Sei sulla pagina 1di 9

Setting up Implicit Ethernet/IP messaging between an Omron PLC and Vision Builder AI

Publish Date: Nov 03, 2011

Overview
This tutorial explains how to setup an Ethernet/IP I/O connection between an Ethernet/IP enabled Omron PLC and a Vision Builder AI remote system ( Smart Camera, Embedded Vision System, or
Compact Vision System).

Table of Contents
Goal
Use the Implicit EthernetIP Messaging function of Ethernet/IP to quickly and easily share data between PLCs and Vision Builder AI systems.
Vision Builder AI targets can be configured as Ethernet/IP adapters. Part of the memory of these systems is configured as assemblies, used to share data between the Vision Builder AI system
and the PLC. The input assembly is the assembly that is the input to the PLC and where Vision Builder AI can write data to. The output assembly is the part of the Vision Builder AI memory where
the PLC can write data for Vision Builder AI to access. A Vision Builder AI inspection uses the Ethernet/IP Adapter step to read and write those assemblies.
On the PLC, you need to reserve part of the PLC memory to mirror the input assembly and output assemblies, and set up the I/O connection between the Vision Builder AI assemblies and the PLC
registers.

Table of Contents
1. Enabling the Vision Builder Ethernet/IP Server
2. Configuring the Assembly Size
3. Using the Omron Network Configurator Software to Create the Network Configuration and set up the I/O Connection
4. Testing the I/O Connection
5. Related Links

Enabling the Vision Builder Ethernet/IP Server


Launch Vision Builder AI if it is not already open. To enable the Vision Builder AI Ethernet/IP server, open the Communication Device Manager by clicking Tools>>Communication Device
Manager. Click the Start Server button next to the Ethernet/IP Server. Click OK.

Configuring the Assembly Size


By default, Vision Builder AI assemblies are 500 bytes for the input assembly and 496 bytes for the output assembly. Some PLCs do not support assemblies that large. For example, the Omron
CJ2M CPU31 version 1 only supports assembly sizes of 40 bytes.
Refer to the documentation of your PLC to verify the maximum size of the assembly it supports.
If the PLC supports assembly sizes greater than 220 bytes, use the Vision Builder AI Communication Device Manager to change the assembly size. In Vision Builder AI, select
Tools>>Communication Device Manager. Click the Configure button and change the size of the assemblies. Click OK to reboot the Ethernet/IP server with the new assembly sizes. Click OK to
close the Communication Device Manager window.
If the PLC supports assembly sizes smaller than 220 bytes, use FTP to transfer the Vision Builder.ini file located in the folder C:\VBAI on the target to your desktop.
Change the following lines of the [EthernetIP] section to set the size of the assemblies to values that are supported by your PLC.
For example:
Input_Assembly_Size = 40
Output_Assembly_Size = 40
Transfer the Vision Builder.ini file back to the target. Reboot the target.

Using the Omron Network Configurator Software to Create the Network Configuration and set up the I/O Connection
This tutorial works with any Vision Builder AI remote target. An NI Smart Camera is used in this instance.
Open the Network Configurator software to set up the I/O connection between the PLC and the Vision Builder AI target.

1/9

www.ni.com

1.

In the left pane of Network Configurator, right click and select Install

Browse to the NI Smart Camera EthernetIP Adapter.eds file attached to this application note and select Open.
Answer No to Install the Icon of NI LabVIEW Device.
2.

Select File>>Open to create a new Ethernet IP communication.

3.

Drag and drop an Omron EIP Module (for example, CJ2M-EIP21) from the Network Configurator pane to the main view.

4.

Right Click on the Module and select Change Node Address.

5.

Specify the IP address of the Module in the New IP Address field. Click OK.

6.

Drag and drop NI LabVIEW Device from the Network configurator pane to the main view.

7.

Right click on the NI LabVIEW Device and select Change Node Address.

2/9

www.ni.com

7.

Right click on the NI LabVIEW Device and select Change Node Address.

8.

Specify the IP address of the NI LabVIEW Device in the New IP Address field. Click OK.

9.

Double Click on the NI LabVIEW Device.

