Basler Vision Connector Messaging Concept#
For ZeroMQ, the JSON string payload is encoded in a UTF-8 single-frame message.
In MQTT messages, the JSON payload serves as the content of the message to be sent.
Getting Started#
If you want to use the Basler Vision Connector via messaging, a good starting point are the JSON Test files delivered in this documentation. You also find instructions for setting up the Flow Creator and starting with these JSON Test files in the topic Using the JSON Test Files with Industrial Edge Flow Creator.
Topic Structure#
ZeroMQ#
When using ZeroMQ connections, use the expected structure outlined below:
- To receive application feedback, subscribe to the logging topic on the PUB/SUB port.
- To send commands, use single-frame messages sent to the REQ/REP port.
- To receive data from the recipe, subscribe to the recipe data topic cstm_recipe/{RecipeID}/data on the PUB/SUB port using Recipe Payload Format.
- To stream images using the Image Format, use the {DeviceID}/stream topic on the PUB/SUB port.
-
To stream images using the Recipe Payload Format, subscribe to the additional image streaming topic device/{DeviceID}/cstm_images on the PUB/SUB port. The following information is provided when streaming on this topic:
- The camera image itself.
Data name:Image0
Data type:Image - The ID of the image.
Data name:ImageID0
Data type:Integer - The camera timestamp (only provided, if received from the camera).
Data name:DeviceTimestamp0
Data type:Integer - The host timestamp when the image was received (the timestamp is ISO8601-encoded).
Data name:HostTimestamp0
Data type:String
- The camera image itself.
Message Envelope for ZeroMQ Messages in the Req/Rep Channel#
In the Basler Vision Connector, messages (request and response) with only one frame are used:
| Frame | Field | Description | Type |
|---|---|---|---|
| 1 | payload | Contains the JSON payload. | Binary string (UTF-8) |
MQTT#
For MQTT connections, the topic structure is as follows:
- To send commands, publish messages to {mqttRoot}/app/request.
- To receive application command responses, subscribe to the {mqttRoot}/app/response topic.
- To receive human-readable application feedback, subscribe to the {mqttRoot}/app/logging topic.
- To receive events which should be handled by the subscriber, subscribe to the {mqttRoot}/app/events topic.
- The recipe data topic on the PUB/SUB port using the Recipe Payload Format: {mqttRoot}/cstm_recipe/{RecipeID}/data
- Topics for the recipe data via the IE Common Payload Format on the PUB/SUB port:
- Metadata topic: ie/m/j/simatic/v1/bvc1/dp
- Datapoint topic: ie/d/j/simatic/v1/bvc1/dp/r/recipe.{RecipeID}/default
The message content should be formatted in JSON, employing the message field names as property names for each call, as described in the different "Messaging" topics.
Message Envelope for MQTT Messages#
In MQTT, the JSON messages are written directly into the payload of the MQTT message. No specific envelope is required.