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
|