LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Record time of digital trigger

Hi I'm acquiring an analog signal by sampling it on occurance of an external digital trigger. I'm using the PC 6251 and Labwindows CVI.
I would like to record either the absolute or relative time of the digital trigger with ms resolution.
 
-Charles
0 Kudos
Message 1 of 7
(4,298 Views)

Hi crdust,

The best way to accomplish this task is to take the absolute time, as the digital start trigger will start the sample clock. The difference in time between the trigger and the sample clock starting is default to two clock periods (which can be much less than the ms range if you are running fast enough), but can also  be changed using two property nodes: DAQmxSetTrigAttribute (Start >> More >> Delay) and (Start >> More >> Delay Units). The minimum delay for m-series is 100x10^-9 Seconds.

Regards,

David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 7
(4,268 Views)

Thanks David. Is there an example for this.

 

-Charles

0 Kudos
Message 3 of 7
(4,263 Views)

An example of data acquisition using a digital trigger can be found in the shipping examples ( Help >> Find Examples… >> Hardware Input and Output >> DAQmx >> Analog Measurements >> Voltage ) ContAcq-ExtClk-DigStart. You can change this to use the internal clock if that works better for you.

To get the starting point, we can call the CVI function ‘GetSystemTime’ (Utility Library >> Date / Time) just AFTER calling the DAQmx read, which will return the system time in the format seen below.


 

We want to call this after the DAQmx read because you are using a trigger, and this will cause the DAQmx read to wait until the trigger has been tripped. An example is if the program starts running, but the trigger does not trip for 2 minutes. If we had put the 'GetSystemTime' before the DAQmx read, it would be 2 minutes early. By putting it after the GetSystemTime, we will read the current time and can subtract the amount of time it took to collect the samples (# samples x sample rate) to get our original time stamp.

The ‘Waveform timing limitations’ in the NI-DAQmx C Reference Help (Start >> Programs >> National Instruments >> NI-DAQ) has more information about how DAQmx calculate the t0, and why we need to do the calculation this way.


Message Edited by David L. on 09-05-2007 02:15 PM

Message Edited by David L. on 09-05-2007 02:20 PM

David L.
Systems Engineering
National Instruments
Download All
Message 4 of 7
(4,249 Views)
Has anyone been able to circumvent the problem with t0 as described under the labview help heading "Waveform Timing Limitations" ?

The reason I'm asking is that I need need to know the timestamp within an accuracy of 500 microseconds. Normally I'd synchronize the channels however one of my cards needs a separate trigger and so synchronization is not an option.

So I guesss I need to record the sample clock along with the channels. Any thoughts?

I'm using PXI-6133 cards with Labview 8.2 by the way.

BrissyDrew


Message Edited by BrissyDrew on 07-23-2008 12:49 AM
0 Kudos
Message 5 of 7
(3,984 Views)

Hi BrissyDrew,

You can still synchronize your channels to a single clock and have one of your cards be triggered, just realize there is only one analog comparison event circuit on the board if doing analog triggering.

As far as getting time information, have tried leveraging the onboard counters? You can count an onboard, high speed, timebase and therefore get a high resolution clock to reference when your trigger comes in.

I would also recommend creating a new thread as this thread hasn't had any action in 10 months. This would make your question more visible to the community which would probably bring in more responses.

PBear
NI RF
0 Kudos
Message 6 of 7
(3,955 Views)

Thanks PBear for your reply to my post. Looks like using counters is the way to go so thank you for leading me in that direction.

I've created another thread with more information regarding my requirements  here.

Kind regards, BrissyDrew



Message Edited by BrissyDrew on 07-28-2008 12:20 AM
0 Kudos
Message 7 of 7
(3,933 Views)