node-modbus | Modbus TCP Client/Server implementation for Node.JS | TCP library
kandi X-RAY | node-modbus Summary
kandi X-RAY | node-modbus Summary
A simple an easy to use Modbus TCP client/server implementation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-modbus
node-modbus Key Features
node-modbus Examples and Code Snippets
Community Discussions
Trending Discussions on node-modbus
QUESTION
I'm trying to set up a listener that accepts modbus RTU polls.
I have found a lot of modbus related npm library but they are all related to polling from other modbus slave, or act as modbus TCP server. I need to simulate the modbus slave, not the poller (act as modbus RTU server)
Edit: I found this library https://github.com/Cloud-Automation/node-modbus
There is a modbus-rtu-server.js file in the source, so I have been trying to use this. However, I'm having trouble understand and use the library without documentation. Here's what I have tried:
...ANSWER
Answered 2019-Jul-08 at 07:05The server is just waiting for a client to connect. For the connect event to happen you have to start a query from a client. That means you need to have a second serial port connected to your /dev/ttyUSB0
and initiate a Modbus query from it. For that you can use the same library or any other tool like modpoll or QModMaster.
You also need to develop a little bit your server, because right now it does not have any registers defined, so it won't be much use.
Look at the TCP examples, in particular the SimpleServer. As you can see there, you need to define the Modbus registers or coils on your server, something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-modbus
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page