キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Create refnum for control programmatically

Is it possible to create a reference to a front panel control programmatically?
0 件の賞賛
メッセージ1/18
10,629件の閲覧回数
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 件の賞賛
メッセージ2/18
10,628件の閲覧回数
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 件の賞賛
メッセージ3/18
10,628件の閲覧回数

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 件の賞賛
メッセージ4/18
10,369件の閲覧回数
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
メッセージ5/18
10,325件の閲覧回数

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 件の賞賛
メッセージ6/18
10,322件の閲覧回数

 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 件の賞賛
メッセージ7/18
10,029件の閲覧回数

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 件の賞賛
メッセージ8/18
10,020件の閲覧回数

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 件の賞賛
メッセージ9/18
10,012件の閲覧回数

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 件の賞賛
メッセージ10/18
10,006件の閲覧回数