#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Pune, Maharashtra India.
    Posts
    19
    Rep Power
    0

    Sending signals to a Paralle Port...


    Well, what I'm trying to do is send a signal to any of the data pins of a Parallel Port. We have this project going on in college, and my professors no nothing about this(not that I expected them to...) and I want to do it, so I'm coming here for help.

    Code:
    #include <stdio.h>
    #include <dos.h>
    #include <conio.h>
    
    /********************************************/
    /*This program set the parallel port outputs*/
    /********************************************/
    
    void main (void)
    {
    clrscr();             /* clear screen */
    outportb(0x378,0xff); /* output the data to parallel port */
    getch();              /* wait for keypress before exiting */
    }
    I already found this and I even executed it, but nothing. I put a LED there and it doesn't glow when program is executed. Is there anything that WinXP does to these C progs so that I can't access it directly or something?

    I have a program called ParaPort(paraport.net) and it sends a signal to the LED fine and it glows.

    So... any help?

    I'm using TurboC compiler. Old but cool... Dos based. Console app...
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,174
    Rep Power
    2222
    XP may well be the problem there. With DOS and even Win9x/ME (I think), you still had a chance of getting to the hardware. NT and its progeny (which includes Win2k and XP) do more to protect the hardware from you. In other words, as I understand it, you don't have the access to the parallel port I/O registers that you enjoyed in DOS.

    Now this is much more what I've heard and been told rather than experienced myself. Though we had one utility program that would change the serial port's baud rate on the fly. Worked great on Win98. Refused to work when we tried to run it on a customer's NT machine.

    Could somebody with more knowledge in this please verify what I've said here?
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Pune, Maharashtra India.
    Posts
    19
    Rep Power
    0
    Well it is that, and its called Kernel Mode or something. How do you bypass it?
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,174
    Rep Power
    2222
    I haven't done anything like that, but I think device drivers might be involved.

    You might want to repost the the question with a title about XP kernel mode accessing the parallel port. You might also want to try posting to a forum that is more Windows-specific. I used to suggest one, but it's been months and I forget what it is. You might want to also ask for suggestions when you repost the question.

    EDIT
    Google'd about a bit and found it:

    http://www.codeguru.com/forum/

    Of course, there are others out there, some of which may have XP- or NT-specific areas.
    Last edited by dwise1_aol; September 7th, 2003 at 12:27 AM.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    1
    Rep Power
    0
    hii,, i am trying to send a signal to the parallel port using java in redhat linux 9 as part of my project ,, i need help in this.. can you send me the parport.net program ..thanks

IMN logo majestic logo threadwatch logo seochat tools logo