EtherNet/IP - OMRON PLC Setup Instructions

This topic provides instructions on setting up the Standard Interface communication based on the EtherNet/IP protocol between an OMRON PLC and Mech-Mind Software Suite.

Hardware and Software Requirements

Hardware

  • OMRON PLC:

    • CJ2H-CPU6[]-EIP series

    • CJ2M-CPU3[] series

    • Other models with a CJ1W-EIP21 or CS1W-EIP21 EtherNet/IP Unit

  • USB Type A Male to Type B Male cable

  • Power supply unit

  • HMS IXXAT INpact EIP Slave PCIe interface card installed on the IPC in Mech-Mind Vision System

  • Switch

  • Ethernet cables

Attention

An CJ2H CPU65-EIP model and CJ1W-PA205R power supply unit are used in the example below. The UNIT NO. is set to 0, and the NODE No. is set to 15 (in HEX; 21 in the decimal numeral system).

Software

  • CX-Programmer V9.70

  • Mech-Mind Software Suite: 1.7.0 or above

  • VCI V4 (driver software for HMS IXXAT INpact 40 interface card)

  • HMS IPconfig software

  • Mech-Mind EDS file:

    • File name: 005A002B003A0100.EDS

    • Location: xxx\Mech-Mind Software Suite-x.x.x\Mech-Center\Robot_Interface\EthernetIP in the installation directory of Mech-Mind Software Suite

  • PLC routine files:

    • AUTOEXEC.OBJ

    • PROGRAMS.IDX

    • SYMBOLS.SYM

    • COMMENTS.CMT

    The files are stored in xxx\Mech-Mind Software Suite-x.x.x\Mech-Center\Robot_Interface\EthernetIP\Programming Samples\Omron CX-Programmer CJ2H PLC EthernetIP in the installation directory of Mech-Mind Software Suite. Please copy and paste all files to the computer with CX-Programmer installed.

Note

Connect the Mech-Mind Vision System IPC, computer with CX-Programmer installed, and PLC to the same router.

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.

    ../../../../_images/install_communication_board2.png
  2. Start the IPC, go to Start ‣ Device Manager and check if the driver software VCI4 INpact PCIe has been installed.

    ../../../../_images/device_manager2.png

Set up “Robot and Interface Configuration” in Mech-Vision

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

  2. Select Listed robot from the Select robot drop-down menu, and then click Select robot model.

  3. Select the robot model that you use, and then click Next.

  4. Select the following options and click Apply.

    • Interface Type: Standard Interface

    • Protocol: ETHERNET IP

  5. Make sure the Interface Service is started: on the toolbar of Mech-Vision, the Interface Service switch on the far right is flipped and turned to blue.

Configure IP address of the PCI-e Card

  1. Download and install HMS IPconfig software on the IPC first. Use an Ethernet cable to connect the network ports of the IPC and the INpact EIP Slave PCIe.

    Attention

    After configuring the IP and initiating communication successfully, the Ethernet cable used here can be removed.

  2. Open HMS IPconfig, click icon_scan and select Ixxat INpact EtherNet/IP(TM). Then uncheck Retrieve IP settings dynamically from a DHCP server and enter the IP address and subnet mask, as shown below. After configuration, click on Apply.

    ../../../../_images/set_ip5.png

    Attention

    The IP address should be the same as which is configured in the PLC.

Install EDS file and Configure Communication

