CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    what difference of rs232 and rs485 ?

    I write a program with vc++6.0, when i use rs232 for communication,
    that's normal, but when i use rs485, i can write, don't read,
    what wrong for this?
    thanks!!!


  2. #2
    Join Date
    May 1999
    Posts
    35

    Re: what difference of rs232 and rs485 ?

    Hi,

    one of the differences in rs232 and rs485 is at least the voltage. The rs232 protocol specifies a voltage about -12V and 12V whereas the rs485 protocol specifies a higher voltage.

    Greetings, Jörg



  3. #3
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: what difference of rs232 and rs485 ?

    RS485 needs the RTS line toggling to indicate which direction the data is flowing - to write data it has to be in one state, to read it has to be in the other.

    There IS a function call which can toggle the RTS line under Windows, which will work under NT (EscapeCommFunction() ) - but it is too slow, and you will find communications erratic. You can toggle the RTS line manually using _inp() and _outp(), but this won't work under NT. You will need a device driver.

    Good luck, that's something I've been grappling with. There are RS232 - RS485 converters which can automatically toggle the RTS line when they see data passing through (ADE - Auto Driver Enable) - but these are about £60 ($80) each.



    --
    Jason Teagle
    [email protected]

  4. #4
    Guest

    Re: what difference of rs232 and rs485 ?

    Actually, if I'm not mistaken, 485 requires +5V and -5V....its a bi-directional signal. That means that when a "0" is being transmitted, one line is +5V and the other is -5V.....when a 1 is being transmitted, both lines are close to 0V.

    As for why you aren't reading a signal, I've got no idea, but I'd agree that the RTS line needs to change state. I seem to think you can handle this manually, and suggest you look at the serial communications documentation.

    Paul


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured