com.teravation.labjack
Interface LabJack


public interface LabJack

This interface defines the methods to interface with a LabJack data acquisition & control device. This interface will be implemented by the platform-dependent concrete classes.

The LabJack objects are virtual devices, generally independent from the device itself. The updateXXXXX methods are used to synchronize the object with the device, reading and/or writing the object information to/from the device itself.

Copyright © 2003-2004 Teravation. All rights reserved.

Version:
4.0
Author:
Chris Reigrut

Method Summary
 float getAI(int channel)
          Returns the last updated voltage of the specified analog input, or -1.0f on an overvoltage.
 float getAO(int channel)
          Returns the last set voltage of the specified analog output.
 long getCounter()
          Returns the last updated value of the counter.
 boolean getD(int channel)
          Returns the last updated/set value of the specified digital input (DB25).
 float getDifferentialAI(int channel)
          Returns the last updated voltage of the specified differential analog input, or -1.0f on an overvoltage.
 int getDifferentialAIGain(int channel)
          Returns the last set gain factor of the specified differential analog input.
 float getFirmwareVersion()
          Returns the firmware version of the LabJack.
 float getHumidity()
          Returns the last updated relative humidity percentage
 boolean getIO(int channel)
          Returns the last updated/set value of the specified digital input (screw terminal).
 int getLocalId()
          Returns the local id of the LabJack.
 int getProductId()
          Returns the product id of the LabJack.
 float getPulseSpace()
          Gets the pulse spacing (in microseconds).
 float getPulseWidth()
          Gets the pulse width (in microseconds).
 com.teravation.labjack.LabJackScan getScan()
          Returns the last updated LabJackScan object (from a Burst or Stream).
 int getSerialNumber()
          Returns the serial number of the LabJack.
 float getTempC()
          Returns the last updated temperature (in Celsius)
 float getTempF()
          Returns the last updated temperature (in Fahrenheit)
 boolean isDForOutput(int bit)
          Returns whether the specified D line is set for output (from the bit array)
 boolean isIOForOutput(int bit)
          Returns whether the specified IO line is set for output (from the bit array)
 void reenumerate()
          Forces the associated device to re-enumerate.
 void reset()
          Resets the associated device.
 void setAO(int channel, float value)
          Sets the voltage of the specified analog output.
 void setD(int channel, boolean value)
          Sets the state of the specified digital output (DB25).
 void setDForInput(int channel)
          Sets the specified digital channel (DB25) as an input channel (the default).
 void setDForOutput(int channel)
          Sets the specified digital channel (DB25) as an output channel.
 void setDifferentialAIGain(int channel, int gain)
          Sets the gain value for the specified differential analog input.
 void setIO(int channel, boolean value)
          Sets the state of the specified digital output (screw terminal).
 void setIOForInput(int channel)
          Sets the specified digital channel (screw terminal) as an input channel (the default).
 void setIOForOutput(int channel)
          Sets the specified digital channel (screw terminal) as an output channel.
 void setLocalId(int value)
          Sets the local id.
 void setPulse(float pulseWidth, float pulseSpace)
          Sets the pulse width and spacing (in microseconds) for the device during subsequent calls to updatePulseXXXX.
 void setPulseSpace(float pulseSpace)
          Sets the space between pulses pulse (in microseconds) for the device during subsequent calls to updatePulseXXXX.
 void setPulseWidth(float pulseWidth)
          Sets the pulse width (in microseconds) for the device during subsequent calls to updatePulseXXXX.
 void updateAI(int channel)
          Updates the LabJack object with voltage read from the specified AI channel of the associated device.
 void updateAll()
          Updates the entire associated device with the values in the current LabJack object.
 void updateAll(boolean resetCounter)
          Updates the entire associated device with the values in the current LabJack object.
 void updateAllAIs()
          Updates the LabJack object with voltages read from the AI channels 0-7 of the associated device.
 void updateAllAOsAndDigitals()
          Updates the associated device, setting the AO voltages and digital (both D and IO) output values stored in the LabJack object, as well as reading the digital input values and the counter (but does not reset the counter).
 void updateAllAOsAndDigitals(boolean resetCounter)
          Updates the associated device, setting the AO voltages and digital (both D and IO) output values stored in the LabJack object, as well as reading the digital input values and the counter, and, if indicated, resets the counter after reading it.
 void updateAllDifferentialAIs()
          Updates the LabJack object with differential voltages read from the associated device.
 void updateAO(int channel)
          Updates the associated device, setting the specified AO voltage to the current value stored in the LabJack object.
 void updateCounter()
          Updates the LabJack object with the counter value of the associated device (but does not reset the counter).
 void updateCounter(boolean resetCounter)
          Updates the LabJack object with counter value of the associated device, and if indicated, resets the counter after reading it.
 void updateD(int channel)
          Updates the LabJack object with the value of the associated channel (DB25).
 void updateDifferentialAI(int channel)
          Updates the LabJack object with differential voltage read from the specified differential channel of the associated device.
 void updateEnvironmentals()
          Updates the LabJack object with temperatures (Fahrenheit and Celsius) and relative humidity read from an attached temperature/humidity probe.
 void updateFirmwareVersion()
          Updates the LabJack object with the firmware version from the associated device.
 void updateHighAIs()
          Updates the LabJack object with voltages read from the AI channels 4-7 of the associated device.
 void updateIO(int channel)
          Updates the LabJack object with the value of the associated channel (screw terminal).
 void updateLocalId()
          Updates the associated device, setting the local id to the value set in the LabJack object.
 void updateLowAIs()
          Updates the LabJack object with voltages read from the AI channels 0-3 of the associated device.
 void updatePulse(boolean[] dChannels, int numPulses)
          Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOut DLL call.
 void updatePulse(boolean[] dChannels, int numPulses, boolean lowFirst)
          Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOut DLL call.
 void updatePulse(int dChannel, int numPulses)
          Updates the associated device, causing it to generate square pulses on the specified D line.
 void updatePulseAsynch(boolean[] dChannels, int numPulses)
          Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOutStart DLL call.
 void updatePulseAsynch(boolean[] dChannels, int numPulses, boolean lowFirst)
          Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOutStart DLL call.
 void updatePulseAsynch(int dChannel, int numPulses)
          Updates the associated device, causing it to generate square pulses on the specified D line.
 void updatePulseAsynchFinish(int timeoutMS)
          Updates the associated device, waiting until the last updatePulseAsynch has finished, or the timeout has expired.
 float updateScanFromBurst(long[] channels, float scanRate, int scans)
          Updates the LabJack object with scans read from Burst mode.
 float updateScanFromBurst(long[] channels, float scanRate, int scans, int timeout, boolean updateIO, boolean triggerIO, boolean triggerState, long transferMode, boolean ledOn)
          Updates the LabJack object with scans read from Burst mode.
 void updateScanFromStream(int scans)
          Reads the designated number of scans from the device and updates the current scan object with that data, or timeout after 10 seconds if the data is not available.
 void updateScanFromStream(int scans, int timeout)
          Reads the designated number of scans from the device and updates the current scan object with that data, or timeout after the designated period.
 void updateStreamClear()
          Updates the associated device, ending Stream mode.
 float updateStreamStart(long[] channels, float scanRate)
          Updates the associated device, putting it into Stream mode.
 float updateStreamStart(long[] channels, float scanRate, boolean readCount)
          Updates the associated device, putting it into Stream mode.
 

