Links

3.5 Performing a DA Conversion Scan

Description

A D/A scan conversion is similar to a D/A conversion except that it performs several conversions on a multiple, specified output channels with each function call.
The Universal Driver function for performing a D/A conversion scan is dscDAConvertScan.

Step-By-Step Instructions

Create and initialize an array of D/A scan conversion settings structures (DSCDACS).
Call dscDAConvertScan() and pass it a pointer to your scan structure array - this will generate a D/A conversion for each channel you set to enable.
NOTE: You must remember to initialize enough entries in your DSCDACS array to cover the number of conversions to be performed. If you do not, you will experience segmentation faults and invalid page faults.

Example of Usage for D/A Conversion Scan

...
#define NUM_DA_CHANNELS 4 DSCB dscb;
DSCDACS dscdacs; int i;
...
/* Step 1 */
dscdacs.output_codes = (DSCDACODE*)malloc(sizeof(DSCDACODE) * NUM_DA_CHANNELS);
for (i = 0; i < NUM_DA_CHANNELS; i++)
{
dscdacs.channel_enable[i] = TRUE;
dscdacs.output_codes[i] = 4095;
}
/* Step 2 */
if ((result = dscDAConvertScan(dscb, &dscdacs)) != DE_NONE)
return result;
...