Board index » cppbuilder » TmsAsync

TmsAsync


2005-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.
 
 

Re:TmsAsync

Andrew,
TMSA32 works great. Check out events for rx data and rx flag. don't
forget to enable the events on the design time properties page.
If you still have trouble, email me and I'll send an example from a
piece of kluge code I use to monitor serial port activity.
Tom Woodrow
www.dacworks.com
 

Re:TmsAsync

Thanks Tom.
Never doubt that TMS rocks...
However - just curious - could you sent this piece of code
to me?
I used to work with CreateFile() and stuff till then i finally bought Tms
Async pack few days ago, so i'm not that familiar with it as you ;)
"Tom Woodrow" < XXXX@XXXXX.COM >???????/???????? ? ????????
?????????: news:4340e6e8$ XXXX@XXXXX.COM ...
Quote
Andrew,

TMSA32 works great. Check out events for rx data and rx flag. don't
forget to enable the events on the design time properties page.

If you still have trouble, email me and I'll send an example from a
piece of kluge code I use to monitor serial port activity.

Tom Woodrow
www.dacworks.com

 

{smallsort}

Re:TmsAsync

Andrew,
Sorry that I havn't had time to cull out ant TmsAsync code but was
curious if you have made any progress in the mean time?
Tom Woodrow
Andrew Fedoseev wrote:
Quote
Thanks Tom.
Never doubt that TMS rocks...
However - just curious - could you sent this piece of code
to me?
I used to work with CreateFile() and stuff till then i finally bought Tms
Async pack few days ago, so i'm not that familiar with it as you ;)

"Tom Woodrow" < XXXX@XXXXX.COM >???????/???????? ? ????????
?????????: news:4340e6e8$ XXXX@XXXXX.COM ...

>Andrew,
>
>TMSA32 works great. Check out events for rx data and rx flag. don't
>forget to enable the events on the design time properties page.
>
>If you still have trouble, email me and I'll send an example from a
>piece of kluge code I use to monitor serial port activity.
>
>Tom Woodrow
>www.dacworks.com
>



 

Re:TmsAsync

yes. thank you. Actually i didnt get in the rx events too much but i
noticed a "Count" parameter there, so now i clearly understand what they
meant in help file.
"Tom Woodrow" < XXXX@XXXXX.COM >???????/???????? ? ????????
?????????: news: XXXX@XXXXX.COM ...
Quote
Andrew,

Sorry that I havn't had time to cull out ant TmsAsync code but was
curious if you have made any progress in the mean time?

Tom Woodrow



Andrew Fedoseev wrote:

>Thanks Tom.
>Never doubt that TMS rocks...
>However - just curious - could you sent this piece of code
>to me?
>I used to work with CreateFile() and stuff till then i finally bought
Tms
>Async pack few days ago, so i'm not that familiar with it as you ;)
>
>"Tom Woodrow" < XXXX@XXXXX.COM >???????/???????? ? ????????
>?????????: news:4340e6e8$ XXXX@XXXXX.COM ...
>
>>Andrew,
>>
>>TMSA32 works great. Check out events for rx data and rx flag. don't
>>forget to enable the events on the design time properties page.
>>
>>If you still have trouble, email me and I'll send an example from a
>>piece of kluge code I use to monitor serial port activity.
>>
>>Tom Woodrow
>>www.dacworks.com
>>
>
>
>