public class LucidControlDO4
extends java.lang.Object
This class encapsulates the LucidControl DO4 Digital Output USB Module functionality.
Modifier and Type | Class and Description |
---|---|
static class |
LucidControlDO4.DeviceType
Device type enumeration
|
static class |
LucidControlDO4.LCDO4Mode
DO4 module Operation Modes
|
Constructor and Description |
---|
LucidControlDO4(java.lang.String portName)
Constructor for LucidControl Digital Output USB Module
|
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,
ValueDI1 value)
Get the value or state of one digital output channel.
|
IoReturn |
getIoGroup(boolean[] channels,
ValueDI1[] values)
Get the values or states of a group of digital output channels.
|
IoReturn |
getParamCycleTime(int channel,
long[] cycleTime)
Get the Configuration Parameter "Cycle Time" of the digital output channel.
|
IoReturn |
getParamDutyCycle(int channel,
short[] dutyCycle)
Get the Configuration Parameter "Duty Cycle" of the digital output channel.
|
IoReturn |
getParamFlagCanCancel(int channel,
boolean[] canCancel)
Get the Configuration Parameter Flag "Can Cancel".
|
IoReturn |
getParamFlagCanRetrigger(int channel,
boolean[] canRetrigger)
Get the Configuration Parameter Flag "Can Retrigger".
|
IoReturn |
getParamFlagInverted(int channel,
boolean[] inverted)
Get the Configuration Parameter Flag "Inverted".
|
IoReturn |
getParamMode(int channel,
LucidControlDO4.LCDO4Mode[] mode)
Get the Configuration Parameter "Mode" of the digital output channel.
|
IoReturn |
getParamOnDelay(int channel,
long[] onDelay)
Get the Configuration Parameter "On Delay" of the digital output channel.
|
IoReturn |
getParamOnHold(int channel,
long[] onHold)
Get the Configuration Parameter "On Hold" of the digital output channel.
|
IoReturn |
getParamValue(int channel,
ValueDI1 value)
Get the Configuration Parameter "Value" of a digital output channel.
|
int |
getRevisionFw() |
short |
getRevisionHw() |
IoReturn |
identify(int options) |
boolean |
isOpened() |
boolean |
open() |
IoReturn |
setIo(int channel,
ValueDI1 value)
Set the value or state of one output channel.
|
IoReturn |
setIoGroup(boolean[] channels,
ValueDI1[] values)
Write values or states of a group of output channels.
|
IoReturn |
setParamCycleTime(int channel,
boolean persistent)
Set the Configuration Parameter "Cycle Time" of the digital output channel to the
default value.
|
IoReturn |
setParamCycleTime(int channel,
boolean persistent,
long cycleTime)
Set the Configuration Parameter "Cycle Time" of the digital output channel.
|
IoReturn |
setParamDutyCycle(int channel,
boolean persistent)
Set the Configuration Parameter "Duty Cycle" of the digital output channel to the
default value.
|
IoReturn |
setParamDutyCycle(int channel,
boolean persistent,
short dutyCycle)
Set the Configuration Parameter "Duty Cycle" of the digital output channel.
|
IoReturn |
setParamFlagCanCancel(int channel,
boolean persistent,
boolean canCancel)
Set the Configuration Parameter Flag "Can Cancel".
|
IoReturn |
setParamFlagCanRetrigger(int channel,
boolean persistent,
boolean canRetrigger)
Set the Configuration Parameter Flag "Can Retrigger".
|
IoReturn |
setParamFlagInverted(int channel,
boolean persistent,
boolean inverted)
Set the Configuration Parameter Flag "Inverted".
|
IoReturn |
setParamFlags(int channel,
boolean persistent)
Set the Configuration Parameter "Flags" of the digital output channel to the default
value.
|
IoReturn |
setParamMode(int channel,
boolean persistent)
Set the Configuration Parameter "Mode" of the digital output channel to the default
value.
|
IoReturn |
setParamMode(int channel,
boolean persistent,
LucidControlDO4.LCDO4Mode mode)
Set the Configuration Parameter "Mode" of the digital output channel.
|
IoReturn |
setParamOnDelay(int channel,
boolean persistent)
Set the Configuration Parameter "On Delay" of the digital output channel to the
default value.
|
IoReturn |
setParamOnDelay(int channel,
boolean persistent,
long onDelay)
Set the Configuration Parameter "On Delay" of the digital output channel.
|
IoReturn |
setParamOnHold(int channel,
boolean persistent)
Set the Configuration Parameter "On Hold" of the digital output channel to the
default value.
|
IoReturn |
setParamOnHold(int channel,
boolean persistent,
long onHold)
Set the Configuration Parameter "On Hold" of the digital output channel.
|
IoReturn |
setParamValue(int channel,
boolean persistent)
Set the Configuration Parameter "Value" of the output channel to the default
value.
|
IoReturn |
setParamValue(int channel,
boolean persistent,
ValueDI1 value)
Set the Configuration Parameter "Value" of the output channel.
|
void |
setPortName(java.lang.String portName) |
public LucidControlDO4(java.lang.String portName)
portName
- Name of serial portpublic IoReturn getIo(int channel, ValueDI1 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the value or state of one digital output channel.
This method calls the GetIo function of the module and returns the value or state of the digital output channel.
channel
- Output channel to read from. Must be in the range 0 ... 3value
- Digital value objectIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getIoGroup(boolean[] channels, ValueDI1[] values) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the values or states of a group of digital output channels.
This method calls the GetIoGroup function of the module and returns the values or states of a group of digital output channels.
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
- Digital value object array.
Empty array prepared for 4 digital value objects. The function fills this 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
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setIo(int channel, ValueDI1 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Set the value or state of one output channel.
This method calls the SetIo function of the module and writes the value or state of the output channel.
channel
- Output channel to write to. Must be in the range 0 ... 3value
- Digital value object initialized with the updated dataIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setIoGroup(boolean[] channels, ValueDI1[] values) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Write values or states of a group of output channels.
This method calls the SetIoGroup function of the module and writes the values or states of a group of output channels.
channels
- Write channel array.
Boolean array with 4 values (o for each channel). A channel is only written in the case that the corresponding channel array value is true.
values
- Digital value object array.
Array containing 4 digital value objects. The values of the objects are written to the output channels in the case that the corresponding channel array value is true.
IoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getParamValue(int channel, ValueDI1 value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Value" of a digital output 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 current value or state of the output channel. It is recommended to call getIo instead of this method.
channel
- Channel to read parameter from. Must be in the range 0 ... 3value
- Digital value objectIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamValue(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Value" of the output channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Value" 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 setParamValue(int channel, boolean persistent, ValueDI1 value) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Value" of the output channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Value" to the value of the digital value object.
Using this method allows to initialize the output value or state with a specific value after startup. The output can be set after a restart by making the new setting permanent.
channel
- Channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlyvalue
- Digital value object containing the configuration valueIoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamMode(int channel, LucidControlDO4.LCDO4Mode[] mode) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Mode" of the digital output 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 digital output channel.
channel
- Channel to read parameter from. Must be in the range 0 ... 3mode
- Digital output 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 digital output 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, LucidControlDO4.LCDO4Mode mode) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Mode" of the digital output 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 digital output channel.
channel
- Channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlymode
- 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 digital output 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. Please access this parameter by using one of the flag specific methods:
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 getParamFlagCanCancel(int channel, boolean[] canCancel) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter Flag "Can Cancel".
This method calls the GetParam function and returns the Configuration Flag "Can Cancel".
channel
- Digital output channel. Must be in the range 0 ... 3canCancel
- Digital output "Can Cancel" Configuration Parameter FlagIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamFlagCanCancel(int channel, boolean persistent, boolean canCancel) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter Flag "Can Cancel".
This method calls the SetParam function and sets the Configuration Flag "Can Cancel".
channel
- Digital output channel to configure. Must be in the range 0 ... 3canCancel
- Digital output "Can Cancel" Configuration Parameter FlagIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getParamFlagCanRetrigger(int channel, boolean[] canRetrigger) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter Flag "Can Retrigger".
This method calls the GetParam function and returns the Configuration Flag "Can Retrigger".
channel
- Digital output channel. Must be in the range 0 ... 3canRetrigger
- Returned digital output "Can Retrigger" Configuration Parameter FlagIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamFlagCanRetrigger(int channel, boolean persistent, boolean canRetrigger) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter Flag "Can Retrigger".
This method calls the SetParam function and sets the Configuration Flag "Can Retrigger".
channel
- Digital output channel to configure. Must be in the range 0 ... 3canRetrigger
- Digital output "Can Retrigger" Configuration Parameter FlagIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getParamFlagInverted(int channel, boolean[] inverted) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter Flag "Inverted".
This method calls the GetParam function and returns the Configuration Flag "Inverted".
channel
- Digital output channel. Must be in the range 0 ... 3inverted
- Returned digital output "Inverted" Configuration Parameter FlagIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamFlagInverted(int channel, boolean persistent, boolean inverted) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter Flag "Inverted".
This method calls the SetParam function and sets the Configuration Flag "Inverted".
channel
- Digital output channel to configure. Must be in the range 0 ... 3inverted
- Digital output "Inverted" Configuration Parameter FlagIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn getParamCycleTime(int channel, long[] cycleTime) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Cycle Time" of the digital output channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "Cycle Time".
channel
- Digital output channel. Must be in the range 0 ... 3cycleTime
- Configuration Parameter "Cycle Time" in microsecondsIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamCycleTime(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Cycle Time" of the digital output channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Cycle Time" to its default value.
channel
- Digital output 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 setParamCycleTime(int channel, boolean persistent, long cycleTime) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Cycle Time" of the digital output channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Cycle Time".
channel
- Digital output channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlycycleTime
- Cycle Time in microseconds. Value must be positive and must not be
bigger than 1h = 3,600s = 3,600,000,000 microseconds.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamDutyCycle(int channel, short[] dutyCycle) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "Duty Cycle" of the digital output channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "Duty Cycle".
channel
- Digital output channel. Must be in the range 0 ... 3dutyCycle
- Returned digital output channel Configuration Parameter "Duty Cycle"IoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamDutyCycle(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Duty Cycle" of the digital output channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "Duty Cycle" to its default value.
channel
- Digital output 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 setParamDutyCycle(int channel, boolean persistent, short dutyCycle) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "Duty Cycle" of the digital output channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "Duty Cycle".
channel
- Digital output channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlydutyCycle
- Duty Cycle in 1/1000 (0.1%). Value must be positive and must not be
bigger than 1,000.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamOnHold(int channel, long[] onHold) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "On Hold" of the digital output channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "On Hold".
channel
- Digital output channel. Must be in the range 0 ... 3onHold
- Returned "On Hold" in microsecondsIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamOnHold(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "On Hold" of the digital output channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "On Hold" to its default value.
channel
- Digital output 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 setParamOnHold(int channel, boolean persistent, long onHold) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "On Hold" of the digital output channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "On Hold".
channel
- Digital output channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlyonHold
- On Hold Time in microseconds. Value must be positive and must not be
bigger than 1h = 3,600s = 3,600,000,000 microseconds.IoReturn
Valuejava.lang.IllegalArgumentException
java.io.IOException
public IoReturn getParamOnDelay(int channel, long[] onDelay) throws java.lang.IllegalArgumentException, java.lang.NullPointerException, java.io.IOException
Get the Configuration Parameter "On Delay" of the digital output channel.
This method calls the GetParam function of the module and returns the Configuration Parameter "On Delay".
channel
- Digital output channel. Must be in the range 0 ... 3onDelay
- Returned "On Delay" in microsecondsIoReturn
Valuejava.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException
public IoReturn setParamOnDelay(int channel, boolean persistent) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "On Delay" of the digital output channel to the default value.
This method calls the SetParam function of the module and sets the Configuration Parameter "On Delay" to its default value.
channel
- Digital output 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 setParamOnDelay(int channel, boolean persistent, long onDelay) throws java.lang.IllegalArgumentException, java.io.IOException
Set the Configuration Parameter "On Delay" of the digital output channel.
This method calls the SetParam function of the module and sets the Configuration Parameter "On Delay".
channel
- Digital output channel to configure. Must be in the range 0 ... 3persistent
- If this parameter is true the setting is stored permanentlyonDelay
- On Delay Time in microseconds. Value must be positive and must not be
bigger than 1h = 3,600s = 3,600,000,000 microseconds.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