user_define_bulk
Description
User defined data point loading.
Syntax
void user_define_bulk(UInt32* dataPoints, UInt32* controlWords, UInt32 numOfPoints)
Arguments
| dataPoints | Data points array |
| controlWords | Control words array |
| numOfPoints | Number of data points |
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 Words
The control word is comprised of 3 control bits each controlling one of the markers. Bit 0 (LSB) controls Marker 1, bit 1 (second LSB) controls Marker 2 and bit 2 (MSB) controls Marker 3. When a control bit is "0" the marker is inactive. When a control bit is "1" the marker is active. Here is a table showing the possible combinations of the control bit:
| Dec / Hex | Binary | Marker 3 | Marker 2 | Marker 1 |
| 0 / 0x0 | 000 | Inactive | Inactive | Inactive |
| 1 / 0x1 | 001 | Inactive | Inactive | Active |
| 2 / 0x2 | 010 | Inactive | Active | Inactive |
| 3 / 0x3 | 011 | Inactive | Active | Active |
| 4 / 0x4 | 100 | Active | Inactive | Inactive |
| 5 / 0x5 | 101 | Active | Inactive | Active |
| 6 / 0x6 | 110 | Active | Active | Inactive |
| 7 / 0x7 | 111 | Active | Active | Active |
Notes
This method will allow you to load an array representing data points into the AWG. Note that there are two overloaded methods. One version takes in two parameters: the array of data points and the number of data points. The other version takes in three parameters: the array of data points, the array of control words corresponding to each data point, and the number of data points.
Each data point represents an amplitude output from the high-speed DAC. The amplitude values that you can load range from 0 to 4,095 representing 12 bits. This is true even for the AWG801 which has 11 bits. You can think of the AWG801 as a 12-bit DAC but with only the 11 MSB bits functional. The array of data points is just the amplitudes that you want to output from the high-speed DAC at each time interval, the time interval being the period of the input clock for the AWG272, AWG452, and AWG472. The time interval for the AWG801 is half the period of the input.
The optional control words array controls marker output. You can refer to the table above to see which bit controls what marker. Each of the markers can be independently controlled and unlike the regular marker controls (marker1_start, marker1_width, marker2_start, marker2_width, marker3_start, marker3_width) the marker used in the user defined methods can be active multiple times in one waveform. When you pass in the control words array into the method, the AWG will ignore the regular marker controls. If you do not pass in the control words array, then you will need to set the regular marker controls.
The number of data points is self explanatory. If you wanted a waveform with 8,192 data points then this is what you would pass into the method. Please note that you will also need to set the data_length property to match with the number of data points.
Please note that you will still need to use the download method to download all the data you passed into the user_define_bulk method into the AWG. Also, after passing in all the data to the user_define_bulk method, it is a good idea to delete the arrays if you happen to use unmanaged data.