![]() |
|
The di_buffer_free
function de-allocates the memory block set by di_buffer_alloc
.
int di_buffer_free(chn); |
|
unsigned chn; |
/* specifies whether to de-allocate the input buffer (0) or output buffer (1)*/ |
0 = input
1 = output
Note: Output functions are not available on all instruments. Check your hardware manual for output specifications.
The least significant bit of chn
is the only bit checked to determine input or output. No bit is checked where output functions are not available.
DI_NO_ERR | No error |
none
#include "200sdk.h" |
|
int *input_buffer; |
|
int *output_buffer; |
|
main() |
|
{ |
|
di_open (); |
|
if((input_buffer = di_buffer_alloc(0,4096)) == NULL) |
/* allocate input buffer */ |
printf("Insufficient memory or input buffer already allocated...\n"); |
|
if((output_buffer = di_buffer_alloc(1,4096)) == NULL) |
/* allocate input buffer */ |
printf("Insufficient memory or output buffer already allocated...\n"); |
|
di_buffer_free(0); |
/* free input buffer */ |
di_buffer_free(1); |
/* free output buffer */ |
di_close (); |
|
} |
Copyright © DATAQ Instruments, Inc.