Resolving S7-1200 Data Record Area Pointer Tag Error in TIA

David Krause12 min read
SiemensTIA PortalTroubleshooting
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

Problem Statement

When configuring a Data Record area pointer on a SIMATIC S7-1200 against a WinCC Basic (Basic Panel) or WinCC RT Advanced HMI in TIA Portal, the PLC tag column in the Connections > Area Pointers editor rejects every tag that is offered in the object list. Selecting an indexed element such as "GlobalDataBlock".RecipyMailbox[0] produces the diagnostic message "The PLC Tag requires the same length as area pointer." The same error is reported whether the tag is referenced as a single word, an array slice, a 5-word STRUCT, or a member of a larger array. The project compiles only when the assignment is changed to the bare array symbol without an index.

Symptom in one line: TIA Portal refuses to bind any Array[i] element, STRUCT member, or partially-qualified sub-tag to a Data Record area pointer. The area pointer remains not configured at download, and the recipe mailbox remains inactive at runtime.

Affected Environment

Component Value
Controller SIMATIC S7-1200 (CPU 1211C / 1212C / 1214C / 1215C / 1217C, all firmware versions supported by the TIA Portal version in use)
HMI SIMATIC Basic Panel (KTP400 Basic, KTP600 Basic, KTP1000 Basic, TP1500 Basic) or WinCC RT Advanced (PC-based)
Engineering STEP 7 Basic V10.5 SP2, TIA Portal V11 through V20 (the dialog wording is identical across these versions)
Area pointer Data Record (used for recipe data record transfer)
PLC tag pattern Array[0..4] of Word declared inside a global data block (DB)
Storage location Global DB (optimized or standard access depending on TIA Portal version; the area pointer requires non-optimized access for the binding to resolve)

Technical Background: Data Record Area Pointers

An area pointer is a fixed-width, contiguous block of process data that the HMI runtime reads or writes as a single chunk at every configured acquisition cycle. The pointer is referenced by one symbolic PLC tag whose length must match the area pointer's data record length in bytes. The list of area pointers supported on S7-1200 / S7-1500 against WinCC Basic / RT Advanced is:

  • Data Record – recipe mailbox (5 words / 10 bytes)
  • Date / Time – HMI to PLC clock synchronization (8 bytes)
  • Coordination – user-led handshake for HMI startup and lifecycle (1 word / 2 bytes)
  • Project ID – project identification (1 word / 2 bytes)

The Data Record pointer is the only area pointer whose data record length is set by Siemens and cannot be changed by the user. Its mailbox layout is fixed at 5 words (10 bytes) regardless of the number of recipe elements or records on the HMI side. The runtime writes the recipe number, record number, element number, and a control word to that mailbox and expects the S7-1200 user program to interpret the field and copy data record contents into the configured data records of the recipe.

For official Siemens documentation on the area pointer concept, see General information on area pointers (TIA Portal V20 help).

Data Record Mailbox Layout

Word index Byte offset Field Direction Description
0 0 Control word HMI → PLC Trigger bits: e.g. 16#0001 = read record, 16#0002 = write record, 16#0004 = record changed, 16#8000 = busy
1 2 Recipe number HMI → PLC Recipe index (1-based) of the active data record
2 4 Record number HMI → PLC Record index (1-based) inside the recipe
3 6 Element number HMI → PLC Item index (1-based) inside the record
4 8 Reserved HMI → PLC Reserved; must be initialised to 16#0000

Total length: 5 × 2 bytes = 10 bytes. The PLC tag bound to the area pointer must therefore be a 10-byte contiguous block in the CPU's I/O or data area. A single WORD (2 bytes), a 4-word STRUCT (8 bytes), or any sub-element that is shorter or longer than 10 bytes is rejected at binding time.

Root Cause

The diagnostic "The PLC Tag requires the same length as area pointer" is generated by the TIA Portal editor when the symbol selected for the area pointer does not cover the full 10 bytes of the data record mailbox. There are three common root causes:

  1. Indexed element selection. The user navigates the object tree, expands the Array[0..4] of Word, and selects RecipyMailbox[0]. The selected symbol is a single Word (2 bytes), not the 5-word (10-byte) block the area pointer expects. The editor accepts the syntactic reference but fails the length check and emits the diagnostic.
  2. STRUCT with different total length. A user-defined 5-field STRUCT declared as five separate Word members compiles to a 10-byte block and would be acceptable, but a STRUCT with mixed types (e.g. Word, Word, Word, Word, Bool) produces a 9-byte block that fails the length check.
  3. Optimized DB access. On S7-1200 firmware V4.x and S7-1500, the default for new data blocks is optimized block access. The area pointer editor needs a non-optimized (absolute) symbol, and on a few TIA Portal versions the tag length is reported incorrectly if the DB is set to optimized access.
Design constraint: The area pointer does not navigate into an array. It treats the symbol you select as the base address of a fixed-width window. Selecting the array base symbol (the whole Array[0..4] of Word) is therefore the only valid binding, regardless of which array element you are trying to point at semantically.

Solution: Bind the Array Base Symbol, Not the Indexed Element

The fix is to select the array symbol without an index. The TIA Portal object list presents the array in two forms:

  • "GlobalDataBlock".RecipyMailbox – the full 5-word array, 10 bytes
  • "GlobalDataBlock".RecipyMailbox[0] – a single Word, 2 bytes
  • "GlobalDataBlock".RecipyMailbox[1] – a single Word, 2 bytes
  • ... etc.

Selecting the first form satisfies the area pointer length check and binds the data record mailbox correctly. The index fields in the runtime are populated inside the array by the HMI at runtime; the user program reads them by index (e.g. "GlobalDataBlock".RecipyMailbox[1] for the recipe number) but the area pointer is bound to the base symbol only.

Step-by-Step Configuration

  1. Open the TIA Portal project that contains both the S7-1200 station and the HMI station.
  2. In the project tree, expand HMI > Connections and double-click the connection that targets the S7-1200 (for example HMI_Connection_1).
  3. Switch to the Area Pointers tab of the connection editor.
  4. Check the Data Record checkbox. The PLC tag column becomes editable and the Length column displays 5 words in greyed-out text.
  5. Click the empty cell in the PLC tag column. The browse button (...) opens the PLC tag selector.
  6. Navigate to PLC tags > Default tag table or directly to the global DB. Do not expand the RecipyMailbox array.
  7. Select the symbol "GlobalDataBlock".RecipyMailbox (the array base, without an index). Confirm with OK.
  8. Confirm the Length column now reads 5 words for the data record row.
  9. Compile the HMI station. No diagnostic should remain on the area pointer row.
  10. Download the S7-1200 program first (so the global DB exists in the CPU), then download the HMI station.

Verification

  1. Compile check. In the HMI editor, run Compile > Software (rebuild all). The Info window must show zero errors and zero warnings related to the connection or area pointer.
  2. Online diagnostic. In the HMI connection editor, click Go online after the download. The Status column of the data record row should report Established; a Not connected or Configuration error status means the binding is still bad.
  3. Online tag watch. In the S7-1200 project, open the global DB online and watch RecipyMailbox[0] through RecipyMailbox[4]. Trigger a read or write from the HMI recipe view and confirm the control word, recipe number, record number, element number, and reserved word are written as expected by the HMI runtime.
  4. Runtime trace. In the HMI runtime log (or via the WinCC RT Advanced diagnostic files under \HmiRtm\Logfiles), confirm that the line "Data record pointer active on area 0x..." appears after download, and that no 0x8004 / 0x8005 (HMI area pointer error) is logged.

Alternative Layouts That Also Work

Once the binding rule is understood, several tag layouts are accepted by the area pointer editor as long as the total length is 10 bytes and the layout is contiguous:

DB declaration Bytes Accepted? Notes
RecipyMailbox : Array[0..4] of Word; 10 Yes Standard pattern. Bind the base symbol.
RecipyMailbox : Struct
  Ctrl : Word;
  RecipeNo : Word;
  RecordNo : Word;
  ElementNo : Word;
  Reserved : Word;
End_Struct;
10 Yes Bind the struct base symbol. More readable in the SCL/ST user program.
Mailbox : Array[0..9] of Byte; 10 Yes Use byte offsets and combine words via WORD_TO_INT(MAKE_WORD(...)) on the CPU side.
Mailbox : Array[0..4] of Int; 10 Yes Equivalent to Word in 16-bit signed range; same length.
Mailbox : Word; 2 No Fails length check; only covers the control word.
Mailbox : Array[0..5] of Word; 12 No Fails length check; pointer is fixed at 10 bytes.
Mailbox : Array[0..3] of DWord; 16 No Even though 4×4=16 bytes covers the area, the binding is 4 elements of 4 bytes each, not a contiguous 10-byte block; the editor does not accept it.

Common Configuration Errors

Symptom Root cause Resolution
"The PLC Tag requires the same length as area pointer" on Data Record row Indexed array element or partial STRUCT selected Select the array or struct base symbol without index
Data Record row stays greyed out; PLC tag column is empty Connection is not yet bound to a real S7-1200 station in the project Re-create the connection from the HMI station toward the S7-1200 station; verify the partner is the right PLC
HMI runtime reports 0x8004 / 0x8005 at recipe trigger Area pointer bound but not initialised in OB100 / startup; CPU was in stop when the recipe was triggered Initialise the array in OB100 with FILL_BLK or MOVE and re-download the HMI
Recipe number/record number never appear in the DB Data Record row not enabled, or wrong connection is used by the HMI recipe view Confirm the recipe view points to the connection that has the data record area pointer enabled
Compile warning: "DB is optimized - some tools cannot access the data" Data block uses optimized access on a TIA Portal version that does not fully support optimized DBs for area pointers Switch the DB to Standard (non-optimized) access; rebuild; re-download the CPU
Binding succeeds, but the user program sees zeros on every word The CPU is being scanned with a different data record length, e.g. legacy 4-word layout from an older project Re-create the connection; do not import area pointer config from older TIA Portal versions

User Program Reference (SCL on S7-1200)

After binding, the typical S7-1200 user program reads the mailbox and copies the active record to / from a separate recipe body DB. The pattern is:

// GlobalDataBlock.RecipyMailbox is Array[0..4] of Word, already bound to the HMI data record area pointer.
// GlobalDataBlock.RecipeBody is Array[1..10, 1..5] of Int (10 records, 5 elements per record).

IF "GlobalDataBlock".RecipyMailbox[0] = 16#0001 THEN              // HMI requests read
    RecipeNo := "GlobalDataBlock".RecipyMailbox[1];
    RecordNo := "GlobalDataBlock".RecipyMailbox[2];
    ElementNo := "GlobalDataBlock".RecipyMailbox[3];
    // Bounds checks, then copy:
    IF (RecipeNo >= 1) AND (RecipeNo <= 10) AND (RecordNo >= 1) AND (RecordNo <= 5) THEN
        "GlobalDataBlock".RecipeBody[RecipeNo, RecordNo] :=
            "GlobalDataBlock".WorkingElement[ElementNo];
    END_IF;
    "GlobalDataBlock".RecipyMailbox[0] := 16#8000;              // Busy -> Done
    "GlobalDataBlock".RecipyMailbox[0] := 16#0000;
END_IF;

IF "GlobalDataBlock".RecipyMailbox[0] = 16#0002 THEN              // HMI requests write
    RecipeNo := "GlobalDataBlock".RecipyMailbox[1];
    RecordNo := "GlobalDataBlock".RecipyMailbox[2];
    ElementNo := "GlobalDataBlock".RecipyMailbox[3];
    IF (RecipeNo >= 1) AND (RecipeNo <= 10) AND (RecordNo >= 1) AND (RecordNo <= 5) THEN
        "GlobalDataBlock".WorkingElement[ElementNo] :=
            "GlobalDataBlock".RecipeBody[RecipeNo, RecordNo];
    END_IF;
    "GlobalDataBlock".RecipyMailbox[0] := 16#8000;
    "GlobalDataBlock".RecipyMailbox[0] := 16#0000;
END_IF;

Version Compatibility Notes

  • STEP 7 Basic V10.5 SP2: original release where the error pattern was first documented. The fix (select array base, not indexed element) is identical in every later TIA Portal version.
  • TIA Portal V11 / V12 / V13: dialog wording is "The PLC Tag requires the same length as area pointer."
  • TIA Portal V14 / V15 / V16: dialog wording updated to "The assigned tag does not match the required length of the area pointer." Underlying rule unchanged.
  • TIA Portal V17 / V18 / V19 / V20: behavior identical. Newer versions also expose a contextual Error tooltip in the connection editor pointing to the offending symbol.
  • S7-1200 firmware V4.x and V5.x: identical behavior. S7-1500 with optimized DBs and S7-1200 with optimized DBs both require that the DB be set to Standard access for the area pointer binding to resolve.

Field-Commissioning Checklist

  1. Confirm the S7-1200 firmware version is compatible with the TIA Portal version that contains the HMI configuration.
  2. Confirm the global DB holding the mailbox is set to Standard (non-optimized) access.
  3. Declare the mailbox as Array[0..4] of Word or an equivalent 10-byte contiguous block.
  4. In the HMI connection editor, bind the base symbol of the array (no index, no slice, no member).
  5. Initialise the mailbox in OB100 with FILL_BLK to 16#0000 so the HMI starts from a known state.
  6. Compile the HMI station, then download the CPU, then download the HMI.
  7. Online-watch the first four words of the mailbox and trigger a recipe read/write to verify the HMI writes valid values.
  8. Document the recipe number, record number, and element number interpretation in the user program so the recipe body and the HMI views stay aligned.

Troubleshooting Matrix

Check Pass criterion Tool / location
DB access mode Standard (not optimized) TIA Portal: DB > Properties > Attributes
Array length 10 bytes (5 words) TIA Portal: DB editor, status bar shows size
Binding target Array base symbol without index TIA Portal: HMI > Connections > Area pointers
Compile 0 errors, 0 warnings on connection row TIA Portal: Info window after rebuild
Online status Data record row reports Established TIA Portal: Connection editor, Go online
Runtime mailbox fill Words 0-3 contain HMI-driven values during recipe transfer TIA Portal: Watch table on the global DB
Runtime error log No 0x8004 / 0x8005 entries WinCC RT diagnostic directory

FAQ

Why does TIA Portal reject the indexed element RecipyMailbox[0] for a Data Record area pointer?

The Data Record area pointer is a fixed 10-byte (5-word) mailbox. The PLC tag must cover that exact 10-byte window. Selecting RecipyMailbox[0] binds only one Word (2 bytes), which fails the length check. Bind the array base symbol RecipyMailbox instead and address the individual fields by index inside the S7-1200 user program.

What is the correct length of a Data Record area pointer on S7-1200?

Always 5 words (10 bytes): control word, recipe number, record number, element number, reserved. The length is fixed by Siemens and cannot be changed, regardless of the number of recipe elements defined on the HMI side.

Do I have to use an Array[0..4] of Word, or can I use a 5-field STRUCT?

Both are valid as long as the total size is exactly 10 bytes and the symbol you bind is the base symbol (the array or the STRUCT, not a member). A STRUCT is often easier to read on the CPU side because you can name the fields ControlWord, RecipeNo, RecordNo, ElementNo, Reserved.

Does the global DB have to be non-optimized?

Yes. Area pointer binding requires standard (non-optimized) block access on the S7-1200. Open the DB in TIA Portal, go to Properties > Attributes, and uncheck Optimized block access. Rebuild the project and re-download the CPU before re-downloading the HMI.

Will this fix apply to TIA Portal V17, V18, and V20?

Yes. The error message has been re-worded in newer releases, but the underlying rule is unchanged: the symbol bound to a Data Record area pointer must be a 10-byte contiguous block, and the array base symbol (not an indexed element) is the correct choice.

Back to blog