[futurebasic] Re: [FB] [X-FB] Strings, Communication, Resources, and more

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: Paul Bruneau <paul_bruneau@...>
Date: Mon, 07 Jun 1999 16:23:52 -0400
I'm not sure I follow, but it sounds to me like yes, during debugging,
your buffer gets filled up. But I'm sure that during actual runtime,
your program is cycling cycling cycling waiting for that next character
to come from the Casio.

When you say "it grabs a bunch of characters and places them into a
buffer" I think you are thinking wrongly. What is happening is that one
character comes down the serial line, and gets put into the buffer by
the Mac. Very low level. Then your program checks the buffer for content
and grabs it.

My theory is that you have nothing to gain by grabbing the entire buffer
(with a blockmove for instance) even if you could (which I'm not sure
you can) because your program is likely waiting on the buffer 99 percent
of the time. Unless your program is doing some serious thinking during
the transfer...And if it is doing that, what will getting all the
characters from the buffer at once get you?? Your program will still
have to plod along processing the characters, I think. But I don't think
that is what is happening.

My theory is that the bottleneck is the serial port, which is running at
what speed? 9600? 19200? 38400?? Those are pretty piddly compared with
how fast FutureBasic goes, in my experience...

I suggest putting in a counter to count how many times your program
checks for characters in the serial buffer and finds none. I'm sure
you'll find it large. 

Now, for your questions:

bytesInBuffer% = LOF (port, 1) 'from Handbook page 172

I think you'll be finding this number very very small at any given time,
except perhaps during debugging

I can't find how to get the buffer itself...sorry.


tedd wrote:
> >Hey, tedd-
> >
> >I can't believe that your program, copying the characters one at a time
> >from the buffer into whatever data structure you might want to put them
> >into could possibly be slower than the FASTEST serial connection you can
> >make to your Casio...
> >
> >In other words, just grab the characters and work with them.
> >
> >There is no physical "packet" of data on your serial line...the
> >characters are coming over one at a time, so just read them. I'm sure
> >your program can beat the serial port by many many times. Am I not
> >thinking right?
> >
> >PB
> PB:
> It's a mystery to me and something that I still don't fully understand.
> And, I believe that it's not as simple a problem as it may appear.
> At present, I get the characters one at a time from the buffer. I don't
> have any problem with that. However, when I turn-on the debugger, and look
> at the character stream, I find that the process is way-ahead of me at
> getting the characters. In other words, it grabs a bunch of characters and
> places them into a buffer. From there, I then read them one at a time from
> the buffer-- which is far behind the filling-the-buffer process. As I said,
> every thing works! But, if I could grab and store the entire contents of
> the buffer, instead of taking it a character at a time, then I believe that
> the over all performance would be improved.
> So... How does one grab the contents of a buffer? How does one know how
> much is in the buffer? These are the questions that I have.
> tedd