Board index » cppbuilder » TmsAsync
Andrew Fedoseev
CBuilder Developer |
TmsAsync2005-10-03 03:25:29 PM cppbuilder109 Hi There! I have a problem with Reading Com port with ReadBuf(var Buf; Count: Integer): Integer, function provided in TMs Async pack... the code is the following : TVaComm *Com1; //opening Com port: Com1->Open(); //writing in com port err = Com1->WriteBuf(buf,14); // reading com port result = Com1->ReadBuf(&res[0],14); When i run application it successfully writes 14 bytes into Com port but whenever i read it i get error - err=0. And What said in Help files about Readbuf "Buf is any variable, Count is an expression of type Integer. Read reads Count or fewer bytes from the com port. The actual number of bytes read (less than or equal to Count) is returned in it's Result. If a read operations fails it returns 0. Never try to read bytes manually by specifying the count parameter yourself. Use the Count parameter returned in "OnData Event." OnData Event??? there are no such events for that component! Thanks in advance Andrew. |