API reference

Namespaces

Name

Description

TcHmi

TwinCAT HMI namespace

Functions

Name

Description

tchmi_base64decode

Decodes a Base64 string.

tchmi_base64encode

Encodes a user-defined text string into a Base64 string.

tchmi_equal

Compares two values for equality

tchmi_clone_object

Clones a data object.

tchmi_path

Restores a path.

tchmi_create_guid

Creates a string with a Globally Unique Identifier

Constants

Name

Description

TCHMI_ENGINEERING

Available from version 1.12

Is true if the framework has been loaded into the Designer or Live View instance.

TCHMI_DESIGNER

Available from version 1.12

Is true if the framework has been loaded into the Designer instance.

TCHMI_LIVEVIEW

Available from version 1.12

Is true if the framework has been loaded into Live View instance.

TCHMI_RUNTIME

Available from version 1.12

Is true if the framework was loaded into the Runtime instance.

TCHMI_ENABLE_DESIGNER_MODE

Available from version 1.8
Deprecated from version 1.12

Please use instead: TCHMI_ENGINEERING

Is true if the framework has been loaded into the Designer or Live View instance.

TCHMI_ENABLE_DESIGNER_MODE_MASTER

Available from version 1.8
Deprecated from version 1.12

Please use instead: TCHMI_DESIGNER

Is true if the framework has been loaded into the Designer instance.

TCHMI_ENABLE_DESIGNER_MODE_SLAVE

Available from version 1.8
Deprecated from version 1.12

Please use instead: TCHMI_LIVEVIEW

Is true if the framework has been loaded into Live View instance.

TCHMI_CONSOLE_LOG_LEVEL

Available from version 1.8

See TcHmi.Log

Events

The framework fires many events at different times. These can be used graphically or via JavaScript code (TcHmi.EventProvider.register).

Each control has many events, which are documented under the control (see Base Control, for example). The system also provides a series of events:

Name

Description

onConfigChanged

Available from version 1.12

There was a change in the tchmiconfig.json file. This can only occur during engineering.

onInitialized

Available from version 1.8

At this point, the system is initialized and the main control (view) was loaded. Other controls may not be loaded or visible at this time.

onLocaleChanged

Available from version 1.8

The language of the current display has been set or changed.

onThemeDataChanged

Available from version 1.10

The theme system has new values or CSS styles. In addition, this event is fired when a new font is loaded. This can happen at any time for characters that have never been displayed on the screen before.

onUserChanged

Available from version 1.12

A new user has been logged in.

onUserDataChanged

Available from version 1.12

A new user has been logged in and / or the configuration (time zone, ...) of the current user is now known to the system or has changed.

onUserInGroupChanged

Available from version 1.8

The system now knows or has changed the group membership of the current user.

onWebSocketOpened

Available from version 1.8

The communication to the server was successfully established.

onWebSocketClosed

Available from version 1.8

The communication to the server was interrupted. In normal operation, the connection is automatically re-established.