LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay problem when stopping parallel while loops

Hi there!

 

I have a problem when stopping parallel while loops with the stop button, it happens that I have 2 while loops, the first corresponds to a modbus communication block and the second is the control block that contains a state machine and its respective delays, at pressing the stop button, the communication block disconnects immediately, however; the control block takes a long time to do it because it waits for the set delay time to end and then it stops, in this loop I use a local variable of the general stop, this delay when executing stop button, between both loops; is quite high. I would like to know if there is any way to make both loops stop at the same time, or at least reduce somewhat the time it takes to stop the other loop, I understand that this happens because of the waiting time of the second block and because the stop button is a local variable.

 

Here is a screenshot of the program.

 

nath97__0-1612827382404.png

 

I hope you can help me.

Thanks in advance.

 

0 Kudos
Message 1 of 2
(1,159 Views)

A proper state machine would have a much shorter delay and would keep returning to the same state until the time it detects the 45 seconds have passed using something like an Elapsed Time Express VI (or some equivalent).  Only when that has passed does it move on to the next state.

 

 

0 Kudos
Message 2 of 2
(1,133 Views)