Arbitrary Waveform Generator

Commands that provide access to Arbitrary Waveform Generator data and functions.

awgCalibrate


Calibrate the arbitrary waveform generator.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgCalibrate”

Response

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{
  "command": "awgCalibrate"
}

Response

{
  "statusCode": 0
}



awgEnumerate


Enumerate instrument info.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgEnumerate”

Response

  • numChans - (Integer)
    The number of oscilloscope channels.
  • chans - (Array<Object>) - An array of objects representing oscilloscope channels.
    • name - (String)
      The channel name.
    • resolutionMax - (Integer)
      The sample maximum sample resolution in bits.
    • bufferSizeMax - (Integer)
      The maximum buffer size in samples.
    • freqMin - (Integer)
      The minimum frequency in Hz.
    • freqMax - (Integer)
      The maximum frequency in Hz.
    • voltageMin - (Integer)
      The minimum voltage in mv.
    • voltageMax - (Integer)
      The maximum voltage in mv.

waveform types per channel

Example

Send

{
  "command": "awgEnumerate"
}

Response

{
    "awg": {
        "numChans": 2,
        "chans": [
            {
                "name": "Channel0",
                "resolutionMax": 10,
                "bufferSizeMax": 1024,
                "freqMin": 100,
                "freqMax": 1000000,
                "voltageMin": -5000,
                "voltageMax": 5000
            },
            {
                "name": "Channel2",
                "resolutionMax": 10,
                "bufferSizeMax": 1024,
                "freqMin": 100,
                "freqMax": 1000000,
                "voltageMin": -5000,
                "voltageMax": 5000
            }
        ]
    }
}



awgSetOffsets


Set the offset voltage.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgSetOffset”

  • offset - (Integer)
    The offset value in mv.

Response

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{
  "command": "awgSetOffsets",
  "offset": 1000
}

Response

{
  "statusCode": 0
}



awgGetOffsets


Get the offset value.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgGetOffsets”

Response

  • offset - (Integer)
    Offset value in mv.

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{
  "command": "awgGetOffsets"
}

Response

{
  "offset": 1000
  "statusCode": 0
}



awgSetWaveforms


Configure the waveform.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgSetWaveforms”

  • chan - (Number)
    The AWG channel to write.

  • type - (String)
    The waveform type. Options: ['sine', 'triangle'].

  • freq - (Integer)
    The signal frequency in Hz.

  • amplitude - (Integer)
    Peak to peak amplitude in mv.

  • offset - (Integer)
    Signal DC offset in mv.

Response

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{

  "command": "awgSetWaveforms",
  "waveforms": [
    {
      "type": "sine",
      "freq": 1000,
      "amplitude": 5000,
      "offset": 1000
    }
  ]
}

Response

{
  statusCode: 0
}



awgSetCustomWaveforms


Configure the waveform.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgSetCustomWaveforms”

  • chan - (Integer)
    The channel number to write to.

  • numSamples (Integer)
    Number of data points in the waveform.

  • sampleRate (Integer)
    Number of samples to generate each second.

  • offset - (Integer)
    Signal DC offset in mv.

  • samples - (Arrray<Number>)
    Array of data points representing the custom waveform.

Response

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{
  "command": "awgSetCustomWaveforms",
  "waveforms": [
    {
      "numSamples": 7,
      "sampleRate": 1000,
      "offset": 0,
      "samples": [0, 1, 2, 3, 2, 1, 0]
    }
  ]
}

Response

{
  statusCode: 0
}



awgRun


Run the waveform generator.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgRun”

Response

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{  
  "command": "awgRun"
}

Response

{  
  "statusCode": 0
}



awgStop


Stop running the waveform generator.

Type: POST

Parameters

  • command - (String)
    Command constant - “awgStop”

Response

  • statusCode - (Integer)
    32-bit status code

  • statusData - (Object) - Optional
    Additional status specific data. Default is {}.

Example

Send

{
  "command": "awgStop"
}

Response

{  
  "statusCode": 0
}