API Reference v9.2.0
Triggerclass
Module: zaber_motion.ascii
A handle for a trigger with this number on the device. Triggers allow setting up actions that occur when a certain condition has been met or an event has occurred. Please note that the Triggers API is currently an experimental feature.
Requires at least Firmware 7.06.
To use this type, add from zaber_motion.ascii import Trigger to the top of your source code.
Related Guides:
Index
pProperties
Properties
p
Methods
m
trigger.clear_action(action = TriggerAction.ALL)Clear a trigger action.
Arguments
| Name | Type | Description |
|---|---|---|
| action | TriggerAction | The action number to clear. The default option is to clear all actions. |
m
m
trigger.enable(count = 0)Enables the trigger. Once a trigger is enabled, it will fire whenever its condition transitions from false to true. If a trigger condition is true when a disabled trigger is enabled, the trigger will fire immediately.
Arguments
| Name | Type | Description |
|---|---|---|
| count | int | Number of times the trigger will fire before disabling itself. If count is not specified, or 0, the trigger will fire indefinitely. |
m
trigger.fire_at_interval(interval, unit = Units.NATIVE)Set a trigger condition based on a time interval.
Arguments
| Name | Type | Description |
|---|---|---|
| interval | float | The time interval between trigger fires. |
| unit | TimeUnits | Units of time. |
m
m
trigger.fire_when_absolute_setting(axis, setting, trigger_condition, value, unit = Units.NATIVE)Set a trigger condition based on an absolute setting value.
Arguments
| Name | Type | Description |
|---|---|---|
| axis | int | The axis to monitor for this condition. Set to 0 for device-scope settings. |
| setting | str | The setting to monitor. |
| trigger_condition | TriggerCondition | Comparison operator. |
| value | float | Comparison value. |
| unit | UnitsAndLiterals | Units of value. |
m
trigger.fire_when_distance_travelled(axis, distance, unit = Units.NATIVE)Set a trigger condition for when an axis position has changed by a specific distance.
Arguments
| Name | Type | Description |
|---|---|---|
| axis | int | The axis to monitor for this condition. May be set to 0 on single-axis devices only. |
| distance | float | The measured distance between trigger fires. |
| unit | LengthUnits | Units of dist. |
m
trigger.fire_when_encoder_distance_travelled(axis, distance, unit = Units.NATIVE)Set a trigger condition for when an encoder position has changed by a specific distance.
Arguments
| Name | Type | Description |
|---|---|---|
| axis | int | The axis to monitor for this condition. May be set to 0 on single-axis devices only. |
| distance | float | The measured encoder distance between trigger fires. |
| unit | LengthUnits | Units of dist. |
m
trigger.fire_when_io(port_type, channel, trigger_condition, value)Set a trigger condition based on an IO channel value.
Arguments
| Name | Type | Description |
|---|---|---|
| port_type | IoPortType | The type of IO channel to monitor. |
| channel | int | The IO channel to monitor. |
| trigger_condition | TriggerCondition | Comparison operator. |
| value | float | Comparison value. |
m
trigger.fire_when_setting(axis, setting, trigger_condition, value, unit = Units.NATIVE)Set a trigger condition based on a setting value.
Arguments
| Name | Type | Description |
|---|---|---|
| axis | int | The axis to monitor for this condition. Set to 0 for device-scope settings. |
| setting | str | The setting to monitor. |
| trigger_condition | TriggerCondition | Comparison operator. |
| value | float | Comparison value. |
| unit | UnitsAndLiterals | Units of value. |
m
trigger.get_enabled_state()Gets the enabled state of the trigger.
Return Value
TriggerEnabledState Whether the trigger is enabled and the number of times it will fire.m
m
trigger.get_state()Gets the state of the trigger.
Return Value
TriggerState Complete state of the trigger.m
trigger.on_fire(action, axis, command)Set a command to be a trigger action.
Arguments
| Name | Type | Description |
|---|---|---|
| action | TriggerAction | The action number to assign the command to. |
| axis | int | The axis to on which to run this command. Set to 0 for device-scope settings or to run command on all axes. |
| command | str | The command to run when the action is triggered. |
m
trigger.on_fire_set(action, axis, setting, operation, value, unit = Units.NATIVE)Set a trigger action to update a setting.
Arguments
| Name | Type | Description |
|---|---|---|
| action | TriggerAction | The action number to assign the command to. |
| axis | int | The axis on which to change the setting. Set to 0 to change the setting for the device. |
| setting | str | The name of the setting to change. |
| operation | TriggerOperation | The operation to apply to the setting. |
| value | float | Operation value. |
| unit | UnitsAndLiterals | Units of value. |
m
trigger.on_fire_set_to_setting(action, axis, setting, operation, from_axis, from_setting)Set a trigger action to update a setting with the value of another setting.
Arguments
| Name | Type | Description |
|---|---|---|
| action | TriggerAction | The action number to assign the command to. |
| axis | int | The axis on which to change the setting. Set to 0 to change the setting for the device. |
| setting | str | The name of the setting to change. Must have either integer or boolean type. |
| operation | TriggerOperation | The operation to apply to the setting. |
| from_axis | int | The axis from which to read the setting. Set to 0 to read the setting from the device. |
| from_setting | str | The name of the setting to read. Must have either integer or boolean type. |