# devices.physikinstrumente:MercuryC663


Driver for PI stepper motor @ Rote Zora.


Usage

``` python
devices.physikinstrumente:MercuryC663(
    interface,
    **kwargs,
)
```


Provides control for the PI stepper motor with ItemID of the axis used for communication being 1.


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize the Mercury C663 device. |
| [getAngle()](#getAngle) | Read current target angle. |
| [getMotorState()](#getMotorState) | Get the motor state for the axis. |
| [getOnTarget()](#getOnTarget) | Read on-target status of axis 1. |
| [getReference()](#getReference) | Check reference state of the motor. |
| [gotohome()](#gotohome) | Move the motor to home position (0deg). |
| [setAngleAbs()](#setAngleAbs) | Move to absolute angle defined from home position. |
| [setAngleRel()](#setAngleRel) | Move to angle relative to current position. |
| [setMotorOFF()](#setMotorOFF) | Turn off the motor for the axis. |
| [setMotorON()](#setMotorON) | Turn on the motor for the axis. |
| [setReference()](#setReference) | Move the motor to reference position (6deg). |
| [stop()](#stop) | Stop all axis movement with system deceleration. |

------------------------------------------------------------------------


### \_\_init\_\_()


Initialize the Mercury C663 device.


Usage

``` python
__init__(
    interface,
    **kwargs,
)
```


#### Parameters


`interface: str`  
VISA resource name or interface identifier


------------------------------------------------------------------------


### getAngle()


Read current target angle.


Usage

``` python
getAngle()
```


#### Returns


`float`  
Current target angle in degrees


------------------------------------------------------------------------


### getMotorState()


Get the motor state for the axis.


Usage

``` python
getMotorState()
```


#### Returns


`int`  
Motor state: 1 for on, 0 for off


------------------------------------------------------------------------


### getOnTarget()


Read on-target status of axis 1.


Usage

``` python
getOnTarget()
```


#### Returns


`int`  
1 if the axis is on target, 0 if not


------------------------------------------------------------------------


### getReference()


Check reference state of the motor.


Usage

``` python
getReference()
```


#### Returns


`int`  
Reference state: 1 if successfully referenced, 0 if not


------------------------------------------------------------------------


### gotohome()


Move the motor to home position (0deg).


Usage

``` python
gotohome()
```


Note: Motor must be switched on!


------------------------------------------------------------------------


### setAngleAbs()


Move to absolute angle defined from home position.


Usage

``` python
setAngleAbs(angle)
```


#### Parameters


`angle: float`  
Target absolute angle in degrees


------------------------------------------------------------------------


### setAngleRel()


Move to angle relative to current position.


Usage

``` python
setAngleRel(angle)
```


The sum of the provided angle and the last commanded target position is set as the new target position.


#### Parameters


`angle: float`  
Relative angle change in degrees


------------------------------------------------------------------------


### setMotorOFF()


Turn off the motor for the axis.


Usage

``` python
setMotorOFF()
```


------------------------------------------------------------------------


### setMotorON()


Turn on the motor for the axis.


Usage

``` python
setMotorON()
```


This needs to be done after connecting to the motor.


------------------------------------------------------------------------


### setReference()


Move the motor to reference position (6deg).


Usage

``` python
setReference()
```


Note: Motor must be switched on!


------------------------------------------------------------------------


### stop()


Stop all axis movement with system deceleration.


Usage

``` python
stop()
```
