Launch Vision Builder AI if it is not already open. Create a new inspection or open an existing inspection. 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.
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 2.0 only supports assembly sizes of 40 bytes, while version 2.1 and later removed this limitation.Refer to the documentation of your PLC to verify the maximum size of the assembly it supports.Use the Vision Builder AI Communication Device Manager to change the assembly size. If it is not still open, select Tools>>Communication Device Manager in Vision Build AI. Click the Configure button for the Ethernet/IP Server and change the size of the assemblies. You will also need to configure the Input and Output Registers that you wish to communicate to and from the PLC.Click OK to reboot the Ethernet/IP server with the new assembly sizes. Click OK to close the Communication Device Manager window.
Download the attached NI Vision Builder AI.eds file attached to this tutorial and open the file in a text editor. You will need to edit the input and output assembly sizes in this folder to match what you configured in the Communication Device Manager. The relevant section in the file is lines 67-82.For example, if I had set my input and output assemblies to both be 40 bytes, those lines should look like this:
Please note that not only do you need to set the assembly size to be 40 bytes, but also set the corresponding number of bits for the assembly (320 in this case).Alternatively, you can use a tool like EZ-EDS that you can download from the ODVA web site to configure the assembly size and ensure the EDS file is properly formatted.Once the EDS file is configured and saved, copy the file to the following folder:C:\Program Files (x86)\OMRON\Sysmac Studio\IODeviceProfiles\EipConnection\Eds
Open Sysmac Studio and create a new project. Configure the project name and device that you are using.Configure the EtherNet/IP settings for the PLC by going to Configuration and Setup»Controller Setup»Built-in EtherNet/IP Port Settings. Specify the IP address settings for Port 1 of the PLC controller. The IP address and subnet mask should be configured so that the PLC is on the same subnet as the Vision Builder AI computer or remote target. Next, create the variables to hold the data for the EtherNet/IP communication. Go to Programming»Data»Global Variables. Create new global variables and set the data types to match the assembly data registers that you previously configured in Vision Builder AI.Tip: Under Data>>Data Types, you can create data types that match the assembly structure defined in VBAI and set the datatype of the variable to this data type.For the sake on simplicity in this tutorial, we will set the variables to ARRAY[0..39] of BYTE, which matches what we configured in Vision Builder AI.When you create the variables in Sysmac Studio, the size needs to match assembly size that is configured in Vision Builder AI. Make sure to set Network Publish as input or output which should match how it is configured in the Ethernet/IP Assembly Configuration in Vision Builder AI.
To confirm that the connection is setup, go back to the Ethernet/IP Device List tab, right click on the port 1, and select Monitor.
If the communication is successful, the Target Node Status will be blue.If the Target Node Status is red, a communication error has occurred. Select the Connection Status tab to find the status error. You can look up the status error in the Ethernet/IP Error Code Decoder to determine why the connection is failing.If a connection has been established, click on the Watch (Table) tab icon to display the watch table.
Enter the variable name corresponding to the input assembly and verify that VBAI can write to it.Enter the variable name corresponding to the output assembly, type some number and verify that VBAI properly reads that number.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.