LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add data to a table?

I am collecting data and want to continually add to my table. How do I do this? I have included an example of part of my VI.
0 Kudos
Message 1 of 7
(3,532 Views)
The VI you have does continously add data to the table (everytime the button is pressed in this case), what's the problem?

If you really wanted a 2D (new data added as rows) table and not the 3D that you are using now (new data is added as new pages)remove the for-loop and replace the indicator with a 2D table.

One word of advice; building tables continously means that memory is also allocated continusly...as the table grows you will quite soon see the performance degrade and the memory usage skyrocket. Unless the number of rows/pages in your table is restricted to a low number I would recommend to initialize the table to the final size right away and then use the replace array elements function instead, then you always work on the same table in memory...If yo
u do not know how large the table will be initialize it large enough to hold the likely maximum of entries...if it could exceed that in some rare cases then add logic that will resize the array in jumps if that happens, it's better than resizing it all the time.
0 Kudos
Message 2 of 7
(3,532 Views)
I must be doing something wrong. My table doesn't change when I press the stop button. I didn't realize I was using a 3D. I am only trying to store the data that is generated each time the case is true, one set of data each time. That is the reason for the for-loop. This example VI is part of a much larger VI.

I tried replacing my indicator with a 2D table, but I have a mismatch in wiring. I don't understand the arrays very well and am not sure what to do. Feel free to alter the example. I would appreciate any help I can get.
0 Kudos
Message 3 of 7
(3,532 Views)
Attached is a VI that perhaps works like you want it to...If the button is pressed when you run it a new row will be added to the table.

I have assumed that the roll number indicator and locals you were using really just were a way to place the new data on the next row..in that case you can use an uninitialized shift register instead (as in the attached VI). If you add a case and a state selector you could make it initialize the first time it is run, that way if you start and stop the VI it will not keep the previous value.

Let me know if this does the trick, if not please describe the purpose of the VI in more detail.

Mads
0 Kudos
Message 4 of 7
(3,532 Views)
I cannot run your VI. I am running Labview 5. Perhaps you have to convert it backwards in order for me to open it.

The master VI is used in a simple mudlogging outfit in an oilfield in Ohio. It records the depth, elapsed time and gas detection readings. There can be several moments between readings.


Thanks very much for your help.

Mdlggr
0 Kudos
Message 5 of 7
(3,532 Views)
Can't convert back to 5.0, but I have attached a picture of the code.
0 Kudos
Message 6 of 7
(3,531 Views)
Thanks for the help. I was able to make this work.
Your version of Labview must have different functions. My Array functions are different. That or I don't understand how to change them.

Mdlggr
0 Kudos
Message 7 of 7
(3,531 Views)