11-05-2013 02:17 PM
Hello everyone! I am now trying to create a range by using two numerical controls, but I do not know how to connect these two controls together in Block Diagram.
I need to create this scenario, this range (set by these controls) to be above a fluctuating number (temperature) before the fan is being turned on; sort of like a control 1 "AND" control 2 must be above this temperature, other conditions are being ignored.
Thank you in advance for the help!
Solved! Go to Solution.
11-05-2013 02:20 PM
Try the old inrange and coerce in place of that <=
11-05-2013 02:30 PM
I just tried the range and coerce function, however it seems like in my case the fan goes off at the minimum value but it is switched on again once the temperature goes above the minimum value; which gives a on-and-off situation every two or three seconds. I wish it to switch off at this minimum value and switch on again only after it hits the maximum value.
Thanks!
11-05-2013 02:53 PM
please post your vi and not a png to fully understand the big picture
11-05-2013 03:06 PM
Use a case statement where the two cases are the current state of the fan (1 for on and 1 for off). When the fan is on, compare the temp with the lower threshold. When the temp drops below it, turn the fan off. Now, the fan off case, will compare the current temp to the upper threshold, turning the fan on once you exceed the threshold.
11-05-2013 03:12 PM
Apok : Thanks for suggestion, I will probably do it tomorrow as I am away from the resources now.
pjr1121 : Thank you for your solution to my problem, I can feel that I am near to completing this one task! I will update again tomorrow!
Have a great night everyone!
11-05-2013 03:56 PM
I created a subVI I called deadband which adds this hysteresis effect.
11-06-2013 03:15 AM
Hi pjr1121,
Your method seems to be the one I am seeking for, but I am unsure how do I connect to a case statement in my case; there is no "fan off" function, just when to turn it on.
I have attached pictures of how I have connected them, but it seems like only the false case is working whereas the true case is not.
Does anyone know what is wrong with my connection please?
Thank you!
11-06-2013 06:04 AM
@jqlee wrote:
sort of like a control 1 "AND" control 2 must be above this temperature
That sounds like 2 Less Or Equals (1 for each control) and the results ANDed together. Or am I misunderstanding something?
11-06-2013 07:18 AM
Thanks for your reply, crossrulz.
If I use 2 Less Or Equals and AND them, it will give me the following:
0 0 0
1 0 0
0 1 0
1 1 1 } Which means the fan will only be turned on when the temperature is lesser or equal to both of the set values
In this case, the fan will be switched on if the conditions are met and it will be switched on forever because the temperature will be kept low, with the fan already on.
I have deduced two logics as shown:
Logic 1:
1 1 1
1 0 1
0 1 1
0 0 0 } Done with an OR gate. Fan will only be switched off when the temperature is lower than the upper limit and lower than the lower limit.
Logic 2:
1 1 1
1 0 0
0 1 0
0 0 0 } Done with an AND gate. This is the range I need, only when the temperature is higher than the both upper and lower limit; the fan is turned on.
However I need to have the tool to utilise these two conditions at the same time, meaning when fan is on, logic 1 kicks in; when fan is off, logic 2 kicks in.
Thanks!