Parallel working

PaulS:
If you do what with an if()?

You start the devices moving, and then loop to check the position of each one. When one gets to the desired position, you stop that one. When all 4 have stopped, you quit looping.

I start to think i've explained really bad the situation :confused:
The problem is the control of the cylinder. They move with 2 different digital signal: one to go up and one to go down. Now if the position of just one is reached, the the digital signal (up or down) must be putted to 0 (check the code to understand). The problem is that can't be done until all the positions are reached if a if loop is use, or I do a single loop for each cylinder but in this case it's not parallel anymore.
Just one other thing. If anybody has a solution please put an example for the code.

Thank you again!