node-modbus-serial
node-modbus-serial copied to clipboard
Timeouts when I d'ont include sleeps
Hi,
I'm having a lot a Timeouts when using Modbus RTU calls. The only wait I found to prevent it is using "sleeps" but I don't think it is nice and I would like to understand why.
I'm having the issue with several products. I tested with Python, I did not have Timeouts. So I thing it is related to the modbus library.
All my files are available at https://gist.github.com/LeNouveau/bf5861e75a5b9eee76cb1dd17db775a3.
My questions will be related to index.ts
, line 71~72.
-
Why do I have so many Timeouts without adding a sleep ? Did I miss a step ? What is the best practice ?
-
Why does my 1ms sleep generates +10~20ms for each call ? Is it the time required to load the context of the "fake function" ? But why not always, then ? Is the modbus-serial library doing something ?
Thanks for your help. Regards, LeNouveau