dam112 changes
This commit is contained in:
@ -2,7 +2,7 @@ from pymodbus.client.sync import ModbusSerialClient
|
||||
import RS485Ext
|
||||
import time
|
||||
|
||||
ser=RS485Ext.RS485Ext(port='/dev/ttyAMA0', baudrate=1200, stopbits=2)
|
||||
ser=RS485Ext.RS485Ext(port='/dev/ttyAMA0', baudrate=9600, stopbits=1)
|
||||
|
||||
client = ModbusSerialClient(method='rtu')
|
||||
client.socket = ser
|
||||
@ -10,7 +10,7 @@ client.connect()
|
||||
|
||||
while True:
|
||||
try:
|
||||
result = client.read_holding_registers(address=0x2000, count=2, unit=1)
|
||||
result = client.read_holding_registers(address=0x9c42, count=1, unit=1)
|
||||
print(result)
|
||||
print(result.registers)
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user