DGIOT是一个面向物联网的开源数据分析平台,它为用户提供了快速、高效采集、管理和分析物联网设备数据的能力,并具备多种数据处理和可视化展示方式。
DGIOT的安装实例数已经超过 35.2k,用户遍布全球。拿下多个物联网产品的领域赛道冠军。
已承建多个重大国际赛事场馆数字驾驶舱、平安校园数据中台、电信级设备监管平台、千亿级产业大脑等。
全开放源码,全流程低代码。
强大开源社区,集成和兼容各种开源工具。
商业级物联网基座,快速承接物联网项目。
面向工业物联网的轻量级开源平台,致力于平台的标准化和工具化。打造全面、丰富、专业的开源生态产品及服务。
首页 › 实战教程, 技术文章
[小 迪 导读]: 本教程在掌握基础modbusRTU标准协议概念和业务流程之后,可以通过真实的ModbusRTU标准协议的设备和DTU来进行实战演练。
场景解析:在使用Modbus对设备进行采集时,我们会通过读取多个连续寄存器的数据块来保持多个数据的时间一致性,本文就来详细解读dgiot中的数据块配置
和读单个寄存器的区别在于要多配一个数据块的物模型,这个数据块的作用在于一次性把多个连续的寄存器数据读取上来,再通过解析这个数据块,把数据分配下去,所以下图中只有数据块是要采集的,温度湿度是通过计算得来的
数据块配置只读,不存储,不展示 数据类型建议配置text,长度9999,不过不存储情况下,此配置无关紧要
采集策略默认20,协议类型MODBUSRTU,其余默认即可
采集策略选择不采集(计算值),因为采集策略是计算值,采集公式里的变量要填自己的标识符 其他的同以往一样
温度数据来源配置 湿度数据来源配置
物模型代码
{ "properties": [ { "accessMode": "r", "dataForm": { "address": "0X10", "afn": "", "byteType": "", "bytelen": "", "collection": "%{s}", "control": "%{d}", "countcollection": "%{s}", "countround": "all", "countstrategy": 20, "da": "", "data": "null", "dt": "", "iscount": "0", "offset": 0, "operatetype": "readCoils", "order": 0, "originaltype": "short16_AB", "protocol": "MODBUSRTU", "rate": 1, "round": "all", "slaveid": "0X10", "strategy": "20" }, "dataSource": { "": [], "_dlinkindex": "", "address": "0X0200", "operatetype": "readHregs", "originaltype": "bit", "registersnumber": "2", "slaveid": "0X01" }, "dataType": { "das": [], "size": 9999, "specs": {}, "type": "text" }, "devicetype": "数据块", "identifier": "block_data", "index": 0, "isaccumulate": false, "isshow": false, "isstorage": false, "moduleType": "properties", "name": "温湿度数据块", "required": true, "updateAt": "1695189804403" }, { "accessMode": "r", "dataForm": { "address": "0X10", "afn": "", "byteType": "", "bytelen": "", "collection": "%%{humd}/10", "control": "%{d}", "countcollection": "%{s}", "countround": "all", "countstrategy": 20, "da": "", "data": "null", "dt": "", "iscount": "0", "offset": 0, "operatetype": "readCoils", "order": 0, "originaltype": "short16_AB", "protocol": "MODBUSRTU", "rate": 1, "round": "all", "slaveid": "0X10", "strategy": "计算值" }, "dataSource": { "": [], "_dlinkindex": "", "address": "1", "operatetype": "readHregs", "originaltype": "ushort16_AB", "registersnumber": "1", "slaveid": "block_data" }, "dataType": { "das": [], "specs": { "max": 100, "min": 0, "precision": 3, "step": 0, "unit": "%" }, "type": "float" }, "devicetype": "温湿度", "identifier": "humd", "isaccumulate": false, "isshow": true, "isstorage": true, "moduleType": "properties", "name": "湿度", "required": true, "updateAt": "1695196699923", "index": 1 }, { "accessMode": "r", "dataForm": { "address": "0X10", "afn": "", "byteType": "", "bytelen": "", "collection": "%%{wendu}/10", "control": "%{d}", "countcollection": "%{s}", "countround": "all", "countstrategy": 20, "da": "", "data": "null", "dt": "", "iscount": "0", "offset": 0, "operatetype": "readCoils", "order": 0, "originaltype": "short16_AB", "protocol": "MODBUSRTU", "rate": 1, "round": "all", "slaveid": "0X10", "strategy": "计算值" }, "dataSource": { "": [], "_dlinkindex": "", "address": "0", "operatetype": "readHregs", "originaltype": "short16_AB", "registersnumber": "1", "slaveid": "block_data" }, "dataType": { "das": [], "specs": { "max": 100, "min": 0, "precision": 3, "step": 0, "unit": "℃" }, "type": "float" }, "devicetype": "温湿度", "identifier": "wendu", "isaccumulate": false, "isshow": true, "isstorage": true, "moduleType": "properties", "name": "温度", "required": true, "updateAt": "1695196712029", "index": 2 } ] }
[小 迪 点 评]
想了解更多 dgiot 的具体细节,欢迎大家在GitHub上查看相关源代码。
加微信咨询
请填写下面表单,我们的工作人员会与您联系。
报错: 未找到这个表单
请填写下面表单,我们会即时将最新版本下载地址发到您的邮箱。
加小迪为好友即可加入交流群