The main objective is to guide the configuration of the BluePlant supervisory system for communication with Nexto Series PLCs via the MODBUS TCP/IP protocol.
For a complete understanding of the equipment operation, it is recommended to consult the product manuals. The same recommendation applies if it is necessary to modify the proposed architecture as an example.
In this document, a reference architecture is adopted, of the point-to-point type with one Master and one Slave. This architecture is not fixed but only an example for application development.
Items Used in the Application:
Programmable Controller: NX3010
Rack Chassis: NX9001
Power Supply: NX8000
PLC Programming Cable: Network cable
PLC Programming Software: MasterTool IEC XE
Supervisory Creation Software: BluePlant
1. Program Creation
• First, install the MasterTool IEC XE and BluePlant programs.
They are available for download at www.altus.com.br.
• Minimum Installation Requirements:
? Platform: PC with Windows XP® (32-bit), Windows Vista® (32-bit), or
Windows 7® (32-bit).
? Processor: Intel Core 2 Duo 1.66 GHz (minimum)
? Disk Space: 1 GB (minimum), 2 GB (recommended)
? RAM: 2 GB (minimum), 3 GB (recommended)
? Resolution: 1024x768 (recommended)
? Language: Any language
• Necessary information about installing MasterTool IEC XE can be found in the MasterTool IEC XE User Manual (MU299048).
• Open MasterTool IEC XE.
• In the window that opens, go to File->New Project
• In the New Project window, under Templates choose Standard MasterTool Project.
• In the Name field, choose a name for the project.
• In the Path field, specify the location where it will be saved.
In the next window select:
• CPU Model: NX3010
• Rack Model: NX9001
• Power Supply Model: NX8000, click Next.
• In the next window select the desired profile; for this application the Simple profile is most suitable.
• Also select the programming language; in this example we will use Ladder.
• Click Next.
In the next window that appears, select the programming language for the program (MainPrg) associated with the Main Task. Select Ladder.
• Click Finish.
• MasterTool will execute the routine to start the Program.
• At the end of this process, MasterTool will present the workspace to the user:
•Where:
-Device Tree: In the Devices window you can access the Hardware Architecture and its Configuration in Configuration (Bus). You can also access the Application Program components in Application.
- Bus Configuration: This window displays all modules in the Rack, also used to add or remove modules from the bus.
- Messages: pre-compile, compile, assemble, send messages, etc., commands are shown in this window. Click on the Message View Commands item for more details.
- Product Library: During the "Bus Configuration" view, you can access all Nexto Series products to add them to the bus in this window.
2. Configuring the MODBUS Relationship
• When opening the new project, the first step is to configure the MODBUS relationship.
• In the project treeview, right-click on NET1,
as shown in the following image,
and click Add Device:
• The following window will open:
• On this screen, you select whether the CPU's NET1 will be Client or MODBUS Server.
• In the tutorial, we use the NEXTO as Server ("slave").
• Simply click on the MODBUS Server tab, select the MODBUS Server protocol, click Add, and then Close.
• After selecting the protocol, it will appear in the Devices window associated with the NET1 port.
• Double-click on MODBUS_Server and the MODBUS configuration window will open.
3. Adding the MODBUS Relationship
• The following window will open:
• Keep the TCP protocol selected.
• Click Add.
• Click the Add button to add the Modbus relationship.
• The following window will open:
• At this point, you choose the type of relationship that will be read or written by the Client.
• In this tutorial, a mapping of Holding Register and one of Coil was used.
• Press OK.
• The following window will appear showing that the relationship was added.
• Where:
• Initial Data Address: refers to the starting MODBUS address of the relationship.
• Data Size: number of data items used by Mtool IEC XE in the relationship.
• IEC Variable: variables used by Mastertool IEC XE to handle the values of the relationship. Use %QX0.0 for Coil (related to the first output octet) and %QW10 for Holding Register.
• Below is the figure of the relationship used in the tutorial.
• Note that each WORD occupies two %QW positions in Nexto and 1 MODBUS address, while each REAL occupies 4 %QD positions in Nexto and 2 MODBUS addresses each.
• We will use 2 WORDS and 2 REAL, therefore, 6 MODBUS registers.
4. Configuring the Communication Port
• After configuring the relationship, open the ethernet port configuration by double-clicking
on NET1.
• The following window will open:
• In this window, the IP address of the communication port is configured.
• In the example, the configuration shown in the image below was used.
• Where:
• IP Address: address of the CPU's NET1 port on the network.
5. Inserting the Programming
• The programming logic must be done in MainPrg(PRG) according to the desired behavior.
• After declaring the variables, the window will look like this:
•The syntax is as follows:
//COMMENT: WORD type variables assigned to variables related to the Holding
Registers of the MODBUS Server relationship
mb1 AT %QW10: WORD;
mb2 AT %QW12: WORD;
//COMMENT: BOOL type variables assigned to variables related to the Coils of the
MODBUS Server relationship
mb3 AT %QX0.0: BOOL;
mb4 AT %QX0.1: BOOL;
//COMMENT: REAL type variables assigned to variables related to the Holding
Registers of the MODBUS Server relationship
mb5 AT %QD14: REAL;
mb6 AT %QD18: REAL;
6. Sending the Program to the CPU
• To send the program, read the tutorial that explains how to connect Nexto to the computer, linked below:
Nexto Series - How to Connect the Computer to Nexto
7. Putting the Application in RUN
• With the program sent, we must run the application; to do this, go to the main Menu and select Debug-> Start.
8. Creating a Project in BluePlant
Creating a New Project
• Open the BluePlant software.
• The following window will open:
• Click New Project and the window to create a new project will open, as shown in the
figure below.
Where:
• Name: Project name;
• Description: Project description (optional);
• Location: Directory where the project will be saved;
• Product Family: Software version used (Express was used in the tutorial);
• Product Model: Maximum Communication Points for the current license;
• Target Framework: Framework used;
• Culture Info: Language used by the project;
• Default Code: Default language for project development;
• Default Desktop Resolution: Graphical resolution of the project pages.
• After filling in the data (as shown in the previous image), click Create New Project.
• After configuring the project, the editing software will open:
9. Creating the TAGs
• To create TAGs go to the menu Edit -> Tags. As shown in the figure below:
• The TAG editing window will open.
• In this window, you can observe that there are 4 (four) tab options:
• The main settings for the Objects tab are shown in the following figure:
• Where:
• Name: Tag identifier;
• Type: Variable type;
• Array: Defines the dimension in case of a vector;
• StartValue: Initial value of the Tag;
• Retentive: Configures value retention on power off;
• Description: Detailed description of the Tag;
• To create a new Tag, click on a blank line in the Name column and type the Tag name, or click the New Tag... icon in the top toolbar.
Note:
• Types (Type) can be: Digital, AnalogInt, Text, Timer, among others,
depending on the variable read.
• If the Array column is empty, the Tag is not an Array type. Any other value "N"
characterizes an Array Tag (positions 0 through N).
• Value retention options in the Retentive column are: None (non-retentive),
ValueOnly (saves the Tag value), and Properties (saves all Tag properties).
• The final table will look similar to the following:
10. Configuring the Device
• Go to the menu Edit -> Devices.
• This option allows configuring communication protocols and data acquisition methods for the connected device(s).
• The following figure shows the tabs of the Devices option.
• In the Channels menu, the protocol is configured. The main settings are shown below:
Where:
• Name: Channel name;
• Protocol: Protocol used by the channel;
• ProtocolOptions: Specific protocol configuration;
• Interface: Communication interface for the channel;
• Settings: Interface settings;
• Timeout: Communication timeout definition;
• Description: Channel description;
11. Configuring the Device - Channels
• To create a new channel, click the Create New button.
• Select the TCPIP option under Interface.
• Click OK.
• The following window will open:
• The protocol used in the tutorial is Modbus Master TCP/IP and RS232.
• Tip: clicking the Help button gives you access to the communication driver documentation!
• In the ProtocolOptions tab, choose the block size, protocol encoding (RTU TCP), write type, and slave address.
• The window will show the configured channel as in the figure below:
12. Configuring the Device - Node
• Now the communication Node configuration will be done.
Where:
• Name: node name;
• Channel: communication channel associated with the node;
• Primary Station: primary station; IP address; port number and Slave ID (IP of Nexto's NET1);
• BackupStation: backup station; IP address; port number and Slave ID;
• Description: node description;
• Note: If a backup station is defined and a communication error occurs in the primary station, the system will automatically try communication with the backup station.
13. Configuring the Device - Points
• At this stage, the values for data acquisition and Tag mapping are configured.
•
• As per the previous table, note that the REAL variable (with decimal) needs special attention by enabling WORD SWAP in Modifiers and setting the variable type to SINGLE.
• Note that in the example, the first variable of each type is writable and the second is readable.
NOTE:
• AccessType: defines read or write behavior for the point;
• Scaling: scale conversion applied to communication.
14. Configuring the Device - AccessTypes
• This selection defines the characteristics of common access types for points in devices. Default access types are: ReadWrite, Write, and Read. New access types can be created via the Create New... button.
15. Drawing the Application
• From now on, the supervisory drawing tool will be presented using the Draw menu.
• The vertical toolbar available in the Drawing tab allows selecting a component for use in the application. The selection tool (arrow) at the top of this bar can be used to move, group, or resize components.
16. Adding Modbus Objects on the Screen
• To add a read/write object on the supervisory screen, go to the Draw menu. In the toolbar, select the Text Box object, as shown in the figure below:
• After selecting the tool, click on the supervisory screen and drag to form a dialog box, as shown in the figure below:
• To stop adding these objects, right-click.
• Double-click on the button placed on the screen and the following window will appear:
• Select the TextI/O checkbox as shown in the figure below; this will enable the settings.
• Click the " ..." button next to ObjectName and select the operand MODBUS_40001, which will look like this: (For REAL variables, just change the Format to 0.00; for WORD variables, keep it at 0)
• To place a text box without linking operands, insert the text box the same way, but instead of double-clicking and looking for an object in TextI/O, go to the object's submenu located on the right side of the supervisory screen, as shown in the figure below:
• In this submenu, you can edit the text, font, size, and other writing functions that go on the button.
• To place an object that shows the status of a BIT, open the object library and place a SWITCH.
• To assign the variable to the SWITCH, double-click on it and change the STATE field to the TAG you want to monitor.
• Repeat this process with all operands, taking care with the settings for WORD, REAL, and BIT.
• The screen will look similar to the following:
17. Running the Application (RUN)
• The following modules are available: Build (Compile), Test, Startup, and Publish. The following figure shows the options of the runtime environment.
18. Run Startup
• The Startup option runs the project in startup mode. It allows configuring startup, diagnostic tools, and modules to be initialized.
• Check the Online configuration enabled option to establish an online configuration before starting the Project. If started without this option checked, it will only be applied on the next execution.
• To execute the project, simply ensure that Nexto's NET1 port is physically connected to the same Ethernet network as the computer running the BluePlant Application (as per the Tutorial Architecture item), and communication will be established. The variables created in Nexto will be monitored on the BluePlant screen.
• NOTE: In this example, the NEXTO IP is 192.168.10.30, so the computer running the BluePlant Application must be on the same network: 192.168.10.xx
Comments
0 comments
Please sign in to leave a comment.