Skip to content

MichaelDrostWago/WEDME

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

WEDME Wage EDM Modbus Extension

You can use this to extend the modbus TCP connections from your Wago EDM Application to multiple modbus TCP servers.

1. Function

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. image

To get the data in to the EDM you just can use the standart way, as you would connect any other remote Modbus device.

2. Configuration

Edit the >config.json file to configure the WEDME.

2.1 Internal Modbus Server Configuration

  "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

2.2 Modbus Device Configuration

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}

2.3 example Configuration

The config.json file contents an example configuration.

3. Run in Docker Container on EDM-PLC

3.1 copy packed container image to your Wago plc

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/

image

3.2 unpack an load docker image

docker load --input /home/wedme/wedme.tar

then there musst be this text: Loaded image: wedme:1.0.0

3.3 start the docker container with your config:

docker run -dit -p5502:5502 -v /home/wedme/config.json:/app/config.json --restart=always --name=wedme wedme:1.0.0  app.py

About

Wago EDM Modbus Extension to get more data from different Modbus Servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages