From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control with time

Solved!
Go to solution

Hi,

 

To simplify my problem: the VI contains a boolean indicator (representing the ON/OFF status of a pump) and a numeric control (representing the measured pressure of the system).

 

The boolean indicator needs to be ON during a certain time (for example it stays ON for 10 seconds and then turns OFF again). But if the numeric control goes over a certain limit, the boolean must turn OFF (even if it did not reach the given time). But when the control goes lower than the limit again, the boolean must turn ON for the remaining time.

 

For example:
Time for which the boolean must be ON = 10 seconds
Upper limit for the numeric control = 5

The numeric control stays at 4, boolean turns ON. After 6 seconds, the numeric control goes to 6, so the boolean turns OFF. Eventually the numeric control goes back to 4, so the boolean must turn ON again for the remaining 4 seconds. 

 

Does anyone know how to solve this on LabView? 

 

Thank you.

0 Kudos
Message 1 of 4
(2,206 Views)

Hi Charly,

 

I guess you can use ElapsedTime for this ON/OFF part related to time. The other condition (limit check) is just a boolean operation later on: LED:=ElapsedTime AND limit-check…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,199 Views)

@GerdW wrote:

Hi Charly,

 

I guess you can use ElapsedTime for this ON/OFF part related to time. The other condition (limit check) is just a boolean operation later on: LED:=ElapsedTime AND limit-check…


Hi GerdW, thank you for your reply!

 

The problem is that the time keeps elapsing. So with your solution, the boolean turns OFF when the limit is not check, indeed. But when the limit is check again, the boolean will not turn ON for the remaining time. In my example, if the numeric control goes to 6 for more than 4 seconds and then goes back to 4, well the boolean will not turn ON at all because the limit time will be reached.

0 Kudos
Message 3 of 4
(2,192 Views)
Solution
Accepted by HZintern

Hi Charly,

 

then you could just create your own ElapsedTime function with an additional "Pause!" input…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,183 Views)