Created
September 10, 2019 10:00
-
-
Save agutenkunst/bf549cfcc0acca6faffe83f7788d7c16 to your computer and use it in GitHub Desktop.
python read modbus registers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requireds: "sudo apt-get install python-pymodbus" | |
from pymodbus.client.sync import ModbusTcpClient | |
client = ModbusTcpClient('192.168.0.10') | |
result = client.read_holding_registers(975,1) # Reads 1 register starting at 975 | |
print(result.registers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment