def __init__(self,addr='COM1',ndacs=8,polarity=('BIP','BIP'),verb=True,timeout = 2,reset=False):
#Directly using pyserial interface and skipping pyvisa
self.serialport = serial.Serial(addr,baudrate=115200,bytesize=serial.EIGHTBITS, parity=serial.PARITY_ODD, stopbits=serial.STOPBITS_ONE,timeout=timeout)
if ndacs!=8 and ndacs!=16:
print('DAC WARNING, non-standard number of dacs. Should be 8 or 16 but %d was given' % ndacs)
self.ndacs = ndacs
self.verb = verb
self.SetPolarity(polarity)
if reset:
self.RampAllZero(tt=20.)
return
self.lastmessage = ()
#Function to set polarity. This just informs the driver what polarities are in use so it can correctly set the voltages.
#The driver cannot physically set the polarity. The real polarity of the DACs can only be set form the hardware switches.
评论列表
文章目录