02-06-2007 03:46 PM
02-06-2007 03:50 PM
You're welcome.
I had to refer to my LV Intermediate book to remember how to do that. It was one of those "Wow, cool" things I learned in that course.
I had the same problem when I was writing my first program with a state machine. Everytime I added a case to the machine, I had to edit numerous enums. And I was just using some numbers in my case structure rather than descriptive item names. Learning this technique saved a lot of time and headaches.
02-07-2007 03:34 PM
I had a quick question about this topic too. I started off making a state machine vi to control a test for me, then decided I wanted two tests which acted slightly differently. I duplicated the vi of the first test, but found that whenever I changed the names of states within the new copy (through Open Type Def/Edit), they would affect the names of states in the first and vice versa. I then created two separate .ctl's, but ended up having to go through the entire second diagram, changing the Constant "Enum Constant"s to Controls, then going to the Front Panel, right-clicking on the control, and clicking Replace/Select Control/NewStates.ctl, then setting it back to a constant on the block diagram.
(Note, as a side effect, the names of the states disappeared from the Case Selector box and were replaced with 0,1,2,3... until I'd replaced every Enum Constant with it's new version)
Is there a faster or easier way to do this?
02-07-2007 04:03 PM
@ChrisC_ wrote:
Is there a faster or easier way to do this?
Two options:
(Note, as a side effect, the names of the states disappeared from the Case Selector box and were replaced with 0,1,2,3... until I'd replaced every Enum Constant with it's new version)
I'm not sure how that happened (unless you had less items in the new enum).