Implementing Monthly Energy Totalizers for PAC3200 Meters in PCS 7

Implementing Monthly Energy Totalizers for PAC3200 Meters in PCS 7

To calculate current-month and previous-month kilowatt-hour (kWh) consumption using SENTRON PAC3200 meters in SIMATIC PCS 7 V8.1/V9.0, do not attempt to reset the physical meter hardware counters monthly, as physical resets destroy cumulative utility audit registers. Instead, implement a software delta calculation in the S7-400 controller conforming to the Siemens Industry Library Energy Monitoring template. Using an APL TimeTrig block or SCL logic that detects the first minute of each month (Day = 1, Hour = 0, Minute = 0), capture the cumulative meter reading as a monthly baseline offset; current-month consumption is calculated dynamically as cumulative energy minus the offset, while the previous month's final total is latched into a permanent holding variable.

Table of Contents

Hardware Meter Persistence vs Software Accounting

SENTRON PAC3200 and PAC4200 power meters integrate non-volatile hardware registers that accumulate total Active Energy (kWh) over the lifetime of the installation. In industrial power distribution, utility billing, and ISO 50001 energy management audits, the physical meter reading must remain continuous and monotonic.

While the PAC3200 block faceplate provides an operator command to reset internal device counters, triggering an automated monthly reset on the physical hardware register is poor engineering practice: it introduces rollover calculation anomalies, causes communication contention, and erases historical hardware verification. The standardized, certified Siemens solution is maintaining continuous hardware accumulation while calculating periodic consumption (hourly, daily, monthly) entirely in software within the S7-400 CPU.

Energy Calculation Architecture in SIMATIC PCS 7

As documented in the official application example 'Energy monitoring and load management with PCS 7 Industry Library', periodic energy tracking utilizes a baseline offset model:

  1. Continuous Acquisition: The technological block PAC3200 (FB1085) cyclically reads the raw energy counter ActEnergy_Import_T1 (Active Energy Imported, Tariff 1) in kWh via channel driver DrvPAC (FB1084).

  2. Month-Boundary Triggering: An APL TimeTrig (FB1803) block or SCL routine evaluates CPU system time (SFC1 READ_CLK). At precisely 00:00:00 on the first calendar day of the month, a single-cycle pulse is generated.

  3. Baseline Offset Calculation:
    - On trigger, the previous month's consumption is archived: $$\text{KWh}{\text{LastMonth}} = \text{KWh}$$}
    - The current meter reading is latched as the new baseline: $$\text{Offset}{\text{Month}} = \text{ActEnergy}$$}
    - During the active month, current consumption updates cyclically: $$\text{KWh}{\text{CurrentMonth}} = \text{ActEnergy}$$}} - \text{Offset}_{\text{Month}

Energy Accounting Strategies Comparison Matrix

The following table compares approaches for calculating periodic electrical consumption in PCS 7:

Calculation ApproachHardware Counter ImpactAudit Trail IntegrityImplementation ComplexityRobustness on CPU RestartPhysical PAC Hardware ResetResets physical register to 0Fails (Destroys cumulative audit)High (Requires command writes)Poor (Risk of failed resets)APL TotalL IntegratorNone (Integrates kW power)Moderate (Integration drift errors)Low (Standard APL block)Moderate (Work memory dependent)Baseline Offset Model (SCL/CFC)None (Continuous)100% Audit CompliantLow to MediumHigh (Preserved in DB)WinCC Tag Logging CalculationNoneHigh (HMI level)Low (Scripting in WinCC)Poor (Fails if OS client stops)

Step-by-Step Implementation in CFC Using TimeTrig and Delta Logic

To implement the monthly energy calculation in CFC:

  1. Acquire Continuous Meter Energy:
    - In CFC, ensure the PAC3200 block output ActEn_Imp_T1 (Active Energy Imported Tariff 1) is active.

  2. Instantiate Time Trigger Block (TimeTrig):
    - Insert an APL TimeTrig (FB1803) block into the chart.
    - Configure TimeTrig for monthly recurrence: set mode to trigger at Day 1, Hour 0, Minute 0.
    - The output Out produces a clean 1-cycle boolean pulse at midnight on the first of every month.

  3. Implement Latching Logic in SCL or CFC:
    - Create a small SCL Function Block (e.g., FB_MonthlyTotal) or implement using elementary CFC blocks (Sample & Hold Sel08B, Subtracter Sub02, Memory FlipFlop):
    ```pascal
    // SCL Month Boundary Calculation
    IF MonthlyTrigger AND NOT Trig_Edge THEN
    KWh_LastMonth := Current_Energy_Raw - Month_Offset;
    Month_Offset := Current_Energy_Raw;
    END_IF;
    Trig_Edge := MonthlyTrigger;

// Continuous Real-Time Calculation
KWh_CurrentMonth := Current_Energy_Raw - Month_Offset;
```

  1. Expose Values to WinCC via OCM:
    - Assign S7_m_c = 'true' to KWh_CurrentMonth and KWh_LastMonth.
    - Run a Changes-Only OS Compile.
    - Display both values on the WinCC electrical overview graphic and energy dashboard.

Verification

Verify monthly energy tracking:
1. In CFC, test the trigger by simulating a pulse into the MonthlyTrigger input.
2. Verify that KWh_LastMonth captures the current total, while KWh_CurrentMonth immediately resets to 0.0 kWh.
3. Allow the PAC3200 meter to accumulate load; verify that KWh_CurrentMonth increases incrementally in exact synchronization with the physical meter display.
4. Check WinCC Runtime to confirm that both tags update live and archive into historical trend tables.

Limitations and Operational Precautions

  • Meter Replacement Handling: If a physical PAC3200 meter is replaced in the field, the new meter reading will start from 0, resulting in a negative calculation. Incorporate a reset button in CFC to initialize Month_Offset to the new meter baseline.
  • Time Synchronization Dependency: The S7-400 CPU must be time-synchronized via SICLOCK or NTP. If controller time jumps or fluctuates, monthly triggers can misfire.
  • Counter Rollover: The PAC3200 energy register rolls over after reaching 999,999,999 kWh. Incorporate rollover detection logic if deployed on ultra-high-consumption utility substations.

Engineer FAQ

Why shouldn't I reset the PAC3200 counter directly from the PLC?

Writing counter reset commands over PROFIBUS/PROFINET requires acyclic communication (SFB53 WRREC). If communication fails during the write, the reset is missed, and physical audit history is destroyed.

Can I use the APL TotalL block for monthly energy calculation?

TotalL can calculate totalized energy by integrating instantaneous active power (kW), but integration involves mathematical approximation drift. Subtracting physical PAC cumulative kWh readings is 100% exact.

Where can I find the official Siemens SCL source code for this?

Siemens provides complete SCL source code in the application example 'Energy Monitoring and Load Management with PCS 7 Industry Library' (SIOS Entry ID: 109756832).

What happens to the monthly calculation if the CPU is powered off at midnight?

If the CPU is unpowered when midnight passes, the TimeTrig pulse is missed. Robust logic compares current month number (DATE_AND_TIME) with a stored month variable to detect missed transitions upon restart.

Technical References

Related Articles

Related Tags

  • PAC3200
  • Energy Totalizer
  • TimeTrig
  • kWh Calculation
  • Industry Library
6 respuestas