Standard Interface Commands

You are currently viewing the documentation for the latest version (2.1.2). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

This section describes standard interface commands used in PROFINET communications between a Siemens SIMATIC S7 Series PLC and Mech-Mind Vision System. The PLC (the client) sends commands to Mech-Mind Vision System (the server), and Mech-Mind Vision System returns the processed data to the PLC.

send receive

Precautions

  • Unit of data:

    • The unit of joint positions is degree (°).

    • A robot’s flange pose or TCP consists of the position and pose. The position is represented in XYZ coordinates and is measured in millimeters (mm); the pose is represented in Euler angles and is measured in degrees (°).

  • Vision point and waypoint:

    • Vision point: An object recognized by Mech-Vision. A vision point has information including the object pose, label, velocity, dimensions, and custom data.

    • Waypoint: Each point that the robot reaches when moving along the planned path. A waypoint has information including the robot pose, label, motion type, and velocity. Waypoints can be divided into two categories:

      • Vision Move waypoint: Waypoint corresponding to the Vision Move Step.

      • Non-Vision Move waypoints, which refer to the waypoints corresponding to Move-type Steps other than the Vision Move Step.

Run Mech-Vision Project

Description

This command triggers the Mech-Vision project to run. When the Mech-Vision project is running, the vision system triggers the camera to capture images and then process the returned images with algorithms to produce a series of vision points or waypoints.

  • Vision point: An object recognized by Mech-Vision. A vision point has information including the object pose, label, velocity, dimensions, and custom data.

  • Waypoint: Each point that the robot reaches when moving along the planned path. A waypoint has information including the robot pose, label, motion type, and velocity.

Calling Sequence

Modules

cmd1

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is USINT. You can view the project ID of a Mech-Vision project in the Project List section of Mech-Vision. The project ID is the number before the project name.

Req_Pose_Num

This parameter specifies the number of vision points or waypoints expected to be returned by the Mech-Vision project. The data type is USINT. Valid values: 0 to the largest positive integer.

If the Mech-Vision project has a Path Planning Step, this parameter indicates the expected number of waypoints. Otherwise, it indicates the expected number of vision points.
  • 0: Obtain all vision points or waypoints from the Mech-Vision project.

  • A positive integer: Obtain the specific number of vision points or waypoints from the Mech-Vision project.

    • If the total amount of vision points or waypoints output by the Mech-Vision project is smaller than the parameter value, this command will obtain the number of all vision points or waypoints.

    • If the total amount of vision points or waypoints output by the Mech-Vision project is larger than or equal to the parameter value, this command will obtain the number of vision points or waypoints as specified by this parameter.

Vision points or waypoints will not be returned after Run Mech-Vision Project is called. To obtain vision points, call Get Vision Result. To obtain waypoints, call Get Planned Path in Mech-Vision.

Robot_Pose_Type

This parameter specifies the pose type of the real robot to send to the Mech-Vision project. The data type is USINT. Valid values: 0, 1, 2, and 3. The following table describes the details.

Robot_Pose

This parameter specifies the pose of the robot. The data type is ARRAY[0..1, 0..5] OF DINT. The data structure of this parameter is a two-dimensional array, where Robot_Pose[0,0] to [0,5] represent the robot joint positions, and Robot_Pose[1,0] to [1,5] represent the robot flange pose.

The following table explains the relationship between Robot_Pose_Type and Robot_Pose.

Robot_Pose_Type Robot_Pose Description Applicable scenario

0

[[0,0,0,0,0,0]],[0,0,0,0,0,0]]

The command does not send the robot pose to the Mech-Vision project.

If the Path Planning Step is used in the Mech-Vision project, the start point of the planned path will be the Home point set in the path planning tool.

This setting should be used if the camera is mounted in eye to hand mode and the project does not require images to be captured beforehand.

1

Current joint positions and flange pose of the robot

The robot joint positions and flange pose must be input to the Mech-Vision project.

This setting should be used when the camera is mounted in eye in hand mode.

This setting is recommended for most scenarios except those involving gantry robots.

2

Current flange pose of the robot

The robot flange pose must be input to the Mech-Vision project.

This setting is recommended for scenarios involving gantry robots.

3

Custom joint positions of the robot

This command sends custom joint positions to the Mech-Vision project.

These joint positions will be sent to the Path Planning Step in the Mech-Vision project as the start point, where the robot will move from this start point to the first waypoint of the planned path.

This setting should be used if the camera is mounted in eye to hand mode and the project requires images to be captured beforehand.

The current joint positions and flange pose of the robot are floating-point numbers. You must first multiply the floating-point values by 10,000 to convert them into 32-bit signed integers before storing them in the Robot_Pose array.

