hi
i need some help
i have a s7 input as boolean , and when this goes true i need to stop/block another flow.
does anyone have and idea?
br. lars
hi
i need some help
i have a s7 input as boolean , and when this goes true i need to stop/block another flow.
does anyone have and idea?
br. lars
Save the boolean to a flow context variable then use a switch node with property set to the flow variable, and the output when is false.
Or use the contrib node simple gate.
i tried to use contrib node simple gate, but didnt manage to get it to work
Show us how you have configured it and what messages you are feeding into it to open/close the gate.
[{"id":"03ab325d69e76d84","type":"tab","label":"test 2","disabled":false,"info":"","env":[]},{"id":"8747bd5d66b28c63","type":"s7 in","z":"03ab325d69e76d84","endpoint":"917a01e163f8bc30","mode":"single","variable":"drink in progress","diff":true,"name":"","x":160,"y":320,"wires":[["6e625f41740fb350","94caffc9dc9c9dda"]],"outputLabels":["close"]},{"id":"6e625f41740fb350","type":"change","z":"03ab325d69e76d84","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":320,"wires":[["0d6589e71ba7158b"]]},{"id":"0d6589e71ba7158b","type":"gate","z":"03ab325d69e76d84","name":"gate demo","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":730,"y":220,"wires":[["7dc439623be9b9b3"]]},{"id":"af0308327297cf2e","type":"inject","z":"03ab325d69e76d84","name":"close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"close","payloadType":"str","x":150,"y":240,"wires":[["0d6589e71ba7158b"]]},{"id":"8ebd88b64a6cc30a","type":"inject","z":"03ab325d69e76d84","name":"open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"open","payloadType":"str","x":150,"y":200,"wires":[["0d6589e71ba7158b"]]},{"id":"7dc439623be9b9b3","type":"debug","z":"03ab325d69e76d84","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":910,"y":220,"wires":[]},{"id":"94caffc9dc9c9dda","type":"change","z":"03ab325d69e76d84","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":420,"wires":[["0d6589e71ba7158b"]]},{"id":"917a01e163f8bc30","type":"s7 endpoint","transport":"iso-on-tcp","address":"10.0.0.105","port":"102","rack":"0","slot":"1","localtsaphi":"01","localtsaplo":"00","remotetsaphi":"01","remotetsaplo":"00","connmode":"rack-slot","adapterauto":true,"adapterport":"","busaddr":"2","adapteraddr":"0","cycletime":"1000","timeout":"2000","verbose":"default","name":"","vartable":[{"addr":"DB1,X0.0","name":"start drink 1"},{"addr":"DB1,X0.1","name":"start drink 2"},{"addr":"DB1,X0.2","name":"start drink 3"},{"addr":"DB1,X0.3","name":"start drink 4"},{"addr":"DB1,X0.4","name":"start drink 5 "},{"addr":"DB1,X0.5","name":"start drink 6"},{"addr":"DB1,X0.6","name":"start drink 7"},{"addr":"DB1,X0.7","name":"start drink 8"},{"addr":"DB1,X1.0","name":"drink done 1"},{"addr":"DB1,X1.1","name":"drink done 2"},{"addr":"DB1,X1.2","name":"drink done 3"},{"addr":"DB1,X1.3","name":"drink done 4"},{"addr":"DB1,X1.4","name":"drink done 5"},{"addr":"DB1,X1.5","name":"drink done 6"},{"addr":"DB1,X1.6","name":"drink done 7"},{"addr":"DB1,X1.7","name":"drink done 8"},{"addr":"DB1,X2.0","name":"start homing"},{"addr":"DB1,X2.1","name":"homing ok"},{"addr":"DB1,X2.2","name":"jog forward"},{"addr":"DB1,X2.3","name":"jog backward"},{"addr":"DB1,X2.4","name":"la 25 frem"},{"addr":"DB1,X2.5","name":"la 25 tilbage"},{"addr":"DB1,X2.6","name":"drink in progress"},{"addr":"DB1,X4.0","name":"close"}]}]
Here is an example of my first suggestion, as it is simpler than using the gate node.
top flow represents s7 input, and lower flow stops if s7 equals true.
[{"id":"fcdcb436.026088","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":4720,"wires":[["cbd17163.79e8b8"]]},{"id":"cbd17163.79e8b8","type":"switch","z":"c791cbc0.84f648","name":"","property":"gate","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":320,"y":4720,"wires":[["7dc439623be9b9b3"]]},{"id":"7dc439623be9b9b3","type":"debug","z":"c791cbc0.84f648","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":4720,"wires":[]},{"id":"af0308327297cf2e","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":110,"y":4560,"wires":[["94caffc9dc9c9dda"]]},{"id":"8ebd88b64a6cc30a","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":4520,"wires":[["94caffc9dc9c9dda"]]},{"id":"94caffc9dc9c9dda","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"gate","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":4520,"wires":[[]]}]
and here is an example of using gate node
[{"id":"8ebd88b64a6cc30a","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":4520,"wires":[["94caffc9dc9c9dda"]]},{"id":"94caffc9dc9c9dda","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload ? \"close\" : \"open\"","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":4520,"wires":[["b8c4fef4.37f7f8"]]},{"id":"af0308327297cf2e","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":110,"y":4560,"wires":[["94caffc9dc9c9dda"]]},{"id":"b8c4fef4.37f7f8","type":"gate","z":"c791cbc0.84f648","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"default","x":350,"y":4720,"wires":[["7dc439623be9b9b3"]]},{"id":"fcdcb436.026088","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":4720,"wires":[["b8c4fef4.37f7f8"]]},{"id":"7dc439623be9b9b3","type":"debug","z":"c791cbc0.84f648","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":4720,"wires":[]}]
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.