mm_vispath_sample
This example program triggers the Mech-Vision project to plan a robot path and move the robot to the first waypoint.
|
Please make sure that the Lua script is running in the background. Otherwise, the communication between the robot and the Software Suite cannot be established. |
Program Logic
NOP
WAIT B099 = 0
SET B105 1
//set project id
// SET B108 1
// //recipe id
// SET B099 3
// //set recipe
// WAIT B099 = 0
SET B106 0
//run vision except num of pose
SET B107 2
//run vision pose type
SET B099 1
//start vision
WAIT B099 = 0
SET B114 2
// set get_vision_path pose type
SET B099 11
// get vision path
WAIT B099 = 0
SET B099 9
// set vision path to V101-V120
WAIT B099 = 0
MOVL V101 V=100MM/S CR=0.000MM
END
-
Line 3: Set Mech-Vision project No. 1 as the project to be executed.
-
Line 5: Set the parameter recipe to be used in the Mech-Vision project.
-
Line 7: Send the command for switching Mech-Vision parameter recipe.
-
Line 10: Set the number of vision points to obtain (0 means to obtain all vision points or the first 20 if more than 20 are available).
-
Line 12: Set the type of pose to send to Mech-Vision (2 means to send the current TCP).
-
Line 14: Send the command for triggering the Mech-Vision project to run.
-
Line 17: Set the type of waypoint pose to be obtained (2 means to obtain waypoint poses as TCPs).
-
Line 19: Send the command for obtaining the planned path.
-
Line 22: 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 25: Move the robot to the obtained waypoint pose.
Run the mm_vispath_sample program
Open Needed Variables
As the waypoint poses received from Mech-Vision will be stored in variables V101 to V120 (if TCP) or P101 to P120 (if JPs), please open these 40 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.
-
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 running successfully, the received vision poses will be stored in the variables starting from V101.