Timer
The described widget is suitable for displaying a timer in the app. The various configuration options are described below. In the figure all available features of the widget are active.
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' := 'TimeSwitch'}
{attribute 'iot.TimeSwitchStartTimeVisible' := 'true'}
{attribute 'iot.TimeSwitchEndTimeVisible' := 'true'}
{attribute 'iot.TimeSwitchStartDateVisible' := 'true'}
{attribute 'iot.TimeSwitchEndDateVisible' := 'true'}
{attribute 'iot.TimeSwitchDaysVisible' := 'true'}
{attribute 'iot.TimeSwitchDateYearlyVisible' := 'true'}
{attribute 'iot.TimeSwitchModeVisible' := 'true'}
{attribute 'iot.TimeSwitchModeChangeable' := 'true'}
stTimeSwitchWidgetSample : ST_TimeSwitchWidgetSample;
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: TimeSwitch. |
iot.TimeSwitchStartTimeVisible | BOOL | Determines whether the start time is displayed (TRUE) or not (FALSE). |
iot.TimeSwitchEndTimeVisible | BOOL | Determines whether the end time is displayed (TRUE) or not (FALSE). |
iot.TimeSwitchStartDateVisible | BOOL | Determines whether the start date is displayed (TRUE) or not (FALSE). |
iot.TimeSwitchEndDateVisible | BOOL | Determines whether the end date is displayed (TRUE) or not (FALSE). |
iot.TimeSwitchDaysVisible | BOOL | Determines whether the weekdays are displayed (TRUE) or not (FALSE). |
iot.TimeSwitchDateYearlyVisible | BOOL | Determines whether the attribute for the annual configuration is displayed (TRUE) or not (FALSE). |
iot.TimeSwitchModeVisible | BOOL | Determines whether the mode is displayed (TRUE) or not (FALSE). |
iot.TimeSwitchModeChangeable | BOOL | Determines whether the mode is adjustable (TRUE) or not (FALSE). |
TYPE ST_TimeSwitchWidgetSample :
STRUCT
sDisplayName : STRING := '';
bOn : BOOL;
tStartTime : TIME_OF_DAY;
tEndTime : TIME_OF_DAY;
dStartDate : DATE;
dEndDate : DATE;
bYearly : BOOL;
bMonday : BOOL;
bTuesday : BOOL;
bWednesday : BOOL;
bThursday : BOOL;
bFriday : BOOL;
bSaturday : BOOL;
bSunday : BOOL;
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. |
bOn | BOOL | Switches the timer on (TRUE) or off (FALSE). | Toggle switch top right. |
tStartTime | TIME_OF_DAY | Start time of the timer. | Time on the left side of the arrow. |
tEndTime | TIME_OF_DAY | End time of the timer. | Time on the right side of the arrow. |
dStartDate | DATE | Start date of the timer. | Date on the left side of the arrow. |
dEndDate | DATE | End date of the timer. | Date on the right side of the arrow. |
bYearly | BOOL | Yearly. | Yearly (Depending on the language of the operating system). |
bMonday | BOOL | Monday. | M. |
bTuesday | BOOL | Tuesday. | D. |
bWednesday | BOOL | Wednesday. | M. |
bThursday | BOOL | Thursday. | D. |
bFriday | BOOL | Friday. | F. |
bSaturday | BOOL | Saturday. | S. |
bSunday | BOOL | Sunday. | S. |
sMode | STRING | Mode of the timer. | 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. |