optimize the codes with lwip and opcua

This commit is contained in:
wlyu
2022-03-21 16:47:32 +08:00
parent a52854efb6
commit f74d1dafd7
25 changed files with 452 additions and 2257 deletions

View File

@@ -0,0 +1,16 @@
# OPCUA DEMO README
## 文件说明
用于OPCUA 相关测试命令演示需要开启LWIP和OPCUA协议.
### 命令行
UaConnect [IP]
用于测试与OPCUA服务器连接连接成功应显示OK
UaObject [IP]
用于显示对应的OPCUA设备的节点信息

View File

@@ -0,0 +1,48 @@
# PLC DEMO README
## 文件说明
用于PLC设备相关测试命令演示目前支持OPCUA协议对PLC进行远程控制该命令基于LWIP和OPCUA需要开启相关开关。
多个PLC设备可以组成一个channel用于一条相关业务线控制。
### 命令行
ShowChannel
显示注册到channel上的PLC设备范例如下
ch_type ch_name drv_name dev_name cnt
-----------------------------------------------------------------
PLC_Channel PLC OPCUA PLC Demo 4 1
PLC Demo 3 2
PLC Demo 2 3
PLC Demo 1 4
PLC Demo 0 5
ShowPLC
用于显示PLC范例如下
device vendor model product id
-----------------------------------------------------------------
PLC Demo 4 B&R X20 X20 CP1381 5
PLC Demo 3 B&R X20 X20 CP1586 4
PLC Demo 2 SIEMSNS S7-200 CPU SR60 3
PLC Demo 1 SIEMENS S7-1200 CPU 1215C 2
PLC Demo 0 SIEMENS S7-1500 CPU 1512SP-1PN 1
PlcRead [NodeID]
用于读取PLC节点信息
- [NodeID]: 如n4,1, 其中4代表namespace1代表节点号
PlcWrite
用于写入PLC节点数值
- [NodeID]: 如n4,1, 其中4代表namespace1代表节点号
- [value]: 为写入数值目前支持bool类型和int类型。bool型应为0b(代表false), 1b(代表true)

View File

@@ -101,8 +101,6 @@ void PlcReadUATask(void* arg)
if(EOK != ret)
{
plc_print("plc: [%s] open failed %#x\n", __func__, ret);
// free(plc_demo_dev.priv_data);
// plc_demo_dev.priv_data = NULL;
return;
}
@@ -163,8 +161,6 @@ void PlcWriteUATask(void* arg)
if(EOK != ret)
{
plc_print("plc: [%s] open failed %#x\n", __func__, ret);
// free(plc_demo_dev.priv_data);
// plc_demo_dev.priv_data = NULL;
return;
}