TApxComPort.LineError

TApxComPort

property LineError : Word

Returns a non-zero value if line errors have occurred since the last call to LineError.

It returns 0 if no errors were detected or the port is not yet open. Otherwise, it returns a numeric value from the following list that indicates the most severe pending error:

Constant
Value
Description
leBuffer
1
Buffer overrun in device driver
leOverrun
2
UART receiver overrun
leParity 
3
UART receiver parity error 
leFraming
4
UART receiver framing error
leCTSTO
5
Transmit timeout waiting for CTS
leDSRTO
6
Transmit timeout waiting for DSR
leDCDTO
7
Transmit timeout waiting for RLSD
leTxFull
8
Transmit queue is full

Line errors can occur during calls to any GetXxx or PutXxx method of the port. If your application must detect line errors, it should check LineError after each such call or group of calls, or it should install an OnTriggerLineError event handler.

The following example checks for line errors after receiving data with GetBlock:

ApxComPort.GetBlock(DataBlock, DataLen);
if ApxComPort.LineError <> 0 then
...error handling

See also: OnTriggerLineError