LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp of dynamic data type

Solved!
Go to solution

Given the following simple data-acquisition program.

simple_daq.pngProblem

I understand that the while loop will iterate close to 10 Hz, where f_loop = f_sample/N_samples_per_channel. Every second, the DAQ captures 100 samples for each channel (6 channels in my case), and the buffer size is set to 10 samples/channel, so the computer has to read or empty the buffer 10 times per second to keep pace with the DAQ. I also understand that the while loop won't operate exactly at 10 Hz because I'm running this over Windows. However, I don't understand how the resulting data file has relative timestamps for every single datapoint (first col in picture below). 

datafile.PNG

Does W2M simply use the dt value in the dynamic data type variable to linearly interpolate the relative timestamp of each sample using the timestamp of each loop-iteration? If not, what's going on?

 

I ask because I'm trying to program an equivalent program in Python using NIDAQmx, and I'm not sure how to tack-on the time for each sample in my data arrays. Thanks! 

0 Kudos
Message 1 of 8
(6,036 Views)
Solution
Accepted by aeroAggie

@aeroAggie wrote:

...

Does W2M simply use the dt value in the dynamic data type variable to linearly interpolate the relative timestamp of each sample using the timestamp of each loop-iteration?...


Yup!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 8
(6,023 Views)

Oh, well that's simple enough. Do you think you could answer my second question here?

https://forums.ni.com/t5/Multifunction-DAQ/Loop-timing-with-NIDAQmx-for-Python/td-p/3656140

 

I wasn't getting much views, so I abstracted my first question into this post. My second question still perplexes me!

 

Respectfully,

aeroAggie

0 Kudos
Message 3 of 8
(6,013 Views)

No sir!

 

After I discovered LV this dyslexic jumped for joy and never imagined programming in a text based language again.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 8
(5,998 Views)

Hah! I never realized how much of a boon LV is for dyslexic people. Thanks anyways.

0 Kudos
Message 5 of 8
(5,990 Views)

I don't understand why you even use write to measurement file.vi

 

Simply enable logging in the DAQmx Express.vi


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(5,985 Views)

Initially ignorance (I never knew about logging), but now convenience.

I just tried it, and I faced 2 problems. First, I have to perform 2 conversions: one from tdms => tdms excluding "raw" DAQmx values and another from tdms => another format, in my case .mat. The first conversion (tdms/tdms) strips the time vector.

Also, I come from an academic background, and the LabVIEW bootcamp I attended 2 years ago taught us data-acquisition using write to measurement file. I've been running with it since!

 

PS: Do you think you could answer my other post, here? Question 2 specifically

https://forums.ni.com/t5/Multifunction-DAQ/Loop-timing-with-NIDAQmx-for-Python/td-p/3656140

0 Kudos
Message 7 of 8
(5,972 Views)

Go look

Just a math problem


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(5,940 Views)