LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my output cases not changing?

Hi..
 
I am trying Formular function with case structure.. I do not have any error but it is not moving...
 
Does anyone have any idea?
0 Kudos
Message 1 of 3
(2,680 Views)
You've got a few issues.  In your if statements, you're using dio = 0 and curr = 0.  Those are assignment states which means your setting the variables to those values.  YOu need them to be dio == 0 and curr ==0 to make them comparitive functions.

You should also be using integers as your inputs, as trying to compare floating point numbers to an exact value is a no-no.

Finally, you still have syntax issues.  The else statement is only for the final for statement, so your code will only work for cur==3, all other results will be 4 because your final if structure will be false for cur!=3.  You can combine them to be If (dio ==0 && cur == 1)  ... else if, etc.  You would be better off using a case statement since dio is 0 for all your states.

Is this just an exercise in learning, or is this the way you are trying to implement something?  LabVIEW has much more elegant and more efficient ways to do what you are attempting.
0 Kudos
Message 2 of 3
(2,674 Views)
The problem has been listed in this thread as well.
0 Kudos
Message 3 of 3
(2,657 Views)