Hi @Lloyd Linnell ,
Thank you for posting here.
Here's an example of using serial port to receive data, and you can refer to it.
Private isOpened As Boolean = False
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Not isOpened Then
SerialPort1.PortName = "your port name"
SerialPort1.BaudRate = yourBaudRate
Try
' Open the serial port.
SerialPort1.Open()
isOpened = True
AddHandler SerialPort1.DataReceived, AddressOf ttest_DataReceived
Catch
MessageBox.Show("Failed to open serial port!")
End Try
Else
Try
' Close the serial port.
SerialPort1.Close()
isOpened = False
Catch
MessageBox.Show("Failed to close the serial port!")
End Try
End If
End Sub
Private Sub ttest_DataReceived(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
txtNext.Text = "x"
End Sub
Hope it could be helpful.
Besides, if the code cannot help you find the solution, please provide some related code about your question.
Best Regards,
Xingyu Zhao
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.