nidas  v1.2-1520
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 () throw (nidas::util::IOException)
 Open the D2A. More...
 
void close () throw (nidas::util::IOException)
 Close the D2A. More...
 
int getNumOutputs () const
 Return number of VOUT pins on this device. More...
 
float getMinVoltage (int i) const
 Return the minimum setable voltage of an output. More...
 
float getMaxVoltage (int i) const
 Return the maximum setable voltage of an output. More...
 
void setVoltage (int which, float val) throw (nidas::util::IOException, nidas::util::InvalidParameterException)
 Set a voltage on an output. More...
 
void setVoltages (const std::vector< int > &which, const std::vector< float > &val) throw (nidas::util::IOException, nidas::util::InvalidParameterException)
 Set one or more outputs. More...
 

Private Attributes

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

Detailed Description

Support for the D2A device on a Diamond DMMAT card.

Constructor & Destructor Documentation

DSC_AnalogOut::DSC_AnalogOut ( )
DSC_AnalogOut::~DSC_AnalogOut ( )

References _fd, and close().

Member Function Documentation

void DSC_AnalogOut::close ( )
throw (nidas::util::IOException
)

Close the D2A.

References _fd.

Referenced by DmdA2dCk::run(), and ~DSC_AnalogOut().

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

References _devName.

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

References _fd.

float DSC_AnalogOut::getMaxVoltage ( int  i) const

Return the maximum setable voltage of an output.

References _conv, _noutputs, and DMMAT_D2A_Conversion::vmax.

Referenced by main(), and DmdA2dCk::run().

float DSC_AnalogOut::getMinVoltage ( int  i) const

Return the minimum setable voltage of an output.

References _conv, _noutputs, and DMMAT_D2A_Conversion::vmin.

Referenced by main(), and DmdA2dCk::run().

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

References _devName.

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 main(), and DmdA2dCk::run().

void DSC_AnalogOut::open ( )
throw (nidas::util::IOException
)

Open the D2A.

References _conv, _devName, _fd, _noutputs, DMMAT_D2A_GET_CONVERSION, and DMMAT_D2A_GET_NOUTPUTS.

Referenced by main(), and DmdA2dCk::run().

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

References _devName.

Referenced by main(), and DmdA2dCk::run().

void DSC_AnalogOut::setVoltage ( int  which,
float  val 
)
throw (nidas::util::IOException,
nidas::util::InvalidParameterException
)

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.

Referenced by DmdA2dCk::run().

void DSC_AnalogOut::setVoltages ( const std::vector< int > &  which,
const std::vector< float > &  val 
)
throw (nidas::util::IOException,
nidas::util::InvalidParameterException
)

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.

References DMMAT_D2A_Outputs::active, DMMAT_D2A_Outputs::counts, DMMAT_D2A_SET, and DMMAT_D2A_Outputs::nout.

Referenced by main().

Member Data Documentation

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(), and open().

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

The file descriptor of this device.

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

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

How many VOUT pins are on this device?

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


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