Method Detail

getAI

public float getAI(int channel)
            throws LabJackException
Returns the last updated voltage of the specified analog input, or -1.0f on an overvoltage.

Parameters:
channel - the analog input channel to read.
Returns:
the voltage of the specified analog input.
Throws:
LabJackException - on any error

getAO

public float getAO(int channel)
            throws LabJackException
Returns the last set voltage of the specified analog output.

Parameters:
channel - the analog output channel to read.
Returns:
the voltage of the specified analog output.
Throws:
LabJackException - on any error

getCounter

public long getCounter()
                throws LabJackException
Returns the last updated value of the counter.

Returns:
the current counter value.
Throws:
LabJackException - on any error.

getD

public boolean getD(int channel)
             throws LabJackException
Returns the last updated/set value of the specified digital input (DB25).

Parameters:
channel - the digital input channel to read.
Returns:
the value of the specified digital input.
Throws:
LabJackException - on any error.

getDifferentialAI

public float getDifferentialAI(int channel)
                        throws LabJackException
Returns the last updated voltage of the specified differential analog input, or -1.0f on an overvoltage. The differential channels are measured as follows:

Parameters:
channel - the differential analog input channel to read.
Returns:
the voltage of the specified differential analog input.
Throws:
LabJackException - on any error

getDifferentialAIGain

public int getDifferentialAIGain(int channel)
                          throws LabJackException
Returns the last set gain factor of the specified differential analog input. The gain values are specified as the constants:

Parameters:
channel - the differential analog input channel for which to get the gain.
Returns:
the gain value of the specified differential analog input gain.
Throws:
LabJackException - on any error

getHumidity

public float getHumidity()
Returns the last updated relative humidity percentage

Returns:
the relative humidity percentage

getIO

public boolean getIO(int channel)
              throws LabJackException
Returns the last updated/set value of the specified digital input (screw terminal).

Parameters:
channel - the digital input channel to read.
Returns:
the value of the specified digital input.
Throws:
LabJackException - on any underlying DLL error.

getLocalId

public int getLocalId()
Returns the local id of the LabJack.

Returns:
the local id of the LabJack.

getProductId

public int getProductId()
Returns the product id of the LabJack.

Returns:
the product id of the LabJack.

getScan

public com.teravation.labjack.LabJackScan getScan()
Returns the last updated LabJackScan object (from a Burst or Stream).

Returns:
the last update scan.

getSerialNumber

public int getSerialNumber()
Returns the serial number of the LabJack.

Returns:
the serial number of the LabJack.

getTempC

public float getTempC()
Returns the last updated temperature (in Celsius)

Returns:
the temperature (in Celsius)

getTempF

public float getTempF()
Returns the last updated temperature (in Fahrenheit)

Returns:
the temperature (in Fahrenheit)

isDForOutput

public boolean isDForOutput(int bit)
Returns whether the specified D line is set for output (from the bit array)

Parameters:
bit - int
Returns:
boolean

isIOForOutput

public boolean isIOForOutput(int bit)
Returns whether the specified IO line is set for output (from the bit array)

Parameters:
bit - int
Returns:
boolean

setAO

public void setAO(int channel,
                  float value)
           throws LabJackException
Sets the voltage of the specified analog output. This will be applied to the device during the next appropriate updateXXXXXX call.

Parameters:
channel - the analog output channel to set.
value - the voltage to be set.
Throws:
LabJackException - on any error.

setD

public void setD(int channel,
                 boolean value)
          throws LabJackException
Sets the state of the specified digital output (DB25). This will be applied to the device during the next appropriate updateXXXXXX call. If the channel is not currently set for output, a LabJackException will be thrown.

Parameters:
channel - the digital output channel to set.
value - the state to set.
Throws:
LabJackException - on any error.

setDForInput

public void setDForInput(int channel)
                  throws LabJackException
Sets the specified digital channel (DB25) as an input channel (the default).

Parameters:
channel - the digital channel to set as an input.
Throws:
LabJackException - on any error.

setDForOutput

public void setDForOutput(int channel)
                   throws LabJackException
Sets the specified digital channel (DB25) as an output channel.

Parameters:
channel - the digital output channel to set as an output.
Throws:
LabJackException - on any error.

setDifferentialAIGain

public void setDifferentialAIGain(int channel,
                                  int gain)
                           throws LabJackException
Sets the gain value for the specified differential analog input. The gain values are specified as the constants:

Parameters:
channel - the differential analog input channel for which to set the gain.
gain - the gain value for the specified differential analog input.
Throws:
LabJackException - on any error

setIO

public void setIO(int channel,
                  boolean value)
           throws LabJackException
Sets the state of the specified digital output (screw terminal). This will be applied to the device during the next appropriate updateXXXXXX call. If the channel is not currently set for output, a LabJackException will be thrown.

Parameters:
channel - the digital output channel to set.
value - the state to set.
Throws:
LabJackException - on any error.

setIOForInput

public void setIOForInput(int channel)
                   throws LabJackException
Sets the specified digital channel (screw terminal) as an input channel (the default).

Parameters:
channel - the digital channel to set as an input.
Throws:
LabJackException - on any error.

setIOForOutput

public void setIOForOutput(int channel)
                    throws LabJackException
Sets the specified digital channel (screw terminal) as an output channel.

Parameters:
channel - the digital output channel to set as an output.
Throws:
LabJackException - on any error.

updateAI

public void updateAI(int channel)
              throws LabJackException
Updates the LabJack object with voltage read from the specified AI channel of the associated device.
On Windows, this call utilizes the EAnalogIn DLL call.

Parameters:
channel - the analog input channel to update.
Throws:
LabJackException - on any error.

updateAll

public void updateAll()
               throws LabJackException
Updates the entire associated device with the values in the current LabJack object. Equivalent to calling updateAllAOsAndDigitals, updateAllAIs, updateAllDifferentialAIs, and updateEnvironmentals.

Throws:
LabJackException - on any error.

updateAll

public void updateAll(boolean resetCounter)
               throws LabJackException
Updates the entire associated device with the values in the current LabJack object. Equivalent to calling updateAllAOsAndDigitals, updateAllAIs, updateAllDifferentialAIs, and updateEnvironmentals.

Parameters:
resetCounter - whether or not to reset the counter after reading it.
Throws:
LabJackException - on any error.

updateAllAIs

public void updateAllAIs()
                  throws LabJackException
Updates the LabJack object with voltages read from the AI channels 0-7 of the associated device.
On Windows, this call utilizes the AISample DLL call.

Throws:
LabJackException - on any error.

updateAllAOsAndDigitals

public void updateAllAOsAndDigitals()
                             throws LabJackException
Updates the associated device, setting the AO voltages and digital (both D and IO) output values stored in the LabJack object, as well as reading the digital input values and the counter (but does not reset the counter).
On Windows, this call utilizes the AOUpdate DLL call.

Throws:
LabJackException - on any error.

updateAllAOsAndDigitals

public void updateAllAOsAndDigitals(boolean resetCounter)
                             throws LabJackException
Updates the associated device, setting the AO voltages and digital (both D and IO) output values stored in the LabJack object, as well as reading the digital input values and the counter, and, if indicated, resets the counter after reading it.
On Windows, this call utilizes the AOUpdate DLL call.

Parameters:
resetCounter - whether or not to reset the counter after reading it.
Throws:
LabJackException - on any error.

updateAllDifferentialAIs

public void updateAllDifferentialAIs()
                              throws LabJackException
Updates the LabJack object with differential voltages read from the associated device.
On Windows, this call utilizes the AISample DLL call.

Throws:
LabJackException - on any error.

updateAO

public void updateAO(int channel)
              throws LabJackException
Updates the associated device, setting the specified AO voltage to the current value stored in the LabJack object.
On Windows, this call utilizes the EAnalogOut DLL call.

Parameters:
channel - the analog output channel to update.
Throws:
LabJackException - on any error.

updateCounter

public void updateCounter()
                   throws LabJackException
Updates the LabJack object with the counter value of the associated device (but does not reset the counter).
On Windows, this call utilizes the ECount DLL call.

Throws:
LabJackException - on any error.

updateCounter

public void updateCounter(boolean resetCounter)
                   throws LabJackException
Updates the LabJack object with counter value of the associated device, and if indicated, resets the counter after reading it.
On Windows, this call utilizes the ECount DLL call.

Parameters:
resetCounter - whether or not to reset the counter after reading it.
Throws:
LabJackException - on any error.

updateD

public void updateD(int channel)
             throws LabJackException
Updates the LabJack object with the value of the associated channel (DB25). if the channel is set as an input, the value is read from the device. If the channel is set as an output, the value is written to the device.
On Windows, this call utilizes the EDigitalOut or EDigitalIn DLL call.

Parameters:
channel - the digital IO channel to update.
Throws:
LabJackException - on any error.

updateDifferentialAI

public void updateDifferentialAI(int channel)
                          throws LabJackException
Updates the LabJack object with differential voltage read from the specified differential channel of the associated device.
On Windows, this call utilizes the EAnalogIn DLL call.

Parameters:
channel - the differential analog input channel to update.
Throws:
LabJackException - on any error.

updateEnvironmentals

public void updateEnvironmentals()
                          throws LabJackException
Updates the LabJack object with temperatures (Fahrenheit and Celsius) and relative humidity read from an attached temperature/humidity probe. Requires LabJack firmware v1.1 or higher (otherwise, it will return zeros).
On Windows, this call utilizes the SHT1X DLL call.

Throws:
LabJackException - on any error.

updateHighAIs

public void updateHighAIs()
                   throws LabJackException
Updates the LabJack object with voltages read from the AI channels 4-7 of the associated device.
On Windows, this call utilizes the AISample DLL call.

Throws:
LabJackException - on any error.

updateIO

public void updateIO(int channel)
              throws LabJackException
Updates the LabJack object with the value of the associated channel (screw terminal). if the channel is set as an input, the value is read from the device. If the channel is set as an output, the value is written to the device.
On Windows, this call utilizes the EDigitalOut or EDigitalIn DLL call.

Parameters:
channel - the digital IO channel to update.
Throws:
LabJackException - on any error.

updateLowAIs

public void updateLowAIs()
                  throws LabJackException
Updates the LabJack object with voltages read from the AI channels 0-3 of the associated device.
On Windows, this call utilizes the AISample DLL call.

Throws:
LabJackException - on any error.

updateScanFromBurst

public float updateScanFromBurst(long[] channels,
                                 float scanRate,
                                 int scans)
                          throws LabJackException
Updates the LabJack object with scans read from Burst mode.
On Windows, this call utilizes the AIBurst DLL call.

Parameters:
channels - the digital IO channels to update.
scanRate - the rate to scan the channels.
scans - the total number of scans to record.
Returns:
the actual scan rate used
Throws:
LabJackException - on any error.

updateScanFromBurst

public float updateScanFromBurst(long[] channels,
                                 float scanRate,
                                 int scans,
                                 int timeout,
                                 boolean updateIO,
                                 boolean triggerIO,
                                 boolean triggerState,
                                 long transferMode,
                                 boolean ledOn)
                          throws LabJackException
Updates the LabJack object with scans read from Burst mode.
On Windows, this call utilizes the AIBurst DLL call.

Parameters:
channels - the digital IO channels to update.
scanRate - the rate to scan the channels.
scans - the total number of scans to record.
timeout - the total number of scans to record.
updateIO - whether or not to update the IO channels.
triggerIO - the IO port to trigger on (false=IO0, true=IO1).
triggerState - whether or not to trigger on an IO port.
transferMode - unused (currently must be false).
ledOn - whether or not to turn on the device LED.
Returns:
the actual scan rate used
Throws:
LabJackException - on any error.

setLocalId

public void setLocalId(int value)
                throws LabJackException
Sets the local id. This will be updated on the associated device on the next updateLocalId call.

Parameters:
value - the state to set.
Throws:
LabJackException - on any error.

updateLocalId

public void updateLocalId()
                   throws LabJackException
Updates the associated device, setting the local id to the value set in the LabJack object.
On Windows, this call utilizes the LocalID DLL call.
NOTE: The change will only take effect after a reset or re-enumeration of the physical device.

Throws:
LabJackException - on any error.

reset

public void reset()
           throws LabJackException
Resets the associated device. This will typically take a few seconds to complete (even though the call returns immediately).
On Windows, this call utilizes the Reset DLL call.

Throws:
LabJackException - on any error.

reenumerate

public void reenumerate()
                 throws LabJackException
Forces the associated device to re-enumerate. This will typically take a few seconds to complete (even though the call returns immediately).
On Windows, this call utilizes the ReEnum DLL call.

Throws:
LabJackException - on any error.

updateFirmwareVersion

public void updateFirmwareVersion()
                           throws LabJackException
Updates the LabJack object with the firmware version from the associated device.
On Windows, this call utilizes the GetFirmwareVersion DLL call.

Throws:
LabJackException - on any error.

getFirmwareVersion

public float getFirmwareVersion()
                         throws LabJackException
Returns the firmware version of the LabJack.

Returns:
the serial number of the LabJack.
LabJackException

setPulse

public void setPulse(float pulseWidth,
                     float pulseSpace)
Sets the pulse width and spacing (in microseconds) for the device during subsequent calls to updatePulseXXXX.

Parameters:
pulseWidth - The pulse width (in microseconds)
pulseSpace - The pulse space (in microseconds)
See Also:
setPulseWidth(float), setPulseSpace(float)

setPulseWidth

public void setPulseWidth(float pulseWidth)
Sets the pulse width (in microseconds) for the device during subsequent calls to updatePulseXXXX.
NOTE: This actually sets the pulse width to the nearest supported value, calculated by
1st half-cycle microseconds = ~17 + 0.83*C + 20.17*B*C
(where 1 <= B <= 255 and 1 <= C <= 255)
A subsequent call to getPulseWidth will return the actual pulse width.

Parameters:
pulseWidth - The pulse width (in microseconds)

setPulseSpace

public void setPulseSpace(float pulseSpace)
Sets the space between pulses pulse (in microseconds) for the device during subsequent calls to updatePulseXXXX.
NOTE: This actually sets the pulse width to the nearest supported value, calculated by
1st half-cycle microseconds = ~12 + 0.83*C + 20.17*B*C
(where 1 <= B <= 255 and 1 <= C <= 255)
A subsequent call to getPulseSpace will return the actual pulse space.

Parameters:
pulseSpace - The pulse space (in microseconds)

getPulseWidth

public float getPulseWidth()
Gets the pulse width (in microseconds).

Returns:
pulseWidth The pulse width (in microseconds)

getPulseSpace

public float getPulseSpace()
Gets the pulse spacing (in microseconds).

Returns:
pulseSpace The pulse space (in microseconds)

updatePulse

public void updatePulse(int dChannel,
                        int numPulses)
                 throws LabJackException
Updates the associated device, causing it to generate square pulses on the specified D line.
On Windows, this call utilizes the PulseOut DLL call.
NOTE: This is the synchronous version, and will not return until all the pulses have been generated.
NOTE: The selected D line must have been set as an output (on the hardware side) with prior calls to setDForOutput and updateAllAOsAndDigitals.

Parameters:
dChannel - the line (D0-D7).
numPulses - the number of pulses to create.
Throws:
LabJackException - on any error.

updatePulse

public void updatePulse(boolean[] dChannels,
                        int numPulses)
                 throws LabJackException
Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOut DLL call.
NOTE: This is the synchronous version, and will not return until all the pulses have been generated.
NOTE: The selected D lines must have been set as an output (on the hardware side) with prior calls to setDForOutput and updateAllAOsAndDigitals.

Parameters:
dChannels - the lines (D0-D7).
numPulses - the number of pulses to create.
Throws:
LabJackException - on any error.

updatePulse

public void updatePulse(boolean[] dChannels,
                        int numPulses,
                        boolean lowFirst)
                 throws LabJackException
Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOut DLL call.
NOTE: This is the synchronous version, and will not return until all the pulses have been generated.
NOTE: The selected D lines must have been set as an output (on the hardware side) with prior calls to setDForOutput and updateAllAOsAndDigitals.

Parameters:
dChannels - the lines (D0-D7).
numPulses - the number of pulses to create.
lowFirst - whether to set the line high, then low (true) or low, then high (false).
Throws:
LabJackException - on any error.

updatePulseAsynch

public void updatePulseAsynch(int dChannel,
                              int numPulses)
                       throws LabJackException
