LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding items to an enum shifts the constant on the BD...

Solved!
Go to solution

A picture being worth a 1000 words, here is my qualm:

 

ScreenHunter_002.jpg

 

Why is adding an item to an enum constant shifting the constant on the BD?

I am using this approach alot for pseudo-stacked sequences (I use instead a state machine) and I end up moving the enum constant after wach added item, otherwise it eventually disappears underneath whatever structure there is to the right...

Of course I could just Right-Click and use Edit items (which I resorted doing today as my tolerance level has ebbed down a lot lately) but unless this feature has been willingly incorporated in LV, this is bordering on the sadistic.

 

Tested in LV 2011.

Message 1 of 5
(4,750 Views)

I thought you were done bug hunting before the weekend?

 

I can duplicate your seeing in LV2011.

 

The only thing I wonder is how often and how many people use the shortcut menu to add an item before or after on an enum.  I don't think those options should really be on the shortcut menu.

 

Why not? In reality, when you add or subtract items from the enum, you are also affecting their value since it is an ordered list.  Adding or subtracting using the right click menu from the BD, you are kind of acting blind because you only see the current constant, you don't see it's value.  I've always gone to edit items to that I can add elements or subtract elements and see how they ordered on the list and thus know their value.

 

Although there are many situations where the value of the enum really doesn't manner, since you really only care that the the item is in the list and the code probably doesn't care where, I usually try to build my enum lists such as those used for state machines with some logical order keeping things like Init or Open at the top of the list, a Close or Stop near the bottom, and the items in between in an order that might be a typical of the normal operation of the program.  One other possibility (though I realize I probably have never done this) is to shuffle items around so they are in alphabetical order.

Message 2 of 5
(4,749 Views)

The movement is tied to the text justification.  Switch the justification and the from left to right and the constants move the other direction.

 

I did not spend much time on it but I suspect that the motion tied to the length of the text and the justification.

 

My guess is that this is more an unintended consequence than a bug.

 

Lynn

Message 3 of 5
(4,743 Views)

More like a grasshoper than a bug...

I guess one day I will start trying to find reasons why there are oddities like thess. At this point, I am just reporting them in hope (am I that naive?) that somebody will do somethings about them...

0 Kudos
Message 4 of 5
(4,727 Views)
Solution
Accepted by topic author X.

Hi guys,

Thanks for pointing this out! I was also able to reproduce it here on my computer running LabVIEW 2011 SP1.

This was reported to R&D (CAR# 339320) for further investigation. Please let us know if you spot any other issues, we always appreciate your diligence and feedback!

Tunde S.
Applications Engineer
National Instruments
Message 5 of 5
(4,696 Views)