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.
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?
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.
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.
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!!
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.