Basler Vision Connector Messaging Concept#
For ZMQ, 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.
Info
For message code 0x00000000 - Request was completed successfully., the JSON response doesn't contain a "Message" entry.
Topic Structure#
ZMQ#
When using ZMQ connections, use the expected structure outlined below:
- To send commands, use single-frame messages sent to the REQ/REP port.
- To stream images, use the {DeviceID}/stream topic on the PUB/SUB port.
- To receive application feedback, subscribe to the logging topic on the PUB/SUB port.
Message Envelope for ZMQ 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}/request.
- To receive application command responses, subscribe to the {mqttRoot}/response topic.
- To receive application feedback, subscribe to the {mqttRoot}/logging topic.
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.
Device Identification#
To identify a device, you can specify the serial number (SerialNumber field), user identification (UserDefinedName field), IP address (for GigE devices, in the IPAddress field), and MAC address (for GigE devices, in the mac field) in the Basler Vision Connector. While these fields are commonly used, they are not mandatory. See Discovering the Camera for details about camera discovery.
In the following topics, the DeviceID term refers to the identifying string used for a camera device when it is opened. This exact string is used for identifying the opened camera device while it's used and until it's closed again. Only after having closed a camera, the camera device can be opened and used again, but in that case with a different DeviceID. The value of the DeviceID can be one of the fields returned during the device info. See more details in Opening the Camera Connection.
Using a different DeviceID for a camera device while it's open, even if it refers to the same device, may lead to errors. Exceptions to this rule are allowed, if documented by the application.