A pure JavaScript implementation of MODBUS-RTU (Serial and TCP) for Node.js to communicate with industrial devices.
modbus-serial is a Node.js library that implements the MODBUS-RTU and MODBUS-TCP protocols in pure JavaScript. It allows developers to communicate with industrial electronic devices, such as PLCs, irrigation controllers, and robots, over serial lines (e.g., RS485, RS232) or TCP/IP networks. The library supports standard MODBUS function codes for reading and writing data to devices, making it a versatile tool for industrial automation and IoT projects.
Developers and engineers working on industrial automation, IoT, or robotics projects that require communication with MODBUS-enabled devices. It is particularly useful for Node.js developers integrating with PLCs, Arduino-based systems, or other industrial equipment.
Developers choose modbus-serial because it is a pure JavaScript implementation with no native dependencies for TCP/UDP usage, making it easy to install and deploy. It supports multiple transport protocols (serial, TCP, UDP, Telnet) and includes both client and server modes, offering flexibility for various industrial communication scenarios.
A pure JavaScript implemetation of MODBUS-RTU (and TCP) for NodeJS
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements MODBUS protocols without native dependencies for TCP/UDP, enabling easier deployment in environments where serial hardware isn't needed, as highlighted by the optional serialport dependency.
Supports MODBUS-RTU, MODBUS-TCP, UDP, Telnet, and ASCII, covering a wide range of industrial communication scenarios, as evidenced by the multiple port classes and examples in the README.
Includes both client classes for querying devices and a ServerTCP class for creating MODBUS-TCP servers, offering flexibility for testing and simulation, with detailed vector-based examples provided.
Implements standard MODBUS function codes (FC1-FC16, FC22, FC43/14), allowing complete read/write operations on coils, registers, and device identification, as listed in the compatibility table.
The optional serialport dependency can cause installation headaches, requiring specific npm flags or manual installation, and serial-specific APIs fail at runtime if not properly set up, as warned in the README.
Server functionality is primarily for TCP; serial server support is less documented or might be incomplete, limiting its use for serial-based master devices compared to the robust TCP server examples.
As a pure JavaScript library, it may not match the performance of native C++ bindings for high-frequency data polling or latency-sensitive applications, which could be a bottleneck in industrial automation.