LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read out more than 1 number

Solved!
Go to solution

Hi,

 

I am currently working on a code for some scales that reads out the weight and saves it on a .lvm file. The program works as it should except for saving it to the .lvm file. The program only saves the last number before I click stop, ex last number read is 6.03 kg, only data saved is 6.03 kg. What do I need to do to make the file save all the points of data rather than just saving the last data point? Attached is the part of the code for the read out, it is the string to write to text file vi.

0 Kudos
Message 1 of 2
(2,306 Views)
Solution
Accepted by topic author wolfgang2021

Open the file before the loop and write data inside the loop using the refnum from the open. with each call, it will write at the current file position, which is right after the previous write operation. Close the file after the while loop, again using the same refnum wire (make sure it goes through all cases!).

 

If you wire a path to the write primitive, it will open the file and close it afterwards, thus it will not append but start fresh with each write (unless you also set the file position).

 

Did you look at the help? Read the part about the "file" input connector.

Message 2 of 2
(2,300 Views)