com.acces.aiousb
Class AnalogOutputSubsystem

java.lang.Object
  extended by com.acces.aiousb.AnalogOutputSubsystem
Direct Known Subclasses:
AO16_AnalogOutputSubsystem, DA12_AnalogOutputSubsystem

public class AnalogOutputSubsystem
extends java.lang.Object

Class AnalogOutputSubsystem is the superclass of the analog output subsystem of a device. This class provides basic features, such as writing count values to the D/As. More sophisticated functions are provided by device-specific subclasses. One accesses this analog output subsystem through its parent object, typically through a method such as dac() (see USB_AO16_Family.dac()).


Method Summary
 int getNumChannels()
          Gets the number of analog output channels.
 USBDevice getParent()
          Gets the parent device that this subsystem is part of.
 java.io.PrintStream print(java.io.PrintStream stream)
          Prints the properties of this subsystem.
 AnalogOutputSubsystem writeCounts(char[] points)
          Writes a block of count values to one or more D/A channels.
 AnalogOutputSubsystem writeCounts(int channel, char counts)
          Writes a count value to a D/A channel.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

print

public java.io.PrintStream print(java.io.PrintStream stream)
Prints the properties of this subsystem. Mainly useful for diagnostic purposes.

Parameters:
stream - the print stream where properties will be printed.
Returns:
The print stream.

getNumChannels

public int getNumChannels()
Gets the number of analog output channels.

Returns:
Number of channels, numbered 0 to n-1.

writeCounts

public AnalogOutputSubsystem writeCounts(int channel,
                                         char counts)
Writes a count value to a D/A channel.

Parameters:
channel - the channel to write to.
counts - the D/A count value to output. The number of bits of resolution for the D/A outputs varies from model to model, however it's usually 12 or 16 bits. Moreover, some of the 12-bit models actually accept a 16-bit value and simply truncate the least significant 4 bits. Consult the manual for the specific device to determine the range of D/A values the device will accept. In general, 12-bit devices accept a count range of 0-0xfff, and 16-bit devices accept a count range of 0-0xffff.
Returns:
This subsystem, useful for chaining together multiple operations.
Throws:
java.lang.IllegalArgumentException
OperationFailedException

writeCounts

public AnalogOutputSubsystem writeCounts(char[] points)
Writes a block of count values to one or more D/A channels.

Parameters:
points - an array of 16-bit integers representing channel-count pairs. The first integer of each pair is the D/A channel number and the second integer is the D/A count value to output to the specified channel. Refer to writeCounts() for an explanation of the channel addressing and count values.
Returns:
This subsystem, useful for chaining together multiple operations.
Throws:
java.lang.IllegalArgumentException
OperationFailedException

getParent

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

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