Buffer handler functions, Al_clearbufferdoneflag – Measurement Computing ADLIB WIN User Manual
Page 121

Chapter 40 Buffer Handler Functions
27-1
27. BUFFER HANDLER FUNCTIONS
Buffer Handler functions provide the means to retrieve and output data a device. Different methods are
used depending on the programming requirements of each application. See the example programs
ADLAI01 to ADLAI02 for AtoD support and ADLDA02 for DtoA support.
For Continuous AtoD applications there may be 10 buffers, each containing 1000 samples of data. The
drive fills each buffer and either notifies the user through a Message Handler of CALLBACK function.
Within the Message Handler of CALLBACK function the user then checks for errors in the buffer
structure, retrieves the data and acknowledges the buffer completion back to ADLIB.
For SingleCycle applications The buffers are handled just like the Continuous mode described above,
except the driver stops collecting data when all buffers are completed.
27.1 AL_ClearBufferDoneFlag
Prototype
C\C++
ERRNUM
AL_ClearBufferDoneFlag(LHLD lhld, long lBuffNum);
Visual
Basic
for
Windows
Function
AL_ClearBufferDoneFlag(ByVal
lhld As Long,
ByVal lBuffNum As Long) As Long
LHLD lhld
handle of the LDSD
long lBuffNum
specifies the buffer
The AL_ClearBufferDoneFlag function informs the ADLIB LDSD that the buffer is available for use.
All buffers are flagged as done when filled and it’s the user applications' responsibility to inform the LDSD
that the buffer is once again available. This function is therefor required when the LDSD cycle mode is set
to AL_CONTINUOUS_CYCLE, otherwise LDSD will generate an error when it attempts to reuse a buffer
that has not been released back to the LDSD. Setting lBuffNum to INIT_ALL_BUFFERS will reinitialize
all buffers for the specified LDSD, this is most usefull in the AL_SINGLE_CYCLE mode when all buffers
have been completed.
Parameter
Description
lhld
Identifies the instance of the logical device subsystem.
lBuffNum
Specifies the buffer ID number to be released back to the LDSD.
Returns:
On success ERRNUM is set to 1, otherwise ERRNUM contains the last error code that occurred during the
call.
Related Functions:
AL_GetDoneBuffPtr
AL_GetBuffPtr
AL_CopyBuffer
Supported Logical Device Subsystems:
Pci55xx Series: ADC0, DAC0, DAC1