node-opcua-samples 2.52.0 → 2.56.0
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/LICENSE +20 -20
- package/bin/createOPCUACertificate.cmd +5 -5
- package/bin/create_certificates.js +2 -2
- package/bin/crypto_create_CA.js +2 -2
- package/bin/demo_server_with_alarm.js +51 -51
- package/bin/di_server.js +318 -318
- package/bin/findServersOnNetwork.js +32 -32
- package/bin/interactive_client.js +758 -758
- package/bin/machineryServer.js +83 -83
- package/bin/more.js +40 -40
- package/bin/node-opcua.js +2 -2
- package/bin/opcua_interceptor.js +135 -135
- package/bin/simple_client.js +830 -830
- package/bin/simple_server.js +588 -588
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
SET BASE=%~dp0%
|
|
3
|
-
echo applicationUri %1
|
|
4
|
-
echo output %2
|
|
5
|
-
|
|
1
|
+
|
|
2
|
+
SET BASE=%~dp0%
|
|
3
|
+
echo applicationUri %1
|
|
4
|
+
echo output %2
|
|
5
|
+
|
|
6
6
|
node %BASE%\crypto_create_CA.js certificate --selfSigned --applicationUri %1 -o %2
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
require("node-opcua-pki/bin/crypto_create_CA");
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
require("node-opcua-pki/bin/crypto_create_CA");
|
package/bin/crypto_create_CA.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
require("node-opcua-pki/bin/crypto_create_CA");
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
require("node-opcua-pki/bin/crypto_create_CA");
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const { OPCUAServer, nodesets } = require("node-opcua");
|
|
5
|
-
const { construct_demo_alarm_in_address_space } = require("node-opcua-address-space/testHelpers");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const nodeset_filenames = [nodesets.standard];
|
|
9
|
-
|
|
10
|
-
const port = 4334;
|
|
11
|
-
|
|
12
|
-
const server = new OPCUAServer({
|
|
13
|
-
port, // the port of the listening socket of the server
|
|
14
|
-
resourcePath: "/UA/MyLittleServer", // this path will be added to the endpoint resource name
|
|
15
|
-
buildInfo: {
|
|
16
|
-
productName: "urn:DemoAlarmServer",
|
|
17
|
-
buildNumber: "1",
|
|
18
|
-
buildDate: new Date(2016, 9, 27)
|
|
19
|
-
},
|
|
20
|
-
nodeset_filename: nodeset_filenames
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
function post_initialize() {
|
|
24
|
-
function construct_my_address_space(server) {
|
|
25
|
-
const addressSpace = server.engine.addressSpace;
|
|
26
|
-
|
|
27
|
-
const data = {};
|
|
28
|
-
construct_demo_alarm_in_address_space(data, addressSpace);
|
|
29
|
-
|
|
30
|
-
let time = 1;
|
|
31
|
-
function simulate_variation() {
|
|
32
|
-
const value = (1.0 + Math.sin((time / 360) * 3)) / 2.0;
|
|
33
|
-
data.tankLevel.setValueFromSource({ dataType: "Double", value: value });
|
|
34
|
-
|
|
35
|
-
data.tankLevel2.setValueFromSource({ dataType: "Double", value: value });
|
|
36
|
-
|
|
37
|
-
time += 1;
|
|
38
|
-
}
|
|
39
|
-
setInterval(simulate_variation, 200);
|
|
40
|
-
simulate_variation();
|
|
41
|
-
}
|
|
42
|
-
construct_my_address_space(server);
|
|
43
|
-
|
|
44
|
-
server.start(function () {
|
|
45
|
-
console.log("Server is now listening ... ( press CTRL+C to stop)");
|
|
46
|
-
console.log("port ", server.endpoints[0].port);
|
|
47
|
-
const endpointUrl = server.getEndpointUrl();
|
|
48
|
-
console.log(" the primary server endpoint url is ", endpointUrl);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
server.initialize(post_initialize);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { OPCUAServer, nodesets } = require("node-opcua");
|
|
5
|
+
const { construct_demo_alarm_in_address_space } = require("node-opcua-address-space/testHelpers");
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const nodeset_filenames = [nodesets.standard];
|
|
9
|
+
|
|
10
|
+
const port = 4334;
|
|
11
|
+
|
|
12
|
+
const server = new OPCUAServer({
|
|
13
|
+
port, // the port of the listening socket of the server
|
|
14
|
+
resourcePath: "/UA/MyLittleServer", // this path will be added to the endpoint resource name
|
|
15
|
+
buildInfo: {
|
|
16
|
+
productName: "urn:DemoAlarmServer",
|
|
17
|
+
buildNumber: "1",
|
|
18
|
+
buildDate: new Date(2016, 9, 27)
|
|
19
|
+
},
|
|
20
|
+
nodeset_filename: nodeset_filenames
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function post_initialize() {
|
|
24
|
+
function construct_my_address_space(server) {
|
|
25
|
+
const addressSpace = server.engine.addressSpace;
|
|
26
|
+
|
|
27
|
+
const data = {};
|
|
28
|
+
construct_demo_alarm_in_address_space(data, addressSpace);
|
|
29
|
+
|
|
30
|
+
let time = 1;
|
|
31
|
+
function simulate_variation() {
|
|
32
|
+
const value = (1.0 + Math.sin((time / 360) * 3)) / 2.0;
|
|
33
|
+
data.tankLevel.setValueFromSource({ dataType: "Double", value: value });
|
|
34
|
+
|
|
35
|
+
data.tankLevel2.setValueFromSource({ dataType: "Double", value: value });
|
|
36
|
+
|
|
37
|
+
time += 1;
|
|
38
|
+
}
|
|
39
|
+
setInterval(simulate_variation, 200);
|
|
40
|
+
simulate_variation();
|
|
41
|
+
}
|
|
42
|
+
construct_my_address_space(server);
|
|
43
|
+
|
|
44
|
+
server.start(function () {
|
|
45
|
+
console.log("Server is now listening ... ( press CTRL+C to stop)");
|
|
46
|
+
console.log("port ", server.endpoints[0].port);
|
|
47
|
+
const endpointUrl = server.getEndpointUrl();
|
|
48
|
+
console.log(" the primary server endpoint url is ", endpointUrl);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
server.initialize(post_initialize);
|