@things-factory/integration-opc 6.1.129 → 6.1.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/engine/task/index.js +1 -1
- package/dist-server/engine/task/index.js.map +1 -1
- package/dist-server/engine/task/opc-ua-start-monitor.js +35 -11
- package/dist-server/engine/task/opc-ua-start-monitor.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/integration/connector/opc-ua.ja.md +4 -6
- package/helps/integration/connector/opc-ua.ko.md +3 -5
- package/helps/integration/connector/opc-ua.md +4 -6
- package/helps/integration/connector/opc-ua.ms.md +5 -7
- package/helps/integration/connector/opc-ua.zh.md +6 -8
- package/package.json +3 -3
- package/server/engine/task/index.ts +1 -1
- package/server/engine/task/opc-ua-start-monitor.ts +45 -16
|
@@ -8,16 +8,14 @@ OPC-UA コネクタを使用すると、OPC-UA サーバに接続し、データ
|
|
|
8
8
|
|
|
9
9
|
## エンドポイント
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
OPC-UA サーバーの接続情報を、以下の形式で指定してください。
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
|
|
14
|
+
opc.tcp://ホスト名:ポート
|
|
15
15
|
|
|
16
16
|
# 例
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
192.168.0.1
|
|
20
|
-
192.168.0.1:4334
|
|
17
|
+
opc.tcp://127.0.0.1:4840
|
|
18
|
+
opc.tcp://192.168.0.100:9999
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
## パラメータ
|
|
@@ -11,13 +11,11 @@ OPC-UA 커넥터를 사용하면 OPC-UA 서버에 연결하고 해당 데이터
|
|
|
11
11
|
다음 형식으로 OPC-UA 서버 연결 정보를 지정하세요:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
|
|
14
|
+
opc.tcp://호스트이름:포트
|
|
15
15
|
|
|
16
16
|
# 예시
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
192.168.0.1
|
|
20
|
-
192.168.0.1:4334
|
|
17
|
+
opc.tcp://127.0.0.1:4840
|
|
18
|
+
opc.tcp://192.168.0.100:9999
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
## 파라미터
|
|
@@ -11,13 +11,11 @@ The OPCUA connector allows you to connect to an OPC-UA server and interact with
|
|
|
11
11
|
Specify the OPC-UA server connection information in the following format:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
|
|
14
|
+
opc.tcp://host_name:port
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
192.168.0.1
|
|
20
|
-
192.168.0.1:4334
|
|
16
|
+
# Example
|
|
17
|
+
opc.tcp://127.0.0.1:4840
|
|
18
|
+
opc.tcp://192.168.0.100:9999
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
## Parameters
|
|
@@ -8,18 +8,16 @@ ified_Architecture) merupakan protokol untuk pertukaran data yang selamat dan bo
|
|
|
8
8
|
|
|
9
9
|
Dengan menggunakan Pemacu OPC-UA, anda boleh menyambungkan ke pelayan OPC-UA dan berinteraksi dengan data.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Endpoint
|
|
12
12
|
|
|
13
|
-
Sila tentukan maklumat sambungan pelayan OPC-UA
|
|
13
|
+
Sila tentukan maklumat sambungan pelayan OPC-UA dalam format berikut:
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
-
|
|
16
|
+
opc.tcp://nama_hos:port
|
|
17
17
|
|
|
18
18
|
# Contoh
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
192.168.0.1
|
|
22
|
-
192.168.0.1:4334
|
|
19
|
+
opc.tcp://127.0.0.1:4840
|
|
20
|
+
opc.tcp://192.168.0.100:9999
|
|
23
21
|
```
|
|
24
22
|
|
|
25
23
|
## Parameter
|
|
@@ -6,18 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
使用 OPC-UA 连接器,您可以连接到 OPC-UA 服务器并与其交互以获取数据。
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 端点
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
请按照以下格式指定 OPC-UA 服务器连接信息:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
|
|
14
|
+
opc.tcp://主机名:端口
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
192.168.0.1
|
|
20
|
-
192.168.0.1:4334
|
|
16
|
+
# 示例
|
|
17
|
+
opc.tcp://127.0.0.1:4840
|
|
18
|
+
opc.tcp://192.168.0.100:9999
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
## 参数
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/integration-opc",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.138",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"clean": "npm run clean:server"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@things-factory/integration-base": "^6.1.
|
|
26
|
+
"@things-factory/integration-base": "^6.1.138",
|
|
27
27
|
"node-opcua": "^2.110.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "6bcb91fa7d1647f069212383bf0ece8039e742e5"
|
|
30
30
|
}
|
|
@@ -1,34 +1,63 @@
|
|
|
1
1
|
import { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'
|
|
2
2
|
import { DataValue } from 'node-opcua'
|
|
3
|
+
import { sleep } from '@things-factory/utils'
|
|
3
4
|
|
|
4
|
-
async function OPCUAStartMonitor(step,
|
|
5
|
+
async function OPCUAStartMonitor(step, context) {
|
|
5
6
|
var {
|
|
6
7
|
connection,
|
|
7
8
|
params: { node, samplingInterval, discardOldest, queueSize }
|
|
8
9
|
} = step
|
|
9
10
|
|
|
11
|
+
const { logger, domain, closures, __opcua_moinitor } = context
|
|
12
|
+
if (!__opcua_moinitor) {
|
|
13
|
+
context.__opcua_moinitor = {}
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
var client = ConnectionManager.getConnectionInstanceByName(domain, connection)
|
|
11
17
|
if (!client) {
|
|
12
18
|
throw new Error(`no connection : ${connection}`)
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
if (!context.__opcua_moinitor[node]) {
|
|
22
|
+
var MONINTORED_VALUE
|
|
23
|
+
context.__opcua_moinitor[node] = async () => {
|
|
24
|
+
while (!MONINTORED_VALUE) {
|
|
25
|
+
await sleep(100)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var monitoringValue = MONINTORED_VALUE
|
|
29
|
+
|
|
30
|
+
MONINTORED_VALUE = null
|
|
31
|
+
|
|
32
|
+
return monitoringValue
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var { startMonitor, stopMonitor } = client
|
|
36
|
+
var monitoredItem = await startMonitor(
|
|
37
|
+
node,
|
|
38
|
+
(dataValue: DataValue) => {
|
|
39
|
+
MONINTORED_VALUE = dataValue?.value.value
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
samplingInterval,
|
|
43
|
+
discardOldest,
|
|
44
|
+
queueSize
|
|
45
|
+
},
|
|
46
|
+
{ logger }
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
closures.push(async () => {
|
|
50
|
+
try {
|
|
51
|
+
monitoredItem && (await stopMonitor(monitoredItem, { logger }))
|
|
52
|
+
} catch (e) {
|
|
53
|
+
logger.error(e)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
17
56
|
}
|
|
18
57
|
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
callback,
|
|
23
|
-
{
|
|
24
|
-
samplingInterval,
|
|
25
|
-
discardOldest,
|
|
26
|
-
queueSize
|
|
27
|
-
},
|
|
28
|
-
{ logger }
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
return { data: monitoredItem }
|
|
58
|
+
var monitoringValue = await context.__opcua_moinitor[node]()
|
|
59
|
+
|
|
60
|
+
return { data: monitoringValue }
|
|
32
61
|
}
|
|
33
62
|
|
|
34
63
|
OPCUAStartMonitor.parameterSpec = [
|