LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically create and label references for FP items

Hi all,

 

I hope this is an easy question but I can't find a solution. I would like to create references for all front panel objects and indicators located in Tabs in my application so I can access and control these in subVi's. There are multiple charts/controls/indicators to read/write. The easiest way I can think of to do this would be to select all the items, Right-click and Create References. I can wire all the references to a cluster and I would be able to access these easily in my VI's.


I'm trying to do this programatically using Tab Properties -> CtlsonPage to create an array of references (or convert to cluster?). The issue I'm having is identifying the control & indicators as they don't have unique identification labels so I know which reference to use. Is there a method attaching labels to references so I know which item I am accessing? 


Cheers,
Dave

 

 

0 Kudos
Message 1 of 5
(2,373 Views)

Hi Dave,

 

two notes:

- you can use a property node on each FP reference to read the label of the control

- I suggest not to use ArrayToCluster just to get the elements of an array, use IndexArray (or autoindexing loops) instead!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,363 Views)

Feed each reference to a generic property node (from the Application control palette), then select the Label.Text string property.

You will get "Number", "ON/OFF" or "Chart" depending on the control the reference is related to.

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

The short answer is 'No'.  Because the property "CtlsOnPage" is an array, all elements contain identical label information (all elements of an array must have identical properties (except for Value and Position)).

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 5
(2,336 Views)

Thanks for the help people, I've decided to stick with the "bundle in to cluster" method for now, it requires a bit more work to maintain but it does what I want.


Cheers,
Dave

0 Kudos
Message 5 of 5
(2,315 Views)