Skip to content

Commit

Permalink
Merge branch 'release/v5.16.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Dec 10, 2021
2 parents c249ddf + 6d9e693 commit 9223695
Show file tree
Hide file tree
Showing 7 changed files with 457 additions and 391 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [5.16.0](https://github.com/biancoroyal/node-red-contrib-modbus/compare/v5.15.0...v5.16.0) (2021-12-10)


### Bug Fixes

* [#253](https://github.com/biancoroyal/node-red-contrib-modbus/issues/253) queue info reset ([9ad4531](https://github.com/biancoroyal/node-red-contrib-modbus/commit/9ad45314e874caa2016caf80e5b5102acf29964d))
* [#274](https://github.com/biancoroyal/node-red-contrib-modbus/issues/274) ([fccd59b](https://github.com/biancoroyal/node-red-contrib-modbus/commit/fccd59be03ec79deae4698e4ce11064f3de825c1))
* [#277](https://github.com/biancoroyal/node-red-contrib-modbus/issues/277), [#253](https://github.com/biancoroyal/node-red-contrib-modbus/issues/253), [#263](https://github.com/biancoroyal/node-red-contrib-modbus/issues/263), [#266](https://github.com/biancoroyal/node-red-contrib-modbus/issues/266) ([920d6d0](https://github.com/biancoroyal/node-red-contrib-modbus/commit/920d6d0e089e27e21fa92b4b6a313a66dad6452b))
* remove wire to none existing node of example code ([be770c4](https://github.com/biancoroyal/node-red-contrib-modbus/commit/be770c4ed8f36ccaeb2a5f614e569a25965fb17f))



## [5.14.1](https://github.com/biancoroyal/node-red-contrib-modbus/compare/v5.14.0...v5.14.1) (2021-08-07)


Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ Based on [modbus-serial][2] with TCP, C701, Telnet, Serial, RTU buffered, and AS
* stress tested with Node-RED v1.0.4 and Node.js LTS
* works with queueing per unit and round robin scheduling

Node-RED v1.x versions:
Node-RED v2.x versions:
* Node.JS 16.x will be supported with v6.+
* Node.JS 14.x is supported with v5.14.+
* Node.JS 12.x is supported with v5.x

Node-RED v1.x versions:
* Node.JS 14.x is supported with v5.14.+
* Node.JS 12.x is supported with v5.x
* Node.JS 10.x is supported with v5.x

Node-RED v0.x versions:
Expand Down
809 changes: 422 additions & 387 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-modbus",
"version": "5.15.0",
"version": "5.16.0",
"private": false,
"description": "The all in one Modbus TCP and Serial contribution package for Node-RED.",
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions src/core/modbus-client-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ de.biancoroyal.modbus.core.client.setNewSerialNodeSettings = function (node, msg
node.serialParity = msg.payload.serialParity || node.serialParity
node.serialType = msg.payload.serialType || node.serialType

// Make sure is parsed when string, otherwise just assign.
if (msg.payload.serialAsciiResponseStartDelimiter && typeof msg.payload.serialAsciiResponseStartDelimiter === 'string') {
node.serialAsciiResponseStartDelimiter = parseInt(msg.payload.serialAsciiResponseStartDelimiter, 16)
} else {
node.serialAsciiResponseStartDelimiter = msg.payload.serialAsciiResponseStartDelimiter || node.serialAsciiResponseStartDelimiter
}

if (msg.payload.serialConnectionDelay) {
node.serialConnectionDelay = parseInt(msg.payload.serialConnectionDelay) || node.serialConnectionDelay
}
Expand Down
11 changes: 9 additions & 2 deletions src/modbus-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = function (RED) {
const timeoutTimeMS = 1000
const reconnectTimeMS = 2000
const logHintText = ' Get More About It By Logging'
const serialAsciiResponseStartDelimiter = '0x3A'

this.clienttype = config.clienttype

Expand All @@ -58,7 +59,7 @@ module.exports = function (RED) {
this.serialParity = config.serialParity
this.serialType = config.serialType
this.serialConnectionDelay = parseInt(config.serialConnectionDelay) || serialConnectionDelayTimeMS
this.serialAsciiResponseStartDelimiter = config.serialAsciiResponseStartDelimiter
this.serialAsciiResponseStartDelimiter = config.serialAsciiResponseStartDelimiter || serialAsciiResponseStartDelimiter

this.unit_id = parseInt(config.unit_id)
this.commandDelay = parseInt(config.commandDelay) || minCommandDelayMilliseconds
Expand Down Expand Up @@ -357,8 +358,14 @@ module.exports = function (RED) {
switch (node.serialType) {
case 'ASCII':
verboseLog('ASCII port serial')
serialPortOptions.startOfSlaveFrameChar = parseInt(node.serialAsciiResponseStartDelimiter, 16)
// Make sure is parsed when string, otherwise just assign.
if (node.serialAsciiResponseStartDelimiter && typeof node.serialAsciiResponseStartDelimiter === 'string') {
serialPortOptions.startOfSlaveFrameChar = parseInt(node.serialAsciiResponseStartDelimiter, 16)
} else {
serialPortOptions.startOfSlaveFrameChar = node.serialAsciiResponseStartDelimiter
}
verboseLog('Using response delimiter: 0x' + serialPortOptions.startOfSlaveFrameChar.toString(16))

node.client.connectAsciiSerial(node.serialPort, serialPortOptions).then(node.setSerialConnectionOptions)
.catch(node.modbusSerialErrorHandling)
break
Expand Down
1 change: 1 addition & 0 deletions src/modbus-flex-connector.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ <h3>SERIAL options</h3>
<li>msg.payload.commandDelay || node.commandDelay
<li>msg.payload.clientTimeout || node.clientTimeout
<li>msg.payload.reconnectTimeout || node.reconnectTimeout
<li>msg.payload.serialAsciiResponseStartDelimiter || node.serialAsciiResponseStartDelimiter
</ul>
</p>

Expand Down

0 comments on commit 9223695

Please sign in to comment.