Thread: output to serial port

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    4

    output to serial port

    from what i understand it is possible to send signals to various pins of a serial port. is this, true, and either way is it possible to send output to the serial port(or other ports) at all? how? what .h files are required? i have absolutely no idea where to start here so help w/ a code snippet would be excellent. thanks a ton.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    Depends on your OS. It's always possible, but you generally need to use an OS specific call. You'd need the WinAPI if you plan to do this in Windows -- making this a Windows programming question.

    There is no cross-platform way to do this.

  3. #3
    I don't think you can use the WinAPI for this kind of stuff. You'll have to learn the WinDDK (Driver Developement Kit). I looked in to programming Windows NT device drivers, and it looks like the most difficult thing ever. Hmm...What kind of data are you trying to send?
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    4
    i just need to produce a current in one of the pins. being able to do hi/lo would be nice, but ill take what i can get.

  5. #5
    Registered User
    Join Date
    Nov 2001
    Posts
    5
    Originally posted by khan
    i just need to produce a current in one of the pins. being able to do hi/lo would be nice, but ill take what i can get.
    I did this once by sending a ^G (bell character - Control G) to com2.... provided me with a negative voltage on the TX pin to operate a cash drawer out of a dos-based POS program

  6. #6
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Don't cross post.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Serial Port Issues (again!)
    By HalNineThousand in forum Linux Programming
    Replies: 6
    Last Post: 04-09-2008, 08:26 PM
  2. Can't Read From Serial Port
    By HalNineThousand in forum Linux Programming
    Replies: 14
    Last Post: 03-20-2008, 05:56 PM
  3. Reading and writing to a serial port
    By SwarfEye in forum C Programming
    Replies: 2
    Last Post: 08-18-2006, 12:28 AM
  4. serial port data transmission
    By djarian in forum C Programming
    Replies: 2
    Last Post: 10-04-2003, 02:22 PM
  5. Serial port read..can someone tell me..
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 06-27-2002, 08:21 AM