ModBus Communication Configuration
About 2765 wordsAbout 9 min
ModBus is a communication method in which PickWiz acts as the client and the Robot acts as the server. When PickWiz communicates with the Robot, it actively controls the Robot, sends commands to the Robot, and the Robot executes the commands and returns data after receiving them.

Before configuring Robot ModBus communication, please first refer to Project Operation Guide to create a new Project, then click Robot Configuration Panel on the main interface to enter the Add a Robot interface.

1. Add Robot
(1)Enter the Add a Robot interface and click +Add Robot

(2)Select ModBus for the communication method, click Next, and enter the Robot Configuration interface

2. Configure the Robot
On the Robot Configuration interface, you can configure Robot information, basic communication settings, and custom communication messages.

2.1 Robot Information Configuration

| Configuration Item | Description |
|---|---|
| Communication Method | The communication protocol established between PickWiz and the Robot. This cannot be modified. |
| Configuration Name | The name of the Robot configuration. Chinese, English, numbers, and symbols are supported. |
| Configuration ID | The unique identifier ID of the Robot configuration. It can be modified and supports numbers only. |
| Brand | The Robot brand. If the Robot side is connected to a PLC, select Other Device for the brand. |
| Model | The Robot model. If the Robot side is connected to a PLC, select Other Device for the model. |
| Visualization Model | When Other Device is selected for both brand and model, you need to upload the device model. The model file format is urdf. |
| Axis Count | The number of Robot arm axes. Three-axis, four-axis, and six-axis are supported. |
| Rotation Expression | Describes the Robot pose in 3D space. Currently Euler Angles and rotation vector are supported, and the Euler angle order can be modified. |
2.2 Basic Communication Configuration

| Configuration Item | Description | |
|---|---|---|
| Communication Address | Host IP | The host IP address. Under ModBus communication, the default is 127.0.0.1. |
| Port Number | The specified port used by the Robot to connect to the host. The default port is 502 and usually does not need to be modified. | |
| Slave ID | The unique identifier of the Robot. Through the slave ID, PickWiz can accurately identify and distinguish each Robot. Numbers only. The default is 1 and can be modified. | |
| Byte Order | The byte order used when PickWiz communicates with the Robot under ModBus communication. ABCD/BADC/CDAB/DCBA are supported, and the default is ABCD. | |
| Read/Write Format | Euler Angle Unit | The unit of Euler Angles. Degree and radian are supported, and the default is degree. |
| Length Unit | The length unit used by the Robot, including Robot Pose and Object Dimensions. The default is mm. | |
| Pose Type | The representation method of the Robot Pose. The default is Tool Pose. Tool Pose refers to the pose of the Robot end Tool; joint angles refer to the poses of each Robot joint, and the combination of all joint poses can determine the pose of the Robot arm or end Tool. When Other Device is selected for the Robot brand and model, only Tool Pose can be selected by default. | |
| Reserved Decimal Places | How many decimal places to keep for floating-point data in Robot commands. Numbers only. The default is 1. | |
2.3 Custom Communication Message Configuration

3. ModBus Command Description
3.1 Communication Assurance Fields
Communication assurance fields are used for communication status monitoring and for ensuring the uniqueness and correctness of command execution.

| Field | Description |
|---|---|
| Heartbeat | Used to monitor the communication status. When the Robot/PLC is connected to PickWiz, PickWiz writes 1 to the corresponding address block. When the Robot/PLC is disconnected from PickWiz (PickWiz has not written 1 for a long time), the Robot/PLC writes 0 to that address block. |
| Trigger Flag | Used to indicate whether the Robot/PLC triggers a command. When the Robot/PLC triggers a command, it writes 1 to the trigger-flag address block, and PickWiz reads data from that address block. After the Robot/PLC receives the message that PickWiz has received the command (the command acknowledgement flag is 1), the Robot/PLC writes 0 to the trigger-flag address block to prevent repeated triggering. After PickWiz finishes executing the command, PickWiz returns the Vision Result to the Robot/PLC and simultaneously reads data from the trigger-flag address block. If the value read is 0, the Robot/PLC can read the returned Vision Result. |
| Command Acknowledgement Flag | Used to indicate whether PickWiz has received the command. After the Robot/PLC triggers a command and PickWiz reads it, PickWiz writes 1 to the command-acknowledgement address block to inform the Robot/PLC that the command has been received. After PickWiz finishes executing the command and confirms that the Robot/PLC has reset the trigger flag (written 0), PickWiz synchronously resets the command acknowledgement flag (writes 0), informing the Robot/PLC that the command has been executed, the process is complete, and the Robot can read the returned Vision Result and then execute the task. |
| Execute Command | Used to indicate which command the Robot/PLC executes. When the Robot/PLC needs to execute a command, it writes 100/101 to the execute-command address block. PickWiz reads data from the execute-command address block to know which command the Robot/PLC needs to execute. 100 is the photo-taking command, and 101 is the clear-cache command (used in one shot, multiple picks). |

