LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No write permissions for DisabledItems[] property of control which is an instance of Strict typedef?

Hey Guys,

 

I have an instance of a strict typedef in my VI. This strict typedef ctl has a cluster, which has a ring control element in it.(Attached the ctl) I would like to enable some of the items in the ring control programatically depending on some parameters. Hence I thought I should be using DisabledItems[] property to do that. But I was not able to do "Change to Write" on the property node of the ring control. Also I tried to write to that property using the refernce of the property node. But then it throws an error "Operation not valid for strict tupe definition instance". I concluded that this is expected.

 

ABC.PNG

I have tried changing my ctl as a "typedef" and I am able to write into "DisabledItems[]" property.

 

I was hoping if somebody could explain me the rationale for this decision "of not giving write permissions for DisabledItems[] property for the ring control which is an instance of Strict typedef" taken by LabVIEW developers?Also if there is a workaround for being able to do this?

 

Thanks for your help

bobdiya

 

 

0 Kudos
Message 1 of 3
(2,585 Views)

A typedef defines the datatype of a control.  A strict typedef defines not only the datatype, but also most of the appearance properties of a control.  The disabled items property would be one that defines the appearance of the control (i.e., what items are selectable, what items aren't.) so it makes sense that you can't write to it and change the items.

 

The workaround?  If you need to change the appearance of the ring control such as changing which items are disabled, then you need to make it a regular typedef and not a strict typedef.

 

Is there a particular reason you had it defined as a strict typedef to begin with?

Message 2 of 3
(2,573 Views)

The reason of choosing a typedef is because it is very likely that I am going to modify the items themselves in the ring control. Since the value defines the data type in a ring control unlike in an enum, any changes in the ring control's item will not update in the instances if the ctl is a regular typedef. But I want all of my modifications to the ctl to be applied in all the places that I have used them, AND be able to disable some of items.

 

>> So in this case looks like I will have to use the regular typedef and then make apply any modifications in the items in the ctl manually everywhere.

 

I will try to explain why I expected the behavior:

A strict typedef is responsible for autoupdating of the datatype and the appearance. However here my understanding of the appearance is the bounds of the control, the size, the color of the control itself etc. Its somethign like if I ask a question "How is that restaurant you visited yesterday", I expect an answer "Food served there is good, located at a nice place, ambience is good etc" (analogous to appearance and datatype). I am not worried if the restuarant's working hours, i.e, wheather is now open or closed (disabling of items in the Ring control). Pardon me if my anology does not make sense. However I feel allowing the LabVIEW user to disable some of the items, will not change any of the attributes that define the control itself, since the control in itself is not changed . Also I talked to couple of my friends (who are LabVIEW developers) and even they were suprised about this behavior. So I thought I was not the only one who feels this is not what I expected Smiley Happy

0 Kudos
Message 3 of 3
(2,559 Views)