node-red-contrib-plcs
Version:
Mentor Monitor Project Plcs Modbus Controllers
65 lines (59 loc) • 2.35 kB
HTML
<script type="text/x-red" data-template-name="Generic Out">
<div class="form-row">
<label for="node-input-name" style="width:25%;"><i class="icon-bookmark"></i> Device Name</label>
<input type="text" id="node-input-name" style="width:70%;">
</div>
<div class="form-row">
<label for="node-input-group_name" style="width:25%;"><i class="icon-bookmark"></i> Group Name</label>
<input type="text" id="node-input-group_name" style="width:70%;">
</div>
<div class="form-row">
<label for="node-input-chunks" style="width:25%;"><i class="fa fa-history"></i> Chunks</label>
<input type="number" id="node-input-chunks" value=1 style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div id="result-div">
<div class="form-row">
<label for="node-input-keyed" style="width:25%;"> Keyed Result</label>
<input type="checkbox" id="node-input-keyed" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-stringify" style="width:25%;"> Stringified Result</label>
<input type="checkbox" id="node-input-stringify" style="display: inline-block; width: auto; vertical-align: top;">
</div>
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('Generic Out',{
category: 'Mentor Plcs',
color: '#EBEDEC',
align: 'right',
defaults: {
name: {value:""},
chunks: {value:1},
group_name: {value:""},
keyed: {value:true},
stringify: {value:true}
},
inputs:1,
outputs:1,
icon: "iconDO.png",
label: function() {
return this.name||"Generic Out";
},
oneditprepare() {
if (typeof this.stringify == 'undefined')
{
$("#node-input-stringify"). prop("checked", true);
}
if ( typeof this.keyed == 'undefined')
{
$("#node-input-keyed"). prop("checked", true);
}
}
});
</script>
<script type="text/x-red" data-help-name="Generic Out">
<p>
PLC Device Output to Mentor<br/>
</p>
</script>