I must admit that I've had a good experience with this Modbus-Slave library. Anyway, as its author claims, this library has some known issues:
- It implements only functions 3 (read holding registers), 6 (preset single register) and 16 (preset multiple registers).
- It lacks a character frame format, it is to say, there is no parity control and only allows 8N1 frames. Indeed the Arduino IDE 1.05 now supports other frames formats.
- The Serial buffer is limited to 59 registers.
- It uses Serial.print( byte, BYTE), which fails when compiling with Arduino IDE greater than 1.00. It needs to be replaced by Serial.write( byte ). Indeed it was written for Arduino IDE < 1.00.
- The Arduino family has increased with other devices like the Arduino Mega with 4 serial ports or the Leonardo with 2 serial ports (1 USB plus another UART). This library was restricted only to the first Serial port and didn't support any other port.
- It is based on another work, thought for PC systems, which didn't care about memory. This library wastes a lot of memory resources, because it declares several arrays and moves them between function calls. This isn't the most efficient way to work with an Arduino.
- The Modbus library can also implement a Master, because both share most of the code. There are some small differences regarding to the register handling.
- There may be some issues with small microcontrollers like the ATMEGA8 or the ATMEGA168. I have experienced memory overflows that reset the controller.
- My library allows 4 serial ports depending on the device type and it isn't just restricted to Arduino AVR's. It also allows other popular microcontrollers like the ATMEGA644P or the 1284P. Indeed I'm testing it with a 1284P.
- Now I'm implementing functions 1 Read coils, 2 Read digital inputs, 5 Write single coil and 15 Write multiple coils.
No comments:
Post a Comment