mm_vispath_sample

This example program triggers the Mech-Vision 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
 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 from Mech-Vision (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 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_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 variables first according to the following steps.

  1. On the teach pendant, press Monitor ‣ Global variables ‣ Var_V.

    ../../../../_images/elite_example1.png
  2. 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.

    ../../../../_images/elite_example2.png
  3. Similarly, press Monitor ‣ Global variables ‣ Var_P and open all the P101 to P120 variables.

    ../../../../_images/elite_example3.png
  4. Press Quit to return to the home page.

Select Program

On the home page, select the mm_vispath_sample program, and press Open.

../../../../_images/elite_example_vispath.png

Run the Program

  1. Move the cursor to the first line of the program, and turn the key to PLAY.

  2. 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.

    ../../../../_images/elite_example41.png
  3. If the program is run successfully, The received vision poses will be stored in the variables starting from V101.