FB_SimpleAdsLogEvent

FB_SimpleAdsLogEvent 1:

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

FB_SimpleAdsLogEvent 2: 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 3: 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 4:

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 system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)