09-16-2014 02:14 PM
Hello to all,
I need help with the modbus library, I just downloaded it and since I am not an expert at modbus I'm having some troubles using it. Basically what I want to do right now is to read two input registers of a slave device (address 1006 and 1007); using MB Ethernet Master Query Read Holding Registers (poly).vi. All I get is an error 6010 MODBUS Exception code: 10. I saw the MB Ethernet Example Master.vi to compare it with mine and see if I was missing something but I haven't been able to solve the problem.
I am putting a screenshot of the block diagram.
Please someone tell me what I am missing!
Solved! Go to Solution.
09-16-2014 02:26 PM
I don't see the cluster for MBAP header wired into the top of your Modbus VI.
09-16-2014 02:39 PM
I didn't put it since I'm not sure what to put on it, and in the detailed help says that is additional info not usually required. So I left it unwired. Also in the MB Ethernet Example Master.vi that input was unwired.
Where do I get the info for that cluster?
09-16-2014 03:12 PM
I've only done serial modbus, not ethernet modbus, so I can't be sure. But with serial modbus, you definitely have to define the slave address. That cluster has a "client ID" which seems to be that it should be equivalent to a slave address.
09-16-2014 03:15 PM
The indicator says Holding registers but I made a mistake at naming that indicator.
09-16-2014 03:34 PM
Googling exception 10 gave me this.
" Modbus Exception Code 10 Received from the Connected Modbus Device "Specialized use in conjunction with gateways indicates that the gateway was unable to allocate an internal communication path from the input port to the output port for processing the request. This usually means that the gateway is misconfigured or overloaded."
Maybe that info helps.
09-16-2014 03:45 PM
The default address of the slave device is 1, I put it in the Unit ID of the MBAP cluster, and the error disappeared. Apparently now is reading something, I don't think the reading was correct but maybe it's something related with the register address.
But at least is now reading something without an error. 😄
Thanks for the help!!
09-17-2014 07:31 AM
That's good to hear.
Keep an eye for the register addresses as well. At least in serial, the register is zero-based while the modbus spec has them starting with zero. So 40001 and 40002 registers would be entered as register 0 and register 1 in the VI's. (Drop the leading digit that identifies the type of register and subtract 1.)
I don't know if the register numbers you used already account for that or not because your register numbers didn't seem to have that leading digit that would indicate te type of register.