FB_SimpleAdsLogEvent

FB_SimpleAdsLogEvent 1:

This function block allows the sending and acknowledgment of messages to the TwinCAT EventLogger. As opposed to the ADSLOGEVENT block, events cannot be parameterized from the PLC with the FB_SimpleAdsLogEvent block; however, events can be set, reset and acknowledged in a simple manner.

FB_SimpleAdsLogEvent 2:

TwinCAT EventLogger vs. TwinCAT 3 EventLogger

The TwinCAT EventLogger was replaced by the successor TwinCAT 3 EventLogger. The older TwinCAT EventLogger is supported by TwinCAT 3 up to version 3.1.4024. Newer TwinCAT versions (>= 3.1.4026.0) only support the newer TwinCAT 3 EventLogger. PLC function blocks for this can be found in the PLC library Tc3_EventLogger.

FB_SimpleAdsLogEvent 3: Inputs

VAR_INPUT
    SourceId   : INT;
    EventId    : INT;
    bSetEvent  : BOOL;
    bQuit      : BOOL;
END_VAR

Name

Type

Description

SourceId

INT

ID of the source. Used to clearly identify the source in the EventLogger.

EventId

INT

ID of the event. Used to clearly identify the event in the EventLogger.

bSetEvent

BOOL

The "coming" of the event is signaled with the rising edge, the "going" of the event with the falling edge.

bQuit

BOOL

The event is acknowledged with the rising edge.

FB_SimpleAdsLogEvent 4: Outputs

VAR_OUTPUT
    ErrId     : UDINT;
    Error     : BOOL;
END_VAR

Name

Type

Description

ErrId

UDINT

ADS error code or command-specific error code of the last executed command. Is reset to 0 by the execution of a command at the inputs.

Error

BOOL

This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in ErrId. If the function block has a timeout error, Error is TRUE and ErrId is 1861 (hexadecimal 0x745). Is reset to FALSE by the execution of a command at the inputs.

Acknowledge messages

FB_SimpleAdsLogEvent 5:

The upper figure represents the general sequence.

In the case of messages not requiring acknowledgment, the event is announced with the rising edge at the event input of the function block and is thus active in the EventLogger. The falling edge at the event input initiates the reset. This signal deletes the event in the EventLogger again.

In the case of messages requiring acknowledgment, the event is activated again with the rising edge at the event input. The event is deactivated either

If there is a reset of the event between event activation and arrival of the acknowledgement, the next arrival of the event input is called "signal". A request is thus announced in case of already active events.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0
up to
TwinCAT v3.1.4024

PC or CX (x86, x64, ARM)

Tc2_System (system)