Configuration of the event table

The visualization element "event table" works in combination with the function block "FB_AdsReadEvents". The function block is therefore added to the PLC program first. It is included in the library "Tc2_Utilities". In this example the function block is declared and called in the program "MAIN". Since the messages of the local TcEventLogger are to be read, an empty string can be entered under the input "sNetId".

PROGRAM MAIN
VAR
    fbAdsReadEvents : FB_AdsReadEvents;
    bReadEvents : BOOL;
END_VAR
fbAdsReadEvents (    sNetId := ‚‘,
                bReadEvents := bReadEvents,
                nLanguageId := 1031,
                eDateAndTimeFormat := E_DateAndTimeFormat.de_DE,
                tRefreshTime := T#1S,
                tTimeout := T#5s);

In order to be able to add the visualization element "event table" on a visualization page, the corresponding extension for the element must be selected in the PLC project settings under the category "Visualization Profile".

Configuration of the event table 1:

After activation of this setting the TwinCAT project has to be restarted once. The element is then available in the toolbox in the category "special control elements" and can be used on the visualization page.

Configuration of the event table 2:

Once the element has been added to the visualization page, the array "aEvents" of the instance "fbAdsReadEvents", in which the messages are stored, is entered on the properties, and the size is set to 565x285 pixels.

Configuration of the event table 3:

To center the text in the index column, change the text property "Horizontal alignment" to “Centered” in the category "Columns" → "Index column". Moreover, the font size and color of the message text is adjusted in the "Detail properties", in order to distinguish it from the other information.

Configuration of the event table 4:

At runtime the visualization element looks as follows, if two example messages were triggered.

Configuration of the event table 5: