0% found this document useful (0 votes)
55 views2 pages

Coding Form Monitor

This document contains code for a monitoring form application in Visual Basic. It includes code to: 1) Close the form and open a login form when closing. 2) Center and initialize the form on load. 3) Scan and populate available COM ports in a dropdown and enable connecting when a port is selected. 4) Connect to a selected COM port and baud rate, start timers, and disable/enable buttons accordingly. 5) Disconnect from the COM port, stop timers, and enable/disable buttons in the opposite manner of connecting.

Uploaded by

Harits Cool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views2 pages

Coding Form Monitor

This document contains code for a monitoring form application in Visual Basic. It includes code to: 1) Close the form and open a login form when closing. 2) Center and initialize the form on load. 3) Scan and populate available COM ports in a dropdown and enable connecting when a port is selected. 4) Connect to a selected COM port and baud rate, start timers, and disable/enable buttons accordingly. 5) Disconnect from the COM port, stop timers, and enable/disable buttons in the opposite manner of connecting.

Uploaded by

Harits Cool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Imports System.

IO
Imports [Link]
Imports [Link]
Imports [Link]

Public Class FormMonitoring

Private Sub FormMonitoring_FormClosing(sender As Object, e As


[Link]) Handles [Link]
[Link]()
End Sub

Private Sub FormMonitoring_Load(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]
[Link]()
[Link] = False
[Link] = False
[Link] = 2

[Link]()
[Link]()

End Sub

Private Sub ButtonScanPort_Click(ByVal sender As [Link], ByVal e As


[Link])
[Link]()
Dim myPort As Array
Dim i As Integer
myPort = [Link]()
[Link](myPort)
i = [Link]
i = i - i
Try
[Link] = i
[Link] = True
Catch ex As Exception
MsgBox("Com port not detected", [Link], "Warning !!!")
[Link] = ""
[Link]()
[Link] = False
Return
End Try
[Link] = True
End Sub

Private Sub ButtonConnect_Click(ByVal sender As [Link], ByVal e As


[Link])
[Link] = [Link]
[Link] = [Link]
[Link]()

[Link]()
[Link]()

[Link] = False
'[Link] = False
[Link] = False
[Link] = False
[Link] = False
[Link] = True
[Link] = [Link]
[Link] = "Status : Connected"
End Sub

Private Sub ButtonDisconnect_Click(ByVal sender As [Link], ByVal e As


[Link])
[Link] = [Link]
[Link] = True
[Link] = "Status : Disconnect"

[Link] = True
'[Link] = True
[Link] = True
[Link] = True
[Link] = True
[Link] = False

[Link]()
[Link]()

[Link]()
End Sub

Public Sub Timer1_Tick_1(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

End Sub

Private Sub ConnectionToolStripMenuItem_Click(ByVal sender As [Link],


ByVal e As [Link])
[Link]()

End Sub

Private Sub MonitoringToolStripMenuItem_Click(ByVal sender As [Link],


ByVal e As [Link])
[Link]()

End Sub

End Class

You might also like