I have a PyModbus running on a Raspberry PI 3b. I have the IF96015 Ethernet Interface for the Nemo 96HD Digital Multimeter. When I try to connect to it over ModbusTCP with the PyModbus console I can ask if it is connected and it says "true" but I cannot read any data from it.
According to the manuals the first used address is 301
and when I try to read the .Coil()
I get:
"original_function_code": "1 (0x1)",
"error": "[Input/Output] No Response received from the remote unit/Unable to decode response"
Open the Console:
pymodbus.console tcp --host 192.168.178.200 --port 502
Check for connection:
client.connect
Try to read a Coil:
client.read_coils address 301 count 1
Output:
"original_function_code": "1 (0x1)",
"error": "[Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 8 bytes (0 received)"
[NOTE]:
Manuals of the IF96015:
I have found a solution to this. The problem is in the default value for the unit ID. The manual which can be found at the vendor's website shows an example Modbus TCP packet format with unit ID value set to "1".
But the factory setting for unit ID is "255". You can change the default address in a menu, password 3002. Now, I can read values with the following Python code:
message = tcp.read_holding_registers(slave_id=255, starting_address=0x1000, quantity=6)
response = tcp.send_message(message, sock)