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.
First, thanks for taking the time to put together this reply. I know you are very busy.
Second, I have a connection to MACH4, but I don't think any data is moving. MACH4 thinks it is talking to something, but there is nothing actually coming to the device. So I need to figure that out as a first step, I think.
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.
There is an entry for the number of registers, but I did not see anywhere to enter a register number in the config.
I think I must have missed something along the way. It was my impression that you just made up names for the registers.
Where do you enter register numbers in the config?
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.
Excellent. I'll take a peek. My focus is to see how to get data in and out of MACH4 thru its Modbus implementation so that I can plan my port and be thinking about how to utilize the new methods imposed by the MACH4 Modbus structure. If a simulator provides that, I'd be a happy camper and could work out the physical comm issues later on.
[/quote]