AIOUSB::AnalogIORange Class Reference
#include <AnalogIORange.hpp>
List of all members.
Detailed Description
Class
AnalogIORange helps manage analog I/O range settings and provides voltage-count conversion utilities. A single instance can be used with devices that support just one range, or multiple instances can be used with devices that support multiple ranges, such as a separate range per analog I/O channel. This class also supports changing the range properties. Some devices, for instance, permit the range to be changed at run-time. The class that owns this instance can change the range by calling one or more of the methods of this class. Or, for devices that do not support changing the range, the properties can be set up once and left alone. Or, some properties can be changed and others left alone. For example, devices that permit changing the voltage range usually use a fixed count range.
Constructor & Destructor Documentation
AIOUSB::AnalogIORange::AnalogIORange |
( |
|
) |
|
Constructor which uses the default properties.
AIOUSB::AnalogIORange::AnalogIORange |
( |
int |
minCounts, |
|
|
int |
maxCounts | |
|
) |
| | |
Constructor which sets the count range. The count range is usually constant, so setting it one time in the constructor is convenient.
- Parameters:
-
| minCounts | minimum counts for current range. |
| maxCounts | maximum counts for current range. |
AIOUSB::AnalogIORange::~AnalogIORange |
( |
|
) |
[virtual] |
Member Function Documentation
double AIOUSB::AnalogIORange::countsToVolts |
( |
int |
counts |
) |
const |
Converts a single A/D or 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 range. The voltage value returned is constrained to the current minimum-maximum voltage range.
int AIOUSB::AnalogIORange::getRange |
( |
|
) |
const [inline] |
Gets the current range ID.
- Returns:
- Current range ID (defined by class that owns this instance).
AnalogIORange & AIOUSB::AnalogIORange::setCountRange |
( |
int |
minCounts, |
|
|
int |
maxCounts | |
|
) |
| | |
Sets the A/D or D/A count range.
- Parameters:
-
| minCounts | minimum counts for current range. |
| maxCounts | maximum counts for current range. |
- Returns:
- This subsystem, useful for chaining together multiple operations.
- Exceptions:
-
AnalogIORange & AIOUSB::AnalogIORange::setRange |
( |
int |
range |
) |
[virtual] |
AnalogIORange & AIOUSB::AnalogIORange::setVoltRange |
( |
double |
minVolts, |
|
|
double |
maxVolts | |
|
) |
| | |
Sets the voltage range.
- Parameters:
-
| minVolts | minimum volts for current range. |
| maxVolts | maximum volts for current range. |
- Returns:
- This subsystem, useful for chaining together multiple operations.
- Exceptions:
-
int AIOUSB::AnalogIORange::voltsToCounts |
( |
double |
volts |
) |
const |
Converts a single voltage value to A/D or 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.
Member Data Documentation