# API Reference v10.3.1 (Python)

## Triggers (class)

Module: zaber_motion.ascii

Class providing access to device triggers. Please note that the Triggers API is currently an experimental feature.

Requires at least Firmware 7.06.

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

```py
from zaber_motion.ascii import Connection

connection = Connection.open_serial_port("COM3")
device = connection.get_device(1)
triggers = device.triggers
```

Related Guides:

- [Triggers](https://software.zaber.com/motion-library/docs/guides/device_features/triggers.md)

### Properties

#### `device` (read-only)

`triggers.device`

Type: [`Device`](https://software.zaber.com/motion-library/api/py/ascii/device.md)

Device that these triggers belong to.

### Methods

#### `get_all_labels()` (async available)

`triggers.get_all_labels()`

Gets the labels for every trigger for this device.

##### Return Value

Type: `List[str]`

The labels for every trigger for this device. If a trigger has no label, the value will be an empty string.

#### `get_enabled_states()` (async available)

`triggers.get_enabled_states()`

Gets the enabled state for every trigger for this device.

##### Return Value

Type: [`List[TriggerEnabledState]`](https://software.zaber.com/motion-library/api/py/ascii/triggerenabledstate.md)

Whether triggers are enabled and the number of times they will fire.

#### `get_number_of_actions()` (async available)

`triggers.get_number_of_actions()`

Get the number of actions for each trigger for this device.

##### Return Value

Type: `int`

Number of actions for each trigger for this device.

#### `get_number_of_triggers()` (async available)

`triggers.get_number_of_triggers()`

Get the number of triggers for this device.

##### Return Value

Type: `int`

Number of triggers for this device.

#### `get_trigger()`

`triggers.get_trigger(trigger_number)`

Get a specific trigger for this device.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `trigger_number` | `int` | The number of the trigger to control. Trigger numbers start at 1. |

##### Return Value

Type: [`Trigger`](https://software.zaber.com/motion-library/api/py/ascii/trigger.md)

Trigger instance.

#### `get_trigger_states()` (async available)

`triggers.get_trigger_states()`

Get the state for every trigger for this device.

##### Return Value

Type: [`List[TriggerState]`](https://software.zaber.com/motion-library/api/py/ascii/triggerstate.md)

Complete state for every trigger.
