Node-RED Siemens S7 PLC Connector

3.1.3 · active · verified Tue Apr 21

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

view raw JSON →