Start_Vision

This parameter triggers the Mech-Vision project to start when a rising edge occurs. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Start_Vision in the previous scan cycle. The data type is BOOL. 1 indicates that Start_Vision was high in the previous scan cycle, while 0 indicates that Start_Vision was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Start_Vision. The data type is BOOL. 1 indicates that a rising edge occurred on Start_Vision, while 0 indicates that no rising edge occurred on Start_Vision.

Output Parameters

Vision_Proj_Num_O

This parameter indicates the Mech-Vision project ID. The data type is USINT.

Req_Pose_Num_O

This parameter specifies the number of vision points or waypoints expected to be returned by the Mech-Vision project. The data type is USINT. 0: Obtain all vision points or waypoints from the Mech-Vision project.

Robot_Pose_Type_O

This parameter indicates the way in which the real robot pose is sent to the Mech-Vision project. The data type is USINT. Valid values: 0, 1, 2, and 3.

Robot_Pose_JPS

This parameter indicates the joint positions of the robot. The data type is ARRAY[0..5] OF DINT.

Robot_Pose_TCP

This parameter indicates the flange pose of the robot. The data type is ARRAY[0..5] OF DINT.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 1102 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd2

When "Camera_User".Step_Num is set to 2 and "Camera_User".Start_Vis is at the rising edge, the PLC triggers Mech-Vision project No.1 to run and expects Mech-Vision project No.1 to return all vision points or waypoints. At the same time, the PLC sends the current joint positions and flange pose of the robot to Mech-Vision.

Get Vision Result

Description

This command obtains vision result, namely, a series of vision points, from Mech-Vision. The object pose of the vision point (namely, the output of the poses port of the Output Step) will be automatically converted to the robot’s TCP by the vision system. The process is as follows.

get tcp
  1. Convert the object pose from a quaternion to Euler angles.

  2. Rotate the object’s pose around the X-axis by 180° to orient its Z-axis downward.

    convert tcp

Calling Sequence

This command should be called after Run Mech-Vision Project.

Modules

cmd3

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is USINT. You can view the project ID of a Mech-Vision project in the Project List section of Mech-Vision. The project ID is the number before the project name.

Get_VisData

This parameter triggers the vision result to be obtained at the rising edge. The data type is BOOL.

Data_Ready

This parameter specifies whether the vision result is readable. This parameter is used to receive multiple vision points. The data type is BOOL. 1 indicates readable. 0 indicates unreadable.

Send_Pose_Num

This parameter indicates the number of vision points returned by Mech-Vision. The data type is USINT. Valid values: 0 to the largest positive integer.

Target_Pose

This parameter indicates the pose of each vision point in the obtained vision result. The poses are TCPs. The data type is ARRAY[0..5] OF DINT.

Target_Label

This parameter indicates the label of each vision point in the obtained vision result. Labels and poses are one-to-one paired. The data type is DINT.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Get_VisData in the previous scan cycle. The data type is BOOL. 1 indicates that Get_VisData was high in the previous scan cycle, while 0 indicates that Get_VisData was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Get_VisData. The data type is BOOL. 1 indicates that a rising edge occurred on Get_VisData, while 0 indicates that no rising edge occurred on Get_VisData.

Output Parameters

Vision_Proj_Num_O

This parameter indicates the Mech-Vision project ID. The data type is USINT.

Target_Pose_O

This parameter indicates the poses of all vision points in the obtained vision result. The poses are TCPs. The data type is ARRAY[0..19,0..5] OF DINT.

You must divide the elements of the Target_Pose_O array by 10,000 to obtain the TCP.

Target_Label_O

This parameter indicates the labels of all vision points in the obtained vision result. Labels and poses are one-to-one paired. The data type is ARRAY[0..19] OF DINT.

DataACK

This parameter confirms whether the data returned by Mech-Vision is read and cached. The data type is BOOL.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 1100 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

By default, after the robot sends this command, the vision system returns the result in 10 seconds. If the vision system fails to return any result in 10 seconds, a timeout error code is returned. To modify the default timeout period as needed, go to Robot and Communication > Robot Communication Configuration  Next  Advanced Settings in the toolbar of Mech-Vision.

set vis time

"CameraIO".MM.FromCamera.SEND_POSE_TYPE

The parameter value is 2, which indicates that the pose returned by Mech-Vision is TCP. The data type is USINT.

Example

cmd4

When "Camera_User".Step_Num is set to 4 and "Camera_User".Get_VisData is at the rising edge, this example obtains the vision result from Mech-Vision project No. 1.

