You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

This tutorial explains how to configure platform-to-device communication by using the Modbus protocol. In the software platform, the Devices module manages communication with field devices through the Channels, Nodes, and Points by allowing stable and secure data exchange between multiple devices across different networks.

The presented concepts apply to all communication drivers. You can define multiple protocol interfaces using the abstraction layers such as Channels and Nodes. The only big difference in using one or another protocol is the syntax on the STATION and ADDRESS fields. All the configuration and testing procedures are similar for all communication protocol drivers.

Note that not all available protocols may be installed on your computer. Check the Communication Drivers page for more detailed information about what you must do if you require a device protocol not listed on your system.

On this page:


Technical Overview

All initial configurations for devices in the solutions on the software platform encompass the following workflow:

  1. Defining a Channel using a target communication Protocol. It will create the base instance for linking a Node;
  2. Defining the Node linked to the created Channel;
  3. Defining the Point that you would like to monitor.

Protocols define communication rules between the platform and devices. Channels define global parameters for the usage of a communication protocol. Nodes represent the physical field devices (like a PLC) with a unique field address (PrimaryStation). Points represent tags within a device. Additionally, AccessType defines how the device interacts with the platform (Read and Write).


Solution creation

Solutions refer to the applications developed on the software platform. Their purpose is to store all configuration information for applications. The solution saves its configuration in a file with the ".dbsln" extension. It is a database file that stores all configuration items of an application, such as Tags, Alarms, Devices configurations, graphical displays, scripts, etc. 

You open the solution file on Solution Manager and edit the solution through the Solution Designer. These interfaces allow you to manage and design your solutions on the software platform. The Solution Designer organizes engineering configurations by modules. They are on the left, in the Solution Explorer menu.

Installing the software platform is the only requirement to create a solution. Once installed, go to Solution Manager and create a new Solution to configure the device.

To create a new Solution, on the Solution Manager at the top of the solution list, click the New... button to start the New Solution Wizard:

  1. Define the Product Series for your solution by selecting the product family and the product model.
  2. Define the target platform for your solution by selecting Windows or Multi-platform.
  3. Define the name and location for saving your solution file. Then, you can select a solution template and press the Create New Solution button. Or only press the button to create. When you do this, it will create a new Solution using a blank template.

Once created, go to Solution Manager and double-click to open it in Solution Designer.

After that, you can start the device configuration by creating a Channel.


Channels configuration

Channels refer to implemented communication protocol within a solution. Their purpose is to define global parameters for the protocol usage. They group the devices that use the same protocol logically.

Creating a Solution within the software platform is the only requirement for configuring a Channel in the Devices module. 

To create a new Channel, follow the steps:

  1. On the Solution Designer, find the left menu, go to Devices, and expand it. There are two following ways to create a Device's Channel:
    1. Go to Devices → Protocols, select the desired protocol on the main grid, then click the New Channel button to open the Create New Channel dialog.
    2. Go to Devices → Channels, click the Add button on the grid's top-left to open the Create New Channel dialog.
  2. In the Create New Channel dialog:
    1. Select the Modbus Master Protocol.
    2. Choose a name for the Channel.
    3. Select the interface. For this tutorial, select TCPIP.
    4. Press the OK button to create a Channel using the selected protocol.

It will insert a new line in the Channels data grid. Some configurations are accessible through the Channels data grid, such as ProtocolOptions, Channel Settings, Timeout, and InitialState options, they are detailed in the Additional Configurations section.


Nodes configuration

Nodes refer to an individual representation of each physical device on the platform. Its purpose is to identify and address devices uniquely, allowing individual access and control.

Creating a Channel within the Solution is the only requirement for configuring a Node on the Devices module. 

To create a new Node, follow the steps:

  1. On the Solution Designer, go to Devices → Nodes, and click the Add button to open the Create New Node screen.
  2. Select the previously created channel and click OK.

It will insert a new line in the Nodes data grid.

After that, you must configure the PrimaryStation, to do this:

On the Devices → Nodes, find the column PrimaryStation. This column contains the network IP and port necessary to find the device into the network. Into the specific created Node, on the PrimaryStation cell there is a comboBox to help with this configuration.

  • IP: In this case, because we will use the simulator on the same machine as the solution, the IP can be the localhost IP: 127.0.0.1, but if you have a physical device on your network, you can use the IP from there.
  • Port: We will use the default port 502. Generally, each protocol has our default port.

The PrimaryStation configuration can change according to each protocol. 


Points configuration

Points refer to specific tags within a device, information units such as a temperature value, or an engine start command. Its purpose is to allow granular access to device data and functionalities, enabling monitoring and controlling each point.

Creating a Node within the Channel and having a tag are the only requirements for configuring a Point on the Devices module.

To create a new Point follow the steps:

  1. On the Solution Designer, go to Devices Points, click on the first line of the data grid and insert the tag name.
  2. On the Node column, select the target Node and press Enter.

It will insert a new line in the Points data grid.

Some configurations accessible through the Points data grid, such as Address, DataType, AccessType, Modifiers, Scaling, and more, are detailed in the Additional Configurations section.

Additional configurations

The additional configurations refer to settings that allow protocol fine-tuning.

 By selecting the SERIAL interface, you can configure the serial parameters for RS232/485 networks. Use TCP/IP interface to Ethernet or wireless networks. After creating the channel, using the proper TCP/IP interface, you should go to the ProtocolOptions column to define specific parameters for the protocol information that will be used:

Channels

ProtocolOptions

BlockSize: Sets the maximum number of items per group, the default value is 250.

Encoding: Determines how information is encoded/sent. To select just click the arrow next to:

Encoding options

