def __init__(self,visaAddress=None): ScpiDevice.__init__(self) SwitchPlatform.__init__(self,{ \ 'generator':AgilentSwitch(self,{ \ 'bridge': 1103, 'Prana': 1105, 'Milmega': 1106, 'open': 1108 \ }), 'DUT':AgilentSwitch(self,{ \ 'SAorVNA': 1112, 'bridge': 1113, 'Prana': 1115, 'Milmega': 1116, 'open': 1118 \ }), 'powerMeterIncident':AgilentSwitch(self,{ \ 'Prana': 1125, 'Milmega': 1126, 'open': 1128 \ }), 'powerMeterReflected':AgilentSwitch(self,{ \ 'bridge': 1133, 'Prana': 1135, 'Milmega': 1136, 'open': 1138 \ }) }) self._presets = { \ 'bridge' : {'DUT':'bridge', 'powerMeterReflected':'bridge', 'generator':'bridge'}, 'Prana' : {'DUT':'Prana', 'powerMeterIncident':'Prana', 'powerMeterReflected':'Prana', 'generator':'Prana'}, 'Milmega' : {'DUT':'Milmega', 'powerMeterIncident':'Milmega', 'powerMeterReflected':'Milmega', 'generator':'Milmega'} \ }
def putOnline(self): ScpiDevice.putOnline(self) if self._deviceHandle: self._deviceHandle.timeout = 20000 if not self.frontPanelLockout: self.gtl() #self.write('FORM{0:d};'.format(self.dataFormat)) self._setGpibRemote(True) self._gotoNullStatus() if not self._lastLearnString: self._obtainLearnString() self._restoreLearnString()
def __init__(self, visaAddress=None,frontPanelLockout=True,**kwargs): ScpiDevice.__init__(self,visaAddress) self.ifBandwidth = quantities.Frequency(3000,'Hz') # scikit-rf API compatibility self.channel=1 self.port = 1 self.echo = False self.frontPanelLockout = frontPanelLockout self._lastFrequency = None self._lastLearnString = None self._hardPresetMethod = None
def __init__(self,*args,**kwargs): ScpiDevice.__init__(self,*args,**kwargs) SwitchPlatform.__init__(self,{ \ 'generator':AgilentSwitch(self,{ \ 'Amplifier 1': 1102, 'coupler': 1103, 'Amplifier 2': 1105, 'Amplifier 3': 1106, 'open': 1108 \ }), 'DUT':AgilentSwitch(self,{ \ 'Amplifier 1': 1112, 'coupler': 1113, 'Amplifier 2': 1115, 'Amplifier 3': 1116, 'open': 1118 \ }), 'powerMeterIncident':AgilentSwitch(self,{ \ 'Amplifier 1': 1122, 'coupler': 1123, 'Amplifier 2': 1125, 'Amplifier 3': 1126, 'open': 1128 \ }), 'powerMeterReflected':AgilentSwitch(self,{ \ 'Amplifier 1': 1132, 'coupler': 1133, 'Amplifier 2': 1135, 'Amplifier 3': 1136, 'open': 1138 \ }) }) def allSamePosition(position): return { \ 'DUT':position, 'powerMeterIncident':position, 'powerMeterReflected':position, 'generator':position\ } self._presets = { \ 'open': allSamePosition('open'), 'coupler': allSamePosition('coupler'), 'Amplifier 3': allSamePosition('Amplifier 3'), 'Amplifier 1': allSamePosition('Amplifier 1'), 'Amplifier 2': allSamePosition('Amplifier 2') \ }
def createHandle(self): ScpiDevice.createHandle(self) if type(self._deviceHandle).__name__ == 'SerialInstrument': self._deviceHandle.term_chars = '\r\n' self._deviceHandle.baud_rate = 19200 self._deviceHandle.parity = 0 self._deviceHandle.stop_bits = 1 self._deviceHandle.clear() # TODO: remove dirty nobody-knows-why flushing by having one timeout for tryNumber in range(10): try: print 'Trying to get serial interface in a well-known state' self._deviceHandle._vpp43.flush(self._deviceHandle.vi,self._deviceHandle._vpp43.VI_READ_BUF_DISCARD) self._deviceHandle._vpp43.flush(self._deviceHandle.vi,self._deviceHandle._vpp43.VI_WRITE_BUF_DISCARD) print self._deviceHandle.ask('*IDN?') break except: pass
def _write(self,command,useSRQ=False,timeout=3000): if type(self._deviceHandle).__name__ == 'GpibInstrument': if useSRQ: ScpiDevice._write(self,command + '; RQ') self._deviceHandle.wait_for_srq(timeout) else: ScpiDevice._write(self,command) elif type(self._deviceHandle).__name__ == 'SerialInstrument': ScpiDevice._write(self,command) else: raise ValueError('Device handle of type ' + type(self._deviceHandle).__name__ + ' not supported')
def reset(self): ScpiDevice.reset(self) self.write(':CONFigure:SANalyzer') # self.write(':INITiate:CONTinuous ON') self.write(':CAL:AUTO OFF')
def putOnline(self): # try: ScpiDevice.putOnline(self)
def putOnline(self): ScpiDevice.putOnline(self) if self.online: self.write('ROUT:CHAN:VER:ENAB ON,(@1102:1138)') #TODO: take minimum an maximum of switchMapping
def write(self,command): # print 'Newport300.write',command ScpiDevice.write(self,command + '; RQ') self._deviceHandle.wait_for_srq(15)
def putOnline(self): ScpiDevice.putOnline(self) # self._deviceHandle.term_chars = '\r' if self._deviceHandle: self.clear()
def __init__(self): Positioner.__init__(self) ScpiDevice.__init__(self) self.axesGrouped = None self.homed = None
def putOnline(self): ScpiDevice.putOnline(self) if self._deviceHandle: self.clear()
def putOnline(self): ScpiDevice.putOnline(self) if self.online: self.write('ROUT:CHAN:VER:ENAB ON,(@1102:1138)') #TODO: take minimum an maximum of switchMapping self.write('ROUTe:RMODule:BANK:LED:DRIVe:ENABle ON,ALL,(@1100)') #enables LED drive for all channels self.write('ROUTe:RMODule:BANK:LED:DRIVe:LEVel 0.02,ALL,(@1100)') #...at 20mA drive strength