npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-opcua-isa95

v0.2.0

Published

ISA95 server extension for node-opcua

Downloads

17

Readme

OPC UA NPM version NPM download Build Status HitCount

ISA95 Common Object Model

an extension package for node-opcua

This NPM module implements the ISA95 extensions for node-opcua, to ease the creation of ISA95 OPCUA server, in the industrial world.

It follows the specification in OPCUA ISA95 Specification

installation

  • install node-opcua-isa95 module along side node-opcua
npm install node-opcua  --save
npm install node-opcua-isa95 --save
  • use require("node-opcua-isa95")(opcua); to enrich node-opcua with the ISA95 add-on
var opcua = require("node-opcua");

// add server ISA95 extension to node-opcua
require("node-opcua-isa95")(opcua);


var xmlFiles = [
    opcua.standard_nodeset_file,
    opcua.ISA95.nodeset_file
];

var server = new opcua.OPCUAServer({
    nodeset_filename: xmlFiles,
// details left out for clarity
});


function post_initialize() {
    console.log("initialized");
    var addressSpace = server.engine.addressSpace;

    // add your ISA95 node in the addressSpace here
    server.start(function() {
        console.log("Server is now listening ... ( press CTRL+C to stop)");
        console.log("port ", server.endpoints[0].port);
        var endpointUrl = server.endpoints[0].endpointDescriptions()[0].endpointUrl;
        console.log(" the primary server endpoint url is ", endpointUrl );
    });
}

server.initialize(post_initialize);

Projects using node-opcua-isa95

ISA95 extension is ready to use with Node-RED via node-red-contrib-iiot-opcua

API documentation

Equipment

ISA 95 logical Equipments can be added to the addressSpace and defined using the following API.

opcua.AddressSpace#addEquipmentClassType(options)

add a new EquipmentClassType to the addressSpace

| options | type | description | |-----------------------------------|-------------------------------|--------------------------------------------------------------------| | options.browseName | {String/QualifiedName} | the browseName of the new node equipment | | [options.equipmentLevel] | {EquipmentLevel} | the EquipmentLevel |

example

var weldingRobotClassType = addressSpace.addEquipmentClassType({
    browseName: "WeldingRobotClassType",
    equipmentLevel: opcua.ISA95.EquipmentLevel.EquipmentModule
});

opcua.AddressSpace#addEquipmentType(options)

add a new EquipmentType to the addressSpace

| options | type | description | |-----------------------------------|-------------------------------|--------------------------------------------------------------------| | options.browseName | {String/QualifiedName} | the browseName of the new node equipment | | [options.equipmentLevel] | {EquipmentLevel} | the EquipmentLevel | | [options.definedByEquipmentClass | {UAObjectType/ Array } | a collection of EquipmentClassType that define this new EquipmentType |

Example of addEquipmentClassType

var multiPurposeRobotType = addressSpace.addEquipmentClassType({
    browseName: "MultiPurposeRobotType",
    definedByEquipmentClass: [
        weldingRobotClassType,
        assemblingRobotClassType,
    ]
});

opcua.AddressSpace#addEquipment(options)

add a new equipment to the addressSpace

| options | type | description | |-----------------------------------|-------------------------------|--------------------------------------------------------------------| | options.browseName | {String/QualifiedName} | the browseName of the new node equipment | | [options.typeDefinition] | {String/UAObjectType} | "EquipmentType" the ISA95 type of the equipment to instantiate. if not specified, EquipmentType will be used the provided typeDefinition must be a sub type of "EquipmentType". | | [options.definedByEquipmentClass] | {UAObjectType/Array} | The class that define the EquipmentType. It must be a subtype of "EquipmentClassType" | | [options.containedByEquipment] | {UAObject} | the equipment that contains the created equipment. equipment must have a typeDefinition of type "EquipmentType" | | [options.organizedBy] | {UAObject} | a folder {FolderType} that organises the created equipment |

Example of addEquipment

var weldingRobot = addressSpace.addEquipment({
  browseName: "WeldingRobot",
});

var robotController = addressSpace.addEquipment({
  browseName: "RobotController",
  containedByEquipment: weldingRobot
});

var robotArm = addressSpace.addEquipment({
  browseName: "RobotArm",
  containedByEquipment: weldingRobot
});

PhysicalAsset

opcua.AddressSpace#addPhysicalAssetClassType

opcua.AddressSpace#addPhysicalAssetType

Example of addPhysicalAssetType

var fanuc_robotArcMate = addressSpace.addPhysicalAssetType({
    browseName: "ArcMate 100iB/6S i",
    modelNumber: "ArcMate 100iB/6S i",
    manufacturer: {
        dataType: "String",
        value: { dataType: opcua.DataType.String, value: "Fanuc Inc"}
    }
});

addressSpace.addISA95Attribute({
    ISA95AttributeOf: fanuc_robotArcMate,
    browseName: "Weight",
    description: "Robot mass in kg",
    dataType:"Double",
    value: { dataType: opcua.DataType.Double, value: 135 },
    modellingRule: "Mandatory"
});

addressSpace.addISA95Attribute({
    ISA95AttributeOf: fanuc_robotArcMate,
    browseName: "Payload",
    description: "Payload in kg",
    dataType:"Double",
    value: { dataType: opcua.DataType.Double, value: 6 },
    modellingRule: "Mandatory"
});
addressSpace.addISA95Attribute({
    ISA95AttributeOf: fanuc_robotArcMate,
    browseName: "Repeatability",
    description: "+/-",
    dataType:"Double",
    value: { dataType: opcua.DataType.Double, value: 0.08 },
    modellingRule: "Mandatory"
});

AddressSpace#addPhysicalAsset

Example of PhysicalAssetSet

// create the physical asset set storage  folder
// where all our main assets will be listed
var namespace = addressSpace.getOwnNamespace();
var physicalAssetSet = namespace.addObject({
    browseName: "PhysicalAssetSet",
    typeDefinition: "FolderType",
    organizedBy: addressSpace.rootFolder.objects,
});

var robot_instance = addressSpace.addPhysicalAsset({
    organizedBy:     physicalAssetSet,
    typeDefinition:  fanuc_robotArcMate,
    definedByPhysicalAssetClass: "PhysicalAssetClassType",
    browseName: "FANUC Arc Mate 100iB/6S i - 001",
    implementationOf: robotArm,
    vendorId: {
        dataType: "String",
        value: { dataType: opcua.DataType.String, value: "RobotWox" }
    }
});

Misc

opcua.AddressSpace#addISA95Attribute

| options | type | description | |-----------------------------------|-------------------------------|--------------------------------------------------------------------| | options.browseName | {String/QualifiedName} | the browseName of the new node equipment | | options.dataType | {String/UADataType} | the Variable DataType | | options.value | {Variant} | the Variable Value | | options.ISA95AttributeOf | {UAObject/UAObjecType} | the parent node | | [options.modellingRule] | {String} | "Mandatory" or "Optional"| | [options.typeDefinition] | {UAVariableType} ||

returns a ```opcua.UAVariable````

opcua.AddressSpace#addISA95Property

| options | type | description | |-----------------------------------|-------------------------------|--------------------------------------------------------------------| | options.browseName | {String/QualifiedName} | the browseName of the new node equipment | | options.dataType | {String/UADataType} | the Variable DataType | | options.value | {Variant} | the Variable Value | | options.ISA95PropertyOf | {UAObject/UAObjecType} | the parent node | | [options.modellingRule] | {String} | "Mandatory" or "Optional"| | [options.typeDefinition] | {UAVariableType} ||

returns a ```opcua.UAVariable````

opcua.AddressSpace#addISA95ClassProperty

| options | type | description | |-----------------------------------|-------------------------------|--------------------------------------------------------------------| | options.browseName | {String/QualifiedName} | the browseName of the new node equipment | | options.dataType | {String/UADataType} | the Variable DataType | | options.value | {Variant} | the Variable Value | | options.ISA95ClassPropertyOf | {UAObject/UAObjecType} | the parent node | | [options.modellingRule] | {String} | "Mandatory" or "Optionnal"| | [options.typeDefinition] | {UAVariableType} | |

returns a ```opcua.UAVariable````

opcua.ISA95.EquipmentLevel

(see Table 36 – ISA95EquipmentElementLevelEnum Values )

This DataType is an enumeration that defines the equipment element levels defined in ISA-95. Its values are defined in a below table.

| Value | Description | |-------------|-------------| | Enterprise | An enterprise is a collection of sites and areas and represents the top level of a role based equipment hierarchy.| | Site | A site is a physical, geographical, or logical grouping determined by the enterprise. It may contain areas, production lines, process cells, and production units. | | Area | An area is a physical, geographical, or logical grouping determined by the site. It may contain work centres such as process cells, production units, production lines, and storage zones. | | ProcessCell | Process cells are the low level of equipment typically scheduled by the Level 4 and Level 3 functions for batch manufacturing processes. | | Unit | Units are low level of equipment typically scheduled by the Level 4 and Level 3 functions for batch manufacturing processes and continuous manufacturing processes. | | ProductionLine | Production lines are low levels of equipment typically scheduled by the Level 4 or Level 3 functions for discrete manufacturing processes. | | WorkCell | Work cells are low levels of equipment typically scheduled by the Level 4 or Level 3 functions for discrete manufacturing processes. | | ProductionUnit | Production units are the lowest level of equipment typically scheduled by the Level 4 or Level functions for continuous manufacturing processes. | | StorageZone | Storage zones are low level of material movement equipment typically scheduled by the Level 4 and Level 3 functions for discrete, batch and continuous manufacturing processes. | | StorageUnit | Storage units are low level of material movement equipment typically scheduled by the Level 4 and Level 3 functions for discrete, batch and continuous manufacturing processes. | WorkCenter | Work centres are typically the grouping of equipment scheduled by the Level 4 or Level 3 functions. | | WorkUnit | A work unit is any element of the equipment hierarchy under a work centre. Work units are the lowest form of elements in an equipment hierarchy that are typically scheduled by Level 3 functions.| | EquipmentModule| An equipment module entity is an engineered subdivision of a process cell, a unit, or another equipment module. | | ControlModule | A control module entity is an engineered subdivision of a process cell, a unit, an equipment module, or another control module. | | Other | non of the above |

license

MIT

Copyright

Copyright 2016 - Etienne Rossignon