Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

KeywordFull name

Meaning

UnitDefault value

Kotva
swt
swt
SWT

Station Will Topic

Will topic of the device. If this parameter is set and a message with the same topic is received, the station will go into a communication error (StHardErr) and the values of the I/O tags will be invalidated. In this way, it is possible to emulate the standard behavior that occurs when there is a communication error with the device (even if the communication between the D2000 Kom process and the MQTT broker is functional).



Kotva
swp
swp
SWP

Station Will Payload

Content of the Will message. If this parameter is set and a message with the same topic as defined by the Station Will Topic parameter is received, the Payload must also be the same. If this parameter is an empty string, matching the topic with the Station Will Topic parameter is sufficient.
Note: This parameter was implemented because MQTT brokers send messages with the same Topic when connecting/disconnecting the device, the difference being only in the payload.



Kotva
fpt
fpt
FPT

Payload Type

The setting of message parsing (overriding the line parameter Payload Type):

  • Default - the line parameter Payload Type is respected
  • Text only - the message is not parsed, it is assigned to the I/O tag with the address IN_TOPIC
  • JSON - the message is parsed as JSON data. If there is an I/O tag with the address IN_TOPIC, the whole message will be assigned to it.
    If there are I/O tags with addresses JA=json_address, they will be populated with the appropriate data from the JSON message. If no such addresses exist in the message, the I/O tags will be invalidated.
  • Sparkplug - the message is parsed as Sparkplug B payload (binary coded). Based on the line parameter Payload Type, this is Sparkplug Host/Edge Node mode, Sparkplug Host by default.
Default
Text only
JSON
Sparkplug
Default

Kotva
ftf
ftf
FTF

Time Field Name

If Payload Type=JSON, the name of the field with a timestamp - overriding the line parameter Time Field Name--

Kotva
ftm
ftm
FTM

Time Mask

Mask for parsing a value in the field with a timestamp - overriding the line parameter Time Mask.

Note: Whether the time is interpreted as local or UTC with a configured offset depends on the time station parameters settings.

--

Sparkplug parameters



Kotva
sr
sr
SR

Send Node Control/Rebirth

At the start of the D2000 KOM process, a command (NCMD or DCMD) with the metric 'Node Control/Rebirth' is sent to the SparkPlug station. The response should be a message (NBIRTH/DBIRTH) with all current metrics.

YES/NOYES

...

Info
titleAn example of communication - text payload

The attached ZIP contains the configuration of two lines and two stations with the MQTT protocol and the definition of the S.MqttTest scheme. Data written over one line is received over the other line. The functionality was verified against the Mosquitto broker installed locally on Windows, listening on TCP port 1883.

View file
nameMosquito_test.zip
height150


Info
titleAn example of communication - Sparkplug B payload

The attached ZIP contains a configuration of two lines and four stations with the MQTT Sparkplug B protocol. Both connect (alternatively) to the servers test.mosquitto.org and localhost.

The line L.MQTT_MOSQUITTO_EN (parent MQTT_MOSQUITTO_EN.KOM) is in Sparkplug Edge Node (data producer) mode, has two stations B.MQTT_MOSQUITTO_EN (Edge Node with address myGroup/myEdgeNode) and B.MQTT_MOSQUITTO_EN.Device1 (Device with address myGroup/myEdgeNode/myDevice1). These stations publish the values ​​of the objects Hour, Min, Sec.
The line parameter Sparkplug Host ID is set to "D2000komHA" (The Host application with this name is considered primary). The line L.MQTT_MOSQUITTO_EN connects alternately to the servers test.mosquitto.org and localhost until it finds a connected primary host application.

The L.MQTT_MOSQUITTO_HA line (parent MQTT_MOSQUITTO_HA.KOM) is in Sparkplug Host mode (data consumer), has two stations B.MQTT_MOSQUITTO_HA (receiving data with the topic myGroup/myEdgeNode) and B.MQTT_MOSQUITTO_HA.Device1 (receiving data with the address myGroup/myEdgeNode/myDevice1). These stations receive object values ​​published by I/O tags on Sparkplug Edge Node stations.
The line parameter Sparkplug Host ID is set to "D2000komHA" (this is the Host application identification).

Using the output I/O tags on Sparkplug Host stations (M.MQTT_MOSQUITTO_HA.Output1_Int32, M.MQTT_MOSQUITTO_HA.Output2_Float, and M.MQTT_MOSQUITTO_HA.Device1.Output1_Bool), it is possible to send DCMD and NCMD messages and write to the input I/O tags on Sparkplug Edge Node stations (M.MQTT_MOSQUITTO_EN1.Input1, M.MQTT_MOSQUITTO_EN1.Input2, and M.MQTT_MOSQUITTO_EN.Device1.Input1_Bool).

View file
nameSparkplug.zip
height150



Info
titleBlog

You can read a blog about the MQTT protocol

...