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
- Energy Calculation Architecture in SIMATIC PCS 7
- Energy Accounting Strategies Comparison Matrix
- Step-by-Step Implementation in CFC Using TimeTrig and Delta Logic
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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:
-
Continuous Acquisition: The technological block
PAC3200(FB1085) cyclically reads the raw energy counterActEnergy_Import_T1(Active Energy Imported, Tariff 1) in kWh via channel driverDrvPAC(FB1084). -
Month-Boundary Triggering: An APL
TimeTrig(FB1803) block or SCL routine evaluates CPU system time (SFC1 READ_CLK). At precisely00:00:00on the first calendar day of the month, a single-cycle pulse is generated. -
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:
Step-by-Step Implementation in CFC Using TimeTrig and Delta Logic
To implement the monthly energy calculation in CFC:
-
Acquire Continuous Meter Energy:
- In CFC, ensure thePAC3200block outputActEn_Imp_T1(Active Energy Imported Tariff 1) is active. -
Instantiate Time Trigger Block (
TimeTrig):
- Insert an APLTimeTrig(FB1803) block into the chart.
- ConfigureTimeTrigfor monthly recurrence: set mode to trigger at Day 1, Hour 0, Minute 0.
- The outputOutproduces a clean 1-cycle boolean pulse at midnight on the first of every month. -
Implement Latching Logic in SCL or CFC:
- Create a small SCL Function Block (e.g.,FB_MonthlyTotal) or implement using elementary CFC blocks (Sample & HoldSel08B, SubtracterSub02, MemoryFlipFlop):
```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;
```
- Expose Values to WinCC via OCM:
- AssignS7_m_c = 'true'toKWh_CurrentMonthandKWh_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_Offsetto 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
- SIMATIC PCS 7 Industry Library (V8.1 / V9.0) Function Manual: PAC Integration
- Siemens Industry Online Support: Energy Monitoring and Load Management with PCS 7 Industry Library (Entry ID: 109756832)
- SENTRON PAC3200 Multifunction Meter Equipment Manual
Related Articles
- Integrating SENTRON PAC3200 Energy Meters into SIMATIC PCS 7 APL
- Implementing Daily and Monthly Energy Totalizers with APL TimeTrig in PCS 7
- Resolving CPU Area Length Error in DrvPAC FB1084 When Connecting SENTRON Meters
Related Tags
- PAC3200
- Energy Totalizer
- TimeTrig
- kWh Calculation
- Industry Library