Switch Mech-Vision Parameter Recipe

Description

This command triggers Mech-Vision to switch the parameter recipe used by the project. The image below shows how to manually switch the parameter recipe for a Mech-Vision project. For details about parameter recipes, see the parameter recipe guide.

set recipe

Calling Sequence

This command should be called before Run Mech-Vision Project.

Modules

cmd5

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is USINT. You can view the project ID of a Mech-Vision project in the Project List section of Mech-Vision. The project ID is the number before the project name.

Vision_Recipe_Num

This parameter indicates the parameter recipe ID in the Mech-Vision project. The data type is USINT. For details on how to check the parameter recipe ID, see View the Parameter Recipe ID.

Switch_Recipe

This parameter triggers the switch of parameter recipe in Mech-Vision when the rising edge occurs. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Switch_Recipe in the previous scan cycle. The data type is BOOL. 1 indicates that Switch_Recipe was high in the previous scan cycle, while 0 indicates that Switch_Recipe was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Switch_Recipe. The data type is BOOL. 1 indicates that a rising edge occurred on Switch_Recipe, while 0 indicates that no rising edge occurred on Switch_Recipe.

Output Parameters

Vision_Proj_Num_O

This parameter indicates the Mech-Vision project ID. The data type is USINT.

Vision_Recipe_Num_O

This parameter indicates the parameter recipe ID in the Mech-Vision project. The data type is USINT.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 1107 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd6

When "Camera_User".Step_Num is set to 0 and "Camera_User".Switch_Recipe is at the rising edge, this example switches the parameter recipe used to No.1 in Mech-Vision project No.1.

Get Planned Path in Mech-Vision

Description

This command obtains the path planned by the Mech-Vision project as a series of waypoints. The path is planned by the path planning tool, which you may enter by clicking Config wizard as shown in the image below. For details about Path Planning, see Path Planning.

Set the Port Type parameter of the Output Step in Mech-Vision to Predefined (robot path).
get plan path step

Calling Sequence

This command should be called after Run Mech-Vision Project.

Modules

cmd7

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is USINT. You can view the project ID of a Mech-Vision project in the Project List section of Mech-Vision. The project ID is the number before the project name.

Request_Pose_Type

This parameter specifies the type of waypoint poses to be obtained. The data type is USINT. Valid values: 1 and 2.

  • 1: Joint positions.

  • 2: TCP.

Get_VisData

This parameter triggers the path planned by Mech-Vision to be obtained at the rising edge. The data type is BOOL.

Data_Ready

This parameter specifies whether the planned path is readable. This parameter is used to receive multiple waypoints. The data type is BOOL. 1 indicates readable. 0 indicates unreadable.

Send_Pose_Num

This parameter indicates the number of waypoints returned by Mech-Vision. The data type is USINT. Valid values: 0 to the largest positive integer.

Target_Pose

This parameter indicates the pose of each waypoint in the obtained planned path. The data type is ARRAY[0..5] OF DINT.

Target_Label

This parameter indicates the label of each waypoint in the obtained planned path. Labels and poses are one-to-one paired. The data type is DINT.

Target_Tool_ID

This parameter indicates the tool ID of each waypoint in the obtained planned path. The tool IDs and poses are one-to-one paired. The data type is DINT.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Get_VisData in the previous scan cycle. The data type is BOOL. 1 indicates that Get_VisData was high in the previous scan cycle, while 0 indicates that Get_VisData was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Get_VisData. The data type is BOOL. 1 indicates that a rising edge occurred on Get_VisData, while 0 indicates that no rising edge occurred on Get_VisData.

Output Parameters

Vision_Proj_Num_O

This parameter indicates the Mech-Vision project ID. The data type is USINT.

Request_Pose_Type_O

This parameter indicates the pose type of waypoints. The data type is USINT. 1 indicates joint positions, 2 indicates TCP.

Target_Pose_O

This parameter indicates the poses of all waypoints in the obtained planned path. The pose type can be either TCP or joint positions, depending on the value of the Request_Pose_Type parameter. The data type is ARRAY[0..19,0..5] OF DINT.

You must divide the elements of the Target_Pose_O array by 10,000 to obtain the pose data.

Target_Label_O

This parameter indicates the labels of all waypoints in the obtained planned path. Labels and poses are one-to-one paired. The data type is ARRAY[0..19] OF DINT.

Target_Tool_ID_O

This parameter indicates the tool IDs of all waypoints in the obtained planned path. The tool IDs and poses are one-to-one paired. The data type is ARRAY[0..19] OF DINT.

DataACK

This parameter confirms whether the data returned by Mech-Vision is read and cached. The data type is BOOL.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 1103 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

By default, after the robot sends this command, the vision system returns the result in 10 seconds. If the vision system fails to return any result in 10 seconds, a timeout error code is returned. To modify the default timeout period as needed, go to Robot and Communication > Robot Communication Configuration  Next  Advanced Settings in the toolbar of Mech-Vision.

set vis time

"CameraIO".MM.FromCamera.SEND_POSE_TYPE

This parameter represents the pose type of the waypoints, and its value is the same as the input value of the Request_Pose_Type parameter. The data type is USINT. 1 indicates joint positions, 2 indicates TCP.

"CameraIO".MM.FromCamera.VISUAL_POINT_INDEX

The sequence number of the Vision Move waypoint (the waypoint corresponding to the Vision Move step of the path planning tool) in the path. The data type is USINT. If the waypoint does not exist in the path, the petameter value is 0.

If the planned path consists of the following waypoints in sequence: Fixed-Point Move_1, Fixed-Point Move_2, Vision Move, and Fixed-Point Move_3, the sequence number of the Vision Move waypoint is 3.

Example

cmd8

When "Camera_User".Step_Num is set to 5 and "Camera_User".Get_VisData is at the rising edge, this example obtains the planned path from Mech-Vision project No. 1. The waypoints are represented in joint positions.

Get Gripper DO List

Description

This command obtains the control signal list for the multi-section vacuum gripper from the Mech-Viz project. Before using this command, you must perform the following configurations in Mech-Viz.

  • In the Vision Move Step of Mech-Viz, set Select Picking Method to Box depalletizing.

    vision move viz
  • In Mech-Viz, double-click the tool name, select Depalletizing vacuum gripper for Tool type, click Configure depalletizing vacuum gripper, and then configure the DO signals according to needs.

    sucker viz

Calling Sequence

This command must be called before the Get Planned Path in Mech-Viz command. This means that the PLC must obtain the planned path and then obtain gripper DO signals of the Vision Move waypoint.

Modules

cmd9

Input Parameters

Get_DoList

This parameter triggers gripper DO signals to be obtained at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Get_DoList in the previous scan cycle. The data type is BOOL. 1 indicates that Get_DoList was high in the previous scan cycle, while 0 indicates that Get_DoList was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Get_DoList. The data type is BOOL. 1 indicates that a rising edge occurred on Get_DoList, while 0 indicates that no rising edge occurred on Get_DoList.

Output Parameters

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. If the DO signal list is successfully obtained from Mech-Viz, the status code is 2102. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

"CameraIO".MM.FromCamera.DO_LIST

This parameter indicates the 64 DO signals returned by this command. The data type is ARRAY[0..7] OF BYTE.

Example

cmd10

When "Camera_User".Step_Num is set to 20 and "Camera_User".Get_DoList is at the rising edge, this example obtains the DO signal list from Mech-Viz and stores the list in "CameraIO".MM.FromCamera.DO_LIST.

Run Mech-Viz Project

Description

This command triggers the Mech-Viz project to run. Mech-Viz plans the robot’s motion path based on the vision result output by Mech-Vision.

Right-click the project name in the project resource panel in Mech-Viz and select Autoload Project.

Modules

cmd13

Input Parameters

Robot_Pose_Type

This parameter specifies the way in which the real robot pose is sent to the Mech-Viz project. Valid values: 0, 1, and 2. The following table describes the details. The data type is USINT.

Robot_Pose

This parameter specifies the pose of the robot. The data type is ARRAY[0..1, 0..5] OF DINT. The data structure of this parameter is a two-dimensional array, where Robot_Pose[0,0] to [0,5] represent the robot joint positions, and Robot_Pose[1,0] to [1,5] represent the robot flange pose.

The following table explains the relationship between Robot_Pose_Type and Robot_Pose.

Robot_Pose_Type Robot_Pose Description Applicable scenario

0

[[0,0,0,0,0,0]],[0,0,0,0,0,0]]

This command does not need to send the robot pose to the Mech-Viz project. The simulated robot in the Mech-Viz project will move from the set home position to the first waypoint.

This setting is recommended when the camera is mounted in eye to hand mode.

1

Current joint positions and flange pose of the robot

In this command, the robot sends its current joint positions and flange pose to the Mech-Viz project. The simulated robot in Mech-Viz moves from the input joint positions to the first waypoint.

This setting is recommended when the camera is mounted in eye in hand mode.

2

Joint positions of the start point of the planned path

In this command, the robot sends the joint positions of a teach point (the custom joint positions), instead of the current joint positions, to the Mech-Viz project. The Mech-Viz project uses the input joint positions to plan the next path in advance while the robot is not in the camera capture region, as shown below. The simulated robot in Mech-Viz moves from the input joint positions to the first waypoint.

This setting is recommended when the camera is mounted in eye to hand mode.

The current joint positions and flange pose of the robot are floating-point numbers. You must first multiply the floating-point values by 10,000 to convert them into 32-bit signed integers before storing them in the Robot_Pose array.
If the camera is mounted in eye to hand mode, option 2 is recommended for Robot_Pose_Type. Why?

In eye to hand mode, the camera can perform image capturing for the next round of path planning before the robot returns to the image capture region and picking region, thus shortening the cycle time. The image below demonstrates how a robot works in the placing region.

If Robot_Pose_Type is set to 1, the robot will send the current pose to Mech-Viz. It is possible that the real robot moves to other positions before reaching the first waypoint. However, the simulated robot moves directly to the first waypoint of the Mech-Viz project from the pose sent by the robot. Consequently, there may be a mismatch between the paths of the real robot and simulated robot. This mismatch can potentially lead to unpredicted safety hazards, especially if a collision is detected in the path of the simulated robot.

On the other hand, if Robot_Pose_Type is set to 2, the robot will send the image-capturing pose set by teaching to Mech-Viz. Thus, the real robot can trigger the next round of path planning in Mech-Viz when the real robot is in the image-capturing region and the cycle time can be shortened.

This is why when the camera is mounted in eye to hand mode, option 2 is recommended for Robot_Pose_Type.

robot example

Start_Viz

This parameter triggers the Mech-Viz project to run at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Start_Viz in the previous scan cycle. The data type is BOOL. 1 indicates that Start_Viz was high in the previous scan cycle, while 0 indicates that Start_Viz was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Start_Viz. The data type is BOOL. 1 indicates that a rising edge occurred on Start_Viz, while 0 indicates that no rising edge occurred on Start_Viz.

Output Parameters

Robot_Pose_Type_O

This parameter indicates the way in which the real robot pose is sent to the Mech-Viz project. The data type is USINT. Valid values: 0, 1, and 2.

Robot_Pose_JPS

This parameter indicates the joint positions of the robot. The data type is ARRAY[0..5] OF DINT.

Robot_Pose_TCP

This parameter indicates the flange pose of the robot. The data type is ARRAY[0..5] OF DINT.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 2103 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd14

When "Camera_User".Step_Num is set to 10 and "Camera_User".Start_Viz is at the rising edge, this example triggers the Mech-Viz project to run.

Stop Mech-Viz Project

Description

This command stops the Mech-Viz project.

Calling Sequence

This command should be called after Run Mech-Viz Project.

Modules

cmd15

Input Parameters

Stop_Viz

This parameter triggers the Mech-Viz project to stop at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Stop_Viz in the previous scan cycle. The data type is BOOL. 1 indicates that Stop_Viz was high in the previous scan cycle, while 0 indicates that Stop_Viz was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Stop_Viz. The data type is BOOL. 1 indicates that a rising edge occurred on Stop_Viz, while 0 indicates that no rising edge occurred on Stop_Viz.

Output Parameters

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 2104 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd16

When "Camera_User".Step_Num is set to 12 and "Camera_User".Stop_Viz is at the rising edge, this example stops the Mech-Viz project.

Set the Exit Port for the Branch by Msg Step in Mech-Viz

Description

This command sets the exit port for the Branch by Msg Step. When the next Step is a Branch by Msg Step, the Mech-Viz project will wait for this command to specify the exit port.

set branch

Calling Sequence

This command should be called after Run Mech-Viz Project.

Modules

cmd17

Input Parameters

Branch_Name

This parameter specifies the “Branch by Msg” Step by its ID. The data type is USINT. Valid values: positive integers. The Step ID is displayed in the Step parameter panel. For example, the Step ID of the Step in the image above is 1.

Branch_Exit_Port

This parameter indicates the exit port of the Branch by Msg Step. The data type is USINT. Valid values: positive integers. When the parameter value is set to N, the Mech-Viz project exits from the port with an ID of N-1 of the Branch by Msg Step.

Set_Branch

This parameter triggers the exit port of the Branch by Msg Step to be set in the Mech-Viz project at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Set_Branch in the previous scan cycle. The data type is BOOL. 1 indicates that Set_Branch was high in the previous scan cycle, while 0 indicates that Set_Branch was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Set_Branch. The data type is BOOL. 1 indicates that a rising edge occurred on Set_Branch, while 0 indicates that no rising edge occurred on Set_Branch.

Output Parameters

