Basic Structure -

For each waveform that is created by the module, the controlling program should adhere to the following structure:

  1. Initialization of module(s)
  2. Configure control settings
  3. Waveform parameter definitions
  4. Download data
  5. Start module memory
  6. Stop memory when complete


Initialization of module(s)

The initialization of the module only needs to be done once in a program assuming that the module is not disconnected. Initialization must be done first before all other steps. Initialization is a multiple step process. First you should find out how many modules are connected by reading the number property in the AWG_Group_API class. Then call the get_sn member function in the AWG_Group_API class to get the board Series Number. The next step is the most important step in the entire AWG program writing process: after you have instantiated a AWG_API object, you must initialize it by calling the ini with the board Series Number as argument. Simply having an AWG_API object without calling the ini method will likely cause your program to fail.

Always call the ini function immediately after instantiating a AWG_API object!


Configure control settings

Control settings should be redefined every time a new waveform is implemented. The reason for this is that if you do not change the control settings, the module will carry over settings from the previous waveform. Even if two waveforms have the same settings, you should redefine the settings just in case. You must set the memory depth and loop count; the rest are optional.

First set the mode (either Free Run, Master or Slave) and the related multi-board settings:

Mode Settings Implementation
Loop Count (mandatory): loop_count
Slave Enable/Disable: slave_mode
Auto-Arm Enable/Disable auto_armed
SYNCO Enable/Disable synco_enable
Internal SYNCI Enable/Disable synci_enable

Then set the general control settings that apply to all modes.:

Control Settings Implementation
Memory Depth (mandatory): memory_depth
Oversampling Factor: over_sampling_rate
Marker 1 Enable/Disable: marker1_enabled
Marker 1 Polarity marker1_polarity
Marker 2 Enable/Disable: marker2_enabled
Marker 2 Polarity marker2_polarity
Marker 3 Enable/Disable: marker3_enabled
Marker 3 Polarity marker3_polarity
Data Length Enable/Disable: data_length_enable


Waveform parameter definitions

There are three ways you can set up your waveforms:

Built-In Waveform Parameters Implementation
Waveform code: code
Delay delay

The second way to define a waveform is to use the user_define_bulk member function.

The final way to define a waveform is to use the user_define_file member function.


The Data Length is a mandatory parameter that you must set for ALL waveforms.

Mandatory Parameter Implementation
Data Length data_length


Finally, there are optional parameters that may be useful for your waveform.

Optional Parameters Implementation
Marker 1 Start marker1_start
Marker 1 Width marker1_width
Marker 2 Start marker2_start
Marker 2 Width marker2_width
Marker 3 Start marker3_start
Marker 3 Width marker3_width


Download data

The next step is to download all of the information stored in the computer memory to the memory on the module. To do this, you should use the download method.


Start memory

When in Free Run mode, start the memory by using the restart method.

For Master mode, use the arm method to arm the board. When armed, the Master module will wait for the trigger signal and then start the memory.

For Slave mode, use the slave_mode property to arm the board. When armed, the Slave module will wait for the SYNCI signal and then start the memory.


Stop memory

In the absence of a stop command, the module will continue to run until the power is interrupted. If you want to stop the module memory, use the stop method.