Color data

The ColorSymbol attribute can be bound to different symbols. To avoid inconsistencies between the output color value and the data type of the symbol, the Color Control reads the type of the symbol and tries to automatically derive the correct return type.

For example, if three color channels are to be displayed, but an array of type TcVnVector4_LREAL is linked in the PLC, these types do not match. The Color Control automatically recognizes this and writes an array with four values instead of three into the symbol, so that no error occurs. The rest of the channel is left empty.

The read-only ColorValue attribute is used to make the color programmatically accessible without binding a symbol to the ColorSymbol property. Other than that, there is no difference. It is possible to use both versions at the same time. Please note that ColorValue also outputs the data type of the symbol that is bound to ColorSymbol.

The SliderValueUpdate attribute is used to specify whether the color symbol should be updated during onChanged or at the end of an interaction onConfirmed with the sliders.

In analogy to the ColorValue property, the SetColorValue function provides a way to set the color values of this control without linking a symbol with the ColorSymbol property.

The two ways of accessing the color value are explained in the following samples:

The Conversion to HMI color object example shows how the color data can also be used for other use cases.