Communication Configuration and Example Program Usage

You are currently viewing the documentation for the latest version (2.2.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 introduces the commands for EtherNet/IP communication between an Omron NX/NJ Series PLC 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

Hardware and Software Requirements

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 you configure the software to set up the EtherNet/IP communication, click this line to view the required hardware and hardware connection settings.
  • PLC:Omron NX1P2-1040DT1。

  • * Mech-Mind Vision System IPC.

  • Switch (or router) and Ethernet cables.

The hardware connection is as follows. Each device has a unique IP address, but all must be in the same subnet and not in use by other devices. Set the IP Address of PLC

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.
  • PLC:Omron NX1P2-1040DT1。

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

  • Switch (or router) and Ethernet cables.

The hardware connection is as follows. Each device has a unique IP address, but all must be in the same subnet and not in use by other devices. IP address settings of the PLC and the PCIe interface card.

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

Sysmac Studio 1.54

OMRON PLC programming software

Computer that is used for OMRON PLC programming

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

Software that provides the Mech-Mind Vision System

IPC

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

  • ` EDS file name: 005A002B003A0100.EDS;

    The EDS file can be found in the Communication Component/Robot_Interface/EthernetIP/EDS path in the directory where Mech-Vision and Mech-Viz are installed.
  • PLC example program files:

    • MM_OMRON_NJ_NX_Lib.slr (contains MM_XXX_XXX function blocks used to implement various interface commands);

    • MM_OMRON_NJ_NX_Lib_Project.smc2 (vision system manual/automatic mode sample project).

      The files are stored in /Robot_Interface/EthernetIP/Programming Samples/Omron Sysmac Studio NXNJ PLC EthernetIP in the installation directory where ` and are installed.
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

Sysmac Studio 1.54

OMRON PLC programming software

Computer that is used for OMRON PLC programming

Communication card driver software

IPC

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

Software that provides the Mech-Mind Vision System

IPC

Used for setting up the IP address of the PCIe card

IPC

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

  • ` EDS file name: 005A002B003A0100.EDS;

    The EDS file can be found in the Communication Component/Robot_Interface/EthernetIP/EDS path in the directory where Mech-Vision and Mech-Viz are installed.
  • PLC example program files:

    • MM_OMRON_NJ_NX_Lib.slr (contains MM_XXX_XXX function blocks used to implement various interface commands);

    • MM_OMRON_NJ_NX_Lib_Project.smc2 (vision system manual/automatic mode sample project).

      The files are stored in /Robot_Interface/EthernetIP/Programming Samples/Omron Sysmac Studio NXNJ PLC EthernetIP in the installation directory where ` and are installed.

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.

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

Configure Mech-Vision and Initiate Communication

  1. Run Mech-Vision, then open "Robot Communication Configuration".

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

  3. Select Standard Interface for Interface Service Type.

  4. Protocol: select “ETHERNET IP”. By default, keep “Automatically start the interface service when the project opens” checked, then click Apply.

  5. In the Log window > Console tab, verify that “ETHERNET IP Interface Service” messages appear, and wait for the EtherNet/IP scanner (master) to establish a connection.

Configure IP address of the PCI-e Card

  1. Use an Ethernet cable to connect the network ports of the IPC and the INpact EIP Slave PCIe.

    After configuring the IP and initiating communication successfully, the Ethernet cable used here can be removed.
  2. Open HMS IPconfig, click to 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. The IP address you set must match the IP address configured in the PLC. After completing the settings, click Apply and exit the software.

PLC Project Creation and Vision Library File Reference

Create PLC Project

  1. Open Sysmac Studio, click "New Project". In the "Project Properties" window, enter the project name and select "Standard Project" for Type.

  2. Select the device type, model, and version according to the actual hardware, then click Create to enter the main software window.

  3. In the Multiview Explorer, expand Configuration and Setup > Controller Setup, 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 (e.g., 192.168.1.22/255.255.255.0 ).

    The IP addresses of the PLC, the vision slave (adapter), and the network interface of the computer on which Sysmac Studio is installed must be on the same subnet.
  5. From the menu bar, click Controller  Communications Settings, set Connection Type to “Ethernet-Hub connection,” enter the PLC address in Remote IP (e.g., 192.168.1.22), run “Ethernet Communication Test,” and confirm the test succeeds.

Import the Mech-Mind Library File

Before you add the Mech-Mind 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.
  1. From the menu bar, click Project  Library  Show Index to open the Library Index window.

  2. Click the “Create Index” icon, select the MM_OMRON_NJ_NX_Lib.slr library file, and add it.

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

Create Vision Global Variable Tag

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

  2. Create 3 global variables, and set their data types to the corresponding structures in MM_OMRON_NJ_NX_Lib.slr.

  3. Set the Network Publish attribute:

    • Set FromCamera1 to "Input";

    • Set ToCamera1 to "Output";

    • Set Camera_User1 to "Not Published".

Built-in EtherNet/IP Port Settings and Download

Tag Set Registration

  1. From the menu bar, click Tools  EtherNet/IP 连接设置 to open the EtherNet/IP Device List window.

  2. Double-click the PLC device (e.g., 192.168.1.22) to open EtherNet/IP Connection Settings.

  3. In the Tag Sets tab, click "Register All." When the "Tag Set Registration Settings" window appears, click "Register".

Install EDS File and Configure Communication

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

  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 right-hand toolbox.

  4. For Node Address, enter the same address as in HMS IPconfig (e.g., 192.168.1.10). Set Model to Ixxat INpact EtherNet/IP™, set Revision to 1, then click Add.

  5. At the bottom of the connection list, click Add, then select the newly added target device 192.168.1.10 Ixxat INpact EtherNet/IP™ Rev.1.

  6. Fill in the communication parameters per the configuration interface and ensure no “pink alarm” indications appear.

  7. After switching the project to Online mode, click "Transfer to Controller".

  8. After confirming that peripheral devices are safe, click Yes when prompted, and select “Execute Transfer to Controller in Run Mode”.

Dwnload the PLC Poject

  1. From the menu bar, click Controller  Online and confirm that the project has switched to Online mode.

  2. From the menu bar, click Controller  Transferring  Controller to transfer the project to the PLC.

  3. In the “Transfer to Controller” dialog, click Execute, and after the safety confirmation, click Yes.

  4. After the project transfer is complete, and after confirming that peripheral devices are safe, click Yes and OK prompted.

Check Communication

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

  2. Add the global variable FromCamera1 to the Watch window; if the connection is successful, you will see the FromCamera1.HEARTBEAT value changing continuously.

  3. In the Mech-Vision Log window > Console tab, verify that the message “Connected to ETHERNET/IP controller successfully” appears.

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

Test with Mech-Vision/Mech-Viz Project

This section introduces how to use the example program FB to trigger the Mech-Vision project to obtain vision points and trigger the Mech-Viz project to obtain the planned path. For detailed information on the I/O units, please refer to Command Specifications for ETHERNET/IP Communication between Omron NX/NJ PLC and Mech-Mind system.

Preparation

  1. Set up Mech-Vision project and configure it to auto-load the current project.

  2. Set up Mech-Viz project and configure it to auto-load the current project.

  3. The Mech-Viz project used for testing must include a branch task named “1”.

Run Mech-Vision Project and Obtain Vision Points

Parameter settings

  1. In the main software window, click Controller > Offline to switch the PLC project to Offline mode.

  2. In the Multiview Explorer on the left, expand Programming > POUs > Programs > Program0, then double-click Section0. The Toolbox on the right will display the vision interface library function blocks referenced by the PLC.

  3. Enable PLC–vision interaction in the program section (e.g., set ToCamera1.COMM_ENABLE).

    In the “Section0” title bar, click “Variables.” Under the “External” tab, add the three required external variables (e.g., ToCamera1, FromCamera1, and Camera_User1), and ensure their data types match the structures defined in the library file.

  4. Set the vision project number: VISION_PROJ_NUM=1, indicating that the Mech-Vision project with ID 1 in the Deployment settings will be run.

  5. Set the value of REQ_POSE_NUM to 0, which means the ` project will send all the vision points.

    Use the vision system manual mode sample in MM_OMRON_NJ_NX_Lib_Project.smc2 as a reference for programming.

Trigger Mech-Vision Project to Run

  1. Download the PLC project and switch to Online.

  2. Trigger the MM_Start_Vis input variable (e.g., set Camera_User1.Start_Vis to True, then set it back to False).

  3. Check the value returned by the variable FromCamera1.STATUS_CODE 1102 represents that the branch was selected successfully. If it is 10XX, please refer to Status Codes and Troubleshooting for troubleshooting.

Get Vision Target(s) Calculated by Mech-Vision

  1. After STATUS_CODE=1102, trigger the MM_Get_VisData input variable (e.g., set Camera_User1.Get_VisData to True, then set it back to False).

  2. Check whether the return value of FromCamera1.STATUS_CODE is 1100.

  3. SendPoseNum indicates the number of poses returned; Target_Pose stores pose data (transmitted values are the actual values multiplied by 10,000).

    To view all data in a two-dimensional array, add variables to the Watch window one by one using array index notation.

Mech-Vision Automatic Control Logic Example

Use the vision system auto mode sample in MM_OMRON_NJ_NX_Lib_Project.smc2 as a reference for programming.

Obtain Planned Path from Mech-Viz

Parameter settings

  1. In the main software window, click Controller > Offline to switch the PLC project to Offline mode.

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

  3. Trigger Mech-Viz Project to Run.

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

  5. Set REQ_POSE_TYPE=1 to return joint angle data.

    Use the vision system manual mode sample in MM_OMRON_NJ_NX_Lib_Project.smc2 as a reference for programming.

Trigger Mech-Viz Project to Run

  1. Download the PLC project and switch to Online.

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

  3. Run the Mech-Viz project with MM_Start_Viz.

  4. Check the value returned by the variable FromCamera1.STATUS_CODE 2103 represents that the branch was selected successfully. If it is 20XX, please refer to Status Codes and Troubleshooting for troubleshooting.

Set Mech-Viz Branch Exit Port

  1. Trigger MM_Set_Branch (e.g., set Camera_User1.Set_Branch to True, then set it back to False).

  2. Check whether the return value of FromCamera1.STATUS_CODE is 2105.

Obtain Planned Path from Mech-Viz

  1. Trigger MM_Get_VizData (e.g., set Camera_User1.Get_VizData to True, then set it back to False).

  2. Check whether the return value of FromCamera1.STATUS_CODE is 2100.

  3. SendPoseNum indicates the number of path points returned; the joint-angle results are stored in Camera_User1.TargetPose (transmitted values are the actual values multiplied by 10,000).

Mech-Viz Automatic Control Logic Example

Use the vision system auto mode sample in MM_OMRON_NJ_NX_Lib_Project.smc2 as a reference for programming.

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.