There are two scenarios:
Write the mapping-address in the corresponding field.
To map a larger number of Databus topics with the same inputs, the placeholder character "#" can be used in the address, for example:
ie/d/j/simatic/v1/s7c1/dp/r/PLC1/default/unknownTopic/#The hash symbol must always be placed immediately after the slash.AI Inference Server reads every value of several topics and passes all the values to a variable that contains the mapping with hash characters. The Python steps calls up the values can perform the calculations based on them.AI Inference Server stops the pipeline and changes the status to "ERROR", if an unexpected type of Databus arrives (for example, type of variable was set to "Integer" and "String" received). The corresponding log message is generated.
Select the variables directly from the Databus. Follow the instructions in the next section "Browsing tags from the Databus".
Tag browser functionality is available for SIMATIC v1 Connector (S7, S7+, OPC UA). The "Browse tags" button is disabled if the databus connector type with SIMATIC V1 payload was not added as a data connection.
In both cases, you can select a data connection for each variable in the "Connection" field.
It is possible to read the data from different types of data connector (like S7) and to rewrite the data to others (like Databus).
The app helps you choose the right connection for input and output variables based on the data types. Only the ports that support inputs can be mapped. For example, the Zero Message Queue only has outputs of type "Object", so that they are filtered out of the list.
The options are shown in the following table:
Connector type |
Payload format |
Input |
Output |
|---|---|---|---|
Databus |
String (incl. pure json) |
String |
|
Databus |
SIMATIC v1 (S7, S7+, OPC UA) |
Integer, Double, Boolean, IntegerArray, DoubleArray, BooleanArray, String, StringArray |
|
External Databus |
String (incl. pure json) |
String |
|
IE Vision Connector |
Low throughput (Databus based, string) |
String |
NA |
IE Vision Connector |
High throughput (ZMQ based, multipart) |
Object, ImageSet |
NA |
Zero Message Queue |
Internal multipart message (Topic, meta data, binary) |
NA |
Object |
Zero Message Queue |
Internal multipart message (Topic, binary data) |
Binary |
Binary |
Browsing tags from the Databus
To preselect the variable, follow these steps:
Click on "Browse tags".
A popup window is displayed in which you can browse for tags either by tag name or data type. You can also add or remove tags in this window.
You can get context-sensitive help using the button ④.
The configured data connectors are displayed in the dialog ①.
If you want to access the Databus for the first time, you must configure a data connection as described in the section "The data connection".
When you click on a device name, a list of connectors and information about them is displayed.
Example: SIMATIC S7+ Connector
When you click on a connector name, a list of available PLCs and information about them is displayed:
When you click on the check box, all available tags on this PLC are added to the selected tags.
When you click on a PLC, a list of available tag groups and information about them is displayed. The group can be a standard group or the grouping can be based on the acquisition cycle of the tag, e.g. 1000 ms:
When you click on the check box, all available tags in this group are added to the selected tags.
When you click on a group, a list of available tags and information about them is displayed:
The name and ID of the tags are listed here together with the data type and access mode. Access mode means that the tag can only be read ("read") or that it can also be written ("read / write").
When you click on the check box, this tag is added to the selected tags.
Select the tags on the "List of tags" ② tab. Select the check box alongside the selected tag.
If you want to remove preselected tags from the tag pool, select the tags in the "Selected tags" tab ⑤. Use the search box ⑥ and the "Clear results" button ⑦ to select the tags. Clear the check box ③ for the unwanted tags.
Save the result by clicking on "Update tag pool" ⑧.
Now, you can select the missing mapping address from a drop-down list. Click the "Mapping" button.
Note:Only the tags that have the same data type as the one required by the model are displayed in the drop-down list.
Note:During the variable mapping, only the selected tags that are "read/write" can be defined for output variables of the pipeline.
When all the variables and parameters have been correctly mapped, you can start the pipeline.
Wildcarded Databus input topics
When mapping databus input topics, it is possible to map several topics to one variable. Use a wildcard character (#) at the end of the topic name (prefix). In this case, all incoming values from the various topics generate a new data set in the AI Inference Server.
If the payload type is String, all data from the mapped topics is mapped to the same variable of type String, one at a time, generating new records for all values.
If the payload type is S7, AI Inference Server tries to map all values within the S7 payload individually to the variables. If the type of a particular value does not match the type of the mapped variable (for example, if the mapped S7 payload contains a String-type variable and the variable is of type Double), the pipeline stops with an error message.
Topics |
Payload |
Variable |
Mapping |
Result |
topic/somedata/data1 topic/somedata/data2 |
String |
myvar (String) |
topic/somedata/# |
Both topics’ data is mapped into myvar as a String. |
topic/somedata/data1 topic/somedata/data2/a topic/somedata/data2/b |
String |
myvar (String) |
topic/somedata/data2/# |
Only the last two topics’ data is mapped into myvar as a String. |
topic/somedata/data1:100 topic/somedata/data1:101 topic/somedata/data1:102 (all of these have type Double) |
S7 |
myvar (Double) |
topic/somedata/# |
All values from the bulk S7 JSON message are mapped as a Double into myvar. This means one message generates three internal records. |
topic/somedata/data1:100 topic/somedata/data1:101 topic/somedata/data1:102 (100, 101 is of type Double, 102 is String) |
S7 |
myvar (Double) |
topic/somedata/# |
When Inference Server tries to map topic 102 (string value) into myvar, it will send an error message if the string itself cannot be converted to a valid number. |
Wildcarded output topic mapping is not supported.
Data of output variables retained on Databus
It is possible to retain the data of the output variables, if it is mapped to Databus based on the settings of the Databus configurator.
In this case the last data sent to the specified variable is retained. The application that has subscribed to the topic receives the stored data first.
The data retention function increases the security of the data on the Databus and supports the Edge applications (such as IIH Essentials) in consuming the data at their own pace.
Only one data element at a time is saved. Thus, if new data is sent, the previously saved data is overwritten.
This function is available for string payload and S7 payload. (String payload is recommended).
You are strongly discouraged from enabling the Retain function for two variables that are assigned to the same topic, even if the subtopic is different, because one can overwrite the other.
Data retention is provided by the Databus and can be configured via the Databus Configurator. The entire performance of the AI model can be slower if the "Retain data" flag is enabled.