Digilent Instrumentation Protocol

The Digilent Instrumentation Protocol is a JSON encoded command set for communicating with and controlling electronic instruments. The Digilent Instrumentation Protocol was initially designed as the communication protocol between WaveForms Live and and the OpenScope MZ, however the protocol is designed to be hardware agnostic and extensible.

JSON encoding offers several advantages including ease of use in JavaScript based web and mobile applications, human readable commands, and bus agnostic communication that easily supports HTTP, UART, TCP, WebSockets and more.

Command Format


  • The JSON data below is expanded for readability. All JSON should be minified (white space removed) before transmission.
  • Unless otherwise noted all commands are sent using the POST method when using HTTP.
  • All Digilent Instrumentation Protocol commands must be a JSON object or a chunked transfer:
    • JSON Object
      • Must start with a '{' character and ends with a '}' character.
      • May be followed by one or more '\r\n'.
    • Chunked Transfer
      • Composed of one or more chunks.
      • Each chunk must begin with the number of bytes in the chunk in ASCII hexidecimal format followed by one '\r\n', the binary data, and one '\r\n'.
        • The chunk length does not include the '\r\n' between the chunk length and the data.
        • The chunk length does not include the trailing '\r\n' after the binary data.
      • Each chunked transfer is terminated with a zero length chunk.
      • Ex.
6\r\n
chunk1\r\n
8\r\n
somedata\r\n
E\r\n
 in\r\n\r\nchunks.\r\n
0\r\n
\r\n

Multi Command


Multiple commands can be sent in a single transaction using a multicommand.

Example:

Command

{
   "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
         }
      ]
   }
}



Debug Print


The commands below are used the change the device debug print status.

Change Debug Print


Change serial debug setting on the device.

Command

  • debugPrint - (String) - The desired device debug print status - “off” | “on”

Response

  • mode - (String) - The device debug print status after applying the command
Example:

Command

{
   "debugPrint":"off"
}

Response

{
   "debugPrint":"off"
}



Mode


The commands below are used the change the device mode and are valid commands in every device mode.

Enter JSON Mode


Put the device into JSON command mode.

Command

  • mode - (String) - The desired device mode - “JSON”

Response

  • mode - (String) - The device mode after applying the command

Note: This command must include a trailing '\r\n'

Example:

Command

{
   "mode":"JSON"
}\r\n

Response

{
   "mode":"JSON"
}\r\n



Enter Menu Mode


Put the device into menu command mode.

Command

  • mode - (String) - The desired device mode - “menu”

Response

  • mode - (String) - The device mode after applying the command

Note: This command must include a trailing '\r\n'

Example:

Command

{
   "mode":"menu"
}\r\n

Response

{
   "mode":"menu"
}\r\n



File

Commands that provide access to logger instrument data and functions.

List Directory


List a directory on the device.

Command

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The List Directory command: “listdir”
    • type - (String) - The type of storage. Valid options are returned by storageGetLocations
    • path - (String) - The path to the directory to list

Response

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The List Directory command: “listdir”
    • 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.
    • type - (String) - The type of storage. Valid options are returned by storageGetLocations
    • path - (String) - The path to the directory to list
Example

Command

{
    "file": [{
        "command": "listdir",
        "type": "sd0",
        "path": "/"
    }]
}

Response

{
    "file": [{
        "command": "listdir",
        "statusCode": 0,
        "files": ["fileone.txt", "filetwo.bin"],
        "type": "sd0",
        "path": "/",
        "wait": 0
    }]
}


Write


Write a file.

Command

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Write command: “write”
    • type - (String) - The storage type (sd0, flash, etc)
    • path - (String) - The desired path of the file
    • filePosition - (String) - What index to start writing the file
    • binaryOffset - (Integer) - The offset in the binary chunk where the corresponding data starts
    • binaryLength - (Integer) - The length of the data in the binary chunk

Response

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The List Directory command: “write”
    • 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.
    • actualFilePosition - (Integer) - The actual file position
    • binaryLength - (Integer) - The length of the binary data in the binary chunk
    • binaryOffset - (Integer) - The offset in the binary chunk where the corresponding data starts
    • path - (String) - The path of the file
    • type - (String) - The storage type (sd0, flash, etc)
Example

Command

80\r\n
{
    "file": [{
        "command":"write",
        "type":"flash",
        "path":"hardprofiledata.json",
        "filePosition":0,
        "binaryOffset":0,
        "binaryLength":434
    }]
}\r\n
1b2\r\n
<Binary Data>
0\r\n
\r\n

Response

{
    "file": [{
        "command":"write",
        "statusCode":0,
        "type":"flash",
        "path":"hardprofiledata.json",
        "actualFilePosition":0,
        "binaryOffset":0,
        "binaryLength":434,
        "wait":0
    }]
}


Read


Read a file.

Command

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Read command: “read”
    • type - (String) - The storage type (sd0, flash, etc)
    • path - (String) - The desired path of the file
    • filePosition - (String) - What index to start writing the file
    • requestedLength - (Integer) - The desired length to read

Response

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Read command: “read”
    • 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.
    • actualFilePosition - (Integer) - The actual file position
    • actualLength - (Integer) - The actual number of bytes read
    • binaryLength - (Integer) - The length of the binary data in the binary chunk
    • binaryOffset - (Integer) - The offset in the binary chunk where the corresponding data starts
    • path - (String) - The path of the file
    • type - (String) - The storage type (sd0, flash, etc)
Example

Command

{
    "file": [{
        "command":"read",
        "type":"flash",
        "path":"hardprofiledata.json",
        "filePosition":0,
        "requestedLength":-1
    }]
}

Response

80\r\n
{
    "file": [{
        "command":"read",
        "statusCode":0,
        "type":"flash",
        "path":"hardprofiledata.json",
        "actualFilePosition":0,
        "actualLength":-1,
        "binaryOffset":0,
        "binaryLength":454,
        "wait":0
    }]
}\r\n
1B2\r\n
<Binary Data>
0\r\n
\r\n


Get File Size


Delete a file on the device.

Command

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Get File Size command: “getFileSize”
    • type - (String) - The type of storage. Valid options are returned by storageGetLocations
    • path - (String) - The path to the directory to list

Response

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Get File Size command: “getFileSize”
    • 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.
    • type - (String) - The type of storage. Valid options are returned by storageGetLocations
    • path - (String) - The path to the directory to list
    • actualFileSize - (Integer) - The actual file size
Example

Command

{
    "file":[{
        "command":"getFileSize",
        "type":"sd0",
        "path":"ch1.dlog"
    }]
}

Response

{
    "file":[{
        "command":"getFileSize",
        "statusCode":0,
        "type":"sd0",
        "path":"ch1.dlog",
        "actualFileSize":4070,
        "wait":0
    }]
}


Delete


Delete a file on the device.

Command

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Delete File command: “delete”
    • type - (String) - The type of storage. Valid options are returned by storageGetLocations
    • path - (String) - The path to the directory to list

Response

  • file - (Array<Object>) - An array of file commands
    • command - (String) - The Delete File command: “delete”
    • 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.
    • type - (String) - The type of storage. Valid options are returned by storageGetLocations
    • path - (String) - The path to the directory to list
Example

Command

{
    "file": [{
        "command": "delete",
        "type": "sd0",
        "path": "garbage.txt"
    }]
}

Response

{
    "file": [{
        "command": "delete",
        "statusCode": 0,
        "type": "sd0",
        "path": "garbage.txt",
        "wait": 0
    }]
}



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. Command

  • device - (Object) - The device object.
    • command - (String) - The Enumerate command: “enumerate”

Response

  • awg - (Object) - The AWG instrument object.
    • numChans - (Integer) - The number of AWG channels.
      • # - (Integer) - An AWG channel number.
        • signalTypes - (Array<string>) - 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.
  • la - Notes: MSB first, bits are right justified and contiguous.
Example:

Command

{  
   "device":[  
      {  
         "command":"enumerate"
      }
   ]
}

Response

{
    "device": [
        {
            "command": "enumerate",
            "statusCode": 0,
            "wait": 0,
            "deviceMake": "Digilent",
            "deviceModel": "OpenScope MZ",
            "calibrationSource": "flash",
            "firmwareVersion": {
                "major": 0,
                "minor": 283,
                "patch": 0
            },
            "awg": {
                "1": {
                    "signalTypes": [
                        "sine",
                        "square",
                        "sawtooth",
                        "triangle",
                        "dc"
                    ],
                    "signalFreqMin": 100,
                    "signalFreqMax": 1000000000,
                    "dataType": "I16",
                    "bufferSizeMax": 32640,
                    "dacVpp": 3000,
                    "sampleFreqMin": 1000000,
                    "sampleFreqMax": 10000000000,
                    "vOffsetMin": -1500,
                    "vOffsetMax": 1500,
                    "vOutMin": -3000,
                    "vOutMax": 3000
                },
                "numChans": 1
            },
            "dc": {
                "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
                },
                "numChans": 2
            },
            "gpio": {
                "numChans": 10,
                "sourceCurrentMax": 7000,
                "sinkCurrentMax": 12000
            },
            "la": {
                "numChans": 1,
                "1": {
                    "bufferDataType": "U16",
                    "numDataBits": 10,
                    "bitmask": 1023,
                    "sampleFreqMin": 6000,
                    "sampleFreqMax": 6250000000,
                    "bufferSizeMax": 32640
                }
            },
            "osc": {
                "1": {
                    "resolution": 12,
                    "effectiveBits": 11,
                    "bufferSizeMax": 32640,
                    "bufferDataType": "I16",
                    "sampleFreqMin": 6000,
                    "sampleFreqMax": 6250000000,
                    "delayMax": 4611686018427388000,
                    "delayMin": -32640000000000000,
                    "adcVpp": 3000,
                    "inputVoltageMax": 20000,
                    "inputVoltageMin": -20000,
                    "gains": [
                        1,
                        0.25,
                        0.125,
                        0.075
                    ]
                },
                "2": {
                    "resolution": 12,
                    "effectiveBits": 11,
                    "bufferSizeMax": 32640,
                    "bufferDataType": "I16",
                    "sampleFreqMin": 6000,
                    "sampleFreqMax": 6250000000,
                    "delayMax": 4611686018427388000,
                    "delayMin": -32640000000000000,
                    "adcVpp": 3000,
                    "inputVoltageMax": 20000,
                    "inputVoltageMin": -20000,
                    "gains": [
                        1,
                        0.25,
                        0.125,
                        0.075
                    ]
                },
                "numChans": 2
            },
            "log": {
                "analog": {
		    "1": {
		        "resolution": 12,
			"effectiveBits": 12,
			"bufferSizeMax": 32702,
			"fileSamplesMax": 2147483136,
			"sampleDataType": "I16",
			"sampleFreqUnits": 0.000001,
			"sampleFreqMin": 1,
			"sampleFreqMax": 50000000000,
			"delayUnits": 1e-12,
			"delayMax": 9223372036854776000,
			"delayMin": 0,
			"voltageUnits": 0.001,
			"adcVpp": 3000,
			"inputVoltageMax": 20000,
			"inputVoltageMin": -20000,
			"gains": [1, 0.25, 0.125, 0.075]
		    },
		    "2": {
		        "resolution": 12,
			"effectiveBits": 12,
			"bufferSizeMax": 32702,
			"fileSamplesMax": 2147483136,
			"sampleDataType": "I16",
			"sampleFreqUnits": 0.000001,
			"sampleFreqMin": 1,
			"sampleFreqMax": 50000000000,
			"delayUnits": 1e-12,
			"delayMax": 9223372036854776000,
			"delayMin": 0,
			"voltageUnits": 0.001,
			"adcVpp": 3000,
			"inputVoltageMax": 20000,
			"inputVoltageMin": -20000,
			"gains": [1, 0.25, 0.125, 0.075]
		    },
		    "fileFormat": 1,
		    "fileRevision": 1,
		    "numChans": 2
		}
	    }
        }
    ]
}



