How to Create a PLC Variable/Tag Table from Scratch
Step-by-step guide for creating a PLC symbol table or tag table when no documentation exists. Covers I/O assignment, naming conventions, and tools for STEP 7 and TIA Portal.
How to Create a PLC Variable/Tag Table from Scratch
When you inherit a PLC program with no symbol table, every address is a mystery. E 0.0 could be a start button, a proximity sensor, or an emergency stop. Creating a variable table is the single most valuable documentation step — it transforms cryptic addresses into readable code. This guide covers the complete process.
What You Need Before Starting
- The PLC program (backup or online connection)
- Electrical schematics / wiring diagrams (the most important document)
- Access to the machine (for physical tracing if schematics are incomplete)
- A cross-reference list from the PLC program
- 1–3 days of time, depending on program size
Step 1: Generate a Cross-Reference List
The cross-reference list shows every address used in the program and where it is used.
In STEP 5: Extras → Cross-Reference (Querverweisliste / QL)
In STEP 7 Classic (SIMATIC Manager): Extras → Reference Data → Cross References
In TIA Portal: Project → Cross-references (in the Inspector window)
This gives you a complete list of every I/O address, marker, timer, counter, and data block element used in the program. Many addresses in the hardware may not be used in the program — the cross-reference list tells you which ones actually matter.
Step 2: Map I/O Addresses to Physical Devices
This is the core work. For every input and output address in the cross-reference list, identify the physical device:
From wiring diagrams (preferred):
- Find the PLC terminal assignments
- Trace each terminal to its field device
- Record: PLC address → Terminal → Cable → Device → Device function
From the machine (if no wiring diagrams):
- Put the PLC in STOP mode (or use the monitoring function in RUN)
- Activate each sensor/actuator manually and observe which PLC address changes
- For outputs: Force individual outputs (with extreme caution!) and observe which device activates
Record format:
| Address | Device | Location | Function | Cable |
|---|---|---|---|---|
| E 0.0 | S1 | Panel 1 | Start button | W101 |
| E 0.1 | B1 | Station 3 | Part present sensor | W102 |
| A 4.0 | K1 | Cabinet | Conveyor motor contactor | W201 |
Step 3: Name Markers, Timers, and Counters
Markers (M), timers (T), and counters (Z) do not have physical connections — their function can only be determined by reading the program logic.
Common patterns:
| Pattern | Likely Function | Suggested Name |
|---|---|---|
U E x.x / O A y.y / UN E z.z / = A y.y | Self-holding circuit | Motor_Self_Hold |
U E x.x / L KT ... / SI T n | Delay timer for sensor | Sensor_Delay_Timer |
U E x.x / FP M n.n / ZV Z n | Parts counter | Parts_Counter |
S M n.n (with no R in same network) | Status flag | Step_Active or Mode_Selected |
Step 4: Choose a Naming Convention
There is no universal standard, but consistency is key. IEC 61131-3 specifies that variable names must consist of letters, digits, and underscores, starting with a letter or underscore.
Recommended structure: [Location]_[Device]_[Function]
Examples:
| Address | Name | Description |
|---|---|---|
| E 0.0 | St1_Start_Button | Station 1 Start button |
| E 0.1 | St1_Safety_Door | Station 1 Safety door closed |
| E 0.2 | St1_Part_Sensor | Station 1 Part present sensor |
| A 4.0 | St1_Conv_Motor | Station 1 Conveyor motor |
| A 4.1 | St1_Clamp_Cyl | Station 1 Clamping cylinder |
| T 1 | St1_Start_Delay | Station 1 Start delay timer |
| Z 1 | St1_Parts_Count | Station 1 Parts counter |
| M 10.0 | St1_Motor_Self_Hold | Station 1 Motor self-holding |
Rules to follow:
- Use underscores as separators (not spaces or camelCase)
- Be descriptive:
Conveyor_1_MotorbeatsM1 - Include location when the plant has multiple identical stations
- Maximum length: 24 characters in STEP 5, 128 in STEP 7, 128 in TIA Portal
- Avoid special characters (ä, ö, ü, ß) in international projects
Step 5: Enter the Table
In STEP 5: The symbol table (Zuordnungsliste) is edited in the ZL editor.
In STEP 7 Classic: Symbol Editor (Extras → Symbol Table). Can export/import as .ASC file.
In TIA Portal: PLC tags (in the project tree under "PLC tags → Default tag table"). Can export/import as .XML file.
Bulk entry tip: Export the tag table to Excel/CSV, fill in names and comments, then import back. This is much faster than typing each entry in the PLC software.
Step 6: Verify
After creating the table, verify it:
- Open the program with symbols displayed
- Read through the most critical blocks — does the logic make sense with the names?
- Monitor the program online — do the named variables behave as expected?
- Have an operator walk through a machine cycle while you watch the named I/O
How PLCcheck Pro Helps
PLCcheck Pro can accelerate steps 1–4 dramatically:
- Generates the complete cross-reference automatically
- Identifies common logic patterns and suggests variable purposes
- Proposes naming based on usage patterns
- Exports a ready-to-import symbol table
Frequently Asked Questions
How long does it take to create a tag table for a typical machine?
For a small machine (32 I/O, 20 blocks): 4–8 hours. For a medium machine (128 I/O, 50 blocks): 1–2 days. For a large system (500+ I/O, 100+ blocks): 3–5 days. The time depends heavily on the availability of wiring diagrams.
Should I name every address or only the used ones?
Name every used address (from the cross-reference list). Unused addresses can be marked as "spare" or left unnamed. Do not name addresses that are reserved for future use unless you know their intended function.
Maintained by PLCcheck.ai. Last update: March 2026. Not affiliated with Siemens AG.
Related Articles
PLC Memory Optimization: Reducing Data Block Usage
Practical techniques for reducing PLC memory usage on S7-300/400 where memory is limited. Covers DB optimization, marker cleanup, dead code removal, and string handling.
8 min read
plc-programmingRefactoring Legacy PLC Code: From Spaghetti to Structure
How to refactor messy legacy PLC code into maintainable structure. Covers identifying spaghetti code, step-by-step refactoring, when to refactor vs. rewrite, and practical examples.
12 min read
plc-programmingCommon PLC Programming Mistakes and How to Fix Them
The 10 most common PLC programming mistakes found in industrial plants. Each mistake with explanation, real-world consequence, and fix. Covers S5 and S7.
12 min read
Analyze your PLC code with AI
PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.
Try PLCcheck Pro →Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.