3.2 Calibration Communication Messages

Commands Sent from the Robot to PickWiz
Used for eye-hand calibration and for obtaining the current real-time Robot Pose in PickWiz when Eye in hand triggers photo-taking.
If Pose Type is set to Tool Pose in Basic Communication Configuration, send the current pose of the Robot end Tool to PickWiz (6 values);
If Pose Type is set to Joint Angles in Basic Communication Configuration, send the joint pose (6 values), which is used to calculate the Pick Point joint pose closest to that reference joint pose.
During eye-hand calibration or when
Eye in handtriggers photo-taking, the Robot writes the current real-time Robot Pose to this address block, and PickWiz reads the pose from this address block.The Robot Pose consists of 6 values, so 6 values of storage space must be reserved in the address block.
3.3 Vision Computation Communication Messages
When the Execute Command value is 100, vision computing can be performed and the following messages take effect. Check the checkbox, and the corresponding address input box will appear below. Enter the address block. When the Robot triggers the photo-taking command, it writes data to the corresponding address block, and PickWiz reads the data from that address block.

(1)Commands Sent from the Robot to PickWiz
| Field | Description |
|---|---|
| Joint Pose | Robot reference joint pose. When Pose Type is Joint Angles, you need to enter the Reference Joint Pose, which is used to calculate the joint pose of the Pick Point closest to that reference joint pose. The data length is 6. |
| Object Dimensions | When incoming materials include Target Objects of different sizes, the Robot needs to automatically adjust the grasping strategy according to different sizes. In different scenarios, the number of values passed for Object Dimensions and the corresponding object information are different. In circular-surface scenarios, 1 value is passed, representing the radius; in cylinder scenarios, 2 values are passed, representing radius\height; in carton scenarios, 3 values are passed, representing length\width\height; in quadrilateral scenarios, 2 values are passed, representing width\length. |
| Object Dimension Tolerance | When incoming materials include Target Objects of different sizes, the Robot needs to automatically adjust the grasping strategy according to different sizes. In different scenarios, the number of values passed for Object Dimension Tolerance and the corresponding object information are different. In circular-surface scenarios, 1 value is passed, representing the radius tolerance; in cylinder scenarios, 2 values are passed, representing radius\height tolerance; in quadrilateral scenarios, 2 values are passed, representing width\length tolerance. |
| Target Object ID | Target Object ID, used by the Robot to automatically switch the Target Object to pick |
| task ID | task ID, used by the Robot to automatically switch tasks |
| Calibration ID | Calibration ID, used by the Robot to automatically switch eye-hand calibration configuration files |
| Tool ID | Tool ID, used by the Robot to automatically switch the end Tool when executing tasks |
| ROI ID | ROI ID, used by the Robot to automatically switch ROI |
| Vision Parameter ID | Vision Parameter ID, used by the Robot to automatically switch vision parameters |
| Scene Object ID | Scene Object ID, used by the Robot to automatically switch Scene Object |
| Photo-taking Calculation Type | Photo-taking calculation type 0: retake images and perform vision computing; 1: use cached images (images acquired last time) for vision computing; 2: only take photos 3: take photos for “Automatic random pose sampling” 4: real-time vision drift correction 5: use historical data for vision computing 6: IPC shutdown |
(2)Commands Sent from PickWiz to the Robot
- Vision Result Information
| Field | Description |
|---|---|
| Photo Capture Completed Signal | Photo capture completed signal, 1 value, indicating that photo capture is completed and the Robot/PLC needs to reset it after receiving it |
| Vision Result Signal | Vision Result signal, 1 value. The default success value is 100, and other exceptions are 0 by default. This can be customized. |
| Returned Instance Type | Returned instance type, 1 value. An instance type value of 0 represents a Target Object and 1 represents a pallet. Different instance types have different picking-related information. |
| Remaining Instance Count | Remaining instance count, 1 value. Under the one shot, multiple picks picking logic, this returns the current number of remaining cached instances. |
| Returned Instance Count | Returned instance count, 1 value. This returns the number of instances recognized by instance segmentation 2D. This value is less than or equal to Number of Instances to Send. If there are multiple instances, the Length of Picking-related Information increases as the returned instance count increases. |
| Total Detected Instances | Total detected instances, 1 value. The number of detected instances before instance filtering. |
| Valid Instance Count | Valid instance count, 1 value. The number of detected instances after instance filtering. |
| Target Object Type | When recognizing multiple Target Object types, the returned type ID. |
- Automatic Calibration Sampling Send Command
When the eye-hand calibration method is
Automatic random pose sampling, you need to set this command. Otherwise, the Robot cannot communicate with PickWiz.
| Field | Description |
|---|---|
| Calibration Sampling Result: Different calibration sampling results correspond to different signal values | 0: the minimum number of samples is reached 1: a new sample is added successfully 11: failed to add a new sample 12: automatic sampling ends and the sample list is fully executed 13: failed to generate a sampling pose 14: calibration sampling page not entered 15: system error |
| Next Sampling Pose | The movement position for the Robot to collect the next calibration sample |
- Picking-related Information
The following length values for picking-related information represent the length for a single Pick Point. If there are multiple Pick Points, the total length is the number of values x the number of Pick Points.
Information Common to All Scenarios
| Field | Description |
|---|---|
| Target Object Category | / |
| Picked Target Object ID | 1 value; indicates the current Target Object index |
| Pick Point Pose | 6 values; indicates the pose data of the Pick Point |
| Pick Point Index | 1 value; indicates the current Pick Point index |
| Additional Information | 1 value; indicates the custom additional information of the current Target Object |
| Approach Point | Applicable only when the pose type is Joint Angles. The length is 1 + the number of Waypoints; format: (number of Waypoints, joint Waypoint poses from the pre-pick point to the Pick Point) |
| Retreat Point | Applicable only when the pose type is Joint Angles. The length is 1 + the number of Waypoints; format: (number of Waypoints, joint Waypoint poses from the Pick Point to the retreat Pick Point) |
- Vision Status Code
Vision status codes are used for troubleshooting. The complete status codes are shown in the following table.
You need to check “Vision Status Code” under Commands Sent from PickWiz to the Robot - Vision Result Information, and configure the address block and communication data type.
If the vision status code is not customized, the default value is
100for success and0for all other exceptions.
| Error Content | Default Value | Related Node |
|---|---|---|
| Success | 100 | / |
| Bottom plate detected | 301 | Foreground Processing (Foreground Builder) |
| No bin detected | 4000 | Bin Detection (Container Builder) |
| No instance detected | 5000 | Instance Segmentation (Instance Builder) |
| No pose detected | 6000 | Pose Estimation (Pose Builder) |
| No Pick Point detected | 7000 | Pick Point Generation (Grasp Builder) |
| No Path detected | 8000 | Robot Trajectory Generator (Trajectory Builder) |
| No instance size detected | 9000 | Object Size Generator (Size Builder) |
| Empty ROI | 1101 | Valid Point Filter (ValidPoints Criteria) |
| No valid instance | 12000 | Instance Filtering (Instance Criteria) |
| No valid Object Pose | 13000 | Pose Filtering (Pose Criteria) |
| No valid Pick Point | 14000 | Pick Point Filtering (Grasp Criteria) |
| All detection results collide and cannot be picked | 15000 | Collision Detection Filtering (Collision Criteria) |
| No instance with valid size | 17000 | Object Size Filtering (Size Criteria) |
| Exception | 20000 | Common exception error. Please check the logs to confirm. |
| Insufficient video memory | 20001 | Common exception error. Please check the logs to confirm. |
| Invalid input (please check algorithm parameters) | 20002 | Common exception error. Please check the logs to confirm. |
| Full inspection | 20003 | Related to point cloud processing operator (full_detect_judgment) |
| Foreign matter detection exception | 20004 | Related to instance filtering operator (foreign_matter_judgement) |
4. Edit, Copy, and Delete Robot Configurations
(1)Edit the Robot configuration
On the Add a Robot interface, left-click a Robot configuration to edit the selected Robot configuration.

(2)Copy the Robot configuration
On the Add a Robot interface, right-click a Robot configuration to copy the selected Robot configuration.

(3)Delete the Robot configuration
On the Add a Robot interface, right-click a Robot configuration to delete the selected Robot configuration.

5. Select a Robot Configuration
After ModBus communication configuration is completed, you can select the Robot configuration for the current task Scene on the task main interface. Select the corresponding Robot configuration in the Robot configuration selection bar, and PickWiz will try to establish communication with the Robot through the ModBus communication protocol.

If the communication connection is successful, the Robot communication connection status in the lower-left corner of the main interface will display "Connected".

If the communication connection fails, the Robot communication connection status will display "Disconnected". Please check whether the network cable between the Robot and the Vision system industrial PC (Industrial Personal Computer) is firmly connected and whether the program loaded and running on the Robot system is correct, then configure the Robot again.
