You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to run your SimpleServer example. (examples/javascript/tcp/SimpleServer.ts)
I was trying to use the readHoldingRegisters listener defined in the example.
The issue is that with the defined options for the server these listeners get never called.
This is the case for:
readCoils
readHoldingRegisters
readInputRegisters
readDiscreteInputs
Reason:
When the server.holding option is defined the event gets not triggered.
if(!this._server.coils){debug('no coils buffer on server, trying readCoils handler');this._server.emit('readCoils',request,cb);return;}
see modbus-server-response-handler.js:55
Solution/Workaround:
You can define the server options to undefined. Then the events will be emitted and the listeners get called.
Can you plaese change this in the example or at least add a comment to the example?
Hi @TimT1919 , thanks for the hint and the workaround. Since this is an open source project I welcome every Merge Request developers are submitting. It would be great if you provide one for this case too.
I was trying to run your SimpleServer example. (examples/javascript/tcp/SimpleServer.ts)
I was trying to use the readHoldingRegisters listener defined in the example.
The issue is that with the defined options for the server these listeners get never called.
This is the case for:
Reason:
When the server.holding option is defined the event gets not triggered.
see modbus-server-response-handler.js:55
Solution/Workaround:
You can define the server options to undefined. Then the events will be emitted and the listeners get called.
Can you plaese change this in the example or at least add a comment to the example?
The text was updated successfully, but these errors were encountered: