Parallel Port Tutorial

  • 11 years ago

    I need a full tutorial on how to use parallel ports in VB, how can i control a circuit using Visual Basic 6.0, i want to know what i will need [libraries ...] and that's about it.. i'm a newbie in this type of programming so...

  • 11 years ago
    I've changed the title of your post, as the initial title was misleading. Hopefully you'll get a few useful answers this way...  

  • 11 years ago


    First you have to know that parallel port not accessaple directly from the Win NT based system, cause of security reasons, microsoft has decide to allow app. written in kernal mode to deal with parallel port, so develop a dll library that allow developer to deal with parallel port this library contain a .sys file inside it which work as an parallel port driver when you use this dll its check if the parallel port driver loaded or not, if its not loaded, it extract and setup its internal driver and allow you to read and write to PPT, this library contain 2 easy API statment.

    Follow the following link

    and then download


    you can use the samples in ZIP, or you can use the follow both are easy.

    you have to know that parallel port has 8 data channel and 8 grounds  and status , control channels,


    Private Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAdress As Integer) As Integer
    Private Declare Sub out Lib "inpout32.dll" Alias "Out32" (ByVal PortAdress As Integer, ByVal Value As Integer)

    Private Sub WriteToChannel(Index As Byte)
        Dim PPT_Pulse As Byte
        PPT_Pulse = PPT_Pulse + (2 ^ Index)
        Call out(888, PPT_Pulse)
    End Sub


    The index is a value from 0 to 7, if you wana turn off all channels write

    Call out(888, 0)

    The 888 is the base address of parallel port,


    if you wana more of details just googling on "Parallel port programming tutorials"


    Hope this help you :), mail me if you need somthing.

    Good luck.

  • 11 years ago

    Devil [6]Hi there one better way to do parallel port interfacing is with the use of inpout32.dll, search for this the web, another way is with the use of the hwinterface.ocx, this one provides advantage for visual basic programmers, this offers 2 major methods inport for reading and outport for writing. Best regrads to you.

  • 11 years ago
    where do i get hwinterface.ocx
  • 11 years ago
    Angel [A] I've got my hwinterface.ocx in a package that also contains the inpout32.ocx. as said you can download it for free @ hwinterface.ocx can be used as a component in vb6 and is much simplier to use than tha inpout32.dll , good luck...
  • 11 years ago
    Hi Sir ...I tried all the instruction on how to use this dll or ocx file,this function is ok when I write data to the port like out(888,2) but when I used to read the data from port like the instruction inp(888) or inp(val("&H378")) there is no data comming out.My sensor is connected to pin 7 and when i test this no data or value is comming from the pin. I tried pin 10,11,12 to 13 pin from parallel port for the sensor and still no data is comming when i use the inp function for computer is pentium 4 and xp service pack 1 os.Is there other configuration from the port so that I can read the data from the port if i want to test my motion sensor?

    Hope you can help me Sir cause I really need this...I try hard just to finished my program.

    I will appreciate any suggestion from you Sir cause I know you can help me Sir.

  • 10 years ago
    i need parallel port tutorial in flash ,in which compleatly show the discription of parallel port
  • 10 years ago
    Ramil that ocx worked in my project before, try to check out the motion sensor. Try to check out if it really send a +5V back to the port...There are lots of factors to be considered but then lets try to start answering your question with that.


  • 10 years ago

    inpout32.dll wont register because it is not an OLE DLL

    You have to call it using declares like you would with Windows API calls.

    The headers are:

    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)


    and I found these at

    in a sample file

    Did you do a search for inpout32.dll?


Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match” - Bill Bryson