本文整理汇总了Python中VISA_Driver.VISA_Driver.performOpen方法的典型用法代码示例。如果您正苦于以下问题:Python VISA_Driver.performOpen方法的具体用法?Python VISA_Driver.performOpen怎么用?Python VISA_Driver.performOpen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VISA_Driver.VISA_Driver
的用法示例。
在下文中一共展示了VISA_Driver.performOpen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
# fix issue with termination for read
visa.vpp43.set_attribute(self.com.vi, visa.VI_ATTR_SUPPRESS_END_EN, visa.VI_FALSE)
self.detectedOptions = self.getOptions()
示例2: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
# fix issue with termination for read
visa.vpp43.set_attribute(self.com.vi, visa.VI_ATTR_SUPPRESS_END_EN, visa.VI_FALSE)
#Detect options: (vector) magnet and swicth heater
detectedOptions = []
rate = self.askAndLog('READ:SYS:VRM:RFMX').strip().rsplit(':',1)[1][1:-1].translate(None,string.letters+"/").split()
if float(rate[0]) > 0:
detectedOptions.append("x magnet")
if float(rate[1]) > 0:
detectedOptions.append("y magnet")
if float(rate[2]) > 0:
detectedOptions.append("z magnet")
heater = self.askAndLog('READ:SYS:VRM:SWHT').strip().rsplit(':',1)[1][1:-1].split()
if heater[0] != "NOSW" or heater[1] != "NOSW" or heater[2] != "NOSW":
detectedOptions.append("switch heater")
self.instrCfg.setInstalledOptions(detectedOptions)
# Make sure that the coordinate system matches the device
coordFunc = self.instrCfg.getQuantity('CoordSys')
v = self.performGetValue(coordFunc)
coordFunc.setValue(v)
示例3: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# init meas param dict
self.dMeasParam = {}
self.cData=None
# calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
示例4: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# start by calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
#Reads out the Arduino upon start
reply = self.read()
self.log('Response at startup: ' + reply)
示例5: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
degChannels = []
self.unitFactors = [0. for i in range(8)]
for i in range(1,9):
#Check if channel can be used (left and right limit tripped indicates failure or missing device)
if int(self.askAndLog(str(i)+"MS").strip()[3].encode("hex"), 16) & 0x18 == 0x18:
continue
#Check the units
unit = self.askAndLog(str(i)+"SN?").strip()[3:]
self.unitFactors[i] = 1.
if unit == "Dg.":
degChannels.append("ch"+str(i)+"deg")
elif unit == "mm":
degChannels.append("ch"+str(i)+"mm")
self.unitFactors[i] = .001;
else:
degChannels.append("ch"+str(i)+"unknown")
#Set maximum velocity
vmax = self.askAndLog(str(i)+"VU?")[3:]
self.writeAndLog(str(i)+"VA"+vmax)
self.instrCfg.setInstalledOptions(degChannels)
示例6: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# start by calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options)
# check for strange bug by reading the status bit
try:
status = self.askAndLog('*STB?', bCheckError=False)
status = int(status)
except:
# if conversion to int failed, re-read instrument buffer to clear
sBuffer = self.read()
self.log('Extra data read from Tek: %s, %s' % (str(status), sBuffer))
# get model name and number of channels
sModel = self.getModel()
self.nCh = 4 if sModel in ('5004', '5014') else 2
# turn off run mode
self.writeAndLog(':AWGC:STOP;')
# init vectors with old values
self.bWaveUpdated = False
self.nOldSeq = -1
self.lOldU16 = [[np.array([], dtype=np.uint16) \
for n1 in range(self.nCh)] for n2 in range(1)]
# clear old waveforms
self.lInUse = [False]*self.nCh
for n in range(self.nCh):
self.createWaveformOnTek(n+1, 0, bOnlyClear=True)
示例7: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# start by calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
self.bSweep1 = self.getValue('Channel 1 Autosweep')
self.bSweep2 = self.getValue('Channel 2 Autosweep')
self.bSweep3 = self.getValue('Channel 3 Autosweep')
self.bSweep4 = self.getValue('Channel 4 Autosweep')
示例8: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
# Check if there really is an IPS120 at the other end of the wire
if not "IPS120" in self.askAndLog("V"):
raise InstrumentDriver.CommunicationError("Could not get an identification as IPS120.")
self.writeAndLog("Q4")
示例9: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
# This device does not respond to *IDN?, so let's check manually
id = self.askAndLog("ID")
if not id in ("7260", "7265"):
raise InstrumentDriver.CommunicationError(
"ID query did not return 7260 or 7265. Is this the right driver for the device at the right address?"
)
return
示例10: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
# start by calling the generic VISA open to make sure we have a connection
VISA_Driver.performOpen(self, options=options)
self.amplitude = 0
self.phase = 0
self.IOffset = 0
self.QOffset = 0
self.II = 1
self.IQ = 0
self.QI = 0
self.QQ = 1
示例11: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self,options={}):
VISA_Driver.performOpen(self,options)
self.wait(delayTime)
"""
#Switch to remote & unlocked mode
#(command already in 'init:' field in INI file)
VISA_Driver.writeAndLog('$C3')
"""
self.clearMessages()
#Switch to extended resolution
VISA_Driver.writeAndLog(self,'$Q4')
#Clear clamped status, if applicable
VISA_Driver.writeAndLog(self,'$A0')
self.wait(delayTime)
示例12: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
VISA_Driver.performOpen(self, options=options)
self.data = None
self.xdisp = 0
self.xincr = 1
self.f1 = 0
self.f2 = 0
self.I1 = None
self.Q1 = None
self.I2 = None
self.Q2 = None
self.P1Mean = None
self.P2Mean = None
self.psi = None
self.covar = None
示例13: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={"values_format":visa.single | visa.big_endian}):
"""Perform the operation of opening the instrument connection"""
try:
VISA_Driver.performOpen(self, options=options) # start by calling the generic VISA open to make sure we have a connection
self.com.values_format=visa.single | visa.big_endian #this sets this bit order so we can interpret the binary data
self.writeAndLog("HEADER OFF") #having the header on makes reading data more difficult
self.writeAndLog("DATA:ENCDG FPBinary") # enable the encoding of bits we can understand (faster data transfer than ASCII)
self.AvgTrace = {'Time': None, #This is a local dictionary to avoid taking a sweep twice unnecessarily
'Amplitude': None,
'RollAvg Time': None,
'RollAvg Amplitude': None}
self.numRep=self.getValue("Number of shifts")
except Error as e:
# re-cast errors as a generic communication error
msg = str(e)
raise InstrumentDriver.CommunicationError(msg)
示例14: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={}):
""" Perform the operation of opening the instrument connection """
# self.writeAndLog('*CLS')
VISA_Driver.performOpen(self, options=options)
self.writeAndLog("*CLS")
self.writeAndLog("OUTX0") # set output to GPIB
self.writeAndLog("PDST 3") # set Print/Plot/Dump destination to GPIB
self.writeAndLog("DISP 2, 1") # set displays live
self.writeAndLog("DFMT 1") # set displays to dual display
self.writeAndLog("ACTD 0") # set active display to displayA
self.writeAndLog("RPMF 0") # set Hz as frequency units (not RPM)
self.writeAndLog("A1RG 1") # Autoranges Channel 1
self.writeAndLog("A2RG 1") # Autoranges Channel 2
self.writeAndLog("I1AR 1") # Autotracks Channel 1
self.writeAndLog("I2AR 1") # Autotracks Channel 2
self.writeAndLog("ASCL 0") # Autoscales Display 0
self.writeAndLog("ASCL 1") # Autoscales Display 1
self.writeAndLog("STRT") # Starts measurement
示例15: performOpen
# 需要导入模块: from VISA_Driver import VISA_Driver [as 别名]
# 或者: from VISA_Driver.VISA_Driver import performOpen [as 别名]
def performOpen(self, options={"values_format": visa.single | visa.big_endian}):
"""Perform the operation of opening the instrument connection"""
# start by calling the generic VISA open to make sure we have a connection
# always get function and range: they are essential for correct resolution and sweeping
############### quantFunc = self.instrCfg.getQuantity('Function')
###############valueFunc = self.performGetValue(quantFunc)
####################3quantFunc.setValue(valueFunc)
try:
VISA_Driver.performOpen(self, options=options)
self.com.values_format = visa.single | visa.big_endian
self.writeAndLog("HEADER OFF")
self.writeAndLog("DATa:STOP 4000")
self.writeAndLog("DATA:ENCDG FPBinary")
# self.lTrace= [None] * 2
self.numMeas = 25
self.AvgTrace = {"Time": None, "Amplitude": None}
except Error as e:
# re-cast afdigitizer errors as a generic communication error
msg = str(e)
raise InstrumentDriver.CommunicationError(msg)