ROKAE Standard Interface Commands

Notes for calling commands:

Since the commands are restricted by ROKAE syntax, the parameters and returned values cannot be passed. Therefore, all parameters and returned values involved in the command are global variables.

The following procedures will be introduced in this section:

Initialize Communication

This procedure is used to set the host IP address, port number, and wait time for TCP/IP communication.

Procedure

IP_Address = "192.168.1.20"
Server_Port = 50000
MM_Timeout = 60
MM_Init_Socket()

This procedure sets the host IP address to 192.168.1.20, the port number to 50000, and wait time to 60 seconds.

Input Parameters

IP_Address

the IP address of the host

Server_Port

TCP/IP port number; the default port number is 50000

MM_Timeout

Wait time in seconds before stopping connection attempt

Start Mech-Vision Project

This procedure is for applications that use Mech-Vision but not Mech-Viz. It runs the corresponding Mech-Vision project to acquire and process data.

If the camera is mounted in the Eye In Hand mode, this procedure sends the image-capturing pose of the robot to the project.

Procedure

Job = 1
Pos_Num_Need = 1
SendPos_Type = 1
MM_J = UpdateJnttarget(MM_J,0,0,0,0,0,0,0,0,0,0,0,0)
MM_Start_Vis()

This procedure triggers Mech-Vision No. 1 project to run; the Mech-Vision No. 1 project is expected to send back 1 vision point; and the robot will send its current joint positions and flange pose to Mech-Vision. UpdateJnttarget(MM_J,0,0,0,0,0,0,0,0,0,0,0,0) sets a set of fixed joint positions, and it will be used when the value of SendPos_Type is 3.

Input Parameters

Job

Mech-Vision project ID, which can be viewed in the Project List panel in Mech-Vision.

Pos_Num_Need

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.

  • Integers greater than 0: Receive a specified number of vision points in the recognition result from Mech-Vision.

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

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

Hint

By default, command 102 can only fetch at most 20 vision points at a time. Therefore, command 102 may need to be repeatedly executed until all the vision points required are obtained.

SendPos_Type

The type of the robot pose to send to Mech-Vision, from 0 to 3.

  • 0: No robot pose need to be sent to Mech-Vision. If the camera is mounted in the Eye To Hand mode, the image capturing process is independent of the robot pose, and therefore the robot pose is not needed.

  • 1: Robot pose in current joint positions together with current flange pose will be sent to Mech-Vision. It is recommended to set this value when the camera is mounted in the Eye In Hand mode. When this parameter is being used, the “Path Planning” Step in the Mech-Vision project will use the joint positions sent by the robot. If the flange pose data are all 0, please ignore the flange pose data.

  • 2: Robot pose in current flange pose will be sent to Mech-Vision. It is recommended to set this value when the camera is mounted in the Eye In Hand mode or other scenarios where only the flange pose data is available (such as truss robots).

  • 3: Robot pose in predefined joint positions set by the user will be sent to Mech-Vision. It is recommended to set this value when the camera is mounted in the Eye To Hand mode. When this parameter is being used, the “Path Planning” Step in the Mech-Vision project will use the joint positions sent by the robot as the initial pose.

MM_J

User-defined joint positions. When the value of SendPos_Type is set to 3, this set of joint positions will be used as the first waypoint in the path planned by the “Path Planning” Step. If the value of SendPos_Type is set to values other than 3, the joint positions set here will not take effect, but it has to be set.

Get Vision Target(s)

This procedure should be used after executing the “Start Mech-Vision Project” procedure. It obtains the vision result, which contains the robot pose (in TCP format) and label, from the corresponding Mech-Vision project.

Mech-Center will automatically convert the vision point information into the corresponding robot TCP. The process includes the following steps:

  • Rotate the poses around their Y 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.

Hint

Command 102 can only fetch at most 20 TCPs at a time. Therefore, command 102 may need to be repeatedly executed until all the TCPs required are obtained.

Procedure

Job = 1
MM_Get_VisData()

This procedure obtains the vision result from Mech-Vision project No. 1. The output values of this command is stored in global variables (Last_Data, Pose_Num, and MM_Status). Whether all vision points have been sent is stored in Last_Data, the number of vision points received is stored in Pose_Num, and the status code is stored in MM_Status.

Input Parameters

Job

Mech-Vision project ID, which can be viewed in the Project List panel in Mech-Vision.

Output Parameters

Last_Data

This parameter indicates whether all required TCPs have been sent, 0 or 1.

  • 0: NOT all required TCPs have been sent (more on the way). Please execute command 102 repeatedly until the value turns to 1.

  • 1: All required TCPs have been sent.

If the expected number of TCPs set in “Start Mech-Vision Project” procedure is greater than 20 (default value length for sending and receiving data), this parameter can be used to determine whether there is any TCP that has not been sent. If not all data have been sent, you can call command 102 repeatedly until all TCPs have been received.

Hint

If not all TCPs have been received, and command 101 is called to re-capture an image at this time, the unreceived TCPs will be cleared.

Variable type: int

Pos_Num

The number of received TCPs.

  • If the required number of TCPs is greater than or equal to the number of vision points recognized by Mech-Vision, the number of recognized vision points will be sent.

  • If the required number of TCPs is less than the number of the recognized vision points, the required number of vision points will be sent.

Default range: 0-20

Variable type: int

MM_Status

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

When calling this procedure, Mech-Center will wait for the result from Mech-Vision and then send it to the robot. The default wait time is 10 seconds. If a timeout occurs, a timeout error code will be returned to the robot.

Variable type: int

Start Mech-Viz Project

This procedure is for applications that use both Mech-Vision and Mech-Viz. It runs the corresponding Mech-Viz project (which triggers the corresponding Mech-Vision project to run), and sets the initial joint positions of the simulated robot in Mech-Viz.

Please right-click the Mech-Viz project to be started in Resources panel and select Autoload Project in the context menu.

There are some template projects of typical applications stored in Mech-Center/tool/viz_project/suction_zone in the installation directory of Mech-Mind Software Suite. You can modify the template projects according to actual requirements for real applications.

Please refer to Example Mech-Viz Projects for Standard Interface for the description of example Mech-Viz projects for Standard Interface.

Procedure

SendPos_Type = 1
MM_J = CJointT()
MM_Start_Viz()

This procedure triggers Mech-Viz project to run and send the current joint positions and flange pose of the robot to Mech-Viz.

Input Parameters

SendPos_Type

The type of the robot pose to send to Mech-Viz, from 0 to 2.

0: No robot pose need to be sent to Mech-Viz. The simulated robot in Mech-Viz will start from joint positions [0,0,0,0,0,0] and move to the first waypoint.

1: Send the current joint positions and flange pose of the real robot to Mech-Viz. The simulated robot in Mech-Viz will start from the current joint positions of the real robot and move to the first waypoint.

2: Send the predefined joint positions of the robot to Mech-Viz. The simulated robot in Mech-Viz will start from the predefined joint positions and move to the first waypoint.

MM_J

User-defined joint positions. When the value of SendPos_Type is set to 2, this set of joint positions will be used as the first waypoint in the path planned by Mech-Viz. If the value of SendPos_Type is set to values other than 2, the joint positions set here will not take effect, but it has to be set.

Get Planned Path

This procedure obtains the planned path from Mech-Viz. It should be used after executing the “Start Mech-Viz Project” procedure to obtain the planned path.

By default, this command can only fetch at most 20 waypoints at a time. Therefore, it may need to be repeatedly executed until all the waypoints are obtained.

Note

If you do not want to send a waypoint in the move-type Steps of Mech-Viz to the robot, please unselect “Send Waypoint” in Move-Type Step Common Parameters.

Procedure

Jps_Pos = 2
MM_Get_VizData()

This procedure obtains waypoints in the planned path from Mech-Viz in the form of TCPs. Whether all waypoints have been sent is stored in Last_Data, the number of waypoints received is stored in Pos_Num, the position of the Vision Move waypoint in the path is stored in VisPos_Num, and the status code is stored in MM_Status.

Input Parameters

Jps_Pos

This parameter is used to specify the type of waypoints returned by Mech-Viz.

  • 1: Waypoints in joint positions will be returned.

  • 2: Waypoints in TCPs will be returned.

Output Parameters

Last_Data

This parameter indicates whether all waypoints have been sent, 0 or 1.

  • 0: NOT all waypoints have been sent (more on the way). Please execute this command repeatedly until the value turns to 1.

  • 1: All waypoints have been sent.

Pos_Num

Number of waypoints. This parameter indicates the number of returned waypoints ([pose, label, velocity]) in this execution.

If there are more than 20 waypoints in the path, please execute the command multiple times.

Default range: 0-20

VisPos_Num

The position of the first Vision Move waypoint in the path. The Vision Move Step guides the robot to the vision point for picking.

For example, if the workflow is: Fixed-Point Move 1 → Fixed-Point Move 2 → Vision Move → Fixed-Point Move 3, the value of VisPose_Num, i.e., the position of the Vision Move Step, is 3.

If there is no Vision Move Step in the workflow, the parameter value is 0.

MM_Status

Status code.

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

Hint

When calling this procedure, Mech-Center will wait for the result from Mech-Viz and then send it to the robot. The default wait time is 10 seconds. If a timeout occurs, a timeout error code will be returned to the robot.

Obtain Pose

This procedure stores a vision pose returned by Mech-Vision or a waypoint pose returned by Mech-Viz in the specified variable.

Procedure

Serial = 1
MM_Get_Pose()

This procedure stores the first received pose to the position variable MM_P, stores the corresponding label to the global variable MM_Label, and the corresponding velocity to the global variable MM_Speed.

Input Parameters

Serial: This parameter specifies the serial number of the pose to store.

Output Parameters

MM_P

Position variable for storing the specified pose data.

MM_Label

Double variable for storing the label corresponding to the specified pose.

MM_Speed

Double variable for storing the velocity corresponding to the specified pose.

Obtain Joint Positions

This procedure stores a set of joint positions returned by Mech-Viz in the specified variable.

Note

As Mech-Vision does not output joint position data, this procedure can only be used with Mech-Viz.

Procedure

Serial = 1
MM_Get_Jps()

This procedure stores the first set of received joint positions to global position variable MM_J, the corresponding label to global variable MM_Label, and the corresponding velocity to global variable MM_Speed.

Input Parameters

Serial: This parameter specifies the serial number of the pose to store.

Output Parameters

MM_J

Variable for storing the specified joint positions.

MM_Label

Double variable for storing the label corresponding to the specified pose.

MM_Speed

Double variable for storing the velocity corresponding to the specified pose.

Switch Mech-Vision Recipe

This procedure specifies which parameter recipe of the Mech-Vision project to use.

The Step parameter settings in Mech-Vision can be adjusted by switching the parameter recipe.

Attention

This procedure should be used before “Start Mech-Vision Project”.

Procedure

Job = 1
Model_Number = 1
MM_Switch_Model()

This procedure switches the parameter recipe used to No. 1 in Mech-Vision project No. 1.

Input Parameters

Job

Mech-Vision project ID, which can be viewed in the Project List panel in Mech-Vision.

Model_Number

Parameter recipe number.

The ID in an integer of a parameter recipe in the Mech-Vision project, from 1-99. Click Project Assistant ‣ Parameter Recipe to edit the parameter recipe.

Select Mech-Viz Branch

This procedure 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 procedure specifies which exit port such Step(s) should take.

“Start Mech-Viz Project” must be called BEFORE this procedure.

Procedure

