LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: while loop event with a different time

Hi. I'm a begginer with labview, so I have a few doutes. I'm trying to control various valves at the same time (same VI). I created a subvi responsable for modifing the position of a valve according to time. I'm using a array with "n" lines, and each line represents the time when the valve will changes its position. When the time present in the the line is reached, the VI stops automaticly the while loop and restart, so the second time time present in the second line might be counted. This operation will happens in a continious way.

The problem appears when I try to use two or more while loops at the same. Each loop has the same subvi. When I set the time present in each line in each while loop and beggin the vi, it seems they don't work independently of each other. For example, if I set 20 seconds for the first change in the first while, and set 30 seconds for the first change in the second while loop, the first will only continue if the the time setted in the second one finishes.

If anyone could help me.

0 Kudos
Message 1 of 4
(3,578 Views)

I would recommend that you start a new discussion instead of adding to a different discussion that is already marked as solved.

 

You did not attach your subVI. If the subVI is not reentrant, both loops will use the same subVI.

It is not really clear how your code is supposed to function. You don't need to restart the while loop, just reset the timer.

0 Kudos
Message 2 of 4
(3,573 Views)

Thank you 

0 Kudos
Message 3 of 4
(3,552 Views)

There are the same VIs as before. Your tolevel VI is loking for a VI with speical portuguese(?) characters in the name. I guess I can replace with what you have attached.

 

You can use the "elapsed time express VI" or you can keep the reference time in a shift regsiter or feedback node and replace it whenever the time has elapsed.

 

Here is a very quick example for a resettable timer.

 

 

Now to your original problem. Your while loops don't restart when you stop them. What makes you think they do?

Download All
0 Kudos
Message 4 of 4
(3,516 Views)