取消
显示结果 
搜索替代 
您的意思是: 

Create refnum for control programmatically

Is it possible to create a reference to a front panel control programmatically?
0 项奖励
1 条消息(共 18 条)
10,265 次查看
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,264 次查看
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,264 次查看

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,005 次查看
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 条)
9,961 次查看

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 条)
9,958 次查看

 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 条)
9,665 次查看

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 条)
9,656 次查看

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 条)
9,648 次查看

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 条)
9,642 次查看