FB_AdsReadEvents

FB_AdsReadEvents 1:

The function block queries the active messages of the EventLogger via ADS and makes them available in the form of an array aEvents. To display the messages in the visualization element Event table, the array aEvents has to be entered in its property Message data array.

Messages with a text length less than or equal to 255 characters can be output in full at the output. Messages with a text length greater than 255 characters and less than or equal to 1023 characters are output with truncated text. Messages with a text length greater than 1023 characters cannot be output and the function block returns an error.

FB_AdsReadEvents 2: Inputs

VAR_INPUT
    sNetId             : T_AMSNetId;
    bReadEvents        : BOOL;
    nLanguageId        : DWORD;
    eDateAndTimeFormat : E_DateAndTimeFormat;
    tRefreshTime       : TIME
    tTimeout           : TIME
END_VAR

Name

Type

Description

sNetId

T_AMSNetId

AmsNetId of the device from which the EventLogger messages are to be queried. If the messages are to be read locally, an empty string can be specified.

bReadEvents

BOOL

The input can be used to enable reading of the messages. When the release is canceled, the error outputs (bError and nErrId) are also reset.

nLanguageId

DWORD

(Language ID) Defines which translation of the message text is to be queried.

eDateAndTimeFormat

E_DateAndTimeFormat

Defines the format of the timestamps. The available options are:

  • de_De – German notation: dd.MM.yyyy hh:mm:ss (24 h)
  • en_GB – British notation: dd/MM/yyyy hh:mm:ss (12 h)
  • en_US – American notation: MM/dd/yyyy hh:mm:ss (12 h)

tRefreshTime

TIME

Defines the time interval, after which the message query is repeated.

tTimeout

TIME

Defines the time interval, after which a timeout error is triggered.

FB_AdsReadEvents 3: Outputs

VAR_OUTPUT
    aEvents         : ARRAY[1..80] OF ST_ReadEvent;
    nNumberOfEvents : UDINT;
    bBusy           : BOOL;
    bDone           : BOOL;
    bError          : BOOL
    nErrorId        : UDINT;
END_VAR

Name

Type

Description

aEvents         

ARRAY[1..80] OF ST_ReadEvent

This array is used by the function block to make the read messages available. The array can store a maximum of 80 messages. (see ST_ReadEvent)

nNumberOfEvents

UDINT

Indicates how many messages are currently stored in the array aEvents.

bBusy

BOOL

Indicates whether the function block is currently busy.

bDone

BOOL

TRUE, if the function block is not busy at present, but has carried out at least one operation.

bError

BOOL

Indicates whether an error has occurred.

nErrorId

UDINT

Indicates the error number.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_Utilities (System)