|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.opi.io.DefaultIOItem
dk.opi.io.opc.opcclient.OpcItem
This class implements functinality related to items. An items represents the input/output points read/written to/from the devices monitored by the OPC server.
This class has no public constructor - use the OpcGroup.addItem() method to create instances of this class.
OpcGroup.addItem(java.lang.String, java.lang.String, boolean, int, java.lang.String)
Field Summary | |
protected boolean |
invalid
This value is set to true if this item has been invalidated - ie. if it has been removed from the OPC server |
protected Object |
oldChangeValue
|
Fields inherited from class dk.opi.io.DefaultIOItem |
actionCommand, active, dataType, description, GOOD_QUALITY_VALUE, ioGroup, name, oldValue, userObject |
Fields inherited from interface dk.opi.io.IOItem |
CACHE_READ, DATATYPE_BOOL, DATATYPE_BOOLARRAY, DATATYPE_DATE, DATATYPE_DOUBLE, DATATYPE_DOUBLEARRAY, DATATYPE_FLOAT, DATATYPE_FLOATARRAY, DATATYPE_INT, DATATYPE_INTARRAY, DATATYPE_STRING, DATATYPE_USE_NATIVE, DEVICE_READ |
Method Summary | |
IOQuality |
getOldQuality()
Returns the quality of the last read value, ie. quality corresponding to the item value returned from calling DefaultIOItem.getOldValue()
For efficiency reasons the same static IOQuality object is being reused
when quality is good, ie. sub-status and limit value for good values
will always be IOQuality.GOOD_NON_SPECIFIC and
IOQuality.LIMIT_NOT_LIMITED respectively |
boolean |
isInvalid()
Get the value of invalid. |
boolean |
isOldQualityGood()
Returns quality of last read value. |
Object |
readValue()
Read the item value from the device. |
Object |
readValue(int dataSource)
Read the item value from the device. |
void |
writeIntValue(int value)
Deprecated. Replaced by writeValue(int). |
void |
writeValue(boolean value)
Write the specified value to the device. |
void |
writeValue(Boolean value)
Write the specified value to the device. |
void |
writeValue(boolean[] values)
Write the specified array of booleans to the device. |
void |
writeValue(double value)
Write the specified value to the device. |
void |
writeValue(double[] values)
Write the specified array of doubles to the device. |
void |
writeValue(float value)
Write the specified value to the device. |
void |
writeValue(float[] values)
Write the specified array of floats to the device. |
void |
writeValue(int value)
Write the specified value to the device. |
void |
writeValue(int[] values)
Write the specified array of integers to the device. |
void |
writeValue(String value)
Write the specified value to the device. |
Methods inherited from class dk.opi.io.DefaultIOItem |
getActionCommand, getDataType, getDescription, getGroup, getOldValue, getUserObject, isActive, setActionCommand, setDescription, setOldValue, setUserObject, toString, writeValue, writeValue, writeValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Object oldChangeValue
protected boolean invalid
Method Detail |
public Object readValue() throws RbxIOException
readValue
in interface IOItem
readValue
in class DefaultIOItem
RbxIOException
- thrown if the read operation failedpublic Object readValue(int dataSource) throws RbxIOException
readValue
in interface IOItem
readValue
in class DefaultIOItem
dataSource
- The source to read from, ie. CACHE_READ or DEVICE_READ. A cache read
will obtain the current value for the item from the device server cache
(ie. OPC server). This is fast but the value is only updated with the
specified update rate. A CACHE read is accurate to within the
'UpdateRate' of the group.RbxIOException
- thrown if the read operation failedpublic void writeIntValue(int value) throws RbxIOException
writeIntValue
in interface IOItem
writeIntValue
in class DefaultIOItem
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(int value) throws RbxIOException
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(float value) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(double value) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(String value) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(boolean value) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(Boolean value) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
value
- The value to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(int[] values) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
values
- The array of integer values to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(float[] values) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
values
- The array of float values to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(double[] values) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
values
- The array of double values to send to the device
RbxIOException
- thrown if the write operation failedpublic void writeValue(boolean[] values) throws RbxIOException
writeValue
in interface IOItem
writeValue
in class DefaultIOItem
values
- The array of boolean values to send to the device
RbxIOException
- thrown if the write operation failedpublic IOQuality getOldQuality()
DefaultIOItem.getOldValue()
For efficiency reasons the same static IOQuality object is being reused
when quality is good, ie. sub-status and limit value for good values
will always be IOQuality.GOOD_NON_SPECIFIC
and
IOQuality.LIMIT_NOT_LIMITED
respectively
getOldQuality
in interface IOItem
getOldQuality
in class DefaultIOItem
IOQuality
. Guaranteed
never to return null.public boolean isOldQualityGood()
getOldQuality()
and then investigate the
returned IOQuality
instance, since the implementation need
not create an IOQuality
instance to determine if the quality
is good or not.
This default implementation will always return true. Subclasses may
overwrite for specific implementations
isOldQualityGood
in interface IOItem
isOldQualityGood
in class DefaultIOItem
IOQuality
public boolean isInvalid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |