3.4. 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

... 

DSCUD_Class DSCUD_class = new DSCUD_Library.DSCUD_Class();
DSCDACS dscdacs= new DSCDACS(); // structure containing DA conversion settings

int NUM_DA_CHANNELS = 4 
int i; 

...

/* Step 1 */ 

dscdacs.channel_enable = new int[16];   //Allocate memory for int channel_enable array
dscdacs.DACode = new uint[4];           //Allocate memory for uint DACode array

for (i = 0; i < NUM_DA_CHANNELS; i++) 
{ 
 dscdacs.channel_enable[i] = TRUE; 
 dscdacs.output_codes[i] = 4095; 
} 

/* Step 2 */ 

if ((result = DSCUD_Library.DSCUD_Class.dscDAConvertScan(DSCUD_class.dscb,ref dscdacs)) != DSCUD_class.DE_NONE) 
return result; 

...

Last updated