LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing issues on 2 DAQmx Task wrt to Write to Measurement File

hello every1, i am trying to write 2 seperate files at 2 different frequencies using 1 DAQmx AI vi. I am using a Resample Waveforms.vi to resample the input AI into 2 seperate frequencies. I am also saving the RPM data from a mag pickup using freq input on USB-6229.

 

The problem is, when i initialize the max input sampling from DAQmx to 10hz, and the minimum sampling rate at which data is written to file is 2hz, i observe in the excel that i have data at 0.5sec, then i have 2-3rows of junk values, data at 1sec, another 2-3 rows of junk values... and so on...

 

why do i have this/ any idea? is it because the input data sampling rate is 10 and then I am stepping it down at 2hz using the 'Resample Waveforms.vi' below is the sample...

 

Time(s) Voltage1 voltage 2
Voltage 3
19:51.5


0 377.3304 1856.257 1934.39
19:51.9


0.5 395.7867 1837.126 1951.939
19:52.3


19:52.5


1 402.7624 1843.206 2016.952
19:52.8


1.5 396.6137 1889.137 2028.533
19:53.3


19:53.5


2 402.3852 1886.627 2013.197
19:53.8


2.5 410.2069 1926.095 2057.378
19:54.3


19:54.5


3 413.9997 1961.468 2094.644
Now on LabVIEW 10.0 on Win7
0 Kudos
Message 1 of 8
(2,756 Views)

Did anyone figure out about my problem yet?? I am assuming anyone who uses Resample Waveforms.vi and writes data to the file would have similar problems...

 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 2 of 8
(2,745 Views)

How are you writing it to file? Post a clip of your code if you can.

 

Eric

0 Kudos
Message 3 of 8
(2,740 Views)

i dont the computer which runs labview with me now, but here is what i am doing, i am collecting the Nchannel 1sample AI waveforms at 10hz in a while loop.

 

Then, i have a case statement, in which we can set this AI to any sampling rate we want.

 

I have taken the step-down sampling rate to 2Hz.

 

After the "dt" is set, I am using "Resample Waveforms.vi" to produce 2Hz output waveforms. this waveform is then passed into Write to Measurement.vi, wherein i have tab limited,no headers, 1 time column settings in it.

I know i have mentioned a mag-pick up channel as well in 1st post, but temperarily I am not saving that data into this file. I am using a standard measure frequency using 1-low frequency counter example VI to measure RPM.

thats all the code does. i hope you should have an idea what I am doing.

 

thanks

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 4 of 8
(2,737 Views)

here is the snippet of the code

check the attached file...

 

another thing about the writing to file... I have included a time stamp in the "comment" section of the write to measurement file.vi

 

if i remove that comment, i observe there is no discrepancy in the data file... However, I would like to have the timestamp in the data file i write.

 

PLease help

untitled.JPG

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 5 of 8
(2,730 Views)

I'm not sure what's happening in the false case of your code, but look at the example I attached and see if that's what you're trying to do. It's timestamping and the timestamp changes when you resample.

Message 6 of 8
(2,718 Views)

egraham, the code does produce a time-stamp in decimal, and changes the delta t between the time stamps.. however, i would like to have a real time time stamp, like hr;mm;ss;ms as a column,

if i add that to the comment column, everything messes up...

 

did you observe this at your end as well???

 

 

thanks a lot for the code... it did reduce lot of my worries 🙂

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 7 of 8
(2,711 Views)

I see what you were trying to do. I don't think the Write to Measurement File express VI works that way where you were trying to insert a new timestamp as a new comment on every data point. Have you considered using the basic Write to Text File VI instead? You would have more control over the text file this way as opposed to using the express VI.

 

Eric

0 Kudos
Message 8 of 8
(2,696 Views)