node-red-contrib-mewtocol
Version:
Panasonic PLC MEWTOCOL COM over TCP implementation for Node-Red
77 lines (75 loc) • 3.6 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('mewtocol-rd',{
category: 'Mewtocol',
color: '#3FADB5',
defaults: {
name: {value:""},
server: {value:"", type:"mewtocol-client", required:true},
station: {value:1},
area: {value:"D"},
startaddress: {value:""},
endaddress: {value:""},
sendonerror: {value:true}
},
inputs:1,
outputs:2,
inputLabels: ["command"],
outputLabels:["output","error"],
icon: "font-awesome/fa-microchip",
label: function() {
return this.name||"mewtocol-rd";
},
oneditprepare: function() {
$("#node-input-area").typedInput({
types: [
{
value: "area",
options: [
{ value: "D", label: "D"},
{ value: "L", label: "L"},
{ value: "F", label: "F"}
]
}
]
});
}
});
</script>
<script type="text/html" data-template-name="mewtocol-rd">
<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-startaddress"><i class="fa fa-arrow-circle-left"></i> Start address</label>
<input type="text" id="node-input-startaddress" placeholder="Start address">
</div>
<div class="form-row">
<label style="min-width:110px" for="node-input-endaddress"><i class="fa fa-arrow-circle-right"></i> End address</label>
<input type="text" id="node-input-endaddress" placeholder="End 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-rd">
<p>Read registers in 16bit word units. Specify register memory area and addresses to read 16bit int values from.</p>
<p>You can use message parameters to specify station number, memory area and addresses: msg.station, msg.area, msg.startaddress, msg.endaddress</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>