Communication Configuration and Example Program Usage

You are currently viewing the documentation for the latest version (2.1.0). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

This topic provides two methods 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.

  • Use PCI-e card.

  • Configure the software. No card required.

You should choose one of the methods to set up the communication. You cannot choose both methods.

Hardware and Software Requirements

Hardware

If you configure the software to set up the EtherNet/IP communication, click this line to view the required hardware and hardware connection settings.
  • 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

  • Network switch and Ethernet cables

ethernet ip ab 1 soft
If you use a PCI-e card to set up the EtherNet/IP communication, click this line to view the required hardware and hardware connection settings.
  • 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

ethernet ip ab 1

Software

If you configure the software to set up the EtherNet/IP communication, click this line to view the required software.
Software Description Installed location

AB PLC Studio 5000

AB PLC programming software

Computer that is used for AB PLC programming

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

Mech-Mind Vision System

IPC

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

  • Software EIP.eds file, which is used to provide the identity information of the IPC in the EtherNet/IP network.

    The Software EIP.eds file can be found in the Communication Component/Robot_Interface/EthernetIP path in the 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 features of various interface functions

      The example program files are stored in the folder where Mech-Vision & Mech-Viz are installed: Communication Component/Robot_Interface/EthernetIP/Programming Samples/AB PLC EthernetIP.
If you use a PCI-e card to set up the EtherNet/IP communication, click this line to view the required 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: 2.0.0 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:

  • 005A002B003A0100.EDS file, which is used to provide the identity information of the IPC in the EtherNet/IP network.

    The 005A002B003A0100.EDS file can be found in the Communication Component/Robot_Interface/EthernetIP path in the 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 features of various interface functions

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

Configure Communication

If you configure the software to set up the EtherNet/IP communication, click this line to view the detailed operations.
  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 section, set Interface service type to Standard Interface, set Protocol to ETHERNET IP (Software), and set Network Adapters and IP Address to the network adapter and IP address used by the IPC.

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

    4. Click Apply.

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

    interface service
If you use a PCI-e card to set up the EtherNet/IP communication, click this line to view the detailed operations.

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

Ensure the interface service has been enabled before proceeding with the following operations.
  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 [Enable BOOTP/DHCP] Command successful will be displayed in the status bar below.

    ethernet ip ab 15

    Power off and restart the PLC, restart BootP DHCP EtherNet/IP Commissioning Tool (without saving configuration files), and then wait for the MAC address of the PLC to be displayed in the Discovery History section. Double-click the MAC address, change the IP address of the PLC in the pop-up window, and then click OK. The address used in the following figure is provided for reference only.

    ethernet ip ab 15 1

    If the preceding configurations are complete, the Sent 192.168.1.22 to Ethernet address 5C:88:16:D6:BF:C0 message will be displayed in the status bar and the configured PLC address will be displayed in the Discovery History section.

    ethernet ip ab 15 2

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

  6. Select the MAC address in the Entered Relations section and click Disable BOOTP/DHCP to disable the BOOTP feature. 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.

      • Location: Communication Component/Robot_Interface/EthernetIP in the installation directory where Mech-Vision and Mech-Viz are installed.

      • If you configure the software to set up the EtherNet/IP communication, select the Software EIP.eds file. If you use a PCI-e card to set up the EtherNet/IP communication, select the 005A002B003A0100.EDS file. In this example, the 005A002B003A0100.EDS file is selected.

      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 above section describes how to manually obtain the vision result from Mech-Vision. To allow the vision result to be automatically obtained from Mech-Vision, see Example 1: MM_S1_Vis_Basic.

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 above section describes how to manually obtain the planned path from Mech-Viz. To allow the planed path to be automatically obtained from Mech-Viz, see Example 5: MM_S5_Viz_SetBranch.

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.