User manual
Programmer’s Guide Page 33 of 64
automatically switches the banks, starts a
new acquisition, a new processing and clears
the AutoSwitch semaphore.
4 Once
the software receives the
ProcessingEnd interrupt, it can start the
readout.
status = AcqrsD1_waitForEndOfProcessing(instrID,
timeout);
AcqrsD1_readData
(instrID, channel, &readParams,
waveformArray, &wfDesc, &segDesc);
Go to 2 to continue.
Here is a sample bit of code showing this principle:
status=AcqrsD1_acquire(instrID); // Start the acquisition
processType = 0;
for (;;) //loop forever
{
status=AcqrsD1_processData(instrID, processType, 1);
status=AcqrsD1_waitForEndOfProcessing(instrID, timeout);
status=AcqrsD1_readData(instrID, channel, &readPar, &adcArray,
&dataDesc, &segDesc);
}
To keep the same interface for the AP240 as was the case for the AP101/AP201, the processing step is kept but the
“dummy” processing value is used. Actually the software knows which processing is needed from the setup values
sent to AcqrsD1_configAvgConfig. Thus, the software must wait for the end of processing even if the “processing
mode” is set to NO_PROCESSING.
3.10.6.2. What happens when the AutoSwitch semaphore is not set
After the "processing" of an acquisition, if the semaphore is not set, the FPGA waits for further instructions. This
feature ensures that the software has finished with the old buffer and gives full compatibility with older software
implementations. If you make a call to AcqrsD1_stopAcquisition you shouldn't try to read the last acquisition's
data.
3.10.6.3. Changing acquisition settings while acquiring and reading events
If you want to change any of the acquisition settings you must
o terminate the current acquisition sequence
AcqrsD1_processData(instrID, processType, 2); // do a bank switch but do not
start
status = AcqrsD1_waitForEndOfProcessing(instrID, timeout); // usual wait
// finish reading the data associated with the old settings
AcqrsD1_readData(instrID, channel, &readParams, waveformArray, &wfDesc,
&segDesc);
o configure the instrument for the new values and start the new set of acquisitions
// go back to step 0 in the table above
AcqrsD1_configAvgConfig(…); …
AcqrsD1_acquire(instrID); …