diff --git a/app.js b/app.js index c690efe..a0fe591 100755 --- a/app.js +++ b/app.js @@ -282,7 +282,7 @@ module.exports = { }, async write(item, allowSendNext) { - this.client.setID(item.unitid); + this.client.setID(parseInt(item.unitid)); let fcw = item.vartype == 'bool' ? 5 : 6; let val = item.value; if (fcw == 6) { diff --git a/modbus.ih b/modbus.ih index f840bfd..c1a2794 100755 --- a/modbus.ih +++ b/modbus.ih @@ -2,5 +2,5 @@ "id":"modbus", "description":"Modbus Master plugin for IH", "cross":true, - "version":"5.0.4" + "version":"5.0.5" } diff --git a/node_modules/modbus-serial/index.js b/node_modules/modbus-serial/index.js index fafe7c0..bbaa765 100644 --- a/node_modules/modbus-serial/index.js +++ b/node_modules/modbus-serial/index.js @@ -367,7 +367,9 @@ function _onReceive(data) { * if we do not expect this message * raise an error */ - if (address !== transaction.nextAddress || code !== transaction.nextCode) { + if ((address != transaction.nextAddress) || (code != transaction.nextCode)) { + + error = "Unexpected data error, expected " + transaction.nextAddress + " got " + address; next(new Error(error)); diff --git a/v5/channelform.json b/v5/channelform.json index ec8b0a8..3187dc1 100755 --- a/v5/channelform.json +++ b/v5/channelform.json @@ -116,7 +116,8 @@ "title": "$kh", "type": "input", "hide": "!data.p2.usek || data.p2.vartype.id == 'bool'" - } + }, + { "prop": "devpropname", "title": "Свойство устройства для привязки", "type": "input"} ], "p3": [ { "prop": "r", "title": "$Read", "type": "cb" },