0

I am trying to establish a Modbus connection from a laptop to a Mitsubishi inverter (FR A-800 E series) (the manual for this connection can be found [here][1])

I am using pymodbus and I can establish a connection, but the problem comes when I try to read a register.

I know I am connection because doing something like:

from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient('192.168.15.10', 502)
client.connect()

results in a

True

response. Also, if I just print client it returns the details of the connection, which makes me confident the connection is properly establish. But, whenever I try to read a register (which I am confident exists, since it appears in the manual) :

result=client.read_holding_registers(9,1,1)
print(result)

I would obtain:

Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)

and if I try again,

Modbus Error: [Input/Output] No Response received from the remote unit/unable to decode response.

Does anyone have any idea? I have tried with a bunch of addresses for the registers, I have tried including not including the 1,1) part when reading the register and got no luck.

[1]: https://dl.mitsubishielectric.com/dl/fa/document/manual/inv/ib0600628eng/ib0600628engd.pdf)

Bohm Arahnmob
  • 53
  • 1
  • 6
  • The manual says "Unit identifier Fixed to 255" so I'd try that (`client.read_holding_registers(9,1,255)`). Many ModbusTCP devices ignore this but some don't. – Brits Jul 01 '23 at 22:05
  • Thank you very much! Shouldn't that have stopped the communication in the first place? – Bohm Arahnmob Jul 01 '23 at 22:13
  • No, the unit ID is sent with each request (so you can establish a connection and then communicate with different units attached to that gateway). – Brits Jul 01 '23 at 23:29
  • Thank you very much! I will try this and report back. – Bohm Arahnmob Jul 02 '23 at 00:03
  • Sorry - from your comment I assumed you had checked and this helped (hence raising the answer to close things off). No worries - will wait to hear (with the info available there is some guesswork involved). – Brits Jul 02 '23 at 02:26

1 Answers1

1

As per the comments, the manual says "Unit identifier Fixed to 255" so use that (client.read_holding_registers(9,1,255)).

Some ModbusTCP devices ignore this but sometimes you need to specify the correct value in order to get a response.

Brits
  • 14,829
  • 2
  • 18
  • 31