EtherNet/IP - OMRON PLC¶
This section provides information on setting up communication between an OMRON PLC and Mech-Mind Software Suite via EtherNet/IP.
Overview¶
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 decimal numeral system).
Software¶
CX-Programmer V9.70
Mech-Mind Software Suite: Mech-Center 1.5.1 or above, Mech-Vision 1.5.0 or above, and Mech-Viz 1.5.0 or above
VCI V4 (driver software for HMS IXXAT INpact 40 interface card)
Mech-Mind EDS file:
File name: 005A002B003A0100.EDS
Location:
Mech-Mind/Mech-Center/mech_interface/EthernetIP
Example programs:
AUTOEXEC.OBJ
PROGRAMS.IDX
SYMBOLS.SYM
COMMENTS.CMT
The files are stored in
Mech-Mind/Mech-Center/mech_interface/documents/CN/欧姆龙EtherNet IP编程指南
. 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¶
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.
Start the IPC, go to
and check if the driver software VCI4 INpact PCIe has been installed.
Configure Mech-Interface in Mech-Center¶
Open Mech-Center, and click on Deployment Settings.
Go to Mech-Interface, check Use Mech-Interface and select Save to complete configurations.
. Click onClick on Start Interface in the Toolbar. Then an ETHERNET IP icon will display in the service status bar.
Configure IP address of the PCI-e Card¶
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 configurating the IP and initiating communication successfully, the Ethernet cable used here can be removed.
Open HMS IPconfig, click on 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.
Attention
The IP address should be the same as which is configured in the PLC.
Install EDS file and Configure Communication¶
Create PLC Project¶
Open the CX-Programmer software, click on 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.
Click on 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.
Click on in the menu bar, and then select Yes in the pop-up window to connect to the PLC.
Click on in the menu bar. Make sure that there aren’t any problems if the PLC is stopped, and then select Yes.
Select
in the project workspace to open the PLC IO Table.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.
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.
After transfering the parameters successfully, click on Close.
Select Yes to restart the unit, and click on OK in the pop-up window.
Click on OK in the Edit Parameters window to complete configuration.
Install EDS File and Configure Network¶
Right click on CJ2B-EIP21 in the PLC IO Table, and then select .
Select Network Configurator in the pop-up window, and click on OK to open the Untitled - Network Configurator window.
Click on in the menu bar, and an Install EDS File file will pop up.
Locate and select the EDS file and click on Open.
Attention
The EDS file is stored in the folder where Mech-Center is installed. The default path is
Mech-Mind/Mech-Center/mech_interface/ETHERNETIP
. If CX-Programmer is not installed on the same IPC where Mech-Center is installed, you can copy and paste the ETHERNETIP folder to the PC with CX-Programmer installed.In the Untitled - Network Configurator panel, go to
. Right click on Ixxat INpact EtherNet/IP(TM) and select Add to Network in the context menu.Then go to
. Right click on Rev 3 and select Add to Network in the context menu.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.
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.
Right click on Mech-Mind visual device icon, and select Property.
In the Property window, click on I/O Information to check the I/O size, and then click on Close.
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.
Select In-Consume, and click on New. Then edit the tag according to actual situation. Click on Regist and Close.
Select Out-Produce and edit the tag in the same way. Click on OK in the Edit Tags window in the end.
Select Yes in the pop-up window.
Select Ixxat INpact EtherNet/IP(TM) in the Unregister Device List, click on . Then double click on Ixxat INpact EtherNet/IP(TM) in the Register Device List.
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.
Now the tag sets will appear in the Register Device List, then click on OK.
After the IPC is connected, a small arrow will appear as shown below.
Download Hardware Configuration to PLC¶
Click on in the Network Configurator window. Then select OK in the pop-up Setup Interface window.
Now you can see a Select Connect Network Port window. Select OK.
, and then click onSelect OK.
in the Select Connected Network window and click onClick on in the Network Configurator window, and select Yes to start dowloading parameters.
After the dowload is completed, click on OK.
Check Communication¶
In the Untitled-Network Configurator window, go to
.A Monitor Device window will appear. Click on Connection. If the connection is successful, the status indicator will be blue.
The PLC is successfully connected to Mech-Center if the following message is displayed in Mech-Center Log panel:
Connect to ETHERNET IP controller successfully
Note
If you don’t see this log message, please check if:
The hardware are properly connected;
If Mech-Interface has been started by clicking on Start Interface in the Toolbar;
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¶
Open CX-Programmer, right click on MM_Camera_CX[CJ2H] Offline and select .
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.
Select OK in the pop-up window to load the example program.
Download PLC Program¶
Right click on MM_Camera_CX[CJ2H] Offline and select Work Online in the context menu to switch the project to monitor mode.
Right click on MM_Camera_CX[CJ2H] Monitor Mode and select .
Click on OK in the Download Options window.
Click on Yes if the safety of connected devices can be ensured. Click on OK after dowloading the program successfully.
Test with Mech-Vision/Mech-Viz Project¶
This section introduces how to run the Mech-Vision/Mech-Viz project and obtain data from the project using the ObtainPose FB. For detailed information on the modules, please refer to PROFINET.
Prerequisites¶
Mech-Vision project(s):
Executable
Set to autoload
The Project list in , and the order of Mech-Vision projects have been adjusted according to actual needs.
is synced by clicking on
Mech-Viz project:
Executable
Set to autoload
Contains a branch_by_service_message Task that has been renamed to 1.
Run Mech-Vision Project and Obtain Vision Points¶
Parameter Settings¶
Set the ToCamera.COM_ENABLE to be always ON.
Double click on the MOV module, set the Mech-Vision project ID the same as the one set in Deployment Settings in Mech-Center. For example, if the monitor value is changed to 1, then Mech-Vision project No. 1 in the Project list of Mech-Center will be started.
Set the number of vision points to be sent by Mech-Vision. The default value of REQ_POSE_NUM is 0, which means the Mech-Vision project will send all the vision points.
Start Mech-Vision Project¶
Open CX-Programmer, go to Set to start Mech-Vision project and trigger camera to capture images. Then reset the value to 0.
and double click on CameraTest. Double click on the input port of VisionStart in the FB ObtainPose. Set the value to 1 in the Set New Value window and then click onCheck returned status code: check the monitor value of StatusCode. 1102 represents that the Mech-Vision project was started successfully. For other values, please refer to Status Codes for the corresponding error.
Obtain Vision Points from Mech-Vision¶
After the status code 1102 is returned, double click on the input port of VisObtainStart in the FB ObtainPose, 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 as below. The value of SendPoseNum is 3, which means 3 vision points are obtained from Mech-Vision.
Double click on Memory in the project workspace, and a PLC Memory window will appear.
Double click on D, set the Start to 10000, click on , to set the data format as signed decimal and double word, and then click on to start monitoring.
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¶
Open CX-Programmer, double click on input port of Reset in the ObtainPose FB, 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.
Modify the value of D0 register, set the value of BranchName to 1.
Modify the value of D1 register, set the value of BranchPort to 1 , the Mech-Viz project will proceed along out port 1 of Task 1.
Set the value of REQ_POSE_TYPE to 1. This asks Mech-Viz to send joint positions (instead of TCP data).
Start Mech-Viz Project¶
Double click on the input port of VizStart in the ObtainPose FB, set the value to 1 in the Set New Value window to start Mech-Viz project and then reset it to 0.
If the value returned by the variable StatusCode is 2103, it represents that the Mech-Viz project was started successfully. For other values, please refer to Status Codes for the corresponding error.
Select Branch in the Mech-Viz Project¶
Double click on the input port of BranchSet in the ObtainPose FB, 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.
If the value returned by the variable StatusCode is 2105, it represents that the branch was selected successfully. For other values, please refer to Status Codes for the corresponding error.
Obtain Planned Path¶
Double click on the input port of VizObtainStart in the ObtainPose FB, 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.
If the value returned by the variable StatusCode is 2100, it represents that planned path was obtained successfully. For other values, please refer to Status Codes for the corresponding error. The value of SendPoseNum shows how many target points were received, and the target points are stored in TargetPose.
Go back to PLC Memory window, the 10 poses are shown as below. Please divide the transferred values by 10000 to obtain the actual pose data.