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:
- How to lock operation with key switch
- 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
- 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
- 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.
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.
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".
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.
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
|