Create PLC Project

  1. Open the CX-Programmer software, click on icon_new in the menu bar and then a Change PLC window will pop up. Select the Device Type according to the model in use, and then click on Settings. Select the CPU type in the pop-up Device Type Settings window. Click on OK to save the changes.

    ../../../../_images/create_plc_12.png
  2. Click on icon_save in the menu bar, a Save CX-Programmer File window will pop up. Select a folder to save the project file, name the file, and then click on Save.

    ../../../../_images/create_plc_22.png
  3. Click on icon_connect in the menu bar, and then select Yes in the pop-up window to connect to the PLC.

    ../../../../_images/create_plc_32.png
  4. Click on icon_program in the menu bar. Make sure that there aren’t any problems if the PLC is stopped, and then select Yes.

    ../../../../_images/create_plc_42.png
    ../../../../_images/create_plc_52.png
  5. Select IO Table and Unit Setup ‣ Open in the project workspace to open the PLC IO Table.

    ../../../../_images/create_plc_61.png
  6. Go to Built-in Port/Inner Board and select CJ2B-EIP21. Select TCP/IP in the Edit Parameters window, enter the IP address and subnet mask. Then click on Transfer[PC to Unit], select Yes in the pop-up window to transfer parameters.

    ../../../../_images/create_plc_71.png

    Note

    • The instructions in this step is based on a specific model of PLC. Please configure according to the actual PLC model you are using.

    • The last number of the IP address should be the same as the NODE No. set on the PLC.

  7. After transferring the parameters successfully, click on Close.

    ../../../../_images/create_plc_81.png
  8. Select Yes to restart the unit, and click on OK in the pop-up window.

    ../../../../_images/create_plc_91.png
    ../../../../_images/create_plc_101.png
  9. Click on OK in the Edit Parameters window to complete configuration.

Install EDS File and Configure Network

  1. Right click on CJ2B-EIP21 in the PLC IO Table, and then select Start Special Application ‣ Start with Settings Inherited.

    ../../../../_images/eds_file_11.png
  2. Select Network Configurator in the pop-up window, and click on OK to open the Untitled - Network Configurator window.

    ../../../../_images/eds_file_1_2.png
  3. Click on icon_install in the menu bar, and an Install EDS File file will pop up.

    ../../../../_images/eds_file_21.png
  4. Locate and select the EDS file and click on Open.

    ../../../../_images/eds_file_31.png

    Attention

    The EDS file is stored in the folder where Mech-Mind Software Suite is installed: xxx\Mech-Mind Software Suite-x.x.x\Mech-Center\Robot_Interface\EthernetIP. If CX-Programmer is not installed on the same IPC where Mech-Mind Software Suite is installed, you can copy and paste the EthernetIP folder to the PC with CX-Programmer installed.

  5. In the Untitled - Network Configurator panel, go to EtherNet‣ IP HardWare‣ Vendor‣ HMS Industrial Networks AB‣ Generic Device. Right click on Ixxat INpact EtherNet/IP(TM) and select Add to Network in the context menu.

    ../../../../_images/eds_file_41.png
  6. Then go to EtherNet/IP Hardware‣ Vendor‣ OMRON Corporation‣ Communications Adapter‣ CJ2B-EIP21. Right click on Rev 3 and select Add to Network in the context menu.

    ../../../../_images/eds_file_51.png
  7. In EtherNet/IP_1 window, right click on the SJ2B-EIP21 device icon, select Change Node Adress in the context menu, and then configure the IP address to 192.168.1.21.

    ../../../../_images/eds_file_61.png
    ../../../../_images/eds_file_6_1.png
  8. Right click on Mech-Mind visual device icon, select Change Node Adress in the context menu, and then configure the IP address to 192.168.1.10.

    ../../../../_images/eds_file_6_2.png
  9. Right click on Mech-Mind visual device icon, and select Property.

    ../../../../_images/eds_file_71.png
  10. In the Property window, click on I/O Information to check the I/O size, and then click on Close.

    ../../../../_images/eds_file_81.png
  11. In EtherNet/IP_1 window, double click on the CJ2B-EIP21 icon. Select Tag Sets in the pop-up Edit Device Parameters window, and then click on Edit Tags.

    ../../../../_images/eds_file_91.png
  12. Select In-Consume, and click on New. Then edit the tag according to actual situation. Click on Regist and Close.

    ../../../../_images/eds_file_9_1.png
  13. Select Out-Produce and edit the tag in the same way. Click on OK in the Edit Tags window in the end.

    ../../../../_images/eds_file_9_2.png
  14. Select Yes in the pop-up window.

    ../../../../_images/eds_file_9_3.png
  15. Select Ixxat INpact EtherNet/IP(TM) in the Unregister Device List, click on icon_down. Then double click on Ixxat INpact EtherNet/IP(TM) in the Register Device List.

    ../../../../_images/eds_file_10.png
  16. A Ixxat INpact EtherNet/IP(TM) Edit Connection window showing Input and Output will appear. Configure the tag sets as shown below. Click on Regist and Close to close the window.

    ../../../../_images/eds_file_111.png
  17. Now the tag sets will appear in the Register Device List, then click on OK.

    ../../../../_images/eds_file_12.png
  18. After the IPC is connected, a small arrow will appear as shown below.

    ../../../../_images/eds_file_13.png

