这是一个时间继电器的宏,放在background的宏里面
plc m115 ON 启动计时,现在的问题是M115 ON 后计时启动,但M115 off后,又重复计时
大家帮我看看问题出在哪,谢谢了!!
IFB {Link1}1@PLC_M115 == ON THEN GOTO LABEL 1
IFB {Link1}1@PLC_M114 == OFF THEN GOTO LABEL 2
LABEL 1
$408 = $400 * 60
$410 = $408 + $402
$404 = 0
$406 = 0
$412 = 0
FOR $410
$412 = $412 + 1
$404 = $412 / 60
$414 = $404 * 60
$406 = $412 - $414
DELAY(1010)
NEXT
IFB {Link1}1@PLC_M114 == OFF THEN GOTO LABEL 2
BITON ({Link1}1@PLC_M94)
BITON ({Link1}1@PLC_M116)
FOR 5
DELAY 1005
NEXT
END
LABEL 2
BITOFF ({Link1}1@PLC_M94)
BITOFF ({Link1}1@PLC_M116)
BITOFF ({Link1}1@PLC_M94)
END
ENDIF