QextSerialPort rs422, rs485

671 views
Skip to first unread message

cia.michele

unread,
Oct 27, 2009, 7:09:46 AM10/27/09
to qextserialport
Good morning to everybody,
I found this library looking for a qt serial library and it hurt me :)
it's wonderfull and easy to use (I'm a newbie with qt programming, but
i've modify easly the sample to test a serial comunication).
Now, I need something to comunicate by rs422 and rs485 modbus rtu too.
QextSerialPort can do this?
Do you have any examples about this?

Thanks for yours reply

Michele

Martin Gebert

unread,
Oct 27, 2009, 7:23:40 AM10/27/09
to qextser...@googlegroups.com
Hi Michele,


> Now, I need something to comunicate by rs422 and rs485 modbus rtu too.
> QextSerialPort can do this?
> Do you have any examples about this?
>

speaking from my experiences with RS4xx on embedded Linux 2.6 systems
(which may not be valid in general), there's no rs4xx flag in the
standard kernel interface. This means there's no canonical way to
configure RS4xx mode for a serial device, and QextSerialPort can't
support an interface to this feature because it depends on how the
serial driver you use handles this.
However, once you've set the RS4xx mode for your serial device it should
be transparent to QextSerialPort and I would expect that you will be
able to use the classes as usual, but perhaps some advanced features
won't work due to driver limitations. YMMV, so try yourself. Good luck!

Martin


Michele Ciampichetti

unread,
Oct 27, 2009, 8:57:21 AM10/27/09
to qextser...@googlegroups.com
Thanks Martin of your reply.
Do you know something about using QextSerialPort in rs485 or rs422 mode on Windows - mingw system?
The most proable contest is this. Excuse me if I don't specify it early.

I need to read a ModBus RTU instrument (rs485) and some other instrument by rs422. It is possible by QextSerialPort? I saw an old forum on QtCenter but there are no sample to learn how do this :(

Thanks a lot for your answer

Michele

2009/10/27 Martin Gebert <martin...@alpha-bit.de>

Martin Gebert

unread,
Oct 29, 2009, 5:44:05 AM10/29/09
to qextser...@googlegroups.com
Good morning Michele,


> Do you know something about using QextSerialPort in rs485 or rs422
> mode on Windows - mingw system?

sorry, I've never developed in a MinGW environment. My best guess is
that, being a gcc/glibc environment on top of a Windows OS, you'll have
to use the Windows specific interface to the driver. Perhaps looking
into the QextSerialPort sources could make this clearer, and there
should be more knowledgable people on this list that can answer this.

> I need to read a ModBus RTU instrument (rs485) and some other
> instrument by rs422. It is possible by QextSerialPort? I saw an old
> forum on QtCenter but there are no sample to learn how do this :(

I can give you a hint what I would try in this case:

1. Make sure the serial controller/UART you're using on your
workstation supports RS422/485 at all. Try connecting to/reading
from the instruments from console, e. g. using TeraTerm, and
setting RS4xx mode by the frontend that should be part of the
Windows driver of that specific controller.
2. If it doesn't you'll need a RS232-to-422/485 converter like an
ADAM-4520, and in this case you'll be using the serial port as usual.
3. If it does, find out how to change to RS4xx mode using the
driver's API.
4. In your application, set the RS4xx mode and use QextSerialPort to
establish a connection to your instrument(s) and communicate with
them.

HTH.

Martin

Reply all
Reply to author
Forward
0 new messages