...
- Communication line category: TCP/IP-TCP or TCP/IP-TCP Redundant.
- Host: IP address of MQTT server (or redundant addresses separated by a comma or semicolon).
Note: In Payload Type = Sparkplug Edge Node mode, the Node Control/Next Server metric is supported, which can be used to command the D2000 KOM process to connect to the next MQTT server (if multiple servers are specified).Note: If the TCP/IP-TCP line is configured, one TCP connection is created, which can be directed to multiple specified IP addresses. If the TCP/IP-TCP Redundant line is configured, two TCP connections are created, each of which can be directed to multiple specified IP addresses. - Port: the default port number is 1883 or 8883 for the encrypted SSL/TLS variant.
- Line number: unused, set the value to 0.
...
openssl x509 -text -in file.crt | grep "After"
Notes on MQTT broker redundancy
If the TCP/IP-TCP line is configured, one TCP connection is created, which can be directed to one of multiple configured IP addresses.
If the TCP/IP-TCP Redundant line is configured, two TCP connections are created (to 2 MQTT brokers), each of which can be directed to one of multiple configured IP addresses.
Forced disconnection: If all stations on the line are in the simulation mode or the communication is stopped for them, the line will be disconnected (the communication socket will be closed). If the simulation is disabled for at least one station and the communication is not stopped for it (the Parameters tab of the Station type object), the line will be connected again.
...
| Type of I/O tag | Address | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| I/O tags for reading data sent by the MQTT server through a PUBLISH message (usually used in Text mode or JSON mode, rarely in Sparkplug mode). Note: Values of I/O tags are set by the D2000 KOM process in the order IN_TOPIC, IN_DATA, and IN_ID. The configuration doesn't need to contain all three I/O tags. | ||||||||||||||||||||||
| TxtI |
| Topic (Topic) of the received PUBLISH message. | ||||||||||||||||||||
| TxtI |
| Data (Payload) of the received PUBLISH message. | ||||||||||||||||||||
| Ci |
| Identifier of a packet (Packet Identifier) of a PUBLISH message that depends on the level of validation (QoS). For messages sent with QoS_0, the identifier is zero; for QoS_1 and QoS_2, it is a positive 16-bit number. On the TCP/IP-TCP line, the identifier is monotonically increasing; on the TCP/IP-TCP Redundant line, values from two monotonically increasing sequences can alternate (so they can also be repeated), so the recommendation given in the following note applies: Note: If the MQTT server sends also messages with the QoS_0 level of validation and the ACK_ID I/O tag is configured, then we recommend activating the option New value when changing time in the Filter tab, so that repeated writing of the value 0 will cause a new value that differs only in a timestamp to be generated. | ||||||||||||||||||||
| I/O tag to confirm the received data to the MQTT server. | ||||||||||||||||||||||
| Co |
| If an output I/O tag with the ACK_ID address is defined, the D2000 KOM expects confirmation of the processing of each message by writing a copy of the value of the IN_ID tag. Only after, it sets values from the next received PUBLISH message (if it was received in the meantime) into the IN_TOPIC, IN_DATA, and IN_ID I/O tags (in this order). In the case of the QoS_0 level of confirmation, it is, therefore, necessary to repeatedly set the value of the I/O tag ACK_ID to 0. If the I/O tag ACK_ID does not exist, the values are written into the IN_TOPIC, IN_DATA, and IN_ID I/O tags immediately after the PUBLISH message is received and processed. Note: For messages received with a QoS_0 level of validation, no confirmation is sent to the MQTT server; only the values of the received PUBLISH message will be published. | ||||||||||||||||||||
| I/O tags for sending values to the MQTT server through a PUBLISH message. Note: in order for the D2000 KOM process to send the PUBLISH messages to the MQTT server, both I/O tags must be defined within one station. | ||||||||||||||||||||||
| TxtO |
| The topic of the PUBLISH message being sent. Note: If the I/O tag with the OUT_TOPIC address does not exist, the station address will be used directly as the Topic (if it is empty, the writing will not be performed). | ||||||||||||||||||||
| TxtO |
| Data (Payload) of the PUBLISH message being sent. Note: Sending the message is performed as a result of writing to the OUT_VALUE I/O tag (i.e., if the Topic does not change, then it is sufficient to set the OUT_TOPIC point once, e.g., by using the default value). | ||||||||||||||||||||
| I/O tags for parsing JSON messages | ||||||||||||||||||||||
TxtI, TxtO, Qi, |
| If Payload Type=JSON, the message is parsed as JSON data. The json_address value specifies the name of the JSON field whose value is to be assigned to the I/O tag. For other examples, see the description of the LoRaWAN protocol's Envelope type I/O tags. Writing to an I/O tag with a JSON address is also supported, but it must not have indexes. Examples of correct addresses for writing:
When writing, the generated JSON contains the value itself and optionally a timestamp, if the station protocol parameter Time Field Name or the line parameter Time Field Name is set. | ||||||||||||||||||||
| I/O tags for parsing Sparkplug messages | ||||||||||||||||||||||
TxtI, TxtO, Qi, |
SA=sparkplug_address SAL=alias;SA=sparkplug_address ST=type;SA=sparkplug_address ST=type;SAL=alias;SA=sparkplug_address | If Payload Type = Sparkplug Host/Edge Node, the message is parsed as Sparkplug data (a binary format built on Google Protocol Buffers). Sparkplug data contains metrics that have text identifiers (sparkplug_address) or possibly numeric aliases (alias). Reading template items is possible by specifying sparkplug_address in the format <TemplateName1><Separator><TemplateName2><Separator> ... <Separator><ItemName> where:
Examples of template item addresses: Reading dataset items (equivalent to structured variables in D2000) is possible by specifying sparkplug_address in the format <DatasetName>[<Row>]^<ColumnName> where:
Examples of dataset item addresses: For output I/O tags, the value type can be explicitly (ST=type). Simple types are supported (not template items/dataset items):
If the value type is not specified, the default value depends on the type of I/O tag:
Note: There is no difference between the String and Text types. For Payload Type = Edge Node, it is also possible to specify a numerical alias (SAL=alias) as a natural number (0, 1, 2, ...) for both input and output I/O tags. The alias of the I/O tag within the station must be unique. Aliasing allows you to reduce the size of the transmitted data: in the NBIRTH/DBIRTH message, both the text identifier (sparkplug_address) and the alias are specified for each I/O tag; in the NDATA/DDATA messages, only aliases that are shorter than the text addresses are sent. Alias is only used if Sparkplug Alias Mode = "Default (SAL=alias)".
The Payload of the message contains a timestamp, a value type (type), a written value (encoded according to the specified value type), and a metric name (sparkplug_address) or an alias. | ||||||||||||||||||||
TxtI |
| The I/O tag is used to convert the Sparkplug payload into a JSON representation, which can then be processed, e.g., in an ESL script. Depending on the Convert Datatype/Timestamp to Text parameter, a textual representation of the value type and timestamp is also added. {"metrics":[{"datatype":3,"int_value":7338992,"name":"Corrected Vol Acc Stn","timestamp":1729664005479}],"seq":32,"timestamp":1729664005479} {An example of a more complex value containing properties and a dataset, and also displaying a textual representation of the data type (datatype_txt) and timestamp (timestamp_txt) as a result of the set parameter Convert Datatype/Timestamp to Text: { | ||||||||||||||||||||
...
| Kotva | ||||
|---|---|---|---|---|
|
...
| Príkaz | Syntax | Popis |
|---|---|---|
| STCOMMAND | STCOMMAND StationName PUTOLDVAL BeginTime EndTime | For Payload Type = Edge Node: The Tell command reads out historical values of output I/O tags (if the I/O tags or their control objects are archived) and sends them as historical values. Reading works independently of the Store & Forward protocol parameter. Using this command, it is possible to send historical values even for the period when the D2000 KOM was turned off (and therefore the Store & Forward functionality could not work). Example: STCOMMAND B.MQTT_MOSQUITTO_EN.Device1 PUTOLDVAL "30-05-2025 00:00:00" "30-05-2025 00:10:00" |
| Kotva | ||||
|---|---|---|---|---|
|
...