   0:# 
   1:# ======= START RUNG 1 =======
   2:set bit '$rung_top'
   4:# start series [
   5:# ELEM_TCY
   6:if '$rung_top' {
   7:    if 'T1s' < 49 {
   8:        increment 'T1s'
   9:    } else {
  10:        let var 'T1s' := 0
  11:        if not '$oneShot_0000_TCY_T1s' {
  12:            set bit '$oneShot_0000_TCY_T1s'
  13:        } else {
  14:            clear bit '$oneShot_0000_TCY_T1s'
  15:        }
  16:    }
  17:    if not '$oneShot_0000_TCY_T1s' {
  18:        clear bit '$rung_top'
  19:    }
  20:} else {
  21:    let var 'T1s' := 0
  22:}
  24:# ELEM_COIL
  25:let bit 'R1s' := '$rung_top'
  27:# ] finish series
  28:# 
  29:# ======= START RUNG 2 =======
  30:set bit '$rung_top'
  32:# start series [
  33:# ELEM_CONTACTS
  34:if 'Rreset' {
  35:    clear bit '$rung_top'
  36:}
  38:# ELEM_CONTACTS
  39:if not 'R1s' {
  40:    clear bit '$rung_top'
  41:}
  43:# ELEM_ONE_SHOT_RISING
  44:if '$rung_top' {
  45:    if '$oneShot_0001_ONE_SHOT_RISING_' {
  46:        clear bit '$rung_top'
  47:    } else {
  48:        set bit '$oneShot_0001_ONE_SHOT_RISING_'
  49:    }
  50:} else {
  51:    clear bit '$oneShot_0001_ONE_SHOT_RISING_'
  52:}
  54:# start parallel [
  55:# ELEM_ADD
  56:if '$rung_top' {
  57:    increment 'sec'
  58:}
  60:let bit '$parThis_0000' := '$rung_top'
  61:# start series [
  62:# ELEM_GEQ
  63:let var '$scratch2' := 60
  64:if '$scratch2' > 'sec' {
  65:    clear bit '$parThis_0000'
  66:}
  68:# start parallel [
  69:# ELEM_MOVE
  70:if '$parThis_0000' {
  71:    let var 'sec' := 0
  72:}
  74:# ELEM_ADD
  75:if '$parThis_0000' {
  76:    increment 'min'
  77:}
  79:# ] finish parallel
  80:# ] finish series
  81:# ] finish parallel
  82:# ] finish series
  83:# 
  84:# ======= START RUNG 3 =======
  85:set bit '$rung_top'
  87:# start series [
  88:# ELEM_GEQ
  89:let var '$scratch2' := 2
  90:if '$scratch2' > 'min' {
  91:    clear bit '$rung_top'
  92:}
  94:# ELEM_COIL
  95:let bit 'Rrefan_1' := '$rung_top'
  97:# ] finish series
  98:# 
  99:# ======= START RUNG 4 =======
 100:# NOT TESTED
 101:# vvvvvvvvvv
 102:# 
 103:# ======= START RUNG 5 =======
 104:set bit '$rung_top'
 106:# start series [
 107:# ELEM_CONTACTS
 108:if not 'Rrefan_1' {
 109:    clear bit '$rung_top'
 110:}
 112:# ELEM_COIL
 113:let bit 'Rreset' := '$rung_top'
 115:# ] finish series
 116:# 
 117:# ======= START RUNG 6 =======
 118:set bit '$rung_top'
 120:# start series [
 121:# ELEM_READ_ADC
 122:if '$rung_top' {
 123:    read adc 'A1'
 124:}
 126:# ] finish series
 127:# 
 128:# ======= START RUNG 7 =======
 129:# analog input for temperature when become 700/1023 it goes high when droped goes low  & the timer starts for 2 min or more  to m
 130:# 
 131:# 
 132:# ======= START RUNG 8 =======
 133:set bit '$rung_top'
 135:# start series [
 136:# ELEM_GEQ
 137:let var '$scratch2' := 700
 138:if '$scratch2' > 'A1' {
 139:    clear bit '$rung_top'
 140:}
 142:# ELEM_COIL
 143:let bit 'R1' := '$rung_top'
 145:# ] finish series
 146:# 
 147:# ======= START RUNG 9 =======
 148:# Action is not clear.
 149:# vvvvvvvvvvvvvvvvvvvv
 150:# 
 151:# ======= START RUNG 10 =======
 152:set bit '$rung_top'
 154:# start series [
 155:# start parallel [
 156:clear bit '$parOut_0000'
 157:let bit '$parThis_0001' := '$rung_top'
 158:# ELEM_CONTACTS
 159:if not 'Rrefan_1' {
 160:    clear bit '$parThis_0001'
 161:}
 163:if '$parThis_0001' {
 164:    set bit '$parOut_0000'
 165:}
 166:let bit '$parThis_0001' := '$rung_top'
 167:# ELEM_ONE_SHOT_RISING
 168:if '$parThis_0001' {
 169:    if '$oneShot_0002_ONE_SHOT_RISING_' {
 170:        clear bit '$parThis_0001'
 171:    } else {
 172:        set bit '$oneShot_0002_ONE_SHOT_RISING_'
 173:    }
 174:} else {
 175:    clear bit '$oneShot_0002_ONE_SHOT_RISING_'
 176:}
 178:if '$parThis_0001' {
 179:    set bit '$parOut_0000'
 180:}
 181:let bit '$parThis_0001' := '$rung_top'
 182:# ELEM_CONTACTS
 183:if not 'YRelay_1' {
 184:    clear bit '$parThis_0001'
 185:}
 187:if '$parThis_0001' {
 188:    set bit '$parOut_0000'
 189:}
 190:let bit '$rung_top' := '$parOut_0000'
 191:# ] finish parallel
 192:# ELEM_CONTACTS
 193:if 'R1' {
 194:    clear bit '$rung_top'
 195:}
 197:# ELEM_COIL
 198:let bit 'YRelay_1' := '$rung_top'
 200:# ] finish series
