Write to drive after setting vfd parameters

This commit is contained in:
Patrick McDonagh
2016-03-03 22:07:59 -06:00
parent f2650cb9fa
commit 9c3de89693

View File

@@ -117,6 +117,9 @@ class start(threading.Thread, deviceBase):
print self.channels print self.channels
self.setupChannels() self.setupChannels()
time.sleep(30) time.sleep(30)
def write_vfdconfig(self):
print("Writing config to drive")
return u800.writeMicroTag(addr, 'VFD_Write', 1)
def vfdipp_sync(self, name, value): def vfdipp_sync(self, name, value):
self.sendtodb("connected", "true", 0) self.sendtodb("connected", "true", 0)
@@ -140,7 +143,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdnameplatefla(self, name, value): def vfdipp_vfdnameplatefla(self, name, value):
print('trying to set cfg_NameplateFLA to {0}'.format(value)) print('trying to set cfg_NameplateFLA to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_NameplateFLA', float(value)) if u800.writeMicroTag(addr, 'cfg_NameplateFLA', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_dhpressurestartup(self, name, value): def vfdipp_dhpressurestartup(self, name, value):
print('trying to set DH_Pressure_Startup to {0}'.format(value)) print('trying to set DH_Pressure_Startup to {0}'.format(value))
@@ -152,7 +158,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdmotorpoles(self, name, value): def vfdipp_vfdmotorpoles(self, name, value):
print('trying to set cfg_MotorPoles to {0}'.format(value)) print('trying to set cfg_MotorPoles to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_MotorPoles', int(value)) if u800.writeMicroTag(addr, 'cfg_MotorPoles', int(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_tubingpressurealarmdelay(self, name, value): def vfdipp_tubingpressurealarmdelay(self, name, value):
print('trying to set TubingPressure_Alarm_Delay to {0}'.format(value)) print('trying to set TubingPressure_Alarm_Delay to {0}'.format(value))
@@ -168,7 +177,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdmaxfreq(self, name, value): def vfdipp_vfdmaxfreq(self, name, value):
print('trying to set cfg_MaxFreq to {0}'.format(value)) print('trying to set cfg_MaxFreq to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_MaxFreq', float(value)) if u800.writeMicroTag(addr, 'cfg_MaxFreq', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_tubingpressurelosp(self, name, value): def vfdipp_tubingpressurelosp(self, name, value):
print('trying to set TubingPressure_Lo_SP to {0}'.format(value)) print('trying to set TubingPressure_Lo_SP to {0}'.format(value))
@@ -180,7 +192,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdnameplateolcurrent(self, name, value): def vfdipp_vfdnameplateolcurrent(self, name, value):
print('trying to set cfg_NameplateOLCurrent to {0}'.format(value)) print('trying to set cfg_NameplateOLCurrent to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_NameplateOLCurrent', float(value)) if u800.writeMicroTag(addr, 'cfg_NameplateOLCurrent', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_offmode(self, name, value): def vfdipp_offmode(self, name, value):
print('trying to set Off_Mode to {0}'.format(value)) print('trying to set Off_Mode to {0}'.format(value))
@@ -208,7 +223,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdnameplaterpm(self, name, value): def vfdipp_vfdnameplaterpm(self, name, value):
print('trying to set cfg_NameplateRPM to {0}'.format(value)) print('trying to set cfg_NameplateRPM to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_NameplateRPM', float(value)) if u800.writeMicroTag(addr, 'cfg_NameplateRPM', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_vfdspeedref(self, name, value): def vfdipp_vfdspeedref(self, name, value):
print('trying to set VFD_SpeedRef to {0}'.format(value)) print('trying to set VFD_SpeedRef to {0}'.format(value))
@@ -236,7 +254,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdnameplatevolts(self, name, value): def vfdipp_vfdnameplatevolts(self, name, value):
print('trying to set cfg_NameplateVolts to {0}'.format(value)) print('trying to set cfg_NameplateVolts to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_NameplateVolts', float(value)) if u800.writeMicroTag(addr, 'cfg_NameplateVolts', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_downholetoolenabled(self, name, value): def vfdipp_downholetoolenabled(self, name, value):
print('trying to set Downhole_Tool_Enabled to {0}'.format(value)) print('trying to set Downhole_Tool_Enabled to {0}'.format(value))
@@ -244,7 +265,10 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdnameplatehz(self, name, value): def vfdipp_vfdnameplatehz(self, name, value):
print('trying to set cfg_NameplateHz to {0}'.format(value)) print('trying to set cfg_NameplateHz to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_NameplateHz', float(value)) if u800.writeMicroTag(addr, 'cfg_NameplateHz', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_tubingpressuretransducerenabled(self, name, value): def vfdipp_tubingpressuretransducerenabled(self, name, value):
print('trying to set TubingPressure_Transducer_Enabled to {0}'.format(value)) print('trying to set TubingPressure_Transducer_Enabled to {0}'.format(value))
@@ -256,11 +280,17 @@ class start(threading.Thread, deviceBase):
def vfdipp_vfdnameplatehp(self, name, value): def vfdipp_vfdnameplatehp(self, name, value):
print('trying to set cfg_NameplateHP to {0}'.format(value)) print('trying to set cfg_NameplateHP to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_NameplateHP', float(value)) if u800.writeMicroTag(addr, 'cfg_NameplateHP', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_vfdminfreq(self, name, value): def vfdipp_vfdminfreq(self, name, value):
print('trying to set cfg_MinFreq to {0}'.format(value)) print('trying to set cfg_MinFreq to {0}'.format(value))
return u800.writeMicroTag(addr, 'cfg_MinFreq', float(value)) if u800.writeMicroTag(addr, 'cfg_MinFreq', float(value)):
return self.write_vfdconfig()
else:
return False
def vfdipp_startcommand(self, name, value): def vfdipp_startcommand(self, name, value):
print('trying to set Start_Command to 1') print('trying to set Start_Command to 1')