node-red-contrib-modbus-modpackqt 3.3.27 → 3.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@
26
26
  oneditprepare: function () {
27
27
  const node = this;
28
28
 
29
- // ── My Slaves picker
29
+ // ── My Slaves picker (TCP only — this node runs a TCP server, not serial RTU)
30
30
  const $sel = $('#node-input-modpackqt-slave-picker');
31
31
  const reload = function () {
32
32
  $sel.empty().append('<option value="">— Loading… —</option>');
@@ -37,17 +37,15 @@
37
37
  $.getJSON('modpackqt/slaves?probe=' + encodeURIComponent(node.id))
38
38
  .done(function (rows) {
39
39
  $sel.empty().append('<option value="">— Manual entry —</option>');
40
- (rows || [])
41
- .filter(function (s) { return !!s; })
42
- .forEach(function (s) {
43
- const isRtu = s.protocol === 'rtu';
44
- const proto = isRtu ? ' [RTU]' : ' [TCP]';
45
- const conn = isRtu
46
- ? ' — unit #' + (s.unitId || 1)
47
- : ' — :' + (s.port || 1502) + ' #' + (s.unitId || 1);
48
- const label = (s.name || '(unnamed)') + conn + proto;
40
+ const tcpSlaves = (rows || []).filter(function (s) { return !!s && s.protocol !== 'rtu'; });
41
+ if (tcpSlaves.length === 0) {
42
+ $sel.empty().append($('<option>').val('').text('— No TCP slaves saved yet —'));
43
+ } else {
44
+ tcpSlaves.forEach(function (s) {
45
+ const label = (s.name || '(unnamed)') + ' — :' + (s.port || 1502) + ' #' + (s.unitId || 1);
49
46
  $('<option>').val(s.id).text(label).data('row', s).appendTo($sel);
50
47
  });
48
+ }
51
49
  })
52
50
  .fail(function (xhr) {
53
51
  const msg = (xhr.responseJSON && xhr.responseJSON.error) || ('HTTP ' + xhr.status);
@@ -59,8 +57,7 @@
59
57
  const row = $(this).find('option:selected').data('row');
60
58
  if (!row) return;
61
59
  if (!node.name) $('#node-input-name').val(row.name || '');
62
- // RTU slaves have no port — keep whatever TCP port is already set
63
- if (row.protocol !== 'rtu' && row.port) $('#node-input-bindPort').val(row.port);
60
+ if (row.port) $('#node-input-bindPort').val(row.port);
64
61
  $('#node-input-unitId').val(row.unitId || 1);
65
62
  buildLink();
66
63
  });
@@ -115,7 +112,7 @@
115
112
  <button type="button" id="modpackqt-slave-server-picker-refresh" class="red-ui-button" title="Reload" style="margin-left:4px"><i class="fa fa-refresh"></i></button>
116
113
  </div>
117
114
  <div class="form-tips" style="font-size:11px;color:#6b7280;margin:-8px 0 12px 105px">
118
- Required pick a saved slave to set the port and unit ID.
115
+ Loads your saved <strong>TCP</strong> slaves. RTU slaves are not shown this node runs a Modbus TCP server only.
119
116
  Register layout and limits are managed from the web console.
120
117
  </div>
121
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-modbus-modpackqt",
3
- "version": "3.3.27",
3
+ "version": "3.3.29",
4
4
  "description": "Modbus commissioning, testing & analysis tools for Node-RED. Embedded Modbus TCP/RTU master + slave server, FC1/FC2/FC3/FC4 reads, FC5/FC6/FC15/FC16 writes, built-in slave register store, and a passive traffic monitor for debugging. 100% free, MIT, no usage limits. By ModPackQT — open the matching web console at modpackqt.com for register decoding, simulation and AI assistance.",
5
5
  "keywords": [
6
6
  "node-red",