Skip to main content

waitForTrigger

Wait until a trigger reaches the specified active state.

Parameter​

KeyTypeDescription
idstringTrigger ID. If omitted, the trigger of printer is used.
printerstringPrinter ID. Used when id is omitted; required if more than one printer is available.
activebooleanThe active state to wait for. v6.0
statebooleanDeprecated name of active.
timeoutnumberTimeout in seconds. Required.

Either active or state is required. Both may be given, as long as they agree, so that the same request also works with versions before v6.0.

Return value​

An object with the position at the moment the trigger fired, or null if the timeout elapsed before the trigger fired.

KeyTypeDescription
positionnumberPosition in nanometers.
positionMetersnumberPosition in meters, like getSpeedInfo. v5.4

Example​

waitForTrigger {"id": "trigger1", "active": true, "timeout": 5.0}