app-label
Description
The app-label block is used to present up to five independent text labels in the mobile application and in the web interface. Each label may consist of an optional prefix, the current value received from an input labeled with the tag block, and an optional suffix.
The block is for presentation only. It does not pass data further through the logic and has no logical outputs. After it is added to the project, an associated virtual device representation is created, so the labels are also visible outside the logic diagram itself.
The block supports up to five inputs labeled using the tag block. Each input works independently and corresponds to one line shown to the user.
Configuration parameters
| Parameter name | Value |
|---|---|
name |
Optional parameter. Defines the name visible to the user in the mobile application and in the web interface. The absence of this parameter does not prevent the block from working. |
prefix_tag1 ... prefix_tag5 |
Optional parameters. Define the text shown before the current value for inputs tag1 to tag5 respectively. These parameters may be used, for example, to add a field label, a colon, or a unit written before the value. |
suffix_tag1 ... suffix_tag5 |
Optional parameters. Define the text shown after the current value for inputs tag1 to tag5 respectively. These parameters may be used, for example, to append a unit such as °C, %, or V. |
Input handling
The block reacts only to inputs labeled using the tag block. At least one of the inputs tag1 to tag5 must be connected. If none of them is connected, the block returns the Input disconnected. error.
At most one tag block may be connected to each of the inputs tag1 to tag5. A larger number of such connections is a configuration error.
Meaning of the individual inputs:
| Input number and name | Description |
|---|---|
tag1: Label 1. |
The value delivered to tag1 sets the current content of the first label visible in the mobile application and in the web interface. |
tag2: Label 2. |
The value delivered to tag2 sets the current content of the second label visible in the mobile application and in the web interface. |
tag3: Label 3. |
The value delivered to tag3 sets the current content of the third label visible in the mobile application and in the web interface. |
tag4: Label 4. |
The value delivered to tag4 sets the current content of the fourth label visible in the mobile application and in the web interface. |
tag5: Label 5. |
The value delivered to tag5 sets the current content of the fifth label visible in the mobile application and in the web interface. |
Detailed operating rules:
- logical values are presented as
trueorfalse - numeric values are converted to text without automatically appending a unit
- text values are presented without modification
- if the
nullvalue reaches a given input, the current value of the corresponding label is cleared - if the received value cannot be safely converted to text, the corresponding label is also cleared
- the prefix and suffix are fixed and result from the block configuration, while the middle value itself is updated dynamically based on input events
- after the project starts, the block immediately tries to read the last known values from connected inputs and show them in the mobile application and in the web interface
The block does not append units automatically. If the user wants to show, for example, a temperature or a percentage, the proper unit should be added in suffix_tagX or prefix_tagX.
Block outputs
The app-label block has no logical outputs.
Its only purpose is to make labels and current values available to the mobile application and to the web interface. It is not used to pass data to subsequent blocks.
Errors returned by the block
The block can return the following errors:
| Error code | Error description |
|---|---|
Input disconnected. |
None of the inputs tag1 to tag5 is connected. For the block to work correctly, at least one input labeled with the tag block must be connected. |
Too many tagX blocks connected. |
More than one tag block is connected to one of the inputs tag1 to tag5. Only one such connection is allowed on each of these inputs. |
Usage examples
- If
prefix_tag1 = Temperature:,suffix_tag1 = °C, and the value21.5reachestag1, then the user will see the labelTemperature: 21.5 °C. - If
prefix_tag2 = Motion:and the boolean value true reachestag2, then the user will see the labelMotion: true. - If the
nullvalue is sent totag3, the previously displayed value of the third label will be removed. - If the percentage value
55reachestag4andsuffix_tag4 = %, then the user will see55%. Without a configured suffix, the unit is not appended automatically.