Bi-Directional S7 Read/Write Flow
This flow enables both reading from and writing to a Siemens S7 PLC using the node-red-contrib-s7 package. It continuously reads a REAL value from DB1, address 0, and allows manual injection of a new value to be written back to the same address. Useful for testing control loops, setpoints, or simulating user interaction with a PLC.
[{"id":"e0cf123a9482124a","type":"s7 in","z":"f6c2e2c64938fda0","endpoint":"6f05c4f2e2b5be12","mode":"single","variable":"TankLevel","name":"Read TankLevel","x":210,"y":100,"wires":[["0a16386b918d4edc"]]},{"id":"0a16386b918d4edc","type":"debug","z":"f6c2e2c64938fda0","name":"Debug Read","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":430,"y":100,"wires":[]},{"id":"a7a25c3979f6b53e","type":"inject","z":"f6c2e2c64938fda0","name":"Inject Write Value (e.g., 55.0)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"55.0","payloadType":"num","x":210,"y":180,"wires":[["8f6748cbe6e56a38"]]},{"id":"8f6748cbe6e56a38","type":"s7 out","z":"f6c2e2c64938fda0","endpoint":"6f05c4f2e2b5be12","variable":"TankLevel","name":"Write TankLevel","x":430,"y":180,"wires":[]},{"id":"6f05c4f2e2b5be12","type":"s7 endpoint","transport":"iso-on-tcp","port":"102","rack":"0","slot":"1","localtsaphi":"01","localtsaplo":"00","remotetsaphi":"01","remotetsaplo":"00","connmode":"rack-slot","adapter":"","cycletime":"1000","timeout":"2000","name":"S7-1200 PLC"}]