Receiving serial data - gb.net
Posted
#1
(In Topic #1196)
Trainee
'******** Incoming serial data ********
PUBLIC SUB SComm _Read()
SLEEP 0.025
TRY READ #SComm , Rx, Lof(SComm )
IF ERROR THEN
Message.info(No received data!
End if
I’m used to the oncomm event in vb which is triggered when a serial port receives data - having to poll the port on the off chance that data arrives doesn’t seem right - does anyone know if there is an equivalent of oncomm? - thanks in anticipation.
Posted
Guru

The event should require that the object is attached either when creating or after.
hSerialPort = New SerialPort ( ) As "SComm"
or ..
hSerialPort = New SerialPort ( )
Object.Attach(hSerialPort, Me, "SComm")
then your SComm_Read() event should work.
Please post some example code or a small application showing the problem if you still need help
Posted
Regular

Uhmmmm…that is, are you looking for an Event that will be raised only when the serial port receives data ?PeteMarsh said
I’m used to the oncomm event in vb which is triggered when a serial port receives data
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Guru

TRY READ #SComm , Rx, Lof(SComm )
If Rx is your String I think should be..
Rx = READ #SComm , Lof(SComm)
1 guest and 0 members have just viewed this.


