Code Monkey home page Code Monkey logo

opc-gateway's Introduction

opc-gateway

OPC Gateway exposes data from an OPC-UA server via HTTP and WebSocket APIs.

Support

This package is no longer actively maintained.

Run

OPC Gateway is launched from the command line with two arguments: the URL of the OPC server and the port number to use for the web server.

npm start opc.tcp://localhost:26543 3000

Use

// POST this to /api (HTTP)
// or send it to /api (WebSockets)
{
	"readVariableValue":"ns=1;s=FanSpeed",
	"browse": "RootFolder"
}
// Receive this
{
    "readVariableValue": {
        "value": {
            "dataType": "Double",
            "arrayType": "Scalar",
            "value": 972.941836492203
        },
        "statusCode": {
            "value": 0,
            "description": "No Error",
            "name": "Good"
        },
        "sourcePicoseconds": 0,
        "serverPicoseconds": 0
    },
    "browse": [
        {
            "statusCode": {
                "value": 0,
                "description": "No Error",
                "name": "Good"
            },
            "references": [
                {
                    "referenceTypeId": "ns=0;i=40",
                    "isForward": true,
                    "nodeId": "ns=0;i=61",
                    "browseName": {
                        "namespaceIndex": 0,
                        "name": "FolderType"
                    },
                    "displayName": {
                        "text": "FolderType"
                    },
                    "nodeClass": "ObjectType",
                    "typeDefinition": "ns=0;i=0"
                },
                {
                    "referenceTypeId": "ns=0;i=35",
                    "isForward": true,
                    "nodeId": "ns=0;i=85",
                    "browseName": {
                        "namespaceIndex": 0,
                        "name": "Objects"
                    },
                    "displayName": {
                        "text": "Objects"
                    },
                    "nodeClass": "Object",
                    "typeDefinition": "ns=0;i=61"
                }
            ]
        }
    ]
}

Test

// Run the unit tests
npm test

// Run the integration tests
npm run test:mockopc
npm run test:mockapp
npm run test:integration

Troubleshooting

If you get errors related to certificates when starting opc-gateway or running the tests, there is likely a conflict between the version of openssl on your machine and what is required by the node-opcua version used by opc-gateway. The specifics for fixing this will depend on the setup of your machine, but this would be a good starting point.

opc-gateway's People

Contributors

joshmcguigan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.