LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving column in a table

Hi all,

 

I'm measuring different curves and want to place their values in a table. Went I use "active sell" it take a lot of time because they’re a lot of points. So I take the values and set them directly in an array (what goes immediately). The problem is now that I want to take the values from the array (column) and set them in a table in the column that I want. The result must be like this: in the first column the values from curve one, in the second column the values of curve two, … How can I that?

 

Thanks

0 Kudos
Message 1 of 7
(3,388 Views)

It will be easier to help if I'm clear on what you want.  My understanding is you'll create a 2D array where each column, or row, represents one set of data points.  After all of the collection, you want to change your array into a table.  But, I'm not sure what you mean by "I want."  That decision could come at edit time and be very static, easiest solution, or could come at runtime and be far more complex.  Which are you looking at?

0 Kudos
Message 2 of 7
(3,366 Views)

It sounds like you might be thinking of a SpreadSheet Array (judging by your use of the term "active sell", which I take as meaning "active cell").  This is a 2D array of data that can be saved to disk as a .CSV (comma-separated values) file, and read back from such a file.  Such file formats can also be read by Excel (hence the term "active cell").

 

If you want to use a LabVIEW Array to hold all your data, you need a 2D array.  You talk about measuring "different curves" -- are you getting the same number of points (measurements) from each curve?  If so, you can easily combine multiple "measurement Arrays" (1D, the measurements from a single curve) into a 2D array (I assume you know how to use Build Array or Insert into Array to do this).

 

If you want to be able to move data columns around so that you can "look at the data" with different orderings, there are multiple ways to do this.  One is to simply create another "Table" Array, and fill it, column-by-column, with the chosen columns from your Measurement Array.  For example, if you wanted to see Columns 2, 4, and 6 by themselves, you could (in a For Loop) extract (using Index Array) columns 2, 4, and 6, and pass them out of the For Loop in a Indexing Tunnel.  Of course, the extracted 1D arrays will be combined by the indexing output tunnel as rows, but you can simply "Transpose 2D Array" to change them back to columns.  [I'm deliberately not including a Block Diagram here -- this is simple if you know anything about LabVIEW Arrays, so you should just spend 3 minutes and write a little demo program with a 3x3 array of numbers and try to do this yourself.]

 

Bob Schor 

Message 3 of 7
(3,345 Views)

I’ll explain you more in detail what I want to do. In the annex, you can find one of the curves that a measure. In the VI is take every single value and I place them in the table. When I read a new curve, I want that the values came in the second column. So, that they do not erase the first measures. It works fine if I use Set Active Value (Invoke Node). But There are so many points that I take to many times when I got a lot of curves. So, I find out that I can use an array of the curve. But I can’t keep the values and place them in the column that I want to. I hope you understand what I mean. Sorry for my English.

0 Kudos
Message 4 of 7
(3,338 Views)

Attach your VI.  I want to see what you are doing.  Where are these data coming from?  Are you always dealing with the same number of data points?  Why are you putting them into a Table (which, I take it, is a LabVIEW Front Panel Table indicator)?  If you put them into an Array Indicator, you could have scroll bars, and getting the data in and out (as I described) would be pretty quick.  Do you really need to look at all those numbers?

 

Since you are fairly new to the Forums, you might not have seen my many posts saying Do not attach pictures of code.  I really dislike looking at PNGs in this Forum, as they don't tell me the details that I need in order to make a proper response, so I waste my time asking the Poster to please attach your VI.  I promise not to look at any more PNGs you attach.

 

Bob Schor

Message 5 of 7
(3,326 Views)

One thing to consider: It is almost always easier and faster to add rows to an array or to a file than to add columns. This is because of the way array data is stored in memory or in a file. If you need it in columns, first store it in rows and then after all the data collection is finished, use Transpose 2D Array to get the configuration you want.

 

Lynn

Message 6 of 7
(3,302 Views)

I can't give you the exact data I use so I made a simulation to explain my problem. Please find attached my VI.

0 Kudos
Message 7 of 7
(3,278 Views)