__FBL_RET := _PUSHCALLFB EPOCH_TIME  CURRENTTIMERTC 
__TMPULI1 := CURRENTTIMERTC [ __CDINT00000004 ]
_PUSH_PAR __TMPULI1 
__TMPI1 := _CALL ANY_TO_ULINT 
TIME_CURRENTTIME := __TMPI1 
__TMPB1 := _NOT TEST_MODE 
_IF _NOT __TMPB1 _GOTO __LAB1 
CONTACTOR_STATUS := DIGITALINPUT_STATUS_0 
START_BUTTON := DIGITALINPUT_STATUS_1 
AUTO_MODE := DIGITALINPUT_STATUS_2 
HAND_MODE := DIGITALINPUT_STATUS_3 
_PUSH_PAR _IO_P1_AI_00 
__TMPR3 := _CALL ANY_TO_UINT 
__TMPR__LINEARSCALE__RAW_INP := __TMPR3 
__FBL_RET := _PUSHCALLFB LINEARSCALE  LINEARSCALE_PRESSURE 
_PUSH_PAR _IO_P1_AI_01 
__TMPR3 := _CALL ANY_TO_UINT 
__TMPR__LINEARSCALE__RAW_INP := __TMPR3 
__FBL_RET := _PUSHCALLFB LINEARSCALE  LINEARSCALE_FLOW 
__TMPR3 := LINEARSCALE_PRESSURE [ __CDINT0000000C ]
PRESSURE_IN := __TMPR3 
__TMPR3 := LINEARSCALE_FLOW [ __CDINT0000000C ]
FLOWRATE := __TMPR3 
_GOTO __LAB2 
__LAB1 : 
CONTACTOR_STATUS := CMD_RUN 
VOLTAGEOK := TRUE 
__LAB2 : 
_IF _NOT __SYSVA_FIRST_SCAN _GOTO __LAB3 
SHUTDOWN_TIME := TIME_CURRENTTIME 
DEVICE_STATUS := __TMPM1 
DEVICE_STATUS_INT := __CUINT00000001 
RESTART_COMMAND := FALSE 
RESTART_ALLOWED := FALSE 
RUN_PERMISSIVE := FALSE 
START_PERMISSIVE := FALSE 
CFG_READ := TRUE 
STS_TIMERRUNTIMESET := FALSE 
STS_TIMERWAITTIMESET := FALSE 
STS_TIMERCYCLEACTIVE := FALSE 
STS_TRIPCOUNTINCREASED := FALSE 
VAL_OVERLOADTRIPCOUNT := __DINT_NULL 
VAL_TRIPCOUNT := __DINT_NULL 
_GOTO __LAB4 
__LAB3 : 
__LAB4 : 
__TMPLRE3 := E300 [ __DINT_NULL ]
_PUSH_PAR __TMPLRE3 
__TMPR3 := _CALL ANY_TO_LREAL 
E300_KWH := __TMPR3 
__TMPLRE3 := E300 [ __CDINT00000008 ]
_PUSH_PAR __TMPLRE3 
__TMPR3 := _CALL ANY_TO_LREAL 
E300_KWH_REGEN := __TMPR3 
_IF _NOT DOWNHOLE_TOOL_ENABLED _GOTO __LAB5 
__TMPI1 := __CDINT00000002 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
_PUSH_PAR __TMPUIN1 
__TMPR3 := _CALL ANY_TO_UINT 
__TMPR3 := __TMPR3 / __TMPR4 
DH_INTAKETEMPERATURE := __TMPR3 
__TMPI1 := __CDINT00000003 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
_PUSH_PAR __TMPUIN1 
__TMPR3 := _CALL ANY_TO_UINT 
__TMPR3 := __TMPR3 - __TMPR5 
DH_INTAKEPRESSURE := __TMPR3 
__TMPI1 := __CDINT0000000A - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
DH_NUMCHANNELS := __TMPUIN1 
__TMPI1 := __CDINT0000000B - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
DH_TOOLVOLTAGE := __TMPUIN1 
__TMPI1 := __CDINT00000028 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
_PUSH_PAR __TMPUIN1 
__TMPR3 := _CALL ANY_TO_UINT 
__TMPR3 := __TMPR3 / __TMPR4 
DH_MAXINTAKETEMPERATURE_STARTUP := __TMPR3 
__TMPI1 := __CDINT00000029 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
DH_MAXINTAKEPRESSURE_STARTUP := __TMPUIN1 
__TMPI1 := __CDINT00000063 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
DH_DOWNHOLESTATUS_INT := __TMPUIN1 
__TMPR3 := __TMPR6 / __TMPR7 
__TMPR8 := DH_INTAKEPRESSURE * __TMPR3 
__TMPR9 := __TMPR6 / CFG_SPECIFICGRAVITY 
__TMPR8 := __TMPR8 * __TMPR9 
__TMPR8 := __TMPR8 + CFG_DHSENSORDISTTOINTAKE 
DH_FLUID_LEVEL := __TMPR8 
__TMPI1 := __CDINT00000063 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ0 [ __TMPI1 ]
_PUSH_PAR __TMPUIN1 
__TMPI2 := _CALL ANY_TO_UINT 
__TMPB1 := __TMPI2 <> __DINT_NULL 
_IF __TMPB1 _GOTO __LAB7 
DH_DOWNHOLESTATUS := __TMPM2 
_GOTO __LAB6 
__LAB7 : 
__TMPB1 := __TMPI2 <> __CDINT00000001 
_IF __TMPB1 _GOTO __LAB8 
DH_DOWNHOLESTATUS := __TMPM3 
_GOTO __LAB6 
__LAB8 : 
__TMPB1 := __TMPI2 <> __CDINT00000002 
_IF __TMPB1 _GOTO __LAB9 
DH_DOWNHOLESTATUS := __TMPM4 
_GOTO __LAB6 
__LAB9 : 
__TMPB1 := __TMPI2 <> __CDINT00000003 
_IF __TMPB1 _GOTO __LABa 
DH_DOWNHOLESTATUS := __TMPM5 
_GOTO __LAB6 
__LABa : 
__TMPB1 := __TMPI2 <> __CDINT00000004 
_IF __TMPB1 _GOTO __LABb 
DH_DOWNHOLESTATUS := __TMPM6 
_GOTO __LAB6 
__LABb : 
DH_DOWNHOLESTATUS := __TMPM7 
__LAB6 : 
__TMPI1 := __CDINT00000005 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ1000 [ __TMPI1 ]
DH_TOOLTYPE := __TMPUIN1 
__TMPI1 := __CDINT00000007 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ1000 [ __TMPI1 ]
__TMPUIN1 := __TMPUIN1 * __CUINT000003E8 
DH_PSIRATING := __TMPUIN1 
__TMPI1 := __CDINT00000008 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ1000 [ __TMPI1 ]
_PUSH_PAR __TMPUIN1 
__TMPR3 := _CALL ANY_TO_UINT 
__TMPR3 := __TMPR3 / __TMPR4 
DH_MAXINTAKETEMPERATURE_FOREVER := __TMPR3 
__TMPI1 := __CDINT00000009 - __CDINT00000001 
__TMPI1 := __TMPI1 * __CDINT00000002 
__TMPUIN1 := MODBUS_READ1000 [ __TMPI1 ]
DH_MAXINTAKEPRESSURE_FOREVER := __TMPUIN1 
_GOTO __LABc 
__LAB5 : 
DH_DOWNHOLESTATUS := __TMPM8 
PRESSURE_SHUTDOWN_ENABLED := FALSE 
PRESSURE_STARTUP_ENABLED := FALSE 
TEMP_SHUTDOWN_ENABLED := FALSE 
TEMP_STARTUP_ENABLED := FALSE 
__LABc : 
__TMPB1 := PRESSURE_TRANSDUCER_ENABLED _AND CONTACTOR_STATUS 
__TMPB2 := RUN_TIME > PRESSURE_ALARM_STARTUP_DELAY 
__TMPB1 := __TMPB1 _AND __TMPB2 
_IF _NOT __TMPB1 _GOTO __LABd 
__TMPB3 := PRESSURE_IN >= PRESSURE_HI_SP 
_IF _NOT __TMPB3 _GOTO __LABe 
PRESSURE_HI := TRUE 
PRESSURE_LO := FALSE 
_GOTO __LABf 
__LABe : 
__TMPB1 := PRESSURE_IN <= PRESSURE_LO_SP 
_IF _NOT __TMPB1 _GOTO __LAB10 
PRESSURE_HI := FALSE 
PRESSURE_LO := TRUE 
_GOTO __LABf 
__LAB10 : 
PRESSURE_HI := FALSE 
PRESSURE_LO := FALSE 
__LABf : 
__TMPB1 := _NOT PRESSURE_HI 
__TMPB2 := _NOT PRESSURE_LO 
__TMPB1 := __TMPB1 _AND __TMPB2 
_IF _NOT __TMPB1 _GOTO __LAB11 
PRESSURE_OK := TRUE 
PRESSURE_OOT_SCANS := __UDINT_NULL 
PRESSURE_OOT_SECONDS := __UDINT_NULL 
_GOTO __LAB12 
__LAB11 : 
__TMPUDI1 := PRESSURE_OOT_SCANS + __CUDINT00000001 
PRESSURE_OOT_SCANS := __TMPUDI1 
_PUSH_PAR __SYSVA_TCYCURRENT 
__TMPUDI1 := _CALL ANY_TO_TIME 
__TMPUDI2 := PRESSURE_OOT_SCANS * __TMPUDI1 
__TMPUDI2 := __TMPUDI2 / __CUDINT000003E8 
PRESSURE_OOT_SECONDS := __TMPUDI2 
__LAB12 : 
__TMPB1 := PRESSURE_OOT_SECONDS > PRESSURE_ALARM_DELAY 
_IF _NOT __TMPB1 _GOTO __LAB13 
PRESSURE_OK := FALSE 
_GOTO __LAB14 
__LAB13 : 
__LAB14 : 
_GOTO __LAB15 
__LABd : 
PRESSURE_OK := TRUE 
__LAB15 : 
__TMPB1 := _NOT PRESSURE_OK 
ALARM_TUBINGPRESSURE := __TMPB1 
__TMPB1 := _NOT PRESSURE_STARTUP_ENABLED 
__TMPB2 := DH_INTAKEPRESSURE > PRESSURE_STARTUP 
__TMPB1 := __TMPB1 _OR __TMPB2 
SP_PRESSURE := __TMPB1 
__TMPB1 := _NOT TEMP_STARTUP_ENABLED 
__TMPB2 := DH_INTAKETEMPERATURE < TEMP_STARTUP 
__TMPB1 := __TMPB1 _OR __TMPB2 
SP_TEMPERATURE := __TMPB1 
__TMPB1 := HAND_MODE _OR AUTO_MODE 
__TMPB1 := __TMPB1 _OR TEST_MODE 
SP_MODE := __TMPB1 
__TMPB1 := _NOT TRIPSTATUS 
SP_TRIP := __TMPB1 
SP_VOLTAGE := VOLTAGEOK 
__TMPB1 := SP_PRESSURE _AND SP_TEMPERATURE 
__TMPB1 := __TMPB1 _AND SP_MODE 
__TMPB1 := __TMPB1 _AND SP_TRIP 
__TMPB1 := __TMPB1 _AND SP_VOLTAGE 
START_PERMISSIVE := __TMPB1 
__TMPB1 := _NOT START_PERMISSIVE 
__TMPB2 := _NOT CMD_RUN 
__TMPB1 := __TMPB1 _AND __TMPB2 
_IF _NOT __TMPB1 _GOTO __LAB16 
DEVICE_STATUS := __TMPM9 
DEVICE_STATUS_INT := __CUINT00000002 
_GOTO __LAB17 
__LAB16 : 
__LAB17 : 
__TMPB1 := DEVICE_STATUS = __TMPM9 
__TMPB1 := __TMPB1 _AND START_PERMISSIVE 
__TMPB2 := _NOT CMD_RUN 
__TMPB1 := __TMPB1 _AND __TMPB2 
_IF _NOT __TMPB1 _GOTO __LAB18 
DEVICE_STATUS := __TMPM10 
DEVICE_STATUS_INT := __CUINT00000003 
_GOTO __LAB19 
__LAB18 : 
__LAB19 : 
__TMPB1 := _NOT PRESSURE_SHUTDOWN_ENABLED 
__TMPB2 := DH_INTAKEPRESSURE > PRESSURE_SHUTDOWN 
__TMPB1 := __TMPB1 _OR __TMPB2 
RP_PRESSURE := __TMPB1 
__TMPB1 := _NOT TEMP_SHUTDOWN_ENABLED 
__TMPB2 := DH_INTAKETEMPERATURE < TEMP_SHUTDOWN 
__TMPB1 := __TMPB1 _OR __TMPB2 
RP_TEMPERATURE := __TMPB1 
__TMPB1 := HAND_MODE _OR AUTO_MODE 
__TMPB1 := __TMPB1 _OR TEST_MODE 
RP_MODE := __TMPB1 
__TMPB1 := _NOT TRIPSTATUS 
RP_TRIP := __TMPB1 
RP_TUBINGPRESSURE := PRESSURE_OK 
__TMPB1 := RP_PRESSURE _AND RP_TEMPERATURE 
__TMPB1 := __TMPB1 _AND RP_MODE 
__TMPB1 := __TMPB1 _AND RP_TRIP 
__TMPB1 := __TMPB1 _AND RP_TUBINGPRESSURE 
RUN_PERMISSIVE := __TMPB1 
__TMPB1 := _NOT RP_PRESSURE 
__TMPB1 := __TMPB1 _AND CONTACTOR_STATUS 
ALARM_DHPRESSURE := __TMPB1 
__TMPB1 := _NOT RP_TEMPERATURE 
__TMPB1 := __TMPB1 _AND CONTACTOR_STATUS 
ALARM_DHTEMPERATURE := __TMPB1 
__TMPB1 := _NOT RUN_PERMISSIVE 
__TMPB1 := __TMPB1 _AND CMD_RUN 
_IF _NOT __TMPB1 _GOTO __LAB1a 
DEVICE_STATUS := __TMPM11 
DEVICE_STATUS_INT := __CUINT00000004 
SHUTDOWN_TIME := TIME_CURRENTTIME 
__TMPB1 := _NOT STS_TRIPCOUNTINCREASED 
_IF _NOT __TMPB1 _GOTO __LAB1b 
_IF _NOT OVERLOADTRIP _GOTO __LAB1c 
__TMPI1 := VAL_OVERLOADTRIPCOUNT + __CDINT00000001 
VAL_OVERLOADTRIPCOUNT := __TMPI1 
_GOTO __LAB1d 
__LAB1c : 
__TMPI1 := VAL_TRIPCOUNT + __CDINT00000001 
VAL_TRIPCOUNT := __TMPI1 
__LAB1d : 
STS_TRIPCOUNTINCREASED := TRUE 
_GOTO __LAB1e 
__LAB1b : 
__LAB1e : 
_GOTO __LAB1f 
__LAB1a : 
__LAB1f : 
__TMPB1 := VAL_OVERLOADTRIPCOUNT > CFG_OVERLOADTRIPCOUNTLIMIT 
_IF _NOT __TMPB1 _GOTO __LAB20 
RESTART_ALLOWED := FALSE 
DEVICE_STATUS := __TMPM12 
DEVICE_STATUS_INT := __CUINT00000005 
STS_TRIPLIMITOLREACHED := TRUE 
_GOTO __LAB21 
__LAB20 : 
STS_TRIPLIMITOLREACHED := FALSE 
__LAB21 : 
__TMPB1 := VAL_TRIPCOUNT > CFG_TRIPCOUNTLIMIT 
_IF _NOT __TMPB1 _GOTO __LAB22 
RESTART_ALLOWED := FALSE 
DEVICE_STATUS := __TMPM13 
DEVICE_STATUS_INT := __CUINT00000006 
STS_TRIPLIMITREACHED := TRUE 
_GOTO __LAB23 
__LAB22 : 
STS_TRIPLIMITREACHED := FALSE 
__LAB23 : 
__TMPB1 := START_COMMAND _OR START_BUTTON 
__TMPB1 := __TMPB1 _AND START_PERMISSIVE 
_IF _NOT __TMPB1 _GOTO __LAB24 
TEST_STARTED := TRUE 
RESTART_ALLOWED := TRUE 
_IF _NOT CFG_TIMERMODEENABLED _GOTO __LAB25 
STS_TIMERCYCLEACTIVE := TRUE 
CMD_TIMERRUN := TRUE 
_GOTO __LAB26 
__LAB25 : 
__LAB26 : 
_GOTO __LAB27 
__LAB24 : 
__LAB27 : 
__TMPB1 := _NOT OVERLOADTRIP 
__TMPB2 := AUTO_MODE _AND __TMPB1 
__TMPB3 := _NOT CMD_RUN 
__TMPB2 := __TMPB2 _AND __TMPB3 
__TMPB4 := STS_TIMERCYCLEACTIVE _AND CMD_TIMERRUN 
__TMPB5 := _NOT STS_TIMERCYCLEACTIVE 
__TMPB4 := __TMPB4 _OR __TMPB5 
__TMPB2 := __TMPB2 _AND __TMPB4 
__TMPB2 := __TMPB2 _AND RESTART_ALLOWED 
_IF _NOT __TMPB2 _GOTO __LAB28 
__TMPI1 := TIME_CURRENTTIME - SHUTDOWN_TIME 
__TMPB6 := __TMPI1 > DOWNTIME_TIME_PARAMETER 
_IF _NOT __TMPB6 _GOTO __LAB29 
__TMPB7 := _NOT RESTART_COMMAND 
_IF _NOT __TMPB7 _GOTO __LAB2a 
TRIPRESETCMD := TRUE 
RESTART_COMMAND := TRUE 
_IF _NOT CFG_TIMERMODEENABLED _GOTO __LAB2b 
CMD_TIMERRUN := TRUE 
STS_TIMERCYCLEACTIVE := TRUE 
_GOTO __LAB2c 
__LAB2b : 
__LAB2c : 
_GOTO __LAB2d 
__LAB2a : 
__LAB2d : 
_GOTO __LAB2e 
__LAB29 : 
_IF _NOT CFG_TIMERMODEENABLED _GOTO __LAB2f 
CMD_TIMERRUN := FALSE 
_GOTO __LAB30 
__LAB2f : 
__LAB30 : 
STS_TIMERCYCLEACTIVE := FALSE 
RESTART_COMMAND := FALSE 
__TMPI1 := TIME_CURRENTTIME - SHUTDOWN_TIME 
__TMPI2 := DOWNTIME_TIME_PARAMETER - __TMPI1 
TIME_UNTIL_STARTUP := __TMPI2 
__TMPI1 := TIME_UNTIL_STARTUP / __CDINT0000003C 
TIME_UNTIL_STARTUP_MIN := __TMPI1 
__TMPI1 := TIME_UNTIL_STARTUP_MIN * __CDINT0000003C 
__TMPI2 := TIME_UNTIL_STARTUP - __TMPI1 
TIME_UNTIL_STARTUP_SEC := __TMPI2 
_PUSH_PAR TIME_UNTIL_STARTUP_MIN 
__TMPM14 := _CALL ANY_TO_DINT 
__TMPM14 := __TMPM14 + __TMPM15 
_PUSH_PAR TIME_UNTIL_STARTUP_SEC 
__TMPM17 := _CALL ANY_TO_DINT 
__TMPM18 := __TMPM16 + __TMPM17 
_PUSH_PAR __TMPM18 
_PUSH_PAR __CDINT00000002 
__TMPM19 := _CALL RIGHT 
__TMPM14 := __TMPM14 + __TMPM19 
TIME_UNTIL_STARTUP_STRING := __TMPM14 
_IF _NOT AUTO_MODE _GOTO __LAB31 
__TMPM14 := __TMPM20 + TIME_UNTIL_STARTUP_STRING 
DEVICE_STATUS := __TMPM14 
DEVICE_STATUS_INT := __CUINT00000007 
_GOTO __LAB32 
__LAB31 : 
__LAB32 : 
__LAB2e : 
_GOTO __LAB33 
__LAB28 : 
__TMPB1 := AUTO_MODE _AND OVERLOADTRIP 
__TMPB2 := _NOT CMD_RUN 
__TMPB1 := __TMPB1 _AND __TMPB2 
__TMPB1 := __TMPB1 _AND RESTART_ALLOWED 
_IF _NOT __TMPB1 _GOTO __LAB34 
__TMPI1 := TIME_CURRENTTIME - SHUTDOWN_TIME 
__TMPB3 := __TMPI1 > DOWNTIME_TIME_PARAMETER_OL 
_IF _NOT __TMPB3 _GOTO __LAB35 
__TMPB4 := _NOT RESTART_COMMAND 
_IF _NOT __TMPB4 _GOTO __LAB36 
RESTART_COMMAND := TRUE 
_IF _NOT CFG_TIMERMODEENABLED _GOTO __LAB37 
CMD_TIMERRUN := TRUE 
STS_TIMERCYCLEACTIVE := TRUE 
_GOTO __LAB38 
__LAB37 : 
__LAB38 : 
_GOTO __LAB39 
__LAB36 : 
__LAB39 : 
_GOTO __LAB3a 
__LAB35 : 
_IF _NOT CFG_TIMERMODEENABLED _GOTO __LAB3b 
CMD_TIMERRUN := FALSE 
_GOTO __LAB3c 
__LAB3b : 
__LAB3c : 
STS_TIMERCYCLEACTIVE := FALSE 
RESTART_COMMAND := FALSE 
__TMPI1 := TIME_CURRENTTIME - SHUTDOWN_TIME 
__TMPI2 := DOWNTIME_TIME_PARAMETER_OL - __TMPI1 
TIME_UNTIL_STARTUP := __TMPI2 
__TMPI1 := TIME_UNTIL_STARTUP / __CDINT0000003C 
TIME_UNTIL_STARTUP_MIN := __TMPI1 
__TMPI1 := TIME_UNTIL_STARTUP_MIN * __CDINT0000003C 
__TMPI2 := TIME_UNTIL_STARTUP - __TMPI1 
TIME_UNTIL_STARTUP_SEC := __TMPI2 
_PUSH_PAR TIME_UNTIL_STARTUP_MIN 
__TMPM14 := _CALL ANY_TO_DINT 
__TMPM14 := __TMPM14 + __TMPM15 
_PUSH_PAR TIME_UNTIL_STARTUP_SEC 
__TMPM17 := _CALL ANY_TO_DINT 
__TMPM18 := __TMPM16 + __TMPM17 
_PUSH_PAR __TMPM18 
_PUSH_PAR __CDINT00000002 
__TMPM19 := _CALL RIGHT 
__TMPM14 := __TMPM14 + __TMPM19 
TIME_UNTIL_STARTUP_STRING := __TMPM14 
_IF _NOT AUTO_MODE _GOTO __LAB3d 
__TMPM14 := __TMPM21 + TIME_UNTIL_STARTUP_STRING 
DEVICE_STATUS := __TMPM14 
DEVICE_STATUS_INT := __CUINT00000008 
_GOTO __LAB3e 
__LAB3d : 
__LAB3e : 
__LAB3a : 
_GOTO __LAB33 
__LAB34 : 
__LAB33 : 
__TMPB1 := START_BUTTON _OR START_COMMAND 
__TMPB1 := __TMPB1 _OR CMD_TIMERRUN 
__TMPB2 := RESTART_ALLOWED _AND RESTART_COMMAND 
__TMPB1 := __TMPB1 _OR __TMPB2 
__TMPB1 := __TMPB1 _AND START_PERMISSIVE 
__TMPB1 := __TMPB1 _OR CMD_RUN 
__TMPB3 := _NOT STOP_COMMAND 
__TMPB1 := __TMPB1 _AND __TMPB3 
__TMPB4 := _NOT CFG_TIMERMODEENABLED 
__TMPB5 := CMD_TIMERRUN _OR __TMPB4 
__TMPB1 := __TMPB1 _AND __TMPB5 
__TMPB1 := __TMPB1 _AND RUN_PERMISSIVE 
_IF _NOT __TMPB1 _GOTO __LAB3f 
CMD_RUN := TRUE 
RESTART_COMMAND := FALSE 
START_COMMAND := FALSE 
__TMPB1 := _NOT START_TIME_SET 
_IF _NOT __TMPB1 _GOTO __LAB40 
START_TIME := TIME_CURRENTTIME 
START_TIME_SET := TRUE 
DEVICE_STATUS := __TMPM22 
DEVICE_STATUS_INT := __CUINT00000009 
STS_TRIPCOUNTINCREASED := FALSE 
_GOTO __LAB41 
__LAB40 : 
__LAB41 : 
_IF _NOT CONTACTOR_STATUS _GOTO __LAB42 
__TMPI1 := TIME_CURRENTTIME - START_TIME 
RUN_TIME := __TMPI1 
_GOTO __LAB43 
__LAB42 : 
__LAB43 : 
_GOTO __LAB44 
__LAB3f : 
CMD_RUN := FALSE 
__LAB44 : 
__TMPB1 := _NOT CONTACTOR_STATUS 
__TMPB2 := CMD_RUN _AND __TMPB1 
_IF _NOT __TMPB2 _GOTO __LAB45 
__TMPB3 := _NOT E300_OUTPUT_ENABLE 
_IF _NOT __TMPB3 _GOTO __LAB46 
_IF _NOT E300_OUTPUT_TOGGLED _GOTO __LAB47 
E300_OUTPUT_ENABLE := TRUE 
_GOTO __LAB48 
__LAB47 : 
__LAB48 : 
E300_OUTPUT_TOGGLED := TRUE 
_GOTO __LAB49 
__LAB46 : 
__TMPB1 := _NOT E300_OUTPUT_TOGGLED 
_IF _NOT __TMPB1 _GOTO __LAB4a 
E300_OUTPUT_ENABLE := FALSE 
_GOTO __LAB4b 
__LAB4a : 
__LAB4b : 
__LAB49 : 
_GOTO __LAB4c 
__LAB45 : 
__LAB4c : 
__TMPB1 := RUN_TIME > CFG_CLEARTRIPCOUNTAFTER 
__TMPB2 := CONTACTOR_STATUS _AND __TMPB1 
_IF _NOT __TMPB2 _GOTO __LAB4d 
VAL_OVERLOADTRIPCOUNT := __DINT_NULL 
VAL_TRIPCOUNT := __DINT_NULL 
_GOTO __LAB4e 
__LAB4d : 
__LAB4e : 
__TMPB1 := _NOT AUTO_MODE 
_IF _NOT __TMPB1 _GOTO __LAB4f 
RESTART_COMMAND := FALSE 
RESTART_ALLOWED := FALSE 
_GOTO __LAB50 
__LAB4f : 
__LAB50 : 
__FBL_RET := _PUSHCALLFB R_TRIG  RTRIG_AUTOMODE 
__TMPB1 := RTRIG_AUTOMODE [ __CDINT00000002 ]
_IF _NOT __TMPB1 _GOTO __LAB51 
RESTART_ALLOWED := TRUE 
SHUTDOWN_TIME := TIME_CURRENTTIME 
_GOTO __LAB52 
__LAB51 : 
__LAB52 : 
_IF _NOT STOP_COMMAND _GOTO __LAB53 
RESTART_ALLOWED := FALSE 
DEVICE_STATUS := __TMPM23 
DEVICE_STATUS_INT := __CUINT0000000A 
STS_TIMERCYCLEACTIVE := FALSE 
VAL_OVERLOADTRIPCOUNT := __DINT_NULL 
VAL_TRIPCOUNT := __DINT_NULL 
CMD_TIMERRUN := FALSE 
STS_TIMERRUNTIMESET := FALSE 
_GOTO __LAB54 
__LAB53 : 
__LAB54 : 
__TMPB1 := _NOT HAND_MODE 
__TMPB2 := _NOT AUTO_MODE 
__TMPB1 := __TMPB1 _AND __TMPB2 
_IF _NOT __TMPB1 _GOTO __LAB55 
VAL_OVERLOADTRIPCOUNT := __DINT_NULL 
VAL_TRIPCOUNT := __DINT_NULL 
CMD_TIMERRUN := FALSE 
STS_TIMERCYCLEACTIVE := FALSE 
STS_TIMERRUNTIMESET := FALSE 
_GOTO __LAB56 
__LAB55 : 
__LAB56 : 
__TMPB1 := _NOT CONTACTOR_STATUS 
_IF _NOT __TMPB1 _GOTO __LAB57 
START_TIME_SET := FALSE 
_GOTO __LAB58 
__LAB57 : 
__LAB58 : 
__TMPB1 := CFG_TIMERMODEENABLED _AND STS_TIMERCYCLEACTIVE 
_IF _NOT __TMPB1 _GOTO __LAB59 
_IF _NOT CMD_TIMERRUN _GOTO __LAB5a 
__TMPB2 := _NOT STS_TIMERRUNTIMESET 
_IF _NOT __TMPB2 _GOTO __LAB5b 
STS_TIMERRUNTIMESET := TRUE 
TIME_TIMERRUNTIME := TIME_CURRENTTIME 
_GOTO __LAB5c 
__LAB5b : 
__LAB5c : 
__TMPI1 := CFG_TIMERRUNTIME * __CDINT0000003C 
__TMPI2 := TIME_CURRENTTIME - TIME_TIMERRUNTIME 
__TMPI1 := __TMPI1 - __TMPI2 
TIMER_RUNTIMELEFT := __TMPI1 
__TMPB1 := TIMER_RUNTIMELEFT <= __DINT_NULL 
_IF _NOT __TMPB1 _GOTO __LAB5d 
CMD_TIMERRUN := FALSE 
STS_TIMERRUNTIMESET := FALSE 
_GOTO __LAB5e 
__LAB5d : 
__LAB5e : 
__TMPI1 := TIMER_RUNTIMELEFT / __CDINT0000003C 
TIME_RUNTIMELEFTMIN := __TMPI1 
__TMPI1 := TIME_RUNTIMELEFTMIN * __CDINT0000003C 
__TMPI2 := TIMER_RUNTIMELEFT - __TMPI1 
TIME_RUNTIMELEFTSEC := __TMPI2 
_GOTO __LAB5f 
__LAB5a : 
__TMPB1 := _NOT STS_TIMERWAITTIMESET 
_IF _NOT __TMPB1 _GOTO __LAB60 
STS_TIMERWAITTIMESET := TRUE 
TIME_TIMERWAITTIME := TIME_CURRENTTIME 
DEVICE_STATUS := __TMPM24 
DEVICE_STATUS_INT := __CUINT0000000B 
_GOTO __LAB61 
__LAB60 : 
__LAB61 : 
__TMPI1 := CFG_TIMERWAITTIME * __CDINT0000003C 
__TMPI2 := TIME_CURRENTTIME - TIME_TIMERWAITTIME 
__TMPI1 := __TMPI1 - __TMPI2 
TIMER_WAITTIMELEFT := __TMPI1 
__TMPB1 := TIMER_WAITTIMELEFT <= __DINT_NULL 
_IF _NOT __TMPB1 _GOTO __LAB62 
CMD_TIMERRUN := TRUE 
STS_TIMERWAITTIMESET := FALSE 
_GOTO __LAB63 
__LAB62 : 
__LAB63 : 
__TMPI1 := TIMER_WAITTIMELEFT / __CDINT0000003C 
TIME_WAITTIMELEFTMIN := __TMPI1 
__TMPI1 := TIME_WAITTIMELEFTMIN * __CDINT0000003C 
__TMPI2 := TIMER_WAITTIMELEFT - __TMPI1 
TIME_WAITTIMELEFTSEC := __TMPI2 
__LAB5f : 
_GOTO __LAB64 
__LAB59 : 
__LAB64 : 
__TMPB1 := _NOT CFG_TIMERMODEENABLED 
__TMPB1 := __TMPB1 _OR STOP_COMMAND 
_IF _NOT __TMPB1 _GOTO __LAB65 
CMD_TIMERRUN := FALSE 
STS_TIMERRUNTIMESET := FALSE 
STS_TIMERWAITTIMESET := FALSE 
_GOTO __LAB66 
__LAB65 : 
__LAB66 : 
__TMPB1 := TRIPSTATUS _OR OVERLOADTRIP 
_IF _NOT __TMPB1 _GOTO __LAB67 
_PUSH_PAR TIME_CURRENTTIME 
_PUSH_PAR CFG_RESETCYCLE 
__TMPI1 := _CALL MOD 
__TMPB2 := __TMPI1 = __DINT_NULL 
_IF _NOT __TMPB2 _GOTO __LAB68 
TRIPRESETCMD := TRUE 
_GOTO __LAB69 
__LAB68 : 
__LAB69 : 
_GOTO __LAB6a 
__LAB67 : 
__LAB6a : 
