node-red-contrib-minelert-universal-io
Version:
Node-RED nodes for Universal IO Gateway and I/O Modules
69 lines (60 loc) • 2.02 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('digital-in', {
category: 'Smartlink UIO',
color: '#ccffff',
defaults: {
name: { value: '' },
gateway: { value:"", type: 'gateway', required: true },
moduleId: { value: '', required: true }
},
inputs: 0,
outputs: 1,
icon: "font-awesome/fa-sign-in",
paletteLabel: "MOD-DI-4",
label: function () {
return this.name || 'MOD-DI-4';
}
});
</script>
<script type="text/x-red" data-template-name="digital-in">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" />
</div>
<div class="form-row">
<label for="node-input-gateway"><i class="fa fa-random"></i> Gateway</label>
<input type="text" id="node-input-gateway" />
</div>
<div class="form-row">
<label for="node-input-moduleId"><i class="fa fa-cube"></i> Module ID</label>
<input type="text" id="node-input-moduleId" />
</div>
</script>
<script type="text/x-red" data-help-name="digital-in">
<p>
This node receives digital input signals from the SmartLink Universal IO digital input card.
</p>
<p>
You must configure the following:
</p>
<ul>
<li><strong>Gateway Node:</strong> Reference to the gateway connected to the bus.</li>
<li><strong>Device Address:</strong> Address of the I/O module.</li>
</ul>
<p>
The node emits a message with the analog value and channel info.
<code>
{
value: true,
channel: 0,
}
</code>
</p>
<ul>
<li><strong>value:</strong> received digital input signal (boolean true or false)</li>
<li><strong>channel:</strong> digital intput channel index (0 to 3)</li>
</ul>
<p>
This node assumes the hardware module is properly wired and supports digital input.
</p>
</script>