A Node-RED node to interact with Siemens S7 PLCs
A Node-RED node to interact with Siemens S7 PLCs. Based on the awesome work of plcpeople/nodes7.
You can install this node directly from the "Manage Palette" menu in the Node-RED interface. There are no external dependencies or compilation steps.
Alternatively, run the following command in your Node-RED user directory - typically
~/.node-red on Linux or
%HOMEPATH%\.nodered on Windows
npm install node-red-contrib-s7
Each connection to a PLC is represented by the S7 Endpoint configuration node. You can configure the PLC's Address, the variables available and their addresses, and the cycle time for reading the variables.
The S7 In node makes the variable's values available in a flow in three different modes:
- Single variable: A single variable can be selected from the configured variables, and a message is sent every cycle, or only when it changes if diff is checked.
msg.payloadcontains the variable's value and
msg.topichas the variable's name.
- All variables, one per message: Like the Single variable mode, but for all variables configured. If diff is checked, a message is sent everytime any variable changes. If diff is unchecked, one message is sent for every variable, in every cycle. Care must be taken about the number of messages per second in this mode.
- All variables: In this mode,
msg.payloadcontains an object with all configured variables and their values. If diff is checked, a message is sent if at least one of the variables changes its value.
Bugs and enhancements
Copyright 2016-2017 Smart-Tech, Apache 2.0 license.