Download Hardware Configuration to PLC

  1. Click on icon_connect1 in the Network Configurator window. Then select OK in the pop-up Setup Interface window.

    ../../../../_images/download_configuration_11.png
  2. Now you can see a Select Connect Network Port window. Select BackPlane‣ #0 CJ2B-EIP21‣TCP:2, and then click on OK.

    ../../../../_images/download_configuration_21.png
  3. Select Using the existing network‣ EtherN IP_1 in the Select Connected Network window and click on OK.

    ../../../../_images/download_configuration_31.png
  4. Click on icon_download in the Network Configurator window, and select Yes to start downloading parameters.

    ../../../../_images/download_configuration_41.png
  5. After the download is completed, click on OK.

    ../../../../_images/download_configuration_5.png

Check Communication

  1. In the Untitled-Network Configurator window, go to Device ‣ Monitor.

    ../../../../_images/establish_communication_12.png
  2. A Monitor Device window will appear. Click on Connection. If the connection is successful, the status indicator will be blue.

    ../../../../_images/establish_communication_21.png
  3. 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

Note

If you don’t see this log message, please check:

  • If the hardware is properly connected;

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

  • If the hardware configuration has been downloaded to the PLC.

Import Example Program and Download to PLC

Note

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. In the following steps, the project created earlier is used to import and test the example program.

Import Example Program Files

  1. Open CX-Programmer, right click on MM_Camera_CX[CJ2H] Offline and select Transfer ‣ From File.

    ../../../../_images/import_file_12.png
  2. Check Programs, Program Index, Symbols and Program comments. Then click on next to the File name under Programs, select the OBJ file, and click on Open. If other files are stored in the same folder, they will be auto filled. Click on OK in the end.

    ../../../../_images/import_file_22.png
    ../../../../_images/import_file_32.png
  3. Select OK in the pop-up window to load the example program.

    ../../../../_images/import_file_41.png

Download PLC Program

  1. Right click on MM_Camera_CX[CJ2H] Offline and select Work Online in the context menu to switch the project to monitor mode.

    ../../../../_images/build_plc_11.png
  2. Right click on MM_Camera_CX[CJ2H] Monitor Mode and select Transfer ‣ To PLC.

    ../../../../_images/build_plc_21.png
  3. Click on OK in the Download Options window.

    ../../../../_images/build_plc_31.png
  4. Click on Yes if the safety of connected devices can be ensured. Click on OK after downloading the program successfully.

    ../../../../_images/build_plc_41.png
    ../../../../_images/build_plc_5.png

Test with Mech-Vision/Mech-Viz Project

This section provides the introduction on how to run the Mech-Vision/Mech-Viz project and obtain data from the project by using the function blocks. For detailed information on the I/O units, please refer to EtherNet/IP - Omron PLC Commands.

Prerequisites

  • Mech-Vision project(s):

    • Executable

    • Set to autoload: right-click the solution and select Autoload Solution. Projects in the solution are also autoloaded.

  • Mech-Viz project:

    • Executable

    • Set to autoload: right-click the project name in Resources and select Autoload Project

    • Contains a “Branch by Msg” Step that has been renamed to 1.

Run Mech-Vision Project and Obtain Vision Points

Parameter Settings

  1. Open CX-Programmer, go to Programs ‣ NewProgram1(00) Running, double click on CameraTest, and set the condition flag of ToCamera.COM_ENABLE to be Always ON

    ../../../../_images/test_vision_12.png
  2. Set the Mech-Vision project ID according to the displayed number in the Project List panel in Mech-Vision. Set the value of VISION_PROJ_NUM to 1, then project No. 1 in Mech-Vision will be started.

  3. Set the number of vision points to be sent by Mech-Vision. Set the value of REQ_POSE_NUM to 0, which means the Mech-Vision project will send all the vision points.

    ../../../../_images/test_vision_22.png

Start Mech-Vision Project

  1. Double click on the input variable Start_Vis of the FB MM_Start_Vis. Set the value to 1 in the Set New Value window and then click on Set to start Mech-Vision project and trigger the camera to capture images. Then reset the value to 0.

    ../../../../_images/test_vision_32.png
  2. Click on icon_toggle button, locate FromCamera.STATUS_CODE in the Name column, and then check its value. 1102 represents that the Mech-Vision project was started successfully. For other values, please refer to Status Codes and Troubleshooting for the corresponding error.

    ../../../../_images/test_vision_42.png
    ../../../../_images/test_vision_52.png

Obtain Vision Points from Mech-Vision

  1. After the status code 1102 is returned, double click on the input variable Get_VisData of the FB MM_Get_VisData, and set the value to 1 in the Set New Value window and then click on Set to obtain vision points from Mech-Vision. Then reset the value to 0. The result is shown below. The value of SendPoseNum is 3, which means 3 vision points were obtained from Mech-Vision.

    ../../../../_images/test_vision_62.png
    ../../../../_images/test_vision_72.png
  2. Double click on Memory in the project workspace, and a PLC Memory window will appear.

    ../../../../_images/test_vision_5_0.png
  3. Double click on D, set the Start to 10000, click on icon_decimal, icon_2w to set the data format as signed decimal and double word, and then click on icon_monitor to start monitoring.

    ../../../../_images/test_vision_81.png

Hint

This example received 3 poses. Divide the transferred values by 10000 to obtain the actual pose data.

Run Mech-Viz Project and Obtain Planned Path

Parameter Settings

  1. Open CX-Programmer, double click on input variable Start_Empty of the FB MM_Get_VisData, set the value to 1 in the Set New Value window and then click on Set to clear the previously obtained vision data. Then reset the value to 0.

    ../../../../_images/test_viz_13.png
    ../../../../_images/test_viz_22.png
  2. Set the value of Branch_Name and Branch_Exit_Port to 1 respectively, the Mech-Viz project will proceed along exit port 1 of Step 1.

    ../../../../_images/test_viz_32.png
  3. Set the value of Request_Pose_Type to 1. This asks Mech-Viz to send joint positions (instead of TCP data).

    ../../../../_images/test_viz_42.png

Start Mech-Viz Project

  1. Double click on the input variable Start_Viz of the FB MM_Start_Viz, set the value to 1 in the Set New Value window to start Mech-Viz project and then reset it to 0.

    ../../../../_images/test_viz_52.png
  2. Check the value returned by the variable FromCamera.STATUS_CODE. 2103 represents that the Mech-Viz project was started successfully. For other values, please refer to Status Codes and Troubleshooting for the corresponding error.

    ../../../../_images/test_viz_62.png

Select Branch in the Mech-Viz Project

  1. Double click on the input variable Set_Branch of the FB MM_Set_Branch, set the value to 1 in the Set New Value window to select branch in the Mech-Viz project and then reset it to 0.

    ../../../../_images/test_viz_72.png
  2. Check the value returned by the variable FromCamera.STATUS_CODE. 2105 represents that the branch was selected successfully. For other values, please refer to Status Codes and Troubleshooting for the corresponding error.

    ../../../../_images/test_viz_82.png

Obtain Planned Path

  1. Double click on the input variable Get_VizData of the FB MM_Get_VizData, set the value to 1 in the Set New Value window to obtain planned path from Mech-Viz project and then reset it to 0.

    ../../../../_images/test_viz_92.png
  2. Check the value returned by the variable FromCamera.STATUS_CODE. 2100 represents that planned path was obtained successfully. For other values, please refer to Status Codes and Troubleshooting for the corresponding error. The result is shown in the above figure. The value of SendPoseNum is 10, which means that 10 robot poses in JPs have been obtained, and the JPs are stored in TargetPose.

    ../../../../_images/test_viz_101.png
  3. Go back to PLC Memory window, the 10 poses are shown below. Please divide the transferred values by 10000 to obtain the actual pose data.

    ../../../../_images/test_viz_112.png