Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

compare timestamps of two independent reference triggers using counters

Hi,

I'm trying to accurately determine the timestamps of two independent reference triggers.

I have two PXI-6133 cards. Each card is on a different timebase (1 MHz and 2.5kHz). Each have there own reference triggers based on independent analogue voltages. So Card 1 is looking at its ai0 channel for a rising voltage through 200mV. Card 2 is looking for a falling voltage through 2V on its own ai0 channel. Each card has different pre and post trigger samples but the long time base (ie the second card) will be long enough to cover the entire sample time of the first card. Each card is also recording all remaining channels.

I need to know within 0.5 millisecond the timestamps of each of the triggers so I can line up all the signals. The t0 stamp calculated by the DAQmx Read.vi is not accurate enough as it uses the CPU clock and is polled after reading the data and so it drifts as you read data from successive cards.

Any suggestions?

BrissyDrew


Message Edited by BrissyDrew on 07-24-2008 09:09 PM
Message 1 of 4
(4,348 Views)
Hi Brissy,

One way to find the time between the two analog triggers is to use the analog comparison event that is generated when the trigger occurs. Both of these signals can be exported to a counter on one of the boards where a two edge separation measurement can be used to calculate the difference in time. The analog comparison event is an advanced channel which can be accessed when you show advanced terminals in a terminal constant. More information about the analog comparison event can be found in here or in the DAQmx Help file. Once both of these digital signals are on the same board, a two edge separation counter measurement can be used to find the time difference. All of these signals should be able to be routed internally through the PXI system. More information about the two edge serparation measurement can be found here.

Regards,
Kent
Applications Engineer
Message 2 of 4
(4,329 Views)
Hi Tnek,

Thank you very much for the prompt reply to my post. The solution you presented is exactly what I want.

However I am having a little bit of trouble implementing it. I started by loading up one the Labview Examples titled "Meas Two Edge Separation.vi"  (screen shot attached) however it immediately returned at -200431 error which I haven't been able to interpret. Have you come across this error before with the PXI-6133 boards or have I wired up the wrong input?

Regarding the routing of internal signals, just wondering how I select "auxiliary line input" as described in http://zone.ni.com/devzone/cda/tut/p/id/4529  when exporting signals. Attached is a screenshot of the configuration I have now for exporting signals but I am unsure if it is correct.

Any further help would be greatly appreciated.

Cheers,
BrissyDrew


Message Edited by BrissyDrew on 07-27-2008 09:31 PM
Download All
0 Kudos
Message 3 of 4
(4,320 Views)

Hello BrissyDrew,

 

Unfortunately it looks like the PCI-6133 does not support two edge separation measurements--that is the source of the -200431 error.  In order to determine the time separation between your two reference triggers I think you're going to have to use digital lines.  If you route the reference trigger signals to two digital lines and use the 1 MHz clock as the sample clock you should be able to use software calculations to calculate the separation down to +/- 1 us.  It won't be a direct measurement, but the result will be pretty accurate.

 

If you have another data acquisition board (i.e. E or M Series multifunction DAQ) then you may be able to take Tnek's suggestion to do the two edge separation measurement by routing signals to that card.  Otherwise you'll have to monitor these two signals and measure the separation in software.

 

Also, with regards to the aux line, this is a related issue, and likely the reason the two edge separation is not supported on the PCI-6133--the counter aux line is not available on the pinout.  On devices that support this measurement you would see CTR X AUX on the pinout.

 

I hope this helps, and have a great day!

Brooks
0 Kudos
Message 4 of 4
(4,282 Views)