LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling at once frequency, but writing data to a file at a different frequency

I'm new to LabView, and have what is probably a simple problem to overcome.
 
I'm scanning 4 LVDT's and one Pressure Transducer at 5 Hz (within my main While loop).  This rate works great as the refresh on the front panel indicators and XY-Graph.  I also want to write my data to a text file, but I do not want to do so on every sample.  Reason - the testing I will be recording will last for several hours and I don't need the data file becoming excessive.
 
I have my VI set up to start scanning on RUN, and I have a separate Boolean to begin "Recording" the data...which triggers the "Enable" input terminal of the Write Data File express tool.  Of course, since this is all in the main While loop, the writing is at 5 Hz.
 
I've tried to nest a timing loop that only controls the data writing, but everything I try ends up slowing down the execution of the main loop.  So, I'm sure I'm not doing the nesting correctly.
 
I would like to be able to specify the "Write Interval", in seconds, on the front panel, so that during testing I can speed up/slow down the write interval as needed, but I don't want to slow down the main refresh rate.
 
Can anyone help?
 
Thanks in advance!
 
_____________________________
Edward J. Garbin, Jr., Ph.D., P.E.
Chief Engineer - Southeast Region

Hayward Baker, Inc.
6850 Benjamin Road
Tampa, FL 33634
0 Kudos
Message 1 of 13
(3,590 Views)
You could hook up a quick conditional to your data write

This way, if your loop is going at 5Hz, you can determine how frequently you want to record.  You can move the control into the loop if you want to be able to do it while running as well.

~milq

Message Edited by Milqman on 03-27-2007 07:56 PM

Message 2 of 13
(3,574 Views)
Thanks for the sample VI.  That was the perfect solution...works great.
_____________________________
Edward J. Garbin, Jr., Ph.D., P.E.
Chief Engineer - Southeast Region

Hayward Baker, Inc.
6850 Benjamin Road
Tampa, FL 33634
0 Kudos
Message 3 of 13
(3,548 Views)
I can't open the vi attached as it was written in Labview 9? Anyone can help me with that? I need that!!
0 Kudos
Message 4 of 13
(3,434 Views)
anyone can help me with that? thank you so so much
0 Kudos
Message 5 of 13
(3,407 Views)
What version of LabVIEW would you like the VI to be in? The attached VI was written in 8.5. I can convert it for you if you'd like. Just let me know which version you need.
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 6 of 13
(3,393 Views)
Labview 8.0 please!!!
0 Kudos
Message 7 of 13
(3,382 Views)
I've attached a screen shot of the VI. The front panel only includes a stop button and the Recording Period control.

Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 8 of 13
(3,377 Views)
I added that conditioner to the while loop, strangely the data recording (through Write to measurement file.vi )still remains the same frequency which is the same as the DAQ assistant, no matter I put it in the Case loop or connect it directly to the write to measurement file.vi's enable port. I've attached some of them with this message, could you please check it for me?
1. the third one sometimes can save the data to a file, but sometimes can't. Besides, the frequency is the same as DAQ assistant.
2. the second one's frequency is the same as DAQ assistant, which is 5000 hz, not 1 hz as I want.
3. the first one seems working, and the first column it creates is the Current Time. However, the parameter is in the format of Second instead of Time/Day/Year.
Thanks a lot.

Message Edited by soundofwind on 10-18-2007 05:25 AM

Download All
0 Kudos
Message 9 of 13
(3,357 Views)
Anyone can help?
0 Kudos
Message 10 of 13
(3,338 Views)