Adding a device and MODBUS/PVD communication

Introduction

Adding a new device to the system and enabling communication with this device using the modbus protocol requires several steps. Some of them are performed only once for a given type of device and then the data is used in subsequent devices. This significantly reduces the time needed to add additional devices.

In the description, we present the way of defining Fronius devices - frequency converters used for photovoltaic systems and communication with them using the PVD application - data aggregator for the AMAGE system.

Definition of device types and parameters

In the presented case, we already have defined the types of devices we need. Let’s go to the element types view and verify what we have already added.

After going to the list of element types, we filter the list according to the selected criterion. Here we filter by the name fronius. There are two types of devices from this company.

structure define device modbus pvd 68ee5
Figure 1. List of current Fronius device types

If we would like to add another type of device with similar parameters as the existing ones, it is worth using parameter templates. Templates allow us to define groups of parameters and reuse them when defining subsequent devices.

Select the dictionary view - parameter templates from the context menu.

structure define device modbus pvd 330db
Figure 2. Checking parameter templates

Go to the view of this template - select the template named Fronius.

structure define device modbus pvd 17cb2
Figure 3. Parameter template for FRONIUS

We see the definition of all parameters. Importantly, in these parameters, in the definition data for the protocol, we have already defined the parameters for the PVD application and MODBUS communication.

structure define device modbus pvd 27138
Figure 4. Definition of modbus parameters for a parameter
To find out what parameters can be used in this field, refer to the documentation of the PVD application and individual communication modules. Depending on whether we are dealing with the MODBUS or the energy IEC-62056 protocol, the values here differ.

In the template definition we have everything correctly defined. Such a template was used in the definition of already existing types. Everything is correctly defined here and we don’t need to add/modify anything. We can go to the definition of a specific device (resource) in the system.

Adding a resource

We go to the list of resources. We can immediately filter/go to the selected group of devices. To do this, in the filter for resources, select the appropriate group from the group tree. Here we select PV Inverters and filter. Resources from this group are shown. There are already other devices in it.

structure define device modbus pvd b82c8
Figure 5. We filter the view for resources

We want to add a new device. To do this, select the (+) button on the top taskbar. The window for adding a new resource opens with the PV Inverters group already selected. We select the appropriate type of device. Here Fronius Symo 5.0-3-M.

structure define device modbus pvd 7c062
Figure 6. Adding a resource

After selecting a given type, the system automatically creates containers for the parameters of the so-called parameter settings for a given resource. When we go to the appropriate tab, these parameters already appear in the list.

structure define device modbus pvd 35bf7
Figure 7. Resource - visible parameters

We add all other properties, e.g. description, serial number, 2D/RFID identifiers. After approval, the device is defined in the system and visible in the given resource group.

Now let’s move on to configuring communication with this device. We want the system to automatically download measurements from this device using the MODBUS protocol.

MODBUS communication - PVD application

To communicate with this device, we will use the AMAGE PVD application. It is an application that can be installed on edge-computing/embedded-pc devices or on regular machines with Linux/Windows operating systems. The application is used to communicate with devices and transfer measurements to the main AMAGE system to specific parameters in resources.

More about the application, its configuration and capabilities can be found on the Documentation Portal in the User’s manuals section. All configuration parameters, installation and available communication modules are also described there.

We already have the application installed on the embedded-pc machine with the Windows-Embedded operating system. There are several instances of the PVD application running on it, each of them is responsible for communication with a different set of devices or IT systems.

In order for the PVD application to communicate with the device and send data to the central system, it needs configuration. The configuration in the JSON file format can be created manually (according to the documentation of the PVD application) or you can use the help of the mapping generator in the AMAGE application web interface. We generate mapping files in the resource view in its context menu. There we select the generation of the configuration file for the MODBUS protocol.

structure define device modbus pvd 885d5
Figure 8. Configuration generation for PVD

After generating, we get a configuration file. The file contains information about the mapping of the protocol parameters (here register, number and conversion factor of the MODBUS register) to the parameter identifier of a given resource.

structure define device modbus pvd 364f1
Figure 9. Configuration file after export

The system automatically, based on the definitions available in the parameter template, assigned the appropriate registers of the device to the appropriate identifiers of the parameters of the given device in the system. We modify this file by completing the information about the IP address of the device in the case of the MODBUS-TCP protocol. In addition, for these devices, we change the offset of addresses. This allows to define parameters of register numbers in the template in accordance with the documentation and to send the number reduced by one, so as to respond to the required shift of addresses in accordance with the communication protocol of this device.

structure define device modbus pvd f78a3
Figure 10. Configuration modification

After receiving the result file, we transfer the file to the device on which the PVD application is installed to the configuration directory of the MODBUS data provider. Details on sample screen and file locations.

structure define device modbus pvd e14c7
Figure 11. Configuration structure of Fronius/PV devices
For the proper configuration of the PVD application beyond the scope of this manual, refer to the main PVD application user manual in the Help Portal.

All we have to do is restart the PVD service and we are waiting for measurements in the system …​

structure define device modbus pvd a12f4
Figure 12. PVD Service restart

Ready. A new device was added and the PVD application was configured to download data and upload it to the central system.

In case of communication problems, first check the communication logs of the PVD application and see what problems appear there. Later, the details of communication with individual devices can be found in the AMAGE application in the configuration section for mobile devices.
The Howto is based on system version 1.17.0.2 (03.2022) and presents features that may not be available in your system. Ask AMAGE about making this functionality available.
Due to ongoing development of the system, some screens or configuration files may look slightly different, but will still retain the full functionality described here. This does not affect the core functionality described in this document.