On May 4, 8:29 am, Quentin <quinn.willoug. ..@gmail.comwro te:
I would like to create a serial port listener that starts recording
data to a text file as soon as the port starts receiving the data.
How do I trigger the program to start running when data is sent to
that port.
Any help with the code would be great!
Thank you!!
Hi,
I have just started working with the SerialPort class availble in,
Imports System.IO.Ports
You can declare an instance,
Private WithEvents serialPort As SerialPort = New SerialPort()
It have a recieved event,
Private Sub serialPort_Data Received(ByVal sender As System.Object,
ByVal e As System.IO.Ports .SerialDataRece ivedEventArgs) Handles
serialPort.Data Received
This event is fired when some data arives at the port.
In there I use the serial port method,
inData = serialPort.Read Existing()
and then do whatever needs to be done with the data.
I am just learing it myself.
Jeff