Hey all of ya,
Well, i use the RS232.vb for the serial communication but the problem is that it handles the data in ASCII.
I searched in the RS232.vb and i came across 3 places where the ASCII is mentioned:
code:--------------------------------------------------------------------------------
This read-only property returns a string that represents
the data coming into to the Comm Port.
Overridable ReadOnly Property InputStreamString() As String
Get
Dim oEncoder As New System.Text.ASCIIEncoding()
Return oEncoder.GetString(Me.InputStream)
End Get
End Property
--------------------------------------------------------------------------------
code:--------------------------------------------------------------------------------
This subroutine uses another thread to write to the Comm Port. It
raises TxCompleted when done. It writes a string.
Public Overloads Sub AsyncWrite(ByVal Buffer As String)
Dim oEncoder As New System.Text.ASCIIEncoding()
Dim aByte() As Byte = oEncoder.GetBytes(Buffer)
Me.AsyncWrite(aByte)
End Sub
--------------------------------------------------------------------------------
code:--------------------------------------------------------------------------------
This subroutine writes the passed string to the
Comm Port to be written.
Public Overloads Sub Write(ByVal Buffer As String)
Dim oEncoder As New System.Text.ASCIIEncoding()
Dim aByte() As Byte = oEncoder.GetBytes(Buffer)
Me.Write(aByte)
End Sub
--------------------------------------------------------------------------------
how can i modify these codes to handle the data flow to and from the serial port in binary?
Well, i use the RS232.vb for the serial communication but the problem is that it handles the data in ASCII.
I searched in the RS232.vb and i came across 3 places where the ASCII is mentioned:
code:--------------------------------------------------------------------------------
This read-only property returns a string that represents
the data coming into to the Comm Port.
Overridable ReadOnly Property InputStreamString() As String
Get
Dim oEncoder As New System.Text.ASCIIEncoding()
Return oEncoder.GetString(Me.InputStream)
End Get
End Property
--------------------------------------------------------------------------------
code:--------------------------------------------------------------------------------
This subroutine uses another thread to write to the Comm Port. It
raises TxCompleted when done. It writes a string.
Public Overloads Sub AsyncWrite(ByVal Buffer As String)
Dim oEncoder As New System.Text.ASCIIEncoding()
Dim aByte() As Byte = oEncoder.GetBytes(Buffer)
Me.AsyncWrite(aByte)
End Sub
--------------------------------------------------------------------------------
code:--------------------------------------------------------------------------------
This subroutine writes the passed string to the
Comm Port to be written.
Public Overloads Sub Write(ByVal Buffer As String)
Dim oEncoder As New System.Text.ASCIIEncoding()
Dim aByte() As Byte = oEncoder.GetBytes(Buffer)
Me.Write(aByte)
End Sub
--------------------------------------------------------------------------------
how can i modify these codes to handle the data flow to and from the serial port in binary?