About PortController
Introduction
Purchasing PortController
Redistributing PortController
License Agreement
Support
Getting Started
How to Use PortController
Using PortController with Visual Basic
Using PortController with Visual C++
Using PortController with Delphi
How to Use Events
Handling Events in Visual Basic
Handling Events in Visual C++
Handling Events in Delphi
PortController Sample Projects
Reading and Writing Binary Data
Handling PortController Errors
Reference
Properties
BaudRate Property
Break Property
BytesUsedRQ Property
BytesUsedTQ Property
Cd Property
Cts Property
DataBits Property
Dsr Property
Dtr Property
DtrDsr Property
EnableReadOnEventChar Property
EventChar Property
Parity Property
PortHandle Property
PortName Property
Ring Property
Rts Property
RtsCts Property
StopBits Property
XonXoff Property
Methods
ClearRQ Method
ClearTQ Method
Close Method
GetErrorStatus Method
Open Method
Read Method
ReadBinary Method
Write Method
WriteBinary Method
SendXoff Method
SendXon Method
Events
BreakSignal Event
CdToggle Event
CtsToggle Event
DataReceived Event
DsrToggle Event
Error Event
EvtCharReceived Event
Ring Event
TQEmpty Event

PortController Events

PortController events are signals that PortController sends to your application when something interesting on the port has occurred. For example, when data is received in the incoming buffer you can use PortController's DataReceived event to call your application's read function.

A powerful technique for reading from the port is to handle the EvtCharReceived that is fired when a specific character is received in the incoming buffer. This is useful if you are reading formatted data that is delimited by a character such as a newline or a comma. When the delimiter you specify is received on the line, PortController fires the event and optionally reads the data from the incoming buffer and supplies it to your handling function.

The complete list of events fired by PortController is as follows:

Event Argument Description
BreakSignal None Fired when the Break signal is received.
CtsToggle short/Integer CtsState Fired when the state of the Clear-to-Send line changes.
DsrToggle short/Integer DsrState Fired when the state of the Data-set-Ready line changes.
CdToggle short/Integer CdState Fired when the state of the Carrier Detect line changes.
DataReceived None Fired when a character is received and placed in the buffer.
Error None Fired when a line-status error occurs.
EvtCharReceived string ReadBuffer, long NumBytesRead Fired when the event character is received and placed in the input buffer.
Ring None Fired when the state of the Ring line changes from high to low.
TQEmpty None Fired when the last character in the output buffer is sent.

For detailed instructions and examples of handling PortController events, see Handling Events in Visual Basic, Handling Events in Visual C++ and Handling Events in Delphi