Vous êtes sur la page 1sur 35

s

Saving Energy with SIMATIC S7


PROFIenergy with multiple devices

Application Description June 2012

Applications & Tools


Answers for industry.
Industry Automation and Drive Technologies Service & Support Portal
This article is taken from the Service Portal of Siemens AG, Industry Automation
and Drive Technologies. The following link takes you directly to the download page
of this document.
http://support.automation.siemens.com/WW/view/en/<Item-ID>

If you have any questions concerning this document please e-mail us to the
following address:
online-support.automation@siemens.com

Industrial Security
By the increasing networking of industrial plants the productivity is increased.
However, also IT security risks arise which it is necessary to meet with
corresponding protective measures for Industrial Security. A holistic view is
necessary which takes similarly into account technical measures and contains the
training of employees and the definition of guidelines and processes. This is
necessary to attain the highest possible level of security and to ensure the safe
operation of the plant. You find further information about technical solutions and
Siemens AG 2012 All rights reserved

our service offer for Industrial Security on the Internet under


www.siemens.de/industrialsecurity

The functions and solutions described in this article confine themselves to


Caution
the realization of the automation task predominantly.
Please take into account furthermore that corresponding protective
measures have to be taken up in the context of Industrial Security when
connecting your equipment to other parts of the plant, the enterprise
network or the Internet. Further information can be found at
Copyright

http://support.automation.siemens.com/WW/view/de/50203404

PROFIenergy
2 V 1.6, Entrys-ID: Entry ID
SIEMENS Automation Task 1

Automation Solution 2

Basics 3
Function Mechanisms of
this Application 4

SIMATIC Configuration 5
PROFIenergy Operation of the
Application 6
Application of PROFINET profile PROFIenergy

Glossary 7
Siemens AG 2012 All rights reserved

Literature 8

10
Copyright

11

12

PROFIenergy
V 1.6, Entry-ID: Entry ID 3
Warranty and Liability
Note The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. The Application
Examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for ensuring that
the described products are used correctly. These application examples do not
relieve you of the responsibility to use safe practices in application, installation,
operation and maintenance. When using these Application Examples, you
recognize that we cannot be made liable for any damage/claims beyond the
liability clause described. We reserve the right to make changes to these
Application Examples at any time without prior notice.
If there are any deviations between the recommendations provided in these
application examples and other Siemens publications – e.g. Catalogs – the
contents of the other documents have priority.

We do not accept any liability for the information contained in this document.

Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
Siemens AG 2012 All rights reserved

body or health, guarantee for the quality of a product, fraudulent concealment of a


deficiency or breach of a condition which goes to the root of the contract
(“wesentliche Vertragspflichten”). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
the type of contract, except in the event of intent or gross negligence or injury to
life, body or health. The above provisions do not imply a change of the burden of
proof to your detriment.

Any form of duplication or distribution of these Application Examples or excerpts


Copyright

hereof is prohibited without the expressed consent of Siemens Industry Sector.

PROFIenergy
4 V 1.6, Entrys-ID: Entry ID
Table of Contents

Table of Contents
1 Automation Task................................................................................ 6
1.1 Overview ........................................................................................... 6
1.2 Scenarios .......................................................................................... 8
2 Automation Solution........................................................................... 9
2.1 Overview of the overall solution ......................................................... 9
2.2 Description of the core functionality.................................................. 10
2.3 Required Hardware and Software Components ............................... 15
2.4 Basic performance data ................................................................... 16
3 Basics ............................................................................................. 17
3.1 PROFIenergy profile ........................................................................ 17
3.2 Available Hardware.......................................................................... 18
3.3 Required software ........................................................................... 18
4 Function Mechanisms of this Application.......................................... 19
4.1 Functionality FB820 “PE_WOL” ....................................................... 19
4.1.1 Program details on block FB820 ...................................................... 19
4.1.2 Structure of the STATUS signal ....................................................... 21
4.1.3 Structure of the PROFIenergy User DB............................................ 23
5 Configuration ................................................................................... 29
5.1 Configuration of the ET200S interface module ................................. 29
5.2 Configuration of ET200S power module ........................................... 30
Siemens AG 2012 All rights reserved

5.3 Calling the FB820 “PE_WOL” .......................................................... 31


6 Operation of the Application ............................................................. 33
6.1 Overview ......................................................................................... 33
7 Glossary .......................................................................................... 34
8 Related Literature ............................................................................ 35
8.1 Bibliography..................................................................................... 35
8.2 Internet Link Specifications .............................................................. 35
Copyright

PROFIenergy
V 1.6, Entry-ID: Entry ID 5
1 Automation Task
1.1 Overview

1 Automation Task
1.1 Overview
Introduction
The importance of energy management will grow in the future. To cut costs by
saving energy in the production is an approach that has been used for quite some
time already. Recently, short production-free times become center of the focus -
from short pauses up to shifts off work.
Main switch turned off - the complete production stops and the lights in the hall go
out. This is the common way in nearly each plant all over the world in production
free times like weekends or during plant vacation shutdown. But what happens
during shorter pauses? Here, the plant proceeds and consumes energy without
delivering productive results.
Is it not possible to put smaller units of the plant that are not needed over a certain
period of time into an energy saving mode while the rest of the plant keeps on
producing?
All this might considerably improve the energy balance of a production unit.

