Ich hab ein TextBox1- Fenster mit Multiline.
Im Code hab ich stehen:
TextBox1.Text = "Incoming"
aber in der TextBox1 kommt nix an. (Hab schon mal alles andere auskommentiert)
Was kann ich übersehen haben?
Gruß
Helle
W64/VB-Net
Im Code hab ich stehen:
TextBox1.Text = "Incoming"
aber in der TextBox1 kommt nix an. (Hab schon mal alles andere auskommentiert)
Was kann ich übersehen haben?
Gruß
Helle
W64/VB-Net
Quellcode
- 'Public returnStr As String
- 'Private com1 As Object
- Public Sub Main()
- Dim TextBox1 As TextBox = Nothing
- 'Dim returnStr As String = ""
- 'returnStr = com1.ReadLine() 'ReceiveSerialData(returnStr) 'com1.ReadLine()
- TextBox1.Text = "Incoming"
- End Sub
- 'Function ReceiveSerialData() 'As String
- ' Receive strings from a serial port.
- ' Dim returnStr As String = ""
- 'Dim com1 As IO.Ports.SerialPort = Nothing
- 'Try
- 'com1.BaudRate = 115200
- 'com1.DataBits = 8
- 'com1.StopBits = IO.Ports.StopBits.One
- 'com1.Parity = IO.Ports.Parity.None
- 'com1 = My.Computer.Ports.OpenSerialPort("com1")
- 'com1.ReadTimeout = 10000
- 'Do
- 'Dim Incoming As String = COM1.ReadLine()
- 'If Incoming Is Nothing Then
- 'Exit Do
- 'Else
- 'returnStr &= Incoming & vbCrLf
- 'End If
- 'Loop
- 'Catch ex As TimeoutException
- 'returnStr = "Error: Serial Port read timed out."
- 'Finally
- 'If com1 IsNot Nothing Then com1.Close()
- 'End Try
- 'TextBox1.Text = "hallo " & returnStr
- 'Return returnStr
- 'End Function
- End Class
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von „hheck“ ()