pascalSCADA OPM: SerialPort: Class TSerialPortDriver

Pascal SCADA OPM

Class TSerialPortDriver

Unit

SerialPort

Declaration

type TSerialPortDriver = class(TCommPortDriver)

Description

Serial port driver. Working on Windows, Linux and FreeBSD.

:

See also
TCommPortDriver
The base class of an communication port driver.

Hierarchy

Overview

Methods

Protected procedure Read(Packet:PIOPacket); override;
Protected procedure Write(Packet:PIOPacket); override;
Public constructor Create(AOwner:TComponent); override;

Properties

Published property COMPort: AnsiString read PPortName write SetCOMPort;
Published property Timeout: LongInt read PTimeout write SetTimeOut stored true default 5;
Published property WriteReadDelay: LongInt read PRWTimeout write SetRWTimeout stored true default 20;
Published property BaudRate: TSerialBaudRate read PBaundRate write SetBaundRate stored true default br19200;
Published property DataBits: TSerialDataBits read PDataBits write SetDataBits stored true default db8;
Published property Paridade: TSerialParity read PParity write SetParity stored true default spNone;
Published property StopBits: TSerialStopBits read PStopBits write SetStopBits stored true default sb1;
Published property BackupPortSettings: Boolean read PBackupPortSettings write PBackupPortSettings stored true default false;
Published property AcceptAnyPortName: Boolean read PAcceptAnyPortName write PAcceptAnyPortName stored true default false;
Published property OnCommPortOpened;
Published property OnCommPortOpenError;
Published property OnCommPortClosed;
Published property OnCommPortCloseError;
Published property OnCommErrorReading;
Published property OnCommErrorWriting;
Published property ReadRetries;
Published property WriteRetries;

Description

Methods

Protected procedure Read(Packet:PIOPacket); override;
 
Protected procedure Write(Packet:PIOPacket); override;
 
Public constructor Create(AOwner:TComponent); override;

: Creates a new serial port driver with the following settings: baud rate 19200bps, 8 data bits, 1 stop bits, without parity check and 100ms of timeout.

See also
TCommPortDriver
The base class of an communication port driver.

Properties

Published property COMPort: AnsiString read PPortName write SetCOMPort;

: Serial port driver to be used. This names depends of operating system. On Windows the name is COMx, ob Linux is ttySx and on FreeBSD is cuadx.

Published property Timeout: LongInt read PTimeout write SetTimeOut stored true default 5;

: How many time a read or write operation can take.

Published property WriteReadDelay: LongInt read PRWTimeout write SetRWTimeout stored true default 20;

: Delay between commands of read and write.

Published property BaudRate: TSerialBaudRate read PBaundRate write SetBaundRate stored true default br19200;

: Serial port baud rate.

See also
TSerialBaundRate
Published property DataBits: TSerialDataBits read PDataBits write SetDataBits stored true default db8;

: Data byte size.

See also
TSerialDataBits
Published property Paridade: TSerialParity read PParity write SetParity stored true default spNone;

: Parity check.

See also
TSerialParity
Published property StopBits: TSerialStopBits read PStopBits write SetStopBits stored true default sb1;

: Stop bits.

See also
TSerialStopBits
Published property BackupPortSettings: Boolean read PBackupPortSettings write PBackupPortSettings stored true default false;

: If True the driver will do a of the older settings of the serial port before open it, and restore when it's closed.

Published property AcceptAnyPortName: Boolean read PAcceptAnyPortName write PAcceptAnyPortName stored true default false;

: If True the driver will accept any comm port name, even if it don´t exists on your system.

Published property OnCommPortOpened;

:

See also
TCommPortDriver.OnCommPortOpened
Published property OnCommPortOpenError;

:

See also
TCommPortDriver.OnCommPortOpenError
Published property OnCommPortClosed;

:

See also
TCommPortDriver.OnCommPortClosed
Published property OnCommPortCloseError;

:

See also
TCommPortDriver.OnCommPortCloseError
Published property OnCommErrorReading;

:

See also
TCommPortDriver.OnCommErrorReading
Published property OnCommErrorWriting;

:

See also
TCommPortDriver.OnCommErrorWriting
Published property ReadRetries;

:

See also
TCommPortDriver.ReadRetries
Published property WriteRetries;

:

See also
TCommPortDriver.WriteRetries

Author


Generated by PasDoc 0.14.0.