LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i draw a table from array inputs?

I want to be able to display on the front panel of an application a table that updates by adding a row at a time that represents some results from a series of tests. There will be no missing columns but am unsure whether the table will always have fixed dimensions or there's some variation in the number of rows, but this aspect is of lesser importance. All arrays come in standard predefined order so i only need to append one element after another.

 

Can't seem to find a combination of VIs that would allow me to get arrays and draw a table. Thanks for any suggestions.

0 Kudos
Message 1 of 6
(1,903 Views)

Maybe something like this is what you're looking for?

Example_VI.png

 

Here I send "new data" using an Event Structure, but you probably have a different source.

I convert my data to a 1D string array (i.e. a row in the table) and then send to a Consumer loop (Producer/Consumer) to append to the Table using Build Array.

Note that of course, the memory usage here is unbounded (because the table can keep growing) - so be careful if you might have a very large number of rows or fast addition of new rows.

 

Stop is controlled through the Queue error, which isn't a good strategy for a real application but is quick for demos 😉


GCentral
Message 2 of 6
(1,878 Views)

Hi Andrei,

 


@AndreiV wrote:

I want to be able to display on the front panel of an application a table that updates by adding a row at a time


A table displays a 2d array of strings. All you need to do is to build such an array by appending new rows each time (using BuildArray)…

 

What have you tried? Where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(1,876 Views)

 

What have you tried? Where are you stuck?


Sorry for my belated response. I was stuck at looking for some sort of container that displays a table in the familiar layout(header + rows). Was looking for something dedicated rather than displaying a 2D array, but that would do it too if nothing else exists in the free version.

 

@

0 Kudos
Message 4 of 6
(1,813 Views)

Hi Andrei,

 


@AndreiV wrote:

Sorry for my belated response. I was stuck at looking for some sort of container that displays a table in the familiar layout(header + rows). Was looking for something dedicated rather than displaying a 2D array, but that would do it too if nothing else exists in the free version.


When you write about "displaying a table" then we think of a table indicator as provided by LabVIEW.

This table indicator also supports headers for rows and columns! And it is dedicated to "displaying a 2D array"…

 

CButcher attached a snippet: have you tried to use it? (Lookup that term in the LabVIEW help.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 6
(1,807 Views)

As Gerd mentioned, the image in my previous post was a "snippet".

 

Although unfortunately it is no longer possible (at least as I tested just now, using Chrome) to drag the image directly from the browser to the block diagram, I was able to click on the image (opening a 'larger' version) and then choose Download in the far right (there are 3 icons, Kudos, Flag and Download. Please don't flag me 😉 ) and then drag from the bar at the bottom of the browser.

 

You need to open LabVIEW (I used 2019 just now) and then create a new VI, and then just drag from the downloads bar into the block diagram. You might need to use alt-tab to get the BD to be visible (since clicking the browser will put it in front of LabVIEW, unless they're not on top of each other because you have a large screen etc).


GCentral
Message 6 of 6
(1,799 Views)