
(* system is just powered up, start TMR1 *)
(* AUTO must be declared as an init value of FALSE *)
(* TMR1 must be declared as an init value of T#0s *)
IF (AUTO=FALSE) AND (TMR1 >= T#0s) AND (TMR1 < T#1s) THEN
  TMR1 := T#1s;  
  TSTART(TMR1);
END_IF;

(* Set to AUTO mode and stop TMR1 after some time *)
IF TMR1 > ( ANY_TO_TIME(2*ANY_TO_DINT(Ts)) + T#1s ) THEN
  AUTO := TRUE;  (*set to auto mode *)
  TSTOP(TMR1);
END_IF;


