OP 277 Function Key Programming in WinCC Flexible Global vs

David Krause15 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

1. Overview and Scope

The SIMATIC OP 277 6" Key is a membrane-key HMI panel from the SIMATIC 270 series, designed for machine-level operator control with a 5.7-inch (144 mm) STN display, 320 x 240 pixel resolution, and 14 freely assignable function keys (F1–F14) plus a dedicated ESC, ENTER, and cursor block. Although the hardware is mature, the OP 277 remains in service in thousands of packaging, water-treatment, and machine-tool installations. Most field issues are not hardware failures but configuration mismatches introduced by two common situations:

  1. Defining a function key globally (i.e., the same F-key triggers the same action regardless of the active screen) versus locally (the F-key triggers a screen-specific action).
  2. Migrating an existing OP 270 project authored in ProTool to a WinCC flexible 2004 / 2005 / 2007 / 2008 project on the OP 277.

This reference covers both situations in engineering depth. It documents the template mechanism that gives a function key project-wide scope, the screen-property mechanism that scopes a key to a single screen, the migration of screen numbering, and the post-migration ESC-key behavior that operators often flag as a bug.

Applicable software: WinCC flexible 2004 SP1, 2005 SP1, 2007 SP1, 2008 SP1 / SP2 / SP3. The OP 277 image type is OP277 6" Key (catalog 6AV6 642-0BA01-1AX1 or 6AV6 642-0BC01-1AX1, depending on the 5.7" Key variant). Confirm the catalog number on the rating plate on the rear of the unit before transferring a project.

2. Prerequisites

Item Specification Notes
Programming software SIMATIC WinCC flexible 2004 / 2005 / 2007 / 2008 All editions except the Micro variant support OP 277.
Image / device OP 277 6" Key Verifies against catalog label.
Transfer cable PC adapter USB (6ES7 972-0CB20-0XA0) or Ethernet (for OP 277B / OP 277 with Ethernet port) RS-232 on the OP 277 is the standard programming port.
PC operating system Windows XP SP2/SP3, Windows 7 (32-bit) for SP3 / SP4 toolchains WinCC flexible does not install on x64 OS in earlier SPs.
Runtime / firmware on HMI WinCC flexible Runtime matches engineering version Update via ProSave if the image version is older.
Source archive (migration path) ProTool/Pro V6.0 SP2 or later .pdb / .sst project Required only for the OP 270 → OP 277 path.

3. OP 277 Project Structure Relevant to Function Keys

WinCC flexible stores a project as a tree under the HMI device. The three nodes that control function-key behavior are:

  1. Screens → Template — defines elements (including function-key labels and assignments) that are inherited by every screen.
  2. Screens → <Screen_001> … — individual screen objects; each has its own Events list for function keys.
  3. Project → Function Keys — a cross-screen view that aggregates F1–F14 with their global assignment. The OP 277 has 14 function keys arranged in two columns of seven; the bottom row also includes the system keys (ESC, ENTER, HELP, INFO, ACK on B variants).

Function keys have two independent event sources:

  • Global assignment — configured on the template. The configured action runs no matter which screen is currently visible, including the start screen.
  • Local assignment — configured on the active screen. The configured action runs only when that specific screen is the foreground image.

If both global and local assignments exist for the same F-key on the same screen, the local assignment takes precedence. The global assignment is suppressed for the duration of that screen. As soon as a different screen becomes active, the local assignment disappears and the global one re-asserts.

4. Programming a Function Key Globally (Independent of Screen Number)

A global F-key is the correct pattern for actions that the operator can invoke from anywhere: Logon, Logout, Language toggle, Stop / Emergency Stop, Acknowledge alarms, Change user, Go to start screen, or Print screen. The configuration is anchored to the template so every screen inherits it.

4.1 Open the template editor

  1. In the project tree, expand Screens.
  2. Double-click Template (in WinCC flexible 2005+ the node is labelled Template; in some localized builds it is Bildvorlage or Modèle).
  3. The template work area opens with the same resolution as the OP 277 (320 x 240).

4.2 Insert a function-key label

  1. From the toolbox select Function Keys → drag the appropriate key onto the work area, or right-click in the work area and select Function Key > F1 (or whichever key you require).
  2. With the key selected, look at the Properties window on the right. Under General set the Label field to the text shown on the keycap, e.g. LOGIN, HOME, STOP.
  3. Optionally assign a graphic to the key via Properties > Picture. A monochrome BMP/ICO is recommended for the OP 277 STN display.

4.3 Wire the global event

  1. With the function key still selected, switch to the Events tab in the Properties window.
  2. Expand Press. Three sub-events are available:
    • Click — fires on press while the key is held, used for latching logic.
    • Press — single event on the leading edge of the key-press.
    • Release — fires on the trailing edge.
  3. Click the button next to Press. The system functions list opens. Common global functions:
Required action System function to select Parameters to set
Always return to start screen ActivateScreen Screen name = start screen (e.g. Screen_002)
Log a user in Logon Domain = local; Password list = configured user list
Log out Logout
Acknowledge all alarms AcknowledgeAlarm Alarm class = Errors + Warnings
Print current screen PrintScreen Destination = local serial printer
Change language SetLanguage Language index = 1 / 2 / 3
Trigger a custom script ExecuteScript (VBScript in WinCC flexible 2008+) Script file = MyScript.bscript

4.4 Compile and verify the global binding

  1. Select Project > Compiler > All (or right-click the HMI device → Compile).
  2. Open any screen and inspect the template strip at the bottom. The global F-key label must appear on the soft-key strip even though no local assignment exists.
  3. Start the runtime simulator (Start > Runtime > Simulator with HMI). Click the F-key from at least three different screens. The action must execute in each.
Why the template is mandatory: a function-key label, label graphic, and event configured directly on a single screen only exist while that screen is active. The template is the only mechanism that propagates a function-key event to every screen simultaneously without per-screen duplication.

5. Programming a Function Key Locally (Screen-Specific Only)

A local F-key is the correct pattern when the same physical key on the OP 277 has different meanings on different screens. Typical examples: F5 = Start pump on the Pumping screen, F5 = Open valve 12 on the Valve-Detail screen, F5 = Reset counter on the Diagnostics screen.

5.1 Configure the local event on a specific screen

  1. Open the target screen (e.g. Screen_005).
  2. Either drag a function key from the toolbox onto the screen or select the inherited key from the template and override its event in this screen.
  3. Switch to Events > Press > … and configure the screen-specific function. Examples:
    • SetBit with tag db120.dbx0.0 (S7-200/300) or HMI_Tag_StartPump (internal tag).
    • ActivateScreen "Screen_007" to drill into a sub-screen.
    • SetValue on tag RecipeIndex with value 0.

5.2 Confirm local scope

  1. Compile the project.
  2. Open the runtime simulator and navigate to Screen_005 → press F5 → observe the expected action.
  3. Navigate to Screen_006 → press F5 → observe the global F5 action (if one is configured on the template), or no action at all if F5 is exclusively local.

5.3 Mixed scope — global + local for the same key

This is a common requirement. Configure the global action on the template and the local action on individual screens. Operators will see the local label while the screen is active, and the global label reappears as soon as they navigate to a screen without a local override. To make the operator aware of the local context, the standard approach is to update the function-key label dynamically with a text list or a string tag.

Example using a text list for F5:

  1. Create a text list TextList_F5_Labels with three entries: Start pump, Open valve 12, Reset counter.
  2. On the template's F5 label element, set Properties > Label > Dynamic and bind to a tag of type INT named CurrentF5Context.
  3. In the Loaded event of each screen, set CurrentF5Context to the appropriate index (0, 1, or 2) using SetValue.

6. Screen Number Management and Renumbering

In ProTool the screen number (the integer shown in the title bar and the GetScreenNumber system function) was assigned automatically in the order of creation. After migration to WinCC flexible the numbering can change to 1, 2, 3, 4, …, 18, 19 because the WinCC flexible compiler re-numbers based on its own internal sort. Many PLC programs are coded against the ProTool-era numbers, so reordering breaks the HMI ↔ PLC contract.

6.1 Inspect the current screen number

  1. Right-click any screen in the Screens node and select Properties.
  2. The General tab shows two fields:
    • Screen name — symbolic, e.g. Screen_017
    • Screen number — the integer, e.g. 17

6.2 Renumber a screen

  1. Open the screen's Properties dialog (right-click → Properties).
  2. Click the Screen number field and edit it. Valid range: 1 to 32767. Numbers must be unique across the project.
  3. Press OK. The screen name is unchanged; only the integer is rewritten.

