This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const chalk = require("chalk"); | |
| const { | |
| OPCUAServer , | |
| OPCUACertificateManager | |
| } = require("node-opcua"); | |
| const certificateManager = new OPCUACertificateManager({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // node --inspect-brk -r ts-node/register -r source-map-support test_server.ts | |
| import * as path from "path"; | |
| import * as fs from "fs"; | |
| import { promisify } from "util"; | |
| import * as child_process from "child_process"; | |
| import { | |
| makeApplicationUrn, | |
| OPCUAServer, | |
| OPCUAClient, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // mkdir myproj | |
| // cd myproj | |
| // npm init | |
| // npm install node-opcua | |
| // => copy this file | |
| // node --inspect-brk test_server.js | |
| const path = require("path"); | |
| const fs = require("fs"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ts-node | |
| // tslint:disable:no-console | |
| import * as chalk from "chalk"; | |
| import * as fs from "fs"; | |
| import * as path from "path"; | |
| import * as yargs from "yargs"; | |
| import { | |
| ApplicationType, | |
| coerceMessageSecurityMode, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ssh pi@raspberrypi | |
| pi@raspberrypi's password: | |
| Linux raspberrypi 5.4.51-v7l+ #1327 SMP Thu Jul 23 11:04:39 BST 2020 armv7l | |
| The programs included with the Debian GNU/Linux system are free software; | |
| the exact distribution terms for each program are described in the | |
| individual files in /usr/share/doc/*/copyright. | |
| Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | |
| permitted by applicable law. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { OPCUAClient, SecurityPolicy, MessageSecurityMode } = require("node-opcua"); | |
| const endpointUri = process.argv[2] || "opc.tcp://opcuademo.sterfive.com:26543"; | |
| (async () => { | |
| try { | |
| console.log("connecting to ", endpointUri); | |
| const client = OPCUAClient.create({ endpoint_must_exist: false }); | |
| client.on("backoff", () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as fs from 'fs'; | |
| import { OPCUAServer, nodesets, Variant, DataType, StatusCodes } from 'node-opcua'; | |
| (async () => { | |
| const data = await fetch("https://raw.githubusercontent.com/OPCFoundation/UA-Nodeset/2f76ebcfa097cde42414bea08abf04423f30ea4e/PlasticsRubber/GeneralTypes/1.03/Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml"); | |
| const filename = "./Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml"; | |
| fs.writeFileSync(filename, await data.text()); |
OlderNewer