예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
    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
예제 #5
0
    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
예제 #6
0
    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
예제 #7
0
    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
예제 #8
0
    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
예제 #9
0
    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
예제 #10
0
    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
예제 #11
0
    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
예제 #12
0
    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
예제 #13
0
    def amplitude(self, axis, amp):
        '''
		set the amplitude setpoint in V
		'''
        ANC.positionerAmplitude(self.handle, axis, ANC.Int32(int(1000 * amp)))
예제 #14
0
    def moveSingleStep(self, axis, direction):
        '''
		starts a one-step positioning.
		Previous movement will be stopped. direction can be 0 (forward) or 1 (backward)
		'''
        ANC.positionerMoveSingleStep(self.handle, axis, ANC.Int32(direction))
예제 #15
0
    def frequency(self, axis, freq):
        '''
		sets the frequency of selected axis. frequency in Hz
		'''
        ANC.positionerFrequency(self.handle, axis, ANC.Int32(int(freq)))
예제 #16
0
    def dcLevel(self, axis, dclev):
        '''
		sets the dc level of selected axis. dclevel in V
		'''

        ANC.positionerDCLevel(self.handle, axis, ANC.Int32(int(1000 * dclev)))