コード例 #1
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def triggerPolarity(self, triggerno, polarity):
        '''
		sets the polarity of the external trigger,
		triggerno: 0-5,
		polarity: 0 low active, 1 high active
		'''
        ANC.positionerTriggerPolarity(self.handle, triggerno, polarity)
コード例 #2
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def quadratureOutputPeriod(self, quadratureno, period):
        '''
		selects the position difference which causes a step on the output AB-signal.
		quadratureno: number of addressed quadrature unit (0-2).
		period: period in unit of actor * 1000
		'''
        ANC.positionerQuadratureOutputPeriod(self.handle, quadratureno, period)
コード例 #3
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def capMeasure(self, axis):
        '''
		determines the capacitance of the piezo addressed by axis
		'''
        self.status = ANC.Int32(0)
        ANC.positionerCapMeasure(self.handle, axis, ctypes.byref(self.status))
        return self.status.value
コード例 #4
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def moveRelative(self, axis, position, rotcount=0):
        '''
		starts approach to relative target position.
		previous movement will be stopped. rotcount optional argument.
		position units are in 'unit of actor multiplied by 1000' (generally nanometres)
		'''
        ANC.positionerMoveRelative(self.handle, axis, position, rotcount)
コード例 #5
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def bandwidthLimitEnable(self, axis, state):
        '''
		activates/deactivates the bandwidth limiter of the addressed axis.
		only applicable for scanner axes
		'''
        ANC.positionerBandwidthLimitEnable(self.handle, axis,
                                           ctypes.c_bool(state))
コード例 #6
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getSpeed(self, axis):
        '''
		determines the actual speed. In case of standstill of this actor this is the calculated speed resulting	from amplitude setpoint, frequency, and motor parameters. In case of movement this is measured speed.
		'''
        self.spd = ANC.Int32(0)
        ANC.positionerGetSpeed(self.handle, axis, ctypes.byref(self.spd))
        return self.spd.value
コード例 #7
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getPosition(self, axis):
        '''
		determines actual position of addressed axis
		'''
        self.pos = ANC.Int32(0)
        ANC.positionerGetPosition(self.handle, axis, ctypes.byref(self.pos))
        return self.pos.value
コード例 #8
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getFrequency(self, axis):
        '''
		determines the frequency in Hz
		'''
        self.freq = ANC.Int32(0)
        ANC.positionerGetFrequency(self.handle, axis, ctypes.byref(self.freq))
        return self.freq.value
コード例 #9
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getDcLevel(self, axis):
        '''
		determines the status actual DC level in V
		'''
        self.dclev = ANC.Int32(0)
        ANC.positionerGetDcLevel(self.handle, axis, ctypes.byref(self.dclev))
        return self.dclev.value / 1000
コード例 #10
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def singleCircleMode(self, axis, state):
        '''
		switches single circle mode. In case of activated single circle mode
		the number of rotations are ignored and the shortest way to target
		position is used. Only relevant for rotary actors.
		'''
        ANC.positionerSingleCircleMode(self.handle, axis, ctypes.c_bool(state))
コード例 #11
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def quadratureInputPeriod(self, quadratureno, period):
        '''
		selects the stepsize the controller executes when detecting a step on
		its input AB-signal.
		quadratureno: number of addressed quadrature unit (0-2).
		period: stepsize in unit of actor * 1000
		'''
        ANC.positionerQuadratureInputPeriod(self.handle, quadratureno, period)
コード例 #12
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getDcInEnable(self, axis):
        '''
		determines status of dc input of addressed axis. only applicable for scanner/dither axes
		'''
        self.status = ctypes.c_bool(None)
        ANC.positionerGetDcInEnable(self.handle, axis,
                                    ctypes.byref(self.status))
        return self.status.value
コード例 #13
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def updateAbsolute(self, axis, position):
        '''
		updates target position for a *running* approach.
		function has lower performance impact on running approach compared to
		.moveAbsolute(). position units are in 'unit of actor multiplied by 1000'
		(generally nanometres)
		'''
        ANC.positionerUpdateAbsolute(self.handle, axis, position)
コード例 #14
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getRotCount(self, axis):
        '''
		determines actual number of rotations in case of rotary actuator
		'''
        self.rotcount = ANC.Int32(0)
        ANC.positionerGetRotCount(self.handle, axis,
                                  ctypes.byref(self.rotcount))
        return self.rotcount.value
コード例 #15
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getReferenceRotCount(self, axis):
        '''
		determines actual position of addressed axis
		'''
        self.rotcount = ANC.Int32(0)
        ANC.positionerGetReferenceRotCount(self.handle, axis,
                                           ctypes.byref(self.rotcount))
        return self.rotcount.value
コード例 #16
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getStatus(self, axis):
        '''
		determines the status of the selected axis.
		result: bit0 (moving), bit1 (stop detected), bit2 (sensor error), bit3 (sensor disconnected)
		'''
        self.status = ANC.Int32(0)
        ANC.positionerGetStatus(self.handle, axis, ctypes.byref(self.status))
        return self.status.value
コード例 #17
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getBandwidthLimitEnable(self, axis):
        '''
		determines status of bandwidth limiter of addressed axis. only applicable for scanner axes
		'''
        self.status = ctypes.c_bool(None)
        ANC.positionerGetBandwidthLimitEnable(self.handle, axis,
                                              ctypes.byref(self.status))
        return self.status.value
コード例 #18
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def amplitudeControl(self, axis, mode):
        '''
		selects the type of amplitude control.
		The amplitude is controlled by the positioner to hold the value constant
		determined by the selected type of amplitude control.
		mode takes values 0: speed, 1: amplitude, 2: step size
		'''
        ANC.positionerAmplitudeControl(self.handle, axis, mode)
コード例 #19
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getReference(self, axis):
        '''
		determines distance of reference mark to origin
		'''
        self.pos = ANC.Int32(0)
        self.validity = ctypes.c_bool(None)
        ANC.positionerGetReference(self.handle, axis, ctypes.byref(self.pos),
                                   ctypes.byref(self.validity))
        return self.pos.value, self.validity.value
コード例 #20
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def triggerModeIn(self, mode):
        '''
		selects the mode of the input trigger signalsself.
		state:
			0 disabled - inputs trigger nothing,
			1 quadrature - three pairs of trigger in signals are used to accept
				AB-signals for relative positioning,
			2 coarse - trigger in signals are used to generate coarse steps
		'''
        ANC.positionerTriggerModeIn(self.handle, mode)
コード例 #21
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getAmplitude(self, axis):
        '''
		determines the actual amplitude in V. In case of standstill of the actor this
		is the amplitude setpoint. In case of movement the amplitude set by
		amplitude control is determined.
		'''
        self.status = ANC.Int32(0)
        ANC.positionerGetAmplitude(self.handle, axis,
                                   ctypes.byref(self.status))
        return self.status.value / 1000
コード例 #22
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def getStepwidth(self, axis):
        '''
		determines the step width. In case of standstill of the motor this
		is the calculated step width resulting from amplitude setpoint,
		frequency, and motor parameters. In case of movement this is measured
		step width
		'''
        self.stepwdth = ANC.Int32(0)
        ANC.positionerGetStepwidth(self.handle, axis,
                                   ctypes.byref(self.stepwdth))
        return self.stepwdth.value
コード例 #23
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def check(self):
        '''
		Determines number of connected positioners and their respective hardware IDs
		'''
        self.posinf = ANC.PositionerInfo()  #create PositionerInfo Struct
        self.numconnected = ANC.positionerCheck(ctypes.byref(
            self.posinf))  #look for positioners!
        if self.numconnected > 0:
            print(self.numconnected, 'ANC350 connected')
            print('ANC350 with id:', self.posinf.id, 'has locked state:',
                  self.posinf.locked)
コード例 #24
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def connect(self):
        '''
		Establishes connection to first device found
		'''
        self.handle = ANC.Int32(0)
        try:
            ANC.positionerConnect(0, ctypes.byref(
                self.handle))  #0 means "first device"
            print('connected to first positioner')
        except Exception as e:
            print('unable to connect!')
            raise e
コード例 #25
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def triggerModeOut(self, mode):
        '''
		selects the mode of the output trigger signals.
		state:
			0 disabled - inputs trigger nothing,
			1 position - the trigger outputs reacts to the defined position
				ranges with the selected polarity,
			2 quadrature - three pairs of trigger out signals are used to
				signal relative movement as AB-signals,
			3 IcHaus - the trigger out signals are used to output the internal
				position signal of num-sensors
		'''
        ANC.positionerTriggerModeOut(self.handle, mode)
コード例 #26
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def close(self):
        '''
		closes connection to ANC350 device
		'''
        ANC.positionerClose(self.handle)
コード例 #27
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def clearStopDetection(self, axis):
        '''
		when .setStopDetectionSticky() is enabled, this clears the stop detection status
		'''
        ANC.positionerClearStopDetection(self.handle, axis)
コード例 #28
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def triggerAxis(self, triggerno, axis):
        '''
		selects the corresponding axis for the addressed trigger. triggerno is 0-5
		'''
        ANC.positionerTriggerAxis(self.handle, triggerno, axis)
コード例 #29
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def triggerEpsilon(self, triggerno, epsilon):
        '''
		sets the hysteresis of the external trigger. epsilon in units of actor * 1000
		'''
        ANC.positionerTriggerEpsilon(self.handle, triggerno, epsilon)
コード例 #30
0
ファイル: PyANC350v2.py プロジェクト: floubar/PyANC350v2
    def amplitude(self, axis, amp):
        '''
		set the amplitude setpoint in V
		'''
        ANC.positionerAmplitude(self.handle, axis, ANC.Int32(int(1000 * amp)))