×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 81715807, Entry date: 06/20/2016
(0)
Rate

How do you reset the Energy Meter?

  • Entry
  • Associated product(s)
At the beginning of a new job it is useful to reset the energy meter module. Reset means setting the energy meter back to the start value which can also be 0.

You can reset the energy meters via

Follow the instructions below to reset the energy counters of the Energy Meter via the data record 143.

  1. Create a data type with an identical structure to the data record 142. The sample project already includes such a UDT.
    Detailed information about the structure of the data record 143 is available in the manual of the AI Energy Meter 400VAC ST (6ES7134-6PA01-0BD0) in the section entitledStructure for energy counters (DS 143) and in the manual of the Energy Meter 480VAC ST (6ES7134-6PA20-0BD0) in the section entitled Structure for energy counters (DS 143).

    Fig. 1 shows the structure of the data record 143 for the AI Energy Meter 400VAC ST.
     

    Fig. 1

      
    The data record 143 has been extended for the AI Energy Meter 480VAC ST. Fig. 2 shows the extension of the data record 143.
      

    Fig. 2
     

  2. Create a data block (DB) which includes this data type and set the value of the data record.
    Byte 0 and Byte 1: 16#01
    Byte 2 to Byte 7: Control bytes
    The control bytes specify for each phase (L1, L2, L3) whether and which energy counter values are to be reset.

  3. In the control byte 1 of the data record 143 you set bit 2 to 1 to reset the energy counter.
    Control byte 1 = 16#04 (hex)
    Table 1 shows the structure of Control byte 1.

     

    BitDescription / Value
    0Overflow counter:
    0 = no action
    1 = reset overflow counter
    10
    2Energy counter:
    0 = no action
    1 = reset counter (counter selection in Control byte 2)
    30
    40
    50
    60
    7Apply set start values:
    0 = Apply start values immediately
    1 = Apply start values only when the DQ bit is set in the user data


    Table 1
     
  4. In the Control byte 2 of the data record 143 set the category of the energy counters (active, reactive, apparent energy) to 1 via Bit 5 to Bit 7.
    Control byte 2 = 16#E0: Counter for active, reactive, apparent energy is reset.
    Table 2 shows the structure of the Control byte 2.
     
    BitDescription / Value
    00
    10
    20
    30
    40
    5Active energy:
    0 = no action
    1 = reset counter for active energy
    6Reactive energy:
    0 = no action
    1 = reset counter for reactive energy
    7Apparent energy:
    0 = no action
    1 = reset apparent energy


    Table 2
     
  5. Byte 8 to Byte 127: Start values for the individual energy counters
    The start values for the energy counters in the data record 143 are 64-bit floating point numbers. This corresponds to the data type LREAL in the S7-1200 and in the S7-1500.
    The S7-300 CPUs and S7-400 CPUs do not have an adequate data type. The FAQ response in Entry ID56600676 describes how to convert your values into the LREAL format. The FAQ response also provides the "DINT2LREAL" block.

  6. The following applies for the AI Energy Meter 480VAC ST:
    Byte 128 to Byte 157: Start values for overflow counters
    The start values for the overflow counters in the data record 143 are 64-bit floating point numbers. This corresponds to the data type UINT in the S7-1200 and in the S7-1500.

  7. Use the SFB 53 "WRREC" to write the data record into the Energy Meter module.

SFB 53 "WRREC"
Table 3 shows the input parameters of SFB 53 "WRREC".
 

Input parameterData typeDescription
REQBOOLREQ = 1: perform data record transfer.
IDDWORD

Logical address of the Energy Meter module.
  
Note
You take the logical address from the Hardware Configuration. The first input address corresponds to the ID. The ID must be specified in hexadecimal form.
  

Fig. 3

  
Note
If you are using an S7-1500 CPU / S7-1200 CPU, you specify the hardware ID of the AI Energy Meter. Take the hardware ID of the AI Energy Meter from Properties of the module in the Device view of the ET 200SP. The hardware ID is of the data type HW-IO.

INDEXINTData record number: 143
LENINT

Maximum length of the data record to be transferred.
  
Note
The maximum length of the data record 143 is as follows:

  • with AI Energy Meter 400VAC ST: 128 bytes
  • with AI Energy Meter 480VAC ST: 170 bytes
RECORDANY

Data record, which means:

Pointer to the data area in the CPU which contains the data record 143.

Table 3

Table 4 shows the output parameters of SFB 53 "WRREC".
  

Output parameterData typeDescription
DONEBOOLData record has been transferred.
BUSYBOOLBUSY = 1: The write procedure has not yet finished.
ERRORBOOLERROR = 1: An error has occurred in the write procedure.
STATUSDWORDBlock status and error information.

Table 4

Note

  • If you want to write to or read from multiple Energy Meter modules at the same time, then pay attention to the maximum number of active jobs of the communication with SFB52/SFB53 (Entry ID 15364459).
  • Alternatively you can also reset the energy counter via the output data (see the manual AI Energy Meter 400VAC, in the section entitledReset energy counters via user data and the manual AI Energy Meter 480VAC ST, in the section entitled Reset energy counters via user data.

Download
The download includes the project "EnergyMeter_reset.zip". Unpack the "EnergyMeter_reset.zip" file in a separate directory. Then you can use STEP 7 to open and edit the project.

 Registration required energymeter_reset.zip (3.2 MB)

Further Information
Detailed information about the AI Energy Meter is available in the manuals and FAQ responses below:

FAQ:
What should you watch out for when setting up and configuring an ET 200SP with an Energy Meter?
(Entry ID: 81800892) FAQ:
How can you read out all the measured values of the Energy Meter at once?
(Entry ID: 81715524) FAQ:
FAQ: How do you find out the current measuring value from the IO data of the energy meter?
(Entry ID: 81714201) FAQ:
How do you select a current transformer for the ET 200SP Energy Meter and how do you connect it to the module?
(Entry ID: 85477190)

Creation Environment
The screens and downloads in this FAQ response were created with STEP 7 V13 SP1.