irioCoreCpp Library Module  2.1.0
irio::Module Class Reference

Manage conversion information for the ADC/DAC of a module. More...

#include <modules.h>

Inheritance diagram for irio::Module:

Public Member Functions

 Module (const ModulesType &id=ModulesType::NoModule)
 Constructor. More...
 
void setCouplingMode (const CouplingMode &mode)
 Sets a new coupling mode, changing the conversion constants accordingly. More...
 
CouplingMode getCouplingMode () const
 Returns the actual configured coupling mode. More...
 
double getCVADC () const
 Conversion to Volts of analog inputs. More...
 
double getCVDAC () const
 Conversion from Volts for analog outputs. More...
 
double getMaxValAO () const
 Maximum value to be written in an analog output. More...
 
double getMinValAO () const
 Minimum value to be written in an analog output. More...
 

Public Attributes

const ModulesType moduleID
 Module identifier.
 

Protected Member Functions

void addConfig (const CouplingMode &mode, const ConfigParams &config)
 Adds a configuration for a specific coupling mode. More...
 

Private Attributes

std::unordered_map< CouplingMode, const ConfigParamsm_availableConfigs
 A map that stores available configurations for different coupling modes.
 
CouplingMode m_couplingMode = CouplingMode::None
 Current coupling mode.
 
ConfigParams m_currentConfig
 Current config values for the selected coupling mode.
 

Detailed Description

Manage conversion information for the ADC/DAC of a module.

Definition at line 81 of file modules.h.

Constructor & Destructor Documentation

◆ Module()

irio::Module::Module ( const ModulesType id = ModulesType::NoModule)
explicit

Constructor.

Set parameters for all supported coupling modes and identifies the module

Parameters
idModule identifier

Member Function Documentation

◆ addConfig()

void irio::Module::addConfig ( const CouplingMode mode,
const ConfigParams config 
)
protected

Adds a configuration for a specific coupling mode.

Parameters
modeThe coupling mode.
configThe configuration parameters.

◆ getCouplingMode()

CouplingMode irio::Module::getCouplingMode ( ) const

Returns the actual configured coupling mode.

Returns
Actual coupling mode

◆ getCVADC()

double irio::Module::getCVADC ( ) const

Conversion to Volts of analog inputs.

Returns
Constant for Conversion to Volts of analog inputs

◆ getCVDAC()

double irio::Module::getCVDAC ( ) const

Conversion from Volts for analog outputs.

Returns
Constant for conversion from Volts for analog outputs

◆ getMaxValAO()

double irio::Module::getMaxValAO ( ) const

Maximum value to be written in an analog output.

Returns
Maximum value to be written in an analog output

◆ getMinValAO()

double irio::Module::getMinValAO ( ) const

Minimum value to be written in an analog output.

Returns
Minimum value to be written in an analog output

◆ setCouplingMode()

void irio::Module::setCouplingMode ( const CouplingMode mode)

Sets a new coupling mode, changing the conversion constants accordingly.

Exceptions
irio::errors::UnsupportedAICouplingForModuleThe mode is not supported by the module
Parameters
modeNew mode to configure

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