imports system.io.ports
Public Class Form1
Public Delegate Sub myDelegate()
Public Sub updateTextBox()
Dim strarr(8) As String
Dim str1 As String
str1 = port.ReadLine
W1.AppendText(str1)
strarr =str1.Split(",")
Dim x1 As Double
x1 = Val(strarr(0))
w1.text=(x1)
W1.ScrollToCaret()
End Sub
Private Sub port_DataReceived(ByVal sender As Object, ByVal e AsSystem.IO.Ports.SerialDataReceivedEventArgs) Handles port.DataReceived
W1.Invoke(New myDelegate(AddressOf updateTextBox), New Object() {})
End Sub
private sub btn_connect
With SerialPort1 'Connection for my serial port
.Close()
.PortName = "COM3"
.BaudRate = 9600
.Parity = Parity.None
.DataBits = 8
.StopBits = StopBits.One
.DtrEnable = True
.RtsEnable = True
.ReceivedBytesThreshold = 1
End With
SerialPort1.Open()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
private sub btn_disconnect
seriaport1.close
end sub