plcindustry 2.1.1
A Node-RED node to interact with Siemens S7 PLCs
node-red-contrib-s7
A Node-RED node to interact with Siemens S7 PLCs. Based on the awesome work of plcpeople/nodes7.
This node was created by Smart-Tech as part of the ST-One project.
Install
You can install this node directly from the "Manage Palette" menu in the Node-RED interface. An optional compilation step is only necessary for supporting MPI-USB adapter.
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
Usage
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 andmsg.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.
Variable addressing
The variables and their addresses configured on the S7 Endpoint follow a slightly different scheme than used on Step 7 or TIA Portal. Here are some examples that may guide you on addressing your variables:
*) Note that strings on the PLC uses 2 extra bytes at start for size/length of the string
Notes on S7-1200/1500
These newer PLCs offer an "extended" version of the S7 Protocol, while we have only a "basic" version of it.
Therefore, some additional configuration steps on the PLC are necessary:
- "Optimized block access" must be disabled for the DBs we want to access (image)
- In the "Protection" section of the CPU Properties, enable the "Permit access with PUT/GET" checkbox (image)
Wishlist
- Perform data type validation on the variables list, preventing errors on the runtime
Bugs and enhancements
Please share your ideas and experiences on the Node-RED forum, or open an issue on the page of the project on GitHub
License
Copyright: (c) 2016-2019, Smart-Tech, Guilherme Francescon Cittolin [email protected]
GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy | Cookie Settings
