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.
Local copy, just in case the links break....
Page
io.dll (dll only)
io.zip (all files)
io.cpp
io.h
STEP 2 - Load Visual Basic, create a New project and add a Module ...
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 ByteSTEP 4 - Create a Form with two Command buttons:
STEP 5 - Add the following code:
STEP 6 - Attach a LED Interface. Run your program and watch the LEDs change, OR run Fred Bulback's Parallel Port Monitor (parmon.exe) and watch the lines change state.
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...
STEP 4 - Connect an input interface, Run your programme and press the switches connected to the input lines.