Example Programs

You are viewing an old version of the documentation. You can switch to the documentation of the latest version by clicking the top-right corner of the page.

The CRX plugin provides picking programs as examples. You can learn from the examples and create your own picking programs with less effort.

This section introduces the process of creating two simple picking programs:

In actual application, please configure the end tool and define the TCP correctly beforehand.

Picking with Mech-Vision

The example program below triggers Mech-Vision to capture images and move the robot to the pick point.

  1. Create a new robot program (the name of the robot program in this example is MM_EXAMPLE_VISION). Select Programming and follow the order in the figure below to drag the commands in the ALL tab to the program line.

    crx 37

    Press Comment in the program line, and then you can enter a comment, e.g., “Debugging”, in the Details panel.

    General workflow of the program is:

    • The Mech-Vision Trigger command triggers the specified Mech-Vision project to run.

    • The Mech-Vision GetData command obtains the vision result from Mech-Vision and stores the status code in a register (R[52] for example).

    • The If command determines whether the planned path is received successfully.

      • If the vision result is received successfully, the Mech-System GetPose command will store the first pick point sent from the Mech-Vision project to a specified register, and then the robot will move to the first pick point in the J (joint) motion type.

      • If the planned path is not received successfully, debugging will be performed. The detailed programming of the debugging process is omitted in this example.

  2. Press If and configure the parameters as shown below.

    crx 38

    The If command will check the status code which is stored in R[52]. If the value of R[52] is 1100, the vision result is received successfully, or else a debugging process should be performed.

  3. Press J and configure the position register as shown below.

    crx 39

    The first pick point sent from the Mech-Vision project is stored in PR[60] as TCP. Once the pick point is received successfully, the robot will move to the PR[60] position in moveJ motion type.

Now you have built a simple program that uses Mech-Vision for picking. Once you have switched the teach pendant to the Automatic mode, you can select Play in the lower left corner and reduce the velocity. Then you can press Run to run the program.

Picking with Mech-Viz

All waypoints in the path planned by Mech-Viz can be sent to the robot via Mech-Interface. The example program below triggers Mech-Viz to plan a path and move the robot to a waypoint in the path.

  1. Create a new robot program (the name of the robot program in this example is MM_EXAMPLE_VIZ). Select Programming and follow the order in the figure below to drag the commands in the ALL tab to the program line.

    crx 40

    General workflow of the program is:

    • The Mech-Viz Trigger command triggers the Mech-Viz project to run.

    • The Mech-Viz GetData obtains the planned path from Mech-Viz and stores the status code in a register (R[53] for example).

    • The If command determines whether the planned path is received successfully.

      • If the planned path is received successfully, the Mech-System GetPoseJPS command will store the first waypoint sent from the Mech-Viz project to a specified register, and then the robot will move to the first waypoint in the J (joint) motion type.

      • If the planned path is not received successfully, debugging will be performed. The detailed programming of the debugging process is omitted in this example.

  2. Press If and configure the parameters as shown below.

    crx 41

    The If command will check the status code which is stored in R[53]. If the value of R[53] is 2100, the planned path is received successfully, or else a debugging process should be performed.

  3. Press J and configure the position register as shown below.

    crx 42

    The first waypoint sent from the Mech-Viz project is stored in PR[60] as joint positions. Once the planned path is received successfully, the robot will move to the PR[60] position in the J (joint) motion type. If you want Mech-Viz to send waypoints in TCP, please modify the Return Value Type in Mech-Viz GetData to TCP. Then the “Mech-System GetPoseJPS” command will store poses as TCPs in PR[60].

    crx 42

Now you have built a simple program which uses Mech-Viz to plan the path for picking. Once you have switched the teach pendant to the Automatic mode, you can select Play in the lower left corner and reduce the velocity. Then you can press Run to run the program.

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.