I/O Control Using Using Visual Basic

Output

STEP 1 - Download Fred Bulback's Dynamic Link Library (DLL) called io.dll from: http://www.geekhideout.com and copy it into the C:\WINDOWS\SYSTEM directory.

STEP 2 - Load Visual Basic, create a New project and add a Module ...

vbout1.gif (11144 bytes)

STEP 3 - In the Module Code window type in:

Public Declare Sub PortOut Lib "io.dll" (ByVal Port As Integer, ByVal Value As Byte)
Public Declare Function PortIn Lib "io.dll" (ByVal Port As Integer) As Byte

STEP 4 - Create a Form with two Command buttons:

vbout2.gif (2444 bytes)

STEP 5 - Add the following code:

vbout3.gif (4058 bytes)

STEP 6 - Attach a LED Interface. Run your programme and watch the LEDs change, OR run Fred Bulback's Paralell Port Monitor (parmon.exe) and watch the lines change state.

vbout4.gif (5093 bytes)

../sio5b.jpg (8325 bytes)

For further information about this Interface see: http://www.southwest.com.au/~jfuller/sio5.html

   

Input

STEP 1 - Set up a new Visual basic Form and add a Module as described above.

STEP 2 - Add a Command Button and a Label to your Form.

STEP 3 - Type in the following code...

vbin1.gif (4458 bytes)

STEP 4 - Connect an input interface, Run your programme and press the switches connected to the input lines.

vbin2.gif (5209 bytes)

../home.gif (1049 bytes)