did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780849322136

The Windows Serial Port Programming Handbook

by ;
  • ISBN13:

    9780849322136

  • ISBN10:

    0849322138

  • Edition: CD
  • Format: Hardcover
  • Copyright: 2004-11-19
  • Publisher: Auerbach Public

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $170.00 Save up to $123.62
  • Rent Book $145.75
    Add to Cart Free Shipping Icon Free Shipping

    TERM
    PRICE
    DUE
    USUALLY SHIPS IN 3-5 BUSINESS DAYS
    *This item is part of an exclusive publisher rental program and requires an additional convenience fee. This fee will be reflected in the shopping cart.

Supplemental Materials

What is included with this book?

Summary

The popularity of serial communications demands that additional serial port interfaces be developed to meet the expanding requirements of users. The Windows Serial Port Programming Handbook illustrates the principles and methods of developing various serial port interfaces using multiple languages. This hands-on and practical guide to serial interface programming enables you to develop sophisticated interfaces and apply them in real-world projects. Step by step and line by line, the Handbook clearly explains the interfacing techniques used for each different language. Examples from actual projects have been compiled and debugged, with detailed source code for each included on an accompanying CD-ROM.

Table of Contents

About the Author xv
Acknowledgments xvii
The Fundamentals of Serial Port Communications
1(88)
Introduction
1(1)
Why Serial Port Communications Are Necessary
2(1)
What Is Serial Port Communication?
3(8)
RS-232
3(1)
RS-422
3(1)
RS-485
4(1)
Universal Serial Bus (USB)
5(1)
Controller Area Network (CAN)
6(2)
CAN Standard Frame
8(1)
CAN Extended Frame
8(1)
Detecting and Signaling Errors
8(1)
Firewire
9(2)
Serial Port Communication Protocols
11(13)
ASCII Code
11(1)
DTE and DCE
12(1)
Serial Data Format in TTL
12(2)
Serial Data Format in Transmission Lines
14(1)
Baud Rate
15(1)
Parity
15(1)
Serial Signal Handshaking and the Physical Connector
16(2)
DB-9 Connector
18(3)
DB-25 Connector
21(2)
Serial Signal Timing
23(1)
Serial Port Cabling
24(2)
PC-to-Modem Cabling
24(1)
Null Modem Cabling
25(1)
The Universal Asynchronous Receiver Transmitter (UART)
26(26)
Two Types of UARTs
28(2)
UART Model Numbers
30(1)
The UART Transmitter
30(2)
The UART Receiver
32(1)
Addressing the UART
33(1)
The 8250 UART
33(1)
8250 Architecture
34(1)
8250 Internal Registers
35(2)
8250 Register Functionality
37(8)
The 8250 UART Interrupt Operations
45(5)
The 16550 UART
50(1)
The Receiver Buffer Register (RBR)
50(1)
The FIFO Control Register (FCR)
51(1)
The Line Status Register (LSR)
51(1)
Modems and Flow Control
52(15)
Modem and Modem Control
52(2)
Internal Modem and External Modem
54(1)
Modulation and Demodulation
54(1)
Amplitude Modulation
54(1)
Frequency Modulation
55(1)
Phase Modulation
55(1)
Other Modulations
56(1)
Modem Control
57(1)
Flow Control and File Transfer Control
57(1)
Hardware Flow Control
57(1)
Software Flow Control
58(1)
File Transfer Control
59(1)
The XMODEM Protocol
59(2)
The XMODEM-CRC Protocol
61(1)
The XMODEM-1K Protocol
62(1)
The YMODEM Protocol
63(1)
The YMODEM-G Protocol
64(1)
The ZMODEM Protocol
64(1)
The Kermit Protocol
65(2)
Serial Communication Errors and Error Detection
67(3)
Block Redundancy---Checksum
67(1)
The Classical CRC Algorithm
68(2)
Variations of CRC
70(1)
Serial Communications with the RS-422 and RS-485
70(19)
Basics of the RS-422 Standard
72(1)
Basics of the RS-485 Standard
73(1)
The Operational Principle of the RS-485
73(16)
Serial Port Programming for MS-DOS in ANSI C and Assembly Languages
89(94)
Introduction
89(2)
Virtual Machines
89(1)
MS-DOS-Compatible ANSI C Programming
89(2)
A Loopback Serial Port Testing Program Developed in ANSI C
91(4)
A Loopback Testing Program Developed in C
92(1)
The _outp() and _inp() Functions
92(1)
The Detailed Program Code
92(3)
Embedding Assembly Code into C Programming
95(17)
Inline Assembly Code
96(1)
The _asm Keyword
97(1)
Using C/C++ in _asm Blocks
98(1)
Using Operators and Symbols in _asm Blocks
98(1)
Accessing C/C++ Data in _asm Blocks
99(1)
Using and Preserving Registers in Inline Assembly Code
100(1)
Jumping to Labels in _asm Blocks
100(1)
Calling C/C++ Functions in _asm Blocks
100(2)
Defining _asm Blocks as C Macros
102(1)
Embedding Inline Assembly Code Within C Code
103(9)
A Serial Port Communication Program Developed in ANSI C
112(24)
The Serial Port Communication Program on the Master Side
114(11)
The Serial Port Communication Program on the Slave Side
125(7)
Testing the Serial Port Communication Program Using Two Computers
132(4)
A Serial Port Communication Program Developed in ANSI C and Inline Assembly Code
136(3)
Embedding Inline Assembly Code with the Master and the Slave Computers
137(2)
An Interrupt-Driven Serial Communications Program
139(6)
The Interrupt Mechanism of the 8250 and 16550 UARTs
140(1)
A Sample Interrupt Program
141(4)
Programming the Interface Between PCs and A/D Converters
145(35)
An Eight-Bit A/D Serial Interface Developed in ANSI C
146(1)
The TLC548 Analog-to-Digital Converter
146(2)
The TLC548 Serial Interface Program
148(6)
An Eight-Bit A/D Serial Interface Developed in ANSI C and Inline Assembly Code
154(6)
A 12-Bit A/D Serial Interface Developed in ANSI C
160(1)
The MAX187---12-Bit Serial A/D Converter
160(2)
The MAX220---Multichannel RS-232 Drivers and Receivers
162(1)
The 12-Bit Serial A/D Converter Interface Circuit
163(2)
The 12-Bit Serial A/D Converter Interface Program
165(8)
A 12-Bit A/D Serial Interface Developed in C and Inline Assembly Code
173(7)
Chapter Summary
180(3)
Serial-Port Interfaces Developed in VC++ 6.0
183(112)
Introduction
183(7)
Configuring a Serial Port
184(2)
Writing Data to the Serial Port
186(1)
Reading Data from the Serial Port
187(3)
A Single-Loop Serial Port Communication Test in C/C++
190(53)
Hardware Installation
190(1)
Developing a Console Application Testing Program
190(15)
A Serial Port Application in Visual C++
205(4)
Developing the Document Class
209(3)
Developing the View Class
212(8)
Developing the Dialog Box Classes
220(23)
A Double-Loop Serial Port Test in Visual C++
243(45)
Hardware Connection
243(2)
A Console-Based Double-Loop Serial-Port-Testing Project
245(15)
A Double-Loop Serial-Port-Testing Project Using MFC
260(28)
RS-485 Serial Port Communication
288(5)
Overview
288(1)
An RS-485 Application for Real-Time Control
289(1)
Installing and Setting Up the NI-485
290(1)
NI-485 Serial Port Setup and Installation
291(2)
Software Implementation with the NI-485
293(1)
Chapter Summary
293(2)
Serial Port Programming in Visual BASIC
295(180)
Introduction
295(2)
Calling Windows API Functions to Interface The Serial Ports
297(34)
Windows API Functions
297(3)
Mapping to a Subroutine
300(1)
Mapping to a Function
301(1)
The API Viewer
301(3)
The API Functions, Structures and Constants in Serial Communications
304(1)
Nonoverlapped I/O
305(1)
Overlapped I/O
306(1)
A Visual Basic Program Using Win32 API Functions
307(2)
Developing Two Graphical User Interfaces
309(3)
Adding Win32 API Functions to the VBAPISerial Project
312(4)
Developing the Setup Form
316(2)
Developing the frmSerial Form
318(10)
Testing and Running the VBAPISerial Project
328(3)
Using the Active-X MSComm Control to Interface with the Serial Ports
331(113)
Overview of the Active-X MSComm Control
331(1)
Configuration Properties for the MSComm Control
332(1)
Data Transfer Properties for the MSComm Control
333(1)
Handshaking Properties for the MSComm Control
333(2)
Identification Properties for the MSComm Control
335(1)
The Operation of the MSComm Control
335(2)
A Serial Port Communication Program Developed with MSComm
337(1)
The Serial Interface Program for the Master Computer
338(22)
The Serial Interface Program for the Slave Computer
360(16)
A Serial Interface for the File Flow Control Between Two Computers
376(1)
The File Transfer Program for the Master Computer
376(22)
The File Transfer Program for the Slave Computer
398(13)
Developing a Serial Interface For the TLC548 8-Bit A/D Converter
411(1)
The Interface Circuit of the 8-Bit Serial A/D Converter
411(1)
The Interface Program Design
412(13)
Implementation of the Serial Interface for the 8-Bit Serial A/D Converter
425(2)
Developing a Serial Interface for the MAX187 12-Bit A/D Converter
427(1)
The Interface Circuit of the MAX-187 A/D Converter
428(1)
Designing the Graphical User Interfaces
429(1)
Coding the Project
430(12)
Implementation of the Serial Interface for a 12-Bit Serial A/D Converter
442(2)
Calling Dynamic Link Library to Interface with the Serial Ports
444(28)
Review of the DLL
444(1)
General Requirement for Calling a User-Defined DLL
445(1)
An Example of Calling DLL to Interface the Serial Port
446(1)
Configuring the Hardware for the Loop-Back Test
447(1)
Developing a Dynamic Link Library in Visual C++
447(13)
Developing a Visual Basic Testing Project
460(12)
Chapter Summary
472(3)
Serial Port Programming in LabVIEW
475(112)
Introduction
475(1)
A Basic Serial Port Interface for Writing and Reading Data
475(6)
Designing the Front Panel for the Loopback Testing Program
476(1)
Designing a Block Diagram for the Loopback Testing Program
477(3)
Running and Testing the Loopback Testing Program
480(1)
Advanced Serial Port Interfaces
481(36)
Using VISA to Interface with an 8-Bit Serial A/D Converter, TLC548
481(2)
Designing a Front Panel for the Main Program
483(2)
Develop a Block Diagram for the Main Program
485(3)
Designing a Front Panel for the Data Collection SubVI
488(2)
Developing a Block Diagram for the Data Collection SubVI
490(7)
Testing and Running the Project
497(2)
Using VISA to Interface with an 12-Bit Serial A/D Converter MAX187
499(2)
Designing a Front Panel for the Main Program
501(1)
Developing a Block Diagram for the Main Program
502(3)
Designing a Front Panel for the GetMAXData SubVI
505(2)
Developing a Block Diagram for the GetMAXData SubVI
507(7)
Configuring the GetMAXData VI as a SubVI
514(1)
Testing and Running the Project
515(2)
Calling the DLL from LabVIEW to Interface with the Serial Port
517(30)
Using Call Library Function and the Code Interface Node
517(1)
Using the Call Library Function to Access DLLs
517(2)
The Calling Conventions
519(1)
The Calling Parameters
520(1)
Calling Functions That Expect Other Data Types
521(1)
The Create. c File
522(1)
Multiple Calls to the Shared DLL Function
522(1)
Using the Call Library Function to Interface with the TLC548 Serial A/D Converter
523(1)
Interface Circuit of the TLC548 Serial A/D Converter
523(1)
Building the Function Protocol in LabVIEW
524(4)
Building the Block Diagram in LabVIEW
528(2)
Building DLL Functions in Visual C++
530(17)
Calling the CIN from LabVIEW to Interface with the Serial Port
547(38)
The Calling Procedure of the CIN
548(1)
Creating a CIN
548(2)
Creating a .c File
550(1)
Using the Visual C++ IDE to Compile the CIN Source Code
551(1)
Loading the CIN Object Code
552(1)
Using CIN to Interface with a Serial A/D Converter
552(1)
The Hardware Interface Circuit
552(1)
Designing of a Front Panel for the Project
553(1)
Using CIN to Develop a Block Diagram
553(6)
Using the Visual C++ 6.0 IDE to Develop the CIN Object Code
559(23)
Loading the CIN Object Code and Running the Project
582(3)
Other Methods for Interfacing with the Serial Port
585(2)
Serial Port Programming in MATLAB
587(72)
Introduction
587(1)
Using MEX-files to Interface with Serial Ports
587(35)
The MEX-File Format
588(1)
System Setup and Configuration
589(1)
Select a Compiler
589(2)
The Ingredients of a MEX-file
591(1)
Header File mex.h
591(1)
The mxArray
591(1)
Using the Gateway Function mexFunction in C/C++
592(3)
API Functions
595(1)
Creating a MEX-file in C/C++
596(1)
Using a MEX-file to Interface with the MAX187 ADC
597(2)
Configuring the C/C++ MEX-file
599(1)
Designing the Header File for the MEX-file
600(3)
Designing the DEF File
603(1)
Designing the Source File of the MEX-file
603(14)
Compiling and Building the Target MEX-file
617(1)
The Design of the MATLAB M-Function
618(1)
Testing and Running the Project
619(2)
Creating a MEX-file to Interface with the TLC548 ADC
621(1)
Using the Shared DLL to Interface with the Serial Ports
622(25)
Installing the Loadlibrary Interface
622(2)
Loading and Unloading the Shared Library
624(1)
Obtaining Information from the Library
624(1)
Calling Library Functions and Passing Arguments
625(1)
Converting Data Between MATLAB and External Functions
626(1)
Primitive Data Types
627(1)
Converting Data to Other Primitive Data Types
627(1)
Converting Data to References
628(1)
Converting to Strings
628(1)
Converting and Passing Structures
629(2)
Creating References
631(2)
Creating a Structure Reference
633(1)
Creating Reference Pointers
634(1)
Calling a Shared DLL
635(1)
Developing a Standard Win32 Dynamic Link Library
635(3)
Developing a MATLAB M-Function to Call the DLL
638(7)
Testing and Running the DLL Project
645(2)
Using the Serial Object to Interface with the Serial Ports
647(12)
The Instrument Control Toolbox
647(1)
Creating and Configuring a Serial Port Object
648(1)
Writing and Reading the Serial Port Object
649(1)
Event and Callback Functions
650(1)
The BytesAvailable Event and Its Callback Function BytesAvailableFcn
651(1)
The Output Empty Event and Its Callback Function OutputEmptyFcn
651(1)
The PinStatus Event and Its Callback Function PinStatusFcn
651(1)
The Timer Event and Its Callback Function TimerFcn
652(1)
The Break Interrupt Event and Its Callback Function BreakProcess ()
652(1)
Using the Serial Port Object to Perform Data Transmission
652(1)
Using the Graphical Tool to Create and Configure a Serial Port
652(4)
Developing a User-Defined Callback Function
656(1)
Developing the Main Serial Port Interface Program
656(2)
Testing and Running the Main Serial Port Interface Program
658(1)
Serial Port Programming in Smalltalk
659(70)
Introduction
659(1)
Overview of VisualWorks
659(5)
The VisualWorks Application Framework
660(1)
Installing and Starting VisualWorks
661(3)
A Simple Serial Port Interface Program
664(30)
Serial Port Testing Configuration
664(1)
Developing a Domain Model Class
665(3)
Developing an Application Model Class and a GUI
668(1)
Developing an External Interface Class
669(5)
Finish Coding of the SerialPort Project in VisualWorks
674(1)
Code for the Application Model
675(2)
Code for the Domain Model
677(3)
Parceling and Filing Out the Project Files
680(1)
Develop a Dynamic Link Library in the Visual C++ Domain
681(1)
Creating the Header File for the DLL
681(1)
Developing the Source File for the DLL
681(9)
Developing the Definition File for the DLL
690(1)
Finishing Coding of the SerialPort Project in VisualWorks
691(3)
An Advanced Serial Port Interface Program
694(35)
The Interface Circuit
695(1)
Developing the Dynamic Link Library
696(1)
The Header File for the DLL
696(2)
Code for the Source Files of the DLL
698(9)
Developing the Definition File for the DLL
707(1)
Building and Installing the DLL Target File
708(1)
Developing a Domain Model Class
708(4)
Developing an Application Model Class and a GUI
712(3)
Developing an External Interface Class
715(4)
Finish Coding of the SmallMAXDLL Project in VisualWorks
719(1)
Code of the Application Model Class
719(2)
Code for the Domain Model Class
721(3)
Testing and Running the Project
724(2)
Parceling and Filing Out the Project Files
726(3)
Serial Port Programming in Java
729(66)
Introduction
729(1)
Overview of the Java Native Interface
729(3)
Why We Need an Interface Between Java and the Native Code
729(1)
The JNI Development Environment
730(1)
How to Develop an InterFACE
731(1)
A Simple Serial Port Testing Program Using the JNI
732(37)
Setting Up the Java Development Environment in Windows 95/98/Me
732(1)
Setting Up the Java Development Environment in Windows 2000
733(1)
Setting Up the Java Development Environment in Windows XP
734(1)
Setting Up the Hardware for the Single-Port Loopback Test
734(1)
The Operation of the Interface Program
735(1)
Developing a GUI in Java
736(5)
Developing the Model Class File
741(2)
Developing the Interface Class File
743(2)
Developing the MSG Class File
745(1)
Developing a JNI-Style Header File
746(1)
Mapping Variables and Objects Between Java and C/C++
747(2)
Mapping String Variables
749(2)
Mapping Array Variables
751(3)
Developing a Dynamic Link Library as the Native Library
754(1)
Developing the Header File
755(2)
Developing the Source File
757(9)
Building and Installing the Native Library
766(1)
Running and Testing the Project
767(2)
An Advanced Interface Between the Serial A/D and Java
769(23)
Developing the View Class---Java GUI Window
770(3)
Developing the Model Class
773(2)
Developing the Interface Class
775(1)
Creating a JNI-Style Header File
775(2)
Developing the Native Library (the DLL Target File)
777(1)
Developing the DLL Header File
778(1)
Developing the DLL Source File
778(11)
Building and Installing the DLL Target File
789(1)
Testing and Running the MAX187 Project
790(2)
Chapter Summary
792(3)
Appendix 795(2)
Index 797

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program