Updates the associated device, causing it to generate square pulses on the specified D line.
On Windows, this call utilizes the PulseOutStart DLL call.
NOTE: This is the asynchronous version, and returns immediately. In order to then wait for the call to complete, call updatePulseAsynchFinish
NOTE: The selected D line must have been set as an output (on the hardware side) with prior calls to setDForOutput and updateAllAOsAndDigitals.

Parameters:
dChannel - the line (D0-D7).
numPulses - the number of pulses to create.
Throws:
LabJackException - on any error.

updatePulseAsynch

public void updatePulseAsynch(boolean[] dChannels,
                              int numPulses)
                       throws LabJackException
Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOutStart DLL call.
NOTE: This is the asynchronous version, and returns immediately. In order to then wait for the call to complete, call updatePulseAsynchFinish
NOTE: The selected D lines must have been set as an output (on the hardware side) with prior calls to setDForOutput and updateAllAOsAndDigitals.

Parameters:
dChannels - the lines (D0-D7).
numPulses - the number of pulses to create.
Throws:
LabJackException - on any error.

updatePulseAsynch

public void updatePulseAsynch(boolean[] dChannels,
                              int numPulses,
                              boolean lowFirst)
                       throws LabJackException
Updates the associated device, causing it to generate square pulses on the specified D line(s)
On Windows, this call utilizes the PulseOutStart DLL call.
NOTE: This is the asynchronous version, and returns immediately. In order to then wait for the call to complete, call updatePulseAsynchFinish
NOTE: The selected D lines must have been set as an output (on the hardware side) with prior calls to setDForOutput and updateAllAOsAndDigitals.

Parameters:
dChannels - the lines (D0-D7).
numPulses - the number of pulses to create.
lowFirst - whether to set the line high, then low (true) or low, then high (false).
Throws:
LabJackException - on any error.

updatePulseAsynchFinish

public void updatePulseAsynchFinish(int timeoutMS)
                             throws LabJackException
Updates the associated device, waiting until the last updatePulseAsynch has finished, or the timeout has expired. If the updatePulseAsynch has already completed, this call can only time out.
On Windows, this call utilizes the PulseOutFinish DLL call.

Throws:
LabJackException - on any error.

updateStreamStart

public float updateStreamStart(long[] channels,
                               float scanRate,
                               boolean readCount)
                        throws LabJackException
Updates the associated device, putting it into Stream mode.
On Windows, this call utilizes the AIStreamStart DLL call.

Parameters:
channels - the channels to sample
scanRate - the rate at which to sample
readCount - whether or not to sample the counter (if so, only the first channel will actually be sampled)
Returns:
the actual scan rate that will be used
Throws:
LabJackException - on any error.

updateStreamStart

public float updateStreamStart(long[] channels,
                               float scanRate)
                        throws LabJackException
Updates the associated device, putting it into Stream mode.
On Windows, this call utilizes the AIStreamStart DLL call.

Parameters:
channels - the channels to sample
scanRate - the rate at which to sample
Returns:
the actual scan rate that will be used
Throws:
LabJackException - on any error.

updateStreamClear

public void updateStreamClear()
                       throws LabJackException
Updates the associated device, ending Stream mode.
On Windows, this call utilizes the AIStreamClear DLL call.

Throws:
LabJackException - on any error.

updateScanFromStream

public void updateScanFromStream(int scans)
                          throws LabJackException
Reads the designated number of scans from the device and updates the current scan object with that data, or timeout after 10 seconds if the data is not available.
On Windows, this call utilizes the AIStreamRead DLL call.

Parameters:
scans - the number of scans to read
Throws:
LabJackException - on any error.

updateScanFromStream

public void updateScanFromStream(int scans,
                                 int timeout)
                          throws LabJackException
Reads the designated number of scans from the device and updates the current scan object with that data, or timeout after the designated period.
On Windows, this call utilizes the AIStreamRead DLL call.

Parameters:
scans - the number of scans to read
timeout - the time (in seconds) to wait for the data before returning
Throws:
LabJackException - on any error.