[r42]: / branches / SBSI / Vision_Game_PLC / Plc Logic / Application / Function Blocks / Puzzle / PuzzleTimerStateMachine / svnobj  Maximize  Restore  History

Download this file

16 lines (15 with data), 3.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
(* Main timer *)
ton_PuzzleTimer(IN:= , PT:=tMaxPuzzleTime , Q=> , ET=> );
IF xStartTimer THEN
	ton_PuzzleTimer.IN:=TRUE;
END_IF
IF xStopTimer THEN
	TempTime:=T#0S;
	ton_PuzzleTimer.IN:=FALSE;
(* Store actual time in temp when paused *)
IF xPauseTimer THEN
	TempTime:= TempTime + ton_PuzzleTimer.ET;
(* Calculate actual and remaining time *)
ActualPuzzleTime:= TempTime + ton_PuzzleTimer.ET;
tRemainingTime:=tMaxPuzzleTime - ActualPuzzleTime;
(* Process *)