From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's wrong with my State Machine structure? I'm new to LabView

I've been recently introduced to LabView, and in my current project I've created an "Enum Constant" with 9 items. Le'ts say, for example, each item says:

"First Item"
"Second Item"
"Third Item"
...etc

then I created a case structure, and used the "Add case for every value" option.

My problem is that later on, I noticed that in the Case Structure, my cases show numbers "0, Default" "1" "2" ...  instead of saying "First Item" or "Second Item" .... etc

I don't know what in the world I've done to change the display of the values, and I can't figure out the way to change it back lol




Side Notes:

--The enum constant (obviously attached to the case structure) still has the same values "First Item" "Second Item" "Third Item"

--The enum constant (again, attached to the case structure) has a tunnel that goes through a While Loop with a Shift Register, and there's a little coercion dot right there at the input terminal. I don't know what to do about it.

-- I can't attach the VI for moral reasons, so I tried to explain my problem as simple as I could 

0 Kudos
Message 1 of 3
(2,140 Views)

I believe you have created a Ring constant insteat of Enum. The Ring looks very similar to the Enum just check it and try to replace that with the exact Enum constant then it should be alright.

-----

The best solution is the one you find it by yourself
Message 2 of 3
(2,139 Views)

You should also make the enum a type def. Otherwise you're going to run into synchronization issues if you need to modify the enum list. Without a type def you'd have to update every single enum instance on your block diagram, and it's a pretty safe bet that you'd likely miss on. By using a type def you'd only need to modify the list in one place and all instance of that type def would be updated. The LabVIEW Help discusses creating and using type defs.

0 Kudos
Message 3 of 3
(2,109 Views)