Receiving serial data - gb.net
Posted: Wednesday 28th February 2024 2:01am
I have been able to set up a serial port, set the baud rate etc, use send to output data, and verified on oscilloscope. All very simple in the end. I’m now looking to read a reply. With gb.net enabled I can see there is an event called read but examples of its use don’t seem to be event driven :
'******** 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.
'******** 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.