ASCII: The message is encoded in ASCII mode, where each 8-bit byte corresponds to a message sent as two ASCII characters.

RTU: Remote Terminal Unit mode, where each 8-bit byte in a message contains two sets of 4-bit hexadecimal characters.

RTU TCP: Transmission mode by default when the message is held in Modbus TCP/IP protocol. Contains information to enable the person concerned to receive the full messages, even if these are divided into several packages. Attention: for most devices using TCP/IP networks you need to select RTU TCP as the protocol encoding.

SingleWrite: Indicates the behavior of information written with only one item. To modify this behavior, just click the arrow to the right:

SlaveID: Device slave address on Modbus network. Can be used for addresses 1-247.


Click the Settings column to fine-tune the channel options used in the statement. If you use Serial (RS232/485) or TCP/IP, that column will have different contents. Usually, you can keep the default values, and it is unnecessary to edit this column. Here is the examples of the contents for different selected interfaces.





Click the Timeout column to configure the time of transmission and reception of data packets.

Nodes


Points

Operand: Indicates the memory area. To select click the arrow to the right:

Operand options

0 Coils - Variable number of digital outputs

1 Input Status - Variable number of digital inputs

3 Input Registers - Variable number of input records

4 Holding Registers - Variable number of records

Address: Indicates the address of the data on the memory, and can range from 1-65535.

E.g.: 40001 (Operand = Holding Register, Address = 1)

30001 (Operand = Input Register, Address = 1)

01001 (Operand = Input Status , Address = 1)

00001 (Operand = Coils, Address = 1)


Modbus Protocols

The Modbus communication protocols allow data exchange between a master and a slave. The master-slave principle is a model for a communication protocol in which one device (the master) controls one or more other devices (the slaves). A standard Modbus network can have one master and many slaves. Each side uses a different protocol, which means that the master protocol defines the communication for the master and the slave protocol does the same for the slaves. Because of this, there is one protocol for the Master and another for the Slaves. Both are available on the software platform.

You can check and manage which protocols are available by clicking on the Product Series on the Solution Manager. You can check it on the Solution Designer, too. To do this, go to Devices/Protocols or Devices/Channels. Both interfaces allow you to start the device configuration by creating a channel using a target protocol.


Modbus Master Configuration

The Modbus Master protocol dynamically creates blocks based on the AccessType configurations set for each data point. It allows for selecting message encoding types such as ASCII, RTU, or RTU TCP - a combination of RTU and TCP/IP. It is worth noting that TCP/IP and UDP/IP are transport layer protocols in the OSI model.

The Modbus Master Protocol supports serial, multi-serial, and TCP/IP interfaces. It results in slight differences in some attributes for each supported interface. For example, considering the Modbus Master Protocol, the Settings column presents different parameters according to the selected communication interface. It happens on the Nodes, where the PrimaryStation settings differ according to each protocol. However, generally, the procedure is very similar, and most settings are the same.



Modbus Simulator

The Modbus Simulator is a tool for testing communication drivers. It simulates interactions between a software platform and field devices or other automation systems on a Modbus TCP/IP network. This ensures that components can communicate before deployment in a production environment.

In a Modbus network, a Channel is a communication path established by the Master to manage interactions with Nodes. The simulator enables the creation and Node configuration, allowing test network scenarios and topologies without needing a physical network.

Each node within the network represents a device or a logical entity capable of communication via the Modbus protocol. Nodes can be configured within the simulator with communication properties such as IP addresses, ports, and device IDs. This feature allows for testing of integration and communication among devices and nodes without a physical environment.

Communication test

The PrimaryStation defines the essential parameters for communication with a target device. In the context of this tutorial, the Modbus Simulator emulates a Master device in the Modbus Network.

Follow the steps to test communication:

Step 1: Run the Modbus Simulator before starting.

To run the Modbus Simulator:

On Solution Designer, use the Solution Explorer to navigate to:

A. Devices/Channels: select a Channel created using the Modbus Master Protocol;

B. Devices/Nodes: select a Node linked to the created Modbus Channel;

The Modbus Simulator button will appear on the top of the data grid. Press the button to start the simulator.

Step 2: Configure and test PrimaryStation.

To configure the PrimaryStation:

On Solution Designer, use the Solution Explorer to navigate to Devices/Nodes:

  1. Select a Node linked to a created Modbus Channel;
  2. Click the PrimaryStation cell to edit;
  3. Change the default IP address [192.168.0.1] to [127.0.0.1].
  4. Press the Test button to test.


Testing on Runtime

You can use a display to view and interact with device data to test communication with the device during the solution runtime. You can include the Test tag that will reflect the data from a Modbus device and configure a "Set Value" action for the Test tag. It will enable the manual setting of a new value to the Test tag, helping verify the communication between the Solution and the device.


Diagnostic Tools

Diagnostics tools refer to the Property Watch, Trace Window, and Module Information. These tools identify communication blocks and address errors, allow property access to pinpoint error causes, and display system messages for device management and troubleshooting, offering a comprehensive approach to device management and troubleshooting for Solutions on the software platform.

Module Information

This tool provides insights into module operations and communication channels, offering information about virtual reading groups, error codes, and communication events. It helps users identify communication blocks and effectively address errors in industrial automation systems.

Property Watch

This tool enables users to access, read, and write tags and internal properties of the system. It assists in identifying the root cause of errors through negative error codes, allowing for real-time adjustments and optimizations to the system configuration.

Trace Window

This tool displays system messages in a data grid interface, providing information about the status of reads, writes, and communication frames. It is particularly useful for various PLCs and communication protocols, as it presents invalid addresses in the configuration, assisting in device management and troubleshooting.


In this section:

The root page @parent could not be found in space v10.

  • No labels