User manual
Programmer’s Guide Page 20 of 64
long nbrPoints = ???; // Should be the ‘current’ number of points!
long timeStampLo, timeStampHi, nbrReturnedSamples;
double horPos, sampTime;
// Read the Waveform directly to the Background buffer
double bckGndWform[nbrPoints];
AcqrsD1_readRealWform(instrID, 1, 0, 0, nbrPoints, bckGndWform,
&nbrReturnedSamples, &horPos, &sampTime, &timeStampLo, &timeStampHi);
// Restore the settings of the averager
AcqrsD1_configVertical(instrID, 1, fsr, offset, coupl, bwidth);
AcqrsD1_configAvgConfig(instrID, channelNbr, "TrigResync", &reSync);
Use the following code fragment to acquire a ‘fixed pattern’ background, assuming that the external trigger can be
used and is already set:
const long channelNbr = 0;
double fsr, offset;
long coupl, bwidth, reSync, freeRun = 2;
AcqrsD1_acquire(instrID);
long timeOut = 1000; // depends on conditions!
AcqrsD1_waitForEndOfAcquisition(instrID, timeOut);
long nbrPoints = ???; // Should be the ‘current’ number of points!
long timeStampLo, timeStampHi, nbrReturnedSamples;
double horPos, sampTime;
// Read the Waveform directly to the Background buffer
double bckGndWform[nbrPoints];
AcqrsD1_readRealWform(instrID, 1, 0, 0, nbrPoints, bckGndWform,
&nbrReturnedSamples, &horPos, &sampTime, &timeStampLo, &timeStampHi);
The examples above assume that the background and the averaged waveforms are read in Volts. In this case, the
background data points are simply subtracted from the averaged waveform.
However, if you read the background and the averaged waveforms as 32-bit sums, with the function
long bckGndWform[nbrPoints]; // Background as 32-bit sum
AcqrsD1_readData(instrID, channel, &readParams, waveformArray, &wfDesc,
&segDesc);
you must correct the average as follows:
corrWform[i] = waveformArray[i] - bckGndWform[i] + 128*nbrAvgWforms;
The last term corrects for the fact that the 32-bit data are unipolar and that for display purposes the corrected
waveform should be in the middle of the vertical range if the averaged waveform is the same as the background.
3.4.4. Configuring Noise Suppressed Accumulation (NSA)
As discussed in the User Manual Family of Averagers the module can be configured to only accept data above a
fixed threshold and, if desired, to shift the data in that case. Since these two values are expressed in Volts and used as
ADC counts they have to be converted before use. The User Manual describes this transformation that depends on
whether Data Inversion has been enabled. The NSA threshold functionality must be enabled and a threshold defined.
If this has been done the NSA base subtraction can also be enabled and will be activated using the defined base
value. The order of the calls to AcqrsD1_configAvgConfig is not important since the final decision is taken when the
acquisition is started. However, the correct full scale should be selected with AcqrsD1_configVertical before setting
the NSA levels. Here is an example: