I am using a VI which receives some variables and I'd like to save them all in a text file.
I would like to have a row to be added for each iteration of my while loop so that I would get, say:
first line: 2500.000000, 2502.000000, 0.000000, 2529.000000, 2488.270176, 2551.494700, 4704, 423564, 57.303482, 2016-11-10 15-38-42
second line: 2500.000000, 2502.000000, 0.000000, 2529.000000, 2488.270176, 2551.494700, 4704, 423564, 57.303482, 2016-11-10 15-38-42
So far I've managed to save my variables in that text file, but the format of saving is not really ideal (not displayed in line, and each iteration saves the new values + everything that has been saved during the previous iterations...)
I've attached an example of output as well as my current VI
but the format of saving is not really ideal (not displayed in line
Because you have it programmed this way: each ArrayToSpreadsheetString will add a CR/LF…
and each iteration saves the new values + everything that has been saved during the previous iterations...)
Because you have it programmed this way: you collect your data in arrays and each time you save the content of those arrays into your file…
Collect only the values of the next line in an array and use ArrayToSpreadsheetString only once per line of text…
The problems are in your shift registers. You are building the individual values into multiple arrays, then combining them all together.
You shouldn't need any shift regsiters. Just combine the various data coming into a single string. Write that string to the file.
You didn't attach your VI, just a picture of your block diagram. Otherwise it would be easy to fix.
The picture is actually a snippet.
I'll try your solution.
I'm sorry, you are right. It is. I didn't notice the header information at the top of the image.
Attached is a modified VI. I cleaned up a lot and used Format Into String to simplify the combination of the data points.
Note, you will need to debug it. I know a couple things broke such as where data was accumulated. So you may need to add a shift register or two back in and fix where the data is coming from. (I just added the constant of 0 to them.)