Communicating a Nexto CPU with a X2 HMI through ARTII protocol
This document describes how to create MasterTool IEC XE and iX Developer projects to communicate an iX Panel and a Nexto CPU through the ARTII protocol. ARTII is a protocol used by 3S in CoDeSys platform. The variables can be exported by MasterTool IEC XE and imported into the iX Developer.
The following versions were used to this feature test:
- MasterTool IEC XE 3.03 Release
- NX3005
- iX Developer 2.30
- iX T4A-EC v 6.0 build 223
Attached with the document are the zip file with the iX project and the *.project used into the MasterTool IEC XE as the xml file exported an imported during the test.
Creating a MasterTool Project
It is possible to export standard types, arrays and structs. This example will export three standard variables and one struct with 3 elements.
First of all, create a single Project, using, for example, the CPU NX3005. Before writing the code create a struct to use in the example. To do that, click the right button on "Application" and choose the option "Add Object/DUT…" on the context menu. Set the DUT "Name" as "sTest" and select the type "Struct". The following code must be typed into the DUT editor:
TYPE sTest :
STRUCT
X : INT;
Y : INT;
Z : INT;
END_STRUCT
END_TYPE
Edit the "UserPrg" POU and type the following code into this object:
PROGRAM UserPrg
VAR
X : INT;
Y : DINT;
Z : REAL;
Test : sTest;
END_VAR
X := X + 5;
Y := Y + 10;
Z := Z + 15;
Test.X := Test.X + 20;
Test.Y := Test.Y + 25;
Test.Z := Test.Z + 30;
Add a "Symbol Configuration" object by clicking on "Application" and choose the option "Add Object/Symbol configuration". The "Symbol configuration" screen will be opened empty as the following picture.
Press "Build" into this screen to see the symbol available into the project.
Choose the variables to be exported. In this case all variables declared into the UserPrg will be exported. If a struct is used, as in this example, it is necessary to select the struct members that will be exported by clicking into the members’ column.
After generating the code (command "Build/Genarate code") a XML file is created into the same project path. In this example, the project name is TestNextoARTII.project and the XML is TestNextoARTII.Device.Application.xml.
Before downloading set the right configuration for the NET1 interface and choose the Device in the Communication Settings.
Download the application and execute the "Run" command.
Creating an iX Developer Project
Create a new project using an iX panel, like the iX T4A SoftControl.
Choose the controller CoDeSys and the protocol ARTII.
After creating the project, select the option "Tags". There is a button called "Import. Press the black arrow and select "Import tags to [Contoller 1]…"
In "Filename" select the XML file created by MasterTool IEC XE and press "Import".
Press "OK" when the following screen is shown.
Select the variable(s) that will be imported.
The variables will be added to the panel "Tags".
Choose the right IP for the controller as shown in the following screen.
Create a panel screen using the "Tags" as shown in the next picture.
Select the right panel to download the HMI project.
The values are updated for the HMI and PLC as shown in the following picture.