FB_SimpleAdsLogEvent
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.
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. |
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. |
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
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
- by the falling edge at the event input (if an acknowledgment signal had previously come from the PLC with the Quit input or from the visualization) or
- by the rising edge at the Quit input (if a reset had previously been initiated by a falling edge at the event input).
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 | PC or CX (x86, x64, ARM) | Tc2_System (system) |