HELP...parallel port interfacing in c++


kindly help me on how to monitor and interface the 8 LEDs using the parallel port in c++.
the program goes like this...
if led1 is on... the display should be "Led 1 is on..."
if led2 is on... the display should be "Led 2 is on..."
an so on....

I have no idea on how to interface in C++ that's the reason why i ask you're expertise.
I am hoping that someone will reply to this... please email me if you know how to solve this problem.

thank you


  • What 8 leds?
  • : What 8 leds?
    consist of 8 light emitting diode (LED. Each LED is assign to D0-D7 (data register) of the prallel port.

    assuming that i turn on the led number 1... the program wiil dislplay "Led number 1 is on". Similarly,if i turn on the Led number two, the progam will display that "Led number 2 is On" the program is input mode condition using the parallel port...
    lastly, is it possible to load a sound from file in order to acknowledge the condition on waht led is on. this is just to caught the attention of somebody to monitor LED is on.
    sir, i hope you can help me.
  • Here is a good site that describes -everything- about ports:
  • WinIo - This library allows direct I/O port and physical memory access under Windows 9x/NT/2000 and XP.

    1) In C++ source program insert line:
    #include "winio.h"
    2) In project add file "winio.lib"
    3) In Release and/or Debug directory add files "WinIo.dll" and "WinIo.sys"

    I have tested this library with VC++ 6.0, VB 6.0, VC++.NET 2008 and VB.NET 2008

    Contents of WinIo.h:
    bool _stdcall StartWinIoDriver();
    bool _stdcall StopWinIoDriver();

    extern "C"
    bool _stdcall InitializeWinIo();
    void _stdcall ShutdownWinIo();
    PBYTE _stdcall MapPhysToLin(PBYTE pbPhysAddr, DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle);
    bool _stdcall UnmapPhysicalMemory(HANDLE PhysicalMemoryHandle, PBYTE pbLinAddr);
    bool _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal);
    bool _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal);
    bool _stdcall GetPortVal(WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize);
    bool _stdcall SetPortVal(WORD wPortAddr, DWORD dwPortVal, BYTE bSize);
    bool _stdcall InstallWinIoDriver(PSTR pszWinIoDriverPath, bool IsDemandLoaded = false);
    bool _stdcall RemoveWinIoDriver();
    Example Initalizing WinIo:
    Example reading from parallel port:
    WORD PortAddr;
    DWORD PortVal;
    GetPortVal(PortAddr, &PortVal, 1);
    Example Writing to parallel port:
    WORD PortAddr;
    DWORD PortVal;
    SetPortVal(PortAddr, PortVal, 1);
    Example Shutting down WinIo:
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!