I'm going to use a board to control my wood/oil furnace. It won't replace my $$$$ AB plc until I know it will work safely and I have learned as many quirks and techniques as possible about this board first.
The program will work like such:
Check duct temp (T5) for hot and overheat (IP8 N/C). If either is on then force blower to high. If neither is on then proceed. If room temp (T1) is below setpoint then on until above setpoint. Do this every 500 loops or on 1st scan. Check to see if oil is selected or wood is selected. If heat is enabled and oil on then turn oil on else goto wood. Check duct temp and determine blower speed. I forgot to add in a limit switch function to turn oil or wood off well before the overheat is reached. I use excel because it makes it easier for me to write the code in blocks then paste together when I'm ready.
I saw someone had a program to compile code with comments but can't remember where I saw it. If you remember it, I would appreciate a link to it. Here's the code I have so far. Any and all thoughts are appreciated. If I can condense it or sweeten it or add additional safety features not considered, that would be great. Thanks.
START
GOTO INIT
INIT:
TSTEQ IP8 0
GOTO SAFETY
INC RAM8
TSTEQ RAM8 500
GOTO TSTAT
TSTEQ RAM8 0
GOTO TSTAT
NOP
GOTO OVERHEAT
NOP
TSTAT:
TSTLE T1 UROM1
ANDB RAM1 32766 RAM1
ORB RAM1 1 RAM1
TSTGE T1 UROM2
ANDB RAM1 32766 RAM1
SET RAM8 1
GOTO INIT
NOP
OVERHEAT:
TSTLE T5 1650
ORB RAM1 1024 RAM1
ANDB RAM1 31743 RAM1
ANDB RAM1 1024
BZ SAFETY
TSTEQ IP8 1
ORB RAM1 2048 RAM1
ANDB RAM1 30719 RAM1
ANDB RAM1 3072
BZ SAFETY
ANDB RAM1 1
BNZ HEAT
GOTO INIT
NOP
Fan_spd:
TSTLE T5 1200
ANDB RAM1 32511 RAM1
ORB RAM1 256 RAM1
TSTLE T5 1400
ANDB RAM1 32255 RAM1
ORB RAM1 512 RAM1
ANDB RAM1 768
BNZ HI_SPD
ANDB RAM1 256
BNZ LO_SPD
ANDB RAM1 256
BZ FAN_OFF
GOTO INIT
NOP
FAN_OFF:
SET OP3 0
SET OP4 0
GOTO INIT
SET VAR1 RAM1
NOP
SAFETY:
SET OP1 0
SET OP2 0
SET OP3 0
SET OP4 1
GOTO INIT
NOP
LO_SPD:
SET OP3 1
SET OP4 0
SET VAR1 RAM1
GOTO INIT
NOP
HI_SPD:
SET OP3 0
SET OP4 1
SET VAR1 RAM1
GOTO INIT
XNOP
HEAT:
ANDB RAM1 3
BNZ OIL
SET OP1 0
ANDB RAM1 5
BNZ WOOD
SET OP2 0
GOTO FAN_SPD
NOP
OIL:
ANDB RAM1 3
SET OP1 1
SET OP2 0
GOTO FAN_SPD
NOP
WOOD:
ANDB RAM1 5
SET OP2 1
SET OP1 0
GOTO FAN_SPD
END
The program will work like such:
Check duct temp (T5) for hot and overheat (IP8 N/C). If either is on then force blower to high. If neither is on then proceed. If room temp (T1) is below setpoint then on until above setpoint. Do this every 500 loops or on 1st scan. Check to see if oil is selected or wood is selected. If heat is enabled and oil on then turn oil on else goto wood. Check duct temp and determine blower speed. I forgot to add in a limit switch function to turn oil or wood off well before the overheat is reached. I use excel because it makes it easier for me to write the code in blocks then paste together when I'm ready.
I saw someone had a program to compile code with comments but can't remember where I saw it. If you remember it, I would appreciate a link to it. Here's the code I have so far. Any and all thoughts are appreciated. If I can condense it or sweeten it or add additional safety features not considered, that would be great. Thanks.
START
GOTO INIT
INIT:
TSTEQ IP8 0
GOTO SAFETY
INC RAM8
TSTEQ RAM8 500
GOTO TSTAT
TSTEQ RAM8 0
GOTO TSTAT
NOP
GOTO OVERHEAT
NOP
TSTAT:
TSTLE T1 UROM1
ANDB RAM1 32766 RAM1
ORB RAM1 1 RAM1
TSTGE T1 UROM2
ANDB RAM1 32766 RAM1
SET RAM8 1
GOTO INIT
NOP
OVERHEAT:
TSTLE T5 1650
ORB RAM1 1024 RAM1
ANDB RAM1 31743 RAM1
ANDB RAM1 1024
BZ SAFETY
TSTEQ IP8 1
ORB RAM1 2048 RAM1
ANDB RAM1 30719 RAM1
ANDB RAM1 3072
BZ SAFETY
ANDB RAM1 1
BNZ HEAT
GOTO INIT
NOP
Fan_spd:
TSTLE T5 1200
ANDB RAM1 32511 RAM1
ORB RAM1 256 RAM1
TSTLE T5 1400
ANDB RAM1 32255 RAM1
ORB RAM1 512 RAM1
ANDB RAM1 768
BNZ HI_SPD
ANDB RAM1 256
BNZ LO_SPD
ANDB RAM1 256
BZ FAN_OFF
GOTO INIT
NOP
FAN_OFF:
SET OP3 0
SET OP4 0
GOTO INIT
SET VAR1 RAM1
NOP
SAFETY:
SET OP1 0
SET OP2 0
SET OP3 0
SET OP4 1
GOTO INIT
NOP
LO_SPD:
SET OP3 1
SET OP4 0
SET VAR1 RAM1
GOTO INIT
NOP
HI_SPD:
SET OP3 0
SET OP4 1
SET VAR1 RAM1
GOTO INIT
XNOP
HEAT:
ANDB RAM1 3
BNZ OIL
SET OP1 0
ANDB RAM1 5
BNZ WOOD
SET OP2 0
GOTO FAN_SPD
NOP
OIL:
ANDB RAM1 3
SET OP1 1
SET OP2 0
GOTO FAN_SPD
NOP
WOOD:
ANDB RAM1 5
SET OP2 1
SET OP1 0
GOTO FAN_SPD
END