UNPKG

@fw-systeme/node-red-msl

Version:

A node-red module to simplify the access of msl4 channel data.

42 lines (40 loc) 1.97 kB
<script type="text/javascript"> RED.nodes.registerType('msl4-out',{ category: 'MSL4', color: 'lightgreen', defaults: { name: {value: ""}, mslChannel: {value:"", type:"msl-channel-config"}, channels: {value: ""} }, inputs:1, outputs:1, icon: "fw-logo.png", label: function() { if(this.name) return this.name; else if (this.channel) return this.channels.flatMap(channel => channel.channelname).join(); else return "MSL4-Out" } }); </script> <script type="text/html" data-template-name="msl4-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" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-mslChannel"><i class="fa fa-tag"></i> MSL-Kanal</label> <input type="text" id="node-input-mslChannel"> </div> </script> <script type="text/x-red" data-help-name="msl4-out"> <h3>MSL4 Out</h3> <p>Node zur Setzung von Werten der MSL4 Ausgangskanäle</p> <p> Um diesem Node ein Kanal des MSL zuzuordnen, erstellen Sie über das MSL-Kanal Auswahlfeld ein Kanalkonfigurationsnode und wählen bei dessen Konfiguration einen Kanal aus. <b>Für jede weitere Kanalzuordnung muss ein neues Konfigurationsnode üder die Option `Neuen Typ msl-channel-config hinzufügen` erstellt werden.</b> Diese Konfigurationsnodes sind global und für alle anderen Nodes verfügbar. Damit dieses Node die Werte der zugeordneten Kanäle setzen kann, muss ihm ein Array mit numerischen Werten übergeben dessen Größe der Anzahl von zugeordneten Kanälen entsprechen muss. Beispiel: <br>[1] => [Digital Out 1]<br> [0, 1] => [Digital Out 1, Digital Out 2]<br> [0, 1, 0] => [Digital Out 1, Digital Out 2, Digital Out 3] usw. </p> </script>