0

Hi,

I am new to programming and have attached my code so far, i need to insert the code to read data from serial port but havent a clue where to put it or how any help would be great

Imports System
Imports System.IO.Ports

Public Class Form1

    Private mySerialPort As New SerialPort

    Private Sub ButtonShowPorts_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonShowPortsol.Click
        ' Show all available COM ports. 
        For Each sp As String In My.Computer.Ports.SerialPortNames
            ListBox1.Items.Add(sp)
        Next
    End Sub

    Private Sub ButtonClearList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonClearList.Click
        ListBox1.Items.Clear()
    End Sub

    Private Sub ButtonClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonClose.Click
        Close()
    End Sub

    Private Sub ButtonRunLogger_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRunLogger.Click

    End Sub

    Private Sub ButtonStopLogger_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStopLogger.Click

    End Sub

End Class
2
Contributors
1
Reply
9
Views
2 Years
Discussion Span
Last Post by ddanbe
0

You could place the code from the example in the form load event and leave out th console.WriteLines.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.