Siemens Snap7 Communication Configuration
About 3072 wordsAbout 10 min
Siemens Snap7 is a communication method in which PickWiz acts as the client and the Siemens PLC acts as the server. When PickWiz communicates with the Siemens PLC, it actively controls the PLC and sends commands to it. After receiving the commands, the Siemens PLC executes them.

Before configuring Siemens Snap7 communication for the Robot, refer to Project Operation Guide to create a new Project, then click Robot Configuration Panel on the main interface to enter the Add Robot page.

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

(2)Select Siemens Snap7 as the communication method, click Next, and enter the Robot Configuration page

2. Configure the Robot
On the Robot Configuration page, 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 and English characters, numbers, and symbols are supported |
| Configuration ID | The unique identifier 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 |
| Model File | When Other Device is selected for brand and model, you need to upload the model of that device. The model file format is urdf |
| Axis Count | The number of robotic arm axes of the Robot. Three-axis, four-axis, and six-axis are available |
| Rotation Expression | Describes the Robot Pose in three-dimensional space. Currently, Euler Angles and rotation vector are available, and the Euler angle order can be modified. |
2.2 Basic Communication Configuration

| Configuration Item | Description | |
|---|---|---|
| Communication Address | Host IP | The local IP address. Under Siemens Snap7 communication mode, the default is 127.0.0.1 |
| Port Number | The specified port on the local machine to which the Robot connects. The default port is 6000 and usually does not need to be modified | |
| Data Block Number | PLC data block number | |
| Rack Number | The rack number of the Siemens PLC hardware module, configured according to the hardware selection | |
| Slot Number | The slot number of the Siemens PLC hardware module, configured according to the hardware selection | |
| Read/Write Format | Euler Angle Unit | The unit of Euler Angles. Degree and radian are available, and the default is degree. |
| Length Unit | The length unit used by the Robot, including Robot Pose, Target Object Dimensions, and so on. The default is mm | |
| Pose Type | The representation of the Robot Pose, and the default is Tool pose. Tool pose refers to the pose of the Robot end Tool; joint angle refers to the pose of each Robot joint, and the combination of the poses of all joints can determine the pose of the robotic arm or the end Tool. When Other Device is selected for the Robot brand and model, only Tool pose can be selected for the pose type by default | |
| Reserved Decimal Places | How many decimal places to retain for floating-point data in Robot instructions. Numbers only are supported, and the default is 1 | |
2.3 Custom Communication Message Configuration

3. Siemens Snap7 Instruction Description
3.1 Communication Assurance Fields
Used to monitor the communication status and ensure the uniqueness of instruction execution. Address blocks should be filled in the text boxes. Address blocks are the areas in the Robot/PLC used to store data. Each area has a corresponding address number, and read/write operations by the Robot/PLC or PickWiz read from or write to these corresponding storage areas.

| 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 has triggered an instruction. When the Robot/PLC triggers an instruction, the Robot/PLC writes 1 to the trigger flag address block, and PickWiz reads data from the trigger flag address block. After the Robot/PLC receives confirmation that PickWiz has received the instruction (the instruction acknowledgment flag is 1), the Robot/PLC writes 0 to the trigger flag address block to prevent the Robot/PLC from triggering the instruction again. After PickWiz finishes executing the instruction, PickWiz returns the vision inspection result to the Robot/PLC and simultaneously reads data from the trigger flag address block. If 0 is read, the Robot/PLC can read the returned vision inspection result |
| Instruction Acknowledgment Flag | Used to indicate whether PickWiz has received the instruction. After the Robot/PLC triggers an instruction and PickWiz reads it, PickWiz writes 1 to the instruction acknowledgment flag address block to notify the Robot/PLC that the instruction has been received. After PickWiz finishes executing the instruction and confirms that the Robot/PLC has reset the trigger flag (written 0), PickWiz synchronously resets the instruction acknowledgment flag (writes 0), informing the Robot/PLC that the instruction has been executed and the process is complete. The Robot then reads the returned vision inspection result and executes the task. |
| Execution Instruction | Used to indicate that the Robot/PLC executes a certain instruction. When the Robot/PLC needs to execute a certain instruction, it writes 100/101 to the execution instruction address block. PickWiz reads data from the execution instruction address block to determine which instruction the Robot/PLC needs to execute. 100 is the image-capture instruction, and 101 is the clear-cache instruction (used in `One Shot Multiple Picks` mode) |

