8
Windows Programming, C.-S. Shieh, KUAS EC, 2005 1 Chapter 9.5 I/O Communication

Chapter 9.5

  • Upload
    ghita

  • View
    31

  • Download
    0

Embed Size (px)

DESCRIPTION

Chapter 9.5. I/O Communication. ComPort Library v2.64. ComPort Library v2.64 is a free RS-232 VCL component for C++ Builder by Dejan Crnila. http://sourceforge.net/projects/comport/. ComPort Installation Note. Download CPort264.zip from ftp://bit.kuas.edu.tw/pub/lang/CPort264.zip - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 1

Chapter 9.5

I/O Communication

Page 2: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 2

ComPort Library v2.64

• ComPort Library v2.64 is a free RS-232 VCL component for C++ Builder by Dejan Crnila.

• http://sourceforge.net/projects/comport/

Page 3: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 3

ComPort Installation Note

• Download CPort264.zip from ftp://bit.kuas.edu.tw/pub/lang/CPort264.zipUnzip CPort264.zip to a temporary directory

• VCL Component Installation1. Unzip Sources.zip to C:\Program Files\Borland\CBuilder5\ComPort2. Open, compile, close, and save C:\Program Files\Borland\CBuilder5\ComPort\CPortLibCB5.bpk3. Open, compile, close, and save C:\Program Files\Borland\CBuilder5\ComPort\DsgnCPortCB5.bpk4. Component->Install Packages->Add->C:\Program Files\Borland\CBuilder5\Projects\Bpl\DsgnCPortCB5.bpl5. Add $(BCB)\ComPort to include path (Project->Options- >Directories/Conditionals->Include path)

Page 4: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 4

ComPort Installation Note (cont)

• Help File Installation1. Unzip Help.zip to C:\Program Files\Borland\CBuilder5\ComPort2. Help->Customize->Contents->Add Files->C:\Program Files\Borland\CBuilder5\ComPort\CPort.toc3. Help->Customize->Index->Add Files->C:\Program Files\Borland\CBuilder5\ComPort\CPort.hlp4. Help->Customize->Link->Add Files->C:\Program Files\Borland\CBuilder5\ComPort\CPort.hlp5. Help->Customize->Project->Add Files->C:\Program Files\Borland\CBuilder5\ComPort\CPort.cnt6. Help->Customize->Save Project

• Bug Q. There will be two "Multiple declaration" errors on the first time of compilation.A. Comment these two functions with errors and save to prevent these errors occur again.

Page 5: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 5

TComPort

• Properties– BaudRate, Port

• Methods– Open(), Close(), Write(), Read()

• Events– OnRxChar

Page 6: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 6

• char buffer[256];

• … buffer[0]=23;

• … buffer[1]=‘A’;

• …

• ComPort1->Write(buffer,23);

Page 7: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 7

TMS Instrumentation Workshop v1.3

• TMS Instrumentation Workshop v1.3 for C++ Builder contains over 80 VCL components for Instrumentation and Multimedia application development.

• http://www.tmssoftware.com

Page 8: Chapter 9.5

Windows Programming, C.-S. Shieh, KUAS EC, 2005 8

TMSIW Installation Note• Download TIWC5.ZIP from

ftp://bit.kuas.edu.tw/pub/lang/CBuilder/VCL/TIWC5.ZIP

• Unzip TIWC5.ZIP to C:\Program Files\Borland\CBuilder5\TMSIW

• Open, install, save, and close C:\Program Files\Borland\CBuilder5\TMSIW\Vcwb5.bpk

• Customize the online help.