tag
Description
The tag block is used to label a single signal line with a tagX identifier so that other blocks can distinguish the meaning of individual inputs. The block itself does not change the type or content of the transmitted value. Its role is to accept a change on the input and forward it to the output as the selected tagged line.
The block has one input and one output. It does not require its input to be labeled by another tag block.
Typical usage is to connect tag1, tag2, tag3, and subsequent lines to blocks that assign different meanings to particular inputs, such as switch, comparator, sequence-detector, dimmer, or alarm.
Configuration parameters
| Parameter name | Value |
|---|---|
Tag id (tag_id) |
Required tag identifier. In practice, this should be set to a positive integer in the range from 1 to 65535, because then other blocks can recognize this line as tag1, tag2, tag3, and so on. An empty value is a configuration error. A non-numeric value does not stop the tag block from working, but it usually will not be recognized correctly by blocks expecting specific numbered tags. |
Block duplicated value (filter_duplicated_values) |
Required boolean value true or false. When set to true, the block does not forward another value identical to the last emitted one. When set to false, every received change is forwarded to the output, even if the value is the same as the previous one. |
Input handling
The block allows multiple connections to its only input.
The block supports all logic value types used in the project. The received value is forwarded to the output without modification.
Each received input change is handled as follows:
- if
filter_duplicated_values = trueand the new value is identical to the last emitted one, the event is ignored - in all other cases, the value is forwarded to the only output of the block
- the description shown below the block is updated to the form
tagX: valueif the value can be represented as text - if the received value cannot be represented as text, the description remains in the form
tagX
Ignored cases:
- consecutive values identical to the last emitted one when
filter_duplicated_valuesis enabled
Block outputs
The block has one output. Every value accepted on the input that is not filtered out by the filter_duplicated_values parameter appears on the output.
The block does not perform type conversion, scaling, or any additional logic. Its role is only to label the input line with a tag number and pass the value further.
The description shown below the block usually has one of the following forms:
tag1tag1: truetag2: 21.5tag3: open
Errors returned by the block
The block can show the following error messages:
| Error code | Error description |
|---|---|
Tag ID configuration error. |
The tag_id parameter is missing in the configuration or the parameter format is invalid. |
Invalid tag ID configuration. |
The tag_id parameter is empty or cannot be read as a text identifier value. |
Missing filter_duplicated_values configuration. |
The filter_duplicated_values parameter is missing in the configuration. |
Input disconnected. |
No other block is connected to the block input. |
Usage examples
- If
tag_id = 1and the valuetrueis provided on the input, thentrueappears on the output and the block description changes totag1: true. - If
tag_id = 2and the block is connected to an input expectingtag2, the receiving block treats this line astag2. - If
filter_duplicated_values = trueand the value25arrives twice in a row on the input, only the first one is forwarded. - If
filter_duplicated_values = falseand the value25arrives twice in a row on the input, both changes are forwarded. - If
tag_id = abc, the block can still forward values to the output, but blocks expecting numbered inputs such astag1ortag2usually do not recognize such a line as intended.