下面要给大家介绍的是如何使用海创-IIoT平台快速的采集松下PLC的数据,我们使用的是FPX-C30T型号的PLC,采用Mewtocol 协议。
一.选择产品
1、FPX-C30TFP-X
2、海创Box智能采集网关
3、串口服务器
二.设置PLC串口通讯
在松下PLC编程软件FPWIN GR里面设置PLC的串口通讯的波特率、数据位、校验位、停止位。

下图为寄存器地址

三.采集数据
在桌面打开海创-IIoT可视化编辑工具,进入可视化编辑器。本次教程需要用到如下节点,在左侧节点栏中拖拽出使用
1、’定时器周期性触发输入时间戳或者相应的字符

2、Mewtocol松下Mewtocol 采集协议

下图为本案例Mewtocol松下控件的配置内容

下图为服务器配置内容

3、调试用于调试节点输出

把三个控件用线连接起来组成一个流,点击部署最后的效果如下图所示

四.代码示例
以上教程可以通过拷贝下面代码实现快速复用,在新建的流程中点击界面右侧菜单栏-导入-剪贴板,在文本框中粘贴下面代码后点击确定,即可快速复用
[
{
"id": "c51717ca.f93dc8",
"type": "iot-mewtocol",
"z": "8748625d.11eb4",
"name": "",
"server": "817a8aa9.0d9508",
"columns": [
{
"Key": "1",
"Lable": "1",
"Area": "D",
"Address": "100",
"Number": "1",
"ValueType": "Int16BE",
"Arithmetic": ""
}
],
"x": 435,
"y": 340,
"wires": [
[
"7d3fe984.c073b8"
]
]
},
{
"id": "2e14c46c.9929ec",
"type": "inject",
"z": "8748625d.11eb4",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 320,
"y": 340,
"wires": [
[
"c51717ca.f93dc8"
]
]
},
{
"id": "7d3fe984.c073b8",
"type": "debug",
"z": "8748625d.11eb4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 540,
"y": 340,
"wires": []
},
{
"id": "817a8aa9.0d9508",
"type": "iot-mewtocol-client",
"z": "",
"name": "",
"communicate": "Serial",
"host": "COM1",
"post": "502",
"baudrate": "9600",
"databits": "8",
"stopbits": "1",
"parity": "Odd",
"expand": {
"UnitId": "1"
}
}
]
|