LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp is automatically rounded (or jumps)

Hi.  For some reason, in the attached VI, the timestamp that is generated is always rounded to the nearest 0.15625 seconds.  It's an odd value to be rounding to, especially when it shouldn't be rounding at all. 🙂  The attached zip file has the main VI with two subVIs (which I don't think are involved in this, but which are referenced from the main VI) along with a data file where the first column is the timestamps that are generated.

 

If it's relevant, I'm using the USB-6251 DAQ board.

 

Thanks!

Jeremy

0 Kudos
Message 1 of 7
(3,069 Views)

What I find a bit odd is how you are getting the timestamp. You could simply get a waveform data type and have the timestamp from DAQmx.

 

Since you did not include the code that writes the data to file, it's impossible to say where the problem might be. You might be using the wrong format string when you do the write.

0 Kudos
Message 2 of 7
(3,061 Views)

Hmm...I tried the waveform thing and have a different issue...all the data is listed as coming in at regular intervals not at the correct rate and not for the full amount of time.  In other words, the first timestamp is correct, and then all the other timestamps are in multiples of exactly 40 microseconds.  All the data is there, just with the wrong timestamps.  Could it be because I'm output the waveform as an array?   See the attached.

 

As for the data writing, I didn't put it in because it was quite complex with analysis and all.  You can use a probe and the same thing is true for the timestamps.

 

Thanks for your help,

Jeremy

0 Kudos
Message 3 of 7
(3,052 Views)

I'm not sure I think there is any problem. It appears that you are doing a triggered acquisition. When the trigger occurs, you get x number of samples with 1 timestamp for t0. When the trigger occurs again, you will get x number of samples again with a new t0 timestamp. Is my understanding correct? If so, then what exactly is incorrect? Does the trigger happen about every 40 microseconds?

 

If you want to assign a unique time to each sample, then you would have to take the t0 and calculate the subsequent times from the dt.

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

Sorry, I don't think I explained myself correctly last time.

 

If you take a look at the VI attached in my previous post, the front panel controls the acquisition rate (default 250 kHz) and the number of samples to record after each trigger (default 10).  The DAQmx Read VI is called each time the 10 samples are read to read them into the computer as a waveform.

 

After outputting all of the waveforms as an array and looking at the t0 for each, the t0 values are not what they should be.  Instead, they are separated by exactly 4x10^-5 seconds.  That would be correct if there was no pause between triggers (reading 10 samples at 250 kHz takes exactly 4x10^-5 seconds).  But when reading in triggers that occur 10 times a second, the t0 values should be separated by 0.1 seconds, right?  Well, clearly not "right" because otherwise I wouldn't be asking this question 🙂

 

Thanks for your help,

Jeremy

0 Kudos
Message 5 of 7
(2,997 Views)

Put differently, does setting the DAQ board to "retriggerable" stop the internal timer while it waits for the next trigger?  Is there a different way to go about it?

 

Thanks,

Jeremy

0 Kudos
Message 6 of 7
(2,970 Views)

I decided this was a different topic, so I started a new thread: http://forums.ni.com/ni/board/message?board.id=170&thread.id=424055

 

Jeremy

0 Kudos
Message 7 of 7
(2,943 Views)