# API Reference v10.3.1 (Python)

## Ge1xGripper (class)

Module: zaber_motion.product

Class representing a gripper in the GE1x series.

The following example illustrates how you can obtain an instance of this type:

```py
from zaber_motion.product import Ge1xGripper

ge_1_x_gripper = Ge1xGripper.open_connection("COM3")
```

Related Guides:

- [GE1x Series Gripper](https://software.zaber.com/motion-library/docs/guides/product_specific/ge1x_gripper.md)

### Constants

#### `DEFAULT_DEVICE_ADDRESS`

`Ge1xGripper.DEFAULT_DEVICE_ADDRESS`

Type: `int`

The default device address for a gripper in the GE1x series.

##### Value

`1`

### Properties

#### `connection_id` (read-only)

`ge_1_x_gripper.connection_id`

Type: `int`

The identifier for the connection.

### Methods

#### `activate_preset()` (async available)

`ge_1_x_gripper.activate_preset(preset_number, wait_until_idle = True)`

Activates a preset, causing the gripper to move to the preset position using the preset force and speed.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `preset_number` | `int` | The preset number to activate, from 1 to 4. |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `calibrate()` (async available)

`ge_1_x_gripper.calibrate()`

Performs a calibration of the travel range by moving to the fully open and fully closed positions.

#### `clear_error()` (async available)

`ge_1_x_gripper.clear_error()`

Clears the current error of the gripper.

#### `close()` (async available)

`ge_1_x_gripper.close()`

Closes the connection to the gripper.

#### `driver_disable()` (async available)

`ge_1_x_gripper.driver_disable()`

Disables the gripper driver.

#### `driver_enable()` (async available)

`ge_1_x_gripper.driver_enable()`

Enables the gripper driver.

#### `get_current()` (async available)

`ge_1_x_gripper.get_current()`

Gets the current current of the gripper.

##### Return Value

Type: `int`

The current current of the gripper in milliamps.

#### `get_error()` (async available)

`ge_1_x_gripper.get_error()`

Gets the current error of the gripper.

##### Return Value

Type: [`Ge1xGripperError`](https://software.zaber.com/motion-library/api/py/product/ge1xgrippererror.md)

The current error of the gripper.

#### `get_io_input_preset_number()` (async available)

`ge_1_x_gripper.get_io_input_preset_number()`

Gets the preset number currently activated by the gripper IO input.

##### Return Value

Type: `int`

The current preset number activated by the gripper IO input.

#### `get_position()` (async available)

`ge_1_x_gripper.get_position()`

Gets the current position of the gripper.

##### Return Value

Type: `float`

The current position of the gripper as a percentage, where 0 is closed and 100 is open.

#### `get_state()` (async available)

`ge_1_x_gripper.get_state()`

Gets the current state of the gripper.

##### Return Value

Type: [`Ge1xGripperState`](https://software.zaber.com/motion-library/api/py/product/ge1xgripperstate.md)

The current state of the gripper.

#### `home()` (async available)

`ge_1_x_gripper.home(wait_until_idle = True)`

Homes gripper by moving it to its homing position.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `is_homed()` (async available)

`ge_1_x_gripper.is_homed()`

Checks if the gripper has been homed.

##### Return Value

Type: `bool`

True if the gripper is homed, false otherwise.

#### `move()` (async available)

`ge_1_x_gripper.move(position, wait_until_idle = True)`

Moves the gripper to a specified position.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `position` | `float` | The target position for the gripper as a percentage, where 0 is closed and 100 is open. |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `move_close()` (async available)

`ge_1_x_gripper.move_close(wait_until_idle = True)`

Moves the gripper to the closed position.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `move_open()` (async available)

`ge_1_x_gripper.move_open(wait_until_idle = True)`

Moves the gripper to the open position.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

(static)

#### `open_connection()` (async available)

`Ge1xGripper.open_connection(port_name, device_address = DEFAULT_DEVICE_ADDRESS, timeout = 500)`

Opens a serial connection to a gripper.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `port_name` | `str` | The name of the serial port to connect to. |
| `device_address` | `int` | The address of the gripper to connect to. |
| `timeout` | `int` | The timeout in milliseconds for any request sent using this connection. |

##### Return Value

Type: [`Ge1xGripper`](https://software.zaber.com/motion-library/api/py/product/ge1xgripper.md)

A Ge1xGripper instance representing the connection to the gripper.

#### `read_register()` (async available)

`ge_1_x_gripper.read_register(register_address)`

Reads a single register value from the gripper.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `register_address` | `int` | The address of the register to read. |

##### Return Value

Type: `int`

The data at the specified register address.

#### `set_auto_home()` (async available)

`ge_1_x_gripper.set_auto_home(enabled, save_to_flash = True)`

Enables or disables automatic homing on power up.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `enabled` | `bool` | True to enable automatic homing on power up, false to disable. |
| `save_to_flash` | `bool` | Save the auto home setting to flash memory so it is retained on power cycle. |

#### `set_force()` (async available)

`ge_1_x_gripper.set_force(force)`

Sets the gripping force of the gripper.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `force` | `int` | The gripping force as a percentage from 20 to 100. |

#### `set_home_direction()` (async available)

`ge_1_x_gripper.set_home_direction(direction, save_to_flash = True)`

Sets the home direction for the gripper.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `direction` | [`Ge1xGripperDirection`](https://software.zaber.com/motion-library/api/py/product/ge1xgripperdirection.md) | The home direction to set. |
| `save_to_flash` | `bool` | Save the home direction setting to flash memory so it is retained on power cycle. |

#### `set_io_enabled()` (async available)

`ge_1_x_gripper.set_io_enabled(enabled, save_to_flash = True)`

Enables or disables IO control for the gripper. When enabled, the gripper will not move to a preset position until the IO input changes.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `enabled` | `bool` | True to enable IO control, false to disable. |
| `save_to_flash` | `bool` | Save the IO enabled setting to flash memory so it is retained on power cycle. |

#### `set_io_input_filter()` (async available)

`ge_1_x_gripper.set_io_input_filter(duration, save_to_flash = True)`

Sets the debounce filter time for the gripper IO input to suppress noise.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `duration` | `int` | The IO input filter time in milliseconds. |
| `save_to_flash` | `bool` | Save the IO input filter setting to flash memory so it is retained on power cycle. |

#### `set_preset()` (async available)

`ge_1_x_gripper.set_preset(preset_number, position, force = 100, speed = 100, save_to_flash = True)`

Saves a position, force, and speed as a preset that can be enabled using I/O or the activatePreset() method. Note that presets are only activated by I/O when the I/O input changes to that preset number.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `preset_number` | `int` | The preset number to save the preset to, from 1 to 4. |
| `position` | `float` | The target position for the preset as a percentage, where 0 is closed and 100 is open. |
| `force` | `int` | The gripping force for the preset as a percentage from 20 to 100. |
| `speed` | `int` | The maximum speed for the preset as a percentage from 1 to 100. |
| `save_to_flash` | `bool` | Save the preset to flash memory so it is retained on power cycle. |

#### `set_speed()` (async available)

`ge_1_x_gripper.set_speed(speed)`

Sets the maximum speed of the gripper.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `speed` | `int` | The maximum speed as a percentage from 1 to 100. |

#### `stop()` (async available)

`ge_1_x_gripper.stop(wait_until_idle = True)`

Stops the gripper from moving.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `wait_until_idle()` (async available)

`ge_1_x_gripper.wait_until_idle()`

Waits until the gripper has stopped moving.

#### `write_register()` (async available)

`ge_1_x_gripper.write_register(register_address, data)`

Writes a single register value to the gripper.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `register_address` | `int` | The address of the register to write. |
| `data` | `int` | The data to write to the specified register address. |
