Thread: Communication over parallel port

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    3

    Communication over parallel port

    Hello everyone,

    I have a litle problem to solve. I have a code write in c that uses the parallel port to permit communication from one Pc to other over the parallel port. But that code has been done in Linux and now i need to do the same thing in Windows...

    The problem is that i can't find any library in Windows that permit the communication over the parallel port.

    And i have other problem... here is a exemple of the code in Linux


    /*Get access to the ports starting with DATA*/
    if (ioperm(DATA,3,1)) {perror("ioperm");exit(-1);}
    while (1) {
    error=0;
    control=DHIZ; /*control in known state: HiZ, NACK*/
    outb(control,CONTROL);
    /*printf("waiting for rdy assert\n");*/
    while ((inb(STATUS) & RDY) != RDY); /*wait for rdy assert*/
    printf("NEW:");
    fprintf(trace,"NEW:");

    I can't find the functions that do the same that the ioperm, outb and inb but in windows.

    Anybody can help me??

    PS: what is the tag to use to ident my code?

    PS2: sorry for my poor english...

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    I believe most Windows compilers supply inportb() and outportb() functions.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    3
    Quote Originally Posted by itsme86
    I believe most Windows compilers supply inportb() and outportb() functions.
    Maybe, but they don't support the function ioperm... and i don't know what is the fucntion that do the same thing...

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Please look at these threads for more information
    http://cboard.cprogramming.com/searc...searchid=59212

    the tag you are looking for is [code][/code]

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Aug 2004
    Posts
    3
    Quote Originally Posted by itsme86
    I believe most Windows compilers supply inportb() and outportb() functions.
    just one more question. What are the headers for that two functions? Can i use de Visual Studio .NET or i must use the Turbo C or something like that?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port IO ops not working properly
    By microtechno in forum Linux Programming
    Replies: 16
    Last Post: 06-08-2009, 12:33 PM
  2. I2C over parallel port communication
    By bogdan in forum C Programming
    Replies: 6
    Last Post: 03-11-2009, 06:31 AM
  3. Replies: 3
    Last Post: 02-29-2008, 01:29 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  5. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM