Registry / devops / node-red-contrib-s7

node-red-contrib-s7

JSON →
library3.1.3jsnpmunverified

node-red-contrib-s7 is a Node-RED package designed to facilitate interaction with Siemens S7 series Programmable Logic Controllers (PLCs), including S7-300, S7-400, S7-1200, and S7-1500. Currently stable at version 3.1.3, this package offers a robust solution for integrating industrial automation into Node-RED flows. It provides specialized nodes—'S7 Endpoint' for connection management and variable configuration, and 'S7 In' for reading data—that are accessed directly through the Node-RED editor palette. Its key differentiators include a custom, simplified variable addressing scheme, support for various PLC data types (Boolean, Byte, Char, Int, DInt, Real, String), and flexible data retrieval modes (single variable, all variables per message, or all variables as a single object). The package is actively maintained, with updates typically aligned with Node-RED and Node.js LTS releases. Users should be aware of specific Node.js and Node-RED version requirements for compatibility. It originates from the ST-One project, emphasizing its industrial application focus.

npm install node-red-contrib-s7
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-S
N
node-red-contrib-s7
devopsjavascriptv3.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

S7 Endpoint (Node-RED Node)
Available in the Node-RED palette after installation. Drag and drop to configure a PLC connection.
import { S7Endpoint } from 'node-red-contrib-s7'
This package provides Node-RED nodes, not directly importable JavaScript modules. Functionality is accessed exclusively via the Node-RED editor palette and visual flow configuration.
S7 In (Node-RED Node)
Available in the Node-RED palette after installation. Drag and drop to read variables from a configured S7 Endpoint.
const S7In = require('node-red-contrib-s7').S7In
Node-RED nodes are configured and used within the Node-RED flow editor. Direct programmatic import/require in JavaScript files is not the intended usage model for consuming the node's functionality.
S7 Out (Node-RED Node)
Available in the Node-RED palette after installation (for writing data to PLC variables). Drag and drop into a flow.
import * as S7 from 'node-red-contrib-s7'
While the README excerpt focuses on 'S7 In', a corresponding 'S7 Out' node is standard for bidirectional PLC communication. All node interactions are visual within the Node-RED UI.

Installs the Node-RED S7 PLC communication nodes. This then describes the process of configuring 'S7 Endpoint' and 'S7 In' nodes within the Node-RED editor to establish a connection and read PLC variables.

npm install node-red-contrib-s7 // After successful installation, open your Node-RED editor (e.g., http://localhost:1880). // The S7 nodes ('S7 Endpoint', 'S7 In', 'S7 Out') will appear in the Node-RED palette. // // 1. Drag an 'S7 Endpoint' node onto your flow canvas. // 2. Double-click the 'S7 Endpoint' node to configure its properties: // - Set the PLC's IP Address (e.g., '192.168.0.100'). // - Configure Rack and Slot if necessary (default 0,0 for S7-1200/1500). // - Add variables you want to read/write, specifying their Name and custom Address (e.g., 'MyTemperature', 'DB1,REAL0'). // 3. Drag an 'S7 In' node onto your flow. // 4. Double-click the 'S7 In' node, select the configured 'S7 Endpoint' from the dropdown. // 5. Choose a 'Mode' (e.g., 'Single variable') and select one of the variables configured in the endpoint (e.g., 'MyTemperature'). // 6. Connect the 'S7 In' node's output to a 'debug' node to view the PLC data in the Node-RED debug sidebar. // 7. Deploy the flow.
Debug
Known issues
gotchaWhen using the 'All variables, one per message' mode in the S7 In node without 'diff' checked, be cautious of potential high message rates. This can flood your Node-RED flow and impact performance significantly.
fix
To prevent excessive messages, enable the 'diff' option to send messages only when variable values change. Alternatively, utilize the 'All variables' mode to receive a single object containing all values per cycle.
affects: >=1.0.0
breakingThis package has strict runtime environment requirements: Node.js version 10 or greater and Node-RED version 1.0 or greater. Installing or running on older versions will lead to errors and malfunction.
fix
Before installing or using `node-red-contrib-s7`, ensure your Node.js installation is at version 10+ and your Node-RED instance is at version 1.0+.
affects: <1.0.0 (Node-RED), <10.0.0 (Node.js)
gotchaThe variable addressing scheme used within the S7 Endpoint node is custom to this package and differs 'slightly' from standard Siemens Step 7 or TIA Portal conventions. Direct translation may not work.
fix
Always consult the package documentation's 'Variable Addressing' table (e.g., `DB5,X0.1` instead of `DB5.DBX0.1` for a bit) to ensure correct PLC tag configuration and avoid communication errors.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-red-contrib-s7'
The package was either not installed correctly, or Node-RED is not running in the appropriate user directory where the package was installed.
fix
Run `npm install node-red-contrib-s7` in your Node-RED user directory (typically `~/.node-red` on Linux or `%HOMEPATH%\.nodered` on Windows), or use the 'Manage Palette' feature in the Node-RED UI.
Failed to load node file: /path/to/node-red-contrib-s7/nodes/s7-config.js (or similar error message indicating node loading failure)
This error typically indicates an incompatibility issue with your Node.js or Node-RED version, or a corrupted package installation.
fix
Verify that your Node.js version is 10+ and Node-RED is 1.0+. If versions are correct, try reinstalling the package by running `npm uninstall node-red-contrib-s7 && npm install node-red-contrib-s7` in your Node-RED user directory.
Upgrade
Version history
3.1.3latest on npm
Audit
Dependencies
noderequiredRuntime environment requirement for Node-RED.
node-redrequiredCore platform for which this package provides nodes.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
node-red-contrib-s7 — npm install node-red-contrib-s7 · libregistry