Branch_Num = 1
Export_Num = 3
MM_Set_Branch()

This procedure tells Mech-Viz to take exit port 3 for the “Branch by Msg” Step whose Step ID is 1.

Input Parameters

Branch_Num

Step ID of the “Branch by Msg” Step, can be viewed in Mech-Viz

Export_Num

The number of the exit port to take + 1, from 1 to 99.

Hint

To select exit port 0 in Mech-Viz, set the value of this parameter to 1.

Set Move Index

This procedure sets the value for the Current Index parameter of a Mech-Viz Step. These Steps are usually used for consecutive movements, individually specified movement or other operations.

Steps that have this parameter include Move by List, Move by Grid, Custom Pallet Pattern, and Smart Pallet Pattern.

“Start Mech-Viz Project” must be called BEFORE this procedure.

Procedure

Skill_Num = 2
Index_Num = 10
MM_Set_Index()

This procedure sets the Current Index value to 9 for the Step whose Step ID is 2. When the Step is executed, the Current Index value will be added 1 and become 10.

Input Parameters

Skill_Num

ID of the Step that needs to be set the Index parameters. The Step ID can be viewed in Step parameters panel.

The value should be an integer.

Index_Num

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

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

Get Software Status

This procedure is currently capable of checking whether Mech-Vision is ready to run projects. In the future, this procedure can be used for obtaining the execution status of Mech-Vision, Mech-Viz, and Mech-Center.

Procedure

MM_Get_Status()

This example obtains the status code and stores it in the global variable MM_Status.

Output Parameters

MM_Status

Variable for storing status code.

The output status code is used for system self-test. The status code 1101 indicates that Mech-Vision is ready to run projects, while other status codes indicate that the Mech-Vision is NOT ready to run projects.

Input Object Dimensions to Mech-Vision

This procedure inputs object dimensions to the Mech-Vision project dynamically. Please confirm the object dimensions before starting the Mech-Vision project.

The corresponding Mech-Vision project must contain the “Read Object Dimensions” Step, and the Read Sizes from Properties parameter of this step must be selected.

Procedure

Job = 1
Lenght = 500
Width = 300
Height = 200
MM_Set_BoxSize()

This procedure sets the object dimensions in the Read Object Dimensions Step in the Mech-Vision project No. 1 to 500*300*200 mm.

Input Parameters

Job

Mech-Vision project ID, which can be viewed in the Project List panel in Mech-Vision.

Length, Width, Height

Input dimensions (length, width, height) of the object in mm. The dimension values will be read in the Read Object Dimensions Step.

Get DO Signal List

This procedure obtains the planned DO Signal list for controlling multiple sections of a sectioned vacuum gripper.

“Get Planned Path” should be called before this procedure to obtain the path planned by Mech-Viz.

Please deploy the Mech-Viz project based on the template project in xxx\Mech-Mind Software Suite-x.x.x\Mech-Center\tool\viz_project\suction_zone, and set the suction cup configuration file in the Mech-Viz project.

Procedure

MM_Get_DoList()

This procedure stores the status code indicating whether the DO signal is obtained successfully in MM_Status.

Output Parameters

MM_Status

Status code. For more information, please refer to Status Codes and Troubleshooting.

Set DO Signal List

This procedure sets the DO list sent by Mech-Viz to GO signals. It supports 4 groups of 16-bit GO signals in maximum. If you need to set multiple groups of GO signals, please run this procedure for several times.

Attention

MM_Get_DoList must be called BEFORE this procedure.

Procedure

Serial = 1
MM_Set_DoList()

This procedure sets the 0-15 values in the DO list calculated by Mech-Viz to corresponding mm_go16 signal

Serial = 2
MM_Set_DoList()

This procedure sets the 16-32 values in the DO list calculated by Mech-Viz to corresponding mm_go32 signal.

Input Parameters

Serial

Serial number of the signal group, from 1 to 4.

Output Parameters

mm_go16

