ABS SCPI Driver 0.2.0
ABS SCPI driver library
Loading...
Searching...
No Matches
ScpiClient Class Reference

Generic SCPI client for communicating with the Bloomy Controls ABS. More...

#include <ScpiClient.h>

Detailed Description

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):

auto driver{std::make_shared<bci::abs::drivers::UdpDriver>()};
driver->Open("192.168.1.100");
ScpiClient client{driver};
client.SetCellVoltage(0, 1.35f);
if (auto v = client.MeasureCellVoltage(0)) {
std::cout << "cell 1 voltage: " << *v << "\n";
}
Generic SCPI client for communicating with the Bloomy Controls ABS.
Definition ScpiClient.h:54
ErrorCode SetCellVoltage(unsigned int cell, float voltage) const
Set a single cell's target voltage.

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
 
ScpiClientoperator= (ScpiClient &&rhs) noexcept
 Move assign from another ScpiClient.
 
ScpiClientoperator= (const ScpiClient &)=delete
 
 ~ScpiClient ()=default
 DTOR.
 
std::shared_ptr< drivers::CommDriverGetDriver () noexcept
 
std::shared_ptr< const drivers::CommDriverGetDriver () 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< DeviceInfoGetDeviceInfo () const
 Query general information about the unit.
 
Result< std::uint8_t > GetDeviceId () const
 Query the device's serial ID.
 
Result< EthernetConfigGetIPAddress () 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< ScpiErrorGetNextError () 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< CellFaultGetCellFault (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< CellSenseRangeGetCellSenseRange (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 > &currents) const
 Measure all cells' currents.
 
ErrorCode MeasureAllCellCurrents (std::span< float > currents) const
 Measure all cells' currents.
 
Result< CellModeGetCellOperatingMode (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< ModelInfoGetModelInfo () 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.
 

Constructor & Destructor Documentation

◆ ScpiClient() [1/2]

ScpiClient ( std::shared_ptr< drivers::CommDriver driver)
explicitnoexcept

Initialize a ScpiClient with a driver handle.

Parameters
[in]driverpointer to a comm driver

◆ ScpiClient() [2/2]

ScpiClient ( ScpiClient &&  other)
noexcept

Move construct from another ScpiClient.

Parameters
[in]otherScpiClient to move from

Member Function Documentation

◆ AssertSoftwareInterlock()

ErrorCode AssertSoftwareInterlock ( ) const

Assert the software interlock.

Use ClearRecoverableAlarms() to clear the interlock.

Returns
An error code.

◆ ClearErrors()

ErrorCode ClearErrors ( ) const

Clear the device's error queue.

Returns
An error code.

◆ ClearRecoverableAlarms()

ErrorCode ClearRecoverableAlarms ( ) const

Clear any recoverable alarms currently raised on the unit.

This can be used to clear the software interlock.

Returns
An error code.

◆ EnableCell()

ErrorCode EnableCell ( unsigned int  cell,
bool  en 
) const

Enable or disable a single cell.

Parameters
[in]cellthe cell index (0 is the first cell)
[in]enwhether to enable or disable the cell
Returns
An error code.

◆ EnableCellNoiseFilter()

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.

Parameters
[in]endesired cell noise filter state
Returns
An error code.

◆ EnableCellsMasked()

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.

Parameters
[in]cellsa mask of bits selecting the cells to target
[in]enwhether to enable or disable the selected cells
Returns
An error code.

◆ GetAlarms()

Result< std::uint32_t > GetAlarms ( ) const

Get the alarms raised on the unit.

Note
Use the bci::abs::alarms constants to mask/test the states of alarms.
Returns
Result containing the alarm bitmask or an error code.

◆ GetAllAnalogOutputs() [1/4]

Result< std::array< float, kAnalogOutputCount > > GetAllAnalogOutputs ( ) const

Query all analog outputs' voltages.

Returns
Result containing an array of voltages or an error code.

◆ GetAllAnalogOutputs() [2/4]

ErrorCode GetAllAnalogOutputs ( float *  voltages,
std::size_t  count 
) const

Query all analog outputs' voltages.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]voltagesarray to store the voltages
[in]countthe length of the array (must not be greater than the total channel count)
Returns
An error code.

◆ GetAllAnalogOutputs() [3/4]

ErrorCode GetAllAnalogOutputs ( std::array< float, kAnalogOutputCount > &  voltages) const

Query all analog outputs' voltages.

Parameters
[out]voltagesarray of voltages
Returns
An error code.

◆ GetAllAnalogOutputs() [4/4]

ErrorCode GetAllAnalogOutputs ( std::span< float >  voltages) const

Query all analog outputs' voltages.

Parameters
[out]voltagesarray of voltages (must not be longer than the total channel count)
Returns
An error code.

◆ GetAllCellFaults() [1/4]

Result< std::array< CellFault, kCellCount > > GetAllCellFaults ( ) const

Query all cells' faulting states.

Returns
Result containing an array of cell fault states or an error code.

◆ GetAllCellFaults() [2/4]

ErrorCode GetAllCellFaults ( CellFault faults,
std::size_t  count 
) const

Query all cells' faulting states.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]faultsan array of cell fault states
[in]countthe length of the array (must not be greater than the total cell count)
Returns
An error code.

◆ GetAllCellFaults() [3/4]

ErrorCode GetAllCellFaults ( std::array< CellFault, kCellCount > &  faults) const

Query all cells' faulting states.

Parameters
[out]faultsan array of cell fault states
Returns
An error code.

◆ GetAllCellFaults() [4/4]

ErrorCode GetAllCellFaults ( std::span< CellFault faults) const

Query all cells' faulting states.

Parameters
[out]faultsan array of cell fault states (must not be longer than the total cell count)
Returns
An error code.

◆ GetAllCellOperatingModes() [1/4]

Result< std::array< CellMode, kCellCount > > GetAllCellOperatingModes ( ) const

Query all cells' operating modes.

Returns
Result containing an array of cell operating modes or an error code.

◆ GetAllCellOperatingModes() [2/4]

ErrorCode GetAllCellOperatingModes ( CellMode modes,
std::size_t  count 
) const

Query all cells' operating modes.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]modesarray to store the operating modes
[in]countlength of the array (must not be greater than the total cell count)
Returns
An error code.

◆ GetAllCellOperatingModes() [3/4]

ErrorCode GetAllCellOperatingModes ( std::array< CellMode, kCellCount > &  modes) const

Query all cells' operating modes.

Parameters
[out]modesan array of cell operating modes
Returns
An error code.

◆ GetAllCellOperatingModes() [4/4]

ErrorCode GetAllCellOperatingModes ( std::span< CellMode modes) const

Query all cells' operating modes.

Parameters
[out]modesan array of cell operating modes (must not be longer than the total cell count)
Returns
An error code.

◆ GetAllCellsEnabled()

Result< std::array< bool, kCellCount > > GetAllCellsEnabled ( ) const

Query the enable states of all cells.

Returns
Result containing an array of cell enable states or an error code.

◆ GetAllCellsEnabledMasked()

Result< unsigned int > GetAllCellsEnabledMasked ( ) const

Query the enable states of all cells as a bitmask.

Returns
Result containing a bitmask of enabled cells or an error code.

◆ GetAllCellSenseRanges() [1/4]

Result< std::array< CellSenseRange, kCellCount > > GetAllCellSenseRanges ( ) const

Query all cells' current sense ranges.

Returns
Result containing an array of cell sense ranges or an error code.

◆ GetAllCellSenseRanges() [2/4]

ErrorCode GetAllCellSenseRanges ( CellSenseRange ranges,
std::size_t  count 
) const

Query all cells' current sense ranges.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]rangesarray to store the sense ranges
[in]countlength of the array (must not be greater than the total cell count)
Returns
An error code.

◆ GetAllCellSenseRanges() [3/4]

ErrorCode GetAllCellSenseRanges ( std::array< CellSenseRange, kCellCount > &  ranges) const

Query all cells' current sense ranges.

Parameters
[out]rangesan array of current sense ranges
Returns
An error code.

◆ GetAllCellSenseRanges() [4/4]

ErrorCode GetAllCellSenseRanges ( std::span< CellSenseRange ranges) const

Query all cells' current sense ranges.

Parameters
[out]rangesan array of sense ranges (must not be longer than the total cell count)
Returns
An error code.

◆ GetAllCellSinkingLimits() [1/4]

Result< std::array< float, kCellCount > > GetAllCellSinkingLimits ( ) const

Query all cells' sinking current limits.

Returns
Result containing an array of the cells' sinking limits or an error code.

◆ GetAllCellSinkingLimits() [2/4]

ErrorCode GetAllCellSinkingLimits ( float *  limits,
std::size_t  count 
) const

Query all cells' sinking current limits.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]limitsarray to store the sinking current limits
[in]countsize of the limits array (must not be greater than the total cell count)
Returns
An error code.

◆ GetAllCellSinkingLimits() [3/4]

ErrorCode GetAllCellSinkingLimits ( std::array< float, kCellCount > &  limits) const

Query all cells' sinking current limits.

Parameters
[out]limitsarray to store the sinking current limits
Returns
An error code.

◆ GetAllCellSinkingLimits() [4/4]

ErrorCode GetAllCellSinkingLimits ( std::span< float >  limits) const

Query all cells' sinking current limits.

Parameters
[out]limitsarray to store the sinking current limits (must not be longer than the total cell count)
Returns
An error code.

◆ GetAllCellSourcingLimits() [1/4]

Result< std::array< float, kCellCount > > GetAllCellSourcingLimits ( ) const

Query all cells' sourcing current limits.

Returns
Result containing an array of the cells' sourcing limits or an error code.

◆ GetAllCellSourcingLimits() [2/4]

ErrorCode GetAllCellSourcingLimits ( float *  limits,
std::size_t  count 
) const

Query all cells' sourcing current limits.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]limitsarray to store the sourcing current limits
[in]countsize of the limits array (must not be greater than the total cell count)
Returns
An error code.

◆ GetAllCellSourcingLimits() [3/4]

ErrorCode GetAllCellSourcingLimits ( std::array< float, kCellCount > &  limits) const

Query all cells' sourcing current limits.

Parameters
[out]limitsarray to store the sourcing current limits
Returns
An error code.

◆ GetAllCellSourcingLimits() [4/4]

ErrorCode GetAllCellSourcingLimits ( std::span< float >  limits) const

Query all cells' sourcing current limits.

Parameters
[out]limitsarray to store the sourcing current limits (must not be longer than the total cell count)
Returns
An error code.

◆ GetAllCellVoltageTargets() [1/4]

Result< std::array< float, kCellCount > > GetAllCellVoltageTargets ( ) const

Query all cells' voltage set points.

Returns
Result containing an array of voltages or an error code.

◆ GetAllCellVoltageTargets() [2/4]

ErrorCode GetAllCellVoltageTargets ( float *  voltages,
std::size_t  count 
) const

Query all cells' voltage set points.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]voltagespointer to an array to contain the returned voltages
[in]countnumber of elements in the voltages array (must not be more than the total cell count)
Returns
An error code.

◆ GetAllCellVoltageTargets() [3/4]

ErrorCode GetAllCellVoltageTargets ( std::array< float, kCellCount > &  voltages) const

Query all cells' voltage set points.

Parameters
[out]voltagesarray to store the returned voltages
Returns
An error code.

◆ GetAllCellVoltageTargets() [4/4]

ErrorCode GetAllCellVoltageTargets ( std::span< float >  voltages) const

Query all cells' voltage set points.

Parameters
[out]voltagesarray to store the returned voltages (must not be longer than the total cell count)
Returns
An error code.

◆ GetAllDigitalOutputs()

Result< std::array< bool, kDigitalOutputCount > > GetAllDigitalOutputs ( ) const

Query all digital outputs' states.

Returns
Result containing an array of output states or an error code.

◆ GetAllDigitalOutputsMasked()

Result< unsigned int > GetAllDigitalOutputsMasked ( ) const

Query all digital outputs' states.

Returns
Result containing a bitmask of output states or an error code.

◆ GetAllGlobalModelInputs() [1/4]

Result< std::array< float, kGlobalModelInputCount > > GetAllGlobalModelInputs ( ) const

Query all global model inputs.

Returns
Result containing the array of values or an error code.

◆ GetAllGlobalModelInputs() [2/4]

ErrorCode GetAllGlobalModelInputs ( float *  values,
std::size_t  count 
) const

Query many global model inputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]valuesarray to store the values, one per input
[in]countlength of the array (must not be more than the total number of inputs)
Returns
An error code.

◆ GetAllGlobalModelInputs() [3/4]

ErrorCode GetAllGlobalModelInputs ( std::array< float, kGlobalModelInputCount > &  values) const

Query all global model inputs.

Parameters
[out]valuesarray of returned values, one per input
Returns
An error code.

◆ GetAllGlobalModelInputs() [4/4]

ErrorCode GetAllGlobalModelInputs ( std::span< float >  values) const

Query many global model inputs.

Parameters
[out]valuesarray of returned values, one per input (must not be longer than the total number of inputs)
Returns
An error code.

◆ GetAllLocalModelInputs() [1/4]

Result< std::array< float, kLocalModelInputCount > > GetAllLocalModelInputs ( ) const

Query all local model inputs.

Returns
Result containing the array of values or an error code.

◆ GetAllLocalModelInputs() [2/4]

ErrorCode GetAllLocalModelInputs ( float *  values,
std::size_t  count 
) const

Query many local model inputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]valuesarray to store the values, one per input
[in]countlength of the array (must not be more than the total number of inputs)
Returns
An error code.

◆ GetAllLocalModelInputs() [3/4]

ErrorCode GetAllLocalModelInputs ( std::array< float, kLocalModelInputCount > &  values) const

Query all local model inputs.

Parameters
[out]valuesarray of returned values, one per input
Returns
An error code.

◆ GetAllLocalModelInputs() [4/4]

ErrorCode GetAllLocalModelInputs ( std::span< float >  values) const

Query many local model inputs.

Parameters
[out]valuesarray of returned values, one per input (must not be longer than the total number of inputs)
Returns
An error code.

◆ GetAllModelOutputs() [1/4]

Result< std::array< float, kModelOutputCount > > GetAllModelOutputs ( ) const

Query all model outputs.

Returns
Result containing the outputs or an error code.

◆ GetAllModelOutputs() [2/4]

ErrorCode GetAllModelOutputs ( float *  outputs,
std::size_t  count 
) const

Query many model outputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]outputsarray of returned model output values, one per channel
[in]countlength of the array (must not be greater than the total number of outputs)
Returns
An error code.

◆ GetAllModelOutputs() [3/4]

ErrorCode GetAllModelOutputs ( std::array< float, kModelOutputCount > &  outputs) const

Query all model outputs.

Parameters
[out]outputsarray of returned outputs
Returns
An error code.

◆ GetAllModelOutputs() [4/4]

ErrorCode GetAllModelOutputs ( std::span< float >  outputs) const

Query many model outputs.

Parameters
[out]outputsarray of returned outputs, one per output (must not be longer than the total number of outputs)
Returns
An error code.

◆ GetAnalogOutput()

Result< float > GetAnalogOutput ( unsigned int  channel) const

Query a single analog output's voltage.

Parameters
[in]channeltarget channel index
Returns
Result containing the voltage or an error code.

◆ GetCalibrationDate()

Result< std::string > GetCalibrationDate ( ) const

Query the device's calibration date.

Returns
Result containing the calibration date or an error code.

◆ GetCellEnabled()

Result< bool > GetCellEnabled ( unsigned int  cell) const

Query the enable state of a cell.

Parameters
[in]celltarget cell index (0 is the first cell)
Returns
Result containing whether the cell is enabled or an error code.

◆ GetCellFault()

Result< CellFault > GetCellFault ( unsigned int  cell) const

Query a single cell's faulting state.

Parameters
[in]celltarget cell index
Returns
Result containing the cell's fault state or an error code.

◆ GetCellNoiseFilterEnabled()

Result< bool > GetCellNoiseFilterEnabled ( ) const

Query the state of the cell noise filter.

Returns
Result containing the enable state of the noise filter or an error code.

◆ GetCellOperatingMode()

Result< CellMode > GetCellOperatingMode ( unsigned int  cell) const

Query a single cell's operating mode.

Parameters
[in]celltarget cell index
Returns
Result containing the cell operating mode or an error code.

◆ GetCellSenseRange()

Result< CellSenseRange > GetCellSenseRange ( unsigned int  cell) const

Query a single cell's current sense range.

Parameters
[in]celltarget cell index
Returns
Result containing the cell's sense range or an error code.

◆ GetCellSinkingLimit()

Result< float > GetCellSinkingLimit ( unsigned int  cell) const

Query a single cell's sinking current limit.

Parameters
[in]celltarget cell index
Returns
Result containing the cell's sinking current limit or an error code.

◆ GetCellSourcingLimit()

Result< float > GetCellSourcingLimit ( unsigned int  cell) const

Query a single cell's sourcing current limit.

Parameters
[in]celltarget cell index
Returns
Result containing the cell's sourcing current limit or an error code.

◆ GetCellVoltageTarget()

Result< float > GetCellVoltageTarget ( unsigned int  cell) const

Query a single cell's voltage set point.

Parameters
[in]celltarget cell index
Returns
Result containing the cell's voltage set point or an error code.

◆ GetDeviceId()

Result< std::uint8_t > GetDeviceId ( ) const

Query the device's serial ID.

Returns
Result containing the device ID or an error code.

◆ GetDeviceInfo()

Result< DeviceInfo > GetDeviceInfo ( ) const

Query general information about the unit.

Returns
Result containing a DeviceInfo structure or an error code.

◆ GetDigitalOutput()

Result< bool > GetDigitalOutput ( unsigned int  channel) const

Query a digital output's state.

Parameters
[in]channeltarget channel index
Returns
Result containing the output state or an error code.

◆ GetDriver() [1/2]

std::shared_ptr< const drivers::CommDriver > GetDriver ( ) const
noexcept
Returns
Pointer to the comm driver.

◆ GetDriver() [2/2]

std::shared_ptr< drivers::CommDriver > GetDriver ( )
noexcept
Returns
Pointer to the comm driver.

◆ GetErrorCount()

Result< int > GetErrorCount ( ) const

Query the number of errors in the device's error queue.

Returns
Result containing the error count or an error code.

◆ GetGlobalModelInput()

Result< float > GetGlobalModelInput ( unsigned int  index) const

Query a single global model input.

Parameters
[in]indexindex of the input, 0-7
Returns
Result containing the value of the input or an error code.

◆ GetInterlockState()

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.

Returns
Result containing the interlock state or an error code.

◆ GetIPAddress()

Result< EthernetConfig > GetIPAddress ( ) const

Query the device's IP address and subnet mask.

Returns
Result containing the IP address or an error code.

◆ GetLocalModelInput()

Result< float > GetLocalModelInput ( unsigned int  index) const

Query a single local model input.

Parameters
[in]indexindex of the input, 0-7
Returns
Result containing the value of the input or an error code.

◆ GetModelInfo()

Result< ModelInfo > GetModelInfo ( ) const

Query information about the currently loaded model.

Returns
Result containing information about the model or an error code.

◆ GetModelOutput()

Result< float > GetModelOutput ( unsigned int  index) const

Query a single model output.

Parameters
[in]indexindex of the output, 0-35
Returns
Result containing the output value or an error code.

◆ GetModelStatus()

Result< std::uint8_t > GetModelStatus ( ) const

Query the model status.

Returns
Result containing the model status bitmask or an error code.

◆ GetNextError()

Result< ScpiError > GetNextError ( ) const

Pop the next error from the SCPI error queue.

Returns
Result containing the error or an error code.

◆ GetTargetDeviceID()

Result< unsigned int > GetTargetDeviceID ( ) const
Returns
Result containing the targeted device ID or an error code.

◆ LoadModel()

ErrorCode LoadModel ( ) const

Load the model configuration on the device.

Returns
An error code.

◆ MeasureAllAnalogInputs() [1/4]

Result< std::array< float, kAnalogInputCount > > MeasureAllAnalogInputs ( ) const

Measure all analog inputs.

Returns
Result containing an array of voltages or an error code.

◆ MeasureAllAnalogInputs() [2/4]

ErrorCode MeasureAllAnalogInputs ( float *  voltages,
std::size_t  count 
) const

Measure all analog inputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]voltagesarray to store the measured voltages
[in]countlength of the array (must not be greater than the total channel count)
Returns
An error code.

◆ MeasureAllAnalogInputs() [3/4]

ErrorCode MeasureAllAnalogInputs ( std::array< float, kAnalogInputCount > &  voltages) const

Measure all analog inputs.

Parameters
[out]voltagesan array of analog input voltages
Returns
An error code.

◆ MeasureAllAnalogInputs() [4/4]

ErrorCode MeasureAllAnalogInputs ( std::span< float >  voltages) const

Measure all analog inputs.

Parameters
[out]voltagesan array of voltages (must not be longer than the total channel count)
Returns
An error code.

◆ MeasureAllCellCurrents() [1/4]

Result< std::array< float, kCellCount > > MeasureAllCellCurrents ( ) const

Measure all cells' currents.

Returns
Result containing an array of cell currents or an error code.

◆ MeasureAllCellCurrents() [2/4]

ErrorCode MeasureAllCellCurrents ( float *  currents,
std::size_t  count 
) const

Measure all cells' currents.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]currentsarray to store the measured currents
[in]countlength of the array (must not be greater than the total cell count)
Returns
An error code.

◆ MeasureAllCellCurrents() [3/4]

ErrorCode MeasureAllCellCurrents ( std::array< float, kCellCount > &  currents) const

Measure all cells' currents.

Parameters
[out]currentsan array of cell currents
Returns
An error code.

◆ MeasureAllCellCurrents() [4/4]

ErrorCode MeasureAllCellCurrents ( std::span< float >  currents) const

Measure all cells' currents.

Parameters
[out]currentsan array of cell currents (must not be longer than the total cell count)
Returns
An error code.

◆ MeasureAllCellVoltages() [1/4]

Result< std::array< float, kCellCount > > MeasureAllCellVoltages ( ) const

Measure all cells' voltages.

Returns
Result containing an array of cell voltages or an error code.

◆ MeasureAllCellVoltages() [2/4]

ErrorCode MeasureAllCellVoltages ( float *  voltages,
std::size_t  count 
) const

Measure all cells' voltages.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[out]voltagesarray to store the measured voltages
[in]countlength of the array (must not be greater than the total cell count)
Returns
An error code.

◆ MeasureAllCellVoltages() [3/4]

ErrorCode MeasureAllCellVoltages ( std::array< float, kCellCount > &  voltages) const

Measure all cells' voltages.

Parameters
[out]voltagesan array of cell voltages
Returns
An error code.

◆ MeasureAllCellVoltages() [4/4]

ErrorCode MeasureAllCellVoltages ( std::span< float >  voltages) const

Measure all cells' voltages.

Parameters
[out]voltagesan array of cell voltages (must not be longer than the total cell count)
Returns
An error code.

◆ MeasureAllDigitalInputs()

Result< std::array< bool, kDigitalInputCount > > MeasureAllDigitalInputs ( ) const

Measure all digital inputs.

Returns
Result containing an array of input states or an error code.

◆ MeasureAllDigitalInputsMasked()

Result< unsigned int > MeasureAllDigitalInputsMasked ( ) const

Measure all digital inputs.

Returns
Result containing a bitmask of input states or an error code.

◆ MeasureAnalogInput()

Result< float > MeasureAnalogInput ( unsigned int  channel) const

Measure a single analog input.

Parameters
[in]channeltarget channel index
Returns
Result containing the analog input voltage or an error code.

◆ MeasureCellCurrent()

Result< float > MeasureCellCurrent ( unsigned int  cell) const

Measure a single cell's current.

Parameters
[in]celltarget cell index
Returns
Result containing the cell current or an error code.

◆ MeasureCellVoltage()

Result< float > MeasureCellVoltage ( unsigned int  cell) const

Measure a single cell's voltage.

Parameters
[in]celltarget cell index
Returns
Result containing the cell voltage or an error code.

◆ MeasureDigitalInput()

Result< bool > MeasureDigitalInput ( unsigned int  channel) const

Measure a single digital input.

Parameters
[in]channeltarget channel count
Returns
Result containing the input state or an error code.

◆ operator=()

ScpiClient & operator= ( ScpiClient &&  rhs)
noexcept

Move assign from another ScpiClient.

Parameters
[in]rhsScpiClient to move from
Returns
Reference to self.

◆ Reboot()

ErrorCode Reboot ( ) const

Reboot the unit.

Note
You will need to reopen the connection if using TCP.
Returns
An error code.

◆ Send()

ErrorCode Send ( std::string_view  buf) const
protected

Send a message to the ABS.

Checks for driver validity.

Parameters
[in]bufdata to send
Returns
An error code.

◆ SendAndRecv()

Result< std::string > SendAndRecv ( std::string_view  buf) const
protected

Send a message to the ABS and wait for a response.

Checks for driver validity.

Parameters
[in]bufdata to send
Returns
Result containing the response or an error code.

◆ SetAllAnalogOutputs() [1/4]

ErrorCode SetAllAnalogOutputs ( const float *  voltages,
std::size_t  count 
) const

Set all analog outputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]voltagesarray of voltages
[in]countlength of the array (must not be greater than the total channel count)
Returns
An error code.

◆ SetAllAnalogOutputs() [2/4]

ErrorCode SetAllAnalogOutputs ( const std::array< float, kAnalogOutputCount > &  voltages) const

Set all analog outputs.

Parameters
[in]voltagesarray of voltages
Returns
An error code.

◆ SetAllAnalogOutputs() [3/4]

ErrorCode SetAllAnalogOutputs ( float  voltage) const

Set all analog outputs to the same value.

Parameters
[in]voltagedesired voltage
Returns
An error code.

◆ SetAllAnalogOutputs() [4/4]

ErrorCode SetAllAnalogOutputs ( std::span< const float >  voltages) const

Set all analog outputs.

Parameters
[in]voltagesarray of voltages (must not be longer than the total channel count)
Returns
An error code.

◆ SetAllCellFaults() [1/4]

ErrorCode SetAllCellFaults ( CellFault  fault) const

Set all cells' faulting states to the same value.

Parameters
[in]faultdesired cell fault
Returns
An error code.

◆ SetAllCellFaults() [2/4]

ErrorCode SetAllCellFaults ( const CellFault faults,
std::size_t  count 
) const

Set all cells' faulting states.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]faultsan array of cell fault states
[in]countthe length of the array (must not be greater than the total cell count)
Returns
An error code.

◆ SetAllCellFaults() [3/4]

ErrorCode SetAllCellFaults ( const std::array< CellFault, kCellCount > &  faults) const

Set all cells' faulting states.

Parameters
[in]faultsan array of fault states
Returns
An error code.

◆ SetAllCellFaults() [4/4]

ErrorCode SetAllCellFaults ( std::span< const CellFault faults) const

Set all cells' faulting states.

Parameters
[in]faultsan array of fault states (must not be longer than the total cell count)
Returns
An error code.

◆ SetAllCellSenseRanges() [1/4]

ErrorCode SetAllCellSenseRanges ( CellSenseRange  range) const

Set all cells' current sense ranges to the same value.

Parameters
[in]rangedesired sense range
Returns
An error code.

◆ SetAllCellSenseRanges() [2/4]

ErrorCode SetAllCellSenseRanges ( const CellSenseRange ranges,
std::size_t  count 
) const

Set all cells' current sense ranges.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]rangesan array of sense ranges
[in]countthe length of the array (must not be greater than the total cell count)
Returns
An error code.

◆ SetAllCellSenseRanges() [3/4]

ErrorCode SetAllCellSenseRanges ( const std::array< CellSenseRange, kCellCount > &  ranges) const

Set all cells' current sense ranges.

Parameters
[in]rangesan array of sense ranges
Returns
An error code.

◆ SetAllCellSenseRanges() [4/4]

ErrorCode SetAllCellSenseRanges ( std::span< const CellSenseRange ranges) const

Set all cells' current sense ranges.

Parameters
[in]rangesan array of sense ranges (must not be longer than the total cell count)
Returns
An error code.

◆ SetAllCellSinking() [1/4]

ErrorCode SetAllCellSinking ( const float *  limits,
std::size_t  count 
) const

Set all cells' sinking current limits.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]limitsarray of sinking current limits (may be positive or negative)
[in]countnumber of cells to set (must not be greater than the total cell count)
Returns
An error code.

◆ SetAllCellSinking() [2/4]

ErrorCode SetAllCellSinking ( const std::array< float, kCellCount > &  limits) const

Set all cells' sinking current limits.

Parameters
[in]limitsarray of sinking current limits
Returns
An error code.

◆ SetAllCellSinking() [3/4]

ErrorCode SetAllCellSinking ( float  limit) const

Set all cells' sinking current limits to the same value.

Parameters
[in]limitdesired sinking current limit (may be positive or negative)
Returns
An error code.

◆ SetAllCellSinking() [4/4]

ErrorCode SetAllCellSinking ( std::span< const float >  limits) const

Set all cells' sinking current limits.

Parameters
[in]limitsarray of sinking current limits (must not be longer than the total cell count)
Returns
An error code.

◆ SetAllCellSourcing() [1/4]

ErrorCode SetAllCellSourcing ( const float *  limits,
std::size_t  count 
) const

Set all cells' sourcing current limits.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]limitsarray of sourcing current limits
[in]countnumber of cells to set (must not be greater than the total cell count)
Returns
An error code.

◆ SetAllCellSourcing() [2/4]

ErrorCode SetAllCellSourcing ( const std::array< float, kCellCount > &  limits) const

Set all cells' sourcing current limits.

Parameters
[in]limitsarray of sourcing current limits
Returns
An error code.

◆ SetAllCellSourcing() [3/4]

ErrorCode SetAllCellSourcing ( float  limit) const

Set all cells' sourcing current limits to the same value.

Parameters
[in]limitdesired sourcing current limit
Returns
An error code.

◆ SetAllCellSourcing() [4/4]

ErrorCode SetAllCellSourcing ( std::span< const float >  limits) const

Set all cells' sourcing current limits.

Parameters
[in]limitsarray of sourcing current limits (must not be longer than the total cell count)
Returns
An error code.

◆ SetAllCellVoltages() [1/4]

ErrorCode SetAllCellVoltages ( const float *  voltages,
std::size_t  count 
) const

Set all cells' voltages.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]voltagespointer to an array of cell voltages
[in]counthow many cells to set (how many entries are in the voltages array)
Returns
An error code.

◆ SetAllCellVoltages() [2/4]

ErrorCode SetAllCellVoltages ( const std::array< float, kCellCount > &  voltages) const

Set all cells' voltages.

Parameters
[in]voltagestarget voltages, one per cell
Returns
An error code.

◆ SetAllCellVoltages() [3/4]

ErrorCode SetAllCellVoltages ( float  voltage) const

Set all cells' voltages to the same value.

Parameters
[in]voltagetarget voltage
Returns
An error code.

◆ SetAllCellVoltages() [4/4]

ErrorCode SetAllCellVoltages ( std::span< const float >  voltages) const

Set all cells' voltages.

Parameters
[in]voltagestarget voltages, one per cell (there may not be more entries than cells)
Returns
An error code.

◆ SetAllDigitalOutputs() [1/3]

ErrorCode SetAllDigitalOutputs ( bool  level) const

Set all digital outputs to the same state.

Parameters
[in]leveldesired output state
Returns
An error code.

◆ SetAllDigitalOutputs() [2/3]

ErrorCode SetAllDigitalOutputs ( const std::array< bool, kDigitalOutputCount > &  levels) const

Set all digital outputs.

Parameters
[in]levelsan array of output states
Returns
An error code.

◆ SetAllDigitalOutputs() [3/3]

ErrorCode SetAllDigitalOutputs ( std::span< const bool >  levels) const

Set all digital outputs.

Parameters
[in]levelsan array of output states (must not be longer than the total channel count)
Returns
An error code.

◆ SetAllDigitalOutputsMasked()

ErrorCode SetAllDigitalOutputsMasked ( unsigned int  channels,
bool  level 
) const

Set all digital outputs.

Parameters
[in]channelsa bitmask of channels to control, 1 bit per channel
[in]levelthe desired output state
Returns
An error code.

◆ SetAllGlobalModelInputs() [1/4]

ErrorCode SetAllGlobalModelInputs ( const float *  values,
std::size_t  count 
) const

Set many global model inputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]valuesarray of values, one per input
[in]countlength of the array (must not be greater than the total number of inputs)
Returns
An error code.

◆ SetAllGlobalModelInputs() [2/4]

ErrorCode SetAllGlobalModelInputs ( const std::array< float, kGlobalModelInputCount > &  values) const

Set all global model inputs.

Parameters
[in]valuesarray of values, one per input
Returns
An error code.

◆ SetAllGlobalModelInputs() [3/4]

ErrorCode SetAllGlobalModelInputs ( float  value) const

Set all global model inputs to the same value.

Parameters
[in]valuethe input value
Returns
An error code.

◆ SetAllGlobalModelInputs() [4/4]

ErrorCode SetAllGlobalModelInputs ( std::span< const float >  values) const

Set many global model inputs.

Parameters
[in]valuesarray of values, one per input (must not be longer than the total number of inputs)
Returns
An error code.

◆ SetAllLocalModelInputs() [1/4]

ErrorCode SetAllLocalModelInputs ( const float *  values,
std::size_t  count 
) const

Set many local model inputs.

Note
It is recommended that the array and span overloads be preferred over this overload whenever possible.
Parameters
[in]valuesarray of values, one per input
[in]countlength of the array (must not be greater than the total number of inputs)
Returns
An error code.

◆ SetAllLocalModelInputs() [2/4]

ErrorCode SetAllLocalModelInputs ( const std::array< float, kLocalModelInputCount > &  values) const

Set all local model inputs.

Parameters
[in]valuesarray of values, one per input
Returns
An error code.

◆ SetAllLocalModelInputs() [3/4]

ErrorCode SetAllLocalModelInputs ( float  value) const

Set all local model inputs to the same value.

Parameters
[in]valuethe input value
Returns
An error code.

◆ SetAllLocalModelInputs() [4/4]

ErrorCode SetAllLocalModelInputs ( std::span< const float >  values) const

Set many local model inputs.

Parameters
[in]valuesarray of values, one per input (must not be longer than the total number of inputs)
Returns
An error code.

◆ SetAnalogOutput()

ErrorCode SetAnalogOutput ( unsigned int  channel,
float  voltage 
) const

Set a single analog output.

Parameters
[in]channeltarget channel index
[in]voltagedesired voltage
Returns
An error code.

◆ SetCellFault()

ErrorCode SetCellFault ( unsigned int  cell,
CellFault  fault 
) const

Set a single cell's faulting state.

Parameters
[in]celltarget cell index
[in]faultdesired cell fault
Returns
An error code.

◆ SetCellSenseRange()

ErrorCode SetCellSenseRange ( unsigned int  cell,
CellSenseRange  range 
) const

Set a single cell's current sense range.

Parameters
[in]celltarget cell index
[in]rangedesired sense range
Returns
An error code.

◆ SetCellSinking()

ErrorCode SetCellSinking ( unsigned int  cell,
float  limit 
) const

Set a single cell's sinking current limit.

Parameters
[in]celltarget cell index
[in]limitdesired sinking current limit (may be positive or negative)
Returns
An error code.

◆ SetCellSourcing()

ErrorCode SetCellSourcing ( unsigned int  cell,
float  limit 
) const

Set a single cell's sourcing current limit.

Parameters
[in]celltarget cell index
[in]limitdesired sourcing current limit
Returns
An error code.

◆ SetCellVoltage()

ErrorCode SetCellVoltage ( unsigned int  cell,
float  voltage 
) const

Set a single cell's target voltage.

Parameters
[in]celltarget cell index
[in]voltagetarget voltage
Returns
An error code.

◆ SetDigitalOutput()

ErrorCode SetDigitalOutput ( unsigned int  channel,
bool  level 
) const

Set a single digital output.

Parameters
[in]channeltarget channel index
[in]leveldesired output state
Returns
An error code.

◆ SetDriver()

void SetDriver ( std::shared_ptr< drivers::CommDriver driver)
noexcept

Set or replace the comm driver for the client.

Parameters
[in]drivernew driver to use

◆ SetGlobalModelInput()

ErrorCode SetGlobalModelInput ( unsigned int  index,
float  value 
) const

Set a global model input.

Parameters
[in]indexinput index, 0-7
[in]valueinput value
Returns
An error code.

◆ SetIPAddress()

ErrorCode SetIPAddress ( std::string_view  ip,
std::string_view  netmask 
) const

Set the device's IP address and subnet mask.

Note
The addresses must be IPv4 dot-decimal notation, e.g. 192.168.1.100.
You will need to reopen the connection if using Ethernet.
Parameters
[in]ipdesired IP address for the unit
[in]netmaskdesired subnet mask for the unit
Returns
An error code.

◆ SetLocalModelInput()

ErrorCode SetLocalModelInput ( unsigned int  index,
float  value 
) const

Set a local model input.

Parameters
[in]indexinput index, 0-7
[in]valueinput value
Returns
An error code.

◆ SetMultipleAnalogOutputs()

ErrorCode SetMultipleAnalogOutputs ( unsigned int  channels,
float  voltage 
) const

Set multiple analog outputs to the same value.

Parameters
[in]channelsbitmask of channels to target, 1 bit per channel
[in]voltagetarget voltage
Returns
An error code.

◆ SetMultipleCellFaults()

ErrorCode SetMultipleCellFaults ( unsigned int  cells,
CellFault  fault 
) const

Set multiple cells to the same fault state.

Parameters
[in]cellsbitmask of cells to target, one bit per cell
[in]faulttarget fault state
Returns
An error code.

◆ SetMultipleCellSinking()

ErrorCode SetMultipleCellSinking ( unsigned int  cells,
float  limit 
) const

Set multiple cells' sinking current limits to the same value.

Parameters
[in]cellsbitmask of cells to target, 1 bit per cell
[in]limittarget sinking limit
Returns
An error code.

◆ SetMultipleCellSourcing()

ErrorCode SetMultipleCellSourcing ( unsigned int  cells,
float  limit 
) const

Set multiple cells' sourcing current limits to the same value.

Parameters
[in]cellsbitmask of cells to target, 1 bit per cell
[in]limittarget sourcing limit
Returns
An error code.

◆ SetMultipleCellVoltages()

ErrorCode SetMultipleCellVoltages ( unsigned int  cells,
float  voltage 
) const

Set multiple cells' voltages to the same value.

Parameters
[in]cellsbitmask of cells to target, 1 bit per cell
[in]voltagetarget voltage
Returns
An error code.

◆ SetReadTimeout()

unsigned int SetReadTimeout ( unsigned int  timeout_ms)
noexcept

Set the read timeout for the client.

In most cases, this is unnecessary. The default is 150ms.

Parameters
[in]timeout_msnew read timeout in milliseconds
Returns
The previous timeout value.

◆ SetTargetDeviceID()

ErrorCode SetTargetDeviceID ( unsigned int  id)

Change the targeted device ID.

This is currently only meaningful for RS-485.

Parameters
[in]idthe serial ID in the range 0-31, or 32+ to target all devices on a bus
Returns
An error code.

◆ StartModel()

ErrorCode StartModel ( ) const

Start modeling.

Returns
An error code.

◆ StopModel()

ErrorCode StopModel ( ) const

Stop modeling.

Returns
An error code.

◆ UnloadModel()

ErrorCode UnloadModel ( ) const

Unload the model configuration on the device.

Returns
An error code.

The documentation for this class was generated from the following file: