Jim Kring Posted April 5, 2004 Report Share Posted April 5, 2004 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" So we need an option on the Case Structure to explicitly show all inclusive values instead of using the ".." notation. Quote Link to comment
jdunham Posted March 7, 2005 Report Share Posted March 7, 2005 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 Quote Link to comment
Mike Ashe Posted December 2, 2005 Report Share Posted December 2, 2005 You mean like this: 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? Quote Link to comment
Jim Kring Posted December 2, 2005 Author Report Share Posted December 2, 2005 You mean like this: 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" ? Quote Link to comment
Mike Ashe Posted December 4, 2005 Report Share Posted December 4, 2005 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. :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: 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? Quote Link to comment
Jim Kring Posted December 4, 2005 Author Report Share Posted December 4, 2005 Mike, You would need a NOP inside of every possible contiguous group. This boils down to having every onther value being a NOP. And enum values must be unique, so you would have to give them different names. This is probably more work than it is worth. -Jim Quote Link to comment
BChandler Posted December 4, 2005 Report Share Posted December 4, 2005 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 Quote Link to comment
didierj Posted December 5, 2005 Report Share Posted December 5, 2005 ...I did the above in 7.3 just now... LV 7.3 ........uh?.......did I miss something? I know LV 7.1, 7.1.1, 7.1.1f2 and then LV 8.0 Quote Link to comment
Mike Ashe Posted December 5, 2005 Report Share Posted December 5, 2005 LV 7.3 ........uh?.......did I miss something? 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. My video editing software is version 7.3 (although, like LV it now has V8 out), so no, there was no LV 7.3. Quote Link to comment
Mike Ashe Posted December 5, 2005 Report Share Posted December 5, 2005 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.