umstrukturierung
This commit is contained in:
parent
25e406ed8c
commit
98451284d7
14 changed files with 138 additions and 139 deletions
|
|
@ -1,41 +0,0 @@
|
|||
'''
|
||||
Created on 05.12.2013
|
||||
|
||||
@author: Philipp Rauch
|
||||
'''
|
||||
from pymodbus.client.sync import ModbusTcpClient
|
||||
|
||||
PAC01, PAC02, PAC03, PAC04 = None, None, None, None
|
||||
|
||||
def setup(conf):
|
||||
### INITIALIZE ###
|
||||
PAC01 = ModbusTcpClient('10.2.6.5')
|
||||
PAC02 = ModbusTcpClient('10.2.6.6')
|
||||
PAC03 = ModbusTcpClient('10.2.6.7')
|
||||
PAC04 = ModbusTcpClient('10.2.6.8')
|
||||
|
||||
### CONNECT ###
|
||||
PAC01.connect()
|
||||
PAC02.connect()
|
||||
PAC03.connect()
|
||||
PAC04.connect()
|
||||
|
||||
|
||||
def loop(cursor, item):
|
||||
# PAC01.write_coil(213, 100,2)
|
||||
# result = PAC01.read_coils(213,1,unit=2)
|
||||
|
||||
ans = PAC01.write_registers(213,(1,0),unit=2)
|
||||
print "Antwort: %s" % ans
|
||||
|
||||
res = PAC01.read_holding_registers(213,4,unit=2)
|
||||
print "Werte: %s" % res.registers
|
||||
|
||||
# print result.bits[0]
|
||||
|
||||
def close():
|
||||
### CLOSE ###
|
||||
PAC01.close()
|
||||
PAC02.close()
|
||||
PAC03.close()
|
||||
PAC04.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue