Data messages
Messages sent or received by the SQL, for example, have the following format and thus all other attributes can be determined via the id and the metadata:
Insert:
- Each message always represents an insert statement.
- Each column may not occur more than once per insert statement.
- Each "vals" always consists of an id with which the associated datapoint definition can be determined and a val, which is always a value which must correspond to the data type of the associated metadata.
- The insert message is always sent to the pubtopic, which can be taken from the metadata.
- If you want to insert into a column that has the datatype Date or DateTime, you must use the ISO-8601 like it is described in the Common Payload Format of Siemens
Example:
{
"seq":0,
"vals":[
{
"id":"DP144",
"val":"2023-06-29T00:00:00Z"
},
{
"id":"DP145",
"val":"2023-06-29T15:37:22.92Z"
}
],
}
Reading:
- Each message always represents a table and is sent every acquisition cycle
- Each message consists of at least one "vals", each one representing a column
- Each "vals" always consists of an id with which the associated datapoint definition can be determined and a val, which is always an array consisting of the rows read from this column.
- The reading messages are always sent to the topic of the corresponding table, which can be taken from the metadata.
- If multiple lines are sent, the values are displayed in arrays per column, but if only one line is read, only this one value is sent.
Multiple line Example:
{
"seq":0,
"ts":"2023-07-27T10:58:33.050072Z",
"vals":[
{
"id":"DP77",
"val":[
19,
20,
21,
22,
23,
24
]
},
{
"id":"DP78",
"val":[
"2023-07-02T00:00:00Z",
"2023-07-02T00:00:00Z",
"2023-07-02T00:00:00Z",
"2023-07-02T00:00:00Z",
"2023-07-02T00:00:00Z",
"2023-07-02T00:00:00Z"
]
}
]
}
Single line Example:
{
"seq":54,
"ts":"2023-07-27T10:50:17.398716Z",
"vals":[
{
"id":"DP23",
"val":9
},
{
"id":"DP24",
"val":"2023-07-02T00:00:00Z"
},
{
"id":"DP25",
"val":"2023-07-01T08:30:45Z"
}
]
}