UNPKG

prisme-flow

Version:

prisme platform flow engine

107 lines (92 loc) 4.3 kB
<!-- Created by prisme.io on 09/06/2017. @author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io) --> <script type="text/javascript"> RED.nodes.registerType('modbus-queue-info', { category: 'plc', color: '#E9967A', defaults: { name: {value: ""}, unitid: {value: ""}, lowLowLevel: {value: 25, validate: RED.validators.number()}, lowLevel: {value: 75, validate: RED.validators.number()}, highLevel: {value: 150, validate: RED.validators.number()}, highHighLevel: {value: 300, validate: RED.validators.number()}, server: {type: "modbus-client", required:true}, errorOnHighLevel: {value: false} }, inputs: 1, outputs: 1, icon: "modbus.png", paletteLabel: "Modbus-Queue-Info", label: function () { return this.name || "modbus queue info" } }) </script> <script type="text/x-red" data-template-name="modbus-queue-info"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> <span>Modbus-Queue-Info</span></label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-unitid"><i class="icon-bookmark"></i> <span>Unit-Id</span></label> <input type="text" id="node-input-unitid" placeholder="1"> </div> <hr> <div class="form-row"> <label for="node-input-lowLowLevel"><i class="icon-bookmark"></i> <span>Low low level</span></label> <input type="text" id="node-input-lowLowLevel" placeholder="25"> </div> <div class="form-row"> <label for="node-input-lowLevel"><i class="icon-bookmark"></i> <span>Low level</span></label> <input type="text" id="node-input-lowLevel" placeholder="75"> </div> <div class="form-row"> <label for="node-input-highLevel"><i class="icon-bookmark"></i> <span">High level</span></label> <input type="text" id="node-input-highLevel" placeholder="150"> </div> <div class="form-row"> <label for="node-input-highHighLevel"><i class="icon-bookmark"></i> <span>High high level</span></label> <input type="text" id="node-input-highHighLevel" placeholder="300"> </div> <hr> <div class="form-row"> <label for="node-input-server"><i class="icon-globe"></i> <span>Server</span></label> <input type="text" id="node-input-server"> </div> <hr> <div class="form-row"> <label style="min-width:160px" for="node-input-errorOnHighLevel"><i class="fa fa-th"></i> <span>Error on high level</span> </label> <input type="checkbox" id="node-input-errorOnHighLevel" style="max-width:30px"> </div> </script> <script type="text/x-red" data-help-name="modbus-queue-info"> <p><strong> A queue is set per unit - setup the unit-id to get the right information. </strong></p> <p>Modbus TCP/Serial queue information node.</p> <p>Unit-Id (0..255 tcp | 1..247 serial)</p> <p>Use inject of <pre>msg.resetQueue = true</pre> to reset the queue.</p> <p>Reset on high level to connect with the catch node</p> <p><pre> [{"id":"430f76bf.9de2d8","type":"function","z":"b245d3e4.b52de","name":"reset on High", "func":"if(\"high level reached\" === msg.state) {\n msg.resetQueue = true;\n return msg;\n}\n", "outputs":1,"noerr":0,"x":410,"y":140,"wires":[["64cca59a.dc295c"]]}] </pre></p> <p>Reset on high high level to connect with the catch node</p> <p><pre> [{"id":"fc74491.2ddc9b8","type":"function","z":"b245d3e4.b52de","name":"reset on HighHigh", "func":"if(\"high high level reached\" === msg.state) {\n msg.resetQueue = true;\n return msg;\n}\n", "outputs":1,"noerr":0,"x":430,"y":180,"wires":[["64cca59a.dc295c"]]}] </pre></p> <p>"Error on high level" with that option the node sends an error if high level is reached and on high high level.</p> <p>With reaching the high level there comes a warning and with the high high an error for work with the catch node</p> <p>Output: all queue information - use complete msg with debug</p> </script>