Blinklicht in SFC programmieren mit Codesys V3

Code:
VAR
  timer : TON;
  counter : INT := 1;
END_VAR

timer(PT:=t#200ms,IN:=not timer.Q);

if timer.Q and counter<7 then 
  if (counter mod 2) = 0 then
     lampe := false; 
  else
    lampe := true;
  counter := counter + 1;
end_if
 
VAR timer : TON; t : time := T#200ms;END_VARtimer(PT:=t,IN:=not timer.Q);Ausgang := timer.ET < timer.PT/2;
 
Zurück
Oben