Name of the signal group for storing the DO signal value to be set.

mm_go32

Name of the signal group for storing the DO signal value to be set.

Calibration

This procedure is used for hand-eye calibration (camera extrinsic parameter calibration).

It automates the calibration process in conjunction with the Camera Calibration function in Mech-Vision, and obtain the calibration points where the robot should reach from Mech-Vision.

This procedure should be executed several times to complete the calibration.

Procedure

Move_Type = 2
Jps_Pos = 1
Wait_Time = 2
IsAxis7 = false
MM_Calib()

This procedure moves the robot in MoveJ type, receives pose data in the form of TCP, and sets the wait time to 2 seconds to avoid the robot from shaking after it moves to the calibration point.

Move_Type = 2
Jps_Pos = 1
Wait_Time = 2
IsAxis7 = true
Axis7 = 0
MM_Calib()

This procedure moves the robot in MoveJ type, receives pose data in the form of TCP, and sets the wait time to 2 seconds to avoid the robot from shaking after it moves to the calibration point. Moreover, the 7th axis value of this robot is 0.

Input Parameters

Move_Type

Motion type. 1: MoveL; 2: MoveJ.

Jps_Pos

Pose as joint positions or TCP. 1: Joint positions, 2: TCP

Wait_Time

The time the robot waits to avoid shaking after it moves to the calibration point; the default value is 2 (s)

IsAxis7

Whether there is an external 7th axis, true or false. The default value is false, i.e., no 7th axis.

Axis7

Optional variable for storing the external axis data. It is only used when there is a 7th axis. The unit is mm.

Get Vision Result from Mech-Vision

This procedure is used for obtaining the vision result that includes custom port outputs from the corresponding Mech-Vision project. “Custom port outputs” refers to data output by ports other than poses and labels of the “Procedure Out” Step in Mech-Vision. The output ports can be customized if the Port Type parameter of the Step is set to “Custom”.

Each time this procedure is called, all data will be obtained and stored in the robot RAM.

Procedure

Job = 2
MM_Get_Dy_Data()

This example obtains the vision result that includes custom port outputs from Mech-Vision project No. 2. The obtained poses and corresponding labels are stored in the global arrays MM_Pose_Pos[128] and MM_Pose_Label[128], and the corresponding custom port outputs are stored in the global array UserData[128][128]. The number of vision points received is stored in the global variable Pos_Num, and the status code is stored in the global variable MM_Status.

Input Parameters

Job

Variable in the integer data type. Mech-Vision project ID, which can be viewed in the Project List panel in Mech-Vision.

Output Parameters

Pos_Num

Variable in the integer data type for storing the number of received vision points.

MM_Status

Variable in the integer data type for storing the status code.

Save Vision Point to Specified Variables

This procedure stores the data in a vision point returned by Mech-Vision in the specified variables. This procedure is called AFTER Get Vision Result from Mech-Vision.

Procedure

Serial = 2
MM_Get_DyPose()

This example stores the pose in the second received vision point to MM_P, the corresponding label to MM_Label, and the corresponding custom port outputs to MM_UserData.

Input Parameters

Serial

Variable in the integer data type. Specify the index of the vision point to be stored. The index of the vision point is determined by the order in which Mech-Vision sends data.

Output Parameters

MM_P

Variable in the robtarget data type for storing the pose in the specified vision point.

MM_Label

Variable in the double data type for storing the label in the specified vision point. If there is not a label port set in Mech-Vision, it will be filled with 0.

MM_UserData

Global array variable in the double data type for storing the custom port outputs in the specified vision point.

Get Waypoint from Mech-Viz

This procedure is used for obtaining the planned path from Mech-Viz. This procedure can obtain all data output by Mech-Viz, including motion type, tool number, custom port outputs from Mech-Vision and depalletizing planning data.

“Custom port output” refers to data output by ports other than poses and labels of the “Procedure Out” Step in Mech-Vision. The output ports can be customized if the Port Type parameter of the Step is set to “Custom”.

Waypoints in a planned path can be divided into two types: those of the “Vision Move” Step and those of other move-type Steps.

  1. All waypoints contain the following data: pose, motion type, tool number and velocity.

  2. The waypoints of the “Vision Move” Step also contain depalletizing planning data.

  3. If custom ports are defined for the “Procedure Out” Step in Mech-Vision, then the waypoints of the “Vision Move” Step also contain custom port outputs.

Procedure

Jps_Pos = 4
MM_Get_PlanData()

This example obtains the planned path from Mech-Viz and stores all the output data to the global array of the robot. The position of the Vision Move waypoint is stored in VisPos_Num, and the status code is stored in MM_Status.

Input Parameters

Jps_Pos

Expected format of the returned data in the integer data type, from 1-4.

See the following table for explanations.

Jps_Pos value

Format of returned data (Explained below)

1

Pose (joint positions), motion type, tool number, velocity, number of custom ports, custom port output, custom port output, … custom port output

2

Pose (TCP), motion type, tool number, velocity, number of custom ports, custom port output, custom port output, … custom port output

3

Pose (joint positions), motion type, tool number, velocity, depalletizing planning data, number of custom ports, custom port output, custom port output, … custom port output

4

Pose (TCP), motion type, tool number, velocity, depalletizing planning data, number of custom ports, custom port output, custom port output, … custom port output

Pose (Stored in MM_Pose_Pos[128])

The pose of the waypoint, as joint positions (in degree) or TCP, which is composed of Cartesian coordinates (XYZ in mm) and Euler angles (ABC in degree).

Motion type (Stored in MM_Pose_MoveType[128])

  • 1: MOVEJ, joint motion

  • 2: MOVEL, linear motion

Tool number (Stored in MM_Pose_ToolNum[128])

The index number of the tool to be used at this waypoint. -1 means no tool is used.

Velocity (Stored in MM_Pose_Speed[128])

Velocity percentage of the waypoint, equals to the velocity setting in the corresponding move-type Step × the global velocity setting in Mech-Viz.

Depalletizing planning data (Stored in Plan_Results[128][128])

Data used in planning multi-pick depalletizing tasks. These data are part of the waypoint of the “Vision Move” Step. The following data are included:

  • Label: composed of 10 integers, if fewer than 10 labels are obtained, the rest of the digits are filled with 0.

  • Number of picked workobjects

  • Number of workobjects to be picked this time

  • Edge-corner ID of vacuum gripper: can be checked by double-clicking the corresponding tool in Resources in Mech-Viz and then selecting Configure control logic.

  • TCP offset: The offset between the tool pose at the center of the to-pick workobjects and the actual tool pose.

  • Workobject orientation: whether the X-axis of the workobject reference frame is aligned with the X-axis of the tool reference frame (value: 0 or 1).

  • Dimensions of the workobjects combined

Number of custom ports (Stored in UserDataNum)

The number of output keys excluding poses and labels when the Port Type parameter of the “Procedure Out” Step in the Mech-Vision project is set to “Custom”.

Custom port outputs (Stored in UserData[128][128])

The outputs excluding poses and labels when the Port Type parameter of the “Procedure Out” Step in the Mech-Vision project is set to “Custom”. These data are part of the waypoint of the “Vision Move” Step.

The custom port outputs are arranged in alphabetical order of the custom port names.

Output Parameters

Pos_Num

Variable in the integer data type for storing the number of received waypoints.

VisPos_Num

Variable in the integer data type for storing the position of the first Vision Move waypoint in the path. For example, if the workflow is: Fixed-Point Move 1 → Fixed-Point Move 2 → Vision Move → Fixed-Point Move 3, the value of VisPose_Num, i.e., the position of the Vision Move Step, is 3. If there is no Vision Move Step in the workflow, the parameter value is 0.

MM_Status

Variable in the integer data type for storing the status code.

