手寫的一個(gè)定時(shí)器 可以通用其他plc
SettingTimeold :=SettingTime*1000.0;
IF Enable THEN
IF NOT DelayedComplete AND CurrentTime<=SettingTimeold THEN
CurrentTime:=CurrentTime+100.0; (*利用掃描周期計(jì)算時(shí)間,掃描周期100ms*)
IF CurrentTime>=SettingTimeold THEN
CurrentTime:=0.0;
DelayedComplete:=TRUE;
END_IF;
END_IF;
ELSE
DelayedComplete:=FALSE;
CurrentTime:=0.0;
END_IF;
EnableOld :=Enable ;