modbusTester added
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,3 +7,5 @@ promagmbs/.DS_Store
|
||||
flow-monitor/.DS_Store
|
||||
.DS_Store
|
||||
plcfreshwater/.DS_Store
|
||||
.DS_Store
|
||||
plcfreshwater/.DS_Store
|
||||
|
||||
@@ -2,8 +2,9 @@ import minimalmodbus
|
||||
|
||||
minimalmodbus.BAUDRATE = 9600
|
||||
minimalmodbus.STOPBITS = 1
|
||||
address = 123
|
||||
|
||||
instrument = minimalmodbus.Instrument('/dev/ttyS0', 1) #device, modbus slave address
|
||||
instrument = minimalmodbus.Instrument('/dev/ttyS0', address) #device, modbus slave address
|
||||
instrument.debug = True
|
||||
try:
|
||||
value = instrument.read_float(599) #register -1 for float
|
||||
|
||||
BIN
plcfreshwater/.DS_Store
vendored
BIN
plcfreshwater/.DS_Store
vendored
Binary file not shown.
Reference in New Issue
Block a user