MODBUS RTU protocol based data transmission method

A data transmission method and data technology, applied in transmission systems, electrical components, etc., can solve problems such as high hardware configuration requirements, crystal oscillator accuracy errors, and large interference, and achieve low hardware configuration requirements, improved reliability, and reduced reliability. Effect

A data transmission method and data technology, applied in transmission systems, electrical components, etc., can solve problems such as high hardware configuration requirements, crystal oscillator accuracy errors, and large interference, and achieve low hardware configuration requirements, improved reliability, and reduced reliability. Effect

CN104038499AInactive Publication Date: 2014-09-10NINGBO SANXING MEDICAL & ELECTRIC CO LTD

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • MODBUS RTU protocol based data transmission method
  • MODBUS RTU protocol based data transmission method
  • MODBUS RTU protocol based data transmission method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0053] The present invention will be further described below with regard to specific embodiments.

[0054] A kind of data transmission method based on MODBUS RTU protocol of the present invention comprises the following steps:

[0055] (1), set the device address and the function code of the communication device, in the present embodiment, the device address can be any one in 0-247; The function code is 03H for reading data, 10H for preset multi-register etc., also Can have other functions.

[0056] (2), create an array for storing 485 received data in the cache or memory of the communication device, the array is represented by ring[N], where N is the maximum number of bytes of a frame of data allowed to be received; the array The size is allocated according to the size of the longest frame of data that is allowed to be received, and the data received by 485 is stored circularly in byte order; define three variables *head, *tail and *pnum in the cache or memory, where *head m...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a MODBUS RTU protocol based data transmission method. Analysis is performed on a data structure of an RTU frame to weaken the control on the interval time in a data frame, analytical judgment is performed on the integrity of frame data to achieve data sending and receiving, and accordingly the distance, crystal oscillator accuracy and outside interference is not easy to cause and accordingly the reliability of data transmission can be greatly improved and the requirements for hardware configuration of two data transmission devices can be low due to the fact that the interruption is reduced due to the increase of the reliability of the data transmission.

Description

technical field [0001] The invention relates to the technical field of communication between electric energy meters and mobile networks, in particular to a data transmission method based on the MODBUS RTU protocol. Background technique [0002] The Modbus protocol was originally developed by Modicon Corporation, which became part of the Schneider Automation Division in late 1979, and now Modbus is the world's most popular protocol in the industrial field. This protocol supports legacy RS-232, RS-422, RS-485 and Ethernet devices. [0003] The Modbus protocol includes ASCII, RTU, TCP, etc., and does not specify the physical layer. This protocol defines message structures that controllers can understand and use, regardless of the network over which they communicate. Standard Modicon controllers implement serial Modbus using RS232C. The ASCII and RTU protocols of Modbus stipulate the message, data structure, command and answering method. The data communication adopts the Mase...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
10 Sep 2014
Publication
CN104038499A
IPC
H04L29/06
Inventors
郑坚江; 章跃平