Common_API -
arm
ck_fe_reset
download
flush
ini
memory_clock_toggle
restart
signature_ini
stop
USB_Reconnect
user_define_bulk
user_define_file
arm
Description
Arms AWG board in Master mode.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.arm();
Notes
This function only arms the board in Master mode. It will not arm the board in Slave mode. To arm the board in Slave mode, use the slave_mode property.
ck_fe_reset
Description
Resets Front-End Clock.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.ck_fe_reset();
Notes
This function resets the front-end clock inside the module. You must reset the clock any time you set or change the frequency.
download
Description
Downloads the waveform parameters to the module.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.download();
Notes
This function downloads the waveform parameters to the module. It is necessary to download the parameters whether you use built-in waveforms or if you use the user_define_bulk or the user_define_file functions.
flush
Description
Resets memory to starting memory address.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.flush();
Notes
It is a good idea to reset the memory after you stop it. This method and the memory stop method, stop, should usually be used together.
ini
Description
Initializes the AWG board.
Syntax
Arguments
| series_number | Series Number of the AWG board |
Return Value
None
Example
int seriesNumber = ug.get_sn(0);
awg.ini(seriesNumber);
Notes
Please use the get_sn method to get the Series Number.
When you call the ini function, some of the member properties will be initialized to their default values. To see these default values, please see the Properties section main page.
memory_clock_toggle
Description
Toggles memory clock high or low.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.memory_clock_toggle();
Notes
When memory clock is high, this function will set it low; if memory clock is low, this function will set it high.
restart
Description
Starts memory.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.restart();
Notes
When in Master or Slave mode, do not use this method to start the memory. Instead use the arm method to arm the Master mode AWG or the slave_mode property to arm the Slave mode AWG. After arming, the boards will wait for the trigger or SYNCI signal before starting the memory.
signature_ini
Description
Initializes signature settings for the module.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.signature_ini();
Notes
This function must be called before you download the waveform parameters to the
module. It will use the data in the signature file for your module.
You must ensure there is a copy of the signature file for the module you are using
in the same directory as your executable code. The signature filename should resemble
AWG_452_SGN_xxx.dat, where xxx is the board series number and AWG_452 is the Euvis
part number of your module.
stop
Description
Stops the AWG memory.
Syntax
Arguments
| None |
Return Value
| None |
Example
awg.stop();
Notes
It is a good idea to reset the memory after you stop it. This method and the memory reset method, flush, should usually be used together.
USB_Reconnect
Description
Reconnects to USB after a disconnect between the computer and the AWG
Syntax
Arguments
None
Return Value
None
Example
awg.USB_Reconnect();
Notes
You can use this method to reconnect to the module if you accidentally disconnect the USB cable or if the power to the module were unexpectedly interrupted.
user_define_bulk
Description
Waveform output with bulk memory.
Syntax
void user_define_bulk(UInt32* bulkMemory, UInt32* controlMemory, UInt32 numOfPoints)
Arguments
| bulkMemory | Bulk memory that will be used for the waveform |
| controlMemory | Control bit words for each value |
| numOfPoints | Number of values in the waveform |
Return Value
None
Example
int i;
unsigned *u = new unsigned[16];
unsigned *c = new unsigned[16];
const unsigned AMP_START = 0x80;
const unsigned AMP_STEP = 0x10;
for( i=1, u[0]=AMP_START; i<16; i++ )
{
if ( i <= 4 )
{
c[i] = 7;
u[i] = AMP_START;
continue;
}
u[i]=u[i-1]+AMP_STEP;
}
awg.user_define_bulk( u, c, 16 );
delete u;
delete c;
Control Bit Words
The control bit words are basically three control bits that represent the markers. Bits 0,1,2 (LSB) control whether markers 1, 2, and 3 are high or low. For each marker bit, "0" turns marker low while "1" turns marker high.
Notes
The user_define_bulk method will essentially output the data words that are stored in an array. The first method with two arguments will output the data words in the bulk memory array. The overloaded method with three arguments will output the data words and marker control bits in the bulk memory array.
Each of the three markers is independent and can occur multiple times in any pattern you wish. However, you must use overloaded user_define_bulk method with three arguments to set the marker control bits if you wish to have any of the markers occur multiple times. For instance, for a waveform with 10,000 points, you would have the option of setting each marker high more than once, such as for points 2000 through 3000 and then points 7446 through 8564 for marker 1. The same goes for each marker.
If you are using the user_define_bulk method with two arguments then you must set the marker properties (marker1_start, marker1_width, marker2_start, marker2_width, marker3_start, and marker3_width) separately. Those properties only allow you to set a single range of points for each marker.
If you are using the overloaded user_define_bulk method with three arguments, the marker1_start, marker1_width, marker2_start, marker2_width, marker3_start, and marker3_width properties will be ignored and you must specify markers using the control array. The default setting if you do not specify a control bit word in the control array is with each marker low.
When you call the user_define_bulk method, you still need to set the properties such as the memory depth, data length, and the user bulk waveform style code (256). The program will not automatically download the data to the AWG, so you still must use the download method. Please see an example of using the user_define_bulk method.
user_define_file
Description
Loads custom user waveform files
Syntax
Arguments
| filename | file name of custom user file |
| clock | frequency of the input clock |
Return Value
| numOfPoints | number of frequencies in user waveform file |
Example
unsigned numOfPoints;
Double clock = 2e9;
numOfPoints = awg.user_define_file("user_defined_file.uda", clock);
Notes
The user_define_file will use the contents of an external .uda file, provided that the file is formatted the correct way. The file gives you complete control of the waveform data. User defined waveforms are not limited to linear waveforms that are available in the built-in waveforms.
If you are using the user_define_file method and specify
either #Type "1" or "2," then you must set the
marker1_start,
marker1_width,
marker2_start,
marker2_width,
marker3_start, and
marker3_width properties in order
to get the correct markers.
If you are using the user_define_file method and specify either
#Type "5" or "6", the
marker1_start, marker1_width
marker2_start, marker2_width
marker3_start, and marker3_width
properties will be ignored, and you must specify markers with the control bit words within the .uda file.
For more information regarding the .uda file and how to format it, please see the AWG Manual.