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 modulesetString()
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.
Node Documentation¶
This section describes all the nodes in the AWG Module node tree organized by branch.
awg¶
/awg/enable ¶
Properties: | Read, Write |
Type: | Integer (64 bit) |
Unit: | None |
Start the AWG sequencers. In MDS mode, this will enable all devices in the correct order.
compiler¶
/compiler/sourcefile ¶
Properties: | Read, Write |
Type: | String |
Unit: | None |
The filename of an AWG sequencer program file to compile and load. The file must be located in the "awg/src" sub-directory of the LabOne user directory. This directory path is provided by the value of the read-only directory parameter.
/compiler/sourcestring ¶
Properties: | Read, Write |
Type: | String |
Unit: | None |
A string containing an AWG sequencer program may directly loaded to this parameter using the module command setString. This allows compilation and upload of a sequencer program without saving it to a file first. Compilation starts automatically after compiler/sourcestring has been set.
/compiler/start ¶
Properties: | Read, Write |
Type: | Integer (64 bit) |
Unit: | None |
Set to 1 to start compiling the AWG sequencer program specified by compiler/ sourcefile. The module sets compiler/ start to 0 once compilation has successfully completed (or failed). If compiler/upload is enabled then the sequencer program will additionally be uploaded to the AWG upon after successful compilation.
/compiler/status ¶
Properties: | Read |
Type: | Integer (enumerated) |
Unit: | None |
Compilation status
Value | Description |
---|---|
-1 | Idle. |
0 | Compilation successful. |
1 | Compilation failed. |
2 | Compilation completed with warnings. |
/compiler/upload ¶
Properties: | Read, Write |
Type: | Integer (64 bit) |
Unit: | None |
Specify whether the sequencer program should be automatically uploaded to the AWG following successful compilation.
/compiler/waveforms ¶
Properties: | Read, Write |
Type: | String |
Unit: | None |
A comma-separated list of waveform CSV files to be used by the AWG sequencer program.
device¶
/device ¶
Properties: | Read, Write |
Type: | String |
Unit: | None |
The target device for AWG sequencer programs upload, e.g. 'dev1000'.
directory¶
/directory ¶
Properties: | Read, Write |
Type: | String |
Unit: | None |
The path of the LabOne user directory. The AWG Module uses the following subdirectories in the LabOne web server directory: "awg/src": Contains AWG sequencer program source files (user created); "awg/elf": Contains compiled AWG binary (ELF) files (created by the module); "awg/waves": Contains CSV waveform files (user created).
elf¶
/elf/checksum ¶
Properties: | Read |
Type: | Integer (64 bit) |
Unit: | None |
The checksum of the generated ELF file.
/elf/file ¶
Properties: | Read, Write |
Type: | String |
Unit: | None |
The filename of the compiled binary ELF file. If not set, the name is automatically set based on the source filename. The ELF file will be saved by the AWG Module in the "awg/elf" sub-directory of the LabOne user directory. This directory path is provided by the value of the read-only directory parameter.
/elf/status ¶
Properties: | Read |
Type: | Integer (enumerated) |
Unit: | None |
Status of the ELF file upload.
Value | Description |
---|---|
-1 | Idle. |
0 | Upload successful. |
1 | Upload failed. |
2 | Upload in progress. |
/elf/upload ¶
Properties: | Read, Write |
Type: | Integer (64 bit) |
Unit: | None |
Set to 1 to start uploading the AWG sequencer program to the device. The module sets elf/upload to 0 once the upload has finished.
index¶
/index ¶
Properties: | Read, Write |
Type: | Integer (64 bit) |
Unit: | None |
The index of the current AWG Module to use when running with multiple AWG groups. See section on channel grouping in the manual for further explanation.
mds¶
/mds/group ¶
Properties: | Read, Write |
Type: | Integer (64 bit) |
Unit: | None |
The MDS group (multiDeviceSyncModule/group) to use for synchronized AWG playback.
progress¶
/progress ¶
Properties: | Read |
Type: | Double |
Unit: | None |
Reports the progress of the upload as a value between 0 and 1.
sequencertype¶
/sequencertype ¶
Properties: | Read, Write |
Type: | Integer (enumerated) |
Unit: | None |
Type of sequencer to compile for. For all devices but the SHFQC, the sequencer type is deduced from the device type, and this node is ignored. For the SHFQC, the sequencer type must be defined ("qa" or "sg").
Value | Description |
---|---|
0 | "auto-detect": The sequencer type is deduced from the device type (for all devices but the SHFQC). |
1 | "qa": QA sequencer |
2 | "sg": SG sequencer |