我们今天能为您提供什么帮助?

OPC Quality flags / values

Issue:
Many may be familiar with an OPC quality value of 192 or 0xc0 representing "good", but how, why and what are all the other possible values. Well the quality value actually contains three seperate bit fields each with its own meaning. It makes much more sense if you convert this 192 decimal value into binary, which is 11000000, then apply that to the following excerpt from the OPC DA 3.00 specification (section 6.8 OPC Quality Flags)

Product Line:

Power Monitoring Expert (PME) 9.x
Power Monitoring Expert (PME) 2020
Power Monitoring Expert (PME) 2021
Power Monitoring Expert (PME) 2022
Power Monitoring Expert (PME) 2023
Power Monitoring Expert (PME) 2024

Environment:

OPC

Resolution:


Quality Flags

These flags represent the quality state for a item's data value. This is intended to be similar to but slightly simpler than the Fieldbus Data Quality Specification (section 4.4.1 in the H1 Final Specifications). This design makes it fairly easy for both servers and client applications to determine how much functionality they want to implement.

The low 8 bits of the Quality flags are currently defined in the form of three bit fields; Quality, Substatus and Limit status. The 8 Quality bits are arranged as follows:

QQSSSSLL

The high 8 bits of the Quality Word are available for vendor specific use. If these bits are used, the standard OPC Quality bits must still be set as accurately as possible to indicate what assumptions the client can make about the returned data. In addition it is the responsibility of any client interpreting vendor specific quality information to insure that the server providing it uses the same `rules' as the client. The details of such a negotiation are not specified in this standard although a QueryInterface call to the server for a vendor specific interface such as IMyQualityDefinitions is a possible approach.

Details of the OPC standard quality bits follow:

The Quality BitField:

QQBit ValueDefineDescription
000SSSSLL Bad Value is not useful for reasons indicated by the Substatus.
101SSSSLL Uncertain The quality of the value is uncertain for reasons indicated by the Substatus.
210SSSSLL N/ANot used by OPC
311SSSSLL Good The Quality of the value is Good.

Comment:

A server which supports no quality information must return 3 (Good). It is also acceptable for a server to simply return Bad or Good (0x00 or 0xC0) and to always return 0 for Substatus and limit.

It is recommended that clients minimally check the Quality Bit field of all results (even if they do not check the substatus or limit fields).

Even when a `BAD' value is indicated, the contents of the value field must still be a well-defined VARIANT even though it does not contain an accurate value. This is to simplify error handling in client applications. For example, clients are always expected to call VariantClear() on the results of a Synchronous Read.

If the server has no known value to return then some reasonable default should be returned such as a NUL string or a 0 numeric value.

The Substatus BitField

The layout of this field depends on the value of the Quality Field.

Substatus for BAD Quality:

SSSS Bit ValueDefine Description
0000000LL Non-specific The value is bad but no specific reason is known.
1000001LL Configuration Error There is some server specific problem with the configuration. For example the item in question has been deleted from the configuration.
2000010LL Not ConnectedThe 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.
3000011LL Device Failure A device failure has been detected.
4000100LL Sensor Failure A sensor failure had been detected (the 'Limits' field can provide additional diagnostic information in some situations).
5000101LL Last Known ValueCommunications 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.
6000110LL Comm FailureCommunications have failed. There is no last known value is available.
7000111LL Out of Service 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.
8001000LL Waiting for Initial Data After Items are added to a group, it may take some time for the server to actually obtain values for these items. In such cases the client might perform a read (from cache), or establish a ConnectionPoint based subscription and/or execute a Refresh on such a subscription before the values are available. This substatus is only available from OPC DA 3.0 or newer servers.
9-15 N/AReserved for future OPC use

Comment:

Servers which do not support Substatus should return 0. Note that an `old' value may be returned with the Quality set to BAD (0) and the Substatus set to 5. This is for consistency with the Fieldbus Specification. This is the only case in which a client may assume that a `BAD' value is still usable by the application.

Substatus for UNCERTAIN Quality:

SSSS Bit ValueDefine Description
0010000LL Non-specific There is no specific reason why the value is uncertain.
1010000LL Last Usable ValueWhatever 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.
2-3010000LL N/A Not used by OPC
4010000LLSensor Not Accurate 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).
5010000LL Engineering Units Exceeded 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.
6010000LL Sub-NormalThe value is derived from multiple sources and has less than the required number of Good sources.
7-15N/Areserved for future OPC use


Comment:

Servers which do not support Substatus should return 0.

Substatus for GOOD Quality:

SSSS Bit ValueDefine Description
0110000LL Non-specific The value is good. There are no special conditions
1-5N/ANot used by OPC
6110110LL Local OverrideThe value has been Overridden. Typically this is means the input has been disconnected and a manually entered value has been `forced'.
7-15010000LL N/Areserved for future OPC use


Comment:

Servers which do not support Substatus should return 0.

The Limit BitField

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

LL Bit ValueDefine Description
0QQSSSS00 Not LimitedThe value is free to move up or downThe value is free to move up or down
1QQSSSS01 Low LimitedThe value has `pegged' at some lower limit
2QQSSSS10 High LimitedThe value has `pegged' at some high limit.
3QQSSSS11 Constant The value is a constant and cannot move.

Comment:

Servers which do not support Limit should return 0.

Symbolic Equates are defined for values and masks for these BitFields in the "QUALITY" section of the OPC header files.

施耐德電機Taiwan

探索更多
產品:
探索更多
產品:

需要協助?

需要協助?

產品選型工具

產品選型工具

快速輕鬆地為您的應用找到合適的產品和附件。

取得報價

取得報價

立即線上提交您的銷售需求,專業團隊將主動聯繫您。

購買地點

購買地點

輕鬆在您所在地區找到最近的施耐德電機經銷商。

支援中心

支援中心

在同一位置找到滿足您所有需求的支援資源。

  • 產品文檔
  • 軟體下載
  • 產品選型工具
  • 產品替代和替換
  • 幫助和聯絡中心
  • 尋找我們的辦公室
  • 取得報價
  • 施耐德電機社群
  • 人才招募
  • 公司簡介
  • 舉報不當行為
  • 無障礙
  • 新聞中心
  • 投資者
  • 專業洞察
  • 台灣施耐德電機學院
  • 綠色影響力落差調查
  • Schneider Go Green 2025
  • 隱私政策
  • Cookie通告
  • 使用條款
  • Change your cookie settings