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