LamaPLC: S7-1500 and Metrawatt EM2389 Modbus TCP communication

Metrawatt EM2389

Metrawatt EM2389 The MID approved meters can be used to acquire and bill active energy in industrial, household, commercial and building management applications.

The new generation of ENERGYMID energy meters opens up entirely new levels of transparency within your electrical system. In addition to energy, up to 33 other mains parameters are acquired by the multifunctional variant.

Communication via M-Bus, LON, Modbus TCP / BACnet, Modbus RTU, pulse output possible.

>> More information

TIA Portal / Simatic S7-1500

Wiring schema

TIA Portal / Simatic S7-1500 Modbus communication wiring schema

  • Modbus communication is usually not part of the managed block of the TIA portal, so these modules do not need to be included in the TIA portal (they are not participants in the topology- or network view).
  • The communication to the connected switch can even be Profinet (or IE), the point is that the Switch is “visible” from the PLC (it is not necessary to use a managed switch)
  • It is important that each unit falls into a class 3 IP address range (the first three identifiers must match, e.g. 192.168.178.nn)
  • Both the PLC and the Modbus partner must be accessible with the PING command

Blocks (FBs, DBs)

TIA Portal / Simatic S7-1500 - Metrawatt EM2389 CommunicationmetraWattFB: main program for communication

metraWattDB: measurements in real format

metraWattFB_DB: instant DB from call main prg (automatic generated)

metraWDBModbus: row readed data in word format

ModbusCommBlockMWatt: communication parameters (IP,…)
  • The program should be called from OB1 (it has internal timing)
  • When calling FB, “metraWattFB_DB” is the instant DB (recommended only)
  • The program does not query all data from Metrawatt (but can be expanded if necessary)
  • The Metrawatt modbus register list can be found here (here)
  • The program calls up the data slowly, the entire update takes 4 seconds (because that's enough for me). If faster data reading is required, the parameter t#1s in line 2 of “metraWattFB” must be modified.

This page has been accessed for: Today: 1, Until now: 17