All Projects → Cloud-Automation → Node Modbus

Cloud-Automation / Node Modbus

Modbus TCP Client/Server implementation for Node.JS

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Node Modbus

Jlibmodbus
JLibModbus is an implementation of the Modbus protocol v1.1b in java language.
Stars: ✭ 149 (-52.4%)
Mutual labels:  modbus, modbus-tcp
Pyscada
PyScada is a open source scada system that uses the Django framework as backend
Stars: ✭ 233 (-25.56%)
Mutual labels:  modbus, modbus-tcp
J2mod
Enhanced Modbus library implemented in the Java programming language
Stars: ✭ 155 (-50.48%)
Mutual labels:  modbus, modbus-tcp
Modbus Tcp Client
PHP client for Modbus TCP and Modbus RTU over TCP (can be used for serial)
Stars: ✭ 89 (-71.57%)
Mutual labels:  modbus, modbus-tcp
huawei solar
Home Assistant integration for Huawei Solar inverters via Modbus
Stars: ✭ 126 (-59.74%)
Mutual labels:  modbus, modbus-tcp
Modbuspp
A C++ Library for Modbus TCP Protocol
Stars: ✭ 108 (-65.5%)
Mutual labels:  modbus, modbus-tcp
rodbus
Rust implementation of Modbus with idiomatic bindings for C, C++, .NET, and Java
Stars: ✭ 34 (-89.14%)
Mutual labels:  modbus, modbus-tcp
Modbus
Modbus RTU and TCP support for C#
Stars: ✭ 23 (-92.65%)
Mutual labels:  modbus, modbus-tcp
modbus-esp8266
Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.
Stars: ✭ 332 (+6.07%)
Mutual labels:  modbus, modbus-tcp
EasyModbusTCP.Java
EasyModbusTCP library for Java implementation
Stars: ✭ 76 (-75.72%)
Mutual labels:  modbus, modbus-tcp
Pymodbus
A full modbus protocol written in python
Stars: ✭ 1,225 (+291.37%)
Mutual labels:  modbus, modbus-tcp
go-modbus
modbus write in pure go, support rtu,ascii,tcp master library,also support tcp slave.(WIP new implement<old: https://github.com/thinkgos/gomodbus >)
Stars: ✭ 124 (-60.38%)
Mutual labels:  modbus, modbus-tcp
Modbridge
Bridge between modbus and MQTT
Stars: ✭ 20 (-93.61%)
Mutual labels:  modbus, modbus-tcp
Genmon
Generac Generator Monitoring using a Raspberry Pi and WiFi
Stars: ✭ 143 (-54.31%)
Mutual labels:  modbus, modbus-tcp
Gomodbus
A Modbus client in Go
Stars: ✭ 11 (-96.49%)
Mutual labels:  modbus, modbus-tcp
Modbustool
A modbus master and slave test tool with import and export functionality, supports TCP, UDP and RTU.
Stars: ✭ 187 (-40.26%)
Mutual labels:  modbus, modbus-tcp
Easymodbustcp.net
Modbus TCP, Modbus UDP and Modbus RTU client/server library for .NET implementations
Stars: ✭ 358 (+14.38%)
Mutual labels:  modbus, modbus-tcp
Hslcommunication
An industrial IoT underlying architecture framework, focusing on the underlying technical communications and cross-platform, cross-language communication functions, to achieve a variety of mainstream PLC data reading and writing, to achieve modbus of various protocols read and write, and so on, to support the rapid construction of industrial upper computer software, configuration software, SCADA software, factory mes system, To help enterprise Industry 4.0 take-off, to achieve intelligent manufacturing, smart factory goals. The main PLC contains Siemens, Mitsubishi, Omron, Panasonic, Modbus, AB-PLC, Redis
Stars: ✭ 816 (+160.7%)
Mutual labels:  modbus, modbus-tcp
Mbusd
Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.
Stars: ✭ 233 (-25.56%)
Mutual labels:  modbus, modbus-tcp
ModbusMechanic
Cross platform GUI MODBUS TCP/RTU simulator & gateway. Interprets data types including ascii float and int.
Stars: ✭ 63 (-79.87%)
Mutual labels:  modbus, modbus-tcp

A simple an easy to use Modbus TCP client/server implementation.

JavaScript Style Guide

Modbus Build Status

Modbus is a simple Modbus TCP/RTU Client/Server with a simple API. It supports modbus function codes 1 - 6 and 15 and 16.

Status

Version 4.0.0 is a early beta release. Please use and test it and help make it better. We keep you posted on the status of this module.

Installation

Just type npm install jsmodbus and you are ready to go. You can also install this module globally and use the Command Line Interface. Simply type npm install -g jsmodbus.

CLI

Version 4 offers a Command Line Interface. Just install the module globally and type jsmodbus --help to get some more Information.

Testing

The test files are implemented using mocha and sinon.

Simply npm install -g mocha and npm install -g sinon. To run the tests type from the projects root folder mocha test/*.

Please feel free to fork and add your own tests.

Debugging

If you want to see some debugging information, since Version 3 we use the debug module. You can filter the debug output by defining the DEBUG environment variable like so export DEBUG=*

TCP Client Example

// create a tcp modbus client
const Modbus = require('jsmodbus')
const net = require('net')
const socket = new net.Socket()
const client = new Modbus.client.TCP(socket, unitId)
const options = {
'host' : host
'port' : port
}

RTU Client Example

// create a tcp modbus client
const Modbus = require('jsmodbus')
const SerialPort = require('serialport')
const options = {
baudRate: 57600
}
const socket = new SerialPort("/dev/tty-usbserial1", options)
const client = new Modbus.client.RTU(socket, address)

Client API Example

// for reconnecting see node-net-reconnect npm module

// use socket.on('open', ...) when using serialport
socket.on('connect', function () {

// make some calls

client.readCoils(0, 13).then(function (resp) {

// resp will look like { response : [TCP|RTU]Response, request: [TCP|RTU]Request }
// the data will be located in resp.response.body.coils: <Array>, resp.response.body.payload: <Buffer>

console.log(resp);

}, console.error);

});

socket.connect(options)

Keeping TCP Connections alive

I've written a module to keep net.Socket connections alive by emitting TCP Keep-Alive messages. Have a look at the node-net-reconnect module.

Server example

const modbus = require('jsmodbus')
const net = require('net')
const netServer = new net.Server()
const server = new modbus.server.TCP(netServer)

netServer.listen(502)

License (MIT)

Copyright (C) 2017 Stefan Poeter (Stefan.Poeter[at]cloud-automation.de)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].