ABS SCPI Driver 0.2.0
ABS SCPI driver library
|
Generic SCPI client for communicating with the Bloomy Controls ABS. More...
#include <ScpiClient.h>
Generic SCPI client for communicating with the Bloomy Controls ABS.
This class implements all the SCPI commands and queries, as well as parsing and returning the results. It works with any CommDriver.
Example usage (error handling omitted):
Public Member Functions | |
ScpiClient () noexcept | |
Default CTOR. | |
ScpiClient (std::shared_ptr< drivers::CommDriver > driver) noexcept | |
Initialize a ScpiClient with a driver handle. | |
ScpiClient (ScpiClient &&other) noexcept | |
Move construct from another ScpiClient. | |
ScpiClient (const ScpiClient &)=delete | |
ScpiClient & | operator= (ScpiClient &&rhs) noexcept |
Move assign from another ScpiClient. | |
ScpiClient & | operator= (const ScpiClient &)=delete |
~ScpiClient ()=default | |
DTOR. | |
std::shared_ptr< drivers::CommDriver > | GetDriver () noexcept |
std::shared_ptr< const drivers::CommDriver > | GetDriver () const noexcept |
void | SetDriver (std::shared_ptr< drivers::CommDriver > driver) noexcept |
Set or replace the comm driver for the client. | |
unsigned int | SetReadTimeout (unsigned int timeout_ms) noexcept |
Set the read timeout for the client. | |
ErrorCode | SetTargetDeviceID (unsigned int id) |
Change the targeted device ID. | |
Result< unsigned int > | GetTargetDeviceID () const |
System Control | |
Result< DeviceInfo > | GetDeviceInfo () const |
Query general information about the unit. | |
Result< std::uint8_t > | GetDeviceId () const |
Query the device's serial ID. | |
Result< EthernetConfig > | GetIPAddress () const |
Query the device's IP address and subnet mask. | |
ErrorCode | SetIPAddress (std::string_view ip, std::string_view netmask) const |
Set the device's IP address and subnet mask. | |
Result< std::string > | GetCalibrationDate () const |
Query the device's calibration date. | |
Result< int > | GetErrorCount () const |
Query the number of errors in the device's error queue. | |
Result< ScpiError > | GetNextError () const |
Pop the next error from the SCPI error queue. | |
ErrorCode | ClearErrors () const |
Clear the device's error queue. | |
Result< std::uint32_t > | GetAlarms () const |
Get the alarms raised on the unit. | |
Result< bool > | GetInterlockState () const |
Get the system interlock state. | |
ErrorCode | AssertSoftwareInterlock () const |
Assert the software interlock. | |
ErrorCode | ClearRecoverableAlarms () const |
Clear any recoverable alarms currently raised on the unit. | |
ErrorCode | Reboot () const |
Reboot the unit. | |
Cell Control | |
ErrorCode | EnableCell (unsigned int cell, bool en) const |
Enable or disable a single cell. | |
ErrorCode | EnableCellsMasked (unsigned int cells, bool en) const |
Enable or disable multiple cells using a bitmask. | |
Result< bool > | GetCellEnabled (unsigned int cell) const |
Query the enable state of a cell. | |
Result< std::array< bool, kCellCount > > | GetAllCellsEnabled () const |
Query the enable states of all cells. | |
Result< unsigned int > | GetAllCellsEnabledMasked () const |
Query the enable states of all cells as a bitmask. | |
ErrorCode | SetCellVoltage (unsigned int cell, float voltage) const |
Set a single cell's target voltage. | |
ErrorCode | SetAllCellVoltages (float voltage) const |
Set all cells' voltages to the same value. | |
ErrorCode | SetAllCellVoltages (const float *voltages, std::size_t count) const |
Set all cells' voltages. | |
ErrorCode | SetAllCellVoltages (std::span< const float > voltages) const |
Set all cells' voltages. | |
ErrorCode | SetAllCellVoltages (const std::array< float, kCellCount > &voltages) const |
Set all cells' voltages. | |
ErrorCode | SetMultipleCellVoltages (unsigned int cells, float voltage) const |
Set multiple cells' voltages to the same value. | |
Result< float > | GetCellVoltageTarget (unsigned int cell) const |
Query a single cell's voltage set point. | |
Result< std::array< float, kCellCount > > | GetAllCellVoltageTargets () const |
Query all cells' voltage set points. | |
ErrorCode | GetAllCellVoltageTargets (float *voltages, std::size_t count) const |
Query all cells' voltage set points. | |
ErrorCode | GetAllCellVoltageTargets (std::array< float, kCellCount > &voltages) const |
Query all cells' voltage set points. | |
ErrorCode | GetAllCellVoltageTargets (std::span< float > voltages) const |
Query all cells' voltage set points. | |
ErrorCode | SetCellSourcing (unsigned int cell, float limit) const |
Set a single cell's sourcing current limit. | |
ErrorCode | SetAllCellSourcing (float limit) const |
Set all cells' sourcing current limits to the same value. | |
ErrorCode | SetAllCellSourcing (const float *limits, std::size_t count) const |
Set all cells' sourcing current limits. | |
ErrorCode | SetAllCellSourcing (std::span< const float > limits) const |
Set all cells' sourcing current limits. | |
ErrorCode | SetAllCellSourcing (const std::array< float, kCellCount > &limits) const |
Set all cells' sourcing current limits. | |
ErrorCode | SetMultipleCellSourcing (unsigned int cells, float limit) const |
Set multiple cells' sourcing current limits to the same value. | |
Result< float > | GetCellSourcingLimit (unsigned int cell) const |
Query a single cell's sourcing current limit. | |
Result< std::array< float, kCellCount > > | GetAllCellSourcingLimits () const |
Query all cells' sourcing current limits. | |
ErrorCode | GetAllCellSourcingLimits (float *limits, std::size_t count) const |
Query all cells' sourcing current limits. | |
ErrorCode | GetAllCellSourcingLimits (std::array< float, kCellCount > &limits) const |
Query all cells' sourcing current limits. | |
ErrorCode | GetAllCellSourcingLimits (std::span< float > limits) const |
Query all cells' sourcing current limits. | |
ErrorCode | SetCellSinking (unsigned int cell, float limit) const |
Set a single cell's sinking current limit. | |
ErrorCode | SetAllCellSinking (float limit) const |
Set all cells' sinking current limits to the same value. | |
ErrorCode | SetAllCellSinking (const float *limits, std::size_t count) const |
Set all cells' sinking current limits. | |
ErrorCode | SetAllCellSinking (std::span< const float > limits) const |
Set all cells' sinking current limits. | |
ErrorCode | SetAllCellSinking (const std::array< float, kCellCount > &limits) const |
Set all cells' sinking current limits. | |
ErrorCode | SetMultipleCellSinking (unsigned int cells, float limit) const |
Set multiple cells' sinking current limits to the same value. | |
Result< float > | GetCellSinkingLimit (unsigned int cell) const |
Query a single cell's sinking current limit. | |
Result< std::array< float, kCellCount > > | GetAllCellSinkingLimits () const |
Query all cells' sinking current limits. | |
ErrorCode | GetAllCellSinkingLimits (float *limits, std::size_t count) const |
Query all cells' sinking current limits. | |
ErrorCode | GetAllCellSinkingLimits (std::array< float, kCellCount > &limits) const |
Query all cells' sinking current limits. | |
ErrorCode | GetAllCellSinkingLimits (std::span< float > limits) const |
Query all cells' sinking current limits. | |
ErrorCode | SetCellFault (unsigned int cell, CellFault fault) const |
Set a single cell's faulting state. | |
ErrorCode | SetAllCellFaults (CellFault fault) const |
Set all cells' faulting states to the same value. | |
ErrorCode | SetAllCellFaults (const CellFault *faults, std::size_t count) const |
Set all cells' faulting states. | |
ErrorCode | SetAllCellFaults (std::span< const CellFault > faults) const |
Set all cells' faulting states. | |
ErrorCode | SetAllCellFaults (const std::array< CellFault, kCellCount > &faults) const |
Set all cells' faulting states. | |
ErrorCode | SetMultipleCellFaults (unsigned int cells, CellFault fault) const |
Set multiple cells to the same fault state. | |
Result< CellFault > | GetCellFault (unsigned int cell) const |
Query a single cell's faulting state. | |
Result< std::array< CellFault, kCellCount > > | GetAllCellFaults () const |
Query all cells' faulting states. | |
ErrorCode | GetAllCellFaults (CellFault *faults, std::size_t count) const |
Query all cells' faulting states. | |
ErrorCode | GetAllCellFaults (std::array< CellFault, kCellCount > &faults) const |
Query all cells' faulting states. | |
ErrorCode | GetAllCellFaults (std::span< CellFault > faults) const |
Query all cells' faulting states. | |
ErrorCode | SetCellSenseRange (unsigned int cell, CellSenseRange range) const |
Set a single cell's current sense range. | |
ErrorCode | SetAllCellSenseRanges (CellSenseRange range) const |
Set all cells' current sense ranges to the same value. | |
ErrorCode | SetAllCellSenseRanges (const CellSenseRange *ranges, std::size_t count) const |
Set all cells' current sense ranges. | |
ErrorCode | SetAllCellSenseRanges (std::span< const CellSenseRange > ranges) const |
Set all cells' current sense ranges. | |
ErrorCode | SetAllCellSenseRanges (const std::array< CellSenseRange, kCellCount > &ranges) const |
Set all cells' current sense ranges. | |
Result< CellSenseRange > | GetCellSenseRange (unsigned int cell) const |
Query a single cell's current sense range. | |
Result< std::array< CellSenseRange, kCellCount > > | GetAllCellSenseRanges () const |
Query all cells' current sense ranges. | |
ErrorCode | GetAllCellSenseRanges (CellSenseRange *ranges, std::size_t count) const |
Query all cells' current sense ranges. | |
ErrorCode | GetAllCellSenseRanges (std::array< CellSenseRange, kCellCount > &ranges) const |
Query all cells' current sense ranges. | |
ErrorCode | GetAllCellSenseRanges (std::span< CellSenseRange > ranges) const |
Query all cells' current sense ranges. | |
ErrorCode | EnableCellNoiseFilter (bool en) const |
Enable or disable the cell 50/60Hz noise filter. | |
Result< bool > | GetCellNoiseFilterEnabled () const |
Query the state of the cell noise filter. | |
Result< float > | MeasureCellVoltage (unsigned int cell) const |
Measure a single cell's voltage. | |
Result< std::array< float, kCellCount > > | MeasureAllCellVoltages () const |
Measure all cells' voltages. | |
ErrorCode | MeasureAllCellVoltages (float *voltages, std::size_t count) const |
Measure all cells' voltages. | |
ErrorCode | MeasureAllCellVoltages (std::array< float, kCellCount > &voltages) const |
Measure all cells' voltages. | |
ErrorCode | MeasureAllCellVoltages (std::span< float > voltages) const |
Measure all cells' voltages. | |
Result< float > | MeasureCellCurrent (unsigned int cell) const |
Measure a single cell's current. | |
Result< std::array< float, kCellCount > > | MeasureAllCellCurrents () const |
Measure all cells' currents. | |
ErrorCode | MeasureAllCellCurrents (float *currents, std::size_t count) const |
Measure all cells' currents. | |
ErrorCode | MeasureAllCellCurrents (std::array< float, kCellCount > ¤ts) const |
Measure all cells' currents. | |
ErrorCode | MeasureAllCellCurrents (std::span< float > currents) const |
Measure all cells' currents. | |
Result< CellMode > | GetCellOperatingMode (unsigned int cell) const |
Query a single cell's operating mode. | |
Result< std::array< CellMode, kCellCount > > | GetAllCellOperatingModes () const |
Query all cells' operating modes. | |
ErrorCode | GetAllCellOperatingModes (CellMode *modes, std::size_t count) const |
Query all cells' operating modes. | |
ErrorCode | GetAllCellOperatingModes (std::array< CellMode, kCellCount > &modes) const |
Query all cells' operating modes. | |
ErrorCode | GetAllCellOperatingModes (std::span< CellMode > modes) const |
Query all cells' operating modes. | |
Aux IO Control | |
ErrorCode | SetAnalogOutput (unsigned int channel, float voltage) const |
Set a single analog output. | |
ErrorCode | SetAllAnalogOutputs (float voltage) const |
Set all analog outputs to the same value. | |
ErrorCode | SetAllAnalogOutputs (const float *voltages, std::size_t count) const |
Set all analog outputs. | |
ErrorCode | SetAllAnalogOutputs (std::span< const float > voltages) const |
Set all analog outputs. | |
ErrorCode | SetAllAnalogOutputs (const std::array< float, kAnalogOutputCount > &voltages) const |
Set all analog outputs. | |
ErrorCode | SetMultipleAnalogOutputs (unsigned int channels, float voltage) const |
Set multiple analog outputs to the same value. | |
Result< float > | GetAnalogOutput (unsigned int channel) const |
Query a single analog output's voltage. | |
Result< std::array< float, kAnalogOutputCount > > | GetAllAnalogOutputs () const |
Query all analog outputs' voltages. | |
ErrorCode | GetAllAnalogOutputs (float *voltages, std::size_t count) const |
Query all analog outputs' voltages. | |
ErrorCode | GetAllAnalogOutputs (std::array< float, kAnalogOutputCount > &voltages) const |
Query all analog outputs' voltages. | |
ErrorCode | GetAllAnalogOutputs (std::span< float > voltages) const |
Query all analog outputs' voltages. | |
ErrorCode | SetDigitalOutput (unsigned int channel, bool level) const |
Set a single digital output. | |
ErrorCode | SetAllDigitalOutputs (bool level) const |
Set all digital outputs to the same state. | |
ErrorCode | SetAllDigitalOutputsMasked (unsigned int channels, bool level) const |
Set all digital outputs. | |
ErrorCode | SetAllDigitalOutputs (const std::array< bool, kDigitalOutputCount > &levels) const |
Set all digital outputs. | |
ErrorCode | SetAllDigitalOutputs (std::span< const bool > levels) const |
Set all digital outputs. | |
Result< bool > | GetDigitalOutput (unsigned int channel) const |
Query a digital output's state. | |
Result< std::array< bool, kDigitalOutputCount > > | GetAllDigitalOutputs () const |
Query all digital outputs' states. | |
Result< unsigned int > | GetAllDigitalOutputsMasked () const |
Query all digital outputs' states. | |
Result< float > | MeasureAnalogInput (unsigned int channel) const |
Measure a single analog input. | |
Result< std::array< float, kAnalogInputCount > > | MeasureAllAnalogInputs () const |
Measure all analog inputs. | |
ErrorCode | MeasureAllAnalogInputs (float *voltages, std::size_t count) const |
Measure all analog inputs. | |
ErrorCode | MeasureAllAnalogInputs (std::array< float, kAnalogInputCount > &voltages) const |
Measure all analog inputs. | |
ErrorCode | MeasureAllAnalogInputs (std::span< float > voltages) const |
Measure all analog inputs. | |
Result< bool > | MeasureDigitalInput (unsigned int channel) const |
Measure a single digital input. | |
Result< std::array< bool, kDigitalInputCount > > | MeasureAllDigitalInputs () const |
Measure all digital inputs. | |
Result< unsigned int > | MeasureAllDigitalInputsMasked () const |
Measure all digital inputs. | |
Model Control | |
Result< std::uint8_t > | GetModelStatus () const |
Query the model status. | |
ErrorCode | LoadModel () const |
Load the model configuration on the device. | |
ErrorCode | StartModel () const |
Start modeling. | |
ErrorCode | StopModel () const |
Stop modeling. | |
ErrorCode | UnloadModel () const |
Unload the model configuration on the device. | |
Result< ModelInfo > | GetModelInfo () const |
Query information about the currently loaded model. | |
ErrorCode | SetGlobalModelInput (unsigned int index, float value) const |
Set a global model input. | |
ErrorCode | SetAllGlobalModelInputs (float value) const |
Set all global model inputs to the same value. | |
ErrorCode | SetAllGlobalModelInputs (const float *values, std::size_t count) const |
Set many global model inputs. | |
ErrorCode | SetAllGlobalModelInputs (std::span< const float > values) const |
Set many global model inputs. | |
ErrorCode | SetAllGlobalModelInputs (const std::array< float, kGlobalModelInputCount > &values) const |
Set all global model inputs. | |
Result< float > | GetGlobalModelInput (unsigned int index) const |
Query a single global model input. | |
Result< std::array< float, kGlobalModelInputCount > > | GetAllGlobalModelInputs () const |
Query all global model inputs. | |
ErrorCode | GetAllGlobalModelInputs (float *values, std::size_t count) const |
Query many global model inputs. | |
ErrorCode | GetAllGlobalModelInputs (std::array< float, kGlobalModelInputCount > &values) const |
Query all global model inputs. | |
ErrorCode | GetAllGlobalModelInputs (std::span< float > values) const |
Query many global model inputs. | |
ErrorCode | SetLocalModelInput (unsigned int index, float value) const |
Set a local model input. | |
ErrorCode | SetAllLocalModelInputs (float value) const |
Set all local model inputs to the same value. | |
ErrorCode | SetAllLocalModelInputs (const float *values, std::size_t count) const |
Set many local model inputs. | |
ErrorCode | SetAllLocalModelInputs (std::span< const float > values) const |
Set many local model inputs. | |
ErrorCode | SetAllLocalModelInputs (const std::array< float, kLocalModelInputCount > &values) const |
Set all local model inputs. | |
Result< float > | GetLocalModelInput (unsigned int index) const |
Query a single local model input. | |
Result< std::array< float, kLocalModelInputCount > > | GetAllLocalModelInputs () const |
Query all local model inputs. | |
ErrorCode | GetAllLocalModelInputs (float *values, std::size_t count) const |
Query many local model inputs. | |
ErrorCode | GetAllLocalModelInputs (std::array< float, kLocalModelInputCount > &values) const |
Query all local model inputs. | |
ErrorCode | GetAllLocalModelInputs (std::span< float > values) const |
Query many local model inputs. | |
Result< float > | GetModelOutput (unsigned int index) const |
Query a single model output. | |
Result< std::array< float, kModelOutputCount > > | GetAllModelOutputs () const |
Query all model outputs. | |
ErrorCode | GetAllModelOutputs (float *outputs, std::size_t count) const |
Query many model outputs. | |
ErrorCode | GetAllModelOutputs (std::array< float, kModelOutputCount > &outputs) const |
Query all model outputs. | |
ErrorCode | GetAllModelOutputs (std::span< float > outputs) const |
Query many model outputs. | |
Protected Member Functions | |
ErrorCode | Send (std::string_view buf) const |
Send a message to the ABS. | |
Result< std::string > | SendAndRecv (std::string_view buf) const |
Send a message to the ABS and wait for a response. | |
|
explicitnoexcept |
Initialize a ScpiClient with a driver handle.
[in] | driver | pointer to a comm driver |
|
noexcept |
Move construct from another ScpiClient.
[in] | other | ScpiClient to move from |
ErrorCode AssertSoftwareInterlock | ( | ) | const |
Assert the software interlock.
Use ClearRecoverableAlarms() to clear the interlock.
ErrorCode ClearErrors | ( | ) | const |
Clear the device's error queue.
ErrorCode ClearRecoverableAlarms | ( | ) | const |
Clear any recoverable alarms currently raised on the unit.
This can be used to clear the software interlock.
ErrorCode EnableCell | ( | unsigned int | cell, |
bool | en | ||
) | const |
Enable or disable a single cell.
[in] | cell | the cell index (0 is the first cell) |
[in] | en | whether to enable or disable the cell |
ErrorCode EnableCellNoiseFilter | ( | bool | en | ) | const |
Enable or disable the cell 50/60Hz noise filter.
This mode filters 50/60Hz noise and increases cell measurement accuracy, but reduces the cell control rate to 10Hz.
[in] | en | desired cell noise filter state |
ErrorCode EnableCellsMasked | ( | unsigned int | cells, |
bool | en | ||
) | const |
Enable or disable multiple cells using a bitmask.
The mask is 1 bit per cell, with the first cell being bit 0.
[in] | cells | a mask of bits selecting the cells to target |
[in] | en | whether to enable or disable the selected cells |
Result< std::uint32_t > GetAlarms | ( | ) | const |
Get the alarms raised on the unit.
Result< std::array< float, kAnalogOutputCount > > GetAllAnalogOutputs | ( | ) | const |
Query all analog outputs' voltages.
ErrorCode GetAllAnalogOutputs | ( | float * | voltages, |
std::size_t | count | ||
) | const |
Query all analog outputs' voltages.
[out] | voltages | array to store the voltages |
[in] | count | the length of the array (must not be greater than the total channel count) |
ErrorCode GetAllAnalogOutputs | ( | std::array< float, kAnalogOutputCount > & | voltages | ) | const |
Query all analog outputs' voltages.
[out] | voltages | array of voltages |
ErrorCode GetAllAnalogOutputs | ( | std::span< float > | voltages | ) | const |
Query all analog outputs' voltages.
[out] | voltages | array of voltages (must not be longer than the total channel count) |
Result< std::array< CellFault, kCellCount > > GetAllCellFaults | ( | ) | const |
Query all cells' faulting states.
Query all cells' faulting states.
[out] | faults | an array of cell fault states |
[in] | count | the length of the array (must not be greater than the total cell count) |
ErrorCode GetAllCellFaults | ( | std::array< CellFault, kCellCount > & | faults | ) | const |
Query all cells' faulting states.
[out] | faults | an array of cell fault states |
Query all cells' faulting states.
[out] | faults | an array of cell fault states (must not be longer than the total cell count) |
Result< std::array< CellMode, kCellCount > > GetAllCellOperatingModes | ( | ) | const |
Query all cells' operating modes.
Query all cells' operating modes.
[out] | modes | array to store the operating modes |
[in] | count | length of the array (must not be greater than the total cell count) |
ErrorCode GetAllCellOperatingModes | ( | std::array< CellMode, kCellCount > & | modes | ) | const |
Query all cells' operating modes.
[out] | modes | an array of cell operating modes |
Query all cells' operating modes.
[out] | modes | an array of cell operating modes (must not be longer than the total cell count) |
Result< std::array< bool, kCellCount > > GetAllCellsEnabled | ( | ) | const |
Query the enable states of all cells.
Result< unsigned int > GetAllCellsEnabledMasked | ( | ) | const |
Query the enable states of all cells as a bitmask.
Result< std::array< CellSenseRange, kCellCount > > GetAllCellSenseRanges | ( | ) | const |
Query all cells' current sense ranges.
ErrorCode GetAllCellSenseRanges | ( | CellSenseRange * | ranges, |
std::size_t | count | ||
) | const |
Query all cells' current sense ranges.
[out] | ranges | array to store the sense ranges |
[in] | count | length of the array (must not be greater than the total cell count) |
ErrorCode GetAllCellSenseRanges | ( | std::array< CellSenseRange, kCellCount > & | ranges | ) | const |
Query all cells' current sense ranges.
[out] | ranges | an array of current sense ranges |
ErrorCode GetAllCellSenseRanges | ( | std::span< CellSenseRange > | ranges | ) | const |
Query all cells' current sense ranges.
[out] | ranges | an array of sense ranges (must not be longer than the total cell count) |
Result< std::array< float, kCellCount > > GetAllCellSinkingLimits | ( | ) | const |
Query all cells' sinking current limits.
ErrorCode GetAllCellSinkingLimits | ( | float * | limits, |
std::size_t | count | ||
) | const |
Query all cells' sinking current limits.
[out] | limits | array to store the sinking current limits |
[in] | count | size of the limits array (must not be greater than the total cell count) |
ErrorCode GetAllCellSinkingLimits | ( | std::array< float, kCellCount > & | limits | ) | const |
Query all cells' sinking current limits.
[out] | limits | array to store the sinking current limits |
ErrorCode GetAllCellSinkingLimits | ( | std::span< float > | limits | ) | const |
Query all cells' sinking current limits.
[out] | limits | array to store the sinking current limits (must not be longer than the total cell count) |
Result< std::array< float, kCellCount > > GetAllCellSourcingLimits | ( | ) | const |
Query all cells' sourcing current limits.
ErrorCode GetAllCellSourcingLimits | ( | float * | limits, |
std::size_t | count | ||
) | const |
Query all cells' sourcing current limits.
[out] | limits | array to store the sourcing current limits |
[in] | count | size of the limits array (must not be greater than the total cell count) |
ErrorCode GetAllCellSourcingLimits | ( | std::array< float, kCellCount > & | limits | ) | const |
Query all cells' sourcing current limits.
[out] | limits | array to store the sourcing current limits |
ErrorCode GetAllCellSourcingLimits | ( | std::span< float > | limits | ) | const |
Query all cells' sourcing current limits.
[out] | limits | array to store the sourcing current limits (must not be longer than the total cell count) |
Result< std::array< float, kCellCount > > GetAllCellVoltageTargets | ( | ) | const |
Query all cells' voltage set points.
ErrorCode GetAllCellVoltageTargets | ( | float * | voltages, |
std::size_t | count | ||
) | const |
Query all cells' voltage set points.
[out] | voltages | pointer to an array to contain the returned voltages |
[in] | count | number of elements in the voltages array (must not be more than the total cell count) |
ErrorCode GetAllCellVoltageTargets | ( | std::array< float, kCellCount > & | voltages | ) | const |
Query all cells' voltage set points.
[out] | voltages | array to store the returned voltages |
ErrorCode GetAllCellVoltageTargets | ( | std::span< float > | voltages | ) | const |
Query all cells' voltage set points.
[out] | voltages | array to store the returned voltages (must not be longer than the total cell count) |
Result< std::array< bool, kDigitalOutputCount > > GetAllDigitalOutputs | ( | ) | const |
Query all digital outputs' states.
Result< unsigned int > GetAllDigitalOutputsMasked | ( | ) | const |
Query all digital outputs' states.
Result< std::array< float, kGlobalModelInputCount > > GetAllGlobalModelInputs | ( | ) | const |
Query all global model inputs.
ErrorCode GetAllGlobalModelInputs | ( | float * | values, |
std::size_t | count | ||
) | const |
Query many global model inputs.
[out] | values | array to store the values, one per input |
[in] | count | length of the array (must not be more than the total number of inputs) |
ErrorCode GetAllGlobalModelInputs | ( | std::array< float, kGlobalModelInputCount > & | values | ) | const |
Query all global model inputs.
[out] | values | array of returned values, one per input |
ErrorCode GetAllGlobalModelInputs | ( | std::span< float > | values | ) | const |
Query many global model inputs.
[out] | values | array of returned values, one per input (must not be longer than the total number of inputs) |
Result< std::array< float, kLocalModelInputCount > > GetAllLocalModelInputs | ( | ) | const |
Query all local model inputs.
ErrorCode GetAllLocalModelInputs | ( | float * | values, |
std::size_t | count | ||
) | const |
Query many local model inputs.
[out] | values | array to store the values, one per input |
[in] | count | length of the array (must not be more than the total number of inputs) |
ErrorCode GetAllLocalModelInputs | ( | std::array< float, kLocalModelInputCount > & | values | ) | const |
Query all local model inputs.
[out] | values | array of returned values, one per input |
ErrorCode GetAllLocalModelInputs | ( | std::span< float > | values | ) | const |
Query many local model inputs.
[out] | values | array of returned values, one per input (must not be longer than the total number of inputs) |
Result< std::array< float, kModelOutputCount > > GetAllModelOutputs | ( | ) | const |
Query all model outputs.
ErrorCode GetAllModelOutputs | ( | float * | outputs, |
std::size_t | count | ||
) | const |
Query many model outputs.
[out] | outputs | array of returned model output values, one per channel |
[in] | count | length of the array (must not be greater than the total number of outputs) |
ErrorCode GetAllModelOutputs | ( | std::array< float, kModelOutputCount > & | outputs | ) | const |
Query all model outputs.
[out] | outputs | array of returned outputs |
ErrorCode GetAllModelOutputs | ( | std::span< float > | outputs | ) | const |
Query many model outputs.
[out] | outputs | array of returned outputs, one per output (must not be longer than the total number of outputs) |
Result< float > GetAnalogOutput | ( | unsigned int | channel | ) | const |
Query a single analog output's voltage.
[in] | channel | target channel index |
Result< std::string > GetCalibrationDate | ( | ) | const |
Query the device's calibration date.
Result< bool > GetCellEnabled | ( | unsigned int | cell | ) | const |
Query the enable state of a cell.
[in] | cell | target cell index (0 is the first cell) |
Query a single cell's faulting state.
[in] | cell | target cell index |
Result< bool > GetCellNoiseFilterEnabled | ( | ) | const |
Query the state of the cell noise filter.
Query a single cell's operating mode.
[in] | cell | target cell index |
Result< CellSenseRange > GetCellSenseRange | ( | unsigned int | cell | ) | const |
Query a single cell's current sense range.
[in] | cell | target cell index |
Result< float > GetCellSinkingLimit | ( | unsigned int | cell | ) | const |
Query a single cell's sinking current limit.
[in] | cell | target cell index |
Result< float > GetCellSourcingLimit | ( | unsigned int | cell | ) | const |
Query a single cell's sourcing current limit.
[in] | cell | target cell index |
Result< float > GetCellVoltageTarget | ( | unsigned int | cell | ) | const |
Query a single cell's voltage set point.
[in] | cell | target cell index |
Result< std::uint8_t > GetDeviceId | ( | ) | const |
Query the device's serial ID.
Result< DeviceInfo > GetDeviceInfo | ( | ) | const |
Query general information about the unit.
Result< bool > GetDigitalOutput | ( | unsigned int | channel | ) | const |
Query a digital output's state.
[in] | channel | target channel index |
|
noexcept |
|
noexcept |
Result< int > GetErrorCount | ( | ) | const |
Query the number of errors in the device's error queue.
Result< float > GetGlobalModelInput | ( | unsigned int | index | ) | const |
Query a single global model input.
[in] | index | index of the input, 0-7 |
Result< bool > GetInterlockState | ( | ) | const |
Get the system interlock state.
When in interlock, the unit will be put into its PoR state and cannot be controlled until the interlock is lifted.
Result< EthernetConfig > GetIPAddress | ( | ) | const |
Query the device's IP address and subnet mask.
Result< float > GetLocalModelInput | ( | unsigned int | index | ) | const |
Query a single local model input.
[in] | index | index of the input, 0-7 |
Query information about the currently loaded model.
Result< float > GetModelOutput | ( | unsigned int | index | ) | const |
Query a single model output.
[in] | index | index of the output, 0-35 |
Result< std::uint8_t > GetModelStatus | ( | ) | const |
Query the model status.
Pop the next error from the SCPI error queue.
Result< unsigned int > GetTargetDeviceID | ( | ) | const |
ErrorCode LoadModel | ( | ) | const |
Load the model configuration on the device.
Result< std::array< float, kAnalogInputCount > > MeasureAllAnalogInputs | ( | ) | const |
Measure all analog inputs.
ErrorCode MeasureAllAnalogInputs | ( | float * | voltages, |
std::size_t | count | ||
) | const |
Measure all analog inputs.
[out] | voltages | array to store the measured voltages |
[in] | count | length of the array (must not be greater than the total channel count) |
ErrorCode MeasureAllAnalogInputs | ( | std::array< float, kAnalogInputCount > & | voltages | ) | const |
Measure all analog inputs.
[out] | voltages | an array of analog input voltages |
ErrorCode MeasureAllAnalogInputs | ( | std::span< float > | voltages | ) | const |
Measure all analog inputs.
[out] | voltages | an array of voltages (must not be longer than the total channel count) |
Result< std::array< float, kCellCount > > MeasureAllCellCurrents | ( | ) | const |
Measure all cells' currents.
ErrorCode MeasureAllCellCurrents | ( | float * | currents, |
std::size_t | count | ||
) | const |
Measure all cells' currents.
[out] | currents | array to store the measured currents |
[in] | count | length of the array (must not be greater than the total cell count) |
ErrorCode MeasureAllCellCurrents | ( | std::array< float, kCellCount > & | currents | ) | const |
Measure all cells' currents.
[out] | currents | an array of cell currents |
ErrorCode MeasureAllCellCurrents | ( | std::span< float > | currents | ) | const |
Measure all cells' currents.
[out] | currents | an array of cell currents (must not be longer than the total cell count) |
Result< std::array< float, kCellCount > > MeasureAllCellVoltages | ( | ) | const |
Measure all cells' voltages.
ErrorCode MeasureAllCellVoltages | ( | float * | voltages, |
std::size_t | count | ||
) | const |
Measure all cells' voltages.
[out] | voltages | array to store the measured voltages |
[in] | count | length of the array (must not be greater than the total cell count) |
ErrorCode MeasureAllCellVoltages | ( | std::array< float, kCellCount > & | voltages | ) | const |
Measure all cells' voltages.
[out] | voltages | an array of cell voltages |
ErrorCode MeasureAllCellVoltages | ( | std::span< float > | voltages | ) | const |
Measure all cells' voltages.
[out] | voltages | an array of cell voltages (must not be longer than the total cell count) |
Result< std::array< bool, kDigitalInputCount > > MeasureAllDigitalInputs | ( | ) | const |
Measure all digital inputs.
Result< unsigned int > MeasureAllDigitalInputsMasked | ( | ) | const |
Measure all digital inputs.
Result< float > MeasureAnalogInput | ( | unsigned int | channel | ) | const |
Measure a single analog input.
[in] | channel | target channel index |
Result< float > MeasureCellCurrent | ( | unsigned int | cell | ) | const |
Measure a single cell's current.
[in] | cell | target cell index |
Result< float > MeasureCellVoltage | ( | unsigned int | cell | ) | const |
Measure a single cell's voltage.
[in] | cell | target cell index |
Result< bool > MeasureDigitalInput | ( | unsigned int | channel | ) | const |
Measure a single digital input.
[in] | channel | target channel count |
|
noexcept |
Move assign from another ScpiClient.
[in] | rhs | ScpiClient to move from |
ErrorCode Reboot | ( | ) | const |
Reboot the unit.
|
protected |
Send a message to the ABS.
Checks for driver validity.
[in] | buf | data to send |
|
protected |
Send a message to the ABS and wait for a response.
Checks for driver validity.
[in] | buf | data to send |
ErrorCode SetAllAnalogOutputs | ( | const float * | voltages, |
std::size_t | count | ||
) | const |
Set all analog outputs.
[in] | voltages | array of voltages |
[in] | count | length of the array (must not be greater than the total channel count) |
ErrorCode SetAllAnalogOutputs | ( | const std::array< float, kAnalogOutputCount > & | voltages | ) | const |
Set all analog outputs.
[in] | voltages | array of voltages |
ErrorCode SetAllAnalogOutputs | ( | float | voltage | ) | const |
Set all analog outputs to the same value.
[in] | voltage | desired voltage |
ErrorCode SetAllAnalogOutputs | ( | std::span< const float > | voltages | ) | const |
Set all analog outputs.
[in] | voltages | array of voltages (must not be longer than the total channel count) |
Set all cells' faulting states to the same value.
[in] | fault | desired cell fault |
Set all cells' faulting states.
[in] | faults | an array of cell fault states |
[in] | count | the length of the array (must not be greater than the total cell count) |
ErrorCode SetAllCellFaults | ( | const std::array< CellFault, kCellCount > & | faults | ) | const |
Set all cells' faulting states.
[in] | faults | an array of fault states |
Set all cells' faulting states.
[in] | faults | an array of fault states (must not be longer than the total cell count) |
ErrorCode SetAllCellSenseRanges | ( | CellSenseRange | range | ) | const |
Set all cells' current sense ranges to the same value.
[in] | range | desired sense range |
ErrorCode SetAllCellSenseRanges | ( | const CellSenseRange * | ranges, |
std::size_t | count | ||
) | const |
Set all cells' current sense ranges.
[in] | ranges | an array of sense ranges |
[in] | count | the length of the array (must not be greater than the total cell count) |
ErrorCode SetAllCellSenseRanges | ( | const std::array< CellSenseRange, kCellCount > & | ranges | ) | const |
Set all cells' current sense ranges.
[in] | ranges | an array of sense ranges |
ErrorCode SetAllCellSenseRanges | ( | std::span< const CellSenseRange > | ranges | ) | const |
Set all cells' current sense ranges.
[in] | ranges | an array of sense ranges (must not be longer than the total cell count) |
ErrorCode SetAllCellSinking | ( | const float * | limits, |
std::size_t | count | ||
) | const |
Set all cells' sinking current limits.
[in] | limits | array of sinking current limits (may be positive or negative) |
[in] | count | number of cells to set (must not be greater than the total cell count) |
ErrorCode SetAllCellSinking | ( | const std::array< float, kCellCount > & | limits | ) | const |
Set all cells' sinking current limits.
[in] | limits | array of sinking current limits |
ErrorCode SetAllCellSinking | ( | float | limit | ) | const |
Set all cells' sinking current limits to the same value.
[in] | limit | desired sinking current limit (may be positive or negative) |
ErrorCode SetAllCellSinking | ( | std::span< const float > | limits | ) | const |
Set all cells' sinking current limits.
[in] | limits | array of sinking current limits (must not be longer than the total cell count) |
ErrorCode SetAllCellSourcing | ( | const float * | limits, |
std::size_t | count | ||
) | const |
Set all cells' sourcing current limits.
[in] | limits | array of sourcing current limits |
[in] | count | number of cells to set (must not be greater than the total cell count) |
ErrorCode SetAllCellSourcing | ( | const std::array< float, kCellCount > & | limits | ) | const |
Set all cells' sourcing current limits.
[in] | limits | array of sourcing current limits |
ErrorCode SetAllCellSourcing | ( | float | limit | ) | const |
Set all cells' sourcing current limits to the same value.
[in] | limit | desired sourcing current limit |
ErrorCode SetAllCellSourcing | ( | std::span< const float > | limits | ) | const |
Set all cells' sourcing current limits.
[in] | limits | array of sourcing current limits (must not be longer than the total cell count) |
ErrorCode SetAllCellVoltages | ( | const float * | voltages, |
std::size_t | count | ||
) | const |
Set all cells' voltages.
[in] | voltages | pointer to an array of cell voltages |
[in] | count | how many cells to set (how many entries are in the voltages array) |
ErrorCode SetAllCellVoltages | ( | const std::array< float, kCellCount > & | voltages | ) | const |
Set all cells' voltages.
[in] | voltages | target voltages, one per cell |
ErrorCode SetAllCellVoltages | ( | float | voltage | ) | const |
Set all cells' voltages to the same value.
[in] | voltage | target voltage |
ErrorCode SetAllCellVoltages | ( | std::span< const float > | voltages | ) | const |
Set all cells' voltages.
[in] | voltages | target voltages, one per cell (there may not be more entries than cells) |
ErrorCode SetAllDigitalOutputs | ( | bool | level | ) | const |
Set all digital outputs to the same state.
[in] | level | desired output state |
ErrorCode SetAllDigitalOutputs | ( | const std::array< bool, kDigitalOutputCount > & | levels | ) | const |
Set all digital outputs.
[in] | levels | an array of output states |
ErrorCode SetAllDigitalOutputs | ( | std::span< const bool > | levels | ) | const |
Set all digital outputs.
[in] | levels | an array of output states (must not be longer than the total channel count) |
ErrorCode SetAllDigitalOutputsMasked | ( | unsigned int | channels, |
bool | level | ||
) | const |
Set all digital outputs.
[in] | channels | a bitmask of channels to control, 1 bit per channel |
[in] | level | the desired output state |
ErrorCode SetAllGlobalModelInputs | ( | const float * | values, |
std::size_t | count | ||
) | const |
Set many global model inputs.
[in] | values | array of values, one per input |
[in] | count | length of the array (must not be greater than the total number of inputs) |
ErrorCode SetAllGlobalModelInputs | ( | const std::array< float, kGlobalModelInputCount > & | values | ) | const |
Set all global model inputs.
[in] | values | array of values, one per input |
ErrorCode SetAllGlobalModelInputs | ( | float | value | ) | const |
Set all global model inputs to the same value.
[in] | value | the input value |
ErrorCode SetAllGlobalModelInputs | ( | std::span< const float > | values | ) | const |
Set many global model inputs.
[in] | values | array of values, one per input (must not be longer than the total number of inputs) |
ErrorCode SetAllLocalModelInputs | ( | const float * | values, |
std::size_t | count | ||
) | const |
Set many local model inputs.
[in] | values | array of values, one per input |
[in] | count | length of the array (must not be greater than the total number of inputs) |
ErrorCode SetAllLocalModelInputs | ( | const std::array< float, kLocalModelInputCount > & | values | ) | const |
Set all local model inputs.
[in] | values | array of values, one per input |
ErrorCode SetAllLocalModelInputs | ( | float | value | ) | const |
Set all local model inputs to the same value.
[in] | value | the input value |
ErrorCode SetAllLocalModelInputs | ( | std::span< const float > | values | ) | const |
Set many local model inputs.
[in] | values | array of values, one per input (must not be longer than the total number of inputs) |
ErrorCode SetAnalogOutput | ( | unsigned int | channel, |
float | voltage | ||
) | const |
Set a single analog output.
[in] | channel | target channel index |
[in] | voltage | desired voltage |
Set a single cell's faulting state.
[in] | cell | target cell index |
[in] | fault | desired cell fault |
ErrorCode SetCellSenseRange | ( | unsigned int | cell, |
CellSenseRange | range | ||
) | const |
Set a single cell's current sense range.
[in] | cell | target cell index |
[in] | range | desired sense range |
ErrorCode SetCellSinking | ( | unsigned int | cell, |
float | limit | ||
) | const |
Set a single cell's sinking current limit.
[in] | cell | target cell index |
[in] | limit | desired sinking current limit (may be positive or negative) |
ErrorCode SetCellSourcing | ( | unsigned int | cell, |
float | limit | ||
) | const |
Set a single cell's sourcing current limit.
[in] | cell | target cell index |
[in] | limit | desired sourcing current limit |
ErrorCode SetCellVoltage | ( | unsigned int | cell, |
float | voltage | ||
) | const |
Set a single cell's target voltage.
[in] | cell | target cell index |
[in] | voltage | target voltage |
ErrorCode SetDigitalOutput | ( | unsigned int | channel, |
bool | level | ||
) | const |
Set a single digital output.
[in] | channel | target channel index |
[in] | level | desired output state |
|
noexcept |
Set or replace the comm driver for the client.
[in] | driver | new driver to use |
ErrorCode SetGlobalModelInput | ( | unsigned int | index, |
float | value | ||
) | const |
Set a global model input.
[in] | index | input index, 0-7 |
[in] | value | input value |
ErrorCode SetIPAddress | ( | std::string_view | ip, |
std::string_view | netmask | ||
) | const |
Set the device's IP address and subnet mask.
[in] | ip | desired IP address for the unit |
[in] | netmask | desired subnet mask for the unit |
ErrorCode SetLocalModelInput | ( | unsigned int | index, |
float | value | ||
) | const |
Set a local model input.
[in] | index | input index, 0-7 |
[in] | value | input value |
ErrorCode SetMultipleAnalogOutputs | ( | unsigned int | channels, |
float | voltage | ||
) | const |
Set multiple analog outputs to the same value.
[in] | channels | bitmask of channels to target, 1 bit per channel |
[in] | voltage | target voltage |
Set multiple cells to the same fault state.
[in] | cells | bitmask of cells to target, one bit per cell |
[in] | fault | target fault state |
ErrorCode SetMultipleCellSinking | ( | unsigned int | cells, |
float | limit | ||
) | const |
Set multiple cells' sinking current limits to the same value.
[in] | cells | bitmask of cells to target, 1 bit per cell |
[in] | limit | target sinking limit |
ErrorCode SetMultipleCellSourcing | ( | unsigned int | cells, |
float | limit | ||
) | const |
Set multiple cells' sourcing current limits to the same value.
[in] | cells | bitmask of cells to target, 1 bit per cell |
[in] | limit | target sourcing limit |
ErrorCode SetMultipleCellVoltages | ( | unsigned int | cells, |
float | voltage | ||
) | const |
Set multiple cells' voltages to the same value.
[in] | cells | bitmask of cells to target, 1 bit per cell |
[in] | voltage | target voltage |
|
noexcept |
Set the read timeout for the client.
In most cases, this is unnecessary. The default is 150ms.
[in] | timeout_ms | new read timeout in milliseconds |
ErrorCode SetTargetDeviceID | ( | unsigned int | id | ) |
Change the targeted device ID.
This is currently only meaningful for RS-485.
[in] | id | the serial ID in the range 0-31, or 32+ to target all devices on a bus |
ErrorCode StartModel | ( | ) | const |
Start modeling.
ErrorCode StopModel | ( | ) | const |
Stop modeling.
ErrorCode UnloadModel | ( | ) | const |
Unload the model configuration on the device.