10-12-2011 12:14 PM - edited 10-12-2011 12:15 PM
With 2011 you select the enum constant, Right-click>Create typedef from constant.
Previous versions require you to first create a control from the constant then (depending on your .ini) double click on the control or right click>advanced>customize control
Edit- should have known I get beat to the answer
10-12-2011 12:18 PM
The one wired to your left shift register (Beginning State) is already a typedef. The filename is BeaconProd0p4.ctl. Things change in LabVIEW 2011, but prior to that, you need to create a enum control. Right-click onthe control and choose Advanced->Customize. Alternatively you can go to the File menu and choose File->New and select custom control.
In LabVIEW 2011, you can create the constant, right-click and choose Create Type Def.
10-12-2011 12:19 PM
In the custom control window, make sure you change the control type from Control to Type Def or Strict Type Def.
10-12-2011 12:26 PM
Hi Matthew,
That doesn't seem to do what I was hoping. Why are the earlier one I had allow "Auto Update form typ def" when you right click on the enum but I don't see that option in mine. All I wanted to do was change the name of one of the states and the whole state machine selections are changing form duplicate states or numeric state. How can something that should be so simple get so complicated.
10-12-2011 12:38 PM
Matthoew,
FYI I'm running 2010 Not 2011.
10-12-2011 12:40 PM
@ggaryt wrote:
How can something that should be so simple get so complicated.
Please attach the latest version of your VI as well as the type definition.
10-12-2011 12:48 PM
Altenbach,
I sorry but you have me a bit confused. When I attach the VI doesn't that already include the type definition? You make it sound like they are two different items.
10-12-2011 01:01 PM
Altenbach,
Here is the Vi you have requested.
10-12-2011 01:13 PM
"I sorry but you have me a bit confused. When I attach the VI doesn't that already include the type definition? You make it sound like they are two different items."
What an important point.
A type definition is a user defined control that you indeed create in a second file, much like a seperate VI. It's created by going to File >> New... and selecting Custom Control. Once the new control opens, you add, for instance, and Enum to the front panel of the Custom Control. Below the menu, you can change the 'Control' into a 'Type Def'. This is important for forcing changes to the type definition to VIs that use the type definition.
Once you're satisfied with the control, save it. Now, you need to start using it in your Vis. To do this, right click on an empty space in your block diagram in your VI and choose "Select a VI". Navigate to the saved type definition and place it on your block diagram. Now, if you ever open up the type definition, any references to it on the block diagram will update automatically. You can open a type definition by right clicking on an instance of it (such as a constant) and choosing "Open Type Def".
So, yes! The type definition is a seperate file, and you should include it! If you right click on an Enum and it doesn't have "Auto-update", that means it isn't linked tp a type definition. Also, when you edit the type definition, you will likely need to File >> Save and File >> Apply Changes to apply any changes from the Type Def to all your VIs.
Good luck!
10-12-2011 02:04 PM
I created the typedef for you. The code you posted no longer had the typedef you once had. The VI doesn't include everything (in fact what you posted is missing several subVIs and at least this typedef. The code you posted earlier pointed to a typedef under the comment "This shift register
stores the current state". You have removed that in the last code you posted.
I included the control and updated the constant under the label to use the typedef.