The Universal Driver function for performing a D/A conversion scan is dscDAConvertScan().
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.
... #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; ...
This page was last modified 00:51, 30 Jan 2004.
Copyright (c) 2004 Diamond Systems. All Rights Reserved.