TCom port; int i,j; BYTE l[17]; port.SetPortA("COM5"); port.OpenPort(); if(port.IfConnected()) { port.SetBaund(38400); port.SendBuffer(mm,8); i=GetTickCount(); j=0; while((j<17)&&(GetTickCount()-i<18)) { l[j]=port.GetByte(); j++; } } else { Application->MessageBox("порт закрыт","СОМ порт ошибка",MB_OK); } port.ClosePort();