The behaviour of eTON is been treated in this topic, unfortunately is an Italian topic. The eTON Q output works according the On-delay (TON) timing IEC-61131 raccomandation (Here the logic diagram) the only difference is in the ET output that it’s not reset, but the time is not remembered at the new IN activation. When the IN is been deactivated it stops the count (ET remains at its value) but when the IN is activated again the ET is reset and starts to count from 0. Here the eTON FB source code, on red the modify to be written to match the IEC raccomandation.
(* If the IN is not active resets the ouput and save time. *)
IF NOT(IN) THEN
ET:=0; (* Executing time (mS) to be inserted to exactly match the IEC raccomandation *)
TimeBf:=SysTime; (* Time buffer *)
Q:=FALSE; (* Delayed output *)
RETURN;
END_IF;
(* IN active, and if Q is active checks if PT is greather than ET and resets Q. *)
IF (Q) THEN
IF (PT > ET) THEN Q:=FALSE; END_IF;
RETURN;
END_IF;
(* Checks if time is been elapsed. *)
ET:=SysTime-TimeBf; (* Executing time (mS) *)
IF (ET >= PT) THEN
Q:=TRUE; (* Delayed output *)
ET:=PT; (* Executing time (mS) *)
END_IF;
To help you, here the print of a sample project with the eTON source code, so you can modify it according the IEC raccomandations.