06-20-2014 03:20 AM
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
Solved! Go to Solution.
06-20-2014 03:29 AM - edited 06-20-2014 03:31 AM
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.
06-20-2014 03:34 AM
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?
06-20-2014 04:43 AM
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?
06-20-2014 04:51 AM
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.
06-20-2014 04:57 AM
It works only the first inner case. Sorry, if I have mislead you.
The second and the third are not started.
06-20-2014 05:08 AM - edited 06-20-2014 05:09 AM
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?
06-20-2014 05:11 AM - edited 06-20-2014 05:11 AM
Still not very clear. Post your vi if possible
06-20-2014 05:43 AM
Why when it reaches the case 2 it stops? It should run the three cases.
06-20-2014 05:48 AM
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.