API Reference v9.2.0

Triggerclass

Module: ZaberMotionAscii

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 import ZaberMotionAscii to the top of your source code.

Related Guides:

Properties

p

device

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

triggerNumber

readonly
trigger.triggerNumber
Int Number of this trigger.

Methods

m

clearAction()

asyncthrows
try await trigger.clearAction(action = DtoAscii.TriggerAction.all)
Clear a trigger action.
Arguments
NameTypeDescription
actionTriggerActionThe action number to clear. The default option is to clear all actions.
m

disable()

asyncthrows
try await 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()

asyncthrows
try await 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

fireAtInterval()

asyncthrows
try await trigger.fireAtInterval(interval, unit = Units.native)
Set a trigger condition based on a time interval.
Arguments
NameTypeDescription
intervalDoubleThe time interval between trigger fires.
unitUnitsUnits of time.
m

fireWhen()

asyncthrows
try await trigger.fireWhen(condition)
Set a generic trigger condition.
Arguments
NameTypeDescription
conditionStringThe condition to set for this trigger.
m

fireWhenAbsoluteSetting()

asyncthrows
try await trigger.fireWhenAbsoluteSetting(axis, setting, triggerCondition, 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.
settingStringThe setting to monitor.
triggerConditionTriggerConditionComparison operator.
valueDoubleComparison value.
unitUnitsUnits of value.
m

fireWhenDistanceTravelled()

asyncthrows
try await trigger.fireWhenDistanceTravelled(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.
distanceDoubleThe measured distance between trigger fires.
unitUnitsUnits of dist.
m

fireWhenEncoderDistanceTravelled()

asyncthrows
try await trigger.fireWhenEncoderDistanceTravelled(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.
distanceDoubleThe measured encoder distance between trigger fires.
unitUnitsUnits of dist.
m

fireWhenIo()

asyncthrows
try await trigger.fireWhenIo(portType, channel, triggerCondition, value)
Set a trigger condition based on an IO channel value.
Arguments
NameTypeDescription
portTypeIoPortTypeThe type of IO channel to monitor.
channelIntThe IO channel to monitor.
triggerConditionTriggerConditionComparison operator.
valueDoubleComparison value.
m

fireWhenSetting()

asyncthrows
try await trigger.fireWhenSetting(axis, setting, triggerCondition, 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.
settingStringThe setting to monitor.
triggerConditionTriggerConditionComparison operator.
valueDoubleComparison value.
unitUnitsUnits of value.
m

getEnabledState()

asyncthrows
try await trigger.getEnabledState()
Gets the enabled state of the trigger.
Return Value
TriggerEnabledState Whether the trigger is enabled and the number of times it will fire.
m

getLabel()

asyncthrows
try await trigger.getLabel()
Returns the label for the trigger.
Return Value
String The label for the trigger.
m

getState()

asyncthrows
try await trigger.getState()
Gets the state of the trigger.
Return Value
TriggerState Complete state of the trigger.
m

onFire()

asyncthrows
try await trigger.onFire(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.
commandStringThe command to run when the action is triggered.
m

onFireSet()

asyncthrows
try await trigger.onFireSet(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.
settingStringThe name of the setting to change.
operationTriggerOperationThe operation to apply to the setting.
valueDoubleOperation value.
unitUnitsUnits of value.
m

onFireSetToSetting()

asyncthrows
try await trigger.onFireSetToSetting(action, axis, setting, operation, fromAxis, fromSetting)
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.
settingStringThe name of the setting to change. Must have either integer or boolean type.
operationTriggerOperationThe operation to apply to the setting.
fromAxisIntThe axis from which to read the setting. Set to 0 to read the setting from the device.
fromSettingStringThe name of the setting to read. Must have either integer or boolean type.
m

setLabel()

asyncthrows
try await trigger.setLabel(label)
Sets the label for the trigger.
Arguments
NameTypeDescription
labelString?The label to set for this trigger. If no value or an empty string is provided, this label is deleted.