Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

modbus-serial

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modbus-serial - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

5

examples/logger-promise.js
// create an empty modbus client
//var ModbusRTU = require("modbus-serial");
var ModbusRTU = require("../index");
var ModbusRTU = require("modbus-serial");
var client = new ModbusRTU();

@@ -14,4 +13,4 @@

client.readInputRegisters(0, 10)
.then(console.log)
.then(console.lot)
.then(run);
}

2

package.json
{
"name": "modbus-serial",
"version": "2.1.3",
"version": "2.1.4",
"description": "A pure JavaScript implemetation of MODBUS-RTU (and TCP) for NodeJS.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -162,11 +162,13 @@ # modbus-serial

// open connection to a serial port
client.connectRTU("/dev/ttyUSB0", {baudrate: 9600});
client.setID(1);
client.connectRTU("/dev/ttyUSB0", {baudrate: 9600}, run);
// read 2 16bit-registers to get one 32bit number
setTimeout(function() {
function run() {
client.setID(1);
// read 2 16bit-registers to get one 32bit number
client.readInputRegisters(5, 2, function(err, data) {
console.log(data.buffer.readUInt32BE());
var int32 = data.buffer.readUInt32BE();
console.log(int32);
});
}, 1000);
}
```

@@ -173,0 +175,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc