libRBR
v1.2.3
RBR instrument communication API
|
Instrument commands and structures pertaining to instrument configuration information and calibration. More...
Go to the source code of this file.
Data Structures | |
struct | RBRInstrumentCalibration |
A channel calibration. More... | |
struct | RBRInstrumentChannelGain |
struct | RBRInstrumentChannel |
Details reported by the instrument channel command. More... | |
struct | RBRInstrumentChannels |
Details reported by a combination of the instrument channels , channel , and calibration commands. More... | |
struct | RBRInstrumentSensorParameter |
A sensor parameter. More... | |
Macros | |
#define | RBRINSTRUMENT_CALIBRATION_C_COEFFICIENT_MAX 24 |
The maximum number of C calibration coefficients. More... | |
#define | RBRINSTRUMENT_CALIBRATION_X_COEFFICIENT_MAX 8 |
The maximum number of X calibration coefficients. More... | |
#define | RBRINSTRUMENT_CALIBRATION_N_COEFFICIENT_MAX 8 |
The maximum number of input channel indices. More... | |
#define | RBRINSTRUMENT_VALUE_COEFFICIENT 0xFF |
An in-band representation of the special “value” calibration correction value. More... | |
#define | RBRINSTRUMENT_CALIBRATION_EQUATION_MAX 31 |
The maximum number of characters in a calibration equation name. More... | |
#define | RBRINSTRUMENT_CHANNEL_GAINS_MAX 8 |
The maximum number of gain settings for a channel. | |
#define | RBRINSTRUMENT_INPUT_TIMEOUT_MIN 10000 |
The minimum input timeout. | |
#define | RBRINSTRUMENT_INPUT_TIMEOUT_MAX 240000 |
The maximum input timeout. | |
#define | RBRINSTRUMENT_SENSOR_PARAMETER_KEY_MAX 63 |
The maximum number of characters in a sensor parameter key. More... | |
#define | RBRINSTRUMENT_SENSOR_PARAMETER_VALUE_MAX 63 |
The maximum number of characters in a sensor parameter value. More... | |
Typedefs | |
typedef uint8_t | RBRInstrumentChannelIndex |
A channel identifier. More... | |
typedef uint8_t | RBRInstrumentModuleAddress |
An internal module identifier. | |
typedef struct RBRInstrumentCalibration | RBRInstrumentCalibration |
A channel calibration. More... | |
typedef enum RBRInstrumentChannelRangingMode | RBRInstrumentChannelRangingMode |
Possible channel gain ranging modes. More... | |
typedef struct RBRInstrumentChannelGain | RBRInstrumentChannelGain |
typedef struct RBRInstrumentChannel | RBRInstrumentChannel |
Details reported by the instrument channel command. More... | |
typedef struct RBRInstrumentChannels | RBRInstrumentChannels |
Details reported by a combination of the instrument channels , channel , and calibration commands. More... | |
typedef enum RBRInstrumentValueSetting | RBRInstrumentValueSetting |
Value settings the instrument uses for calculation of derived channels, or as defaults for physical parameters the instrument does not measure. More... | |
typedef struct RBRInstrumentSensorParameter | RBRInstrumentSensorParameter |
A sensor parameter. More... | |
Enumerations | |
enum | RBRInstrumentChannelRangingMode { RBRINSTRUMENT_RANGING_NONE, RBRINSTRUMENT_RANGING_MANUAL, RBRINSTRUMENT_RANGING_AUTO, RBRINSTRUMENT_RANGING_COUNT, RBRINSTRUMENT_UNKNOWN_RANGING } |
Possible channel gain ranging modes. More... | |
enum | RBRInstrumentValueSetting { RBRINSTRUMENT_SETTING_SPECCONDTEMPCO, RBRINSTRUMENT_SETTING_ALTITUDE, RBRINSTRUMENT_SETTING_TEMPERATURE, RBRINSTRUMENT_SETTING_PRESSURE, RBRINSTRUMENT_SETTING_CONDUCTIVITY, RBRINSTRUMENT_SETTING_ATMOSPHERE, RBRINSTRUMENT_SETTING_DENSITY, RBRINSTRUMENT_SETTING_SALINITY, RBRINSTRUMENT_SETTING_AVGSOUNDSPEED, RBRINSTRUMENT_SETTING_COUNT, RBRINSTRUMENT_UNKNOWN_SETTING } |
Value settings the instrument uses for calculation of derived channels, or as defaults for physical parameters the instrument does not measure. More... | |
Instrument commands and structures pertaining to instrument configuration information and calibration.
#define RBRINSTRUMENT_CALIBRATION_C_COEFFICIENT_MAX 24 |
The maximum number of C calibration coefficients.
#define RBRINSTRUMENT_CALIBRATION_EQUATION_MAX 31 |
The maximum number of characters in a calibration equation name.
Does not include any null terminator.
#define RBRINSTRUMENT_CALIBRATION_N_COEFFICIENT_MAX 8 |
The maximum number of input channel indices.
#define RBRINSTRUMENT_CALIBRATION_X_COEFFICIENT_MAX 8 |
The maximum number of X calibration coefficients.
#define RBRINSTRUMENT_SENSOR_PARAMETER_KEY_MAX 63 |
The maximum number of characters in a sensor parameter key.
Does not include any null terminator.
#define RBRINSTRUMENT_SENSOR_PARAMETER_VALUE_MAX 63 |
The maximum number of characters in a sensor parameter value.
Does not include any null terminator.
#define RBRINSTRUMENT_VALUE_COEFFICIENT 0xFF |
An in-band representation of the special “value” calibration correction value.
typedef struct RBRInstrumentCalibration RBRInstrumentCalibration |
A channel calibration.
typedef struct RBRInstrumentChannel RBRInstrumentChannel |
Details reported by the instrument channel
command.
typedef struct RBRInstrumentChannelGain RBRInstrumentChannelGain |
Gain parameters for a channel.
typedef uint8_t RBRInstrumentChannelIndex |
A channel identifier.
Channel indices are always 1-based. A value of 0 means the index is unset or empty.
Possible channel gain ranging modes.
typedef struct RBRInstrumentChannels RBRInstrumentChannels |
Details reported by a combination of the instrument channels
, channel
, and calibration
commands.
typedef struct RBRInstrumentSensorParameter RBRInstrumentSensorParameter |
A sensor parameter.
typedef enum RBRInstrumentValueSetting RBRInstrumentValueSetting |
Value settings the instrument uses for calculation of derived channels, or as defaults for physical parameters the instrument does not measure.
See the command reference documentation for details on the use and default values for each of these parameters.
Possible channel gain ranging modes.
Value settings the instrument uses for calculation of derived channels, or as defaults for physical parameters the instrument does not measure.
See the command reference documentation for details on the use and default values for each of these parameters.
RBRInstrumentError RBRInstrument_getCastDetection | ( | RBRInstrument * | instrument, |
bool * | castDetection | ||
) |
Get whether cast detection is enabled.
The instrument can automatically detect upcasts and downcasts and generate cast detection events in the datastream.
[in] | instrument | the instrument connection |
[out] | castDetection | whether cast detection is enabled |
RBRInstrumentError RBRInstrument_getChannels | ( | RBRInstrument * | instrument, |
RBRInstrumentChannels * | channels | ||
) |
Get channel information for the instrument.
Channel information is composed from a combination of the channels
, channel
, and calibration
commands. The information returned by this function should comprise a complete model of an instrument's channels.
[in] | instrument | the instrument connection |
[out] | channels | the channel information |
RBRInstrumentError RBRInstrument_getFetchPowerOffDelay | ( | RBRInstrument * | instrument, |
RBRInstrumentPeriod * | fetchPowerOffDelay | ||
) |
Get the fetch power-off delay.
The fetch power-off delay delay in milliseconds between the successful completion of a fetch command and power to the front end sensors being removed by the instrument.
[in] | instrument | the instrument connection |
[out] | fetchPowerOffDelay | the fetch power-off delay |
RBRInstrumentError RBRInstrument_getInputTimeout | ( | RBRInstrument * | instrument, |
RBRInstrumentPeriod * | inputTimeout | ||
) |
Get the timeout for output suppression while receiving commands.
Specified in milliseconds. Must be between 10,000 and 240,000, inclusive; partial seconds are rounded up to the next whole second by the instrument.
[in] | instrument | the instrument connection |
[out] | inputTimeout | the timeout for output suppression |
RBRInstrumentError RBRInstrument_getSensorParameter | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelIndex | channel, | ||
RBRInstrumentSensorParameter * | parameter | ||
) |
Retrieve a single sensor parameter for a channel.
If the parameter is not configured, its value is set to “n/a”. This is the native behaviour of Logger3 instruments. However, at a hardware level, attempting to retrieve a nonexistent sensor parameter from a Logger2 instrument results in the error “E0501 item is not configured”. To simplify things for users, the library emulates the Logger3 behaviour for Logger2 instruments.
instrument | the instrument connection | |
[in] | channel | the index of the channel from which the parameter is to be retrieved |
[in,out] | parameter | initially, the sensor parameter to be retrieved; after return, the instrument response |
RBRInstrumentError RBRInstrument_getSensorParameters | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelIndex | channel, | ||
RBRInstrumentSensorParameter * | parameters, | ||
int32_t * | size | ||
) |
Retrieve the sensor parameters for a channel.
To ease memory requirements, sensor parameters are not included with other channel information retrieved by RBRInstrument_getChannels().
instrument | the instrument connection | |
[in] | channel | the index of the channel for which sensor parameters are to be retrieved |
[out] | parameters | the sensor parameters for the channel |
[in,out] | size | initially, the maximum number of elements which can be written to parameters; after return, the number of parameters actually written |
RBRInstrumentError RBRInstrument_getValueSetting | ( | RBRInstrument * | instrument, |
RBRInstrumentValueSetting | setting, | ||
float * | value | ||
) |
Read a value setting from the instrument.
[in] | instrument | the instrument connection |
[in] | setting | the setting to retrieve |
[out] | value | the value of the setting |
RBRInstrumentError RBRInstrument_isSensorPowerAlwaysOn | ( | RBRInstrument * | instrument, |
bool * | sensorPowerAlwaysOn | ||
) |
Get whether sensor power is always on.
The instrument does not have to power down front end sensors between samples. This can be useful for sensors with very long power-on stabilization times.
[in] | instrument | the instrument connection |
[out] | sensorPowerAlwaysOn | whether sensor power is always on |
RBRInstrumentError RBRInstrument_setCalibration | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelIndex | channel, | ||
const RBRInstrumentCalibration * | calibration | ||
) |
Update a channel's calibration coefficients.
Hardware errors may occur if:
If coefficients used by the channel are omitted from the set sent, then those coefficients will retain their current values. You can call RBRInstrument_getChannels() after updating coefficients to confirm the values written.
Values of in the n coefficient group (RBRInstrumentCalibration.n) are ignored.
[in] | instrument | the instrument connection |
[in] | channel | the index of the channel to update |
[in] | calibration | the new calibration coefficients for the channel |
RBRInstrumentError RBRInstrument_setCastDetection | ( | RBRInstrument * | instrument, |
bool | castDetection | ||
) |
Set whether cast detection is enabled.
A hardware error will occur if the instrument is logging.
[in] | instrument | the instrument connection |
[in] | castDetection | whether cast detection is enabled |
RBRInstrumentError RBRInstrument_setChannelGain | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelIndex | channel, | ||
RBRInstrumentChannelGain * | gain | ||
) |
Set the gain parameters of a channel.
RBRInstrumentChannelGain.rangingMode must be either RBRINSTRUMENT_RANGING_MANUAL or RBRINSTRUMENT_RANGING_AUTO. Otherwise, RBRINSTRUMENT_INVALID_PARAMETER_VALUE is returned.
For manual gain selection, the gain given by RBRInstrumentChannelGain.currentGain must be one of the available gains reported by the instrument. Otherwise, the instrument will produce a hardware error. If RBRInstrumentChannelGain.availableGains is populated (contains at least one leading non-NaN entry), this function will verify the presence of the chosen gain. If it is not found, RBRINSTRUMENT_INVALID_PARAMETER_VALUE is returned.
RBRInstrumentChannelGain.availableGains is only used for parameter verification. It is not sent to the instrument.
[in] | instrument | the instrument connection |
[in] | channel | the index of the channel to update |
[in] | gain | the gain parameters for the channel |
RBRInstrumentError RBRInstrument_setChannelStatus | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelIndex | channel, | ||
bool | status | ||
) |
Set the status of a channel.
[in] | instrument | the instrument connection |
[in] | channel | the index of the channel to update |
[in] | status | whether the channel is activated for sampling |
RBRInstrumentError RBRInstrument_setFetchPowerOffDelay | ( | RBRInstrument * | instrument, |
RBRInstrumentPeriod | fetchPowerOffDelay | ||
) |
Set the fetch power-off delay.
Hardware errors may occur if:
[in] | instrument | the instrument connection |
[in] | fetchPowerOffDelay | the fetch power-off delay |
RBRInstrumentError RBRInstrument_setInputTimeout | ( | RBRInstrument * | instrument, |
RBRInstrumentPeriod | inputTimeout | ||
) |
Set the timeout for output suppression while receiving commands.
Must be between 10,000 and 240,000, inclusive; partial seconds are rounded up to the next whole second.
A hardware error will occur if the instrument is logging.
[in] | instrument | the instrument connection |
[in] | inputTimeout | the timeout for output suppression |
RBRInstrumentError RBRInstrument_setSensorParameter | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelIndex | channel, | ||
RBRInstrumentSensorParameter * | parameter | ||
) |
Set a sensor parameter for a channel.
Hardware errors may occur if:
instrument | the instrument connection | |
[in] | channel | the index of the channel the sensor parameter of which is to be updated |
[in] | parameter | the sensor parameter for the channel |
RBRInstrumentError RBRInstrument_setSensorPowerAlwaysOn | ( | RBRInstrument * | instrument, |
bool | sensorPowerAlwaysOn | ||
) |
Set whether sensor power is always on.
A hardware error will occur if the instrument is logging.
[in] | instrument | the instrument connection |
[in] | sensorPowerAlwaysOn | whether sensor power is always on |
RBRInstrumentError RBRInstrument_setValueSetting | ( | RBRInstrument * | instrument, |
RBRInstrumentValueSetting | setting, | ||
float | value | ||
) |
Write the a value setting to the instrument.
A hardware error will occur if the instrument is logging.
[in] | instrument | the instrument connection |
[in] | setting | the setting to retrieve |
[in] | value | the value of the setting |
const char* RBRInstrumentChannelRangingMode_name | ( | RBRInstrumentChannelRangingMode | mode | ) |
Get a human-readable string name for a channel gain ranging mode.
[in] | mode | the ranging mode |
const char* RBRInstrumentValueSetting_name | ( | RBRInstrumentValueSetting | setting | ) |
Get a human-readable string name for an instrument value setting.
[in] | setting | the value setting |