Communication Configuration and Example Program Usage

This topic provides instructions on setting up the Standard Interface communication based on the EtherNet/IP protocol between an Allen‑Bradley PLC (hereafter referred to as AB PLC) and the Mech-Mind Vision System.

Hardware and Software Requirements

Hardware

  • AB PLC: A 1769-L19ER-BB1B module PLC is used as an example in the following instructions.

  • Power adapter: AC 220 V to DC 24 V

  • IPC: IPC with HMS IXXAT INpact 40 PCIe interface card installed

  • Network switch and Ethernet cables

The connection of the hardware system is shown as below.

ethernet ip ab 1

Software

Software Description Installed Location

AB PLC Studio 5000

AB PLC programming software

Computer that is used for AB PLC programming

PCIe Card and Driver Software

IPC

Mech-Vision & Mech-Viz versions: 1.7.2 or above

Mech-Mind Vision System

IPC

Used for setting up the IP address of the PCIe card

IPC

Please copy and paste the following files to a PC with Studio 5000 installed:

  • EDS file: 005A002B003A0100.EDS, which is used to provide the identity information of the IPC in the EtherNet/IP network. Location: Mech-Center/Robot_Interface/EthernetIP in the installation directory where Mech-Vision and Mech-Viz are installed.

  • PLC example program files:

    • CameraSignalsMove.L5X: used to transfer the vision system signals

    • CameraTest.L5X: used to test the vision system

    • MM EtherNet IP Interface Program.L5X: used to implement the functions of various interface commands

The example program files are stored in the folder where Mech-Vision & Mech-Viz are installed: Mech-Center/Robot_Interface/EthernetIP/Programming Samples/AB PLC EthernetIP.

Configure IPC and Initiate Communication

Check PCI-e Card and Driver Software

  1. Please make sure that the INpact EIP Slave PCIe interface card has been pressed into the PCI-e slot of the IPC, as shown below.

    ethernet ip ab 2
  2. Start the IPC, go to Start ‣ Device Manager and check if the driver software VCI4 INpact PCIe has been installed.

    ethernet ip ab 3

Set up “Robot Communication Configuration”

  1. Click Robot Communication Configuration on the toolbar of Mech-Vision.

  2. In the Robot Communication Configuration window, complete the following configurations.

    1. Click the Select robot drop-down menu, and select Listed robot. Click Select robot model, and select the robot model that you use. Then, click Next.

    2. In the Communication mode area, select Standard Interface for Interface service type and select ETHERNET IP for Protocol.

    3. (Optional) Select Auto enable interface service when opening the solution.

    4. Click Apply.

      ethernet ip
  3. On the main interface of Mech-Vision, make sure that the Robot Communication Configuration switch on the toolbar is flipped and turned to blue.

    interface service

Configure IP address of the PCIe Card

  1. Use an Ethernet cable to connect the network ports of the IPC and the IXXAT INpact 40 PCIe interface card.

    After configuring the IP and initiating communication successfully, the Ethernet cable used here can be removed.
  2. Open HMS IPconfig, click the scan icon and unselect “Retrieve IP settings dynamically from a DHCP server”, and then enter the IP address and subnet mask. After configuration, click Apply and exit the software.

    ethernet ip ab 6

Create and Configure the PLC Project

Create a PLC Project

  1. On the computer, open Studio 5000 software, click New Project, and a New Project window will pop up.

    ethernet ip ab 7
  2. Click Logix, and select the corresponding CPU series and model according to the AB PLC used (a 1769-L19ER-BB1B module PLC is used as an example in the following instructions). Enter the project Name, select the Location, and click Next.

    ethernet ip ab 8
  3. Select Revision and Expansion I/O according to the actual situation, and click Finish to enter the project interface.

    ethernet ip ab 9

Set the IP Address of PLC

  1. On the computer, go to Start  All Programs  Rockwell Software  BootP-DHCP Tool  BootP-DHCP Tool, and a Select Network Interface window will pop up.

    ethernet ip ab 10
  2. Select the driver for the Ethernet adapter connected to the PLC and click OK.

    ethernet ip ab 11
  3. In the BootP DHCP EtherNet/IP Commissioning Tool window, go to Tools  Network Setting.

    ethernet ip ab 12

    Set the subnet mask and gateway and click OK.

    ethernet ip ab 13
  4. Click Add Relation, enter the MAC address and IP address of PLC in the pop-up window (the figure below shows the address used in the example), and click OK.

    ethernet ip ab 14
  5. Select the created Relation, click Enable BOOTP/DHCP to enable the BOOTP function. If successful, the message “Sent 192.168.1.22 to Ethernet address 5C:88:16:D6:BF:C0” will be displayed in the status bar below. If unsuccessful, please check the network connection and IP setting.

    ethernet ip ab 15
  6. Select the created Relation, click Disable BOOTP/DHCP to disable the BOOTP function. If successful, the message “[Disable BOOTP/DHCP] Command successful” will be displayed first in the status bar below, and then “Unable to service DHCP request from 5C:88:16:D6:BF:C0” will be displayed. Then you can close the BootP DHCP EtherNet/IP Commissioning Tool window.

    ethernet ip ab 16

    If unsuccessful, please check your network connection and IP settings.

Connect the Controller

  1. On the computer, go to Start  All Programs  Rockwell Software  RSLinx  RSLinx Classic, and a RSLinx Classic Gateway window will pop up.

    ethernet ip ab 17
  2. In the menu bar, go to Communications  Configure Drivers.

    ethernet ip ab 18
  3. In the Configure Drivers window, please follow the steps below.

    1. Select EtherNet/IP Driver in the drop-down menu from Available Driver Types and click Add New.

    2. In the pop-up Add New RSLinx Classic Driver window, you can use the default name and then click OK.

      ethernet ip ab 19
    3. In the pop-up Configure driver: AB_ETHIP-1 window, select the local subnet of PLC, and click OK.

      ethernet ip ab 20
    4. Go back to the Configure Drivers window, click Close.

      ethernet ip ab 21
  4. In the Controller Organizer panel of Studio 5000, go to IO Configuration  Ethernet, click the specific CPU module, and click the RSWho icon in the toolbar.

    ethernet ip ab 22
  5. In the Who Active (RSLinx Classic) window, expand the AB_ETHIP-1 by clicking the plus (+) sign next to it, select the specific CPU module to be connected, and click Set Project Path in the lower right corner to set the path. It is set successfully if the path changes from <none> to AB_ETHIP-1\192.168.1.22. Click Close to close the window.

    ethernet ip ab 23

Install EDS file and Configure Communication

  1. In the Studio 5000 interface, go to TOOLS  EDS Hardware Installation Tool.

    ethernet ip ab 24
  2. In Rockwell Automation’s EDS Wizard window, please follow the steps below.

    1. Click Next.

      ethernet ip ab 25
    2. Select Register an EDS file(s) and then click Next.

      ethernet ip ab 26
    3. Select Register a single file then click Browse. Select the corresponding EDS file (copied from the IPC in advance) and then select Next.

      ethernet ip ab 27
    4. Click Next.

      ethernet ip ab 28
    5. Select Next to accept the default icon.

      ethernet ip ab 29
    6. Click Next.

      ethernet ip ab 30
    7. Click Finish if the message in the figure below appears.

      ethernet ip ab 31
  3. In the Controller Organizer panel of Studio 5000, go to IO Configuration  Ethernet, right-click the Ethernet, and click New Module.

    ethernet ip ab 32
    1. In the Select Module Type window, type Ixxat in the search bar, select Ixxat INpact EtherNet/IP™, and click Create.

      ethernet ip ab 33
    2. In the New Module window, click the General tab and enter the name MM_Camera (the name cannot be changed as it needs to be consistent with the example name). Set the IP address of the vision system slave device. The IP address set in this example is 192.168.1.10, which should be the same as the IP address set in HMS IPConfig. Click Change.

      ethernet ip ab 34

      A window will pop up as shown below, modify the Size type as INT, and click OK.

      ethernet ip ab 35

      Click Yes if the message shown below appears.

      ethernet ip ab 36

      Go back to the New Module window, click OK.

    3. All the steps are completed, and the device Ixxat INpact EtherNet/IP™ MM_Camera has been successfully added to the Ethernet as shown below. In the Select Module Type window, click close.

      ethernet ip ab 37

Import Example Program and Download to PLC

Import Example Programs

