SendCustomDeviceIcon

SendCustomDeviceIcon 1:

This method allows the user to send a user-defined icon to be displayed at the top level of a Communicator function block. The TwinCAT cube is displayed here by default. The icon is transmitted as a Base64-encoded string and can also be changed at runtime.

Please note that, depending on the image size, large amounts of data may be transferred. This means that more storage space is required in the PLC, the message broker and the app. For static images, it is therefore recommended that the icon is only transferred once when the program is started. By saving the image in the retain topic, it remains permanently available for all subsequent clients.

Syntax

METHOD SendCustomDeviceIcon : BOOL
VAR_INPUT
    pBase64EncodedIconString : POINTER TO STRING;
    bIsIconMulticolor        : BOOL;
END_VAR

SendCustomDeviceIcon 2: Return value

Name

Type

Description

SendCustomDeviceIcon

BOOL

The method returns the return value TRUE if the call was successful.

SendCustomDeviceIcon 3: Inputs

Name

Type

Description

pBase64EncodedIconString

POINTER TO STRING

Pointer to the Base64 string that contains the image. The image must be converted from an image format to a Base64 string using a converter. Please note that only the Base64 string is specified here.

bIsIconMulticolor

BOOL

Set to TRUE for multicolor icons to ensure that colors are not inverted when the app is running in Dark Mode. If this setting is set to FALSE, the icon will always be displayed in black and white.

Possible errors are output at the outputs bError and hrErrorCode of the function block instance.