3.2 Calibration Communication Messages

The Robot sends Robot Pose to PickWiz. This is used for eye-hand calibration and for PickWiz to obtain the current real-time Robot Pose when Eye in hand triggers image capture.
If Pose Type in the basic communication configuration is Tool pose, send the current Robot Pose of the Robot end Tool to PickWiz (6 data values);
If Pose Type in the basic communication configuration is Joint Angle, send joint pose (6 data values), which is used to calculate the Pick Point joint pose closest to the reference joint pose.
During eye-hand calibration or when Eye in hand triggers image capture, the Robot writes the current real-time Robot Pose to this address block, and PickWiz reads the pose from this address block
Robot Pose consists of 6 data values, so storage space for 6 data values must be reserved when writing to the address block
3.3 Vision Calculation Communication Messages
When the Execution Instruction value is 100, vision calculation can be performed and the following messages take effect. After Checkbox is selected, the corresponding Address Input Box appears below. Enter the address block, and when the Robot triggers the image-capture instruction, it writes data to the corresponding address block, which PickWiz reads.

(1)Instructions Sent from the Robot to PickWiz
| Field | Description |
|---|---|
| Joint Pose | The Robot reference joint pose. When Pose Type is Joint Angle, Reference Joint Pose must be entered for 6 data values. It is used to calculate the Pick Point joint pose closest to the reference joint pose |
| Target Object Dimensions | The incoming materials may be Target Objects of multiple sizes, so the Robot needs to automatically adjust the grasping strategy according to different sizes. In different scenarios, the number of Target Object dimension values passed from the Robot side and the corresponding Target Object information differ. For the circular surface scenario, 1 value is passed, representing the radius; for the cylinder scenario, 2 values are passed, representing radius\height; for the carton scenario, 3 values are passed, representing length\width\height; for the quadrilateral scenario, 2 values are passed, representing width\length. |
| Target Object Dimension Tolerance | The incoming materials may be Target Objects of multiple sizes, so the Robot needs to automatically adjust the grasping strategy according to different sizes. In different scenarios, the number of Target Object dimension tolerance values passed from the Robot side and the corresponding Target Object information differ. For the circular surface scenario, 1 value is passed, representing the radius tolerance; for the cylinder scenario, 2 values are passed, representing radius\height tolerances; for the quadrilateral scenario, 2 values are passed, representing width\length tolerances. |
| 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 Tool during task execution |
| ROI ID | The ID of the ROI, used by the Robot to automatically switch the 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 Objects |
| Image Capture Calculation Type | 0: retake an image and perform vision calculation after image acquisition; 1: use the cached image (the image acquired last time) for vision calculation; 2: only perform image acquisition 3: perform image acquisition for Random Pose Automatic Sampling 4: real-time correction of visual drift 5: use historical data for vision calculation 6: shut down the industrial PC |
(2)Instructions Sent from PickWiz to the Robot
- Vision Inspection Information
| Field | Description |
|---|---|
| Image Capture Completion Signal | Image capture completion signal, 1 value, indicating that image capture is complete. The Robot/PLC needs to reset it after receiving it |
| Inspection Result Signal | Vision inspection signal, 1 value. The default success value is 100, and other exceptions are 0. Custom configuration is supported |
| Returned Instance Type | Returned instance type, 1 value. An instance type value of 0 indicates a Target Object, and 1 indicates a pallet. The picking-related information differs for different instance types |
| Remaining Instance Count | Remaining instance count, 1 value. Under the picking logic of One Shot Multiple Picks, it returns the current number of remaining cached instances |
| Returned Instance Count | Returned instance count, 1 value. Returns the number of instances recognized by Instance Segmentation 2D. This value is less than or equal to Sent Instance Count. If there are multiple instances, Pick-related Information Length 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 |
- Automatic Calibration Sampling Send Instruction
When the eye-hand calibration method is “random pose automatic sampling”, this instruction must be configured. Otherwise, the Robot cannot communicate with PickWiz
| Calibration Sampling Result: Different calibration sampling results correspond to different signal values | 0: the sample count reaches the minimum quantity1: successfully added a new sample11: failed to add a new sample12: automatic sampling ended and the sample list has been executed13: failed to generate a sampling pose14: calibration sampling page was not opened15: system error |
|---|---|
| Next Sampling Pose | The moving position for the Robot to collect the next calibration sample |
- Picking-Related Information
The lengths of the picking-related information described below are for a single Pick Point. If there are multiple Pick Points, the length is the number of values x the number of Pick Points
General information for all scenarios
| Field | Description |
|---|---|
| Target Object Category | |
| Picked Target Object ID | 1 value; indicates the current Target Object sequence number |
| Pick Point Pose | 6 values; indicates the pose data of the Pick Point |
| Pick Point Index | 1 value; indicates the current Pick Point sequence number |
| Additional Information | 1 value; indicates the custom additional information of the current Target Object |
| Approach Point | Applicable only when the pose type is Joint Angle. The length is 1+ the number of Waypoints; the format is (number of Waypoints, joint Waypoint pose from the pre-pick point to the Pick Point) |
| Retreat Point | Applicable only when the pose type is Joint Angle. The length is 1+ the number of Waypoints; the format is (number of Waypoints, joint Waypoint pose from the Pick Point to the retreat pick point) |
Common information for carton/sack depalletizing
Product Length: 1 value, the current product length (along the image x direction)
Product Width: 1 value, the current product width (along the image y direction)
Product Orientation: 1 value, the product orientation (0: horizontal along x, 1: vertical along y)
Upper-left Vertex Position of the Pallet: 3 values (x, y, z), indicating the position information of the upper-left vertex of the pallet in the current Scene
Upper-right Vertex Position of the Pallet: 3 values (x, y, z), indicating the position information of the upper-right vertex of the pallet in the current Scene
Lower-left Vertex Position of the Pallet: 3 values (x, y, z), indicating the position information of the lower-left vertex of the pallet in the current Scene
Lower-right Vertex Position of the Pallet: 3 values (x, y, z), indicating the position information of the lower-right vertex of the pallet in the current Scene
Carton depalletizing information:
- Product Height: 1 value, the current product height
Ordered/unordered circular wafer picking:
- Circular Surface Radius: 1 value, the current product circular surface radius
Ordered/unordered cylinder picking:
Circular Surface Radius: 1 value, the current product circular surface radius
Cylinder Height: 1 value, the current product height
Unordered picking:
- Target Object Category: 1 value, the current Target Object category
Quadrilateral:
Quadrilateral Length: 1 value, the current product length
Quadrilateral Width: 1 value, the current product width
Vision Status Code
Vision status codes are used for troubleshooting. The complete status codes are shown in the following table
In Instructions Sent from PickWiz to the Robot - Vision Inspection Information, select “Vision Status Code” and configure the address block and communication data type.
If the vision status code is not custom-configured, 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) |
| Bin Not Detected | 4000 | Bin Detection(Container Builder) |
| Instance Not Detected | 5000 | Instance Segmentation(Instance Builder) |
| Pose Not Detected | 6000 | Pose Estimation(Pose Builder) |
| Pick Point Not Detected | 7000 | Pick Point Generation(Grasp Builder) |
| Path Not Detected | 8000 | Robot Trajectory Generator(Trajectory Builder) |
| Target Object Dimensions Not Detected | 9000 | Target Object Dimensions Generator(Size Builder) |
| Empty ROI | 1101 | Invalid Point Filter(ValidPoints Criteria) |
| No Valid Instance | 12000 | Instance Filtering(Instance Criteria) |
| No Valid Target 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 Dimensions | 17000 | Target Object Dimensions Filtering(Size Criteria) |
| Exception | 20000 | General exception error. Please check the logs for confirmation |
| Insufficient Video Memory | 20001 | General exception error. Please check the logs for confirmation |
| Invalid Input (Please Check Algorithm Parameters) | 20002 | General exception error. Please check the logs for confirmation |
| Full Inspection | 20003 | Related to point cloud processing operators(full_detect_judgment) |
| Foreign Matter Detection Exception | 20004 | Related to instance filtering operators(foreign_matter_judgement) |
4. Edit, Copy, and Delete the Robot
(1)Edit Robot Configuration
On the Add Robot page, left-click a Robot configuration to edit the selected Robot configuration.

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

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

5. Select a Robot Configuration
After completing the Siemens Snap7 communication configuration, you can select a 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 attempt to establish communication with the Robot through the Siemens Snap7 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 industrial PC is securely connected and whether the program loaded and running on the Robot system is correct, then reconfigure the Robot.
