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

grunig-nodes

v1.2.22

Published

Grünig Nodes Library

Downloads

1,057

Readme

Description

These are nodes for Grunig.

All the nodes require an additional node for the functions (mqtt-node, opcua-client, influxdb out, modbus-read).

Every node (except for the OpcUa-Read) also requires an function node with the code in the node-description to get the right format for node-input.

There is an example flow for the relevant nodes.

Node-Red:

relevant Nodes

Reads data from Modbus and puts it in MQTT

Transfer of Values

The values Payload, Communication, and MachineID must be passed through a Function Node.

Code:

    let value = msg.payload;
    msg.payload = {};
    msg.payload.Value = value;
    msg.payload.MachineID = flow.get("fMachineID");
    msg.payload.Communication = flow.get("fCommunication");
    return msg;

MQTT Path

Here must be the MQTT path where the data should be written.

Example:

Error

Format

The desired format can be selected.

payload

Only the payload value is output.

Example:

Main_Warning = 0

unit

The payload value and a unit are output.

Example:

ProgramNumber = {"value":0,"unit":"#"}

Communication

It can be selected whether the values are set to 0 if there is no active connection to the machine.

Value should be retained if connection is lost:

ignore

Value should be set to 0 if connection is lost:

consider

Data x

Here come the variable names after the Topic-Path.

The square brackets must specify the array in which the value is stored.

This usually corresponds to the last two digits of the Modbus address.

Digit example:

Modbus address: 32110  --> last two digits = [10]

Input:

Main_Warning [10]

Format = unit

If the format is unit, then the unit must be specified in another square bracket.

Example:

ProgramNumber [30] [#]

Example Path

The path is constructed as follows:

"GRUNIG/MachineID/" + MQTT Path + Data x

In the example, we have Error as the MQTT Path and Main_Warning as Data x.

This means, in the example, the value will be written to this path in the MQTT broker:

GRUNIG/MachineID/Error/Main_Warning

Reads OpcUa data and puts it in MQTT

Path

Here must be the path of the OpcUa variables (with "." at the end).

Example:

ns=6;s =:: Industry40:Interface.State.

Value

Here a specific value can be entered to be written to the variables.

If the value should be taken from the payload, leave it empty.

Data x

Here come the names of the variables that come after the path in the OpcUa server.

The data type of each variable must be written in square brackets "[ ]" after the variable name.

Example:

bCommunication [Boolean]

Permissible Variables

| Type | Description | |---------------------|--------------------------| | Int8 | 8-Bit Integer | | Int16 | 16-Bit Integer | | Int32 | 32-Bit Integer | | Int64 | 64-Bit Integer | | UInt8 | 8-Bit Unsigned Integer | | UInt16 | 16-Bit Unsigned Integer | | UInt32 | 32-Bit Unsigned Integer | | UInt64 | 64-Bit Unsigned Integer | | Byte | Byte | | SByte | Signed Byte | | Float | Floating Point Number | | Double | Double | | Boolean | Boolean | | String | String | | LocalizedText | Localized Text | | DateTime | Date and Time | | Int8 Array | Array of Int8 | | Int16 Array | Array of Int16 | | Int32 Array | Array of Int32 | | UInt8 Array | Array of UInt8 | | UInt16 Array | Array of UInt16 | | UInt32 Array | Array of UInt32 | | Byte Array | Array of Byte | | SByte Array | Array of Signed Byte | | String Array | Array of Strings | | Float Array | Array of Floats | | Double Array | Array of Doubles | | Boolean Array | Array of Booleans | | ExtensionObject | Extension Object | | ExtensionObject Array | Array of Extension Objects |

Writes MQTT to InfluxDB or OpcUa to MQTT

Transfer of Values

The values Payload and MachineID must be passed through a Function Node.

Code:

let value = msg.payload;
msg.payload = {};
msg.payload.MachineID = flow.get("fMachineID");
msg.payload.Value = value;
return msg;

Path Construction

The path is constructed as follows:

"GRUNIG/MachineID/" + Topic-Path + Data x In the example, we have /State as the Topic-Path and MachineState as Data x.

This means, in the example, the value will be written to this path in the MQTT broker:

GRUNIG/MachineID/State/MachineState

Topic-Path

Here comes the path from MQTT, even if >write InfluxDB is selected.

Example:

/State

Action

You can choose whether to write to MQTT or to InfluxDB.

Format

If write MQTT is selected in Action, then the format can be chosen here.

Format Example: Alarm message

"value": "1", "description": "ALARM_STATE_ACTIVE"

Format Example: Unit

"value": "5", "unit": "s",

Type

If write InfluxDB is selected in Action, then the type can be determined here.

Example: State

MachineState: 1 "_type": State

Data x

Here come the variable names after the Topic-Path.

Example:

MachineState

Reads the MQTT from the input JSON and puts it in InfluxDB format. Reads the Alarm-Input Bitwise.

Alarm List

This is where alarm messages are specified.

  "Enable": true,
   "Alarm": "Main A00",
   "Message": [
       "Error 0",
       "Fehler 0"
   ]

Enable

The Enable parameter is used to disable individual alarms.

true: Alarm is triggered

false: Alarm is not triggered

Alarm

Name of the alarm.

"Main A00" 

Message

The first string contains the error message in English.

"Error 0" 

The second string contains the error message in German.

"Fehler 0" 

Path MQTT

This specifies the path from the MQTT broker for the alarms.

Error/Main_Warning