How to get correct value from parallel port

This is a discussion on How to get correct value from parallel port within the Windows Programming forums, part of the Platform Specific Boards category; Dear All, i have one program which can get the input of parallel port and display the value on window. ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    38

    How to get correct value from parallel port

    Dear All,
    i have one program which can get the input of parallel port and display the value on window.
    Code:
    void CProjDlg::OnCalculte() 
    {
    	
    
    	unsigned StatusAddress=0x378;
                    int StatusPort;
                   StatusPort=_inp(StatusAddress);
                    m_value=StatusPort;
                   UpdateData(0);
    
    }
    But StatusAddress (0x378) default value is 4 (100), so pin 3 always shows "1" even i connect it to ground, how can solve it?
    Thank you.

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    25
    Pin 3 is a writeonly datapin.
    If you want to read use
    pin 1 hw inverted, i/o
    pin 10
    pin 11 hw inverted
    pin 12
    pin 13
    pin 14 hw inverted, i/o
    pin 31 i/o
    pin 32
    pin 36 i/o

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem interfacing in parallel port
    By tariq7868 in forum C Programming
    Replies: 4
    Last Post: 06-08-2009, 03:53 AM
  2. Question on Accessing parallel port
    By Luciferek in forum C++ Programming
    Replies: 6
    Last Post: 06-16-2008, 05:36 PM
  3. Parallel Port: Sending the signals as binary
    By h3ro in forum Tech Board
    Replies: 7
    Last Post: 08-25-2007, 12:22 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  5. Communication over parallel port
    By Istari in forum C Programming
    Replies: 5
    Last Post: 08-25-2004, 03:22 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21