LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arrays to indicators in huge number

Hi,

I have an array that contains 120 elements in it, now I want to show 80 values from that array in the front panel with separate indicators for each value. I can use index array but that would make my code very big, I want some simple solution for it. Does anyone have any idea on how to do it? 

0 Kudos
Message 1 of 9
(2,737 Views)

Hi rk,

 


@rk0001 wrote:

I have an array that contains 120 elements in it, now I want to show 80 values from that array in the front panel with separate indicators for each value. I can use index array but that would make my code very big,


Having 80 individual indicators in the frontpanel also means to have 80 individual terminals in the block diagram: why do you worry about a single IndexArray node in the blockdiagram???

 


@rk0001 wrote:

I want some simple solution for it. Does anyone have any idea on how to do it? 


IndexArray is the simplest way to get the array elements…

 

A somewhat scalable way would be to label all of those 80 indicators in a very distinctive way like "arraylabel#000" (where "000" is the index of the corresponding array element). Now you could use the frontpanel reference to get references of all frontpanel elements, filter for the indicator references, use their label to get the corresponding element from the array and then set their value using a "value" property node. (Keep in mind: you can always show a different caption instead of the label.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,727 Views)

There are certainly use cases for this. However, can be a terrible way to get things done.

 

I hope you know what you're doing.

 

 

Create one indicator, label it "Something 0".

Copy it to, to get "Something 1"

Copy it to, to get "Something2"

Copy it to, to get "Something3"

Copy those 2 times, to get 8, copy those 10 times to get 80.

 

Now, use VI Server to get references to those controls, and to set their value:

VI Server Control Values.png

 

Obviously, you can get the references from controls on a pane, a tab page, a cluster, etc.

 

If you cast the control references to the specific type of reference, you loose the variant.

 

EDIT: Use "Something [0-9]+" in stead, \d only works in a reg.ex, not a match pattern.

0 Kudos
Message 3 of 9
(2,724 Views)

wiebe@CARYA wrote:

There are certainly use cases for this. However, can be a terrible way to get things done.

 

I hope you know what you're doing.


To elaborate a little.

 

I have panels with configuration items where I get\set values by reference. I definitely don't want to wire dozens of terminals and locals manually.

 

If the configuration name doesn't suit you, show the caption to the user, and use the label in the diagram.

 

Also have a few situations like yours. A few dozen indicators. So why not use an array? Customer want to set individual properties of the items (sometimes incl. position), and in an array there's only one control type, so you can't change properties of individual items. Values not included of course.

 

I do put these items in a cluster when possible. However, if several clusters have overlapping regions on the front panel, the front most cluster blocks clusters behind it. Viewing the items isn't a problem if the cluster is transparent, but mouse interaction is blocked.

 

So, I won't say you shouldn't do it, but there are consequences to this technique... For instance, the value property node is in sync with your screens refresh rate. This makes it slow. For 80 items, I wouldn't worry about it too much, but it's a concern.

 

0 Kudos
Message 4 of 9
(2,717 Views)

As already suggested, put your indicators in one (or more) cluster. Then use Array To Cluster to set in a single node (or as many nodes as the number of clusters). This is a lot easier especially if your source values are grouped together, that is if values to be shot into each cluster are adjacent in the array, allowing you to extract them by Array Subset.

 

pincpanter_0-1640266519236.png

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 5 of 9
(2,681 Views)

While the solutions mentioned are good, I think all of us need to know what your use-case is for having 80 separate indicators. It's not clear as to why you need so many.

 

Can you elaborate?

0 Kudos
Message 6 of 9
(2,677 Views)

Just reshape it to a 2D array and show that. Make it 6x20 and show 4 rows.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 9
(2,671 Views)

@Yamaeda wrote:

Just reshape it to a 2D array and show that. Make it 6x20 and show 4 rows.


I would go one more step and use a table indicator. Now you can even do some custom formatting or at least guide the eye by various background tints.

0 Kudos
Message 8 of 9
(2,651 Views)

@altenbach wrote:

@Yamaeda wrote:

Just reshape it to a 2D array and show that. Make it 6x20 and show 4 rows.


I would go one more step and use a table indicator. Now you can even do some custom formatting or at least guide the eye by various background tints.


That just wouldn't work for e.g. a P&ID.

6d58cc74d0c0b55dca45ebcb234b11345b50303b_2_1023x662

0 Kudos
Message 9 of 9
(2,641 Views)