|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
TheLabJack
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.
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 |
public float getAI(int channel) throws LabJackException
channel
- the analog input channel to read.
LabJackException
- on any errorpublic float getAO(int channel) throws LabJackException
channel
- the analog output channel to read.
LabJackException
- on any errorpublic long getCounter() throws LabJackException
LabJackException
- on any error.public boolean getD(int channel) throws LabJackException
channel
- the digital input channel to read.
LabJackException
- on any error.public float getDifferentialAI(int channel) throws LabJackException
channel
- the differential analog input channel to read.
LabJackException
- on any errorpublic int getDifferentialAIGain(int channel) throws LabJackException
GAIN_1x
GAIN_2x
GAIN_4x
GAIN_5x
GAIN_8x
GAIN_10x
GAIN_16x
GAIN_20x
channel
- the differential analog input channel for which to get the gain.
LabJackException
- on any errorpublic float getHumidity()
public boolean getIO(int channel) throws LabJackException
channel
- the digital input channel to read.
LabJackException
- on any underlying DLL error.public int getLocalId()
public int getProductId()
public com.teravation.labjack.LabJackScan getScan()
public int getSerialNumber()
public float getTempC()
public float getTempF()
public boolean isDForOutput(int bit)
bit
- int
public boolean isIOForOutput(int bit)
bit
- int
public void setAO(int channel, float value) throws LabJackException
updateXXXXXX
call.
channel
- the analog output channel to set.value
- the voltage to be set.
LabJackException
- on any error.public void setD(int channel, boolean value) throws LabJackException
updateXXXXXX
call. If the channel is not currently
set for output, a LabJackException will be thrown.
channel
- the digital output channel to set.value
- the state to set.
LabJackException
- on any error.public void setDForInput(int channel) throws LabJackException
channel
- the digital channel to set as an input.
LabJackException
- on any error.public void setDForOutput(int channel) throws LabJackException
channel
- the digital output channel to set as an output.
LabJackException
- on any error.public void setDifferentialAIGain(int channel, int gain) throws LabJackException
channel
- the differential analog input channel for which to set the gain.gain
- the gain value for the specified differential analog input.
LabJackException
- on any errorpublic void setIO(int channel, boolean value) throws LabJackException
updateXXXXXX
call. If the channel is not currently
set for output, a LabJackException will be thrown.
channel
- the digital output channel to set.value
- the state to set.
LabJackException
- on any error.public void setIOForInput(int channel) throws LabJackException
channel
- the digital channel to set as an input.
LabJackException
- on any error.public void setIOForOutput(int channel) throws LabJackException
channel
- the digital output channel to set as an output.
LabJackException
- on any error.public void updateAI(int channel) throws LabJackException
LabJack
object with voltage read from the specified AI channel
of the associated device.
EAnalogIn
DLL call.
channel
- the analog input channel to update.
LabJackException
- on any error.public void updateAll() throws LabJackException
LabJack
object.
Equivalent to calling updateAllAOsAndDigitals
, updateAllAIs
,
updateAllDifferentialAIs
, and updateEnvironmentals
.
LabJackException
- on any error.public void updateAll(boolean resetCounter) throws LabJackException
LabJack
object.
Equivalent to calling updateAllAOsAndDigitals
, updateAllAIs
,
updateAllDifferentialAIs
, and updateEnvironmentals
.
resetCounter
- whether or not to reset the counter after reading it.
LabJackException
- on any error.public void updateAllAIs() throws LabJackException
LabJack
object with voltages read from the AI channels 0-7
of the associated device.
AISample
DLL call.
LabJackException
- on any error.public void updateAllAOsAndDigitals() throws LabJackException
LabJack
object, as well as reading the digital input values and the
counter (but does not reset the counter).
AOUpdate
DLL call.
LabJackException
- on any error.public void updateAllAOsAndDigitals(boolean resetCounter) throws LabJackException
LabJack
object, as well as reading the digital input values and the
counter, and, if indicated, resets the counter after reading it.
AOUpdate
DLL call.
resetCounter
- whether or not to reset the counter after reading it.
LabJackException
- on any error.public void updateAllDifferentialAIs() throws LabJackException
LabJack
object with differential voltages read from the
associated device.
AISample
DLL call.
LabJackException
- on any error.public void updateAO(int channel) throws LabJackException
LabJack
object.
EAnalogOut
DLL call.
channel
- the analog output channel to update.
LabJackException
- on any error.public void updateCounter() throws LabJackException
LabJack
object with the counter value of the associated device (but does not
reset the counter).
ECount
DLL call.
LabJackException
- on any error.public void updateCounter(boolean resetCounter) throws LabJackException
LabJack
object with counter value of the associated device,
and if indicated, resets the counter after reading it.
ECount
DLL call.
resetCounter
- whether or not to reset the counter after reading it.
LabJackException
- on any error.public void updateD(int channel) throws LabJackException
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.
EDigitalOut
or EDigitalIn
DLL call.
channel
- the digital IO channel to update.
LabJackException
- on any error.public void updateDifferentialAI(int channel) throws LabJackException
LabJack
object with differential voltage read from the specified
differential channel of the associated device.
EAnalogIn
DLL call.
channel
- the differential analog input channel to update.
LabJackException
- on any error.public void updateEnvironmentals() throws LabJackException
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).
SHT1X
DLL call.
LabJackException
- on any error.public void updateHighAIs() throws LabJackException
LabJack
object with voltages read from the AI channels 4-7
of the associated device.
AISample
DLL call.
LabJackException
- on any error.public void updateIO(int channel) throws LabJackException
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.
EDigitalOut
or EDigitalIn
DLL call.
channel
- the digital IO channel to update.
LabJackException
- on any error.public void updateLowAIs() throws LabJackException
LabJack
object with voltages read from the AI channels 0-3
of the associated device.
AISample
DLL call.
LabJackException
- on any error.public float updateScanFromBurst(long[] channels, float scanRate, int scans) throws LabJackException
LabJack
object with scans read from Burst mode.
AIBurst
DLL call.
channels
- the digital IO channels to update.scanRate
- the rate to scan the channels.scans
- the total number of scans to record.
LabJackException
- on any error.public float updateScanFromBurst(long[] channels, float scanRate, int scans, int timeout, boolean updateIO, boolean triggerIO, boolean triggerState, long transferMode, boolean ledOn) throws LabJackException
LabJack
object with scans read from Burst mode.
AIBurst
DLL call.
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.
LabJackException
- on any error.public void setLocalId(int value) throws LabJackException
updateLocalId
call.
value
- the state to set.
LabJackException
- on any error.public void updateLocalId() throws LabJackException
LabJack
object.
LocalID
DLL call.
LabJackException
- on any error.public void reset() throws LabJackException
Reset
DLL call.
LabJackException
- on any error.public void reenumerate() throws LabJackException
ReEnum
DLL call.
LabJackException
- on any error.public void updateFirmwareVersion() throws LabJackException
LabJack
object with the firmware version from the associated device.
GetFirmwareVersion
DLL call.
LabJackException
- on any error.public float getFirmwareVersion() throws LabJackException
LabJackException
public void setPulse(float pulseWidth, float pulseSpace)
updatePulseXXXX
.
pulseWidth
- The pulse width (in microseconds)pulseSpace
- The pulse space (in microseconds)setPulseWidth(float)
,
setPulseSpace(float)
public void setPulseWidth(float pulseWidth)
updatePulseXXXX
.
pulseWidth
- The pulse width (in microseconds)public void setPulseSpace(float pulseSpace)
updatePulseXXXX
.
pulseSpace
- The pulse space (in microseconds)public float getPulseWidth()
public float getPulseSpace()
public void updatePulse(int dChannel, int numPulses) throws LabJackException
PulseOut
DLL call.
setDForOutput
and updateAllAOsAndDigitals
.
dChannel
- the line (D0-D7).numPulses
- the number of pulses to create.
LabJackException
- on any error.public void updatePulse(boolean[] dChannels, int numPulses) throws LabJackException
PulseOut
DLL call.
setDForOutput
and updateAllAOsAndDigitals
.
dChannels
- the lines (D0-D7).numPulses
- the number of pulses to create.
LabJackException
- on any error.public void updatePulse(boolean[] dChannels, int numPulses, boolean lowFirst) throws LabJackException
PulseOut
DLL call.
setDForOutput
and updateAllAOsAndDigitals
.
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).
LabJackException
- on any error.public void updatePulseAsynch(int dChannel, int numPulses) throws LabJackException
PulseOutStart
DLL call.
updatePulseAsynchFinish
setDForOutput
and updateAllAOsAndDigitals
.
dChannel
- the line (D0-D7).numPulses
- the number of pulses to create.
LabJackException
- on any error.public void updatePulseAsynch(boolean[] dChannels, int numPulses) throws LabJackException
PulseOutStart
DLL call.
updatePulseAsynchFinish
setDForOutput
and updateAllAOsAndDigitals
.
dChannels
- the lines (D0-D7).numPulses
- the number of pulses to create.
LabJackException
- on any error.public void updatePulseAsynch(boolean[] dChannels, int numPulses, boolean lowFirst) throws LabJackException
PulseOutStart
DLL call.
updatePulseAsynchFinish
setDForOutput
and updateAllAOsAndDigitals
.
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).
LabJackException
- on any error.public void updatePulseAsynchFinish(int timeoutMS) throws LabJackException
updatePulseAsynch
has finished, or the timeout
has expired. If the updatePulseAsynch
has already completed, this call can only time out.
PulseOutFinish
DLL call.
LabJackException
- on any error.public float updateStreamStart(long[] channels, float scanRate, boolean readCount) throws LabJackException
AIStreamStart
DLL call.
channels
- the channels to samplescanRate
- the rate at which to samplereadCount
- whether or not to sample the counter (if so, only the first channel will actually be sampled)
LabJackException
- on any error.public float updateStreamStart(long[] channels, float scanRate) throws LabJackException
AIStreamStart
DLL call.
channels
- the channels to samplescanRate
- the rate at which to sample
LabJackException
- on any error.public void updateStreamClear() throws LabJackException
AIStreamClear
DLL call.
LabJackException
- on any error.public void updateScanFromStream(int scans) throws LabJackException
AIStreamRead
DLL call.
scans
- the number of scans to read
LabJackException
- on any error.public void updateScanFromStream(int scans, int timeout) throws LabJackException
AIStreamRead
DLL call.
scans
- the number of scans to readtimeout
- the time (in seconds) to wait for the data before returning
LabJackException
- on any error.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |