LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving data into a user defined file

LabVIEW,

            I would like to create a program that simply takes a few random numbers and then saves them in a text file. Easy, right? Well here is my problem…. I have my VI setup so that it generates 3 different random numbers every second. I need those numbers to be recorded. My VI currently writes those numbers into an array, and then into a .txt file but it only records one line. And every time the number changes that line is just replaced with the 3 new numbers. It should be adding a new line with the updated numbers.  

 

The screen shot I have attached includes a feedback node, which I used to get the array to include more data, however it does not display the data on the next line…

Without the feedback loop the code operates as stated above.

 

Any thoughts?

0 Kudos
Message 1 of 7
(2,580 Views)
Hi kd5pff,
i cant´t open your vi, but you can use the "Write to Spreadsheet File" function with the option, append data.

Hope it helps.
Mike
0 Kudos
Message 2 of 7
(2,579 Views)
Your VI has no function for writing to a file so that might be part of your problem.Smiley Wink
0 Kudos
Message 3 of 7
(2,576 Views)

crap i just attached the wrong file... im not sure where my mind was.. thanks for the heads up... here is the actual jpeg. of my VI.

0 Kudos
Message 4 of 7
(2,572 Views)
What is the purpose of the shift register? It's counting for no apparent reason. If you want the loop count, just use the "i" terminal.

I can't quite figure out what you're trying to do with the Feedback Node. I'm guessing you're not properly using it. Check the LabVIEW Help on how this node works.

Also, you should be using the Build Path function to create your paths rather than strings.
0 Kudos
Message 5 of 7
(2,559 Views)
In addition, you need to read the help for Write to Text File. It says that if you wire a path to it, it will always overwrite the existing content. If you wire a file reference to it, you use the Set File Position to point to the end of the file first. Using Write to Spreadsheet with append to file set to T will also do what you want.
Message 6 of 7
(2,553 Views)
Thanks for the tips and pointers... changing the append to file setting worked perfectly...
0 Kudos
Message 7 of 7
(2,528 Views)