Case btnOpenPort.Tag of 0: begin if RF_OpenPortF(cb_Com.ItemIndex + 1) = true then begin bISCom := 1; btnOpenPort.Tag:=1; btnOpenPort.Caption:='关闭串口'; ShowMessage('打开串口成功'); end else ShowMessage('打开串口失败'); end; 1: begin if RF_ClosePortF = true then begin bIsCom := 0; btnOpenPort.Tag:=0; btnOpenPort.Caption:='打开串口'; ShowMessage('关闭串口成功'); end;
一般机器都有com1,com2两个com口吧?
设定什么?
是想知道设备被WINDOW到底分配在哪个端口上
什么设备?USB转串口的设备?
0:
begin
if RF_OpenPortF(cb_Com.ItemIndex + 1) = true then
begin
bISCom := 1;
btnOpenPort.Tag:=1;
btnOpenPort.Caption:='关闭串口';
ShowMessage('打开串口成功');
end
else
ShowMessage('打开串口失败');
end;
1:
begin
if RF_ClosePortF = true then
begin
bIsCom := 0;
btnOpenPort.Tag:=0;
btnOpenPort.Caption:='打开串口';
ShowMessage('关闭串口成功');
end;
一般根据系统自动设为COM3(如果系统自带COM1 COM2的话)标枪驱动一般有设置..设置哪个就是哪个..建议在程序里预设为COM(1-6)搜索..有反应的才设为你要用的COM口..其实也是一个容错的过程..