Save Waypoint to Specified Variables

This procedure should be called after Get Waypoint from Mech-Viz. It stores the corresponding set of data to different variables. The code will be slightly different according to the value of Jps_Pos.

Procedure

Serial = 2
Jps_Pos = 4
MM_Get_PlanPose()

This example procedure stores the TCP in the second received waypoint to MM_P, the corresponding motion type to MM_MoveType, the corresponding tool number to MM_ToolNum, the corresponding velocity to MM_Speed. If the waypoint is not a Vision Move waypoint, there is no further information; if it is a Vision Move waypoint, the corresponding custom port outputs will be stored to MM_UserData, and the corresponding depalletizing planning data will be stored to MM_Plan_Results.

Serial = 1
Jps_Pos = 3
MM_Get_PlanJps()

This example procedure stores the joint position in the first received waypoint to MM_J, the corresponding motion type to MM_MoveType, the corresponding tool number to MM_ToolNum, the corresponding velocity to MM_Speed. If the waypoint is not a Vision Move waypoint, there is no further information; if it is a Vision Move waypoint, the corresponding custom port outputs will be stored to MM_UserData, and the corresponding depalletizing planning data will be stored to MM_Plan_Results.

Input Parameters

Serial

Variable in the integer data type. Specify the index of the waypoint to be stored. The index of the waypoint is determined by the order in which Mech-Viz sends data.

Jps_Pos

Variable in the integer data type, which should have the same value as that of Jps_Pos in MM_Get_PlanData().

Output Parameters

MM_P

Global variable in the robtarget data type for storing the TCP in the specified waypoint.

MM_J

Global variable in the Jointtarget data type for storing the joint positions in the specified waypoint.

MM_MoveType

Global variable in the integer data type for storing the motion type in the specified waypoint.

MM_ToolNum

Global variable in the integer data type for storing the tool number in the specified waypoint. -1 means no tool is used.

MM_Speed

Global variable in the integer data type for storing the velocity in the specified waypoint.

MM_UserData

Predefined global variable for storing the custom port outputs in the specified waypoint.

MM_Plan_Results

Predefined global variable for storing the depalletizing planning data in the specified waypoint.

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

This procedure is for applications that use Mech-Vision but not Mech-Viz. It obtains the collision-free path planned by the “Path Planning” Step from the corresponding Mech-Vision project.

The Port Type parameter of the “Procedure Out” Step in the Mech-Vision project must be set to “Predefined (robot path)”.

Procedure

Job = 2
Jps_Pos = 2
MM_Get_VisPath()

This example obtains the planned path from Mech-Vision project No. 2 in the form of TCPs. The number of waypoints received is stored in Pos_Num, the position of the Vision Point in the path is stored in VisPos_Num, and the status code is stored in MM_Status.

Input Parameters

Job

Global variable in the integer data type. Mech-Vision project ID, which can be viewed in the Project List panel in Mech-Vision.

Jps_Pos

Global variable in the integer data type. This parameter is used to specify the type of waypoints returned by the “Path Planning” Step.

  • 1: Waypoints in joint positions will be returned.

  • 2: Waypoints in TCPs will be returned.

Output Parameters

Last_Data

Global variable in the integer data type. This parameter indicates whether all waypoints have been sent, 0 or 1.

  • 0: NOT all waypoints have been sent (more on the way). Please execute this command repeatedly until the value turns to 1.

  • 1: All waypoints have been sent.

Pos_Num

Global variable in the integer data type for storing the number of received waypoints.

VisPos_Num

Variable in the integer data type for storing the position of the Vision Point in the path. For example, if the workflow is: Fixed Waypoint 1 → Fixed Waypoint 2 → Vision Point → Fixed Waypoint 3, the value of VisPose_Num, i.e., the position of the Vision Point, is 3. If there is no Vision Point in the workflow, the parameter value is 0.

MM_Status

Global variable in the integer data type for storing status code.