Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Modbus protocol file encoding method, Modbus protocol file decoding method, encoder and decoder

A coding method and file technology, applied in electrical components, digital transmission systems, bus networks, etc., can solve problems such as reducing error probability, achieve the effect of reducing decoding complexity, reducing coding complexity, and reducing coding error probability

Active Publication Date: 2017-05-24
SHANGHAI EASTSOFT MICROELECTRONICS
View PDF3 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The technical problem solved by the present invention is to reduce the complexity in the encoding and decoding process when using the Modbus protocol communication, and reduce the error probability

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 protocol file encoding method, Modbus protocol file decoding method, encoder and decoder
  • Modbus protocol file encoding method, Modbus protocol file decoding method, encoder and decoder
  • Modbus protocol file encoding method, Modbus protocol file decoding method, encoder and decoder

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] In the prior art, when the PC software implements the Modbus protocol, it needs to implement corresponding encoding and decoding for each protocol. When encoding a protocol, the data required by the slave device is combined into a corresponding character array according to the protocol, and the decoding is to parse the character array output from the slave device into the data required by the PC software according to the protocol. PC software needs to combine or analyze the specific composition structure of the protocol in each encoding and decoding function, and there are many data operations in the software code, which is prone to errors.

[0040] In the embodiment of the present invention, when encoding the required parameters of the sending frame corresponding to different function codes, the required parameters of the sending frame may be firstly mapped to generate a first parameter object and stored in the first parameter dictionary. Afterwards, according to the p...

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 relates to a Modbus protocol file encoding method, a Modbus protocol file decoding method, an encoder and a decoder. The Modbus protocol file encoding method comprises the steps of acquiring a first function code and a parameter required by a corresponding transmission frame; mapping the parameter required by the transmission frame so as to generate a parameter object, and storing the parameter object in a parameter dictionary; searching a first function object corresponding to the first function code from a preset function code dictionary; reading parameter description information of the parameter required by the transmission frame from the first function object; searching the corresponding parameter object from the parameter dictionary according to the parameter description information of the parameter required by the transmission frame; determining a corresponding position of data of the parameter object in valid data of the transmission frame; and generating a transmission frame and sending the transmission frame to a slave device. According to the scheme provided by the invention, the complexity of the encoding and decoding process when a Modbus protocol is adopted in communication can be reduced, and the error probability is reduced.

Description

technical field [0001] The invention relates to the field of protocol processing, in particular to a method for encoding and decoding Modbus protocol files, an encoder and a decoder. Background technique [0002] The Modbus protocol is a common language used in electronic controllers. Through the Modbus protocol, the controllers can communicate with each other, and between the controllers and other devices via the network. [0003] Controller communication uses master-slave technology, that is, the master device initiates the query, and other slave devices make corresponding responses according to the data provided by the master device query. The Modbus communication method establishes the format of the master device query: slave device address, function code, all data to be sent and check code. The response message of the slave device is carried out by means of Modbus communication, and the response message of the slave device includes the field to confirm the action, the...

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): H04L1/00H04L12/40
Inventor 卢昊裘巍
Owner SHANGHAI EASTSOFT MICROELECTRONICS
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products