本文来源:https://support.softwaretoolbox.com/app/answers/detail/a_id/414/~/opc-da-quality-codes

文章目录

  • 1. OPC Quality flags OPC质量代码
  • 2. OPC 质量代码的结构
    • 1. 低 8 位 -- OPC 标准质量位:固定意义。质量位、子状态位、限值状态位
    • 2. 高 8 位:厂商自定内容
  • 3. OPC 标准质量位 (低 8 位) 的详细含义解析
    • 质量位域 (Quality, QQ, 高 2 位)
    • 子状态位域 (Substatus, SSSS, 中间 4 位)
      • 1. 不可用状态下的子状态 (QQ = 0b00)
      • 2. 不确定状态下的子状态 (QQ = 0b01)
      • 2. 良好状态下的子状态 (QQ = 0b11)
    • 极限状态位域 (Limit status, LL, 低 2 位)

1. OPC Quality flags OPC质量代码

OPC质量代码表示数据值的质量状态。它与现场总线数据质量规范相似但更简单一些。这种设计使OPC服务器和客户端应用程序都可以轻松确定要实现的功能量。
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.

2. OPC 质量代码的结构

质量代码由 16 位二进制数组成。其中低 8 位为固定内容,称为标准 OPC 质量位,高 8 位为厂商自定义内容

1. 低 8 位 – OPC 标准质量位:固定意义。质量位、子状态位、限值状态位

  1. OPC质量代码的低8位,划分为3个区域

    1. 质量位域 (Quality, Q):占最高 2 位
    2. 子状态位域 (Substatus, S):占中间 4 位
    3. 限值状态位与(Limit status, L):占最低 2 位
  2. 8 位的排列方式如下:
    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:
 最高位 --> 最低位QQ SSSS LL

2. 高 8 位:厂商自定内容

质量代码的高8位可供厂商自定义。如果使用这些位,则OPC标准质量位 (质量代码低 8 位) 仍必须尽可能准确地设置,以指示客户端对返回的数据做出处理。此外,任何解释供应商特定质量信息的客户端都要确保提供这些信息的服务器使用与客户端相同的“规则”。OPC标准中未指定质量代码自定义内容的协商确定机制,一种可行的方法是调用厂商接口服务器的特定的查询接口。
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.

3. OPC 标准质量位 (低 8 位) 的详细含义解析

  1. 质量位域 (Quality, QQ, 高 2 位) --> 子状态位域 (Substatus, SSSS, 中间 4 位)

    不同质量位域 + 不同子状态位域 = 该点的状态信息
    
  2. 限值状态位 (Limit status, LL, 低 2 位),与质量位、子状态位相互独立,再某些情况下 (如传感器故障) 能提供有用的额外诊断信息。
    The Limit Field is valid regardless of the Quality and Substatus. In some cases such as Sensor Failure it can provide useful diagnostic information.

质量位域 (Quality, QQ, 高 2 位)

十进制 二进制值 定义 描述
0 00SSSSLL 值不可用 (Bad) 值不可用 (通信异常),具体原因见子状态位域描述 (Value is not useful for reasons indicated by the Substatus)
1 01SSSSLL 值不确定 (Uncertain) 值不确定 (通信状态未知),具体原因见子状态位域描述 (The quality of the value is uncertain for reasons indicated by the Substatus)
2 10SSSSLL 不使用 (N/A) OPC 质量代码不使用此值 (Not used by OPC)
3 11SSSSLL 良好 (Good) 值是良好 (通信正常) 的 (The Quality of the value is Good)
  1. 不支持任何质量信息的OPC服务器,质量位域必须返回3(良好 Good)。并始终将“子状态位域”和“限制位域”设置返回0值 (即 8 位输出 = 0x00)
    支持最简单质量信息的OPC服务器只需返回“坏 (Bad)”或“好 (Good)”(质量位域 = 0 或 3),并始终将“子状态位域”和“限制位域”设置返回0值 (即8位输出 = 0x00 或 0xC0)
    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.

  2. 建议客户端:至少检查所有值的“质量位域”。
    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).

  3. 在“质量位域:指示了“BAD”值时,值字段的内容也必须仍然是可读的变量形式,即使它不包含准确的值。这样可简化客户端应用程序中的错误处理。
    例如:客户端在同步读取过程中,不论点位的质量如何,总是调用统一的 VariantClear() 函数进行处理,当数据质量为”Bad“时,此函数也能正常对数据流中包含的值和数据进行交互和解包。
    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 Sychronous Read. Similarly the IAdviseSink needs to be able to interpret and ‘unpack’ the Value and Data included in the Stream even if that data is BAD.

  4. 如果服务器中没有对应点位的值,则应返回一些合理的默认值,例如 NUL 字符串或 0 数值。
    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.

子状态位域 (Substatus, SSSS, 中间 4 位)

此位域包含的内容取决于”质量位域“。

1. 不可用状态下的子状态 (QQ = 0b00)

十进制 二进制值 定义 描述
0 000000LL 未指定 (Non-specific) 该值不可用,但不知道具体原因 (The value is bad but no specific reason is known)
1 000001LL 配置错误 (Configuration Error) 服务器配置存在问题。如:项目已从配置中删除 (There is some server specific problem with the configuration. For example the item is question has been deleted from the configuration.)
2 000010LL 未连接 (Not Connected) 输入需要在逻辑上连接到某物,但实际没有连接。这种质量可能时目前没有可用的值,原因可能是数据源可能没有提供该值 (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)
3 000011LL 设备故障 (Device Failure) 检测到设备故障 (A device failure has been detected)
4 000100LL 传感器故障 (Sensor Failure) 检测到传感器故障(“限制位域”可以提供额外的诊断信息) (A sensor failure had been detected (the ’Limits’ field can provide additional diagnostic information in some situations))
5 000101LL 上一个已知值 (Last Known Value) 通信故障。但是,最后一个已知值可用。该值的“新旧程度”可以从“应用程序”中的时间戳确定 (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)
6 000110LL 通信故障 (Comm Failure) 通信故障。且没有最后一个已知值可用 (Communications have failed. There is no last known value is available.)
7 000111LL 停止服务 (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.)
8-15 不使用 (N/A) 未被 OPC 使用 (Not used by OPC)
  1. 不支持"子状态"的 OPC 服务器,子状态位域应返回 0
    Servers which do not support Substatus should return 0.
  2. 如果将“质量”设置为 BAD (0),并将“子状态”设置为 5 (上一个已知值),则可能会返回“旧”值。这种情况是质量为 BAD 时客户端仍能使用返回数据值的唯一情况。
    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.

2. 不确定状态下的子状态 (QQ = 0b01)

十进制 二进制值 定义 描述
0 010000LL 未指定 (Non-specific) 该值不可用,但不知道具体原因 (The value is uncertain but no specific reason is known)
1 010001LL 上次可用值 (Last Usable Value) 已经停止更新此点的值。返回的值应被视为“过时”。请注意,这与子状态为 5(最后已知值)的 BAD 值不同。该状态与可检测到的通信错误或“提取”值的操作错误相关联。此错误与某些外部源无法在可接受的时间段内将某些内容“放入”值中有关。该值的“新旧”可以从“OPCITEMTIMESTAMP” 对象中的时间戳中确定。 (The value is uncertain but no specific reason is known)
2-3 不使用 (N/A) 未被 OPC 使用 (Not used by OPC)
4 010100LL 传感器不准确 (Sensor Not Accurate) 传感器的输出值”固定“为极限量程(此时”限制状态位域“应为 1 或 2),或传感器内部诊断出传感器未校准(此时”限制状态位域“应为 0) (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)
5 010101LL 超出工程单位 (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)
6 010110LL 亚健康 (Sub-Normal) 该值需要多个源才能生成,并且其良好源数少于所需的数量 (The value is derived from multiple sources and has less than the required number of Good sources.)
7-15 不使用 (N/A) 未被 OPC 使用 (Not used by OPC)
  1. 不支持"子状态"的 OPC 服务器,子状态位域应返回 0
    Servers which do not support Substatus should return 0.

2. 良好状态下的子状态 (QQ = 0b11)

十进制 二进制值 定义 描述
0 110000LL 未指定 (Non-specific) 值正常,且没有特殊状况 (The value is good. There are no special conditions)
1-5 不使用 (N/A) 未被 OPC 使用 (Not used by OPC)
6 110000LL 本地覆盖 (Local Override) 该值已被覆盖。通常,这意味着输入已断开连接,并且被手动输入的值强制覆盖 (The value has been Overridden. Typically this is means the input has been disconnected and a manually entered value has been ‘forced’)
7-15 不使用 (N/A) 未被 OPC 使用 (Not used by OPC)
  1. 不支持"子状态"的 OPC 服务器,子状态位域应返回 0
    Servers which do not support Substatus should return 0.

极限状态位域 (Limit status, LL, 低 2 位)

无论质量和子状态如何,“限制”字段都有效。在某些情况下,例如传感器故障时,它可以提供有用的额外诊断信息。

十进制 二进制值 定义 描述
0 QQSSSS00 不限 (Not Limited) 该值可自由变化 (The value is free to move up or down)
1 QQSSSS01 低限 (Low Limited) 该值已低于设定的下限 (The value is free to move up or downThe value has ‘pegged’ at some lower limit)
2 QQSSSS10 高限 (High Limited) 该值已高于设定的上限 (The value has ‘pegged’ at some high limit)
3 QQSSSS11 不断 (Constant) 该值是常量,不能变化 (The value is a constant and cannot move)
  1. 不支持“限值状态位域”的服务器,此位域应返回 0。
    Servers which do not support Limit should return 0.

OPC UA 质量代码 OPC quality codes 简介相关推荐

  1. 什么是opc ua通信?opc ua的介绍

    什么是opc ua通信?opc ua的介绍 一.OPC-UA通讯的产生 为了应对各生产基地的通讯机制不一样,需要一个标准化的通讯格式来统一各种设备平台的通讯.其中OPC标准的的OPC-UA网络协议就是 ...

  2. php访问opc ua,什么是OPC网关?OPC UA有什么特点

    OPC UA OPC统一架构(OPC Unified Architecture)是OPC基金会(OPC Foundation)创建的新技术,更加安全.可靠.中性(与供应商无关),为制造现场到生产计划或 ...

  3. [1] OPC UA基础知识简介

    OPC UA简介 OPC 什么是OPC? 为什么需要OPC? OPCUA简介 什么是OPC UA? OPC UA的优势: OPC UA规范标准 OPC UA基础 OPC UA 软件层 OPC UA 学 ...

  4. opc ua 用哪种语言编写_OPC UA是什么 OPC UA简介

    最近在电视上看到,消费电子取得了一些突破性的技术进步,这让我感到非常惊奇.例如,手机上配备了内置的Google应用,一款内置Google应用的惠普打印机则支持用户直接从互联网或无线设备上打印图像和文档 ...

  5. opcua客户端实现断线重连_虹科教您|实现OPC UA C/S快速部署及数据采集

    想获取更多IIOT干货 请点击蓝字,关注我们 虹科HMI解决方案 高性能 高防护 宽温 ★★★★★ 简介 边缘HMI需要实现的主要功能包括连接到该边缘HMI的边缘设备的数据采集,实现边缘计算.提供人机 ...

  6. OPC DA 与 OPC UA区别

    OPC首字母缩写词代表什么? 问一个OPC老手,他们或许会笑,因为他们知道有很多含义!在经典的且程序化的说法是:O LE for P rocess C ontrol(用于过程控制的OLE).OLE 或 ...

  7. 工业4.0技术路线图 - OPC UA

    工业4.0技术路线图 - OPC UA(上) 发布时间:2015-11-05 13:46     供稿单位: 中国工控网 转载地址http://video.gongkong.com/newsnet_d ...

  8. 合作式智能运输系统 车用通信系统应用层及应用数据交互标准 第二阶段_为什么一定要了解OPC UA TSN——未来的工业通信标准...

    ↑ 点击上方 "智能制造之家" 关注我们 写在面前 前面我们介绍了很多OPC UA的相关知识: OPC UA-面向未来的工业通讯规范 OPC UA服务器和客户端的安全机制你明白吗? ...

  9. 虹科教您|实现OPC UA C/S快速部署及数据采集

    简介 边缘HMI需要实现的主要功能包括连接到该边缘HMI的边缘设备的数据采集,实现边缘计算.提供人机接口.数据的本地存储与上传. 在工业4.0的进程中,越来越多的现场设备开始提供OPC UA支持功能, ...

最新文章

  1. 全球智能驾驶公司列表
  2. 练习:自己写一个容器ArrayList集合 一一数组综合练习2
  3. Invalid syntax for function signature in TLD
  4. logging总结 - log4j2使用流程[归档存储]
  5. Session丢失,都是CDN惹的祸
  6. 6 HBase java API访问HBase数据库
  7. pd.get_dummies()
  8. android程序启动动画,Android设置软件启动动画(以及初次安装的几张引导图)
  9. [html] 如何使用纯html制作一个进度条?
  10. Adobe Acrobat Pro DC二次激活失败的解决方案
  11. 自定义导航--wx.getMenuButtonBoundingClientRect() 万机兼容
  12. C# 如何检测UDP是否被占用_如何悄悄检测微信好友是否被删除?
  13. jeesit1.27(4)-数据权限控制
  14. PHPWAMP自定义添加PHP版本教程,支持无限添加PHP和Mysql版本
  15. 数字电路设计之RTL编码指导原则
  16. Linux debian安装DBeaver连接MySQL8、导入和导出数据库详细教程
  17. STM32F407ZG定时器
  18. js通用判断指定日期是周几,是否是周六、周日
  19. 张志华-统计机器学习-概率论导论
  20. Kermit使用(提权限)

热门文章

  1. 微信小程序源代码_HiApp聊天工具
  2. 1024福利 | 2019乌镇互联网大会大佬报告原文全集(李彦宏、陆奇、倪光南等)...
  3. python-删除列表中的重复值
  4. 育儿-《6-9岁孩子为何喜欢装大人》书中的精髓:6-9岁孩子心理特征、原因以及我们和孩子相处的方法。
  5. SD反转颜色 Invert
  6. VulnHub靶机-Jangow: 1.0.1
  7. 提高效率和质量——生产车间6S管理
  8. 物联网定位模块对智慧交通的意义
  9. 企业如何申请CCRC认证?CCRC认证证书查询官网是什么?
  10. java面试笔试题大汇总