Zaber Launcher Tutorials
Zaber Motion Library
Sample Projects
Virtual DeviceDropdown icon
About3D Viewer
AccountDropdown icon
Sign InSign Up
Zaber Motion LibraryGetting StartedHow-to Guides
API Reference
root
zaber_motion.ascii
AlertEventAllAxesAxisAxisGroupAxisIdentityAxisSettingsAxisStorageAxisTypeConnectionConversionFactorDeviceDeviceIdentityDeviceIODeviceIOInfoDeviceSettingsDeviceStorageDigitalOutputActionGetAxisSettingGetAxisSettingResultGetSettingGetSettingResultIoPortLabelIoPortTypeLockstepMeasurementSequenceMessageTypeOscilloscopeOscilloscopeCapturePropertiesOscilloscopeDataOscilloscopeDataSourceParamsetInfoPidTuningPvtPvtAxisDefinitionPvtAxisTypePvtBufferPvtCallActionPvtCancelAllOutputsScheduleActionPvtCancelOutputScheduleActionPvtCsvDataPvtIoPvtModePvtPartialCsvDataPvtPartialPointPvtPartialSequenceItemPvtPointPvtSequencePvtSequenceItemPvtSetAllAnalogOutputsActionPvtSetAllDigitalOutputsActionPvtSetAnalogOutputActionPvtSetDigitalOutputActionResponseServoTunerServoTuningParamServoTuningParamsetSetStateAxisResponseSetStateDeviceResponseSettingConstantsSimpleTuningSimpleTuningParamDefinitionStreamStreamAxisDefinitionStreamAxisTypeStreamBufferStreamIoStreamModeStreamsTransportTriggerTriggerActionTriggerConditionTriggerEnabledStateTriggerOperationTriggersTriggerStateUnknownResponseEventWarningFlagsWarnings
zaber_motion.binary
BinarySettingsCommandCodeConnectionDeviceDeviceIdentityDeviceSettingsDeviceTypeErrorCodeMessageReplyCodeReplyOnlyEventUnknownResponseEvent
zaber_motion.exceptions
MotionLibExceptionBinaryCommandFailedExceptionDataCommandFailedExceptionDataCommandTooLongExceptionDataDeviceAddressConflictExceptionDataDeviceDbFailedExceptionDataDeviceDbInnerErrorGCodeExecutionExceptionDataGCodeSyntaxExceptionDataInvalidPacketExceptionDataInvalidPvtPointInvalidResponseExceptionDataMovementFailedExceptionDataMovementInterruptedExceptionDataOperationFailedExceptionDataPvtExecutionExceptionDataPvtMovementFailedExceptionDataPvtMovementInterruptedExceptionDataSetDeviceStateExceptionDataSetPeripheralStateExceptionDataStreamExecutionExceptionDataStreamMovementFailedExceptionDataStreamMovementInterruptedExceptionData
zaber_motion.gcode
AxisDefinitionAxisMappingAxisTransformationDeviceDefinitionOfflineTranslatorTranslateMessageTranslateResultTranslatorTranslatorConfig
zaber_motion.microscopy
AutofocusAutofocusStatusCameraTriggerFilterChangerIlluminatorIlluminatorChannelMicroscopeMicroscopeConfigObjectiveChangerThirdPartyComponentsWdiAutofocusProviderWdiAutofocusProviderStatus
zaber_motion.product
ProcessProcessControllerProcessControllerModeProcessControllerSourceProcessControllerSourceSensor
zaber_motion
AxisAddressChannelAddressCyclicDirectionDeviceDbSourceDeviceDbSourceTypeDeviceDiscoveryResultDevicePortTypeFirmwareVersionLibraryLogOutputModeMeasurementNamedParameterRotationDirectionToolsUnitConversionDescriptorUnitsUnitTable
SupportBinary Protocol (Legacy)
© 2026 Zaber Technologies Inc.

API Reference v9.0.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:
  • Triggers

Index

pProperties
device
trigger_number
mMethods
clear_action()
disable()
enable()
fire_at_interval()
fire_when()
fire_when_absolute_setting()
fire_when_distance_travelled()
fire_when_encoder_distance_travelled()
fire_when_io()
fire_when_setting()
get_enabled_state()
get_label()
get_state()
on_fire()
on_fire_set()
on_fire_set_to_setting()
set_label()

Properties

p

device

readonly
trigger.device
Device Device that this trigger belongs to.
p

trigger_number

readonly
trigger.trigger_number
int Number of this trigger.

Methods

m

clear_action()

