Hello madhouse!
I have successfully tested the proposal.
The results are optimistic.
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)msg : Object
object
payload: 2022-10-15T07:13:47.104Z
_msgid: "b12812a412b53e24"
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)93a8f1f404f0e670 : msg : Object
{ _msgid: "b12812a412b53e24", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a5dabf726ad632b11b2ed", modbusRequest: object … }
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)93a8f1f404f0e670 : msg : Object
{ _msgid: "b12812a412b53e24", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a5dabf726ad632b11b2ee", modbusRequest: object … }
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)93a8f1f404f0e670 : msg : Object
{ _msgid: "b12812a412b53e24", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a5dabf726ad632b11b2ef", modbusRequest: object … }
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)93a8f1f404f0e670 : msg : Object
{ _msgid: "b12812a412b53e24", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a5dabf726ad632b11b2f0", modbusRequest: object … }
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)93a8f1f404f0e670 : msg : Object
{ _msgid: "b12812a412b53e24", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a5dabf726ad632b11b2f1", modbusRequest: object … }
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)93a8f1f404f0e670 : msg : Object
{ _msgid: "b12812a412b53e24", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a5dabf726ad632b11b2f2", modbusRequest: object … }
15/10/2022, 9:13:46[node: byte1](http://homeassistant:8123/api/hassio_ingress/W-k-PM7qxZvF06h4xSYghc_cWI3PuyXykyzxGadY6Qc/#)msg : Object
object
payload: 2022-10-15T07:13:47.280Z
_msgid: "b12812a412b53e24"
The first inquiry is sent to at: 07:13:47.104Z
And the last answer to: 07:13:47.280Z
I understand that we are talking about 176ms? This is really fast
If you want I can lower the bus speed to 9600 to test and compare. It costs me nothing.
I have added delay to finish adjusting the desired speed and continue testing.
I have tested the system consistency but it has a problem. I have disconnected input module 4 and it causes that modules 5 and 6 are not read anymore. In addition, it causes an error in "Modbus Flex Getter" that causes it to initialize.
15/10/2022, 9:45:06node: 32e78ebaf8875bfb
msg : Object
{ payload: 1665819906665, _msgid: "da4a34f05c06afe1" }
15/10/2022, 9:45:06node: 3a125fbe24bc2f1b
93a8f1f404f0e670 : msg : Object
{ _msgid: "da4a34f05c06afe1", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a6502f726ad632b11b375", modbusRequest: object … }
15/10/2022, 9:45:06node: 3a125fbe24bc2f1b
93a8f1f404f0e670 : msg : Object
{ _msgid: "da4a34f05c06afe1", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a6502f726ad632b11b376", modbusRequest: object … }
15/10/2022, 9:45:06node: 3a125fbe24bc2f1b
93a8f1f404f0e670 : msg : Object
{ _msgid: "da4a34f05c06afe1", payload: array[16], topic: "93a8f1f404f0e670", messageId: "634a6503f726ad632b11b377", modbusRequest: object … }
15/10/2022, 9:45:07node: Modbus Flex Getter
msg : string[60]
"Modbus Failure On State sending Get More About It By Logging"
15/10/2022, 9:45:07node: Modbus Flex Getter
msg : error
"Error: Timed out"
15/10/2022, 9:45:07node: 3a125fbe24bc2f1b
93a8f1f404f0e670 : msg : Object
{ topic: "93a8f1f404f0e670", messageId: "634a6503f726ad632b11b378", payload: "", queueLengthByUnitId: object, queueUnitId: 4 … }
15/10/2022, 9:45:08node: 22ca57b398372ef1
function : (error)
"TypeError: Cannot read properties of undefined (reading 'unitid')"
How could you adapt your function so that it will loop as long as an eject is not deactivated? Would I have to create a constant? I'm a bit lost on this.
Thanks again sir