Lighting

The described widget is suitable for displaying light sources in the app. The various configuration options are described below. In the figure all available features of the widget are active.

Lighting 1:

The widget is transferred as a substructure in the overall structure of the SendData() method. To build the widget, various PLC attributes are used when declaring the structure.

{attribute 'iot.ReadOnly' := 'false'}
{attribute 'iot.DisplayName' := 'Name for Widget'}
{attribute 'iot.WidgetType' := 'Lighting'}
{attribute 'iot.LightValueVisible' := 'true'}
{attribute 'iot.LightSliderVisible' := 'true'}
{attribute 'iot.LightModeVisible' := 'true'}
{attribute 'iot.LightModeChangeable' := 'true'}
stLightingWidgetSample : ST_LightingWidgetSample;

Attribute

Data type

Description

iot.ReadOnly

BOOL

Determines whether the widget on the app side gets only read access (TRUE) or also additional write access to the PLC (FALSE).

iot.DisplayName

STRING

The display name of the widget in the app. This will be overwritten by sDisplayName as soon as sDisplayName is not an empty string.

iot.WidgetType

STRING

Type specification for the widget, in this case: Lighting.

iot.LightValueVisible

BOOL

Determines whether the dimming value is displayed (TRUE) or not (FALSE).

iot.LightSliderVisible

BOOL

Determines whether the slider is displayed (TRUE) or not (FALSE).

iot.LightModeVisible

BOOL

Determines whether the mode is displayed (TRUE) or not (FALSE).

iot.LightModeChangeable

BOOL

Determines whether the mode is adjustable (TRUE) or not (FALSE).

TYPE ST_LightingWidgetSample :
STRUCT
    sDisplayName    : STRING := '';
    bLight          : BOOL := FALSE;
    {attribute 'iot.Unit' := '%'}
    {attribute 'iot.MinValue' := '0'}
    {attribute 'iot.MaxValue' := '100'}
    nLight          : INT := 100;
    sMode           : STRING := 'Automatic';
    aModes          : ARRAY[0..1] OF STRING := ['Manual', 'Automatic'];
END_STRUCT
END_TYPE

Attribute

Data type

Description

Display in widget

sDisplayName

STRING

Determines the display name of the widget and overwrites the PLC attribute 'iot.DisplayName'.

Display text of the widget.

bLight

BOOL

Switches the lighting on (TRUE) or off (FALSE).

Toggle switch top right.

iot.Unit

STRING

Unit of the dimming value.

Unit after the numerical value.

iot.MinValue

INT

Lower limit of the dimming value.

On the left side under the slider.

iot.MaxValue

INT

Upper limit of the dimming value.

On the right side under the slider.

nLight

INT

Dimming value of the widget.

Display in the numerical value and additionally display in the filling of the slider.

sMode

STRING

Mode of lighting.

The currently displayed mode.

aModes

ARRAY [0..n] OF STRING

Array of the different modes that can be set by the user.

By pressing on the current mode, the adjustable modes can be displayed.