From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS logging + start trigger => wf_start_time incorrect

Solved!
Go to solution

Hi,

I'm reading an analog channel in LabVIEW from an NI USB-6008 device. It is configured to start reading as soon a TTL pulse is received on PFI0 and to log the samples to a TDMS file. See the vi in attachment. The trigger part works fine. Samples are only read after the pulse but the wf_start_time in the TDMS file is not correct. For example, I run the vi, wait 5 minutes to send the TTL pulse, the wf_start_time will be 5 minutes earlier. It will also be approximately 10 seconds later than the time a put on screen (see vi). The problem is that I'm also registering the time of a TTL pulses from, in this case, an fMRI scanner and I want to know which samples matches which scan number. That's not possible now. Am I doing something wrong?

 

Regards,

René

0 Kudos
Message 1 of 4
(2,701 Views)
Solution
Accepted by topic author Rene_Clerckx

Is the time always the wait time too early and 10 seconds later than the time from the sequence structure?

 

My guess (although I don't have hardware currently to test - nice work creating a very simple VI though! 🙂 ) is that the wf_start_time is controlled by the 'Start' function on the DAQmx task (not the first sample time, controlled by the trigger) and that the indicator time is perhaps related to a time-out?

 

If you send the TTL pulse immediately (or at least, within a few seconds) of starting the VI, does the clock time in the indicator get closer to the wf_start_time?


GCentral
0 Kudos
Message 2 of 4
(2,676 Views)

Hi cbutcher,

 

Thanks for the reply, I tried your suggestion and the time is indeed correct when I send the TTL pulse earlier. And it turns out that the DAQmx Read vi has a timeout property that has a default of 10 seconds. My actual program doesn't read the samples, only logs them, so I have to find out where I can alter this default.

 

Thanks for showing me the way!

 

René

0 Kudos
Message 3 of 4
(2,654 Views)

Jumping back in with another untested question - can you just remove the 'Start' VI? I'm not certain how the TDMS logging VI changes the arrangement but it might be that the digital trigger will autostart the task and so you don't need the start VI.

 

In that case, it should be that the TTL pulse that starts the Read will coincide with the start of the read (seems silly as I type it!)

 

Regarding getting a time for the indicator, if that is necessary for your application, you can wire the DAQmx task into a 'Register for Events' node, and you might have some luck with either the 'Sample Clock' (but I don't know if that will trigger every clock cycle, which would be presumably very annoying) or the 'Change Detection Event', but I'm not sure how you'd get this on the PFI0 channel rather than the AI0, which presumably changes all the time. Getting it for the 'Done' signal is easy, but that probably isn't when you want to know the time.

 

I've attached a VI Snippet that shows what I mean, with a 'First Call?' and case structure, but I'd suggest trying it without that first (especially if you need it to trigger more than one time!)

 

daqmxEvent.png


GCentral
0 Kudos
Message 4 of 4
(2,644 Views)