CN112765083A - RS 232-based communication protocol - Google Patents
RS 232-based communication protocol Download PDFInfo
- Publication number
- CN112765083A CN112765083A CN202110124124.0A CN202110124124A CN112765083A CN 112765083 A CN112765083 A CN 112765083A CN 202110124124 A CN202110124124 A CN 202110124124A CN 112765083 A CN112765083 A CN 112765083A
- Authority
- CN
- China
- Prior art keywords
- protocol
- communication protocol
- message
- point
- network terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004891 communication Methods 0.000 title claims abstract description 49
- 230000004044 response Effects 0.000 claims abstract description 22
- 230000009471 action Effects 0.000 claims description 4
- 238000000034 method Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 abstract description 6
- 238000012795 verification Methods 0.000 abstract description 3
- 238000005286 illumination Methods 0.000 description 3
- 239000000047 product Substances 0.000 description 2
- 239000003086 colorant Substances 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a communication protocol based on RS232, which comprises a link layer protocol and an application layer protocol; the baud rate of the RS232 link layer is set to 57600 or 115200, 8 data bits, a stop bit and no parity bit; the communication message of the RS232 application layer comprises a start frame 1, a start frame 2, a command word, a source address, a data field, priority and a checksum. Based on RS232 communication protocol, the control instruction protocol of the first network terminal to the second network terminal is realized by expanding the protocol content. Based on the RS232 communication protocol, the response protocol of the second network terminal to the control instruction of the first network terminal is realized by expanding the protocol content. The invention realizes an application layer communication protocol with good flexibility, high data transmission efficiency and better robustness, and can expand the protocol content according to the actual requirement on the basis of the communication protocol; through the verification of actual products, the communication protocol has excellent universality and stability.
Description
Technical Field
The invention relates to the field of communication, in particular to a communication protocol based on RS 232.
Background
RS232 is a physical interface standard for serial communication, and is a common interface for data exchange between modules in a control system.
The RS232 standard only makes constraint specifications on electrical characteristics of a physical bus and a link layer protocol, but when each module of the control system performs data communication based on an RS232 interface, a certain application layer communication protocol must be observed in addition to the RS232 link layer protocol. The specification of the application layer communication protocol directly determines the data transmission efficiency of the bus and the robustness of data exchange.
If the application layer protocol specification is too complex, the data transmission efficiency will be reduced; if the application layer protocol specification is too simple, the robustness of the data exchange may be degraded.
Disclosure of Invention
The invention aims to: the communication protocol based on RS232 is provided, an application layer communication protocol standard which is good in flexibility, high in data transmission efficiency and good in robustness is achieved, and on the basis of the application layer communication protocol standard, protocol contents can be expanded according to actual requirements.
The technical scheme of the invention is as follows:
an RS 232-based communication protocol comprises a link layer protocol and an application layer protocol;
the baud rate of the RS232 link layer is set to 57600 or 115200, 8 data bits, a stop bit and no parity bit;
communication messages of the RS232 application layer are divided into point-to-point messages and global broadcast messages; the point-to-point message is only received by a terminal matched with a target address, and a response is needed after the point-to-point message is received; any terminal can receive the global broadcast message, and no response is needed after receiving the global broadcast message;
after any network terminal sends a point-to-point message, if no response still exists after 50ms, the message needs to be retransmitted again, and the process is circulated until correct response information is received; if the response is not received yet after the response is continuously sent for 50 times, the overtime exit is carried out, and communication overtime alarm is fed back.
Preferably, the communication message includes a start frame 1, a start frame 2, a command word, a source address, a data field, a priority, and a checksum.
Preferably, the length of each frame of the communication message is fixed to 14 bytes, where:
start frame 1: byte0, always 0 xAA;
start frame 2: byte1, always 0x 55;
command word: byte2, which is an action instruction executed by the target terminal;
source address: byte3, which is the ID of the message sending terminal;
data field: the bytes 4-11 are 8 bytes of data information, and the low Byte of the multi-Byte data is before;
priority: byte12, defaulted to 0x0C, reserves the function of expanding the message priority;
and (4) checking the sum: the Byte 13-14 take eight lower bits after carrying out summation operation on the Byte 0-12.
Preferably, any one of the network terminals has a unique identification ID.
Preferably, the control instruction protocol of the first network terminal to the second network terminal is implemented by expanding the protocol content based on the RS232 communication protocol.
Preferably, based on the RS232 communication protocol, the response protocol of the second network terminal to the control instruction of the first network terminal is implemented by extending the protocol content.
The invention has the advantages that:
1. the invention realizes the application layer communication protocol standard with good flexibility, high data transmission efficiency and better robustness, and can expand the protocol content according to the actual requirement on the basis of the application layer communication protocol standard;
2. through the verification of actual products, the communication protocol specification has excellent universality and stability.
Drawings
The invention is further described with reference to the following figures and examples:
FIG. 1 is a table of standard message formats;
FIG. 2 is a protocol table of start-stop control commands of the host to the motor controller in the embodiment;
fig. 3 is a protocol table for responding to a host start-stop control command by the motor controller in the embodiment.
Detailed Description
The communication protocol based on RS232 comprises a link layer protocol and an application layer protocol, wherein:
the baud rate of the RS232 link layer is set to 57600 or 115200, 8 data bits, a stop bit and no parity bit;
communication messages of the RS232 application layer are divided into point-to-point messages and global broadcast messages; the point-to-point message is only received by a terminal matched with a target address, and a response is needed after the point-to-point message is received; any terminal can receive the global broadcast message, and no response is needed after receiving the global broadcast message; any network terminal has a unique identification ID.
After any network terminal sends a point-to-point message, if no response still exists after 50ms, the message needs to be retransmitted again, and the process is circulated until correct response information is received; if the response is not received yet after the response is continuously sent for 50 times, the overtime exit is carried out, and communication overtime alarm is fed back.
Any standard communication message includes start frame 1, start frame 2, command word, source address, data field, priority, checksum. As shown in fig. 1, the message length of each frame of the communication message is fixed to 14 bytes, where:
start frame 1: byte0, always 0 xAA;
start frame 2: byte1, always 0x 55;
command word: byte2, which is an action instruction executed by the target terminal;
source address: byte3, which is the ID of the message sending terminal;
data field: the bytes 4-11 are 8 bytes of data information, and the low Byte of the multi-Byte data is before;
priority: byte12, defaulted to 0x0C, reserves the function of expanding the message priority;
and (4) checking the sum: the Byte 13-14 take eight lower bits after carrying out summation operation on the Byte 0-12.
Example 1
In a motor control system, it is composed of a host and a motor controller. The host machine issues a control command to the motor controller, and the motor controller executes the relevant motion after receiving the control command issued by the host machine. Wherein:
(a) start frame 1: 0 xAA;
(b) start frame 2: 0x 55;
(c) command word: 0x 03;
(a) the ID address of the host is: 0x 27.
(b) The ID address of the motor controller is: 0 xEF.
(c) As shown in fig. 2, based on the RS232 communication protocol, the start/stop control instruction protocol of the host to the motor controller is implemented by extending the protocol content.
(d) As shown in fig. 3, based on the RS232 communication protocol, by extending the protocol content, the response protocol of the motor controller to the host start-stop control instruction is implemented.
Example 2
In an electron microscope, there are multiple RS232 network nodes, such as host PCs, multi-axis motor controllers, illumination LED drivers, and the like. When the electron microscope works, the host PC sends a control command through the RS232 to control the motor controller to perform multidirectional displacement action, or control the illumination LED driver to perform light supplement illumination with different brightness and different colors.
Based on the communication protocol specification, according to the functional requirements of the electron microscope, the control protocol among the host PC, the multi-axis motor controller and the lighting LED driver can be quickly realized, and the control protocol of the communication protocol specification is obeyed through product verification, so that the data transmission is stable and efficient. Meanwhile, the control protocol is simple in iterative upgrade and has excellent expandability.
The above embodiments are merely illustrative of the technical ideas and features of the present invention, and the purpose of the embodiments is to enable those skilled in the art to understand the contents of the present invention and implement the present invention, and not to limit the protection scope of the present invention. All modifications made according to the spirit of the main technical scheme of the invention are covered in the protection scope of the invention.
Claims (6)
1. The communication protocol based on the RS232 is characterized by comprising a link layer protocol and an application layer protocol;
the baud rate of the RS232 link layer is set to 57600 or 115200, 8 data bits, a stop bit and no parity bit;
communication messages of the RS232 application layer are divided into point-to-point messages and global broadcast messages; the point-to-point message is only received by a terminal matched with a target address, and a response is needed after the point-to-point message is received; any terminal can receive the global broadcast message, and no response is needed after receiving the global broadcast message;
after any network terminal sends a point-to-point message, if no response still exists after 50ms, the message needs to be retransmitted again, and the process is circulated until correct response information is received; if the response is not received yet after the response is continuously sent for 50 times, the overtime exit is carried out, and communication overtime alarm is fed back.
2. The RS 232-based communication protocol of claim 1 wherein the communication packet includes a start frame 1, a start frame 2, a command word, a source address, a data field, a priority, a checksum.
3. The RS 232-based communication protocol according to claim 2, wherein each frame of the communication message has a fixed message length of 14 bytes, wherein:
start frame 1: byte0, always 0 xAA;
start frame 2: byte1, always 0x 55;
command word: byte2, which is an action instruction executed by the target terminal;
source address: byte3, which is the ID of the message sending terminal;
data field: the bytes 4-11 are 8 bytes of data information, and the low Byte of the multi-Byte data is before;
priority: byte12, defaulted to 0x0C, reserves the function of expanding the message priority;
and (4) checking the sum: the Byte 13-14 take eight lower bits after carrying out summation operation on the Byte 0-12.
4. A RS232 based communication protocol according to claim 3 wherein any network terminal has a unique ID.
5. The RS 232-based communication protocol of claim 4, wherein the RS 232-based communication protocol implements a control command protocol from the first network terminal to the second network terminal by extending protocol contents.
6. The RS 232-based communication protocol of claim 5, wherein the RS 232-based communication protocol implements a response protocol of the second network terminal to the control command of the first network terminal by extending protocol contents.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110124124.0A CN112765083A (en) | 2021-01-29 | 2021-01-29 | RS 232-based communication protocol |
PCT/CN2021/124102 WO2022160779A1 (en) | 2021-01-29 | 2021-10-15 | Rs232-based communication protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110124124.0A CN112765083A (en) | 2021-01-29 | 2021-01-29 | RS 232-based communication protocol |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112765083A true CN112765083A (en) | 2021-05-07 |
Family
ID=75706617
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110124124.0A Pending CN112765083A (en) | 2021-01-29 | 2021-01-29 | RS 232-based communication protocol |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112765083A (en) |
WO (1) | WO2022160779A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022160779A1 (en) * | 2021-01-29 | 2022-08-04 | 苏州易德龙科技股份有限公司 | Rs232-based communication protocol |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116886730A (en) * | 2023-08-07 | 2023-10-13 | 广东龙泉科技有限公司 | Internet of things data acquisition method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102082773A (en) * | 2009-11-30 | 2011-06-01 | 北京广利核系统工程有限公司 | Communication method based on inter-column security communication network protocol of reactor protection system |
CN105491017A (en) * | 2015-11-23 | 2016-04-13 | 泰华智慧产业集团股份有限公司 | RS485 bus multi-device multi-protocol analysis method and RS485 bus multi-device multi-protocol analysis system |
CN109510759A (en) * | 2018-10-22 | 2019-03-22 | 智强通达科技(北京)有限公司 | A kind of Universal-purpose quick multi-protocol gateway realization system and method |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101163075B (en) * | 2006-10-10 | 2011-05-11 | 中兴通讯股份有限公司 | Method of implementing embedded device address installation by RS 485 bus competition |
CN107391421B (en) * | 2017-06-23 | 2019-11-15 | 歌尔股份有限公司 | Method, client terminal device and the data forwarding device of data are transmitted by serial ports |
CN207691852U (en) * | 2017-12-26 | 2018-08-03 | 江苏启泰物联网科技有限公司 | The protocol conversion device of long-range RS232 protocol signals and Ethernet |
CN109379264B (en) * | 2018-10-16 | 2021-07-06 | 西北铁道电子股份有限公司 | Multi-board card communication equipment, method and system based on CAN2.0 |
CN112765083A (en) * | 2021-01-29 | 2021-05-07 | 苏州易德龙科技股份有限公司 | RS 232-based communication protocol |
-
2021
- 2021-01-29 CN CN202110124124.0A patent/CN112765083A/en active Pending
- 2021-10-15 WO PCT/CN2021/124102 patent/WO2022160779A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102082773A (en) * | 2009-11-30 | 2011-06-01 | 北京广利核系统工程有限公司 | Communication method based on inter-column security communication network protocol of reactor protection system |
CN105491017A (en) * | 2015-11-23 | 2016-04-13 | 泰华智慧产业集团股份有限公司 | RS485 bus multi-device multi-protocol analysis method and RS485 bus multi-device multi-protocol analysis system |
CN109510759A (en) * | 2018-10-22 | 2019-03-22 | 智强通达科技(北京)有限公司 | A kind of Universal-purpose quick multi-protocol gateway realization system and method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022160779A1 (en) * | 2021-01-29 | 2022-08-04 | 苏州易德龙科技股份有限公司 | Rs232-based communication protocol |
Also Published As
Publication number | Publication date |
---|---|
WO2022160779A1 (en) | 2022-08-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112765083A (en) | RS 232-based communication protocol | |
CN201887792U (en) | Multi-protocol conversion gateway | |
CN104408003B (en) | The wireless usb protocol and hub of enhancing | |
CN101552785B (en) | CAN bus communication method based on message mechanism used for massive data transmission | |
CN105082540A (en) | Method for controlling 3D printer through 3D slicing device | |
CN1446425A (en) | Providing remote-range network driver interface service and radio-frequency medium | |
EP2843488B1 (en) | Industrial controller apparatus capable of low error, ultra high-speed serial communication and method for driving same | |
CN107741884B (en) | Method and device for realizing message pushing by hierarchical state machine | |
CN115632900B (en) | Computing equipment | |
CN114666937A (en) | Drive using security information | |
CN113196710B (en) | Distribution node, automation network and method for transmitting messages | |
EP2336896B1 (en) | Serial communication module with multiple receiver/transmitters | |
US20050141555A1 (en) | Method for generating commands for network controller modules of peripheral devices | |
US20170192920A1 (en) | Transmission unit with checking function | |
CN111628920B (en) | Intercommunication method between multiple serial interface devices | |
CN209373581U (en) | A kind of updating device of multiple driver | |
CN107018151B (en) | CAN-LonWorks protocol conversion method of programmable conversion logic | |
CN112559080A (en) | TBOX equipment adaptation method based on CAN bus | |
CN109710291B (en) | Remote upgrading method for aviation photoelectric load software configuration items | |
CN114095303B (en) | Communication device, data transmission method and electronic device | |
CN107872431B (en) | Data transmitting and receiving method, device and base station | |
CN112087359B (en) | Serial communication system | |
CN1889567B (en) | Medium-speed series connection bus controller | |
US7733858B1 (en) | Communication protocol between a host computer and a control surface in an audio editing/mixing system | |
CN107608679A (en) | A kind of method by the efficient programming data of set top box of Socket |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |