Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
German

Maschinen per MQTT mit Assets verbinden

Wenn eine Maschine mit einem Asset verbunden werden soll stehen nun 2 Wege zur Verfügung.

  1. die indirekte Anbindung über x4remote, welche in diesem dem Artikel x4remote Connections beschrieben wird x4remote Connections .

  2. die Anbindung direkt per MQTT an die Plattform.

Die Anbindung per MQTT am Beispiel des Lenze x500 ist Thema dieses Artikels. Sie haben bereits ein Gateway welches Sie mit der der Plattform verbinden möchten? Dann schauen Sie bitte hier ob ihr Gerät die Anforderungen erfüllt.

Allgemein
Anchor
MQTT-Beschreibung
MQTT-Beschreibung

Ein MQTT-Telegramm besteht aus ein Topic und eine Nutzlast (Payload). Außerdem benötigt ein Router auch Verbindungsdaten, wie URL, Zugangsdaten um seine Telegramme an einen Broker senden zu können. All diese Infromationen URL, Zugangsdaten, Server-Zertifikat und Topic werden von der Asset Performance Plattform vorgegeben und sind im Router einzustellen.MQTT selbst

Die Payload

Die Asset Performance Plattform stellt einen Broker bereit, der nur eine verschlüsselte und authentifizierte Verbindung erlaubt.

Die MQTT Protokoll Spezifikation definiert nicht wie die Payload gestalltet sein muss, damit die Systeme sich verstehen. gestaltet sein muss. Diese Lücke füllt die die Sparkplug B Spezifikation für MQTT Nutzdaten.

Info

Sparkplug ist eine Open-Source-Spezifikation, die bei der Eclipse Foundation gehostet wird und MQTT-Clients ein Framework zur nahtlosen Integration von Daten aus ihren Anwendungen, Sensoren, Geräten und Gateways in die MQTT-Infrastruktur bietet.

Die Spezifikation zu Sparkplug B ist hier zu finden https://sparkplug.eclipse.org/specification/

Der Lenze x500 überträgt seine Daten in der MQTT-Payload Sparkplug - B konform. Die Asset Performance Plattform kann die Nutzlast im Sparkplug B Format einlesen. Ausnahme ist die Formatierung im JSONMit der Einschränkung das die Payload als Klartext JSON formatiert sein muss. Die Verwendung des Google Protocol Buffer Schema, wie in der Spezifikation beschrieben, ist in Vorbereitung.

Die Spezifikation zu Sparkplug B ist hier zu finden https://sparkplug.eclipse.org/specification/

Eine Payload nach Sparkplug B format stellt sich wie folgt dar:

Anchor
Sparkplug-Beschreibung
Sparkplug-Beschreibung

Code Block
languagejson
{
  "timestamp": <send timestamp>,
  "metrics": [{
    "name": <metric_name>,
    "alias": <alias>,
    "timestamp": <collect timestamp>,
    "dataType": <datatype>,
    "value": <value>
  }],
  "seq": <sequence_number>
}

Die Keys von oben nach unten sind folgendermaßen zu verstehen:

Key

Bedeutung

<send timestamp>

zwingend

Zeitstempel wann das Telegramm versendet wurde

metrics

zwingend

Array von Datenpunktobjekten. Es können 1..n Datenpunktojekte hier eingefügt werden.

<metric_name>

zwingend

Name des Datenpunkts

<alias>

optional

Ersatznummer für den Datenpunkt.

<collect timestamp>

zwingend

Zeitstempel wann die Daten gelesen / bereitgestellt wurden

<datatype>

zwingend

Datentyp des Datums. Sie dazu die Liste am Ende.

<value>

optional

Wert des Datenpunkts, sofern ein Wert publiziert werden soll.

<sequence_number>

zwingend

fortlaufende Sequenznummer.

Payload Beispiel:

Code Block
languagejson
{
	"metrics": [
		{
			"alias": 2,
			"datatype": 9,
			"name": "scCloud_rOEErt",
			"timestamp": 1721829360000,
			"value": 75.28211975097656
		},
		{
			"alias": 11,
			"datatype": 10,
			"name": "scCloud_lrQuantityOK",
			"timestamp": 1721829360000,
			"value": 3589.0
		}
	],
	"seq": 215,
	"timestamp": 1721829360042
}

Einstellungen in der Asset Performance Plattform
Anchor
x4APP-Einstellungen
x4APP-Einstellungen

Um eine Verbindung für ein Asset zuerstellen kann über das Connection Icon der Konfigurationsdialog aufgerufen werden.

grafik-20240724-143225.pngImage Added

In diesem Dialog kann der Typ der Verbindung ausgewählt werden. Hier muss der Eintrag “x500 per MQTT” gewählt werden.

grafik-20240724-143504.pngImage Added

Danach kann die Auswahl mit “Speichern” bestätigt werden, denn weitere Einstellungen sind nicht nötig. Die Verbindungsdaten werden jetzt vom System erzeugt. Diese Verbindungsdaten müssen nun im Router eingestellt werden, was abhängig vom Routerhersteller ist. Im nächsten Abschnitt wird dies für den x500 exemplarisch beschrieben.

Neben den Zugangsdaten kann hier das Serverzertifikat heruntergeladen werden. Diese ist nötig, damit der Client die Verbindung überprüfen kann.

