LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

separatly data writing to spread sheed from for loop

Hi,

I tried to write my calculating data inside the for loop into a spreadsheet separately. As a result of my calculation, I could only get the last xy data series. On the other hand, I can see all the data on the graph outside the loop. Last time, I encountered an array matching problem (attached files). I will be grateful if anyone could help me.

 

Erdi.

Download All
0 Kudos
Message 1 of 6
(2,295 Views)

You are trying to connect a 3D array to a 2D array input.  Write to Spreadsheet only takes 1D or 2D arrays as an input.  If you want to save all of your data, you could place "write to spreadsheet" inside the loop and you would save a lot of files or perhaps change the tunnel mode to concatenating, which would keep your data as a 2D array.  

Some more info on concatenating tunnels:

https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/autocat_arraysnloops/

 

0 Kudos
Message 2 of 6
(2,262 Views)

Thanks for the help. I changed the tunnel mode to concatenating but now all data saved as one xy data. How can I separate each data sets in the same text file?

 

Download All
0 Kudos
Message 3 of 6
(2,254 Views)

What are you talking about?  You attached a picture where it shows multiple X, Y's saved in the file.

 

Are you running your VI multiple times in a row by pressing the run button?  If so, you want to change that False going into the Write function to a True so it appends new data to the same file.

 

 

You should get rid of that Save Data Path property node.  It serves no purpose other than writing the same value back into the control that it already is.

 

 

0 Kudos
Message 4 of 6
(2,240 Views)

Ok that my mistake, sorry, let me clarify.

 

When I press the run button the .vi calculates multiple times (with rump by delta) my equation. I got the data as attached "data 1.txt", but, I want is to save the X, Y data set obtained from each calculation in separate columns in txt file like attached "data 2.txt".

Thanks.

 

Download All
0 Kudos
Message 5 of 6
(2,234 Views)

Then you'll need to redo your array operations.  Try putting the transpose after the For Loop.

 

And you still need to get rid of that File Save Path property node.

0 Kudos
Message 6 of 6
(2,225 Views)