Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am following the procedure of the controlling the Parallel port using this article "Reading from Parallel Port using Inpout32.dll". And this is the code,
VB
Option Strict Off
Option Explicit On
Module InpOut32_Declarations

    'Inp and Out declarations for port I/O using inpout32.dll.
    Public Declare Function Inp Lib "inpoutx64.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short
    Public Declare Sub Out Lib "inpoutx64.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal Value As Short)

End Module


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Out(&H378S, &HFFS)      'Print '1' to D7-D0 or 255 in Decimal
        Dim Value1 As String    'String named Value1
        Value1 = Inp(&H378S)    'Now Value1 has the values in 'data port'
        MessageBox.Show(Value1) 'A popup will indicate the current value written

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim Value2 As String    'String named Value2
        Value2 = Inp(&H379S)    'Now Value2 has the values in 'signal port'
        MessageBox.Show(Value2) 'A popup will indicate the current value written

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class




The operating system is Windows 7 64bit and I used Inpoutx64.dll. The code works fine in one pc but it doesn't work on another pc which is the same operating system. When I click Button one "which is the out put for the Data Bus" the results always 120, whatever the value that I give for the Data bus!

Any suggestion how to solve this problem? Plz.


Regards
Posted
Updated 16-Jun-13 4:42am
v2
Comments
[no name] 16-Jun-13 8:25am    
How could we possibly know anything about your code or the computer you are using or what "doesn't work" means?

Check LPT ports configuration (in BIOS) on both PC. Other possibility is a hardware problem: I've PC without any parallel port "on board".
 
Share this answer
 
Hello !

Kindly ensure below,

1) Conform your 'inpoutx64.dll' version 1.2.0.0, then this version of .dll can support for Win-7 OS.

2) And first time you should open your application(.exe) in 'Run as Administrator' mode.


I Hope, The above can solve your data -> 120 results issues.


- Ram V -
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900