下面要给大家介绍的是如何使用海创-IIoT平台快速的采集欧姆龙PLC的数据,我们使用的是CP1E-N20DR-A型号的PLC,采用HOSTLINK协议。
1、CP1E-N20DR-ACP1E使用手册.pdf
2、海创Box智能采集网关
3、串口服务器极简版测试用使用手册.docx
在欧姆龙PLC编程软件CX-Programmer里面设置PLC的串口通讯的波特率、数据位、校验位、停止位、单元号和采集协议。
下图为寄存器地址
在桌面中打开海创-IIoT可视化编辑工具,进入可视化编辑器。本次教程需要用到如下节点,在左侧节点栏中拖拽出使用
1、’定时器周期性触发输入时间戳或者相应的字符
2、HostLink欧姆龙HostLink采集协议
下图为本案例HostLink欧姆龙控件的配置内容
下图为服务器配置内容
3、调试用于调试节点输出
把三个控件用线连接起来组成一个流,点击部署最后的效果如下图所示
以上教程可以通过拷贝下面代码实现快速复用,在新建的流程中点击界面右侧菜单栏-导入-剪贴板,在文本框中粘贴下面代码后点击确定,即可快速复用
[ { "id": "47bba1db.0ca98", "type": "inject", "z": "aac35e85.a1cec", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 235, "y": 240, "wires": [ [ "bb8b0e84.34dc9" ] ] }, { "id": "bb8b0e84.34dc9", "type": "iot-hostlink", "z": "aac35e85.a1cec", "name": "", "server": "a9ca7528.fe2da8", "columns": [ { "Key": "D0000", "Lable": "D区第0位", "Area": "D", "Address": "0000", "Number": "1", "ValueType": "Int16BE", "Arithmetic": "" }, { "Key": "D0001", "Lable": "D区第1位", "Area": "D", "Address": "0001", "Number": "1", "ValueType": "UInt16BE", "Arithmetic": "" } ], "x": 350, "y": 240, "wires": [ [ "ec2ebc2f.77bd5" ] ] }, { "id": "ec2ebc2f.77bd5", "type": "debug", "z": "aac35e85.a1cec", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 535, "y": 240, "wires": [] }, { "id": "a9ca7528.fe2da8", "type": "iot-hostlink-client", "z": "", "name": "", "communicate": "Serial", "host": "COM1", "post": "502", "baudrate": "115200", "databits": "7", "stopbits": "2", "parity": "Even", "expand": { "UnitId": "0" } } ]