文档详情

多线程串行通信实现技术.doc

发布:2016-11-18约4.32万字共10页下载文档
文本预览下载声明
多线程串行通信实现技术 Serial port is a standard PC, configure the communication port, follow the RS-232 - C (EIA-232 - D) standard, widely used in computer network communications, Data acquisition, automatic control and other fields. Although the operating systems provide a serial communication programming interface, but the underlying hardware-oriented programming work As is still complex. In recent years, we have developed which is based on OSI / RM network prototype system OSILite [1] The system selected the RS-232 - C as a physical layer standard, in the development process under different operating system, serial communication programming in-depth research. If you omit Specific methods to access the difference between the serial port, only from the software during operation Relation between the rest of the system, serial communication programming can be divided into two Kinds: one is directly embedded in the main program on the serial port of the operation is simple, but basically the code between the different programs can not be reused; the other Is a serial communication program to execute concurrently with the main program, this method is more complicated programming, but it is possible to program a serial communications package, which Serial communication programming are common components. In this paper, the latter in the Windows programming method under discussion, the use of development tools is Visual C + + 6. 0. First, the realization of the DOS, as a reference, and then analyzes the Win32 programming interface and serial communication support mechanisms, Finally CSerialPort class implementation framework and use. 1 ?? DOS programming of serial communication under DOS, there are several programming interfaces to support serial communication [2, 3]: BIOS function calls INT 14H; DOS INT 21H function calls 3 and 4 sub-functions Energy; the serial port device file to use as a file access interface. As a single task operating system, DOS is not under
显示全部
相似文档