| Class T_QCCom32 (unit QCCom32) |
TComponent
ComPort class
| Constructors |
constructor Create(AOwner: TComponent);Component constructor
| Functions |
procedure Close;
destructor Destroy;
procedure Flush;
function Open: Boolean;
procedure Pick;
function Read: String;
function Write(const sData: String): Boolean;
procedure Timeout;Timeout event - user assigned code
function GetInCount: LongInt;
function GetTimeout: LongInt;
function IsOpen: Boolean;
procedure SetBaud(lBaudToSet: LongInt);
procedure SetPort(nPortToSet: Integer);
procedure SetTimeout(lTimeout: LongInt);Set the Timeout property to the specified milliseconds
procedure TimesUp(Sender: TObject);| Properties |
property Baud : LongInt
property EndOfResponse : String
property InCount : LongInt
property InUse : Boolean
property Opened : Boolean
property Port : Integer
property ResponseTime : LongInt
property ShowErrors : Boolean
property TimedOut : Boolean| Events |
event OnTimeout : TNotifyEvent| Variables |
boolExpired : Boolean;
boolInUse : Boolean;
boolShowErrors : Boolean;
formPickCom : TformPickCom;
hPort : LongInt;
lBaud : LongInt;
nPort : Integer;
pmOnTimeout : TNotifyEvent;
sInTerminator : String;
Timer : TTimer;| Constructors |
constructor Create(AOwner: TComponent);Public declarations } { Methods
Component constructor
| Functions |
procedure Close;Close the COM port
destructor Destroy;Component destructor
procedure Flush;Flush the port by reading any characters in the queue
function Open: Boolean;Opens the COM port, returns True if ok
procedure Pick;Pops a dialog to pick the COM port number
function Read: String;Reads a string from the port, puts it into pchBuffer, returns the number of characters read
function Write(const sData: String): Boolean;Write a string out the COM port, return true if all chars written
procedure Timeout;Protected declarations
Timeout event - user assigned code
function GetInCount: LongInt;Return the number of bytes waiting in the queue
function GetTimeout: LongInt;Get the current timeout setting
function IsOpen: Boolean;Return True if port is open
procedure SetBaud(lBaudToSet: LongInt);Set the baud rate property
procedure SetPort(nPortToSet: Integer);Set the Port property
procedure SetTimeout(lTimeout: LongInt);timeout event } { functions
Set the Timeout property to the specified milliseconds
procedure TimesUp(Sender: TObject);Timer procedure - signals a timeout
| Properties |
property Baud : LongIntbaud rate
property EndOfResponse : Stringstring to signal end of input from external device
property InCount : LongIntnumber of characters received
property InUse : Booleanflag indication if port is blocked
property Opened : Booleanflag indicating if port is open
property Port : IntegerCOM port
property ResponseTime : LongIntPublished declarations } { timeout for waiting for a response, in mS
property ShowErrors : Booleanflag to enable showing error message boxes
property TimedOut : Booleanflag set when a timeout occured
| Events |
event OnTimeout : TNotifyEventtimeout event
| Variables |
boolExpired : Boolean;response terminator string
boolInUse : Boolean;true to enable error boxes
boolShowErrors : Boolean;dialog box to pick a port
formPickCom : TformPickCom;timeout timer
hPort : LongInt;Private declarations
lBaud : LongInt;port #, 1-based
nPort : Integer;handle from OpenComm
pmOnTimeout : TNotifyEvent;true while port is blocked, waiting for response } { Events (method pointers) user can assign code to these
sInTerminator : String;baud rate
Timer : TTimer;set true when a timeout occurs