2022年1月26日 WEBAPT暴力读写测试
视频演示:http://mpvideo.qpic.cn/0bc3diaakaaayuaa5qprunqvagwdaunaabia.f10002.mp4?
通讯没有出现一次问题.we

通过Web端或移动APP发布写值指令json数据到网关代理服务器后,网关再读写PLC的数据,web端和网关的指令操作延时≤60ms。



2022年1月25日
大致的思路如下:

目前网关已经开发完成,并且开发了几个版本.连续运行了一个月都没有出现问题.

其中一个版本使用的是系统服务的模式再运行.

服务器的API已经已经开发完成.还要继续优化.基本已经能使用.

开发中http://localhost:9009/holdingregistersGETapplication/json{
"destination": "127.0.0.1:502",
"connectiontype": 2,
"slaveid": 1,
"address": 100,
"count": 50
}参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
|---|---|---|---|---|
destination | 127.0.0.1:502 | Number | 是 | 链接IP和端号 |
connectiontype | 2 | Number | 是 | 通讯链接类型 |
slaveid | 1 | Number | 是 | 从站 |
address | 100 | Number | 是 | 起始地址 |
count | 50 | Number | 是 | 读取数据长度 |

开发中http://localhost:9009/holdingregistersPUTapplication/json{
"destination": "127.0.0.1:502",
"connectiontype": 2,
"slaveid": 1,
"address": 100,
"Data": [1,2,3,4,5,6,7,8,9,10,11,12]
}参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
|---|---|---|---|---|
destination | 127.0.0.1:502 | Number | 是 | 链接IP和端号 |
connectiontype | 2 | Number | 是 | 通讯链接类型 |
slaveid | 1 | Number | 是 | 从站 |
address | 100 | Number | 是 | 起始地址 |
Data | 1 | Number | 是 | 数据数组 |
客户端通过多次测试,决定用RestSharp来开发测试.后续有更好的方式再换.
RestClient client = new RestClient("http://11.168.1.102:9009/");
string json = "{ \"destination\": \"127.0.0.1:502\", \"connectiontype\": 2, \"slaveid\": 1, \"Ticketmaster.Core.V2.Models.Address\": 0, \"count\": 10}";
RestRequest request = new RestRequest("holdingregisters").AddBody(json, ContentType.Json);
var response = await client.GetAsync(request).Dump();
后续工作:
这两年技术更迭太快了.有点学不过来的感觉.好不容易winform用的毕竟熟了,又要开始搞Web开发.脑子不够用了..😵