使用方法:Dim m_cs232 As New CRs232m_cs232.openPort() '打开串口Dim send() As Byte = {&H1, &H2, &H3}m_cs232.write(send) '发送Dim i as integer = m_cs232.GetReadBuffer() '得到串口输入缓冲区当前字节数Dim rev() As Byterev = m_cs232.read(3) '读取3个字节m_cs232.clsPort() '清空串口输入缓冲区m_cs
串口 实现 function TFTransForm.OpenPort:Boolean; var ret:Integer; begin OpenPort := false; ret := sio_open(GCommData.Port); if ret SIO_OK then begin MxShowError('sio_open',ret); Exit; end; if PortSet() = false then begin sio_close(GCommData.Port); Exit
** ** PURPOSE This class can read, write and watch one serial port. ** It sends messages to its owner when something happends on the port ** The class creates a thread for reading and writing so the main ** program is not blocked. ** ** CREATION DAT
CSerialPort =========== First Version by Remon Spekreijse on 2000-02-08 http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2483/A-communication-class-for-serial-port.htm Second Version by mrlong on 2007-12-25 https://code.goog
CSerialPort First Version by Remon Spekreijse on 2000-02-08 http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2483/A-communication-class-for-serial-port.htm Second Version by mrlong on 2007-12-25 https://code.google.com/p/myc
CSerialPort First Version by Remon Spekreijse on 2000-02-08 http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2483/A-communication-class-for-serial-port.htm Second Version by mrlong on 2007-12-25 https://code.google.com/p/myc
CSerialPort First Version by Remon Spekreijse on 2000-02-08 http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2483/A-communication-class-for-serial-port.htm Second Version by mrlong on 2007-12-25 https://code.google.com/p/myc
CSerialPort First Version by Remon Spekreijse on 2000-02-08 http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2483/A-communication-class-for-serial-port.htm Second Version by mrlong on 2007-12-25 https://code.google.com/p/myc