Standard Interface Commands

You are currently viewing the documentation for version 2.0.0. To access documentation for other versions, click the "Switch Version" button located in the upper-right corner of the page.

■ To use the latest version, visit the Mech-Mind Download Center to download it.

■ If you're unsure about the version of the product you are using, please contact Mech-Mind Technical Support for assistance.

This section describes standard interface commands used in EtherNet/IP communications between a AB 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

Before you call the commands, take note of the following items:

  • 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

abcmd1

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is SINT. 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 indicates the number of vision points or waypoints expected to be returned by the Mech-Vision project. The data type is SINT. 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.

Robot_Pose_Type

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

Robot_Pose_JPS

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

Robot_Pose_TCP

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

The following table explains the relationship among the Robot_Pose_Type, Robot_Pose_JPS, and Robot_Pose_TCP parameters.

Robot_Pose_Type Robot_Pose_JPS Robot_Pose_TCP Description Applicable Scenarios

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 of the robot

Current 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

0,0,0,0,0,0

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

User-defined joint positions

0,0,0,0,0,0

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

This 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.

Before assigning to Robot_Pose_JPS and Robot_Pose_TCP, multiply the floating-point numbers that represent joint positions or the robot flange pose by 10000 to convert the data to 32-bit signed integers.

Start_Vision

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

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Vision_Proj_Num_O

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

Req_Pose_Num_O

This parameter indicates the number of vision points or waypoints expected to be returned by the Mech-Vision project. The data type is SINT. 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 SINT. Valid values: 0, 1, 2, and 3.

Robot_Pose_JPS_O

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

Robot_Pose_TCP_O

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.

Returned data of the FromCamera global label

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

abcmd2

When Camera_User.Start_Vis is at the rising edge, the PLC triggers Mech-Vision project No. 1 to run and expects the Mech-Vision project No.1 to send over one vision point or waypoint. At the same time, the PLC sends the current joint positions and flange pose of the robot to Mech-Vision.

Obtain the 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.

If the first input port of the Output Step is Object Center Points, the Output Step will convert the object center points into the corresponding pick points. Therefore, the object poses obtained by running this command are actually poses of pick points, instead of poses of object center points.
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

abcmd3

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is SINT. 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 SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Vision_Proj_Num_O

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

Target_Pose_O

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

Target_Pose_O The TCP is obtained by dividing the elements in the array by 10,000.

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.

Returned data of the FromCamera global label

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

FromCamera.SEND_POSE_TYPE

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

Example

abcmd4

When 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

abcmd5

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is SINT. 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 SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Vision_Proj_Num_O

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

Vision_Recipe_Num_O

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

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.

Returned data of the FromCamera global label

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

abcmd6

When Camera_User.Switch_Recipe is at the rising edge, this example switches the parameter recipe used to No.2 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

abcmd7

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is SINT. 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 SINT. 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 SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Vision_Proj_Num_O

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

Request_Pose_Type_O

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

Target_Pose_O

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

Target_Pose_O The pose is obtained by dividing the elements in the array by 10,000.

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.

Returned data of the FromCamera global label

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

FromCamera.SEND_POSE_TYPE

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

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 SINT. 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

abcmd8

When 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.

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

abcmd9

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 SINT.

Robot_Pose_JPS

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

Robot_Pose_TCP

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

The following table explains the relationship among the Robot_Pose_Type, Robot_Pose_JPS, and Robot_Pose_TCP parameters.

Robot_Pose_Type Robot_Pose_JPS Robot_Pose_TCP Description Applicable scenario

0

0,0,0,0,0,0

0,0,0,0,0,0

The command does not need to send the robot pose to the Mech-Viz project. The simulated robot in Mech-Viz moves from the initial pose (joint positions = [0, 0, 0, 0, 0, 0]) to the first waypoint.

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

1

Current joint positions of the robot

Current 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

0,0,0,0,0,0

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.

Before assigning to Robot_Pose_JPS and Robot_Pose_TCP, multiply the floating-point numbers that represent joint positions or the robot flange pose by 10000 to convert the data to 32-bit signed integers.
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 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.

In conclusion, Robot_Pose_Type should be set to 2 for projects in eye to hand mode.

robot example

Start_Viz

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

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

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 SINT. Valid values: 0, 1, and 2.

Robot_Pose_JPS_O

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

Robot_Pose_TCP_O

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.

Returned data of the FromCamera global label

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

abcmd11

When Camera_User.Start_Viz is at the rising edge, this example runs the corresponding Mech-Viz project and sends the current joint positions and flange pose of the robot to Mech-Viz.

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

abcmd12

Input Parameters

Stop_Viz

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

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

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.

Returned data of the FromCamera global label

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

abcmd13

When 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

abcmd14

Input Parameters

Branch_Name

This parameter specifies the “Branch by Msg” Step by its ID. The data type is SINT. 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 indicate the exit port of the Branch by Msg Step. The data type is SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Branch_Name_O

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

Branch_Exit_Port_O

This parameter indicate the exit port of the Branch by Msg Step. The data type is SINT.

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.

Returned data of the FromCamera global label

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

abcmd15

When 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

abcmd16

Input Parameters

Index_Name

This parameter specifies the Step ID of the Index-type Step. The data type is SINT. 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 SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Index_Name_O

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

Index_Counter_O

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

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.

Returned data of the FromCamera global label

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

abcmd17

When 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

abcmd18

Input Parameters

Request_Pose_Type

This parameter specifies the type of waypoint poses to be obtained. The data type is SINT. 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 SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Request_Pose_Type_O

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

Target_Pose_O

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

Target_Pose_O The pose is obtained by dividing the elements in the array by 10,000.

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.

Returned data of the FromCamera global label

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

FromCamera.SEND_POSE_TYPE

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

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 SINT. 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

abcmd19

When 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 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

abcmd20

Input Parameters

Get_DoList

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

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

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.

Returned data of the FromCamera global label

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.

FromCamera.DO_LIST

This parameter indicates the 64 DO signals returned by this command. The data type is ARRAY[0..3] OF INT. Each INT occupies 16 bits, with each bit using 0 or 1 to represent a DO signal. Therefore, using four INTs can represent 64 DO signals.

Example

abcmd21

When Camera_User.Get_DoList is at the rising edge, the DO signal list returned by Mech-Viz will be stored in FromCamera.DO_LIST.

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.

read object dimensions

Calling Sequence

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

Modules

abcmd22

Input Parameters

Vision_Proj_Num

This parameter specifies the Mech-Vision project ID. The data type is SINT. 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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

Output Parameters

Vision_Proj_Num_O

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

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.

Returned data of the FromCamera global label

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

abcmd23

When Camera_User.Set_Box_Dimension is at the rising edge, this example sets External_Input_Box_Dimension to the object dimensions read by the Read Object Dimensions Step in the Mech-Vision project.

Get Project Status

Description

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

Modules

abcmd26

Input Parameters

Get_Status

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

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

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.

Returned data of the FromCamera global label

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

abcmd27

When Camera_User.Get_VisData is at the rising edge, 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

abcmd28

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 waypoints or vision points. The data type is ARRAY[0..19, 0..5] OF DINT.

Target_Label

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

Target_Tool_ID

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

Example

abcmd29

The above example indicates that when Camera_User.Start_Empty is at the rising edge, the data stored in Target_Pose, Target_Label, and Target_Tool_ID will be cleared.

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 one second. Therefore, users 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 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

abcmd30

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.

Command_Trigger_ACK

This parameter specifies whether the Command_Trigger signal successfully triggered the vision system. The data type is BOOL. 1 indicates that the vision system is successfully triggered, and 0 indicates the Command_Trigger is not received.

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.

Returned data of the FromCamera global label

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.

abcmd31

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

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.