Communication Configuration and Example Program Usage
The following describes how to configure EtherNet/IP communication between Omron NX/NJ series PLCs and the Mech-Mind vision system.
|
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/EDSunder 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 EthernetIPunder 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/EDSunder 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 EthernetIPunder the Communication Component installation directory on the IPC.
-
IPC Configuration and Communication Startup
Check the vision IPC communication card and driver
-
In the PCI-e slot of the vision IPC, confirm that the INpact EIP Slave PCIe card is installed.
-
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
-
Run Mech-Vision and open Robot Communication Configuration.
-
Select the required robot brand and model, and click Next.
-
Select "Standard Interface" for interface service type.
-
Select "ETHERNET IP" for protocol, keep "Automatically start interface service when the solution is opened" selected by default, and click Apply.
-
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
-
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. -
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
-
Open Sysmac Studio, click "New Project", fill in the project name in the "Project Properties" window, and select "Standard Project" as the type.
-
Select device type, model, and version based on the actual hardware, click "Create", and enter the main software window.
-
In "Multiview Explorer", expand "Configurations and Setup/Controller Setup" in sequence, then double-click "Built-in EtherNet/IP Port Settings".
-
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. -
In the menu bar, click , 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. |
-
In the menu bar, click to open the "Library Index" window.
-
Click the "Create Index" icon, select and add the
MM_OMRON_NJ_NX_Lib.slrlibrary file. -
After confirming that this library appears in the index, click OK.
Create global tags for vision communication
-
In "Multiview Explorer", expand "Programming/Data" in sequence, double-click "Global Variables", right-click a blank area, and select "New".
-
Create three global variables, and select the corresponding structure data types from
MM_OMRON_NJ_NX_Lib.slr. -
Set network publish attributes:
-
Set
FromCamera1to "Input"; -
Set
ToCamera1to "Output"; -
Set
Camera_User1to "Do Not Publish".
-
Configure Built-in EtherNet/IP Port and Download
Register tag sets
-
In the menu bar, click to open the "EtherNet/IP Device List" window.
-
Double-click the PLC device (example:
192.168.1.22) to open "EtherNet/IP Connection Settings". -
On the "Tag Set" tab, click "Register All". After the "Tag Set Registration Settings" window appears, click "Register".
Install EDS file and download configuration
-
In the "EtherNet/IP Connection Settings" window, click the "Connection" icon on the left, then click "Show EDS Library" on the Connection tab.
-
In the "EDS Library" window, click "Install", select
005A002B003A0100.EDS, and complete the installation. -
Return to the "EtherNet/IP Connection Settings" window and click "Add Target Device" in the toolbox on the right.
-
Enter the node address consistent with HMS IPconfig (example:
192.168.1.10), select modelIxxat INpact EtherNet/IP™, set revision to1, and click "Add". -
Click "Add" below the connection list. For target device, select
192.168.1.10 Ixxat INpact EtherNet/IP™ Rev.1that you just added. -
Fill in communication parameters according to the configuration interface, and ensure there is no "pink alarm" prompt.
-
Switch the project to Online state, and click "Transfer to Controller".
-
After confirming peripheral safety, click Yes as prompted, and select "Execute transfer to controller in Run mode".
Download PLC project
-
In the menu bar, click and confirm the project has switched to Online.
-
In the menu bar, click to transfer the project to the PLC.
-
In the "Transfer to Controller" pop-up dialog, click Execute, then click Yes after confirming safety.
-
After project transfer is complete, click Yes and OK as prompted after confirming peripheral safety.
Check whether communication is successful
-
In the menu bar, click to open the "Watch (Project)" window.
-
Add global variable
FromCamera1in the watch window. If the connection is successful, the heartbeat valueFromCamera1.HEARTBEATchanges continuously. -
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
-
Build a Mech-Vision project and set it to auto-load the current project.
-
Build a Mech-Viz project and set it to auto-load the project.
-
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
-
In the main software window, click "Controller" / "Offline" to switch the PLC project to Offline.
-
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.
-
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, andCamera_User1), and make sure their data types are consistent with the structures defined in the library file. -
Set vision project ID:
VISION_PROJ_NUM=1, indicating that the Mech-Vision project with deployment ID 1 will run. -
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
-
Download the PLC project and switch to Online.
-
Trigger the
MM_Start_Visinput variable (example: setCamera_User1.Start_VistoTrueand then back toFalse). -
Check whether
FromCamera1.STATUS_CODEreturns1102. If it is10XX, see Status Codes and Troubleshooting for troubleshooting.
Obtain pose results calculated by Mech-Vision
-
After
STATUS_CODE=1102, trigger theMM_Get_VisDatainput variable (example: setCamera_User1.Get_VisDatatoTrueand then back toFalse). -
Check whether
FromCamera1.STATUS_CODEreturns1100. -
SendPoseNumindicates the number of returned poses, andTarget_Posestores 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.
Obtain planned paths from Mech-Viz
Parameter settings
-
In the main software window, click "Controller" / "Offline" to switch the PLC project to Offline.
-
Set to clear the previous vision result (trigger
MM_Empty_Target). -
Set variables related to triggering the Viz project run.
-
Set branch parameters:
BranchName=1,BranchPort=1. -
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
-
Download the PLC project and switch to Online.
-
Trigger
MM_Empty_Targetto clear results. -
Trigger
MM_Start_Vizto start the Mech-Viz project. -
Check whether
FromCamera1.STATUS_CODEreturns2103. If it is20XX, see Status Codes and Troubleshooting for troubleshooting.
Set branch exit of Mech-Viz
-
Trigger
MM_Set_Branch(example: setCamera_User1.Set_BranchtoTrueand then reset). -
Check whether
FromCamera1.STATUS_CODEreturns2105.
Obtain planned path of Mech-Viz
-
Trigger
MM_Get_VizData(example: setCamera_User1.Get_VizDatatoTrueand then reset). -
Check whether
FromCamera1.STATUS_CODEreturns2100. -
SendPoseNumindicates the number of returned path points, and joint-position results are stored inCamera_User1.TargetPose(transmitted value equals actual value multiplied by 10000).