Unlock instant, AI-driven research and patent intelligence for your innovation.

Automatic MODBUS-RTU communication baud rate matching method

A technology of automatic matching and baud rate, applied in the direction of data exchange through path configuration, digital transmission system, electrical components, etc., can solve the problem of increasing labor costs for system maintenance

Inactive Publication Date: 2014-09-17
HUNAN SUPER INFORMATION
View PDF2 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] For RS-485 bus communication, the communication baud rate of devices connected to the same bus must be the same. The existing RS-485 communication baud rate settings are all set through dial-up development, software or other methods, and need to be changed. The baud rate of the bus communication must be set for each device on the bus. There may be dozens of devices on a bus, and the distance between each device is tens to hundreds of meters, possibly thousands of meters. The whole system runs In the future, if the communication is unstable and it is necessary to reduce the communication baud rate to enhance the stability of the communication, it is necessary to stop the operation of the entire bus device, set it manually by dialing code development, software or other methods, and restart it after setting For the devices on the entire bus, this process takes tens of minutes to several hours, 1. Increases the maintenance labor cost of the entire system; 2. Stopping the operation of the entire bus device for tens of minutes to several hours will bring serious consequences to the entire system

Method used

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
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Automatic MODBUS-RTU communication baud rate matching method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0011] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0012] Such as figure 1 The baud rate of the slave station and the master station are automatically matched. The following code is based on the STM32F103 chip and calls the STM32F103 library. The specific description is as follows:

[0013] / *

[0014] Slave station communication baud rate combination definition

[0015] * /

[0016] #define UART_RXBUF_DMA_LEN 300

[0017] const unsigned int ASC_Baudrate_Const[15]=

[0018] {

[0019] 9600,19000,38400,57600,93750,1115200,187500,250000,300000,500000,1000000,2000000,

[0020] 2500000

[0021]};

[0022] Unsigned char ASCRevBuf[300];

[0023] Unsigned char BaudrateInde=0;

[0024] Unsggned char ASCRevErroNum=0;

[0025] uint32_t AscDMA_Ptr=0;

[0026] / *

[0027] Serial port receiving processing (using serial port communication DMA method)

[0028] * /

[0029] void OnASC2_Event(void) ...

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 an automatic MODBUS-RTU communication baud rate matching method. The method is achieved through the steps of firstly, setting the baud rate of a serial port as the default baud rate when a slave station is powered on, waiting for receiving a serial port message on a bus, resetting the baud rate of the serial port as the agreed next baud rate of a master station and the slave station if the messages unceasingly received five times are wrong messages till a correct serial port message is received, and achieving communication with the master station with the baud rate; secondly, changing the baud rate of the master station under the normal communication condition, detecting whether the received message on the bus is correct or not in real time through the slave station, repeatedly executing the baud rate matching process if the wrong messages are unceasingly received five times till the correct message is received, judging the data format based on a MODBUS communication protocol according to whether the message received by the slave station is correct or not, and conducting verification, wherein a CRC verification code and the length of the whole message are mainly verified. By means of the method, the baud rate of the master station and the baud rate of the slave station can be automatically matched without changing bus communication or all devices arranged on the bus.

Description

technical field [0001] The invention relates to the field of industrial automatic control, in particular to the automatic matching of MODBUS-RTU communication baud rate. Background technique [0002] The MODBUS-RTU protocol is an open and widely used serial communication protocol originally developed by Modicon for its programmable controllers and industrial automation systems. It is widely used to transmit digital and analog I / O and Used when registering data, this protocol defines a message structure that controllers can recognize and use, regardless of the network through which they communicate. It describes the process of a controller requesting access to other devices, how to respond to requests from other devices, and how to detect and log errors. It formulates the public format of the message domain structure and content. On the RS-485 bus, most of them adopt the master-slave communication mode, one host, and connect multiple slave stations. The communication betwee...

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
no application Login to View More
IPC IPC(8): H04L1/00H04L12/40
Inventor 周晓峰邓君
Owner HUNAN SUPER INFORMATION