Comments (8)
Great !
a. can you make a pull request ?
b. can you add this case to the tests ?
from node-modbus-serial.
Hello Yaacov,
before I pull ... and excuse me that I am asking ... I want to understand the current code and what was the initial intention about it in order not destroy your "basic thinking" with my code.
In the buffer examining loop I see the code line
if (unitId !== self._id) continue;
So it loops until it finds the unitid as initial char in the load of the RX buffer ... am I correct that you intended to create a kind of synchronization of where a modbus receive telegram starts in the current load of the RX buffer? Please confirm.
Cause if answer is yes I do have doubts that this will work, cause in my life example you see that also modbus data itself can have the same combo set of unitid and function code. So with this method you will never detect a start of frame securely. Do you agree?
Also I recognized that you are checking for the length of an exception message ... you check for (0x80 | self.cmd) ... this is fine for me ... but don't you agree that the examination of just the unitid and function code | 0x80 you can never be 100% sure that is a real exception message without having also the checksum checked at this point?
from node-modbus-serial.
Hello Yaacov,
i have another dumb question.
Let us suppose I have a "bad working" Modbus RTU slave online that responds instead of an exception or a valid frame with endless chars like e.g. "aaaaaaaa....." forever and forever ... or frames that are anything else than Modbus RTU frames ... in this case the reception "self._buffer" will grow and grow and finally would generate if you wait long enough a "out of memory" error. Do you agree?
So we need also a mechanism to "throw" away frames that are no modbus frames. Do you agree?
from node-modbus-serial.
hi,
a. Yes, we need to deal with modbus frames that start not at the beginning of buffer.
b. Out of memory is something important to fix, maybe in a different pull request ?
c. Make the best you can do, if the tests work, it will be ok, if it start break things that we miss in the test, we will fix it again.
p.s.
Their is always a trade-off between something that we can do and works good, and something that is perfect, but we do not have time to do ... :-)
from node-modbus-serial.
Hi, I finished development but before I am pulling it I want to test it with the test environment
This is why I have extended the rtubufferedport.test.js file locally with my life example above.
But when I start it with "node rtubufferedport.test.js" it runs and exits without any feedback. How do I start this test correctly?
from node-modbus-serial.
run (from root of prject)
npm test
from node-modbus-serial.
p.s.
a. when you do a pull request, tests are run automatically.
b. other people can see what you are doing and comment about it.
from node-modbus-serial.
from node-modbus-serial.
Related Issues (20)
- Port Not Open HOT 2
- Error after updating to 8.0.15 HOT 3
- Usage of isDebugEnabled to check the PDU raw data HOT 3
- Modbus TCP Connection was closed after 100 Seconds of Inactivity HOT 1
- ServerTCP causes uncaught exception if listen fails
- Permission denied, cannot open /dev/ttyUSB0
- Open-close function HOT 11
- Combination of modbus requests in the same TCP Frame. HOT 13
- Destroy function callback never to be called HOT 4
- Modbus RTU - CRC delay HOT 5
- Strange interaction with PLC when writing strings HOT 2
- multiple modbusRTU open/close will end with "Error Resource temporarily unavailable Cannot lock port" HOT 5
- ServerTCP: readHoldingRegisters throws Modbus exception 4: Slave device failure HOT 5
- Error "Buffer is not defined" during start Angular application HOT 7
- Does We have any plan using Typescript to refactor this repo?
- I expect to be able to return a string in the getMultipleInputRegisters method. HOT 6
- closing modbus connection using close() and it will crashing my electron app HOT 1
- ServerTCP getMultipleHoldingRegisters and getMultipleInputRegisters don't work with Promises
- 请问对于float,short,word等不同类型数据该如何读取 HOT 1
- Modbus TCP connect Telnet CRC Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-modbus-serial.