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

Data transmission method and device with RS232 capable of automatically adapting to RS485

A data sending device, RS485 technology, applied in the computer field, can solve the problems of cost increase, serial communication conversion complexity, RS232 serial communication program can not automatically adapt to RS485 communication mode, etc., to achieve the effect of low cost and simple serial communication conversion

Inactive Publication Date: 2012-07-04
EVOC INTELLIGENT TECH
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The purpose of the embodiments of the present invention is to provide a RS232 adaptive RS485 data transmission method and device, aiming to solve the problem that the RS232 serial communication program cannot automatically To adapt to the communication mode of RS485, it is necessary to manually or increase the corresponding hardware device to realize the normal communication with RS485, which leads to the problem of complicated conversion of serial communication and increased cost

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
  • Data transmission method and device with RS232 capable of automatically adapting to RS485
  • Data transmission method and device with RS232 capable of automatically adapting to RS485
  • Data transmission method and device with RS232 capable of automatically adapting to RS485

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0045] In this embodiment of the present invention, since RS485 is a half-duplex communication method, when an application uses RS232 to communicate with an application that uses RS485, it must use the RS485 communication method to communicate, otherwise it will cause the process of sending and receiving. , data loss or data error, in this embodiment of the present invention, after receiving the data sending request from the application layer application, the I / O manager generates a corresponding I / O request packet (I / O Request Packet, IRP) , After receiving the IRP, the RS232 data transmission control is carried out by setting the RS232 request to send signal RTS (Request to Send).

[0046] figure 1 The flow of the RS232 adaptive RS485 data transmission method provided by the first embodiment of the present invention is shown, and the details are as follows:

[0047] In step S101, when an IRP for sending data request is received, the RTS is set to be valid.

[0048] In the em...

Embodiment 2

[0054] figure 2 The structure of the RS232-adaptive RS485 data transmission apparatus provided by the second embodiment of the present invention is shown. For convenience of description, only the parts related to the embodiment of the present invention are shown. Details are as follows:

[0055] When the RTS sending valid setting unit 21 receives the IRP of the sending data request, the RTS is set to be valid;

[0056] In the embodiment of the present invention, the RTS of the serial port RS232 is valid at low level and invalid at high level. When receiving the request information for sending data from the application at the application layer, the I / O manager generates the corresponding IRP, and after receiving the IRP, it will The RTS register is set to be valid, so that RS232 is in the state of data transmission. In a specific implementation process, the RTS can be set to be valid, that is, a low-level state, by means of an interruption, so as to switch the state of the R...

Embodiment 3

[0062] image 3 The flow of the RS232 adaptive RS485 data receiving method provided by the third embodiment of the present invention is shown, and the details are as follows:

[0063] In step S301, when an IRP for receiving a data request is received, the RTS is set to be valid.

[0064] In the embodiment of the present invention, when receiving the data receiving request information of the application layer application, the I / O manager generates the corresponding IRP for receiving the data request, and after receiving the IRP, sets the RTS register to be valid, so that the RS232 is in the data receive status. In a specific implementation process, the RTS can be set to be valid, that is, a low-level state, by means of an interruption, so as to switch the state of the RS232 in real time.

[0065] In step S302, data is received from an application using RS485 communication.

[0066] In the embodiment of the present invention, according to the data sender and the data receiver...

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 is applied to the technical field of computers and provides a data transmission method and device with an RS232 capable of automatically adapting to an RS485. The method comprises the following steps: setting RTS (Request To Send) to be effective when receiving an I / O (Input / Output) request packet (IRP) for requiring sending data; and sending data to be sent to an application program which receives data through the RS485. According to the invention, when the IRP request for sending and receiving the data is received, the RTS of the RS232 is set to be effective so as to be communicated with the application program which is communicated by utilizing the RS485, so that self-adaption from the RS232 serial port to the RS485 serial port is realized; the problem that the RS232 cannot be automatically adapted to an RS485 half-duplex communication manner, and the communication between the RS232 and the RS485 can only be realized manually or by adding corresponding hardware is solved; the automatic switching from the RS232 to the RS485 communication manner is completed; the serial port communication switching from the RS232 to the RS485 is simpler; and the cost is lower.

Description

technical field [0001] The invention belongs to the technical field of computers, and in particular relates to a data transmission method and device for RS232 adaptive RS485. Background technique [0002] The RS232 interface is a standard for serial communication jointly developed by the American Electronics Industry Association (EIA) in conjunction with Bell systems, modem manufacturers and computer terminal manufacturers in 1970. Its full name is "Data Terminal Equipment (DTE) and data communication equipment. (DCE) Serial Binary Data Exchange Interface Technical Standard". With the rapid development of embedded applications, Linux serial communication has been widely used. At present, the commonly used serial communication methods of computers include RS232, RS485 and RS422. Since RS485 is half-duplex communication, in the process of using RS232 serial port to communicate with RS485, the RS232 serial port communication program cannot automatically adapt to the RS485 com...

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): G06F13/38
Inventor 陈志列江武
Owner EVOC INTELLIGENT TECH