YASKAWA Standard Interface Commands
When writing your own program, pay attention to the following:
-
Multiple parameters should be separated by semi-colons.
-
When calling jobs, the input parameter is a string by default, and the output parameter is a string by default. Each element in the string corresponds to a global variable in the background.
|
The following is the instruction in standard interface commands.
Initialize Communication
This job sets the IP address and port number of the IPC and wait time before the program stops trying to establish the communication.
Start Mech-Vision Project
This job 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
Name | Description |
---|---|
Input parameters |
|
job |
Mech-Vision Project ID, which can be checked and adjusted in the Project List panel of 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. 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, from 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 checked and adjusted in the Project List panel of Mech-Vision. |
Output Parameters |
|
Last_Data |
I variable, indicating whether all vision points have been sent, 0 or 1.
|
Pose_Num |
I variable for storing the number of received vision points. |
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
This job obtains the planned path from Mech-Viz.
Parameters
Name | Description |
---|---|
Input parameters |
|
GetPos_Type |
Whether Mech-Viz should send waypoint poses as joint positions or TCPs, 1 or 2. 1: The pose type returned by Mech-Viz is joint positions. 2: The pose type returned by Mech-Viz is the TCP. |
Output Parameters |
|
Last_Data |
I variable, indicating whether all waypoints have been sent, 0 or 1. 0: NOT all waypoints have been sent (more on the way). If the value is 0, call this JOB again until all are sent. 1: All waypoints have been sent. |
Pose_Num |
I variable for storing the number of received waypoints. |
VisPos_Num |
I variable for storing the position of the first Vision Move waypoint in the 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. |
Example
CALL JOB:MM_GET_VIZDATA("2;50;51;52;53")
This example obtains the planned path from Mech-Viz in the form of TCPs. Whether all waypoints have been sent is stored in I50, the number of waypoints received is stored in I51, the position of the Vision Move waypoint is stored in I52, and the status code is stored in I53.
Obtain 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 pose. |
Pose_Speed |
I variable for storing the velocity corresponding to the specified pose. |
Obtain Joint Positions (Available when Mech-Viz is used)
This job stores a set of joint positions 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 command 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 command specifies which exit port such Step(s) should take. MM_START_VIZ must be called BEFORE this job. When the Mech-Viz project executes to the “Branch by Msg” Step, it will wait for Command 203 to send the exit port of the branch.
Parameters
Name | Description |
---|---|
Input parameters |
|
Branch_Num |
Step ID of the “Branch by Msg” Step, which is an integer. The Step ID can be viewed in the Step Parameters panel. |
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. Value range: 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 Steps. Steps that have this parameter include Move by List, Move by Grid, Custom Pallet Pattern, and smart_pallet_pattern. mm_start_viz must be called BEFORE this job.
Parameters
Name | Description |
---|---|
Input parameters |
|
Skill_Num |
Step ID of the Step, which is an integer. The Step ID can be viewed in the Step Parameters panel. |
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 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 Communication Component.
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 DO Signal List
This job obtains the planned DO Signal list for controlling multiple sections of a sectioned vacuum gripper in Mech-Viz. MM_GET_VIZDATA must be called BEFORE this job.
Set DO
This job set the DoList sent by Mech-Viz as common output signals. At most 4 groups of GO signals are supported. Each group of GO signals contains 16 bits. If more than one GO group is needed, repeat calling the job. This job must be called AFTER MM_GET_DOLIST.
Input TCP to Mech-Viz
This job dynamically inputs TCP data to the* External Move* Step in Mech-Viz.
Please use this job based on the template project in XXXX/Communication Component-xxx/tool/viz_project/outer_move
, and place the External Move Step at a proper position in the workflow. MM_GET_VIZDATA 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 the Camera Calibration function 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, P99 by default. |
Example
CALL JOB:MM_CALIB("2;1;2;6;0;99")
This example moves the robot with MOVJ, receives pose data in the form of flange pose, 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.
Parameters
Name | Description |
---|---|
Input parameters |
|
job |
Mech-Vision Project ID, which can be checked and adjusted in the Project List panel of Mech-Vision. |
Output Parameters |
|
regPosNum |
I variable for storing the number of received vision points. |
regStatus |
I variable for storing status code. Please see Status Codes and Troubleshooting. |
Save Vision Point to Specified Variables
This job stores the data in the vision point 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 Waypoint from Mech-Viz
This job is used for obtaining the planned path from Mech-Viz. The waypoint may be for a Vision Move Step, or for one of the other move-type Steps. A waypoint may contain pose, velocity, gripper info, workobject info, etc.
Calling this job once will store all the obtained data to the robot.
Waypoints in a planned path can be divided into the following three types.
-
All waypoints contain the following data: motion type (joint motion or linear motion), tool number and velocity.
-
Vision move waypoints, including label, number of workobject that have been picked, number of work objects picked this time, edge/corner ID of the suction cup, the TCP offset, workobject pose, and dimensions of the workobject combined.
-
Vision move waypoints including custom data, where the port type of the Procedure Out step of the Mech-Vision project should be “custom”.
Parameters
Name | Description |
---|---|
Input parameters |
|
jpsPos |
Expected format of the returned data, from 1 to 4. See the following table for explanations. |
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 path. Example path: Move_1, Move_2, Vision Move_3, Move_3, Vision Move_2. In this path, the position of the first Vision Move waypoint is 3. If the path does not contain Vision Move waypoint, the return value is 0. |
regStatus |
I variable for storing status code. Please see Status Codes and Troubleshooting. |
The relationship between the value of Jps_Pos and the format of the returned data is summarized below.
jpsPos 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
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
-
1
: joint motion, MOVEJ -
2
: linear motion, MOVEL
Tool number
The index number of the tool to be used at this waypoint. -1 means no tool is used.
Velocity
Velocity of the waypoint, equals to the velocity setting in the corresponding move-type Step multiplied by the global velocity setting in Mech-Viz, in the format of percentage.
Depalletizing planning data
Data used in planning multi-pick and 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: Specify the gripper corner to which the workobject is aligned. Can be checked by double-clicking the corresponding tool in the Resources panel in Mech-Viz and then selecting Configure control logic.
-
TCP offset: The offset between the tool pose at the center of the to-pick workobject 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 workobject combined.
Number of custom ports
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
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.
Example
CALL JOB:MM_GET_PLANDATA("4;60;61;62")
This example obtains the planned path that includes custom port outputs from Mech-Viz, and the poses obtained are in the form of TCPs. The number of waypoints received is stored in I60, the position of the Vision Move waypoint is stored in I61, and the status code is stored in I62.
Save Waypoint to Specified Variables
This job stores the waypoints returned by Mech-Viz in the specified 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 number 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 depalletizing planning data and custom port outputs in the specified waypoint. Omit for waypoints not of the Vision Move Step. Data are stored in R variables consecutive to the input one. Reserve enough R variables. The depalletizing planning data occupies 20 variables. |
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 number 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 checked and adjusted in the Project List panel of Mech-Vision. |
GetPos_Type |
This parameter specifies the type of waypoint pose returned by the “Path Planning” Step.
|
Output Parameters |
|
Last_Data |
I variable, indicating whether all waypoints have been sent, 0 or 1.
|
Pos_Num |
I variable for storing the number of received waypoints. |
VisPos_Num |
I variable for storing the position of the first Vision Move waypoint in the 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 waypoint, the return value is 0. |
MM_Status |
I variable for storing status code. Please see Status Codes and Troubleshooting. |
Example
CALL JOB:MM_GET_VISPATH("1;2;50;51;52;53")
This example obtains the planned path from Mech-Vision project No.1 in the form of TCPs. Whether all waypoints have been sent is stored in I50, the number of waypoints received is stored in I51, the position of the Vision Move waypoint is stored in I52, and the status code is stored in I53.