Communication Configuration and Example Program Usage

You are currently viewing the documentation for a pre-release version (2.2.0). To access documentation for other versions, click the "Switch Version" button located in the upper-right corner of the page.

■ If you're unsure about the version of the product you are using, please contact Mech-Mind Technical Support for assistance.

The following describes how to configure EtherNet/IP communication between Omron NX/NJ series PLCs and the Mech-Mind vision system.

  • When configuring the communication, do not mix the two methods. Choose only one method to complete the setup.

  • Software configuration has a longer response time compared to using the card. For projects requiring high cycle performance, it is recommended to use the PCI-e card.

    The table below compares the receiving time of two methods when the vision system sends the same vision points or waypoints. The times in the table are for reference only and may differ from the actual time consumption.

    Number of Vision Points or Waypoints Sent by the Vision System Software Configuration PCI-e Card

    1

    0.05 s

    0.04 s

    20

    1.4 s

    0.8 s

    100

    6.0 s

    2.5 s

Required Hardware and Software

The models and versions listed below are tested and can be used. For other models and versions, you may refer to this guide for operation. If any issues occur, please contact Mech-Mind Technical Support.

Hardware

If EtherNet/IP communication is implemented through software configuration, click this line to view required hardware and the hardware connection diagram.
  • PLC: Omron NX1P2-1040DT1.

  • Mech-Mind IPC.

  • Switch (or router) and Ethernet cables.

The hardware connection is shown in the following figure. The IP addresses of all devices must be different, within the same subnet, and not used by other devices. See the following sections for PLC IP address settings.

If EtherNet/IP communication is implemented through a hardware PCI-e communication card, click this line to view required hardware and the hardware connection diagram.
  • PLC: Omron NX1P2-1040DT1.

  • Mech-Mind IPC, or a host computer with the standard PCI-e communication card installed: HMS Ixxat INpact EIP Slave PCIe.

  • Switch (or router) and Ethernet cables.

The hardware connection is shown in the following figure. The IP addresses of all devices must be different, within the same subnet, and not used by other devices. See the following sections for PLC and communication-card IP address settings.

Software

If EtherNet/IP communication is implemented through software configuration, click this line to view required software.
Software Description Installation location

Sysmac Studio Standard Edition Ver.1.54

Omron PLC programming software

Computer used for Omron PLC programming

Mech-Vision and Mech-Viz software (1.5.0 or later)

Software that provides the Mech-Mind vision system

IPC

In addition, prepare the following files and copy them from the IPC to the computer where Sysmac Studio is installed.

  • Vision system EDS file: 005A002B003A0100.EDS.

    The EDS file is located in Communication Component/Robot_Interface/EthernetIP/EDS under the installation directory of Mech-Vision and Mech-Viz.
  • PLC sample files:

    • MM_OMRON_NJ_NX_Lib.slr (contains MM_XXX_XXX functions for implementing interface commands);

    • MM_OMRON_NJ_NX_Lib_Project.smc2 (sample project for manual/automatic modes of the vision system).

      The sample files are located in Robot_Interface/EthernetIP/Programming Samples/Omron Sysmac Studio NXNJ PLC EthernetIP under the Communication Component installation directory on the IPC.
If EtherNet/IP communication is implemented through a hardware PCI-e communication card, click this line to view required software.
Software Description Installation location

Sysmac Studio Standard Edition Ver.1.54

Omron PLC programming software

Computer used for Omron PLC programming

Communication card driver software

IPC

Mech-Vision and Mech-Viz software (1.5.0 or later)

Software that provides the Mech-Mind vision system

IPC

Sets the IP address of the communication card

IPC

In addition, prepare the following files and copy them from the IPC to the computer where Sysmac Studio is installed.

  • Vision system EDS file: 005A002B003A0100.EDS.

    The EDS file is located in Communication Component/Robot_Interface/EthernetIP/EDS under the installation directory of Mech-Vision and Mech-Viz.
  • PLC sample files:

    • MM_OMRON_NJ_NX_Lib.slr (contains MM_XXX_XXX functions for implementing interface commands);

    • MM_OMRON_NJ_NX_Lib_Project.smc2 (sample project for manual/automatic modes of the vision system).

      The sample files are located in Robot_Interface/EthernetIP/Programming Samples/Omron Sysmac Studio NXNJ PLC EthernetIP under the Communication Component installation directory on the IPC.

IPC Configuration and Communication Startup

Check the vision IPC communication card and driver

  1. In the PCI-e slot of the vision IPC, confirm that the INpact EIP Slave PCIe card is installed.

  2. On the IPC, right-click the Windows icon, open Device Manager, and confirm that the board driver software VCI4 INpact PCIe is installed.

Configure and start communication on the Mech-Vision side

  1. Run Mech-Vision and open Robot Communication Configuration.

  2. Select the required robot brand and model, and click Next.

  3. Select "Standard Interface" for interface service type.

  4. Select "ETHERNET IP" for protocol, keep "Automatically start interface service when the solution is opened" selected by default, and click Apply.

  5. In the log window, on the Console tab, confirm that prompts related to "ETHERNET IP interface service" appear, then wait for the EtherNet/IP scanner (master station) to establish the connection.

Set the IP address of the communication card on the vision IPC

  1. Use an Ethernet cable to connect the network port of the IPC with HMS IPconfig installed to the port of the IXXAT INpact communication card.

    After the communication card is configured and communication is successful, this temporary cable can be removed.
  2. Open HMS IPconfig, click "Scan", clear the DHCP check box, and set the card IP address and subnet mask. The configured IP address must match the IP address configured in the PLC. After configuration, click Apply and exit the software.

Create a PLC Project and Import Vision Library Files

Create a PLC project

  1. Open Sysmac Studio, click "New Project", fill in the project name in the "Project Properties" window, and select "Standard Project" as the type.

  2. Select device type, model, and version based on the actual hardware, click "Create", and enter the main software window.

  3. In "Multiview Explorer", expand "Configurations and Setup/Controller Setup" in sequence, then double-click "Built-in EtherNet/IP Port Settings".

  4. On the "TCP/IP Settings" tab, select fixed IP and set the IP address and subnet mask (example: 192.168.1.22/255.255.255.0).

    The network-port IP addresses of the PLC, vision slave station, and the computer running Sysmac Studio must be in the same subnet.
  5. In the menu bar, click Controller  Communications Setup, set the connection type to "Ethernet-Hub Connection", enter the PLC address (example: 192.168.1.22) in Remote IP, run "Ethernet Communications Test", and confirm that the test succeeds.

Import Mech-Mind library files

Import and test the Mech-Mind sample files in a newly created PLC project. If you need to add them to an existing project, import and test in a new project first, then copy to the existing project.
  1. In the menu bar, click Project  Library  Show Index to open the "Library Index" window.

  2. Click the "Create Index" icon, select and add the MM_OMRON_NJ_NX_Lib.slr library file.

  3. After confirming that this library appears in the index, click OK.

Create global tags for vision communication

  1. In "Multiview Explorer", expand "Programming/Data" in sequence, double-click "Global Variables", right-click a blank area, and select "New".

  2. Create three global variables, and select the corresponding structure data types from MM_OMRON_NJ_NX_Lib.slr.

  3. Set network publish attributes:

    • Set FromCamera1 to "Input";

    • Set ToCamera1 to "Output";

    • Set Camera_User1 to "Do Not Publish".

Configure Built-in EtherNet/IP Port and Download

Register tag sets

  1. In the menu bar, click Tools  EtherNet/IP Connection Settings to open the "EtherNet/IP Device List" window.

  2. Double-click the PLC device (example: 192.168.1.22) to open "EtherNet/IP Connection Settings".

  3. On the "Tag Set" tab, click "Register All". After the "Tag Set Registration Settings" window appears, click "Register".

Install EDS file and download configuration

  1. In the "EtherNet/IP Connection Settings" window, click the "Connection" icon on the left, then click "Show EDS Library" on the Connection tab.

  2. In the "EDS Library" window, click "Install", select 005A002B003A0100.EDS, and complete the installation.

  3. Return to the "EtherNet/IP Connection Settings" window and click "Add Target Device" in the toolbox on the right.

  4. Enter the node address consistent with HMS IPconfig (example: 192.168.1.10), select model Ixxat INpact EtherNet/IP™, set revision to 1, and click "Add".

  5. Click "Add" below the connection list. For target device, select 192.168.1.10 Ixxat INpact EtherNet/IP™ Rev.1 that you just added.

  6. Fill in communication parameters according to the configuration interface, and ensure there is no "pink alarm" prompt.

  7. Switch the project to Online state, and click "Transfer to Controller".

  8. After confirming peripheral safety, click Yes as prompted, and select "Execute transfer to controller in Run mode".

Download PLC project

  1. In the menu bar, click Controller  Online and confirm the project has switched to Online.

  2. In the menu bar, click Controller  Transfer  Transfer to Controller to transfer the project to the PLC.

  3. In the "Transfer to Controller" pop-up dialog, click Execute, then click Yes after confirming safety.

  4. After project transfer is complete, click Yes and OK as prompted after confirming peripheral safety.

Check whether communication is successful

  1. In the menu bar, click View  Watch Window to open the "Watch (Project)" window.

  2. Add global variable FromCamera1 in the watch window. If the connection is successful, the heartbeat value FromCamera1.HEARTBEAT changes continuously.

  3. In the Mech-Vision log window on the Console tab, confirm that "Connected to ETHERNET IP controller successfully" appears.

    If this log does not appear, check the following: .. Hardware network connection; .. Whether interface service is enabled in Mech-Vision; .. Whether EtherNet/IP settings on the PLC side are correct.

Vision Project Test

This section describes how to use sample function blocks to trigger a Mech-Vision project and obtain vision points, and to trigger a Mech-Viz project and obtain planned paths. For IO module function descriptions, see Command descriptions for EtherNet/IP communication between Omron NX/NJ PLC and the Mech-Mind system.

Preparations

  1. Build a Mech-Vision project and set it to auto-load the current project.

  2. Build a Mech-Viz project and set it to auto-load the project.

  3. The Mech-Viz project used for testing must include a branch task whose task name is 1.

Obtain vision points from Mech-Vision

Parameter settings

  1. In the main software window, click "Controller" / "Offline" to switch the PLC project to Offline.

  2. In the Multiview Explorer on the left, expand "Programming" / "POUs" / "Programs" / "Program0" in sequence, double-click "Section0", and the Toolbox on the right shows the vision-interaction library files referenced by the PLC.

  3. Enable PLC-vision interaction in the program segment (example: set ToCamera1.COMM_ENABLE).

    In the "Section0" title box, click "Variables" and add the three external variables shown in the figure under the "External" tab (example: ToCamera1, FromCamera1, and Camera_User1), and make sure their data types are consistent with the structures defined in the library file.

  4. Set vision project ID: VISION_PROJ_NUM=1, indicating that the Mech-Vision project with deployment ID 1 will run.

  5. Set returned pose quantity: REQ_POSE_NUM=0, indicating all pose results are returned.

    Program writing can refer to the manual-mode sample of the vision system in MM_OMRON_NJ_NX_Lib_Project.smc2.

Trigger Mech-Vision project run

  1. Download the PLC project and switch to Online.

  2. Trigger the MM_Start_Vis input variable (example: set Camera_User1.Start_Vis to True and then back to False).

  3. Check whether FromCamera1.STATUS_CODE returns 1102. If it is 10XX, see Status Codes and Troubleshooting for troubleshooting.

Obtain pose results calculated by Mech-Vision

  1. After STATUS_CODE=1102, trigger the MM_Get_VisData input variable (example: set Camera_User1.Get_VisData to True and then back to False).

  2. Check whether FromCamera1.STATUS_CODE returns 1100.

  3. SendPoseNum indicates the number of returned poses, and Target_Pose stores pose data (transmitted value equals actual value multiplied by 10000).

    If you need to view all data in a 2D array, add variables one by one in the watch window by array index format.

Mech-Vision automatic control logic sample

Program writing can refer to the automatic-mode sample of the vision system in MM_OMRON_NJ_NX_Lib_Project.smc2.

Obtain planned paths from Mech-Viz

Parameter settings

  1. In the main software window, click "Controller" / "Offline" to switch the PLC project to Offline.

  2. Set to clear the previous vision result (trigger MM_Empty_Target).

  3. Set variables related to triggering the Viz project run.

  4. Set branch parameters: BranchName=1, BranchPort=1.

  5. Set REQ_POSE_TYPE=1, indicating joint-position data is returned.

    Program writing can refer to the manual-mode sample of the vision system in MM_OMRON_NJ_NX_Lib_Project.smc2.

Trigger Mech-Viz project run

  1. Download the PLC project and switch to Online.

  2. Trigger MM_Empty_Target to clear results.

  3. Trigger MM_Start_Viz to start the Mech-Viz project.

  4. Check whether FromCamera1.STATUS_CODE returns 2103. If it is 20XX, see Status Codes and Troubleshooting for troubleshooting.

Set branch exit of Mech-Viz

  1. Trigger MM_Set_Branch (example: set Camera_User1.Set_Branch to True and then reset).

  2. Check whether FromCamera1.STATUS_CODE returns 2105.

Obtain planned path of Mech-Viz

  1. Trigger MM_Get_VizData (example: set Camera_User1.Get_VizData to True and then reset).

  2. Check whether FromCamera1.STATUS_CODE returns 2100.

  3. SendPoseNum indicates the number of returned path points, and joint-position results are stored in Camera_User1.TargetPose (transmitted value equals actual value multiplied by 10000).

Mech-Viz automatic control logic sample

Program writing can refer to the automatic-mode sample of the vision system in MM_OMRON_NJ_NX_Lib_Project.smc2.

Is this page helpful?

You can give a feedback in any of the following ways:

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.