LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Structure will not allow me to change state name.

Solved!
Go to solution

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 28
(853 Views)

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.

0 Kudos
Message 12 of 28
(850 Views)

In the custom control window, make sure you change the control type from Control to Type Def or Strict Type Def.

0 Kudos
Message 13 of 28
(848 Views)

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.

0 Kudos
Message 14 of 28
(841 Views)

Matthoew,

 

FYI I'm running 2010 Not 2011.

0 Kudos
Message 15 of 28
(837 Views)

@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.

0 Kudos
Message 16 of 28
(834 Views)

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.

0 Kudos
Message 17 of 28
(829 Views)

Altenbach,

 

Here is the Vi you have requested.

0 Kudos
Message 18 of 28
(822 Views)
Solution
Accepted by topic author ggaryt

"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!

Message 19 of 28
(814 Views)

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.

Download All
Message 20 of 28
(807 Views)