nidas v1.2.3
Public Member Functions | Private Attributes | List of all members
nidas::dynld::DSC_AnalogOut Class Reference

Support for the D2A device on a Diamond DMMAT card. More...

#include <DSC_AnalogOut.h>

Public Member Functions

 DSC_AnalogOut ()
 
 ~DSC_AnalogOut ()
 
void setDeviceName (const std::string &val)
 
const std::string & getDeviceName () const
 
const std::string & getName () const
 
int getFd () const
 
void open ()
 Open the D2A.
 
void close ()
 Close the D2A.
 
int getNumOutputs () const
 Return number of VOUT pins on this device.
 
float getMinVoltage (int i) const
 Return the minimum setable voltage of an output.
 
float getMaxVoltage (int i) const
 Return the maximum setable voltage of an output.
 
void setVoltage (int which, float val)
 Set a voltage on an output.
 
void setVoltages (const std::vector< int > &which, const std::vector< float > &val)
 Set one or more outputs.
 
void clearVoltages ()
 

Private Attributes

std::string _devName
 
int _fd
 The file descriptor of this device.
 
int _noutputs
 How many VOUT pins are on this device?
 
struct DMMAT_D2A_Conversion _conv
 Linear parameters for converting a voltage to an integer count, which is sent to the device.
 

Detailed Description

Support for the D2A device on a Diamond DMMAT card.

Constructor & Destructor Documentation

◆ DSC_AnalogOut()

DSC_AnalogOut::DSC_AnalogOut ( )

◆ ~DSC_AnalogOut()

DSC_AnalogOut::~DSC_AnalogOut ( )

References _fd, and close().

Member Function Documentation

◆ clearVoltages()

void DSC_AnalogOut::clearVoltages ( )

◆ close()

void DSC_AnalogOut::close ( )

Close the D2A.

Exceptions
nidas::util::IOException

References _fd, and close().

Referenced by close(), nidas::dynld::DSC_A2DSensor::~DSC_A2DSensor(), and ~DSC_AnalogOut().

◆ getDeviceName()

const std::string & nidas::dynld::DSC_AnalogOut::getDeviceName ( ) const
inline

References _devName.

◆ getFd()

int nidas::dynld::DSC_AnalogOut::getFd ( ) const
inline

References _fd.

◆ getMaxVoltage()

float DSC_AnalogOut::getMaxVoltage ( int i) const

Return the maximum setable voltage of an output.

References _conv, _noutputs, and nidas::core::getSample().

◆ getMinVoltage()

float DSC_AnalogOut::getMinVoltage ( int i) const

Return the minimum setable voltage of an output.

References _conv, _noutputs, and nidas::core::getSample().

◆ getName()

const std::string & nidas::dynld::DSC_AnalogOut::getName ( ) const
inline

References _devName.

Referenced by setVoltages().

◆ getNumOutputs()

int nidas::dynld::DSC_AnalogOut::getNumOutputs ( ) const
inline

Return number of VOUT pins on this device.

Value will be 0 if the device has not been opened, or -1 if the open failed.

References _noutputs.

Referenced by nidas::dynld::raf::CVIProcessor::attachLVInput().

◆ open()

void DSC_AnalogOut::open ( )

◆ setDeviceName()

void nidas::dynld::DSC_AnalogOut::setDeviceName ( const std::string & val)
inline

◆ setVoltage()

void DSC_AnalogOut::setVoltage ( int which,
float val )

Set a voltage on an output.

Parameters
whichWhich VOUT pin, numbered from 0.
valDesired voltage value. If val is outside the known limit of the D2A, the request will be changed to the corresponding limit value. Throws nidas::util::InvalidParameterException if "which" is out of range.
Exceptions
nidas::util::IOException
nidas::util::InvalidParameterException

References nidas::core::getSample(), and setVoltages().

◆ setVoltages()

void DSC_AnalogOut::setVoltages ( const std::vector< int > & which,
const std::vector< float > & val )

Set one or more outputs.

Parameters
whichVector of VOUT pin numbers, numbered from 0.
valDesired voltage values. If a val is outside the known limit of the D2A, the request will be changed to the corresponding limit value. Throws nidas::util::InvalidParameterException if "which" is out of range.
Exceptions
nidas::util::IOException
nidas::util::InvalidParameterException

References _conv, _devName, _fd, _noutputs, DMMAT_D2A_SET, getName(), and nidas::core::getSample().

Referenced by setVoltage().

Member Data Documentation

◆ _conv

struct DMMAT_D2A_Conversion nidas::dynld::DSC_AnalogOut::_conv
private

Linear parameters for converting a voltage to an integer count, which is sent to the device.

Referenced by getMaxVoltage(), getMinVoltage(), open(), and setVoltages().

◆ _devName

std::string nidas::dynld::DSC_AnalogOut::_devName
private

◆ _fd

int nidas::dynld::DSC_AnalogOut::_fd
private

The file descriptor of this device.

Referenced by clearVoltages(), close(), getFd(), open(), setVoltages(), and ~DSC_AnalogOut().

◆ _noutputs

int nidas::dynld::DSC_AnalogOut::_noutputs
private

How many VOUT pins are on this device?

Referenced by clearVoltages(), getMaxVoltage(), getMinVoltage(), getNumOutputs(), open(), and setVoltages().


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