An Illegal argument error means that the argument to the modbus function is out of range. For example, each table can have 65535 registers but you put in 70001 by mistake. That would give an illegal argument error.
Or,
Say your device docs give a register number for the Control and Status Register of 40010. If you entered that for your modbus register in the config, you would get a illegal argument error. Because 40010 really means table 4 (holding registers, register 10). So entering 10 for the register is correct.
Also, if you enter a register number that your device does not have, then you will get that error.
It is important to note that the modbus plugin uses the Modicon convention for registers. Your device may give an address like "holding register 0". That is NOT the Modicon convention. So you must add one to the address to get the correct register, 1 in this case.
In the next update, I have added bit packing for register reads and writes. I thought it was in the plugin that you guys had but it was not. Somehow I botched the update and lost that functionality. Anyway, the next update will include bit packing and also fixes the RS485 enable stickiness.
Hopefully I can get time to do some example docs for modbus in the near future. But in the mean time, have a look at this modbus device simulator:
http://www.plcsimulator.org/. It is a really neat little program that emulates a TCP modbus device. You simply run the program and then configure the modbus plugin to connect to 127.0.0.1, port 502. You can then experiment with the different features of the modbus plugin and get the feel for how it works.
Steve