07-10-2017 02:19 PM - edited 07-10-2017 02:19 PM
Given the following simple data-acquisition program.
Problem
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).
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!
Solved! Go to Solution.
07-10-2017 02:28 PM
@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
07-10-2017 02:34 PM
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
07-10-2017 02:53 PM
No sir!
After I discovered LV this dyslexic jumped for joy and never imagined programming in a text based language again.
Ben
07-10-2017 03:18 PM
Hah! I never realized how much of a boon LV is for dyslexic people. Thanks anyways.
07-10-2017 03:24 PM
I don't understand why you even use write to measurement file.vi
Simply enable logging in the DAQmx Express.vi
07-10-2017 03:58 PM
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
07-10-2017 09:37 PM
Go look
Just a math problem