07-03-2014 12:58 PM
Howdy,
My issue is I have an input value that is compared to an upper and lower limit. If the input is within the range I want the program to do nothing. If the input is below the lower value I need to send a "TRUE" signal to a relay. If the input is above the upper value I need to send a "FALSE" signal to the relay. Does anyone have a clever way of getting this to work?
Attached is a example of what I'm trying to do for your veiwing pleasure.
Thanks
07-03-2014 01:04 PM
Look in the comparison pallete. There is an out of range function.
07-03-2014 01:07 PM
There is an In Range and Coerce vi that lets you specify upper/lower limits and data and then tells you whether your data is within the limits, and will coerce the data so that it fits within the limits if you need it.
It is on the comparison pallete.
07-03-2014 04:03 PM
07-03-2014 06:01 PM - edited 07-03-2014 06:01 PM
I would just use a couple of Select functions with the results being based on the comparison to the upper limit and lower limit.
07-06-2014 03:34 PM - edited 07-06-2014 03:40 PM
Your description is not really complete as you don't really say anything about what should happen if the value gets back into range after being either outside of the range nor if you want to happen to set the relay repeatedly if the value stays outside the range. Usually it is not necessary to keep setting a relay to a specific state once it has been set.
I would probably do something along these lines:
This will set the relay whenever there is an out of range situation AND the last state the relay was set to is different than what it should be now.
07-08-2014 10:26 AM
What do you have in the "TRUE" cases?
07-08-2014 10:31 AM
If the question is for me, I attached to you the VI
07-08-2014 11:12 AM
This code is to charge/discharge a battery in my system. So when the voltage drops below the lower limit the relay state should become "TRUE" which starts charging the battery. The state of the relay needs to remain "TRUE" until voltage exceeds the upper limit, at which point the relay state becomes "FALSE" which allows me to draw power from my battery again.
07-09-2014 05:23 AM - edited 07-09-2014 05:24 AM
It's a snippet and should be possible to just pull on your desktop and from there onto a LabVIEW diagram.
Inside the true case I simply wire a TRUE constant to the output that defines if the next case structure acuating the relay should execute and the lower limit boolean straight through. It allows to intialize the system on first run, so that the shift register and relay are in a defined state to begin with.