LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

strict type def enum with disabled item

I have a situation where I am using a strict type def enum control to select a case in a case statement.

The enum type def has certain items disabled and this works everywhere the control is used; its not possible to select the disabled item.

If I make a constant of the type def none of the items are disabled, which seems to go against the concept of a strict type def.

Further, if I manually disable an item in the constant I can still select it while in edit mode.

Finally, if I wire the constant with the disabled item to a case structure which has a case for each item as well as a distinct default case,
and set the constant to the disabled item, the case statement still switches to the case for the item when I run the VI.

I would have  rather had the type def constant follow the disabled items of the type def at creation and update, and the case statement execute
the default case if a disabled item was the value on the wire (assuming that I can still select a disabled item in a constant). So now I wonder what
is the use of disabling an item in an enum constant other than cosmetic?


0 Kudos
Message 1 of 9
(3,994 Views)
I'm not sure why you'd disable items in the strict typedef since this would mean they couldn't be enabled even programmatically. But I tend to agree that the enum constant created from a strict typedef control should inherit any disabled items. If you read what a Strict Type Definition is in the LabVIEW help:

"A strict type definition forces everything about an instance to be identical to the strict type definition, except the caption, label, description, tip strip, and default value."

This should probably be brought to N.I.'s attention. They may write a CAR.

Message Edited by Bill@NGC on 07-20-2007 12:00 AM

0 Kudos
Message 2 of 9
(3,981 Views)
This was reported to R&D (# 4BJG3UXP) for further investigation. Thanks for the feedback!
Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
0 Kudos
Message 3 of 9
(3,963 Views)

As I understand it....

The "strict" stuff applies to GUI's only, not the diagram.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 9
(3,933 Views)

In LabVIEW 2018, this problem was not fixed.

The grayed item of strict type def was displayed normally in a control on front panel, as shown in attachment.

Can you tell me some update?

 

labmaster.

0 Kudos
Message 5 of 9
(1,876 Views)

@Ben wrote:
 

As I understand it....

The "strict" stuff applies to GUI's only, not the diagram.

Ben


True.  However there is an exception: If you have the right stuff enabled, when you right-click on a Ring or Enum constant, one of the items is "Act as Strict TypeDef Constant".

 

Also, "Disabled" has always only affected run-time, not edit-time.  Which of course is how it should be.  Sometimes i have an Enum with the first item being "Select" and grayed out and disabled.  I need to set a control to that value when editing, but prevent it from being selected when running.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 9
(1,864 Views)

@paul_cardinale wrote:

@Ben wrote:
 

As I understand it....

The "strict" stuff applies to GUI's only, not the diagram.

Ben


True.  However there is an exception: If you have the right stuff enabled, when you right-click on a Ring or Enum constant, one of the items is "Act as Strict TypeDef Constant".

 

Also, "Disabled" has always only affected run-time, not edit-time.  Which of course is how it should be.  Sometimes i have an Enum with the first item being "Select" and grayed out and disabled.  I need to set a control to that value when editing, but prevent it from being selected when running.


True, "strictly" speaking.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 9
(1,847 Views)

@labmaster wrote:

In LabVIEW 2018, this problem was not fixed.

The grayed item of strict type def was displayed normally in a control on front panel, as shown in attachment.

Can you tell me some update?

 

labmaster.


And it's still not a bug.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 9
(1,844 Views)

Thank you.

I checked the operation is not a problem in runtime.

 

labmaster.

0 Kudos
Message 9 of 9
(1,807 Views)