async available
trigger.clear_action(action = TriggerAction.ALL)
Clear a trigger action.
Arguments
NameTypeDescription
actionTriggerActionThe action number to clear. The default option is to clear all actions.
m

disable()

async available
trigger.disable()
Disables the trigger. Once disabled, the trigger will not fire and trigger actions will not run, even if trigger conditions are met.
m

enable()

async available
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
NameTypeDescription
countintNumber of times the trigger will fire before disabling itself. If count is not specified, or 0, the trigger will fire indefinitely.
m

fire_at_interval()

async available
trigger.fire_at_interval(interval, unit = Units.NATIVE)
Set a trigger condition based on a time interval.
Arguments
NameTypeDescription
intervalfloatThe time interval between trigger fires.
unitTimeUnitsUnits of time.
m

fire_when()

async available
trigger.fire_when(condition)
Set a generic trigger condition.
Arguments
NameTypeDescription
conditionstrThe condition to set for this trigger.
m

fire_when_absolute_setting()

async available
trigger.fire_when_absolute_setting(axis, setting, trigger_condition, value, unit = Units.NATIVE)
Set a trigger condition based on an absolute setting value.
Arguments
NameTypeDescription
axisintThe axis to monitor for this condition. Set to 0 for device-scope settings.
settingstrThe setting to monitor.
trigger_conditionTriggerConditionComparison operator.
valuefloatComparison value.
unitUnitsAndLiteralsUnits of value.
m

fire_when_distance_travelled()

async available
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
NameTypeDescription
axisintThe axis to monitor for this condition. May be set to 0 on single-axis devices only.
distancefloatThe measured distance between trigger fires.
unitLengthUnitsUnits of dist.
m

fire_when_encoder_distance_travelled()

async available
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
NameTypeDescription
axisintThe axis to monitor for this condition. May be set to 0 on single-axis devices only.
distancefloatThe measured encoder distance between trigger fires.
unitLengthUnitsUnits of dist.
m

fire_when_io()

async available
trigger.fire_when_io(port_type, channel, trigger_condition, value)
Set a trigger condition based on an IO channel value.
Arguments
NameTypeDescription
port_typeIoPortTypeThe type of IO channel to monitor.
channelintThe IO channel to monitor.
trigger_conditionTriggerConditionComparison operator.
valuefloatComparison value.
m

fire_when_setting()

async available
trigger.fire_when_setting(axis, setting, trigger_condition, value, unit = Units.NATIVE)
Set a trigger condition based on a setting value.
Arguments
NameTypeDescription
axisintThe axis to monitor for this condition. Set to 0 for device-scope settings.
settingstrThe setting to monitor.
trigger_conditionTriggerConditionComparison operator.
valuefloatComparison value.
unitUnitsAndLiteralsUnits of value.
m

get_enabled_state()

async available
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

get_label()

async available
trigger.get_label()
Returns the label for the trigger.
Return Value
str The label for the trigger.
m

get_state()

async available
trigger.get_state()
Gets the state of the trigger.
Return Value
TriggerState Complete state of the trigger.
m

on_fire()

async available
trigger.on_fire(action, axis, command)
Set a command to be a trigger action.
Arguments
NameTypeDescription
actionTriggerActionThe action number to assign the command to.
axisintThe axis to on which to run this command. Set to 0 for device-scope settings or to run command on all axes.
commandstrThe command to run when the action is triggered.
m

on_fire_set()

async available
trigger.on_fire_set(action, axis, setting, operation, value, unit = Units.NATIVE)
Set a trigger action to update a setting.
Arguments
NameTypeDescription
actionTriggerActionThe action number to assign the command to.
axisintThe axis on which to change the setting. Set to 0 to change the setting for the device.
settingstrThe name of the setting to change.
operationTriggerOperationThe operation to apply to the setting.
valuefloatOperation value.
unitUnitsAndLiteralsUnits of value.
m

on_fire_set_to_setting()

async available
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
NameTypeDescription
actionTriggerActionThe action number to assign the command to.
axisintThe axis on which to change the setting. Set to 0 to change the setting for the device.
settingstrThe name of the setting to change. Must have either integer or boolean type.
operationTriggerOperationThe operation to apply to the setting.
from_axisintThe axis from which to read the setting. Set to 0 to read the setting from the device.
from_settingstrThe name of the setting to read. Must have either integer or boolean type.
m

set_label()

async available
trigger.set_label(label)
Sets the label for the trigger.
Arguments
NameTypeDescription
labelOptional[str]The label to set for this trigger. If no value or an empty string is provided, this label is deleted.
Top