opcuaclient 文档_连接协议-OPC UA Client
連接協(xié)議-OPC UA Client
更新時間:2018-10-13 17:54:34
一、框圖
opcua driver:LinkEdge中負責連接opcua server,數(shù)據(jù)轉換的模塊
config:驅動配置信息,包含連接的server信息和設備信息,保存在配置中心,詳見第二部分介紹
tsl:產品物模型描述信息,部分信息為opcua特有,保存在配置中心,詳見第三部分介紹
二、config:
{
"DriverConfig":{
/******控制臺需要自行錄入部分******/
"ServerList":[ //----------------------------opcua服務器列表
{
"serverId":0, //------------------------服務器索引,由0順序遞增,用來設備與服務器關聯(lián)
"url": "opc.tcp://localhost:4840", //---服務器連接地址
"userName": "", //----------------------登錄用戶名,如果沒有賬戶和密碼,填空字符串
"password": "", //----------------------賬戶密碼,如果沒有賬戶和密碼,填空字符串
"secPolicy":"None",
"secMode":"None",
"certificate":"",
"privateKey":"",
"timeout":5 //--------------------------方法調用超時時間
}]
/********************************/
},
"DeviceList": [
{
"ProductKey":"",
"DeviceName":"",
"DeviceConfig":{
/****控制臺需要自行錄入部分****/
"serverId":0, //-----------------服務器索引,用來設備與服務器關聯(lián)
"displayName":"" //-----------------設備節(jié)點的displayName
/****************************/
}
},
{
"ProductKey":"",
"DeviceName":"",
"DeviceConfig":{
/****控制臺需要自行錄入部分****/
"serverId":0, //-----------------服務器索引,用來設備與服務器關聯(lián)
"displayName":"Objects" //-------設備節(jié)點的displayName
/****************************/
}
}]
}
三、TSL
{
"profile":{
"productKey": "0LAIGKYmweU"
},
"properties":
[
{
"identifier" : "battery",
"accessMode" : "r",
"dataType":{
"type" : "int",
"specs":{
"max":"100",
"min":"0",
"unit":"%"
}
},
"desc" : "電池電量",
"displayName":"Battery01" /****opcua特有:節(jié)點的displayName****/
},
{
"identifier" : "state",
"accessMode" : "r",
"dataType":{
"type" : "enum",
"specs":{
"0":"正常鎖門",
"2":"門沒有上鎖",
"3":"門內反鎖"
}
},
"desc" : "門狀態(tài)",
"displayName":"DoorState" /****opcua特有:節(jié)點的displayName****/
}
],
"events":
[
{
"identifier" : "action",
"type" : "info",
"outputData":
[
{
"identifier" : "user_type",
"dataType":{
"type":"enum",
"specs":{
"0":"密碼用戶",
"1":"無線用戶",
"3":"卡用戶",
"4":"指紋用戶"
}
},
"index":0 /****opcua特有:參數(shù)索引,在該事件下的序列編號****/
},
{
"identifier" : "state",
"dataType":{
"type":"enum",
"specs":{
"1":"鎖門",
"2":"開門"
}
},
"index":1 /****opcua特有:參數(shù)索引,在該事件下的序列編號****/
}
],
"desc" : "門操作",
"displayName":"Action" /****opcua特有:節(jié)點的displayName****/
}
],
"services":
[
{
"identifier" : "get",
"inputData":
[
"ieee_addr",
"battery",
"state"
],
"outputData":
[
{
"identifier" : "battery",
"dataType":{
"type" : "int",
"specs":{
"max":"100",
"min":"0",
"unit":"%"
}
},
"desc" : "電池電量",
"displayName":"Battery01" /****opcua特有:節(jié)點的displayName****/
},
{
"identifier" : "state",
"dataType":{
"type" : "enum",
"specs":{
"0":"正常鎖門",
"2":"門沒有上鎖",
"3":"門內反鎖"
}
},
"desc" : "門狀態(tài)",
"displayName":"DoorState" /****opcua特有:節(jié)點的displayName****/
}
],
"desc" : "獲取屬性"
},
{
"identifier" : "control",
"inputData":[
{
"identifier" : "action",
"dataType":{
"type":"enum",
"specs":{
"0":"close",
"1":"open"
}
},
"index":0 /****opcua特有:參數(shù)索引,在該方法下的序列編號****/
}
],
"outputData":[
],
"desc" : "門操作",
"displayName":"control" /****opcua特有:節(jié)點的displayName****/
}
]
}
四、部署步驟
導入設備三元組到配置中心
導入config到配置中心
導入tsl到配置中心
執(zhí)行startOpcua.sh
總結
以上是生活随笔為你收集整理的opcuaclient 文档_连接协议-OPC UA Client的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: cpci检索为什么那么慢_索引原理与慢查
- 下一篇: eclipse 注释星号没对齐_36 个