node-red-contrib-minelert-universal-io
Version:
Node-RED nodes for Universal IO Gateway and I/O Modules
70 lines (61 loc) • 2.42 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('digital-out', {
category: 'Smartlink UIO',
color: '#ffd699',
defaults: {
name: { value: '' },
gateway: { value:"", type: 'gateway', required: true },
moduleId: { value: '', required: true }
},
inputs: 1,
outputs: 1,
icon: "font-awesome/fa-sign-out",
paletteLabel: "MOD-DO-4",
label: function () {
return this.name || 'MOD-DO-4';
}
});
</script>
<script type="text/x-red" data-template-name="digital-out">
<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-out">
<p>
This node sends digital output values to a channel on a Smartlink Universal I/O digital output module via the shared gateway bus.
</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>
<strong>Input Format:</strong><br/>
The node expects an incoming message with:
<ul>
<li><code>msg.payload</code> — digital value to output (can be <code>true | false</code>, <code>1 | 0</code> or <code>'on' | 'off'</code>)</li>
<li><code>msg.channel</code> — the digital output channel index (0 to 3)</li>
</ul>
</p>
<p>
The value in <code>msg.payload</code> will be sent to the specified channel of the I/O module as a boolean value.
</p>
<p>
<strong>Important:</strong> Ensure that the channel specified in <code>msg.channel</code> is valid (0–3). Invalid channels will be ignored or may produce an error depending on node configuration.
</p>
<p>
This node assumes the hardware module is properly wired and supports digital output.
</p>
</script>