Skip to content

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 = true and 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: value if 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_values is 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:

  • tag1
  • tag1: true
  • tag2: 21.5
  • tag3: 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 = 1 and the value true is provided on the input, then true appears on the output and the block description changes to tag1: true.
  • If tag_id = 2 and the block is connected to an input expecting tag2, the receiving block treats this line as tag2.
  • If filter_duplicated_values = true and the value 25 arrives twice in a row on the input, only the first one is forwarded.
  • If filter_duplicated_values = false and the value 25 arrives 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 as tag1 or tag2 usually do not recognize such a line as intended.