TwinCAT 3 EventLogger Interface

The TwinCAT 3 EventLogger technology facilitates the exchange of events between various TwinCAT components and other systems. The events are created and triggered in the TwinCAT system. The LabVIEW™ blocks enable current TwinCAT events to be received or logged TwinCAT events to be read from the cache of the TwinCAT target system. The target system is identified via the AMS NetId. The read events can be of the message or alarm type. The main difference between the event types is that messages are stateless, while alarms have the following states: Not-Raised, Raised, (optional) WaitForConfirmation and (optional) Confirmed or Reset. For more detailed information on the TwinCAT 3 EventLogger, as well as for the TwinCAT-side implementation, see "Technical introduction" of the TE1000 | TwinCAT 3 EventLogger.

The example TwinCAT 3 EventLogger Interface.vi describes the use of the TwinCAT EventLogger blocks.

Init TwinCAT EventLogger

The VI Init TwinCAT EventLogger initializes the TwinCAT 3 EventLogger interface in LabVIEW™ for a target system. An EventLogger User Event is also provided, which enables newly generated events to be received dynamically. The received User Event must be released by the user after the release of the TwinCAT 3 EventLogger Handle (see below “Release TwinCAT Eventlogger”).

TwinCAT 3 EventLogger Interface 1:

Input/output

Meaning

[4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

[5] TargetAddr

AMS NetID of the TwinCAT target system

[6] EventLogger User Event

User Event reference number to the EventLogger event generated by Init

Run TwinCAT EventLogger

The VI Run TwinCAT EventLogger starts the TwinCAT 3 EventLogger interface. This block is executed until the TwinCAT 3 EventLogger interface is stopped (see “Stop TwinCAT EventLogger” as follows).

TwinCAT 3 EventLogger Interface 2:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

Stop TwinCAT EventLogger

The VI Stop TwinCAT EventLogger stops the retrieval of TwinCAT 3 Eventlogs.

TwinCAT 3 EventLogger Interface 3:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

Release TwinCAT EventLogger

The VI Release TwinCAT EventLogger releases the handle to the TwinCAT 3 EventLogger from the memory.

TwinCAT 3 EventLogger Interface 4:

Input/output

Meaning

[0] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

TwinCAT EventLogger Add Filter

The VI TwinCAT EventLogger Add Filter adds a filter to the TwinCAT 3 EventLogger interface. The VI is a polymorphic VI. This allows flexible use of the VI depending on the filter to be added. If several filters are to be added, the "FilterSettings" version of the VI can be used (alternatively, the VI can also be called several times sequentially). A description of the corresponding versions of the VI can be found in the LabVIEW™ Help window for the corresponding VIs.

TwinCAT 3 EventLogger Interface 5:

Availability (from TwinCAT 3.1 Build 4026)

The EventLogger filters are available for target systems from TwinCAT 3.1 Build 4026.

TwinCAT 3 EventLogger Interface 6:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

[5] EventFilterSettings

This input depends on the selected option of the polymorphic VI.

[6] Filter Settings

String that describes the applied Filter Settings (in the form (COND1 AND COND2 AND ...). Can be used to check whether the desired filters are applied.

TwinCAT EventLogger Clear Filter

The VI TwinCAT EventLogger Clear Filter removes a filter from the TwinCAT 3 EventLogger interface. The VI is a polymorphic VI. This allows the VI to be used flexibly depending on the filter to be removed. If you want to remove all filters, use the "All" option of the VI. A description of the corresponding options can be found in the LabVIEW™ Help window.

TwinCAT 3 EventLogger Interface 7:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

[5] EventFilterSettings

This input depends on the selected option of the polymorphic VI.

[6] Filter Settings

String that describes the applied Filter Settings (in the form (COND1 AND COND2 AND ...). Can be used to check whether the desired filters are applied.

TwinCAT EventLogger Get Filter Settings

The VI TwinCAT EventLogger Get Filter Settings reads the currently applied filter settings from the TwinCAT 3 EventLogger interface.

TwinCAT 3 EventLogger Interface 8:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

[6] Filter Settings

String that describes the applied Filter Settings (in the form (COND1 AND COND2 AND ...). Can be used to check whether the desired filters are applied.

TwinCAT EventLogger Get Logged Events

The VI TwinCAT EventLogger Get Logged Events reads the past logged events from the configured TwinCAT target system. The configured filter settings are taken into account.

TwinCAT 3 EventLogger Interface 9:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

[5] Max entries

Maximum number of events to be read

[6] Logged Events

Array containing the logged events

TwinCAT EventLogger Get Active Alarms

The VI TwinCAT EventLogger Get Active Alarms reads the active alarms from the configured TwinCAT target system. The unused filter settings are taken into account here.

TwinCAT 3 EventLogger Interface 10:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

[6] Active Alarms

Array containing the active alarms

TwinCAT EventLogger Clear Logged Events Cache

The VI Clear Logged Events Cache clears the Event Cache on the configured TwinCAT target system. This operation cannot be undone and all events in the cache are deleted.

TwinCAT 3 EventLogger Interface 11:

Input/output

Meaning

[0][4] TwinCAT EventLogger Handle

Handle to the TwinCAT EventLogger

TwinCAT EventLogger Event to Table Entry

The VI TwinCAT EventLogger Event to Table Entry converts a structure of the type "TwinCAT EventLogger Event" into a table entry. All elements of the structure are converted into strings and merged into a string array.

TwinCAT 3 EventLogger Interface 12:

Input/output

Meaning

[1] TwinCAT EventLogger Event

Event data of type "TwinCAT EventLogger Event"

[0] Table Entry

String array containing the respective elements of the TwinCAT EventLogger event as a string.