Branch_Name_O

This parameter indicates the Step ID of the Branch by Msg Step. The data type is USINT.

Branch_Exit_Port_O

This parameter indicates the exit port of the Branch by Msg Step. The data type is USINT.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 2105 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd18

When Camera_User.Step_Num is set to 16 and "Camera_User".Set_Branch is at the rising edge, the Mech-Viz project takes port 0 of the Branch by Msg Step No.1.

Set Current Index in Mech-Viz

Description

This command sets the value of the Current Index parameter of index-type Steps. Index-type Steps are Steps that include the Index section, which include Move by Grid, Move by List, Custom Pallet Pattern, and Predefined Pallet Pattern.

set index

Calling Sequence

Index-type Steps are often preceded by a Branch by Msg Step. The PLC should call commands in this order: Run Mech-Viz Project, Set Current Index in Mech-Viz, and Set the Exit Port for the Branch by Msg Step in Mech-Viz. This is to ensure that Mech-Viz has enough time to set the Current Index value.

Modules

cmd19

Input Parameters

Index_Name

This parameter specifies the Step ID of the Index-type Step. The data type is USINT. Valid values: positive integers. The Step ID is displayed in the Step parameter panel. For example, the Step ID of the Step in the image above is 3.

Index_Counter

This parameter sets the value of the Current Index parameter of index-type Steps. The data type is USINT. Valid values: positive integers. When this parameter value is set to N, the current index of the corresponding Step is N-1.

Set_Index

This parameter triggers the Current Index value to be set in the Mech-Viz project at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Set_Index in the previous scan cycle. The data type is BOOL. 1 indicates that Set_Index was high in the previous scan cycle, while 0 indicates that Set_Index was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Set_Index. The data type is BOOL. 1 indicates that a rising edge occurred on Set_Index, while 0 indicates that no rising edge occurred on Set_Index.

Output Parameters

Index_Name_O

This parameter indicates the Step ID of the index-type Step. The data type is USINT.

Index_Counter_O

This parameter indicates the Current Index value of the index-type Step. The data type is USINT.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 2106 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd20

When "Camera_User".Step_Num is set to 14 and "Camera_User".Set_Index is at the rising edge, this example sets the Current Index value to 3 for the Step whose Step ID is 5 in the Mech-Viz project.

Get Planned Path in Mech-Viz

Description

This command obtains the path planned by the Mech-Viz project as a series of waypoints.

Waypoint: Each point that the robot reaches when moving along the planned path. A waypoint has information including the robot pose, label, motion type, and velocity. Waypoints can be divided into two categories:

  • Vision Move waypoint: Waypoint corresponding to the Vision Move Step.

  • Non-Vision Move waypoints, which refer to the waypoints corresponding to move-type Steps other than the Vision Move Step.

Calling Sequence

This command should be called after Run Mech-Viz Project.

Modules

cmd21

Input Parameters

Request_Pose_Type

This parameter specifies the type of waypoint poses to be obtained. The data type is USINT. Valid values: 1 and 2.

  • 1: Joint positions.

  • 2: TCP.

Get_VizData

This parameter triggers the path planned by Mech-Viz to be obtained at the rising edge. The data type is BOOL.

Data_Ready

This parameter specifies whether the planned path is readable. This parameter is used to receive multiple waypoints. The data type is BOOL. 1 indicates readable. 0 indicates unreadable.

Send_Pose_Num

This parameter indicates the number of waypoints returned by Mech-Viz. The data type is USINT. Valid values: 0 to the largest positive integer.

Target_Pose

This parameter indicates the pose of each waypoint in the obtained planned path. The data type is ARRAY[0..5] OF DINT.

Target_Label

This parameter indicates the label of each waypoint in the obtained planned path. Labels and poses are one-to-one paired. The data type is DINT.

Target_Tool_ID

This parameter indicates the tool ID of each waypoint in the obtained planned path. The tool IDs and poses are one-to-one paired. The data type is DINT.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Get_VizData in the previous scan cycle. The data type is BOOL. 1 indicates that Get_VizData was high in the previous scan cycle, while 0 indicates that Get_VizData was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Get_VizData. The data type is BOOL. 1 indicates that a rising edge occurred on Get_VizData, while 0 indicates that no rising edge occurred on Get_VizData.

Output Parameters

Request_Pose_Type_O

This parameter indicates the pose type of waypoints. The data type is USINT. 1 indicates joint positions, 2 indicates TCP.

Target_Pose_O

This parameter indicates the poses of all waypoints in the obtained planned path. The pose type can be either TCP or joint positions, depending on the value of the Request_Pose_Type parameter. The data type is ARRAY[0..19,0..5] OF DINT.

