Showing results for 
Search instead for 
Did you mean: 

How to Make ENUM type def?

Quick question on how to turn on the type def mode when creating an enum, as the "advanced" option to further go to "customize" is grayed out and disabled.  What do I need to do?



Message 1 of 5
ah, answered my question...just had to make it as a new control file outside of my vi.
0 Kudos
Message 2 of 5

I assume you mean an enum constant.  That is something I struggled with for a while--it seems that it should be possible to type def an enum constant on the BD, because that is important when creating state machines.  In the LabVIEW Basic I and II classes, that was stressed as a valuable timesaving tool for future expansion of the structure--always use type def'ed enum constants on the case selector, so you don't need to edit every one of them when you add a case.  Apparently, when the instructor said HOW to create that constant, I missed it.


But I looked for the longest time through LabVIEW Help to learn how to do it--either it's not there, or I just wasn't searching on the right key words (most likelySmiley Wink).  Everything I could find said that type defs can be created for controls and indicators, not constants.


Until I stumbled across the solution you mention, I usually opened a new state machine from the template, and copied the enum from there to use in my VI.


It just seems that such a useful device should be easier to create within the VI.  It seems counterintuitive that we need to create a custom control to produce a constant.  BTW, I am using LV 8.5, so possibly the newer versions make that more obvious?





0 Kudos
Message 3 of 5

No.  Newer versions of LabVIEW are not yet able to do this.  But tst made a right-click plugin to do this here.


You may want to lend your support by going to this idea Create type def from block diagram constant and giving it your Kudos.

Message Edited by Ravens Fan on 02-04-2010 11:06 AM
0 Kudos
Message 4 of 5

I find the simplest method is;

  • File>>New...>>Other Files>>Custom Control
  • Create the ENUM, set to "Type Def" and save
  • Then from the functions palette on the block diagram, "Select VI..." and load the control. The ENUM then appears on the BD as a constant.


One odd thing I find (I'm using LV8.6), when I replace an existing enum const, I seem to have to right-click>>replace twice!


I hope this helps





0 Kudos
Message 5 of 5