The currently used technology which isolates the production components from the
mains via one or more main switches is inappropriate for that purpose as it
Siemens AG 2012 All rights reserved

deactivates production units in an undifferentiated way. Hard-wired switching paths


for firmly defined production units are not flexible enough to make the grade
concerning energy efficiency.
The decision for PROFINET already lays the foundations for a new and future
oriented energy management.
Future-oriented energy management means: Units are no longer switched off via
the conventional method which uses the main switch, but in a better defined way
via the network!
In doing so, the general power supply of the components remains activated and
Copyright

the components enter a defined energy-saving state - initiated by a command.


PROFIenergy is a protocol defined by the PROFINET user organization which
provides the prerequisites for a vendor-independent system that can be generally
used to switch off individual consumers or complete production units in a flexible
and intelligent way on a short-term base.
SIEMENS already supports PROFIenergy /1/ with first implementations into the
automation system SIMATIC.
The following application shows step by step how such an application can be
realized using the ET 200S with integrated PROFIenergy functionality.

PROFIenergy
6 V 1.6, Entrys-ID: Entry ID
1 Automation Task
1.1 Overview

Overview of the automation task


The figure below provides an overview of the automation task.
Figure 1-1

This application describes the switch-off of automation components using an


example from production - here a production line with robots.
This plant consists of one feeding and one discharging conveyor belt and a
processing unit. The belts are connected to an ET 200S; each with an own
PROFIenergy-enabled power module. For reasons of clarification the processing
unit is a "black box" that is switched on/off via an own ET 200S.
Siemens AG 2012 All rights reserved

In terms of energy saving the PROFIenergy does not focus on the drive motors
since these are switched off in case of a production stop. It rather concentrates on
the numerous sensors and further electronic components.
Copyright

PROFIenergy
V 1.6, Entry-ID: Entry ID 7
1 Automation Task
1.2 Scenarios

Description of the automation task


During a pause the components of the automation component shall be switched
off. The spontaneous or regularly planned pause can be initiated by the user via
the control system. After the production has stopped parts of the decentral
periphery are switched off via applicable PROFIenergy commands. Before the
production is started again the necessary automation components are switched on
again.

Figure 1-2
Siemens AG 2012 All rights reserved

A variable table and an optional control panel serve to visualize and control.

1.2 Scenarios
Requirements of the automation task
This application example shall present the following switch-on and switch-off
Copyright

scenarios.
Table 1-1
Problem description Explanation
Switch off all the plant components If no staggered switch-off is required; which
means that all parts are switched off at
once
Switch off individual plant components Staggered switch-off
Coordinated shut-down, i.e. necessary
because of the technological process
Switch on individual plant components Staggered switch-on
Switch on all / remaining plant components Components of the plant, which are not
subject to a special switch-on sequence.

PROFIenergy
8 V 1.6, Entrys-ID: Entry ID
2 Automation Solution
2.1 Overview of the overall solution

2 Automation Solution
2.1 Overview of the overall solution
Layout
The following figure shows the most important components of the solution:
Figure 2-1
Siemens AG 2012 All rights reserved

Structure
The plant described above is based in a decentralized design. Via two ET 200S
with several I/O groups (load groups) each, the CPU controls the plant.
PROFIenergy enabled power modules separate the I/O groups. The respective I/O
modules have to supply the sensors and actuators with voltage to achieve
Copyright

appropriate energy savings. The energy is saved by switching off the supply
voltage via the power modules.
A direct supply of the sensors and actuators via a "24V bus" would impede a
selective switch-off and by that the saving of energy.
Input / visualization via HMI are offered as an option. The same information and
input fields are available in a variable table. The panel itself can also be simulated
on the PG via WinCC flexible Runtime.

Topics not covered by this application


This application does not include a description of the meta knowledge required to
shut down the plant in an orderly manner. Since this knowledge is plant/ machine
specific it cannot be covered in this document.
For the same reason there is no staggered switch-off of the components with
PROFIenergy.
Hereafter, the basic functionality of the PROFIenergy protocol and the respective
function blocks for SIMATIC will be explained.

Required knowledge
It is assumed that the user has basic knowledge in automation, SIMATIC,
PROFINET and project planning with STEP 7.

PROFIenergy
V 1.6, Entry-ID: Entry ID 9
2 Automation Solution
2.2 Description of the core functionality

2.2 Description of the core functionality


Overview of the basic functionality
The block follows the shown schematic and expects inputs into the UserDB, which
will be described in greater detail later.
Figure 2-2

2nd step:
User block Diag-Addr. with „CmdStart
Bit“ = 1 are queued up for
processing.

User DB Instance DB

Diag Start Ende FB820 Diag


Adr. Bit Bit Adr.
8081 1 0 8081
8082 0 0 8083
8083 1 0 8048
8048 1 0
Siemens AG 2012 All rights reserved

1st step:
… … … …
User sets the
„CmdStart Bit“ of
devices to be
turned of to „1“.

3rd step: 4th step:


Copyright

„CmdStart Bits“ will be FB820 processes


reset, when the devices commands entered into
has been queued up the queue.

PROFIenergy
10 V 1.6, Entrys-ID: Entry ID
2 Automation Solution
2.2 Description of the core functionality

