beckhoff — 10.2.3 Issue a message with format parameters

Samples CfgEvent1.Class := TCEVENTCLASS_MESSAGE; (* Event 2 *) CfgEvent2.Prio := 0; CfgEvent2.bQuitRequired := TRUE; CfgEvent2.Flags := TCEVENTFLAG_LOG OR TCEVENTFLAG_SRCID; CfgEvent2.StreamType := TCEVENTSTREAM_SIMPLE; CfgEvent2.ProgId := 'TcEventFormatter.TcXmlFormatter'; CfgEvent2.Id := 2; (* Meldung 2*) CfgEvent2.SourceId := 17001; (* 17001: Achsregelung *) CfgEvent2.Class := TCEVENTCLASS_ALARM; event1( NETID:= '', PORT:= 110, Event:= bSetEvent1, EventConfigData:= CfgEvent1, TMOUT:= t#10s); event2( NETID:= '', PORT:= 110, Event:= bSetEvent2, EventQuit:= bQuitEvent2, EventConfigData:= CfgEvent2, TMOUT:= t#10s); 3. Start the PLC Program. 4.

Start the TcEventbar ('TwinCAT/Eventlogger' directory). 5. By toggling bSetEvent1 the message will be triggered. Rising edge starts the message, otherwise it will be reset. Cause no message texts are configured you will have a error in the fields Source and Message. 6. Toggling bSetEvent2 wont reset the message cause it is a quit-requiring message. It must be deleted before bSetEvent2 can be reset and bQuitEvent2 must be set. 7. Continue with the message text configuration [ } 184] Requirements 10.2.3 Issue a message with format parameters Its possible to transfer one or more variables with a message. This example shows how to do it. 1.

Create a PLC Project like in the previous Sample [ } 187] 2. Add following variables to the variable configuration: value : DWORD := 0; format : STRING := '%d'; 3. Now Change the configuration for the Event: The value 'value' will be transferred; The string 'format' describes the data format. TcEventLogger 189 Version: 1.1 Language / IDE Source code TwinCAT PLC (Structured Text) https://infosys.beckhoff.com/content/1033/ TcEventLogger/Resources/12333058571/.zip