node-red-contrib-modbus
Advanced tools
Comparing version 2.0.1-beta.1 to 2.0.1
@@ -5,4 +5,30 @@ # Change Log | ||
<a name="2.0.1-beta.5"></a> | ||
## [2.0.1-beta.5](https://github.com/biancode/node-red-contrib-modbus/compare/v2.0.1-beta.4...v2.0.1-beta.5) (2017-10-02) | ||
<a name="2.0.1-beta.4"></a> | ||
## [2.0.1-beta.4](https://github.com/biancode/node-red-contrib-modbus/compare/v2.0.1-beta.3...v2.0.1-beta.4) (2017-10-02) | ||
* breaking change for the queue info node to work without the Node-RED catch node | ||
* new Modbus Flex Server ( flexible server of modbus-serial ) | ||
* upgrade to serialport 5.x | ||
* upgrade to node-modbus 4.x | ||
* upgrade to debug 3.x | ||
* using vm2 sandboxes | ||
* locales updates | ||
<a name="2.0.1-beta.3"></a> | ||
## [2.0.1-beta.3](https://github.com/biancode/node-red-contrib-modbus/compare/v2.0.1-beta.2...v2.0.1-beta.3) (2017-10-02) | ||
<a name="2.0.1-beta.2"></a> | ||
## [2.0.1-beta.2](https://github.com/biancode/node-red-contrib-modbus/compare/v2.0.1-beta.1...v2.0.1-beta.2) (2017-09-29) | ||
<a name="2.0.1-beta.1"></a> | ||
## [2.0.1-beta.1](https://github.com/biancode/node-red-contrib-modbus/compare/v2.0.1-beta.0...v2.0.1-beta.1) (2017-09-26) | ||
## [2.0.1-beta.1](https://github.com/biancode/node-red-contrib-modbus/compare/v1.0.16...v2.0.1-beta.1) (2017-09-29) | ||
@@ -27,7 +53,8 @@ | ||
<a name="1.2.0"></a> | ||
# [1.2.0](https://github.com/biancode/node-red-contrib-modbus/compare/v1.1.0...v1.2.0) (2017-07-02) | ||
# [1.2.0](https://github.com/biancode/node-red-contrib-modbus/compare/v1.1.0...v1.2.0) (2017-07-19) | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/biancode/node-red-contrib-modbus/compare/v1.0.0...v1.1.0) (2017-07-02) | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/biancode/node-red-contrib-modbus/compare/v1.0.16...v1.1.0) (2017-07-02) | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2017-01-18) |
@@ -11,3 +11,3 @@ /** | ||
var de = de || {biancoroyal: {modbus: {core: {client: {}}}}} // eslint-disable-line no-use-before-define | ||
de.biancoroyal.modbus.core.client.internalDebug = de.biancoroyal.modbus.core.client.internalDebug || require('debug')('node_red_contrib_modbus:client') // eslint-disable-line no-use-before-define | ||
de.biancoroyal.modbus.core.client.internalDebug = de.biancoroyal.modbus.core.client.internalDebug || require('debug')('contribModbus:core:client') // eslint-disable-line no-use-before-define | ||
de.biancoroyal.modbus.core.client.modbusSerialDebug = de.biancoroyal.modbus.core.client.modbusSerialDebug || require('debug')('modbus-serial') // eslint-disable-line no-use-before-define | ||
@@ -14,0 +14,0 @@ de.biancoroyal.modbus.core.client.Stately = de.biancoroyal.modbus.core.client.Stately || require('stately.js') // eslint-disable-line no-use-before-define |
@@ -9,5 +9,6 @@ { | ||
"address": "Address", | ||
"quantity": "Quantity" | ||
"quantity": "Quantity", | ||
"simpleNegatives": "Negative UInt" | ||
} | ||
} | ||
} |
@@ -278,3 +278,3 @@ /** | ||
} catch (err) { | ||
verboseLog(err) | ||
verboseLog(err.message) | ||
} | ||
@@ -294,3 +294,3 @@ } | ||
if (!node.checkUnitId(node.unit_id)) { | ||
node.error('wrong unit-id (0..255)', {payload: node.unit_id}) | ||
node.error(new Error('wrong unit-id (0..255)'), {payload: node.unit_id}) | ||
node.statlyMachine.failure() | ||
@@ -336,3 +336,3 @@ return | ||
if (!node.checkUnitId(node.unit_id)) { | ||
node.error('wrong unit-id serial (1..247)', {payload: node.unit_id}) | ||
node.error(new Error('wrong unit-id serial (1..247)'), {payload: node.unit_id}) | ||
node.statlyMachine.failure() | ||
@@ -475,3 +475,3 @@ return | ||
if (node.messageAllowedStates.indexOf(state) === -1) { | ||
cberr('FSM Not Ready To Read', msg) | ||
cberr(new Error('FSM Not Ready To Read'), msg) | ||
return | ||
@@ -559,3 +559,3 @@ } | ||
node.activateSending(msg) | ||
cberr('Function Code Unknown', msg) | ||
cberr(new Error('Function Code Unknown'), msg) | ||
coreModbusClient.modbusSerialDebug('Function Code Unknown %s', JSON.stringify(msg)) | ||
@@ -570,3 +570,3 @@ break | ||
if (node.messageAllowedStates.indexOf(state) === -1) { | ||
cberr('FSM Not Ready To Write', msg) | ||
cberr(new Error('FSM Not Ready To Write'), msg) | ||
return | ||
@@ -615,4 +615,4 @@ } | ||
node.activateSending(msg) | ||
cberr('Quantity should be less or equal to coil payload array length: ' + | ||
msg.payload.value.length + ' Addr: ' + msg.payload.address + ' Q: ' + msg.payload.quantity, msg) | ||
cberr(new Error('Quantity should be less or equal to coil payload array length: ' + | ||
msg.payload.value.length + ' Addr: ' + msg.payload.address + ' Q: ' + msg.payload.quantity), msg) | ||
} else { | ||
@@ -642,4 +642,4 @@ node.client.writeCoils(parseInt(msg.payload.address), msg.payload.value).then(function (resp) { | ||
node.activateSending(msg) | ||
cberr('Quantity should be less or equal to register payload array length: ' + | ||
msg.payload.value.length + ' Addr: ' + msg.payload.address + ' Q: ' + msg.payload.quantity, msg) | ||
cberr(new Error('Quantity should be less or equal to register payload array length: ' + | ||
msg.payload.value.length + ' Addr: ' + msg.payload.address + ' Q: ' + msg.payload.quantity), msg) | ||
} else { | ||
@@ -668,3 +668,3 @@ node.client.writeRegisters(parseInt(msg.payload.address), msg.payload.value).then(function (resp) { | ||
node.activateSending(msg) | ||
cberr('Function Code Unknown', msg) | ||
cberr(new Error('Function Code Unknown'), msg) | ||
coreModbusClient.modbusSerialDebug('Function Code Unknown %s', JSON.stringify(msg)) | ||
@@ -762,3 +762,3 @@ break | ||
}).catch(function (err) { | ||
verboseLog(err) | ||
verboseLog(err.message) | ||
done() | ||
@@ -765,0 +765,0 @@ }) |
@@ -17,3 +17,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:flex:connector') | ||
@@ -72,3 +72,3 @@ function ModbusFlexConnector (config) { | ||
setNodeStatusTo(modbusClient.statlyMachine.getMachineState()) | ||
verboseLog(JSON.toString(msg)) | ||
verboseLog(msg) | ||
} | ||
@@ -81,6 +81,6 @@ | ||
} else { | ||
node.error('Payload Not Valid - Connector Type', msg) | ||
node.error(new Error('Payload Not Valid - Connector Type'), msg) | ||
} | ||
} else { | ||
node.error('Payload Not Valid', msg) | ||
node.error(new Error('Payload Not Valid'), msg) | ||
} | ||
@@ -105,3 +105,3 @@ }) | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -124,2 +124,4 @@ } | ||
if (err) { | ||
internalDebugLog(err.message) | ||
switch (err.message) { | ||
@@ -140,3 +142,3 @@ case 'Timed out': | ||
default: | ||
setNodeStatusTo('error: ' + JSON.stringify(err)) | ||
setNodeStatusTo('error ' + err.message) | ||
if (node.showErrors) { | ||
@@ -143,0 +145,0 @@ node.error(err, msg) |
@@ -17,3 +17,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:flex:getter') | ||
@@ -99,3 +99,3 @@ function ModbusFlexGetter (config) { | ||
setNodeStatusTo(modbusClient.statlyMachine.getMachineState()) | ||
verboseLog(JSON.toString(msg)) | ||
verboseLog(msg) | ||
} | ||
@@ -126,3 +126,3 @@ | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -149,2 +149,4 @@ } | ||
if (err) { | ||
internalDebugLog(err.message) | ||
switch (err.message) { | ||
@@ -165,3 +167,3 @@ case 'Timed out': | ||
default: | ||
setNodeStatusTo('error: ' + JSON.stringify(err)) | ||
setNodeStatusTo('error ' + err.message) | ||
if (node.showErrors) { | ||
@@ -168,0 +170,0 @@ node.error(err, msg) |
@@ -18,3 +18,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:flex:server') | ||
@@ -62,3 +62,3 @@ function ModbusFlexServer (config) { | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -130,3 +130,3 @@ } | ||
setNodeStatusTo('error') | ||
internalDebugLog(err) | ||
internalDebugLog(err.message) | ||
@@ -133,0 +133,0 @@ node.server.close(function () { |
@@ -17,3 +17,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:flex:write') | ||
@@ -108,3 +108,3 @@ function ModbusFlexWrite (config) { | ||
setNodeStatusTo(modbusClient.statlyMachine.getMachineState()) | ||
verboseLog(JSON.toString(msg)) | ||
verboseLog(msg) | ||
} | ||
@@ -114,3 +114,3 @@ | ||
} else { | ||
node.error('Payload Not Valid', msg) | ||
node.error(new Error('Payload Not Valid'), msg) | ||
} | ||
@@ -136,3 +136,3 @@ }) | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -159,2 +159,4 @@ } | ||
if (err) { | ||
internalDebugLog(err.message) | ||
switch (err.message) { | ||
@@ -175,3 +177,3 @@ case 'Timed out': | ||
default: | ||
setNodeStatusTo('error: ' + JSON.stringify(err)) | ||
setNodeStatusTo('error ' + err.message) | ||
if (node.showErrors) { | ||
@@ -178,0 +180,0 @@ node.error(err, msg) |
@@ -17,3 +17,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:getter') | ||
@@ -86,3 +86,3 @@ function ModbusGetter (config) { | ||
setNodeStatusTo(modbusClient.statlyMachine.getMachineState()) | ||
verboseLog(JSON.toString(msg)) | ||
verboseLog(msg) | ||
} | ||
@@ -126,3 +126,3 @@ | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -149,2 +149,4 @@ } | ||
if (err) { | ||
internalDebugLog(err.message) | ||
switch (err.message) { | ||
@@ -165,3 +167,3 @@ case 'Timed out': | ||
default: | ||
setNodeStatusTo('error: ' + JSON.stringify(err)) | ||
setNodeStatusTo('error ' + err.message) | ||
if (node.showErrors) { | ||
@@ -168,0 +170,0 @@ node.error(err, msg) |
@@ -16,3 +16,3 @@ /** | ||
'use strict' | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:queue') | ||
@@ -67,3 +67,3 @@ function ModbusQueueInfo (config) { | ||
node.lowLevelReached = true | ||
internalDebugLog({ | ||
let msg = { | ||
payload: Date.now(), | ||
@@ -73,3 +73,6 @@ state: 'low level reached', | ||
items: items | ||
}) | ||
} | ||
internalDebugLog(msg) | ||
node.send(msg) | ||
} | ||
@@ -79,20 +82,17 @@ | ||
node.highLevelReached = true | ||
let msg = { | ||
payload: Date.now(), | ||
state: 'high level reached', | ||
unitid: unit, | ||
highLevel: node.highLevel, | ||
items: items | ||
} | ||
if (node.errorOnHighLevel) { | ||
node.error('Queue High Level Reached', { | ||
payload: Date.now(), | ||
state: 'high level reached', | ||
unitid: unit, | ||
highLevel: node.highLevel, | ||
items: items | ||
}) | ||
node.error(new Error('Queue High Level Reached'), msg) | ||
} else { | ||
node.warn({ | ||
payload: Date.now(), | ||
state: 'high level reached', | ||
unitid: unit, | ||
highLevel: node.highLevel, | ||
items: items | ||
}) | ||
node.warn(msg) | ||
} | ||
node.send(msg) | ||
} | ||
@@ -102,3 +102,3 @@ | ||
node.highHighLevelReached = true | ||
node.error('Queue High High Level Reached', { | ||
let msg = { | ||
payload: Date.now(), | ||
@@ -110,3 +110,5 @@ state: 'high high level reached', | ||
items: items | ||
}) | ||
} | ||
node.error(new Error('Queue High High Level Reached'), msg) | ||
node.send(msg) | ||
} | ||
@@ -180,5 +182,15 @@ | ||
}) | ||
let result = { | ||
payload: Date.now(), | ||
state: 'queue reset done', | ||
unitid: msg.unitid, | ||
lowlowLevel: node.lowlowLevel, | ||
lowLevel: node.lowLevel, | ||
highLevel: node.highLevel, | ||
highHighLevel: node.highHighLevel | ||
} | ||
node.send(result) | ||
} | ||
node.send(msg) | ||
}) | ||
@@ -185,0 +197,0 @@ |
@@ -19,3 +19,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:read') | ||
@@ -104,3 +104,3 @@ function ModbusRead (config) { | ||
setNodeStatusTo('polling') | ||
verboseLog(JSON.toString(msg)) | ||
verboseLog(msg) | ||
} | ||
@@ -149,3 +149,3 @@ | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -189,2 +189,4 @@ } | ||
if (err) { | ||
internalDebugLog(err.message) | ||
switch (err.message) { | ||
@@ -206,3 +208,3 @@ case 'Timed out': | ||
default: | ||
setNodeStatusTo('error: ' + JSON.stringify(err)) | ||
setNodeStatusTo('error ' + err.message) | ||
if (node.showErrors) { | ||
@@ -209,0 +211,0 @@ node.error(err, msg) |
@@ -20,3 +20,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:response') | ||
@@ -34,3 +34,3 @@ function ModbusResponse (config) { | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -37,0 +37,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:server') | ||
@@ -50,3 +50,3 @@ function ModbusServer (config) { | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -53,0 +53,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
let mbBasics = require('./modbus-basics') | ||
let internalDebugLog = require('debug')('node_red_contrib_modbus') | ||
let internalDebugLog = require('debug')('contribModbus:write') | ||
@@ -73,3 +73,3 @@ function ModbusWrite (config) { | ||
setNodeStatusTo('payload error') | ||
node.error('invalid msg.payload', msg) | ||
node.error(new Error('Invalid msg.payload'), msg) | ||
return | ||
@@ -92,3 +92,3 @@ } | ||
setNodeStatusTo(modbusClient.statlyMachine.getMachineState()) | ||
verboseLog(JSON.toString(msg)) | ||
verboseLog(msg) | ||
} | ||
@@ -131,3 +131,3 @@ | ||
if (RED.settings.verbose) { | ||
internalDebugLog(logMessage) | ||
internalDebugLog((typeof logMessage === 'string') ? logMessage : JSON.stringify(logMessage)) | ||
} | ||
@@ -141,3 +141,3 @@ } | ||
function setNodeStatusTo (statusValue) { | ||
let statusOptions = mbBasics.set_node_status_properties(statusValue, false) | ||
let statusOptions = mbBasics.set_node_status_properties(statusValue, node.showStatusActivities) | ||
if (mbBasics.statusLog) { | ||
@@ -157,2 +157,4 @@ verboseLog('status options: ' + JSON.stringify(statusOptions)) | ||
if (err) { | ||
internalDebugLog(err.message) | ||
switch (err.message) { | ||
@@ -173,3 +175,3 @@ case 'Timed out': | ||
default: | ||
setNodeStatusTo('error: ' + JSON.stringify(err)) | ||
setNodeStatusTo('error ' + err.message) | ||
if (node.showErrors) { | ||
@@ -176,0 +178,0 @@ node.error(err, msg) |
{ | ||
"name": "node-red-contrib-modbus", | ||
"version": "2.0.1-beta.1", | ||
"version": "2.0.1", | ||
"private": false, | ||
@@ -9,3 +9,3 @@ "description": "The all in one Modbus TCP and Serial contribution package for Node-RED.", | ||
"node-modbus": "4.0.1", | ||
"modbus-serial": "6.0.0", | ||
"modbus-serial": "6.0.1", | ||
"serialport": "5.0.0", | ||
@@ -75,5 +75,6 @@ "stampit": "2.1.2", | ||
"scripts": { | ||
"test": "standard --fix && mocha test/*", | ||
"build": "standard --fix && gulp publish", | ||
"prepublish": "npm run build && npm test", | ||
"test": "standard --fix && mocha test/* --reporter dot", | ||
"build": "standard --fix && gulp clean && gulp publish", | ||
"prepublish": "standard --fix && npm run build && npm test", | ||
"ci-publish": "ci-publish", | ||
"release": "standard-version" | ||
@@ -83,3 +84,3 @@ }, | ||
"chai": "^4.1.2", | ||
"eslint": "^4.7.2", | ||
"eslint": "^4.8.0", | ||
"eslint-config-standard": "^10.2.1", | ||
@@ -89,3 +90,3 @@ "eslint-config-standard-jsx": "^4.0.2", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^7.3.0", | ||
"eslint-plugin-react": "^7.4.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
@@ -100,7 +101,7 @@ "gulp": "^3.9.1", | ||
"mocha": "^3.5.3", | ||
"nock": "^9.0.19", | ||
"nock": "^9.0.22", | ||
"node-red": "^0.17.5", | ||
"pump": "^1.0.2", | ||
"should": "^13.1.0", | ||
"sinon": "^3.3.0", | ||
"sinon": "^4.0.0", | ||
"standard": "^10.0.3", | ||
@@ -107,0 +108,0 @@ "standard-version": "^4.2.0", |
@@ -22,3 +22,3 @@ ![Node-RED Modbus](http://b.repl.ca/v1/Node--RED-Modbus-green.png) | ||
* works with queueing per unit and round robin scheduling | ||
* Node.JS 4.x is supported in v1.x | ||
* Node.JS 4.x is supported with v1.x | ||
* prepared for the next LTS of Node.js v8.x | ||
@@ -45,6 +45,7 @@ | ||
npm install node-red-contrib-modbus@1.2.2 | ||
or | ||
npm install node-red-contrib-modbus@1.3.0 | ||
npm install -g node-red-contrib-modbus@1.2.2 | ||
or global by | ||
npm install -g node-red-contrib-modbus@1.3.0 | ||
@@ -65,4 +66,23 @@ # How to use | ||
DEBUG=node_red_contrib_modbus node-red -v | ||
DEBUG=contribModbus*,modbus-serial node-red -v | ||
or | ||
DEBUG=contribModbus:{option},contribModbus:{option},... | ||
## Options | ||
* core | ||
* core:client | ||
* read | ||
* write | ||
* server | ||
* response | ||
* flex | ||
* flex:getter | ||
* flex:write | ||
* flex:connector | ||
* flex:server | ||
* modbus-serial | ||
see [Wiki][10] pages to get more options in detail | ||
@@ -69,0 +89,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3114581
6664
1
110
+ Addedmodbus-serial@6.0.1(transitive)
- Removedmodbus-serial@6.0.0(transitive)
Updatedmodbus-serial@6.0.1