This is mnoGoSearch's cache of https://lists.gambas-basic.org/pipermail/user/2008-February/018239.html. It is a snapshot of the page as it appeared during last crawling. The current page could have changed in the meantime.

Last modified: Fri, 08 Feb 2008, 17:19:09 CET    Size: 3412
[Gambas-user] Serial Port Reading Issue

[Gambas-user] Serial Port Reading Issue

Marco Mascia marco at ...1785...
Fri Feb 8 17:19:09 CET 2008


Hi there!
We have some trouble making a Serial port Read (first time that i work 
on it).

Our card reader is a device that sends a "await command" every 500 ms
(Note: the device works on a serial port standard RS232 br: 19200, 
8-N-1, no flow control.)

if we do from shell cat /dev/ttyS0/ we obtain:

INSERISCI COMANDO
INSERISCI COMANDO
MEMORIZZAZIONE CODICE ->101027256<- (a card read)
INSERISCI COMANDO
...
etc


Instead a read on gambas console with this code:

PUBLIC SUB Sport_Read()

DIM s AS String

READ #Sport, s, Lof(Sport)
print s

END


we obtain:


INSERISC
I COMANDO

INSERISC
I COMANDO

MEMORIZZ
AZIONE CODICE ->10102725
6<-

INSERISC
I COMANDO
...
etc

problems:

Weird output or i am a noob and i miss something? :D
I need to extract the card code between "->" and "<-" from the stream.
any help/suggestion?

anybody knows how to obtain the same result of cat command inside gambas?

tnx in advance.

---
Marco




More information about the User mailing list