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: 

Measurement to file appends data need to overwrite

Solved!
Go to solution

I am currently trying to collect 10 second increments of 3 voltage tasks using DAQ assist and then save each segement to its own file using the write measurement express VI. The data collection VI collects 10 seconds of data, filters them and outputs them through charts. When I try to save them however, it saves the previous trials data to the end of the new file. I have tried clearing chart and graph data and tried the "save to series of files" option but nothing is working.

 

In summary:

Collecting Data through DAQ data assist

Each collection takes 10 seconds of data

Each save should only have 10 seconds of data

Currently saving new data along with old

 

LabVIEW Version 13.0.1

Download All
0 Kudos
Message 1 of 8
(3,501 Views)

On the Write Measurement File, there is an input called "Reset"  set that to TRUE.  With your current settings, that will rename the file and give you a new file for the current data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(3,490 Views)

Unfortunately, after adding the true constant wired to the write to file express VI,  when I run a second trial, the file saved still has the new data appended to the old one.

0 Kudos
Message 3 of 8
(3,484 Views)

The detailed help page for the Write Measurement to File VI says that it ignores the reset wire on its first call. Is it possible that I have it set up where it thinks its on its first call when it isn't so it never resets?

0 Kudos
Message 4 of 8
(3,444 Views)

The problem isn't saving new files, it is with the data collected. Each time it runs, it adds data to the wire. Is there a way where I can clear the data from the wire after the loop stops?

Attached is an image of the collection VI as well as the DAQ settings. Also attached is the VI itself.

 

Again, a summary:

I am trying to collect ten seconds of data and then save each segement to a file.

New data is appended onto old when and I cannot figure out how to fix this. 

 

Download All
0 Kudos
Message 5 of 8
(3,433 Views)
Solution
Accepted by topic author ajs814

I don't see any code writing to a measurement file.

 

You talk about "adds data to the wire".  Are your referring to those "Collector" Express VI's?  They are doing exaclty what they are supposed to.  If you want to clear the data out of them, then wire a True boolean to the Reset input.

Message 6 of 8
(3,417 Views)

Sorry, the writing to measurement occurs in the upper level VI which was part of the zipped folder I attached in my first post (newer version attached here). The collectors are used so I can gather the whole 10 seconds of data at once to send out of the subVI. If I wire a true constant to the collector, I only get one sample to send out at the end. If I use the first call? function, it still keeps the old data from the previous trial.

0 Kudos
Message 7 of 8
(3,397 Views)
Solution
Accepted by topic author ajs814

I've figured it out! Finally. I created my own "first call" case diagram so it returns true the first time the loop is run, resetting the collector VIs and returns false until the loop is started again. Thank you guys for your ideas

0 Kudos
Message 8 of 8
(3,390 Views)