[DUG] TComPort issue

Willie Juson willie.juson at satara.co.nz
Thu Mar 11 09:28:47 NZDT 2010


Hi,

 

It's not continuous, we're using a chroma-meter to measure fruit colours so
it's discreet packets of data transmitted when the trigger on the meter is
pushed. I execute a ComPort.ClearBuffer call in the AfterOpen event of the
Comport, if that's what you mean. We're getting a similar issue with a set
of scales which only transmits a single weight value when it's print button
is pushed.

 

 

 

From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Maurice Butler
Sent: Wednesday, 10 March 2010 8:58 p.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] TComPort issue

 

do you flush the buffer of the comport before you start trying to use it or
do you have a continous stream of data coming in?

 

 

-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Willie Juson
Sent: Wednesday, 10 March 2010 11:14 a.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] TComPort issue

Another thing I forgot to add is if I put a break-point anywhere in the
onRXBuf code then the corruption doesn't occur.....

 

From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Willie Juson
Sent: Wednesday, 10 March 2010 10:57 a.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG] TComPort issue

 

Hi,

 

Is anyone using the TComPort component set successfully with D2009/D2010?

 

We've been using it with no issues up until we upgraded to D2010. I've
downloaded the latest version of the TComPort library I can find (ver 4 beta
for D2010) and managed to get it installed ok then modified my program where
it handles the RXBuf event - the "Buffer" parameter has changed to a
PAnsiChar data type.

 

What happens now is the first time I load the form (from another form in my
application) and communicate with my device it works perfectly, however if I
close the form and reopen it then the "Buffer" PAnsiChar returned in the
event appears to be corrupted. If I completely close my app then restart it
then same thing, first time into the form it works fine, after that it's
corrupted.

 

An example of the "Buffer" output is...

 

First time in   OK00#13#10   (calibrating) and
OK00,040931,051754,018356#13#10 getting a reading.

 

Second time in  OK00#13#10Lo   (calibrating)  and
OK00,041o100,0521o06,01857o1#13#1001857o  getting a reading. Garbage is
added into the result.

 

Anyone got any ideas?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100311/476d14c5/attachment.html 


More information about the Delphi mailing list