Integration

Do the following to integrate the functionality:

  1. Declare the energy meter in a suitable location.
    • stEnergy:EnergyCounter;
  2. Initialize the function block using the Init function.
    • xInitDone:=stEnergy.Init(
      pr_InWs_PointerSet:=ADR(rStartVal),
      sFileName:=’TestSav’
      );
    • The block is initialized with a start value and the name of the file in which the count values are saved.

    INFORMATION

    If no remanent memory is used to determine the initial value, it should be initialized with the value 0. The Init function can be called repeatedly. The transferred changes become active immediately.
  3. Transfer the current power value to the energy meter in a cyclically called method (such as User_PRG.HighPrio):
    • stEnergy.AddPwr(rActPower:=rActPower);
  4. Set the xEnable variable to "TRUE."
    • stEnergy.xEnable:=TRUE;
  • The energy meter is activated and the counting function starts logging values.
  • The values are reset by setting xReset to "TRUE."