[Gambas-user] Issue/Problem with Serial Port Component
nando
nando_f at ...951...
Tue Jun 6 17:35:23 CEST 2006
I use the Serial Port Control.
I never considered OPENing the device.
I do have the code working with the LOF() minus one
to force another event after. It works 100% this way :)
-Fernando
---------- Original Message -----------
From: Benoit Minisini <gambas at ...1...>
To: nando_f at ...951..., mailing list for gambas users
<gambas-user at lists.sourceforge.net>
Sent: Mon, 5 Jun 2006 23:32:41 +0200
Subject: Re: [Gambas-user] Issue/Problem with Serial Port Component
> On Sunday 04 June 2006 23:52, nando wrote:
> > I have tested this for hours...
> >
> > PUBLIC SPortReceiveString AS STRING
> >
> > SUB SPort_Read()
> >
> > DIM s AS STRING
> > DIM ls AS INTEGER
> >
> > ls = LOF(SPort)
> > 'IF ls > 1 THEN DEC ls '<---always read 1 less than what LOF offers
> >
> > READ # SPort, s, ls
> >
> > PRINT s '<--help to debug
> >
> > SPortReceiveString = SPortReceiveString & s 'accumulate input
> >
> > 'There is some testing of SPortReceiveString here
> >
> > END
> >
> > Comments:
> > Serial Port data received is in groups of about 120 bytes every 10 minutes.
> > Every READ event is a small bunch of characters received.
> >
> > I have found out that it consistently happens that
> > the during the SPort_Read event of the second last bunch of chars,
> > there are more data being receive by the kernel or SPort control
> > but an event will not happen.
> >
> > If I unREM the REMed line...
> >
> > IF ls > 1 THEN DEC ls '<---always read 1 less than what LOF offers
> >
> > then it works perfect every time.
> > An event will happen for the very past burst of serial data in.
> >
> > -Fernando
> >
>
> Do you use the SerialPort control or a device opened with OPEN ... FOR
> READ ?
>
> The first one use code written by Daniel Campos to read the data from
> the serial port, and the second code written by me. I don't know why,
> but there aren't the same...
>
> Regards,
>
> --
> Benoit Minisini
>
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------
More information about the User
mailing list