LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create an enum typedef?

I want to create an enum typedef?  I should be able to right click on the enum and select "Advanced" from the drop-down menu.  However, when I do that, "Advanced" is greyed-out.  What should I do?

 

Thanks in advance.

0 Kudos
Message 1 of 14
(13,360 Views)
Select the control then click "Customize Control..." in the Edit menu.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 14
(13,348 Views)

jcarmody wrote:
1) Select the control then click "Customize Control..." in the Edit menu.

 

Prequil to Jim's reply...

 

-1 ) Right-click on the enum constant and select "Change to Control"

 

0) Switch to the front panel

 

Continue with Jim's instruction.

 

Explanation: The "customize" option is not available for non-type def'd enum constants on the diagram.

 

Ben

 

PS: Jim, I like your poem.

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

The instructions given worked for me.  Thanks so much! 

 

However, this brings up another related question.  When I open the Standard State Machine template, there's a Beginning State typedef and a Next State typedef.  When I double click on either, nothing shows up on the front panel.  Can you explain what's different?

0 Kudos
Message 4 of 14
(13,295 Views)

They are constants on your block diagram. They have no representation on the front panel.

You can right-click them as well and select 'Open Type Def' or 'Advanced -> Customize'.

 

Felix

0 Kudos
Message 5 of 14
(13,283 Views)
This was the nature of my original question in this tread.  When I create a constant enum, I can't make a typdef out of it because the menu items that would normally be used are greyed out.
0 Kudos
Message 6 of 14
(13,272 Views)

Joe,

 

It is simple theory.

 

You can have 'N' no. of constant instances for a Typedef Enum variable; but not 'N' no. of variable instances for a Enum constant. Thats why, the menu items are normally greyed out for an Enum constant.

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 7 of 14
(13,225 Views)
I'm sorry, I still don't get it.  Can you explain the steps I would have to go thru to duplicate the Beginning State or Next State typdefs from the Standard State Machine template?
0 Kudos
Message 8 of 14
(13,203 Views)

Joe,

 

See Ben's reply. It has already got the answer you want...

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 9 of 14
(13,201 Views)

I realize this thread is old, but for anyone else like myself who comes acorss this in the future, I believe Ben missed a step at the end to create a type def like the ones used for a state machine.

 

Once the custom control front panel is opened after selecting customize controls, select whether you want a type def or a strict type def from the drop down menu at the top.

 

When you then go to your block diagram and switch the control to a constant, you can right-click on it and see the option to open type def.

 

Refer to this link for clarification: http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/creating_type_defs/

 

Chris

0 Kudos
Message 10 of 14
(11,752 Views)