{"id":15152,"library":"node-red-contrib-s7","title":"Node-RED Siemens S7 PLC Connector","description":"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.","status":"active","version":"3.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/st-one-io/node-red-contrib-s7","tags":["javascript","hardware","s7","logo","siemens","plc","profinet","node-red"],"install":[{"cmd":"npm install node-red-contrib-s7","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-s7","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-s7","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime environment requirement for Node-RED.","package":"node","optional":false},{"reason":"Core platform for which this package provides nodes.","package":"node-red","optional":false}],"imports":[{"note":"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.","wrong":"import { S7Endpoint } from 'node-red-contrib-s7'","symbol":"S7 Endpoint (Node-RED Node)","correct":"Available in the Node-RED palette after installation. Drag and drop to configure a PLC connection."},{"note":"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.","wrong":"const S7In = require('node-red-contrib-s7').S7In","symbol":"S7 In (Node-RED Node)","correct":"Available in the Node-RED palette after installation. Drag and drop to read variables from a configured S7 Endpoint."},{"note":"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.","wrong":"import * as S7 from 'node-red-contrib-s7'","symbol":"S7 Out (Node-RED Node)","correct":"Available in the Node-RED palette after installation (for writing data to PLC variables). Drag and drop into a flow."}],"quickstart":{"code":"npm install node-red-contrib-s7\n\n// After successful installation, open your Node-RED editor (e.g., http://localhost:1880).\n// The S7 nodes ('S7 Endpoint', 'S7 In', 'S7 Out') will appear in the Node-RED palette.\n//\n// 1. Drag an 'S7 Endpoint' node onto your flow canvas.\n// 2. Double-click the 'S7 Endpoint' node to configure its properties:\n//    - Set the PLC's IP Address (e.g., '192.168.0.100').\n//    - Configure Rack and Slot if necessary (default 0,0 for S7-1200/1500).\n//    - Add variables you want to read/write, specifying their Name and custom Address (e.g., 'MyTemperature', 'DB1,REAL0').\n// 3. Drag an 'S7 In' node onto your flow.\n// 4. Double-click the 'S7 In' node, select the configured 'S7 Endpoint' from the dropdown.\n// 5. Choose a 'Mode' (e.g., 'Single variable') and select one of the variables configured in the endpoint (e.g., 'MyTemperature').\n// 6. Connect the 'S7 In' node's output to a 'debug' node to view the PLC data in the Node-RED debug sidebar.\n// 7. Deploy the flow.","lang":"javascript","description":"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."},"warnings":[{"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.","message":"When 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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+.","message":"This 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.","severity":"breaking","affected_versions":"<1.0.0 (Node-RED), <10.0.0 (Node.js)"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"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.","cause":"The package was either not installed correctly, or Node-RED is not running in the appropriate user directory where the package was installed.","error":"Error: Cannot find module 'node-red-contrib-s7'"},{"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.","cause":"This error typically indicates an incompatibility issue with your Node.js or Node-RED version, or a corrupted package installation.","error":"Failed to load node file: /path/to/node-red-contrib-s7/nodes/s7-config.js (or similar error message indicating node loading failure)"}],"ecosystem":"npm"}