I am a newbie for QNX ,and now I am troubled with this problem. I want to connect a PLC with a panel computer via RS485. but it said the driver “devc-ser8250” only support RS232 protocol. What can I do ?
Maybe I only can use 485port , and 232 protocol ?

If the PLC is the only device connect to the PC you should be able to use this driver with 485 hardware.

Yep, they are the same data wise, it’s just the direction control on the line driver that gets in the way. I believe that one of either DTR or RTS is normally used for direction control.

On the average PC, because of the lack of any real hardware flow control and also not having an interrupt on TXE, the way to do it is read back all the sent data and when the last byte sent has arrived back in the receive buffer then it’s safe to flip the direction. On the good side of things this creates a good reason to use CRC framing as it enforces rigid tracking of the data.

Thanks for your help. and,

Could you tell me how to use “devc-ser8250” with 485 . Any special attention in buildfile and my application ?

You mean I could only use 485 port & 232 protocol ? or you think 485 connection has hardware flow control ,so I don’t need 485 protocol any more. You know, I don’t know that clearly.

another way:you can use RS232-TO-RS485 converter,there are a lot of such hardware.

dive_dmm: No! We both said there is no difference from the data point-of-view. If you are using a special comport with built-in hardware direction control then the software doesn’t need to know it’s a RS485 connection.

What you choose to do is something we can’t help with unless you give more details like what hardware you have to use, what hardware you could use, what networking layer you want to or have to use.

xuyong: True, these things can do the direction change by detecting the end of transmission with a simple timeout.

Thank you all.
OK, I have a panel computer with a 232/422/485 comport, and a PLC with a communication module with a 485 port . now I wanna exchange data between them. Because of the distance, I have to choose com communication via 485 connection, I think. I have supposed it was very simple via connection by a cable tied two ports. But it said “devc-ser8250” only supported 232 protocol in the helpview, that comfused me. That’s all. Can you give me some suggestions?

RS-232 signal voltage is -12volt for a 0 and +12V for a 1. RS-422 use a differencial signal 0-5V. That means 2 wires for TX and 2 wires for RX. Differencial signal is what allows greater distance because any noise wil affect the two wires hence the difference always stay the same, if the difference is -5V it’s a 0 if it’s +5 it’s a 1. RS-232 and RS-422 can be control by the same serial chip, it’s just a difference in the electrial specification. RS-485 is like RS-422 but with the added capability of havinh multiple TX/Rx connected together. That means when the serial port isn’t sending a signal it must “disconnect” from it so that other devices can freely control the line. This “disconnection” must be taken care of somehow, either through hardware (as mention in previous post) or by controling the disconnection through software. Drivers that only support RS-232 do not have automatic control of the “disconnection”.

There is LOTS of information on serial port on Internet. This issue is not specific to QNX.

  • Mario