11-11-2011 05:12 AM
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
11-11-2011 05:26 AM
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?
11-11-2011 05:41 AM
"What is user class..."
I meant a class, consisting of those same-type controls...
11-11-2011 05:43 AM
11-11-2011 05:56 AM
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
11-11-2011 09:08 AM
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.
11-14-2011 12:09 AM
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"?
11-14-2011 01:04 PM
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
11-14-2011 01:05 PM
Also -- this NI Developer Zone article might be of help.
11-14-2011 01:10 PM
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