6.3 Bulk renumber to a clean 1, 2, 3, 4, 5 sequence

  1. Sort the Screens node by the order you want them numbered.
  2. Open each screen → Properties → Screen number → assign 1, 2, 3, 4, 5, …
  3. Update any PLC logic that calls GetScreenNumber in the HMI tag interface so the controller's expected integers match the new numbers.
Best practice: keep an engineering log that maps the symbolic name to the integer. The screen number is a wire-level address; the screen name is the symbolic identifier. PLC code should reference the symbolic name wherever possible (WinCC flexible supports GetScreenName as of 2005 SP1 HF4 onward).

7. Migrating OP 270 (ProTool) → OP 277 (WinCC flexible)

Siemens officially documented this migration in the manual SIMATIC HMI Configuration Support for Migrators — Migration to Windows-based System. The migration is performed by WinCC flexible's integrated Project Migrator, which reads a ProTool V6.0 SP2 or later archive (file extension .pdb) and writes a new WinCC flexible project (extension .hmi or .hmi_zip).

7.1 Migration steps

  1. Open WinCC flexible and create a new project targeting the OP 277 6" Key.
  2. From the project menu select Project → Migrate ProTool Project (the wording varies slightly across SPs: in 2005 it is File → Migrate; in 2007/2008 it is under Options → Migrate ProTool Project).
  3. Browse to the source .pdb archive, click Open.
  4. WinCC flexible generates a migration log (.log). Open it and review Warnings and Errors sections before continuing.
  5. Accept the migration. All screens, tags, alarms, and the original function-key assignments are carried over.
  6. Compile and run the runtime simulator to validate behaviour.

7.2 What the migrator changes silently

ProTool element WinCC flexible post-migration state Field action
Screen numbers (1, 2, 3 …) Re-numbered by the WinCC flexible sort order, may be 17, 18, 19, … Re-assign numbers 1, 2, 3, 4, 5, … per Section 6.2.
ESC key — function "previous screen / start screen" ESC global assignment lost or remapped to Cancel on a per-screen basis Re-wire ESC on the template (see Section 8).
System functions bildauf, bildab Replaced by ActivateScreenByNumber Update PLC code to use GetScreenNumber + ActivateScreenByNumber pattern.
Bitmap fonts (ProTool bitmap) Migrated to WinCC flexible default font, possibly larger Resize labels to fit the 320 x 240 layout.
Alarms, logged in Alarm_S view Migrated to Alarm view; class names preserved Re-verify acknowledgement bits.

8. ESC Key Behaviour After Migration

The reported symptom — "the ESC key is sometimes not reactive start screen although the key is good" — has three layered causes, ranked by frequency in the field.

8.1 Cause A — global ESC assignment was lost in migration

ProTool configured the ESC key as a project-wide "return to start screen" event. The ProTool → WinCC flexible migrator does not always preserve this binding. The ESC key ends up with no global event and only a per-screen Cancel event on screens where the original ProTool configuration defined one. As a result, on screens that were not explicitly configured in ProTool, the ESC key does nothing.

Fix:

  1. Open Screens → Template.
  2. From the toolbox, drop a function key onto the ESC position. The OP 277 has a dedicated ESC keycap; in WinCC flexible this maps to the system key ESC.
  3. In Properties → Events → Press, select ActivateScreen with the parameter set to your start screen (e.g. Screen_002).
  4. Compile. The ESC key will now return to the start screen from every screen.

8.2 Cause B — local ESC assignment overrides the global one

If a screen has its own Press event on the ESC key, the local event suppresses the global one. Common pattern: a confirmation dialog uses ESC as Cancel. After dialog close, the operator presses ESC again, but the local screen has a residual Press binding that swallows it.

Fix:

  1. Search the project for any screen that has an ESC → Press event other than the desired start-screen action.
  2. Either delete the local event (so the template takes over) or change it to ActivateScreen "StartScreen" explicitly so behaviour is consistent across screens.

8.3 Cause C — key-repeat / debounce on the membrane

The OP 277 6" Key uses a membrane keypad. The debounce is implemented in the OP 277 firmware; the WinCC flexible runtime does not apply any additional filter. If the operator taps ESC very briefly (< 40 ms is the typical minimum pulse width on the OP 277B firmware), the runtime may not register the press.

Fix:

  1. Update the OP 277 firmware to the latest available on the Siemens support portal. The most recent version for the OP 277 6" Key is ≥ V02.01.03.
  2. If the issue persists, open the device → Properties → Keyboard tab and confirm Repeat on long press is enabled if operator workflow depends on held keys.
Diagnostic shortcut: start the runtime simulator on the engineering PC and press ESC. If the simulator does go to the start screen but the panel does not, the issue is hardware / firmware, not project configuration. If the simulator also does not respond, the project lost the global ESC binding during migration (Cause A).

9. Verification and Commissioning Procedure

  1. Compile cleanProject → Compiler → All (Software Rebuild). Zero errors, zero warnings is the acceptance criterion. Warnings about deprecated function-key assignments should be resolved, not suppressed.
  2. Simulator passStart → Runtime → Start Runtime. Click each F-key from the start screen, the middle of the menu tree, and the deepest sub-screen. Confirm the expected action fires in every context.
  3. Cross-check the global map — in the project tree, right-click Function Keys and select Cross-reference. Each F-key should show either a global assignment (template) or local assignment(s) on a screen list. No key should be unbound unless intentional.
  4. Migration log review — open ProjectMigration.log and resolve every Warning entry. Common warnings: Function key F7 lost during conversion, Screen number rewritten from 5 to 17, ESC key event dropped.
  5. Panel transferProject → Transfer → Transfer. Choose Serial / MPI / PROFIBUS for a USB PC adapter, or Ethernet if the OP 277 variant supports it. After transfer, perform a power cycle.
  6. Operator validation — have the end-user perform a typical work cycle: log in, change language, navigate, log out. Confirm ESC returns to the start screen at every step.

10. Troubleshooting Matrix

Symptom Probable cause Where to look in the project Remediation
F-key works on one screen only Local assignment present; no global binding on template Screens → Template (F-key → Events) Wire the action on the template's F-key Press event
F-key label is wrong on a specific screen Text list index is incorrect on the screen's Loaded event Screen → Events → Loaded Set the correct index via SetValue
Screen number is 17, 18, 19 after migration WinCC flexible automatic renumbering Screen → Properties → Screen number Re-assign 1, 2, 3, 4, 5 manually
ESC does not go to start screen Migration lost ESC global binding Template → ESC system key → Events Wire ActivateScreen "StartScreen" on ESC Press
ESC goes to start screen on some screens only Local ESC event overrides global Per-screen → ESC → Events Remove or align local ESC event
Compile error: duplicate screen number Two screens assigned the same integer Compiler log Assign unique numbers
F-key label graphic appears in mono but bitmap is colour OP 277 is 16-colour STN Picture → Properties → Color depth Re-export the source graphic as 16-colour BMP
Operator presses F3 and nothing happens at all F3 disabled in the project properties Device → Properties → Keys Enable F3 or re-assign the action to a different key
Template edited but no screens reflect the change Project was not recompiled Compiler status Force Rebuild All

11. Frequently Asked Questions

How do I make a function key on the OP 277 trigger the same action on every screen?

Open Screens → Template in WinCC flexible, select the function key, and configure the action under Properties → Events → Press (e.g. ActivateScreen "StartScreen"). The template propagates the binding to every screen automatically. See WinCC flexible 2008 Compact / Standard / Advanced manual for the full event model.

How do I make a function key perform a screen-specific action only on one screen?

Open the target screen, drop the function key on the screen (or override the inherited template key), and configure Events → Press with the screen-specific function. The local binding takes precedence over the global one for the duration of that screen.

Can I rename the screen number back to 1, 2, 3, 4, 5 after a ProTool to WinCC flexible migration?

Yes. Right-click the screen in the project tree, choose Properties, and edit the Screen number field. Valid range is 1 to 32767 and numbers must be unique. Update any PLC program that reads GetScreenNumber to match the new sequence.

The OP 277 ESC key does not return to the start screen on every screen after migration. What is wrong?

The most common cause is that the ProTool global ESC binding was lost during migration. Re-open Screens → Template, select the ESC system key, and wire Events → Press → ActivateScreen "StartScreen". The behaviour is then project-wide. Refer to the SIMATIC HMI Configuration Support for Migrators manual for the complete list of migration side-effects.

Which WinCC flexible versions support the OP 277 6" Key?

WinCC flexible 2004 SP1, 2005 SP1, 2007 SP1, 2008 SP1 / SP2 / SP3 all support the OP 277 6" Key. The latest service pack, WinCC flexible 2008 SP3, is recommended for new and migration projects because it includes the most complete migrator logic and the most recent OP 277 firmware update. Confirm the device catalog number against the SIMATIC HMI OP 277 device manual before commissioning.

Back to blog