FUNCTION_BLOCK LOGGER VAR_INPUT TRIG : BOOL; MSG : STRING; LEVEL : LOGLEVEL := INFO; END_VAR VAR TRIG0 : BOOL; END_VAR IF TRIG AND NOT TRIG0 THEN END_IF; TRIG0:=TRIG; END_FUNCTION_BLOCK