取消
显示结果 
搜索替代 
您的意思是: 

triangular select function to select case

已解决!
转到解答
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 项奖励
21 条消息(共 35 条)
1,469 次查看

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 项奖励
22 条消息(共 35 条)
1,467 次查看
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 项奖励
23 条消息(共 35 条)
1,462 次查看

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 项奖励
24 条消息(共 35 条)
1,459 次查看

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 项奖励
25 条消息(共 35 条)
1,456 次查看
Here is code showing a case with the discussed dilemma.
0 项奖励
26 条消息(共 35 条)
1,437 次查看
We need to see the complete list of cases.  Please follow the instructions in my earlier post.
0 项奖励
27 条消息(共 35 条)
1,434 次查看

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 项奖励
28 条消息(共 35 条)
1,428 次查看
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 项奖励
29 条消息(共 35 条)
1,416 次查看
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 项奖励
30 条消息(共 35 条)
1,404 次查看