LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

An easier way to save the data

Solved!
Go to solution

Hi ,

 I am generating some arrays which I like to save them in a row and since they are inside a loop a matrix will be created.

I do have a method how to do it ( attached is my  sample program). The problem is that  I have to take every value and wire it and it has really become a pain, since the program is growing.

Can anyone suggests an easier way, well it does not have to be the type I have chosen,  excel file is OK.

 

Thanks a lot

0 Kudos
Message 1 of 8
(3,528 Views)
Solution
Accepted by topic author helaka

Don't use the array to cluster.  That is not scalable and you would have to create dozens to hundreds of wires.

 

Look at array to spreadsheet string like in the picture.  Now your example wasn't clear on what order you wanted things wired, or what format you wanted the numbers converted to in the string.  So you may have to rework the delimiters (tab by default) and the format string.  But the picture should give you the idea.

Message Edited by Ravens Fan on 10-09-2008 11:56 PM
0 Kudos
Message 2 of 8
(3,515 Views)

Hi Ravens Fan,

 

Thanks again for the help. I appreciate it. Well I do not want to take advantage of it, but I have an other question, is there a way to name this columns created so when I extract them in Origin I know which column is which, since the number of them now has reached to 40.

 

Thanks,

 

Helaka

0 Kudos
Message 3 of 8
(3,471 Views)

I'm not sure what you mean by "Origin".

 

With the columns, how do you determine now what the names are?  If you have a string array of names, you could take the string array and convert to a string using the same function.  The format string would probably be %s.  Do this a single time to write the column names to the same file prior to the for loop.Smiley Happy

0 Kudos
Message 4 of 8
(3,463 Views)

Hi Ravens Fan,

 

Well,  Origin is a software which you can use to plot the data.

As for the suggestions, I tried them and I needed to do some slight changes in order for it to work.

Attached is the program.

 

Thank you

0 Kudos
Message 5 of 8
(3,446 Views)

OK, you're still doing this very inefficiently and convoluted:

  1. I would concatenate the two orange arrays using "built array(concatenate mode)" and then use "array to spreadsheet string" directly.
  2. the "%6.7fg" format has no meaning, because you are dealing with an array of strings. Wire the DBL array directly to the input and the format will be applied.
  3. Typically, you want to use lowlevel file IO functions: open the file outsde the loop, wire the fileref across the loop and write the new data, close the file after the loop. Currently, you open and close the file with each write operation, an expensive method.
0 Kudos
Message 6 of 8
(3,439 Views)

OK, here's a slightly cleaned up version:

 

 

(Of course we assume that the arrays change with each iteration, else we would do their prep outside the loop, of course.)

Message Edited by altenbach on 10-10-2008 12:30 PM
0 Kudos
Message 7 of 8
(3,430 Views)

Hi altenbach,

 

thank you for your suggestions.

 

Helaka

0 Kudos
Message 8 of 8
(3,397 Views)