ngscopeclient 0.1-dev+51fbda87c
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members

Base class for all electronic load drivers. More...

#include <Load.h>

Inheritance diagram for Load:
Inheritance graph
[legend]
Collaboration diagram for Load:
Collaboration graph
[legend]

Public Types

enum  LoadMode { MODE_CONSTANT_CURRENT , MODE_CONSTANT_VOLTAGE , MODE_CONSTANT_RESISTANCE , MODE_CONSTANT_POWER }
 Operating modes for the load. More...
 
- Public Types inherited from Instrument
enum  InstrumentTypes {
  INST_OSCILLOSCOPE = 0x01 , INST_DMM = 0x02 , INST_PSU = 0x04 , INST_FUNCTION = 0x08 ,
  INST_RF_GEN = 0x10 , INST_LOAD = 0x20 , INST_BERT = 0x40 , INST_MISC = 0x80 ,
  INST_SWITCH_MATRIX = 0x100
}
 

Public Member Functions

virtual unsigned int GetInstrumentTypes () const override
 Returns a bitfield describing the set of instrument types that this instrument supports. More...
 
virtual bool AcquireData () override
 Pulls data from hardware and updates our measurements. More...
 
virtual LoadMode GetLoadMode (size_t channel)=0
 Returns the operating mode of the load. More...
 
virtual void SetLoadMode (size_t channel, LoadMode mode)=0
 Sets the operating mode of the load. More...
 
virtual std::vector< float > GetLoadCurrentRanges (size_t channel)=0
 Returns a sorted list of operating ranges for the load's current scale, in amps. More...
 
virtual size_t GetLoadCurrentRange (size_t channel)=0
 Returns the index of the load's selected current range, as returned by GetLoadCurrentRanges() More...
 
virtual std::vector< float > GetLoadVoltageRanges (size_t channel)=0
 Returns a sorted list of operating ranges for the load's voltage scale, in volts. More...
 
virtual size_t GetLoadVoltageRange (size_t channel)=0
 Returns the index of the load's selected voltage range, as returned by GetLoadVoltageRanges() More...
 
virtual void SetLoadVoltageRange (size_t channel, size_t rangeIndex)=0
 Select the voltage range to use. More...
 
virtual void SetLoadCurrentRange (size_t channel, size_t rangeIndex)=0
 Select the current range to use. More...
 
virtual bool GetLoadActive (size_t channel)=0
 Returns true if the load is enabled (sinking power) and false if disabled (no load) More...
 
virtual void SetLoadActive (size_t channel, bool active)=0
 Turns the load on or off. More...
 
virtual float GetLoadSetPoint (size_t channel)=0
 Gets the set point for the channel. More...
 
virtual void SetLoadSetPoint (size_t channel, float target)=0
 Sets the set point for the channel. More...
 
- Public Member Functions inherited from Instrument
virtual unsigned int GetInstrumentTypes () const =0
 Returns a bitfield describing the set of instrument types that this instrument supports. More...
 
virtual std::string GetName () const =0
 
virtual std::string GetVendor () const =0
 
virtual std::string GetSerial () const =0
 
virtual std::string GetTransportConnectionString ()=0
 Gets the connection string for our transport. More...
 
virtual std::string GetTransportName ()=0
 Gets the name of our transport. More...
 
virtual uint32_t GetInstrumentTypesForChannel (size_t i) const =0
 Returns a bitfield describing the set of instrument types that a given channel supports. More...
 
size_t GetChannelCount () const
 Gets the number of channels (of any type) this instrument has.
 
InstrumentChannelGetChannel (size_t i) const
 Gets a given channel on the instrument. More...
 
virtual std::string GetChannelDisplayName (size_t i)
 Gets the hardware display name for a channel. This is an arbitrary user-selected string. More...
 
virtual void SetChannelDisplayName (size_t i, std::string name)
 Sets the hardware display name for a channel. This is an arbitrary user-selected string. More...
 
InstrumentChannelGetChannelByDisplayName (const std::string &name)
 Gets a channel given the display name.
 
InstrumentChannelGetChannelByHwName (const std::string &name)
 Gets a channel given the hardware name.
 
virtual bool AcquireData ()=0
 Pull data from the instrument. More...
 
virtual YAML::Node SerializeConfiguration (IDTable &table) const
 Serializes this instrument's configuration to a YAML node. More...
 
virtual void LoadConfiguration (int version, const YAML::Node &node, IDTable &idmap)
 Load instrument and channel configuration from a save file. More...
 
virtual void PreLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &warnings)
 Parse a limited subset of instrument configuration but do not apply it. More...
 

Static Public Member Functions

static std::string GetNameOfLoadMode (LoadMode mode)
 Convert a LoadMode to a printable string. More...
 
static LoadMode GetLoadModeOfName (const std::string &name)
 Convert a printable string to a LoadMode. More...
 

Protected Member Functions

virtual float GetLoadVoltageActual (size_t channel)=0
 Get the measured voltage of the load (uncached instantaneous measurement) More...
 
virtual float GetLoadCurrentActual (size_t channel)=0
 Get the measured current of the load (uncached instantaneous measurement) More...
 
void DoSerializeConfiguration (YAML::Node &node, IDTable &table)
 Serializes this multimeter's configuration to a YAML node.
 
void DoLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap)
 Load instrument and channel configuration from a save file.
 
void DoPreLoadConfiguration (int version, const YAML::Node &node, IDTable &idmap, ConfigWarningList &list)
 Validate instrument and channel configuration from a save file.
 

Additional Inherited Members

- Public Attributes inherited from Instrument
std::string m_nickname
 Optional user-selected nickname of the instrument. More...
 
- Protected Attributes inherited from Instrument
std::list< sigc::slot< void(YAML::Node &, IDTable &)> > m_serializers
 List of methods which need to be called to serialize this node's configuration.
 
std::list< sigc::slot< void(int, const YAML::Node &, IDTable &)> > m_loaders
 List of methods which need to be called to deserialize this node's configuration.
 
std::list< sigc::slot< void(int, const YAML::Node &, IDTable &, ConfigWarningList &)> > m_preloaders
 List of methods which need to be called to pre-load this node's configuration.
 
std::vector< InstrumentChannel * > m_channels
 Set of all channels on this instrument.
 

Detailed Description

Base class for all electronic load drivers.

Member Enumeration Documentation

◆ LoadMode

Operating modes for the load.

Enumerator
MODE_CONSTANT_CURRENT 

Draw a constant current regardless of supplied voltage.

MODE_CONSTANT_VOLTAGE 

Draw as much current as needed for the input voltage to drop to the specified level.

MODE_CONSTANT_RESISTANCE 

Emulate a fixed resistance.

MODE_CONSTANT_POWER 

Draw a constant power regardless of supplied voltage.

Member Function Documentation

◆ AcquireData()

bool Load::AcquireData ( )
overridevirtual

Pulls data from hardware and updates our measurements.

Implements Instrument.

◆ GetInstrumentTypes()

unsigned int Load::GetInstrumentTypes ( ) const
overridevirtual

Returns a bitfield describing the set of instrument types that this instrument supports.

Not all types may be available on a given channel.

Implements Instrument.

Reimplemented in SiglentLoad.

◆ GetLoadActive()

virtual bool Load::GetLoadActive ( size_t  channel)
pure virtual

Returns true if the load is enabled (sinking power) and false if disabled (no load)

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadCurrentActual()

virtual float Load::GetLoadCurrentActual ( size_t  channel)
protectedpure virtual

Get the measured current of the load (uncached instantaneous measurement)

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadCurrentRange()

virtual size_t Load::GetLoadCurrentRange ( size_t  channel)
pure virtual

Returns the index of the load's selected current range, as returned by GetLoadCurrentRanges()

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadCurrentRanges()

virtual std::vector< float > Load::GetLoadCurrentRanges ( size_t  channel)
pure virtual

Returns a sorted list of operating ranges for the load's current scale, in amps.

For example, returning [1, 10] means the load supports one mode with 1A full scale range and one with 10A range.

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadMode()

virtual LoadMode Load::GetLoadMode ( size_t  channel)
pure virtual

Returns the operating mode of the load.

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadModeOfName()

Load::LoadMode Load::GetLoadModeOfName ( const std::string &  name)
static

Convert a printable string to a LoadMode.

If an invalid input is provided, returns MODE_CONSTANT_CURRENT.

Parameters
nameName of the mode
Returns
Enumerated equivalent ofname

◆ GetLoadSetPoint()

virtual float Load::GetLoadSetPoint ( size_t  channel)
pure virtual

Gets the set point for the channel.

Units vary depending on operating mode: amps (CC), volts (CV), ohms (CR), watts (CP).

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadVoltageActual()

virtual float Load::GetLoadVoltageActual ( size_t  channel)
protectedpure virtual

Get the measured voltage of the load (uncached instantaneous measurement)

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadVoltageRange()

virtual size_t Load::GetLoadVoltageRange ( size_t  channel)
pure virtual

Returns the index of the load's selected voltage range, as returned by GetLoadVoltageRanges()

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetLoadVoltageRanges()

virtual std::vector< float > Load::GetLoadVoltageRanges ( size_t  channel)
pure virtual

Returns a sorted list of operating ranges for the load's voltage scale, in volts.

For example, returning [10, 250] means the load supports one mode with 10V full scale range and one with 250V range.

Parameters
channelIndex of the channel to query

Implemented in SiglentLoad.

◆ GetNameOfLoadMode()

string Load::GetNameOfLoadMode ( LoadMode  mode)
static

Convert a LoadMode to a printable string.

Parameters
modeInput mode
Returns
Text equivalent of mode

◆ SetLoadActive()

virtual void Load::SetLoadActive ( size_t  channel,
bool  active 
)
pure virtual

Turns the load on or off.

Parameters
channelIndex of the channel to query
activeTrue to turn the load on, false to turn it off

Implemented in SiglentLoad.

◆ SetLoadCurrentRange()

virtual void Load::SetLoadCurrentRange ( size_t  channel,
size_t  rangeIndex 
)
pure virtual

Select the current range to use.

Parameters
channelChannel index
rangeIndexIndex of the range, as returned by GetLoadCurrentRanges()

Implemented in SiglentLoad.

◆ SetLoadMode()

virtual void Load::SetLoadMode ( size_t  channel,
LoadMode  mode 
)
pure virtual

Sets the operating mode of the load.

Parameters
channelChannel index
modeOperating mode

Implemented in SiglentLoad.

◆ SetLoadSetPoint()

virtual void Load::SetLoadSetPoint ( size_t  channel,
float  target 
)
pure virtual

Sets the set point for the channel.

Units vary depending on operating mode: amps (CC), volts (CV), ohms (CR), watts (CP).

Parameters
channelIndex of the channel to query
targetDesired operating current/voltage/resistance/power depending on the operating mode

Implemented in SiglentLoad.

◆ SetLoadVoltageRange()

virtual void Load::SetLoadVoltageRange ( size_t  channel,
size_t  rangeIndex 
)
pure virtual

Select the voltage range to use.

Parameters
channelChannel index
rangeIndexIndex of the range, as returned by GetLoadVoltageRanges()

Implemented in SiglentLoad.


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