Page 1 of 1

How many bytes have I receved on my serial port?

Posted: Thu Jun 12, 2003 4:36 pm
by Alberto
Dear PureBasicUsers,

I've just done a program that read and write on the serial port to program a tachometer.
I've write it modifying the PureFrog program made by Fred.

There is only a little problem.

The problem is that I can't know how may bytes I've receveid on the serial port (nothing, 1,2,3 or ... X bytes?)
In the PureFrog program the problem is resolved by a stop character ("Z"). When reading the rx buffer a "Z" is encountered it means that there are no other bytes to read.
If I receive bytes with no stop character (the tachometer was not projected to end his trasmission with "Z" or other stop character) how can I detect when stop to read?

Note that:
Eof() doesn't function
Lof() cant't tell me the length of the rx buffer
Loc() always write 0

Ciao
Alberto