Rodrigo Augusto Lippi
DLG Automação LTDA
rodrigoalippi@dlg.com.br
Carlos Augusto Ribeiro
DLG Automação LTDA
carlos@dlg.com.br
Abstract
Data Acquisition System Using a Master ModBus/RTU
Proposed a data acquisition system applied to industrial networks the Protocol is ModBUs/RTU and the physical medium serial 485. The aquisitor has the characteristic ModBus/RTU master on ModBus network. The data to be stored are available in values of the slave registries ModBus in ModBus network. Any instrument be it an indicator, a controller, a sensor, and others, can be considered a slave on the network since it has available a ModBus/RTU communication port.
1-INTRODUCTION
In industrial environments there is always need for analyzing the behavior of a process through its variables, and a data acquisition system can be the solution. Also, it is very common that the devices distributed over the plant to act, measure and control be interconnected by a communication network (Modbus, Profibus, Fieldbus, etc.). Data acquisition is the process that measures an electrical or physical phenomenon such as voltage, current, temperature, frequency etc. Every data acquisition system shares a common goal in order to acquire, analyze and present the information. Data acquisition systems incorporate signals, sensors, actuators, signal conditioners, data acquisition devices and application softwares.
In industrial automation an industrial network is defined as the communication protocols used to supervise and control a given process, such as a quick and precise exchange of data between sensors, actuators, computers, programmable logic controllers (CLP) among others.
In anticipation to this market need, a new system was proposed for the acquisition of data applied to industrial networks whose protocol is the ModBUs/RTU and the physical means the serial 485.e o meio físico serial 485. The acquisitor features a ModBus/RTU master on the ModBus/RTU network.
The proposed data acquisiton system can be divided in three functional blocks. The first one is a TCP/IP block responsible for the configuration of rules of acquisition, monitoring and transference of data via dedicated software. The second is a Modbus/RTU slave block on the Modbus/RTU network. And the third a script block in the FAT32 format responsible for the storage of data in a SD micro memory card. This article will cover, in additionto an introduction to the data acquisition system, a study of the topology used in industrial networks, the protocol flexibility and reliability when delivering data to the client and case studies in Brazil´s industrial networks.
2- DATA ACQUISITOR
The data acquisitor can be divided in functional blocks for better comprehension. The main blocks are UDP, TCP/IP, Modbus/RTU Master, memory block, status indicator and CPU block.
The next items will cover the most important data acquisitor blocks.
Figure: Diagram of data acquisitor function blocks.
2- UDP Functional Block
The UDP functional block configures the TCP/IP and Modbus port communication parameters using the ethernet connection and the UDP protocol. The TCP/IP configuration parameters are the MAC address, the IP address and the MASK network.
The Modbus port configuration parameters are the network ID number, the baudrate and the timeout.
The MAC address is the physical addres of the ethernet network element. This is a fixed and single address for all network elements.
The IP address is the network identification element and it is configurable according to the network domain in use.
The network mask is used to separate as one IP the part corresponding to the public network, the subnetwork and the hosts.
The Modbus network ID is a single and configurable identifier for each slave present in the network. The ID can be configured with the 1 to 255 value band.
The baudrate is the rate, in bit per second (bps), in which the Modbus master will exchange information with the network slaves.The baudrate can be configured with the 9600bps, 19200bps, 38400bps, 57600bps and 115200bps values.
Timeout (exceeding time) is the total time that the Modbus master waits for a response from the corresponding slave, after a question in the network, before reporting a failure. The exceeding time can be configured from 0 to 9999 miliseconds.
3- TCP/IP Function Block
The proposed acquisitor may log up to four slaves in the Modbus network, this value being based on the volume of data to be acquired. A rule is associated for the acquisition of data to each slave in the network.
One of the functionalities of the TCP/IP block is configuring the acquisition rules. The rules consist of several parameters and are the slave ID in the network,the Modbus function to be used, modbus addresses band, acquisition interval, type of formatting, statistics, date, start and finish time and file name.
The ID, mentioned earlier, is the slave identification address in the Modbus network.
The type of Modbus function refers to the standard reading Modbus functions, namely:
Function 1 (Read Coil);
Function 2 (Read Discrets Inputs);
Function 3 (Read Holding Registers);
Function 4 (Read Input Registers).
The Modbus address initial and final bands refer to the addresses that will be logged on the slaves.
The acquisition interval is the time between data acquisition in seconds.
The file formatting type can be normal or encrypted. With the normal format, the user may download and visualize the formatted and visible data. With the encrypted format the user will only visualize the data with the software help to interpret the encryption.
Statistical resources can be added to the report. The data can by sampling or by samples average, and may also register each sample maximum and minimum value.
Initial and final dates and hours may be configured, as the acquisitor has a battery-powered internal calendar synchronized with the PC calendar for updating
The file name may contain up to seven characters. After the last character, the name will be automatically filled out with the “txt” extension.
The TCP/IP function block also has other functionalities like forcing the acquisition start and halt, download and upoad the configuration rules, read the calendar battery voltage, formatting the memory, synchronizing the acquisitor calendar with the PC and open, download and erase files logged in the memory.
4- Modbus/RTU Master Function Block
This is the block that executes all parameters configured on the acquisition rules. It is also responsible for publishing questions on the Modbus/RTU network and wait for a slave response. The response is received and confirmed in relation to its integrity. If the response is integral the acquisitor will send it for report, if not, the acquisitor will report a CRC error in the report. If an exceeding (timeout) occurs i.e., for any reason the slave in the network doesn´t answer, the acquisitor will report another error.
5- Memory Card Function Block
The memory card function block is responsible for issuing the entire acquisition report.
Its file system generates reports in a standard format (FAT32) compatible with a PC operational system.
The report headline registers a summary of all parameters configured in the rule and below the data are described in columns. The report parameters listed in column are index, date, hour, error, modbus address and the line CRC.
The index is a crescent number that corresponds to the number of acquisitions made for that rule.
The date column corresponds to the date of acquisition.
The hour column corresponds to the hour of acquisition.
The errror column informs if the acquisition occurred without errors (None), with integrity error (CRC) or exceeding response time (timeout).
The columns with Modbus addresses correspond to those configured in the rule and below the acquired values.
Lastly, the line CRC column guarantees the integrity of the data contained in each line of the report.
Figure: Report illustration.
6- APPLICATION SOFTWARE
The application software is a tool developed to assist the user to work with the data acquisitor.
The software uses the UDP block to configure the Modbus/RTU and TCP/IP ports and the TCP/IPblock for configuring the rules, the data acquisitor functionalities and also the data recovery.
The figure below shows the main configuration screens of the application software.
Figure: Application software main configuration screens.
7- NETWORK TOPOLOGY
The data acquisitor characteristic topology is shown on figure 3. The data acquisitor ethernet port can be connected to the ethernet network directly on the PC or through a switch. On the PC is installed the application software for data configuring and download. Its Modbus/TCP port is connected to the Modbus network and can acquire the data from up to four slaves.
After configuring the data acquisitor on the Ethernet it doesn´t have to stay connected and can be taken off the network. After collecting the data you may simply re-connect it and download the data.
Figure: Network topology
8- CONCLUSION
The characteristics described in this article, namely, the data acquisition system using a Modbus/RTU master to scan the ModBus network and record the data were outlined aiming a enabling a cost-efficient solution unlike the solutions using supervisories for quantitative and statistical analysis of the data.
ACKNOWLEDGMENTS
The authors show their appreciation to the South American Automation Associaton (ISA) for publishing this paper.
BIBLIOGRAPHY
[1] RFC 768,User Datagram Protocol (UDP), www.rfc-editor.org
[2} RFC 791, Internet Protocol (IP), www.rfc-editor.org
[3] RFC 793, Transmission Control Protocol (TCP), www.rfc-editor.org
[4] RFC 826, Address Resolution Protocol (ARP), www.rfc-editor.org
[5] RFC 862, Echo Protocol (ECHO), www.rfc-editor.org
[6] Modbus-IDA, Modbus Aplication Protocol Specification, V1.1b, www.modbus.org
[7] Microsoft Corporation, Microsoft Extensible Firmware Initiative FAT32 File System Specification, Version 1.03,
December 6, 2000.
PRACTICAL APPLICATIONS REFERENCES
Applications in sugar cookers with a ModBus/RTU with a IHM, with a data acquisitor for data collecting and a concentration probe. Usina Boca da Mata, Boca da Mata, Alagoas state.
Application in frigorific cold storage rooms with a ModBus/RTU network with a Modbus remote to acquire temperature points, a data acquisitor for data collecting. Frigorific Minerva, Barretos, SP state.
THE AUTHORS
Rodrigo Augusto Lippi
DLG Equipamentos LTDA
Rua José Batista Soares, 53 – CEP 14176 – Sertãozinho – SP
Phone: (16) 3513-7400
Email address: rodrigoalippi@dlg.com.br
Carlos Augusto Ribeiro
DLG Equipamentos LTDA
Rua José Batista Soares, 53 – CEP 14176 – Sertãozinho – SP
Phone: (16) 3513-7400
Email address: carlos@dlg.com.br
to download this article. Click here