LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to append data to save file without overwriting? Using create file / write to file / close file

Solved!
Go to solution

Well there's no code in the True condition, and the stacked sequence, which has the data collection code inside, is within the false condition. Unless, of course, I'm overlooking a different case structure. The original creator had a rather janky way of doing things.

0 Kudos
Message 11 of 24
(1,104 Views)

As a quick sanity check, just wire a True constant to the case structure to prove that you can write more than one line to a file and determine if therer is something wonky about the conditions that heed to be met.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 24
(1,099 Views)

I'll give that a test once the data collection is over! 

0 Kudos
Message 13 of 24
(1,096 Views)

@etvg wrote:

Well there's no code in the True condition ....

In the code I am looking at, the FALSE case is empty, while only the TRUE case writes to the file. If your's is different, please attach the correct code.

 

ItsTrue.png.

0 Kudos
Message 14 of 24
(1,093 Views)

Also note that you are creating a new unique file with each run, so make sure you are not looking at a stale data file from long ago.

0 Kudos
Message 15 of 24
(1,087 Views)

That's my fault, I thought you were talking about the larger case structure, I am looking at an older version of the code on a different machine and forgot about that case structure to delete the first few rows. Sorry about that. I can completely remove that case structure and see if it works. Only reason that is there is because the function generator acts up and creates false data at the beginning. 

0 Kudos
Message 16 of 24
(1,086 Views)

The code writes to multiple lines by the way, it just won't produce data from multiple data collections. 

0 Kudos
Message 17 of 24
(1,081 Views)

What's your definition of "multiple data collections"? (Successive runs? Successive iterations of the outer loop? Something else?)

0 Kudos
Message 18 of 24
(1,071 Views)

So the innermost for loop within stacked sequence 5 scans resonances of a frequency range defined on the front panel. By multiple data collections I mean scan and record this frequency range multiple times (as well as populate the output file with the frequencies and resonance amplitudes from all the scans). 

0 Kudos
Message 19 of 24
(1,065 Views)
Solution
Accepted by etvg

I am relatively sure I solved this issue by getting rid of the shift register on the "How many scans?" for loop, making the save file subVI refnum and error nodes "last value" to replace the shift registers and deleting the "close file" function. 

 

0 Kudos
Message 20 of 24
(1,057 Views)