nidas
v1.2-1520
|
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... | |
Support for the D2A device on a Diamond DMMAT card.
DSC_AnalogOut::DSC_AnalogOut | ( | ) |
void DSC_AnalogOut::close | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
|
inline |
References _devName.
|
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().
|
inline |
References _devName.
|
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().
|
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.
which | Which VOUT pin, numbered from 0. |
val | Desired 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.
which | Vector of VOUT pin numbers, numbered from 0. |
val | Desired 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().
|
private |
Linear parameters for converting a voltage to an integer count, which is sent to the device.
Referenced by getMaxVoltage(), getMinVoltage(), and open().
|
private |
Referenced by getDeviceName(), getName(), open(), and setDeviceName().
|
private |
The file descriptor of this device.
Referenced by close(), getFd(), open(), and ~DSC_AnalogOut().
|
private |
How many VOUT pins are on this device?
Referenced by getMaxVoltage(), getMinVoltage(), getNumOutputs(), and open().