Enter Bootloader


Put the device in the bootloader.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Enter Bootloader command: “enterBootloader”

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Enter Bootloader command: “enterBootloader”
    • 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

{
   "device":[
      {
         "command":"enterBootloader"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"enterBootloader",
         "statusCode":0,
         "wait":1000         
      }
   ]
}


Calibration - Get Instructions


Get user calibration instructions.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Calibration Get Instructions command: “calibrationGetInstructions”

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Calibration Get Instructions command: “calibrationGetInstructions”
    • 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.
    • calibrationInstructions - (String) - User calibration instructions.
Example:

Command

{
   "device":[
      {
         "command":"calibrationGetInstructions"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationGetInstructions",
         "statusCode":0,
         "wait":0,
         "instructions":"Connect the Orange OSC1 lead to the Blue AWG1 Lead".
      }
   ]
}


Calibration - Get Status


Get the calibration status.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Calibration Get Status command: “calibrationGetStatus”

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Calibration Get Status command: “calibrationGetStatus”
    • 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.
    • status - (String) - The calibration process status: “idle”, “runningPretest”, “calibrating”, “calibrationFailed”.
Example:

Command

{
   "device":[
      {
         "command":"calibrationGetStatus"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationGetStatus",
         "statusCode":0,
         "wait":500,
         "status": "idle"
      }
   ]
}


Calibration - Get Storage Types


Get calibration storage types.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Get Calibration Storage Types command: “calibrationGetStorageTypes”

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Get Calibration Storage Types command: “calibrationGetStorageTypes”
    • 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.
    • storageTypes - (Array<String>) - Array of calibration storage types (ex. 'flash', 'sd').
Example:

Command

{
   "device":[
      {
         "command":"calibrationGetStorageTypes"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationGetStorageTypes",
         "statusCode":0,
         "wait":0,
         "storageTypes":[
            "flash",
            "sd"
         ]
      }
   ]
}


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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Calibration Load command: “calibrationLoad”
    • name - (String) - The calibration data to load (ex: “flash”, “sd”).

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Calibration Load command: “calibrationLoad”
    • 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

{
   "device":[
      {
         "command":"calibrationLoad",
         "type":"flash"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationLoad",
         "statusCode":0,
         "wait":0
      }
   ]
}


Calibration - Read


Read the calibration data from the working register.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Calibration Read command: “calibrationRead”.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Calibration Read command: “calibrationRead”.
    • 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.
    • calibrationData - (Object) - Device specific calibration data expressed as a JSON object.
Example:

Command

{
   "device":[
      {
         "command":"calibrationRead"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationRead",
         "statusCode":0,
         "wait":0,
         "calibrationData" : {
           <ARBITRARY JSON CALIBRATION DATA>
         }
      }
   ]
}


Calibration - Save


Save the calibration data to non-volatile storage. Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Calibration Save command: “calibrationSave”
    • type - (String) - The configuration type to save (ex. “flash”, “sd”).

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Calibration Save command: “calibrationSave”
    • 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

{
   "device":[
      {
         "command":"calibrationSave",
         "type": "flash"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationSave",
         "statusCode":0,
         "wait":0
      }
   ]
}


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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Calibration Start command: “calibrationStart”

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Calibration Start command: “calibrationStart”
    • 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

{
   "device":[
      {
         "command":"calibrationStart"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"calibrationStart",
         "statusCode":0,
         "wait":45
      }
   ]
}


NIC - Connect


Connect to the active network using the specified network adapter.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • 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.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The NIC Connect command: “nicConnect ”
    • 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

{  
   "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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The NIC Disconnect command: “nicDisconnect”
    • adapter - (String) - The network adapter to use (ex. wlan0, wlan1).

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The NIC Disconnect command: “nicDisconnect”
    • 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

{
   "device":[
      {
         "command":"nicDisconnect",
         "adapter":"wlan0"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"nicDisconnect",
         "statusCode":0,
         "wait":-1
      }
   ]
}


NIC - Get Status


Get the status of the specified network interface controller.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • 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

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Get NIC Status command: “nicGetStatus”
    • 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.
    • adapter - (String) - The network adapter (ex. eth0, eth1, wlan0, wlan1).
    • securityType - (String) - The network security type: “open”, “wep40”, “wep104”, “wpa”, “wpa2”.
    • status - (String) - NIC status: “connected”, “disconnected”.
    • ssid - (String) - The specified network adapter's SSID or an empty string if now SSID is set. A non-empty SSID does not indicate that the network adapter is connected.
    • ipAddress - (String) - The IP address of the device (if connected).
Example:

Command

{
   "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 - List


List all network adapters on the device.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The NIC List command: “nicList”.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Enter Bootloader command: “enterBootloader”
    • 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.
    • nics - (Array<String>) - An array of all the NICs on the device.
Example:

Command

{
   "device":[
      {
         "command":"nicList"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"nicList",
         "statusCode":0,
         "wait":0,
         "nics": ["wlan0"]
      }
   ]
}


Reset Instruments


Reset all instruments on the device.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Reset Instruments command: “resetInstruments”.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Reset Instruments command: “resetInstruments”.
    • statusCode - (Integer) - A numeric value representing the device status. See protocol-status-codes
    • wait - (Integer) - The number of ms to wait before the device is ready to process another command.
Example:

Command

{
   "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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Storage Get Locations command: “storageGetLocations”.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Storage Get Locations command: “storageGetLocations”.
    • 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.
    • storageLocations - (Array<String>) - The devices storage locations (ex. “flash”, “sd0”, “/tmp/”)
Example:

Command

{
   "device":[
      {
         "command":"storageGetLocations"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"storageGetLocations",
         "statusCode":0,
         "wait":0,
         "storageLocations":[
            "flash",
            "sd0"
         ]
      }
   ]
}


Wifi - Delete Saved Parameters


Delete the specified saved Wifi network.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Wifi Delete Saved Parameters command: “wifiDeleteParameters”.
    • storageLocation - (String) - The location to delete saved network parameters from (ex. “flash”, “sd”).
    • ssid - (String) - The network SSID to delete.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Wifi Delete Saved Parameters command: “wifiDeleteParameters”.
    • 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

{
   "device":[
      {
         "command":"wifiDeleteParameters",         
         "storageLocation":"flash",
         "ssid":"HorseFeathers"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"wifiDeleteParameters",
         "statusCode": 0,
         "wait": 0
      }
   ]
}


Wifi - List Saved Parameters


List all saved network parameters.

Command

  • device - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Wifi List Saved Parameters command: “wifiListSavedParameters”.
    • storageLocation - (String) - The location to read saved network parameters from (ex. “flash”, “sd”).

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Wifi List Saved Parameters command: “wifiListSavedParameters”.
    • 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.
    • parameterSets - (Object) - An object describing the network parameters.
      • ssid - (String) - The network SSID.
      • securityType - (String) - The network security type: “open”, “wep40”, “wep104”, “wpa”, “wpa2”.
      • autoConnect - (boolean) - True if the device should automatically connect to this network on boot.
Example:

Command

{
   "device":[
      {
         "command":"wifiListSavedParameters",
         "storageLocation":"flash"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"wifiListSavedParameters",
         "statusCode":0,
         "parameterSets":[
            {
               "ssid":"HorseFeathers",
               "securityType":"wpa2",
               "autoConnect":true
            }
         ]
      }
   ]
}


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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Wifi Load Parameters command: “wifiLoadParameters”. *
    • storageLocation - (String) - The location to read saved network parameters from (ex. “flash”, “sd”).
    • ssid - (String) - The SSID of the network parameters to load.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Wifi Load Parameters command: “wifiLoadParameters”.
    • 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

{
   "device":[
      {
         "command":"wifiLoadParameters",         
         "storageLocation":"flash",
         "ssid":"HorseFeathers"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"wifiLoadParameters",
         "statusCode":0,
         "wait":0
      }
   ]
}


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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Wifi Read Scanned Networks command: “wifiReadScannedNetworks”.
    • adapter - (String) - The network adapter to use (ex. wlan0, wlan1).

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Wifi Read Scanned Networks command: “wifiReadScannedNetworks”.
    • 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.
    • adapter - (String) - The network adapter to use (ex. wlan0, wlan1).
    • networks - (Array<Object>) - Array of objects describing scanned networks.
      • ssid - (String) - The network SSID.
      • bssid - (String) - The network SSID.
      • securityType - (String) - The network security type: “open”, “wep40”, “wep104”, “wpa”, “wpa2”.
      • channel - (Integer) - The network channel.
      • signalStrength - (Integer) - The network signal strength in arbitrary units from 0 (lowest) to 100 (highest).
Example:

Command

{
   "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 - 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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Wifi Save Parameters command: “wifiSaveParameters”.
    • storageLocation - (String) - The location to save the current network parameters.
      Note that locations outside of flash may not be secure! See storageGetLocations for a list of available storage locations.

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Wifi Save Parameters command: “wifiSaveParameters”.
    • 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

{
   "device":[
      {
         "command":"wifiSaveParameters",
         "storageLocation":"flash"
      }
   ]
}

Response

{
   "device":[
      {
         "command":"wifiSaveParameters",
         "statusCode":0,
         "wait":0
      }
   ]
}


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 - (Array<Object>) - Array of command objects to apply to the device.
    • command - (String) - The Wifi Scan command: “wifiScan”.
    • adapter - (String) - The network adapter to use (ex. wlan0, wlan1).

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Wifi Scan command: “wifiScan”.
    • 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

{
   "device":[
      {
         "command": "wifiScan",
         "adapter":"wlan0"
      }
   ]
}

Response

{
   "device":[
      {
         "command": "wifiScan",
         "statusCode": 0,
         "wait": -1         
      }
   ]
}


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 - (Array<Object>) - Array of command objects to apply to the device.
    • 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

Response

  • device - (Array<Object>) - Array of response objects to apply to the device.
    • command - (String) - The Enter Bootloader command: “enterBootloader”
    • 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

{
   "device":[
      {
         "command":"wifiSetParameters",
         "ssid":"HorseFeathers",         
         "securityType":"wpa2",
         "passphrase":"swordfish",
         "autoConnect":true
      }
   ]
}

Response

{
   "device":[
      {
         "command":"wifiSetParameters",
         "statusCode":0,
         "wait":0
      }
   ]
}


Oscilloscope

Commands that provide access to oscilloscope instrument data and functions.

Get Current State


Get the current state of the instrument's channel

Command

  • osc - (Object) - The oscilloscope object.
    • # - (Array<Object>) - An array of command objects to apply to the oscilloscope channel.
      • command - (String) - The Get Current State command: “getCurrentState”

Response

  • osc - (Object) - The oscilloscope object.
    • # - (Array<Object>) - An array of command objects applied to the oscilloscope 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.
      • state - (String) - The state of the instrument channel: “armed”, “acquiring”, “idle”, or “triggered”.
      • acqCount: - (Integer) - The channel acquisition count. This value increments with each successful acquisition.
      • actualVOffset - (Integer) - The actual voltage offset used in mV.
      • actualSampleFreq- (Integer) - The actual sample frequency used in mHz.
      • actualGain - (Integer) - The actual gain used.
      • actualBufferSize- (Integer) - The actual buffer size used in samples.
      • triggerDelay- (Integer) - The actual trigger delay used in pS.
Example

Command

{
    "osc": {
        "1": [
            {
                "command": "getCurrentState"
            }
        ]
    }
}

Response

{
    "osc": {
        "1": [
            {
                "command": "getCurrentState",
                "statusCode": 0,
                "wait": 0,
                "state": "triggered",
                "acqCount": 10,
                "actualVOffset": 0,
                "actualSampleFreq": 1000000,
                "actualGain": 0.25,
                "actualBufferSize": 32000,
                "triggerDelay": 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.

Data is returned in chunked transfer format. The first chunk of data is a JSON object that describes the following chunk of binary data. The binary data type and resolution are defined in the device enumeration and units are in mV. The first byte in the binary data corresponds to the first sample in the buffer (the earliest sample chronologically).

Command

  • # - (ASCII Hexadecimal) - The number of bytes in the chunk in ASCII hexadecimal followed by '\r\n'.
  • osc - (Object) - The oscilloscope object.
    • # - (Array<Object>) - An array of command objects to apply to the oscilloscope channel.
      • command - (String) - The Read command: “read”.

Response

  • osc - (Object) - The oscilloscope object.
  • # - (Array<Object>) - An array of command objects applied to the oscilloscope channel.
    • command - (String) - The Read command: “read”.
    • 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.
    • binaryOffset - (Integer) - The first byte of the buffer in the binary data chunk.
    • binaryLength - (Integer) - The buffer size in bytes.
    • acqCount - (Integer) - The acquisition count.
    • actualSampleFreq - (Integer) - The actual sample frequency used to generate the data buffer in mHz.
    • pointOfInterest - (Integer) - The sample index of the point of interest in the buffer or -1 if the point of interest is not in the buffer.
    • triggerIndex - (Integer) - The sample index where the trigger occurred in the buffer or -1 if the trigger is not in the buffer.
    • triggerDelay - (Integer) - The time in pS between the point of interest and the trigger. A negative triggerDelay means that the point of interest is before the trigger chronologically.
    • actualVOffset - (Integer) - The voltage offset value used when acquiring the buffer in mV.
    • actualGain - (Decimal) - The gain value used when acquiring the data buffer.
Example:

Command

{  
   "osc":{  
      "1":[  
         {  
            "command":"read",
            "acqCount":101
         }
      ]
   }
}

Response

160\r\n
{
    "osc": {
        "1": [
            {
                "command": "read",
                "statusCode": 0,
                "wait": 0,
                "binaryOffset": 0,
                "binaryLength": 1024,
                "acqCount": 3,
                "actualSampleFreq": 6250000000,
                "pointOfInterest": 256,
                "triggerIndex": 256,
                "triggerDelay": 0
                "actualVOffset": 48,
                "actualGain": 1                
            }
        ]
    }
}\r\n
400\r\n 
<1024 Byte BLOB>
\r\n
0\r\n
\r\n



Set Parameters


Set the specified parameter(s) of the specified oscilloscope channel(s).

Command

  • osc - (Object) - The oscilloscope object.
    • # - (Array<Object>) - An array of command objects to apply to the oscilloscope channel.
      • command - (String) - The Set Parameters command: “setParameters”.
      • bufferSize- (Integer) - The desired buffer size in samples.
      • gain - (Integer) - The desired gain.
      • vOffset - (Integer) - The desired voltage offset in mV.
      • sampleFreq- (Integer) - The desired sample frequency in mHz.
      • triggerDelay- (Integer) - The desired trigger delay in pS.

Response

  • osc - (Object) - The oscilloscope object.
    • # - (Array<Object>) - An array of command objects applied to the oscilloscope channel.
      • command - (String) - The Set Parameters command: “setParameters”
      • statusCode - (Integer) - A numeric value representing the device status. See Digilent Instrumentation Protocol Status Codes
      • actualVOffset - (Integer) - The actual voltage offset used in mV.
      • actualSampleFreq- (Integer) - The actual sample frequency used in mHz.
      • wait - (Integer) - The number of ms to wait before the device is ready to process another command.
Example:

Command

{  
   "osc":{  
      "1":[  
         {  
            "command":"setParameters",
            "bufferSize": 32000,            
            "gain": 0.25,
            "vOffset":3000,
            "sampleFreq": 1000000,            
            "triggerDelay": 100000
         }
      ]
   }
}

Response

{  
   "osc":{  
      "1":[  
         {  
            "command":"setParameters",
            "statusCode":0,
            "actualVOffset":3100,
            "actualSampleFreq": 1000000,
            "wait":0
         }
      ]
   }
}



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

Command

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects to apply to the awg channel.
      • command - (String) - The Get Current State command: “getCurrentState”

Response

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects applied to the awg 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.
      • state - (String) - The instrument channel state: “idle” or “running”.
      • waveType - (String) - The waveform type: “sine”, “square”, “triangle”, “dc”, “sawtooth”, “arbitrary”, or “none”.
      • actualSignalFreq - (Integer) - The actual waveform frequency in mHz.
      • actualVpp - (Integer) - The actual peak-to-peak voltage in mV.
      • actualVOffset - (Integer) - The actual voltage offset in mV.
Example

Command

{
    "awg": {
        "1": [
            {
                "command": "getCurrentState"
            }
        ]
    }
}

Response

{
    "awg": {
        "1": [
            {
                "command": "getCurrentState",
                "statusCode": 0,                
                "wait": 0,
                "state": "running",
                "waveType": "sine",
                "actualSignalFreq": 1000000,
                "actualVpp": 3000,
                "actualVOffset": 0
            }
        ]
    }
}


Set Regular Waveform


Set the parameters of the arbitrary waveform generator channel(s) to output a regular waveform.

Command

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects to apply to the awg channel.
      • command - (String) - The Set Regular Waveform command: “setRegularWaveform”
      • signalType - (String) - The waveform type: “sine”, “square”, “triangle”, “dc”, “sawtooth”, “arbitrary”, or “none”.
      • signalFreq - (Integer) - The signal frequency in mHz.
      • vpp - (Integer) - The peak-to-peak voltage in mV.
      • vOffset - (Integer) - The voltage offset in mV.

Response

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects applied to the awg channel.
      • command - (String) - The Set Regular Waveform command: “setRegularWaveform”
      • 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.
      • actualSignalFreq - (Integer) - The actual waveform frequency in mHz.
      • actualVpp - (Integer) - The actual peak-to-peak voltage in mV.
      • actualVOffset - (Integer) - The actual voltage offset in mV.
Example (Waveform)

Command

{
   "awg":{
      "1":[
         {
            "command":"setRegularWaveform",
            "signalType":"sine",
            "signalFreq":1000000,
            "vpp":3000,
            "vOffset":0 
         }
      ]
   }
}

Response

{  
   "awg":{  
      "1":[  
         {  
            "command":"setRegularWaveform",
            "statusCode":0,            
            "wait":0,
            "actualSignalFreq": 1000000,
            "actualVpp": 3000,
            "actualVOffset":0
         }
      ]
   }
}



Run


Run the arbitrary waveform generator channel(s).

Command

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects to apply to the awg channel.
      • command - (String) - The Run command: “run”

Response

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects applied to the awg 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.
Example:

Command

{
   "awg":{
      "1":[
         {
            "command":"run"
         }
      ]
   }
}

Response

{
   "awg":{
      "1":[
         {
            "command":"run",
            "statusCode":0,
            "wait":0
         }
      ]
   }
}



Stop


Stop the arbitrary waveform generator channel(s).

Command

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects to apply to the awg channel.
      • command - (String) - The Stop command: “stop”

Response

  • awg - (Object) - The arbitrary waveform generator object.
    • # - (Array<Object>) - An array of command objects applied to the awg 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

{
   "awg":{
      "1":[
         {
            "command":"stop"
         }
      ]
   }
}

Response

{
   "awg":{
      "1":[
         {
            "command":"stop",
            "statusCode":0,
            "wait":0
         }
      ]
   }
}



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

Command

{
    "la": {
        "1": [
            {
                "command": "getCurrentState"
            }
        ]
    }
}

Response

{
    "la": {
        "1": [
            {
                "command": "getCurrentState",
                "statusCode": 0,
                "state": "triggered",
                "acqCount": 10,
                "bitmask": 1023,
                "actualSampleFreq": 1000000,
                "actualBufferSize": 32000,
                "triggerDelay": 0,
                "wait": 0
            }
        ]
    }
}


Set Parameters


Set the specified parameter(s) of the specified LA channel(s).

sampleFreq - mHz bufferSize - in samples

Example:

Command

{  
   "la":{  
      "1":[  
         {  
            "command":"setParameters",
            "bitmask": 1023,
            "sampleFreq": 1000000,
            "bufferSize": 32000,
            "triggerDelay": 0
         }
      ]
   }
}

Response

{  
   "la":{  
      "1":[  
         {  
            "command":"setParameters",
            "statusCode":0,
            "actualSampleFreq": 6250000000,
            "actualTriggerDelay": 0,
            "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.

Data is returned in chunked transfer format. The first chunk of data is a JSON object that describes the following chunk of binary data. Data type information for the binary chunk is defined under bufferDataType in the device enumeration response for the instrument. numDataBits defines the maximum number of bits that may contain LA data. Data bits are right justified. For example if bufferDataType is u8 and numDataBits is 3 and all LA channels are high the resulting binary data would be 0b00000111. bitMask defines which bits within the binary data are valid LA channels.

Command

  • # - (ASCII Hexadecimal) - The number of bytes in the chunk in ASCII hexadecimal followed by '\r\n'.
  • la - (Object) - The logic analyzer object.
    • # - (Array<Object>) - An array of command objects to apply to the logic analyzer channel.
      • command - (String) - The Read command: “read”.

Response

  • la - (Object) - TThe logic analyzer object.
  • # - (Array<Object>) - An array of command objects applied to the logic analyzer channel.
    • command - (String) - The Read command: “read”.
    • 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.
    • binaryOffset - (Integer) - The first byte of the buffer in the binary data chunk.
    • binaryLength - (Integer) - The buffer size in bytes.
    • acqCount - (Integer) - The acquisition count.
    • actualSampleFreq - (Integer) - The actual sample frequency used to generate the data buffer in mHz.
    • pointOfInterest - (Integer) - The sample index of the point of interest in the buffer or -1 if the point of interest is not in the buffer.
    • triggerIndex - (Integer) - The sample index where the trigger occurred in the buffer or -1 if the trigger is not in the buffer.
    • triggerDelay - (Integer) - The time in pS between the point of interest and the trigger. A negative triggerDelay means that the point of interest is before the trigger chronologically.
Example:

Command

{  
   "la":{  
      "1":[  
         {  
            "command":"read",
            "acqCount":101
         }
      ]
   }
}

Response

160\r\n
{
    "la": {
        "1": [
            {
                "command": "read",
                "statusCode": 0,
                "wait": 0,
                "binaryOffset": 0,
                "binaryLength": 1024,
                "acqCount": 3,
                "bitmask": 1023,
                "actualSampleFreq": 6250000000,
                "pointOfInterest": 256,
                "triggerIndex": 256,
                "actualTriggerDelay": 0                
            }
        ]
    }
}\r\n
400\r\n 
<1024 Byte BLOB>
\r\n
0\r\n
\r\n



GPIO

Commands that provide access to GPIO data and functions.

Get Current State


Get the current state of the instrument's channel

Command

  • gpio - (Object) - The gpio object.
    • # - (Array<Object>) - An array of command objects to apply to the gpio channel.
      • command - (String) - The Get Current State command: “getCurrentState”

Response

  • gpio - (Object) - The gpio object.
    • # - (Array<Object>) - An array of command objects applied to the gpio 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.
      • state - (String) - The GPIO channel state: “idle” or “running”.
      • mode - (String) - The GPIO channel mode: “la” or “gpio”.
      • direction - (String) - The GPIO channel direction: “input”, “output”, or “tristate”.
      • value - (Integer) - The GPIO value: 0 or 1.
Example

Command

{
    "gpio": {
        "1": [
            {
                "command":"getCurrentState"
            }
        ]
    }
}

Response

{
    "gpio": {
        "1": [
            {
                "command":"getCurrentState",
                "statusCode": 0,
                "wait":0,
                "state": "idle",
                "mode": "gpio",
                "direction": "output",
                "value": 1                
            }
        ]
    }
}


Read


Read the specified GPIO channel(s).

Command

  • gpio - (Object) - The GPIO object.
    • # - (Array<Object>) - An array of command objects to apply to the GPIO channel.
      • command - (String) - The Read command: “read”

Response

  • gpio - (Object) - The GPIO object.
    • # - (Array<Object>) - An array of command objects applied to the GPIO channel.
      • command - (String) - The Read command: “read”
      • 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.
      • direction - (String) - The GPIO channel's direction (ex. “input”, “output”).
      • value - (Integer) - The GPIO channel's value (ex. 0, 1).
Example:

Command

{
   "gpio":{
      "1":[
         {
            "command":"read"
         }
      ]
   }
}

Response

{
   "gpio":{
      "1":[
         {
            "command":"read",
            "statusCode":0,
            "wait":100,
            "direction: "input"
            "value":1            
         }
      ]      
   }
}



Set Parameters


Set the parameters (direction) of the specified GPIO channel(s).

Command

  • gpio - (Object) - The GPIO object.
    • # - (Array<Object>) - An array of command objects to apply to the gpio channel.
      • command - (String) - The Set Parameters command: “setParameters”
      • direction - (String) - The GPIO direction: “input”, “output”, “inputPullUp”, “inputPullDown”.

Response

  • gpio - (Object) - The GPIO object.
    • # - (Array<Object>) - An array of command objects applied to the gpio 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.
Example:

Command

{
   "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
         }
      ]      
   }
}



Write


Write the output voltage(s) of the specified GPIO channel(s).

Command

  • gpio - (Object) - The GPIO object.
    • # - (Array<Object>) - An array of command objects to apply to the GPIO channel.
      • command - (String) - The Write command: “write”
      • value - (Integer) - The value to write to the GPIO channel (ex. 0 for logic low, 1 for logic high).

Response

  • gpio - (Object) - The GPIO object.
    • # - (Array<Object>) - An array of command objects applied to the GPIO channel.
      • command - (String) - The Write command: “write”
      • 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

{
   "gpio":{
      "1":[
         {
            "command":"write",
            "value":1
         }
      ]
   }
}

Response

{
   "gpio":{
      "1":[
         {
            "command":"write",
            "statusCode":0,
            "wait":500
         }
      ]
   }
}



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

Command

  • dc - (Object) - The DC power supply object.
    • # - (Array<Object>) - An array of command objects to apply to the DC power supply channel.
      • command - (String) - The Get Current State command: “getCurrentState”

Response

  • gpio - (Object) - The DC power supply object.
    • # - (Array<Object>) - An array of command objects applied to the DC power supply 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.
      • state - (String) - The current state of the channel: “idle” or “running”.
      • voltage - (Integer) - The current measured value of the channel in mV.
Example

Command

{
    "dc": {
        "1": [
            {
                "command":"getCurrentState"
            }
        ]
    }
}

Response

{
    "dc": {
        "1": [
            {
                "command": "getCurrentState",
                "statusCode": 0,
                "wait": 0,
                "state": "idle",
                "voltage": 3300                
            }
        ]
    }
}


Get Voltage


Get the output voltage(s) of the specified DC power supply channel(s).

Command

  • dc - (Object) - The DC power supply object.
    • # - (Array<Object>) - An array of command objects to apply to the DC power supply channel.
      • command - (String) - The Get Voltage command: “getVoltage”

Response

  • gpio - (Object) - The DC power supply object.
    • # - (Array<Object>) - An array of command objects applied to the DC power supply channel.
      • command - (String) - The Get Voltage command: “getVoltage”
      • 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.
      • voltage - (Integer) - The current measured value of the channel in mV.
Example:

Command

{
   "dc":{
      "1":[
         {
            "command":"getVoltage"
         }
      ]
   }
}

Response

{
   "dc":{
      "1":[
         {
            "command":"getVoltage",
            "statusCode":0,
            "wait":100,
            "voltage":3300
         }
      ]      
   }
}



Set Voltage


Set the output voltage(s) of the specified DC power supply channel(s).

Command

  • dc - (Object) - The DC power supply object.
    • # - (Array<Object>) - An array of command objects to apply to the DC power supply channel.
      • command - (String) - The Set Current State command: “setCurrentState”
      • voltage - (Integer) - The desired voltage in mV.

Response

  • gpio - (Object) - The DC power supply object.
    • # - (Array<Object>) - An array of command objects applied to the DC power supply channel.
      • command - (String) - The Set Current State command: “setCurrentState”
      • 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

{
   "dc":{
      "1":[
         {
            "command":"setVoltage",
            "voltage":3300
         }
      ]
   }
}

Response

{
   "dc":{
      "1":[
         {
            "command":"setVoltage",
            "statusCode":0,
            "wait":500
         }
      ]
   }
}



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
         }
      ]
   }
}



Logger

Commands that provide access to logger instrument data and functions.

Get Current State


Get the current state of the instrument's channel

Command

  • logger - (Object) - The logger
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects to apply to the logger channel.
        • command - (String) - The Get Current State command: “getCurrentState”

Response

  • logger - (Object) - The logger object.
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects applied to the logger 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.
        • state - (String) - The state of the instrument channel: “idle”, “stopped”, “busy”, or “running”.
        • stopReason: - (String) - The reason the channel stopped: “NORMAL” or “OVERFLOW”.
        • startIndex - (Integer) - The start index of the desired data.
        • actualCount- (Integer) - The number of samples available.
        • maxSampleCount - (Integer) - The max sample count. A value of -1 denotes an infinite number of samples.
        • actualGain- (Double) - The gain on the analog channel.
        • actualVOffset- (Integer) - The voltage offset.
        • actualSampleFreq - (Integer) - The actual sample frequency in uHz.
        • actualStartDelay - (Integer) - The start delay in ps.
        • overflow - (String) - The actual overflow setting: “circular” or “stop”.
        • storageLocation - (String) - The location where the logging file will be stored. Empty string if logging to ram (streaming).
        • uri - (String) - The file name of the logging file. Empty string if not set or logging to ram (streaming).
Example

Command

{
    "log": {
        "analog": {
            "1": [{
                "command": "getCurrentState"
            }]
        }
    }
}

Response

{
    "log": {
        "analog": {
            "1": [{
                "command":"getCurrentState",
                "statusCode":0,
                "state":"stopped",
                "stopReason":"NORMAL",
                "startIndex":0,
                "actualCount":0,
                "maxSampleCount":-1,
                "actualGain":0.075,
                "actualVOffset":0,
                "actualSampleFreq":50000000,
                "actualStartDelay":0,
                "overflow":"circular",
                "storageLocation":"sd0",
                "uri":"ch1.bin",
                "wait":0
            }]
        }
    }
}


Set Parameters


Set log parameters.

Command

  • logger - (Object) - The logger
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects to apply to the logger channel.
        • command - (String) - The Set Parameters command: “setParameters”
        • maxSampleCount - (Integer) - The max sample count. A value of -1 denotes an infinite number of samples.
        • gain- (Double) - The gain on the analog channel.
        • vOffset- (Integer) - The voltage offset.
        • sampleFreq - (Integer) - The actual sample frequency in uHz.
        • startDelay - (Integer) - The start delay in ps.
        • storageLocation - (String) - The location where the logging file will be stored. Empty string if logging to ram (streaming).
        • uri - (String) - The file name of the logging file. Empty string if not set or logging to ram (streaming).

Response

  • logger - (Object) - The logger object.
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects applied to the logger channel.
        • command - (String) - The 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.
        • maxSampleCount - (Integer) - The max sample count. A value of -1 denotes an infinite number of samples.
        • actualGain- (Double) - The gain on the analog channel.
        • actualVOffset- (Integer) - The voltage offset.
        • actualSampleFreq - (Integer) - The actual sample frequency in uHz.
        • actualStartDelay - (Integer) - The start delay in ps.
        • storageLocation - (String) - The location where the logging file will be stored. Empty string if logging to ram (streaming).
        • uri - (String) - The file name of the logging file. Empty string if not set or logging to ram (streaming).
Example

Command

{
    "log":{
        "analog":{
            "1":[{
                "command":"setParameters",
                "maxSampleCount":1000,
                "gain":0.25,
                "vOffset":0,
                "sampleFreq":200000000,
                "startDelay":0,
                "storageLocation":"ram",
                "uri":""
            }],
            "2":[{
                "command":"setParameters",
                "maxSampleCount":1000,
                "gain":0.25,
                "vOffset":0,
                "sampleFreq":200000000,
                "startDelay":0,
                "storageLocation":"ram",
                "uri":""
            }]
        }
    }
}

Response

{
    "log":{
        "analog":{
            "1":[{ 
                "command":"setParameters",
                "statusCode":0,
                "maxSampleCount":1000,
                "actualGain":0.25,
                "actualVOffset":-37,
                "actualSampleFreq":200000000,
                "actualStartDelay":0,
                "storageLocation":"ram",
                "uri":"",
                "wait":0
            }],
            "2":[{
                "command":"setParameters",
                "statusCode":0,
                "maxSampleCount":1000,
                "actualGain":0.25,
                "actualVOffset":12,
                "actualSampleFreq":200000000,
                "actualStartDelay":0,
                "storageLocation":"ram",
                "uri":"",
                "wait":0
            }]
        }
    }
}


Run


Run the logger

Command

  • logger - (Object) - The logger
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects to apply to the logger channel.
        • command - (String) - The Run command: “run”

Response

  • logger - (Object) - The logger object.
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects applied to the logger 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.
Example

Command

{
    "log": {
        "analog": {
            "1": [{
                "command": "run"
            }]
        }
    }
}

Response

{
    "log": {
        "analog": {
            "1": [{
                "command":"run",
                "statusCode":0,
                "wait":-1
            }]
        }
    }
}


Read


Read live logger while it runs

Command

  • logger - (Object) - The logger
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects to apply to the logger channel.
        • command - (String) - The Read command: “read”
        • startIndex - (Integer) - The start index to read from
        • count - (Integer) - The number of points to read

Response

  • logger - (Object) - The logger object.
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects applied to the logger channel.
        • command - (String) - The Read command: “read”
        • 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.
        • binaryOffset - (Integer) - The first byte of the buffer in the binary data chunk.
        • binaryLength - (Integer) - The buffer size in bytes.
        • actualCount - (Integer) - The actual number of data points returned.
        • startIndex - (Integer) - The actual start index of the points returned.
        • maxSampleCount - (Integer) - The max sample count parameter currently set.
        • actualGain - (Double) - The gain parameter currently set.
        • actualVOffset - (Integer) - The offset parameter currently set.
        • actualSampleFreq - (Integer) - The actual sample frequency currently set.
        • actualStartDelay - (Integer) - The actual start delay currently set.
        • overflow - (String) - The actual overflow currently set.
        • storageLocation - (String) - The storage location of the data.
        • uri - (String) - The name of the log file
Example

Command

{
    "log": {
        "analog": {
            "1": [{
                "command":"read",
                "startIndex":0,
                "count":0
            }]
        }
    }
}

Response

12F\r\n
{
    "log": {
        "analog": {
            "1": [{
                "command":"read",
                "statusCode":0,
                "binaryOffset":0,
                "binaryLength":2,
                "actualCount":1,
                "startIndex":0,
                "maxSampleCount":1000,
                "actualGain":1,
                "actualVOffset":-68,
                "actualSampleFreq":200000000,
                "actualStartDelay":0,
                "overflow":"circular",
                "storageLocation":"ram",
                "uri":"ch1.bin",
                "wait":0
            }]
        }
    }
}\r\n
2\r\n
<Binary Data>\r\n
0\r\n
\r\n


Stop


Stop the logger

Command

  • logger - (Object) - The logger
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects to apply to the logger channel.
        • command - (String) - The Stop command: “stop”

Response

  • logger - (Object) - The logger object.
    • channel type - (Object) - The channel type (analog or digital).
      • # - (Array<Object>) - An array of command objects applied to the logger 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

{
    "log": {
        "analog": {
            "1": [{
                "command": "stop"
            }]
        }
    }
}

Response

{
    "log": {
        "analog": {
            "1": [{
                "command":"stop",
                "statusCode":0,
                "wait":0
            }]
        }
    }
}