grafik-20240724-143940.pngImage Added

Diese Verbindungseinstellungen können jederzeit über den gleichen Weg wieder angezeigt werden.

Einstellungen im x500 bzw. x4remote

Connect your x500 via MQTT

Datentypenliste

Wert des Datenpunkts, sofern ein Wert publiziert werden soll
  1. 303988737.

  2. Direct connection to the platform via MQTT.

The connection via MQTT using the example of the Lenze x500 is the topic of this article. You want to use a 3rd party router? Please check here whether it can be connected out of the box.

General

An MQTT telegram consists of a topic and a payload. In addition, a router also requires connection data such as URL and access data in order to be able to send its telegrams to a broker. All this information - URL, access data, server certificate and topic - is specified by the Asset Performance Platform and must be set in the router.

The payload

The Asset Performance Platform provides a broker that only allows an encrypted and authenticated connection.

The MQTT protocol specification does not define how the payload must be designed. This gap is filled by the Sparkplug B specification for MQTT user data.

English

Connect a machine via MQTT

If a machine is to be connected to an asset, there are now 2 options available.

  1. Indirect connection via x4remote, which is described in the article https://ll-public.atlassian.net/wiki/spaces/X4/pages/

edit-v2/415203329#Data-type-list

<value>

optional

Info

Sparkplug is an open-source specification hosted at the Eclipse Foundation that provides MQTT clients the framework to seamlessly integrate data from their applications, sensors, devices, and gateways within the MQTT Infrastructure.

You can find the specification here: https://sparkplug.eclipse.org/specification/

The Lenze x500 transmits its data Sparkplug B compliant. The Asset Performance Platform can read the payload in Sparkplug B format. With the restriction that the payload must be formatted as plain text JSON. The use of the Google Protocol Buffer Schema, as described in the specification, is in preparation.

A payload in Sparkplug B format is as follows:

Anchor
Sparkplug-description
Sparkplug-description

Code Block
languagejson
{
  "timestamp": <send timestamp>,
  "metrics": [{
    "name": <metric_name>,
    "alias": <alias>,
    "timestamp": <collect timestamp>,
    "dataType": <datatype>,
    "value": <value>
  }],
  "seq": <sequence_number>
}

The keys from top to bottom are to be understood as follows:

Key

Bedeutung

<send timestamp>

mandantory

Timestamp when the telegram was send.

metrics

mandantory

Array von Datenpunktobjekten. Es können 1..n Datenpunktojekte hier eingefügt werden.

<metric_name>

mandantory

Name of the datapoint

<alias>

optional

Alias for the datapoint.

<collect timestamp>

mandantory

Timestamp when the datapoint was requested/deliverd.

<datatype>

mandantory

Datatype of the datapoint. You can find a list at the end.

<value>

optional

Value of the datapoint. If a value shall be published.

<sequence_number>

zwingend

Sequenznummer. Fortlaufend steigend.

Payload Beispiel

mandantory

continuous sequence number

Example payload:

Code Block
languagejson
{
	"metrics": [
		{
			"alias": 2,
			"datatype": 9,
			"name": "scCloud_rOEErt",
			"timestamp": 1721829360000,
			"value": 75.28211975097656
		},
		{
			"alias": 11,
			"datatype": 10,
			"name": "scCloud_lrQuantityOK",
			"timestamp": 1721829360000,
			"value": 3589.0
		}
	],
	"seq": 215,
	"timestamp": 1721829360042
}
Einstellungen

Settings in

der Asset Performance Plattform

Einstellungen im x500 bzw. x4remote

Datentypenliste

English

Comming soon.

the Asset Performance Platform

To create a connection for an asset, the configuration dialog can be called up via the connection icon.

grafik-20240724-145323.pngImage Added

The connection type can be selected in this dialog. The entry “x500 via MQTT” must be selected here.

grafik-20240724-145415.pngImage Added

The selection can then be confirmed with “Save”, as no further settings are required. The connection data is now generated by the system. This connection data must now be set in the router, which depends on the router manufacturer. The next section describes this for the x500 as an example.

In addition to the access data, the server certificate can be downloaded here. This is necessary so that the client can check the connection.

grafik-20240724-145607.pngImage Added

These connection settings can be displayed again at any time in the same way.

Settings in the x500 or x4remote

Connect your x500 via MQTT

Data type list

Expand
titleSparkplug Datatypes - Datentypen
Code Block
Unknown   = 0;
Int8      = 1;
Int16     = 2;
Int32     = 3;
Int64     = 4;
UInt8     = 5;
UInt16    = 6;
UInt32    = 7;
UInt64    = 8;
Float     = 9;
Double    = 10;
Boolean   = 11;
String    = 12;
DateTime  = 13;
Text      = 14;
UUID      = 15;
DataSet   = 16;
Bytes     = 17;
File      = 18;
Template        = 19;
PropertySet     = 20;
PropertySetList = 21;
Int8Array       = 22;
Int16Array      = 23;
Int32Array      = 24;
Int64Array      = 25;
UInt8Array      = 26;
UInt16Array     = 27;
UInt32Array     = 28;
UInt64Array     = 29;
FloatArray      = 30;
DoubleArray     = 31;
BooleanArray    = 32;
StringArray     = 33;
DateTimeArray   = 34