Skip to content

Instantly share code, notes, and snippets.

@erossignon
Created December 16, 2018 15:20
Show Gist options
  • Save erossignon/308328cf4e4d80e26a1d648aae37686b to your computer and use it in GitHub Desktop.
Save erossignon/308328cf4e4d80e26a1d648aae37686b to your computer and use it in GitHub Desktop.
Basic node-opcua client in typescript
import { OPCUAClient } from "../packages/node-opcua-client";
async function main() {
try {
const endpointUrl2 = "opc.tcp://localhost:48010";
const client = OPCUAClient.create({
endpoint_must_exist: false
});
await client.connect(endpointUrl2);
const session = await client.createSession();
await session.close();
await client.disconnect();
}
catch (err) {
console.log(err.message);
process.exit(0);
}
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment