22115-AXIAL-FORCE 轴力变送器
模型清单
可使用下列名称或 ID 在 ThinkLink 中搜索对应模型。
| 模型类型 | 名称 | id_name | 平台模型 ID |
|---|---|---|---|
| RPC | [AXIAL-FORCE GET] 22115 | axial_force_get_22115 | 134816004424232960 |
| RPC | [AXIAL-FORCE SET] 22115 | axial_force_set_22115 | 134816003702812672 |
| Template | AXIAL-FORCE | axial_force_22115 | 134816001572106240 |
| Thing Model | [AXIAL-FORCE] | axial_force_22115 | 134816002285137920 |
| Parameter Thing Model | [AXIAL-FORCE-PARA] | axial_force_para_22115 | 134816002998169600 |
1. 传感器简介
SX 电阻应变式轴力/称重变送器通过 RS-485/Modbus RTU 接入 KC21,业务代码为 22115,ThinkLink 模板为 axial_force_22115。
2. 产品特点
- 24 bit ADC,典型稳定精度 1/10000
- 支持 10Hz/40Hz 采样和最多 10 点非线性校正
- 同时提供数字测量和 4-20mA/0-10V 输出监测
3. 适用范围
- 基坑、桥梁和支护结构轴力监测
- 拉索、锚杆或称重构件长期载荷监测
- 工业试验和设备受力采集
4. 采集器信息
- DTU:KC21
- 接口:RS-485
- 默认模式:Battery / Class A
- 串口:9600、8N1
- 传感器上电延时:1000ms
部署前供电确认: 本对接在现场信息缺失时默认按 KC21 电池供电(Class A)处理,尚未由客户确认。若实际为常供电,需改为 Class C、改用 MT-EB-POWER 模板并重新核对心跳周期,否则可能出现下行不及时、功耗异常或控制指令不可达。
电源正负极必须按设备资料与实物铭牌连接;RS-485 A/B 分别连接 KC21 485A/485B。部署前断电完成接线,并确认传感器实际供电范围。
5. 数据采集
采用 FC03,3 个查询事件:0-3(实时轴力、信号电压)、10-14(原始轴力、电流、电压)、19(软件版本)。采集与上报共用 app_70=900s,COV 关闭。
| 地址 | 字段 | 数据项 | 类型 | 系数 | 单位 |
|---|---|---|---|---|---|
| 0-1 | axial_force | 实时轴力 / Axial force | int32CDAB | 1 | |
| 2-3 | signal_voltage_raw | 信号电压原始值 / Raw signal voltage | int32CDAB | 1 | |
| 10-11 | axial_force_raw | 原始轴力 / Raw axial force | int32CDAB | 1 | |
| 13 | output_current | 模拟输出电流 / Output current | uint16BE | 0.01 | mA |
| 14 | output_voltage | 模拟输出电压 / Output voltage | uint16BE | 0.01 | V |
| 19 | software_version | 软件版本 / Software version | uint16BE | 1 |
6. EdgeBus 模型
- port: 22
- version/dataType:
0x88/0x01 - BzType/BzVersion:
22115/1 - upPeriodIndex: 70
- addr_modbus: app_150
- 上行帧长度:6 字节公共头 + 所有查询结果字节
- 查询逻辑:3 个查询事件:0-3(实时轴力、信号电压)、10-14(原始轴力、电流、电压)、19(软件版本)
6.2 EdgeBus 代码
import { Buffer } from "buffer";
import { buildOtaFile } from "@EBSDK/run";
import { EBModel } from "@EBSDK/EBCompiler/EBModel/EBModel";
import { EventInfoItem } from "@EBSDK/EBCompiler/plugins/EBHelper";
import type { UserConfUPItem } from "@EBSDK/EBCompiler/plugins/EBHelper";
import { CheckbitEnum, getOtaConfig } from "@EBSDK/otaConfig";
// SX axial-force transmitter, RS485/Modbus-RTU FC03.
// 32-bit values use low-word/high-word register order and are decoded by the
// ThinkLink payload parser. Three windows avoid undocumented registers.
const eventInfo: UserConfUPItem[] = [
{
name: "sx-axial-force",
port: 22,
version: "0x88",
dataType: "0x01",
upPeriodIndex: 70,
quInfo: [
{
protocol: "modbus",
addr: "0x01",
code: "0x03",
periodIndex: 70,
indexAPP: 150,
indexCMD: 0,
copySize: 1,
isLast: false,
listVal: [
{ start: "0x0000", end: "0x0001" },
{ start: "0x0002", end: "0x0003" },
],
},
{
protocol: "modbus",
addr: "0x01",
code: "0x03",
periodIndex: 70,
indexAPP: 150,
indexCMD: 0,
copySize: 1,
isLast: false,
listVal: [
{ start: "0x000A", end: "0x000B" },
{ start: "0x000D", end: "0x000E" },
],
},
{
protocol: "modbus",
addr: "0x01",
code: "0x03",
periodIndex: 70,
indexAPP: 150,
indexCMD: 0,
copySize: 1,
isLast: true,
listVal: [{ start: "0x0013", end: "0x0013" }],
},
],
},
];
const otaConfig = getOtaConfig({
BaudRate: 9600,
StopBits: 1,
DataBits: 8,
Checkbit: CheckbitEnum.NONE,
Battery: true,
ConfirmDuty: 60,
BzType: 22115,
BzVersion: 2,
});
const MODBUS_TT = (ebModel: EBModel) => {
for (const info of eventInfo) {
const event = new EventInfoItem(info);
event.upEventSetup();
event.eventInstall();
}
return JSON.stringify(ebModel, null, 2);
};
buildOtaFile(import.meta.url, otaConfig, MODBUS_TT);7. 物模型
- 遥测物模型:
axial_force_22115 - 参数物模型:
axial_force_para_22115 - 上行:port 22,标签
0x88/0x01
7.1 遥测解析器
import {Buffer} from "buffer";
import {PayloadParser, RPCHelper} from "#tklHelper";
function payload_parser(device, msg, thingModelId, noticeAttrs, org_params) {
const port = msg?.userdata?.port ?? null;
if (port !== 22) return null;
const frameInfo = {
port: 22,
dataLen: 24,
rssi: true,
battery: 4,
status: 3,
tagList: [{index: 0, tag: 0x88}, {index: 1, tag: 0x01}],
};
const appInfo = [
{name: "output_current", field_name: "output_current", unit: "mA", index: 18, type: "uint16BE", coefficient: 0.01, decimal: 2},
{name: "output_voltage", field_name: "output_voltage", unit: "V", index: 20, type: "uint16BE", coefficient: 0.01, decimal: 2},
{name: "software_version", field_name: "software_version", unit: "", index: 22, type: "uint16BE", coefficient: 1, decimal: 0},
];
const parser = new PayloadParser({device, msg, frameInfo, appInfo});
let telemetry = parser.telemetry();
if (telemetry == null) return null;
if ((telemetry.status & 0x02) === 0x02) {
const status = telemetry.status;
telemetry = {...(device.telemetry_data?.[thingModelId] ?? {})};
telemetry.status = status;
} else {
const payload = Buffer.from(msg.userdata.payload, "base64");
const int32Cdab = (offset) => payload.readInt16BE(offset + 2) * 65536 + payload.readUInt16BE(offset);
telemetry.axial_force = int32Cdab(6);
telemetry.signal_voltage_raw = int32Cdab(10);
telemetry.axial_force_raw = int32Cdab(14);
}
telemetry._modelName = "axial_force_22115";
telemetry.adr = msg?.userdata?.adr ?? null;
const result = {
telemetry_data: telemetry,
server_attrs: null,
shared_attrs: null,
};
if (typeof RPCHelper.buildRpcHookAction === "function") {
const action = RPCHelper.buildRpcHookAction({
device,
msg,
thingModelId,
idName: "axial_force_22115",
name: "[AXIAL-FORCE]",
parsed: result,
});
if (action) result.actions = [action];
}
return result;
}
const deviceObj = {telemetry_data: {}};
const msgObj = {
userdata: {
port: 22,
payload: Buffer.from("880100006401e2400001fc18ffffd4c0000104d202ee3039", "hex").toString("base64"),
},
};
const noticeAttrsObj = {telemetry_data: true};
console.log(payload_parser(deviceObj, msgObj, "1", noticeAttrsObj, {}));7.2 参数解析器
import {PayloadParser, RPCHelper, Utils} from "#tklHelper";
function payload_parser(device, msg, thingModelId, noticeAttrs, org_params) {
const port = msg?.userdata?.port ?? null;
const rpcName = "axial_force_set_22115";
const paraDef = {
app_20: {name: "TimeOffset", field_name: "TimeOffset", unit: "", index: 20, type: "uint32le"},
app_38: {name: "pwron_delay", field_name: "pwron_delay", unit: "ms", index: 38, type: "uint16le"},
app_40: {name: "period_heart", field_name: "period_heart", unit: "s", index: 40, type: "uint32LE"},
app_70: {name: "period_up", field_name: "period_up", unit: "s", index: 70, type: "uint32LE"},
app_150: {name: "addr_modbus", field_name: "addr_modbus", unit: "", index: 150, type: "uint8"},
};
if (port !== 214) {
const checkData = Utils.paraCheck(rpcName, device.server_attrs, device.shared_attrs);
return {server_attrs: checkData.sdata, actions: checkData.actions};
}
const pdata = (new PayloadParser({device, msg, paraInfo: paraDef})).paras();
if (pdata == null) return null;
const checkData = Utils.paraCheck(rpcName, device.server_attrs, pdata);
const result = {
telemetry_data: pdata,
server_attrs: checkData.sdata,
shared_attrs: {
TimeOffset: pdata.TimeOffset,
pwron_delay: pdata.pwron_delay,
period_heart: pdata.period_heart,
period_up: pdata.period_up,
addr_modbus: pdata.addr_modbus,
},
actions: checkData.actions,
};
if (typeof RPCHelper.buildRpcHookAction === "function") {
const action = RPCHelper.buildRpcHookAction({
device,
msg,
thingModelId,
idName: "axial_force_para_22115",
name: "[AXIAL-FORCE-PARA]",
parsed: {
telemetry_data: result.telemetry_data,
server_attrs: result.server_attrs,
shared_attrs: result.shared_attrs,
},
});
if (action) {
result.actions = result.actions || [];
result.actions.push(action);
}
}
return result;
}
const deviceObj = {telemetry_data: {}, server_attrs: {}, shared_attrs: {}};
const msgObj = {userdata: {port: 11, payload: ""}};
const noticeAttrsObj = {telemetry_data: true};
console.log(payload_parser(deviceObj, msgObj, "1", noticeAttrsObj, {}));8. 第三方 MQTT 订阅
Topic: /v32/{Organization Account}/tkl/up/telemetry/{eui}
{
"eui": "6353012af10a9331",
"active_time": "2026-07-29T08:35:48.000Z",
"thingModelId": "22115",
"thingModelIdName": "axial_force_22115",
"telemetry_data": {
"snr": 13.5,
"rssi": -51,
"battery": 3.37,
"axial_force": 123456,
"signal_voltage_raw": -1000,
"axial_force_raw": 120000,
"output_current": 12.34,
"output_voltage": 7.5,
"software_version": 12345
}
}9. RPC
- 参数设置:
axial_force_set_22115 - 参数读取:
axial_force_get_22115
| APP 槽位 | 字段 | 含义 | 单位 | 类型 | 默认值 |
|---|
| app_20 | TimeOffset | 时间偏移 | | uint32le | 0 | | app_38 | pwron_delay | 上电延时 | ms | uint16le | 1000 | | app_40 | period_heart | 心跳周期 | s | uint32LE | 86400 | | app_70 | period_up | 采集与上报周期(≥60) | s | uint32LE | 900 | | app_150 | addr_modbus | Modbus 地址(1-250) | | uint8 | 1 |
9.1 参数设置 RPC
import {RPCHelper, Utils} from '#tklHelper';
import {Buffer} from 'buffer';
function rpc_script({device, params, alarms, logger, org_params}) {
const classMode = device?.shared_attrs?.class_mode || "ClassA";
const rpcName = "axial_force_set_22115";
params = params && typeof params === "object" ? {...params} : {};
if (params.period_up != null && params.period_up < 60) {
logger.info("period_up must be at least 60 seconds");
return null;
}
if (params.addr_modbus != null && (params.addr_modbus < 1 || params.addr_modbus > 250)) {
logger.info("addr_modbus must be between 1 and 250");
return null;
}
if (params.period_heart == null || params.period_heart < 3600) {
params.period_heart = 86400;
}
if (params.pwron_delay == null || params.pwron_delay < 1000) {
params.pwron_delay = 1000;
}
const paraDef = {
app_20: {name: "TimeOffset", field_name: "TimeOffset", unit: "", index: 20, type: "uint32le"},
app_38: {name: "pwron_delay", field_name: "pwron_delay", unit: "ms", index: 38, type: "uint16le"},
app_40: {name: "period_heart", field_name: "period_heart", unit: "s", index: 40, type: "uint32LE"},
app_70: {name: "period_up", field_name: "period_up", unit: "s", index: 70, type: "uint32LE"},
app_150: {name: "addr_modbus", field_name: "addr_modbus", unit: "", index: 150, type: "uint8"}
};
const frames = RPCHelper.buildFrame({paraDef, params});
const redoBuffer = RPCHelper.redo();
const dnBuffer = Buffer.alloc(frames.writeBuffer.length + frames.readBuffer.length);
frames.writeBuffer.copy(dnBuffer, 0);
frames.readBuffer.copy(dnBuffer, frames.writeBuffer.length);
logger.info("set axial-force KC21 app parameters");
const msgQue = Utils.makeParaSetMSG({
device,
classMode,
rpcName,
params,
paraDownBuffer: dnBuffer,
extraAppBuffer: redoBuffer
});
return msgQue.length == 0 ? null : msgQue;
}
rpc_script({
device: {server_attrs: {}, shared_attrs: {}},
params: {period_up: 900, addr_modbus: 1, period_heart: 86400, pwron_delay: 1000},
alarms: [],
logger: console,
org_params: {}
});9.2 参数读取 RPC
import {RPCHelper, Utils} from '#tklHelper';
function rpc_script({device, params, alarms, logger, org_params}) {
const classMode = device?.shared_attrs?.class_mode || "ClassA";
const sleepMs = classMode === "ClassA" ? 500 : 5000;
const paraDef = {
app_20: {name: "TimeOffset", field_name: "TimeOffset", unit: "", index: 20, type: "uint32le"},
app_38: {name: "pwron_delay", field_name: "pwron_delay", unit: "ms", index: 38, type: "uint16le"},
app_40: {name: "period_heart", field_name: "period_heart", unit: "s", index: 40, type: "uint32LE"},
app_70: {name: "period_up", field_name: "period_up", unit: "s", index: 70, type: "uint32LE"},
app_150: {name: "addr_modbus", field_name: "addr_modbus", unit: "", index: 150, type: "uint8"}
};
const frames = RPCHelper.buildFrame({paraDef, params: params || {}});
const msg = RPCHelper.makeMSG({
msgType: Utils.msgType.paras,
device,
dnBuffer: frames.readBuffer,
sleepTime: sleepMs
});
return [msg];
}
rpc_script({
device: {server_attrs: {}, shared_attrs: {}},
params: {},
alarms: [],
logger: console,
org_params: {}
});以上 RPC 只配置 KC21 应用参数,不写传感器寄存器。
10. 模板选择
在 ThinkLink 中搜索模板 AXIAL-FORCE,或按业务代码 22115 查找。
11. 补充说明
- 32 位寄存器按低字在前、高字在后(CDAB)解析。
- 说明书对供电范围和默认波特率有冲突;本固件采用 9600,现场必须核对铭牌和通讯参数。
- 轴力工程单位由现场标定决定,本版本不擅自填写单位。