Type: |
Function block |
Available as of: |
V1.1.0.0 |
Inherits from: |
– |
Implements: |
|
Versions: |
Current version |
The function block FB_EventWriter provides methods and properties for setting events for the EcoStruxure Machine Expert Twin.
For connecting to an EcoStruxure Machine Expert Twin, the OPC UA server must be active.
The events are written to the OPC UA structure to be read by the EcoStruxure Machine Expert Twin for further processing.
Internal Events Buffer
To avoid extensive OPC UA structures, an internal events buffer is implemented to store the incoming events.
Incoming events are copied to an internal events buffer. When a connection to an EcoStruxure Machine Expert Twin is detected, the method Update writes the oldest data from the internal events buffer to the OPC UA structure. Once the EcoStruxure Machine Expert Twin has acknowledged that data has been received, new data is written from the internal events buffer to the OPC UA structure until all events from the buffer have been written to the OPC UA structure.
If no EcoStruxure Machine Expert Twin is connected, no data is written from the internal events buffer to the OPC UA structure.
The internal events buffer works like a ring buffer: When the buffer is full and no EcoStruxure Machine Expert Twin is connected, the oldest data in the buffer is overwritten.
You can modify the size of the internal events buffer through the global parameter Gc_udiInternalEventsBufferSize. It is a good practice to choose a value that is 4...5 times the size of the OPC UA structure (Gc_udiMaxNumberOfEventData).
Name |
Data type |
Accessing |
Description |
---|---|---|---|
lrBufferFillLevel |
LREAL |
Read |
Indicates the memory usage of the internal events buffer in percentage. |
udiFreeBufferPositions |
UDINT |
Read |
Indicates the number of free positions of the internal events buffer. |
xTwinConnected |
BOOL |
Read |
Indicates TRUE if an EcoStruxure Machine Expert Twin is connected. |
udiTimeoutTwin |
UDINT |
Read/Write |
The timeout period for the connection between EcoStruxure Machine Expert Twin and the connected controller in milliseconds (ms). Default value: 1000 ms. |