Skip to content

1. Sensor Overview

Model catalog

Search for these models in ThinkLink by name or ID.

Model typeNameid_namePlatform model ID
RPC[ZW SZWB1] switchszwb1_22103_switch95906553915248645
RPC[SZWB1 GET] paraszwb1_get_2210395843156968345605
RPC[SZWB1 SET] paraszwb1_set_para_2210395842872615505925
TemplateZW-SZWB195843645487321093
Thing ModelZW-SZWB1szwb1_2210395840195655503877
Thing Model[ZW-22103-SZWB1L资产] 区域聚合szwb1_asset_22103119677174411063315
Parameter Thing Model[SZWB1-PARA]szwb1_para_2210395842342686167045

SZWB1L is a micro circuit breaker device from ZhuoWen Technology. It can be connected to the KC11 collector through the RS-485 interface, then converted by EdgeBus and reported to the ThinkLink platform through LoRaWAN.

This solution supports periodic reporting of measurement data, and also supports triggered reporting of alarm information and switch status.

2. Product Features

  • Supports acquisition of multiple types of data, including micro circuit breaker operating status, electrical parameters, temperature, and energy.
  • Supports acquisition of alarm and warning states, including undervoltage, overvoltage, overcurrent, overtemperature, leakage current, short circuit, load imbalance, and more.
  • Supports switch status acquisition and remote open/close control.
  • Upload period and acquisition period are configured separately, using APP parameter addresses 70 and 74 respectively.
  • The uplink payload is relatively long. In actual projects, measurement points can be trimmed according to business needs.

3. Application Senario

Suitable for smart power distribution, distribution box monitoring, electrical safety management, building power distribution monitoring, campus power distribution monitoring, industrial power consumption monitoring, and similar scenarios.

4. Collector Information

4.1 Hardware Information

  • Collector model: KC11
  • Communication interface: RS-485
  • Power supply: 220V / 12V

4.2 Wiring Information

Power and Communication Interface

  • KC11 is connected to SZWB1L through RS-485.
  • KC11 can be powered by 220V or 12V.
  • SZWB1L is connected as a Modbus slave, with the default address set to 0x01 in the EB configuration of this document. In actual deployment, the address can be modified through parameters.

Sensor Interface

  • RS-485 A/B communication lines.
  • If remote control and status acquisition are required on site, the circuit breaker itself must support the corresponding functions and be correctly wired.

5. Data Acquisition

In this solution, the following Modbus registers are read:

  • 0x04: Read measurement data (full reporting)
  • 0x02: Read discrete input status (alarm/warning change reporting)
  • 0x01: Read / cooperate with coil status (switch-related status)

Among them:

  • Measurement data is recommended to be acquired and reported at a relatively long interval.
  • Alarm information and switch status are recommended to use a shorter interval or triggered reporting.
  • The acquisition period must be shorter than the upload period.

5.1 Register Definitions

5.1.1 0x04 Read-Only Registers (Input Registers)

NameAddress (Decimal)Address (Hex)Register CountUnitField NameDescription
Panel DIP switch30000BB81-DIP0 = Open/Locked, remote control invalid, leakage protection enabled; 1 = Closed/Unlocked, remote control valid, leakage protection disabled
Single-phase two-wire current30030BBB20.001AI32-bit, high word first
Single-phase voltage30050BBD10.01VU
Single-phase two-wire active power / total three-phase active power30060BBE20.001mW / 0.001WP32-bit, high word first
Single-phase two-wire reactive power / total three-phase reactive power30080BC020.001mVar / 0.001VarQ
Single-phase two-wire apparent power / total three-phase apparent power30100BC220.001mVA / 0.001VAS
Single-phase active energy / total three-phase apparent energy30120BC44WhE64-bit, high word first
Single-phase L-line temperature30160BC810.1℃Ts
Residual current30170BC91mAIresUnsigned
Phase A current30190BCB20.001mAIa32-bit, high word first
Phase B current30210BCD20.001mAIb
Phase C current30230BCF20.001mAIc
Neutral current30250BD120.001mAIn
Rated current30270BD31AIr
Phase A voltage30290BD510.01VUa
Phase B voltage30300BD610.01VUb
Phase C voltage30310BD710.01VUc
Active power A30330BD920.001mW / 0.001WPa32-bit
Active power B30350BDB20.001mW / 0.001WPb
Active power C30370BDD20.001mW / 0.001WPc
Reactive power A30390BDF20.001mVar / 0.001VarQa
Reactive power B30410BE120.001mVar / 0.001VarQb
Reactive power C30430BE320.001mVar / 0.001VarQc
Apparent power A30450BE520.001mVA / 0.001VASa
Apparent power B30470BE720.001mVA / 0.001VASb
Apparent power C30490BE920.001mVA / 0.001VASc
Apparent energy A30510BEB4mVAhEsa64-bit
Apparent energy B30550BEF4mVAhEsb
Apparent energy C30590BF34mVAhEsc
Total three-phase apparent energy30630BF74mVAhEs
Phase A line temperature30670BFB10.1℃Ta
Phase B line temperature30680BFC10.1℃Tb
Phase C line temperature30690BFD10.1℃Tc
Neutral line temperature30700BFE10.1℃Tn
Single-phase apparent energy / total three-phase active energy30750C034mWhEp64-bit
Phase A active energy30790C074mWhEpa
Phase B active energy30830C0B4mWhEpb
Phase C active energy30870C0F4mWhEpc
Single-phase reactive energy / total three-phase reactive energy30910C134mVarhEq
Phase A reactive energy30950C174mVarhEqa
Phase B reactive energy30990C1B4mVarhEqb
Phase C reactive energy31030C1F4mVarhEqc
Grid frequency31070C2310.1HzFreq

5.1.2 0x02 Status Bits (Discrete Inputs)

Read range: 2000 ~ 2054

In EB, this range is read as a whole segment and converted into an alarm bitmap.

5.1.3 0x01 / 0x05 Control Coils

NameAddressField NameDescription
Open/Close0switchWrite 1 to trigger one close action; write 0 to trigger one open action
Leakage test1testWrite 1 to trigger one test action
Energy clear2clearWrite 1 to trigger one reset action

5.1.4 0x03 / 0x06 Setting Registers (Holding Registers)

NameAddressField NameDescription
MODBUS address4053addressFactory default is 1
Baud rate4054baud0 = 9600, 1 = 19200, 2 = 38400; recommended to use 0
Parity4055parity0 = NONE, 1 = ODD, 2 = EVEN
Stop bits4056stop0 = 1, 1 = 1.2, 2 = 2

5.2 Status Bit Definitions

AddressNameField Name
2000Single-phase undervoltage (alarm)UV_S_ALM
2001Single-phase undervoltage (warning)UV_S_WRN
2002Single-phase overvoltage (alarm)OV_S_ALM
2003Single-phase overvoltage (warning)OV_S_WRN
2004Single-phase overcurrent (alarm)OC_S_ALM
2005Single-phase overcurrent (warning)OC_S_WRN
2006Single-phase line temperature (alarm)OT_S_ALM
2007Single-phase line temperature (warning)OT_S_WRN
2008Leakage current (alarm)RCD_ALM
2009Leakage current (warning)RCD_WRN
2012Overpower alarm (alarm)OP_ALM
2013Overpower alarm (warning)OP_WRN
2014Short circuit alarm (alarm)SC_ALM
2015Short circuit alarm (warning)SC_WRN
2016Ground fault alarmGND_ALM
2020Phase sequence error alarmPH_SEQ_ERR
2021Undervoltage (alarm) AUV_A_ALM
2022Undervoltage (warning) AUV_A_WRN
2023Undervoltage (alarm) BUV_B_ALM
2024Undervoltage (warning) BUV_B_WRN
2025Undervoltage (alarm) CUV_C_ALM
2026Undervoltage (warning) CUV_C_WRN
2027Overvoltage (alarm) AOV_A_ALM
2028Overvoltage (warning) AOV_A_WRN
2029Overvoltage (alarm) BOV_B_ALM
2030Overvoltage (warning) BOV_B_WRN
2031Overvoltage (alarm) COV_C_ALM
2032Overvoltage (warning) COV_C_WRN
2033Overcurrent (alarm) AOC_A_ALM
2034Overcurrent (warning) AOC_A_WRN
2035Overcurrent (alarm) BOC_B_ALM
2036Overcurrent (warning) BOC_B_WRN
2037Overcurrent (alarm) COC_C_ALM
2038Overcurrent (warning) COC_C_WRN
2039Temperature (alarm) AOT_A_ALM
2040Temperature (warning) AOT_A_WRN
2041Temperature (alarm) BOT_B_ALM
2042Temperature (warning) BOT_B_WRN
2043Temperature (alarm) COT_C_ALM
2044Temperature (warning) COT_C_WRN
2045Temperature (alarm) NOT_N_ALM
2046Temperature (warning) NOT_N_WRN
2047Phase loss (alarm) APH_LOSS_A
2048Phase A leakage identificationRCD_A_FLG
2049Phase loss (alarm) BPH_LOSS_B
2050Phase B leakage identificationRCD_B_FLG
2051Phase loss (alarm) CPH_LOSS_C
2052Phase C leakage identificationRCD_C_FLG
2053Load imbalance (alarm)UNB_ALM
2054Load imbalance (warning)UNB_WRN
2064Maintenance modeMAINT_MODE
2073Harmonic alarmHARM_ALM
2074Special harmonic alarmSP_HARM_ALM
2075Neutral current warningIN_N_WRN
2076Neutral current alarmIN_N_ALM
2077Neutral voltageUN

6. EdgeBus Model

6.1 EB Configuration Parameters

  • Collector: KC21
  • Serial parameters: 9600 / 8N1 / no parity
  • Battery: false
  • ConfirmDuty: 60
  • BzType: 22103
  • BzVersion: 13
  • LoRaWAN uplink port: 22
  • Data type: 0x86
  • Version: 0x03
  • Upload period parameter address: 70
  • Acquisition period parameter address: 74
  • Modbus address parameter mapping: 150

6.2 EB Code

typescript
import { Buffer } from "buffer";
import { buildOtaFile } from "@EBSDK/run";
import {
    ActionAfertExpr, CalcData,
    CrcMode,
    CvtRule,
    EBBuffer,
    EBModel,
    ExprCondition,
    LoraUpEvent,
    QueryEvent, SetUpCovDataType,QuItemBase,
    UserConfUPItem, EventInfoItem, QuItemModBus, UserConfQueryItem, EventConfig, Utils
} from "@EBSDK/EBCompiler/all_variable";
import { CheckbitEnum, getOtaConfig, HwTypeEnum, UpgrdTypeEnum } from "@EBSDK/otaConfig";
////////////////////////////////////////////////////////////////////////////////////////
//ZHUOWEN mcb SZWB1L
const eventInfo:UserConfUPItem[]=[
   {
        name:"mcb",dataType:"0x86", port:22, version:"0x03",upPeriodIndex:70,//upPeriod:"300s",
        quInfo:[
            {
            protocol:"modbus",addr:"0x01",code:"0x04", periodIndex:70,//period:"300s",
                 indexAPP:150, indexCMD:0, copySize:1,isLast:false,
            listVal:[
                { start: "3000", end: "3000"},
                { start: "3003", end: "3017"},
                { start: "3019", end: "3027"},
                { start: "3029", end: "3031"},
                { start: "3033", end: "3070"},
                { start: "3075", end: "3107"},
            ]
            },
            {
                protocol:"modbus", code:"0x02",periodIndex:74, //period:"30s",
                indexAPP:150, indexCMD:0, copySize:1,isLast:false,
                listVal:[
                    { start: "0x07D0", end: "0x0806",covType:"HEX"}
                ]
            },
            {
                protocol:"modbus", code:"0x01",periodIndex:74, //period:"30s",
                indexAPP:150, indexCMD:0, copySize:1,isLast:false,
                listVal:[
                    { start: "0", end: "0",covType:"HEX"}
                ]
            }
        ]
    }
]
let otaConfig = getOtaConfig({
    SwVersion:31,
    BaudRate: 9600,
    StopBits: 1,
    DataBits: 8,
    Checkbit: CheckbitEnum.NONE,
    Battery: false,
    ConfirmDuty: 60,
    BzType: 22103,
    BzVersion: 13
})
const MODBUS_TT = (ebModel: EBModel) => {
    for (let i=0; i<eventInfo.length; i++){
            let event=new EventInfoItem(eventInfo[i]);
            event.upEventSetup()
            event.eventInstall()
    }
    return JSON.stringify(ebModel, null, 2)
}
buildOtaFile(import.meta.url, otaConfig, MODBUS_TT)

6.3 Notes

Current EB logic:

  • Use 0x04 to read full measurement data as the main uplink content.
  • Use 0x02 to read alarm/warning status bits as the trigger basis for change reporting.
  • Use 0x01 to read switch status.
  • Upload period and acquisition period are separated: 70 is used for upload period, 74 is used for acquisition period.
  • indexAPP:150 corresponds to Modbus address parameter mapping, making it convenient to modify the slave address through parameters.
  • Since SZWB1L has many measurement points, the full uplink payload is long. In projects, it is recommended to trim points based on application scenarios to avoid wasting airtime resources.
  • Alarm information is eventually encoded into warnCode, and then further parsed into readable warning text in the Thing Model script.
  • Transparent transmission port 51 is used together with remote switch control result feedback, converting transparent data into switch status.

7. Thing Model

7.1 Basic Thing Model Information

Data Thing Model

  • Name: [ZW-SZWB1]
  • id Name: zw_szwb1_22103
  • Uplink port: 22
  • Tags: 0x86 0x03

Parameter Thing Model

  • Name: [SZWB1-PARA]
  • id Name: szwb1_para_22103
  • port: 22
  • dataLen: -1
  • rssi: true
  • battery: true
  • tagList:
    • index: 0, tag: 0x86
    • index: 1, tag: 0x03

Main fields include:

  • DIP
  • I / U / P / Q / S / E
  • Ts / Ires
  • Ia / Ib / Ic / In / Ir
  • Ua / Ub / Uc
  • Pa / Pb / Pc
  • Qa / Qb / Qc
  • Sa / Sb / Sc
  • Esa / Esb / Esc / Es
  • Ta / Tb / Tc / Tn
  • Ep / Epa / Epb / Epc
  • Eq / Eqa / Eqb / Eqc
  • Freq
  • warnCode
  • switch
  • Derived field: warning

7.3 Thing Model Script

javascript
let frameInfo={
        port:22, dataLen:-1,rssi:true,battery:true,
        tagList:[{   index:0, tag:0x86}, {   index:1, tag:0x03}]
    }
    const ALARM_MAP = {
        // 单相告警
        2000: "单相欠压(报警)",
        2001: "单相欠压(预警)",
        2002: "单相过压(报警)",
        2003: "单相过压(预警)",
        2004: "单相过流(报警)",
        2005: "单相过流(预警)",
        2006: "单相线温(报警)",
        2007: "单相线温(预警)",
        2008: "漏电(报警)",
        2009: "漏电(预警)",

        // 功率和短路告警
        2012: "过功率报警(报警)",
        2013: "过功率报警(预警)",
        2014: "短路报警(报警)",
        2015: "短路报警(预警)",
        2016: "接地报警",

        // 相序和分相告警
        2020: "相序错误报警",
        2021: "欠压(报警)A",
        2022: "欠压(预警)A",
        2023: "欠压(报警)B",
        2024: "欠压(预警)B",
        2025: "欠压(报警)C",
        2026: "欠压(预警)C",
        2027: "过压(报警)A",
        2028: "过压(预警)A",
        2029: "过压(报警)B",
        2030: "过压(预警)B",
        2031: "过压(报警)C",
        2032: "过压(预警)C",
        2033: "过流(报警)A",
        2034: "过流(预警)A",
        2035: "过流(报警)B",
        2036: "过流(预警)B",
        2037: "过流(报警)C",
        2038: "过流(预警)C",
        2039: "温度(报警)A",
        2040: "温度(预警)A",
        2041: "温度(报警)B",
        2042: "温度(预警)B",
        2043: "温度(报警)C",
        2044: "温度(预警)C",
        2045: "温度(报警)N",
        2046: "温度(预警)N",
        2047: "缺相(报警)A",
        2048: "A相漏电识别",
        2049: "缺相(报警)B",
        2050: "B相漏电识别",
        2051: "缺相(报警)C",
        2052: "C相漏电识别",
        2053: "负载不均衡(报警)",
        2054: "负载不均衡(预警)"
    };
    let appInfo = [
        { name: "面板拨码开关", field_name: "DIP", unit: "", index: 6, type: "uint8", coefficient: 1, options: {0: "断开/锁定, 远控无效, 漏保有效", 1: "闭合/解锁, 远控有效, 漏保无效"} },
        { name: "单相两线电流", field_name: "I", unit: "A", index: 8, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "单相电压", field_name: "U", unit: "V", index: 12, type: "int16be", coefficient: 0.01, decimal: 2 },
        { name: "单相两线有功功率/三相合有功功率", field_name: "P", unit: "W", index: 14, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "单相两线无功功率/三相合无功功率", field_name: "Q", unit: "Var", index: 18, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "单相两线视在功率/三相合视在功率", field_name: "S", unit: "VA", index: 22, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "单相有功电能/三相合视在电能", field_name: "E", unit: "kWh", index: 26, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "单相L线温", field_name: "Ts", unit: "℃", index: 34, type: "int16be", coefficient: 0.1, decimal: 1 },
        { name: "剩余电流", field_name: "Ires", unit: "mA", index: 36, type: "uint16be", coefficient: 0.001, decimal: 3 },
        { name: "A相电流", field_name: "Ia", unit: "A", index: 38, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "B相电流", field_name: "Ib", unit: "A", index: 42, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "C相电流", field_name: "Ic", unit: "A", index: 46, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "N相电流", field_name: "In", unit: "A", index: 50, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "额定电流", field_name: "Ir", unit: "A", index: 54, type: "int16be", coefficient: 1, decimal: 0 },
        { name: "A相电压", field_name: "Ua", unit: "V", index: 56, type: "int16be", coefficient: 0.01, decimal: 2 },
        { name: "B相电压", field_name: "Ub", unit: "V", index: 58, type: "int16be", coefficient: 0.01, decimal: 2 },
        { name: "C相电压", field_name: "Uc", unit: "V", index: 60, type: "int16be", coefficient: 0.01, decimal: 2 },
        { name: "有功功率A", field_name: "Pa", unit: "W", index: 62, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "有功功率B", field_name: "Pb", unit: "W", index: 66, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "有功功率C", field_name: "Pc", unit: "W", index: 70, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "无功功率A", field_name: "Qa", unit: "Var", index: 74, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "无功功率B", field_name: "Qb", unit: "Var", index: 78, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "无功功率C", field_name: "Qc", unit: "Var", index: 82, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "视在功率A", field_name: "Sa", unit: "VA", index: 86, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "视在功率B", field_name: "Sb", unit: "VA", index: 90, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "视在功率C", field_name: "Sc", unit: "VA", index: 94, type: "int32be", coefficient: 0.001, decimal: 3 },
        { name: "视在能量A", field_name: "Esa", unit: "VAh", index: 98, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "视在能量B", field_name: "Esb", unit: "VAh", index: 106, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "视在能量C", field_name: "Esc", unit: "VAh", index: 114, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "三相合视在能量", field_name: "Es", unit: "VAh", index: 122, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "A线温度", field_name: "Ta", unit: "℃", index: 130, type: "int16be", coefficient: 0.1, decimal: 1 },
        { name: "B线温度", field_name: "Tb", unit: "℃", index: 132, type: "int16be", coefficient: 0.1, decimal: 1 },
        { name: "C线温度", field_name: "Tc", unit: "℃", index: 134, type: "int16be", coefficient: 0.1, decimal: 1 },
        { name: "N线温度", field_name: "Tn", unit: "℃", index: 136, type: "int16be", coefficient: 0.1, decimal: 1 },
        { name: "单相视在能量/三相合有功电能", field_name: "Ep", unit: "kWh", index: 138, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "A相有功能量", field_name: "Epa", unit: "kWh", index: 146, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "B相有功能量", field_name: "Epb", unit: "kWh", index: 154, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "C相有功能量", field_name: "Epc", unit: "kWh", index: 162, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "单相无功能量/三相合无功电能", field_name: "Eq", unit: "kVarh", index: 170, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "A相无功能量", field_name: "Eqa", unit: "kVarh", index: 178, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "B相无功能量", field_name: "Eqb", unit: "kVarh", index: 186, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "C相无功能量", field_name: "Eqc", unit: "kVarh", index: 194, type: "int64be", coefficient: 1, decimal: 0 },
        { name: "电网频率", field_name: "Freq", unit: "Hz", index: 202, type: "int16be", coefficient: 0.1, decimal: 1 },
        { name: "告警", field_name: "warnCode", unit: "", index: 204, type: "hexbe7" },
        { name: "开关状态", field_name: "switch", unit: "", index: 211, type: "bitle0-0" },
    ]
    let transFrameInfo={    port:51}
    let transAppInfo = [
        {name: "code", field_name: "code",  index: 1, type: "uint8"}
    ]
    let tdata=null
    if( port===51) {
        let rpcSwitch=device.server_attrs.szwb1_22103_switch
        if (rpcSwitch?.ms==undefined) return null
        let diff=Date.now()-rpcSwitch.ms
        if (diff>5000) return null
        let transParser=new PayloadParser({
            device:device, msg:msg, frameInfo:transFrameInfo, appInfo:transAppInfo}
        )
        let transData=transParser.telemetry()
        if (transData==undefined) return null
        tdata={}
        if (transData.code===0x05) {
            if  (rpcSwitch?.params?.switch===true) {tdata.switch=1
            }else { tdata.switch=0 }
        }
    }else {
        let payParser=new PayloadParser({
            device:device, msg:msg, frameInfo:frameInfo, appInfo:appInfo}
        )
        tdata= payParser.telemetry();
        if (tdata.warnCode!=undefined) {
            let alarmBuffer=new BufferTKL(Buffer.from(tdata.warnCode,"hex"))
            let warnInfo="warning: "
            let alarmcount=0
            for(let i=0;i<55;i++) {
            let content=ALARM_MAP[2000 + i]
            if (content==undefined) continue
            let val =alarmBuffer.read(0,"bitLE"+i.toString(10)+"-"+i.toString(10))
            if (val===0) continue
            if (alarmcount!==0) {warnInfo+=","}
            warnInfo+=content
            alarmcount++
        }
        if (alarmcount===0) { warnInfo="normal"}
        tdata.warning=warnInfo;
        }
    }
    return {
        telemetry_data: tdata,
        server_attrs: null,
        shared_attrs: null,
    };

8. Third-Party Platform Data Subscription

8.1 MQTT Topic

latex
/v32/{Organization Account}/tkl/up/telemetry/{eui}

8.2 Example Reported Data

json
{
    "eui": "6353012af10a9331",
    "active_time": "2026-02-05T08:35:48.000Z",
    "thingModelId": "zw_szwb1_22103",
    "thingModelIdName": "ZW-SZWB1",
    "telemetry_data": {
        "DIP": 1,
        "I": 12.345,
        "U": 220.15,
        "P": 2500.123,
        "Q": 120.456,
        "S": 2520.789,
        "Ts": 36.5,
        "Ires": 0.012,
        "Ia": 12.111,
        "Ib": 11.982,
        "Ic": 12.204,
        "Ua": 220.13,
        "Ub": 219.98,
        "Uc": 220.42,
        "Freq": 50.0,
        "warnCode": "00000000000000",
        "warning": "normal",
        "switch": 1
    }
}

9. RPC

9.1 RPC Names

  1. [SZWB1 SET] para
    • id Name: szwb1_set_para_22103
  2. [SZWB1 GET] para
    • id Name: szwb1_get_22103

9.2 Parameter Definitions

Parameter AddressParameter NameField NameTypeDescription
app_70period_upperiod_upuint32leUpload period, unit: seconds
app_74period_readperiod_readuint32leAcquisition period, unit: seconds
app_150addr_modbusaddr_modbusuint8Modbus slave address

9.3 RPC Code

Set Parameters

javascript
let classMode = (device && device.shared_attrs && device.shared_attrs.class_mode) || "ClassA";
const rpcName="szwb1_set_para_22103"
let paraDef = {
    app_70:{name: "period_up", field_name: "period_up", unit:"S", type: "uint32le"},
    app_74:{name: "period_read", field_name: "period_read", unit:"S", type: "uint32le"},
    app_150:{name: "addr_modbus", field_name: "addr_modbus", unit:"", type: "uint8"}
}
let frames=RPCHelper.buildFrame({
    paraDef:paraDef,
    params:params});
let redoBuffer=RPCHelper.redo()
let dnBuffer=Buffer.alloc(frames.writeBuffer.length+frames.readBuffer.length);
frames.writeBuffer.copy(dnBuffer,0)
frames.readBuffer.copy(dnBuffer,frames.writeBuffer.length)
logger.info("set para")
let msgQue=Utils.makeParaSetMSG({
    device:device,
    classMode:classMode,
    rpcName:rpcName,
    params:params,
    paraDownBuffer:dnBuffer,
    extraAppBuffer:redoBuffer
})
if (msgQue.length==0)  return null
return msgQue

Read Parameters

javascript
let paraDef = {
    app_70:{name: "period_up", field_name: "period_up", unit:"S", type: "uint32le"},
    app_74:{name: "period_read", field_name: "period_read", unit:"S", type: "uint32le"},
    app_150:{name: "addr_modbus", field_name: "addr_modbus", unit:"", type: "uint8"}
}
let frames=RPCHelper.buildFrame({
    paraDef:paraDef,
    params:params});
let msg=RPCHelper.makeMSG({
    msgType:Utils.msgType.paras,
    device:device,
    dnBuffer:frames.readBuffer,
    sleepTime:0,
})
return [msg]

10. Template Selection

In the ThinkLink platform, search for the template:

  • SZWB1
  • 22103