stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.33k stars 1.71k forks source link

I need a speed up to 1Mbit/s via RS485 #93

Closed acrap closed 11 years ago

acrap commented 11 years ago

It's really? My hardware support this, but a libmodbus... Can I use this library at such speeds? Will I have to change something in the code library?

Sorry for the my bad English

stephane commented 11 years ago

Currently you need to patch modbus-rtu.c line 62. I intend to make a change to support until B4000000 w/o depending on constants. Do you need this on Linux or Windows?

acrap commented 11 years ago

Thank you! I need this on QNX

zorxd commented 11 years ago

I needed this too, so I made this patch:

http://bayfiles.net/file/PnbL/XNDENH/0001-high-speed.patch

It uses constants however. That's also how it works in GNU coreutils stty: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f=src/stty.c;h=ee891a593354fde0494fb2a20728cce79dc74f12;hb=1cb8e6392c70dca8773c411d4c824ad98b0fc1ec

stephane commented 11 years ago

Yes, it's certainly the safer approach.

stephane commented 11 years ago

@zorxd Thank you for your patch, I added more defines and Windows values.