接入案例
当前以设施云自研的Modbus数采插件为例来配置设备点位通过数采方式接入,如果是伙伴自己开发的数采插件,流程也是类似,只是数采模板和对应应用的镜像地址这些容器配置会不同。
添加数采模板
- 保存以下模板保存到本地,文件名为Modbus-Tcp.json
{ "tpl_id": "iotfm_general_modbustcp_V3", "name": "智能设施云平台自研ModbusTcp数采模板V3", "description": "智能设施云平台自研ModbusTcp数采模板V3", "datasource_meta": { "config_tabs": [ { "key": "connection_info", "name": "连接信息", "description": "连接信息", "type": "object", "quantity": 10, "config_items": [ { "key": "connection_ext_info", "name": "连接扩展信息", "description": "连接扩展信息,协议应用上线后模板增删字段需重建数采连接,新增扩展信息容纳后续新增的字段。", "data_type": "string", "required": false, "crypted": false, "max_length": 65535, "example": "{\"xxx\": \"xxx\"}" } ] }, { "key": "array_info", "name": "连接信息", "description": "连接信息", "type": "array", "quantity": 10, "config_items": [ { "key": "endpoint", "name": "服务端点信息", "description": "服务端点信息,为json字符串数组格式", "data_type": "string", "required": true, "crypted": false, "max_length": 128, "example": "{\"endpoint_id\":\"1\", \"endpoint_url\": \"127.0.0.1:123\"}" } ] } ], "default_values": { "drivername": "ModbusTcp" } }, "point_meta": { "data_type_enums": [ "bool", "short", "ushort", "int", "uint", "long", "ulong", "float", "double" ], "config_items": [ { "key": "endpoint_id", "name": "终端节点ID", "description": "Modbus终端节点ID,来源于数采连接配置,如配置失败,则将被丢弃。", "data_type": "int", "required": true, "crypted": false, "max_length": 256, "example": 1 }, { "key": "slave_id", "name": "从站号", "description": "modbus传感器从站号", "data_type": "int", "required": true, "crypted": false, "max_length": 256, "example": 1 }, { "key": "register_type", "name": "寄存器类型", "description": "寄存器类型", "data_type": "string", "required": true, "crypted": false, "max_length": 256, "enum_value": "Coil_Status|Input_Status|Holding_Registers|Input_Registers", "example": "Coil_Status" }, { "key": "register_address", "name": "起始地址", "description": "寄存器起始地址", "data_type": "string", "required": true, "crypted": false, "max_length": 256, "example": "0x0" }, { "key": "cycle", "name": "采集周期", "description": "点位采集周期", "data_type": "int", "required": true, "crypted": false, "max_length": 65535, "example": 10000 }, { "key": "byte_swap", "name": "寄存器高低位交换", "description": "寄存器高低位交换", "data_type": "bool", "required": false, "crypted": false, "max_length": 256, "default": false, "example": true }, { "key": "register_swap", "name": "寄存器顺序交换", "description": "寄存器顺序交换", "data_type": "bool", "required": false, "crypted": false, "max_length": 256, "default": false, "example": true }, { "key": "point_ext_info", "name": "点位扩展信息", "description": "点位扩展信息,协议应用上线后模板增删字段需全量调整点位,新增扩展信息容纳后续新增的点位字段。", "data_type": "string", "required": false, "crypted": false, "max_length": 65535, "example": "{\"field_a\": \"valueA\", \"field_b\": 123}" }, { "crypted": false, "data_type": "string", "description": "该物理点位枚举值和物模型点位枚举值的映射关系", "example": "物理点位枚举值1:物模型点位枚举值1|物理点位枚举值2:物模型点位枚举值2", "key": "enum_map", "max_length": 256, "name": "枚举值映射表", "required": false } ] } }
- 导入上面文件到数采模板
添加数采应用
添加应用版本
须知:该步骤将会为上述业务应用添加一个可用版本
【边缘管理】->【应用管理】->【驱动应用】->【操作--详情】->【添加版本】
- 基本配置,容器镜像地址可以使用:swr.cn-north-4.myhuaweicloud.com/huawei-iot-facility/iotfm-edge-app-plugins-modbus-tcp:2025.0113.1944.37
- 配置镜像地址
- 配置容器规格
- 高级配置
数据存储
本地卷名称
类型
主机目录
容器目录
权限
config
CONFIG
/config
/opt/iot/iotfm-edge-app-plugins-modbus-tcp/config
读写
logs
LOG
/tmp/iotfm-edge-app-plugins-modbus-tcp/logs
/opt/iot/iotfm-edge-app-plugins-modbus-tcp/logs
读写
- 端点无需配置
- 部署配置
网络类型:端口映射
- 确认信息,立即发布
插件部署
部署Modbus应用模块