Showing results for 
Search instead for 
Did you mean: 

Defined values in a cicle of Loop


Hello friends, I need your help to solve my problem, well. let´s start.

I have some user defined values, and I need to read each value, and before a task, (compare to other value [voltage] and so do other task [this task is not relevant] );

But I don´t know how I can do that, I´m so confused and lost to find the right solution.


Well.. I think I need/could do the routine in a repetition structure.


*we have the A-B-C-D-E pre-defined values

*I built an array, and then I got the index to know if I´m on the last iteration,(if the last iteration has passed away I stop the VI.) 

*when I run the task and complete it, I need to read the next value of the array, until the E value, e.g.(A, B, ..., E)

* See the red box bellow.


0 Kudos
Message 1 of 11

Not clear what you want.  Your red box doesn't appear to be in a loop at all.


Can you post your actual VI?  It is difficult to read your image because wire thicknesses seem to be changing for no apparent reason, and it is missing the intersection dots to show whether wires are connected or not.

0 Kudos
Message 2 of 11
I said that I didn´t do , and I don´t Know how to implement the loop structure...

The red box is the part of the VI that I need to change and to complete.

See the A-B-C-D-E values at left.

The other parts isn´t relevant, like DC voltage measurement, resistance measurement.

What I really want is to implement the loop. the case structure is the second part of the task, after the task, I think that it will return a value to the structure on the red box and then get the next element.
0 Kudos
Message 3 of 11

Well the other parts ARE relevant because they show a loop.  How do you want that loop to interact with the red box that you want to put in a loop?  Right now you have a single value coming out of the half missing loop that runs to the code you have in the red box.  What does the value represent?  Do you want this new loop to run after the lower loop is complete?


Since you have a loop already, you know how to implement one.  Take your best guess at what you want to try to do.  Figure out if it works or what it is doing wrong compared to what you want.  Then post the VI so we can make suggestions based on what you say it isn't doing right.

Message Edited by Ravens Fan on 02-17-2010 05:56 PM
0 Kudos
Message 4 of 11

Ok.. well. The red box is the main loop, and when the second loop finish its task, it will return +1 to the loop at the red box to get the next value.

*When the task is finish for the value A, it will get the next value ( B ).


The values are temperatures that will be setup. And when a value is reached, i need to get the next value to reach it .



0 Kudos
Message 5 of 11

Could this all be in one loop?  It sounds like a state machine architecture where you have steps A, B, C, D, E and you want to step through them all.


Or if this needs to be two loops, look at producer/consumer architecture which uses queues to pass data between parallel while loops.

0 Kudos
Message 6 of 11

Right, it can be in only one loop structure, but it´s the matter, I think it can be this.

The principle is from the state machine, This project is a Climatic Machine, that I´ll warm up or to freeze inside this machine.

The task is only ( write to digital line to reach the right temperature), I compare the A value to the Sensor temperature and write to digital line for it.

And then when I reach that, I need to get the next value until the end.


* The case structure is only the decision to write to port0 or port1. But it all can be in one loop.

0 Kudos
Message 7 of 11
0 Kudos
Message 8 of 11
Have you tried modifying your code to be more like a state machine architecture or modified it in any meaningful way?
0 Kudos
Message 9 of 11

Well. This is my great doubt, because I´m so lost in how can I implement the control of the state machine, in other words how to pause the cycle and turn it on from the last iteration, to continue after doing the task.


From the 5 values, passing on all values.






0 Kudos
Message 10 of 11