[Python] Reading registers with pymodbus

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    I am very new to Modbus and PyModBus however I have spent a good amount of time trying to read up and experiment with it. If anyone could point me in the right direction I would appreciate it...



    I have a drive with distance, velocity, acceleration, and deceleration on registers 40001, 40003, 40005, and 40007 (respectively). I was initially able to write to the distance register, using client.write_register(0000, n). After trying to write to velocity the drive started going haywire and faulting, and spinning 10x as fast as it should've been. However, the real priority is reading registers. I am trying to read the data from these registers and having zero luck. I tried using

    request = client.read_holding_registers(0000,4)
    response = client.execute(request)
    print response



    However, all I get back is "ReadRegisterResponse (0)".


    So again, my big priority is trying to read values from these registers...any advice? (This is over TCP by the way)

    Continue reading...

Compartilhe esta Página