Skip to content

AWG Module

The AWG module allows programmers to access the functionality available in the LabOne User Interface AWG tab. It allows users to compile and upload sequencer programs to the arbitrary waveform generator of the instruments from any of the LabOne APIs.

Important

The AWG module is the underlying logic of the LabOne User Interface AWG tab. However most of the LabOne APIs expose the AWG offline compiler directly. Often this is the preferred way and offer much more flexibility.

This page only explains the specifics for working with the LabOne AWG module. A in-depth documentation of the LabOne AWG Sequencer Programming Language and its usage can be found in the Sequencer Programming User Manual.

Programming an AWG with a sequencer program is a 2-step process. First, the source code must be compiled to a binary ELF file and secondly, the ELF file must be uploaded from the PC to the AWG Core of the used instrument. Both steps are performed by an instance of the AWG Module regardless of whether the module is used in the API or the LabOne User Interface’s AWG Sequencer tab.

Compilation

An AWG sequencer program can be provided to the AWG module for compilation as either a:

  • Source file: In this case, the sequencer program file must reside in the /awg/src sub-directory of the LabOne user directory (The exact location of this directory can be read from the module node /directory). The filename (without full directory path) must be specified via the /compiler/sourcefile parameter and compilation is started when the in-out parameter /compiler/start is set to 1.

  • String: A sequencer program may also be sent directly to the AWG Module as a string (comprising of a valid sequencer program) without the need to create a file on disk. The string is sent to the module by writing it to the /compiler/sourcestring using the module setString() function. In this case, compilation is started automatically after writing the source string.

Upload

If the /compiler/upload parameter is set to 1 the ELF file is automatically uploaded to the AWG after successful compilation. Otherwise, it must be uploaded by setting the in-out parameter .elf/upload to 1. A running AWG must be disabled first in order to upload a new sequencer program and it must be enabled again after upload.