Sequence of the core functionality


The block internal sequence is described in the following flow chart.
Figure 2-3

START

Init‘d? yes

no

Init

Update yes
User DB
= 1?
Siemens AG 2012 All rights reserved

no EnQ (DB)

Q.E… yes
>0
Copyright

no

Q.Job

Q.Job. yes
Idle?

DeQ
no

END

PROFIenergy
V 1.6, Entry-ID: Entry ID 11
2 Automation Solution
2.2 Description of the core functionality

Sequence of the initialization routine


The block internal sequence for the initialization is described in the following flow
chart.
Figure 2-4

START

Clean Queue
Resetting the job queue

Config Devices
Reading configured
devices for PROFINET
I/O system
No. of yes
Devices Determining diagnostic
>0 addresses
Dev. Diag.
no
Siemens AG 2012 All rights reserved

Reading Order ID
Order ID
User DB
Setup of WoL
Connection connection
setup

Identify PE services for


Copyright

PE_IDENTIFY each device

END END
(Failure) (Initialized)

PROFIenergy
12 V 1.6, Entrys-ID: Entry ID
2 Automation Solution
2.2 Description of the core functionality

Sequence of the CmdStartPause command


This block internal sequence flow chart illustrates the internally used functions and
the expected interaction with a single device, when issuing a CmdStartPause
command.
Figure 2-5

Controller Device
(FB820)
START

User-DB Enable yes


Sleep=1?
list of devices w:
- Diag address
- Pause_Time no
- WoL
- Start_Pause_Bit 1
- …
Sleep yes Info_ sleep_mode
Mode
selected?
Siemens AG 2012 All rights reserved

no Device
prepares
Addt‘l info in DB:
1 Response
- Time_to_operate
- Time_min_Pause
- PE_Mode_ID Response:
- … Time_to_operate
- Wake_Up_Method Time_min_Pause
- Wake_Up_Data Wake_Up_Method
Store Response …
_Length
Copyright

- Wake_Up_Data
- …

Pause_Time
>
Time_min_
yes Start_sleep_mode
Pause

Store Response Device in


sleep-mode
no 3
1
Start_Pause

Store Response Device in an


2 Energy-
Saving_mode
2

Query Status
PEM_Status

3 Device in an
Store Response
Energy-
Saving_mode
END

PROFIenergy
V 1.6, Entry-ID: Entry ID 13
2 Automation Solution
2.2 Description of the core functionality

Sequence of the CmdEndPause command


This block internal sequence flow chart illustrates the internally used functions and
the expected interaction with a single device, when issuing a CmdEndPause
command.
Figure 2-6

Controller Device
(FB820)

START

User-DB
list of devices w: PE_Mode yes
= „0xFE“ Magic-Packet™
- Diag address
- Pause_Time Via T-COM
- WoL DefaultPort: 2189
- Start_Pause_Bit Device in
- …
no Sleep_
2 mode
Siemens AG 2012 All rights reserved

End End_Pause
Pause
Addt‘l info in DB:
- Time_to_operate
- Time_min_Pause
- PE_Mode_ID
- …
Copyright

- Wake_Up_Method
- Wake_Up_Data Device in
_Length Store Response Energy_
- Wake_Up_Data
- …
saving_
mode_x
2 2

PEM_Status
Wait „TTO“

Device in
Store Response Ready_to_
operate_
mode
END

PROFIenergy
14 V 1.6, Entrys-ID: Entry ID
2 Automation Solution
2.3 Required Hardware and Software Components

2.3 Required Hardware and Software Components


Standard software components
Table 2-1
Component No. MLFB / order number Note
STEP7 V5.5 SP3 1 6ES7810-5CC10-…

Standard hardware components


Table 2-2
Component No. MLFB / order number Note
CPU 31x-yPN/DP 1 6ES731x V3.x or higher
alternative
CPU 41x-yPN/DP 1 6ES741x
alternative
IM151-8(F) 1 6ES7151-8 V3.x or higher
PROFIenergy capable 1
PROFINET Device
Siemens AG 2012 All rights reserved

NOTICE The available block FB „PE_WOL“ can only be used in conjunction with a
CPU with integrated Ethernet interface. This CPU must be able to execute
blocks with a size of more than 40kB.
You cannot use this block on a PROFINET I/O system connected through
an Ethernet CP.
Copyright

PROFIenergy
V 1.6, Entry-ID: Entry ID 15
2 Automation Solution
2.4 Basic performance data

2.4 Basic performance data


Application software
The following tables contain the main data belonging to the delivered blocks.
The FB820 “PE_WOL” requires a CPU with some free memory for execution. The
requirements for the different memory types are listed in table 2-4 below.
Table 2-3
Memory requirements for FB820 “PE_WOL” Value
Load memory 40,136 bytes
Working memory 38,630 bytes
Local data stack 112 bytes

The requirements for the also necessary instance DB are listed in table 2-5.
Table 2-4
Memory requirements for the Instance DB Value
Load memory 7.756 bytes
Working memory 6.904 bytes
Siemens AG 2012 All rights reserved

Also the memory requirements for the User DB need to be fulfilled by the CPU,
which is listed in table 2-6.
Table 2-5
Memory requirements for User DB Value
Load memory 26.142 bytes
Working memory 25.746 bytes
Copyright

Measured data

The FB820 „PE_WOL“ operates asynchronously. However the implemented


algorithm has been designed to have the least impact on the cycle time, it may
vary, depending on used hardware.
Table 2-6
Cycle time of FB820 „PE_WOL“ Value
MicroBox 427B (WinAC RTX 2010 Upd3) 20µs per job
(basic load 17µs)
IM151-8(F)PN (V3.2) 100µs per job
(basic load 400µs)

PROFIenergy
16 V 1.6, Entrys-ID: Entry ID
3 Basics
3.1 PROFIenergy profile

3 Basics
This chapter explains the functions of PROFIenergy, especially the relation
between the functional modules and the hardware.

3.1 PROFIenergy profile


The PROFIenergy profile presents methods and techniques for implementing
energy-saving functions into PROFINET IO devices. Not only manufacturer
independently into simple I/O devices but also into intelligent and complex devices.
PROFIenergy consists of a group of methods that serve for parameter setting, the
start and stop commands as well as registration of the energy consumption.
PROFIenergy is based on existing PROFINET mechanisms - changes are not
necessary. Thus users of PROFINET are able to integrate PROFIenergy into
existing plants without basic changes of the plant.
PROFIenergy controller: This means a SPS, in this case the SIMATIC S7 CPU
317-2PN/DP. The user can decide whether to integrate the PROFIenergy
management into an existing control or into an additional control.
PROFIenergy device: A PROFINET IO device with integrated PROFIenergy
functionality. In this case a SIMATIC ET 200S consisting of a head module (IM151-
3PN HF V7.0) and a switchable power module (PM-E DC24V/8A RO).

PROFIenergy is basically designed for several energy-saving states of the


Siemens AG 2012 All rights reserved

PROFIenergy devices. In the presented application the states OFF ("PAUSE") and
ON ("READY") are realized. The state "OFF" provides the complete PROFINET
communication ability. This is achieved as the interface module IM151 induces the
selected power modules to switch off the supply voltage for the following electronic
modules (here DI/DO).

For further reference see the under \2\ mentioned literature, which can be
downloaded from \5\
Copyright

PROFIenergy
V 1.6, Entry-ID: Entry ID 17
3 Basics
3.2 Available Hardware

3.2 Available Hardware


PROFIenergy controller
There are blocks available that can be executed on all SIMATIC S7 CPUs. The
Step7 project which belongs to this application contains these blocks.
PROFIenergy device
ET 200S:
Head modules to process the profile
IM 151-3 PN IO High Feature: 6ES7 151-3BA23-0AB0, from firmware level V7.0
IM 151-3 PN IO High Feature, FO: 6ES7 151-3BB23, from firmware level V7.0
(Can be upgraded from firmware level V6.0.)
The latest firmware is available under the following link:
http://support.automation.siemens.com/WW/view/de/35934244
A head module that is compatible with PROFIenergy is required to process the
PROFIenergy profile.
Switchable power module to switch off the sensor and load supply:
PM-E DC24V/8A RO: 6ES7 138-4CA80-0AB0
Up to 8 of these switchable PM-E can be plugged into an ET 200S.
Additional PM-E without PROFIenergy can be plugged at any number - of course
according to the assembly guidelines ET 200S. These are recommended for F-
modules for instance that shall not be switched off.
Switchable PM-E can be operated without PROFIenergy. Nevertheless, they
occupy an address in the process image.
Siemens AG 2012 All rights reserved

3.3 Required software


All required Step7 blocks are available for being downloaded. The following
chapters describe their function and application.
The software STEP 7 V 5.5 is required for engineering the ET 200S and the power
module.
Copyright

PROFIenergy
18 V 1.6, Entrys-ID: Entry ID
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

4 Function Mechanisms of this Application


Program Overview
The block can be called from any cyclic OB, such as OB1 or OB3x.

CAUTION Calling the FB820 “PE_WOL” cyclic in OB1 and OB3x may lead to
unpredictable erratic behavior and shall be avoided.

4.1 Functionality FB820 “PE_WOL”


This block realizes all the handshaking with the devices as well as the coordination
of multiple requests to a single or multiple devices.

4.1.1 Program details on block FB820

The block call looks like this in LAD


Figure 4-1
Siemens AG 2012 All rights reserved
Copyright

The actual parameter „PE_RedDB“.RedDB represents a data area stored in the


UserDB. It is of type structure.

PROFIenergy
V 1.6, Entry-ID: Entry ID 19
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

Calling Parameter of the block


Table 4-1
Name Data type Type Meaning
COM_RST BOOL INPUT Resets the block and starts the
initialization as long as there
is a True assigned. Only a
falling edge on this parameter
continues the initialization
and finishes with the ready
state of the block.
START BOOL INPUT A rising edge issues a
CmdStartPause command to all
detected devices supporting
this PROFIenergy function.
END BOOL INPUT A rising edge issues a
CmdEndPause command to all
detected devices suppporting
this PROFIenergy function.
PENERGY STRUCT IN_OUT UserDB for structural
information see chapter
“Structure of the PROFIenergy User
Siemens AG 2012 All rights reserved

DB”.
STATUS DWORD OUTPUT Supplies a STATUS value, which
provides information about the
internal block state.
The STATUS is split into 3
sections. These sections are:
MESSAGE, LOCATION, INFORMATION.
Copyright

PROFIenergy
20 V 1.6, Entrys-ID: Entry ID
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

4.1.2 Structure of the STATUS signal

The Status signal is coded as follows and contains additional information about the
internal status of the block.
Table 4-2
Bit 31 Bit 23 Bit 15 Bit 0
MESSAGE LOCATION INFORMATION

Table 4-3
Possible values for MESSAGE
16#00 OK or No Error.
16#50 Start of initialization.
16#51 Determining the configured devices of the specified
PROFINET I/O system.
16#52 No devices configured on the specified PROFINET I/O
system.
16#53 Determining the logical diagnostic addresses of the
configured devices.
16#54 Reading interface information for each device.
Siemens AG 2012 All rights reserved

16#55 Reading I&M data (only record 0) of all configured devices.


16#56 Configuring the PN interface for sending the
„Wake on LAN“ MagicPacket™ via UDP.
16#57 Determining the PROFIenergy capabilities of the
connected devices.
16#62 Invalid PROFINET I/O system ID detected. The number of
the PROFINET I/O system will be listed in the
INFORMATION field.
16#70 Initialized and processing jobs. The number of currently
Copyright

active jobs is contained in the INFORMATION field.


16#80 Initialization lost during operation. This happens typically
due to reloading of either the User DB or the Instance DB.
Remedy: reset the block using COM_RST.
16#FF Unknown situation detected.

Table 4-4
Possible values for LOCATION
16#00 Not initialized or idle.
16#70 Waiting for jobs to be queued.
16#71 Adding job to the queue.
16#72 Preparing request data record for sending.
16#73 Sending request data record.
16#74 Waiting for response from device.
16#75 Evaluating the response data record from device.
16#76 Removing job from the queue.
16#FF Unknown situation detected.

PROFIenergy
V 1.6, Entry-ID: Entry ID 21
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

Table 4-5
Possible values for INFORMATION
16#0000 No additional information available and No jobs active.
16#0001 – Processing of 1 – 255 jobs currently active.
16#00FF
16#8001 Error at 1. Parameter.
16#8002 Error at 2. Parameter.
16#8003 Error at 3. Parameter.
16#8004 Error at 4. Parameter.
16#8005 Error at 5. Parameter.
This error will be reported, as soon as there is an invalid
or missing parameterization to the User DB detected. The
User DB may be
- Too small,
- Write protected,
- Not loaded into RAM (only in load memory)
- Invalid for the used CPU
16#8100 There are more than the maximum possible 256 jobs
active. This represents a temporary issue and solves itself
as soon as a previous job is finished. The last job request
wasn’t accepted and needs to be placed again.
Siemens AG 2012 All rights reserved

16#8200 An invalid or not supported PE_COMMAND code has


been detected.
16#84xx A communication problem to device xx has been detected.
The digits marked with xx contain the causing device
number.
16#85xx The device xx reports back an error. The digits marked
with xx contain the causing device number.
16#8600 The requested Wake Up method is currently not
supported.
Copyright

16#FFFF Unknown situation detected.

NOTE You may not see all of the above mentioned status codes, since there may be
more than just one job active for multiple devices.

PROFIenergy
22 V 1.6, Entrys-ID: Entry ID
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

4.1.3 Structure of the PROFIenergy User DB

The User DB for the PROFIenergy block FB820 „PE_WOL“ creates a database for
the processing of requests to multiple devices. For this to work properly the format
of the User DB has to be well defined and documented. Within the library Siemens
provides a UserDB to achieve this goal. The structure of the UserDB is described
in the table below.
Table 4-6
Addr. Name Data type Meaning
+0.0 Header STRUCT --- Header information
+0.0 Update BOOL R/W Signal to indicate a
data change in the data
area.

True= indicates a change


by the user.

False= indicates that all


changes have been
applied.
+0.1 Initialized BOOL R Signal indicating a finished
initialization.

True= initialization done

False= indicates that the


Siemens AG 2012 All rights reserved

block didn’t
finished the
initialization (yet).
+0.2 LinkUp BOOL R Signal indicating a
successfully configured
Ethernet interface.

True= Interface is ready.

False= Interface not ready


yet.
Copyright

+0.3 LinkDown BOOL R Signal indicating an


unconfigured Ethernet
interface.

True= Interface is not


configured yet.

False= Interface is being


configured or ready.
+2.0 PROFINET_ID INT R/W Accepts the PROFINET I/O
system ID to work with
+4.0 Reserved ARRAY[1..37] OF R/W Reserved.
BYTE
+42.0 LastDeviceID INT R Contains the highest device
ID in this PROFINET I/O
system.
+44.0 PortNo INT R/W Accepts the port number to
be used for the “Wake On
LAN” functionality

Default= 2189
+46.0 Connection STRUCT --- Contains the connection
configuration for the
„Wake on LAN“ functionality.
+46.0 block_length WORD R Length of the structure
always B#16#40
+48.0 id WORD R/W Connection ID
+50.0 connection_type BYTE R/W Connection type:
UDP = B#16#13

PROFIenergy
V 1.6, Entry-ID: Entry ID 23
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

Addr. Name Data type Meaning


