====== OpenScope⢠Protocol ======
Overview...
//**Note**: JSON data below is expanded for readability. All JSON should be minified (white space removed) before being transmitted.//
All open scope commands are JSON objects (start with '{' and with '}' or OSJB (in chunck notation)
Add JSON command that went sent via terminal puts the device into JSON command mode
===== Configuration =====
----
All commands below are valid when the device is in either JSON mode or menu mode.
Put the device into JSON command mode.
{"mode":"JSON"}\r\n
Put the device into menu command mode.
{"mode":"menu"}\r\n
====== Device ======
Commands that provide access to device level data and functions.
===== Enumerate =====
----
Enumerate all device info.
This should return static information about the device. Dynamic data should be retrieved using getters.
**Type:** POST
**Response**
* **awg** - (Object) - The AWG instrument object.\\
* **numChans** - (Integer) - The number of AWG channels.
* **#** - (Integer) - An AWG channel number.
* **signalTypes** - (Array) - Array of supported regular signal types.
* **signalFreqMin** - (Integer) - The minimum regular signal frequency in mHz.
* **signalFreqMax** - (Integer) - The maximum regular signal frequency in mHz.
* **dataType** - (String) - The sample data type (Ex. I16).
* **bufferSizeMax** - (Integer) - The maximum buffer size of the specified channel in samples.
* **dacVpp** - (Integer) - The peak to peak voltage range of the digital to analog converter in mV.
* **sampleFreqMin** - (Integer) - The minimum sample frequency in mHz.
* **sampleFreqMax** - (Integer) - The maximum sample frequency in mHz.
* **vOffsetMin** - (Integer) - The minimum supported offset voltage in mV.
* **vOffsetMax** - (Integer) - The maximum supported offset voltage in mV.
* **vOutMin** - (Integer) - The minimum supported output voltage in mV.
* **vOutMax** - (Integer) - The maximum supported output voltage in mV.
* **osc** - (Object) - The OSC instrument object.\\
===Example===
**Send**
{
"device":[
{
"command":"enumerate"
}
]
}
**Response**
{
"device":[
{
"command":"enumerate",
"statusCode":0,
"wait":0,
"deviceMake":"Digilent",
"deviceModel":"OpenScope-MZ",
"firmwareVersion":{
"major":1,
"minor":0,
"patch":0
},
"awg":{
"numChans":1,
"1":{
"signalTypes":[
"sine",
"square",
"sawtooth",
"triangle",
"dc"
],
"signalFreqMin":312000,
"signalFreqMax":1000000000,
"dataType":"I16",
"bufferSizeMax":32640,
"dacVpp":3000,
"sampleFreqMin":1000,
"sampleFreqMax":1000000000,
"vOffsetMin":-1500,
"vOffsetMax":1500,
"vOutMin":-3000,
"vOutMax":3000
}
},
"dc":{
"numChans":2,
"1":{
"voltageMin":-4000,
"voltageMax":4000,
"voltageIncrement":40,
"currentMin":0,
"currentMax":50,
"currentIncrement":0
},
"2":{
"voltageMin":-4000,
"voltageMax":4000,
"voltageIncrement":40,
"currentMin":0,
"currentMax":50,
"currentIncrement":0
}
},
"gpio": {
"numChans": 10,
"sourceCurrentMax": 50,
"sinkCurrentMax": 50
},
"la":{
"numChans":10
},
"osc":{
"numChans":2,
"1":{
"resolution": 12,
"effectiveBits":11,
"bufferSizeMax":32640,
"bufferDataType":"I16",
"sampleFreqMin": 1000,
"sampleFreqMax": 6250000000,
"adcVpp":3000,
"inputVoltageMax": 20000,
"inputVoltageMin": -20000,
"gains":[
1,
0.25,
0.125,
0.075
]
},
"2":{
"resolution": 12,
"effectiveBits":11,
"bufferSizeMax":32640,
"bufferDataType":"I16",
"sampleFreqMin": 1000,
"sampleFreqMax": 6250000000,
"adcVpp":3000,
"inputVoltageMax": 20000,
"inputVoltageMin": -20000,
"gains":[
1,
0.25,
0.125,
0.075
]
}
}
}
]
}
\\
\\
===== Reset Instruments =====
----
Reset all instruments on the device.
**Type:** POST
===Example===
**Send**
{
"device":[
{
"command":"resetInstruments"
}
]
}
**Response**
{
"device": [
{
"command": "resetInstruments",
"statusCode": 0,
"wait": 1000
}
]
}
\\
\\
===== Storage - Get Locations =====
----
Get a list of all non-volatile storage locations.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Get Storage Locations command: "storageGetLocations"
**Response**
* **storageLocations** - (Array) - The devices storage locations (ex: "flash", "sd0", "/tmp/")
===Example===
**Send**
{
"device":[
{
"command":"storageGetLocations"
}
]
}
**Response**
{
"device":[
{
"command":"storageGetLocations",
"statusCode":0,
"wait":0,
"storageLocations":[
"flash",
"sd0"
]
}
]
}
\\
===== Calibration - Get Storage Types =====
----
Get calibration storage types.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Get Calibration Storage Types command: "calibrationGetStorageTypes"
**Response**
* **calibrationGetStorageTypes** - (String) - Calibration storage types. Either USER or FACTORY
===Example===
**Send**
{
"device":[
{
"command":"calibrationGetStorageTypes"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationGetStorageTypes",
"statusCode":0,
"wait":0,
"storageTypes":[
"USER",
"FACTORY"
]
}
]
}
\\
===== Calibration - Get Instructions =====
----
Get user calibration instructions.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Get Calibration Instructions command: "calibrationGetInstructions"
**Response**
* **calibrationInstructions** - (String) - User calibration instructions.
===Example===
**Send**
{
"device":[
{
"command":"calibrationGetInstructions"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationGetInstructions",
"statusCode":0,
"wait":0,
"instructions":"Connect the Orange OSC1 lead to the Blue AWG1 Lead".
}
]
}
\\
===== Calibration - Start =====
----
Start the calibration process. This function returns immediately. If the calibration process completes successfully new calibration data is saved in the calibration data working register. Use the Calibration Save and Calibration Apply functions to save of apply the new calibration data.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Get Calibration Instructions command: "calibrationStart"
**Response**
===Example===
**Send**
{
"device":[
{
"command":"calibrationStart"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationStart",
"statusCode":0,
"wait":45
}
]
}
\\
===== Calibration - Load =====
----
Load saved calibration data into the working register. The calibration data is not applied to the instruments until **Calibration Apply** is called.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Calibration Apply command: "calibrationLoad"
* **name** - (String) - "factory" for factory calibration "user" for a user save calibration "idealValues" for ideal calculated values.
**Response**
===Example===
**Send**
{
"device":[
{
"command":"calibrationLoad",
"type":"FACTORY"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationLoad",
"statusCode":0,
"wait":0
}
]
}
\\
===== Calibration - Read =====
----
Read the calibration data from the working register.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Get Calibration Instructions command: "calibrationRead"
**Response**
* **calibrationData** - Arbitrary, device specific calibration data expressed as a JSON object.
===Example===
**Send**
{
"device":[
{
"command":"calibrationRead"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationRead",
"statusCode":0,
"wait":0,
"calibrationData" : {
}
}
]
}
\\
===== Calibration - Save =====
----
Save the calibration data to non-volatile storage.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Calibration Save command: "calibrationSave"
* **type** - (String) - The configuration type to save as (ex. "FACTORY", "USER").
**Response**
===Example===
**Send**
{
"device":[
{
"command":"calibrationSave",
"type": "USER"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationSave",
"statusCode":0,
"wait":0
}
]
}
\\
===== Calibration - Get Status =====
----
Get the calibration status.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Calibration Get Status command: "calibrationGetStatus"
**Response**
* **status** - ("idle", "runningPretest", "calibrating", "calibrationFailed")
===Example===
**Send**
{
"device":[
{
"command":"calibrationGetStatus"
}
]
}
**Response**
{
"device":[
{
"command":"calibrationGetStatus",
"statusCode":0,
"wait":500,
"status": "idle"
}
]
}
\\
===== NIC - List =====
----
List all network adapters on the device.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The NIC List command: "nicList:
**Response**
* **nics** - (Array) - An array of all the NICs on the device.
===Example===
**Send**
{
"device":[
{
"command":"nicList"
}
]
}
**Response**
{
"device":[
{
"command":"nicList",
"statusCode":0,
"wait":0,
"nics": ["wlan0"]
}
]
}
\\
===== NIC - Get Status =====
----
Get the status of the specified network interface controller.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Get NIC Status command: "nicGetStatus"
* **adapter** - (String) - The network adapter to use (ex, eth0, eth1, wlan0, wlan1, workingParameterSet).
* Note: "workingParameterSet" will return the value in the working parameter set. Status will always be disconnected.
**Response**
* **status** - (String) - The status of the wifi radio ('disconnected', 'scanning', 'connecting', 'connected').
* **ssid** - (String) - The SSID is always displayed when applicable for the selected adapter. It will be an empty string if there is no parameter set for that adapter or it will be the SSID in the current parameter set for that adapter.
* **ipAddress** - (String) - If connected, the ipAddress of the device will be shown.
===Example===
**Send**
{
"device":[
{
"command":"nicGetStatus",
"adapter":"wlan0"
}
]
}
**Response**
{
"device":[
{
"command":"nicGetStatus",
"statusCode":0,
"wait":0,
"adapter": "wlan0",
"securityType": "wpa2",
"status":"connected",
"ssid": "HorseFeathers",
"ipAddress": "192.168.1.127"
}
]
}
\\
===== NIC - Connect =====
----
Connect to the active network using the specified network adapter.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The NIC Connect command: "nicConnect "
* **adapter** - (String) - The network adapter to use (ex: "wlan0", "wlan1").
* **parameterSet** - (String) - The source of the NIC parameter set (ex. "activeParameterSet", "workingParameterSet")
* **force** - (Boolean) - If the specified adapter is already connected and "force" is true the adapter will disconnected and attempt to connect. If the adapter is connected and "force" is false an error is returned. If the adapter is not connected "force" is ignored.
===Example===
**Send**
{
"device":[
{
"command":"nicConnect",
"adapter":"wlan0",
"parameterSet":"activeParameterSet",
"force":true
}
]
}
**Response**
{
"device":[
{
"command":"nicConnect",
"statusCode":0,
"wait":-1
}
]
}
\\
===== NIC - Disconnect =====
----
Disconnect the specified network adapter from the currently connected network.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The NIC Disconnect command: "nicDisconnect"
* **adapter** - (String) - The network adapter to use (ex: wlan0, wlan1).
===Example===
**Send**
{
"device":[
{
"command":"nicDisconnect",
"adapter":"wlan0"
}
]
}
**Response**
{
"device":[
{
"command":"nicDisconnect",
"statusCode":0,
"wait":-1
}
]
}
\\
===== Wifi - Scan =====
----
Scan for Wifi networks. This function returns immediately and results can be collected using the Wifi Read Available Networks command. An error is returned if the specified adapter is not able to scan (ie if it is connected).
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Wifi Scan command: "wifiScan"
* **adapter** - (String) - The network adapter to use (ex: wlan0, wlan1).
===Example===
**Send**
{
"device":[
{
"command": "wifiScan",
"adapter":"wlan0"
}
]
}
**Response**
{
"device":[
{
"command": "wifiScan",
"statusCode": 0,
"wait": -1
}
]
}
\\
===== Wifi - Read Scanned Networks =====
----
Read the list of networks detected by the previous Wifi Scan call. Scan data is only available after a successful scan and is lost on the next call of a NIC or Wifi command.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The wifi read available networks command: "wifiReadScannedNetworks"
* **adapter** - (String) - The network adapter to use (ex: wlan0, wlan1).
===Example===
**Send**
{
"device":[
{
"command":"wifiReadScannedNetworks",
"adapter":"wlan0"
}
]
}
**Response**
{
"device":[
{
"command":"wifiReadScannedNetworks",
"statusCode":0,
"wait":0,
"adapter":"wlan0",
"networks":[
{
"ssid":"HorseFeathers",
"bssid":"HorseFeathers",
"securityType":"wpa2",
"channel": 1,
"signalStrength":100
}
]
}
]
}
\\
===== Wifi - Set Parameters =====
----
Set one or more parameter of the active network. Changes are applied to the working register (active network) only.
\\
//Note: Currently only DHCP is supported (not static IP)//
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The wifi set parameters command: "wifiSetParameters"
* **ssid** - (String) - The network SSID
* **securityType** - (String) - The network security type: open, wep40, wep104, wpa, wpa2
* **passphrase** - (String) - Optional - The passphrase when using WPA or WPA2 (ignored if not using WPA/WPA2)
* **keys** - (String) - Optional - The key(s) for the network. Depends on the security type. The key should be expressed as hex values separated by ':' (ex 01:02:03:AA...).
* **keyIndex** - (Number) - Optional - The key index. This field is ignored if securityType is not 'wep40' or 'wep104'
* **autoConnect** - (Boolean) - If true the device will attempt to auto connect to this network whenever it is in range
===Example===
**Send**
{
"device":[
{
"command":"wifiSetParameters",
"ssid":"HorseFeathers",
"securityType":"wpa2",
"passphrase":"swordfish",
"autoConnect":true
}
]
}
**Response**
{
"device":[
{
"command":"wifiSetParameters",
"statusCode":0,
"wait":0
}
]
}
\\
===== Wifi - List Saved Parameters =====
----
List all saved network parameters.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The listSavedParameters command: "listSavedParameters"
* **storageLocation** - (String) - The location to read saved network parameters from (ex. "flash", "sd").
===Example===
**Send**
{
"device":[
{
"command":"wifiListSavedParameters",
"storageLocation":"flash"
}
]
}
**Response**
{
"device":[
{
"command":"wifiListSavedParameters",
"statusCode":0,
"parameterSets":[
{
"ssid":"HorseFeathers",
"securityType":"wpa2",
"autoConnect":true
}
]
}
]
}
\\
===== Wifi - Delete Saved Parameters =====
----
Delete the specified saved Wifi network.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Wifi Delete Saved Network command: "wifiDeleteParameters"
* **adapter** - (String) - The network adapter to use (ex: wlan0, wlan1).
* **storageLocation** - (String) - The location to delete saved network parameters from (ex. "flash", "sd").
===Example===
**Send**
{
"device":[
{
"command":"wifiDeleteParameters",
"storageLocation":"flash",
"ssid":"HorseFeathers"
}
]
}
**Response**
{
"device":[
{
"command":"wifiDeleteParameters",
"statusCode": 0,
"wait": 0
}
]
}
\\
===== Wifi - Save Parameters =====
----
Save the parameters from the working parameter set to storage. If a network with the same SSID already exists in non-volatile storage this function will overwrite it.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Wifi Save Network command: "wifiSaveParameters"
* **storageLocation** - (String) - The location to save the current network. **Note that locations outside of flash may not be secure!** See storageGetLocations for a list of available storage locations.
===Example===
**Send**
{
"device":[
{
"command":"wifiSaveParameters",
"storageLocation":"flash"
}
]
}
**Response**
{
"device":[
{
"command":"wifiSaveParameters",
"statusCode":0,
"wait":0
}
]
}
\\
===== Wifi - Load Parameters =====
----
Load a saved network parameters into the working register. This command does not connect to the network. Use the Wifi Connect Network command to connect to the network after loading it.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Wifi Load Parameters command: "wifiLoadParameters"
* **ssid** - (String) - The SSID of the network to load.
* **storageLocation** - (String) - The location to read saved network parameters from (ex. "flash", "sd").
===Example===
**Send**
{
"device":[
{
"command":"wifiLoadParameters",
"storageLocation":"flash",
"ssid":"HorseFeathers"
}
]
}
**Response**
{
"device":[
{
"command":"wifiLoadParameters",
"statusCode":0,
"wait":0
}
]
}
\\
===== Enter Bootloader =====
----
Put the device in the bootloader.
**Command**
* **device** - (Object) - The device object.
* **command** - (String) - The Enter Bootloader command: "enterBootloader"
**Response**
===Example===
**Send**
{
"device":[
{
"command":"enterBootloader"
}
]
}
**Response**
{
"device":[
{
"command":"enterBootloader",
"statusCode":0,
"wait":1000
}
]
}
\\
====== Arbitrary Waveform Generator ======
Commands that provide access to **Arbitrary Waveform Generator** data and functions.
===== Get Current State =====
----
Get the current state of the instrument's channel
* **state**: "idle" or "running"
* **waveType**: "sine", "square", "triangle", "dc", "sawtooth", "arbitrary", or null
* **actualSignalFreq**: number or null
* **actualVpp**: number or null
* **actualVOffset**: number or null
=== Example ===
**Send**
{
"awg": {
"1": [
{
"command": "getCurrentState"
}
]
}
}
**Response**
{
"awg": {
"1": [
{
"command": "getCurrentState",
"statusCode": 0,
"state": "running",
"waveType": "sine",
"actualSignalFreq": 1000000,
"actualVpp": 3000,
"actualVOffset": 0,
"wait": 0
}
]
}
}
\\
===== Set Arbitrary Waveform =====
----
Set the parameters of the arbitrary waveform generator channel(s) to output an arbitrary waveform.
**sampleFreq** - Samples per second in mHz
=== Example ===
**Send**
225
{
"awg":{
"1":[
{
"command":"setArbitraryWaveform",
"binaryOffset":0,
"binaryLength":20000,
"binaryType":"I16",
"vpp":3000,
"vOffset":0,
"sampleFreq":1000000
}
]
}
}
<20000 Byte BLOB>
**Response**
{
"awg":{
"1":[
{
"command":"setArbitraryWaveform",
"statusCode":0,
"wait":0
}
]
}
}
\\
===== Set Regular Waveform =====
----
Set the parameters of the arbitrary waveform generator channel(s) to output a regular waveform.
**Type:** POST
**Command**
* **awg** - (Object) - The AWG instrument object.
* **#** - (Integer) - AWG channel number.
* **signalFreq** - (Integer U64) - The signal frequency in mHz.
===Example (Waveform)===
**Send**
{
"awg":{
"1":[
{
"command":"setRegularWaveform",
"signalType":"sine",
"signalFreq":1000000,
"vpp":3000,
"vOffset":0,
"dutyCycle": 50
}
]
}
}
**Response**
{
"awg":{
"1":[
{
"command":"setRegularWaveform",
"statusCode":0,
"actualSignalFreq": 1000000,
"actualVpp": 3000,
"actualVOffset":0,
"wait":0
}
]
}
}
\\ \\
===== Run =====
----
Run the arbitrary waveform generator channel(s).
===Example===
**Send**
{
"awg":{
"1":[
{
"command":"run"
}
]
}
}
**Response**
{
"awg":{
"1":[
{
"command":"run",
"statusCode":0,
"wait":0
}
]
}
}
\\
\\
===== Stop =====
----
Stop the arbitrary waveform generator channel(s).
===Example===
**Send**
{
"awg":{
"1":[
{
"command":"stop"
}
]
}
}
**Response**
{
"awg":{
"1":[
{
"command":"stop",
"statusCode":0,
"wait":0
}
]
}
}
\\
\\
====== DC Power Supply ======
Commands that provide access to **DC Power Supply** data and functions.
===== Get Current State =====
----
Get the current state of the instrument's channel
* **state**: "idle" or "running"
* **voltage**: number or null
=== Example ===
**Send**
{
"dc": {
"1": [
{
"command":"getCurrentState"
}
]
}
}
**Response**
{
"dc": {
"1": [
{
"command": "getCurrentState",
"statusCode": 0,
"state": "idle",
"voltage": 3300,
"wait": 0
}
]
}
}
\\
===== Get Voltage =====
----
Get the output voltage(s) of the specified DC power supply channel(s).
===Example===
**Send**
{
"dc":{
"1":[
{
"command":"getVoltage"
}
]
}
}
**Response**
{
"dc":{
"1":[
{
"command":"getVoltage",
"voltage":3300,
"statusCode":0,
"wait":100
}
]
}
}
\\
\\
===== Set Voltage =====
----
Set the output voltage(s) of the specified DC power supply channel(s).
===Example===
**Send**
{
"dc":{
"1":[
{
"command":"setVoltage",
"voltage":3300
}
]
}
}
**Response**
{
"dc":{
"1":[
{
"command":"setVoltage",
"statusCode":0,
"wait":500
}
]
}
}
\\
\\
===== Multi Command =====
----
Combine multiple DC commands in a single transaction. A single transaction may not include multiple commands for the same channel.
===Example===
**Send**
{
"dc":{
"1":[
{
"command":"setVoltage",
"voltage":3300
},
{
"command":"getVoltage"
}
],
"2":[
{
"command":"setVoltage",
"voltage":5000
}
]
}
}
**Response**
{
"dc":{
"1":[
{
"command":"setVoltage",
"statusCode":0,
"wait":500
},
{
"command":"getVoltage",
"statusCode":0,
"wait":100,
"voltage":3300
}
],
"2":[
{
"command":"setVoltage",
"statusCode":0,
"wait":500
}
]
}
}
\\
\\
====== GPIO ======
Commands that provide access to **GPIO** data and functions.
===== Get Current State =====
----
Get the current state of the instrument's channel
* **state**: "idle" or "running"
* **mode**: "la" or "gpio"
* **direction**: "input", "output", or "tristate"
* **value**: number or null
=== Example ===
**Send**
{
"gpio": {
"1": [
{
"command":"getCurrentState"
}
]
}
}
**Response**
{
"gpio": {
"1": [
{
"command":"getCurrentState",
"statusCode": 0,
"state": "idle",
"mode": "gpio",
"direction": "output",
"value": 1,
"wait":0
}
]
}
}
\\
===== Set Parameters =====
----
Set the parameters (direction) of the specified GPIO channel(s).
valid directions: input, output, inputPullUp, inputPullDown
===Example===
**Send**
{
"gpio":{
"1":[
{
"command":"setParameters",
"direction":"input"
}
],
"2":[
{
"command":"setParameters",
"direction":"output"
}
]
}
}
**Response**
{
"gpio":{
"1":[
{
"command":"setParameters",
"statusCode":0,
"wait":100
}
],
"2":[
{
"command":"setParameters",
"statusCode":0,
"wait":100
}
]
}
}
\\
\\
===== Read =====
----
Read the specified GPIO channel(s).
===Example===
**Send**
{
"gpio":{
"1":[
{
"command":"read"
}
]
}
}
**Response**
{
"gpio":{
"1":[
{
"command":"read",
"direction: "input"
"value":1,
"statusCode":0,
"wait":100
}
]
}
}
\\
\\
===== Write =====
----
Write the output voltage(s) of the specified GPIO channel(s).
===Example===
**Send**
{
"gpio":{
"1":[
{
"command":"write",
"value":1
}
]
}
}
**Response**
{
"gpio":{
"1":[
{
"command":"write",
"statusCode":0,
"wait":500
}
]
}
}
\\
\\
====== Oscilloscope ======
Commands that provide access to oscilloscope instrument data and functions.
\\
\\
===== Get Current State =====
----
Get the current state of the instrument's channel
* **state**: "armed", "acquiring", "idle", or "triggered"
* **acqCount**: number or null
* **actualVOffset**: number or null
* **actualSampleFreq**: number or null
* **actualGain**: number or null
* **actualBufferSize**: number or null
* **triggerDelay**: number or null
=== Example ===
**Send**
{
"osc": {
"1": [
{
"command": "getCurrentState"
}
]
}
}
**Response**
{
"osc": {
"1": [
{
"command": "getCurrentState",
"statusCode": 0,
"state": "triggered",
"acqCount": 10,
"actualVOffset": 0,
"actualSampleFreq": 1000000,
"actualGain": 0.25,
"actualBufferSize": 32000,
"triggerDelay": 0,
"wait": 0
}
]
}
}
\\
===== Set Parameters=====
----
Set the specified parameter(s) of the specified OSC channel(s).
**Type:** POST
**sampleFreq** - mHz
**bufferSize** - in samples
**triggerDelay** - delay from the trigger to the POI in pS
App will specify 'delay' in pS (+ or -) from the trigger to specify where the POI is. The device will return the index of the POI in the return buffer and will generally be the center point. The chart should be centered around this poi
===Example===
**Send**
{
"osc":{
"1":[
{
"command":"setParameters",
"offset":3000,
"gain": 0.25,
"sampleFreq": 1000000,
"bufferSize": 32000,
"triggerDelay": 100000
}
]
}
}
**Response**
{
"osc":{
"1":[
{
"command":"setParameters",
"statusCode":0,
"actualOffset":3100,
"actualSampleFreq": 1000000,
"wait":0
}
]
}
}
\\
\\
===== Read =====
----
Read data from the device.
Data will be returned if the device acqCount is greater or equal to the command acqCount. If the device acqCount is less than the command acqCount the device responds with it's trigger status and optionally a estimated time before a new buffer will be available.
For both triggerIndex and pointOfInterest, -1 means it is not in the buffer.
**Type:** POST
===Example===
**Send**
{
"osc":{
"1":[
{
"command":"read",
"acqCount":101
}
]
}
}
**Response**
352
{
"osc": {
"1": [
{
"command": "read",
"statusCode": 0,
"binaryOffset": 0,
"binaryLength": 65280,
"acqCount": 3,
"actualSampleFreq": 6250000000,
"pointOfInterest": 16320,
"triggerIndex": 16320,
"triggerDelay": 0
"actualVOffset": 48,
"actualGain": 1,
"wait": 0
}
]
}
}
<1024 Byte BLOB>
\\
\\
====== Logic Analyzer ======
Commands that provide access to the logic analyzer instrument data and functions.
\\
\\
===== Get Current State =====
----
Get the current state of the instrument's channel
* **state**: "armed", "acquiring", "idle", or "triggered"
* **acqCount**: number or null
* **mode**: "la" or "gpio"
* **actualSampleFreq**: number or null
* **actualBufferSize**: number or null
* **triggerDelay**: number or null
=== Example ===
**Send**
{
"la": {
"1": [
{
"command": "getCurrentState"
}
]
}
}
**Response**
{
"la": {
"1": [
{
"command": "getCurrentState",
"statusCode": 0,
"state": "triggered",
"acqCount": 10,
"mode": "la",
"actualSampleFreq": 1000000,
"actualBufferSize": 32000,
"triggerDelay": 0,
"wait": 0
}
]
}
}
\\
===== Set Parameters=====
----
Set the specified parameter(s) of the specified LA channel(s).
**Type:** POST
**sampleFreq** - mHz
**bufferSize** - in samples
===Example===
**Send**
{
"la":{
"1":[
{
"command":"setParameters",
"sampleFreq": 1000000,
"bufferSize": 32000
}
]
}
}
**Response**
{
"la":{
"1":[
{
"command":"setParameters",
"statusCode":0,
"actualSampleFreq": 6250000000,
"wait":0
}
]
}
}
\\
\\
===== Read =====
----
Read data from the device.
Data will be returned if the device acqCount is greater or equal to the command acqCount. If the device acqCount is less than the command acqCount the device responds with it's trigger status and optionally a estimated time before a new buffer will be available.
**Type:** POST
===Example===
**Send**
{
"la":{
"1":[
{
"command":"read",
"acqCount":101
}
]
}
}
**Response**
352
{
"la": {
"1": [
{
"command": "read",
"statusCode": 0,
"binaryOffset": 0,
"binaryLength": 65280,
"acqCount": 3,
"actualSampleFreq": 6250000000,
"pointOfInterest": 16384,
"triggerDelta": -16384,
"wait": 0
}
]
}
}
<1024 Byte BLOB>
\\
\\
====== Trigger ======
Commands that provide access to trigger functionality.
\\
\\
===== Get Current State =====
----
Get the current state of the instrument's channel
* **state**: "armed", "acquiring", "idle", or "triggered"
* **acqCount**: number or null
* **source**: see trigger setParameters or null
* **targets**: see trigger setParameters or null
=== Example ===
**Send**
{
"trigger": {
"1": [
{
"command": "getCurrentState"
}
]
}
}
**Response**
{
"trigger": {
"1": [
{
"command": "getCurrentState",
"statusCode": 0,
"acqCount": 10,
"source": {
"instrument": "osc",
"channel": 1,
"type": "risingEdge",
"lowerThreshold": 0,
"upperThreshold": 30
},
"targets": {
"osc": [1, 2],
"la": [1]
},
"state": "armed" || "acquiring" || "idle" || "triggered",
"wait": 0
}
]
}
}
\\
===== Force Trigger =====
----
Force an immediate acquisition without waiting for a trigger condition.
**Type:** POST
===Example===
**Send**
{
"trigger":{
"1":[
{
"command":"forceTrigger"
}
]
}
}
**Response**
{
"trigger":{
"1":[
{
"command":"forceTrigger",
"statusCode":0,
"acqCount": 27,
"wait": -1
}
]
}
}
\\
\\
===== Set Parameters =====
----
Set the device trigger parameters.
**Type:** POST
**Command**
* **trigger** - (Object) - The trigger endpoint.
* **#** - (Array