beckhoff — 10.3.1 Integration of TcEventViewer ActiveX control

Samples (* 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.DataFormatStrAddress := ADR(format); CfgEvent2.Class := TCEVENTCLASS_ALARM; event2( NETID:= '', PORT:= 110, Event:= bSetEvent2, EventQuit:= bQuitEvent2, EventConfigData:= CfgEvent2, EventDataAddress := ADR(value), EventDataLength := SIZEOF(value), TMOUT:= t#10s); 4. Trigger the event You can transfer multiple variables by wrapping them inside a structure.

Then the format string must define the order of the variables inside the struct. When a string is transferred with the eventdata, this string must be the last element in the structure. Only one string at a time may be transferred. (*data types*) TYPE ST_EventData1 : STRUCT axis : UDINT; pos : LREAL; text : STRING; END_STRUCT END_TYPE (*variable-declaration*) ... format : STRING := '%d%f%s' Eventdata1 : ST_EventData1; ... (*PLC ode*) ... EventDataAddress := ADR(Eventdata1), EventDataLength :=SIZEOF(Eventdata1), ... Requirements 10.3 Visual Studio C++ 10.3.1 Integration of TcEventViewer ActiveX control 1. Create a new MFC exe Project. TcEventLogger 190 Version:

1.1 Language / IDE Source code TwinCAT PLC (Structured Text) https://infosys.beckhoff.com/content/1033/ TcEventLogger/Resources/12333059979/.zip