This is an old revision of the document!
Trigger
Commands that provide access to trigger functionality.
Get Current State
Get the current state of the instrument's channel
Command
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects to apply to the trigger channel.
- command - (String) - The Get Current State command: “getCurrentState”
Response
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects applied to the trigger channel.
- command - (String) - The Get Current State command: “getCurrentState”
- statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
- wait - (Integer) - The number of ms to wait before the device is ready to process another command.
- acqCount - (Integer) - The current acquisition count. This value increments each time an acquisition completes.
- source - (Object) - The trigger source and configuration.
- instrument - (String) - The instrument to trigger on (ex. “osc”, “la”).
- channel - (Integer) - The instrument channel to trigger on.
- type - (String) - The trigger type: “risingEdge”, “fallingEdge”.
- lowerThreshold - (Integer) - The trigger threshold lower value in mV.
- upperThreshold - (Integer) - The trigger threshold upper value in mV.
- risingEdgeMask - (Integer) - The rising edge trigger mask.
- fallingEdgeMask - (Integer) - The falling edge trigger mask.
- targets - (Object) - An object containing instrument channels to use during the acquisition.
- <instrument> - (Array<Integer>) - An array of channel numbers to use during the acquisition for the specified <instrument> (ex. “osc”, “la”)
- state - (String) - The trigger state: “idle” “armed”, “acquiring”, “triggered”, or “busy”
idle - The trigger is not armed, acquiring or triggered.
armed - The trigger had been armed but the trigger condition has not yet been met.
acquiring - The trigger condition has been meet and data is currently being acquired.
triggered - The trigger condition has been met but data is not yet begin acquired (this is typically due to a trigger delay).
busy - The trigger is busy waiting or doing something else
Example
Command
{
"trigger": {
"1": [
{
"command": "getCurrentState"
}
]
}
}
Response
{
"trigger": {
"1": [
{
"command": "getCurrentState",
"statusCode": 0,
"wait": 0,
"acqCount": 10,
"source": {
"instrument": "osc",
"channel": 1,
"type": "risingEdge",
"lowerThreshold": 0,
"upperThreshold": 30,
"risingEdgeMask": 0x3FF,
"fallingEdgeMask": 0x3FF
},
"targets": {
"osc": [1, 2],
"la": [1]
},
"state": "idle"
}
]
}
}
Force Trigger
Force an immediate acquisition without waiting for a trigger condition.
Command
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects to apply to the trigger channel.
- command - (String) - The Force Trigger command: “forceTrigger”
Response
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects applied to the trigger channel.
- command - (String) - The Force Trigger command: “forceTrigger”
- statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
- wait - (Integer) - The number of ms to wait before the device is ready to process another command.
- acqCount - (Integer) - The current acquisition count. This value increments each time an acquisition completes.
Example:
Command
{
"trigger":{
"1":[
{
"command":"forceTrigger"
}
]
}
}
Response
{
"trigger":{
"1":[
{
"command":"forceTrigger",
"statusCode":0,
"wait": -1,
"acqCount": 27
}
]
}
}
Set Parameters
Set the device trigger parameters.
Command
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects to apply to the trigger channel.
- command - (String) - The Set Parameters command: “setParameters”
- source - (Object) - The trigger source and configuration.
- instrument - (String) - The instrument to trigger on (ex. “osc”, “la”).
- channel - (Integer) - The instrument channel to trigger on.
- type - (String) - The trigger type: “risingEdge”, “fallingEdge”.
- lowerThreshold - (Integer) - The trigger threshold lower value in mV.
- upperThreshold - (Integer) - The trigger threshold upper value in mV.
- risingEdgeMask - (Integer) - The rising edge trigger mask. Only applicable when the trigger source is set to LA.
- fallingEdgeMask - (Integer) - The falling edge trigger mask. Only applicable when the trigger source is set to LA.
- * targets - (Object) - An object containing instrument channels to use during the acquisition.
- <instrument> - (Array<Integer>) - An array of channel numbers to use during the acquisition for the specified <instrument> (ex. “osc”, “la”)
Response
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects applied to the trigger channel.
- command - (String) - TThe Set Parameters command: “setParameters”
- statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
- wait - (Integer) - The number of ms to wait before the device is ready to process another command.
Example:
Command
{
"trigger": {
"1": [
{
"command": "setParameters",
"source": {
"instrument": "osc",
"channel": 1,
"type": "risingEdge",
"lowerThreshold": 3300,
"upperThreshold": 4000,
"risingEdgeMask": 1,
"fallingEdgeMask": 0
},
"targets": {
"osc": [
1,
2
],
"la": [
1
]
}
}
]
}
}
Response
{
"trigger":{
"1":[
{
"command":"setParameters",
"statusCode":0,
"wait":0
}
]
}
}
Run
Arm the specified trigger and immediately re-arm the trigger after a successful acquisition.
Command
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects to apply to the trigger channel.
- command - (String) - The Run command: “run”
Response
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects applied to the trigger channel.
- command - (String) - The Run command: “run”
- statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
- wait - (Integer) - The number of ms to wait before the device is ready to process another command.
- acqCount - (Integer) - The current acquisition count. This value increments each time an acquisition completes.
Example:
Command
{
"trigger":{
"1":[
{
"command":"run"
}
]
}
}
Response
{
"trigger":{
"1":[
{
"command":"run",
"statusCode":0,
"wait":-1,
"acqCount": 27
}
]
}
}
Single
Arm the specified trigger and do not re-arm the trigger after a successful acquisition.
Command
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects to apply to the trigger channel.
- command - (String) - The Single command: “single”
Response
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects applied to the trigger channel.
- command - (String) - The Single command: “single”
- statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
- wait - (Integer) - The number of ms to wait before the device is ready to process another command.
- lastAcqCount - (Integer) - The previous acquisition count value.
Example:
Command
{
"trigger":{
"1":[
{
"command":"single"
}
]
}
}
Response
{
"trigger":{
"1":[
{
"command":"single",
"statusCode":0,
"wait":-1,
"lastAcqCount": 27
}
]
}
}
Stop
Disarm the specified trigger.
Command
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects to apply to the trigger channel.
- command - (String) - The Stop command: “stop”.
Response
- trigger - (Object) - The trigger object.
- # - (Array<Object>) - An array of command objects applied to the trigger channel.
- command - (String) - The Stop command: “stop”.
- statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
- wait - (Integer) - The number of ms to wait before the device is ready to process another command.
Example:
Command
{
"trigger":{
"1":[
{
"command":"stop"
}
]
}
}
Response
{
"trigger":{
"1":[
{
"command":"stop",
"statusCode":0,
"wait": 0
}
]
}
}

