pymodbus with fanuc AttributeError: object has no attribute 'registers'

  • Hi all,


    I am using Modbus TCP and SNPX option with FANUC. I am using pymodbus.


    When I am working with Roboguide, I can read and write registers, DO[x], R[x] and UI[x].


    However, when I tried to connect to actual robotic arm, using the same script it did not work


    request = client.read_holding_registers(start_address,4,unit=UNIT)

    vals = request.registers

    print(vals)



    I received this when I did not catch the exception.

    AttributeError: 'ExceptionResponse' object has no attribute 'registers'



    and, when I did catch

    ('Modbus Error:', <pymodbus.pdu.ExceptionResponse object at 0x7fb4b8901d50>)


    on the Teach Pendant, I see "Modbus TCP Server Error."

    but, the pymodbus says the connection is successful, however, as soon as the reading or writing, it gives immediately the error,

    AttributeError: 'ExceptionResponse' object has no attribute 'registers'(on the PC side)

    "Modbus TCP Server Error." (on TP)


    please, can somebody help in that.


    thanks,


    Zahid

Advertising from our partners