Documentation Reconstruction for Undocumented B&R Machines
Overview
When an OEM goes out of business or abandons support, automation engineers are left maintaining machines built on B&R CP1584 hardware with zero documentation: no source code, no wiring diagrams, no IO maps, no maintenance manuals, and no explanation of program logic. This guide provides a systematic methodology for reconstructing a complete documentation set from scratch using physical inspection, runtime observation, forensic extraction, and reverse-engineering techniques specific to B&R Automation Studio and the X20 ecosystem.
The reconstruction process follows five parallel tracks:
- Physical infrastructure documentation — wiring, panel layouts, field devices
- IO mapping reconstruction — linking every physical wire to every software address
- Program behavior documentation — recording what the logic does at runtime
- Communication mapping — documenting every network connection and data exchange
- Maintenance manual assembly — combining all findings into actionable procedures
None of these tracks requires the original source code. Together they produce a documentation package that enables safe maintenance, troubleshooting, and eventual reprogramming.
Audience: Automation engineers maintaining B&R CP1584 machines from defunct OEMs.
Prerequisites:
- Network access to the CP1584 (see cp1584-forensics.md Section 1 for discovery)
- Automation Studio installed (any version 4.x or newer)
- Physical access to the machine control panel
- Multimeter, label maker, camera, and a laptop
Related documents:
- project-reconstruction.md — Recovering the Automation Studio project structure
- cp1584-forensics.md — Forensic data extraction from the running PLC
- memory-map.md — B&R memory addressing and IO data layout
- io-card-hardware.md — X20 IO card types, diagnostics, and LED codes
- io-sniffing.md — Fieldbus traffic capture and analysis
- program-reverse-engineering.md — Binary analysis of compiled B&R code
1. Phase 0: Preservation and Safety
Before any reconstruction begins, preserve every piece of existing information and establish safe working conditions.
1.1 Capture Everything That Exists
Even an undocumented machine often has fragments of information scattered across nameplates, stickers, hand-written labels, and old drawings stuffed inside cabinet doors.
Procedure:
- Photograph every nameplate, label, and marking on every component in the control cabinet — DIN rail modules, power supplies, circuit breakers, contactors, VFDs, terminals, and the PLC itself.
- Photograph the inside of every cabinet door — OEMs sometimes tape drawings or cheat sheets inside.
- Photograph the front and back of every HMI screen — note any model numbers, firmware versions visible in settings menus.
- Check for any paperwork in the machine area: operator manuals (even for sub-assemblies), startup checklists, calibration certificates, maintenance logs left by previous technicians.
- If any USB drives, CF cards, or backup media are found, image them immediately with
ddbefore any other access:dd if=/dev/sdX of=cf_card_backup.img bs=4M status=progress - Extract the CF card from the CP1584 and image it — it may contain source code, configuration files, or logs. See cf-card-boot.md for the extraction procedure and config-file-formats.md for file format analysis.
1.2 Lockout/Tagout and Safety Documentation
Before any hands-on work, document the safety systems present on the machine.
- Identify every emergency stop button (physical location, color, type — mushroom-head, pull-to-release, key-release).
- Trace the E-stop chain: follow the hardwired safety circuit from each E-stop through safety relays to the PLC safety inputs. Document every intermediate contact.
- Document every safety-rated device: light curtains, safety mats, interlock switches, guard door sensors, two-hand stations.
- Record the part numbers and models of all safety relays and safety controllers.
- Create a Safety Interlock Table — even without the original drawing, you can build this by:
- Cycling each guard door / interlock one at a time while observing which inputs change on the PLC
- Recording the machine’s response (immediate stop, controlled stop, warning only)
- Documenting which actuators are disabled by each interlock
2. Phase 1: Physical Infrastructure Documentation
2.1 Control Panel Inventory
Create a complete inventory of every component in the electrical cabinet.
Equipment Inventory Table Template:
| Tag | Description | Manufacturer | Model | Part Number | Qty | Voltage | Notes |
|---|---|---|---|---|---|---|---|
| PS1 | Main Power Supply | Mean Well | NDR-240-24 | NDR-240-24 | 1 | 24VDC | 10A, DIN rail |
| K1 | Main Contactor | Schneider | LC1D18 | LUCA18BD | 1 | 120VAC coil | Motor M1 |
| PLC1 | CPU | B&R | X20CP1584 | X20CP1584 | 1 | 24VDC | SN: xxx |
| VFD1 | Variable Freq Drive | ABB | ACS580 | ACS580-01-012A-3 | 1 | 480VAC 3ph | Motor M1 |
For B&R X20 modules specifically, record:
- Module type and order on the DIN rail (left to right)
- Serial numbers (visible on module label)
- Hardware revision
- Firmware version (visible in Automation Studio online view or via SDM)
- LED state at power-on and during normal operation
This information is critical for replacement ordering and is covered in detail in io-card-hardware.md Section 8.
2.2 Wire Tracing and Numbering
Wire tracing is the most time-consuming phase but produces the most valuable output. Every wire in the cabinet must be accounted for.
Tools Required:
- Digital multimeter with continuity mode
- Wire tracer / tone generator (for long conduit runs)
- Cable identifier set (for multi-core cables)
- Label printer (Brady BMP21 or equivalent)
- Camera for documenting routing before disconnecting
Wire-by-Wire Tracing Procedure:
-
Establish a numbering scheme before starting. Recommended convention:
XX-Ywhere XX = page/drawing number, Y = wire number- Example:
01-001,01-002— sequential per power rail - For B&R terminal blocks: use the terminal number as the primary identifier
-
Start with power distribution:
- Trace every incoming power line from the main disconnect through breakers to transformers to power supplies.
- Document voltage at every stage (L1, L2, L3, N, PE, 24VDC+, 24VDC-, 120VAC, etc.).
- Mark every ground/PE connection.
-
Trace every IO wire:
- At the field terminal block (where wires leave the cabinet), note the wire number.
- Follow it to the IO module terminal.
- Record the IO module slot position and terminal pin.
- Cross-reference with the device it connects to in the field.
-
Apply temporary labels as you go. Use self-laminating wire markers that wrap around the wire.
-
Photograph every row of terminals before and after labeling to create a photographic record.
2.3 Creating Wiring Diagrams from Physical Inspection
Since there are no original drawings, you must create them. Use CAD software (AutoCAD Electrical, EPLAN, or even draw.io for initial drafts).
Diagram Types to Create:
| Diagram | Contents | Priority |
|---|---|---|
| Power Distribution | Main disconnect, breakers, transformers, power supplies, PE routing | Critical |
| IO Wiring Matrix | Every field device → terminal block → IO module pin → slot position | Critical |
| Safety Circuit | E-stops, safety relays, guard interlocks, hardwired safety chains | Critical |
| Motor Control | Contactors, overloads, VFDs, motor connections | High |
| Panel Layout | Physical component placement with dimensions | Medium |
| Network Topology | Ethernet, POWERLINK, serial connections between devices | High |
IO Wiring Matrix Template:
| Field Device | Location | Device Tag | Wire # | TB Term | IO Module | Slot | Channel | Signal Type |
|---|---|---|---|---|---|---|---|---|
| Proximity Sensor | Station 3 | B1-PS1 | 01-042 | X20TB12/T3 | X20DI9371 | 4 | Ch 3 | 24VDC PNP NO |
| Cylinder Ext. | Cylinder A | B1-LS1 | 01-087 | X20TB12/T7 | X20DI9371 | 4 | Ch 7 | 24VDC PNP NO |
| Heater Control | Oven Zone 1 | DR1 | 02-015 | X20TB06/T2 | X20DO9322 | 6 | Ch 2 | 24VDC SSR |
2.4 B&R X20 Specific: Reading the Hardware Tree
The CP1584 maintains a complete hardware configuration that can be read without source code. This gives you the IO module layout, addressing, and module types — the software side of the wiring matrix.
Procedure (see cp1584-forensics.md Section 5 and project-reconstruction.md Section 8):
- Connect via Automation Studio: Online → Settings → enter PLC IP → Connect
- In the System Tree (left panel), expand the hardware configuration to see every module:
- CPU model and firmware
- Bus couplers
- IO stations
- Every IO module with slot, channel count, and type
- Use Target Settings → Runtime → System Dump to export a complete text dump of all hardware info
- Cross-reference the hardware tree with your physical inspection — every module in software should exist on the DIN rail, and vice versa
Any discrepancy between the hardware tree and physical reality indicates a module was added, removed, or replaced after commissioning.
3. Phase 2: IO Mapping Reconstruction
IO mapping is the bridge between the physical wiring and the program logic. Without it, you cannot correlate field behavior with PLC behavior.
3.1 Generating the IO Map from Automation Studio
The IO map on a B&R CP1584 is partially determined by the hardware tree and partially by the programmer’s variable naming. Two approaches are needed.
Approach A: Hardware-Derived IO Addresses
B&R X20 modules are automatically mapped to IO ranges based on slot position. See memory-map.md Section 5 for the automatic addressing rules.
- In Automation Studio, connect to the PLC and open the IO Configuration view.
- Document the base address assigned to each IO module based on its position in the station.
- For each module, list every channel’s automatic address.
Approach B: Variable Name Discovery via PVI/OPC-UA
The compiled program’s variable names are accessible even without source code, provided the OEM did not disable symbol export.
- OPC-UA browse (see cp1584-forensics.md Section 6): Connect an OPC-UA client and enumerate all variable nodes. Names like
gMachine.nState,gAxis[1].bHome,gDI_Cylinder_A_Extendreveal the naming convention and purpose. - PVI enumeration (see cp1584-forensics.md Section 7 and pvi-api.md): Use PVI Manager to dump all accessible variables with names, types, and current values.
3.2 IO Mapping from Online Observation
When variable names are unhelpful (e.g., DI_01, DO_05), you must determine what each IO point does by observing the machine.
Procedure:
- Create a blank IO mapping spreadsheet with columns:
| IO Address | Auto Address | Module | Slot/Ch | Variable Name | Physical Wire | Field Device | Observed Behavior | State Normal | Verified |
-
For digital inputs — the actuation test:
- Manually operate each sensor, switch, and button on the machine one at a time.
- In Automation Studio, open the Watch window and monitor all digital input variables simultaneously.
- When an input changes state, note which variable toggled.
- Record the field device that caused the change.
-
For digital outputs — the force test:
- In Automation Studio, use the Force function on output variables.
- Force each output ON one at a time.
- Walk the machine and observe what physical device activates (solenoid valve clicks, relay pulls in, indicator lights up, motor starts).
- WARNING: Only force outputs when it is safe to do so. De-energize actuators, ensure personnel are clear, and verify no interlocks will be violated. Use the safety circuits to prevent unexpected machine motion.
-
For analog inputs — the stimulus test:
- Apply known signals to each analog input:
- For 4-20mA inputs: use a process calibrator to inject 4mA, 12mA, 20mA and observe the variable value at each point.
- For 0-10V inputs: use a variable DC power supply.
- For thermocouple/RTD: use a temperature simulator or a known-temperature source (ice bath, boiling water).
- Record the scaling: raw ADC value → engineering units.
- See analog-calibration.md for detailed calibration procedures.
- Apply known signals to each analog input:
-
For analog outputs — the measure test:
- Use a multimeter to measure the signal at each analog output terminal.
- If possible, vary the output variable value in the Watch window (or force it to known values) and measure the resulting current/voltage.
- Document the scaling relationship.
3.3 IO Mapping Table: Final Format
After completing all tests, compile the comprehensive IO map:
| Variable | Auto Addr | Module Type | Slot | Ch | Wire # | Field Device | Location | Signal | Range/Scale | Verified Date |
|---|---|---|---|---|---|---|---|---|---|---|
| gDI_EStop_Chain | %IX0.0.3 | X20DI9371 | 3 | 3 | 01-012 | E-Stop PB-1 | Op. Station | 24VDC NC | — | 2026-07-10 |
| gAI_Temp_Oven1 | %IW4 | X20AT6402 | 8 | 1 | 03-005 | PT100 | Oven Zone 1 | 4-20mA | 0-500 C | 2026-07-10 |
| gDO_Heater1 | %QX0.2.1 | X20DO9322 | 6 | 1 | 02-015 | SSR | Oven Panel | 24VDC | — | 2026-07-10 |
4. Phase 3: Program Logic Documentation from Runtime Behavior
Since source code is not available (see program-reverse-engineering.md and project-reconstruction.md Section 2), program logic must be documented through behavioral observation.
4.1 Variable Discovery and Categorization
Before tracing logic, build a complete variable dictionary.
Procedure:
- Dump all variables via PVI or OPC-UA (see cp1584-forensics.md Sections 6-7).
- Categorize by naming convention:
- Prefix
gDI_or_DI→ digital input - Prefix
gDO_or_DO→ digital output - Prefix
gAI_or_AI→ analog input - Prefix
gAO_or_AO→ analog output - Prefix
gAxisor_Axis→ motion axis reference - Prefix
gTimeror_Tmr→ timer reference - Suffix
_Set/_Reset→ latch/unlatch - Suffix
_Cmd/_Cmd→ command - Suffix
_Sts/_Fb→ status / feedback
- Prefix
- Record data types and initial values for every variable.
4.2 Machine Sequence Documentation
Document the complete machine operating sequence by observation.
Step-by-step procedure:
-
Record the normal operating cycle:
- Start the machine from cold start (power-on).
- Record every observable state change in order:
T+0s: Power ON → all outputs OFF, homing required T+2s: Auto sequence initiated → conveyor M1 starts T+5s: Part detected at sensor B1-PS1 → cylinder A extends T+7s: Cylinder A extended (B1-LS2 asserted) → heater energizes ... - Use a video camera recording synchronized with Automation Studio trace data.
-
Use Automation Studio Trace:
- Configure a Trace (Automation Studio → Tools → Trace) to record key variables at high resolution.
- Record during one complete machine cycle.
- Export the trace to CSV for analysis.
- This gives you the exact timing and ordering of state transitions.
-
Build a State Transition Diagram:
[IDLE] --Start Cmd AND All Safeties OK--> [HOMING]
[HOMING] --All Axes Homed--> [AUTO_READY]
[AUTO_READY] --Cycle Start--> [CYCLE_RUNNING]
[CYCLE_RUNNING] --Sequence Complete--> [AUTO_READY]
[CYCLE_RUNNING] --E-Stop OR Fault--> [ESTOPPED]
[ESTOPPED] --Reset AND All Safeties OK--> [IDLE]
- Document error/fault sequences:
- Trigger each known fault condition (sensor failure, timeout, overload).
- Record the machine’s response: which outputs turn off, which alarms activate, what the HMI displays.
- Document the recovery procedure: what must be done to clear the fault and restart.
4.3 Logic Tracing via Forced Inputs
For critical logic paths, use forced inputs to trace cause-and-effect relationships.
Procedure:
-
In the Watch window, identify a variable that changes during a specific machine operation (e.g., a motor start command).
-
Force the input conditions that should trigger that output:
- Force the start button input ON.
- Observe: does the motor command go ON?
- Release the start button. Does the motor command latch?
-
Work backwards through conditions:
- If the motor does NOT start when the start button is forced ON, look for other conditions that must be true (safety interlocks, permissives, other sensor states).
- Force each candidate condition ON one at a time until you identify all prerequisites.
-
Document findings as Boolean logic:
Motor1_Run_Cmd = Start_PB AND NOT E_Stop_Chain AND NOT Motor1_OL AND Motor1_Home_OK AND System_Auto_Mode
WARNING: Use forced values only in a controlled test environment. Never force safety-related inputs in an operational setting. Document every forced value change and revert it immediately after the test.
4.4 Timing and Sequencing Documentation
Many undocumented machines contain timers, delays, and sequencing that are not obvious from observation alone.
Capture timing with Automation Studio Trace:
- Set up a Trace recording with 1ms resolution capturing all state machine variables and timer variables.
- Run the machine through a complete cycle.
- Export and analyze to identify:
- Timer durations (e.g., cylinder dwell time = 2.3 seconds)
- Sequencing dependencies (Event A must occur within 5 seconds of Event B)
- Watchdog timeouts (what happens if a sensor does not assert within the expected window)
- Minimum/maximum cycle times
5. Phase 4: Communication and Network Documentation
5.1 Network Topology Discovery
Document every communication connection involving the CP1584.
Procedure:
- Use nmap to scan the PLC and all connected devices:
nmap -sn 192.168.1.0/24 nmap -sV -p 80,4840,11169,502,1080 <PLC_IP> - Check the CP1584 network configuration via SDM web interface (port 80) or Automation Studio Target Settings.
- Document all configured interfaces: ETH1, ETH2, POWERLINK, serial ports.
- For POWERLINK: document the MN (Managing Node) configuration and all CN (Controlled Node) devices. See powerlink-internals.md and x2x-protocol.md.
- For PLC-to-PLC communication: document any Modbus, OPC-UA, or proprietary data exchange. See plc-to-plc.md and modbus-gateway.md.
5.2 HMI Documentation
If the machine has an HMI (Power Panel, mapp View, or third-party panel):
- Photograph every screen at every state (running, faulted, maintenance mode).
- Document every button and its effect.
- Document every displayed value and its corresponding PLC variable (if possible via OPC-UA browsing).
- Record alarm messages and their conditions.
- Document any recipe or parameter screens with their adjustable values and ranges.
- See hmi-integration.md for B&R-specific HMI analysis techniques.
5.3 Alarm and Event Log Mining
The CP1584 maintains alarm and event logs that reveal historical behavior patterns.
- Use the mapp Alarm or AlarmX components if configured (see alarm-logging.md).
- Check the SDM (System Diagnostics Manager) for hardware-level events.
- Export AR log files from the CF card for analysis.
- Document recurring alarms, their frequency, and the conditions that precede them.
6. Phase 5: Building the Maintenance Manual
6.1 Maintenance Manual Structure
Assemble all findings into a structured maintenance manual. This is the deliverable that enables future engineers to maintain the machine safely.
Recommended structure:
1. Machine Overview
1.1 Purpose and Process Description
1.2 Machine Identification (model, serial, year, OEM if known)
1.3 System Architecture Diagram
2. Safety Systems
2.1 Safety Device Inventory
2.2 E-Stop Circuit Diagram
2.3 Safety Interlock Table
2.4 LOTO Procedures
3. Electrical Documentation
3.1 One-Line Diagram
3.2 Power Distribution
3.3 IO Wiring Matrix
3.4 Panel Layout Drawing
3.5 Network Topology Diagram
4. PLC and Control System
4.1 Hardware Configuration (CPU, IO modules, firmware versions)
4.2 Complete IO Map (variable ↔ physical device)
4.3 Program Logic Summary (state machine, sequences, interlocks)
4.4 Communication Map (PLC-to-PLC, HMI, SCADA)
4.5 IP Address and Network Configuration Table
5. Operation
5.1 Startup Procedure
5.2 Normal Shutdown Procedure
5.3 Operating States and Transitions
5.4 HMI Screen Reference
6. Troubleshooting
6.1 Common Faults and Resolution
6.2 Alarm Code Reference
6.3 Diagnostic Procedures (per subsystem)
6.4 IO Check Procedure (point-by-point verification)
7. Preventive Maintenance
7.1 PM Schedule
7.2 Spare Parts List (with B&R order codes)
7.3 Calibration Procedures (analog inputs/outputs)
7.4 Battery and Backup Replacement (retentive data — see [retentive-data.md](retentive-data.md))
8. Recovery and Disaster Procedures
8.1 CF Card Backup and Restore
8.2 PLC Replacement Procedure
8.3 IO Module Replacement (hot-swap procedure)
8.4 Firmware Recovery (see [bootloader-recovery.md](bootloader-recovery.md))
8.5 Complete System Restore
9. Appendices
A. Original Program Binary Backup Locations
B. Automation Studio Connection Details
C. Password and Access Level Documentation
D. Revision History
6.2 Spare Parts List
For B&R X20 systems, create a spare parts list with exact order codes:
| Component | B&R Order Code | Description | Qty on Hand | Lead Time | Critical? |
|---|---|---|---|---|---|
| CPU | X20CP1584 | PLC CPU, 256MB DDR2 | 0 | 4-6 weeks | Yes |
| PS Module | X20PS2100 | 24V power supply module | 1 | 1-2 weeks | Yes |
| DI Module | X20DI9371 | 24VDC, 32ch, diagnostic | 2 | 1-2 weeks | Yes |
| CF Card | 8CFC3.5STR | CompactFlash 4GB | 2 | 1 week | Yes |
| Bus Module | X20BM01 | Bus module, base | 1 | 2-3 weeks | No |
See io-card-hardware.md Section 8 for the complete X20 module reference.
6.3 IO Point-by-Point Verification Procedure
Include a repeatable IO verification checklist that can be used during commissioning, after module replacement, or during annual PM.
Template:
For each IO point:
- Identify the physical device in the field.
- Operate / simulate the device.
- Verify the correct variable changes state in the Watch window.
- Record PASS/FAIL and date.
This procedure validates that the IO map is correct and that all wiring is intact.
6.4 PLC Replacement Procedure
Document the exact steps to replace the CP1584 CPU, which is the most critical component:
- Back up the current CF card contents via FTP (see ftp-web-interface.md).
- Record the Automation Runtime version and all hardware module configurations.
- Power down the machine following LOTO procedures.
- Remove the old CPU from the DIN rail.
- Install the replacement CPU (match firmware version — see firmware-version-mgmt.md).
- Insert the CF card (or a pre-configured replacement).
- Power up and verify the hardware tree matches the original configuration.
- Verify all IO modules are recognized and communicating.
- Run the IO point-by-point verification.
- Cycle the machine and verify normal operation.
7. Tools and Techniques Summary
7.1 Software Tools
| Tool | Purpose | B&R Specific? |
|---|---|---|
| Automation Studio | Online monitoring, Watch, Trace, Force, hardware tree browse | Yes — B&R proprietary |
| Runtime Utility Center (RUC) | PLC backup, firmware management, system info | Yes — B&R proprietary |
| SDM Web Interface (port 80) | Hardware diagnostics, firmware info, log viewer | Yes — built into AR |
| OPC-UA Client (UaExpert, Prosys) | Variable browsing and monitoring | No — but accesses B&R OPC-UA server |
| PVI Manager | Programmatic variable access | Yes — B&R proprietary |
| Wireshark | Network traffic capture, POWERLINK/ANSL analysis | No — use B&R protocol dissectors |
| nmap | Network discovery and port scanning | No |
| draw.io / EPLAN / AutoCAD Electrical | Creating wiring diagrams | No |
| dd (Linux) | CF card imaging for backup | No |
| Python + OPC-UA library | Automated variable enumeration and logging scripts | No |
7.2 B&R-Specific Diagnostic Features
| Feature | How to Access | What It Gives You |
|---|---|---|
| Watch Window | Automation Studio → Online → Watch | Real-time variable values, force capability |
| Trace | Automation Studio → Tools → Trace | High-resolution variable recording over time |
| Cross Reference | Automation Studio → Edit → List Usage | Variable usage across all programs (requires source) |
| System Dump | Target Settings → Runtime → System Dump | Complete hardware/software configuration dump |
| AR Log | Automation Studio → Logger / CF card | Runtime error and event history |
| SDM Diagnostics | Browser → http://PLC_IP | Hardware health, module status, firmware versions |
| Glossary / InfoPool | Automation Studio → View | Variable documentation if programmer added descriptions |
7.3 Physical Tools
| Tool | Purpose |
|---|---|
| Digital multimeter | Continuity testing, voltage measurement, analog signal verification |
| Process calibrator (4-20mA) | Analog input stimulus and output measurement |
| Wire tracer / tone generator | Tracing wires through conduit |
| Label printer (Brady BMP21) | Applying wire markers and component labels |
| Logic analyzer | X2X bus signal analysis (see io-sniffing.md) |
| Thermal camera | Identifying hot spots in panels (overloaded connections) |
| Torque screwdriver | Verifying terminal tightness during PM |
8. Decision Matrix: Reconstruct vs. Rewrite
During documentation reconstruction, you may discover that the existing program has fundamental problems that make reconstruction impractical. Use this matrix to decide:
| Factor | Document & Preserve | Rewrite from Scratch |
|---|---|---|
| Program stability | Runs reliably, no crashes | Frequent faults, watchdog resets |
| Code organization | Logical structure (even if unnamed) | Spaghetti logic, no discernible structure |
| Safety system | Hardwired safety circuits intact | Safety logic embedded in software (no hardwired backup) |
| IO count | <100 points | >200 points |
| Available time | Weeks/months available | Production pressure, need quick fix |
| Vendor lock-in | Want to stay on B&R | Considering migration to another platform |
Hybrid approach (most common):
- Preserve the running binary as a backup.
- Document everything about the current system.
- Keep the existing program running while you develop a replacement.
- Cut over during a planned shutdown window.
9. Documentation Maintenance
The reconstructed documentation has a shelf life. Without active maintenance, it will become outdated as changes are made to the machine.
9.1 Revision Control
- Store all documentation in a version-controlled repository (Git, SharePoint, or a document management system).
- For every change to the machine (hardware or software), update the relevant documentation section.
- Use a Document Revision Log:
| Rev | Date | Author | Section Changed | Description |
|---|---|---|---|---|
| 1.0 | 2026-07-10 | J. Smith | All | Initial reconstruction from zero documentation |
| 1.1 | 2026-08-15 | J. Smith | 3.3, 4.2 | Added IO points for new sensor at Station 4 |
| 1.2 | 2026-09-01 | M. Jones | 7.1 | Updated firmware version after AR upgrade |
9.2 Permanently Lost Information
Document what you could NOT recover, so future engineers know the gaps:
- Original source code (unless source was stored on target — see project-reconstruction.md Section 2)
- Programmer intent and design rationale
- Original naming conventions for undocumented variables
- Commissioning and calibration history
- OEM warranty and support contacts
- Safety certifications (CE, UL) documentation
10. Workflow Summary
The complete documentation reconstruction workflow, in recommended execution order:
Week 1: Preservation + Physical Inspection
├── 1.1 Image CF card, photograph everything
├── 1.2 Document safety systems and LOTO
├── 1.3 Inventory all panel components
└── 1.4 Begin wire tracing (start with power)
Week 2: Network Discovery + Software Exploration
├── 2.1 Connect via Automation Studio, read hardware tree
├── 2.2 OPC-UA / PVI variable enumeration
├── 2.3 Export system dump, AR logs
├── 2.4 Network scan and topology mapping
└── 2.5 Begin IO wiring matrix (continue wire tracing)
Week 3: IO Mapping from Observation
├── 3.1 Digital input actuation tests
├── 3.2 Digital output force tests (safe conditions only)
├── 3.3 Analog input calibration tests
├── 3.4 Analog output measurement
└── 3.5 Complete IO wiring matrix
Week 4: Logic Documentation
├── 4.1 Machine sequence observation and recording
├── 4.2 Trace recording during operation
├── 4.3 State transition diagram construction
├── 4.4 Critical logic path tracing
└── 4.5 Timing and sequencing documentation
Week 5: Manual Assembly
├── 5.1 Create wiring diagrams from wire trace data
├── 5.2 Compile IO map
├── 5.3 Write machine sequence documentation
├── 5.4 Assemble maintenance manual
├── 5.5 Create spare parts list and PM schedule
└── 5.6 Review, peer check, and finalize
Community Tools for Accelerated Reconstruction
Several community tools significantly accelerate the documentation reconstruction process, especially when you lack the original Automation Studio project:
brwatch — Variable Discovery Without Project
brwatch is the fastest way to enumerate variables on an undocumented PLC. Install the Windows service, point it at the CP1584 IP, and browse the complete variable tree:
; brwatch.ini configuration
[Connection]
CPU=<PLC_IP_ADDRESS>
Protocol=ANSL
Reconstruction workflow with brwatch:
- Browse the full variable tree and note all naming patterns (e.g.,
gMachineData.*,gAxis*.*,stState_*) - Export variable list with types (File > Save As >
.bww) - Log all variables to CSV for a baseline snapshot
- Observe which variables change during machine operation to identify active vs legacy code
This replaces the manual OPC-UA/PVI enumeration steps in Section 2 and produces a more complete variable list because brwatch requires no prior knowledge of the project structure. See access-recovery.md §12 for the full brwatch guide.
Pvi.py — Python Scripted Variable Extraction
Pvi.py enables scripted batch extraction of variable metadata:
from pvi import Pvi
import json
pvi = Pvi()
plc = pvi.line("ANSL", "TCP", "<PLC_IP>").device("CP1584")
variables = plc.list_variables()
with open("variable_inventory.json", "w") as f:
json.dump([{"name": v.name, "type": v.type, "scope": v.scope} for v in variables], f, indent=2)
print(f"Extracted {len(variables)} variables")
systemdump.py — Automated System Dump Analysis
systemdump.py extracts hardware and task configuration from system dumps:
## Download system dump via SDM or FTP
## Then analyze:
systemdump --input SystemDump.xml --hardware > hw_inventory.txt
systemdump --input SystemDump.xml --tasks > task_config.txt
This provides the hardware tree and task configuration without requiring Automation Studio — directly useful for Sections 1.3 and 3.1 of this guide. See diagnostics-sdm.md for dump download and ebpf-telemetry.md for analysis workflows.
awesome-B-R — Complete Tool Catalog
The awesome-B-R repository is the master index of all community tools. For documentation reconstruction, the most useful categories are:
- Discovery tools: brwatch, brsnmp, ListAllBurPLCs
- Variable access: Pvi.py, demo-br-asyncua
- Analysis: systemdump.py, SystemDumpViewer
- Project migration: as6-migration-tools
Key Findings
-
B&R compiled binaries cannot be decompiled. The source code is permanently lost unless the OEM stored it on the target (check via
File → Open Project From Targetin Automation Studio). All program logic documentation must come from behavioral observation, not code reading. -
The hardware tree is fully recoverable. B&R stores complete module configuration, serial numbers, firmware versions, and addressing in the running system. This gives you the software-side IO layout without any original files.
-
Variable names survive compilation. Even without source code, OPC-UA and PVI expose the full variable namespace with names, types, and values. This is the single most valuable extraction for IO mapping and logic documentation.
-
Wire tracing is the bottleneck. Physical wire tracing is the most labor-intensive part of documentation reconstruction and cannot be accelerated by software tools. Budget 40-60% of total project time for this phase.
-
Force-based logic tracing is viable but risky. Using Automation Studio’s Force function to drive inputs and observe outputs can reconstruct Boolean logic equations for critical paths, but must be done under controlled conditions with safety systems fully operational.
-
The Trace function is essential for timing documentation. Automation Studio’s Trace records variable changes at sub-millisecond resolution, enabling precise documentation of timers, sequencing delays, and watchdog timeouts that cannot be observed by eye.
-
CF card imaging is the first priority. The CF card may contain source code, configuration backups, AR logs, or HMI files. Image it immediately with
ddbefore any other work — this single action may save weeks of reconstruction effort. -
A hybrid approach is almost always correct. Do not attempt a full rewrite until you have fully documented the existing system. The existing running binary is the only reference for correct behavior.
-
Documentation maintenance is as important as initial creation. A one-time reconstruction effort produces a static document that decays with every unrecorded change. Establish a revision control process from day one.
-
The safety interlock table is the most critical deliverable. Understanding which safety devices protect which hazards is essential before any testing, forcing, or logic tracing can proceed. Always document safety systems first.
-
Community tools reduce reconstruction time by 50-70%. brwatch for instant variable enumeration, Pvi.py for scripted extraction, and systemdump.py for automated hardware inventory eliminate the most tedious manual steps. See access-recovery.md §12 and the awesome-B-R repository for the full tool catalog.
Sources
- B&R Automation Studio Online Help — Online monitoring, Trace, and Logger tools
- B&R Automation Runtime PVI Reference — variable namespace browsing and data extraction
- B&R OPC-UA Server Configuration Guide — namespace structure and variable access
- B&R Community Forum (community.br-automation.com) — practical discussions on undocumented system recovery
- IEC 61131-3 Programming Standard — IEC program structure and variable naming conventions
- ISA-95 (IEC 62264) — equipment hierarchy and documentation standards for manufacturing systems
Related Documents
- cp1584-forensics.md — Forensic information extraction methodology
- project-reconstruction.md — Building a new AS project from an unknown running PLC
- pvi-api.md — PVI API for programmatic variable access and extraction
- opcua.md — OPC-UA variable browsing for namespace documentation
- io-sniffing.md — Protocol analysis for IO behavior documentation
- cf-card-boot.md — CF card backup and file extraction for documentation
- access-recovery.md — brwatch and Pvi.py tools for variable enumeration and task discovery