SerialConnection.DataReceived

From Xojo Documentation

Event


SerialConnection.DataReceived()

New in 2019r2

Supported for all project types and targets.

Occurs when additional data has been received.

Notes

It is your responsibility to read the received data using Read or ReadAll methods.

fa-exclamation-circle-32.png
This event is reentrant which means you should not process the data you have received in this event. Instead, copy it into a property and then use a Timer to process the data. Specifically, use Timer.CallLater method.

Sample Code

While MySerial.BytesAvailable > 0
Var s As String = MySerial.ReadAll
DataBuffer = DataBuffer + s // DataBuffer is a property
MySerial.Poll
Wend