FANUC Standard Interface Commands¶
The FANUC Standard Interface provides the following procedures:
When programming the FANUC robot, please pay attention to the following:
Multiple parameters should be separated by commas.
All parameters should be defined as local variables in the program file.
Parameters can be defined as Input or Output parameters.
This Standard Interface is over the TCP/IP protocol.
Initialize Communication¶
MM_INIT_SKT (C_Tag,Ip_Addr,Svr_Port,Time_Out)
This procedure is used to set the host IP address, port number, and wait time for TCP/IP communication.
Parameters¶
Input Parameters
Name
Description
C_Tag
Client port number, i.e. the port number string of the robot
Ip_Addr
The IP address of the IPC
Svr_Port
Server port number; the default port number is 50000
Time_Out
Wait time in minutes before stopping connection attempt
Example¶
CALL MM_INIT_SKT ('1', '192.168.1.20', 50000, 5);
When running the example, the specified client port number is 1, the host IP address should be set to 192.168.1.20, the port number should be set to 50000, and the wait time is 5 minutes.
Start Mech-Vision Project¶
MM_START_VIS (Job,Pos_Num_Need,SendPos_Type)
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.
Parameters¶
Input Parameters
Name
Description
Job
Mech-Vision Project ID, from 1 to 99
Please go to
to check and adjust the number.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 MM_START_VIS (1,1,1)
This example triggers Mech-Vision No. 1 project to run; the Mech-Vision No. 1 project is expected to send back 1 pose; and the robot will send image-capturing pose as joint to Mech-Center.
Get Vision Target(s)¶
MM_GET_VIS (Job,Reg_Lst_Data,Reg_Pos_Num,Reg_Status)
This procedure 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
Please go to
to check and adjust the number.Output Parameters
Name
Description
Reg_Lst_Data
Data Register, 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
Reg_Pos_Num
Data Register for storing the number of received poses, from 1 to 20
MM_Status
Data Register for storing status code. Please see Status Codes and Trouble Shooting.
Example¶
CALL MM_GET_VIS (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 register R[50], the number of poses received is stored in register R[51], and the status code is stored in register R[52].
Start Mech-Viz Project¶
MM_START_VIZ (SendPos_Type)
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.
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 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_VIZ (Jps_Pos,Reg_Lst_Data,Reg_Pos_Num,Reg_VPos_Num,Reg_Status)
This procedure obtains the planned path from Mech-Viz.
Parameters¶
Input Parameter
Name
Description
Jps_Pos
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
Reg_Lst_Data
Data Register, 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
Reg_Pos_Num
Data Register for storing the number of received targets which range from 1-20
Reg_VPos_Num
Data Register 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.
Reg_Status
Data Register for storing status code. Please see Status Codes and Trouble Shooting.
Example¶
CALL MM_GET_VIZ (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 register R[50], the number of targets received is stored in register R[51], the position of the visual_move target is stored in register R[52], and the status code is stored in register R[53].
Obtain Pose¶
MM_GET_POS (Serial, Pr_Num, Reg_Label, Reg_Speed)
This procedure stores a pose returned by Mech-Vision or a target (as TCP) returned by Mech-Viz in the specified Position Register.
Parameters¶
Input Parameter
Name
Description
Serial
Specify the index of the pose to be stored
Output Parameters
Name
Description
Pr_Num
Position Register for storing the specified pose
Label
Data Register for storing the label corresponding to the specified pose
Pose_Speed
Data Register for storing the speed corresponding to the specified pose
Example¶
CALL MM_GET_POS (1,60,61,62)
This example stores the first received pose to register PR[60], the corresponding label to register R[61], and the corresponding speed to register R[62].
Obtain Joint Positions¶
MM_GET_JPS (Serial,Pr_Num,Reg_Label,Reg_Speed)
This procedure stores a set of joint positions returned by Mech-Viz in the specified Position Registers.
Note
As Mech-Vision does not output joint position data, this subprogram can only be used with Mech-Viz.
Parameters¶
Input Parameter
Name
Description
Serial
Specify the index of the set of joint positions to be stored
Output Parameters
Name
Description
Pr_Num
Position Register for storing the specified set of joint positions
Reg_Label
Data Register for storing the label corresponding to the specified set of joint positions
Reg_Speed
Data Register for storing the speed corresponding to the specified set of joint positions
Example¶
CALL MM_GET_JPS (1,60,61,62)
This example stores the first set of received joint positions to PR[60], the corresponding label to register R[61], and the corresponding speed to register R[62].
Switch Mech-Vision Recipe¶
MM_SET_MOD (Job,Model_Num)
This procedure specifies which parameter recipe of the Mech-Vision project to use. For more information on parameter recipe, please see Parameter Recipe.
Note
This procedure must be called BEFORE MM_START_VIZ.
Parameters¶
Input Parameters:
Name
Description
Job
Mech-Vision Project ID, from 1 to 99
Can check and adjust in
Model_Num
The number of a parameter recipe in the Mech-Vision project, from 1 to 99
Example¶
CALL MM_SET_MOD (2,2)
This example switches the parameter recipe used to No. 2 in Mech-Vision project No. 2.
Select Mech-Viz Branch¶
MM_SET_BCH (Branch_Num,Export_Num)
This procedure 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 subprogram specifies which exit port such Task(s) should take.
Note
MM_START_VIZ must be called BEFORE this procedure.
When the next Task to be executed in Mech-Viz is a branch_by_msg Task, Mech-Viz will wait for this procedure 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
Export_Num
The number of the exit port to take, from 1 to 99
Example¶
CALL MM_SET_BCH (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_IDX (Skill_Num,Index_Num)
This procedure 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 procedure.
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.
Parameters¶
Input Parameters
Skill_Num
Task ID of the Task with the index parameter. 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 MM_SET_IDX (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_STAT (MM_Status:OUT)
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.
Parameter¶
Output Parameter
MM_Status
Data Register for storing the status code. 1101 means the Mech-Vision project is ready to run. Other codes mean the project is not ready.
Example¶
CALL MM_GET_STAT (70)
This example obtains the status code and stores it in register R[70].
Input Object Dimensions to Mech-Vision¶
MM_SET_BS (Job:IN,Lenght,Width,Height)
This procedure inputs object dimensions to the Mech-Vision project.
Note
This procedure 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
Lenght
Length of object in mm
Width
Width of object in mm
Height
Height of object in mm
Example¶
CALL MM_SET_BS (1,11.0,12.0,13.0)
This example sets the object dimensions in the Read Object Dimensions Step in the Mech-Vision project No. 1 to 11*12*13 mm.
Get DO Signal List/ Set DO Signal List¶
Get DO Signal List
MM_GET_DL
Set DO Signal List
MM_SET_DL
These two procedures obtain the planned DO Signal list for controlling multiple sections of a sectioned vacuum gripper and set the DOs accordingly.
Note
MM_GET_VIZ must be called BEFORE this procedure.
Please deploy the Mech-Viz project based on the template project in XXXX\Mech-Center-xxx\tool\viz_project\suction_zone, and set the suction cup configuration file in the Mech-Viz project.
Parameters¶
No parameters.
Example¶
CALL MM_GET_DL
CALL MM_SET_DL
These two examples obtain the DO signal list planned by Mech-Viz, store it in Do_Port[i], and input the values to the corresponding digital outputs.
Input TCP to Mech-Viz¶
MM_SET_POS (X,Y,Z,W,P,R)
This procedure inputs TCP data to the outer_move Task.
Note
This procedure must be called BEFORE MM_START_VIZ.
Please deploy the Mech-Viz project based on the template project in XXXX\Mech-Center-xxx\tool\viz_project\outer_move, and put the outer_move Task at a proper position in the workflow.
Parameter¶
Input parameter
Name |
Description |
X |
Variable 1 of the pose (mm) |
Y |
Variable 2 of the pose (mm) |
Z |
Variable 3 of the pose (mm) |
W |
Variable 4 of the pose (arc degree) |
P |
Variable 5 of the pose (arc degree) |
R |
Variable 6 of the pose (arc degree) |
Example¶
CALL MM_SET_POS (100.1,200.2,300.3,90.0,180.0,0.0)
This example sends the pose of TCP (100.1,200.2,300.3,90.0,180.0,0.0) to the outer_move task in the Mech-Viz project.
Calibration¶
MM_CALIB (Move_Type,PosJps,WaitTime,AxisNum,AxisVal,Reg_CalibPos)
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. For detailed instructions, see FANUC Calibration Program.
Parameters¶
Input Parameters
Name
Description
Move_Type
Motion type, 1 or 2
1: Linear motion 2: Joint moton
PosJps
Pose as flange pose or joint positions, 1 or 2
1: flange pose 2: Joint positions
WaitTime
The time the robot waits to avoid shaking after it moves to the calibration point; the default value is 2 (s)
AxisNum
The axis number of the robot
AxisVal
Data of the external 7th axis in mm (Optional; input 0 when there is no external axis)
Reg_CalibPos
The Position Register used in MM_AUTO_CALIB; PR[100] by default
Example¶
CALL MM_CALIB (2,1,2,6,0,100)
This example moves a 6-axis robot in Joint motion type, 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. Moreover, the robot does not have an external 7th axis. The register PR[100] is used to store the received pose data.