File: test_modbusrtu_example.py

package info (click to toggle)
labgrid 25.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,796 kB
  • sloc: python: 21,352; sh: 846; makefile: 35
file content (13 lines) | stat: -rw-r--r-- 508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
def test_modbusrtu_example(instrument):
    """
    The interface for the modbus RTU driver is a thin adapter, having same
    interface as provided by the minimalmodbus package. Therefore, for more
    infromation on how to use the labgrid modbus RTU driver, please refer to
    the minimalmodbus documentation.
    """

    uptime_register_addr = 0x107
    instrument.write_register(uptime_register_addr, 0, functioncode=6)
    value = instrument.read_register(uptime_register_addr)

    assert value <= 1