[Gambas-user] Issue/Problem with Serial Port Component

nando nando_f at ...951...
Mon Jun 5 01:58:11 CEST 2006


The speed is 9600 baud.
Yes they are sent in one block, but that block is at 9600 baud.
The _read fires when there is at least one and by the time the code
to actually READ there may be three or four or maybe many more.
This means that there are some available to read when the event fires.
If the event takes a long time to do something, then there will
be more available the next time the event fires.

Gambas/Serial component is responsible to fire _read - which
I am lead to believe is when LOF > 0 for that device.

Something inside the ASCII stream cannot trigger the event.
It is the fact that there is at least something available which
triggers the event.

The following is totally false:

    > If send in one part then a READ LOF() should read all
    > and there is no more to read for a last bunch.

...because of differing speeds between
the computer to process and the 9600 stream.  When one char has arrived,
Gambas can read it, put it in a string far before the second char has
arrived.  It is even more pronounced at slower speeds.

The first LOF(s) only reads a few because only a few have arrived.
The computer is much faster than a stream of 9600 baud chars.

-Fernando


---------- Original Message -----------
From: ron <ronstk at ...239...>
To: nando_f at ...951..., mailing list for gambas users
<gambas-user at lists.sourceforge.net>
Sent: Mon, 5 Jun 2006 01:44:28 +0200
Subject: Re: [Gambas-user] Issue/Problem with Serial Port Component

> On Monday 05 June 2006 01:22, nando wrote:
> > The problem here is that if you read *ALL* LOF(SPort) every _read event,
> > there will not be a _read event for the last bunch.
> >
> 
> Interesting,
> 
> Aren't those 120 bytes send in one block?
> Then the question is how is the _read event fired?
> 
> There must be a byte given the length on start or
> a timeout for getting the next byte from serial device.
> 
> If send in one part then a READ LOF() should read all
> and there is no more to read for a last bunch.
> 
> So there must be something in the ASCII stream that
> triggers the _Read event before all 120 bytes as available.
> 
> Is the first time the _Read event occur the LOF(SPort) the 
> same as the ASC(left(s))-1 ???
> 
> Ron
> 
> _______________________________________________
> 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