You can use this to extend the modbus TCP connections from your Wago EDM Application to multiple modbus TCP servers.
This Python script, collects data from multiple remote Modbus servers and queue them up in a single register sequence.
The order of declared remote modbus registers is also the order in queued modbus register sequence.

To get the data in to the EDM you just can use the standart way, as you would connect any other remote Modbus device.
Edit the >config.json file to configure the WEDME.
"internalConfig": {
"myPort": 5502,
"myStartRegister": 0,
"interval": 2
}| Key | Desrciption |
|---|---|
| myPort | Modbus port for the internal server |
| myStartRegister | The first register where all remote Modbus server data will be queued up |
| interval | Interval in seconds to poll data from remote Modbus servers |
The communication to all remote Modbus devices is configured in the modbusDevices-Array. To add a new connection you simply add following lines and edit your parameters:
{
"name": "ModbusMeter",
"serverIP": "192.168.2.134",
"serverPort": 502,
"mbRegisters": [
{"name": "voltage" , "functionCode": 3, "register": 1280, "length": 1},
{"name": "current", "functionCode": 4, "register": 1, "length": 1},
{"name": "power", "functionCode": 4, "register": 6, "length": 2},
{"name": "energy", "functionCode": 4, "register": 12, "length": 2}
]
}| Key | Desrciption |
|---|---|
| name | User specific devicename (used for Debug) |
| serverIP | The IP adress of your remote Modbus server |
| serverPort | The port of your remote Modbus server |
| mbRegisters | Array of Modbus register calls |
-> you can also add and remove Modbus register calls, every call uses this structure. Multiple calls per device are possible.
{"name": "example", "functionCode": <3-4>, "register": 1234, "length": 1}The config.json file contents an example configuration.
you can use WinScp oder other sftp services. Then you copy then wedme.tar and config.json file in the folder. For example the folder /home/wedme/
docker load --input /home/wedme/wedme.tar
then there musst be this text: Loaded image: wedme:1.0.0
docker run -dit -p5502:5502 -v /home/wedme/config.json:/app/config.json --restart=always --name=wedme wedme:1.0.0 app.py
