Help with ModBus RTU Master-Slave: SimpleModbus [SOLVED]

JuanB:
Updated the libraries so parity and byte frame size can be selected to adhere more to wards the modbus standard.

There are also new example codes that will allow communication between an arduino master and arduino slave. Using a potentiometer on the master one can vary an LED's brightness on the slave and also vice versa.

Superb! With this examples everything become so clear. It is actually simpler to communicate over this modbus protocol than I thought (thanks to you and your libraray). But I still haven't establish communication between my DUE and Leonardo. I had to changed my hardware part a little since I figured out that Leonardo is working on 5V logic not 3.3V (don't know why I thought Leonardo is on 3.3V logic). So now hardware part is working, and one more thing I had to change, I hope I did it correct:

Since Arduino IDE 1.5.2 (which is neccessary for DUE) do not support different parity and stop bits options, I had to make a little changes in libraries. So this is what I changed so far:
Master libraries SimpleModbusMaster.cpp
In modbus_configure I have deleted byteFormat, from this:

void modbus_configure(long baud,
											unsigned char byteFormat,
											unsigned int _timeout, 
											unsigned int _polling, 
											unsigned char _retry_count, 
											unsigned char _TxEnablePin, 
											Packet* _packets, 
											unsigned int _total_no_of_packets)
{ 
	Serial.begin(baud, byteFormat);
	
	// Modbus states that a baud rate higher than 19200 must use a fixed 750 us 
        ...
        ..
        .
}

to this:

void modbus_configure(long baud,
											
											unsigned int _timeout, 
											unsigned int _polling, 
											unsigned char _retry_count, 
											unsigned char _TxEnablePin, 
											Packet* _packets, 
											unsigned int _total_no_of_packets)
{ 
	Serial.begin(baud);
	
	// Modbus states that a baud rate higher than 19200 must use a fixed 750 us 
        ...
        ..
        .
}

Master libraries SimpleModbusMaster.h
In modbus_configure I have deleted byteFormat, from this:

void modbus_configure(long baud, 
											unsigned char byteFormat,
											unsigned int _timeout, 
											unsigned int _polling, 
											unsigned char _retry_count, 
											unsigned char _TxEnablePin,
											Packet* _packets, 
											unsigned int _total_no_of_packets);

to this:

void modbus_configure(long baud, 
													unsigned int _timeout, 
											unsigned int _polling, 
											unsigned char _retry_count, 
											unsigned char _TxEnablePin,
											Packet* _packets, 
											unsigned int _total_no_of_packets);

Slave libraries SimpleModbusSlave.cpp
From this (byteFormat deletion):

void modbus_configure(long baud,
											unsigned char byteFormat,
											unsigned char _slaveID, 
                      unsigned char _TxEnablePin, 
											unsigned int _holdingRegsSize,
                      unsigned int* _regs)
{
  Serial.begin(baud, byteFormat);
	slaveID = _slaveID;
  ...
  ..
  .
}

to this:

void modbus_configure(long baud,
											
			unsigned char _slaveID, 
                      	unsigned char _TxEnablePin, 
			unsigned int _holdingRegsSize,
                      	unsigned int* _regs)
{
  Serial1.begin(baud);
	slaveID = _slaveID;
  ...
  ..
  .
}

And last one: Slave libraries SimpleModbusSlave.h
From this (again byteFormat):

void modbus_configure(long baud,
											unsigned char byteFormat,
											unsigned char _slaveID, 
                      unsigned char _TxEnablePin, 
                      unsigned int _holdingRegsSize,
                      unsigned int* _regs);

to this:

void modbus_configure(long baud,
											unsigned char _slaveID, 
                      unsigned char _TxEnablePin, 
                      unsigned int _holdingRegsSize,
                      unsigned int* _regs);

Also on slave side I had to change every Serial command to Serial1 command, cause Leonardo is using null serial port (Serial.xxx) for communication with computer over terminal and 1st serial port (Serial1.xxx) for communication with other hardware (arduino etc.).
Also I had to delete byteFormat from Master example and from Slave example (in modbus_configure line) to get no errors.

But still with these changes I'm unable to establish communication between arduinos. Due is sending an modbus message to Leonardo every 1 second (probably because timeout is set to 1000 ms), but Leonardo is not responding at all. If I print holdingRegs[PWM_VAL] on Leonardo over null serial port to computer terminal, I get value 0.

I don't know what can cause this problem but I hope not the Arduino 1.5.2 IDE. Any Idea?