LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem repeating a couple of steps

Solved!
Go to solution

So, basically, I have a case structure with true or false that is connected to a switch. In the interior of the true structure I want to repeat a couple of steps and I have tried to put a while loop in the interior of the true case and in it, another structure for the steps that I want to be repeated. Unfortunately, the while loop and the case structure aren't working. 

I have attached a picture to make myself clear.

 

Thank you

 

0 Kudos
Message 1 of 36
(3,583 Views)

The term "is not working" is really vague.

 

Are  the cases 0 and 2 also some simple operations? (Well they have to be, no additional data / index is flowing in...) So, I think you should get rid of the case structure, and just execute the operations side-by-side. You execute all the cases anyway, so getting rid of the inner case- and inner while-structures simplifies the code.

0 Kudos
Message 2 of 36
(3,569 Views)

Why have you kept 1 case as your default? Are you sure the case cannot get 1 other than the default? If the operation is defined for number of times the looping has to happen then are you using a state machine architecture? Why dont you post your vi?

0 Kudos
Message 3 of 36
(3,561 Views)

The 1 case is the default one because I have deleted the 0 case. In total, I have 3 cases which I want to be runned when I switch the bigger case structure to true. I want to use the data that is obtained with the compound arithmetic to create a graph.. 

I will post later the vi, because I'm not home now. 

 

Any other sugestions?

0 Kudos
Message 4 of 36
(3,547 Views)

Welcome to the LV Forum maryus66!

 

You did not state the obvious: what is it that "is not working"? E.g. no case is run, no output is received, or else.

 

Well, post a self-sustainable VI. I am looking forward to it.

 

 

 

 

0 Kudos
Message 5 of 36
(3,541 Views)

It works only the first inner case. Sorry, if I have mislead you. 

The second and the third are not started.

0 Kudos
Message 6 of 36
(3,538 Views)

How do you say the other cases are not executed? According to the code since you deleted "0" your case name "1,Default" will execute twice. And when the loop executes the case 2 it will stop execution and come out of the loop. Is it possible to show us the other cases, how it is named?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 36
(3,530 Views)

Still not very clear. Post your vi if possible

0 Kudos
Message 8 of 36
(3,525 Views)

Why when it reaches the case 2 it stops? It should run the three cases.

0 Kudos
Message 9 of 36
(3,516 Views)

Is your case three named "3"? Well, you count indices from zero, at index 2 you check  equality to "2" and the the while loop exists. It is all hypothetical until you do not answer the Message 7.

0 Kudos
Message 10 of 36
(3,511 Views)