subrutinas_rs232_vbnet

Codigo para conexion RS232:

Public Sub enviar_rs232( ByVal caracter As String ) SerialPort1.Write(caracter) With txtDataReceived .AppendText(txtDataToSend.Text & vbCrLf) .ScrollToCaret End With txtDataToSend.Text = String .Empty End Sub Private Sub DataReceived( _ ByVal sender As Object, _ ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _ Handles SerialPort1.DataReceived txtDataReceived.Invoke( New _ myDelegate( AddressOf updateTextBox), _

New Object {})

End Sub Public Delegate Sub myDelegate

Public Sub updateTextBox

With txtDataReceived.Font = New Font( "Arial", 12.0!, FontStyle.Bold) .AppendText(SerialPort1.ReadExisting) .ScrollToCaret End With End Sub