TMS International BV |
SetSignalBuffer
BOOLEAN SetSignalBuffer(
IN HANDLE Handle,
IN OUT PULONG SampleRate,
IN OUT PULONG BufferSize
);
Parameters
Handle
Handle of the library
SampleRate
The SampleRate argument is a pointer to an unsigned
long.
Before calling this function this location must be filled with required
sample
rate. If the hardware can not match the required sample rate, it will
be set to
the first available sample rate below the requested sample rate. The
location used for the input sample
rate is then overwritten by this function with the sample rate that is
actually
set. The sample rate used in this function is defined in milliHertz. So
to set a
sample rate of 1Hz use 1000 as input value.
BufferSize
This
parameter is used to set the buffer size which the application is going
to use in the GetSamples function. This size is not defined in
bytes but
as the amount of samples that can be stored. A sample in this case is
one
conversion result for all input channels. If this value is set to 100
and the
sample rate of the device is 100Hz, 1 second of conversion results can
be
stored.
Return Value
If successful this function returns TRUE, else FALSE. If the function return FALSE, use GetErrorCode to get the error code.
Comments
To find out what the maximal sample rate and maximal buffer size is,
call SetSignalBuffer with value 0xFFFFFFFF for both parameters. After
return, the parameters will contain the maximal sample rate of the connected device.
Before starting a measurement (by calling Start) call this function
to set the sample rate and buffer size.
The minimum required buffer size is at least 16
samples, and can be higher based on the given sample rate. The
GetSamples() function should be called at least 16 times
per
second.
Also see