Hi,
Here is a small code to read Serial port raw data like Hyper-terminal to read Barcode data from Serial Port. See if it helps you.
Imports System
Imports System.IO
Imports System.IO.Ports
Public Class BARCODEReader
Delegate Sub SetTextCallback(ByVal [text] As String) 'Added to prevent threading errors during receiveing of data
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
BarcodePass.Text = ""
SerialPortSupervisor.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub SerialPortSupervisor_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPortSupervisor.DataReceived
ReceivedText(SerialPortSupervisor.ReadExisting()) 'Automatically called every time a data is received at the serialPort
End Sub
Private Sub ReceivedText(ByVal [text] As String)
'compares the ID of the creating Thread to the ID of the calling Thread
If Me.BarcodePass.InvokeRequired Then
Dim x As New SetTextCallback(AddressOf ReceivedText)
Me.Invoke(x, New Object() {(text)})
Else
Me.BarcodePass.Text &= [text]
End If
End Sub
End class