public class LucidControlAI4
extends java.lang.Object
This class encapsulated the LucidControl AI4 Analog Input USB Module functionality.
Modifier and Type | Class and Description |
---|---|
static class |
LucidControlAI4.DeviceType
Device type enumeration
|
static class |
LucidControlAI4.LCAI4Mode
AI4 module Operation Modes
|
Constructor and Description |
---|
LucidControlAI4(java.lang.String portName) |
Modifier and Type | Method and Description |
---|---|
boolean |
close() |
java.lang.String |
getDeviceClassName() |
int |
getDeviceSnr() |
java.lang.String |
getDeviceTypeName()
Get Device Type Name as String
|
IoReturn |
getIo(int channel,
ValueANU2 value)
Get the ADC Register value of the analog input channel.
|
IoReturn |
getIo(int channel,
ValueCUS4 value)
Get the current value of the analog input.
|
IoReturn |
getIo(int channel,
ValueVOS2 value)
Get the Voltage value of the analog input.
|
IoReturn |
getIo(int channel,
ValueVOS4 value)
Get the Voltage value of the analog input.
|
IoReturn |
getIoGroup(boolean[] channels,
ValueANU2[] values)
Get the ADC Register values of a group of analog input channels.
|
IoReturn |
getIoGroup(boolean[] channels,
ValueCUS4[] values)
Get the Current values of a group of analog input channels.
|
IoReturn |
getIoGroup(boolean[] channels,
ValueVOS2[] values)
Get the Voltage values of a group of analog input channels with millivolt
resolution.
|
IoReturn |
getIoGroup(boolean[] channels,
ValueVOS4[] values)
Get the Voltage values of a group of analog input channels with microvolt
resolution.
|
IoReturn |
getParamCalHigh(int channel,
int[] cal)
Get the Configuration Parameter "CalHigh" (Calibration High) of the analog input channel.
|
IoReturn |
getParamCalLow(int channel,
int[] cal)
Get the Configuration Parameter "CalLow" (Calibration Low) of the analog input channel.
|
IoReturn |
getParamMode(int channel,
LucidControlAI4.LCAI4Mode[] mode)
Get the Configuration Parameter "Mode" of the analog input channel.
|
IoReturn |
getParamNrSamples(int channel,
short[] nrOfSamples)
Get the Configuration Parameter "Nr of Samples" of the analog input channel.
|
IoReturn |
getParamOffset(int channel,
short[] offset)
Get the Configuration Parameter "Offset" of the analog input channel.
|
IoReturn |
getParamScanInterval(int channel,
int[] scanInterval)
Get the Configuration Parameter "Scan Interval" of the analog input channel.
|
IoReturn |
getParamValue(int channel,
ValueANU2 value)
Get the Configuration Parameter "Value" of a analog input channel.
|
int |
getRevisionFw() |
short |
getRevisionHw() |
IoReturn |
identify(int options) |
boolean |
isOpened() |
boolean |
open() |
IoReturn |
setParamCalHigh(int channel,
boolean persistent)
Set the Configuration Parameter "CalHigh" (Calibration High) of the analog input channel to the
default value.
|
IoReturn |
setParamCalHigh(int channel,
boolean persistent,
int cal)
Set the Configuration Parameter "CalHigh" (Calibration High) of the analog input channel.
|
IoReturn |
setParamCalLow(int channel,
boolean persistent)
Set the Configuration Parameter "CalLow" (Calibration Low) of the analog input channel to the
default value.
|
IoReturn |
setParamCalLow(int channel,
boolean persistent,
int cal)
Set the Configuration Parameter "CalLow" (Calibration Low) of the analog input channel.
|
IoReturn |
setParamFlags(int channel,
boolean persistent)
Set the Configuration Parameter "Flags" of the analog input channel to the default
value.
|
IoReturn |
setParamMode(int channel,
boolean persistent)
Set the Configuration Parameter "Mode" of the analog input channel to the
default value.
|
IoReturn |
setParamMode(int channel,
boolean persistent,
LucidControlAI4.LCAI4Mode mode)
Set the Configuration Parameter "Mode" of the analog input channel.
|
IoReturn |
setParamNrSamples(int channel,
boolean persistent)
Set the Configuration Parameter "Nr of Samples" of the analog input channel to the
default value.
|
IoReturn |
setParamNrSamples(int channel,
boolean persistent,
short nrOfSamples)
Set the Configuration Parameter "Nr of Samples" of the analog input channel.
|
IoReturn |
setParamOffset(int channel,
boolean persistent)
Set the Configuration Parameter "Offset" of the analog input channel to the
default value.
|
IoReturn |
setParamOffset(int channel,
boolean persistent,
short offset)
Set the Configuration Parameter "Offset" of the analog input channel.
|
IoReturn |
setParamScanInterval(int channel,
boolean persistent)
Set the Configuration Parameter "Scan Interval" of the analog input channel to the
default value.
|
IoReturn |
setParamScanInterval(int channel,
boolean persistent,
int scanInterval)
Set the Configuration Parameter "Scan Interval" of the analog input channel.
|
void |
setPortName(java.lang.String portName) |
public IoReturn getIo(int channel, ValueANU2 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the ADC Register value of the analog input channel.
This method calls the GetIo function of the module and returns the ADC Register value of the analog input channel.
The ADC Register value represents the result of the analog to digital
conversion. It is probably not what you are looking for. Please see other getIo
functions with ValueVOS2
and ValueVOS4
value types.
channel
- Analog input channel to read from. Must be in the range 0 ... 3value
- Analog register value objectIoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIo(int channel, ValueVOS2 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Voltage value of the analog input.
This method calls the GetIo function of the module and returns the current value of an analog input channel.
This method uses Value Type VOS2 of the module.
channel
- Analog input channel to read from. Must be in the range 0 ... 3value
- Voltage value objectIoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIo(int channel, ValueVOS4 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Voltage value of the analog input.
This method calls the GetIo function of the module and returns the current value of an analog input channel.
This method uses Value Type VOS4 of the module.
channel
- Analog input channel to read from. Must be in the range 0 ... 3value
- Voltage value objectIoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIo(int channel, ValueCUS4 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the current value of the analog input.
This method calls the GetIo function of the module and returns the current value of an analog input channel.
This method uses Value Type CUS4 of the module.
channel
- Analog input channel to read from. Must be in the range 0 ... 3value
- Current value objectIoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIoGroup(boolean[] channels, ValueANU2[] values) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the ADC Register values of a group of analog input channels.
This method calls the GetIoGroup function of the module and returns the ADC Register values of a group of analog input channels.
The ADC Register value represents the result of the analog to digital
conversion. It is probably not what you are looking for. Please see other getIoGroup
functions with ValueVOS2
and ValueVOS4
value types.
channels
- Get channel array.
Boolean array with 4 values (one for each channel). A channel is only read in the case that the corresponding channel array value is true.
values
- Analog Register value object array
Empty array prepared for 4 Analog register value objects. The function fills the array with the read value data.
Value objects are only updated in the case that the corresponding channel in the channel array is set to true.
IoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIoGroup(boolean[] channels, ValueVOS2[] values) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Voltage values of a group of analog input channels with millivolt resolution.
This method calls the GetIoGroup function of the module and returns the Voltage values of a group of analog input channels with millivolt resolution.
This method uses Value Type VOS2 of the module. Please consider using the method
with ValueVOS4
for microvolt resolution.
channels
- Get channel array.
Boolean array with 4 values (one for each channel). A channel is only read in the case that the corresponding channel array value is true.
values
- Voltage value object array
Empty array prepared for 4 Voltage value objects. The function fills the array with the read value data.
Value objects are only updated in the case that the corresponding channel in the channel array is set to true.
IoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIoGroup(boolean[] channels, ValueVOS4[] values) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Voltage values of a group of analog input channels with microvolt resolution.
This method calls the GetIoGroup function of the module and returns the Voltage values of a group of analog input channels with microvolt resolution.
This method uses Value Type VOS4 of the module.
channels
- Get channel array.
Boolean array with 4 values (one for each channel). A channel is only read in the case that the corresponding channel array value is true.
values
- Voltage value object array
Empty array prepared for 4 Voltage value objects. The function fills the array with the read value data.
Value objects are only updated in the case that the corresponding channel in the channel array is set to true.
IoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIoGroup(boolean[] channels, ValueCUS4[] values) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Current values of a group of analog input channels.
This method calls the GetIoGroup function of the module and returns the Current values of a group of analog input channels.
This method uses Value Type CUS4 of the module.
channels
- Get channel array.
Boolean array with 4 values (one for each channel). A channel is only read in the case that the corresponding channel array value is true.
values
- Current value object array
Empty array prepared for 4 Current value objects. The function fills the array with the read value data.
Value objects are only updated in the case that the corresponding channel in the channel array is set to true.
IoReturn
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getParamValue(int channel, ValueANU2 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Value" of a analog input channel.
This method calls the GetParam function of the module and returns the value of the Configuration Parameter "Value".
The Configuration Parameter "Value" contains the ADC Register value of the analog input channel. It is recommended to call getIo instead of this method.
The ADC Register value represents the result of the analog to digital conversion.
channel
- Channel to read parameter from. Must be in the range 0 ... 3value
- Analog value objectIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getParamMode(int channel, LucidControlAI4.LCAI4Mode[] mode) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Mode" of the analog input channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "Mode".
The Configuration Parameter "Mode" represents the current operation mode of the analog input channel.
channel
- Channel to read parameter from. Must be in the range 0 ... 3mode
- Analog input channel operation modeIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamMode(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Mode" of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Mode" to its default value.
channel
- Channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamMode(int channel, boolean persistent, LucidControlAI4.LCAI4Mode mode) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Mode" of the analog input channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Mode".
The Configuration Parameter "Mode" represents the current operation mode of the analog input channel.
channel
- Channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.mode
- Operation modeIoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamFlags(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Flags" of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Flags" to its default value.
It is not possible to assign a value to the Configuration Parameter "Flags" directly.
Calling This method initializes all flag values with its default values.
channel
- Channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlyIoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamScanInterval(int channel, int[] scanInterval) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Scan Interval" of the analog input channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "Scan Interval".
channel
- Analog input channel. Must be in the range 0 ... 3scanInterval
- Configuration Parameter "Scan Interval" in millisecondsIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamScanInterval(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Scan Interval" of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Scan Interval" to its default value.
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamScanInterval(int channel, boolean persistent, int scanInterval) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Scan Interval" of the analog input channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Scan Interval".
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlyscanInterval
- Scan Time in millisecondsIoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamNrSamples(int channel, short[] nrOfSamples) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Nr of Samples" of the analog input channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "Number of Samples".
channel
- Analog input channel. Must be in the range 0 ... 3nrOfSamples
- Configuration Parameter "Number of Samples"IoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamNrSamples(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Nr of Samples" of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Nr of Samples" to its default value.
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamNrSamples(int channel, boolean persistent, short nrOfSamples) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Nr of Samples" of the analog input channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Nr of Samples".
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlynrOfSamples
- Number of SamplesIoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamOffset(int channel, short[] offset) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Offset" of the analog input channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "Offset".
channel
- Analog input channel. Must be in the range 0 ... 3offset
- Configuration Parameter "Offset"IoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamOffset(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Offset" of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Offset" to its default value.
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamOffset(int channel, boolean persistent, short offset) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Offset" of the analog input channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Offset".
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlyoffset
- Offset valueIoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamCalLow(int channel, int[] cal) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "CalLow" (Calibration Low) of the analog input channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "CalLow".
channel
- Analog input channel. Must be in the range 0 ... 3cal
- Configuration Parameter "CalLow" (Calibration Low)IoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamCalLow(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "CalLow" (Calibration Low) of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "CalLow" to its default value.
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamCalLow(int channel, boolean persistent, int cal) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "CalLow" (Calibration Low) of the analog input channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "CalLow".
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlycal
- Configuration Parameter "CalLow" (Calibration Low)IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamCalHigh(int channel, int[] cal) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "CalHigh" (Calibration High) of the analog input channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "CalHigh".
channel
- Analog input channel. Must be in the range 0 ... 3cal
- Configuration Parameter "CalHigh" (Calibration High)IoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamCalHigh(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "CalHigh" (Calibration High) of the analog input channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "CalHigh" to its default value.
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanently.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn setParamCalHigh(int channel, boolean persistent, int cal) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "CalHigh" (Calibration High) of the analog input channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "CalHigh".
channel
- Analog input channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlycal
- Configuration Parameter "CalHigh" (Calibration High)IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public java.lang.String getDeviceTypeName() throws java.lang.IllegalStateException
Get Device Type Name as String
java.lang.IllegalStateException
public int getRevisionFw() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public short getRevisionHw() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public java.lang.String getDeviceClassName() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public int getDeviceSnr()
public IoReturn identify(int options) throws java.io.IOException
java.io.IOException
public void setPortName(java.lang.String portName) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public boolean isOpened()
public boolean open() throws java.io.IOException
java.io.IOException
public boolean close() throws java.io.IOException
java.io.IOException