Before you add the example program to a project already in use, it is recommended to import it to a new project and test it first.
  1. In the menu bar of Studio 5000, go to FILE  Import Component  Add-On Instruction.

    ethernet ip ab 38

    In the pop-up Import Add-On Instruction window, select the example program MM EtherNet IP Interface Program.L5X (which should be copied from the IPC in advance), and click Open.

    ethernet ip ab 39

    Click OK in the pop-up window as shown below.

    ethernet ip ab 40
  2. In the menu bar, go to FILE  Import Component  Routine.

    ethernet ip ab 41

    In the pop-up Import Routine window, select CameraSignalsMove.L5X file (which should be copied from the IPC in advance), and click Open.

    ethernet ip ab 42

    Click OK in the pop-up window as shown below.

    ethernet ip ab 43
  3. Follow the previous step and import the CameraTest.L5X file (which should be copied from the IPC in advance) into the project.

    ethernet ip ab 44

Download PLC Program to PLC

  1. In the Studio 5000 interface, go to Tasks  MainTask  MainProgram, and double-click MainRoutine to open the main program.

    ethernet ip ab 45

    Select Rung 0, go to Program Control  JSR in the toolbar, and call the CameraSignalsMove program.

    ethernet ip ab 46

    Select Rung 0, right-click, and select “Copy Rung” in the context menu. Select Rung End, right-click, and select “Paste” in the context menu to add a new line Rung 1, and change the JSR to CameraTest.

    ethernet ip ab 47
  2. Click the drop-down menu from offline and select Download.

    ethernet ip ab 48

    Click Download in the pop-up window as shown below.

    ethernet ip ab 49
  3. After downloading successfully, an alert message as shown below will pop up. If the system safety can be ensured, select Yes.

    ethernet ip ab 50

    The controller is in the Rem Run (remote run) mode.

    ethernet ip ab 51

Check Communication

  1. In the Studio 5000 interface, go to Tasks  MainTask  MainProgram, and double-click CameraSignalsMove to open the main program.

    ethernet ip ab 52

    If the connection is established successfully, the monitor value of FromCamera.HEARTBEAT in Rung 21 will keep changing.

    ethernet ip ab 53
  2. The PLC is successfully connected if the following message is displayed in the Console tab of Mech-Vision Log panel: Connect to ETHERNET IP controller successfully. If you don’t see this log message, please check:

    1. If the hardware is properly connected;

    2. If the Interface Service has been started successfully in Mech-Vision;

    3. If the PLC program has been successfully downloaded to the PLC.

Test with Mech-Vision/Mech-Viz Project

This section introduces how to use the example program function block to trigger the Mech-Vision project to obtain vision points and trigger the Mech-Viz project to obtain the planned path.

Prerequisites

  1. Mech-Vision project(s): Right-click the solution and select Autoload Solution. Projects in the solution are also autoloaded. Meanwhile, the project number will show up before each project name.

  2. Mech-Viz project: Right-click the project name in Resources of Mech-Viz and select Autoload Project.

    The Mech-Viz project used for testing should contain a “Branch by Msg” Step that has been renamed to 1 as shown below.

    ethernet ip ab 54

Run Mech-Vision Project and Obtain Vision Points

Configure Parameters

  1. In the Studio 5000 interface, double-click the program body of CameraTest, and set the status of ToCamera.COM_ENABLE to be always on.

    ethernet ip ab 55
  2. In the Rung 3 of the CameraTest program, set the values as shown below.

    1. Set the value of Vision_Proj_Num to 1, then project No. 1 in Mech-Vision will be started.

    2. Set the value of Req_Pose_Num to 0, which means the Mech-Vision project will send all the vision points.

    3. Setting the value of Robot_Pose_Type to 0 indicates that the project is in eye-to-hand mode, and the image-capturing pose is not needed.

      ethernet ip ab 56

Trigger Mech-Vision Project to Run

  1. In the Rung 3 of the CameraTest program, set the value of Camera_User.Step_Num to 5. Click the Camera_User.Start_Vis label of MM_Start_Vis and modify the value to 1 to trigger the Mech-Vision project to run. Then reset the value to 0.

    ethernet ip ab 57
  2. Check whether the returned value of STATUS_CODE is 1102.

    1. Click the Watch tab in the status bar to open the Watch window, and add the FromCamera label in the Name column.

      ethernet ip ab 58
    2. Expand the levels and check the returned value of STATUS_CODE.

      ethernet ip ab 59
      If the Mech-Vision project is started successfully, the status code 1102 will be returned. Otherwise, the corresponding error code will be returned. Please refer to Status Codes and Troubleshooting for troubleshooting.

Obtain Vision Points from Mech-Vision

  1. After the STATUS_CODE 1102 is returned, in the Rung 4 of the CameraTest program, modify the value of Camera_User.Step_Num to 10. Click Camera_User.Get_VisData label of MM_Get_VisData and modify the value to 1 to trigger the Mech-Vision project to run. Then reset the value to 0.

    ethernet ip ab 60
  2. Check the returned value of STATUS_CODE in the Watch window.

    ethernet ip ab 61
    If the vision points are obtained successfully, the status code 1100 will be returned. Otherwise, the corresponding error code will be returned. Please refer to Status Codes and Troubleshooting for troubleshooting.
  3. Check the returned value of Target_Pose.

    1. Add the Target_Pose label in the Name column of the Watch window.

      ethernet ip ab 62
    2. Expand the levels and check the returned values of Target_Pose. The example in the figure below received 2 poses. Divide the transferred values by 10000 to obtain the actual pose data.

      ethernet ip ab 63

Automate the Process of Getting Vision Result from Mech-Vision

The previous section introduces how to manually obtain vision results from Mech-Vision. To automate the process of obtaining vision results from Mech-Vision, connect the programs as the following example.

ethernet ip ab 77
ethernet ip ab 78
ethernet ip ab 79
ethernet ip ab 80

Run Mech-Viz Project and Obtain Planned Path

Configure Parameters

  1. In the Rung 14 of the CameraTest program, set the value of Camera_User.Step_Num to 50. Click the Camera_User.Start_Empty label of MM_Empty_Target and modify the value to 1 to clear the previously obtained vision result. Then reset the value to 0.

    ethernet ip ab 64

    Check the value of Target_Pose after the vision result is cleared in the Watch window.

    ethernet ip ab 65
  2. In the Rung 10 of the CameraTest program, set the value of Branch_Name to 1, and the project will execute along the Branch by Msg Step whose Step ID is 1.

  3. In the Rung 10 of the CameraTest program, set the value of Branch_Exit_Port to 1, and the Mech-Viz project will take exit port 1 for the Branch by Msg Step whose Step ID is 1.

    ethernet ip ab 66
  4. In the Rung 11 of the CameraTest program, set the value of Request_Pose_Type to 1, and Mech-Viz will send data as joint positions.

    ethernet ip ab 67

Trigger Mech-Viz Project to Run

  1. In the Rung 7 of the CameraTest program, set the value of Camera_User.Step_Num to 20. Click the Camera_User.Start_Viz label of MM_Start_Viz and modify the value to 1 to trigger the Mech-Viz project to run. Then reset the value to 0.

    ethernet ip ab 68
  2. Check the returned value of STATUS_CODE in the Watch window.

    ethernet ip ab 69
    If the Mech-Viz project is started successfully, the status code 2103 will be returned. Otherwise, the corresponding error code will be returned. Please refer to Status Codes and Troubleshooting for troubleshooting.

Set Mech-Viz Branch Exit Port

  1. In the Rung 10 of the CameraTest program, set the value of Camera_User.Step_Num to 30. Click the Camera_User.Set_Branch label of MM_Set_Branch and modify the value to 1 to select the exit port of the branch. Then reset the value to 0.

    ethernet ip ab 70
  2. Check the returned value of STATUS_CODE in the Watch window.

    ethernet ip ab 71
    If the branch is set successfully, the status code 2105 will be returned. Otherwise, the corresponding error code will be returned. Please refer to Status Codes and Troubleshooting for troubleshooting.

Obtain Mech-Viz Planned Path

  1. In the Rung 11 of the CameraTest program, set the value of Camera_User.Step_Num to 35. Click the Camera_User.Get_VizData label of MM_Get_VizData and modify the value to 1 to get the planned path from Mech-Viz. Then reset the value to 0.

    ethernet ip ab 72

    You can see the value of Send_Pose_Num is 9 in the above figure, which indicates that 9 sets of joint positions are obtained in this example program.

  2. Check the returned value of STATUS_CODE in the Watch window.

    ethernet ip ab 73
    If the planned path is obtained successfully, the status code 2100 will be returned. Otherwise, the corresponding error code will be returned. Please refer to Status Codes and Troubleshooting for troubleshooting.
  3. Check the returned values of Target_Pose in the Watch window. Divide the transferred values by 10000 to obtain the actual pose data.

    ethernet ip ab 74
    ethernet ip ab 75
    ethernet ip ab 76

Automate the Process of Getting Planned Path from Mech-Viz

The previous section introduces how to manually obtain the planned path from Mech-Viz. To automate the process of obtaining the planned path from Mech-Viz, connect the programs as the following example.

ethernet ip ab 81
ethernet ip ab 82
ethernet ip ab 83

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.