LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

triangular select function to select case

Solved!
Go to solution
That is expected behavior. If you have a case for every value of an enum (which is what your state machine is probably using), then you do not need a default. This makes sense because an enum has a defined set of possible values whereas with a normal numeric, you have an infinite number of possible values and a default is required.
0 Kudos
Message 21 of 35
(1,234 Views)

Dennis,

 

In my main program where the state machine is there is no enum to select the case.  It is simply a shift register that is initialized to 0 and wired to the case selector.  It is then incremented to flow to the 9 cases.  If the Boolean flag is True it will use a value of 10 that is wired into the state machine from the outside.  The output of the triangular select function is wired to the right shift register that sets the case upon the next iteration.  None of the cases are set to default.

 

I was just saying enum because that is what I was using in 5.1.1 to replicate this scenario because when I use an ordinary numeric control it gives me an error that goes away when I set a default case.

0 Kudos
Message 22 of 35
(1,232 Views)
Since it sounds like assigning a default case is possible in 5.1, why don't you try doing exactly that? Other than that, it might be time for you to post your code. I'm confused now as to what you have and what you want to do.
0 Kudos
Message 23 of 35
(1,227 Views)

Please post, at the very least, a screen shot of one of the case structures in your main VI.  (Actual code would be preferable.)  Click on the top of your case structure so that we can see the list of cases contained within that structure.  Also be sure to show the triangular case selector, and what is wired to it.

 

You keep contradicting yourself in your posts...we need to see what's really going on in order to help you further.

 

Also, why not just specify a default case and be done with it?

0 Kudos
Message 24 of 35
(1,224 Views)

DianeS wrote:

Also, why not just specify a default case and be done with it?


Alas, this has been the crux of the issue in that it's not clear what the OP has, or is doing.

0 Kudos
Message 25 of 35
(1,221 Views)
Here is code showing a case with the discussed dilemma.
0 Kudos
Message 26 of 35
(1,202 Views)
We need to see the complete list of cases.  Please follow the instructions in my earlier post.
0 Kudos
Message 27 of 35
(1,199 Views)

Actually, we don't. All that the user has to do is to either

 

(a) create a blank case item, right-click on the case label box and set that case to be the "Default" case...    --OR--

(b) pick one of the cases, right-click on the case label box and set that case to be the "Default" case ...

 

... to execute if the value fed to the case structure does not match any of the case item values. This is, of course, what "Default case" means, which is different than an enum that has a "default" enumeration item, or a string with the characters "Default". 

 

Of couse, he has been told to do this several times, and it's still not clear what the difficulty is. I had postulated that maybe LabVIEW 5.1 didn't support default cases, but I was only guessing since I don't remember what a program from 10 years ago was capable of doing. Still, this would be documented, and the user, unlike me, would have the documentation.

Message Edited by smercurio_fc on 03-17-2009 02:35 PM
0 Kudos
Message 28 of 35
(1,193 Views)
My goal is not to change anything but simply understand what will occur.  I was able to isolate the state machine in my main VI and discovered that inputting the value of 10 to the case selector actually sends me to Case 9..my last case!
0 Kudos
Message 29 of 35
(1,181 Views)
smercurio_fc...I wanted to see a complete list of cases so I could figure out if there was actually a default in there.  You are quite right, however.  🙂
0 Kudos
Message 30 of 35
(1,169 Views)