com.acces.aiousb
Class DA12_AnalogOutputSubsystem

java.lang.Object
  extended by com.acces.aiousb.AnalogOutputSubsystem
      extended by com.acces.aiousb.DA12_AnalogOutputSubsystem

public class DA12_AnalogOutputSubsystem
extends AnalogOutputSubsystem

Class DA12_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_DA12_8E_Family.dac()).


Field Summary
static int MAX_COUNTS
          Maximum number of counts D/A can output.
static int MIN_COUNTS
          Minimum number of counts D/A can output.
static int RANGE_0_10V
          Unipolar, 0-10 volt range (see setRange()).
static int RANGE_0_2_5V
          Unipolar, 0-2.5 volt range (see setRange()).
static int RANGE_0_5V
          Unipolar, 0-5 volt range (see setRange()).
static int RANGE_10V
          Bipolar, -10 to +10 volt range (see setRange()).
static int RANGE_2_5V
          Bipolar, -2.5 to +2.5 volt range (see setRange()).
static int RANGE_5V
          Bipolar, -5 to +5 volt range (see setRange()).
 
Method Summary
 double countsToVolts(int channel, char counts)
          Converts a single D/A count value to volts, based on the current range setting.
 USBDevice getParent()
          Gets the parent device that this subsystem is part of.
 int getRange(int channel)
          Gets the current voltage range of a D/A channel.
 int[] getRange(int startChannel, int numChannels)
          Gets the current voltage range of multiple D/A channels.
static java.lang.String getRangeText(int range)
          Gets the textual string for the specified range.
 DA12_AnalogOutputSubsystem setRange(int range)
          Sets the current voltage range of all D/A channels to the same value.
 DA12_AnalogOutputSubsystem setRange(int channel, int range)
          Sets the voltage range of a D/A channel.
 DA12_AnalogOutputSubsystem setRange(int startChannel, int[] range)
          Sets the current voltage range of multiple D/A channels.
 char voltsToCounts(int channel, double volts)
          Converts a single voltage value to D/A counts, based on the current range setting.
 DA12_AnalogOutputSubsystem writeVolts(int channel, double volts)
          Writes a voltage value to a D/A channel.
 DA12_AnalogOutputSubsystem writeVolts(OutputVoltagePoint[] points)
          Writes a block of voltage values to one or more D/A channels.
 
Methods inherited from class com.acces.aiousb.AnalogOutputSubsystem
getNumChannels, print, writeCounts, writeCounts
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANGE_0_2_5V

public static final int RANGE_0_2_5V
Unipolar, 0-2.5 volt range (see setRange()).

See Also:
Constant Field Values

RANGE_2_5V

public static final int RANGE_2_5V
Bipolar, -2.5 to +2.5 volt range (see setRange()).

See Also:
Constant Field Values

RANGE_0_5V

public static final int RANGE_0_5V
Unipolar, 0-5 volt range (see setRange()).

See Also:
Constant Field Values

RANGE_5V

public static final int RANGE_5V
Bipolar, -5 to +5 volt range (see setRange()).

See Also:
Constant Field Values

RANGE_0_10V

public static final int RANGE_0_10V
Unipolar, 0-10 volt range (see setRange()).

See Also:
Constant Field Values

RANGE_10V

public static final int RANGE_10V
Bipolar, -10 to +10 volt range (see setRange()).

See Also:
Constant Field Values

MIN_COUNTS

public static final int MIN_COUNTS
Minimum number of counts D/A can output.

See Also:
Constant Field Values

MAX_COUNTS

public static final int MAX_COUNTS
Maximum number of counts D/A can output.

See Also:
Constant Field Values
Method Detail

getRangeText

public static java.lang.String getRangeText(int range)
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.
Throws:
java.lang.IllegalArgumentException
See Also:
setRange()

getRange

public int getRange(int channel)
Gets the current voltage range of a D/A channel.

Parameters:
channel - the channel for which to obtain the current range.
Returns:
Current voltage range.
Throws:
java.lang.IllegalArgumentException
See Also:
setRange()

getRange

public int[] getRange(int startChannel,
                      int numChannels)
Gets the current voltage range of multiple D/A channels.

Parameters:
startChannel - the first channel for which to obtain the current range.
numChannels - the number of channels for which to obtain the current range.
Returns:
Array containing the current range for each of the specified channels.
Throws:
java.lang.IllegalArgumentException
See Also:
setRange()

setRange

public DA12_AnalogOutputSubsystem setRange(int channel,
                                           int range)
Sets the voltage range of a D/A channel. The ranges in this device are selected by means of hardware jumpers, so these range settings here do not affect the hardware. However, they are used to perform conversions between volts and counts. Moreover, the range setting is per D/A channel, so care must be taken when setting the ranges to ensure that the software setting matches the hardware jumper configuration, otherwise the voltage-count conversions will be incorrect.

Parameters:
channel - the channel for which to set the range.
range - the voltage range to select. May be one of:
RANGE_0_2_5V
RANGE_2_5V
RANGE_0_5V
RANGE_5V
RANGE_0_10V
RANGE_10V
Returns:
This subsystem, useful for chaining together multiple operations.
Throws:
java.lang.IllegalArgumentException

setRange

public DA12_AnalogOutputSubsystem setRange(int startChannel,
                                           int[] range)
Sets the current voltage range of multiple D/A channels.

Parameters:
startChannel - the first channel for which to set the range.
range - an array of voltage ranges to select, one per channel. The length of this array implicitly specifies the number of channels to configure.
Returns:
This subsystem, useful for chaining together multiple operations.
Throws:
java.lang.IllegalArgumentException
See Also:
setRange()

setRange

public DA12_AnalogOutputSubsystem setRange(int range)
Sets the current voltage range of all D/A channels to the same value.

Parameters:
range - the voltage range to select.
Returns:
This subsystem, useful for chaining together multiple operations.
See Also:
setRange()

writeVolts

public DA12_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.

writeVolts

public DA12_AnalogOutputSubsystem writeVolts(OutputVoltagePoint[] 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.
Throws:
java.lang.IllegalArgumentException

countsToVolts

public double countsToVolts(int channel,
                            char counts)
Converts a single D/A count value to volts, based on the current range setting.

Parameters:
channel - the channel whose current range will be used to perform the conversion.
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()).
Throws:
java.lang.IllegalArgumentException

voltsToCounts

public char voltsToCounts(int channel,
                          double volts)
Converts a single voltage value to D/A counts, based on the current range setting.

Parameters:
channel - the channel whose current range will be used to perform the conversion.
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()).
Throws:
java.lang.IllegalArgumentException

getParent

public USBDevice getParent()
Gets the parent device that this subsystem is part of.

Returns:
The parent device that this subsystem is part of.