Hello guys,
I, have build and installed the modbus urcap provided here GitHub - EbbeFuglsang/Modbus_URCap: A tool modbus RTU URCap by @Ebbe .
I modify the tool_modbus_read() inside modbus_xmlrpc.py to support multiple register reading opertation:
def tool_modbus_read(register_address, register_number):
global value
try:
global instrument
value = instrument.read_registers(register_address, register_number, functioncode=4)
except Exception as e:
Logger.error("Error in modbus read method", exc_info=True)
value = str(e)
return value
Unfortunately, when I execute the command tool_modbus_read(0,2)
, I get the exception “No communication with the instrument (no answer)” . However, when I run a debug script inside the robot controller directly with the command instrument.read_registers(0, 2, functioncode=4)
, I do get the value from the registers.
Can anyone please suggest what might be the issue here?
Thanks in advance!