libRBR  v1.2.3
RBR instrument communication API
Functions
RBRInstrumentFetching.h File Reference

Instrument commands and structures pertaining to on-demand data acquisition. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

RBRInstrumentError RBRInstrument_fetch (RBRInstrument *instrument, RBRInstrumentLabelsList *channels, bool sleepAfter, RBRInstrumentSample *sample)
 Requests an “on-demand” sample set from the logger. More...
 

Detailed Description

Instrument commands and structures pertaining to on-demand data acquisition.

See also
https://docs.rbr-global.com/L3commandreference/commands/data-sample

Function Documentation

◆ RBRInstrument_fetch()

RBRInstrumentError RBRInstrument_fetch ( RBRInstrument instrument,
RBRInstrumentLabelsList channels,
bool  sleepAfter,
RBRInstrumentSample sample 
)

Requests an “on-demand” sample set from the logger.

Unlike streaming data/RBRInstrument_readSample(), fetched data is returned directly to the caller (independent of any RBRInstrumentSampleCallback defined in RBRInstrumentCallbacks.sample).

Because fetched samples are indistinguishable from streamed samples, this function may return a streamed sample, not a fetched sample, if the instrument is logging, streaming is enabled for the link over which the library is communicating with the instrument, and a streamed sample is produced by the instrument before the response to the fetch command.

For Logger3 instruments, the channels argument can be used to control which channels are fetched. This can be useful to limit the use of power-hungry sensors. If channels is not given as NULL, then readings will be requested from channels corresponding to the first RBRInstrumentLabelsList.count labels from the list. Otherwise, and for Logger2 instruments, readings will be fetched from all enabled channels.

Parameters
[in]instrumentthe instrument connection
[in]channelsthe list of channels to be acquired (may be NULL)
[in]sleepAfterwhether the instrument should sleep after fetching
[in,out]samplethe fetched sample
Returns
RBRINSTRUMENT_SUCCESS when a sample is successfully read
RBRINSTRUMENT_TIMEOUT when a timeout occurs
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
RBRINSTRUMENT_HARDWARE_ERROR when an invalid channel is requested
See also
https://docs.rbr-global.com/L3commandreference/commands/data-sample/fetch