YASKAWA Standard Interface Commands

The YASKAWA Standard Interface provides the following jobs:

When writing your own program, pay attention to the following:

  • Multiple parameters should be separated by semi-colons.

  • When calling jobs: input parameter is a string by default; output parameter is a string by default, each element in the string corresponding to a global variable in the background.

Attention

  • For Mech-Center prior to version 1.6.1, every Standard Interface job encapsulates codes that initialize the communication and disconnect the communication.

  • For Mech-Center 1.6.1 and aboves, the following changes have been made:

    • To facilitate testing, only MM_INIT_SOCKET keeps codes used for communication establishment and disconnection. The MM_INIT_SOCKET job only needs to be called once because the set IP address will be valid globally from then on.

    • Codes used for communication establishment and disconnection are divided into two individual jobs, which are MM_OPEN_SOCKET and MM_CLOSE_SOCKET. The communication is established when MM_OPEN_SOCKET is called and remains alive until MM_CLOSE_SOCKET is called to disconnect it. With these two jobs, frequent reconnection of communication between the robot and the vision system can be avoided.

This Standard Interface is over the TCP/IP protocol.

The YASKAWA Standard Interface provides the following jobs:

Initialize Communication

MM_INIT_SOCKET ("IP_Address;Server_Port;Time_Out")

This job sets the IP address and port number of the IPC and wait time before the program stops trying to establish the communication.

Parameters

  • Input parameters

    Name

    Description

    IP_Address

    IP address of the IPC

    Server_Port

    Port number of the IPC, the default is 50000

    Time_Out

    Wait time in minutes before stopping connection attempt

Example

CALL JOB:MM_INIT_SOCKET ("192.168.1.1;50000;5")

This example sets the IP address and port number of the IPC to 192.168.1.1:50000 and wait time to 5 minutes.

Start TCP Socket

MM_OPEN_SOCKET

This job begins the communication between the robot and the vision system. The MM_INIT_SOCKET job should be called before this job to set the IP address and port number of the IPC correctly.

Parameters

No parameters.

Example

CALL JOB:MM_OPEN_SOCKET

Close TCP Socket

MM_CLOSE_SOCKET

This job shuts down the TCP/IP socket and therefore ends the the communication between the robot and the vision system. You can call this job after all the vision tasks are completed.

Parameters

No parameters.

Example

CALL JOB:MM_CLOSE_SOCKET

Start Mech-Vision Project

MM_START_VIS ("Job;Pos_Num_Need;SendPos_Type")

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

Parameters

  • Input parameters

    Name

    Description

    Job

    Mech-Vision Project ID, from 1 to 99

    Can check and adjust in Mech-Center ‣ Deployment Settings ‣ Mech-Vision

    Pos_Num_Need

    Number of poses for Mech-Vision to send, from 0 to 20, where 0 means “send all”.

    SendPos_Type

    Set the image-capturing pose for the robot to send, from 0 to 2

    0: Do not send image-capturing pose (for Eye To Hand) 1: Send image-capturing pose as joint positions 2: Send image-capturing pose as robot flange pose

Example

CALL JOB:MM_START_VIS ("1;1;1")

This example runs Mech-Vision project No. 1, and asks the project to send over 1 pose, and the robot sends its joint positions when this job is called as the image-capturing pose to Mech-Center.

Get Vision Target(s)

MM_GET_VISDATA ("Job;Last_Data;Pose_Num;MM_Status")

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

  • Input parameter

    Name

    Description

    Job

    Mech-Vision Project ID, from 1 to 99

    Can check and adjust in Mech-Center ‣ Deployment Settings ‣ Mech-Vision

  • Output parameters

    Name

    Description

    Last_Data

    I variable, indicating whether all vision result has been sent, 0 or 1

    0: NOT all vision result has been sent (more on the way) 1: All vision result has been sent If 0, call this JOB again until all are sent

    Pose_Num

    I variable for storing the number of received poses

    MM_Status

    I variable for storing status code. Please see Status Codes and Trouble Shooting.

Example

CALL JOB:MM_GET_VISDATA ("1;50;51;52")

This example obtains the vision result from Mech-Vision project No. 1. Whether all vision result has been sent is stored in I50, the number of poses received is stored in I51, and the status code is stored in I52.

Start Mech-Viz Project

MM_START_VIZ ("SendPos_Type")

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

Parameter

  • Input parameter

    Name

    Description

    SendPos_Type

    The initial joint positions for the simulated robot in Mech-Viz, 0 or 1

    0: Set the initial joint positions of the simulated robot to [0,0,0,0,0,0] 1: Set the initial joint positions of the simulated robot to the current joint positions of the real robot

    Note

    When the scene contains object models that obstruct the robot to move from [0,0,0,0,0,0] to the first target, this parameter must be set to 1.

Example

CALL JOB:MM_START_VIZ ("1")

This example runs the corresponding Mech-Viz project, and sets the initial joint positions of the simulated robot to the current joint positions of the real robot.

Get Planned Path

MM_GET_VIZDATA ("GetPos_Type;Last_Data;Pos_Num;VisPos_Num;MM_Status")

This job obtains the planned path from Mech-Viz.

Parameters

  • Input parameter

    Name

    Description

    GetPos_Type

    Whether Mech-Viz should send targets as joint positions or TCPs, 1 or 2

    1: Mech-Viz sends joint positions 2: Mech-Viz sends TCPs

  • Output parameters

    Name

    Description

    Last_Data

    I variable, indicating whether all targets have been sent, 0 or 1

    0: NOT all targets have been sent (more on the way) 1: All targets have been sent If 0, call this JOB again until all are sent

    Pos_Num

    I variable for storing the number of received targets

    VisPos_Num

    I variable for storing the position of the first visual_move target in the path

    Example path: move-1, move-2, visual_move-3, move-3, visual_move-2 In this path, the position of the first visual_move target is 3. If the path does not contain visual_move target, the return value is 0.

    MM_Status

    I variable for storing status code. Please see Status Codes and Trouble Shooting.

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 targets have been sent is stored in I50, the number of targets received is stored in I51, the position of the visual_move target is stored in I52, and the status code is stored in I53.

Obtain Pose

MM_GET_POSE ("Index;PosTarget;Label;Pose_Speed")

This job stores a pose returned by Mech-Vision or a target (as TCP) returned by Mech-Viz in the specified variable.

Parameters

  • Input parameter

    Name

    Description

    Index

    Specify the index of the pose to be stored

  • Output parameters

    Name

    Description

    PosTarget

    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 speed corresponding to the specified pose

Example

CALL JOB:MM_GET_POSE ("1;60;61;62")

This example stores the first received pose to P60, the corresponding label to I61, and the corresponding speed to I62.

Obtain Joint Positions

MM_GET_JPS ("Index;JointTarget;Label;Pose_Speed")

This job 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 job can only be used with Mech-Viz.

Parameters

  • Input parameter

    Name

    Description

    Index

    Specify the index of the set of joint positions to be stored

  • Output parameters

    Name

    Description

    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 speed corresponding to the specified set of joint positions

Example

CALL JOB:MM_GET_JPS ("1;60;61;62")

This example stores the first set of received joint positions to P60, the corresponding label to I61, and the corresponding speed to I62.

Switch Mech-Vision Recipe

MM_SET_MODEL ("Job;Model_Number")

This job specifies which parameter recipe of the Mech-Vision project to use. For more information on parameter recipe, please see Parameter Recipe.

Note

  • This job must be called BEFORE MM_START_VIS.

  • The corresponding Mech-Vision project must have parameter recipes already configured and saved.

Parameters

  • Input parameters

    Name

    Description

    Job

    Mech-Vision Project ID, from 1 to 99

    Can check and adjust in Mech-Center ‣ Deployment Settings ‣ Mech-Vision

    Model_Number

    The number of a parameter recipe in the Mech-Vision project, from 1 to 99

Example

CALL JOB:MM_SET_MODEL ("1;1")

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

Select Mech-Viz Branch

MM_SET_BRANCH ("Branch_Num;Exit_Num")

This job is used to select along which branch the Mech-Viz project should proceed. Such branching is achieved by adding branch_by_msg Task(s) to the project. This job specifies which exit port such Task(s) should take.

Note

  • MM_START_VIZ must be called BEFORE this job.

  • When the next Task to be executed in Mech-Viz is a branch_by_msg Task, Mech-Viz will wait for this job to send the exit port number it should take.

  • The name of all branch_by_msg Tasks in the Mech-Viz project must be changed to integers between 1 and 99, and the names should be unique among all Tasks in the project.

Parameters

  • Input parameters

    Name

    Description

    Branch_Num

    Name of the branch_by_msg Task, from 1 to 99

    Exit_Num

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

Example

CALL MM_SET_BRANCH ("1;3")

This example tells Mech-Viz to take exit port 3 for the branch_by_msg Task named 1.

Set Move Index

MM_SET_INDEX ("Skill_Num;Index_Num")

This job sets the value for the Current Index parameter of Mech-Viz Tasks. Tasks that have this parameter include move_list, move_grid, custom_pallet_pattern, and smart_pallet_pattern.

Note

  • mm_start_viz must be called BEFORE this job.

  • The name of all Tasks with index parameters in the Mech-Viz project must be changed to integers between 1 and 99, and the names should be unique among all Tasks in the project.


  • Skill_Num

    The Task ID of the branch_by_msg Task.

    This parameter specifies which Task the index setting should apply to.

    The Task ID can be read in the Task’s parameters.

  • Index_Num:

    The index value that should be set the next time this Task 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 task specified by this command, the current index value in Mech-Viz will be increased by 1 to become the parameter’s value.

Example

CALL JOB:MM_SET_INDEX ("2;10")

This example sets the Current Index value to 9 for the Task named 2. When the Task is executed, the Current Index value will be added 1 and become 10.

Get Software Status

MM_GET_STATUS ("Status")

This job is currently capable of checking whether Mech-Vision is 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.

Parameter

  • Output parameter

    Status

    Software status. 1101 means the Mech-Vision project is ready to run. Other codes mean the project is not ready.

Example

CALL JOB:MM_GET_STATUS ("70")

This example obtains the status code and stores it in I70.

Input Object Dimensions to Mech-Vision

MM_SET_BOXSIZE("Job;Length;Width;Height")

This job inputs object dimensions to the Mech-Vision project.

Note

  • This job must be called BEFORE MM_START_VIS.

Parameters

  • Input parameters

    Name

    Description

    Job

    Mech-Vision Project ID, from 1 to 99

    Can check and adjust in Mech-Center ‣ Deployment Settings ‣ Mech-Vision

    Length

    Length of object in mm

    Width

    Width of object in mm

    Height

    Height of object in mm

Example

CALL JOB:MM_SET_BOXSIZE ("1;500;300;200")

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

Get DO Signal List

MM_GET_DOLIST

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

Note

  • MM_GET_VIZDATA must be called BEFORE this job.

  • Please deploy the Mech-Viz project based on the template project in Mech-Center/tool/viz_project/suction_zone, and set the suction cup configuration file in the Mech-Viz project.

Parameters

No parameters.

Example

CALL JOB:MM_GET_DOLIST

This example obtains the DO signal list planned by Mech-Viz and writes the values in OT1OT16.

Input TCP to Mech-Viz

MM_SET_POSE ("Pos")

This job inputs TCP data to the outer_move Task.

Note

  • This job must be called BEFORE MM_START_VIZ.

  • Please deploy the Mech-Viz project based on the template project in Mech-Centertoolviz_projectouter_move, and put the outer_move Task at a proper position in the workflow.

Parameter

  • Input parameter

    Name

    Description

    Pos

    P variable for storing the TCP data to be sent to Mech-Viz

Example

CALL JOB:MM_SET_POSE ("10")

This example sends the TCP data stored in P10 to the outer_move task in the Mech-Viz project.

Calibration

MM_CALIB ("Move_Type;Pos_Jps;Wait_Time;Rnum;Ext;Pos")

This job 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. For detailed instructions, see KUKA Calibration Program.

Parameters

  • Input parameters

    Name

    Description

    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.