[Gambas-user] Issue/Problem with Serial Port Component
ron
ronstk at ...239...
Mon Jun 5 00:44:05 CEST 2006
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
>
What is the real content of those 120 bytes and what program
send the data?
I'm thinking on a CR/LF problem.
*nix use normal only one of them and if both are used
the are CR/LF (or LF/CR).
Windows use always both but reverse to *nix.
One of them is the line terminator in gambas and when I'm right
not returned in the string
With READ # SPort, s, ls you use a binairy transfer and this
should include all bytes.
More information about the User
mailing list