From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Logs data - but keeps writing new data over the old - fix?

V8.2.1 - Currently working on creating a control vi that will record current, voltage, temp data while a pump is on.  After a pump is on for a bit the float switch on the pump will turn the pump off.  The data only needs to be collected while the pump is running. I have it set up, I think, to only collect data when the current being drawn by the pump exceeds a set point control on the front panel.

 

Primarily - It will currently log data but I do not know why it is overwriting the data .  I need it to just log data while the pump is running..

 

Secondarily,   I also would like to figure out how to control the scan rate of collecting data better than just setting the ms timer

0 Kudos
Message 1 of 2
(1,909 Views)

When you open the file on successive iterations of the loop, the file position is set to the beginning of the file: so it overwrites.

 

Fix: Move the Open and Close file functions outside the loop. If you will have long periods between data writes and want to close the file to minimize the risk of data loss in the event of ppower failure, then use Set File Position (Advanced File palette) to set the position to the end after re-opening the file.

 

Lynn

0 Kudos
Message 2 of 2
(1,901 Views)