LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

same property for many controls

Hello!

 

How can I apply the same property to many controls with the same typedef? Can I apply the property tp typedef directly?

I have any buttons (starting and stopping tests, for example), and I'd like to disable and gray out all of them, and then enable someone. I wouldn't like to use arrys, because the number of tests, and, of course, buttons isn't constant and may be exestented in future.

 

How can I make it? Properties for typedef? Or using user class and its metods and properties?

 

WBR, Igor

0 Kudos
Message 1 of 10
(3,510 Views)

Hi Igor,

 

"I wouldn't like to use arrys, because the number of tests, and, of course, buttons isn't constant and may be exestented in future."

Your reason not to use an array is the perfect argument to use an array of control references. Think about it...

 

"Can I apply the property tp typedef directly?"

No.

 

"Or using user class and its metods and properties?"

What is a user class?

Best regards,
GerdW


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

"What is user class..."

I meant a class, consisting of those same-type controls...

0 Kudos
Message 3 of 10
(3,501 Views)

Hi Igor,

 

a class (in an OOP context) is a bundle of objects (or: data items). It's not related to any controls or type definitions...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,497 Views)

Thank you.

I don't an "big" OOP programmer, I'm en electronics engineer, and my programmer's exeperience is very small. But now I must to write a big testing program and having some problems with it. 🙂

 

P.S. I'm very sorry for my English. 🙂

 

WBR, Igor

0 Kudos
Message 5 of 10
(3,493 Views)

Correct me if i am wrong but it sounds like you are talking about Vi Server class for properties. When dynamically working with several items, assuming you are working with a property that is common to all controls, you can use the generic GOBJECT->CONTROL class property node. A for loop can then go through each object found on the front panel in question and apply the property you want. I am not really good at explaining things which is why i included a demo.  

0 Kudos
Message 6 of 10
(3,480 Views)

Yes, I'm talking about it.

But "GOBJECT -> CONTROL" is a generic class, consists of all controls. Can I describe a bit more specific VI server class, with manually included controls? For example - all of buttons "start 1st test", "start 2nd test",..., "start Nth test", but not "start all tests automaticly"?

0 Kudos
Message 7 of 10
(3,453 Views)

Hi Igor,

 

From what I understand you are looking for a way to grey out a subset of controls on your front panel. The demo posted by iBeTheMarc was a great first step, although it grayed out all of the controls on your front panel. I have adapted that example a bit to grey out only the "odd" Boolean controls on the front panel.

 

To do this, I used a cluster to group together all of the controls on the front panel that I wanted to grey out. I then applied an implicit property node to that cluster, and then used a for loop to change the property of each control in that cluster (just like in iBeTheMarc's demo).

 

I've attached my code below. Let me know if this is what you were looking for!

 

Courtney L 

0 Kudos
Message 8 of 10
(3,417 Views)

Also -- this NI Developer Zone article might be of help. 

 

http://zone.ni.com/devzone/cda/tut/p/id/3159

0 Kudos
Message 9 of 10
(3,415 Views)

You may want to look over the images in my "GUI Controller" collection found here.m Those images illustrates how I address simialr challenges.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 10
(3,412 Views)