VAR
RunTime_first AT %QD80: DWORD; (*1#螺杆压缩机累计运行时间*)
RunTime_second AT %QD84: DWORD; (*2#压缩机累计运行时间*)
RunTime_third AT %QD88: DWORD; (*3#压缩机累计运行时间*)
RunTime_fourth AT %QD92: DWORD; (*4#压缩机累计运行时间*)
P_Less: BOOL; (*中间辅助继电器,检测压力小于设定压力值标志*)
M3: BOOL; (*2#压缩机运行标志*)
M4: BOOL; (*3#压缩机运行标志*)
M5: BOOL; (*4#压缩机运行标志*)
END_VAR
(*2#压缩机未运行,累计运行时间是2#3#4#中最短,检测总压力低于设定标准压力值,启动2#压缩机*)
IF RunTime_second <= RunTime_third
AND RunTime_second <= RunTime_fourth
AND P_Less=TRUE AND M3=0
THEN M3 = TRUE;
END_IF;
(*2#压缩机未运行,累计运行时间是未运行压缩机中较小者时,检测总压力低于设定标准压力值,启动2#压缩机*)
(*3#压缩机累计运行时间最短,但3#压缩机正处于运行状态,2#压缩机累计运行时间是未运行压缩机2#和4#
中较小者时,检测总压力低于设定标准压力值,启动2#压缩机*)
IF RunTime_second >= RunTime_third
AND RunTime_second <= RunTime_fourth
AND P_Less=TRUE AND M3=0 AND M4=1
THEN M3 = TRUE;
END_IF;
先传一部分上来,期待回音....
楼主最近还看过