# module for wiener power supply """ wiener.py version 0.0.1 Class lvchannel: provides methodes for accessing individual channels in a create The following methodes are avilable: lvchannel contains channel specific parameters .Name channel Name .Status channel Status .Switch on/off indicator .Group group indicator .SetVoltage voltage set point .SetCurrent current set point .MeasuredSVoltage voltage sensor read back .MeasuredTVoltage voltage terminal read back .MeasuredCurrent current read back .VoltageUpRate voltage ramp up rate .VoltageDownRate voltage ramp down rate .MaxSVoltage maximum sensor voltage .MaxTVolrage maximum terminal voltage .MaxCurrent maximum current .Behavior bit code to define action on channel failure lvchannel.readValues(ip) read lv channel values lvchannel.setCurrent(ip) set Current setpoint lvchannel.setVoltage(ip) set Voltage setpoint lvchannel.printBehavior(ip) print channel behavior Class WienerCrate: provides methods to setup a Wiener power supply crate like reading the current number of channels for all modules present in the create. The following variables methodes are avilable: WienerWienerCrate contains crate specific parameters .CrateMaineSwitch on/off indicator .CraeteStatus crate status .Nmodules Number of modules in crate .ModuleChannels[] number of channels per module (array of 10) .SerialNumber Crate Serial number .OperatingTime create up time .Channels[] list of all channels in crate (elements are class lvchannel ) WienerWienerCrate .setIP(ip) set an IP address for the create (sets crate with all channels) .getCrateChannels() determine the number modules and channels in the create .channelsUpdateAll() update all channels found in crate .channelsGetReadBacks() update measured Voltages and Currents for all channels in Crate .setModuleCurrent(m,c) set current of all channels of module in slot m to c .setModuleVoltage(m,v) set voltage of all channels of module in slot m to v .setAllLVon() turn all low voltage channels in the create on .setAllLVoff() turn all low voltage channels in the create off .setAllHVon() turn all high voltage channels in the create on .setAllHVoff( turn all high voltage channels in the create off .setAllON() turn all channels in the create on .setAllOFF() turn all channels in the create off .resetAllmodules() reset status of all channels in the create .resetAllLVmodules() reset status of all low voltage channels in the crate .resetAllHVmodules() reset status of all high voltage channels in the crate """ import os import subprocess class lvchannel(): def __init__(self,chnum=0): self.chnum = chnum self.Name = "u"+str(chnum) self.Status = "00 " self.Switch = "off" self.Group = 0 self.SetVoltage = 0 self.SetCurrent = 0 self.MeasuredSVoltage = 0 self.MeasuredTVoltage = 0 self.MeasuredCurrent = 0 self.VoltageUpRate = 0 self.VoltageDownRate = 0 self.MaxSVoltage = 0 self.MaxTVoltage = 0 self.MaxCurrent = 0 self.Behavior = 0 def doprintBehavior(self,val): if(val==1): print " ramp down this channel" elif(val==2): print " ramp down all channels of same group" elif(val==3): print " switch off complete crate" def printBehavior(self,ip): fails = ['Under Voltage ', 'Over Voltage S ', 'Over Voltage T ', 'Over Current ', 'Over Temperature', 'Over Power ', 'Inhibit ', 'Timeout '] print "Channel: ",self.Name for k in range(0,7): b = 3<>k*2 print fails[k],":", if (val>0): self.doprintBehavior(val) else: print " ignore error" def setVoltage(self,ip,V): nam = self.Name val = " F "+str(V) cmd = "snmpset -v 2c -m +WIENER-CRATE-MIB -c guru "+ip+" outputVoltage."+nam+val ans = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find("Error") > -1): print "No channel "+nam+" available!" def setCurrent(self,ip,V): nam = self.Name val = " F "+str(V) cmd = "snmpset -v 2c -m +WIENER-CRATE-MIB -c guru "+ip+" outputCurrent."+nam+val ans = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find("Error") > -1): print "No channel "+nam+" available!" def readValues(self,ip): nam = self.Name cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputName."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr stdout.rstrip() l = stdout.split() self.Name = l[0].lower() cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputStatus."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() self.Status = stdout.rstrip() cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputGroup."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() self.Group = stdout.rstrip() cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputSwitch."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() self.Switch = stdout.rstrip() cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputVoltage."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.SetVoltage = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputCurrent."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.SetCurrent = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputMeasurementSenseVoltage."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.MeasuredSVoltage = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputMeasurementTerminalVoltage."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.MeasuredTVoltage = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputMeasurementCurrent."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.MeasuredCurrent = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputVoltageRiseRate."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.VoltageUpRate = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputVoltageFallRate."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.VoltageDownRate = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputSupervisionMaxSenseVoltage."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.MaxSVoltage = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputSupervisionMaxTerminalVoltage."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.MaxTVoltage = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputSupervisionMaxCurrent."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.MaxCurrent = float(s1[0]) cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+ip+" outputSupervisionBehavior."+nam ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() line = stdout.rstrip() s1 = line.split() self.Behavior = float(s1[0]) # ---------------------------------------------- end of lvchannel class ------------------------------------ class WienerCrate(): def __init__(self,ip="0"): self.ip = ip self.CrateMainSwitch = "off" self.CrateStatus = "00 " self.Nmodules=0 self.ModuleChannels = [0,0,0,0,0,0,0,0,0,0] self.SerialNumber = "0" self.OperatingTime = "0" self.Channels = [] if (ip != "0"): res = self.getCrateStatus() res = self.getCrateChannels() self.channelsUpdateAll() def resetAllmodules(): # reset status of all Channels in the Create cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.0 i 10" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def resetAllHVmodules(): # reset status of all High Voltage Channels in the Create cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.64 i 10" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def resetAllLVmodules(): # reset status of all Low Voltage Channels in the Create cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.128 i 10" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setAllON(): # turn all Channels in the Create ON cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.0 i 1" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setAllOFF(): # turn all Channels in the Create OFF cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.0 i 0" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setAllHVon(): # turn all High Voltage Channels in the Create ON cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.64 i 1" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setAllHVoff(): # turn all High Voltage Channels in the Create OFF cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.64 i 0" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setAllLVon(): # turn all Low Voltage Channels in the Create ON cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.128 i 1" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setAllLVoff(): # turn all Low Voltage Channels in the Create OFF cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" groupsSwitch.128 i 0" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr def setModuleCurrent(self,slot,current): if (self.ModuleChannels[slot]>0): start = slot*100 - 1 stop = start+100 for chan in self.Channels: if ((chan.num > start) and (chan.num < stop)): chan.setCurrent(ip,current) def setModuleVoltage(self,slot,voltage): if (self.ModuleChannels[slot]>0): start = slot*100 - 1 stop = start+100 for chan in self.Channels: if ((chan.num > start) and (chan.num < stop)): chan.setVoltage(ip,voltage) def getCrateStatus(self): cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" sysMainSwitch.0" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr self.CrateMainSwitch = stdout.rstrip() cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" sysStatus.0" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() self.CrateStatus = stdout.rstrip() def setIP(self,ip): if (self.ip == 0): # the current instance has not been in use yet self.ip = ip res = self.getCrateStatus() res = self.getCrateChannels() elif (len(self.ip.split("."))==4): # the current instance was in use already # this means re-define crate self.ip = ip del self.Channels[:] # empty channel list first res = self.getCrateStatus() res = self.getCrateChannels() # new channel list def getCrateChannels(self): # first test connection cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" sysMainSwitch.0" ans = subprocess.Popen(cmd0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = ans.communicate() if (stderr.find('No Response')>0): print stderr.rstrip() return stderr # get power supply serial number cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" psSerialNumber.0" ans = os.popen(cmd0) val = ans.read() ans.close() self.SerialNumber = int(val) print "Power Supply Serial Number: ",self.SerialNumber # get powe supply operating time cmd0 = "snmpget -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" psOperatingTime.0" ans = os.popen(cmd0) val = ans.read() ans.close() r = val.split() self.OperatingTime = int(r[0]) #print "Power Supply operaint time: ",self.OperatingTime," s" # find number of channels for each module in power supply cmd = "snmpwalk -Oqv -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputName" resp = os.popen(cmd) for i in range(0,9): self.ModuleChannels[i] = 0 for l in resp: #print l[1:] num = int(l[1:]) a = lvchannel(num) name = l.lower() a.Name = name.strip() self.Channels.append(a) if (num<100): self.ModuleChannels[0] += 1 elif (num<200): self.ModuleChannels[1] += 1 elif (num<300): self.ModuleChannels[2] += 1 elif (num<400): self.ModuleChannels[3] += 1 elif (num<500): self.ModuleChannels[4] += 1 elif (num<600): self.ModuleChannels[5] += 1 elif (num<700): self.ModuleChannels[6] += 1 elif (num<800): self.ModuleChannels[7] += 1 elif (num<900): self.ModuleChannels[8] += 1 else: self.ModuleChannels[9] += 1 self.Nmodules = 0 for n in range(0,9): if (self.ModuleChannels[n]>0): self.Nmodules +=1 print 'Slot %2d: %3d channels' % (n,self.ModuleChannels[n]) return "ok" def channelsUpdateAll(self): cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputStatus" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1] val = l[3] for k in range(4,len(l)): val = val+" "+l[k] list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.Status = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputSwitch" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() v = l[3].split('(') val = v[0] list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.Switch = list[key].lower() else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputMeasurementSenseVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MeasuredSVoltage = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputMeasurementTerminalVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MeasuredTVoltage = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputMeasurementCurrent" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MeasuredCurrent = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.SetVoltage = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputCurrent" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.SetCurrent = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputVoltageRiseRate" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.VoltageUpRate = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputVoltageFallRate" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.VoltageDownRate = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputSupervisionMaxSenseVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MaxSVoltage = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputSupervisionMaxTerminalVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MaxTVoltage = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputSupervisionMaxCurrent" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MaxCurrent = list[key] else: print "channelsUpdateAll(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputSupervisionBehavior" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[3]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.Behavior = list[key] else: print "channelsUpdateAll(): No channel",key,"found" def channelsGetReadBacks(self): """ channelsGetReadBacks() gets from all channels in the crate the measured SenseVoltage, TerminalVoltage and Current. """ cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputMeasurementCurrent" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MeasuredCurrent = list[key] else: print "channelsGetReadBacks(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputMeasurementSenseVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MeasuredSVoltage = list[key] else: print "channelsGetReadBacks(): No channel",key,"found" cmd = "snmpwalk -v 2c -m +WIENER-CRATE-MIB -c public "+self.ip+" outputMeasurementTerminalVoltage" resp = os.popen(cmd) list = {} for line in resp: line.rstrip() l = line.split() c = l[0].split('.') chan = c[1].lower() val = float(l[4]) list[chan] = val for chan in self.Channels: key = chan.Name.lower() if (list.has_key(key)): chan.MeasuredTVoltage = list[key] else: print "channelsGetReadBacks(): No channel",key,"found"