Description
This is an NPM package for building OPC-UA enabled applications with the Pimoroni Automation HAT.
Installation
npm i --save automationhat-opcua
Usage
The following example creates creates an OPC-UA server called 'AutomationHAT' and runs the myApp function every 500 milliseconds.
GPIO, ADC and the content of the 'variables' object is exposed to OPC-UA.
'use strict'const hat = ; // My OPC variablesconst variables = resetCounter1: 0 ; // My applicationconst myApp = { // Local variables copy const app = ...app_var ; // Log message console; // Reset counter1 if appresetCounter1 === 1 hatgpio; appresetCounter1 = 0; // Return updated application variables return app;} // Start OPC-UA server and run myApphat;