Supercharge Your Innovation With Domain-Expert AI Agents!

Modbus communication method and device based on polling optimization strategy, terminal and medium

A technology for optimizing strategies and communication methods, applied in the field of communication, can solve problems such as reducing the overall communication efficiency, achieve the effect of shortening time consumption and improving communication performance

Inactive Publication Date: 2020-09-15
SHANGHAI YUYUAN POWER TECH CO LTD
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, due to the master-slave polling structure of Modbus communication, in the case of a large number of slave stations, once the communication of a slave station in the bus is interrupted, the master station will have to spend a lot of time to inquire and wait for the slave station to respond. thus greatly reducing the overall communication efficiency

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
  • Modbus communication method and device based on polling optimization strategy, terminal and medium
  • Modbus communication method and device based on polling optimization strategy, terminal and medium
  • Modbus communication method and device based on polling optimization strategy, terminal and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0028] Such as figure 2 As shown in FIG. 1 , a schematic flowchart of a Modbus communication method based on a polling optimization strategy in an embodiment of the present invention is shown. It should be understood that the Modbus communication method provided in this embodiment is applied to a communication master station, and the Modbus communication method mainly includes the following steps.

[0029] In step S21, a data request is sent to the current slave station in the current polling.

[0030] Specifically, the Modbus master station conducts polling visits to multiple Modbus slave stations connected to it, and the Modbus master station sends data requests to each Modbus slave station in turn in each round of polling visits, and waits for the Modbus slave stations to station's response. After visiting each Modbus slave station in this round, it means that the Modbus master station has completed this round of polling visit, so the next round of polling visit can be p...

Embodiment 2

[0045] Such as image 3 As shown, a schematic structural diagram of a Modbus communication device based on a polling optimization strategy in an embodiment of the present invention is shown. The Modbus communication device 30 of this embodiment includes a sending module 31 , a judging module 32 , a recording module 33 , an accumulating module 34 and a processing module 35 .

[0046] Sending module 31 is used for sending data request to slave station; Judging module 32 is used for judging whether slave station responds abnormally; Recording module 33 is used for recording information; Accumulating module 34 is used for accumulating record times; Make described sending module 31 send data request to current slave station; And make described judgment module 32 judge whether current slave station responds abnormally; If if respond normally, then make described sending module 31 continue to the current polling queue The next slave station sends a data request; if the response is a...

Embodiment 3

[0052] Such as Figure 4 As shown in FIG. 2 , a schematic structural diagram of another electronic terminal provided by an embodiment of the present invention is shown. The electronic terminal provided by this example includes: a processor 41, a memory 42, and a communicator 43; the memory 42 is connected to the processor 41 and the communicator 43 through a system bus and completes mutual communication, and the memory 42 is used to store computer programs and communicate The device 43 is used for communicating with other devices, and the processor 41 is used for running a computer program, so that the computer device executes the above steps of the Modbus communication method based on the polling optimization strategy.

[0053]The system bus mentioned above may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (EISA for short) bus or the like. The system bus can be divided into address bus, data bus, control bus and so o...

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 provides a Modbus communication method and device based on a polling optimization strategy, a terminal and a medium. If the master station and slave station communication is abnormal, the master station does not immediately resend the data request,, the current slave station is recorded and the data request is directly sent to the next slave station; and after the master station finishes polling for a circle, data is requested from the slave station which is recorded in the previous round and responds abnormally; if a normal response is obtained, the record is cleared and pollingis continued, and if the normal response still cannot be obtained, recording is continued and polling is continued, and the steps are repeated. Due to the fact that polling is not carried out on board any more when a communication fault occurs, but recording is carried out and polling is directly carried out to the next slave station, the time consumption of waiting for the faulty slave station by the master station is shortened, and the communication performance of the Modbus RTU bus is improved. Meanwhile, according to the technical scheme of the invention, only the message sending strategyis modified, and the specific content of the message is not changed, so that the method and device are convenient to use, and the safety of data transmission is ensured.

Description

technical field [0001] The invention relates to the technical field of communication, in particular to a Modbus communication method, device, terminal and medium based on a polling optimization strategy. Background technique [0002] The existing Modbus RTU communication protocol is usually implemented based on the 485 bus. Modbus is a master-slave question and answer type. The master station initiates an inquiry and the corresponding slave station responds. In actual use, a daisy chain structure is usually used to connect all slave stations and master stations in series for communication. [0003] However, due to the master-slave polling structure of Modbus communication, in the case of a large number of slave stations, once the communication of a slave station in the bus is interrupted, the master station will have to spend a lot of time to inquire and wait for the slave station to respond. Thereby greatly reducing the overall communication efficiency. Contents of the i...

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
Patent Type & Authority Applications(China)
IPC IPC(8): H04L12/403H04L12/40H04L12/24
CPCH04L12/40006H04L12/403H04L41/06H04L2012/40228
Inventor 尚德华徐博渊
Owner SHANGHAI YUYUAN POWER TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More