예제 #1
0
파일: vna.py 프로젝트: seilis/scikit-rf
 def __init__(self, address=16, channel=1,timeout = 3, echo = False,
     front_panel_lockout= False, **kwargs):
     '''
     Constructor 
     
     Parameters
     -------------
     address : int
         GPIB address 
     channel : int
         set active channel. Most commands operate on the active channel
     timeout : number
         GPIB command timeout in seconds. 
     echo : Boolean
         echo  all strings passed to the write command to stdout. 
         usefule for troubleshooting
     front_panel_lockout : Boolean
         lockout front panel during operation. 
     \*\*kwargs : 
         passed to :func:`visa.GpibInstrument.__init__`
     '''
     GpibInstrument.__init__(self,
         'GPIB::'+str(address),
         timeout=timeout,
         **kwargs)
         
     self.channel=channel
     self.port = 1
     self.echo = echo
     if not front_panel_lockout:
         self.gtl()
예제 #2
0
파일: vna.py 프로젝트: linan0827/scikit-rf
 def __init__(self, address=16, channel=1, timeout=3, **kwargs):
     GpibInstrument.__init__(self,
                             'GPIB::' + str(address),
                             timeout=timeout,
                             **kwargs)
     self.channel = channel
     self.port = 1
예제 #3
0
class GPIBBus(VISABus):
    "implements communication over GPIB bus using VISA framework"

    class SBRclass:
        "GPIB status byte register"
        MAV = 16  # message available - HAS SOME TROUBLES - it is common object to ALL GPIBBus devices
        MSS = 32  # Master Summary Status summarizes the ESB and MAV bits.
        semafor = None

    lastCMDstring = ''
    sbr = SBRclass()
    timeout = 5.1  # the commnad issuing and readign timeout

    def __init__(self, GPIBaddr, MAVmask=16, IfaceReadyMask=0):
        deviceIBName = "GPIB0::%d::INSTR" % GPIBaddr
        VISABus.__init__(self, deviceIBName)
        self.f = GpibInstrument(deviceIBName)
        #self.sbr.semafor = GPIB_semafor
        #self.sbr.semafor.acquire()
        print self.deviceIBName, ':clearing the device buffer...'
        self.f.clear()
        #self.sbr.semafor.release()
        #self.sbr.MAV = MAVmask    # how to detect the reading was don and response is available
        self.MAVmaks = MAVmask  # sets the message available mask
        self.IfaceReadyMask = IfaceReadyMask
        return
예제 #4
0
 def __init__(self, address=18, *args, **kwargs):
     '''
     Initializer
     
     Parameters
     --------------
     address : int
         GPIB address
     \*args, \*\*kwargs :
         passed to ``visa.GpibInstrument.__init__``
     '''
     GpibInstrument.__init__(self, 'GPIB::' + str(address), *args, **kwargs)
예제 #5
0
 def __init__(self, address=18, *args, **kwargs):
     '''
     Initializer
     
     Parameters
     --------------
     address : int
         GPIB address
     \*args, \*\*kwargs :
         passed to ``visa.GpibInstrument.__init__``
     '''
     GpibInstrument.__init__(self,'GPIB::'+str(address),*args,**kwargs)
예제 #6
0
 def __init__(self, GPIBaddr, MAVmask=16, IfaceReadyMask=0):
     deviceIBName = "GPIB0::%d::INSTR" % GPIBaddr
     VISABus.__init__(self, deviceIBName)
     self.f = GpibInstrument(deviceIBName)
     #self.sbr.semafor = GPIB_semafor
     #self.sbr.semafor.acquire()
     print self.deviceIBName, ':clearing the device buffer...'
     self.f.clear()
     #self.sbr.semafor.release()
     #self.sbr.MAV = MAVmask    # how to detect the reading was don and response is available
     self.MAVmaks = MAVmask  # sets the message available mask
     self.IfaceReadyMask = IfaceReadyMask
     return
