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.
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.
10-19-2018 11:10 AM
I want to enter in a low limit, high limit and read pressure. When the pressure is above the high limit then the Boolean is False until the pressure is below the low limit. At that point the Boolean is true until the pressure is above the high limit. This should cycle on and off.
Solved! Go to Solution.
10-19-2018 11:28 AM
The output not only depends on the input values, but also on the history. You need a feedback node to retain state. See how far you get.
10-19-2018 01:47 PM
Still having trouble after I tried that.
10-19-2018 01:48 PM - edited 10-19-2018 01:51 PM
Hi bassin,
you are looking for a comparison including a hysteresis.
Many other had the same task before, so you surely will find solutions or atleast descriptions of…
IF value > high THEN boolean := FALSE ELSEIF value < low THEN boolean := TRUE ELSE boolean := boolean ENDIF
or
IF value > high OR value < low THEN boolean := value < high ELSE boolean := boolean ENDIF
Edit:
Still having trouble after I tried that.
There is no feedbacknode (or shift register) in your VI.
Even worse: there is a classic Rube-Goldberg and a global not needed for the task…
10-19-2018 01:55 PM
This will be a rapidly changing pressure. It will need to turn off as soon as it goes above a high limit. It will need to stay off until it goes below a low limit. At that time it need to come on and stay on until it goes above the high limit again. It will have to know the previous value and needs a way to assure which direction the pressure is going (Up or Down). IF it is within the range (not below low limit and not above high limit) then the direction the pressure is going will decide if it is on or off. On if it is going up. Off is it is going down. Needs a hysteresis I assume to assure the direction of pressure.
10-19-2018 02:05 PM - edited 10-19-2018 02:06 PM
10-19-2018 04:40 PM
Thanks. I figured it out and will post it here in case someone would like to see the answer. I can't believe how simple it was. Guess I was way over thinking it.
10-19-2018 08:26 PM - edited 10-19-2018 08:31 PM
Why do you have a For Loop executing twice?
For something with simple Either/Or values, it is easier to read code using the Select function rather than embedded case structures.
Here is a message where I posted a Vi called DeadBand.vi http://forums.ni.com/t5/LabVIEW/refrigerator-temperature-control/m-p/1096003#M484777
It is easy enough to modify if you need the reverse actions for On and Off.
10-23-2018 08:54 AM
Thanks, I took this and modified it to work for my needs.