Skip to content

当你通过 WritePoint(写点)或 Action(动作)下发 CROB 命令时,驱动要求:

  • data_type=UInt8
  • value 是一个 u8 控制码(DNP3 Group12Var1 ControlCode)

但是 并不是所有 0..=255 的 u8 都被网关接受:为避免歧义/误动作,网关仅支持一个明确的安全子集(见下文完整表格)。

1. 位域定义

驱动对 CROB ControlCode 的编码/解码遵循如下位域:

  • bits 7..6:Trip/Close Code(TCC)
    • 0b00 → Nul
    • 0b01 → Close
    • 0b10 → Trip
    • 0b11 → Reserved网关拒绝
  • bit 5clear
  • bit 4queue(标准中已 obsolete,但仍可表示;设备是否支持取决于 Outstation)
  • bits 3..0:OpType(操作类型)
    • 1 → PulseOn
    • 2 → PulseOff
    • 3 → LatchOn
    • 4 → LatchOff
    • 0/5..15(网关拒绝

2. 最常用的 4 个值

如果你不需要 Trip/Close、也不需要 queue/clear(现场最常见),则:

  • PulseOn1 (0x01)
  • PulseOff2 (0x02)
  • LatchOn3 (0x03)
  • LatchOff4 (0x04)

3. 网关允许的完整 ControlCode(u8) 列表

u8(dec)u8(hex)OpTypeTCCqueueclear
10x01PulseOnNulfalsefalse
20x02PulseOffNulfalsefalse
30x03LatchOnNulfalsefalse
40x04LatchOffNulfalsefalse
170x11PulseOnNultruefalse
180x12PulseOffNultruefalse
190x13LatchOnNultruefalse
200x14LatchOffNultruefalse
330x21PulseOnNulfalsetrue
340x22PulseOffNulfalsetrue
350x23LatchOnNulfalsetrue
360x24LatchOffNulfalsetrue
490x31PulseOnNultruetrue
500x32PulseOffNultruetrue
510x33LatchOnNultruetrue
520x34LatchOffNultruetrue
650x41PulseOnClosefalsefalse
660x42PulseOffClosefalsefalse
670x43LatchOnClosefalsefalse
680x44LatchOffClosefalsefalse
810x51PulseOnClosetruefalse
820x52PulseOffClosetruefalse
830x53LatchOnClosetruefalse
840x54LatchOffClosetruefalse
970x61PulseOnClosefalsetrue
980x62PulseOffClosefalsetrue
990x63LatchOnClosefalsetrue
1000x64LatchOffClosefalsetrue
1130x71PulseOnClosetruetrue
1140x72PulseOffClosetruetrue
1150x73LatchOnClosetruetrue
1160x74LatchOffClosetruetrue
1290x81PulseOnTripfalsefalse
1300x82PulseOffTripfalsefalse
1310x83LatchOnTripfalsefalse
1320x84LatchOffTripfalsefalse
1450x91PulseOnTriptruefalse
1460x92PulseOffTriptruefalse
1470x93LatchOnTriptruefalse
1480x94LatchOffTriptruefalse
1610xA1PulseOnTripfalsetrue
1620xA2PulseOffTripfalsetrue
1630xA3LatchOnTripfalsetrue
1640xA4LatchOffTripfalsetrue
1770xB1PulseOnTriptruetrue
1780xB2PulseOffTriptruetrue
1790xB3LatchOnTriptruetrue
1800xB4LatchOffTriptruetrue

4. WritePoint / Action 应该怎么用?

4.1 WritePoint(BinaryOutput 写点)

  • point.group=BinaryOutput
  • point.data_type=UInt8
  • value:填写本页表格中的 u8(dec)

注意

WritePoint 路径 无法 控制 crobCount/crobOnTimeMs/crobOffTimeMs(驱动刻意不暴露这些协议级字段)。如果你需要配置次数/脉冲时序,请使用 Action 路径。

4.2 Action(CROB 批量控制)

  • Action.inputs[].driver_config.group=CROB
  • Action.inputs[].driver_config.index=<目标索引>
  • Action.inputs[].data_type=UInt8
  • Action.inputs[].value:填写本页表格中的 u8(dec)
  • crobCount/crobOnTimeMs/crobOffTimeMs:通过 Parameter 级建模字段配置

注意

如果你传入的 value 不在上表 48 个值里(比如 op_type=0 或 tcc=Reserved),驱动会直接拒绝并返回错误。

基于 MIT 许可发布.