IVVI.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:stlab 作者: yausern 项目源码 文件源码
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.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号