Newbie PLC code help

LeBoutte

Member
Hello,
 
T1 is the outside temperature and OP2 activate my air exchanger. I would like to have my air exchanger running when the outside temperature is between 0° and 20°, not runnning between -0° and -12° and running again under -12°. I have no idea how to program this.
 
Thanks
 
What would air exchanger do when temperature above 20 and below -12?  That need to be considered in the PLC
 
Hello,
 
Thanks for the reply. I want my air exchanger:
-> runnning between 0° and 20°
-> runnning under -12°
-> not runnning between -12° and 0°
-> not running over 20°.
 
start
  tstgt T1 20
  CALLSUB STOP
  callsub CHK_TMP:
end
 
CHK_TMP:
  TSTGT T1 0
  callsub H_RUN
  TSTLT T1 -12
  SET OP2 1
RET
 
H_RUN:
  TSTLT T1 20
  SET OP2 1
RET
 
STOP:
  SET OP2 0
RET
 
That code missed to call stop when temperature between 0 to -12. Also, you probably want to define a range for motor to turn on and off little bit longer, so that motor would not start and stop too often. Keeping bounced ON and OFF could kill off motor quickly.
 
Rewrite the code, check this out:  (anything behind # or ; is skipped automatically by WebControl compiler. Those comments are not stored in EEPROM.)
 
start  # begin of PLC
  tstgt T1 20  # always check stop condition
  SET OP2 0  # turn off exchanger
  callsub CHK_TMP # check different temperature range
end # when reached this line, it will return to START line
 
CHK_TMP:   # subroutine to check temperature range
  TSTGT T1 0  # every test line TRUE will excute next line, FALSE will skip next line
  callsub H_RUN  # check high range
  TSTLT T1 -12 # test less than lower range
  callsub L_RUN  # check lower range
  TSTLE T1 0  # less than or equal zero could be stop condition
  callsub CHK_STOP  # to check this stop range, T1 at this point >= -12
  NOP # skip this line
RET
 
H_RUN:
  # anytime enters here is about 0, check if less than 20
  TSTLT T1 20
  SET OP2 1
RET
 
L_RUN:
  # anytime enter her is less than -12, run
  SET OP2 1
RET
 
CHK_STOP:
TSTGT T1 0
RET
  # anytime enters here is less than 0, check if above -12
  TSTGE T1 -12
  SET OP2 0
  NOP
RET
 
Wow! Thank you very much for taking the time to rewrite the code. Amazing support.
 
I decided to simplify my setup and let the air exchanger running between 0° and 20° only. Under 0° my air exchanger will run only when my gas furnace will be heating (hard wired with a relay in my gas furnace). I will also control the humidifier to run under 30%. Here is my code.
 
START 
   TSTGT T1 200 
   CALLSUB AIR_OFF 
   CALLSUB CHK_TMP
   TSTLE H1 030 
   CALLSUB HUM_ON 
   TSTGT H1 031 
   CALLSUB HUM_OFF 
END
 
CHK_TMP:
   TSTGT T1 0
   CALLSUB AIR_ON
RET
 
AIR_ON:
   TSTLT T1 200
   SET OP2 1
RET 
 
AIR_OFF: 
   SET OP2 0
RET 
 
HUM_ON:
   SET OP3 1
RET 
 
HUM_OFF: 
   SET OP3 0
RET 
 
I want to let you know you didn't rewrite the code for nothing. I will use it as a reference and it is very good for my learning.
 
 
I limit my HRV from running more than about 1 minute every fourty minutes during cold temperatures. I compare the dewpoints between inside and outside, and if not advantageous to the humidity in the home, keep it very short (1 minute).
 
I have found that despite multiple humidifiers I cannot keep the humidity levels higher than about 26% if I run the HRV too long under cold weather. It dries the house right out and colds, nose bleeds, and dry throats become frequent.
 
Note: I found using relative humidity levels useless. You can have high Rh outside, bring it into the home, and still drop the RH% in the house, when it warms up. Dewpoint indicates the absolute humidity in the air, no matter what the temperature.
 
Very interesting. My HRV won't run that much during cold temperatures. It will run at the same time as my gas furnace which don't run very long. I'm exploring different possibilities to run my HRV and humidifier. I'll see.
 
Thanks for you help, I greatly appreciate.
 
When I built my house in Northern South-Western Ontario I was told I would need any humidifier with a house so very tightly sealed. WRONG!!!
I didn't leave enough room around my air handler to install a central humidifier so I use a larger room type unit to keep the humidity up.
 
If I run the HRV for 20 minutes each 40 minute cycle I cannot get the humidity above about 18% using about 4 gallons of water per day, which I manually haul. I like to keep the humidity about 38%, and as a compromise, I have to cut the HRV back to about 1 minute per every 40 minutes.
 
My humidity levels are set on my ecobee thermostat. My ISY994 reads the values and cycles my humidifier in the foyer, and my HRV, accordingly.
 
It seems to be dry in your area! I have a central humidifier and have no difficulties de maintain a humidity level around 30-35%.
 
LeBoutte said:
It seems to be dry in your area! I have a central humidifier and have no difficulties de maintain a humidity level around 30-35%.
Do the math. When you bring in air from outside at -30 degrees C that is 99% RH, and warm it up to 22 degrees C, it becomes 1.92 percent RH.
http://bmcnoldy.rsmas.miami.edu/Humidity.html
 
There is no such thing as air humid enough to keep your 22C air humid and it dries it out. You can fight it with a large enough humidifier and very small HRV but you are pouring money out the window.
 
It costs money to humidify air and not only increases your water consumption, it increases your heating bill considerably. Unfortunately it is a necessary evil. My mother allowed her furnace humidifier to crust over and I watched her 1" thick maple table split from end to end with a 1/2" split that closed every summer. Then her buffet cabinet did the same down one side.
 
Back
Top