10. Double click on the 0002 Input Size Value and specify the same value you specified in the Vision Builder AI ini file. The default size is 500.
11. Double click on the 0003 Output Size Value and specify the same value you specified in the Vision Builder AI ini file. The default size is 496.
12. Click OK.

13. Double click on the Omron Module (CJ2M-EIP21).


14. Select the Tag Sets tab.
15. Select the In Consume tab.

16. Click Edit Tags


17. Select the In Consume Tag.
18. Click New
19. Enter D100 in the Name field, corresponding to the address where the data will be located.
20. Enter the size you specified for the Input assembly (40 for example).

3/9

www.ni.com

20. Enter the size you specified for the Input assembly (40 for example).
21. Click Regist. The tag appears in the In Consume list.
22. Click Close.

23. Select the Out Produce Tab.


24. Click New
25. Enter D200 in the Name field, corresponding to the address where the data will be located.
26. Enter the size you specified for the output assembly (40 for example).
27. Click Regist. The tag appears in the Out Produce list.
28. Click Close.

29. Click OK. You will get a message from Network Configurator saying the new tags will be registered as tag sets. Click Yes.
30. Select the D00100 tag and click the Edit button.
31. Click the Advanced button.
32. Select the Instance ID to Manual and select 101, which is the instance value used by the Input Assembly in VBAI. The default value is 101.
33. Click OK.

34. Click OK.


35. Select the Out Produce tab.

4/9

www.ni.com

35. Select the Out Produce tab.

36. Select the D00200 tag and click the Edit button.
37. Click the Advanced button.
38. Select the Instance ID to Manual and select 102, which is the instance value used by the Output Assembly in VBAI. The default value is 102.
39. Click OK.
40. Click OK.
41. Select the Connections tab.

42. Select the NI LabVIEW Device from the Unregister Device List and click the Down Arrow button to register the device.
43. Double click on the device in the Registered Device List.
44. Specify the Connection I/O Type as Consume data From / Produce Data To .

5/9

www.ni.com

44. Specify the Connection I/O Type as Consume data From / Produce Data To .
45. Select the Input Tag Set you just created from the Input Tag Set drop-down list (D00100 [40Byte]).
46. In the Target Device, Select Input_101 [40Byte] for the Output Tag Set.
47. Select the Output Tag Set you just created from the Output Tag Set drop-down list (D00200 [40Byte]).
48. In the Target Device, Select Output_102 [40Byte] for the Input Tag Set.
49. Click Regist.
50. Click Close.

51. Click OK.

Downloading the configuration to the PLC.

52. Click the Connect Icon (Ctrl+W) to connect to the network. Select the Setup Interface and click OK.

6/9

www.ni.com

53. Select the connection network port.

54. Select the Connected Network. Click OK.

55. Right click on the PLC module, and select Parameter>>Download.


56. Acknowledge the dialog.
57. Click on Download after changing to Program mode.
58. Acknowledge the dialogs.
59. Right click on the PLC module, and select Monitor.

7/9

www.ni.com

60. Verify that the Target Node Status is OK and that there are no errors in the Error History tab.
61. Click Close.
The I/O connection is now configured.

Testing the I/O Connection


To test the connection, create an inspection in Vision Builder AI that reads and writes the assemblies using the Ethernet/IP Adapter step.
After creating the inspection, launch the CX-Programmer software to verify that the data is read properly on the PLC side.
1.

Connect to the PLC.

2.

Double click on Memory in the tree located in the left pane.

3.

From the PLC Memory Window, select Monitor, from the Online menu.

8/9

www.ni.com

4.

From the Monitor Memory Areas dialog, select D, then Monitor.

5.

Type 100 in the Start Address to monitor the input assembly. You should see any value that you write in the Input Assembly from the VBAI Ethernet/IP Adapter step.

6.

Type 200 in the Start Address to go to the part of the memory you allocated for the output assembly. As you modify the values in the table, you should see the values updated by the Vision Builder
AI inspection that reads the output assembly.

Related Links
-NI Smart Cameras
-NI Compact Vision System
-NI Embedded Vision System
-NI Vision Builder for Automated Inspection
-Developer Community Tutorial: Using Vision Builder AI as an OPC Server

9/9

www.ni.com