Siemens S7 ANY Pointer Calculator
Encode and decode the classic 10-byte Siemens S7 ANY pointer used by many STEP 7 and S7 communication operations. Calculate transport size, repetition count, DB number, memory area and the 24-bit byte/bit address.
bit address = byte offset × 8 + bit offset.
The byte offset is therefore address ÷ 8 and the bit number is
address mod 8.
—
What Is a Siemens S7 ANY Pointer?
The classic Siemens S7 ANY pointer is a 10-byte structure used to describe a memory area and data type to many STEP 7 system functions, communication operations and block interfaces.
Instead of containing only a memory address, an ANY pointer also carries a syntax identifier, transport size, repetition count, data block number and memory-area identifier.
S7 ANY Pointer 10-Byte Structure
Byte 0 Syntax ID
Byte 1 Transport Size
Bytes 2–3 Repetition Count
Bytes 4–5 DB Number
Byte 6 Memory Area
Bytes 7–9 24-bit Bit AddressThe multi-byte count and DB-number fields are stored with the high byte first. The final three bytes form one unsigned 24-bit address expressed in bits.
Syntax ID 0x10
A classic S7 ANY pointer normally starts with hexadecimal
0x10. This identifies the S7 ANY syntax used by the 10-byte
pointer structure.
Byte 0:
10
Meaning:
Classic S7 ANY syntaxS7 ANY Transport Size
| Code | Type | Common Element Width |
|---|---|---|
| 0x01 | BIT | 1 bit |
| 0x02 | BYTE | 1 byte |
| 0x03 | CHAR | 1 byte |
| 0x04 | WORD | 2 bytes |
| 0x05 | INT | 2 bytes |
| 0x06 | DWORD | 4 bytes |
| 0x07 | DINT | 4 bytes |
| 0x08 | REAL | 4 bytes |
| 0x09 | DATE | 2 bytes |
| 0x0A | TIME_OF_DAY | 4 bytes |
| 0x0B | TIME | 4 bytes |
| 0x0C | S5TIME | 2 bytes |
| 0x0E | DATE_AND_TIME | 8 bytes |
Repetition Count
Bytes 2 and 3 contain the number of elements addressed by the pointer. The meaning is tied to the transport-size field.
Transport Size:
BYTE
Count:
10
Result:
10 BYTE elementsFor a WORD pointer, a repetition count of 10 refers to ten WORD elements, not ten individual bytes.
Data Block Number
Bytes 4 and 5 contain a 16-bit DB number. This value is meaningful when the selected area is a Data Block or Instance Data Block.
Bytes:
00 64
DB Number:
0x0064
= 100For Inputs, Outputs and Merkers, the DB-number field is normally zero.
Siemens S7 Memory Area Codes
| Code | Area | Common Address Prefix |
|---|---|---|
| 0x81 | Inputs | I |
| 0x82 | Outputs | Q |
| 0x83 | Merkers / Flags | M |
| 0x84 | Data Block | DB |
| 0x85 | Instance DB / DI | DI |
| 0x86 | Local Data | L |
| 0x87 | Previous Local Data | V / previous local |
24-Bit S7 ANY Address
The final three bytes form a 24-bit unsigned bit address. This is one of the most important details when manually constructing an ANY pointer.
Byte Offset = 20
Bit Offset = 0
Bit Address =
20 × 8 + 0
= 160 decimal
= 0x0000A0
Address Bytes:
00 00 A0How to Decode an S7 ANY Bit Address
Address bytes:
00 00 A3
24-bit address:
0x0000A3
= 163
Byte Offset:
floor(163 / 8)
= 20
Bit Offset:
163 mod 8
= 3
Result:
Byte 20, Bit 3DB1.DBX0.0 ANY Pointer Example
Suppose an ANY pointer refers to ten BYTE elements beginning at DB1 byte 0. The pointer can be represented as:
10 02 00 0A 00 01 84 00 00 00
10
Syntax ID
02
BYTE
00 0A
10 elements
00 01
DB1
84
DB area
00 00 00
Byte 0 / Bit 0DB100 Byte 20 Example
DB Number:
100
= 0x0064
Byte Offset:
20
Bit Address:
20 × 8
= 160
= 0x0000A0
ANY:
10 02 00 04 00 64 84 00 00 A0Merkers, Inputs and Outputs
ANY pointers are not limited to data blocks. Memory-area code 0x83 represents Merkers, 0x81 represents Inputs and 0x82 represents Outputs.
MB10:
Area:
83
DB Number:
0000
Byte Offset:
10
Bit Address:
10 × 8
= 80
= 0x000050BIT Transport Size
When transport size BIT is selected, the final bit component is especially important because the pointer can start at an individual bit position.
DB1.DBX0.3
Byte Offset:
0
Bit Offset:
3
Address:
0 × 8 + 3
= 3
Address Bytes:
00 00 03ANY Pointer vs S7 Address Text
A normal STEP 7 address such as DB10.DBB20 is a textual representation. The ANY pointer expands that idea into a structured binary descriptor containing both type and length information.
Text style:
DB10.DBB20
ANY structure additionally stores:
Syntax
Transport Size
Element Count
DB Number
Area
Bit AddressS7 ANY Pointer Calculator FAQs
How many bytes are in a classic S7 ANY pointer?
What does the first byte 0x10 mean?
What does area code 0x84 mean?
What does 0x83 mean?
Is the final address stored in bytes?
How do I calculate byte offset from an ANY pointer?
How do I get the bit offset?
Is the DB number used for Merkers?
Does the repetition count always mean bytes?
Does this tool decode every Siemens pointer format?
Build and Decode Siemens S7 ANY Pointers
Convert Siemens PLC memory addresses into the classic 10-byte ANY structure or decode existing ANY bytes into transport size, DB number, memory area and byte/bit address fields.