YASKAWA Standard Interface Jobs
When writing your own program, pay attention to the following:
-
Multiple parameters should be separated by semi-colons.
-
The input and output parameters in a job are string constants by default. The value of the output parameter corresponds to a global variable in the background.
|
The following is the instruction in standard interface jobs.
Initialize Communication
Start Mech-Vision Project
This job is used for applications that use Mech-Vision. It runs the corresponding project to acquire and process data. It applies for applications that use Mech-Vision but not Mech-Viz.
Parameters
Name | Description |
---|---|
Input parameters |
|
job |
Mech-Vision project ID, which can be viewed before the project name in the Project List panel in Mech-Vision. |
pos_num_need |
The expected number of vision points for Mech-Vision to send. The value range is 0 to 20, in which 0 indicates that all vision points will be received. |
sendpos_type |
The type of the robot pose to send to Mech-Vision. Value range: 0 to 3.
|
prNum |
P variable for storing the joint positions of the start point when sendpos_type=3. The data type of the P variable should be set to PULSE, otherwise the error message “MM:PVAR_SET_ERROR” will be raised. |
Obtain Vision Targets
This job is for applications that use Mech-Vision but not Mech-Viz. It obtains the vision result from the corresponding Mech-Vision project.
Parameters
Name | Description |
---|---|
Input parameters |
|
Job |
Mech-Vision project ID, which can be viewed before the project name in the Project List panel in Mech-Vision. |
Output parameters |
|
Pose_Num |
I variable for storing the number of received poses. |
MM_Status |
I variable for storing status code. Please see Mech-Mind Status Codes and Troubleshooting. |
Start Mech-Viz Project
This job is for applications that use both Mech-Vision and Mech-Viz. It runs the 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.
Parameters
Name | Description |
---|---|
Input parameters |
|
sendpos_type |
Robot pose type. Value range: 0 to 2.
|
prNum |
P variable for storing the joint positions of the start point when SendPos_Type = 2. The data type of the P variable should be set to PULSE, otherwise the error message “MM:PVAR_SET_ERROR” will be raised. |
Get Planned Path from Mech-Viz
This job obtains the path planned by a Mech-Viz project.
Parameters
Name | Description |
---|---|
Input parameters |
|
GetPos_Type |
Pose type of the waypoints to be obtained.
|
Output parameters |
|
Pose_Num |
I variable for storing the number of received poses. |
VisPos_Num |
I variable for storing the position of the first Vision Move waypoint in the entire path. For example, in the workflow “Fixed-Point Move 1, Fixed-Point Move 2, Vision Move 1, Fixed-Point Move 3”, the position of the first Vision Move waypoint is 3. If the path does not contain Vision Move waypoint, the returned value is 0. |
MM_Status |
I variable for storing status code. Please see Status Codes and Troubleshooting for detailed information. |
Obtain Vision Point Pose
This job stores a vision pose returned by Mech-Vision or a waypoint pose returned by Mech-Viz in the specified variable.
Parameters
Name | Description |
---|---|
Input parameters |
|
Index |
Specify the index of the pose to be stored. |
Output parameters |
|
Robtarget |
P variable for storing the specified pose. |
Label |
I variable for storing the label corresponding to the specified set of joint positions. |
Pose_Speed |
I variable for storing the velocity corresponding to the specified set of joint positions. |
Obtain Joint Positions (Available when Mech-Viz is used)
This job stores the joint positions of a waypoint on the planned path returned by Mech-Viz in the specified variable.
Parameters
Name | Description |
---|---|
Input parameters |
|
Index |
Specify the index of the pose to be stored. |
Output parameters |
|
Jointtarget |
P variable for storing the specified set of joint positions. |
Label |
I variable for storing the label corresponding to the specified set of joint positions. |
Pose_Speed |
I variable for storing the velocity corresponding to the specified set of joint positions. |
Switch Mech-Vision Recipe
This job specifies which parameter recipe of the Mech-Vision project to use. This job must be called BEFORE MM_START_VIS.
Select Mech-Viz Branch
This job selects along which branch the Mech-Viz project should proceed. Such branching is achieved by adding Branch by Msg Step(s) to the project. This job specifies which exit port such Step(s) should take. MM_START_VIZ should be called BEFORE this job. When executing the “Branch by Msg” Step, Mech-Viz waits for the exit port No. sent by Command 203.
Parameters
Name | Description |
---|---|
Input parameters |
|
Branch_Num |
Step ID of the “Branch by Msg” Step. Its value is an integer. The Step ID is displayed in the parameters panel of the Step. |
Exit_Num |
The number of the exit port to take plus 1. For example, to select exit port 0 in Mech-Viz, set the value of this parameter to 1. The value range is 1 to 99. This parameter value should be 1 plus the exit port number displayed in the Step. For example, to select exit port 0, you should set the value of this parameter to 1. |
Set Move Index
This job sets the value for the Current Index parameter of a mote-type Step. Move-type Steps include Move by List, Move by Grid, Custom Pallet Pattern, and Predefined Pallet Pattern. mm_start_viz must be called BEFORE this job.
Parameters
Name | Description |
---|---|
Input parameters |
|
Skill_Num |
ID of the Step, an integer. The Step ID is displayed in the parameters panel of the Step. |
Index_Num |
The index value that should be set the next time this Step is executed. When this job 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 job, the Current Index value in Mech-Viz will be increased by 1 to become the parameter’s value. |
Get Software Status
This job is currently capable of checking whether Mech-Vision ready to run projects. In the future, this job can be used for obtaining the execution status of Mech-Vision, Mech-Viz, and Mech-Center.
Parameters
Name | Description |
---|---|
Output parameters |
|
Status |
I variable for storing status code. Please see Status Codes and Troubleshooting for detailed information. |
Input Object Dimensions to Mech-Vision
This job inputs object dimensions to the Mech-Vision project. This job must be called BEFORE MM_START_VIS.
Get Gripper DO List
This job obtains the gripper DO list planned by Mech-Vision or Mech-Viz. To apply the DO signals to the gripper, call the MM_SET_DOLIST job.
Set Gripper DO List
This job writes the DO signal values on the list returned by Mech-Vision or Mech-Viz to the general-purpose output signals.
MM_GET_DOLIST must be called BEFORE this job. |
Calibration
This job is used for hand-eye calibration (camera extrinsic parameter calibration). This job can be used in the MM_Calibration() program. It automates the calibration process in conjunction with Camera Calibration in Mech-Vision. For detailed instructions, see YASKAWA Calibration Program.
Parameters
Name | Description |
---|---|
Input parameters |
|
Move_Type |
Motion type, 1 or 2. 1: MOVL. 2: MOVJ. |
Pos_Jps |
Pose as flange pose or joint positions, 1 or 2. 1: flange pose. 2: Joint positions. |
Wait_Time |
The time the robot waits to avoid shaking after it moves to the calibration point; the default value is 2 (s). |
Rnum |
Number of robot axes. |
Ext |
Data of the external 7th axis in mm, optional. |
Pos |
Start point for the calibration. The value is P99 by default. |
Example
CALL JOB:MM_CALIB("2;1;2;6;0;99")
This example moves the robot in the MOVJ mothed based on TCPs, and sets the wait time to 2 seconds to avoid the robot from shaking after it moves to the calibration point. This robot has 6 axes and does not have an external axis installed. The start point for the calibration is stored in P99.
Get Custom Output Data from Mech-Vision
This job 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. The output ports can be customized if the Port Type parameter of the Step is set to “Custom”.
Calling this job once will store all the obtained data to the robot.
Save Custom Output data to Specified Variables
This job stores the custom output data returned by Mech-Vision in the specified variables. This job is called AFTER MM_GET_DYDATA.
Parameters
Name | Description |
---|---|
Input parameters |
|
serial |
Specify the index of the vision point to be stored. |
Output parameters |
|
prNum |
P variable for storing the pose in the specified vision point. |
regLabel |
I variable for storing the label in the specified vision point. |
rrNum |
The first R variable for storing the custom port outputs in the specified vision point. Data are stored in R variables consecutive to the input one. Reserve enough R variables. |
Get Vision Move Data or Custom Output Data
This function obtains Vision Move output from the Mech-Vision project, or the Vision Move output or custom output from the Mech-Viz project.MM_GET_PLANPOSE assigns the obtained data to variables.
Parameters
Name | Description |
---|---|
Input parameters |
|
Resource |
This parameter specifies the source of the Vision Move data.
|
jpsPos |
This parameter specifies the returned data format. Details are provided below. |
Output parameters |
|
regPosNum |
I variable for storing the number of received waypoints. |
visPosNum |
I variable for storing the position of the first Vision Move waypoint in the entire path. |
regStatus |
I variable for storing status code. |
-
When the value of Resource is 0, the valid value range of jpsPos is 1 to 4. Details are provided below.
Value of jpsPos Format of returned data (Explained below) 1
Pose (joint positions), motion type, tool ID, velocity, element 1 in custom output data, … element N in custom output data
2
Pose (TCP), motion type, tool ID, velocity, element 1 in custom output data, … element N in custom output data
3
Pose (joint positions), motion type, tool ID, velocity, Mech-Viz Vision Move data, element 1 in custom output data, … element N in custom output data
4
Pose (TCP), motion type, tool ID, velocity, Mech-Viz Vision Move data, element 1 in custom output data, … element N in custom output data
-
When the value of Resource is a positive integer, the valid value range of jpsPos is 1 to 2. Details are provided below.
Value of jpsPos Format of returned data (Explained below) 1
Pose (joint positions), motion type, tool ID, velocity, Mech-Vision Vision Move data
2
Pose (TCP), motion type, tool ID, velocity, Mech-Vision Vision Move data
Pose
The pose of the waypoint can be in the form of joint positions (in degree) or TCP, which is composed of Cartesian coordinates (XYZ in mm) and Euler angles (ABC in degree).
Motion type
-
1: Joint motion (MOVEJ)
-
2: Linear motion (MOVEL)
Tool ID
The ID of the tool to be used at this waypoint. The value “-1” means that no tool will be used at this waypoint.
Velocity
The velocity at this waypoint.
Vision Move data
Vision Move data: Refers to data output by the “Vision Move” Step in Mech-Vision or Mech-Viz, including labels of picked workobjects, number of picked workobjects, number of workobjects to be picked this time, edge/corner ID of vacuum gripper, TCP offset, orientation of workobject group, orientation of workobject, dimensions of workobject group.
Element in custom output data
“Custom output data” refers to the data output by ports other than poses and labels of the “Procedure Out” Step in the Mech-Vision project. The output ports can be customized if the “Port Type” parameter of the Step is set to “Custom”. The custom port outputs are arranged in alphabetical order of the custom port names.
Save Waypoint to Specified Variables
This job is called AFTER Get Vision Move Data or Custom Output Data to store the obtained data in variables.
Parameters
Name | Description |
---|---|
Input parameters |
|
serial |
Specify the index of the waypoint to be stored. |
Output parameters |
|
prNum |
P variable for storing the poses in the specified waypoint.
|
brNum |
The first B variable for storing the motion type, tool ID and velocity in the specified waypoint. Make sure the next two B variables are free for storing the above data. |
rrNum |
The first R variable for storing the Vision Move data and custom port outputs in the specified waypoint. Skip this parameter for non-Vision Move waypoints. Data are stored in R variables consecutive to the input one. Reserve enough R variables. The Vision Move data occupies 21 variables. |
Details on Vision Move data are in the table below.
Value | Description | Number of occupied variables |
---|---|---|
Labels of picked workobjects |
Consists of 10 integers. By default, its value is ten 0s. |
10 |
Number of picked workobjects |
The total number of workobjects that have been picked. |
1 |
Number of workobjects to be picked this time |
Number of workobjects to be picked this time |
1 |
Edge/corner ID of vacuum gripper |
The ID of the edge/corner used to pick workobjects this time. |
1 |
TCP offset |
The XYZ offset between the center of the workobject group and the tool center point. |
3 |
Orientation of workobject group |
The relative position between the workobject group and the length of the vacuum gripper. The value is 0 or 1, where 0 stands for parallel and 1 for vertical. |
1 |
Orientation of workobject |
The relative position between the length of a workobject and that of the vacuum gripper. The value is 0 or 1, where 0 stands for parallel and 1 for vertical. |
1 |
Dimensions of workobject group |
The length, width and height of the workobject group to be picked this time. |
3 |
Example
CALL JOB:MM_GET_PLANPOSE("2;60;60;60")
This example stores the TCP in the second received waypoint to P60, and stores the corresponding motion type, tool ID and velocity to B60, B61 and B62. Waypoints that are not vision move points will be neglected. Waypoint that are vision move points will be stored in R60-RN in the data receiving format as the description in MM_GET_PLANDATA.
Get Result of Step “Path Planning” in Mech-Vision
This job 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)”.
Parameters
Name | Description |
---|---|
Input parameters |
|
job |
Mech-Vision project ID, which can be viewed before the project name in the Project List panel in Mech-Vision. |
GetPos_Type |
This parameter specifies the type of waypoint pose returned by the “Path Planning” Step.
|
Output parameters |
|
Pos_Num |
I variable for storing the number of returned waypoints. |
VisPos_Num |
I variable for storing the position of the Vision Move waypoint set in path planning tool in the entire path. For example, if the path is composed of Steps 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 “Vision Move”, the value of this parameter is 0. |
MM_Status |
I variable for storing the status code. |
Read Mech-Viz Step Parameter
This job reads the parameter value of a specific Step in the Mech-Viz project.
Parameters
Name | Description |
---|---|
Input parameters |
|
Read_id |
This parameter corresponds to the Config ID field defined in the property_config file. |
Output parameters |
|
Status |
I Variable for storing the status code. |
Viz_Prop |
I variable for storing the returned parameter value of the specified Step. Only INT is supported by now. |
From the toolbar of Mech-Vision, go to . Click Property Configuration to open the property_config file. |
Before calling this function, users should define a Config ID and its corresponding Step ID and parameter key name in the following format in the property_config file.
read, Config ID, Step ID, parameter key name
read |
Indicates that this line is used to read the parameter value of a Step. |
Config ID |
Specifies a unique ID, which in a positive integer. One Config ID corresponds to only one parameter value of a Step. To read multiple parameter values, you should set different Config IDs. |
Step ID |
The Step ID of the Step whose parameter is to be read. |
Parameter key name |
Specifies the key name of the parameter whose value the robot requires to read. |
|
The property_config file can have multiple read commands. The Config ID in these commands must be different. |
Example
In the line below, “5” is the Config ID; “3” is the Step ID; and “xCount” is the parameter key name. Add this line to the property_config file. Add this line to the property_config file.
read, 5, 3, xCount
When the robot calls the job below, it receives the value of the parameter whose key name is “xCount”.
CALL JOB:MM_GET_PROPERTY("5;10;11")
This example stores the value of the parameter whose key name is xCount of Step 3 in the Mech-Viz project in register I11, and stores the status code in register I10.
Set Mech-Viz Step Parameter
This job sets the parameter value of a specific Step in the Mech-Viz project.
Parameters
Name | Description |
---|---|
Input parameters |
|
Write_id |
This parameter corresponds to the Config ID field defined in the property_config file. |
Output parameters |
|
Status |
I Variable for storing the status code. |
From the toolbar of Mech-Vision, go to . Click Property Configuration to open the property_config file. |
Before sending this command, users should define a Config ID and its corresponding Step ID, parameter key name and parameter value in the following format in the property_config file.
write, Config ID, Step ID, parameter key name, parameter value
write |
Indicates that this line is used to set the parameter value of a Step. |
Config ID |
Specifies an ID, which is a positive integer and can be used repeatedly. |
Step ID |
Specifies the Step whose parameter value the robot requires to read. |
Parameter key name |
Specifies the key name of the parameter whose value the robot requires to set. |
Parameter value |
Specifies the value that the robot sets for the parameter. |
|
Example
In the line below, “1” is the Config ID, and “3” is the Step ID. “xOffset”, “yOffset” and “zOffset” are parameter key names; and “10”, “20” and “30” are their respective values. Add this line to the property_config file.
write, 1, 3, xOffset, 10
write, 1, 3, yOffset, 20
write, 1, 3, zOffset, 30
When the robot calls the job below, Mech-Viz sets the values of the parameters whose key names are “xOffset”, “yOffset” and “zOffset” respectively to “10”, “20” and “30”.
CALL JOB:MM_SET_PROPERTY("1;10")
This example sets the values of the parameters whose key names are “xOffset”, “yOffset” and “zOffset” respectively to “10”, “20” and “30”, and stores the received status code in the register I10.