Registry / communication / node-red-contrib-s7comm

node-red-contrib-s7comm

JSON →
library1.1.6jsnpmunverified

node-red-contrib-s7comm is a Node-RED package designed to facilitate communication with Siemens SIMATIC S7-300, S7-1200, and S7-1500 PLCs. It leverages the RFC1006 (ISO-on-TCP) communication protocol, enabling users to read from and write to specific PLC addresses using various S7 data types. The current stable version is 1.1.6. As a Node-RED contribution node, its release cadence is typically driven by community contributions and updates to its underlying `nodeS7` library, which handles the core PLC communication. Key differentiators include its integration into the Node-RED flow-based programming environment, simplifying the creation of HMI, SCADA, or IIoT applications that interact with Siemens PLCs without requiring extensive low-level protocol knowledge. It abstracts the complexities of the S7comm protocol behind user-friendly Node-RED nodes.

npm install node-red-contrib-s7comm
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-S
N
node-red-contrib-s7comm
communicationjavascriptv1.1.6
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.

S7CommNode
/* This package is a Node-RED node. Users do not typically import symbols directly into JavaScript. */
As a Node-RED contrib package, this node is primarily configured and used within the Node-RED flow editor. Direct programmatic JavaScript/TypeScript `import` statements for users are not the intended interaction method. The entries here are illustrative of what internal components *might* be exposed if it were a standard library, but are not for typical user consumption.
S7ConfigNode
/* This package is a Node-RED node. Users do not typically import symbols directly into JavaScript. */
Configuration nodes for Node-RED are managed by the runtime and exposed via the editor's palette. Users define instances of these nodes graphically.
S7Client
/* This package is a Node-RED node. Users do not typically import symbols directly into JavaScript. */
While an underlying S7 client (from `nodeS7`) is used internally, it is not directly exposed for programmatic import by users of `node-red-contrib-s7comm`. Interaction is abstracted through Node-RED's message passing system.

Illustrates the typical installation process for Node-RED packages via the Palette Manager and provides a conceptual JavaScript snippet for direct S7 client interaction (not directly from this Node-RED node).

// To install the Node-RED node: // 1. Ensure Node-RED is installed and running. // 2. Open the Node-RED editor (usually http://localhost:1880). // 3. Go to the Palette Manager (top-right menu -> Manage palette). // 4. In the 'Install' tab, search for 'node-red-contrib-s7comm' and click install. // After installation, drag 's7comm read' and 's7comm write' nodes from the palette onto your flow. // Example JavaScript code showing conceptual S7 client usage, not direct 'node-red-contrib-s7comm' usage: // import { S7Client } from 'nodeS7'; // Hypothetical import if using nodeS7 directly // async function readS7Data() { // const client = new S7Client(); // try { // await client.connect({ // host: '192.168.0.1', // port: 102, // rack: 0, // slot: 1 // }); // console.log('Connected to PLC.'); // const data = await client.readArea( // S7Client.S7Area.DB, // 1, // DB number // 0, // Start offset // 2, // Length (e.g., 2 bytes) // S7Client.S7Type.WORD // ); // console.log('Read data:', data); // } catch (error) { // console.error('S7 communication error:', error); // } finally { // client.destroy(); // } // } // readS7Data();
Debug
Known issues
gotchaSiemens S7-1200/1500 PLCs require specific 'Protection & Security' settings in TIA Portal (e.g., 'Permit access with PUT/GET communication from remote partner') to allow external read/write access via S7comm. Failure to configure this will result in connection refusal.
fix
In TIA Portal, navigate to the PLC properties, then 'Protection & Security', and enable 'Permit access with PUT/GET communication from remote partner (PLC, HMI, OPC)'.
affects: >=1.0.0
gotchaIncorrect S7 data type or length configuration in the Node-RED node can lead to read/write errors, corrupted data, or unexpected values. The node expects precise mapping to the PLC's actual data block structure.
fix
Always cross-check the configured S7 data type (e.g., BYTE, WORD, INT, REAL, BOOL) and array length in the Node-RED node against the PLC's TIA Portal project variables for exact matches.
affects: >=1.0.0
gotchaNode-RED flow deployments, especially involving configuration nodes, must be handled carefully. Partial or incorrect deployments can result in nodes remaining uninitialized or losing their connection settings.
fix
After making changes to S7comm nodes or their configuration nodes, perform a 'Full deploy' in Node-RED to ensure all nodes are correctly initialized with the latest settings. Check the Node-RED debug tab for errors.
affects: >=1.0.0
gotchaThe stability and security of `node-red-contrib-s7comm` are dependent on the underlying `nodeS7` library. Any vulnerabilities or critical bugs discovered in `nodeS7` will directly impact this Node-RED contribution.
fix
Monitor the GitHub repositories for both `node-red-contrib-s7comm` and `nodeS7` for updates and security advisories. Ensure you are running the latest stable versions of both.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Connection refused
The PLC rejected the connection attempt, often due to incorrect IP, port, firewall blocking, or PLC security settings.
fix
Verify the PLC's IP address and port (default 102), check network connectivity between Node-RED host and PLC, ensure no firewall is blocking port 102, and confirm PLC 'Protection & Security' settings allow PUT/GET communication.
Error: S7 response data error - wrong data size
The configured data length or type in the Node-RED node does not match the actual data block/variable size on the PLC.
fix
In the Node-RED node's configuration, precisely match the S7 data type (e.g., INT, REAL) and length to what is defined in the TIA Portal for the target PLC address (DB, address, size).
Error: S7 PLC response: 10/FF00
Generic PLC communication error, frequently indicating that the PLC's security settings prevent access to the requested data block or an unsupported access method.
fix
Check the PLC's 'Protection & Security' settings in TIA Portal for PUT/GET permissions. For data blocks, ensure 'Optimized block access' is not solely enabled if the client expects standard access, or vice-versa, and verify block attributes.
TypeError: Cannot read properties of undefined (reading 'config')
This error typically occurs within Node-RED when a node's associated configuration node (e.g., the S7comm-Config node) is either missing, unlinked, or not properly deployed.
fix
Ensure that your 's7comm read' or 's7comm write' node is correctly linked to an 's7comm-config' node, and that the 's7comm-config' node is also properly configured. Perform a 'Full deploy' in Node-RED after making changes.
Upgrade
Version history
1.1.6latest on npm
Audit
Dependencies
nodeS7requiredProvides the core S7 communication framework for interacting with Siemens PLCs.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
2
Resources
node-red-contrib-s7comm — npm install node-red-contrib-s7comm · libregistry