mm_viz_pick_and_place¶
This example program triggers the Mech-Viz project to plan a robot path and move the robot to the first waypoint.
Note
Please make sure that the Lua script is running in the background. Otherwise, the communication between the robot and Mech-Mind Software Suite cannot be established.
Program Logic¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | NOP
WAIT B099 = 0
SET B109 1
//run viz pose type
SET B099 4
//start viz
WAIT B099 = 0
// SET B110 1
// //set branch id
// SET B111 1
// //set branch out port
// SET B099 5
// //set branch
// WAIT B099 = 0
// SET B112 2
// //set index id
// SET B113 1
// //set index out port
// SET B099 6
// //set index
// WAIT B099 = 0
SET B114 2
// receive viz pose type
SET B099 7
// receive from viz
WAIT B099 = 0
SET B099 9
// set viz to v101-v120 p101-p120
WAIT B099 = 0
// MOVL V100 V=100MM/S CR=0.000MM
END
|
Line 3: Set the type of pose to send to Mech-Viz (2 means to send the current JPs and flange pose).
Line 5: Send the command for triggering the Mech-Viz project to run.
Line 8: Set the Step ID of the “Branch by Msg” Step for which branch selection is required.
Line 10: Set the exit port to take for the above Step.
Line 12: Send the command for selecting the branch along which the Mech-Viz project should proceed.
Line 15: Set the Step ID of the Step with the Current Index parameter.
Line 17: Set the value of the Current Index parameter in the above step.
Line 19: Send the command for setting the Current Index parameter.
Line 22: Set the type of waypoint pose to be obtained from Mech-Viz (2 means to obtain waypoint poses as TCPs).
Line 24: Send the command for obtaining the planned path.
Line 27: Send the command for storing the obtained waypoint poses to variables V101-V120 (If obtained waypoint poses are JPs, they are stored in variables P101 to P120).
Line 30: Move the robot to the obtained waypoint pose. Modify the command and/or add more robot motion commands according to actual needs.
Run the mm_viz_pick_and_place program¶
Open Needed Variables¶
As the waypoint poses received from Mech-Viz will be stored in variables V101 to V120 (if TCP) or P101 to P120 (if JPs), please open these variables first according to the following steps.
On the teach pendant, press
.If the dot in the Status column is red, the variable is not opened. Select a closed variable, and press Open in the lower left to open it.
Similarly, press
and open all the P101 to P120 variables.Press Quit to return to the home page.
Run the Program¶
Move the cursor to the first line of the program, and turn the key to PLAY.
Press the yellow button in the lower right of the teach pendant to start the servo motors, and then press the green button to run the program automatically.
If the program is run successfully, The received waypoint poses will be stored in the variables starting from V101 or P101, depending on the type of waypoint poses obtained.