Jump to content

Optionally disable ".." notation in Case Structure


Recommended Posts

I am building a state machine with a state enumeration. I often have a Case Structure with frames assigned to multiple enumeration values. It is very frustrating when there are three or more adjacent enum values and LabVIEW automatically converts the frame's "case string" to ".." range notation. It is not clear without looking at the enum which states are applicable for the frame.

For example...

Assume an enum with the following states:

[0] "initializing"

[1] "shutting down"

[2] "aborting"

[3] "running"

A Case Structure frame that is assiged the following states:

"initializing", "shutting down", "aborting"

will get converted to:

"initializing".."aborting" :angry::wacko::blink::unsure:

So we need an option on the Case Structure to explicitly show all inclusive values instead of using the ".." notation.

Link to comment
  • 11 months later...

I think you would need to limit it to enums. I'd hate to see what labview would try to do with the case

1..1000000

Rather than being an option, maybe it could limit itself to 8 items or as many characters as fit, whichever is larger.

- Jason

Link to comment
  • 8 months later...
You mean like this:

post-45-1133545794.jpg?width=400

I must be missing something, works fine here. Maybe changed for LV 8? I did the above in 7.3 just now, worked first time. What am I missing?

Mike,

Are you sure that "mike", "elise", and "jennifer" is a contiguous group? What happens if you add "matthew" ;) ?

Link to comment
Are you sure that "mike", "elise", and "jennifer" is a contiguous group? What happens if you add "matthew" ;) ?
Okay, I was missing my third cup of coffee that morning, along with the braincell, which I think my wife was keeping at the moment. :blink: :headbang:

I agree, we need this as an option. If the range is non-contiguous all enum values show up, if contiguous it performs the elipsis contraction.

A real hack workaround for now is to put a divider, a "No-Operation" or some other such value that you do not use in the enum.

I modified your list and an enum as:

  • initializing
  • --- NOP ---
  • shutting down
  • aborting
  • running

then noticed that if the mod to the enum was performed after the CASE was setup, that the elipsis stayed, but if the enum was filled in, then the CASE was setup that the CASE would show the three selected values:

post-45-1133708356.jpg?width=400

The upper CASE and enum had perviously been setup like you's, the lower case separate, then connected. It works, but it is definitely in the "hack" rather than elegant category.

Most of my CASEs are done with strings these days, I imagine the behavior is the same.

One final thought: now that we can script and get references to things like CASEs I wonder if there is a scripting property that might help here?

Link to comment
You would need a NOP inside of every possible contiguous group.

Another method is to rearange the states so the groups are not contiguous

ie) if States=A,B,C,D,E,F and cases are [A,B,C] or [D,E,F] = two problems

But States=A,E,C,D,B,F = no problems and no extra states.

Still a workaround, but not too bad. Just don't use a logical order in you state Enum.

-WDC

Link to comment
LV 7.3 ........uh?.......did I miss something? :blink:

I know LV 7.1, 7.1.1, 7.1.1f2 and then LV 8.0

Well, thats what I get for having 2 monitors and editing video and LV diagrams at the same time. :P

My video editing software is version 7.3 (although, like LV it now has V8 out), so no, there was no LV 7.3.

Link to comment
You would need a NOP inside of every possible contiguous group. ... This is probably more work than it is worth.
Jim,

I did say that it was a real hack. Obviously not suitable for general purpose programming, especially where you might be needing to modify the state machine a lot. It would even be acceptable to me if the tipstrip showed all the values a given CASE frame handled, but it doesn't do that either, nor does the description. Even the popup menu when you are going to select the case uses the elipsis. The only good thing here is that they are all consistent and if we can convince NI to change the behavior, or make it optional, it appears that they might only have to change one small part to have it carry over to all the different displays.

At the very least we need the tipstrips.

Mike

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.