Thread: opening and reading from a serial port...

  1. #1
    Unregistered
    Guest

    Smile opening and reading from a serial port...

    Can anyone out there please tell me how to open a com port (serial) and read in the data that comes across the port? Examples would be great! Thank You! Barby

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    God it's amazing what you can find if you spend 3 seconds at a search engine. You really should try it some time.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Unregistered
    Guest

    Unhappy

    Quzah,
    I was looking for examples not more grief! I would expect more from a "god". Can someone please tell me at the very least where I can find the information required to accomplish opening and reading data from a serial port. Thanks! Barby

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    14
    This site has a good tutoeial on seriel programming
    net programming

  5. #5
    Unregistered
    Guest

    Smile

    Specifically I'm looking for knowledge with respect to serial port programming in MS C++ Dev Studio in "C"...not "C++". Does anyone know of where I can obtain the information I'm looking for? Thanks!! Barby

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I was looking for examples not more grief!
    I may be mistaken, but quzah gave you many examples.

    >I would expect more from a "god".
    I thought that most gods were uncaring and vengeful.

    >Can someone please tell me at the very least where I can find
    >the information required to accomplish opening and reading
    >data from a serial port.
    Perhaps if you had followed the links that quzah gave you...

    If you look closely, we only answer rudely to posts that ask for easily found information or repetitively asked questions. Even then we still give a decent enough answer to get the poster started. Finding the information you desire is an important part of programming since you can't expect everything to be handed to you for the rest of your life. Most people don't understand this and see our reactions as cruel when we're actually helping you more than you can see.

    -Prelude
    My best code is written with the delete key.

  7. #7
    Unregistered
    Guest

    Smile

    Prelude you're right! I stand corrected and apologize to Quzah. I followed some of the links that Quzah offered and found some useful information. However I am still struggling with finding out how to cleanly compile some of the code I have to do serial communications. I don't know if the errors are unique to the development environment (MS Visual C++ Developer Studio) I'm in or not. I'm close but I can't resolve a couple of errors.
    Barby

  8. #8
    Registered User
    Join Date
    Mar 2002
    Posts
    10

    Thumbs up got it

    hi there

    i have recently developed a code for a serial communication
    in C
    for how u initillize serial port.
    there is interrupt 14 send intiallization the serial COM1 port.

    you could send data through COM1 e.g.

    outport(0x3f8,character);

    where 0x3f8 is the address for the COM1
    and character----the character you want to send.

    if you want to recive through COM1 e.g.

    while(!NULL)
    {
    character=inport(0x3f8);
    }

    inport reads the the character appearing at port COM1


    if you need the complete code just mail me .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with reading strings and opening files PLEASE
    By green2black in forum C Programming
    Replies: 8
    Last Post: 11-17-2008, 05:46 PM
  2. Opening and reading text files
    By pete212 in forum C Programming
    Replies: 3
    Last Post: 04-22-2008, 10:16 AM
  3. Serial Port Issues (again!)
    By HalNineThousand in forum Linux Programming
    Replies: 6
    Last Post: 04-09-2008, 08:26 PM
  4. Can't Read From Serial Port
    By HalNineThousand in forum Linux Programming
    Replies: 14
    Last Post: 03-20-2008, 05:56 PM
  5. Serial Port Basics
    By WaterNut in forum Windows Programming
    Replies: 17
    Last Post: 01-10-2007, 07:18 PM