|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.acces.aiousb.DIOStreamSubsystem
public class DIOStreamSubsystem
Class DIOStreamSubsystem represents the digital I/O streaming subsystem of a device. One accesses
this counter/timer subsystem through its parent object, typically through a method such as
diostream() (see USB_DIO_16_Family.diostream()
).
Method Summary | |
---|---|
DIOStreamSubsystem |
clearFIFO(int method)
Clears the streaming FIFO, using one of several different methods. |
DIOStreamSubsystem |
close()
Closes a digital I/O stream opened by a call to open() . |
double |
getClock()
Gets the current internal read/write clock speed of a digital I/O stream. |
USBDevice |
getParent()
Gets the parent device that this subsystem is part of. |
int |
getStreamingBlockSize()
Gets the current streaming block size. |
DIOStreamSubsystem |
open(boolean directionRead)
Opens a digital I/O stream. |
java.io.PrintStream |
print(java.io.PrintStream stream)
Prints the properties of this subsystem. |
char[] |
read(int numSamples)
Reads a frame from a digital I/O stream opened by a call to open( true ) . |
double |
setClock(boolean directionRead,
double clockHz)
Sets the internal read/write clock speed of a digital I/O stream (see getClock() ). |
DIOStreamSubsystem |
setStreamingBlockSize(int blockSize)
Sets the streaming block size. |
DIOStreamSubsystem |
stopClock()
Stops the internal read/write clocks of a digital I/O stream. |
int |
write(char[] values)
Writes a frame to a digital I/O stream opened by a call to open( false ) . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.io.PrintStream print(java.io.PrintStream stream)
stream
- the print stream where properties will be printed.
public int getStreamingBlockSize()
setStreamingBlockSize()
because that value is
rounded up to a whole multiple of 256.
OperationFailedException
public DIOStreamSubsystem setStreamingBlockSize(int blockSize)
blockSize
- the streaming block size you wish to set. This will be rounded up to the
next multiple of 256.
java.lang.IllegalArgumentException
OperationFailedException
public double getClock()
setClock()
.public double setClock(boolean directionRead, double clockHz)
getClock()
).
Only one clock - the read or write clock - may be active at a time, so this method automatically turns off
the clock not being set by this method. Therefore, do not call this method to explicitly turn off one of the
clocks because it will turn off both of them. Also, when streaming between two devices, only one should have an
active internal clock; the other should have its clocks turned off (see stopClock()
).
directionRead
- true sets read clock; false sets write clock.clockHz
- the frequency at which to stream the samples (in Hertz).
OperationFailedException
public DIOStreamSubsystem stopClock()
OperationFailedException
public DIOStreamSubsystem open(boolean directionRead)
close()
.
directionRead
- true open the stream for reading; false open the stream for writing.
OperationFailedException
public DIOStreamSubsystem close()
open()
.
OperationFailedException
public char[] read(int numSamples)
open( true )
.
You cannot read from, and write to a stream. A stream may be read-only or write-only.
numSamples
- the number of samples to read.
java.lang.IllegalArgumentException
OperationFailedException
public int write(char[] values)
open( false )
.
You cannot read from, and write to a stream. A stream may be read-only or write-only.
values
- an array containing the samples to write.
java.lang.IllegalArgumentException
OperationFailedException
public DIOStreamSubsystem clearFIFO(int method)
method
- the method to use when clearing the FIFO. May be one of:USBDevice.CLEAR_FIFO_METHOD_IMMEDIATE
USBDevice.CLEAR_FIFO_METHOD_AUTO
USBDevice.CLEAR_FIFO_METHOD_IMMEDIATE_AND_ABORT
USBDevice.CLEAR_FIFO_METHOD_WAIT
public USBDevice getParent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |