Introduction:
In this post, we will explore how to use " ODVA EtherNet/IP Server" driver to facilitate data transfer between your HMI and other systems. We’ll walk through utilizing Macros to execute the data transfer and setting up objects to visually display the data.
Software Version:
EasyBuilder Pro 6.05.01+
Related Tutorials:
Instructions
-
Navigate to the System Parameters Settings within the Home tab.
-
Within the Device tab of the system parameter settings click the New Device/Server… button to proceed:
-
Select the Device Type drop-down list and add the ODVA EtherNet/IP Server driver. Choose a name for the device and click OK to save the settings:
-
In the System Parameter Settings, we also need to configure our tags. Click the Tag Manager… button to proceed:
-
Within Tag Manager select Add…:
-
Next, apply the desired CIP (Class, Instance, Attribute) path number. For this demo, we will use “1, 1, 1”. Additionally, assign a tag name and specify the data type. For this demonstration, we will use a BOOL:
-
Next, we will create a Macro to transfer the data from HMI memory to the ODVA server. In the Project tab, select Macro.
-
Within the Macro Manager select New… to create a new macro:
-
In the macro workspace, we will enable the Periodical Execution option and set it to run every second. This will ensure that the HMI updates the server data regularly. We will also utilize the GET/SET function to interact with pre-built functions that facilitate the data transfer:
-
Within this demonstration, we will declare a Boolean variable called “Signal” to which will serve as placeholder allowing us to transfer data:
-
Next, we will set up our Get Data and Set Data functions to move data from HMI memory to server memory. To get the data from HMI memory, set the Function Name to GetData and the Variable to signal, the Boolean we defined earlier. In this demonstration, we will set the read address to LB-0 and assign a toggle switch to this address in later steps. Click OK to add the GetData function:
Note: Usually data transferred to the server will come from an external device not HMI memory.
-
Select the [Enter] key to move your cursor to the next lin. We will repeat step 11, but this time add a SetData statement instead. In the GET/SET FN… API, set the Function Name to SetData and define the variable as signal. In the Write section, set the Device to ODVA EtherNet/IP Server and assign the Tag to the tag configured earlier. Click OK to add the SetData function:
-
At this point the macro should appear as shown:
-
Select [Save & Compile] and click “Exit” to close the finished macro. Now, we will setup objects to interact with the Boolean transfer value. In the Object tab, select the Toggle Switch button:
-
In the Toggle Switch settings, set the Read/Write device to Local HMI and the Address to LB-0. Then, click OK to place the object:
-
[Optional] I will also set up a bit lamp object to visualize the EtherNet/IP server tag that we created in step 6. In the Object tab, select Bit Lamp. In the Read section, set the Device to the ODVA EtherNet/IP Server driver and assign the appropriate Tag:
Note: To optimize HMI performance, please remove any UI objects addressed to the server after testing.
-
When you download the application to the HMI, the Boolean value from the toggle switch will be transferred to server memory allowing EtherNet/IP clients to access this data: