node-opcua-isa95

ISA95 server extension for node-opcua

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-REDvia 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

optionstypedescription
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

optionstypedescription
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

optionstypedescription
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

optionstypedescription
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

optionstypedescription
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

optionstypedescription
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.

ValueDescription
EnterpriseAn enterprise is a collection of sites and areas and represents the top level of a role based equipment hierarchy.
SiteA site is a physical, geographical, or logical grouping determined by the enterprise. It may contain areas, production lines, process cells, and production units.
AreaAn 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.
ProcessCellProcess cells are the low level of equipment typically scheduled by the Level 4 and Level 3 functions for batch manufacturing processes.
UnitUnits are low level of equipment typically scheduled by the Level 4 and Level 3 functions for batch manufacturing processes and continuous manufacturing processes.
ProductionLineProduction lines are low levels of equipment typically scheduled by the Level 4 or Level 3 functions for discrete manufacturing processes.
WorkCellWork cells are low levels of equipment typically scheduled by the Level 4 or Level 3 functions for discrete manufacturing processes.
ProductionUnitProduction units are the lowest level of equipment typically scheduled by the Level 4 or Level functions for continuous manufacturing processes.
StorageZoneStorage 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.
StorageUnitStorage 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.
WorkCenterWork centres are typically the grouping of equipment scheduled by the Level 4 or Level 3 functions.
WorkUnitA 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.
EquipmentModuleAn equipment module entity is an engineered subdivision of a process cell, a unit, or another equipment module.
ControlModuleA control module entity is an engineered subdivision of a process cell, a unit, an equipment module, or another control module.
Othernon of the above
license

MIT

Copyright

Copyright 2016 - Etienne Rossignon

Repository

https://github.com/node-opcua/node-opcua-isa95


上一篇:jsmodbus
下一篇:amble

相关推荐

官方社区

扫码加入 JavaScript 社区