Just wondering how to solve this problem i have a stream of data coming in to my serial port which is the following at the moment however in will be a random number 0 - 512 and it repeats:

Code:
190
120
150
110
i'm reading it with:

Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        current_time.Text = DateTime.Now.ToLocalTime

        SerialPort1.Open()

        Dim data As String
        data = SerialPort1.ReadLine()
        SerialPort1.Close()

        Dim Setup_A_data As New StreamWriter("serial_data.text", True)
        Setup_A_data.WriteLine(data)
       

        Setup_A_data.Close()

end sub
the output im getting is

Code:
0
120
150
1110
190
120
1
120
150
110
150
110
190
10
190
120
1
120
150
110
150
the output should be equal to the input from the serial line but its not
do i need to be using a request to send or something else and if so how would i archive this?
Thanks Michael