UNPKG

node-red-contrib-mewtocol

Version:

Panasonic PLC MEWTOCOL COM over TCP implementation for Node-Red

74 lines (72 loc) 3.43 kB
<script type="text/javascript"> RED.nodes.registerType('mewtocol-rcs',{ category: 'Mewtocol', color: '#3FADB5', defaults: { name: {value:""}, server: {value:"", type:"mewtocol-client", required:true}, station: {value:1}, area: {value:"X"}, address: {value:""}, sendonerror: {value:true} }, inputs:1, outputs:2, inputLabels: ["command"], outputLabels:["output","error"], icon: "font-awesome/fa-microchip", label: function() { return this.name||"mewtocol-rcs"; }, oneditprepare: function() { $("#node-input-area").typedInput({ types: [ { value: "area", options: [ { value: "X", label: "X"}, { value: "Y", label: "Y"}, { value: "R", label: "R"}, { value: "L", label: "L"} ] } ] }); } }); </script> <script type="text/html" data-template-name="mewtocol-rcs"> <div class="form-row"> <label style="min-width:110px" for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label style="min-width:110px" for="node-input-server"><i class="fa fa-microchip"></i> Server</label> <input type="text" id="node-input-server" placeholder="Server"> </div> <div class="form-row"> <label style="min-width:110px" for="node-input-station"><i class="fa fa-th"></i> Station</label> <input type="text" id="node-input-station" placeholder="Station"> </div> <div class="form-row"> <label style="min-width:110px" for="node-input-area"><i class="fa fa-map"></i> Memory area</label> <input type="text" id="node-input-area" placeholder="Memory area"> </div> <div class="form-row"> <label style="min-width:110px" for="node-input-address"><i class="fa fa-arrow-circle-left"></i> Address</label> <input type="text" id="node-input-address" placeholder="Address"> </div> <div class="form-row"> <label style="min-width:265px" for="node-input-sendonerror"><i class="fa fa-exclamation-circle"></i> Send empty payload message on error</label> <input type="checkbox" id="node-input-sendonerror" style="max-width:20px"> <p>If disabled, node will only send error message from the error output</p> </div> </script> <script type="text/html" data-help-name="mewtocol-rcs"> <p>Read single bit from contact value. Specify contact memory areas to read value from. Possible values for area are X,Y,R,L</p> <p>Specify address and bit you want to read e.g. 100A - means memory address 100, bit #10</p> <p>You can use message parameters to specify station number, memory area and address: msg.station, msg.area, msg.address</p> <p>Parameters passed in msg will always take preference over settings in node-red gui</p> <p>All message parameters will be retained except msg.payload which contains returned data from PLC</p> <p>In case of error there will be error message sent to second output</p> </script>