LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean refnum in a cluster missing the point how to create it... :-(

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!!

 

 

question.jpg

0 Kudos
Message 1 of 12
(4,387 Views)

Drop a "Class Specifier Constant"

Than right click select

 

Select VI Server Class>Generic>GObject>Control>Boolean

 

Boolean.png

Omar
0 Kudos
Message 2 of 12
(4,370 Views)

An alternate way is to bundle the controls references and then right-click the center part of the bundle function and select create constant. This will create the cluster of references. I usually make this cluster a typedef.

 

create ref cluster.png

 

Ben64

Message 3 of 12
(4,363 Views)

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....

0 Kudos
Message 4 of 12
(4,358 Views)

You have to do something like Ben64 showed you.

Omar
Message 5 of 12
(4,354 Views)

Thank you Ben64 this seems to work !!!! I am going to test the code thank you !!!!

 

 

:-)))

0 Kudos
Message 6 of 12
(4,350 Views)

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?

 

Question_CTL.jpg

0 Kudos
Message 7 of 12
(4,325 Views)

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?

Omar
0 Kudos
Message 8 of 12
(4,311 Views)

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.

Omar
0 Kudos
Message 9 of 12
(4,303 Views)

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...

0 Kudos
Message 10 of 12
(4,278 Views)