User manual

PicoScope 6000 Series Programmer's Guide 31
Copyright © 2009-2013 Pico Technology Ltd. All rights reserved. ps6000pg.en r9
3.9.10
ps6000GetTimebase
PICO_STATUS ps6000GetTimebase
(
short handle,
unsigned long timebase,
unsigned long noSamples,
long * timeIntervalNanoseconds,
short oversample,
unsigned long * maxSamples
unsigned long segmentIndex
)
This function calculates the sampling rate and maximum number of samples for a
given timebase under the specified conditions. The result will depend on the number
of channels enabled by the last call to ps6000SetChannel.
This function is provided for use with programming languages that do not support the
float data type. The value returned in the timeIntervalNanoseconds argument
is restricted to integers. If your programming language supports the float type,
then we recommend that you use ps6000GetTimebase2 instead.
To use ps6000GetTimebase or ps6000GetTimebase2, first estimate the timebase
number that you require using the information in the timebase guide. Pass this
timebase to the GetTimebase function and check the returned
timeIntervalNanoseconds argument. If necessary, repeat until you obtain the
time interval that you need.
Applicability
All modes
Arguments
handle, the handle of the required device.
timebase, see timebase guide
noSamples, the number of samples required. This value is used to
calculate the most suitable time unit to use.
timeIntervalNanoseconds, on exit, the time interval between
readings at the selected timebase. Use NULL if not required.
oversample, the amount of oversample required.
Range: 0 to PS6000_MAX_OVERSAMPLE_8BIT.
maxSamples, on exit, the maximum number of samples available.
The result may vary depending on the number of channels enabled,
the timebase chosen and the oversample selected. Use NULL if not
required.
segmentIndex, the index of the memory segment to use.
Returns
PICO_OK
PICO_INVALID_HANDLE
PICO_TOO_MANY_SAMPLES
PICO_INVALID_CHANNEL
PICO_INVALID_TIMEBASE
PICO_INVALID_PARAMETER
PICO_SEGMENT_OUT_OF_RANGE
PICO_DRIVER_FUNCTION