1.2.24 • Published 8 months ago

grunig-nodes v1.2.24

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

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

TypeDescription
Int88-Bit Integer
Int1616-Bit Integer
Int3232-Bit Integer
Int6464-Bit Integer
UInt88-Bit Unsigned Integer
UInt1616-Bit Unsigned Integer
UInt3232-Bit Unsigned Integer
UInt6464-Bit Unsigned Integer
ByteByte
SByteSigned Byte
FloatFloating Point Number
DoubleDouble
BooleanBoolean
StringString
LocalizedTextLocalized Text
DateTimeDate and Time
Int8 ArrayArray of Int8
Int16 ArrayArray of Int16
Int32 ArrayArray of Int32
UInt8 ArrayArray of UInt8
UInt16 ArrayArray of UInt16
UInt32 ArrayArray of UInt32
Byte ArrayArray of Byte
SByte ArrayArray of Signed Byte
String ArrayArray of Strings
Float ArrayArray of Floats
Double ArrayArray of Doubles
Boolean ArrayArray of Booleans
ExtensionObjectExtension Object
ExtensionObject ArrayArray 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
1.2.8

9 months ago

1.2.7

9 months ago

1.2.12

9 months ago

1.2.13

9 months ago

1.2.10

9 months ago

1.2.11

9 months ago

1.2.16

9 months ago

1.2.17

9 months ago

1.2.14

9 months ago

1.2.15

9 months ago

1.2.18

9 months ago

1.2.19

9 months ago

1.2.20

9 months ago

1.2.23

8 months ago

1.2.24

8 months ago

1.2.21

9 months ago

1.2.22

9 months ago

1.2.9

9 months ago

1.2.0

11 months ago

1.2.6

9 months ago

1.2.5

10 months ago

1.2.4

10 months ago

1.2.3

10 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.1.39

11 months ago

1.1.41

11 months ago

1.1.40

11 months ago

1.1.42

11 months ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.30

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.38

11 months ago

1.1.37

11 months ago

1.1.36

1 year ago

1.1.35

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.23

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.2

1 year ago

1.0.22

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago