PComm Serial Development

https://blog.csdn.net/u011430225/article/details/51496456

https://blog.csdn.net/eit520/article/details/7861029

About serial programming, useful API, useful mscomm of.

In fact, with the Pcomm lite, you will not encounter many problems, just open the serial port, built threads income data, and then only need to focus on their own to send and receive data on the line.

PComm Lite is the company's home called moxa out, did a few decades of industrial serial cards, serial servers and the like of the device. pcomm provide ease of use, reliability proven.

Download: http: //www.moxa.com/product/download_pcommlite_info.htm

 

The latest version is Version 1.5 Released 2010-09-20 support XP / win7, 32 / 64bit libraries have a development environment supports VC / VB / Delphi.

Note can be found in addition to a Version 2.6. Released Jul 8, 2008 is WIN9x / NT4 use, do not look to compete with the version number wrong.

Foreign industry, there are many older systems in use.

 

Very simple to use up, copy pcomm.h / pcomm.lib two files to the project directory and references, pcomm.dll thrown at windows \ system32.
The entire library comprising a plurality of functions 50, 10 will most commonly be a:
open, close, set baud rate: sio_open (), sio_close () , sio_baut ()
for transmitting data: sio_putch (), sio_write () 
received data: sio_getch (), sio_read ()
query input and output buffers states: sio_iqueue (), sio_oqueue ()
sometimes you may want to set up read and write timeout: sio_SetReadTimeouts (), sio_SetWriteTimeouts ()
these functions are known to see the name meaning, usage check PComm.chm on the line.
Receiving data generally will inevitably have to open thread, sio_iqueue receiving thread () there is no data to look at, there will deal with, not to Sleep () for a while. When receiving data buffer it will help you at least tens of k, generally will not lose data. May be () designated to receive certain data length function is called with a CALLBACK sio_term_irq.

 

These basically live together. The need to control DTS / RTS, there are automatic flow control, and even Xmoderm / Ymoderm / Zmoderm send the file. If you want to Modbus protocol would like to write their own.

 

Guess you like

Origin www.cnblogs.com/xiangtingshen/p/11518703.html