Why does Pose Data Occasionally Show as 0 Despite Normal Status Code in Siemens PLC Communication?
Problem
When Siemens PLC protocol communication is used, after the PLC sends a command to the vision system, the Log panel of the vision system shows that pose data has been sent and the status code received by the PLC also indicates normal, but the pose data received by the PLC is 0.
Cause
The PLC uses periodic clearing of the pose register data as an error prevention measure, but the timing of the clearing occasionally conflicts with the vision system writing pose data.
Solution
-
Set a unique automatic-run step number for the operation of clearing the pose register data. For example, you can do so during the initialization of the image-capturing.
-
If the MM_Empty_Target function is used, the method mentioned in “1” above should be adopted, as shown in the figure below.
If the function is constantly enabled, it reads and writes InOut interface parameter values once every scan cycle. During the execution cycle of this function, the pose data is displayed as 0 because this function clears the data that is being written by the vision system. The vision system writes the pose data by using Target_Pose parameters. -
If the MM Interface data block is being used as a whole as the InOut interface parameters for a function block and this function block remains enabled, the pose data may also be 0. You can adopt a method similar to the following one to address the issue: add the control camera and read camera structures to the MM Interface data block and use the structure data as OUT interface parameters and IN interface parameters respectively for the function block, as shown in the figure below.