@things-factory/integration-opc 6.1.122 → 6.1.124
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/connector/opc-ua.js +2 -2
- package/dist-server/engine/connector/opc-ua.js.map +1 -1
- package/dist-server/engine/task/index.js +1 -0
- package/dist-server/engine/task/index.js.map +1 -1
- package/dist-server/engine/task/opc-ua-read.js +41 -3
- package/dist-server/engine/task/opc-ua-read.js.map +1 -1
- package/dist-server/engine/task/utils.js +33 -0
- package/dist-server/engine/task/utils.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/server/engine/connector/opc-ua.ts +2 -2
- package/server/engine/task/index.ts +1 -0
- package/server/engine/task/opc-ua-read.ts +41 -4
- package/server/engine/task/utils.ts +30 -0
- package/translations/en.json +2 -1
- package/translations/ja.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/ms.json +2 -1
- package/translations/zh.json +2 -1
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.124",
|
|
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.123",
|
|
27
27
|
"node-opcua": "^2.110.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "206aa7c2b8d4d5cf73ceb282be740fb6aec44308"
|
|
30
30
|
}
|
|
@@ -77,8 +77,8 @@ export class OPCUAConnector implements Connector {
|
|
|
77
77
|
|
|
78
78
|
try {
|
|
79
79
|
ConnectionManager.addConnectionInstance(config, {
|
|
80
|
-
read: async function (node, { logger }): Promise<DataValue> {
|
|
81
|
-
const dataValue = await session.read({ nodeId: node, attributeId:
|
|
80
|
+
read: async function (node, attribute, { logger }): Promise<DataValue> {
|
|
81
|
+
const dataValue = await session.read({ nodeId: node, attributeId: Number(attribute) })
|
|
82
82
|
if (dataValue.statusCode !== StatusCodes.Good) {
|
|
83
83
|
logger.info('Could not read ', node)
|
|
84
84
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'
|
|
2
|
-
import { DataValue } from 'node-opcua'
|
|
2
|
+
import { DataType, DataValue, AttributeIds } from 'node-opcua'
|
|
3
|
+
import { DataTypeString } from './utils'
|
|
3
4
|
|
|
4
5
|
async function OPCUARead(step, { logger, domain }) {
|
|
5
6
|
var {
|
|
6
7
|
connection,
|
|
7
|
-
params: { node }
|
|
8
|
+
params: { node, attribute }
|
|
8
9
|
} = step
|
|
9
10
|
|
|
10
11
|
var client = ConnectionManager.getConnectionInstanceByName(domain, connection)
|
|
@@ -17,11 +18,11 @@ async function OPCUARead(step, { logger, domain }) {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
var { read } = client
|
|
20
|
-
var content: DataValue = await read(node, { logger })
|
|
21
|
+
var content: DataValue = await read(node, attribute, { logger })
|
|
21
22
|
|
|
22
23
|
return {
|
|
23
24
|
data: {
|
|
24
|
-
dataType: content?.value.dataType,
|
|
25
|
+
dataType: DataTypeString[content?.value.dataType],
|
|
25
26
|
value: content?.value.value
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -32,6 +33,42 @@ OPCUARead.parameterSpec = [
|
|
|
32
33
|
type: 'string',
|
|
33
34
|
name: 'node',
|
|
34
35
|
label: 'node'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'select',
|
|
39
|
+
label: 'attribute',
|
|
40
|
+
name: 'attribute',
|
|
41
|
+
property: {
|
|
42
|
+
options: [
|
|
43
|
+
{ display: 'Value', value: AttributeIds.Value },
|
|
44
|
+
{ display: 'DataType', value: AttributeIds.DataType },
|
|
45
|
+
{ display: 'NodeId', value: AttributeIds.NodeId },
|
|
46
|
+
{ display: 'NodeClass', value: AttributeIds.NodeClass },
|
|
47
|
+
{ display: 'BrowseName', value: AttributeIds.BrowseName },
|
|
48
|
+
{ display: 'DisplayName', value: AttributeIds.DisplayName },
|
|
49
|
+
{ display: 'Description', value: AttributeIds.Description },
|
|
50
|
+
{ display: 'WriteMask', value: AttributeIds.WriteMask },
|
|
51
|
+
{ display: 'UserWriteMask', value: AttributeIds.UserWriteMask },
|
|
52
|
+
{ display: 'IsAbstract', value: AttributeIds.IsAbstract },
|
|
53
|
+
{ display: 'Symmetric', value: AttributeIds.Symmetric },
|
|
54
|
+
{ display: 'InverseName', value: AttributeIds.InverseName },
|
|
55
|
+
{ display: 'ContainsNoLoops', value: AttributeIds.ContainsNoLoops },
|
|
56
|
+
{ display: 'EventNotifier', value: AttributeIds.EventNotifier },
|
|
57
|
+
{ display: 'ValueRank', value: AttributeIds.ValueRank },
|
|
58
|
+
{ display: 'ArrayDimensions', value: AttributeIds.ArrayDimensions },
|
|
59
|
+
{ display: 'AccessLevel', value: AttributeIds.AccessLevel },
|
|
60
|
+
{ display: 'UserAccessLevel', value: AttributeIds.UserAccessLevel },
|
|
61
|
+
{ display: 'MinimumSamplingInterval', value: AttributeIds.MinimumSamplingInterval },
|
|
62
|
+
{ display: 'Historizing', value: AttributeIds.Historizing },
|
|
63
|
+
{ display: 'Executable', value: AttributeIds.Executable },
|
|
64
|
+
{ display: 'UserExecutable', value: AttributeIds.UserExecutable },
|
|
65
|
+
{ display: 'DataTypeDefinition', value: AttributeIds.DataTypeDefinition },
|
|
66
|
+
{ display: 'RolePermissions', value: AttributeIds.RolePermissions },
|
|
67
|
+
{ display: 'UserRolePermissions', value: AttributeIds.UserRolePermissions },
|
|
68
|
+
{ display: 'AccessRestrictions', value: AttributeIds.AccessRestrictions },
|
|
69
|
+
{ display: 'AccessLevelEx', value: AttributeIds.AccessLevelEx }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
35
72
|
}
|
|
36
73
|
]
|
|
37
74
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DataType } from 'node-opcua'
|
|
2
|
+
|
|
3
|
+
export const DataTypeString = {
|
|
4
|
+
[DataType.Null]: 'Null',
|
|
5
|
+
[DataType.Boolean]: 'Boolean',
|
|
6
|
+
[DataType.SByte]: 'SByte',
|
|
7
|
+
[DataType.Byte]: 'Byte',
|
|
8
|
+
[DataType.Int16]: 'Int16',
|
|
9
|
+
[DataType.UInt16]: 'UInt16',
|
|
10
|
+
[DataType.Int32]: 'Int32',
|
|
11
|
+
[DataType.UInt32]: 'UInt32',
|
|
12
|
+
[DataType.Int64]: 'Int64',
|
|
13
|
+
[DataType.UInt64]: 'UInt64',
|
|
14
|
+
[DataType.Float]: 'Float',
|
|
15
|
+
[DataType.Double]: 'Double',
|
|
16
|
+
[DataType.String]: 'String',
|
|
17
|
+
[DataType.DateTime]: 'DateTime',
|
|
18
|
+
[DataType.Guid]: 'Guid',
|
|
19
|
+
[DataType.ByteString]: 'ByteString',
|
|
20
|
+
[DataType.XmlElement]: 'XmlElement',
|
|
21
|
+
[DataType.NodeId]: 'NodeId',
|
|
22
|
+
[DataType.ExpandedNodeId]: 'ExpandedNodeId',
|
|
23
|
+
[DataType.StatusCode]: 'StatusCode',
|
|
24
|
+
[DataType.QualifiedName]: 'QualifiedName',
|
|
25
|
+
[DataType.LocalizedText]: 'LocalizedText',
|
|
26
|
+
[DataType.ExtensionObject]: 'ExtensionObject',
|
|
27
|
+
[DataType.DataValue]: 'DataValue',
|
|
28
|
+
[DataType.Variant]: 'Variant',
|
|
29
|
+
[DataType.DiagnosticInfo]: 'DiagnosticInfo'
|
|
30
|
+
}
|
package/translations/en.json
CHANGED
package/translations/ja.json
CHANGED
package/translations/ko.json
CHANGED
package/translations/ms.json
CHANGED
package/translations/zh.json
CHANGED