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.
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.
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.
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 .
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.
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.
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.