Closed titov32 closed 7 months ago
The server can pr definition only have 1 context! This is logical since 1 server == 1 device.
Of course having different server objects would be 1 object = 1 device.
Currently the modbusIdentification is a singleton in the code and thus identical across all server objects.
Pull requests are welcome.
To run on a single device and obtain different contexts, is it necessary to use different instances of the program (docker and others), or is it possible to handle everything within one program?
You need to start multiple programs....A singleton, means there are only 1 object in one program space.
Can you point out the place in the code where the singleton implementation is?
"git grep ModbusDeviceIdentification" is your friend.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
It's probably a question rather than a problem. The same context is used when creating objects, specifically self.identity = ModbusDeviceIdentification(). How to correctly use pymodbus to have different contexts?
Versions
Pymodbus Specific
Description
I create different class modbus server, change self.identity.ProductCode and other parametrs, but when I run them all get one context. I expected different object classes, but get one class.
Code and Logs
2024-01-16 14:45:59,730 : info:70 : INFO : Device type for create coroutine: NDI 2024-01-16 14:45:59,732 : info:70 : INFO : Device type for create coroutine: NAI 2024-01-16 14:45:59,735 : info:30 : INFO : Start Emulator IOD on IP address 10.2.11.9, model: NAI 2024-01-16 14:45:59,735 DEBUG logging:103 Awaiting connections server_listener 2024-01-16 14:45:59,736 : info:30 : INFO : Start Emulator IOD on IP address 10.2.11.2, model: NAI 2024-01-16 14:45:59,736 DEBUG logging:103 Awaiting connections server_listener 2024-01-16 14:45:59,736 DEBUG logging:103 Connected to server 2024-01-16 14:45:59,736 DEBUG logging:103 Connected to server 2024-01-16 14:45:59,736 INFO logging:97 Server listening. 2024-01-16 14:45:59,736 INFO logging:97 Server listening.