Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit ID of master PLC connecting to slave #43

Open
ThriftyNick opened this issue Nov 14, 2019 · 1 comment
Open

Unit ID of master PLC connecting to slave #43

ThriftyNick opened this issue Nov 14, 2019 · 1 comment

Comments

@ThriftyNick
Copy link

ThriftyNick commented Nov 14, 2019

I'm running the slave to capture incoming modbus messages. I need to be able to identify the source of these incoming messages. When I run the slave in debug, I can get the Unit ID of the master from request.serverAddress. The problem is that the request is locked down inside RequestHandlerTCP that is set in ModbusSlaveTCP.run and placed in the slave's treadPool, which is private. Is there another way of differentiating the source of incoming modbus events? I could get the IP inside the ModbusSlaveTcpObserver.clientAccepted, but that doesn't help if there are multiple simultaneous incoming messages from different devices.

@ThriftyNick
Copy link
Author

It looks like in RequestHandlerTCP.run there is a condition that tests the incoming request server address is equal to slave.serverAddress. I'm going to try removing that condition since I want all requests from many devices to be handled. Is there a good reason for that condition to be in place? Maybe my whole approach is wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant