dk.opi.io
Interface IOQuality

All Known Implementing Classes:
OpcQuality

public interface IOQuality

This interface describes the quality state for an IOItem value. The structure of this interface has been designed around the item quality concept used by OPC, but is general enough to be used by non-opc server implementations as well.


Field Summary
static int BAD_COMM_FAILURE
          Used when quality value is QUALITY_BAD Communications have failed.
static int BAD_CONFIGURATION_ERROR
          Used when quality value is QUALITY_BAD There is some server specific problem with the configuration.
static int BAD_DEVICE_FAILURE
          Used when quality value is QUALITY_BAD A device failure has been detected
static int BAD_LAST_KNOWN_VALUE
          Used when quality value is QUALITY_BAD Communications have failed.
static int BAD_NON_SPECIFIC
          Used when quality value is QUALITY_BAD.
static int BAD_NOT_CONNECTED
          Used when quality value is QUALITY_BAD The input is required to be logically connected to something but is not.
static int BAD_OUT_OF_SERVICE
          Used when quality value is QUALITY_BAD The block is off scan or otherwise locked This quality is also used when the active state of the item or the group containing the item is InActive.
static int BAD_SENSOR_FAILURE
          Used when quality value is QUALITY_BAD A sensor failure had been detected (the 'Limits' field can provide additional diagnostic information in some situations.)
static int GOOD_LOCAL_OVERRIDE
          Used when quality value is QUALITY_GOOD The value has been Overridden.
static int GOOD_NON_SPECIFIC
          Used when quality value is QUALITY_GOOD The value is good.
static int LIMIT_CONSTANT
          The value is a constant and cannot move.
static int LIMIT_HIGHLIMITED
          The value has 'pegged' at some high limit.
static int LIMIT_LOWLIMITED
          The value has 'pegged' at some lower limit
static int LIMIT_NOT_LIMITED
          The value is free to move up or down
static int QUALITY_BAD
          Value is not useful for reasons indicated by the Substatus.
static int QUALITY_GOOD
          The Quality of the value is Good.
static int QUALITY_UNCERTAIN
          The quality of the value is uncertain for reasons indicated by the Substatus. for OPC type items this may indicate that a cached value has been read from an inactive group or item.
static int UNCERTAIN_ENGINEERING_UNITS_EXCEEDED
          Used when quality value is QUALITY_UNCERTAIN The returned value is outside the limits defined for this parameter.
static int UNCERTAIN_LAST_USABLE_VALUE
          Used when quality value is QUALITY_UNCERTAIN Whatever was writing this value has stopped doing so.
static int UNCERTAIN_NON_SPECIFIC
          Used when quality value is QUALITY_UNCERTAIN There is no specific reason why the value is uncertain.
static int UNCERTAIN_SENSOR_NOT_ACCURATE
          Used when quality value is QUALITY_UNCERTAIN Either the value has 'pegged' at one of the sensor limits (in which case the limit field should be set to 1 or 2) or the sensor is otherwise known to be out of calibration via some form of internal diagnostics (in which case the limit field should be 0).
static int UNCERTAIN_SUB_NORMAL
          Used when quality value is QUALITY_UNCERTAIN The value is derived from multiple sources and has less than the required number of Good sources.
 
Method Summary
 int getLimitField()
          The Limit Field is valid regardless of the Quality and Substatus.
 int getQuality()
          Returns the quality of the item in question
 int getSubStatus()
          Returns the sub status for the item in question
 boolean isQualityGood()
          Convinience method.
 

Field Detail

QUALITY_BAD

public static final int QUALITY_BAD
Value is not useful for reasons indicated by the Substatus.

See Also:
Constant Field Values

QUALITY_UNCERTAIN

public static final int QUALITY_UNCERTAIN
The quality of the value is uncertain for reasons indicated by the Substatus. for OPC type items this may indicate that a cached value has been read from an inactive group or item.

See Also:
Constant Field Values

QUALITY_GOOD

public static final int QUALITY_GOOD
The Quality of the value is Good.

See Also:
Constant Field Values

BAD_NON_SPECIFIC

public static final int BAD_NON_SPECIFIC
Used when quality value is QUALITY_BAD. The value is bad but no specific reason is known

See Also:
Constant Field Values

BAD_CONFIGURATION_ERROR

public static final int BAD_CONFIGURATION_ERROR
Used when quality value is QUALITY_BAD There is some server specific problem with the configuration. For example the item in question has been deleted from the configuration.

See Also:
Constant Field Values

BAD_NOT_CONNECTED

public static final int BAD_NOT_CONNECTED
Used when quality value is QUALITY_BAD The input is required to be logically connected to something but is not. This quality may reflect that no value is available at this time, for reasons like the value may have not been provided by the data source.

See Also:
Constant Field Values

BAD_DEVICE_FAILURE

public static final int BAD_DEVICE_FAILURE
Used when quality value is QUALITY_BAD A device failure has been detected

See Also:
Constant Field Values

BAD_SENSOR_FAILURE

public static final int BAD_SENSOR_FAILURE
Used when quality value is QUALITY_BAD A sensor failure had been detected (the 'Limits' field can provide additional diagnostic information in some situations.)

See Also:
Constant Field Values

BAD_LAST_KNOWN_VALUE

public static final int BAD_LAST_KNOWN_VALUE
Used when quality value is QUALITY_BAD Communications have failed. However, the last known value is available. Note that the 'age' of the value may be determined from the TIMESTAMP in the OPCITEMSTATE.

See Also:
Constant Field Values

BAD_COMM_FAILURE

public static final int BAD_COMM_FAILURE
Used when quality value is QUALITY_BAD Communications have failed. There is no last known value is available.

See Also:
Constant Field Values

BAD_OUT_OF_SERVICE

public static final int BAD_OUT_OF_SERVICE
Used when quality value is QUALITY_BAD The block is off scan or otherwise locked This quality is also used when the active state of the item or the group containing the item is InActive.

See Also:
Constant Field Values

UNCERTAIN_NON_SPECIFIC

public static final int UNCERTAIN_NON_SPECIFIC
Used when quality value is QUALITY_UNCERTAIN There is no specific reason why the value is uncertain.

See Also:
Constant Field Values

UNCERTAIN_LAST_USABLE_VALUE

public static final int UNCERTAIN_LAST_USABLE_VALUE
Used when quality value is QUALITY_UNCERTAIN Whatever was writing this value has stopped doing so. The returned value should be regarded as 'stale'. Note that this differs from a BAD value with Substatus 5 (Last Known Value). That status is associated specifically with a detectable communications error on a 'fetched' value. This error is associated with the failure of some external source to 'put' something into the value within an acceptable period of time. Note that the 'age' of the value can be determined from the TIMESTAMP in OPCITEMSTATE.

See Also:
Constant Field Values

UNCERTAIN_SENSOR_NOT_ACCURATE

public static final int UNCERTAIN_SENSOR_NOT_ACCURATE
Used when quality value is QUALITY_UNCERTAIN Either the value has 'pegged' at one of the sensor limits (in which case the limit field should be set to 1 or 2) or the sensor is otherwise known to be out of calibration via some form of internal diagnostics (in which case the limit field should be 0).

See Also:
Constant Field Values

UNCERTAIN_ENGINEERING_UNITS_EXCEEDED

public static final int UNCERTAIN_ENGINEERING_UNITS_EXCEEDED
Used when quality value is QUALITY_UNCERTAIN The returned value is outside the limits defined for this parameter. Note that in this case (per the Fieldbus Specification) the 'Limits' field indicates which limit has been exceeded but does NOT necessarily imply that the value cannot move farther out of range.

See Also:
Constant Field Values

UNCERTAIN_SUB_NORMAL

public static final int UNCERTAIN_SUB_NORMAL
Used when quality value is QUALITY_UNCERTAIN The value is derived from multiple sources and has less than the required number of Good sources.

See Also:
Constant Field Values

GOOD_NON_SPECIFIC

public static final int GOOD_NON_SPECIFIC
Used when quality value is QUALITY_GOOD The value is good. There are no special conditions

See Also:
Constant Field Values

GOOD_LOCAL_OVERRIDE

public static final int GOOD_LOCAL_OVERRIDE
Used when quality value is QUALITY_GOOD The value has been Overridden. Typically this means the input has been disconnected and a manually entered value has been 'forced'.

See Also:
Constant Field Values

LIMIT_NOT_LIMITED

public static final int LIMIT_NOT_LIMITED
The value is free to move up or down

See Also:
getLimitField(), Constant Field Values

LIMIT_LOWLIMITED

public static final int LIMIT_LOWLIMITED
The value has 'pegged' at some lower limit

See Also:
getLimitField(), Constant Field Values

LIMIT_HIGHLIMITED

public static final int LIMIT_HIGHLIMITED
The value has 'pegged' at some high limit.

See Also:
getLimitField(), Constant Field Values

LIMIT_CONSTANT

public static final int LIMIT_CONSTANT
The value is a constant and cannot move.

See Also:
getLimitField(), Constant Field Values
Method Detail

isQualityGood

public boolean isQualityGood()
Convinience method. Returns the result of the comparison getQuality() == QUALITY_GOOD


getQuality

public int getQuality()
Returns the quality of the item in question

Returns:
any of the values QUALITY_BAD, QUALITY_UNCERTAIN or QUALITY_GOOD

getSubStatus

public int getSubStatus()
Returns the sub status for the item in question

Returns:
the return value depends on the current status as returned by getQuality(). For BAD values any of the values BAD_NON_SPECIFIC, etc. are returned. For UNCERTAIN values any of the values UNCERTAIN_NON_SPECIFIC, etc. are returned. For GOOD values any of the values GOOD_NON_SPECIFIC, etc. are returned.

getLimitField

public int getLimitField()
The Limit Field is valid regardless of the Quality and Substatus. In some cases such as Sensor Failure it can provide useful diagnostic information.

Returns:
any of the values LIMIT_NOT_LIMITED, LIMIT_LOWLIMITED, LIMIT_HIGHLIMITED or LIMIT_CONSTANT