CN107947911B - Communication device and communication method for realizing half-duplex analog full duplex based on upper computer RS485 communication - Google Patents
Communication device and communication method for realizing half-duplex analog full duplex based on upper computer RS485 communication Download PDFInfo
- Publication number
- CN107947911B CN107947911B CN201711486913.9A CN201711486913A CN107947911B CN 107947911 B CN107947911 B CN 107947911B CN 201711486913 A CN201711486913 A CN 201711486913A CN 107947911 B CN107947911 B CN 107947911B
- Authority
- CN
- China
- Prior art keywords
- upper computer
- interface
- communication
- instruction
- mcu
- 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.)
- Active
Links
- 230000006854 communication Effects 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 title claims abstract description 55
- 238000000034 method Methods 0.000 title claims abstract description 12
- 238000004088 simulation Methods 0.000 claims abstract description 7
- 230000000694 effects Effects 0.000 claims abstract description 6
- 230000005540 biological transmission Effects 0.000 claims description 6
- 230000000903 blocking effect Effects 0.000 abstract description 5
- 230000002411 adverse Effects 0.000 abstract description 2
- 230000002452 interceptive effect Effects 0.000 abstract description 2
- 238000005516 engineering process Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/14—Two-way operation using the same type of signal, i.e. duplex
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
- H04L12/40176—Flexible bus arrangements involving redundancy
- H04L12/40182—Flexible bus arrangements involving redundancy by using a plurality of communication lines
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/14—Two-way operation using the same type of signal, i.e. duplex
- H04L5/1415—Two-way operation using the same type of signal, i.e. duplex using control lines
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/14—Two-way operation using the same type of signal, i.e. duplex
- H04L5/16—Half-duplex systems; Simplex/duplex switching; Transmission of break signals non-automatically inverting the direction of transmission
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer And Data Communications (AREA)
- Communication Control (AREA)
Abstract
The communication device for realizing half-duplex simulation full duplex based on the RS485 communication of the upper computer comprises the upper computer and the execution mechanism, wherein the upper computer is provided with a user interface, the upper computer is communicated with the execution mechanism through an AB double line of the RS485, and an MCU of the upper computer is also connected with an external storage space. In the communication method obtained by the method, the upper computer aims at simulating the full duplex mode of RS485 double lines, so that the problem that only one party of data can be transmitted at the same time when double-line RS485 communication is performed, when the data quantity instructions of the upper computer are more, the time delay generated by the upper computer can cause serious result of the blocking of the UI interface, and the adverse effect caused by the blocking of the interactive application which cannot have the time delay is prevented.
Description
Technical Field
The invention relates to an RS485 communication technology, in particular to a communication device and a communication method for realizing half-duplex simulation full-duplex height based on upper computer RS485 communication.
Background
Along with the update of the intelligent operating system, the replacement of hardware and the development of media technology, the timely update and display of the UI of the intelligent operating system are more and more important, the traditional RS485 bus synchronous update UI technology is more and more adaptive to the update of the UI interface of the modern intelligent operating system, the display of the UI of the synchronous waiting upper computer is more and more unacceptable to users, and the interface update katon delay seriously affects the experience of the user operation, so how to update the UI of the upper computer rapidly becomes the problem to be solved at present. Based on this background, the necessity of synchronously updating RS485UI technology is also becoming more and more apparent.
Disclosure of Invention
In order to solve the problems, the invention provides a communication device and a communication method for realizing half-duplex simulation full duplex based on the RS485 communication of an upper computer, which can rapidly update the UI of the upper computer and improve the operation speed.
The invention discloses a communication device for realizing half-duplex simulation full duplex based on RS485 communication of an upper computer, which comprises the upper computer and an executing mechanism, wherein a user interface is arranged on the upper computer, the upper computer is communicated with the executing mechanism through an AB double line of RS485, and an external storage space is also connected to an MCU of the upper computer.
The MCU is arranged in the upper computer, the MCU is STM32F103, the external memory is SRAM with the model of 65WV51216EBLL, wherein the A [0:18] interface of the SRAM is connected with the FMSC_A [0:18] interface of the MCU, the D [0:15] interface of the SRAM is connected with the FSMC_D0:15 ] interface of the MCU, the UB interface of the SRAM is connected with the FSMC_NBL1 interface of the MCU, the LB interface of the SRAM is connected with the FSMC_NBL0 interface of the MCU, the OE interface of the SRAM is connected with the FSMC_OE interface of the MCU, the WE interface of the SRAM is connected with the FSMC_WE interface of the MCU, and the CS interface of the SRAM is connected with the FSMC_NE3 interface of the MCU.
The communication method of the communication device for realizing half-duplex analog full duplex based on the RS485 communication of the upper computer comprises the following steps:
1) The upper computer is connected with an AB double line of RS485, a two-line system is adopted, after the connection is successful, whether serial ports and baud rates between devices are normal or not is confirmed, whether a sensor end device at the other end is normal or not is confirmed, and whether data transmission and data packets are error-free or not is confirmed;
2) The user clicks the upper computer user interface, starts to send various instructions such as login and data acquisition, sends the instructions to the execution mechanism for communication, when the data volume is sent greatly, the upper computer opens up a continuous space with the same size in a cache instruction container simulated by an external storage space for storing data cache instructions, and the storage space is dynamically stored and gradually increases along with the increase of the cache instructions;
3) When the two-wire system communication mode executing mechanism is adopted, a buffer instruction container starts to check whether buffer instructions to be transmitted exist, when the fact that the buffer instructions which are not transmitted are stored in a list is detected, the buffer instruction container starts to inform an upper computer of successful data transmission so as to achieve the effect of updating a UI interface at an upper position, meanwhile, a buffer instruction container at the bottom layer is used for taking out the buffer instructions to be queued from a queue to carry out communication on the data of the executing mechanism, after the buffer instruction at the bottom layer transmits a data packet successfully, the buffer instruction container starts to receive the functional data returned by the executing mechanism, then the buffer instruction container moves out of a successful instruction transmitted last time, meanwhile, after the buffer instruction at the bottom layer receives the successful instruction executed by the executing mechanism, the buffer queue at the bottom layer starts to feed back the successful instruction to the upper computer, the upper computer receives the corresponding ID instruction, and then updates the specific successful instruction to achieve successful communication of the two parties of batch sending and receiving;
4) After the bottom layer cache instruction container successfully sends and receives instructions, the size of the cache instruction container is cleaned regularly, so that the stability and the rapidity of RS485 double-line simulated full duplex communication are ensured;
5) When no communication instruction exists in the bottom layer cache instruction container, the space of the bottom layer cache instruction is reduced, so that the space of a cache device is saved, and the next half-duplex simulated full-duplex communication process is waited.
The communication device for realizing half-duplex simulation full duplex based on the upper computer RS485 communication, which is obtained by the invention, has the advantages of simple structure and reasonable design, achieves the full duplex-like communication effect by using a simple chip connection structure, and is very suitable for being used on low-cost electronic equipment. In the communication method obtained by the method, the upper computer aims at simulating the full duplex mode of RS485 double lines, so that the problem that only one party of data can be transmitted at the same time when double-line RS485 communication is performed, when the data quantity instructions of the upper computer are more, the time delay generated by the upper computer can cause serious result of the blocking of the UI interface, and the adverse effect caused by the blocking of the interactive application which cannot have the time delay is prevented. The double-wire RS485 communication is adopted to simulate full duplex communication, data level storage and instruction caching are carried out when data are large, and blocking influence on an instruction cannot be caused when an upper layer UI interface is updated too fast; when waiting for the upper computer to be idle, the command which is not sent is continuously sent, so that the full double functions of the half double-functional mode are achieved.
Drawings
Fig. 1 is a structural diagram of a frame of the present invention.
FIG. 2 is a diagram showing the connection between MCU and SRAM circuit according to the present invention.
Detailed Description
The technical scheme of the present invention will be clearly and completely described below with reference to the embodiments of the present invention and the accompanying drawings.
Example 1.
The communication device for realizing half-duplex simulation full duplex based on the RS485 communication of the upper computer comprises the upper computer 1 and an executing mechanism 2, wherein a user interface 3 is arranged on the upper computer 1, the upper computer 1 is communicated with the executing mechanism 2 through an AB double line of the RS485, and an external storage space 4 is further connected to an MCU of the upper computer.
The upper computer is internally provided with an MCU, the MCU is STM32F103, the external memory is an SRAM with the model of 65WV51216EBLL, wherein an A0:18 interface of the SRAM is connected with an FMSC_A 0:18 interface of the MCU, a D0:15 interface of the SRAM is connected with an FSMC_D0:15 interface of the MCU, a UB interface of the SRAM is connected with an FSMC_NBL1 interface of the MCU, an LB interface of the SRAM is connected with an FSMC_NBL0 interface of the MCU, an OE interface of the SRAM is connected with an FSMC_OE interface of the MCU, a WE interface of the SRAM is connected with an FSMC_WE interface of the MCU, and a CS interface of the SRAM is connected with an FSMC_NE3 interface of the MCU.
The communication method of the communication device for realizing half-duplex analog full duplex based on the RS485 communication of the upper computer comprises the following steps:
1) The upper computer is connected with an AB double line of RS485, a two-line system is adopted, after the connection is successful, whether serial ports and baud rates between devices are normal or not is confirmed, whether a sensor end device at the other end is normal or not is confirmed, and whether data transmission and data packets are error-free or not is confirmed;
2) The user clicks the upper computer user interface, starts to send various instructions such as login and data acquisition, sends the instructions to the execution mechanism for communication, when the data volume is sent greatly, the upper computer opens up a continuous space with the same size in a cache instruction container simulated by an external storage space for storing data cache instructions, and the storage space is dynamically stored and gradually increases along with the increase of the cache instructions;
3) When the two-wire system communication mode executing mechanism is adopted, a buffer instruction container starts to check whether buffer instructions to be transmitted exist, when the fact that the buffer instructions which are not transmitted are stored in a list is detected, the buffer instruction container starts to inform an upper computer of successful data transmission so as to achieve the effect of updating a UI interface at an upper position, meanwhile, a buffer instruction container at the bottom layer is used for taking out the buffer instructions to be queued from a queue to carry out communication on the data of the executing mechanism, after the buffer instruction at the bottom layer transmits a data packet successfully, the buffer instruction container starts to receive the functional data returned by the executing mechanism, then the buffer instruction container moves out of a successful instruction transmitted last time, meanwhile, after the buffer instruction at the bottom layer receives the successful instruction executed by the executing mechanism, the buffer queue at the bottom layer starts to feed back the successful instruction to the upper computer, the upper computer receives the corresponding ID instruction, and then updates the specific successful instruction to achieve successful communication of the two parties of batch sending and receiving;
4) After the bottom layer cache instruction container successfully sends and receives instructions, the size of the cache instruction container is cleaned regularly, so that the stability and the rapidity of RS485 double-line simulated full duplex communication are ensured;
5) When no communication instruction exists in the bottom layer cache instruction container, the space of the bottom layer cache instruction is reduced, so that the space of a cache device is saved, and the next half-duplex simulated full-duplex communication process is waited.
Claims (1)
1. The communication method of the communication device for realizing half-duplex simulation full duplex based on the RS485 communication of the upper computer comprises the upper computer and an executing mechanism, wherein a user interface is arranged on the upper computer, the upper computer communicates with the executing mechanism through an AB double line of the RS485, and an MCU of the upper computer is also connected with an external storage space;
the upper computer is internally provided with an MCU, the MCU is STM32F103, the external storage space is an SRAM with the model of 65WV51216EBLL, wherein an A [0:18] interface of the SRAM is connected with an FMSC_A [0:18] interface of the MCU, a D [0:15] interface of the SRAM is connected with an FSMC_D0:15 ] interface of the MCU, a UB interface of the SRAM is connected with an FSMC_NBL1 interface of the MCU, an LB interface of the SRAM is connected with an FSMC_NBL0 interface of the MCU, an OE interface of the SRAM is connected with an FSMC_OE interface of the MCU, a WE interface of the SRAM is connected with an FSMC_WE interface of the MCU, and a CS interface of the SRAM is connected with an FSMC_NE3 interface of the MCU;
the method is characterized by comprising the following steps of:
1) The upper computer is connected with an AB double line of RS485, a two-line system is adopted, after the connection is successful, whether serial ports and baud rates between devices are normal or not is confirmed, whether a sensor end device at the other end is normal or not is confirmed, and whether data transmission and data packets are error-free or not is confirmed;
2) The user clicks the upper computer user interface, starts to send various instructions such as login and data acquisition, sends the instructions to the execution mechanism for communication, when the data volume is sent greatly, the upper computer opens up a continuous space with the same size in a cache instruction container simulated by an external storage space for storing data cache instructions, and the storage space is dynamically stored and gradually increases along with the increase of the cache instructions;
3) When the two-wire system communication mode executing mechanism is adopted, a buffer instruction container starts to check whether buffer instructions to be transmitted exist, when the fact that the buffer instructions which are not transmitted are stored in a list is detected, the buffer instruction container starts to inform an upper computer of successful data transmission so as to achieve the effect of updating a UI interface at an upper position, meanwhile, a buffer instruction container at the bottom layer is used for taking out the buffer instructions to be queued from a queue to carry out communication on the data of the executing mechanism, after the buffer instruction at the bottom layer transmits a data packet successfully, the buffer instruction container starts to receive the functional data returned by the executing mechanism, then the buffer instruction container moves out of a successful instruction transmitted last time, meanwhile, after the buffer instruction at the bottom layer receives the successful instruction executed by the executing mechanism, the buffer queue at the bottom layer starts to feed back the successful instruction to the upper computer, the upper computer receives the corresponding ID instruction, and then updates the specific successful instruction to achieve successful communication of the two parties of batch sending and receiving;
4) After the bottom layer cache instruction container successfully sends and receives instructions, the size of the cache instruction container is cleaned regularly, so that the stability and the rapidity of RS485 double-line simulated full duplex communication are ensured;
5) When no communication instruction exists in the bottom layer cache instruction container, the space of the bottom layer cache instruction is reduced, so that the space of a cache device is saved, and the next half-duplex simulated full-duplex communication process is waited.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711486913.9A CN107947911B (en) | 2017-12-29 | 2017-12-29 | Communication device and communication method for realizing half-duplex analog full duplex based on upper computer RS485 communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711486913.9A CN107947911B (en) | 2017-12-29 | 2017-12-29 | Communication device and communication method for realizing half-duplex analog full duplex based on upper computer RS485 communication |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107947911A CN107947911A (en) | 2018-04-20 |
CN107947911B true CN107947911B (en) | 2023-12-01 |
Family
ID=61937124
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711486913.9A Active CN107947911B (en) | 2017-12-29 | 2017-12-29 | Communication device and communication method for realizing half-duplex analog full duplex based on upper computer RS485 communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107947911B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101515849A (en) * | 2008-02-23 | 2009-08-26 | 宏正自动科技股份有限公司 | Pseudo-full duplex communication using a half duplex communication protocol |
TWM379104U (en) * | 2009-10-07 | 2010-04-21 | Sunix Co Ltd | Improved structure of communication transmission interface |
CN102647454A (en) * | 2012-03-26 | 2012-08-22 | 常熟路车智能电子有限公司 | Mobile-heterogeneity full-duplex communication van networking system |
JP2014115756A (en) * | 2012-12-07 | 2014-06-26 | Tamagawa Seiki Co Ltd | Communication method selection circuit, and method of the same |
CN103944707A (en) * | 2014-05-12 | 2014-07-23 | 哈尔滨工业大学 | Full-duplex and half-duplex converter and conversion method |
CN105472290A (en) * | 2014-09-12 | 2016-04-06 | 杭州海康威视数字技术股份有限公司 | Processing method and device for data transmitting and receiving operation modes |
CN106375806A (en) * | 2016-08-31 | 2017-02-01 | 深圳国微技术有限公司 | User interface update method and system based on conditional access module, and frontend device |
CN206611415U (en) * | 2017-03-21 | 2017-11-03 | 广州国联通信有限公司 | A kind of multi-party full duplex intercom system of subway train |
CN207573372U (en) * | 2017-12-29 | 2018-07-03 | 数源科技股份有限公司 | It is communicated based on host computer RS485 and realizes the communication device of half-duplex simulation full duplex |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8693379B2 (en) * | 2008-07-22 | 2014-04-08 | Panasonic Corporation | Communication system, communication device, and communication method |
-
2017
- 2017-12-29 CN CN201711486913.9A patent/CN107947911B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101515849A (en) * | 2008-02-23 | 2009-08-26 | 宏正自动科技股份有限公司 | Pseudo-full duplex communication using a half duplex communication protocol |
TWM379104U (en) * | 2009-10-07 | 2010-04-21 | Sunix Co Ltd | Improved structure of communication transmission interface |
CN102647454A (en) * | 2012-03-26 | 2012-08-22 | 常熟路车智能电子有限公司 | Mobile-heterogeneity full-duplex communication van networking system |
JP2014115756A (en) * | 2012-12-07 | 2014-06-26 | Tamagawa Seiki Co Ltd | Communication method selection circuit, and method of the same |
CN103944707A (en) * | 2014-05-12 | 2014-07-23 | 哈尔滨工业大学 | Full-duplex and half-duplex converter and conversion method |
CN105472290A (en) * | 2014-09-12 | 2016-04-06 | 杭州海康威视数字技术股份有限公司 | Processing method and device for data transmitting and receiving operation modes |
CN106375806A (en) * | 2016-08-31 | 2017-02-01 | 深圳国微技术有限公司 | User interface update method and system based on conditional access module, and frontend device |
CN206611415U (en) * | 2017-03-21 | 2017-11-03 | 广州国联通信有限公司 | A kind of multi-party full duplex intercom system of subway train |
CN207573372U (en) * | 2017-12-29 | 2018-07-03 | 数源科技股份有限公司 | It is communicated based on host computer RS485 and realizes the communication device of half-duplex simulation full duplex |
Non-Patent Citations (2)
Title |
---|
丁超 ; .基于FPGA的RS232接口设计与实现.中国新通信.2017,(第05期),全文. * |
基于FPGA的RS232接口设计与实现;丁超;;中国新通信(第05期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN107947911A (en) | 2018-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101788972B (en) | System and method for transmitting data | |
US20130114623A1 (en) | Method And System For Triggering Training For Ethernet Channels To Support Energy Efficient Ethernet Networks | |
CN106155960A (en) | Shake hands and the UART serial port communication method of EDMA based on GPIO | |
CN103645994A (en) | Data processing method and device | |
CN109976661B (en) | NOF-based reading control method, device and system | |
CN204759403U (en) | System based on data pass realization equipment internal module thoroughly and upgrade | |
CN103401997A (en) | Data transmission method and system of vehicle-mounted terminal and intelligent mobile phone under USB (universal serial bus) connection | |
CN102306136A (en) | Baud rate self-adaption method based on input capture function of singlechip | |
US11784946B2 (en) | Method for improving data flow and access for a neural network processor | |
CN108932207A (en) | SDIO-WIFI data transmission method and system with buffer area | |
CN102546542B (en) | Electronic system and embedded device and transit device of electronic system | |
CN108304335A (en) | A method of the indefinite long message of serial ports is received by DMA | |
CA2281583A1 (en) | Communications system utilizing non-fixed buffer size | |
CN110401522B (en) | Data communication device, controller and data communication method thereof | |
CN107947911B (en) | Communication device and communication method for realizing half-duplex analog full duplex based on upper computer RS485 communication | |
CN104468404B (en) | A kind of buffer configuration method and device | |
CN207573372U (en) | It is communicated based on host computer RS485 and realizes the communication device of half-duplex simulation full duplex | |
CN105807886A (en) | Chip arousing system, chip arousing method and mobile terminal | |
CN102546582A (en) | Method and system of improving transmission speed of embedded data transmission system | |
CN204595919U (en) | A kind of interface arrangement of embedded human artificial neural networks processor | |
CN112351089B (en) | Data transmission method, system and device between virtual machine and accelerator | |
CN102508809B (en) | Device for converting from field bus to PC104 bus and data transmission method | |
WO2021073125A1 (en) | Processor memory optimization method and apparatus oriented toward deep learning training task | |
CN203104528U (en) | Kilomega Ethernet interface circuit | |
CN201726410U (en) | Jacquard pattern data transmission system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |