node-opcua-modeler
TypeScript icon, indicating that this package has built-in type declarations

2.124.0 • Public • Published

Node-OPCUA Modeler

Node-opcua-modeler provides a programatic way to conveniently create OPCUA model and nodeset files.

import {
    AddressSpace,
    buildModel,
    nodesets
} from "node-opcua-modeler";
import fs from "fs";

// the namespaceUri
const namespaceUri = "http://acme.com/Boiler/V0";
const version= "1.0.0";

// the nodeset file required by your model
const xmlFiles: string[] = [
    nodesets.standard,
    nodesets.di
];
    
async function createModel(addressSpace: AddressSpace): Promise<void> {
    // create your model here !
}

(async () => {
    try {
        const { markdown, xmlModel, symbols } = await buildModel({
            namespaceUri,
            version,
            xmlFiles,
            createModel
        });
        // save model to a file
        const nodesetFiename = "./MyModel.NodeSet2.xml";
        await fs.promises.writeFile(nodesetFiename, xmlModel, "utf-8");

    } catch (err) {
        console.log("Error", err);
    }
})();

Package Sidebar

Install

npm i node-opcua-modeler

Weekly Downloads

300

Version

2.124.0

License

MIT

Unpacked Size

134 kB

Total Files

65

Last publish

Collaborators

  • erossignon