资讯详情

DLMS/COSEM 蓝皮书解读(五十二):Sensor manager(class_id = 67)—— 15 个属性塞进一个对象

📅 2026/10/30 4:48:49 | 华诺云谱 👁 阅读
DLMS/COSEM 蓝皮书解读(五十二):Sensor manager(class_id = 67)—— 15 个属性塞进一个对象
DLMS/COSEM 蓝皮书解读五十二Sensor managerclass_id 67—— 15 个属性塞进一个对象传感器铭牌、原始值、处理后值、阈值与动作系列说明本系列基于 DLMS UA《Blue Book蓝皮书第 16 版 · 第 2 部分》一个接口类一篇。第 51 篇的Measurement data monitoring(66) 讲的是电测量里的波形捕获。本篇的Sensor managerclass_id 67把视线转向非电计量——热表、水表、气表这类靠传感器变送器/转换器取数的仪表。它把传感器的铭牌信息、原始值、处理后值、两组阈值与动作全塞进一个对象。上篇回顾Measurement data monitoring(66) 的对象只管抓波形不管这个物理量是怎么来的、传感器状态好不好。在非电计量里恰恰传感器的可追溯性是计量合规的核心——传感器型号、序列号、校准日期、封印方式、输出类型缺一不可。Sensor manager就是把这些计量法治要求模型化的类。0. 为什么需要这个类 —— MID 计量器具的传感器合规要求蓝皮书原文Sensor manager, General“NOTE This interface class is used mainly in metering energy types other than electricity. Most measuring instruments under the scope of the MID operate with dedicated sensors (transducers and transmitters) connected to the processing unit. These sensors have to be permanently supervised concerning their functioning and limits to fulfil the metrological requirements for subsequent calculation of monetary values.”MID Measuring Instruments Directive欧盟计量器具指令。核心要求传感器必须被持续监视包括它的功能状态和量程因为后续算钱的依据就来自它。需要监视的内容原文列出类别内容传感器识别identification of the sensor device连接与封印状态the connection and the sealing status of the sensor配置the configuration of the sensors运行监视the monitoring of the operation of the sensors处理结果监视the monitoring of the result of the processing“The ‘Sensor manager’ interface class allows managing detailed information related to a sensor by a single object.”——一个传感器一个对象全包。原文也给了降级方案“For simpler sensors / devices, already existing COSEM objects – identifying the sensors, holding measurement values and monitoring those measurement values – can be used.”简单传感器用现成的Data(1) /Register(3) /Register monitor(21) 组合就够了Sensor manager是为复杂传感器准备的。为什么 raw data 也要进来原文 NOTE 1“Not every raw data (e.g. the voltage output of a pressure sensor) has its own OBIS code / object. This is the reason to include raw data in the Sensor manager class.”这是一个很实在的理由压力传感器输出 1–5 V 这个原始电压在 OBIS 体系里根本没有对应的码。与其为它发明一个 OBIS不如把它作为Sensor manager的一个 attributeraw_value带进来。1. 类蓝图Sensor manager 0…n class_id 67, version 0属性静态/动态数据类型MinMaxDefShort namelogical_namestaticoctet-string———xserial_numberdyn.octet-string———x 0x08metrological_identificationdyn.octet-string———x 0x10output_typedyn.enum———x 0x18adjustment_methoddyn.octet-string———x 0x20sealing_methoddyn.enum———x 0x28raw_valuedyn.CHOICE———x 0x30scaler_unitdyn.structure———x 0x38statusdyn.CHOICE———x 0x40capture_timedyn.date-time———x 0x48raw_value_thresholdsdyn.array———x 0x50raw_value_actionsdyn.array———x 0x58processed_valuedyn.processed_value_definition———x 0x60processed_value_thresholdsdyn.array———x 0x68processed_value_actionsdyn.array———x 0x70方法必选/可选(m/o)Short namereset (data)ox 0x80说明原文属性表中serial_number一行写作(dyn,)逗号而非句点此处照录。Min/Max/Def 列原文未给出。15 个属性其实是 4 个功能模块蓝皮书原文Sensor manager, Overview“This IC includes a number of functions:”“nameplate data of the sensor and site information (attributes 2 to 6);”“an ‘Extended register’ function for the raw-value (attributes 7 to 10);”“a ‘Register monitor’ function for the raw-value (attributes 11-12);”“a ‘Register monitor’ function for the processed_value (attributes 13 to 15).”模块属性号对应已有 IC 的功能铭牌 / 站点信息2–6Data(1) 类信息raw-value 的扩展寄存器功能7–10Extended register(4)raw-value 的寄存器监视功能11–12Register monitor(21)processed_value 的寄存器监视功能13–15Register monitor(21)这个模块复用视角非常重要Sensor manager不是凭空设计的它是把Extended register和Register monitor的能力内嵌进来了省得为每个传感器建一堆对象。原文 NOTE 2“Not all ‘modules’ are necessarily present. The attributes not used are possibly not implemented or not accessible.”——用不上的模块可以不实现/不可访问。2. 属性逐条解读2.1 logical_name“Identifies the ‘Sensor manager’ object instance.”NOTE“Sensor manager objects are used in relation to non-electricity metering. Therefore no OBIS codes are defined in this document.”关键本文档Part 2没有给Sensor manager定义 OBIS 码——因为它面向非电计量OBIS 码要由项目配套规范或 Part 1 的相关部分定义。2.2 serial_number模块一铭牌“Identifies the sensor (-site information).”NOTE“For simple sensors, the serial number may be held by ‘Data’ objects with appropriate OBIS codes if this is the only information required.”2.3 metrological_identification“Describes metrologically relevant information of the sensor, e.g. metrological identifier, calibration date.”计量相关信息如计量标识号、校准日期——这是合规审计要看的字段。2.4 output_typeenumenum: (0) not specified, (1) 4–20 mA, (2) 0–20 mA (3) 0–5 V, (4) 0–10 V, (5) Pt100, (6) Pt500, (7) Pt1000, (8) HART (128) manufacturer specific“All other values are reserved.”覆盖工业传感器最常见的输出形式电流环4–20 mA / 0–20 mA、电压0–5 V / 0–10 V、铂电阻Pt100/500/1000、HART 协议。128及以上留给厂家。2.5 adjustment_method“Describes the sensor adjustment method, e.g. by 3-Measuring-point-equation.”原文举的例子是三点测量方程——这是传感器标定的常见方法。2.6 sealing_methodenumenum: (0) none, (1) mechanical (e.g. wire or protective sticker); (2) electronic (e.g. contact); (3) software (e.g. password protection)封印方式——计量器具防作弊的核心信息。三种机械铅封线/防护贴、电子触点、软件密码保护。2.7 raw_value模块二Extended register 功能“Physical value from the sensor (e.g. voltage from a pressure to voltage converter). For the possible data type choices, see the ‘Register’ IC in .”传感器出来的物理量原始值例如压力→电压转换器输出的电压。数据类型 CHOICE 见Register(3)。2.8 scaler_unit“The scaler and the unit of the raw_value. For the definition of scaler_unit, see the ‘Register’ IC in .”2.9 statusCHOICE“Status of last raw_value captured (for the definition of status, see the ‘Extended register’ IC, ). The status keeps information such as: sensor failure, sensor activated / inactivated. The meaning of the elements of the status shall be provided for each ‘Sensor manager’ object instance.”状态定义沿用Extended register(4)至少承载两类信息sensor failure传感器故障、sensor activated / inactivated启用/停用。注意最后一句“The meaning of the elements of the status shall be provided for each ‘Sensor manager’ object instance”——每个实例都必须说明 status 各元素的含义。主站不能假定 status 位的通用含义。2.10 capture_time“Provides a ‘Sensor manager’ object specific date and time information showing when the value of the attribute raw_value has been captured. date_time is formatted as specified in . For the possible data type choices, see the ‘Extended register’ interface class in .”2.11 raw_value_thresholds模块三raw-value 的 Register monitor“Provides the threshold values to which the raw_value attribute is compared. array threshold. threshold: The threshold is of the same type as the raw-value”阈值的类型必须与raw_value相同——raw_value 是long-unsigned阈值也是long-unsigned。2.12 raw_value_actions“Defines the scripts to be executed when the raw_value crosses the corresponding threshold. The attribute raw_value_actions has exactly the same number of elements as the attribute raw_value_thresholds. The ordering of the action_items corresponds to the ordering of the thresholds. For the specification of actions, see the Register monitor IC in .”硬约束raw_value_actions的元素个数必须与raw_value_thresholds完全相同且顺序一一对应。2.13 processed_value模块四processed_value 的 Register monitorprocessed_value_definition :: structure { class_id: long-unsigned, logical_name: octet-string, attribute_index: integer }“References the attribute holding the processed value of the raw data provided by the sensor.”“Note that more than one ‘Sensor manager’ objects and processed value objects may belong to the same sensor.”注意它不是一个值而是一个引用——指向某个对象的某个 attribute那个 attribute 才是处理后值。而且同一个传感器可以有多个Sensor manager对象和多个 processed value 对象。2.14 processed_value_thresholds“Provides the threshold values to which the processed value is compared. array threshold. threshold: The threshold is of the same type as the value processed. (referenced by the processed-value attribute )”2.15 processed_value_actions“Defines the scripts to be executed when the processed value crosses the corresponding threshold. The attribute processed_value_actions has exactly the same number of elements as the attribute processed_value_thresholds. The ordering of the action_items corresponds to the ordering of the thresholds. For the specification of actions, see the Register monitor IC in .”同样的数量相同、顺序对应约束。3. 方法reset (data)蓝皮书原文Sensor manager, reset“This method resets the raw_value to the default value. The default value is an instance specific constant. The attribute capture_time is set to the time of the reset execution.”data :: integer (0)三点把raw_value重置为默认值默认值是实例特定的常量不是 0也不是类型默认——每实例自己定同时把capture_time设为reset 执行的时刻。4. 【实战举例】示例 1绝对压力传感器原文示例原文给出的阈值定义照录注意原文用欧洲小数写法1,0 1.0ThresholdPhysical lowerPhysical upperAlarm lowerAlarm upperWarning lowerWarning upperValue1,05,51,25,01,44,8scaler_unit1, Volt1, Volt1, bar1, bar1, bar1, bar读法Physical lower / upper1.0 / 5.5 Volt→ 这是raw_value_thresholds传感器输出电压的物理极限。超出说明传感器本身坏了或线路断了。Alarm lower / upper1.2 / 5.0 bar→ 这是processed_value_thresholds压力值越限告警。Warning lower / upper1.4 / 4.8 bar→ 也是processed_value_thresholds预警区间比 Alarm 更窄。说明原文表格中scaler_unit一列写作 “1, Volt” / “1, bar”本文照录实际 scaler 取值以项目配套规范为准。对应的动作集原文照录action_setPhysical lowerPhysical upperAlarm lowerAlarm upperWarning lowerWarning upperaction_upclr_phy_alarm_bitset_phy_alarm_bitclear_alarm_bitset_alarm_bitclear_warn_bitset_warn_bitaction_downset_phy_alarm_bitclr_phy_alarm_bitset_alarm_bitclear_alarm_bitset_warn_bitclear_warn_bitaction_up/action_down的语义与Register monitor(21) 一致action_up值向上越过阈值时执行的脚本action_down值向下回落越过阈值时执行的脚本。以 “Physical lower 1.0 V” 为例电压跌破1.0 V向下越过→action_downset_phy_alarm_bit置物理告警位电压回到1.0 V 以上向上越过→action_upclr_phy_alarm_bit清物理告警位。提示action_up对 lower 阈值是恢复、对 upper 阈值是越限——别按字面把 up 理解成变严重。示例 2对象的完整配置构造示例非原文Sensor manager 对象 serial_number PT-2024-00817 metrological_identification MID-DE-23-MI004-PS001; cal. 2024-03-15 output_type 1 -- 4–20 mA adjustment_method 3-point equation sealing_method 1 -- mechanical raw_value long-unsigned 值scaler_unit { -3, mA } status 按 Extended register 定义 capture_time 2024-05-11 14:23:45 raw_value_thresholds [ 4000, 20000 ] -- 4.000 mA / 20.000 mA raw_value_actions [ {script: ..., selector: 1}, {script: ..., selector: 2} ] processed_value { class_id 3, logical_name ..., attribute_index 2 } -- 引用某 Register 的 value processed_value_thresholds [ 12000, 50000, 14000, 48000 ] -- 1.2/5.0/1.4/4.8 barscaler -4 processed_value_actions [ ...4 个 action_item... ]校验点raw_value_actions2 个元素 ↔raw_value_thresholds2 个processed_value_actions4 个 ↔processed_value_thresholds4 个。示例 3为什么 raw_value 要单独监视假设一个压力传感器4 mA 对应 0 bar、20 mA 对应 6 bar现象raw_valueprocessed_value判断正常12 mA3.0 bar正常线路断线0 mA0 bar看 raw_value 才知道是断线不是真的 0 bar传感器饱和22 mA6.6 barraw_value 越界 → 该值不可信正常低压4.5 mA0.375 bar两者都正常只监视 processed_value 会把断线误判成压力为零——这正是Sensor manager坚持把raw_value也纳入监视的原因呼应原文 NOTE 1。示例 4output_type 决定阈值怎么配output_typeraw_value 单位raw_value_thresholds 该怎么配(1) 4–20 mAmA下限略低于 4 mA、上限略高于 20 mA如 3.5 / 21 mA(3) 0–5 VV0 / 5.5 V(5) Pt100Ω 或温度按电阻/温度量程(0) not specified未知必须先从别处获知输出类型否则阈值无从配置output_type 0not specified时主站不能盲目套用任何默认量程——这正是该 enum 存在的原因。示例 5sealing_method 与合规审计审计系统关心这块表的传感器有没有被动过手脚sealing_method审计含义(0) none无封印——需要额外的管理措施(1) mechanical铅封/防护贴——现场肉眼可查(2) electronic电子触点——开盖会被记录为事件(3) software密码保护——依赖访问权限管理配合status里的 “sensor activated / inactivated”可以追踪传感器是否被停用过。示例 6processed_value 是引用而非值processed_value { class_id 3, logical_name 6-0:132.7.0.255, attribute_index 2 }指向某个Register(3) 的value。这意味着Sensor manager不存处理后值只存去哪儿读同一个传感器可以有多个Sensor manager对象和多个 processed value 对象原文“more than one ‘Sensor manager’ objects and processed value objects may belong to the same sensor”主站要拿处理后值得二次跳转先读processed_value拿到引用再去读那个对象。示例 7reset 的默认值是实例特定常量ACTION reset (data integer 0)结果raw_value该实例自己的默认常量不是 0也不是通用默认capture_timereset 执行的时刻。原文“The default value is an instance specific constant.”主站不能假设reset 后 raw_value 变成 0——要读出来看。示例 8status 的含义必须逐实例提供“The meaning of the elements of the status shall be provided for each ‘Sensor manager’ object instance.”两个不同厂家的Sensor managerstatus的第 0 位可能一个是传感器故障、另一个是传感器已激活。主站必须按实例或按厂家 型号来解释status不能写死通用解析。这正是第 48 篇Status mapping(63) 想解决的位含义各家不同问题在非电计量领域的翻版——只不过这里原文把责任交给了每个实例自行说明。5. 工程上容易踩的坑在本文档里找Sensor manager的 OBIS 码原文 NOTE 明确“no OBIS codes are defined in this document”。假设所有 15 个 attribute 都实现原文 NOTE 2 说用不上的模块可能未实现或不可访问。假设status的位含义通用“shall be provided for each ‘Sensor manager’ object instance”必须逐实例确认。只监视 processed_value 不监视 raw_value传感器断线会被误判成测量值为零原文 NOTE 1 的反面教训。actions 与 thresholds 数量/顺序不对应原文两处都用“exactly the same number of elements”和“ordering … corresponds to”约束。阈值类型不匹配“The threshold is of the same type as the raw-value”/“of the same type as the value processed”。把action_up一律理解成越限对 lower 阈值up 是恢复对 upper 阈值up 才是越限。以为reset()会把 raw_value 清成 0默认值是实例特定常量且capture_time会被设为 reset 时刻。把processed_value当成值它是一个{class_id, logical_name, attribute_index}的引用要二次跳转读取。output_type 0not specified时套默认量程不知道输出类型就无法正确配阈值。把它用在电表上原文 NOTE 说“used mainly in metering energy types other than electricity”电表场景通常不需要。6. 小结 下期预告本篇要点Sensor manager(67) 面向非电计量热/水/气表一个传感器一个对象15 个 attribute 覆盖铭牌、原始值、处理后值、两组阈值与动作15 个属性其实是四个功能模块铭牌(2–6)、Extended register式 raw-value(7–10)、Register monitor式 raw-value 监视(11–12)、Register monitor式 processed_value 监视(13–15)用不上的模块可不实现raw_value之所以被纳入是因为很多原始量如压力传感器的电压输出根本没有自己的 OBIS 码output_type覆盖 4–20 mA / 0–20 mA / 0–5 V / 0–10 V / Pt100 / Pt500 / Pt1000 / HART128起为厂家自定义sealing_method分机械/电子/软件actions 与 thresholds 必须数量相同、顺序对应action_up对 lower 阈值表示恢复processed_value是引用{class_id, logical_name, attribute_index}而非值需二次跳转reset把 raw_value 置为实例特定常量并更新capture_time本文档未给本类定义 OBIS 码status各元素含义必须逐实例提供。下一篇第 53 篇Arbitratorclass_id 68—— 当多个角色都想控制同一个资源比如供电开关时用权限位图 权重表算出到底执行哪个动作。参考资料DLMS UA《Blue Book Ed.16 Part 2 – COSEM interface classes》Sensor manager(class_id 67, version 0) 章节含 “Example for absolute pressure sensor”文中属性名与顺序、数据类型、(dyn,)标注、Short name 偏移、方法 m/o、enum 取值与引文均与原文一致原文的绝对压力传感器示例已照录含欧洲小数写法与1, Volt/1, bar表述示例 2–8 为帮助理解而构造非蓝皮书原文实际以设备对象列表及项目配套规范为准。
📝

华诺云谱内容团队

资深建站顾问 · 行业研究员

10年+企业数字化服务经验,专注智能建站、SEO优化与品牌营销,持续输出建站技巧、行业洞察与营销干货,已帮助5000+企业实现数字化增长。

你可能需要的服务

订阅华诺云谱资讯周报

每周一封,精选建站技巧、SEO与营销干货,直达邮箱。已有 8,000+ 企业主订阅,助你少走弯路。

↑