show the entry list
WinCC flexible ES -- Creating HMI configurations -- Creating screens
Why is the script shown in bold type in the PC Runtime although it is not configured as bold type?
How do you create a time switch with WinCC flexible?
How do you create your own on-screen keyboard for a WinCC flexible PC Runtime Station?
How do you register an ActiveX object on the configuration computer and then incorporate it in WinCC flexible?
How do you temporarily lock multiple operator panels?
How do you use a key switch to lock/activate the call of specific screens?
How can you change the tab order in WinCC flexible?
How can you start specific items in the Control Panel directly from the Runtime on an operator panel?
How do you implement the "Clean Screen" function for cleaning the touch screen on Mobile Panels and OP 177B?
How can you make a screen selection on a Windows-based operator panel by entering a screen number?
How can you make a screen selection on a Windows-based operator panel via the controller without using a controller job?
How do you configure screen selection on a Windows-based operator panel with WinCC flexible via controller job 51?
How can the display for the danger and warning area of a pointer instrument be made in color?
How do you monitor and control tags on panels on which the status/control object is not available?
Why isn't at the panel the picture number displayed properly in the picture number box after CPU startup?
WinCC flexible RT -- Setting up systems -- Configuring software
Why is the script shown in bold type in the PC Runtime although it is not configured as bold type?
How can you optimize the picture change times of WinCC flexible Runtime on a PC with Intel graphics chipset?
How do you insert error messages of a frequency converter (SINAMICS and MICROMASTER) in a WinCC flexible or WinCC (TIA Portal) project?
How do you simulate the system keyboard via K or F-keys?
How do you change the date format in WinCC flexible?
How do you temporarily lock multiple operator panels?
How do you use a key switch to lock/activate the call of specific screens?
How do you establish a direct connection between HMI Panels and frequency converters (SINAMICS and Micromaster)?
How do you configure the WinCC Autostart for WinCC flexible Runtime?
Which settings must you make on the RT Loader to transfer a WinCC flexible Runtime file from the configuration computer to a visualization PC?
Basic Panels -- Creating HMI configurations -- Remote access - tips and tricks for configuring
How do you synchronize the time of the HMI Basic Panel with an S7-1200 PLC?
How do you temporarily lock multiple operator panels?
How do you use a key switch to lock/activate the call of specific screens?
C7 6xx -- Setting up systems -- Configuring software
How do you use a key switch to lock/activate the call of specific screens?
Mobile Panels -- Creating HMI configurations -- Remote access - tips and tricks for configuring
How can you access tags of an operator panel using an Excel application with WinCC (TIA Portal)?
Which settings do you have to make so that a ProTool project or WinCC flexible project can be transferred via TeleService Adapter IE?
How do you use a key switch to lock/activate the call of specific screens?
How do you temporarily lock multiple operator panels?
How can you access tags of an operator panel using an Excel application with WinCC flexible 2008?
Touch Panel / Operator Panel -- Creating HMI configurations -- Remote access - tips and tricks for configuring
How do you use a key switch to lock/activate the call of specific screens?
How do you temporarily lock multiple operator panels?
How can you access tags of an operator panel using an Excel application with WinCC flexible 2008?
Multi Panel -- Creating HMI configurations -- Remote access - tips and tricks for configuring
How can you access tags of an operator panel using an Excel application with WinCC (TIA Portal)?
OPC connection to a panel not possible with ProTool V6.0 SP1A
Which settings do you have to make so that a ProTool project or WinCC flexible project can be transferred via TeleService Adapter IE?
How do you use a key switch to lock/activate the call of specific screens?
How do you temporarily lock multiple operator panels?
How can you access tags of an operator panel using an Excel application with WinCC flexible 2008?
How do you use a key switch to lock/activate the call of specific screens?
Part number:

Description:
Operation of the controller via the operator panel can be released/locked not only via the user administration, but also using a key switch. This entry shows you one way to lock/activate access to specific screens using a key switch. This can be an external key switch that is connected to an ET200S, for example, or using a Mobile Panel with integrated key switch - see Fig. 01.

Contents:

  1. How to lock operation with key switch
  2. Programming in STEP 7
    2.1 Structure of the STEP 7 program
    2.2 Programming automatic screen selection
    2.3 Special feature of integrated key switch on Mobile Panel
    2.4 Data blocks used
  3. Configuring in WinCC flexible
    3.1 Configuring with external key switch
    3.2 Configuring a Mobile Panel with integrated key switch
    3.3 Parameterizing WinCC flexible Runtime
  4. Download


Fig. 01

Note:
As an alternative, you can also make the connection with the Industrial Ethernet.

Links:

  • Information about locking multiple operator panels
    Entry ID: 32967536
  • Information on user logon with chip card and card reader via RFID
    Entry ID: 26481978

1. How to lock operation with key switch
The operation lock in this example depends on the current position of the key switch and the screen that is open. If you call a released screen on the operator panel and then operate the key switch again, then the screen called is locked again. The locking can be realized by the deactivation of the separate objects in all the relevant screens or by the automatic screen selection for a screen that is not locked.
Object-related locking is implemented in the Start screen of the WinCC flexible project by deactivating the buttons.
This is also included in the sample project to demonstrate the automatic screen selection option. The screens to be locked are stored in a data block with a screen number. The screen numbers stored are compared with the current screen number. If the current screen number is stored in the data block and you operate the key switch again to lock operation, this starts the automatic screen selection.

2. Programming in STEP 7
Special features of the system must be taken into account when evaluating the position of the key switch integrated in the Mobile Panel. The external key switch is only simulated in this example. In a real system, you just have to replace the relevant parameter with the parameter of the (distributed) I/O (for example, E22.0).

2.1 Structure of the STEP 7 program
All the screens to be locked are stored in a matrix or data block. If operation is locked with the key switch, the basic screen is called automatically via the controller by a PLC job.

Large plants are usually divided into function groups. Similar to the entry dealing with "Locking multiple control panels" (see Entry ID: 32967536) the matrix is used as shown in Table 01.
 

Function group

Screen

01 02 03 04 05 06 07 08 09 10
FG 00 1 - - - - - - - - -
FG 01 10 11 - - - - - - - -
: : : : : : : : : : :
FG 10 - - - - - - - - - -
Table 01

Figure 02 outlines the basic program for locking operation with the key switch.


Fig. 02

2.2 Programming automatic screen selection
Automatic screen selection can be used instead of object-related locking. The function or function module FC 502 must be called and parameterized appropriately for each operator panel.

Description of function FC 502
The function module FC502 "** ActivateScreen" does the automatic screen selection after release is locked via the key switch. Release via the key switch is transferred to the function module by the "Unlock" parameter. If the screen currently displayed on the operator panel is stored with the corresponding screen number in data block "DB500" and released is locked through the key switch, then the screen specified in the parameter "StartScreen" is selected automatically. The external parameterization is done primarily with data blocks DB501 "DB_AreaPointerScreenNo", DB502 "DB_AreaPointerJobMailbox" and DB505 "DB_Unlock".


Fig. 03
 
Parameter Data type Interface Description
ActiveScreenNumber Word INPUT Current screen number of operator panel
Unlock Boolean INPUT Release via key switch
StartScreen Word INPUT Target screen with automatic screen selection
ScreenDB Any INPUT List of lockable screen numbers
Release Boolean OUTPUT Release via key switch
AP_JobMailbox Pointer INOUT Area pointer of controller job
StartsJob Boolean INOUT Start of controller job
JobActive Boolean INOUT Controller job is active
LoopCounter Word INOUT Loop counter
Table 02 - Parameters of FC 502 "** ActivateScreen"

2.3 Special feature of integrated key switch on Mobile Panel
The system permits the Mobile Panel to be disconnected from the interface box. Undocking must be taken into account in the STEP 7 program to ensure that the key switch position is not inconsistent in the control program.

In addition to function module FC 502 for automatic screen selection you also need function module FC 503 in the Mobile Panel. Function module FC 503 evaluates the current key switch position.

Description of function FC 503
The function module FC 503 "** Keyswitch MobilePanel" cyclically updates the key switch position on the Mobile Panel. The toggling life bit of the operator panel is used for updating and is transferred in the "AuxiliaryTag" parameter. The operator panel's life bit transferred by the controller's "Coordination" area pointer and must be specified in the "Coordination" parameter. The "Keyswitch_PLC" parameter gives the operator panel's current key switch position.
 

Key switch position

Position Process value
Center 0
Left 1
Right 2
Table 03 - Key switch positions of the Mobile Panel "Keyswitch_PLC"

The operator panel's life bit is monitored by both timers. If the life bit does not change within two seconds, the key switch position is set to invalid and the "Unlock" parameter is reset. External parameterization is done primarily with data block DB505 "DB_Unlock".


Fig. 04
 
Parameter

Data type

Interface Description
Timer_Low Timer INPUT Timer for evaluation of the life bit by the operator panel (Low and High signal)
Timer_High Timer INPUT
WatchDogTime S5Time INPUT Monitoring time of life bit
Valid Boolean OUTPUT Key switch position is valid
Unlock Boolean OUTPUT Release via integrated key switch
Coordination Word INOUT "Coordination" area pointer of HMI
AuxiliaryTag Int INOUT Update of the key switch position
Keyswitch_PLC Int INOUT Key switch position
Table 04 - Parameters of FC 503 "** Keyswitch MobilePanel"

2.4 Data blocks used
The following data blocks are used in this sample project:
 
Data block
Number Name Description
DB8 DB_Coordination DB for the HMI area pointer "Coordination"
DB500 DB_FunctionGroups DB contains the matrix for the screen numbers to be locked
DB501 DB_AreaPointerScreenNo DB for the HMI area pointer "Screen Number"
DB502 DB_AreaPointerJobMailbox DB for the HMI area pointer "Controller job"
DB505 DB_Unlock DB for operation locking and automatic screen selection
Table 05 - Data blocks used in STEP 7

3. Configuring in WinCC flexible
On a station operator panel, the external key switch is simulated by a button on the operator panel. When using the integrated key switch on the Mobile Panel, you must configure this explicitly on the operator panel.

3.1 Configuring with external key switch
The minimum configuration of WinCC flexible is described here.
 

No.

Procedure
1 Start WinCC flexible
  • Open or start WinCC flexible ES.
  • Mark the MP277, for example, and click on "OK".


Fig. 05

2 Add screens
  • Change the screen's name from "Screen_1" to "100_StartScreen" and change the screen number to "100".
  • In the project tree, create two folders under "Screens" and name them "FG00" and "FG01".
  • Add the screen "001_FG00_General" with screen number1" to the screen folder "FG00".
  • In screen folder "FG01" you create the screens "010_FG01" and "011_FG01" with screen numbers "10" and "11" respectively.


Fig. 06

3 Add libraries
  • Download the WinCC flexible library "ConfigScreen.wlf", that is available at the end of this entry under Download.
  • In the "Tools" window you right-click under the "Library" category to open the pop-up menu.
  • In the pop-up menu you click on "Library... > Open".
  • Then select the "ConfigScreen.wlf" library.


Fig. 07

4 Add screens from library
  • Use drag-and-drop to add the "Config" screen folder to the screens in the project tree.


Fig. 08

5 Add buttons
  • Add four buttons and arrange them as shown in Fig. 09.
  • Label the buttons as follows:

    "FG00"
    "FG01"
    "Config"
    "Terminate RT"


Fig. 09

6 Add system functions
  • Link the following system functions to the buttons under the "Press" event:
     
    No. Button System function
    1 "FG00" Activate screen
    -Screen name:
    -Object name:
    "FG00\001_FG00_General"
    0
    2 "FG01" Activate screen
    -Screen name:
    -Object name:
    "FG01\010_FG01"
    0
    3 "Config" Activate screen
    -Screen name:
    -Object name:
    "Config\500_Param"
    0
    4 "Terminate RT" Stop Runtime
    -Mode: "Runtime"


Fig. 10

7 Configure connection
  • In the project tree, click on "Communication > Connections".
  • Select the communication driver "SIMATIC S7 300/400".
  • Configure the appropriate connection parameters.


Fig. 11

8 Create area pointer
  • Click on the "Area pointer" tab in "Connections".
  • Create the area pointer "Screen number" and assign the corresponding address ("DB501.DBW0" in the first panel).

    Note:
    The tag address specified refers to the first panel. If you are using multiple panels, then the address must be changed accordingly - see DB501 in the STEP 7 project.
     
  • Activate the "Controller job" area pointer and assign the corresponding address ("DB502.DBW0" in the first panel).

    Note:
    The tag address specified refers to the first panel. If you are using multiple panels, then the address must be changed accordingly - see DB502 in the STEP 7 project.


Fig. 12

9 Create tags
  • Create the three following tags in the tag editor:
     

    No.

    Tag Address
    1 "DB_Unlock.Panel_01.Unlock_Release" DB505.DBX0.1
    2 "DB_Unlock.Panel_01.Unlock_Key" DB505.DBX0.0

    Note:
    The tag addresses specified refer to the first panel. If you are using multiple panels, then the address must be changed accordingly - see DB505 in the STEP 7 project.


Fig. 13

10 Connect tags
  • Activate the animations listed for the "FG00" and "FG01" buttons:
     
    No.

    Button

    Animation
    1 "FG00" Layout
    -Tag:
    -Value 0:
    -Value 1:
    "DB_Unlock.Panel_01.Unlock_Release"
    Foreground: gray
    Foreground: black
    Operability
    -Tag:
    -Status:
    -Area:
    "DB_Unlock.Panel_01.Unlock_Release"
    Activated
    from "1" to "1"
    2 "FG01" Layout
    -Tag:
    -Value 0:
    -Value 1:
    "DB_Unlock.Panel_01.Unlock_Release"
    Foreground: gray
    Foreground: black
    Operability
    -Tag:
    -Status: 
    -Area:  
    "DB_Unlock.Panel_01.Unlock_Release"
    Activated
    from "1" to "1"


Fig. 14

11 Add key switch
In this example, the key switch is simulated as a visual switch by WinCC flexible.
  • Open "Template".
  • Add a "switch" to the "template".
  • Change type from "Switch" to "Switch with text".

    Note:
    Alternatively you can also insert a "Switch with graphics" - as in the sample project.
     
  • Label the buttons as follows:
     

    Value

    Label
    0 Closed
    1 Open
     
  • Link the "DB_Unlock.Panel_01.Unlock_Key" tag with the switch.


Fig. 15

3.2 Configuring a Mobile Panel with integrated key switch
Below is a description of how to configure the key switch on the Mobile Panel.
Configuring is based on the description in section "3.1 Configuring with external key switch".
 
No. Procedure
1 Open/create a Mobile Panel project
  • Start WinCC flexible.
  • Open or create a WinCC flexible project in a Mobile Panel - see also Figure 05.
2 Create tags
  • Open the Tag Editor of the WinCC flexible project.
  • Create the following tags:
     
    No. Tag

    Connection

    Data type

    Address
    1 Keyswitch_PLC External Int DB 505.DBW14
    2 AuxiliaryTag External Int DB505.DBW12
    3 Position_Keyswitch Internal Int -

    Note:
    In the case of integrated project, you can also use the symbolic connection. The symbolic connection matches the tag name to the symbolic name - see Fig. 16.


Fig. 16

3 Configure system functions
  • For the following tags, you configure the listed system functions for the "Value change" event - see also Fig. 16:
     
    No. Tag System function
    1 AuxiliaryTag SetValue
    -Tag:
    -Value:
    Keyswitch_PLC
    Position_Keyswitch
    2 Position_Keyswitch SetValue
    -Tag:
    -Value:
    Keyswitch_PLC
    Position_Keyswitch

    Note:
    The "Position_Keyswitch" tag gives the current key switch position.
    In order to have the key switch position updated cyclically in the controller via the "Keyswitch_PLC" tag, you must add the "SetValue" system function to the "Value change" event of the "AuxiliaryTag" tag.


Fig. 17

4 Connect tag to key switch
  • Open the template.
  • Click on the key switch and open the Properties window if required.
  • Connect the "Position_Keyswitch" tag.


Fig. 18

3.3 Parameterizing WinCC flexible Runtime
The corresponding screens must be stored in the data block for the automatic screen selection to be activated during Runtime.
 
No. Procedure
1 Start WinCC flexible Runtime
  • Transfer the project to the operator panel or start the WinCC flexible Runtime.
  • Press on the "Config" button.


Fig. 19

2 Parameterize operator panel
  • Enter the number of function groups, the number of operator panels and the number of the operator panel.
  • Then click the "Screens" button.


Fig. 20

3 Parameterize function groups
  • Enter screen number "1" in "FG00".
  • Enter screen numbers "10" and "11" in "FG01".
  • Then press "Back".
  • Press the "Basic screen" button - see Fig. 20.


Fig. 21

4 Unlock function groups
  • Operate the key switch or press the key (1) for simulation of the key switch to release the screens.
  • Press the "FG01" button (2).


Fig. 22

5 Lock function groups
  • Lock function groups again with the key switch or simulation switch.

    Note:
    If the screen number is entered in the data block and you have parameterized FC 502 accordingly, then the parameterized screen - the basic screen, for example - is selected by the automatic screen selection.
  • Terminate the WinCC flexible Runtime.


Fig. 23

4. Download
Attachment 1 contains the sample project described including the Mobile Panel 277 with integrated key switch and the stationary operator panel with simulation switch.

Attachment 1: WinCC_flexible_Keyswitch_Interlock.zip ( 4859 KB )

Attachment 2 contains the WinCC flexible library "ConfigScreen.wlf" with the two configuration screens.

Attachment 2: WinCC_flexible_Library_ConfigScreens.zip ( 983 KB )

Runnability and test environment:
The following table lists the components that have been used to create this entry and verify the functions described.
 
Components Product and version designation
PC operating system Microsoft Windows XP SP2
Standard tools -
Engineering tool STEP 7 V5.4 SP4
HMI software WinCC flexible 2007 HF4
HMI system MP 277 & Mobile Panel 277

Keywords:
Operation lock, Key, Lock

 Entry ID:32967530   Date:2009-02-13 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour