﻿<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
  <POU Name="debugMessage_timed" Id="{da121be4-28aa-4c48-8c3d-084fa2fbe8cd}" SpecialFunc="None">
    <Declaration><![CDATA[FUNCTION_BLOCK DebugMessage_timed // will only trigger if more than 1sec since last call
VAR_INPUT
	st1 : STRING := '';
	st2 : STRING := '';
	st3 : STRING := '';
END_VAR
VAR
	timer : tof;
END_VAR
]]></Declaration>
    <Implementation>
      <ST><![CDATA[// If FB is called more often than every second, it will not send/repeat message.
// It needs to be left alone for more than 1 sec. to transmit a new debug message.
timer();							// update timer to get Q
IF timer.Q THEN						// if still on 
	timer(IN := TRUE,PT := T#1S); 	// refresh timer
	timer(IN := FALSE);
	RETURN;
END_IF
timer(IN := TRUE,PT := T#1S);
DebugMessage(st1,st2,st3);
timer(IN := FALSE);]]></ST>
    </Implementation>
  </POU>
</TcPlcObject>