03-07-2014 09:02 AM
Hello,
It has been a while since I did Labview coding so there are some things I dont remember that good anymore. The question is simple I ques I want to make a button disabled when the program is running and do this in a subvi. Well that is simple found a lot of examples but I am missing the point how to create the boolean refnums in a cluster as in the picture below. The refnums-cluster is in the middle (vertical) of the left (horizontal). I tried to create a refnum this way: click the button Create->reference but the picture is not the same as below and if I try to put the reverence I made in a cluster It simpely disapears in the background of the cluster. Think I am missing something very simple but I am looking for hours now so I hope you guys can help me out and tel me what I am doing wrong. The exeample is a standard exeample called: "continious measurement and sampling"
Hope you can help thank you!!
03-07-2014 10:02 AM
Drop a "Class Specifier Constant"
Than right click select
Select VI Server Class>Generic>GObject>Control>Boolean
03-07-2014 10:15 AM
03-07-2014 10:22 AM
thank you very much Omar!! There is still a part I do not understand though.
How do I link the Start, stop and other buttons to the bolean. In other words how do I get what is in the help screen in the code....
03-07-2014 10:24 AM
You have to do something like Ben64 showed you.
03-07-2014 10:28 AM
Thank you Ben64 this seems to work !!!! I am going to test the code thank you !!!!
:-)))
03-07-2014 11:46 AM
strange it doesnt seem to work, the example has got the text CTL in the property node and my code has got the text "bool" in the property node.. what am i doing wrong?
03-07-2014 12:09 PM - edited 03-07-2014 12:12 PM
You must have another controls beside just Booleans in our array. The array of controls has been down casted to More Generic Class which is the Control Class. One menus level up (see the picture I posted above).
The Disabled property is part of the Control Class which Boolean inheritance. So our function should still work.
So does your fiction work? Does it set the disabled state? Does it throw an Error?
03-07-2014 12:24 PM
If you are working with a mix of controls refnums and wish to set and/or get properties you need to know what properties are valid for which class of objects.
You may have to use the "To More Specific Class" to access property that are only valid for a certain class.
The contol referances can only be cast to the specific Class that it was orginally.
You can't cast a String control Ref to a Boolean control Ref. It will throw an error.
The proberty "Class Name" will tell you what the orginally control class is.
03-08-2014 11:32 AM
Thank you Omar,
It seems to work now, the only thing is I need to keep the bundle function. I can not remove the bundle function and only use the Cluster constant created with the bundle function while the example uses only a cluster constant. Wondering why that is so...