Created
October 16, 2016 01:06
-
-
Save LuisHCK/22c8798106006463265636b3b7108355 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub rpcAbrirPuerto() | |
Try | |
If SerialPort1.IsOpen Then | |
SerialPort1.Close() | |
End If | |
With SerialPort1 | |
.PortName = "COM1" | |
.BaudRate = 9600 | |
.Parity = IO.Ports.Parity.None | |
.DataBits = 8 | |
.StopBits = IO.Ports.StopBits.One | |
End With | |
SerialPort1.Open() | |
Catch ex As Exception | |
MsgBox(ex.ToString) | |
End Try | |
End Sub | |
Public Delegate Sub myDelegate() | |
Public Sub updateTextBox() | |
With txtBarCode | |
.ResetText() | |
.AppendText(SerialPort1.ReadLine) | |
.ScrollToCaret() | |
End With | |
MsgBox("updatebox") | |
End Sub | |
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived | |
txtBarCode.Text = SerialPort1.ReadExisting | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment