LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain enum label

I was able to get the disable node to work by dragging a write disable node from the examples but I would like to know why when I made my own I can't get the write to work...
0 Kudos
Message 11 of 27
(1,575 Views)
I am not sure what you did. Here is how I did it. I put an enum on the panel. From the terminal on the diagram I choose Create >> Property Node >> Disabled. Then, Change to Write. The input to a Disabled property node is an integer (U8) with values: 0 = Enabled, 1 = Disabled, and 2 = Disabled and Grayed Out. See the context help.

Lynn
0 Kudos
Message 12 of 27
(1,568 Views)

Is there a way to disable a control on a top level usinig a sub VI?

I have numerous controls of which many will be used in automation. I do not want the user to have access to these controls unless they put it in manual mode (password protection). What I would like to do is make a sub VI that can disable all controls I send to it (I send an array of enums).

 

Any suggestions?

 

0 Kudos
Message 13 of 27
(1,532 Views)
Yeap, just pass the subVI a reference to the control you want to enable/disable.
 
Calling VI.  Note that the Reference will be coerced to a generic control reference, you can use 'To a more generic class' in the application control pallette to remove that coercion, or if all the controls are of the same type, make the input on the subVI a strict control reference instead.
 
 
 
SubVI
 
 
 


Message Edited by Mythilt on 05-30-2008 12:21 PM
Jon D
Certified LabVIEW Developer.
Download All
0 Kudos
Message 14 of 27
(1,528 Views)
Thank you!
0 Kudos
Message 15 of 27
(1,524 Views)
No worries.  Just be carefull with how strict the control reference inputs are, because in my example for instance, the return reference from the subVI will be a Generic Control Reference, and as such any boolean specific properties won't be accessable and the Value will be a Variant type, not boolean.  You can fix that with the 'To a more specific class' in the applications pallette, bu you need to be carefull that you don't accidently change the class type. (ie, a boolean to a string.)
Jon D
Certified LabVIEW Developer.
0 Kudos
Message 16 of 27
(1,523 Views)

One more follow up question.

 

Is there a way to disable one specific element in an array but not the rest. As I said earlier in the thread I have an array of clusters with value and variable name. I would only want one element disabled but not the rest.

0 Kudos
Message 17 of 27
(1,522 Views)
No. All elements in an array have the same properties. Only values can be different.

You may want to look at a different way of presenting the user interface. Perhaps you can have a single cluster or even separate controls so that you can control the disabled property. One extra control would select which element of the array was to be modified by the values in the single cluster. Put the results into an array which is not displayed for use internally in your program.

Lynn
0 Kudos
Message 18 of 27
(1,518 Views)

No, I don't believe that you can disable just specific items in the array.  Is the array supposed to change size as the program runs?  If not, I'd suggest you go with a cluster of clusters, and disable specific cluster controls.  You do this by referencing the Controls[] property of the main cluster, and then using index array to get the specific cluster reference needed to disable the control.

 

 



Message Edited by Mythilt on 05-30-2008 12:39 PM
Jon D
Certified LabVIEW Developer.
Download All
0 Kudos
Message 19 of 27
(1,516 Views)
OK I think this should work but I am having some difficulties.
 
Rather than going through all my code to change it I figured use the conversion. However when I try to convert the array to a cluster it is defaulting to 9 elements. I am not exactly sure why. Obviously this is a problem since I do not have 9 elements there is a conflict (it should be 23)
Is it likley I have my code screwed up and and the array is being fed through to be 9 elements (even though it will be 23 once the program begins) or is this a default that I do not know about?
0 Kudos
Message 20 of 27
(1,485 Views)