beckhoff — 10.2.2 Issue a complex message

Samples This Sample shows how a complex message is triggered in the PLC. The Code used for a complex message is bigger than for a simple message, but you will have more configuration possibilities. 2 Messages will be created - a simple message and a quit-requiring. They will be shown with the TcEventbar. 1. Create a new PLC-Project ◦Chose PC (i386) as Target System ◦Keep the standard task-settings. ◦Create a new ST-program. ◦Open the menu Window -> Library Manager and add TcSystem.lib to the project. Now you have access to the ADSLOGEVENT function block. 2. Add following code to the project: (*Variable-declaration*) VAR bSetEvent1 : BOOL; bSetEvent2 : BOOL; bQuitEvent2 : BOOL; event1:

ADSLOGEVENT; event2: ADSLOGEVENT; CfgEvent1 : TcEvent; CfgEvent2 : TcEvent; END_VAR (*PLC Code*) (* Event 1 *) CfgEvent1.Prio := 0; CfgEvent1.bQuitRequired := FALSE; CfgEvent1.Flags := TCEVENTFLAG_LOG OR TCEVENTFLAG_SRCID; CfgEvent1.StreamType := TCEVENTSTREAM_SIMPLE; CfgEvent1.ProgId := 'TcEventFormatter.TcXmlFormatter'; CfgEvent1.Id := 1; (* Meldung 1*) CfgEvent1.SourceId := 17001; (* 17001: Achsregelung *) TcEventLogger 188 Version: 1.1