updated change thresholds and added commands
This commit is contained in:
@@ -2,7 +2,7 @@ from Channel import PLCChannel, ModbusChannel
|
||||
from tankalarms import PLC_IP_ADDRESS
|
||||
|
||||
tags = [
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_level","WaterTxLevel","REAL", 5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_level","WaterTxLevel","REAL", 0.5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_batt_volts","WaterTxBatVolts","REAL", 5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_rssi","WaterTxRSSI","REAL", 5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_hihi_spt","WaterTx_HHSP","REAL", 5, 3600, plc_type="Micro800"),
|
||||
@@ -11,7 +11,7 @@ tags = [
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_hi_alm","WaterTx_HAlrm","BOOL", 0, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_batt_lolo_alm","WaterTxBatVolts_LLAlrm","BOOL", 0, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "water_comm_fail_alm","WaterTx_RF_CommFail","BOOL", 0, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "oil_level","OilTxLevel","REAL", 5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "oil_level","OilTxLevel","REAL", 0.5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "oil_batt_volts","OilTxBatVolts","REAL", 5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "oil_rssi","OilTxRSSI","REAL", 5, 3600, plc_type="Micro800"),
|
||||
PLCChannel(PLC_IP_ADDRESS, "oil_hihi_spt","OilTx_HHSP","REAL", 5, 3600, plc_type="Micro800"),
|
||||
|
||||
@@ -151,3 +151,44 @@ class start(threading.Thread, deviceBase):
|
||||
write_res = "Error writing to PLC..."
|
||||
return write_res
|
||||
return False
|
||||
"""
|
||||
def tankalarms_water_hihi_spt(self, name, value):
|
||||
log.info("Value received is {}".format(value))
|
||||
|
||||
write_res = write_tag(str(PLC_IP_ADDRESS), "WaterTx_HHSP", 1, plc_type="Micro800")
|
||||
log.info("Result of tankalarms_water_hihi_spt {}, {}, {}".format(name, value, write_res))
|
||||
if write_res is None:
|
||||
write_res = "Error writing to PLC..."
|
||||
return write_res
|
||||
|
||||
|
||||
def tankalarms_water_hi_spt(self, name, value):
|
||||
log.info("Value received is {}".format(value))
|
||||
if value == 1 or value == "1":
|
||||
write_res = write_tag(str(PLC_IP_ADDRESS), "WaterTx_HSP", 1, plc_type="Micro800")
|
||||
log.info("Result of tankalarms_water_hi_spt {}, {}, {}".format(name, value, write_res))
|
||||
if write_res is None:
|
||||
write_res = "Error writing to PLC..."
|
||||
return write_res
|
||||
return False
|
||||
|
||||
def tankalarms_oil_hihi_spt(self, name, value):
|
||||
log.info("Value received is {}".format(value))
|
||||
if value == 1 or value == "1":
|
||||
write_res = write_tag(str(PLC_IP_ADDRESS), "OilTx_HHSP", 1, plc_type="Micro800")
|
||||
log.info("Result of tankalarms_oil_hihi_spt {}, {}, {}".format(name, value, write_res))
|
||||
if write_res is None:
|
||||
write_res = "Error writing to PLC..."
|
||||
return write_res
|
||||
return False
|
||||
|
||||
def tankalarms_oil_hi_spt(self, name, value):
|
||||
log.info("Value received is {}".format(value))
|
||||
if value == 1 or value == "1":
|
||||
write_res = write_tag(str(PLC_IP_ADDRESS), "OilTx_HSP", 1, plc_type="Micro800")
|
||||
log.info("Result of tankalarms_oil_hi_spt {}, {}, {}".format(name, value, write_res))
|
||||
if write_res is None:
|
||||
write_res = "Error writing to PLC..."
|
||||
return write_res
|
||||
return False
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user