当前位置:网站首页>【网络通信三】研华网关Modbus服务设置
【网络通信三】研华网关Modbus服务设置
2022-07-31 16:27:00 【慷仔】
研华网关Modbus服务设置
1、前言
最近在使用研华网关进行Modbus的通信试验,试图跟之前研究的Modbus通信库进行相互通信。
企图互通两者的通信,熟悉Advantech EdgeLink Studio的使用等目的。
关键字如下所示:
- Advantech EdgeLink Studio
- Modbus Tcp
- Socket 阻塞和非阻塞
- IPv4和IPv6区别
使用到的相关软件和工具: - Advanced IP Scanner
- Modbus Poll
- Advantech EdgeLink Studio
2、Advantech EdgeLink Studio使用流程
2.1、总体使用流程
2.2、重要流程截图



3、试验流程
3.1、使用Modbus Poll进行连接



3.2、libmodbus自写程序连接研华网关的流程
# 复制克隆该项目,运行脚本生成modbus_poll工具
# clear all exec
if [ ! -d "./bin" ]; then
mkdir bin
else
cd bin
rm -rf ./*
cd ..
fi
if [ ! -d "./build" ]; then
mkdir build
fi
cd build
# build client
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Release -DClient=ON ..
make
cd release
cp modbus_poll ../../bin
cd ../../
# 使用工具进行modbus通信
if [ -f bin/modbus_poll ]; then
cd bin/
# ./modbus_poll --debug -mtcp -t0x01 -r2 -p502 10.0.1.28
./modbus_poll --debug -mtcp -t0x03 -r1 -p502 10.0.1.59 -c4
cd ../
else
echo "不存在相应的modbus_poll工具"
fi
3.3、自写程序的通信试验结果
Connecting to 10.0.1.59:502
[00][01][00][00][00][06][01][03][00][01][00][04]
Waiting for a confirmation...
<00><01><00><00><00><0B><01><03><08><00><D6><00><33><00><42><00><00>
SUCCESS: read 4 of elements:
Data: 0x00d6 0x0033 0x0042 0x0000
结果说明:
- "./modbus_poll --debug -mtcp -t0x03 -r1 -p502 10.0.1.59 -c4"命令表示从modbus的1地址开始,读取4个寄存器值,同时显示出来。其中研华网关的ip是10.0.1.59,modbus端口号为502。
- 这些结果和在Modbus Poll工具中显示的是一致的,说明通信成功无误。
4、遇到的问题及解决方法
4.1、问题1
- 现象:自写程序modbus_poll无法与研华网关connect成功,显示"Connect time out"的报错;但是Modbus Poll工具却可以进行通信。
- 原因:没有在研华网关的"系统设置/网络和Internet/网络设置"中设置好相应的IPv4属性
- 解决方法:设置好相应的IPv4属性信息,可以是如下所示的设置。

边栏推荐
- 2022年整理LeetCode最新刷题攻略分享(附中文详细题解)
- The principle of hough transform detection of straight lines (opencv hough straight line detection)
- gerrit中如何切换远程服务器
- 智能垃圾桶(八)——红外对管传感器(树莓派pico)
- ML.NET相关资源整理
- 外媒所言非虚,苹果降价或许是真的在清库存
- 华为顶级工程师历时9年总结的“趣谈网络协议”PDF文档,太强了
- Codeforces Round #796 (Div. 2) (A-D)
- How C programs run 01 - the composition of ordinary executable files
- 网站漏洞修复服务商关于越权漏洞分析
猜你喜欢

6-22 Vulnerability exploit - postgresql database password cracking

Dialogue with Zhuang Biaowei: The first lesson of open source

【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发

After Grafana is installed, the web opens and reports an error

研发过程中的文档管理与工具

Kubernetes principle analysis and practical application manual, too complete

Kubernetes common commands

上传图片-微信小程序(那些年的坑记录2022.4)

仿生毛毛虫机器人源码

外媒所言非虚,苹果降价或许是真的在清库存
随机推荐
After Grafana is installed, the web opens and reports an error
Summary of the implementation method of string inversion "recommended collection"
【7.29】代码源 - 【排列】【石子游戏 II】【Cow and Snacks】【最小生成数】【数列】
tensorflow2.0 cnn(layerwise)
使用 Postman 工具高效管理和测试 SAP ABAP OData 服务的试读版
2.索引及调优篇【mysql高级】
Oracle动态注册非1521端口
BGP综合实验(建立对等体、路由反射器、联邦、路由宣告及聚合)
The principle of hough transform detection of straight lines (opencv hough straight line detection)
tensorflow2.0 cnn(layerwise)
最新神作!阿里巴巴刚出炉的面试参考指南(泰山版),我直接狂刷29天
SHELL内外置命令
adb shell 报错error: device unauthorized
How C programs run 01 - the composition of ordinary executable files
Implementing DDD based on ABP
Insert into data table to insert data
Delete the disk in good condition (recovery partition)
基于ABP实现DDD
.NET 20th Anniversary Interview - Zhang Shanyou: How .NET technology empowers and changes the world
Tencent Cloud Deployment----DevOps