11-06-2013 07:52 AM
jqlee wrote:meaning when fan is on, logic 1 kicks in; when fan is off, logic 2 kicks in.
That certainly sounds like a case structure to me. You need some sort of feedback to tell if the fan is on or not to select the right case. Leave your controls outside of the case structure so you have the values for both cases.
11-06-2013 08:49 AM
Thie logic is really not that hard guys,
11-06-2013 09:01 AM
and jeff created a greedy loop
11-06-2013 09:06 AM
@Neos wrote:
and jeff created a greedy loop
to demo logic thats not horrid (Besides I've got lots of cores)
But, Yes, that is a greedy loop. so, Neos, since you brought it up drop in a few links on why we avoid them so the next new developer who runs across this can learn why.
11-06-2013 09:08 AM
Jeffs logic diagram is on the right track, and there probably is a basic logic method to implement this, but it curently has a problem. The design intent was to turn the fan OFF once it drops below the lower threshold. Since the last logic block is an AND gate that accepts the upper threshold condition as an input, the fan will turn off long before it reaches the lower threshold.
Ex. Lower threshold = 10, upper threshold = 20, current temp = 21... Turn Fan ON...
Temp begins to drop. Current temp reaches 19, fan turns off.
I have attached a figure of what I described as a case statement solution. The lower part of the picture is merely showing the other state.
11-06-2013 09:09 AM
Thanks Jeff Bohrer for your solution!
I think in this case which you presented, the Fan will stop at the lower limit and come on again at the lower limit; the upper limit should be the point at which the fan is being turned on again. (e.g. the fan will be turning on and off at the lower limit) This is a hysteresis case as RavensFan mentioned.
Previously case statement has been mentioned (pjr1121 and crossrulz), I think that should be the solution however I do not know how to use it; I am watching videos and reading tutorials now trying to figure out how to wire up my logics into a case statement.
I will work hard!
11-06-2013 09:11 AM - edited 11-06-2013 09:16 AM
@jqlee wrote:
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.
It is a boolean output. A fan is going to be either ON or OFF, just like a boolean is going to be either TRUE or FALSE.
Note: Mine is a subVI that is meant to be used inside of your main VI. It uses the feedback node to remember the status of the fan output between iterations. Drop it into a VI. Wire up controls and indicators. Put a loop around it and run it. You'll see it does exactly what you want it to do.
11-06-2013 09:14 AM
@pjr1121 wrote:
Jeffs logic diagram is on the right track, and there probably is a basic logic method to implement this, but it curently has a problem. The design intent was to turn the fan OFF once it drops below the lower threshold. Since the last logic block is an AND gate that accepts the upper threshold condition as an input, the fan will turn off long before it reaches the lower threshold.
Ex. Lower threshold = 10, upper threshold = 20, current temp = 21... Turn Fan ON...
Temp begins to drop. Current temp reaches 19, fan turns off.
I have attached a figure of what I described as a case statement solution. The lower part of the picture is merely showing the other state.
Yes pjr1121, thanks for your post!
I think you grasped the picture I am trying to paint here, I will try out your example and see how it goes; thank you so much!
I will update on my result here again! Cheers guys!
11-06-2013 09:46 AM - edited 11-06-2013 09:49 AM
@jqlee wrote:
Thanks Jeff Bohrer for your solution!
I think in this case which you presented, the Fan will stop at the lower limit and come on again at the lower limit; the upper limit should be the point at which the fan is being turned on again.
w a t c h- http://www.screencast.com/t/llktNGegoeDY you read the logic wrong
11-06-2013 09:52 AM
@JÞB wrote:
@Neos wrote:
and jeff created a greedy loop
Neos, since you brought it up drop in a few links on why we avoid them so the next new developer who runs across this can learn why. :smileywink
http://forums.ni.com/t5/LabVIEW/Labview-Loop-Takes-100-cpu/m-p/2178410/highlight/true#M700082
http://forums.ni.com/t5/LabVIEW/cpu-uses/m-p/1853459/highlight/true#M630860
many more ................................