You must divide the elements of the Target_Pose_O array by 10,000 to obtain the pose data.

Target_Label_O

This parameter indicates the labels of all waypoints in the obtained planned path. Labels and poses are one-to-one paired. The data type is ARRAY[0..19] OF DINT.

Target_Tool_ID_O

This parameter indicates the tool IDs of all waypoints in the obtained planned path. The tool IDs and poses are one-to-one paired. The data type is ARRAY[0..19] OF DINT.

DataACK

This parameter confirms whether the data returned by Mech-Viz is read and cached. The data type is BOOL.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 2100 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

By default, after the robot sends this command, the vision system returns the result in 10 seconds. If the vision system fails to return any result in 10 seconds, a timeout error code is returned. To modify the default timeout period as needed, go to Robot and Communication > Robot Communication Configuration  Next  Advanced Settings in the toolbar of Mech-Vision.

set viz time

"CameraIO".MM.FromCamera.SEND_POSE_TYPE

This parameter represents the pose type of the waypoints, and its value is the same as the input value of the Request_Pose_Type parameter. The data type is USINT. 1 indicates joint positions, 2 indicates TCP.

"CameraIO".MM.FromCamera.VISUAL_POINT_INDEX

The sequence number of the Vision Move waypoint (i.e., the waypoint corresponding to the Vision Move Step in the Mech-Viz project) in the path. The data type is USINT. If the waypoint does not exist in the path, the petameter value is 0.

If the planned path consists of the following waypoints in sequence: Fixed-Point Move_1, Fixed-Point Move_2, Vision Move, and Fixed-Point Move_3, the sequence number of the Vision Move waypoint is 3.

Example

cmd22

When "Camera_User".Step_Num is set to 18 and "Camera_User".Get_VizData is at the rising edge, this example obtains the planned path from the Mech-Viz project. The waypoints are represented in TCP.

Input Object Dimensions to Mech-Vision Project

Description

This command dynamically inputs object dimensions into the Mech-Vision project. The object dimensions are the values of the Box Size Settings parameters in the Read Object Dimensions Step.

When you use this command, only one Read Object Dimensions Step is allowed in the Mech-Vision project. Otherwise, the vision system will return an error.
read object dimensions

Calling Sequence

This command should be called before Run Mech-Vision Project.

Modules

cmd23

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is USINT. You can view the project ID of a Mech-Vision project in the Project List section of Mech-Vision. The project ID is the number before the project name.

External_Input_Box_Dimension

This parameter inputs the length, width, and height of the object to the Mech-Vision project. The length, width, and height are measured in millimeters (mm). These values are read by the Read Object Dimensions Step and set for the parameters Length on X-axis, Length on Y-axis and Length on Z-axis. The data type is ARRAY[0..9] OF DINT.

The object dimensions must first be multiplied by 10,000 and converted into a 32-bit signed integer before being stored in the External_Input_Box_Dimension[0-2] array.

Set_Box_Dimension

This parameter triggers the object dimensions to be input to the Mech-Vision project at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Set_Box_Dimension in the previous scan cycle. The data type is BOOL. 1 indicates that Set_Box_Dimension was high in the previous scan cycle, while 0 indicates that Set_Box_Dimension was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Set_Box_Dimension. The data type is BOOL. 1 indicates that a rising edge occurred on Set_Box_Dimension, while 0 indicates that no rising edge occurred on Set_Box_Dimension.

Output Parameters

Vision_Proj_Num_O

This parameter indicates the Mech-Vision project ID. The data type is USINT.

External_Input_Box_Dimension_O

This parameter indicates the object dimensions input to the Mech-Vision project. The data type is ARRAY[0..9] OF DINT.

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 1108 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd24

The above example means setting "Camera_User".Step_Num to 1. When a rising edge occurs on "Camera_User".Set_Box_Dimension, the object dimensions in the Read Object Dimensions Step of the Mech-Vision project will be set to the values of the External_Input_Box_Dimension[0-2] parameters.

Get Message from Notify Step

Description

When the Mech-Vision project or Mech-Viz project is executing the Notify Step, the vision system returns the message predefined in the Notify Step.

When the Notify Step is executed in the Mech-Vision or Mech-Viz project, the message remains in the buffer of the vision system for only three seconds. Therefore, you should consider the timing of calling this command to ensure successful message retrieval. Additionally, after the PLC receives the message, the program should trigger the variable “CameraIO”.MM.ToCamera.CLEAR_NOTIFY to clear the register data.

Before sending this command, complete the following settings for the Notify Step:

  • For a Notify Step in the Mech-Vision project:

    1. Connect the Notify Step to the right side of another Step. The Output Step is used in the example in the image below.

      notify 1
    2. Select Trigger Control Flow Given Output in the parameter panel of the Output Step.

      notify 5
    3. In the parameter panel of the Notify Step, enter Standard Interface Notify (the value cannot be modified) for Service Name. Enter a positive integer for Message, for example, 1001.

      notify 2
  • For a Notify Step in the Mech-Viz project:

    1. Connect the Notify Step to a proper Step in the workflow.

      notify 3
    2. In the parameter panel of the Notify Step, select Standard Interface. Enter a positive integer for Message, for example, 1000.

      notify 4

Calling Sequence

This command should be called after Run Mech-Vision Project or Run Mech-Viz Project.

Modules

cmd25

Input Parameters

Get_Notify

This parameter triggers the message of the Notify Step to be obtained at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Get_Notify in the previous scan cycle. The data type is BOOL. 1 indicates that Get_Notify was high in the previous scan cycle, while 0 indicates that Get_Notify was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Get_Notify. The data type is BOOL. 1 indicates that a rising edge occurred on Get_Notify, while 0 indicates that no rising edge occurred on Get_Notify.

Output Parameters

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.Notify_MSG

This parameter stores the message from the Notify Step. Only positive integer messages are supported at the moment. The data type is DINT.

Example

For example, the message set in the “Notify” Step is 777, and the PLC is obtaining a message in the automatic mode.

cmd26

In the above example, when "Camera_User".Step_Num is set to 3 in the automatic mode, the value of "CameraIO".MM.FromCamera.Notify_MSG is not 777. After MM_Get_Custom_Notify is enabled, when the "Camera_User".Get_Notify variable is at the rising edge, the program retrieves the message from the Notify Step. If the message retrieval was successful, the value of "CameraIO".MM.FromCamera.Notify_MSG changes to 777. Otherwise, if the value remains unchanged, the PLC will prompt an error after 3 seconds.

Get Project Status

Description

This command checks if the Mech-Vision project is ready.

Modules

cmd27

Input Parameters

Get_Status

This parameter checks if the Mech-Vision project is ready at the rising edge. The data type is BOOL.

Trigger_Acknowledge

This parameter indicates whether the Command_Trigger signal has successfully triggered the vision system to run. The data type is BOOL. 1 indicates a successful trigger, while 0 means the Command_Trigger signal was not received.

Input/Output Parameters

Set_Edge

This parameter represents the state of Get_Status in the previous scan cycle. The data type is BOOL. 1 indicates that Get_Status was high in the previous scan cycle, while 0 indicates that Get_Status was low in the previous scan cycle.

Set_Flag

This parameter specifies whether a rising edge occurred on Get_Status. The data type is BOOL. 1 indicates that a rising edge occurred on Get_Status, while 0 indicates that no rising edge occurred on Get_Status.

Output Parameters

Command

This parameter indicates the command code that will be automatically assigned. The data type is DINT.

Command_Trigger

This parameter indicates the command switch that will be automatically triggered. The data type is BOOL.

Return Data of the Global Variable "CameraIO".MM.FromCamera

"CameraIO".MM.FromCamera.STATUS_CODE

This parameter indicates the name of the variable for storing the command execution status code. The data type is DINT. Status code 1101 is returned for a successful command execution. If a command fails to be run, a specific error code is returned. For details, see Status Codes and Troubleshooting.

Example

cmd28

The above example means setting "Camera_User".Step_Num to 22. When a rising edge occurs on "Camera_User".Get_Status, this example checks whether the Mech-Vision project is ready.

Clear Target Data

Description

This command clears the obtained poses, labels, and tool IDs.

Modules

cmd29

Input Parameters

Start_Empty

This parameter triggers the obtained poses, labels, and tool IDs to be cleared. This parameter will take effect when it is set. The data type is BOOL.

Input/Output Parameters

Target_Pose

This parameter indicates the poses of the obtained waypoints or vision points. The data type is Array[0..19, 0..5] OF DINT.

Target_Label

This parameter indicates the labels of the obtained waypoints or vision points. The data type is Array[0..19] OF UDINT.

Target_Tool_ID

This parameter indicates the tool IDs of the obtained waypoints or vision points. The data type is Array[0..19] OF UDINT.

Example

cmd30

The above example means setting "Camera_User".Step_Num to 6. When "Camera_User".Start_Empty is set, the data stored in "Camera_User".Target_Pose, "Camera_User".Target_Label, and "Camera_User".Target_Tool_ID will be cleared.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.