for i:=1 to 30 do begin cpd.PortName:= '\\.\com'+IntToStr(i); if cpd.Connect then // здесь попытка обнаружить СВОЙ девайс ......