部分定义
type
{ 串行通讯定义 }
{ 串口号 }
TCOMID = (ciCOM1, ciCOM2, ciCOM3, ciCOM4, ciCOM5, ciCOM6, ciCOM7, ciCOM8, ciCOM9,
ciCOM10, ciCOM11, ciCOM12, ciCOM13, ciCOM14, ciCOM15, ciCOM16);
{ 波特率 }
TBaudRate = (br110, br300, br600, br1200, br2400, br4800, br9600, br14400, br19200,
br38400, br56000, br57600, br115200, br128000, br256000);
{ 奇偶校验 }
TParity = (paNone, paOdd, paEven, paMark, paSpace);
{ 停止位 }
TStopBit = (sb10, sb15, sb20);
{ 数据位 }
TDataBit = (da4, da5, da6, da7, da8);
{ 串口设置属性 }
TComSet = record
csComID: TComID;
csBaud: TBaudRate;
csParity: TParity;
csDataBit: TDataBit;
csStopBit: TStopBit;
csOutQueue: Integer;
csInQueue: Integer;
csReadTimeOut: Integer;
csWriteTimeOut: Integer;
end;
const
{ 串口号 }
COMComID: array[TCOMID] of string = ('COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'COM10', 'COM11', 'COM12', 'COM13', 'COM14', 'COM15', 'COM16');
{ 波特率 }
COMBaudRate: array[TBaudRate] of Integer = (CBR_110, CBR_300, CBR_600, CBR_1200, CBR_2400, CBR_4800, CBR_9600, CBR_14400, CBR_19200, CBR_38400, CBR_56000, CBR_57600, CBR_115200, CBR_128000, CBR_256000);
{ 数据位 }
COMDataBit: array[TDataBit] of Integer = (4, 5, 6, 7, 8);
{ 奇偶性 }
COMParity: array[TParity] of Integer = (NOPARITY, ODDPARITY, EVENPARITY, MARKPARITY, SPACEPARITY);
ITEM_PARITY: array[TParity] of string = ('NONE', 'ODD', 'EVEN', 'MARK', 'SPACE');
{ 停止位 }
COMStopBit: array[TStopbit] of Integer = (ONESTOPBIT, ONE5STOPBITS, TWOSTOPBITS);
ITEM_STOPBIT: array[TStopbit] of string = ('1', '1.5', '2');