LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create refnum for control programmatically

Is it possible to create a reference to a front panel control programmatically?
0 Kudos
Message 1 of 18
(8,906 Views)
You can open a reference to a VI and from that get an array of all the controls on the front panel, is that what you mean?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 18
(8,905 Views)
I will attach a VI that retreived all front panel controls through Open VI reference. Hopefully this is what you were looking for. I will attach it in LabVIEW 6.0 version
0 Kudos
Message 3 of 18
(8,905 Views)

What if the control is inside a tab?

I have most of my controls inside a tab and the property node of Controls for pane does not return those controls.

 

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 4 of 18
(8,646 Views)
You need to take the Tab refnum and connect it to a property node to get the refnums of the controls on the Tab. From memory I do not recall whether that works page by page or gets all the controls on the tab. Similarly, you can get references to the controls in a cluster or the digital display(s) of a knob... Messy, but useful.

Lynn
Message 5 of 18
(8,602 Views)

To calify Lynn's reply

Tab ref >>> Pages >>> controls on page

And to update the original thread...

FP >>> Panes >>> controls

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 18
(8,599 Views)

 What should I do if I want to get programmatically a control reference, and set his increment.

Do I have to iterate all the FP.controls[] ?

Example: When I click one of the buttons labeled "Multiplier x" (x=1,2,3, etc...), I want to change the "increment" property of another control labeled "Value x" (x=1,2,3, etc...).
See figure, confirm if there is better solution (that is *direct* access to a control reference by naming its label)
Thanks

0 Kudos
Message 7 of 18
(8,306 Views)

I think what you are showing will work.  I do not know of any way to get the direct access you asked about.

 

What is your concern about this approach?  The time it takes should be insignificant compared to the speed of the user, even if you have many controls on the panel.

 

Lynn 

0 Kudos
Message 8 of 18
(8,297 Views)

Indeed it's not working as I imagine because I just discovered there is no property access to "limit".

Even if it worked, it is suboptimal! 🙂

 

 

 

Clipboard01.png

0 Kudos
Message 9 of 18
(8,289 Views)

Take a look at this Nugget on using Control references. When you cast the reference as the proper type, you can access the properties of the widget. Here is a preview.

 

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 18
(8,283 Views)