+51.0 active_est BOOL R/W Active connection
establishment;
with UDP always passive
+52.0 local_device_id BYTE R/W Contains the interface ID
(CPU dependant)
+53.0 local_tsap_id_len BYTE R/W Contains the length in bytes
of the own/ local
UDP port number
+54.0 rem_subnet_id_len BYTE R/W Not used, has to be B#16#00
+55.0 rem_staddr_len BYTE R/W Contains the remote IP
address or B#16#00
+56.0 rem_tsap_id_len BYTE R/W Contains the length in bytes
of the remote UDP port
number
+57.0 next_staddr_len BYTE R Contains the length of the
default router address
(irrelevant)
+58.0 local_tsap_id ARRAY[1..8] OF R/W Contains the own/ local port
INT number.
+74.0 rem_subnet_id ARRAY[1..6] OF R Not used; has to be B#16#00
BYTE
+80.0 rem_staddr ARRAY[1..6] OF R/W Contains the remote
BYTE IP address
+86.0 rem_tsap_id ARRAY[1..8] OF R/W Contains the remote UDP port
INT number
+102.0 next_staddr ARRAY[1..6] OF R irrelevant
BYTE
Siemens AG 2012 All rights reserved

+108.0 spare WORD R


END_STRUCT --- End of connection
configuration
END_STRUCT --- End of header information
+110.0 Device ARRAY[1..256] OF --- Array of devices
+110.0 Device STRUCT --- Contains data for each
device
+110.0 DiagID WORD R Diagnostic address of the
device.
Will be assigned using the
configuration tool.
Copyright

+112.0 InterfaceID WORD R Diagnostic address of the


device interface
Will be assigned using the
configuration tool
+114.0 MACAddr ARRAY[1..6] OF R Contains the device MAC
BYTE address.
+120.0 IPAddr ARRAY[1..4] OF R Contains the device
BYTE IP address.
+124.0 OrderID STRUCT --- Contains the device OrderID.
MxLen BYTE R Contains the maximum length
of the array
ActLen BYTE R Contains the current number
of data elements in the
array
Data ARRAY[1..20] Contains the data
CHAR
END_STRUCT ---
END_STRUCT --- End device data
+146.0 PE STRUCT --- PROFIenergy specific data
+146.0 ModeID BYTE R PE_MODE_ID acc. PROFIenergy
Specification
as of 10.Jan. 2010.
+147.0 Result BYTE R PEErrorCode as of
PROFIenergy
Specification
as of 10.Jan. 2010
+148.0 PauseTime TIME R/W Contains the pausetime in ms

PROFIenergy
24 V 1.6, Entrys-ID: Entry ID
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

Addr. Name Data type Meaning


+152.0 TimeToPause TIME R Contains the time the device
needs to get into the pause
mode.
+156.0 TimeToOperate TIME R Contains the time the device
needs to get to the operate
mode.
+160.0 MinSleepTime TIME R Contains the minimum time
the device needs to stay in
PE_SLEEP_MODE.
+164.0 SleepToOperate TIME R Contains the time the device
needs to get back to operate
from PE_SLEEP_MODE.
+168.0 StatusOperate BOOL R Indicates the device is in
operation.
+168.1 StatusPause BOOL R Indicates the device is in
pause mode.
+168.2 StatusSleep BOOL R Indicate the device is in
PE_SLEEP_MODE.
+168.3 StatusTransitOK BOOL R Indicates a successful
transition from one energy
saving state into another
energy saving state.
+168.4 StatusInTransit BOOL R Indicates a state
transition.
+168.5 StatusTransitNOK BOOL R Indicates a faulty state
transition.
+168.6 StatusError BOOL R Indicates a communication
Siemens AG 2012 All rights reserved

error to a device.
+168.7 StatusRetryEx BOOL R Indicates a non successful
command execution. The block
removed the last request to
this device from the queue.
+169.0 CmdStartPause BOOL R/W Places a START_PAUSE command
for this device into the
queue.
+169.1 CmdEndPause BOOL R/W Places an END_PAUSE command
for this Device into the
queue
Copyright

+169.2 CmdUpdateStatus BOOL R/W Places a PEM_STATUS command


for this device into the
queue
+169.3 EnableSleep BOOL R/W Enables the PE_SLEEP_MODE
for this device.

True= Device should go into


PE_SLEEP_MODE, if the
Pausetime is long
enough

False= Device may not enter


PE_SLEEP_MODE.
+170.0 Services WORD R Indicates the supported
PROFIenergy services.
(bitencoded) see table 4-7
for details
+172.0 UserData ARRAY[1..24] OF R/W User defined data
BYTE
+196.0 Task STRUCT --- Job processing
+196.0 Cmd BYTE --- Internal Bits for Job
processing
+197.0 CmdJ BYTE --- Internal Bits for Job
processing
+198.0 TimeStart BOOL --- starts a delay time
+198.1 TimeStarted BOOL --- Delay time has been started
just
+198.2 TimeDone BOOL --- Indicates the expiration of
the delay time
+198.3 Done BOOL --- Indicates a terminating job

PROFIenergy
V 1.6, Entry-ID: Entry ID 25
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

Addr. Name Data type Meaning


+198.4 DelayedCmd BOOL --- Indicates a delayed job is
active
+198.5 IsV1_0 BOOL --- Indicates a device following
Spec. V1.0
+198.6 IsWakeOnLAN BOOL --- Indicates a devices waking
up by WakeOnLAN.
+199.0 RetryCount BYTE --- Retry counter for
PE_COMMANDS.
+200.0 Duration TIME --- Contains the duration for
the delay time.
+204.0 StartTime TIME --- Contains the start tick of
the delay time.
+208.0 MachineState INT --- Contains the state for this
job
END_STRUCT --- End Job processing
END_STRUCT --- End Array of Device

The User DB is split into two parts, which are:


Header with a size of 110 bytes
Array of Device for a maximum of 256 devices with 100 byte each
o Device specific data
o PROFIenergy specific data
o Data for Job processing
o User defined data
Siemens AG 2012 All rights reserved

o
Each part of the DB has s specific constant size. This leads to a constant minimum
size for that User DB of 25.746 byte.
green fields can be filled by the customer code.
blue fields may be used by the customer
(for user specific Information)

NOTICE The predefined structure of the UserDB shall not be changed. Neither
Copyright

adding, removing or change in size of any part of the DB is permissible.

In the “Services” the block encodes the supported PROFIenergy services


supported by the device. Since this is a bitencoded field the table 4-7 describes
each bit and the associated service on the next page.

PROFIenergy
26 V 1.6, Entrys-ID: Entry ID
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

PROFIenergy Service encoding

Table 4-7
Bit Hex Service name Meaning
encoding
0 0x0001 PE_IDENTIFY This command allows the
retrieval of the supported
services by a PROFIenergy
enabled device
1 0x0002 PE_START_PAUSE The device supports the at at
least one additional energy
saving mode
2 0x0004 PE_END_PAUSE The device can be switched
back to
READY_TO_OPERATE mode
3 0x0008 PEM_STATUS The device supports status
requests
4 0x0010 PE_QUERY_MODE The device supports the
retrieval of a list of supported
energy saving modes and
Siemens AG 2012 All rights reserved

additional attributes to them


5 0x0020 PE_QUERY_MEASUREMENT The device supports energy
measurement functions and
additional information about
the supported measurement
ids
6 0x0040 PE_GET_INFO_SLEEP_MODE The device supports the
retrieval of information about
the PE_SLEEP_MODE. This
Copyright

information contains data


about how to wake the device
up.
7 0x0080 PE_GO_SLEEP_MODE The device supports the
PE_SLEEP_MODE
8 0x0100 PE_GET_VERSION The device supports a function
to get information about the
supported PROFIenergy profile
versions.

Connectionparameters

The FB820 “PE_WOL” reserves a connection resource out of the pool for “open
communication”. This connection will be used with UDP. The following parameters
need to be set in the UserDB.
ConnectionID
PortNo
LocalDeviceID

PROFIenergy
V 1.6, Entry-ID: Entry ID 27
4 Function Mechanisms of this Application
4.1 Functionality FB820 “PE_WOL”

ConnectionID
The ConnectionID is an integer number in the range of 1 to 32. The default setting
is 31. It serves the identification of the firmware internal assigned communication
resources, such as send- and receive buffers.
The ConnectionID needs to be unique CPU wide.
This parameter refers to the WORD type parameter “Connection.id”.

PortNo
The port number identifies the UDP port used to send the WakeOnLAN packet.
The port number is part of the communication resources, which are identified
firmware internal by the connectionID. The port numbers are listed and assigned to
applications by the IANA. The used default setting for the port number is 2189,
which is unused as of the time this document was written.
The parameter can be modified in the UserDB at “Header.PortNo”. the modified
value will be transferred during the initialization process into the connection
specification. The affected values are “Connection.local_tsap_id[1]” and
“Connection.rem_tsap_id[1]”.

LocalDeviceID (InterfaceID)
Siemens AG 2012 All rights reserved

The “LocalDeviceID” aka. “Connection.local_device_id” is also part of the


connection description. This ID identifies the interface of a CPU to be used. There
are multiple values possible, depending on the used CPU type and interface. This
value has to be configured appropriately.

Table 4-8

Value for Used with …


Copyright

„local_device_id“

B#16#01 ET200S CPU or


WinAC RTX with Ethernet interface in Subslot IF1

B#16#02 CPU 315(F)-2PN/DP


CPU 317(F)-2PN/DP

B#16#03 CPU 319(F)-2PN/DP


B#16#05 CPU 41x(F)-3PN/DP

B#16#06 WinAC RTX with Ethernet interface in Subslot IF2


B#16#0B WinAC RTX with Ethernet interface in Subslot IF3
B#16#0F WinAC RTX with Ethernet interface in Subslot IF4

PROFIenergy
28 V 1.6, Entrys-ID: Entry ID
5 Configuration
5.1 Configuration of the ET200S interface module

5 Configuration
At the moment only the head and power modules named above can be delivered
with PROFIenergy functionality. You can adapt and change the delivered example
program according to your needs and your hardware equipment. In the following
chapters the crucial steps of the hardware configuration are described. If you want
to integrate the PROFIenergy blocks into existing software, you can rename them.

5.1 Configuration of the ET200S interface module


Figure 5-1
Siemens AG 2012 All rights reserved
Copyright

Select one of the PROFIenergy-enabled head modules (V7.0) and add it to the
PROFINET I/O system.

PROFIenergy
V 1.6, Entry-ID: Entry ID 29
5 Configuration
5.2 Configuration of ET200S power module

5.2 Configuration of ET200S power module


Figure 5-2
Siemens AG 2012 All rights reserved
Copyright

Insert at least one PROFenergy-enabled power module into the ET200S station.
You are free to select the further equipment. You can either select further
PROFIenergy power modules or any other modules.

Power module 6ES7 138-4CA80-0AB0


Note
Record without "S": PM-E works according to the PROFIenergy standard
and does not occupy any addresses
Record with "S": PM-E is located in the process image and can be
switched directly via I/O

All electronic modules inserted behind the PROFIenergy enabled power


Warning
module will be switched off on a PE_START_PAUSE command.

PROFIenergy
30 V 1.6, Entrys-ID: Entry ID
5 Configuration
5.3 Calling the FB820 “PE_WOL”

5.3 Calling the FB820 “PE_WOL”


The block does contain all necessary routines to be able to handle multiple
devices. Although it requires certain settings to be properly done before it could
operate. These settings are made within the User DB and contain only a few
values, which are:
PROFINET ID
Connection ID
Wake On LAN port
For each device
o PauseTime
o EnableSleep

The following figure demonstrates a possible initialization of the required values in


the restart OB (OB100).
Figure 5-3
Siemens AG 2012 All rights reserved
Copyright

The regular call inside the cyclic program (OB1 or OB3x) could be reduced as
shown in the next figure.

PROFIenergy
V 1.6, Entry-ID: Entry ID 31
5 Configuration
5.3 Calling the FB820 “PE_WOL”

Figure 5-4

Make sure the COM_RST parameter get a “False” value assigned after
Note
initialization. Otherwise the block will continuously stay in the initialization
routine.
Siemens AG 2012 All rights reserved
Copyright

PROFIenergy
32 V 1.6, Entrys-ID: Entry ID
6 Operation of the Application
6.1 Overview

6 Operation of the Application


6.1 Overview
The interaction with the block takes place exclusively via the User DB. For this the
general procedure is as follows:
1. Command selection for the device(s)
a. CmdStartPause
b. CmdEndPause
c. CmdUpdateStatus
2. Set the „Update“ Bit

Between two commands should be at least one block call with an „Update“ = False.
Otherwise the new commands may not be detected and therefore not processed.

Figure 6-1

CmdStartPause
Siemens AG 2012 All rights reserved

CmdEndPause

CmdUpdateStatus

Update
Copyright

The above figure demonstrates the timely sequence of the three possible
commands. They will be processed one after the other independently of the
success of the previous command.
Setting all three command requests at once, only a single command will be
executed, the others will be discarded. The block implements a priorization of the
commands, which prefers the CmdStartPause command with the highest priority
over the other commands. The command CmdEndPause will be discarded when
CmdStartPause is selected, but has a higher priority than the CmdUpdateStatus
command.
In the case all three commands are selected at the same call, the not executed
commands will stay active. This way the next rising edge on „Update” causes the
next command to be scheduled for execution.

PROFIenergy
V 1.6, Entry-ID: Entry ID 33
7 Glossary

7 Glossary
PROFIenergy
PROFIenergy is a vendor independent, standardized and open application profile
on PROFINET. It provides a standardized method to retrieve energy consumption
data from devices and/ or execute power switching on enabled devices.

Wake On LAN
The Wake On LAN functionality allows data processing equipment to resume
operation from an almost power off state on receipt of a specially crafted Ethernet
packet. For this to work properly the data processing equipment need to have a
network controller, which is enabled to receive such a packet.
This packet (also called a Magic Packet ™) has a special format containing the
network controllers MAC address 15 times.
Siemens AG 2012 All rights reserved
Copyright

PROFIenergy
34 V 1.6, Entrys-ID: Entry ID
8 Related Literature

8 Related Literature
8.1 Bibliography
This list is not complete and only represents a selection of relevant literature.
Table 8-1
Subject Title
/1/ STEP7 Automation with STEP7 in STL and SCL
Hans Berger
Publisher: Vch Pub
ISBN-10 3895783412
ISBN-13 9783895783418
/2/ PROFIenergy Common Application Profile PROFIenergy; Technical
Profile Specification for PROFINET; Version 1.0;
January 2010; Order No: 3.802

8.2 Internet Link Specifications


Siemens AG 2012 All rights reserved

This list is not complete and only represents a selection of relevant information.
Table 8-2
Subject Title
\1\ Reference to the http://support.automation.siemens.com/WW/view/en/EntryID
entry
\2\ Siemens I IA/DT http://support.automation.siemens.com
Customer Support
\3\ Decentral I/O http://support.automation.siemens.com/WW/view/de/1144348
Copyright

system ET200S -
Manual
\4\ FW download http://support.automation.siemens.com/WW/view/de/35934244

\5\ Common http://www.profibus.org


Application Profile
PROFIenergy
PROFIBUS
International
\6\ Reference to http://support.automation.siemens.com/WW/view/de/41986454
related entry

PROFIenergy
V 1.6, Entry-ID: Entry ID 35

Vous aimerez peut-être aussi