MC Commands

This topic introduces the commands of the MC Standard Interface.

Command 101: Start Mech-Vision Project

This function starts the Mech-Vision project that executes image capturing and performs vision recognition. This command is for applications that use only Mech-Vision but not Mech-Viz.

Parameters in Sent Command

Parameter Address offset

Command code 101

1

Mech-Vision project ID

4

Expected number of vision points

3

Robot pose type

2

Robot pose

6 to 17 (joint positions) or 18 to 29 (flange pose)

Mech-Vision project ID

The number before the project name in the Project List panel in Mech-Vision. Please ensure that the project has been set to auto-loaded, or else the project ID will not be displayed.

Expected number of vision points

The expected number of vision points for Mech-Vision to send. The vision point contains the vision pose, corresponding point cloud, label, scaling, etc.

  • 0: Receive all vision points in the recognition result from Mech-Vision.

  • Integer greater than 0: The sender expects to receive the specified number of vision points in the recognition result from the Mech-Vision project.

    • If the total number of vision points is less than the parameter value, all vision points in the recognition result will be sent.

    • If the total number of vision points is greater than or equal to the parameter value, the specified number of vision points will be received.

The function is used to obtain the vision points is Command 102. Command 102 can only fetch at most 20 vision points at a time. Therefore, to obtain more than 20 vision points, please repeat the execution of command 102.

Robot pose type and Robot pose

  • Robot pose type specifies the type of pose of the real robot to be input to Mech-Vision. The value range is 0–3.

  • The values of robot pose depend on the value of robot pose type.

The following table explains the relationship between the two parameters.

Value of robot pose type Value of robot pose Description Applicable scenario

0

0, 0, 0, 0, 0, 0

No need to input robot pose to Mech-Vision

Project is in the eye-to-hand mode. If the “Path Planning” Step is used in the Mech-Vision project, the planned path starts at the Home point set in the path planning tool.

1

Current joint positions and flange pose of the robot

Robot joint positions and flange pose must be input to Mech-Vision

Project is in the eye-in-hand mode. Applicable to most robots (excluding truss robots).

2

Current flange pose of the robot

Robot flange pose must be input to Mech-Vision

Project is in the eye-in-hand mode. The robot has no joint positions and only flange pose (such as truss robots).

3

Joint positions of the start point of the planned path

The joint positions of the path start point must be input to Mech-Vision

Project is in the eye-to-hand mode and the Mech-Vision project contains the “Path Planning” Step, whose start point needs to be set from the robot side.

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 1102 will be returned. Otherwise, the corresponding error code will be returned.

Command 102: Get Vision Target(s)

This command is called after Command 101 — Start Mech-Vision Project to obtain the vision points output by Mech-Vision and automatically transform the vision points into vision targets.

The transformation process, in which the poses of vision points are transformed into the robot TCP, is as follows:

  • Rotate the poses around their X axes by 180 degrees.

  • Determine whether the definition of the reference frame used by the robot model involves robot base height, and add a vertical offset accordingly.

This command can only fetch at most 20 vision targets at a time. Therefore, to obtain more than 20 vision targets, please repeat the calling of this command.

Parameters in Sent Command

Parameter Address offset

Command code 102

1

Mech-Vision project ID

4

Mech-Vision project ID

The number before the project name in the Project List panel in Mech-Vision. Please ensure that the project has been set to auto-loaded, or else the project ID will not be displayed.

Parameters in Returned Data

Parameter Address offset

Status code

100

Data transmission status

101

Number of vision targets

102

Reserved field

/

Obtained robot TCPs

104

Obtained labels

584

Status code

If there is no error, status code 1100 will be returned. Otherwise, the corresponding error code will be returned.

After calling this command, if the vision result from Mech-Vision is not returned within 10 seconds, the error code for timeout will be returned.

Data transmission status

This parameter indicates whether the data returned is new and can be read.

1: The returned data is new and can be read.

After the newly returned data is read, reset this parameter to 0.

Number of vision targets

The number of received vision targets.

  • If the requested number of vision targets is greater than or equal to the number of vision points output by Mech-Vision, all vision points output by Mech-Vision will be obtained.

  • If the requested number of vision targets is smaller than the number of vision points output by Mech-Vision, the requested number of vision points will be obtained.

Reserved field

This field is not currently in use. The value is always 0.

Obtained robot TCPs

Each TCP consists of the Cartesian coordinates (XYZ) and Euler angles (ABC).

Obtained labels

The integer labels corresponding to the obtained poses. If the labels in the Mech-Vision project are strings, please map them to integers by using the “Label Mapping” Step before output. If there are no labels in the project, the value of this parameter is 0.

Command 103: Switch Mech-Vision Recipe

This command switches the parameter recipe used by the Mech-Vision project. It should be called before command 101.

Parameters in Sent Command

Parameter Address offset

Command code 103

1

Mech-Vision project ID

4

Parameter recipe ID

5

Mech-Vision project ID

The number before the project name in the Project List panel in Mech-Vision. Please ensure that the project has been set to auto-loaded, or else the project ID will not be displayed.

Parameter recipe ID

The ID of the parameter recipe in the Mech-Vision project. The ID is a positive integer. To view the parameter recipe ID, click Project Assistant  Parameter Recipe.

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 1107 will be returned. Otherwise, the corresponding error code will be returned.

Command 105: Get Result of Step “Path Planning” in Mech-Vision

This command obtains the collision-free picking path planned by the “Path Planning” Step in the Mech-Vision project after command 101 is called.

When using this function, set the Port Type parameter of the “Procedure Out” Step in the Mech-Vision project to “Predefined (robot path)”.

Before calling command 105, please set expected number of vision points of command 101 to 0 to reduce the times of calling command 105. If expected number of vision points of command 101 is set to 1, then every time command 105 is called, only 1 waypoint is returned, and command 105 must be called multiple times to obtain all the waypoints.

Parameters in Sent Command

Parameter Address offset

Command code 105

1

Mech-Vision project ID

4

Waypoint pose type

2

Mech-Vision project ID

The number before the project name in the Project List panel in Mech-Vision. Please ensure that the project has been set to auto-loaded, or else the project ID will not be displayed.

Waypoint pose type

This parameter specifies the type of waypoint poses returned by the “Path Planning” Step.

  • 1: Waypoints in joint positions will be returned.

  • 2: The waypoint poses are returned in the form of TCP.

Parameters in Returned Data

Parameter Address offset

Status code

100

Data transmission status

101

Number of waypoints

102

Position of “Vision Move” in the planned path

103

All waypoint poses returned

104

All waypoint labels returned

584

Velocities of all waypoints returned

624

Status code

If there is no error, status code 1103 will be returned. Otherwise, the corresponding error code will be returned.

Data transmission status

This parameter indicates whether the data returned is new and can be read.

1: The returned data is new and can be read.

After the newly returned data is read, reset this parameter to 0.

Number of waypoints

The number of waypoints returned. The value range is 0 to 20. If the planned path contains more than 20 waypoints, please repeat the calling this command.

Position of “Vision Move”

The position of the “Vision Move” waypoint in the entire planned path in the Path Planning tool.

For example, if the planned path consists of waypoints “Fixed-Point Move_1”, “Fixed-Point Move_2”, “Vision Move”, and “Fixed-Point Move_3” sequentially, the position of “Vision Move” is 3.

If the path does not contain any “Vision Move”, the value of this parameter is 0.

All waypoint poses returned

The Cartesian coordinates (XYZ in mm) and Euler angles (ABC in degrees), or joint positions (in degrees). The type is determined by the “waypoint pose type” parameter in the sent command.

All waypoint labels returned

The integer labels corresponding to the obtained poses. If the labels in the Mech-Vision project are strings, please use the “Label Mapping” Step before the “Procedure Out” Step to map the labels to integers. If there are no labels in the project, the value of this parameter is 0.

Velocities of all waypoints returned

The velocities set in the Path Planning tool.

Command 201: Start Mech-Viz Project

In scenarios where both Mech-Vision and Mech-Viz are used, this function starts the Mech-Viz project that triggers the corresponding Mech-Vision project, and therefore the Mech-Viz project can plan the robot path based on the vision points received from Mech-Vision.

Parameters in Sent Command

Parameter Address offset

Command code 201

1

Robot pose type

2

Robot pose

6 to 17 (joint positions) or 18 to 29 (flange pose)

Robot pose type and Robot pose

  • Robot pose type specifies the type of pose of the real robot to be input to Mech-Viz. The value range is 0–2.

  • The values of robot pose depend on the value of robot pose type.

The following table explains the relationship between the two parameters.

Value of robot pose type Value of robot pose Description Applicable scenario

0

0, 0, 0, 0, 0, 0

No need to input the robot pose to Mech-Viz. The simulated robot in Mech-Viz moves from the initial pose JPs = [0, 0, 0, 0, 0, 0] to the first waypoint.

Project is in the eye-to-hand mode. This setting is not recommended.

1

Current joint positions and flange pose of the robot

Robot joint positions and flange pose must be input to Mech-Viz. The simulated robot in Mech-Viz moves from the input JPs to the first waypoint.

This setting is recommended for projects in the eye-in-hand mode.

2

Specific joint positions of the robot

The robot joint positions of a point determined by teaching must be input to Mech-Viz. The input joint positions are used to trigger Mech-Viz 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 for projects in the eye-to-hand mode.

The reason for setting robot pose type to 2 when the project is in the eye-to-hand mode:

In the eye-to-hand mode, the camera can perform image capturing for the next round of path planning before the robot returns to the camera capture region and picking region, shortening the cycle time.

If robot pose type is set to 1, the robot’s current pose is sent to Mech-Viz. The simulated robot will move from the input pose to the first waypoint in the planned path, while the real robot might move to another point first, and then move to the first waypoint.

Therefore, the path of the real robot may contain unpredicted collisions, leading to safety hazards.

In conclusion, robot pose type should be set to 2 for projects in the eye-to-hand mode.

Unnamed image

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 2103 will be returned. Otherwise, the corresponding error code will be returned.

Command 202: Stop Mech-Viz Project

This function stops the execution of the Mech-Viz Project. Please use this function only when there is an infinite loop in the Mech-Viz project or the project cannot be stopped properly.

Parameters in Sent Command

Parameter Address offset

Command code 202

1

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 2104 will be returned. Otherwise, the corresponding error code will be returned.

Command 203: Select Mech-Viz Branch

This function is used to select along which branch the Mech-Viz project should proceed. Such branching is achieved by adding Branch by Msg Step(s) to the project. This function specifies which exit port such Step(s) should take. Before you execute this function, run Command 201: Start Mech-Viz Project. Mech-Viz waits for the exit port specified by this function to take for Branch by Msg Step(s).

Parameters in Sent Command

Parameter Address offset

Command code 203

1

Step ID of the “Branch by Msg” Step

30

Exit port number

31

Step ID of the “Branch by Msg” Step

Step ID of the “Branch by Msg” Step. The value is a positive integer.

Exit port number

The number of the exit port to take. The value is a positive integer.

An exit port number is the 1-based index of the specified exit port on the Step. For example, if the specified exit port is the second exit port of the Step from left to right, the exit port number is 2.

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 2105 will be returned. Otherwise, the corresponding error code will be returned.

Command 204: Set Move Index

This function is for setting the index parameter of a Step that involves sequential or separate motions or operations. Steps with index parameters include Move by List, Move by Grid, Custom Pallet Pattern, Smart Pallet Pattern, etc.

Parameters in Sent Command

Parameter Address offset

Command code 204

1

Step ID

32

Index value

33

Step ID

The Step ID of the Step whose Current Index value needs to be set. The Step ID is a positive integer.

Index value

The Current Index value that should be set the next time this Step is executed.

When this procedure is sent, the current index value in Mech-Viz will become the parameter value minus 1.

When the Mech-Viz project runs to the Step specified by this command, the Current Index value in Mech-Viz will be increased by 1 to become the parameter’s value.

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 2106 will be returned. Otherwise, the corresponding error code will be returned.

Command 205: Get Planned Path

This command obtains the planned path from Mech-Viz. It should be used after Command 201: Start Mech-Viz Project is called.

This command can only fetch at most 20 waypoints at a time. Therefore, to obtain more than 20 waypoints, please repeat the calling of this command.

If the waypoint of a move-type Step should not be sent to the robot, please clear the “Send Waypoint” option in the parameters of this Step.

Parameters in Sent Command

Parameter Address offset

Command code 205

1

Waypoint type

2

Waypoint type

This parameter specifies the type of waypoint pose returned by Mech-Viz.

  • 1: The waypoint poses are returned in the form of joint positions (JPs).

  • 2: The waypoint poses are returned in the form of tool center point (TCP).

Parameters in Returned Data

Parameter Address offset

Status code

100

Data transmission status

101

Number of waypoints

102

Position of “Vision Move” in the planned path

103

All waypoint poses returned

104

All waypoint labels returned

584

Velocities of all waypoints returned

624

Status code

If there is no error, status code 2100 will be returned. Otherwise, the corresponding error code will be returned.

After calling this command, if the vision result from Mech-Viz is not returned within 10 seconds, the error code for timeout will be returned.

Data transmission status

This parameter indicates whether the data returned is new and can be read.

1: The returned data is new and can be read.

After the newly returned data is read, reset this parameter to 0.

Number of waypoints

The number of waypoints returned. The value range is 0 to 20. This command can only fetch at most 20 waypoints at a time. Therefore, to obtain more than 20 waypoints, please repeat the calling of this command.

Position of “Vision Move”

The position of the “Vision Move” waypoint in the entire planned path.

For example, if the planned path consists of waypoints “Fixed-Point Move_1”, “Fixed-Point Move_2”, “Vision Move”, and “Fixed-Point Move_3” sequentially, the position of “Vision Move” is 3.

If the path does not contain any “Vision Move”, the value of this parameter is 0.

All waypoint poses returned

The Cartesian coordinates (XYZ in mm) and Euler angles (ABC in degrees), or joint positions (in degrees). The type is determined by the “waypoint pose type” parameter in the sent command.

All waypoint labels returned

The integer labels corresponding to the obtained poses. If the labels in the Mech-Vision project are strings, please use the “Label Mapping” Step before the “Procedure Out” Step to map the labels to integers. If there are no labels in the project, the value of this parameter is 0.

Velocities of all waypoints returned

The non-zero value in front of the percentage sign in the velocity parameter of move-type Steps.

Command 206: Get DO List

This function gets the planned DO signal list. The DO signal list is used to control multiple grippers or multiple suction cup sections. Before calling this command, command 205 needs to be called to obtain the planned motion path.

In the parameters of the “Set DO List” Step:

  • Select “Standard Interface” under “Receiver”.

  • Select “Get DO List from ‘Vision Move’”.

  • In the drop-down list of the “Select ‘Vision Move’” parameter, select a “Vision Move” Step that needs the DO signal list.

Parameters in Sent Command

Parameter Address offset

Command code 206

1

Parameters in Returned Data

Parameter Address offset

Status code

100

DO signal list

664

Status code

If there is no error, status code 2102 will be returned. Otherwise, the corresponding error code will be returned.

DO signal list

This command returns 64 DO port numbers. The valid port numbers are positive integers, in the range of 0–999, while the invalid port numbers are -1 (used as a placeholder).

For example, in the table below, the valid DO port numbers are 1, 3, 5, and 6, which means that the values of the corresponding ports will be set to 1.

1 3 5 6 -1 -1 -1 -1 ... -1 -1

First value

Second value

Third value

Fourth value

Fifth value

Sixth value

Seventh value

Eighth value

...

Sixty-third value

Sixty-fourth value

Command 501: Input Object Dimensions to Mech-Vision

This command is used for dynamically inputting object dimensions into the Mech-Vision project. Please check the actual object dimensions before running the Mech-Vision project.

The Mech-Vision project should contain the Read Object Dimensions Step, and the Step’s parameter Read Sizes from Properties should be selected.

Parameters in Sent Command

Parameter Address offset

Command code 501

1

Mech-Vision project ID

4

Length, width, height

34

Mech-Vision project ID

The number before the project name in the Project List panel in Mech-Vision. Please ensure that the project has been set to auto-loaded, or else the project ID will not be displayed.

Length, width, height

The object dimensions (length, width, height) to be input to the Mech-Vision project. The dimensions will be read into the “Read Object Dimensions” Step.

Unit: mm

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

If there is no error, status code 1108 will be returned. Otherwise, the corresponding error code will be returned.

Command 901: Get Software Status

This command is designed for obtaining the execution status of Mech-Vision, Mech-Viz, and Mech-Center. The function is currently capable of checking whether Mech-Vision is ready to run projects.

Parameters in Sent Command

Parameter Address offset

Command code 901

1

Parameters in Returned Data

Parameter Address offset

Status code

100

Status code

Software status. Status code 1101 indicates that Mech-Vision is ready to run projects. Other status code indicates that Mech-Vision is not ready.

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.