You are on page 1of 1

MAIN CODING:

Public Class Form1

Private Sub Write_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Write.Click
Dim Value As Integer
'Read the corresponding value and store it
Value = Convert.ToString(TextBox1.Text)

If Value = "007" Then


'If 007 entered then there will be high voltage on D0 and
D1 of parallel port
'Port is the name of the module
'888 is the port number of parallel port
Port.Out(888, 3)

ElseIf Value = "070" Then


'If 070 entered then there will be high voltage on D2 and
D3 of parallel port
Port.Out(888, 12)
Else
'For all other values logic 0 on all datalines of parallel
port
Port.Out(888, 0)
End If

End Sub

End Class

PORT-ACCESS MODULE CODING


Module Port
Public Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
End Module

USER INTERFACE