AIOUSB::AO16_AnalogOutputSubsystem Class Reference

#include <AO16_AnalogOutputSubsystem.hpp>

Inheritance diagram for AIOUSB::AO16_AnalogOutputSubsystem:

Inheritance graph
[legend]
Collaboration diagram for AIOUSB::AO16_AnalogOutputSubsystem:

Collaboration graph
[legend]

List of all members.

Public Member Functions

int getRange () const
AO16_AnalogOutputSubsystemsetRange (int range)
AO16_AnalogOutputSubsystemwriteVolts (int channel, double volts)
AO16_AnalogOutputSubsystemwriteVolts (const OutputVoltagePointArray &points)
double countsToVolts (unsigned short counts) const
unsigned short voltsToCounts (double volts) const

Static Public Member Functions

static std::string getRangeText (int range)

Static Public Attributes

static const int RANGE_0_5V = 0
static const int RANGE_5V = 1
static const int RANGE_0_10V = 2
static const int RANGE_10V = 3
static const int MIN_COUNTS = 0
static const int MAX_COUNTS = 0xffff

Protected Member Functions

 AO16_AnalogOutputSubsystem (USBDevice &parent)
virtual ~AO16_AnalogOutputSubsystem ()

Protected Attributes

AO16_OutputRange outputRange

Static Protected Attributes

static const char RANGE_TEXT [][10]

Friends

class USB_AO16_Family


Detailed Description

Class AO16_AnalogOutputSubsystem represents the analog output subsystem of a device. One accesses this analog output subsystem through its parent object, typically through a method such as dac() (see USB_AO16_Family::dac()).

Constructor & Destructor Documentation

AIOUSB::AO16_AnalogOutputSubsystem::AO16_AnalogOutputSubsystem ( USBDevice parent  )  [protected]

AIOUSB::AO16_AnalogOutputSubsystem::~AO16_AnalogOutputSubsystem (  )  [protected, virtual]


Member Function Documentation

double AIOUSB::AO16_AnalogOutputSubsystem::countsToVolts ( unsigned short  counts  )  const [inline]

Converts a single D/A count value to volts, based on the current range setting.

Parameters:
counts the count value to convert to volts.
Returns:
A voltage value calculated using the current D/A range. The voltage value returned is constrained to the current minimum-maximum voltage range of the D/A. (see setRange( int range )).

int AIOUSB::AO16_AnalogOutputSubsystem::getRange (  )  const [inline]

Gets the current voltage range of the D/A outputs.

Returns:
Current voltage range.
See also:
setRange( int range )

std::string AIOUSB::AO16_AnalogOutputSubsystem::getRangeText ( int  range  )  [static]

Gets the textual string for the specified range.

Parameters:
range the range for which to obtain the textual string.
Returns:
The textual string for the specified range.
See also:
setRange( int range )
Exceptions:
IllegalArgumentException 

AO16_AnalogOutputSubsystem & AIOUSB::AO16_AnalogOutputSubsystem::setRange ( int  range  ) 

Sets the voltage range of the D/A outputs.

Parameters:
range the voltage range to select. May be one of:
AO16_AnalogOutputSubsystem::RANGE_0_5V
AO16_AnalogOutputSubsystem::RANGE_5V
AO16_AnalogOutputSubsystem::RANGE_0_10V
AO16_AnalogOutputSubsystem::RANGE_10V
Returns:
This subsystem, useful for chaining together multiple operations.
Exceptions:
IllegalArgumentException 
OperationFailedException 

unsigned short AIOUSB::AO16_AnalogOutputSubsystem::voltsToCounts ( double  volts  )  const [inline]

Converts a single voltage value to D/A counts, based on the current range setting.

Parameters:
volts the voltage value to convert to counts.
Returns:
A count value calculated using the current D/A range. The count value returned is constrained to the current minimum-maximum count range of the D/A. (see setRange( int range )).

AO16_AnalogOutputSubsystem & AIOUSB::AO16_AnalogOutputSubsystem::writeVolts ( const OutputVoltagePointArray points  ) 

Writes a block of voltage values to one or more D/A channels.

Parameters:
points an array of OutputVoltagePoint points representing channel-voltage pairs.
Returns:
This subsystem, useful for chaining together multiple operations.
Exceptions:
IllegalArgumentException 

AO16_AnalogOutputSubsystem & AIOUSB::AO16_AnalogOutputSubsystem::writeVolts ( int  channel,
double  volts 
)

Writes a voltage value to a D/A channel.

Parameters:
channel the channel to write to.
volts the voltage value to output.
Returns:
This subsystem, useful for chaining together multiple operations.


Friends And Related Function Documentation

friend class USB_AO16_Family [friend]


Member Data Documentation

Maximum number of counts D/A can output.

Minimum number of counts D/A can output.

Unipolar, 0-10 volt range (see setRange( int range )).

Unipolar, 0-5 volt range (see setRange( int range )).

Bipolar, -10 to +10 volt range (see setRange( int range )).

Bipolar, -5 to +5 volt range (see setRange( int range )).

const char AIOUSB::AO16_AnalogOutputSubsystem::RANGE_TEXT [static, protected]

Initial value:

 {
    
      "0-5V"
    , "+/-5V"
    , "0-10V"
    , "+/-10V"
}


doxygen