Functions > di_buffer_size

Syntax 

The di_buffer_size function returns the size of the input buffer as an unsigned integer.

Syntax 

unsigned di_buffer_size(void);

Parameters

none

Return Value

The di_buffer_size function returns an unsigned integer equal to the size of the input buffer.

Dependencies

none

Remarks

This function is used to get the size of the input buffer when the buffer is allocated by WinDaq software. The size of the buffer is needed to determine the proper index for use with the di_copy_buffer function.

Sample Code

buffer_size = di_buffer_size()

'get size of buffer

buffer_pointer = di_buffer_status(0) - 100

'get the last 100 data points

If buffer_pointer < 0 Then

'check for wrap around

buffer_pointer = buffer_size + buffer_pointer

'adjust pointer if wrap around

End If

i% = di_copy_buffer(buffer_pointer, inbuffer(0), 100)

'copy buffer to user array

 

Copyright © DATAQ Instruments, Inc.