예제 #7
0
    def __init__(self, address=1, current_axis=1,\
            always_wait_for_stop=True,delay=0,**kwargs):
        '''
        takes:
                address:        Gpib address, int [1]
                current_axis:   number of current axis, int [1]
                always_wait_for_stop:   wait for stage to stop before
                        returning control to calling program, boolean [True]
                **kwargs:       passed to GpibInstrument initializer
        '''

        GpibInstrument.__init__(self,address,**kwargs)
        self.current_axis = current_axis
        self.always_wait_for_stop = always_wait_for_stop
        self.delay=delay
예제 #8
0
파일: vna.py 프로젝트: seilis/scikit-rf
 def write(self, msg, *args, **kwargs):
     '''
     Write a msg to the instrument. 
     '''
     if self.echo:
         print msg 
     return GpibInstrument.write(self,msg, *args, **kwargs)
예제 #9
0
파일: stages.py 프로젝트: seilis/scikit-rf
    def __init__(self, address=1, current_axis=1, always_wait_for_stop=True, delay=0, **kwargs):
        """
        Initializer 
        
        Parameters
        -------------
        address :   int
            Gpib address
        current_axis :   int 
            number of current axis
        always_wait_for_stop :   Boolean
            wait for stage to stop before
            returning control to calling program
        \*\*kwargs :
            passed to GpibInstrument initializer
        """

        GpibInstrument.__init__(self, address, **kwargs)
        self.current_axis = current_axis
        self.always_wait_for_stop = always_wait_for_stop
        self.delay = delay
예제 #10
0
    def __init__(self, address=1, current_axis=1,\
            always_wait_for_stop=True,delay=0,**kwargs):
        '''
        Initializer 
        
        Parameters
        -------------
        address :   int
            Gpib address
        current_axis :   int 
            number of current axis
        always_wait_for_stop :   Boolean
            wait for stage to stop before
            returning control to calling program
        \*\*kwargs :
            passed to GpibInstrument initializer
        '''

        GpibInstrument.__init__(self, address, **kwargs)
        self.current_axis = current_axis
        self.always_wait_for_stop = always_wait_for_stop
        self.delay = delay
예제 #11
0
파일: vna.py 프로젝트: rgommers/scikit-rf
	def __init__(self, address=16,**kwargs):
		GpibInstrument.__init__(self,'GPIB::'+str(address),**kwargs)
		self.write('FORM4;')
예제 #12
0
파일: vna.py 프로젝트: rgommers/scikit-rf
	def __init__(self, address=16, channel=1,**kwargs):
		GpibInstrument.__init__(self,'GPIB::'+str(address),**kwargs)
		self.channel=channel
		self.write('calc:par:sel CH1_S11_1')
예제 #13
0
파일: vna.py 프로젝트: rgommers/scikit-rf
	def __init__(self, address=20,**kwargs):
		GpibInstrument.__init__(self,address, **kwargs)
		self.add_channel(1)
예제 #14
0
파일: vna.py 프로젝트: rgommers/scikit-rf
	def __init__(self, address=20, active_channel = 1, continuous=True,\
		**kwargs):
		GpibInstrument.__init__(self,address, **kwargs)
		self.active_channel = active_channel
		self.continuous = continuous
		self.traces = []
예제 #15
0
파일: vna.py 프로젝트: linan0827/scikit-rf
 def __init__(self, address=20, active_channel = 1, continuous=True,\
         **kwargs):
     GpibInstrument.__init__(self, address, **kwargs)
     self.active_channel = active_channel
     self.continuous = continuous
     self.traces = []
예제 #16
0
파일: vna.py 프로젝트: linan0827/scikit-rf
 def __init__(self, address=20, **kwargs):
     GpibInstrument.__init__(self, address, **kwargs)
     self.add_channel(1)
예제 #17
0
파일: vna.py 프로젝트: linan0827/scikit-rf
 def __init__(self, address=16, **kwargs):
     GpibInstrument.__init__(self, 'GPIB::' + str(address), **kwargs)
     self.write('FORM4;')
예제 #18
0
파일: vna.py 프로젝트: edy555/scikit-rf
 def __init__(self, address=16, channel=1,timeout = 3, **kwargs):
     GpibInstrument.__init__(self,'GPIB::'+str(address),timeout=timeout,**kwargs)
     self.channel=channel
     self.port = 1