B&R Automation Runtime Firmware Architecture: Program Storage, Boot Sequence, and Firmware Updates
Overview
This document covers the firmware architecture of B&R Automation Runtime (AR) as it applies to the X20CP1584 and related X20 CPU platforms. It details where programs and the operating system are stored, how the boot sequence works, how memory is organized, and how firmware updates are performed — all critical knowledge for maintaining machines built by defunct OEMs with zero documentation.
CP1584 Hardware Specifications
The X20CP1584 (B&R ID code: 0xC370) is based on an Intel Atom E640T processor clocked at 600 MHz with the following key memory resources:
| Resource | Value |
|---|---|
| CPU | Intel Atom E640T @ 600 MHz |
| L1 Cache | 24 kB data / 32 kB program |
| L2 Cache | 512 kB |
| Main RAM | 256 MB DDR2 SDRAM |
| User RAM (SRAM) | 1 MB (battery-backed) |
| Remanent Variables | Configurable, up to 256 kB (reduces available User RAM) |
| Application Memory | CompactFlash card (separate order, not included with CPU) |
| Integrated I/O Processor | Dedicated co-processor for background I/O data handling |
| Shortest Task Class Cycle | 400 µs |
| Typical Instruction Cycle | 0.0075 µs |
| FPU | Yes (hardware floating point) |
The CPU is fanless, with overtemperature shutdown at 110°C processor / 95°C board temperature. Operating temperature range: -25°C to +60°C (horizontal), -25°C to +50°C (vertical).
Power consumption: 8.6 W (without interface modules/USB).
Recommended CompactFlash Cards
B&R certifies specific CF cards — using generic consumer cards is a common source of failures. B&R creates 4 partitions on CF cards, and consumer cards often lack the controller needed to maintain separate partitions.
| Part Number | Size | Type |
|---|---|---|
| 0CFCRD.0512E.01 | 512 MB | Extended temperature |
| 0CFCRD.2048E.01 | 2048 MB | Extended temperature |
| 5CFCRD.0512-06 | 512 MB | SLC |
| 5CFCRD.1024-06 | 1 GB | SLC |
| 5CFCRD.2048-06 | 2 GB | SLC |
| 5CFCRD.4096-06 | 4 GB | SLC |
| 5CFCRD.8192-06 | 8 GB | SLC |
Critical note: Only use B&R-certified CF cards. Off-the-shelf consumer CF cards frequently fail to work in B&R controllers because B&R’s partitioning scheme (4 partitions) is not supported by most consumer card controllers.
The Operating System: VxWorks-Based Automation Runtime
B&R Automation Runtime is based on VxWorks, the Wind River real-time operating system. This was confirmed directly by B&R on their community forum. B&R has developed substantial custom layers on top of VxWorks:
- Task class scheduling (B&R’s cyclic execution model)
- IEC 61131-3 runtime (execution of ladder, ST, FBD, etc.)
- Hardware abstraction layers for all B&R bus systems (X2X, POWERLINK)
- I/O driver subsystem with the integrated I/O processor
- Memory management tailored to PLC operation
- File system for the CompactFlash card
- Networking stack including POWERLINK, OPC-UA, Ethernet/IP, etc.
For newer B&R industrial PCs, a bare-metal hypervisor allows a GPOS (typically Linux) to run alongside AR on the same hardware. However, the CP1584 is a pure PLC controller and runs AR as its sole operating system.
See also: ar-rtos.md for deeper RTOS internals.
Memory Architecture
The B&R memory model has several distinct regions, each with specific persistence and boot behavior:
System ROM
The Automation Runtime operating system itself is stored in System ROM on the CompactFlash card. This is the firmware/RTOS that gets loaded on boot. It is non-volatile (stored in flash).
User ROM
User ROM is memory on the CompactFlash card where all compiled B&R modules (*.BR files) for the Automation Studio project are stored. This includes:
- Compiled IEC 61131-3 program code
- Configuration data
- Hardware configuration
- I/O mapping
User ROM is non-volatile. Programs persist across power cycles.
User RAM
User RAM uses the 1 MB battery-backed SRAM on the CPU board. It holds:
- Runtime variable data
- Intermediate calculation results
- Temporary buffers
Size: 1 MB total minus whatever is configured for remanent variables. This is volatile to the extent that it depends on battery backup.
FIX-RAM
FIX-RAM is a configurable portion of User RAM that persists across cold restarts. It behaves like User ROM during a cold restart while still residing in SRAM. Objects in FIX-RAM survive cold restarts, making it ideal for:
- Process parameters and setpoints
- Calibration data
- Recipe data
- Runtime counters
- Operator configuration changes
FIX-RAM is configured in Automation Studio under Hardware Configuration > Memory Configuration. The UserRAM size + RemMem size must not exceed available memory.
Remanent Variables
A separate configurable area (up to 256 kB on CP1584) for variables that must survive power loss. Backed by the lithium battery. The battery also buffers:
- User RAM
- System RAM
- Real-time clock
Battery Backup
The CP1584 uses a Renata CR2477N lithium battery (3V, 950 mAh, B&R part number 4A0006.00-000). Battery replacement interval: 4 years. If power is off, battery must be swapped within 1 minute to prevent data loss.
Battery status is available via:
- The
BatteryInfosystem library function - CPU I/O mapping (status bits)
- LED indicator: DC LED turns red when backup battery is empty
Memory Persistence Summary
| Memory Type | Location | Persistence | Cleared on Cold Restart? |
|---|---|---|---|
| System ROM | CompactFlash | Non-volatile | No |
| User ROM | CompactFlash | Non-volatile | No |
| User RAM | SRAM (battery-backed) | Volatile (battery) | Yes |
| FIX-RAM | SRAM (subset) | Survives cold restart | No |
| Remanent Variables | SRAM (dedicated area) | Battery-backed | No |
| System RAM | DDR2 SDRAM | Volatile | Yes |
CF Card Partition Layout
B&R CompactFlash cards are divided into 4 partitions created by the B&R file system driver. The partition names and their roles are:
| # | Partition Name | Drive Letter | File System | Purpose |
|---|---|---|---|---|
| 1 | SYSTEM | A: | B&R proprietary | Automation Runtime OS image (System ROM) |
| 2 | DATA1 | C: | B&R proprietary | Compiled user modules (*.BR files) — User ROM |
| 3 | DATA2 | D: | B&R proprietary | Application configuration and runtime data |
| 4 | USER | F:\ | FAT16/FAT32 | User-accessible file system (FTP-visible) |
Partition Creation via CFCreatePart
The partitions are created using the CFCreatePart command in the PIL (Program Installation List) file. The community has documented the syntax:
CFCreatePart "HD0", "4",
"20, 'SYSTEM'", /* 20% of card → AR OS */
"30, 'DATA1'", /* 30% of card → User ROM (compiled .BR modules) */
"30, 'DATA2'", /* 30% of card → Config and runtime data */
"20, 'USER'" /* 20% of card → FTP-accessible user partition */
The percentages define relative partition sizes. Notably, RUC (Runtime Utility Center) cannot repartition an existing CF card — if a USER partition was never created, RUC cannot add one later. Only Automation Studio or a fresh CF card creation can establish all four partitions.
Source: B&R Community — USER partition not creating thread (2024), confirmed by B&R staff.
What Each Partition Contains
SYSTEM (A:):
- The complete Automation Runtime OS binary
- Version-specific system libraries and drivers
- FPGA bitstream for the X2X bus controller and I/O processor
- Boot loader and POST (Power-On Self-Test) firmware
- Not directly browseable by users; accessed via FTP as the “System” volume
DATA1 (C:):
- All compiled user program modules (
*.BRfiles) generated by Automation Studio - Hardware configuration compiled binaries
- Library modules (AsIO, AsTCP, AsUDP, mapp components, etc.)
- The module directory structure mirrors the AS project Logical View
- When AR boots, it loads all
.BRfiles from this partition into DRAM
DATA2 (D:):
- Runtime configuration data (network settings, task configuration)
- Persistent and remanent variable storage areas
- System dump files and diagnostic data
- Calibration and parameter data
USER (F:\):
- Standard FAT16/FAT32 file system accessible via FTP
- Log files from the AR Logger
- User-created files (from AsFile library operations)
- System dump exports
- Occasionally the original Automation Studio project (
.apj,.acp) if the OEM stored it here - Configuration backups and recipe files
- This is the most valuable partition for forensic analysis of an undocumented machine
Accessing the CF Card
| Method | Access Scope | Notes |
|---|---|---|
| FTP | User partition (F:) only | Requires IP configuration; cannot see System/User ROM |
| Runtime Utility Center (RUC) | Full CF card | Can create backups as image files (.zp2, .zp3) |
| CF card reader + PC | May see partitions | Consumer readers often cannot read B&R partitioned cards |
| Automation Studio | Full access | Online or via CF card reader (for CF creation) |
dd raw image | Sector-level | Most reliable for forensic imaging; dd if=/dev/sdX of=backup.img bs=512 |
Important: The user partition is often where you’ll find the most valuable undocumented data — log files, recipes, and sometimes even the original Automation Studio project source files. Always check the user partition via FTP first when working with an unknown machine.
CF Card Imaging Procedure
To create a complete backup of a B&R CF card for forensic analysis or disaster recovery:
# Method 1: Runtime Utility Center (GUI)
# Tools > Back up files from Compact Flash / Image file...
# Produces .zp2 or .zp3 image file
# Method 2: Raw sector copy via Linux (remove CF card from PLC)
dd if=/dev/sdX of=cp1584_backup_YYYYMMDD.img bs=512 status=progress
# Replace /dev/sdX with actual device (check with lsblk first)
# This captures ALL partitions including System ROM
# Method 3: Mount individual partitions after imaging
fdisk -l cp1584_backup_YYYYMMDD.img # Show partition table
# Mount partition N:
mount -o loop,offset=$((START_SECTOR * 512)) cp1584_backup_YYYYMMDD.img /mnt/partN
Boot Sequence
The CP1584 boot sequence is a multi-stage process. Understanding each stage is critical for diagnosing boot failures.
Stage 0: Power-On and Hardware Init
- Power applied to 24 VDC input
- Internal power supply initializes (CPU/X2X Link supply + I/O supply, galvanically isolated)
- Hardware self-test runs (RAM check, basic FPGA validation)
- If a fatal hardware error is detected, the system halt error code is displayed on the S/E LED
- The CPU enters BOOT mode if:
- Operating mode switch is in BOOT position, OR
- No CF card is inserted, OR
- CF card is unrecognized/invalid
Stage 1: Bootloader
The CPU contains a factory-programmed bootloader (in internal ROM/FPGA). This bootloader:
- Reads the operating mode switch position:
- BOOT → Launch minimal “Boot AR” runtime
- RUN → Proceed to load full AR from CF card
- DIAG → Boot in diagnostic mode (User RAM/Flash not initialized)
- In BOOT mode: only the RS232 interface is active, allowing firmware download via INA2000 protocol
- The R/E LED behavior during boot:
- Green blinking → System startup (initializing application, bus systems, I/O)
- Green double flash → BOOT mode (during firmware update)
- Green solid → Application running
- Red solid → SERVICE mode
Stage 2: Automation Runtime Load
When mode switch is in RUN with valid CF card:
- AR kernel loads from System ROM partition on CF card
- VxWorks kernel initializes:
- Memory subsystem (DDR2, SRAM)
- Interrupt controller
- Timer subsystem
- Task scheduler
- B&R’s custom layers initialize:
- I/O processor
- X2X bus enumeration
- POWERLINK stack
- Ethernet interface
- File system
- OPC-UA server (if configured)
- System diagnostics (SDM)
This stage can take several minutes depending on the complexity of the configuration (number of I/O modules, bus topology, etc.).
Stage 3: Application Load
- Compiled modules (
*.BRfiles) are loaded from User ROM (DATA1 partition) into DRAM - Global variables are initialized from their persistent data (User ROM / FIX-RAM / remanent)
- Hardware configuration is applied:
- I/O module mapping
- Interface module configuration
- Network configuration (IP addresses, POWERLINK node assignments)
- I/O modules are enumerated and initialized via X2X bus
Stage 4: I/O Enumeration and Initialization
- X2X Link master on the CPU discovers all connected X2X bus modules
- Each I/O module is identified and its configuration loaded
- Analog modules perform calibration checks
- I/O data images are mapped into the CPU’s address space
- POWERLINK network is established (if configured as MN):
- PRE_OPERATIONAL_1 → configure CNs
- PRE_OPERATIONAL_2 → start cyclic communication
- READY_TO_OPERATE → PDO data active
- OPERATIONAL → cyclic data evaluated
Stage 5: Task Class Startup
- Task classes are started according to their priority and configuration
- IEC 61131-3 programs begin cyclic execution
- Watchdog timers are armed
- PLC transitions to RUN state (R/E LED solid green)
Boot Timing Indicators
| Time After Power-On | Typical Activity | LED State |
|---|---|---|
| 0–2 seconds | Power supply initialization, FPGA load | All LEDs off, then DC green |
| 2–10 seconds | RAM test, bootloader execution | CF green (if card detected) |
| 10–30 seconds | AR kernel load from CF card System partition | R/E green blinking |
| 30–120 seconds | Driver init, X2X enumeration, POWERLINK | R/E green blinking, S/E cycling |
| 120+ seconds | Application load, I/O init, task start | R/E transitions to solid green |
| 2–5 minutes | Complex configurations (many I/O stations) | R/E may blink for extended period |
If the PLC has been running for more than 5 minutes with R/E still blinking green, suspect a hardware problem (bad CF card, failed I/O module, X2X bus fault). See cf-card-boot.md for detailed CF card boot analysis.
See also: execution-model.md for details on task class scheduling.
Operating Modes
The CP1584 has a physical operating mode switch with three positions:
BOOT Mode
- Switch position: BOOT
- CPU launches minimal Boot AR runtime
- Only RS232 interface is active
- Allows firmware/OS download via INA2000 protocol
- User Flash is erased when a download begins
- Used for: initial commissioning, firmware recovery, OS updates
RUN Mode
- Switch position: RUN
- Full Automation Runtime loads from CF card
- Application executes
- All interfaces active
- Normal operating mode
DIAG (Diagnostic) Mode
- Switch position: DIAG
- CPU boots in diagnostic mode
- Program sections in User RAM and User FlashPROM are not initialized
- After DIAG mode, the CPU always boots with a warm restart
- Used for: diagnosing application issues without running the program
SERVICE Mode
- Not a switch position — entered automatically on errors or reset
- No task classes running
- Application program halted
- All outputs set to zero
- Used for: online debugging, firmware upload, error diagnosis
Reset Button Behavior
The reset button (bottom of housing, requires pointed object) triggers:
- All application programs stopped
- All outputs set to zero
- PLC enters SERVICE mode by default
- The post-reset startup mode can be configured in Automation Studio
Restart Types
Cold Restart (INIT)
- Full OS reload
- All RAM data deleted (except FIX-RAM)
- Programs reload from flash
- Equivalent to first-time initialization
- Triggered by: mode switch changes, firmware updates, explicit cold restart command
- Use when: RAM corruption suspected, memory config changed, firmware updated
Warm Restart
- OS continues running
- All RAM data preserved
- Programs continue from current state
- Variables retain their current values
- Typical power-cycle behavior (with good battery)
Hot Restart
- Same as warm restart but faster
- Used when switching between configurations
Firmware Update Mechanism
Method 1: Automation Studio — Transfer Operating System
- Insert CF card and power on CPU
- Establish online connection (Ethernet, RS232, or POWERLINK)
- In Automation Studio: Project > Services > Transfer Operating System…
- Select runtime system version (pre-selected from project settings)
- Choose whether to download modules with SYSTEM ROM target memory
- Download proceeds — User Flash is cleared
- When complete, set mode switch to RUN and reset CPU
For initial download (CPU with no OS on CF card):
- Must use RS232 connection only (INA2000 protocol)
- CPU must be in BOOT mode
Method 2: PVI Transfer Tool (Automated/Scripted)
- In Automation Studio: Tools > Generate Transfer List
- Select “Generate complete transfer list”
- Activate “Include operating system”
- Use Tools > PVI Transfer Tool to execute the transfer
- Can create CF card from existing project for mass deployment
Method 3: Runtime Utility Center (RUC)
RUC can:
- Create CompactFlash cards from Automation Studio projects
- Back up entire CF cards as image files (.zp2, .zp3)
- Restore CF cards from image files
- Create user partitions
- Cannot repartition an existing CF card — if no User partition exists, it won’t create one
Method 4: CF Card Imaging (for Clone/Fleet Deployment)
# Create CF card from a known-good image
dd if=cp1584_gold_image.img of=/dev/sdX bs=512 status=progress
This is the most practical method when you don’t have Automation Studio:
- Image a known-good CF card from a working machine
- Write that image to a new B&R-certified CF card
- Swap into replacement hardware
Firmware Downgrade Considerations
- Not all firmware versions support downgrading
- B&R provides compatibility matrices
- Some AR versions require minimum hardware revisions for certain interface modules
- Always verify compatibility before changing firmware versions
INA2000 Protocol: Serial Firmware Transfer
The INA2000 protocol is B&R’s original serial communication protocol, used for firmware transfer via RS232 when no Ethernet connection exists.
When INA2000 Is Required
- Initial CPU commissioning — brand new CPU with no OS on CF card must use RS232 + INA2000 for the first firmware transfer
- BOOT mode communication — when the mode switch is in BOOT position and no Ethernet is available
- Emergency recovery — when the Ethernet interface is misconfigured or the CF card is corrupted
- Legacy systems — older B&R controllers that predate Ethernet online interfaces
INA2000 Transfer Parameters
| Parameter | Value |
|---|---|
| Serial port | RS232 (IF1, pins 1-3 of X20TB12 terminal block) |
| Baud rate | 57600 bps (factory default; try 9600/19200/38400/115200 if 57600 fails) |
| Data bits | 8 |
| Parity | None |
| Stop bits | 1 |
| Flow control | None |
| Protocol | INA2000 (B&R proprietary) |
INA2000 vs ANSL (Modern) Protocol
| Feature | INA2000 (Legacy) | ANSL (Modern) |
|---|---|---|
| Interface | RS232 serial | Ethernet (TCP/IP) or serial |
| Speed | 57600 bps max | 10/100/1000 Mbit/s |
| Transfer medium | Serial cable (max ~15 m) | Ethernet (max 100 m) |
| Data integrity | Basic checksum | Full TCP with retransmission |
| Use case | Initial commissioning, recovery | Normal development and maintenance |
| Required in BOOT mode | Yes (sole method) | Yes (if Ethernet configured) |
| Automation Studio support | Via COM port selection | Via IP address / auto-search |
The /DA=02 flag in PVI connections selects the INA2000 data access protocol explicitly. B&R’s modern ANSL (Automation Network Service Layer) supersedes INA2000 for all normal operations.
Serial Transfer Procedure
- Connect RS232 cable: CPU pin 1 (RX) → PC TX, CPU pin 2 (TX) → PC RX, CPU pin 3 (GND) → PC GND
- Use a null-modem cable or cross-wired connections (the CP1584 pinout is DCE-like)
- Set terminal/emulation software to 57600, 8-N-1, no flow control
- Set the CPU mode switch to BOOT
- Power on the CPU — R/E LED shows red, RDY/F shows yellow (BOOT mode)
- In Automation Studio: Online > Settings > Transfer Settings, select Serial, COM port, 57600 baud
- Online > Settings > Auto Search — the PLC should appear with its INA2000 station address
- Transfer Operating System — download AR to the CF card via serial
Source: B&R Community — INA2000 protocol discussions, PLCtalk — serial connection guides
Automation Studio and AR Version Compatibility
The CP1584 has specific version compatibility requirements that must be observed:
Minimum Software Versions for CP1584
| Software | Minimum Version | Notes |
|---|---|---|
| Automation Studio | 3.0.90.20 | Earliest version supporting X20CP1584 |
| Automation Runtime | 3.x (initial), 4.x (recommended) | AR 4.x adds OPC-UA support |
| Automation Runtime Embedded | Latest: 4.93 | B&R order number 1SWAREMB493 |
AR Embedded Version Availability (from B&R Downloads)
| Order Number | Version | Notes |
|---|---|---|
| 1SWAREMB407 | AR Embedded 4.7 | |
| 1SWAREMB408 | AR Embedded 4.8 | |
| 1SWAREMB490 | AR Embedded 4.90 | |
| 1SWAREMB491 | AR Embedded 4.91 | |
| 1SWAREMB492 | AR Embedded 4.92 | |
| 1SWAREMB493 | AR Embedded 4.93 | Latest AR 4.x for CP1584 — recommended |
| 1SWAREMB6 | AR Embedded 6 | Not compatible with CP1584 — requires newer hardware |
AS Version to AR Version Mapping
| Automation Studio Version | AR Versions Supported | Notes |
|---|---|---|
| AS 3.0.x | AR 3.x | Initial support for CP1584 |
| AS 3.5.x – 4.2.x | AR 3.x – 4.25 | AR 4.0 adds OPC-UA, improved diagnostics |
| AS 4.3.x – 4.6.x | AR 4.30 – 4.60 | |
| AS 4.7.x – 4.9.x | AR 4.70 – 4.93 | Latest AR 4.x release (4.93) |
| AS 5.x | AR 5.x | May not support all CP1584 features |
| AS 6.x | AR 6.x | Not compatible with CP1584 — requires newer CPU |
Critical: The CP1584 cannot run AR 6.x. AR 6.x requires Intel Core i processors (APC910, APC3200) or specific newer X20 CPUs. The CP1584 is limited to AR 4.93 as its maximum runtime version.
Interface Module Hardware Upgrades
Some X20 interface modules require a hardware revision upgrade when moving from older CP1484 CPUs to the CP1584. The minimum hardware revision is documented in the data sheet:
| Module | Min HW Rev (CP1584) | Notes |
|---|---|---|
| X20IF1020 (Ethernet) | H0 | Upgrade required from CP1484 |
| X20IF1030 (Ethernet Switch) | I0 | Upgrade required from CP1484 |
| X20IF1082 (Modbus TCP/RTU) | — | No upgrade needed |
| X20IF1063 (CAN + X2X hybrid) | — | Requires AR >= 1.1.5.0 |
| X20IF1072 (PROFIBUS DP) | — | Requires AS >= 1.0.5.1 |
Source: X20CP158x Data Sheet V1.56, B&R Community upgrade discussions
PIL File Format and PVI Transfer
What Is a PIL File?
A PIL (Program Installation List) file is a text-based manifest that describes exactly what gets transferred to the CF card during a firmware or application update. It is generated by Automation Studio and consumed by the PVI Transfer Tool or Runtime Utility Center.
PIL File Structure (Key Commands)
; Example PIL file for CP1584 firmware + application installation
Target="X20CP1584"
; Partition creation (fresh CF card only)
CFCreatePart "HD0", "4",
"20, 'SYSTEM'",
"30, 'DATA1'",
"30, 'DATA2'",
"20, 'USER'"
; Installation mode
InstallMode=ForceInitialInstallation ; Wipes existing data
; InstallMode=Update ; Preserves user data
; Transfer individual files
CFWrite "A:\System\arcore.bin" ; AR kernel
CFWrite "C:\Modules\MyProgram.br" ; Compiled program
CFWrite "C:\Modules\AsIO.br" ; Library module
CFWrite "C:\Modules\AsArProf.br" ; Profiler library
CFWrite "D:\Config\System.par" ; System parameters
PVI Transfer Tool
The PVI Transfer Tool (pvitransfer.exe) automates firmware and application deployment:
- Automation Studio → Tools → Generate Transfer List — creates the
.pilfile - Automation Studio → Tools → PVI Transfer Tool — executes the transfer list against target PLCs
- Can target multiple PLCs simultaneously (fleet deployment)
- Works over Ethernet (ANSL) or serial (INA2000)
- Requires the PLC to be in BOOT mode for initial installations
- For updates to existing installations, RUN mode is sufficient (online changes)
Runtime Utility Center (RUC)
RUC is a standalone tool (does not require full Automation Studio installation):
- Install from B&R downloads page (free, no AS license required)
- Load a
.pilfile generated by Automation Studio - Connect to target PLC (requires knowing IP address or using serial)
- Execute offline installation to CF card or live transfer to PLC
RUC capabilities:
- Create CF cards from PIL files (offline, requires CF card reader)
- Transfer firmware and applications over network or serial
- Cannot repartition existing CF cards — only Automation Studio can do this
- Can update firmware on PLCs already running AR
RUC limitations:
- Less capable than full Automation Studio for browsing project structure
- Cannot change PLC IP address or auto-discover PLCs on network
- In BOOT mode without DHCP, requires manual IP configuration
Source: B&R Runtime Utility Center documentation, B&R Community RUC discussions
B&R Product Lifecycle and CP1584 Status
The Four Lifecycle Phases
| Phase | Status | What It Means |
|---|---|---|
| Active | In series production | Full availability, recommended for new projects |
| Classic | Phase-out announced | Still orderable; do NOT use for new projects; plan LTB |
| Limited | Last-Time-Buy complete | Only LTB orders fulfilled; no new orders accepted |
| Obsolete | Market exit | No longer available; repair service for 3 years after obsolete |
X20CPx58x Discontinuation
B&R announced the discontinuation of the X20CPx58x CPU series (which includes the CP1584) via Service Note SN 2022/54 due to component discontinuation:
- Last-Time-Buy date: February 28, 2023
- Reason: Semiconductor component supply chain discontinuation (Intel Atom E6xx series becoming obsolete)
- The CP1584 has entered the Limited or possibly Obsolete phase as of 2025–2026
Practical Implications for Maintaining CP1584 Machines
- No new CP1584 units available from B&R. All spare CPUs must come from secondary market, surplus, or refurbished stock.
- CF cards are still available — B&R continues to sell CF cards and software. The 8 GB SLC cards (
5CFCRD.8192-06) are current products. - AR 4.93 continues to receive security patches — B&R’s patching policy for AR 4.x (see CVE data in ar-rtos.md) shows ongoing security advisories covering AR 4.93.
- Interface modules and I/O modules remain available — the X20 ecosystem (I/O modules, bus couplers, interface modules) continues in Active or Classic status.
- Migration path: B&R recommends X20CP1684 (Intel Atom E680T, 1 GHz) as the direct replacement, or X20CP0484-1 for cost-sensitive applications. See remanufacturing.md for full migration analysis.
Source: B&R Lifecycle Policy page, Service Note SN 2022/54, B&R downloads page
Firmware File Types on the CF Card
Files in the SYSTEM Partition (A:)
| File/Directory | Description |
|---|---|
arcore.bin (or similar) | AR kernel binary (VxWorks-based) |
fpga.bit (or similar) | FPGA bitstream for X2X bus controller |
bootloader.bin | Secondary bootloader for CF card access |
| System library binaries | AR core runtime libraries |
The exact file names vary between AR versions. These files are not directly human-readable and are loaded by the CP1584’s internal boot ROM.
Files in the DATA1 Partition (C:)
| File Type | Extension | Description |
|---|---|---|
| Compiled program modules | *.br | Binary runtime modules from Automation Studio |
| Hardware configuration | Compiled binary | CPU, I/O, and network configuration |
| Library modules | *.br | Standard and third-party libraries |
The directory structure on C: mirrors the Automation Studio Logical View. Modules are loaded in a specific order determined by the project configuration.
Files in the USER Partition (F:)
| File/Directory | Description |
|---|---|
LogBook/ | AR Logger output files (system and user log) |
SystemDump/ | System dump files (XML format) |
*.apj | Automation Studio project files (if OEM stored them) |
*.acp | Project configuration files |
*.csv | Data logging exports, diagnostic reports |
*.dat | Configuration and recipe data files |
*.txt | User-created text files |
See config-file-formats.md for detailed format descriptions of .apj, .acp, and other configuration files.
FPGA and the Integrated I/O Processor
The CP1584 contains an FPGA (Field Programmable Gate Array) that handles critical real-time functions independently of the main CPU:
FPGA Functions
| Function | Description |
|---|---|
| X2X Bus Controller | Manages the X2X Link protocol timing, addressing, and data transfer to all connected I/O stations |
| I/O Data Processor | Independently refreshes the I/O image in background, decoupled from CPU task execution |
| POWERLINK MAC | Implements the Ethernet MAC layer for POWERLINK (IF3), including the Precise Timestamp (IEEE 1588 hardware support) |
| Watchdog Timer | Hardware-level cycle time monitoring independent of software |
| Boot ROM Interface | CF card reading during early boot before AR kernel loads |
FPGA Programming
The FPGA bitstream is part of the AR installation in the SYSTEM partition. When AR is updated, the FPGA bitstream is also updated. This is why firmware updates can take several minutes — the FPGA must be reconfigured without disrupting ongoing operations.
If the FPGA fails to program (System Halt error: •−−− •−−−), the CPU module must be replaced. There is no user-accessible mechanism to reprogram the FPGA independently.
Automation Runtime Security Patching on CP1584
See ar-rtos.md Section 14 for a comprehensive list of CVEs affecting AR 4.x on the CP1584. Key points:
Patch Status Summary
| Vulnerability | Patched in AR 4.93? | Notes |
|---|---|---|
| URGENT/11 (VxWorks TCP/IP) | Yes (in newer AR 4.x builds) | Requires AR R4.90+ |
| NAME-WRECK (DNS) | Yes | Requires AR R4.90+ |
| SA24P011 (Multiple) | No | Unpatchable on AR 4.x; CVE-2024-5800 (weak TLS) remains |
| CVE-2025-11044 (ANSL DoS) | Yes (AR R4.93) | Must update to 4.93 |
| CVE-2025-3450 (SDM DoS) | Yes (AR R4.93) | Must update to 4.93 |
| CVE-2024-0323 (FTP weak TLS) | No | FTP is insecure on all AR 4.x |
| CVE-2024-8603 (SSL/TLS broken crypto) | No | SSL/TLS uses broken/risky cryptographic algorithm (requires AR >= 6.1) |
| CVE-2021-22275 (Webserver overflow) | No | |
| CVE-2023-1617 (VNC auth bypass) | No (but patchable via VC4 update) | |
| SA25P003 CVEs (SDM XSS/session) | No | Cannot be patched on any AR 4.x |
Recommendation: Update to AR 4.93 immediately if not already at this version. It patches the most critical DoS vulnerabilities. Accept that some older CVEs cannot be patched on the CP1584 platform and mitigate via network isolation.
See access-recovery.md Section 14.19 for recommended firewall rules for an AR 4.93 CP1584.
LED Diagnostics During Boot
| LED | Color | Pattern | Meaning |
|---|---|---|---|
| R/E | Green | Blinking | System startup (may take several minutes) |
| R/E | Green | Double flash | BOOT mode, firmware update in progress |
| R/E | Green | Solid | Application running |
| R/E | Red | Solid | SERVICE mode |
| R/E | Red | Blinking (alternating with RDY/F yellow) | License violation |
| RDY/F | Yellow | Solid | CPU is active |
| RDY/F | Red | Solid | Overtemperature |
| CF | Green | Solid | CF card inserted and detected |
| CF | Yellow | Solid | CF card read/write access |
| DC | Green | Solid | CPU power supply OK |
| DC | Red | Solid | Backup battery empty |
| S/E | Various | See powerlink-states | POWERLINK interface state |
System Halt Error Codes (S/E LED Red Blinking)
Error codes are displayed as 4 phases of 150ms (short) or 600ms (long) LED on-times, repeated every 2 seconds:
| Error | Code Pattern | Meaning |
|---|---|---|
| RAM error | •••• •••• | Device defective, must be replaced |
| Hardware error | •••− •••− | Device/system component defective |
| Stack overflow | ••−• ••−• | Task stack exceeded (software bug) |
| Undefined address | ••−− ••−− | Access to non-existent address |
| Instruction fetch abort | •−•• •−•• | Invalid memory access during instruction fetch |
| Data access abort | •−−• •−−• | Invalid memory access during data access |
| FPGA programming error | •−−− •−−− | FPGA configuration failure |
Legend: • = 150ms on, − = 600ms on, 2s pause between repetitions.
Practical Procedures for the No-Documentation Scenario
Determining What Firmware is Running
Without Automation Studio:
- FTP to the PLC — check user partition for version info files, log files may contain AR version
- OPC-UA browse — some system nodes expose firmware version
- AR log analysis — the PLC logbook often records firmware version on boot
- Web interface (if enabled) — may show system info
- PVI API — connect and query system variables
Backing Up a CF Card Without Automation Studio
## Remove CF card from PLC (power off first!)
## Insert into USB CF reader connected to Linux PC
lsblk # Identify the CF card device
dd if=/dev/sdX of=cp1584_backup.img bs=512 status=progress conv=noerror,sync
## Verify backup
md5sum cp1584_backup.img
## Mount user partition to inspect
fdisk -l cp1584_backup.img
mount -o loop,offset=$((SECTOR*512)),ro cp1584_backup.img /mnt/cf_user
ls -laR /mnt/cf_user
Creating a Replacement CF Card Without Original Project
- Take a raw image backup of a known-good CF card from a working identical machine
- Write image to a new B&R-certified CF card of the same or larger capacity
- Boot the replacement PLC with this CF card
- If hardware differs (different I/O modules), the configuration will need adjustment — see project-reconstruction.md
What to Do When the CF Card Fails
- PLC will enter BOOT mode (R/E LED blinking green)
- In BOOT mode, only RS232 is active
- You need either:
- A backup CF card image to restore, OR
- Automation Studio with the correct AR version to transfer a new OS, OR
- A known-good CF card from an identical machine to clone
- If no backup exists and you don’t have AS: this is when you need project-reconstruction.md
Gotchas and Edge Cases
-
CF card brand matters: B&R-certified cards only. Consumer cards fail silently or during operation. The most common “dead PLC” scenario is a bad CF card.
-
CF card partitioning: B&R uses 4 partitions. Standard formatting tools will destroy this layout. Only use RUC or raw
ddto create/restore CF cards. -
User partition may not exist: If the original project was built without configuring a user partition size, there won’t be one. RUC cannot create one on an existing CF card.
-
Battery drain kills retentive data: If the battery is dead, ALL remanent data, FIX-RAM, and RTC are lost. Check the DC LED (red = battery empty) before powering off a machine.
-
Overtemperature is logged: The PLC logs error 9204 (temperature-triggered restart) and 9210 (watchdog/manual reset) before shutting down. These are recoverable from the logbook.
-
SERVICE mode after reset: Pressing the reset button always enters SERVICE mode by default. This stops the program and zeroes all outputs. If you don’t know this, it looks like the PLC “died.”
-
Firmware version compatibility: X20CPx58x CPUs require Automation Studio V3.0.90.20+. Some X20 IF interface modules require hardware revision upgrades when moving from CPx48x to CPx58x CPUs.
-
USB is NOT an online interface: USB ports on the CP1584 are for peripherals only, not for programming/debugging connections.
-
Boot takes time: Initial boot with complex I/O configurations can take several minutes. Don’t assume the PLC is dead if LEDs are still blinking after 30 seconds.
-
ETHERNET interface is NOT for POWERLINK: The standard Ethernet interface (IF2) must NOT use POWERLINK address range (192.168.100.x). POWERLINK uses its own dedicated interface (IF3).
Automation Runtime Version Landscape (2026)
The AR version landscape has evolved significantly. Understanding what versions exist and their compatibility with the CP1584 is critical for maintenance planning.
Available AR Versions (as of 2026)
| Material Number | AR Version | CP1584 Compatible | Notes |
|---|---|---|---|
| 1SWAREMB407 | AR Embedded 4.7 | Yes | Legacy — min for X20CP1584 |
| 1SWAREMB408 | AR Embedded 4.8 | Yes | Maintenance |
| 1SWAREMB490 | AR Embedded 4.90 | Yes | Maintenance |
| 1SWAREMB491 | AR Embedded 4.91 | Yes | Maintenance |
| 1SWAREMB492 | AR Embedded 4.92 | Yes | Maintenance |
| 1SWAREMB493 | AR Embedded 4.93 (R4.93) | Yes | Latest/most secure AR 4.x — recommended |
| 1SWAREMB6 | AR Embedded 6 | No | Requires newer hardware (X20EM, X20CP3xxx) |
| 1SWARAPI600 | AR API 6 | N/A | API-only runtime for exOS/Linux |
| 1SWARVXW6 | VxWorks 6 Getting Started | No | Migration toolkit for AR 6 targets |
| 1SWARVXW7 | VxWorks 7 Getting Started | No | Migration toolkit for newest targets |
AR 6.x — The Next Generation (Not for CP1584)
AR 6 represents a major platform shift. Key changes:
- Base OS migration from VxWorks 5.5 to VxWorks 6.x/7.x — the underlying RTOS is being modernized after decades on the VxWorks 5.5 codebase
- Security hardening — AR 6 patches many CVEs that cannot be patched on AR 4.x (see ar-rtos.md §14 for full CVE table)
- New hardware required — AR 6 does not run on X20CP1484/1584/1684. It targets the newer generation:
- X20EM (Edge Controllers) — ARM/RISC-V based, designed for IIoT edge computing
- X20CP3xxx series (e.g., X20CP3586 @ 1.6 GHz, 512 MB RAM) — Intel Atom successor
- APC9xx (Automation PCs) — full industrial PC platform
- exOS support — AR 6 introduces proper IT/OT integration with Linux running on separate cores alongside the RTOS
- Automation Studio 6.x required — AS 6 is a separate product line from AS 4.x and requires its own license
What This Means for CP1584 Operators
- AR R4.93 is the end of the line for CP1584. No further AR updates will be released for this hardware platform.
- Security patching has effectively stopped. The 16+ unpatchable CVEs documented in ar-rtos.md §14 will never be fixed on CP1584.
- Migration planning should begin now for machines with >5 years remaining service life. See remanufacturing.md for migration strategies.
- The transition to AS 6 + AR 6 is not a simple upgrade — it requires new hardware, new AS licenses, and project porting. Budget accordingly.
- B&R’s VxWorks 6/7 migration kits (1SWARVXW6, 1SWARVXW7) suggest they are actively transitioning their entire product line to a modern RTOS base, which will further widen the capability gap between legacy CP1584 and current-generation hardware.
Key Findings
- The CP1584 runs B&R Automation Runtime, a VxWorks-based RTOS with extensive B&R custom layers for PLC operation
- All application memory is on CompactFlash — the CPU contains no onboard flash for user programs
- CF card uses 4 proprietary partitions: System ROM, User ROM, User partition (FTP-accessible), and reserved
- Memory hierarchy: System ROM (OS) → User ROM (compiled programs) → User RAM (runtime data) → FIX-RAM (persistent parameters)
- Battery-backed SRAM retains remanent variables, User RAM, and RTC; battery is a Renata CR2477N with 4-year replacement interval
- Boot sequence: Hardware init → Bootloader → AR kernel load → Application load → I/O enumeration → Task class startup
- Three operating modes via physical switch: BOOT (firmware download), RUN (normal operation), DIAG (diagnostic)
- CF card failures are the most common cause of “dead” CP1584s — always image the CF card before doing anything else
- Raw
ddimaging is the most reliable backup method when Automation Studio is unavailable - AR R4.93 is the final firmware for CP1584 — no further AR 4.x updates will be released, and 16+ security CVEs remain unpatched on this platform
- AR 6 requires new hardware (X20EM, X20CP3xxx, APC9xx) — the VxWorks base is migrating from 5.5 to 6.x/7.x, and the CP1584 cannot run AR 6
- Automation Studio 6 is required for AR 6 targets — AS 6 is a separate product from AS 4.x and needs its own license
Sources
- B&R X20CP1584 Data Sheet V1.56 — hardware specifications, memory resources, and operating conditions
- B&R X20 System User’s Manual — boot modes, operating mode switch, and CF card handling
- B&R Automation Runtime Overview (TM213) — AR architecture, task configuration, and memory management
- B&R Community Forum (community.br-automation.com) — firmware, CF card, and boot sequence discussions
- B&R Knowledge Base — firmware update procedures and recovery methods
Related Documents
- cf-card-boot.md — Detailed CF card partition structure, file types, and boot stages
- bootloader-recovery.md — Recovery procedures for corrupted CF cards and bricked CPUs
- firmware-version-mgmt.md — Version management without OEM access
- ar-rtos.md — Automation Runtime OS internals, VxWorks base, and security vulnerability history
- config-file-formats.md — Configuration file formats on the CF card (.apj, .acp, etc.)
- retentive-data.md — Battery-backed SRAM and retentive data management
- cp1584-hardware-ref.md — CP1584 hardware specifications, LED meanings, and physical interfaces
- execution-model.md — Task scheduling, cycle times, and watchdog behavior
- access-recovery.md — Password recovery and BOOT mode access procedures
- remanufacturing.md — Migration from CP1584 to newer B&R hardware
- spare-parts.md — Sourcing B&R replacement hardware
- network-architecture.md — Network topology and interface configuration
- program-reverse-engineering.md — Analyzing compiled .BR module files
- cp1584-forensics.md — Extracting information from an unknown CP1584
- online-changes.md — Runtime patching and parameter modification
- diagnostics-sdm.md — System Diagnostics Manager for error logging
- ftp-web-interface.md — FTP and web server for remote file access
- cybersecurity-hardening.md — Security posture for legacy AR 4.x systems
B&R Execution Model: Cyclic Task Scheduling, IEC 61131-3 Semantics, and Watchdog Behavior
Overview
B&R Automation Runtime uses a deterministic, priority-based preemptive multitasking system built on VxWorks. Programs written in IEC 61131-3 languages (Ladder Diagram, Structured Text, Function Block Diagram, Instruction List, Sequential Function Chart) and ANSI C are executed in cyclically-repeating task classes with configurable priorities and cycle times. Understanding this model is essential for diagnosing timing-related bugs, cycle time violations, and SERVICE mode entries on undocumented machines.
Priority System
Automation Runtime uses a deterministic, priority-based preemptive multitasking system built on a real-time operating system (RTOS) derived from VxWorks. B&R does not publicly document the exact RTOS version or whether it uses a licensed Wind River VxWorks kernel or a B&R-developed RTOS, but the scheduling behavior is consistent with VxWorks’s priority-based preemptive scheduler with a hardware timer tick interrupt driving context switches.
B&R uses a priority range of 0 to 255, where higher numbers have higher priority. When multiple tasks want to run simultaneously, the higher-priority task always runs first. The RTOS tick timer (configurable, typically 1 ms) drives the scheduler’s periodic evaluation of task readiness.
The priority space is divided into four tiers:
| Priority Range | Tier | What Runs Here |
|---|---|---|
| > 230 | Hardware/Interrupt | HW interrupts, I/O scheduling. Higher priority than Cyclic #1. |
| 190–230 | Cyclic Tasks | Cyclic #1 (highest) through Cyclic #8 (lowest). Motion control, time-critical logic. |
| 4–190 | System Tasks | Ethernet, ANSL/TCP/UDP, file operations, logger, visualization, webserver, SDM, OPC-UA. |
| < 4 | Idle Tasks | No-op filler (IDLE at priority 0, TcIdleFiller at priority 3). |
Scheduler Internals
The RTOS scheduler uses a tick-driven, priority-based preemptive algorithm:
- Timer tick interrupt fires at the configured system tick rate (typically 1 ms on the CP1584, derived from the Intel Atom HPET or LAPIC timer)
- The tick ISR runs the scheduler: it checks all ready queues and dispatches the highest-priority ready task
- Preemption: If a higher-priority task becomes ready (via interrupt or timeout), the currently running task is immediately preempted — even mid-instruction
- Round-robin within priority: Tasks at the same priority level are scheduled round-robin
- Time slicing: B&R does NOT use time slicing within a priority level for cyclic tasks. Each cyclic task runs to completion (or until preempted) within its allocated window
The minimum the Task class idle time can be reduced to is your System Tick (base timer for all AR), and the Task class idle time must be a multiple of the system tick. This means on a system with a 1 ms tick, idle time granularity is 1 ms.
Memory Protection
The Intel Atom E640T provides hardware MMU/MPU capabilities, but B&R Automation Runtime uses them with specific scope:
- Kernel/user protection: The MMU protects the AR kernel and system memory from user task access — user tasks cannot corrupt the OS kernel or system structures
- Flat task model: All user tasks (cyclic, event, etc.) share a single flat address space with no task-to-task isolation. A buggy cyclic task CAN corrupt another cyclic task’s data. See ar-rtos.md Section 2.3 for details
- Page faults (accessing unmapped or protected memory) trigger EXCEPTION 7 (address error) or EXCEPTION 25314 (Page Fault) and result in SERVICE mode
- The Exception task class (EXC) has access to all memory spaces for error handling
- The integrated I/O processor uses DMA (Direct Memory Access) to update the I/O image in memory without CPU involvement
Interrupt Handling
Interrupts on the CP1584 follow the VxWorks interrupt model:
| Interrupt Source | Priority | Handler | Latency |
|---|---|---|---|
| CPU timer tick | 240+ | RTOS scheduler | Deterministic, typically < 5 us |
| X2X bus interrupt | ~235 | X2X driver | < 10 us |
| POWERLINK interrupt | ~233 | EPL driver | < 10 us |
| Ethernet RX interrupt | ~20 | Network driver | Variable (higher with high traffic) |
| USB interrupt | ~15 | USB driver | Variable |
| Exception (fault) | 255 (highest) | Exception handler | Immediate |
When an interrupt fires, the RTOS saves the current task’s context (registers, stack pointer, flags) and jumps to the registered interrupt handler. After the handler completes, the context is restored and the highest-priority ready task resumes.
Task Classes
B&R provides up to 8 cyclic task classes (Cyclic #1 through Cyclic #8), each with:
- A configurable cycle time
- A priority (Cyclic #1 = highest, Cyclic #8 = lowest)
- One or more assigned programs/tasks
- A configurable watchdog tolerance
- A configurable jitter tolerance
Default Cycle Times
| Task Class | Default Cycle Time | Typical Use |
|---|---|---|
| Cyclic #1 | 10 ms (default) | Motion control, time-critical I/O, PID loops |
| Cyclic #2 | 20 ms (default) | Standard logic, I/O processing |
| Cyclic #3 | 50 ms (configurable) | HMI updates, data exchange |
| Cyclic #4–8 | 100–1000 ms (configurable) | Recipe handling, logging, diagnostics |
The CP1584 has a shortest achievable task class cycle time of 400 µs (hardware limitation).
Task Class Execution Model
Each task class operates as follows:
- The cycle timer for the task class expires
- If a higher-priority task class is still running, the current class waits (preemptive priority)
- All programs/tasks assigned to the class execute sequentially within the class
- After all tasks complete, the class yields and waits for the next cycle
- I/O data is updated at specific synchronization points (see I/O Cycle section)
Time →
|---TC#1---|---TC#1---|---TC#1---|---TC#1---|
| ProgA | ProgA | ProgA | ProgA |
|----TC#2----|----TC#2----|----TC#2----|
| ProgB ProgC | ProgB ProgC | ProgB ProgC |
|-------TC#3-------|-------TC#3-------|
| ProgD ProgE ProgF | ProgD ProgE ProgF |
Jitter Tolerance
Each task class has a configurable jitter tolerance — the allowed deviation from the exact cycle time before an exception is triggered. This is different from the watchdog timeout (which covers total cycle time violations). Jitter tolerance is important for motion control applications where exact timing is critical.
I/O Cycle Synchronization
I/O data exchange is synchronized with the cyclic task system. This is a critical concept that differs from some other PLC platforms:
Synchronizing Tasks with the I/O Cycle
The I/O cycle runs independently and deterministically. Task classes can be configured to:
- Read inputs at the start of the task class cycle
- Write outputs at the end of the task class cycle
- Run synchronized with the I/O bus cycle (X2X, POWERLINK)
When a task class is synchronized to the I/O cycle:
- Input data is read from the I/O image at the start of the cycle
- Logic executes using that input data
- Output data is written to the I/O image at the end of the cycle
- Multiple task classes reading the same inputs see identical input data within one I/O cycle
The Integrated I/O Processor
The CP1584 has a dedicated I/O processor that processes I/O data points in the background. This means:
- I/O scanning runs independently of the main CPU task execution
- The I/O image in memory is continuously updated by the I/O processor
- Cyclic tasks read from a snapshot of the I/O image, not directly from hardware
This architecture provides excellent I/O performance but means that I/O timing is decoupled from task class timing.
Watchdog Behavior
Cycle Time Violations
A cycle time violation occurs when the sum of runtimes of all tasks in a task class exceeds the configured cycle time. This is the #1 cause of SERVICE mode entries (approximately 80% of all SERVICE mode events).
By default, a cycle time violation triggers:
- A system emergency stop
- The controller boots in ERROR mode
- The PLC then enters SERVICE mode
- All outputs are set to zero
- The error is logged in the AR logbook
Common Causes of Cycle Time Violations
- Infinite loops in IEC code (most common)
- Blocking I/O operations (e.g., waiting for a response in a cyclic task)
- Excessive computation in a fast task class
- String operations or memory allocation in cyclic code
- File I/O performed in a cyclic task
- Division by zero causing exception handling overhead
- Page faults from invalid memory access
Configuring Watchdog Tolerance
The watchdog tolerance for each task class can be increased to allow occasional overruns without triggering an emergency stop. However, this does not fix the underlying timing problem.
Task Idle Time and System Task Starvation
The Problem
Because cyclic tasks (priority 190–230) have higher priority than system tasks (priority 4–190), a long-running cyclic task class can starve system tasks of CPU time. This causes:
- Visualization updates to become sporadic or freeze
- OPC-UA responses to time out
- Ethernet communication to fail
- SDM data to become stale
- File operations to hang
- USB device discovery to fail
The Solution: Task Idle Time
The Task Idle Time / Idle Time Task Class mechanism reserves a portion of a cyclic task class’s time for system tasks to execute. This is configured in the CPU’s task class properties.
Default configuration:
- Idle Time Task Class: Cyclic #2 (20 ms cycle)
- Task Idle Time: 2 ms (last 2 ms of the 20 ms cycle)
During the idle time window:
- The affected task class is effectively moved to priority 2
- System tasks can run at their normal priority (4–190)
- If no system tasks need to run,
TcIdleFillerruns no-ops at priority 3 - Cyclic #1 (and any higher-priority cyclics) still preempt everything
SDM CPU Usage Reporting
The SDM reports CPU usage as: 100% - time spent at priority 0 (IDLE)
This means:
TcIdleFillerno-ops count as “CPU usage” even though the CPU is doing nothing- In SERVICE mode with default idle time, CPU usage appears artificially high (~50-60%) when the real usage is near 0%
- Don’t be alarmed by high SDM CPU readings in SERVICE mode — it’s the TcIdleFiller effect
Tuning the Idle Time
Guidelines for tuning without the original project:
- Minimum idle time: System tick (base timer for AR), must be a multiple of system tick
- Zero (0 µs) disables idle time entirely (dangerous — can starve all system tasks)
- Better to have frequent short windows: 2 ms every 20 ms is better than 200 ms every 2000 ms, even though both reserve 10% for background tasks
- Don’t put idle time in a low-priority task class even if it’s fast — use TC#3 at 50 ms rather than TC#8 at 10 ms
- The idle time follows the tolerance of its assigned task class — delays cascade if cyclics overrun
Exception Handling
Exception Types
| Exception | Trigger | Default Action |
|---|---|---|
| Cycle time violation | Task class exceeds cycle time | Emergency stop → SERVICE mode |
| Page fault | Invalid memory access | SERVICE mode, error logged |
| Stack overflow | Task stack exceeded | SERVICE mode, error logged (S/E LED error code) |
| Divide by zero | Division by zero in cyclic code | SERVICE mode |
| Hardware fault | FPGA error, RAM error | System halt (non-recoverable) |
| Watchdog | Watchdog timer expired | Emergency stop → SERVICE mode |
Exception Handling Configuration
The default behavior (emergency stop on cycle time violation) can be changed:
- Exception handling can be configured per task class
- Actions can be: ignore, log only, stop task, or emergency stop
- For production machines from defunct OEMs, it’s often safer to leave defaults (emergency stop) to prevent dangerous behavior from timing errors
Troubleshooting Execution Issues
Diagnosing Cycle Time Violations
- Check the AR logbook for cycle time violation entries (error codes typically in the 9xxx range)
- Use the Profiler in Automation Studio to see which task/function block is consuming time
- Check task class configuration — are cycle times realistic for the hardware?
- Look for blocking operations in cyclic code:
- File I/O (
FileOpen,FileRead) - Network operations (
TcpOpen, synchronous communication) WAITstatements or delay loops- String operations on long strings
- File I/O (
Diagnosing System Task Starvation
Symptoms:
- OPC-UA clients disconnect or time out
- Visualization freezes or updates erratically
- Ethernet communication fails intermittently
- New I/O modules plugged in are not detected
- Web interface becomes unresponsive
Solution:
- Check Task Idle Time configuration — increase if too small
- Move idle time to a higher-priority task class
- Reduce cycle times of lower-priority task classes
- Look for cyclic tasks that consistently overrun their cycle time
Monitoring Task Execution at Runtime
Without Automation Studio:
- PVI API — read task cycle time, max cycle time, current load per task class
- OPC-UA — if exposed, monitor task cycle time nodes
- System variables —
RTInfofunction block data (see system-variables.md) - AR logbook — check for cycle time warnings/violations
- SDM — monitor CPU usage, task class load indicators
Using RTInfo Function Block
The RTInfo function block from the BRSystem library provides runtime information about the current task class:
(* In structured text *)
rtInfo_0(enable := TRUE);
// Available outputs:
// rtInfo_0.cycletime - Current cycle time of this task class
// rtInfo_0.maxcycletime - Maximum cycle time recorded
// rtInfo_0.taskload - Current load of this task class
// rtInfo_0.tasknumber - Current task class number
Cycle Time Tolerance and Watchdog Configuration Details
Cycle Time vs. Maximum Cycle Time vs. Tolerance
B&R distinguishes between three related but distinct timing parameters per task class:
| Parameter | Exception Code | What It Checks | Default Behavior |
|---|---|---|---|
| Cycle Time | 144 | Total time for all tasks in the class must complete within this window | Emergency stop |
| Maximum Cycle Time | 145 | Peak cycle time must not exceed (cycle time + max tolerance) | Emergency stop |
| Cycle Time Tolerance | 144 (extended) | Extra time allowed beyond cycle time before violation is declared | Emergency stop |
The cycle time tolerance is an additional buffer beyond the base cycle time. If the base cycle time is 10 ms and the tolerance is 2 ms, the task class can run up to 12 ms before Exception 144 fires. After the tolerance window expires and the task still hasn’t completed, Exception 145 (maximum cycle time violation) fires.
Critical rule from B&R (AS 4.3.5 SP release notes): If a tolerance is defined that is NOT a multiple of the cycle time, the value is silently ignored — no error is displayed. The tolerance must be a multiple of the cycle time for it to take effect.
Adjusting Tolerance Without the Project
If you have Automation Studio but not the project source, you can still adjust tolerance via online changes:
- Connect to the PLC with a minimal project
- Login online
- Navigate to the target system configuration
- Locate the task class properties
- Increase the cycle time tolerance value
- Apply the online change — this takes effect immediately without stopping the PLC
This is a runtime band-aid only — it does not fix the underlying cause of the cycle time violation. See online-changes.md for the full procedure.
Watchdog Variants
B&R implements two watchdog mechanisms:
-
Task class watchdog — Per-task-class timer that fires if the class doesn’t complete within (cycle time + tolerance). This is the most common.
-
System watchdog — A hardware-level watchdog timer that resets the entire CPU if the RTOS kernel stops responding. This is a safety net for kernel-level hangs (e.g., driver deadlock, hardware fault). The system watchdog cannot be configured from Automation Studio.
If the system watchdog fires, the CPU performs a complete hardware reset — this is different from a SERVICE mode entry. The AR logbook will not contain an entry for this event because the logger didn’t get a chance to write it. A system watchdog reset is indicated by the CPU booting up with no log entry for the previous session.
Community-Sourced Troubleshooting Wisdom
PV_lkaddr() Causing Maximum Cycle Time Violation
A known cause of Exception 145 on B&R systems is the PV_lkaddr() function from the SYS_Lib library. This function is used to obtain the address of a variable for use with PV_xget()/PV_xset() direct memory access. The issue occurs when:
- An initialization section of a function block calls
PV_lkaddr()only once (as intended) - But the function block’s instance data is not properly initialized on first scan
- The call to
PV_lkaddr()triggers an expensive name resolution operation - This operation exceeds the cycle time tolerance, triggering Exception 145
Fix: If you encounter this pattern in the profiler, check the AR logbook for the specific task class and look for PV_lkaddr references. If you have the source code, add a guard flag to ensure PV_lkaddr() is only called after the task class has completed its first full cycle.
Profiler “Unknown” Cyclic Task
When profiling a PLC with a different version of Automation Studio than what was used to compile the original project, one of the cyclic tasks may appear as “unknown” in the profiler diagram. This is caused by a symbol version mismatch — the profiler cannot resolve function block names from a different AS version. This is not a real problem; it simply means you cannot see the individual function blocks within that task class.
Workaround: Use the same AS version (or the same major version) as the original project to get full profiler resolution. If you don’t know the original AS version, check the AR version on the PLC and install the corresponding AS version.
Tools > Upgrades Stopped Working (July 2026 Known Issue)
As of July 2026, there is an active B&R Community thread titled “Tools - Upgrades stopped working” with 7 responses. The B&R Upgrade Service, which runs as a Windows service and downloads AR firmware packages from B&R’s website, can stop functioning due to:
- Windows firewall changes blocking the service
- TLS certificate updates on B&R’s server
- Antivirus software quarantining downloaded upgrade files
- The service running under
LOCAL_SERVICEaccount without sufficient rights to write toC:\Temp
Fix steps:
- Delete everything in
C:\Temp - Restart the PC
- Start AS explicitly as Administrator
- Check that the B&R Upgrade Service is running (Windows Services)
- Try switching the service user from
LOCAL_SERVICEtoLOCAL_SYSTEMor vice versa - If still failing, check
C:\Users\<username>\AppData\Roaming\BR\Logging\Datafor error logs
Practical Gotchas for Undocumented Machines
-
Cycle time violations are the #1 cause of SERVICE mode. If a CP1584 keeps going into SERVICE mode and you don’t have the project, check the AR logbook first — it’s almost certainly a cycle time violation.
-
Default idle time setup masks problems. If someone moved the idle task class to a very slow cycle (e.g., TC#8 at 100ms), system tasks will respond very slowly, making the PLC appear “sluggish” without any visible error.
-
Task priorities are fixed — you can’t change the priority number. Only the cycle time, jitter tolerance, and idle time are configurable. If the original programmer put a slow operation in Cyclic #1, there’s no way to lower its priority without access to the project.
-
I/O synchronization matters for motion. If a task class handling motion control is NOT synchronized to the I/O cycle, the I/O data read by the motion task may be from a different cycle than expected, causing jerky motion or missed position capture events.
-
SERVICE mode stops ALL tasks. When the PLC enters SERVICE mode, no cyclic tasks run, no I/O is updated, and all outputs are zeroed. The machine literally stops. If outputs must be maintained during debugging, this must be configured in advance (which requires the project).
-
The reset button always enters SERVICE mode by default. Don’t press it during production.
-
CPU usage in SDM is not what you think. The SDM calculates CPU usage as
100% - time_at_priority_0. BecauseTcIdleFillerruns at priority 3 (not 0), its no-op time counts as “CPU usage”. In SERVICE mode, SDM will show ~50-60% CPU usage when the real usage is near 0%. On a running system, this effect is smaller but still present — the SDM always over-reports by the amount of time spent in TcIdleFiller. A community member measured: SDM reported 95.45% while the actual CPU usage (system tasks + I/O) was only ~37.9%. -
Don’t put idle time in a low-priority task class even if it’s fast. The idle time follows the tolerance of its assigned task class. Using TC#8 at 10ms means idle time is delayed by any higher-priority cyclic that runs long. Use TC#3 at 50ms instead — the higher priority ensures idle time windows are more predictable.
-
The profiler recording time must be at least 2× the slowest task class cycle. For intermittent faults, use 10+ seconds. If the profiler shows nothing despite cycle time violations, check the filter settings — the offending task class may be excluded.
-
System watchdog resets leave no log entry. If the CPU resets and there’s no log entry for the previous session, a system watchdog reset (kernel hang) is the likely cause. This is a hardware-level reset — the RTOS never got a chance to log anything.
Exception Task Classes (EXC)
Exception task classes handle fatal errors that occur while Automation Runtime is running and cannot be corrected by the OS alone. The EXC task class has the highest priority in the entire system — it interrupts all normal tasks, high-speed tasks, and interrupt tasks.
How Exception Handling Works
- An exception occurs while a normal task is running
- The normal task is immediately interrupted (EXC has absolute highest priority)
- The exception task assigned to EXC executes
- Processing of normal tasks resumes from the point of interruption
Exception Codes
| Exception # | Description | Common Cause |
|---|---|---|
| 2 | Bus error | Memory bus fault, DMA failure |
| 3 | Address error | Unaligned memory access |
| 4 | Illegal instruction | Corrupted code, wrong CPU target |
| 5 | Division by zero | Missing zero-check in cyclic code |
| 6 | Range overflow | Array index out of bounds |
| 7 | Null pointer | Dereferencing NULL pointer |
| 8 | Privilege violation | Accessing protected memory region |
| 10 | Unimplemented instruction | Code compiled for wrong CPU |
| 24 | Spurious interrupt | Interrupt with no handler |
| 128 | I/O Exception | IO module failure, bus communication error |
| 144 | TC cycle time violation | Normal cyclic task exceeded cycle time |
| 145 | TC maximum cycle time violation | Peak cycle time exceeded tolerance |
| 146 | TC Input cycle time violation | Input processing exceeded limit |
| 147 | TC Output cycle time violation | Output processing exceeded limit |
| 160 | HSTC maximum cycle time violation | High-speed task exceeded max cycle |
| 170 | CAN I/O exception | CAN bus communication failure |
Configuring Exception Tasks
In Automation Studio, exception tasks are configured per CPU:
- Right-click CPU → Insert Object → Exception
- Select the exception type (e.g., “Division by zero”, “TC cycle time violation”)
- Enable/disable execution of the exception task
- Assign a program to the exception task class
The EXC task class shares its global data area with Cyclic #1, enabling fast data exchange without PLC-global variables.
Practical note for undocumented machines: If the original project configured custom exception handlers, you won’t know what they do without the source code. The exception codes above are logged in the AR logbook regardless.
Interrupt Task Classes (IRQ)
Interrupt task classes handle asynchronous hardware events (triggered by hardware interrupts). IRQ tasks have higher priority than all normal cyclic tasks, but lower priority than exception tasks.
IRQ Task Characteristics
- Each interrupt-capable module can be assigned its own IRQ task
- The IRQ task is processed each time the corresponding hardware interrupt triggers
- Only available on B&R 2010 systems (X20, X67) — not supported on older B&R 2003/2005 hardware
- Useful for: hardware encoder triggers, high-speed digital input capture, external sync signals
Typical IRQ Sources
| Source | Use Case |
|---|---|
| Digital input module interrupt | High-speed part detection, emergency stop capture |
| Encoder module latch signal | Position capture at external trigger event |
| Timer interrupt | Precise timing for specialized applications |
| Communication module | CAN bus event-triggered processing |
Practical note: IRQ tasks are rarely used in standard machine control. If you find IRQ tasks configured on an undocumented CP1584, they’re likely handling high-speed measurement or encoder capture. The exception codes 170 (CAN I/O) and 128 (I/O Exception) are most relevant for IRQ-related diagnostics.
High-Speed Task Classes (HSTC)
High-speed task classes are activated by hardware interrupts rather than by the system scheduler. This provides lower latency and jitter than normal cyclic tasks.
Types of High-Speed Task Classes
| Type | Trigger | Use Case |
|---|---|---|
| Timer HSTC | Hardware timer interrupt | Ultra-fast cyclic processing below normal TC limits |
| RIO HSTC | Remote I/O cycle completion interrupt | Immediate access to fresh remote I/O data |
| MP HSTC | MP_trigger() function call | Multi-processor synchronization (legacy) |
Timer HSTC
Timer HSTCs use a dedicated hardware timer to trigger execution. The cycle time is configurable in Automation Studio and independent of the system scheduler. All tasks assigned to a Timer HSTC execute exactly once per cycle.
RIO HSTC
Remote I/O HSTCs are triggered by an interrupt generated at the end of each remote I/O cycle. The configured cycle time is the minimum — if the RIO cycle takes longer, the HSTC starts later accordingly.
Practical note for CP1584: The CP1584 supports Timer HSTCs and RIO HSTCs. The minimum Timer HSTC cycle time is lower than the minimum Cyclic #1 time (400 us). HSTCs are typically used only in specialized motion control or high-speed measurement applications.
Startup Behavior
Boot Sequence and Task Initialization
When the CP1584 powers on:
- BIOS/Bootloader executes (VxLD loader) — hardware init, memory test
- Automation Runtime kernel loads — VxWorks starts, drivers initialize
- System configuration is read from CF card — hardware config, network config
- INIT phase — all task classes execute their initialization subroutines once
- TRANSITION to RUN — I/O modules initialize, POWERLINK starts
- Normal cyclic execution begins — task classes cycle per their configuration
Task Structure: Init vs Cyclic
Every task in a task class has two parts:
| Part | Execution | Purpose |
|---|---|---|
| Initialization subroutine | Executed once during INIT phase | Set initial values, one-time setup, calibration |
| Cyclic part | Executed every cycle | Main control logic, I/O processing |
In Automation Studio, the initialization part is accessed via View → Init Subroutine.
Startup Modes
| Mode | Behavior | Outputs |
|---|---|---|
| Cold start | All variables initialized to default/initial values | Zeroed |
| Warm start | Retentive variables preserved, non-retentive re-initialized | Zeroed |
| INIT start | Runs initialization subroutines, then transitions to cyclic | Zeroed until program sets them |
The startup mode is configured in the CPU’s task configuration in Automation Studio. On an undocumented machine, the startup mode is unknown — you can determine it by observing whether retentive values survive a power cycle (warm start) or not (cold start). See retentive-data.md for details.
Task Configuration in Automation Studio
Without access to the original project, you cannot change task class configuration. However, understanding what’s configurable helps with diagnostics:
Configurable Parameters Per Task Class
| Parameter | Description | Default (Typical) |
|---|---|---|
| Cycle time | Time between executions | 10 ms (TC#1), 20 ms (TC#2) |
| Tolerance | Allowed overrun before exception | Same as cycle time |
| Jitter tolerance | Allowed deviation from exact timing | Configurable |
| Idle time | Reserved time for system tasks | 0 µs (explicit) |
| Exception handling | Action on cycle time violation | Emergency stop |
| I/O synchronization | Whether to sync I/O with this task | Configurable |
| Core assignment (multicore) | Which CPU core runs this task | Core 0 |
Creating a Task Class
In Automation Studio:
- Right-click CPU → Insert Object → Cyclic
- Set name, programming language, priority
- Configure cycle time, tolerance, jitter
- Assign programs to the task class
- Set exception handling behavior
Multicore Task Assignment
On multicore CPUs (CP3586, APC910, etc.), each task class can be assigned to a specific CPU core. The default configuration assigns all cyclic tasks to core 0. For the single-core CP1584, this is the only option.
AR 6.5 hard real-time multicore (released December 2025): Task classes can now be assigned to specific CPU cores via Automation Studio 6.5 — not just system tasks but hard real-time cyclic tasks. This enables deterministic parallel execution of time-critical logic (e.g., motion control on core 0, process logic on core 1). Configuration is available in the task class properties dialog in AS 6.5. AR 6.5 also adds hypervisor repair boot for resolving PCIe interrupt conflicts and extends ARsim to support 4 GB process memory.
See ar-rtos.md §3.6 for the full multicore version progression and firmware-version-mgmt.md §3.2 for AS 6.5 release details.
reACTION Technology
B&R’s reACTION technology provides microsecond-level I/O response by processing logic directly in the I/O module’s FPGA, bypassing the main CPU task cycle entirely.
How reACTION Works
- I/O module receives input change
- FPGA on the I/O module executes programmed logic immediately
- Output response in 1-10 µs (vs. 400 µs minimum on CPU)
- Results are also available to CPU tasks for monitoring/coordination
reACTION vs CPU Tasks
| Aspect | reACTION | CPU Cyclic Task |
|---|---|---|
| Response time | 1-10 µs | 400 µs minimum |
| Programming | Ladder Diagram only | All IEC 61131-3 languages |
| Complexity | Simple logic only | Full programming capability |
| I/O access | Local module only | All I/O in system |
| Monitoring | Limited (via CPU exchange) | Full (via variables, OPC-UA) |
Practical Relevance
If an undocumented machine uses reACTION for safety-critical or high-speed responses, you won’t see this logic in the CPU’s cyclic tasks. reACTION programs are stored on the I/O modules themselves. The only way to discover them is through the CF card project files or by connecting with Automation Studio and browsing the hardware configuration.
Key Findings
- B&R uses deterministic preemptive multitasking with 8 cyclic task classes, priority range 0–255 (higher = more important)
- Cyclic tasks always preempt system tasks — this is by design but can cause system task starvation
- Cycle time violations cause emergency stop by default — this is the #1 cause of SERVICE mode entries (~80%)
- The Task Idle Time mechanism reserves CPU time for system tasks (Ethernet, OPC-UA, visualization, SDM) within a designated cyclic task class
- SDM CPU usage is misleading — it counts TcIdleFiller no-ops as “usage,” making SERVICE mode appear loaded when it’s actually idle
- The CP1584’s integrated I/O processor handles I/O scanning independently of cyclic task execution
- I/O cycle synchronization is configurable per task class and critical for motion control applications
Advanced Diagnostics: Profiling Without the Full Project
Creating a Long Profiler
The Long Profiler is the primary tool for diagnosing cycle time violations and identifying which function blocks are consuming excessive time. It requires Automation Studio but does NOT require the project source code.
Prerequisites:
- Automation Studio (any version that supports the AR version on the target)
- Network connectivity to the CP1584
- The PLC does NOT need to be in SERVICE mode — the profiler can run on a running system
Procedure:
- Open Automation Studio (no project needed)
- Open → Profiler (or Tools → Profiler in some AS versions)
- Connect to the PLC: Settings → Auto Search or enter IP manually
- Login to the target (may need online password — see access-recovery.md)
- Configure the profiler:
- Recording time: At least 2× the cycle time of the SLOWEST task class (e.g., if TC#4 runs at 100 ms, record for at least 200 ms minimum)
- For intermittent faults, use 10,000 ms (10 seconds) or longer
- Set the number of samples high enough to capture the fault
- Start recording — let it run through multiple cycles
- Stop recording
- Analyze the results as a diagram (View → Diagram):
- Each task class appears as a colored bar
- Function blocks within each task class show as sub-bars with width proportional to execution time
- Look for tasks that span nearly the entire cycle time (approaching the tolerance)
- Look for spikes or occasional long executions that correlate with cycle time violations
- Export the profiler data (File → Export) for future reference
Reading the Diagram:
Time →
|---TC#1 (10ms)---|---TC#1 (10ms)---|---TC#1 (10ms)---|
| ProgA ████ | ProgA ████████ | ProgA ████ | ← Normal
| | ProgA ██████████| | ← VIOLATION: exceeded 10ms
|----TC#2 (20ms)--------|----TC#2 (20ms)--------|
| ProgB ████ ProgC ████| ProgB ████ ProgC █████████| ← ProgC occasionally slow
|-------TC#3 (50ms)-----------------------|
| [2ms IDLE] ProgD ██ [2ms IDLE] ProgE ██ | ← Idle time window visible
- The yellow “Idle tasks” section in the profiler output shows TcIdleFiller time
- The “unknown” cyclic task that sometimes appears in profiler output is caused by an Automation Studio version mismatch — the profiler cannot resolve symbols from a different AS version. This does NOT indicate a real problem.
Community-sourced tips (from B&R Community forum):
- The profiler must include at least two (2×) executions of the slowest task class, or the data is insufficient
- For intermittent faults that happen once per hour, consider recording continuously and saving profiler traces periodically
- If the profiler shows nothing even though cycle time violations occur, check that the task class executing the long-running code is included in the profiler’s filter settings
Using the Profiler in SERVICE Mode
The profiler works even when the PLC is in SERVICE mode. However, since no cyclic tasks are running in SERVICE mode, the profiler will show only:
- I/O system tasks
- System tasks (networking, SDM, visualization)
- TcIdleFiller no-ops
This is still useful for diagnosing whether a SERVICE mode issue is caused by system task overload (rare) vs. a cycle time violation that happened before SERVICE mode was entered (check the AR logbook).
Alternative Monitoring Without Automation Studio
When Automation Studio is not available, these methods provide cycle time monitoring:
PVI API Method
## Using PVI.py (see pvi-api.md for setup)
from pvi import *
pvi = PviConnection()
line = pvi.add_line('LN1', 'ANSL')
cpu = line.add_device('CP1', 'ANSL', '192.168.1.10')
## Read RTInfo system variables for each task class
## Task class cycle time variables are typically named:
## gTaskClass[n].CycleTime
## gTaskClass[n].MaxCycleTime
## gTaskClass[n].TaskLoad
## Where n is the task class number (0-7)
for i in range(8):
try:
ct = cpu.read_variable(f'gTaskClass[{i}].CycleTime')
mx = cpu.read_variable(f'gTaskClass[{i}].MaxCycleTime')
ld = cpu.read_variable(f'gTaskClass[{i}].TaskLoad')
print(f'TC#{i+1}: cycle={ct}ms, max={mx}ms, load={ld}%')
except:
break
OPC-UA Method
If OPC-UA is configured, browse the System namespace for task class nodes. Common node paths:
Root → Objects → System → TaskClasses → Cyclic#1 → CycleTime
→ MaxCycleTime
→ TaskLoad
Trend these values over time to detect gradual performance degradation.
SDM Web Interface Method
The SDM at http://<PLC_IP>/sdm shows:
- CPU usage percentage (with TcIdleFiller caveat noted above)
- Task monitor tab showing basic task class status
- This is the lowest-resolution method but requires zero setup
Automation Runtime 4 vs. 6: Execution Model Changes
If you are upgrading a CP1584 system from AR 4.x to AR 6.x, or migrating to newer hardware (CP1684, CP3686), these execution model changes are relevant:
| Aspect | AR 4.x (CP1584 typical) | AR 6.x (newer hardware) |
|---|---|---|
| Task classes | Up to 8 cyclic | Up to 8 cyclic (same) |
| Priority range | 0–255 | 0–255 (same) |
| TcIdleFiller behavior | Active as described | Same behavior, better visibility in profiler |
| SDM CPU usage | Misleading due to TcIdleFiller | Improved accuracy in some AR 6 versions |
| Min cycle time | 400 µs (CP1584) | 100 µs (CP3686 with faster CPU) |
| Multicore | Single-core only | Multi-core task assignment available |
| System tasks | Same priority tiers | More background tasks (mapp components, OPC-UA security) |
| PROFINET/ EtherCAT | Not available on CP1584 | Available on newer CPUs |
Key migration note: An AS 4.x project targeting AR 4.x cannot be downloaded to an AR 6.x target. The project must be migrated using Automation Studio 6’s built-in migration tool. B&R provides open-source migration scripts at github.com/br-automation-community/as6-migration-tools that detect deprecated libraries, function blocks, and configuration incompatibilities. The community awesome-B-R repository catalogs all available migration resources.
Practical impact for execution model: When migrating, cycle times must be re-evaluated because:
- AR 6.x has more system tasks running (mapp components, enhanced OPC-UA, security layers)
- The Task Idle Time may need to be increased to accommodate the additional background load
- If moving to multi-core hardware, task core assignment should be optimized (motion on one core, logic on another)
Detailed Exception Code Reference
The exception codes below are logged in the AR logbook and can be retrieved via FTP from C:\arlogsys.log, SDM, or OPC-UA. These are distinct from ACOPOS drive fault codes (see acopos-drives.md for those).
CPU/OS Exceptions (Hardware-Level)
| Exception # | Description | Common Cause | Severity |
|---|---|---|---|
| 2 | Bus error | Memory bus fault, DMA failure, bad RAM | Fatal → SERVICE |
| 3 | Address error | Unaligned memory access, pointer arithmetic bug | Fatal → SERVICE |
| 4 | Illegal instruction | Corrupted code, wrong CPU target compiled | Fatal → SERVICE |
| 5 | Division by zero | Missing zero-check before division | Fatal → SERVICE |
| 6 | Range overflow | Array index out of bounds, math overflow | Fatal → SERVICE |
| 7 | Null pointer dereference | NULL pointer access in IEC code or C | Fatal → SERVICE |
| 8 | Privilege violation | Accessing protected memory region | Fatal → SERVICE |
| 10 | Unimplemented instruction | Code compiled for wrong CPU architecture | Fatal → SERVICE |
| 24 | Spurious interrupt | Interrupt with no registered handler | Logged, may continue |
| 25314 | Page fault (EXCEPTION) | Invalid memory access (NULL dereference, corrupted pointer, shifted memory from online change) | Common intermittent fault — Fatal → SERVICE |
Interpreting Exception 25314 (Page Fault)
Exception 25314 is the most common cause of intermittent SERVICE mode entries (as opposed to the consistent Exception 144 cycle time violations). It indicates the CPU tried to access a memory page that is not mapped or protected.
Common causes on undocumented machines:
- Online code changes — When code is downloaded to a running PLC, memory addresses may shift. Pointer-based code (C programs, addresses of global variables) can become invalid. This is documented as “the primary risk of online code changes.”
- Corrupted retentive data — If the battery died and retentive data was partially corrupted, reading invalid pointers from retentive memory causes page faults on warm start.
- String buffer overflows — IEC 61131-3 STRING operations writing beyond buffer bounds.
- Array index out of bounds — Accessing an array element beyond the allocated memory, triggering a page fault at the unmapped page boundary.
- mapp component memory corruption — If a mapp component (OPC-UA, mapp View) has a bug, it may write to an invalid address.
Diagnostic approach:
- Check the AR logbook for the exact exception address — the faulting memory address is logged
- If the address is near zero (0x00000000-0x00001000), it’s a NULL pointer dereference
- If the address is in a specific range, it may indicate which library or variable is at fault
- The exception log includes the task class where the fault occurred
- If the fault is intermittent and correlates with online changes, the code was likely not properly designed for online modification
Community reference: B&R Community thread “Intermittent EXCEPTION Page Fault during startup – mvLoader mvrpctxtfmt threads” documents page faults occurring during PLC startup related to the mvLoader and mvrpctxtfmt threads, which handle module loading and format parsing. If you see these thread names in the exception log, the fault may be caused by a corrupted module on the CF card or an incompatible firmware/library combination.
Task Class Exceptions (Execution-Level)
| Exception # | Description | Common Cause | Severity |
|---|---|---|---|
| 128 | I/O Exception | IO module failure, X2X/POWERLINK bus error | Fatal → SERVICE |
| 144 | TC cycle time violation | Normal cyclic task exceeded its configured cycle time | #1 most common — Fatal → SERVICE |
| 145 | TC maximum cycle time violation | Peak/max cycle time exceeded tolerance | Fatal → SERVICE |
| 146 | TC Input cycle time violation | Input processing phase exceeded limit | Fatal → SERVICE |
| 147 | TC Output cycle time violation | Output processing phase exceeded limit | Fatal → SERVICE |
| 160 | HSTC maximum cycle time violation | High-speed task exceeded max cycle | Fatal → SERVICE |
| 170 | CAN I/O exception | CAN bus communication failure | Logged |
Interpreting Exception 144 (Cycle Time Violation)
This is the most frequently encountered exception on B&R systems:
- Check the AR logbook for the task class number and timestamp
- The log entry will include the task class ID and the cycle time that was exceeded
- Compare the exceeded time against the configured cycle time:
- If exceeded by 10-50%: Likely a code path that occasionally takes longer (e.g., conditional logic with extra computation)
- If exceeded by 2-10x: Likely an infinite loop or blocking operation
- If exceeded by 100x+: Likely a page fault or hardware fault
- Use the Long Profiler to identify the specific function block causing the overrun
- If you cannot use Automation Studio, check if the violation correlates with a specific I/O event (via OPC-UA trending of task cycle times)
Critical Section Exceptions
AR 6.x introduced enhanced exception codes for critical section violations:
| Exception | Description |
|---|---|
| CS timeout | Critical section wait time exceeded — possible deadlock |
| CS priority inversion | Low-priority task holding a lock needed by high-priority task |
| CS re-entry | Re-entering a critical section that is already held (recursive lock attempt) |
These indicate synchronization bugs in the application code. On an undocumented system with no source, these are extremely difficult to fix — the only practical solution is to identify the conditions that trigger them and avoid those operating conditions.
Cross-References
| Related File | Relevance |
|---|---|
ar-rtos.md | AR RTOS internals — task scheduler, process model, interrupt handling |
system-variables.md | System variables for monitoring task cycle times, CPU load, and watchdog status |
diagnostics-sdm.md | SDM Task Monitor for real-time cycle time observation without Automation Studio |
firmware.md | AR firmware architecture and how the execution model is loaded at boot |
memory-map.md | CPU memory map for understanding IO data access within task contexts |
online-changes.md | How online code changes affect running tasks and cycle time behavior |
safe-io-diagnostics.md | Safety task execution requirements and SIL-rated cycle time constraints |
ebpf-telemetry.md | Performance profiling and task execution monitoring techniques |
alarm-logging.md | Exception and watchdog event logging for cycle time violations |
cp1584-hardware-ref.md | CP1584 hardware specs affecting task execution (cycle time limits, FPU) |
custom-diagnostic-tools.md | Building custom cycle time monitoring tools on the PLC itself |
access-recovery.md | brwatch for no-project variable monitoring and CPU reboot |
python-diagnostics.md | Python scripts for automated cycle time logging and alerting |
troubleshooting-index.md | Scenario-based troubleshooting for cycle time violations (Exception 144) |
B&R OPC-UA Integration: Server Configuration, Address Mapping, Security, and Certificate Management
Overview
B&R Automation Runtime includes a built-in OPC-UA server that exposes PLC process variables to any OPC-UA compliant client. This is one of the most important diagnostic access points when working with undocumented B&R machines — OPC-UA allows reading and writing variables without needing the original Automation Studio project. This document covers how the OPC-UA server is configured, how address mapping works, namespace organization, security models, certificate management, and how to use OPC-UA for diagnostics on machines with no OEM documentation.
Architecture
The B&R OPC-UA server runs as a system task within Automation Runtime (priority 4–190 tier). It is integrated into the CPU firmware and requires no additional hardware. Key characteristics:
- Default port: 4840 (standard OPC-UA port, configurable)
- Runs on: Ethernet interface (IF2) — NOT on the POWERLINK interface (IF3)
- Configuration file:
OpcUa.Config.xmlon the CF card - Address configuration: Under
ServerConfiguration → BaseAddressesin the config file - Part of: mapp Technology framework (specifically mapp OPC-UA component)
Enabling the OPC-UA Server
Via Automation Studio (Normal Method)
- Open the project in Automation Studio
- Go to Physical View
- Right-click on the CPU (e.g., X20CP1584) → Configuration
- Expand OPC-UA System
- Set “Activate OPC-UA System” to On
- Configure server settings (port, endpoint, security policy)
- Add an OPC-UA Default View from the Toolbox to the Configuration View
- Enable specific variables as OPC-UA tags (right-click → Enable Tag)
- Set user role access rights for each tag (read, write, browse)
- Build & Transfer to the PLC
Critical: Variables Are NOT Automatically Exposed
Enabling the OPC-UA server does NOT automatically expose all process variables. Each variable must be explicitly enabled as an OPC-UA tag. This means:
- Grayed-out variables in the Default View = NOT accessible via OPC-UA
- Black/active variables = enabled and accessible
- The OEM had to deliberately enable each variable for external access
This is a major consideration for undocumented machines — if the OEM didn’t enable OPC-UA tags, you cannot access them via OPC-UA regardless of whether the server is running.
Without Automation Studio
If you have no project but the OPC-UA server is running:
- Scan for the server using UaExpert or any OPC-UA discovery client
- Browse the namespace to see what variables are exposed
- Read/write through the client
Namespace and Address Structure
B&R OPC-UA Namespace Layout
When connected to a B&R OPC-UA server, the namespace follows this structure:
Objects
└── PLC
├── Modules
│ ├── Default
│ │ ├── <TaskName1> (e.g., "Cyclic#1", "HMI_Inputs")
│ │ │ ├── Variable1
│ │ │ ├── Variable2
│ │ │ └── StructName
│ │ │ ├── Member1
│ │ │ └── Member2
│ │ └── <TaskName2>
│ │ └── ...
│ └── (additional modules)
├── System
│ └── (system diagnostics, status)
└── Server
└── (server configuration, status)
Node IDs
B&R OPC-UA Node IDs typically follow the format:
ns=2;s=PLC.Modules.Default.<TaskName>.<VariableName>(string-based)- Numeric namespace indices:
ns=0(OPC-UA standard),ns=1(B&R system),ns=2+(user application)
Variables are organized by the task class they belong to. Only variables within tasks that have been configured in the OPC-UA Default View are visible.
Custom Namespaces
You can create custom namespaces using a nodeset file (.xml), which provides more flexibility. A nodeset file can:
- Link OPC-UA nodes to specific PLC variables
- Create custom data types and structures
- Organize variables into logical groups (e.g., “Machine1”, “Conveyor”, “Press”)
- Add metadata (engineering units, descriptions, limits)
Security Model
Authentication Methods
| Method | Description | Default Availability |
|---|---|---|
| Anonymous | No authentication required | Enabled by default (role “Everyone”) |
| Username/Password | B&R user management | Configurable |
| Certificate-based | X.509 certificate validation | Configurable |
Important: If the “Anonymous” user is deleted from the user-role system, OPC-UA clients cannot connect without credentials. This is a common issue when OEMs tighten security.
User Roles and Access Rights
B&R implements OPC-UA role-based access control:
- Everyone — default role, typically browse + read
- Operator — read + limited write
- Engineer/Admin — full read/write access
- Custom roles — can be defined per installation
Each OPC-UA tag can have individual access rights configured:
- Visible — appears in browse
- Browse — node info can be read
- Read — current value can be read
- Write — value can be modified
- History — historical data can be accessed
Security Policies
B&R OPC-UA supports the standard OPC-UA security policies:
- None — no encryption, no signing (common on legacy machines)
- Basic128Rsa15 — basic encryption
- Basic256 — stronger encryption
- Basic256Sha256 — strongest commonly available
Certificate Management
Certificate Location
Certificates are stored on the CF card in the certificate store:
- Path: Accessible via Automation Studio → Configuration → Access and Security → Certificate Store
- Own certificates — the PLC’s server certificate
- Communication partner certificates — trusted client certificates
- CA certificates — certificate authority chains
Managed Certificate Store (AR 6.5+)
Starting with AR 6.5, B&R introduced the ManagedCertificateStore with the ArMcsRecreateCert function block for programmatic certificate recreation. In AR 6.5, the ManagedCertificateStore is extended to cover ANSL, FTP, HTTP, and SMTP libraries (not just OPC-UA). Additionally, the ArCert library now supports creating, exporting, viewing, and deleting certificate signing requests (CSRs), and the AsHttp httpsClient supports Server Name Indication (SNI). These features are not available on AR 4.x (CP1584 maximum), but are relevant for migration planning to newer B&R hardware.
Creating and Managing Certificates
- In Automation Studio: Configuration → Access & Security → Certificate Store → Own certificates
- Double-click New OPC UA certificate
- Configure: subject, validity, key size
- Transfer to PLC
Certificate-Only Access
For secure installations, certificate-based access can be configured:
- Create SSL configuration referencing the certificate
- Apply to OPC-UA server
- Add trusted client certificates to the communication partner store
- Disable anonymous access
Replacing Certificates Without Automation Studio
If you need to change certificates on a running PLC without the project:
- Access the CF card via FTP (user partition)
- The certificate store is typically at
F:\System\Certificates\or similar - Replace the server certificate file
- Cold restart the PLC to apply
Caution: Incorrect certificate replacement can lock you out of OPC-UA entirely.
Certificate Management Deep Dive
Certificate Creation Step-by-Step
When creating an OPC-UA certificate for a B&R PLC, the subject fields must be configured correctly for the PLC to accept and serve the certificate properly.
Recommended subject fields:
| Field | Value | Example |
|---|---|---|
| CN (Common Name) | PLC hostname or descriptive name | BR-PLC-001 or Line3-Controller |
| O (Organization) | Company or plant name | ACME Manufacturing |
| L (Locality) | City or site location | Detroit |
| S (State) | State or province | Michigan |
| C (Country) | Two-letter country code | US |
Key size: Minimum 2048-bit RSA. 4096-bit is supported on newer firmware but increases handshake latency.
Validity period: Typical production use is 1-3 years. Longer periods reduce renewal overhead but weaken the security boundary if the private key is compromised.
Certificate Renewal Workflow
- Generate a new certificate with the same subject fields and new validity period
- Replace the server certificate on the CF card (
System/Certificates/Own/) - Warm restart — the OPC-UA server reloads the certificate
- All connected clients receive
BadCertificateUntrustedand must re-accept the new certificate - Update any client certificate stores that pinned the old certificate
SHA1 Deprecation Issue
Older Automation Studio versions generated OPC-UA certificates using SHA1 signatures. Modern clients (UaExpert 1.5+, .NET OPC-UA stack, Python asyncua) reject SHA1 at the security layer.
Symptoms: BadCertificateUntrusted on any sign/encrypt policy; works with security None. Verify: openssl x509 -in cert.der -inform DER -text -noout | grep "Signature Algorithm".
Resolution: Regenerate the certificate with SHA256 via Automation Studio → Certificate Store. Ensure mapp version is 5.x+ (SHA256 native support). On firmware older than AR 4.30, use security None as a workaround.
Self-Signed vs CA-Signed Certificates
| Aspect | Self-Signed | CA-Signed |
|---|---|---|
| Trust model | Manual trust per client | Chain trust via CA root |
| Deployment | Simple, no external dependency | Requires CA infrastructure |
| Revocation | Not possible | CRL/OCSP supported |
| Scalability | Poor for many devices | Good for fleet management |
| Recommended for | Single-machine setups, development | Production lines, multi-PLC systems |
For production environments with multiple PLCs, use an internal CA (e.g., Smallstep CA, HashiCorp Vault PKI, or B&R’s own Automation Studio CA feature). This eliminates the need to manually trust each PLC’s certificate on every client.
Certificate Trust Chain Management
The B&R certificate store on the CF card maintains three categories under System/Certificates/:
- Own/ — server certificate + private key (DER format)
- Trusted/ — accepted client certificates from connecting clients
- CA/ — CA root and intermediate certificates
Trust validation order: check Trusted/ folder for direct match, then check CA/ for chain validation (intermediate to root), then verify validity period.
Adding a trusted CA: Export CA root cert in DER format, upload to System/Certificates/CA/ via FTP, warm restart. All certificates signed by that CA are automatically trusted.
SSL Configuration in Automation Studio
To bind a certificate to the OPC-UA server in Automation Studio:
- Configuration → Access & Security → SSL Configuration — create a new SSL Configuration object
- Set the Certificate Reference to the OPC-UA certificate in the Certificate Store
- Under OPC-UA System → Server Configuration, set the SSL Configuration reference
- Build and transfer
The SSL Configuration also controls TLS versions (TLS 1.2 minimum recommended), cipher suites, and whether the server requests client certificates.
mappView OPC-UA Client Certificate Configuration
When mappView acts as an OPC-UA client (connecting to another PLC or external server), it needs its own client certificate:
- In the mappView configuration, open mapp OPC-UA Client
- Set the Certificate reference to a client certificate from the Certificate Store
- The target server must trust this certificate (either directly or via CA chain)
- Configure the security policy to match what the server offers
Failure to configure the client certificate results in BadSecurityChecksFailed on the server side.
Certificate Backup and Restore Procedure
Backup: FTP to PLC, download the entire System/Certificates/ directory. Optionally convert to PEM: openssl x509 -in cert.der -inform DER -out cert.pem -outform PEM
Restore: Upload backup System/Certificates/ via FTP, cold restart to reload. Verify by connecting with UaExpert and checking the server certificate fingerprint. Always back up before firmware upgrades — upgrades may invalidate certificate bindings.
Connecting with OPC-UA Clients
Using UaExpert (Free OPC-UA Client)
- Install UaExpert (Unified Automation)
- Server → Add
- Enter the PLC IP address
- The Discovery URL will be:
opc.tcp://<PLC_IP>:4840 - Click Connect
- A certificate approval dialog appears — check “Trust Server Certificate”
- Browse: Objects → PLC → Modules → Default to find variables
- Set Authentication to Anonymous if no credentials configured
Python Client (asyncua)
import asyncio
from asyncua import Client
async def read_br_variables():
url = "opc.tcp://192.168.1.100:4840"
async with Client(url=url) as client:
# Browse available variables
root = client.nodes.root
objects = await root.get_child(["Objects", "PLC", "Modules", "Default"])
children = await objects.get_children()
for child in children:
name = await child.get_browse_name()
value = await child.get_value()
print(f"{name}: {value}")
# Read a specific variable by node ID
var = client.get_node("ns=2;s=PLC.Modules.Default.Cyclic#1.MyVariable")
value = await var.get_value()
print(f"MyVariable = {value}")
# Write a variable
await var.write_value(42.0)
asyncio.run(read_br_variables())
Node-RED Integration
Use the OPCUA-IIoT node in Node-RED:
- Configure OPC-UA server endpoint:
opc.tcp://<PLC_IP>:4840 - Security mode: None (for legacy machines)
- Browse to find variable node IDs
- Use Read/Write nodes for data exchange
Practical Client Examples
Python Subscription Example (asyncua)
Subscriptions are preferred over polled reads — the server pushes updates only when values change.
import asyncio
from asyncua import Client, ua
url = "opc.tcp://192.168.1.100:4840"
async def data_change_callback(node, val, data):
name = await node.get_browse_name()
print(f"[CHANGE] {name.Name} = {val}")
async def subscription_example():
async with Client(url=url) as client:
sub = await client.create_subscription(500, data_change_callback)
nodes = [
"ns=2;s=PLC.Modules.Default.Cyclic#1.Temperature",
"ns=2;s=PLC.Modules.Default.Cyclic#1.Pressure",
"ns=2;s=PLC.Modules.Default.Cyclic#1.Status",
]
for nid in nodes:
node = client.get_node(nid)
params = ua.MonitoringParameters(
ClientHandle=len(sub.monitored_items),
SamplingInterval=250,
QueueSize=10,
DiscardOldest=True
)
await sub.subscribe_data_change(node, params)
print("Subscribed. Press Ctrl+C to exit.")
try:
while True:
await asyncio.sleep(1)
except KeyboardInterrupt:
await sub.delete()
asyncio.run(subscription_example())
Python Write Example — B&R Gotcha
When writing to B&R OPC-UA variables, write_value() works for scalars. For complex structures with engineering unit scaling, you may need write_params or write individual members.
import asyncio
from asyncua import Client, ua
url = "opc.tcp://192.168.1.100:4840"
async def write_example():
async with Client(url=url) as client:
scalar = client.get_node("ns=2;s=PLC.Modules.Default.Cyclic#1.Setpoint")
await scalar.write_value(75.5)
print("Setpoint written: 75.5")
struct_node = client.get_node("ns=2;s=PLC.Modules.Default.Cyclic#1.RecipeData")
variant = ua.Variant(
{"Param1": 100, "Param2": 3.14, "Enable": True},
ua.VariantType.ExtensionObject
)
try:
await struct_node.write_value(variant)
except ua.UaError:
print("Structure write failed — writing individual members:")
await client.get_node(
"ns=2;s=PLC.Modules.Default.Cyclic#1.RecipeData.Param1"
).write_value(100)
await client.get_node(
"ns=2;s=PLC.Modules.Default.Cyclic#1.RecipeData.Param2"
).write_value(3.14)
await client.get_node(
"ns=2;s=PLC.Modules.Default.Cyclic#1.RecipeData.Enable"
).write_value(True)
asyncio.run(write_example())
UaExpert Workflow for Undocumented PLCs
- Launch UaExpert, add server: Server → Add → enter PLC IP
- Discovery: UaExpert queries
opc.tcp://<IP>:4840. If discovery fails, manually enter the endpoint URL - Certificate dialog: Check “Trust server certificate” on first connect
- Authentication: Start with Anonymous. If rejected, try common B&R credentials (admin/admin, operator/operator)
- Browse: Expand Objects → PLC → Modules → Default. Subfolders = task classes, contents = PLC variables
- Export: Right-click “Default” → Create Address Space Snapshot → saves CSV of all nodes
- Test: Drag a variable to Data Access View. Double-click value to attempt write
- System nodes: Objects → PLC → System shows CPU utilization, memory, task cycle times
Wireshark OPC-UA Capture and Decode
- Start Wireshark, set capture filter:
port 4840 - Connect with the OPC-UA client, then stop capture
- Install the OPC-UA dissector (Edit → Preferences → Protocols → OPC UA) if not present
- For encrypted traffic, set security to None for debugging — Wireshark cannot decrypt without session keys
- Key frames to inspect: Hello/ACK (TCP+OPC-UA handshake), CreateSession, Browse/Read/Write (node IDs visible in plaintext with security None), PublishResponse (subscription data)
C#/.NET OPC-UA Client Example
using Opc.Ua;
using Opc.Ua.Client;
var endpointUrl = "opc.tcp://192.168.1.100:4840";
var config = new ApplicationConfiguration()
{
ApplicationName = "B&R OPC-UA Client",
ApplicationUri = new Uri("urn:BROpcUaClient"),
ApplicationType = ApplicationType.Client,
SecurityConfiguration = new SecurityConfiguration
{
AutoAcceptUntrustedCertificates = true,
MinimumCertificateKeySize = 1024
}
};
config.CertificateValidator.CertificateValidation += (s, e) =>
{
if (e.Error.StatusCode == StatusCodes.BadCertificateUntrusted)
e.Accept = true;
};
var endpoint = CoreClientUtils.SelectEndpoint(endpointUrl, useSecurity: false);
using var session = Session.Create(config, endpoint, updateBeforeConnect: true,
"BROpcUaClient", 60000, null, null).Result;
var readNode = new NodeId("PLC.Modules.Default.Cyclic#1.Temperature", 2);
Console.WriteLine($"Temperature: {session.ReadValue(readNode).Value}");
session.WriteValue(
new NodeId("PLC.Modules.Default.Cyclic#1.Setpoint", 2),
new DataValue(72.5));
var subscription = new Subscription(session.DefaultSubscription)
{
PublishingInterval = 500, PublishingEnabled = true,
LifetimeCount = 1000, KeepAliveCount = 10
};
session.AddSubscription(subscription);
var item = new MonitoredItem(subscription.DefaultItem)
{
DisplayName = "Pressure",
StartNodeId = new NodeId("PLC.Modules.Default.Cyclic#1.Pressure", 2),
SamplingInterval = 250, QueueSize = 10, DiscardOldest = true
};
item.Notification += (_, e) =>
{
foreach (var c in e.NotificationList)
Console.WriteLine($"Pressure: {c.Value}");
};
subscription.AddItem(item);
subscription.Create();
Console.WriteLine("Subscribed. Press Enter to exit.");
Console.ReadLine();
session.Close();
Package: OPCFoundation.NetStandard.Opc.Ua (NuGet). Requires .NET Standard 2.0+ or .NET 6+.
Finding an Unknown OPC-UA Server
For machines with no documentation:
Step 1: Find the PLC IP Address
- Check the SDM (System Diagnostics Manager):
http://<IP>/sdm - Use Wireshark to capture B&R ANSL discovery packets
- Check network switch/router ARP table for B&R MAC OUI prefixes
- Try common B&R default IP ranges (192.168.100.x, 192.168.1.x)
Step 2: Check if OPC-UA is Active
## Scan for OPC-UA port 4840
nmap -p 4840 <PLC_IP>
## Or try connecting with openssl
openssl s_client -connect <PLC_IP>:4840
Step 3: Determine the OPC-UA Configuration
You cannot determine the OPC-UA configuration from the PLC alone without:
- The original project
- A system dump analyzed in Automation Studio
- The ability to browse the server
Key unknowns:
- Is OPC-UA activated at all?
- What port is it on? (default 4840, but configurable)
- What variables are enabled?
- What authentication is required?
- What encryption policy is used?
Step 4: Try Connection
Use UaExpert to attempt connection at the default port. If anonymous access is enabled and variables were configured, you’ll see them in the namespace. If not, you need to explore alternative access methods (PVI, FTP, direct I/O monitoring).
Performance Considerations
- OPC-UA runs as a system task (lower priority than cyclic tasks)
- Sampling interval is typically 100 ms minimum for standard OPC-UA subscriptions
- If the task idle time is too low, OPC-UA responses will time out
- The OPC-UA server can be a significant CPU load if many subscriptions are active
- For high-speed data collection, POWERLINK or direct I/O access is faster
Configuration File Deep Dive
OpcUa.Config.xml Structure
The OPC-UA server behavior is controlled by OpcUa.Config.xml on the CF card, generated by Automation Studio but editable via FTP.
OpcUa.Config.xml
├── ServerConfiguration
│ ├── ApplicationUri / ApplicationName / ProductUri / ServerName
│ ├── BaseAddresses (list of endpoint URLs)
│ ├── SecurityPolicies (uri + certificate per policy)
│ ├── MaxSessions / MaxSubscriptionsPerSession
│ ├── MaxMonitoredItemsPerSubscription
│ ├── RequestTimeout / ServiceLevel / AuditingEnabled
│ └── MaxResponseMessageSize
├── EndpointConfiguration
│ ├── TransportProfileUri / SecurityMode
│ ├── SecurityPolicyUri / SecurityLevel
├── UserTokenPolicies (anonymous, username, certificate)
├── CertificateConfiguration
│ ├── CertificateStorePath / IssuedCertificatesPath
│ └── TrustedCertificatesPath
└── NodeManager → BaseAddress
Editing the Config File via FTP
When you have no Automation Studio project and need to modify OPC-UA server settings:
- Connect to the PLC via FTP (default credentials: user/user or admin/admin depending on configuration)
- Navigate to the user partition (typically
F:\or the volume labeled “User”) - Locate
OpcUa.Config.xml— it may be at the root or under a project-specific directory - Download the file to your local machine
- Edit with a text editor (XML-aware editor recommended — notepad++ with XML plugin, VS Code)
- Backup the original file first (
OpcUa.Config.xml.bak) - Upload the modified file
- Perform a warm restart of the PLC to reload the configuration
Caution: Invalid XML will prevent the OPC-UA server from starting. Validate the XML before uploading. The server does not provide detailed parse error logs — it simply fails to start.
Key Configuration Parameters
| Parameter | Default | Description |
|---|---|---|
| MaxSessions | 100 | Maximum concurrent OPC-UA sessions (client connections) |
| MaxSubscriptionsPerSession | 100 | Maximum subscriptions per session |
| MaxMonitoredItemsPerSubscription | 1000 | Maximum monitored items (variables) per subscription |
| MaxBrowseContinuationPoints | 50 | Parallel browse operations |
| MaxHistoryContinuationPoints | 50 | Parallel history read operations |
| RequestTimeout | 10000 ms | Server-side request timeout |
| ServiceLevel | 100-255 | Server service level (100 = minimum) |
| MaxResponseMessageSize | 0 (unlimited) | Maximum response message size in bytes |
Endpoint Configuration
Endpoints define how clients connect. Each endpoint specifies:
- Transport Profile URI:
opc.tcpfor binary TCP transport (standard),httpfor SOAP/HTTP (legacy, rarely used) - Security Mode:
None,Sign,SignAndEncrypt - Security Policy URI: Maps to the actual encryption algorithm:
http://opcfoundation.org/UA/SecurityPolicy#Nonehttp://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15http://opcfoundation.org/UA/SecurityPolicy#Basic256http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
Changing the OPC-UA Port Without Automation Studio
- FTP to the PLC, download
OpcUa.Config.xml - Locate
<BaseAddresses>and change the port in the endpoint URI:<BaseAddresses> <EndpointUri>opc.tcp://192.168.1.100:4841</EndpointUri> </BaseAddresses> - Backup the original, upload the modified file, warm restart
- After changing the port, clients must use the new endpoint URL directly — auto-discovery will not find the server at the old port
Namespace and Variable Discovery Without Project
Recursive Python Namespace Browser
When working with an undocumented B&R PLC, the first task is discovering what variables are exposed. This script recursively browses the entire OPC-UA namespace and prints a tree of all nodes with their data types and current values.
import asyncio
from asyncua import Client
url = "opc.tcp://192.168.1.100:4840"
async def browse_recursive(client, node, indent=0):
name = await node.get_browse_name()
node_class = await node.read_node_class()
display_name = await node.get_display_name()
prefix = " " * indent
info = f"{prefix}[{node_class.name}] {display_name.Text}"
try:
value = await node.get_value()
data_type = await node.read_data_type()
info += f" = {value} ({data_type.Identifier})"
except Exception:
pass
try:
desc = await node.read_description()
if desc and desc.Text:
info += f" -- {desc.Text}"
except Exception:
pass
print(info)
try:
children = await node.get_children()
for child in children:
await browse_recursive(client, child, indent + 1)
except Exception:
pass
async def discover_namespace():
async with Client(url=url) as client:
print(f"=== OPC-UA Namespace Discovery: {url} ===")
root = client.nodes.root
objects = client.nodes.objects
await browse_recursive(client, objects, indent=0)
asyncio.run(discover_namespace())
Usage notes:
- On large namespaces, this can take several minutes — the B&R OPC-UA server has a default browse limit and may require continuation point handling
- Redirect output to a file:
python discover.py > namespace_dump.txt - The output can be cross-referenced with any partial documentation or PLC I/O lists
Mapping Discovered Variables to IO Points
After discovering the namespace, map variables back to physical I/O:
- Task class names in OPC-UA correspond to Automation Studio task classes:
Cyclic#1/Cyclic#2(I/O processing),HMI_Inputs/HMI_Outputs(HMI interface),Alarm/Recipe/DataLogger(mapp components),IO_.../DI_.../DO_.../AI_.../AO_...(digital/analog I/O) - Variable naming patterns:
gMachine_State(global state),stAxis_<Name>(axis structure),rSensor_<Location>(sensor reading),bSwitch_<Function>(boolean input) - Struct members map directly to Automation Studio variable names (
bEnable,rActualValue,rSetpoint)
Reconstructing IO Mapping via OPC-UA Browse
For a completely undocumented machine:
- Start with
Systemnode: CPU diagnostics, firmware version, task cycle times - Browse
Modules → Default → <task classes>: application variables by task - Look for variables with engineering units metadata — often correspond to physical sensors
- Look for structures named after hardware:
Axis_Drive1,IoModule_Terminal1 - Compare with physical I/O module count on the hardware to validate coverage
Limitations: What You Cannot Discover via OPC-UA
- Internal program logic: You cannot see ladder logic, ST code, or function block implementations
- Communication parameters: POWERLINK node assignments, MODBUS register mappings, or serial port configurations are not exposed
- Disabled variables: Any variable the OEM did not explicitly enable as an OPC-UA tag is invisible
- Array dimensions: B&R OPC-UA may expose arrays but with limited dimension metadata
- User-defined types: Complex user-defined data types may appear as generic structures without meaningful member descriptions
- Timing information: Task cycle times are visible, but internal timing (delays, timer configurations) is not
- Hardware configuration: The physical I/O topology (which terminal is in which slot) is not directly exposed — only the logical variable names
- Alarm/event history: Unless mapp AlarmX was configured to publish through OPC-UA, alarm data is not available via standard variable browsing
OPC-UA Troubleshooting
Common Connection Failures
| Symptom | Likely Cause | Resolution |
|---|---|---|
| Connection refused (TCP RST) | OPC-UA server not running | Check if OPC-UA is activated in the PLC configuration. Warm restart. Verify port via nmap |
| Connection timeout | Network firewall blocking port 4840 | Check firewall rules. Open TCP 4840 inbound on the PLC network segment |
| Certificate rejection | Server cert untrusted by client | Trust the server certificate in the client. In UaExpert: check “Trust Server Certificate” on first connect |
| BadCertificateUntrusted | SHA1-signed certificate | Regenerate certificate with SHA256. See Certificate Management Deep Dive |
| BadSecurityChecksFailed | Security policy mismatch | Client and server must share at least one common security policy. Check server endpoints |
| BadSessionClosed | Session timeout | Increase client keep-alive interval. Check PLC CPU load — high load causes OPC-UA timeouts |
| BadUserAccessDenied | Insufficient permissions | Verify user role assignment. Check if anonymous access was disabled |
| BadNodeIdUnknown | Variable node does not exist | Verify the node ID against a fresh namespace browse. Variable names are case-sensitive |
| No endpoints discovered | Discovery service not responding | Try direct connection with the endpoint URL opc.tcp://<IP>:4840 |
| Connection drops intermittently | Network instability or CPU overload | Check network cabling, switch port errors, and PLC task idle time |
Certificate Trust Issues
Scenario: Client connects successfully with security=None but fails with any signing or encryption policy.
- Verify the server certificate is not expired:
openssl x509 -in cert.der -inform DER -dates -noout - Verify the signature algorithm:
openssl x509 -in cert.der -inform DER -text -noout | grep "Signature Algorithm" - Check if the client certificate is in the PLC’s trusted store:
- FTP to PLC → browse
System/Certificates/Trusted/ - If the client certificate is missing, upload it
- FTP to PLC → browse
- For CA-signed certificates, ensure the CA root is in
System/Certificates/CA/
Authentication Failures
- Anonymous rejected: The OEM removed the “Everyone” role. You must authenticate with a configured username/password. Check the B&R User Management for valid accounts.
- Username/password rejected: Verify credentials against the B&R user management (accessible via Automation Studio or the SDM web interface). Passwords are case-sensitive.
- Certificate authentication rejected: The client certificate is not in the trusted store, or the SSL Configuration on the PLC requires a specific certificate that was not presented by the client.
Timeout Issues
OPC-UA timeouts on B&R systems are almost always caused by insufficient task idle time:
- Check CPU utilization:
PLC.System.CPU.Utilizationand per-task cycle times via OPC-UA System nodes - If task idle time is below 10%, the OPC-UA system task cannot respond within the request timeout
- Reduce active subscriptions, increase sampling intervals, or optimize cyclic task code
- Increase client-side timeout (UaExpert: Tools → Options → Advanced → Operation Timeout)
Variable Not Found / Namespace Issues
- Node IDs in B&R OPC-UA are case-sensitive:
PLC.Modules.Default.Cyclic#1is not the same asplc.modules.default.cyclic#1 - The namespace index (
ns=X) can change between firmware upgrades or configuration rebuilds — always verify with a fresh browse - If variables disappear after a PLC update, the OEM may have modified the OPC-UA Default View configuration
- Empty namespaces under
Objects → PLC → Modules → Defaultmean no variables were enabled for that task class
Port Conflicts
- Another service on the PLC may be using port 4840 (unlikely but possible with custom configurations)
- A firewall between the client and PLC may be blocking the port
- If the OPC-UA port was changed from the default, the discovery URL will not match — always try direct endpoint connection
- Multiple OPC-UA servers on the same network segment with the same ApplicationUri can cause client confusion
Security Policy Mismatch
If the client and server have no overlapping security policies:
- Use UaExpert to connect and check the server’s offered endpoints (shown in the connection dialog before connecting)
- Ensure the client supports at least one of the server’s offered security policies
- If the server only offers
Basic256Sha256and the client only supportsNone, upgrade the client or reconfigure the server’s security policies inOpcUa.Config.xml - For legacy B&R firmware, the server may only offer
NoneandBasic128Rsa15— modern clients that reject SHA1 may only haveNoneas an option
OPC-UA Performance Tuning
Subscription vs Polled Reads
| Approach | Network Traffic | Server Load | Data Freshness | Recommended Use |
|---|---|---|---|---|
| Subscription | Low (push on change) | Lower | Near real-time | Continuous monitoring, alarming, dashboards |
| Polled Read | High (periodic request) | Higher | Periodic (poll interval) | One-time reads, data logging, batch processing |
| Batched Read | Medium | Medium | Periodic | Reading many variables at once |
Recommendation: Always prefer subscriptions over polled reads. A single subscription with 100 monitored items generates significantly less network traffic than polling 100 variables every 250 ms.
Dead Band Settings for Analog Values
Dead bands prevent unnecessary notifications for insignificant analog value changes. Set the absolute dead band to match sensor resolution — a temperature sensor with 0.1C resolution does not need notifications for 0.001C changes. Dead bands are not applicable to integers and booleans.
Queue Size and Sampling Rate Optimization
- QueueSize=1: Only the latest value is kept. Intermediate values are lost. Use for dashboards where only the current value matters.
- QueueSize=10+: Multiple intermediate values are queued. Use for data logging or trend analysis. Client receives all intermediate values on each publish cycle.
- SamplingInterval: The minimum practical interval on B&R OPC-UA is typically 50-100 ms. Intervals below 50 ms may be rounded up by the server.
- PublishingInterval: The server sends queued notifications at this interval. Set to 500-1000 ms for normal operation. Lower values increase CPU and network load.
Impact on Cyclic Task Performance
The OPC-UA server runs as a system task at a priority between 4 and 190. If cyclic tasks are consuming most of the CPU cycle, the OPC-UA server task gets starved:
- Monitor task idle time: Via OPC-UA, read
PLC.System.Tasks.<TaskName>.IdleTime. If below 10%, expect OPC-UA response degradation - Correlation: When cyclic task cycle time spikes (e.g., from 5 ms to 15 ms), OPC-UA publish intervals will stretch proportionally
- Mitigation: Reduce the number of monitored items, increase sampling intervals, or optimize the cyclic task code
- Diagnostic: If you notice OPC-UA latency increasing during machine operation, check which cyclic task is consuming CPU and when
Monitoring Task Idle Time with OPC-UA Active
When OPC-UA is active, monitor task idle time to detect performance impact. Key node IDs:
PLC.System.Cyclic#1.IdleTime— idle time in microsecondsPLC.System.Cyclic#1.CycleTime— total cycle time in microseconds
Health thresholds:
- Idle > 20% of cycle time: healthy, OPC-UA is not starving
- Idle 10-20%: warning, reduce subscriptions or increase sampling intervals
- Idle < 10%: critical, OPC-UA responses will timeout; optimize cyclic tasks first
If idle time drops when OPC-UA subscriptions are active, the OPC-UA system task is competing for CPU time. Reduce the number of monitored items or increase sampling intervals to relieve pressure.
OPC-UA History (Historical Access)
Historical Data Access
If the B&R OEM configured mapp DataLogger or mapp History with OPC-UA historical access enabled, you can read historical variable values from the OPC-UA server:
- The historical data is exposed through the OPC-UA Historical Data Access (HDA) service
- Not all B&R OPC-UA configurations include HDA — it must be explicitly configured in Automation Studio
- Available historical nodes appear in the namespace with the
AccessLevelHistoryReadflag set
Reading Historical Data with Python
import asyncio
from asyncua import Client, ua
url = "opc.tcp://192.168.1.100:4840"
async def read_history():
async with Client(url=url) as client:
node = client.get_node("ns=2;s=PLC.Modules.Default.DataLogger.Temperature")
start = ua.DateTime.utcfromisoformat("2025-12-01T00:00:00Z")
end = ua.DateTime.utcfromisoformat("2025-12-31T23:59:59Z")
details = ua.ReadRawModifiedDetails(
IsReadModified=False, StartTime=start, EndTime=end,
NumValuesPerNode=0, ReturnBounds=True
)
result = await node.read_history(
history_read_details=details,
timestamps_to_return=ua.TimestampsToReturn.Both
)
if result.StatusCode.is_good():
for item in result.HistoryData.Values:
print(f"{item.SourceTimestamp}: {item.Value.Value} [{item.Status}]")
else:
print(f"Failed: {result.StatusCode}")
asyncio.run(read_history())
Reading Historical Alarms via OPC-UA
If mapp AlarmX is configured to publish through OPC-UA, alarms appear as condition nodes with properties: EnabledState, AckedState, ActiveState, Severity. Query historical alarm events using the Event History service.
import asyncio
from asyncua import Client, ua
url = "opc.tcp://192.168.1.100:4840"
async def read_alarm_history():
async with Client(url=url) as client:
alarms = client.get_node("ns=2;s=PLC.Modules.Default.AlarmX")
start = ua.DateTime.utcfromisoformat("2025-12-01T00:00:00Z")
end = ua.DateTime.utcfromisoformat("2025-12-31T23:59:59Z")
event_filter = await alarms.get_event_filter(
evtype=client.get_node(ua.ObjectIds.AlarmConditionType)
)
details = ua.ReadEventDetails(
StartTime=start, EndTime=end,
MaxValuesPerNode=1000, Filter=event_filter
)
result = await alarms.read_event_history(details)
if result and result.Events:
for ev in result.Events:
msg = ev.Message.Text if ev.Message else "No message"
sev = ev.Severity if hasattr(ev, "Severity") else "N/A"
print(f"{ev.Time}: [{sev}] {msg}")
else:
print("No alarm history or HDA not configured")
asyncio.run(read_alarm_history())
Time-Based Data Retrieval Constraints
- Time zone: B&R OPC-UA uses UTC. If the PLC clock is not NTP-synchronized, timestamps may be inaccurate (see time-sync.md)
- Resolution: Depends on mapp DataLogger config — typically 100 ms to 60 seconds
- Retention: Stored on CF card or SRAM; old data is overwritten when the buffer fills
- Aggregate functions: If supported, use
ReadProcessedDetailsfor server-side aggregates (average, min, max, count, stddev) — more efficient than reading all raw values
Security Considerations for OPC-UA on B&R Systems
Known OPC-UA Vulnerabilities
| CVE | Advisory | Product | CVSS | Impact | Mitigation |
|---|---|---|---|---|---|
| CVE-2025-11482 | SA25P006 (2026-05-26) | PPT30 OS < 1.8.0 | v4.0 8.7 / v3.1 7.5 | Permanent DoS on OPC-UA server via resource exhaustion from concurrent connections | Update PPT30 OS to 1.8.0; firewall port 4840 if OPC-UA not needed |
| CVE-2025-11044 | SA25P005 (2026-01-19) | AR < 6.5 / R4.93 | v4.0 8.9 | ANSL flooding DoS (impacts OPC-UA indirectly by exhausting AR resources) | Patched in R4.93; rate-limit at firewall |
| CVE-2026-0936 | SA26P001 (2026-01-29) | PVI client | N/A | PVI logs credentials in plaintext (affects OPC-UA connections made via PVI) | Update PVI to 6.5; see pvi-api.md |
OPC-UA Hardening Checklist
- Disable anonymous access if possible — require username/password or certificate authentication
- Use security policy Basic256Sha256 or higher — never run production with security None
- Firewall port 4840 to allow only known OPC-UA clients and HMIs
- Monitor OPC-UA connection attempts — unexpected clients may indicate scanning
- Regenerate self-signed certificates with SHA256 and set reasonable validity (1-3 years)
- Replace self-signed certs with CA-signed when possible — see SA25P001 guidance in cybersecurity-hardening.md
- PPT30 HMI panels: If OPC-UA is enabled on a PPT30, verify OS version >= 1.8.0 (SA25P006)
CVE-2025-11482: PPT30 OPC-UA Server DoS
The PPT30 OPC-UA server has a resource exhaustion vulnerability (CWE-770). An unauthenticated network attacker can send messages that cause the OPC-UA server to become permanently unresponsive. A reboot is required to restore service. The vulnerability is scored CVSS v4.0 8.7 because:
- No authentication required
- Network-based exploitation
- Permanent availability impact (reboot needed)
- Affects safety-related HMI interactions when PPT30 is used as the operator interface
If your CP1584 system uses a PPT30 panel with OPC-UA:
- Check PPT30 OS version: Settings → System Information → OS Version
- Update to PPT30 OS 1.8.0 via B&R Update Tool
- If update is not immediately possible, restrict OPC-UA access to trusted IP addresses via firewall
- OPC-UA is not enabled by default on PPT30 — if you never explicitly enabled it, you are not affected
Cross-References
- execution-model.md — How task priority affects OPC-UA system task performance
- pvi-api.md — Alternative programmatic access method
- ftp-web-interface.md — FTP access to CF card for certificate/config files
- iiot-retrofit.md — OPC-UA to MQTT bridges for modern monitoring
- python-diagnostics.md — Building Python diagnostic scripts with OPC-UA
- time-sync.md — Timestamp handling for OPC-UA historical data
- network-architecture.md — Network requirements for OPC-UA
- access-recovery.md — Accessing OPC-UA when credentials are lost
- alarm-logging.md — OPC-UA alarm integration
- cybersecurity-hardening.md — OPC-UA security hardening, CVE-2025-11482, SA25P006
Key Findings
- OPC-UA server is built into AR firmware but must be explicitly activated and variables individually enabled
- Not all variables are automatically exposed — each must be enabled as an OPC-UA tag by the developer
- Default port is 4840 on the standard Ethernet interface
- Namespace structure:
Objects → PLC → Modules → Default → <TaskName> → <Variables> - Three authentication methods: anonymous (default), username/password, certificate
- Certificates stored on CF card in the certificate store
- For undocumented machines: OPC-UA is the best diagnostic access point if it was configured, but useless if the OEM never enabled it
- The
OpcUa.Config.xmlfile on the CF card contains server configuration - OPC-UA runs as a lower-priority system task — it can be starved by long-running cyclic tasks
Community OPC-UA Tools for B&R
| Tool | URL | Purpose |
|---|---|---|
| OpcUaSamples | github.com/br-automation-community/OpcUaSamples-sample-AS | Comprehensive OPC-UA configuration and coding samples in Ansi-C and ST, spanning AS4.1 through the newest AS version, with detailed explanations |
| easyuaclient-as-project | github.com/br-automation-community/easyuaclient-as-project-dev | EasyUaClnt — a simplicity wrapper library based on AsOpcUac for a clear OPC-UA client interface |
| demo-br-asyncua | github.com/hilch/demo-br-asyncua | Minimal Python example accessing a B&R PLC via asyncua (asyncio-based OPC-UA stack). Alternative to the Python OPC-UA client examples in python-diagnostics.md |
| mappRemoteShell | github.com/br-automation-community/mappRemoteShell | Sample project executing shell commands on a remote PC via OPC-UA + Python — demonstrates bidirectional OPC-UA communication for remote diagnostics |
| mappPanel | github.com/br-automation-community/mappPanel | Sample for PLC to T-Panel communication over OPC-UA — useful for understanding panel integration patterns |
Document updated: July 2026 (added security considerations section §13 with CVE-2025-11482/PPT30 OPC-UA DoS, OPC-UA hardening checklist; added community OPC-UA tools section)
B&R HMI Integration — mapp View & Panel Systems
Audience: Automation engineers maintaining undocumented B&R CP1584 machines with zero OEM documentation.
Scope: mapp View (HTML5), legacy POWER WORX/VNC display paths, OPC UA FX data exchange, Automation Studio project recovery, panel replacement procedures.
Table of Contents
- Overview
- Architecture
- mapp View Deep Dive
- Data Exchange: OPC UA FX
- Legacy Protocols: POWER WORX & VNC
- Alarm Handling: mapp AlarmX
- Diagnosing HMI Issues on an Undocumented Machine
- Recovering the HMI Project Without OEM Files
- Panel Replacement Procedure (CP1584 Context)
- Multi-Client / Multi-User Setup
- Practical Code Examples
- Key Findings
- Cross-References
Overview
B&R Automation’s HMI ecosystem has evolved from proprietary serial/ethernet display protocols to a fully web-based architecture built on open standards. On a CP1584 (or any modern B&R controller with mapp View), the HMI is not a separate application — it is an integrated web server running inside the controller’s runtime, rendering HTML5 pages that bind to PLC variables through the OPC UA FX (Field eXchange) data model.
This means:
- There is no separate “HMI program” to worry about — the HMI is part of the controller project.
- The display is served over HTTP/HTTPS on the controller’s Ethernet interface.
- Any device with a web browser can be the HMI panel. Dedicated B&R Panel PCs (Power Panel series, panels with built-in B&R controllers) run a fullscreen Chromium-based runtime that points at the controller’s web server.
- If you have no OEM documentation, the HMI configuration lives inside the
.apj(Automation Studio project) or in files deployed to the controller’s flash filesystem.
Architecture
┌──────────────────────────────────────────────────────────────────────┐
│ B&R Controller (e.g. CP1584) │
│ │
│ ┌─────────────────┐ ┌──────────────────┐ ┌────────────────┐ │
│ │ PLC Logic │ │ mapp View │ │ OPC UA FX │ │
│ │ (IEC 61131-3) │◄──►│ Web Server │◄──►│ Data Broker │ │
│ │ ST/SFC/CFC/LD │ │ (Port 80/443) │ │ │ │
│ └─────────────────┘ └────────┬─────────┘ └────────────────┘ │
│ │ │
│ ┌────────────────────────────────┼──────────────────────────────┐ │
│ │ Runtime Filesystem │ │ │
│ │ /opt/mappView/ │ │ │
│ │ ├── pages/ (*.page) │ │ │
│ │ ├── widgets/ (*.widget) │ │ │
│ │ ├── css/ │ │ │
│ │ ├── js/ │ │ │
│ │ └── config/ │ │ │
│ └────────────────────────────────┼──────────────────────────────┘ │
└───────────────────────────────────┼──────────────────────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌─────▼─────┐ ┌─────▼──────┐ ┌────▼───────┐
│ Panel PC │ │ VNC │ │ Web Browser│
│ (local) │ │ (remote) │ │ (any dev.) │
│ Chromium │ │ port 5900 │ │ HTTP/HTTPS │
└────────────┘ └────────────┘ └─────────────┘
Key architectural principle: HMI logic and control logic are completely decoupled. The PLC program has no knowledge of the HMI screens. The HMI screens have no knowledge of the PLC program structure. They are connected solely through the OPC UA FX variable namespace.
mapp View Deep Dive
Project Structure in Automation Studio
In Automation Studio, mapp View is a mapp component that you add to the project. Once added, it creates a structured directory tree:
MyProject/
├── Logical/
│ ├── mappView/ ← mapp View configuration
│ │ ├── Pages/ ← .page files (screen definitions)
│ │ │ ├── Main.page
│ │ │ ├── Diagnostics.page
│ │ │ └── RecipeEditor.page
│ │ ├── Widgets/ ← Reusable widget definitions
│ │ │ ├── MotorStatus.widget
│ │ │ └── TemperatureGauge.widget
│ │ ├── Frames/ ← Frame layouts (.frame)
│ │ ├── Styles/ ← CSS files
│ │ │ └── Custom.css
│ │ ├── Resources/ ← Images, SVGs
│ │ ├── Data/ ← Data configuration (.data)
│ │ │ └── mappViewData.data
│ │ ├── Config/ ← .config files (roles, clients)
│ │ │ ├── Roles.config
│ │ │ └── Clients.config
│ │ └── mappView.config ← Root configuration
│ │
│ └── Libraries/ ← Linked widget libraries
│ └── mappViewWidgets/
│
├── Physical/
│ ├── CP1584/ ← Target hardware configuration
│ └── ...
│
└── MyProject.apj ← Project file
File types you will encounter:
| Extension | Purpose |
|---|---|
.page | Defines a screen/page with widgets and layout |
.widget | Reusable UI component definition |
.frame | Container for grouping widgets with layout rules |
.data | Data bindings — maps HMI variables to PLC variables |
.config | Configuration files (roles, clients, display settings) |
.css | Custom stylesheets |
Widget Framework & Pages
mapp View provides a library of drag-and-drop widgets organized by function:
- Display widgets:
Text,Image,LED,Bar,Trend,Gauge,Table - Input widgets:
Button,Edit,CheckBox,RadioButton,Slider,DatePicker - Container widgets:
Group,Tab,SplitPanel,ScrollBox,Layer - Chart widgets:
CurveTracker,XYChart,BarChart - Special widgets:
AlarmList,RecipeEditor,CameraView,MaintenanceUI
Each widget has properties that fall into categories:
- Layout — position, size, anchoring
- Style — colors, fonts, borders
- Data — variable bindings (the OPC UA FX links)
- Behavior — click handlers, visibility conditions, animations
Widget data binding syntax in the .data file uses dot-notation referencing the OPC UA FX namespace:
// Data binding example (mappViewData.data)
Content.Main.StatusText.Value = "gMachineStatus.sCurrentState"
Content.Main.StartButton.Enable = "gMachineStatus.bRunning"
Content.Main.TempDisplay.Value = "gAxis[0].fTemperature"
Content vs. Layout Separation
mapp View enforces a strict three-layer separation:
| Layer | Contains | Modified when |
|---|---|---|
| Content | Text strings, image paths, variable bindings | Translating UI, changing I/O mapping |
| Layout | Page structure, widget positions, widget types | Redesigning screens, adding/removing widgets |
| Logic | HMI-side JavaScript actions, visibility rules | Changing interactive behavior |
This separation is critical for undocumented machines because:
- You can change variable bindings in the
.datafile without touching any page layouts. - You can swap language resource files without rebuilding the project.
- Layout changes don’t affect what data is displayed.
Data Exchange: OPC UA FX
Data Model Mapping
OPC UA FX is B&R’s proprietary extension to the OPC UA information model, optimized for high-performance cyclic data exchange between the PLC and HMI. It runs inside the controller — no external OPC UA server is needed.
The FX model organizes variables into a hierarchical namespace:
Data
├── Global
│ ├── gMachineStatus
│ │ ├── sCurrentState (STRING)
│ │ ├── bRunning (BOOL)
│ │ ├── nErrorCode (UINT)
│ │ └── fCycleTime (LREAL)
│ ├── gAxes
│ │ └── [0..7]
│ │ ├── fPosition (LREAL)
│ │ ├── fVelocity (LREAL)
│ │ ├── bHomed (BOOL)
│ │ └── bEnabled (BOOL)
│ └── gRecipe
│ ├── sActiveRecipe (STRING)
│ └── rParameters
│ ├── fSpeed (LREAL)
│ ├── fForce (LREAL)
│ └── nCount (UDINT)
├── AlarmX
│ ├── nActiveCount (UDINT)
│ └── aEntries[]
│ ├── sText (STRING)
│ ├── nCode (UDINT)
│ ├── eSeverity (ENUM)
│ └── tTimestamp (DATE_AND_TIME)
└── mappView
├── nClientCount (USINT)
└── aClients[]
Variable Binding
Variable bindings in mapp View are not hardcoded in widget definitions. They use a three-part indirection:
- PLC declares global variables (in IEC code or mapp component FBK instances).
- The
.datafile maps those PLC variables to symbolic names in the FX namespace. - Widgets reference the FX symbolic names.
PLC side (IEC 61131-3):
PROGRAM Main
VAR_GLOBAL
gMachineStatus : ST_MachineStatus;
END_VAR
FX data binding (mappViewData.data):
Data.Global.gMachineStatus → Main.gMachineStatus
Widget property (in page/widget XML):
Content.Main.StatusText.Value → Data.Global.gMachineStatus.sCurrentState
This indirection is what makes the content/layout/logic separation work.
Diagnostic Reads Without the Project
If you have no Automation Studio project, you can still read the live variable namespace from the controller:
Method 1: OPC UA Client (e.g., UAExpert, Prosys Simulator)
1. Connect OPC UA client to controller IP
- Endpoint URL: opc.tcp://<CP1584_IP>:4840
- Security: None (or sign-only, depending on config)
- No username/password by default
2. Browse the namespace:
- Root → Objects → Data → Global
- All PLC global variables are exposed here
- Root → Objects → Data → AlarmX
- Active alarms and history
3. Read/scribe individual variables
4. Monitor cyclic changes (subscription)
Method 2: B&R Automation Studio “Upload from Target”
1. Open Automation Studio → File → New → Project from Target
2. Enter controller IP address
3. Select hardware configuration to upload
4. This recovers:
- Physical hardware configuration (module types, addresses)
- Software object list (what programs/components are running)
- Global variable declarations
- mapp component instances and their configurations
- File system contents (including mapp View files)
5. Does NOT recover:
- Source code of PLC programs (only compiled object code)
- Comments or original variable names (only runtime names)
- .page/.widget source files IF the OEM disabled source deployment
Method 3: FTP to controller filesystem
# B&R controllers expose file system access via FTP
ftp <CP1584_IP>
# Default credentials: admin / admin (may differ)
# On Automation Runtime (VxWorks), the CF card is mounted as:
# C:\ — system partition (firmware, OS files)
# F:\ — user partition (application, mapp View, logs)
# mapp View deployed files are typically at:
# F:\mappView\
# Check with:
dir F:\mappView
dir F:\UserProject
# Automation Studio project files (if deployed):
# F:\UserProject\
WARNING: The CP1584 runs Automation Runtime on VxWorks — it does NOT provide SSH access. All filesystem access is via FTP (see ftp-web-interface.md). Filesystem access depends on firmware version and security settings. Some machines have FTP disabled or credentials changed from defaults.
Legacy Protocols: POWER WORX & VNC
POWER WORX (Proprietary HMI Protocol)
Before mapp View, B&R’s HMI systems (Power Panel T-Series, older Panel PCs) communicated with PLCs using the POWER WORX protocol — a B&R-proprietary binary protocol over Ethernet or serial.
Characteristics:
- Binary protocol, not human-readable
- Runs on Ethernet (TCP, typically port 49152 or configured) or serial (RS-232/TTY)
- Direct memory-mapped variable exchange (the HMI reads/writes PLC memory directly)
- Tightly coupled — HMI knew PLC memory layout and structure
- Replaced by OPC UA FX in modern systems
If you encounter POWER WORX on a CP1584:
- This means the machine has a legacy Power Panel connected alongside the CP1584
- The CP1584 acts as a gateway/bridge between POWER WORX and OPC UA
- Check Automation Studio configuration for
POWERWORXorPVI(Process Visualization Interface) components - PVI is the B&R library that implements POWER WORX communication
// PVI object access in IEC 61131-3 (legacy pattern)
// This is what you might find in older PLC code
PVI_Connect(hConnection, 'CP1584', 'TCP', '<IP>');
PVI_ReadVariable(hConnection, 'Main.gMachineStatus', &rxStatus);
PVI_WriteVariable(hConnection, 'Main.gCmdStart', bStart);
VNC (Remote Display)
VNC is used on B&R systems as a passive remote display mechanism — it mirrors what is shown on a connected Panel PC’s screen.
┌──────────┐ VNC (5900) ┌──────────────┐
│ Panel PC │───────────────│ Remote PC │
│ (shows │ │ (VNC viewer │
│ HMI) │ │ / noVNC) │
└─────┬──────┘ └──────────────┘
│ HTTP/HTTPS
│
┌─────▼──────┐
│ CP1584 │
│ (mapp View│
│ server) │
└────────────┘
- Default VNC port on B&R Panel PCs: 5900
- Some B&R systems also expose noVNC (HTML5 VNC client) on the controller’s web server
- VNC is display only — you cannot inject HMI commands through VNC
- For full remote HMI access, connect a browser directly to the controller’s mapp View server instead
Accessing VNC:
# Direct VNC connection to Panel PC (not the CP1584 itself)
vncviewer <Panel_PC_IP>:5900
# noVNC via controller web interface (if available)
http://<CP1584_IP>/vnc.html
VNC Configuration Notes:
- VNC is available on B&R Panel PCs and Automation PCs (APC series) — not on headless CPUs like the CP1584
- On the CP1584 specifically, the VNC server is part of the VNC Component in Automation Studio (Visualisierung > VNC) and requires it to be configured in the project
- Default VNC password: typically blank (no password) on older systems; configured in the VNC component settings
- Security warning: VNC traffic is unencrypted by default. On plant networks, use a VPN or SSH tunnel, or disable VNC and use the web-based mapp View interface instead
- VNC performance depends on resolution, color depth, and network bandwidth. Reduce resolution on slow links (10 Mbps)
- Troubleshooting VNC failures: Check that the Panel PC’s VNC component is enabled in the project (look for
VncSrvin the task configuration via Automation Studio online view). If VNC doesn’t connect, check firewall rules and verify port 5900 is not blocked by the plant network
Alarm Handling: mapp AlarmX
mapp AlarmX is the integrated alarm management component for mapp View systems. It provides:
- Centralized alarm definition in the Automation Studio project
- Automatic alarm triggering when bound variables change state
- Historical alarm logging with timestamps and acknowledgment
- HMI integration via the
AlarmListwidget
Architecture
PLC Logic ──► mapp AlarmX Component ──► OPC UA FX ──► mapp View AlarmList Widget
│
├── Alarm Definitions (.alarmx file)
├── Alarm Groups (Machine, Safety, Process...)
├── Severity Levels (Info, Warning, Error, Fatal)
└── Alarm Logging (to SD card / internal flash)
Alarm Configuration File Structure
// In the Automation Studio project: Logical/mappAlarmX/
AlarmGroups.config → Group definitions
AlarmInstances.config → Which variables trigger which alarms
AlarmParameters.config → Thresholds, delays, severity mapping
Accessing Alarms Without the Project
# Via OPC UA:
Browse to: Objects → Data → AlarmX → ActiveAlarms
# Key variables exposed via OPC UA FX:
AlarmX.nActiveAlarmCount → Number of currently active alarms
AlarmX.aActiveAlarms[0..N] → Array of active alarm structures
.sText → Alarm description
.nCode → Alarm code number
.eSeverity → Severity level
.tOccurrence → First occurrence timestamp
.tAcknowledged → Acknowledgment timestamp (0 if unack'd)
# Via Automation Runtime console (if SSH access):
# Alarm log files are typically stored at:
/flash/alarmlog/
/flash/UserProject/Log/
See also: alarm-logging.md for detailed alarm logging analysis and recovery procedures.
Diagnosing HMI Issues on an Undocumented Machine
Symptom: HMI Screen Blank or Not Loading
CHECKLIST:
□ Ping the controller IP from a PC on the same network
→ If unreachable: network/cable/switch issue — not HMI
□ Open browser → http://<CP1584_IP>
→ If browser shows connection refused: mapp View service not running
→ If browser shows login page: HMI is working, check credentials
□ If nothing loads on port 80, check port 443 (HTTPS):
→ Some systems force HTTPS only
□ Check if controller is in RUN mode:
→ Via Automation Studio "Online" → "Show Status"
→ Or via the physical controller status LED
□ SSH/FTP into controller and check mapp View process:
ps aux | grep -i mapp
# Or check the web server status
ps aux | grep -i httpd
Symptom: HMI Shows Values But They’re Wrong/Stale
DIAGNOSIS:
1. Connect OPC UA client (UAExpert) to opc.tcp://<CP1584_IP>:4840
2. Browse to the same variables shown on the HMI
3. Compare OPC UA values with HMI displayed values
4. If OPC UA values are correct but HMI is wrong:
→ .data binding file has wrong variable mapping
→ Rebuild .data file with correct PLC variable references
5. If OPC UA values are also wrong:
→ PLC program issue, not HMI
→ See [execution-model.md](./execution-model.md) for PLC diagnostics
Symptom: Alarms Not Appearing on HMI
DIAGNOSIS:
1. Check OPC UA FX → AlarmX node → are alarms present in the namespace?
→ If yes but not showing on HMI: AlarmList widget misconfigured or page not visible
→ If no: mapp AlarmX component not running or not configured
2. Check if mapp AlarmX is in the software object list:
→ Automation Studio → Online → Software Objects
→ Look for "mpAlarmX" or "mappAlarmX" in the running components
3. Force an alarm condition:
→ Write to the alarm trigger variable via OPC UA client
→ Does it appear in the AlarmX OPC UA node?
→ Does it appear on the HMI?
Symptom: Can’t Log In / “Access Denied”
DIAGNOSIS:
1. Default credentials on many B&R systems:
Username: administrator (or admin)
Password: (blank or "admin" — varies by firmware)
2. If credentials are unknown and there's no documentation:
→ You will need Automation Studio to "Upload from Target" and read the
Roles.config and Clients.config files
→ Or access the controller filesystem and read the config files directly
3. Factory reset (LAST RESORT):
→ Automation Studio → Online → Initialize Target
→ WARNING: This erases ALL configuration including PLC program
Recovering the HMI Project Without OEM Files
Step 1: Upload from Target
This is the primary recovery method for any undocumented B&R system.
Automation Studio:
1. File → New → Project from Target
2. Enter controller IP: <CP1584_IP>
3. Project name: Recovery_CP1584_<serial>
4. Select target hardware (Automation Studio will auto-detect)
5. Configure upload scope:
☑ Hardware configuration
☑ Software configuration (mapp components)
☑ Global variable declarations
☑ File system contents (this captures mapp View files)
☐ Source code (only compiled objects will be available)
6. Wait for upload (can take 10-30 minutes for large projects)
7. Save the recovered project as .apj
Step 2: Analyze Recovered mapp View Files
After upload, inspect the recovered project structure:
Logical/
└── mappView/
├── Pages/ ← .page files (XML format, human-readable)
├── Widgets/ ← .widget files (XML format)
├── Data/ ← .data files (variable bindings — CRITICAL)
├── Config/ ← Roles, clients, display settings
└── Styles/ ← CSS overrides
Critical files to examine:
| File | What it tells you |
|---|---|
mappViewData.data | Every variable binding between HMI and PLC |
Roles.config | User roles and access permissions |
Clients.config | Connected display clients and their properties |
*.page files | What screens exist and what widgets are on each |
*.config in mappAlarmX/ | Alarm definitions and trigger conditions |
Step 3: Reverse-Engineer Variable Mapping
1. Open mappViewData.data
2. Map each HMI binding to the PLC variable namespace:
"Content.Main.Motor1Speed.Value" → "Data.Global.gMotor[1].fSpeed"
→ This tells you PLC variable: Main.gMotor[1].fSpeed
3. Cross-reference with the global variable declarations:
→ Find Main.gMotor data type
→ Find ST_Motor structure definition
→ Now you know every motor parameter available
Step 4: Export for Documentation
# Convert recovered .page files to documentation:
# .page files are XML — parse them to extract:
# - Page names (screen list)
# - Widget types per page
# - Variable bindings per widget
# - Text strings (process descriptions, labels)
# Example: parse a .page file
xmllint --format Main.page | grep -E '(widget|binding|text)'
What You CANNOT Recover
| Item | Reason | Workaround |
|---|---|---|
| PLC source code (ST/SFC/CFC text) | Only compiled object code is on the controller | Use decompiler (limited) or rewrite from observed behavior |
| Comments in PLC code | Stripped during compilation | Document from reverse-engineering the logic |
| Original variable names (if optimized away) | Compiler may rename variables | Use runtime names from OPC UA namespace |
| Password-protected mapp View configs | Encryption on the controller | Need to reconfigure from scratch |
Panel Replacement Procedure (CP1584 Context)
Scenario: Panel PC Failed, Need to Replace
On B&R systems, the “HMI panel” is typically one of:
- A dedicated B&R Power Panel with built-in controller (your machine has a CP1584, which IS the controller — so the panel is likely a separate display)
- A B&R Panel PC connected to the CP1584 via Ethernet, running mapp View in a fullscreen browser
- A third-party display accessing mapp View via web browser
Replacing a B&R Panel PC
PREREQUISITES:
□ New panel PC with B&R Automation Runtime installed (or standard Windows/Linux)
□ IP address of the CP1584 controller
□ Network configuration (subnet, gateway)
□ Any role/client configuration needed for this panel
PROCEDURE:
1. Physically install the new panel:
→ Mount in existing cutout / VESA mount
→ Connect power
→ Connect Ethernet to the same switch as CP1584
2. Configure network on new panel:
→ Static IP on same subnet as CP1584
→ Verify ping to CP1584
3. Launch the HMI runtime:
┌─ If B&R Panel PC with Automation Runtime:
│ → Automation Studio → Deployment → Deploy HMI Client
│ → Or: the panel auto-discovers the mapp View server via mDNS
│
└─ If standard PC / thin client:
→ Open browser: http://<CP1584_IP>
→ Set to fullscreen (F11)
→ Bookmark for automatic startup
4. Verify all screens load correctly
5. Test alarm acknowledgment from the new panel
6. Test user login/role assignment
Reconfiguring the HMI Client on the Controller
If the new panel has a different resolution or needs a different role assignment:
# Access the Clients.config via Automation Studio or FTP:
# Edit the client entry for the new panel:
<Client>
<Name>Panel_Line2</Name>
<IpAddress>192.168.1.50</IpAddress>
<DisplayResolution>1920x1080</DisplayResolution>
<Role>Operator</Role>
<AutoStartPage>Main</AutoStartPage>
</Client>
If There Is No Dedicated Panel (Headless Operation)
Some CP1584 machines run without any physical display — the HMI is accessed only via browser from a PC or tablet.
To verify the HMI is running on a headless machine:
1. Connect PC to same network
2. Open browser → http://<CP1584_IP>
3. If mapp View loads: HMI is running, no panel needed
4. If not: check if mapp View is enabled in the controller configuration
→ Automation Studio: mappView.config → Enabled = true
→ Also check: Configuration → mapp View → "Enable web server"
Multi-Client / Multi-User Setup
mapp View supports multiple simultaneous connections, each with independent state:
┌──────────┐
│ CP1584 │
│ mapp View│
│ Server │
└────┬─────┘
┌─────────────┼─────────────┐
│ │ │
┌─────▼─────┐ ┌────▼──────┐ ┌────▼──────┐
│ Operator │ │ Engineer │ │ Tablet │
│ Panel │ │ Laptop │ │ (remote) │
│ Role: Op │ │ Role: Eng │ │ Role: View│
└───────────┘ └───────────┘ └───────────┘
Role-Based Views
mapp View implements roles through the Roles.config file. Each role can have:
- Different available pages (Operator doesn’t see Engineering pages)
- Different widget visibility (some widgets hidden for certain roles)
- Different variable write permissions (View role = read-only)
- Different language settings
// Roles.config structure (simplified XML)
<Roles>
<Role name="Administrator">
<Pages>All</Pages>
<Permission>ReadWrite</Permission>
</Role>
<Role name="Operator">
<Pages>Main, Alarms, Recipe</Pages>
<Permission>ReadWrite</Permission>
<HiddenPages>Diagnostics, Network, System</HiddenPages>
</Role>
<Role name="Viewer">
<Pages>Main, Alarms</Pages>
<Permission>ReadOnly</Permission>
</Role>
</Roles>
Multi-Client Data Consistency
When multiple clients are connected:
- Read operations: Each client reads independently from the OPC UA FX namespace — no conflicts
- Write operations (e.g., button press to start machine): The first write wins. Multiple clients pressing “Start” simultaneously do not cause errors — the PLC logic handles the edge detection
- Alarm acknowledgment: Acknowledgment is tracked per-alarm, not per-client. If Client A acknowledges an alarm, Client B sees it as acknowledged
- Recipe changes: mapp View handles recipe editing with a “checkout” mechanism — only one client can edit a recipe at a time
Practical Code Examples
Reading HMI Variables via OPC UA (Python)
"""
Read live HMI variables from B&R CP1584 via OPC UA.
Requires: pip install opcua-asyncio
"""
import asyncio
from asyncua import Client
CONTROLLER_IP = "192.168.1.10"
PORT = 4840
ENDPOINT = f"opc.tcp://{CONTROLLER_IP}:{PORT}"
async def read_machine_status():
async with Client(url=ENDPOINT) as client:
await client.connect()
root = client.nodes.root
objects = await root.get_child(["0:Objects"])
data = await objects.get_child(["2:Data"])
global_vars = await data.get_child(["2:Global"])
machine_status = await global_vars.get_child(["2:gMachineStatus"])
state = await machine_status.get_child(["2:sCurrentState"]).get_value()
running = await machine_status.get_child(["2:bRunning"]).get_value()
error = await machine_status.get_child(["2:nErrorCode"]).get_value()
print(f"State: {state}")
print(f"Running: {running}")
print(f"Error Code: {error}")
await client.disconnect()
asyncio.run(read_machine_status())
Browsing the HMI Variable Namespace (Python)
"""
Recursively browse the OPC UA FX namespace on a B&R controller
to discover all HMI-accessible variables — useful for undocumented machines.
"""
import asyncio
from asyncua import Client
async def browse_namespace(node, indent=0):
children = await node.get_children()
for child in children:
name = (await child.get_browse_name()).Name
node_id = str(child.nodeid)
dtype = await child.get_data_type()
try:
value = await child.get_value()
value_str = f" = {value}"
except Exception:
value_str = ""
print(" " * indent + f"{name} [{dtype}]{value_str} ({node_id})")
await browse_namespace(child, indent + 1)
async def main():
async with Client(url="opc.tcp://192.168.1.10:4840") as client:
await client.connect()
print("=== B&R OPC UA FX Namespace ===\n")
objects = await client.nodes.objects.get_child(["2:Data"])
await browse_namespace(objects)
await client.disconnect()
asyncio.run(main())
Writing a Variable via OPC UA (Start/Stop Machine)
"""
Write a command to the PLC via OPC UA.
WARNING: Only use on a test machine or when you fully understand the system.
"""
import asyncio
from asyncua import Client
async def send_command():
async with Client(url="opc.tcp://192.168.1.10:4840") as client:
await client.connect()
cmd_node = await client.nodes.objects.get_child([
"2:Data", "2:Global", "2:gCommands", "2:bStart"
])
# Edge-triggered: write TRUE, then FALSE
await cmd_node.write_value(True)
print("Command START sent")
await asyncio.sleep(0.5)
await cmd_node.write_value(False)
print("Command START released")
await client.disconnect()
asyncio.run(send_command())
Reading Active Alarms via OPC UA (Python)
"""
Read active alarms from mapp AlarmX via OPC UA FX namespace.
"""
import asyncio
from asyncua import Client
async def read_alarms():
async with Client(url="opc.tcp://192.168.1.10:4840") as client:
await client.connect()
alarmx = await client.nodes.objects.get_child([
"2:Data", "2:AlarmX"
])
count = await (await alarmx.get_child(["2:nActiveAlarmCount"])).get_value()
print(f"Active alarms: {count}\n")
if count > 0:
alarms_node = await alarmx.get_child(["2:aActiveAlarms"])
alarms = await alarms_node.get_value()
for i, alarm in enumerate(alarms):
print(f" [{i}] Code: {alarm.nCode} "
f"Severity: {alarm.eSeverity} "
f"Text: {alarm.sText}")
await client.disconnect()
asyncio.run(read_alarms())
Checking mapp View Service Status
IMPORTANT: The CP1584 runs Automation Runtime (AR) on VxWorks — it does NOT provide SSH access or Linux-style process management. You cannot SSH into the controller, run
ps,systemctl, ornetstatcommands. The correct approaches for checking mapp View status on a CP1584:
Via SDM (System Diagnostics Manager):
- Open a web browser to
http://<CP1584_IP>/SDM - Navigate to the Overview tab — check web server status
- Navigate to the Task Monitor tab — look for the HTTP/WebServer task
- Navigate to the Logger tab — check for web server errors
Via Automation Studio:
- Connect to the controller via Online > Login
- Open Diagnostics > Task Monitor — check HTTP server task status and cycle times
- Open Diagnostics > System Diagnostics Manager (SDM) > Diagnostics > Software Modules
Via OPC UA:
- Connect an OPC UA client to
opc.tcp://<CP1584_IP>:4840 - Browse to the SDM namespace for web server health indicators
Via SNMP:
snmpwalk -v1 -c public <CP1584_IP> 1.3.6.1.4.1.2706.1
See diagnostics-sdm.md for full SDM usage details.
Extracting HMI Pages from Controller via FTP
# FTP into controller (NOT SSH — CP1584 has no SSH)
ftp <CP1584_IP>
# Navigate to mapp View files on the user partition
cd F:\mappView
# or
cd F:\UserProject\mappView
# Download all HMI definition files
lcd /local/backup/
cd Pages
mget *.page
cd ../Widgets
mget *.widget
cd ../Data
mget *.data
cd ../Config
mget *.config
# .page and .widget files are XML — parseable:
# xmllint --format Main.page | head -50
NOTE: The B&R AR filesystem uses
C:\(system) andF:\(user/application) partition notation. These are NOT Windows paths — they are VxWorks device mounts that appear as drive letters. The FTP server exposes them in this format.
Key Findings
-
mapp View is a web server inside the controller — the HMI is not a separate program. It serves HTML5/CSS3/JavaScript pages over HTTP/HTTPS from the controller itself.
-
All data flows through OPC UA FX — there is no direct PLC memory access from the HMI. Every value displayed or entered on the HMI passes through the OPC UA FX information model on port 4840.
-
HMI and control logic are fully decoupled — the PLC program has zero knowledge of the HMI. The HMI has zero knowledge of PLC program structure. This separation is enforced through the three-layer model (content, layout, logic) and the
.databinding file indirection. -
On undocumented machines, upload from target is your primary recovery tool — Automation Studio can upload the hardware config, software object list, global variables, mapp component configurations, and deployed filesystem contents. Source code cannot be recovered.
-
The
.datafile is the most important file — it maps every HMI element to every PLC variable. Losing it means you must reverse-engineer every variable binding by comparing what the HMI shows against what OPC UA exposes. -
Panel replacement does not require PLC changes — because the HMI is web-based, replacing a panel is purely a network/browser configuration task. No PLC reprogramming is needed.
-
Legacy POWER WORX systems used direct memory mapping — unlike OPC UA FX, POWER WORX read/wrote PLC memory directly. If you encounter this on a CP1584, it indicates a bridged legacy display connection via the PVI library.
-
VNC is display-only — VNC mirrors what a connected Panel PC shows. It cannot be used to interact with the mapp View server directly. For full remote access, use a web browser.
-
Alarm handling is fully integrated — mapp AlarmX exposes active alarms, history, and acknowledgment status through the OPC UA FX namespace. The
AlarmListwidget on the HMI subscribes to this data automatically. -
Role-based access is configured in Roles.config — without the OEM project, you may need to upload from target to discover role definitions. Default credentials vary by firmware version.
Cross-References
| Related Document | Content | Relevance |
|---|---|---|
| firmware.md | B&R firmware versions, update procedures, compatibility | mapp View features vary by firmware version; some features require minimum firmware levels |
| opcua.md | OPC UA server configuration, security setup, namespace browsing | mapp View data exchange is entirely OPC UA FX-based; understanding OPC UA is essential for HMI diagnostics |
| execution-model.md | PLC task configuration, cycle times, program execution order | HMI responsiveness depends on PLC cycle time and task priorities; stale HMI values may indicate PLC execution issues |
| alarm-logging.md | Alarm history analysis, log file formats, recovery | mapp AlarmX logs are written to the controller filesystem; alarm logging details complement the HMI alarm display |
| ftp-web-interface.md | FTP access, web server configuration, file download | FTP is the primary method for extracting mapp View files from the CP1584 without Automation Studio |
| pvi-api.md | PVI middleware, variable access, programmatic connections | PVI is the underlying communication layer for POWER WORX legacy HMI connections |
| diagnostics-sdm.md | System Diagnostics Manager, web-based diagnostics | SDM provides web server status, task monitoring, and system health for diagnosing HMI service issues |
| access-recovery.md | Password recovery, credential discovery | Default credentials for FTP/web/SDM access when OEM passwords are unknown |
| python-diagnostics.md | Python scripts for PLC communication | Python OPC UA clients for programmatic HMI data extraction and testing |
| network-architecture.md | Network topology, device discovery, VLAN segmentation | HMI panel connectivity and VNC performance depend on network architecture |
Document generated from reverse-engineering research on undocumented B&R CP1584 systems. All procedures should be validated on a test system before applying to production equipment.
B&R System Diagnostics Manager (SDM) & Automation Studio Diagnostics
Target audience: Automation engineers maintaining undocumented B&R CP1584 machines with zero OEM documentation. This guide covers how to access, configure, and use SDM and Automation Studio diagnostic tools to troubleshoot and understand a B&R controller you did not originally program.
1. Overview
B&R System Diagnostics Manager (SDM) is a built-in diagnostic web interface available in Automation Runtime V3.0 and higher. It provides browser-based access to the controller’s internal state—CPU load, memory usage, task execution, I/O module health, and the system logbook—without requiring Automation Studio, a project file, or any OEM documentation.
For CP1584 machines where no project exists in your archive, SDM is often the first and only tool you have to understand what the controller is doing, why it may have stopped, and what hardware is actually installed.
SDM is complemented by Automation Studio’s Logger tool, which can import system dump files (.tar.gz) exported from SDM for deeper offline analysis.
2. Prerequisites & Configuration
2.1 What Must Be Enabled on the Controller
SDM does not work out of the box on every B&R controller. Two services must be enabled in the Automation Runtime configuration:
| Setting | Location | Required Value |
|---|---|---|
| Web Server | Automation Studio → System → Configuration → Web Server | Enabled |
| SDM | Automation Studio → System → Configuration → SDM | Enabled |
If you have no project file (common when inheriting undocumented machines), you cannot change these settings via Automation Studio. Options:
- Check if SDM is already running — open
http://<PLC_IP>/sdmin a browser. If it loads, you’re good. - Use Automation Studio’s “Upload from PLC” — connect to the PLC IP, upload the configuration, enable web server and SDM, then download. This requires at minimum a compatible Automation Studio version matching the runtime on the target.
- Default configuration — many B&R default configurations ship with the web server enabled. SDM is not always enabled by default on older images.
2.2 Network Access
SDM communicates over HTTP (not HTTPS by default). Ensure:
- The PLC IP is reachable from your workstation (ping test).
- Port 80 is open on the PLC (standard HTTP).
- For remote/internet access, a VPN or port-forward must be configured — SDM has no built-in authentication mechanism in older versions. Treat exposed SDM interfaces as sensitive.
3. Accessing SDM
3.1 Web Browser Access
Open any standard web browser and navigate to:
http://<PLC_IP>/sdm
For example, if the CP1584 has IP 192.168.1.10:
http://192.168.1.10/sdm
No installation, no plugins, no Java required. SDM renders a standard HTML interface.
3.2 Access Without Project Files
This is the critical advantage of SDM for undocumented machine scenarios:
- You do not need Automation Studio installed.
- You do not need the OEM project file or source code.
- You do not need to know the PLC’s configuration.
- You only need the PLC’s IP address and network connectivity.
SDM reads directly from the controller’s runtime, showing you the live state of the system as it runs.
3.3 Remote / Internet Access
Because SDM is web-based, it can be accessed from any location—intranet or internet—provided network routing is in place. This is useful for:
- Remote troubleshooting of field machines.
- Monitoring a line of machines from a central engineering office.
- Supporting multiple plants without traveling.
4. SDM Interface — Sections & What They Show
4.1 System Logbook
The System Logbook (also called Event Log or System Log) is a chronological record of system events recorded during:
- Startup — boot sequence, module initialization, firmware loading, configuration application.
- Runtime operation — warnings, errors, state changes, communication events, module insertion/removal (if hot-swappable).
Logbook entries include:
- Timestamp (controller time)
- Event class (Info, Warning, Error, Fatal)
- Event ID / error code
- Source module (which hardware or software component generated the event)
- Description text
The logbook is the primary tool for understanding why a controller went into Error or Stop state. Always check it first after a fault.
4.2 CPU Usage
SDM displays the current CPU utilization of the controller as a percentage. This shows:
- Overall CPU load across all tasks.
- Whether the controller is CPU-bound (sustained >80% is a concern).
- Spikes that correlate with specific events (e.g., cyclic communication timeout causing retry storms).
4.3 Task Monitor
The Task Monitor is one of the most valuable SDM sections. It shows every cyclic task configured on the controller with:
| Column | Description |
|---|---|
| Task Name | The configured task identifier (e.g., Cyclic#1, Cyclic#2, Timer) |
| Cycle Time (current) | Most recent cycle execution time |
| Cycle time (min) | Minimum observed cycle time |
| Cycle time (max) | Maximum observed cycle time |
| Cycle time (avg) | Average cycle time |
| Task Load | Percentage of CPU time consumed by this task |
| Priority | Task priority level |
| State | Running, Waiting, Error, etc. |
What to look for:
- A task with a max cycle time approaching its configured watchdog limit → imminent watchdog trip.
- A task showing error state → that task has crashed or is stuck.
- High task load on a low-priority task stealing time from critical I/O tasks.
4.4 Memory Information
SDM shows memory usage broken down into:
- User memory — how much of the available user RAM is allocated.
- System memory — memory used by the operating system and runtime.
- File system — usage on the onboard file system (if applicable).
Memory exhaustion can cause subtle failures (task not starting, unable to allocate buffers) before any explicit error is raised.
4.5 I/O Module Status
SDM lists all I/O modules detected in the controller’s hardware tree with:
- Module type and identifier.
- Slot/bus position.
- Status — OK, Error, Not responding, Initializing.
- Module firmware version.
This is critical on undocumented machines because it reveals the actual hardware configuration without needing the project file. You can use this to reconstruct a hardware overview of the machine.
5. System Dump Files
5.1 What Is a System Dump
A system dump is a snapshot of the controller’s entire diagnostic state, packaged as a .tar.gz archive. It contains:
- Hardware information — controller type, serial number, firmware version, module inventory.
- System logbook entries — all recorded events up to the moment of the dump.
- Diagnostic data — task states, memory maps, I/O status, error registers.
- Configuration snapshot — relevant runtime configuration parameters.
System dumps are created on the controller via SDM and then downloaded to your PC for offline analysis in Automation Studio.
5.2 Creating a System Dump in SDM
- Navigate to
http://<PLC_IP>/sdm. - Locate the System Dump or Create Dump section.
- Click Create or Generate.
- Wait for the controller to collect and package the data (can take 30 seconds to several minutes depending on system complexity).
- Download the resulting
.tar.gzfile to your workstation.
The dump is created from the controller’s current state. If the controller is in Error/Stop, create the dump before cycling power—the dump captures the fault state, which is what you need to analyze.
5.3 Opening System Dumps in Automation Studio
To analyze a system dump file in Automation Studio’s Logger:
- Open Automation Studio.
- Open or create a project — the Logger tool requires at least a project to be open. If you do not have the real project, create a dummy project (any valid B&R project with the same or similar controller target). The Logger uses the project context only as a container; it reads the dump data from the file itself.
- Workaround: Create a new project, add a single controller of the same type as the PLC (e.g., CP1584), and save it. This is enough.
- Open the Logger — use Ctrl+L or go to Tools → Logger.
- In the Logger, click Load Data (or File → Load Data).
- Navigate to the
.tar.gzsystem dump file and open it. - The Logger will parse the dump and display all contained diagnostic data.
5.4 Limitations of Logger with Dummy Projects
When using a dummy project to analyze a dump from an unknown machine:
- Hardware tree mismatch — the dummy project won’t match the real hardware. Logger may show some modules as “unknown.” This is acceptable; the logbook and diagnostic data are still fully readable.
- No variable cross-reference — without the real project’s variable declarations, Logger cannot resolve variable names in the dump’s memory snapshots. You see raw addresses, not symbolic names.
- No source-level debugging — Logger shows diagnostic data, not source code. To trace logic, you still need the actual project.
Despite these limitations, the logbook data, error codes, and task state information alone are often enough to diagnose the root cause of a fault.
6. Common Error Codes
The following error codes are frequently encountered in B&R CP1584 and similar controllers. They appear in the SDM System Logbook and in Automation Studio diagnostics.
| Error Code | Severity | Description | Typical Cause | Recommended Action |
|---|---|---|---|---|
| 8021 | Error | Configuration error / invalid configuration | Missing or corrupt configuration on controller | Re-upload configuration via Automation Studio; check if SDM/config files are intact |
| 8099 | Error | General system error / unspecified fault | Various — check logbook for surrounding entries for context | Review full logbook around the 8099 timestamp; look for preceding warnings |
| 9204 | Fatal | Temperature shutdown — controller exceeded safe operating temperature | Blocked ventilation, failed fan, ambient temperature too high, high CPU load generating excess heat | Immediately check cooling/ventilation; reduce CPU load if possible; let controller cool before restart; inspect fan operation |
| 9206 | Error | Hardware fault / module error | I/O module failure, bus communication failure, module not responding | Check I/O module status in SDM; reseat modules; inspect bus cables; check for loose connections |
| 9210 | Fatal | Watchdog timeout / system reset — a task exceeded its maximum cycle time | Task stuck in infinite loop, blocking I/O call, excessive interrupt load, communication timeout | Check Task Monitor for which task is near/exceeding its limit; review that task’s code (if project is available); check for communication timeouts (PVI, fieldbus) |
| 9212 | Error | Memory error / insufficient memory | Memory allocation failure, buffer overflow, too many instances | Check Memory Information in SDM; reduce dynamic allocations; check for memory leaks in user program |
| 9214 | Error | Communication error / connection lost | Lost connection to upstream/downstream device, network cable issue, protocol mismatch | Check network cables; verify IP configuration; check ANSL connection (port 11169); verify PVI connection parameters |
Error Code Investigation Procedure
- Note the error code and timestamp from the SDM logbook.
- Look at 5-10 entries before the error — preceding warnings often indicate the root cause (e.g., a communication timeout followed by a watchdog trip).
- Look at entries after the error — does the controller recover, or does it go to Stop?
- Cross-reference the error code in the table above.
- If the error is recurring, download a system dump and analyze in Automation Studio Logger.
7. ANSL Communication (PVI Port)
7.1 ANSL TCP Port
B&R controllers use the ANSL (Automation Network Service Layer) protocol for PVI (Process Visualization Interface) and automation communication. The default TCP port is 11169.
This port is used by:
- Automation Studio to connect to the PLC for programming, debugging, and configuration.
- PVI-based HMI applications (e.g., VNC, Panel Builder, custom SCADA) to exchange data with the PLC.
- OPC UA and other higher-level protocols that run on top of PVI.
7.2 Port Accessibility
- Ensure port 11169 is reachable from your Automation Studio workstation (test with
telnet <PLC_IP> 11169or a similar tool). - Firewalls between your PC and the PLC must allow TCP/11169.
- If Automation Studio cannot connect to the PLC but SDM (port 80) works, the ANSL port may be blocked or the PVI service may not be running.
7.3 Troubleshooting Connection Issues
| Symptom | Possible Cause | Check |
|---|---|---|
| Automation Studio cannot discover PLC | ANSL port blocked | telnet <PLC_IP> 11169 |
| SDM works but AS cannot connect | PVI service disabled | Check AR configuration; ensure PVI/ANSL is enabled |
| Connection drops intermittently | Network issue / switch problem | Check cables, switch ports, network load |
| “Unknown target” in AS | Controller type mismatch | Ensure AS version matches runtime; correct target type selected |
8. Practical Procedures for Undocumented Machines
8.1 First Contact — What to Do When You Have No Documentation
-
Find the PLC IP address.
- Check the machine’s network switch/router for B&R MAC addresses (OUI: 00:0C:CD or similar).
- Use B&R IP Address Finder tool (part of Automation Studio installation) to scan the subnet.
- Check if a label on the controller shows an IP (common on well-maintained machines).
- Try common B&R defaults:
192.168.1.10,192.168.0.10.
-
Open SDM in a browser.
- Navigate to
http://<PLC_IP>/sdm. - If SDM loads, proceed. If not, try enabling it via Automation Studio (see Section 2.1).
- Navigate to
-
Record the hardware configuration.
- In SDM, go to I/O Module Status.
- Document every module: type, slot, status, firmware version.
- This becomes your hardware reference.
-
Download and review the System Logbook.
- Look for recurring errors.
- Note the controller firmware version (shown in SDM header or hardware info).
- Check if the controller is in Run, Error, or Stop state.
-
Create a system dump.
- Download the
.tar.gzfile. - Open it in Automation Studio Logger (Ctrl+L → Load Data).
- Review all diagnostic data offline.
- Download the
-
Attempt to upload the configuration.
- In Automation Studio, use Online → Upload to pull the configuration from the PLC.
- This gives you the configuration (hardware tree, task structure, network settings) without the source code.
- Upload does not give you the PLC program logic, but it gives you the project skeleton.
8.2 Routine Health Check Procedure
For machines you maintain but did not program, perform these checks periodically:
- Open SDM → System Logbook — scan for new warnings/errors since last check.
- Task Monitor — verify no task is approaching its watchdog limit; check for any task in Error state.
- CPU Usage — ensure not consistently above 80%.
- Memory Information — ensure not above 90% (leave headroom for peak operation).
- I/O Module Status — verify all modules show OK.
- If anything looks off, create a system dump before the situation degrades.
8.3 Post-Fault Investigation Procedure
- Do not cycle power yet. The fault state contains diagnostic information.
- Open SDM → System Logbook — read the last 20+ entries to understand the fault sequence.
- Create a system dump immediately — this captures the fault state.
- Task Monitor — check if any task is in Error or has an extreme max cycle time.
- I/O Module Status — check if any module is in Error or Not Responding.
- Download the dump and analyze in Automation Studio Logger.
- Cross-reference error codes with the table in Section 6.
- Only after gathering all diagnostic information, address the root cause and restart the controller.
9. SDM Advanced Features
9.1 Alarm Visualization
SDM provides an alarm overview section that aggregates active alarms and warnings from the system logbook. On newer AR versions (V4.0+):
- Active alarm count — grouped by severity (Warning, Error, Fatal).
- Alarm list — each row shows timestamp, alarm class, alarm ID, source module, and description. Clicking may reveal additional detail on some versions.
- Alarm acknowledgment — newer versions allow acknowledging alarms from the web interface, clearing them from the active display (does not fix the underlying cause).
- Historical alarm filter — some versions include date/time range and severity filters.
On CP1584 controllers running older AR versions (V3.x), the alarm view is typically limited to a simple scrolling list of the most recent logbook entries with no filtering or acknowledgment capability.
9.2 Trending and Graphing Capabilities
SDM does not include built-in trending. Workarounds: programmatic polling with time-series storage (Section 10), B&R mapp View widget trends, Automation Studio Watch/Trace, or OPC-UA subscriptions to external tools like Grafana.
9.3 Firmware and Software Version Display
SDM shows key identifiers in the hardware information area:
| Field | Description |
|---|---|
| Automation Runtime version | AR version (e.g., V4.12, V4.73). Determines feature availability. |
| Target type | Controller model (e.g., CP1584, CP1585). |
| Serial number | Hardware serial of the controller. |
| Hardware revision | PCB revision level. |
| System software version | Additional software component versions. |
| Module firmware versions | Firmware of each I/O module (shown in I/O Module Status). |
This information determines whether a specific SDM feature is available, whether firmware updates are needed, and which Automation Studio version is required to connect.
9.4 SDM Access via HTTPS (Newer AR Versions)
Starting with Automation Runtime V4.0, the B&R web server supports HTTPS:
https://<PLC_IP>/sdm
Requirements and notes:
- TLS certificate — controller ships with a self-signed certificate (browsers show a security warning). CA-signed certificates can be uploaded via Automation Studio.
- Must be explicitly enabled in AR configuration under System → Configuration → Web Server. Not enabled by default.
- Port — HTTPS typically uses 443, configurable in web server settings.
- HTTP redirect — some versions can redirect HTTP (port 80) to HTTPS (port 443).
For undocumented machines, try HTTP first (http://<PLC_IP>/sdm). If it fails, try HTTPS. If both fail, the web server or SDM may not be enabled.
9.5 SDM REST API for Programmatic Access
Newer Automation Runtime versions (V4.50+) expose a limited REST-like interface alongside the SDM web pages. This is not a fully documented public API, but the following endpoints are observable on V4.x controllers:
| Endpoint | Method | Description |
|---|---|---|
/sdm/api/system/info | GET | Controller type, AR version, serial number, uptime |
/sdm/api/taskmonitor | GET | Task monitor data (names, cycle times, states) |
/sdm/api/memory | GET | Memory usage breakdown |
/sdm/api/logbook | GET | Recent logbook entries; supports ?count=N and ?severity=Error |
/sdm/api/modules | GET | I/O module status list |
/sdm/api/dump | POST | Triggers system dump creation |
Caveats: these endpoints are not officially documented and may change between firmware versions. On V3.x they generally do not exist. No auth on older firmware; newer may require credentials. Probe http://<PLC_IP>/sdm/api/system/info with curl to test.
9.6 SDM User Authentication
Starting with Automation Runtime V4.20, SDM supports optional user authentication:
- Username/password login — credentials managed in AR configuration under System → Configuration → Users.
- Default credentials — many controllers ship with a default admin account. Check default settings or machine documentation.
- Role-based access — users can be assigned roles limiting access to certain SDM sections.
- Anonymous access — on controllers where authentication is not configured, SDM remains open. Default on older firmware.
If you encounter a login prompt without credentials, check with the previous maintainer or OEM. Authentication cannot be bypassed via the web interface.
9.7 SDM System Configuration Display
SDM includes a read-only view of system configuration parameters. Typically visible:
- Network configuration — IP address, subnet mask, gateway, DNS servers, hostname.
- Time synchronization — SNTP/NTP server settings, current time, timezone offset.
- Communication settings — ANSL port, OPC-UA endpoint, POWERLINK settings.
- Task configuration — task names, configured cycle times, watchdog limits.
- File system paths — default directories for logs, configuration, user data on CF card.
This read-only view is valuable for undocumented machines as it reveals operational settings without needing the project file. Not all parameters are visible through SDM — some are only accessible via Automation Studio.
9.8 SDM File Browser
On controllers with CompactFlash storage, some SDM versions include a file browser for viewing and downloading files:
- System log files — text log files written by the runtime.
- Configuration files —
.cfg,.xmlconfiguration files on the CF card. - User files — files placed on the CF card by the application or user.
- System dump files — previously created dumps stored on the controller.
Limitations: availability depends on AR version and web server configuration. Upload and deletion are typically not available — this is a read-only interface. Large files or deep directory trees may cause slow rendering or timeouts.
10. Programmatic SDM Data Access
10.1 Python Script to Scrape SDM Web Pages
For controllers running AR V3.x where no REST API exists, the HTML pages served by SDM can be parsed programmatically using requests and BeautifulSoup (pip install requests beautifulsoup4):
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import json
PLC_IP = "192.168.1.10"
SDM_BASE = f"http://{PLC_IP}/sdm"
def get_sdm_page(path):
url = f"{SDM_BASE}/{path}"
resp = requests.get(url, timeout=10)
resp.raise_for_status()
return resp.text
def parse_task_monitor(html):
soup = BeautifulSoup(html, "html.parser")
table = soup.find("table")
if not table:
return []
headers = [th.get_text(strip=True) for th in table.find_all("th")]
tasks = []
for row in table.find_all("tr")[1:]:
cells = [td.get_text(strip=True) for td in row.find_all("td")]
if len(cells) == len(headers):
tasks.append(dict(zip(headers, cells)))
return tasks
snapshot = {
"timestamp": datetime.utcnow().isoformat() + "Z",
"tasks": parse_task_monitor(get_sdm_page("taskmonitor")),
}
print(json.dumps(snapshot, indent=2, default=str))
Important notes:
- The URL paths (
/sdm/cpu,/sdm/taskmonitor,/sdm/memory) are illustrative. Actual paths vary by AR version. Inspect the SDM page source in a browser to determine correct paths for your controller. - Table structures in the SDM HTML change between firmware versions. Adjust the parsing logic accordingly.
10.2 Parsing the SDM HTML Interface Programmatically
The SDM interface is standard server-rendered HTML. To parse any SDM page:
- Inspect page source in your browser (F12 developer tools) to find
<table>elements containing target data. - Handle pagination — some pages paginate with URL parameters (e.g.,
?page=2&count=50). Loop through pages to collect all entries. - Handle frame-based layouts — older SDM versions use HTML framesets. Fetch frame URLs individually by inspecting
<frame src="...">attributes. - Character encoding — controllers may serve ISO-8859-1 or UTF-8. Check the
Content-Typeheader or setresp.encodingexplicitly.
10.3 Using Requests + BeautifulSoup to Extract Task Monitor Data
The task monitor page is the most useful data to scrape. Key considerations:
- Refresh rate — SDM shows snapshots. Poll every 30-60 seconds.
- Max cycle time — running maximum since last restart. A sudden jump between polls indicates a recent anomaly.
- Task state changes — transition from “Running” to “Error”/“Waiting” is an immediate alert.
- Watchdog proximity — ratio of max cycle time to watchdog limit. Above 80%: warning; above 95%: critical.
10.4 Using SDM Data in Automated Monitoring Systems
SDM data can be integrated into monitoring tools: write a Prometheus exporter for Grafana dashboards, a Nagios/Icinga check plugin, use Telegraf’s http_json/exec plugins, or publish to MQTT for Node-RED subscribers. Key considerations: rate-limit polling (CP1584 web server has limited capacity), cache if multiple consumers need data, handle reboots gracefully, and track uptime to detect unexpected restarts.
11. System Dump Deep Dive
11.1 What Is Inside the .tar.gz File
A system dump .tar.gz archive typically contains:
system_dump/
info/
hardware.txt, software.txt, configuration.txt, network.txt
log/
logbook.txt, logbook_alarms.txt
diagnostic/
tasks.txt, memory.txt, io_status.txt, cpu.txt
trace/
cyclic_trace_*.dat, bus_trace_*.dat (binary)
files/
*.cfg, *.xml (config snapshots)
runtime/
global_vars.bin, task_stacks.bin (binary)
Exact contents vary by AR version and controller type. Trace and runtime sections may be empty if no tracing was configured. The info/ and log/ directories are always present.
11.2 Extracting and Examining Specific Dump Files Without Automation Studio
The .tar.gz archive is a standard tar+gzip file. No B&R software needed:
mkdir dump_extracted
tar xzf system_dump_20260710_143022.tar.gz -C dump_extracted
Key files to examine directly with any text editor:
info/hardware.txt— controller type, serial, AR version, hardware revision.log/logbook.txt— complete logbook; most immediately useful for fault analysis.diagnostic/tasks.txt— task cycle time statistics at dump time.diagnostic/io_status.txt— I/O module listing and status.diagnostic/memory.txt— memory usage at dump time.
Binary files (.dat, .bin) require Automation Studio Logger.
11.3 Log File Format Inside the Dump
The log/logbook.txt uses a structured text format:
[2026-07-10 14:30:22.123] [Error ] [9210] [TaskMonitor] Cyclic#1 exceeded watchdog limit (cycle=52.3ms, limit=50.0ms)
Field breakdown: Timestamp (YYYY-MM-DD HH:MM:SS.mmm, controller local time), Severity (Info/Warning/Error/Fatal), Event ID (numeric, matching Section 6 codes), Source (subsystem or module), Description (may include numeric values). Some entries have additional fields or multi-line descriptions, especially hardware fault events.
11.4 Configuration Snapshot Content
The info/configuration.txt file contains key-value pairs. Typical entries:
Controller Type: CP1584
Automation Runtime: V4.73
Uptime: 14d 06h 23m 11s
Network.IP: 192.168.1.10
ANSL.Port: 11169
OPC-UA.Enabled: true
WebServer.Enabled: true
SDM.Enabled: true
Powerlink.CycleTime: 1000us
This captures only operational parameters the diagnostic subsystem can read. For complete configuration (hardware tree, task mappings, variables), you need the project file.
11.5 Comparing Dumps Over Time (Diff Analysis)
When troubleshooting intermittent issues, comparing dumps from different time points reveals state changes:
diff -u dump_20260709/log/logbook.txt dump_20260710/log/logbook.txt
diff -u dump_20260709/diagnostic/tasks.txt dump_20260710/diagnostic/tasks.txt
diff -u dump_20260709/diagnostic/memory.txt dump_20260710/diagnostic/memory.txt
What to look for:
- New error entries — errors in the later dump indicate a developing fault.
- Memory growth — increasing user memory across dumps without a corresponding decrease suggests a memory leak.
- Max cycle time increase — a task’s max cycle time growing progressively indicates accumulating latency.
- Module status changes — a module going from OK to Error points to hardware degradation.
- Configuration changes — differences in
configuration.txtmean someone changed runtime settings between dumps.
11.6 Retention and Storage of Dumps for Compliance
For environments requiring diagnostic retention:
- Naming convention —
PLC01_CP1584_FAULT_20260710.tar.gz(machine ID, controller, reason, date). - Storage — network share alongside maintenance logs.
- Retention — at least warranty period or regulatory requirement (typically 2-5 years for ISO 9001).
- Metadata log — spreadsheet tracking date, machine ID, serial, AR version, reason, file location, analysis notes, root cause.
- Size — 5-50 MB compressed. Store compressed; dispose per data retention policy when expired.
11.7 System Dump via CLI: systemdump.py (Open Source)
The systemdump.py tool by the hilch community contributor automates system dump creation, upload, and inventory extraction from the command line — no browser or Automation Studio required.
Installation:
pip install systemdumpy
Creating, uploading, and saving a dump from CLI:
py -m systemdumpy 192.168.1.10 -cuv -p MyMachine_
Output:
create a systemdump on 192.168.1.10
upload systemdump from 192.168.1.10
saving MyMachine__BuR_SDM_Sysdump_2026-07-10_14-30-55.tar.gz (2820986) bytes
Flags:
| Flag | Action |
|---|---|
-c | Create a dump on the remote PLC |
-u | Upload/download the dump from PLC to local file |
-d | Delete the last dump from the PLC (free storage) |
-n | Create dump without data files (logger, NCT, profiler — smaller) |
-p PREFIX | Prepend a prefix to the output filename |
-i | Create an inventory list (.xlsx) from an existing dump file |
-v | Verbose output |
Batch automation example — dump all machines on a subnet:
for ip in 192.168.1.10 192.168.1.11 192.168.1.12; do
py -m systemdumpy "$ip" -cuv -p "$(hostname)_${ip}_" || echo "FAILED: $ip"
done
Creating hardware inventory from an existing dump file:
py -m systemdumpy BuR_SDM_Sysdump_2026-07-10_17-43-05.tar.gz -iv
This extracts all hardware module information (type, serial, firmware, status) into an .xlsx spreadsheet — invaluable for building spare parts inventories on undocumented machines. See spare-parts.md for the inventory methodology.
Viewing dumps without Automation Studio:
The SystemDumpViewer (GPL v3, desktop app) can open .tar.gz system dump files on any platform without Automation Studio installed. It displays hardware info, logbook, task timing, IO status, and memory data from the XML inside the archive.
12. AR Logbook Deep Analysis
12.1 Logbook Entry Format Details
The Automation Runtime system logbook records events in a structured format. Understanding the exact field layout is essential for programmatic parsing and filtering:
[YYYY-MM-DD HH:MM:SS.mmm] [Severity ] [EventID] [Source ] Description text
Severity levels in order of increasing criticality:
| Level | Meaning | Controller Response |
|---|---|---|
| Info | Informational (startup, normal state change) | Logged only. No action. |
| Warning | Non-critical anomaly | Logged. May trigger user alarm. Controller continues. |
| Error | Fault affecting a subsystem | Logged. Affected subsystem may halt. Other tasks continue. |
| Fatal | Critical fault requiring restart | Logged. Controller goes to Error/Stop state. Manual intervention required. |
Timestamps use the controller’s local time. If the clock is wrong (no SNTP sync, dead backup battery), timestamps will be offset from real time. Always verify time sync before relying on timestamps for forensic analysis.
12.2 Filter Patterns for Common Issues
When searching the logbook for specific problem categories:
Communication issues:
- Event IDs:
9214,5xxxrange. Sources:ANSL,PVI,Powerlink,EtherCAT,Modbus. - Descriptions:
timeout,connection lost,cable,retry.
Task/execution issues:
- Event IDs:
9210,5xxxrange. Sources:TaskMonitor,Cyclic,Timer. - Descriptions:
exceeded,watchdog,cycle time,overflow.
Hardware issues:
- Event IDs:
9204(temperature),9206(module fault). Sources:Hardware,I/O,Bus. - Descriptions:
temperature,fault,not responding,inserted,removed.
Memory issues:
- Event ID:
9212. Descriptions:memory,allocation,buffer,insufficient.
Startup issues:
- Severity
Fatalin the first 60 seconds after boot timestamps. - Descriptions:
configuration,firmware,initialization,boot.
12.3 Logbook Capacity and Rollover Behavior
The AR system logbook has finite capacity:
- Memory buffer — stored in a fixed-size memory buffer, typically 64 KB to 1 MB depending on controller and configuration.
- Ring buffer — when full, oldest entries are overwritten. No archive to non-volatile storage by default.
- Entry size — 80-200 bytes typical. A 512 KB buffer holds approximately 2,500-6,000 entries.
- Estimated capacity — moderate event activity retains 1-3 days; many warnings may only retain a few hours.
Implications:
- Dumps are essential for long-term analysis — the buffer rolls over, so creating a system dump is the only way to preserve data.
- After a fault, dump immediately — root-cause entries will eventually be pushed out by subsequent events.
- Logbook-to-file — AR V4.x can optionally write logbook entries to a file on the CF card (check AR configuration under System → Configuration → Logbook).
12.4 Exporting Logbook to CSV or Text
Via SDM file browser: navigate to logbook file (typically /log/logbook.txt on CF card) and download.
Via Automation Studio Logger: load dump or connect live, select Logbook view, use File → Export Data.
12.5 Correlating Logbook Entries with POWERLINK Events
On machines using POWERLINK as the fieldbus:
- POWERLINK cycle errors — logbook entries with source
Powerlinkor event IDs in the 6xxx range indicate fieldbus issues, correlating with I/O module status changes in SDM. - Timing correlation — a POWERLINK cycle error followed by a task watchdog timeout (event 9210) within the next few entries indicates the communication fault caused a task to block waiting for I/O data.
- Node-related events — POWERLINK entries referencing specific node numbers cross-reference to I/O modules in SDM to identify the affected physical module.
- Isochronous mode violations — entries mentioning
isochronousortiming violationindicate the network cycle was disrupted, potentially causing motion control or synchronized I/O errors.
For deeper POWERLINK analysis, the dump’s trace/cyclic_trace_*.dat files contain captured cycle data (requires Automation Studio Logger).
12.6 Logbook Retention Policy
| Scenario | Method | Duration |
|---|---|---|
| In-memory ring buffer (default) | Overwrites oldest entries | 1-3 days |
| Logbook to CF card file (V4.x) | Append to file | Weeks to months |
| System dump export | Static .tar.gz on PC | Permanent |
| External log collection | Programmatic scraping + storage | Configurable |
Recommended: configure logbook-to-file on CF card (if supported), create periodic system dumps, and use a Python scraper to capture entries to a central database.
12.7 Reading Logbook via OPC-UA or PVI
For controllers with OPC-UA enabled, logbook entries can be read programmatically:
- OPC-UA logbook node — under
Objects > System > Logbook, provides recent entries as an array. Subscribing gives near-real-time updates. - PVI logbook access — PVI provides a logbook object readable via the PVI .NET, C++, or Python API.
- Event subscriptions — OPC-UA event subscriptions push logbook events as they occur, eliminating polling. Server-side filtering by severity, source, and event ID is supported.
- Endpoint — typically
opc.tcp://<PLC_IP>:4840. Requires OPC-UA enabled in AR configuration and a user account with sufficient permissions.
13. SDM Configuration Without Automation Studio
13.1 Checking if SDM Is Enabled via FTP
When you cannot use Automation Studio, check SDM status by inspecting configuration files via FTP:
- Connect:
ftp <PLC_IP>(default credentials vary; common:admin/adminor no auth on older firmware). - Navigate to configuration directories (e.g.,
/System/Config/,/CF/). - Look for files controlling web server and SDM:
Config.ini(may contain[WebServer]withEnabled=1),SysConfig.xml(XML configuration),BRSystemConfig.cfg(B&R proprietary).
ftp 192.168.1.10
ftp> cd System/Config
ftp> get Config.ini
ftp> get SysConfig.xml
ftp> bye
13.2 Enabling SDM by Modifying Configuration on CF Card
If SDM is not enabled, it may be possible to enable it by modifying configuration files:
In Config.ini — add or modify:
[WebServer]
Enabled=1
Port=80
[SDM]
Enabled=1
In SysConfig.xml — set the enabled attribute:
<WebServer Enabled="true" Port="80">
<SDM Enabled="true" />
</WebServer>
After modification: upload the file via FTP, restart the controller (cold boot is most reliable), and verify at http://<PLC_IP>/sdm.
13.3 What Configuration Files Control SDM and Web Server
| File | Format | Controls | Location |
|---|---|---|---|
Config.ini | INI | Web server enable, port, SDM enable | /System/Config/ or CF root |
SysConfig.xml | XML | Web server, SDM, OPC-UA, network, time sync | /System/Config/ |
BRSystemConfig.cfg | B&R proprietary | System-wide config including web services | /System/ |
WebServer.cfg | B&R proprietary | Web server specific settings | /System/WebServer/ |
Exact file names and locations vary between AR versions. V3.x uses primarily .ini/.cfg; V4.x uses more XML. Inspect the file system via FTP to determine what is present.
13.4 Risks of Modifying Configuration Files Manually
Modifying configuration files directly on the CF card bypasses all validation that Automation Studio performs. Key risks:
- Syntax errors — an incorrectly formatted INI or XML file may cause the controller to fail to boot or refuse to start services.
- Encoding issues — configuration files must use ASCII or ISO-8859-1. Editing on Windows may introduce BOM markers or CRLF line endings the controller cannot parse.
- File permissions — modifying files via FTP may change permissions, preventing the runtime from reading them.
- No validation — invalid port numbers or misspelled settings are silently ignored or cause unpredictable behavior.
- Recovery difficulty — if the modified configuration prevents boot, recovery requires a known-good CF card image or Automation Studio (which may also fail to connect).
Mitigation: always back up the original file first, make one change at a time, keep a record of changes, and have a recovery plan (known-good CF card image or B&R support contact). Prefer Automation Studio’s “Upload from PLC, Modify, Download” workflow whenever possible.
14. Key Findings Summary
- SDM is built into Automation Runtime V3.0+ and requires no additional software to access.
- Web-based access at
http://<PLC_IP>/sdmfrom any browser — no project file, no Automation Studio, no documentation needed. - System logbook is the primary diagnostic tool for understanding controller faults.
- Task Monitor reveals task cycle times and loads — critical for diagnosing watchdog timeouts (error 9210).
- System dumps (
.tar.gz) can be exported from SDM and analyzed offline in Automation Studio Logger (Ctrl+L → Load Data). - Logger requires a project to be open — use a dummy project if the real project is unavailable.
- ANSL default port 11169 is required for Automation Studio and PVI communication — separate from SDM’s HTTP port 80.
- Common error codes include 8021 (config error), 8099 (general), 9204 (temperature shutdown), 9210 (watchdog/reset), and others documented in Section 6.
- Temperature shutdown (9204) is a critical physical fault — always check ventilation and cooling before restarting.
- SDM configuration (web server + SDM enabled) must be set in the AR configuration — if not already enabled on the target controller, you need Automation Studio to enable it.
15. Security Vulnerabilities in SDM
CVE-2025-3450 — SDM Denial-of-Service (Improper Resource Locking)
| Detail | Value |
|---|---|
| CVE | CVE-2025-3450 |
| CVSS | v3.1 7.5 (High), v4.0 8.2 (High) |
| Affected | AR < 6.3 and AR = 6.0 |
| Impact | System node stop via crafted HTTP request to SDM |
| Authentication | Unauthenticated (network-based) |
| Advisory | B&R SA25P002 (2025-10-07) |
All CP1584 systems running AR 4.x are affected. An attacker who can reach port 80/443 can crash the entire controller by sending a specially crafted message to the SDM web interface. This is not theoretical — B&R discovered it through internal security testing.
Mitigations (for systems that cannot update to AR R4.93):
- Disable SDM in the Automation Studio project if not actively needed for maintenance. AR Help GUID:
1d915d67-07f7-4034-a472-c204b5cabbfe - Enable HTTPS with mutual TLS (mTLS) — in AS project, option “Validate SSL communication partner” (GUID:
01ced6c0-28ef-4aaa-bd05-2442b971859c). Note: mTLS also affects other web applications using the AR webserver (mapp View, etc.) - Restrict webserver access to trusted IPs using the AR host-based firewall (GUID:
75b8994b-f97a-4e0f-8278-43c2a737e65f) - Block port 80/443 at the network firewall except during active maintenance windows
- Never expose SDM to the internet or untrusted networks
CVE-2022-4286 — SDM Reflected XSS
| Detail | Value |
|---|---|
| CVE | CVE-2022-4286 |
| CVSS | 6.1 (Medium) |
| Affected | AR >= 3.00 and <= C4.93 |
| Impact | Reflected cross-site scripting — JavaScript execution in authenticated user’s browser |
| Authentication | Requires user interaction (click malicious link while authenticated) |
| Patched | AR R4.93 |
Mitigation: Update to AR R4.93. On older versions, avoid clicking untrusted links while authenticated to SDM.
CVE-2025-3449 — SDM Session Takeover (Predictable Session ID)
| Detail | Value |
|---|---|
| CVE | CVE-2025-3449 |
| CVSS | v3.1 4.2 (Medium) |
| CWE | CWE-340 (Generation of Predictable Numbers or Identifiers) |
| Affected | AR < 6.4 (all AR 4.x versions) |
| Impact | Unauthenticated attacker can take over an already-established SDM session by predicting the session ID |
| Advisory | B&R SA25P003 (2025-10-07), CISA ICSA-26-141-04 |
Practical implications: Since SDM on older AR 4.x versions has no authentication, the predictable session ID means an attacker could hijack a maintenance engineer’s active SDM session. However, B&R notes SDM does not currently process session-specific data, so the practical impact is limited.
Mitigation: Block SDM access at the network firewall when not actively debugging. Never access SDM over untrusted networks. See ar-rtos.md Section 14.15 for full details.
CVE-2025-3448 — SDM Reflected XSS (New, Distinct from CVE-2022-4286)
| Detail | Value |
|---|---|
| CVE | CVE-2025-3448 |
| CVSS | v3.1 6.1 (Medium) |
| CWE | CWE-79 (Improper Neutralization of Input During Web Page Generation) |
| Affected | AR < 6.4 (all AR 4.x versions) |
| Impact | Reflected XSS — attacker can execute arbitrary JavaScript in victim’s browser via crafted SDM URL |
| Advisory | B&R SA25P003 (2025-10-07), CISA ICSA-26-141-04 |
Note: This is a separate vulnerability from CVE-2022-4286 (which was patched in R4.93). CVE-2025-3448 remains unpatched on all AR 4.x versions.
Mitigation: Do not click untrusted links while authenticated to SDM. Deploy a Web Application Firewall (WAF) to filter reflected XSS attempts. Never follow hyperlinks to SDM from emails, social media, or messaging apps.
CVE-2025-11498 — SDM CSV Injection
| Detail | Value |
|---|---|
| CVE | CVE-2025-11498 |
| CVSS | v3.1 6.1 (Medium) |
| CWE | CWE-1236 (Improper Neutralization of Formula Elements in a CSV File) |
| Affected | AR < 6.4 (all AR 4.x versions) |
| Impact | Attacker injects formula data into SDM-generated CSV exports via crafted URL; victim must click link AND manually open CSV in spreadsheet app |
| Advisory | B&R SA25P003 (2025-10-14), CISA ICSA-26-141-04 |
Mitigation: Never use hyperlinks from untrusted sources to access SDM. If you export CSV diagnostic data from SDM, verify the URL was manually typed. Open CSV files from untrusted sources in a text editor first, not directly in Excel.
CVE-2021-22275 — AR Webserver Buffer Overflow (Stops Cyclic Program)
| Detail | Value |
|---|---|
| CVE | CVE-2021-22275 |
| CVSS | 8.6 (High) |
| Impact | Unauthenticated DoS — stops cyclic program via crafted HTTP request |
| Affected | Automation Runtime |
Distinct from CVE-2025-3450 (which targets SDM specifically), this older vulnerability targets the AR webserver more broadly. On affected AR 4.x versions, any HTTP request to port 80 can potentially crash the cyclic program.
SDM Security Recommendations Summary
| Risk Level | Action |
|---|---|
| Immediate | Disable SDM on all production CP1584s that don’t need active monitoring |
| Short-term | Configure HTTPS with mTLS; restrict webserver to trusted IPs via AR firewall |
| Medium-term | Block ports 80/443 at network firewall; enable only during maintenance windows |
| Long-term | Update to AR R4.93 (patches CVE-2025-3450, CVE-2022-4286, CVE-2023-3242, CVE-2025-11044). Note: SA25P003 CVEs (CVE-2025-3449/3448/11498) require AR >= 6.4 and cannot be patched on any AR 4.x version — further reason to disable SDM on production PLCs. |
See ar-rtos.md Section 14 for the complete vulnerability catalog and cp1584-forensics.md for the forensic workflow with security considerations.
16. B&R Automation Academy SDM Learning Content (2026)
In March 2026, B&R released a free microlearning module for the System Diagnostics Manager (SDM) as part of the Automation Academy. This is specifically targeted at end users and service engineers who need quick, reliable diagnostic insights without deep Automation Studio knowledge.
What it covers:
- How to navigate the SDM web interface
- Reading and interpreting the system logbook
- Task monitor usage for performance diagnostics
- I/O module status interpretation
- Creating and downloading system dumps
- Common error code identification
Access: Free through the B&R Automation Academy. Search the B&R Community for “Learning Content for End Users and Service Engineers: SDM” or visit the Automation Academy portal.
Relevance for undocumented machine maintainers: If you are new to B&R systems (inheriting a machine from a defunct OEM), this free training module is an efficient way to learn SDM without needing an Automation Studio license or B&R service contract. It complements this document by providing structured, vendor-approved training material.
Related: B&R also released a “Service & Diagnostics” training track in 2026 covering broader diagnostic techniques. See community.br-automation.com/t/release-2026-new-training-service-diagnostics/11444.
Key Findings
-
SDM is the central diagnostic hub for B&R systems. It aggregates hardware status, task monitoring, IO state, logbook entries, alarm events, and firmware information into a single web-based interface accessible from any browser.
-
SDM is accessible without Automation Studio. The built-in web server (default port 80/443) provides full diagnostic access to any device on the network — no project files, no AS license, and no OEM credentials required.
-
The SDM logbook is the primary forensic data source. Every AR boot, error, warning, and configuration change is timestamped and stored in the logbook. Bulk export via FTP provides the raw material for post-mortem analysis.
-
SDM has known security vulnerabilities. Multiple CVEs affect the SDM web interface (reflected XSS, DoS, authentication weaknesses). On isolated networks this is manageable; on connected networks, the SDM port should be firewalled.
-
Hardware tree in SDM reveals the complete system topology. The hardware tree shows every module, its status, firmware version, and connection path. For undocumented machines, this is the fastest way to map out what hardware is installed.
-
Task Monitor data correlates directly with execution-model.md. SDM shows real-time task cycle times, jitter, and watchdog status — making it the operational complement to the theoretical execution model documentation.
17. Cross-References
| Related File | Relevance |
|---|---|
| firmware.md | Automation Runtime versions, firmware update procedures, version compatibility with SDM features |
| execution-model.md | Task configuration, cycle times, task priorities, watchdog behavior — directly relevant to Task Monitor data in SDM |
| alarm-logging.md | User-level alarm and event logging — complements the system-level logbook in SDM |
| system-variables.md | B&R system variables accessible via Automation Studio that provide additional diagnostic data beyond what SDM shows |
| python-diagnostics.md | Python scripts for SDM data scraping, automated health checks, and logbook parsing |
| opcua.md | Reading diagnostic data via OPC-UA — logbook subscriptions, task monitor access, and alarm event feeds |
| hardware-monitoring.md | Temperature monitoring, fan status, and environmental sensor data — complements SDM hardware info |
| time-sync.md | Timestamp correlation between controller clock, SNTP, and PC time — critical for accurate logbook analysis |
| cp1584-forensics.md | Forensic analysis workflow for CP1584 controllers — combining SDM dumps, logbook analysis, and hardware inspection |
| ftp-web-interface.md | FTP access to config/log files on the CF card — enabling SDM, inspecting configuration, and retrieving logbook files |
| io-card-hardware.md | IO module LED diagnostic patterns — interpreting ‘r’, ‘e’, ‘S’, ‘l’ LEDs that SDM also reports digitally |
| io-sniffing.md | Protocol-level IO diagnostics for X2X and POWERLINK — when SDM shows communication errors |
| network-architecture.md | Network topology and device enumeration — mapping all devices visible in SDM’s hardware tree |
| config-file-formats.md | Configuration files controlling SDM enable/disable and webserver settings |
| access-recovery.md | Password recovery when SDM requires authentication |
| cybersecurity-hardening.md | SDM security vulnerabilities and hardening — SDM is a critical attack surface |
| pvi-api.md | PVI API for programmatic access to SDM diagnostic data from external applications |
| acopos-drives.md | ACOPOS drive status monitoring via SDM — drive fault codes, DC bus voltage, temperature |
| grounding-emc.md | EMC troubleshooting when SDM reports intermittent communication errors |
| online-changes.md | Runtime changes visible in SDM — how SDM reflects configuration modifications |
| cf-card-boot.md | CF card backup procedures using SDM system dump export |
| diagnostic-workstation.md | Setting up a workstation that uses SDM as a primary diagnostic tool |
| bootloader-recovery.md | Recovery procedures when SDM is inaccessible due to boot failure |
| remanufacturing.md | Using SDM data to document a machine before control system replacement |
Document generated for undocumented CP1584 maintenance scenarios. Verify all procedures against the specific controller firmware version in your environment.
B&R CP1584 Forensic Information Extraction Guide
Overview
This guide provides a systematic methodology for extracting every possible piece of information from a B&R CP1584 programmable logic controller when no original project files, documentation, or OEM support exists. It is written for automation engineers who have inherited undocumented machines built on B&R hardware from defunct or unresponsive OEMs.
The CP1584 is a B&R X20 Compact CPU controller with an Intel Atom processor, running B&R Automation Runtime (VxWorks-based on the CP1584; newer B&R controllers use a hypervisor with Linux alongside AR). It ships with Ethernet connectivity, CF card storage, OPC-UA capability, PVI (Process Visualization Interface) support, and the SDM (System Diagnostics Manager) web service.
The extraction process follows two fundamental phases:
- Discovery — Locate the PLC on the network and identify what services it exposes.
- Extraction — Pull data, configuration, logs, and runtime state from every accessible interface.
Everything documented here is non-destructive and read-only unless explicitly noted. Nothing here requires physical access to the controller beyond network connectivity and (optionally) a VNC connection.
1. Network Discovery
1.1 ANSL Protocol Discovery
B&R PLCs broadcast ANSL (Automation Network Service Layer) discovery packets. These are the fastest way to find a CP1584 on an unknown network.
Wireshark capture filter:
udp port 30303 or udp port 11169
Step-by-step procedure:
- Connect your workstation to the same physical or VLAN segment as the machine network.
- Open Wireshark and start a capture on the active interface.
- Apply the ANSL filter above.
- Within a few seconds you should see broadcast packets from the CP1584 containing:
- Device name (configurable by the OEM, often descriptive)
- IP address
- Serial number
- Firmware version
- Automation Runtime version
- ANSL protocol version
- Stop the capture and note the IP address.
If no ANSL packets appear, the PLC may be on a different subnet or ANSL discovery may be disabled in the controller’s network configuration.
1.2 nmap Service Scan
Once you have the IP address from ANSL or from a network diagram, scan for exposed services:
nmap -sV -p 80,21,11169,4840,5900,5800,8080,443,502 <PLC_IP>
Expected open ports and their significance:
| Port | Service | What it gives you |
|---|---|---|
| 80 | HTTP | SDM web interface, possibly 404 but headers reveal “B&R computer” |
| 4840 | OPC-UA | Full namespace browsing if configured by the OEM |
| 11169 | PVI / ANSL | PVI Manager communication port — the COMT port |
| 21 | FTP | CF card file access including user partition F:\ |
| 5900 | VNC | Remote HMI display (if a visualization is running) |
| 5800 | HTTP-VNC | Java-based VNC viewer via browser (legacy) |
| 8080 | HTTP alt | Secondary web service or OPC-UA HTTP gateway |
| 502 | Modbus TCP | If a Modbus gateway task is running |
1.3 B&R Separate IP Addresses
Some B&R hardware configurations use two independent network interfaces: one for process data/communication and one dedicated to visualization/HMI traffic. Check both interfaces during discovery. The ANSL packets will reveal both IPs if this is configured.
2. Web Interface (Port 80)
2.1 SDM — System Diagnostics Manager
The SDM is B&R’s built-in web-based diagnostics service. Access it at:
http://<PLC_IP>/sdm
What you get from SDM:
- Logbook entries — timestamped system events, errors, warnings, and info messages. This is a goldmine for understanding what the machine does, what errors it encounters, and what tasks are running.
- Task list — all running Automation Runtime tasks with CPU usage, cycle times, and memory consumption.
- Hardware configuration — installed modules, firmware versions, serial numbers.
- Network configuration — IP addresses, subnet masks, gateway, DNS.
- File system browser — limited view of the CF card directory structure.
- AR system information — Automation Runtime version, licensing status, uptime.
Step-by-step SDM exploration:
-
Open
http://<PLC_IP>/sdmin a browser. -
If prompted for credentials, try:
admin/ no passwordadmin/admin- No credentials at all (anonymous access is common on older firmware) Security Warning (CVE-2025-3450): The SDM web interface has a known denial-of-service vulnerability (CVSS v3.1 7.5 High) in all AR versions before R4.93. An unauthenticated network attacker can send a crafted request to crash the controller via SDM. See diagnostics-sdm.md and ar-rtos.md Section 14.5 for full details and mitigations. When accessing SDM on unpatched systems, block port 80/443 at the firewall except during active maintenance windows, or use HTTPS with mutual TLS.
-
Navigate to Logbook and export all available entries. These contain task names, error codes, and operational context.
-
Navigate to Task Monitor and record every running task name. These map directly to PVI objects and are critical for OPC-UA/PVI reconstruction.
-
Navigate to Hardware and record all module types, serial numbers, and firmware versions.
-
Export or screenshot everything.
2.2 System Dump via SDM
The SDM web interface provides a button to create a system dump. This is a .tar.gz archive of the controller’s complete runtime state.
Procedure:
- In SDM, navigate to Diagnostics > Create System Dump.
- Wait for the dump to be generated (can take several minutes depending on CF card speed and system complexity).
- Download the
.tar.gzfile. - Extract and analyze:
mkdir dump_analysis && tar -xzf system_dump.tar.gz -C dump_analysis/
find dump_analysis/ -type f
What the system dump typically contains:
- AR log files (
*.log,*.arlog) - Task memory snapshots
- Network configuration files
- License files
- Installed software package manifest
- Runtime configuration
- Variable listing (partial — may include names and data types)
- I/O mapping information
- Recipe data
- User partition file structure
2.3 Header Fingerprinting
Even if the web interface returns a 404, the HTTP response headers reveal critical information:
curl -v http://<PLC_IP>/ 2>&1 | head -30
Look for:
Server: B&R
X-Powered-By: B&R Automation Runtime
This confirms the device is a B&R controller even when the web root returns nothing useful.
3. FTP Access — CF Card Forensics
3.1 Connecting to the FTP Server
The CP1584 exposes its CF card filesystem via FTP. Connect with any FTP client:
ftp <PLC_IP>
Or with curl for scripted directory listing:
curl -s ftp://<PLC_IP>/ --list-only
Credentials to try:
- Anonymous login (
anonymous/ any email as password) admin/ no passwordadmin/admin- Check the SDM network configuration page for configured FTP credentials.
3.2 Directory Structure
The CF card is organized into system and user partitions:
/ ← System root
/System/ ← Automation Runtime system files
/AT/ ← Automation Runtime core
/AS/ ← Automation Studio project files (if deployed)
/Temp/ ← Temporary files, sometimes includes logs
/Licenses/ ← License files (.lic)
/Web/ ← Web server files
/F:/ ← User partition (designated as F:\ in B&R path notation)
3.3 User Partition (F:)
The user partition is where the deployed project lives. This is the most valuable target on the entire controller.
What to look for:
| Path / Pattern | What it is |
|---|---|
F:/Project/ | Deployed Automation Studio project structure |
F:/Project/*.apj | Project files — partial or full project archive |
F:/Project/logic/ | PLC program source (may be compiled .pc or source .st) |
F:/Project/visualization/ | Visualization project files (mapp View, VNC) |
F:/Project/hardware/ | Hardware configuration (.hw files) |
F:/Project/parameters/ | Machine parameters, recipe files |
F:/Project/io/ | I/O mapping configuration |
F:/*.log | Application log files |
F:/*.csv | Data logs, recipe files, production records |
F:/*.txt | Configuration files, notes left by OEM developers |
F:/*.ini | Initialization and configuration files |
F:/*.xml | Configuration, OPC-UA namespace exports, mapp config |
F:/*.cfg | System and application configuration |
F:/*.arconfig | Automation Runtime configuration |
F:Recipes/ | Recipe management directory |
F:/DataLog/ | Datalogger output files |
F:/AlarmLog/ | Alarm history files |
Recursive download of the user partition:
wget -r -nH --cut-dirs=2 ftp://<PLC_IP>/F:/ -P cp1584-user-partition/
Or with lftp (better for large transfers):
lftp -u admin, -e "mirror --verbose --parallel=4 /F:/ ./cp1584-user-partition/" <PLC_IP>
3.4 Critical Configuration Files
If present on the CF card, these files are essential for reconstruction:
PvConfig.xmlorPviConfig.xml— PVI Manager configuration including all registered variables, COMT ports, and transport types.opcua_config.xmlorUaServerConfig.xml— OPC-UA server namespace configuration with all published nodes.mappServices.xml— Configuration for B&R mapp components (AlarmX, DataX, RecipeX, FileX, etc.).ARConfig.cfg— Automation Runtime base configuration.UserPar.datorUserPar.cfg— User parameters and machine settings.NetworkConfig.xml— Network interface configuration.
3.5 Datalogger and Alarm Archives
The B&R mapp DataX component writes .csv or proprietary binary files to the CF card. These archives can reveal:
- Which variables are being logged and their engineering units
- Sampling rates and trigger conditions
- Historical trends that document machine behavior over time
- Alarm history with timestamps, severity, and associated variables
4. OPC-UA Data Extraction
4.1 Prerequisites
OPC-UA is the single most productive extraction point if it was configured by the OEM. Many B&R machines from the last 10+ years run an OPC-UA server because it is the standard B&R communication layer for mapp View visualization and for SCADA/ MES integration.
Connection test:
nmap -pU 4840,sT 4840 <PLC_IP>
If port 4840 is open, proceed to namespace browsing.
4.2 UaExpert — OPC-UA Client
UaExpert is a free OPC-UA client from Unified Automation that supports namespace browsing without prior knowledge of the server configuration.
Procedure:
- Download and install UaExpert.
- Add a new server:
opc.tcp://<PLC_IP>:4840 - If authentication is required, try:
- Anonymous
- Username/Password:
admin/admin,User/User - Certificate-based (you would need the OEM’s certificate — unlikely without documentation)
- Once connected, expand the address space tree.
- Browse every namespace systematically. B&R OPC-UA servers typically expose:
- Namespace 0: OPC-UA standard types (skip unless debugging)
- Namespace 1-2: B&R system namespace with controller status, task info, hardware info
- Namespace 3+: Application-specific namespaces created by the OEM
4.3 What to Extract from Each Namespace
For every variable node you find, record:
| Field | Why it matters |
|---|---|
| Node ID | Unique identifier — you need this for PVI/OPC-UA programming |
| Display Name | Human-readable name — often reveals variable purpose |
| Description | May contain engineering units, ranges, or documentation |
| Data Type | INT, REAL, BOOL, STRING, etc. — needed for reconstruction |
| Array Dimensions | If an array, the dimension reveals batch sizes, table lengths |
| Value | Current runtime value — reveals machine state |
| Access Level | Read/write — writable variables are control inputs |
| Browse Name Path | Hierarchy shows logical grouping (e.g., “Axis1/Position”) |
UaExpert extraction procedure:
- Right-click on the top-level application namespace folder.
- Select Add to Document > Data Access View to subscribe to all variables.
- Export the address space: File > Export Address Space > CSV.
- The CSV export gives you the complete node list with IDs, names, types, and descriptions.
- Save this CSV — it is a primary artifact for project reconstruction.
4.4 Identifying Functional Groups
OPC-UA node hierarchy often reveals the machine’s functional structure:
Machine
├── Axis_Control
│ ├── Spindle_Speed (REAL, R/W)
│ ├── Target_Position (REAL, R/W)
│ ├── Actual_Position (REAL, R)
│ └── Homing_Status (BOOL, R)
├── Temperature
│ ├── Zone_1_Actual (REAL, R)
│ ├── Zone_1_Setpoint (REAL, R/W)
│ └── Heater_Enable (BOOL, R/W)
├── Recipe
│ ├── Current_Recipe_Name (STRING, R/W)
│ ├── Load_Recipe (METHOD)
│ └── Save_Recipe (METHOD)
├── Status
│ ├── Machine_State (UINT, R)
│ ├── Error_Code (UINT, R)
│ ├── Error_Text (STRING, R)
│ └── Cycle_Counter (UDINT, R)
└── Commands
├── Start (METHOD)
├── Stop (METHOD)
└── Reset (METHOD)
Map every group and variable. This structure is essentially the machine’s functional specification.
4.5 Method and Event Nodes
B&R OPC-UA servers expose methods (callable functions) and events (notifications). In UaExpert:
- Methods appear under the object node. Right-click and select Call to see input/output argument signatures.
- Events can be subscribed to via the Event View. Subscribe to the server node to capture all events and record their fields.
Methods are especially valuable — they reveal the machine’s command interface (start, stop, recipe load, homing, etc.).
5. PVI API Access
5.1 Connecting Without a Project
The PVI Manager (Process Visualization Interface) is B&R’s native communication layer. It runs on the CP1584 and listens for PVI client connections. You can connect to it without any project files if you know the IP address and the COMT port.
Connection parameters:
| Parameter | Value / Description |
|---|---|
| COMT | 350 (default for Ethernet PVI connections) |
| PT | 11169 (default PVI transport port for TCP/IP). Note: Some documentation references port 11160 (INA2000 legacy). Port 11169 is the ANSL COMT port; 11160 is the INA2000 PVI transport port. Both may work depending on AR version. |
| IP | The controller’s IP address |
5.2 PVI Transfer Tool
The PVI Transfer Tool is a standalone B&R utility that can:
- Connect to a PVI Manager by IP address and COMT port
- Browse all registered PVI objects (variables, data structures, arrays)
- Read and write variable values in real time
- Export the variable list
Connection procedure:
- Launch PVI Transfer Tool.
- Enter connection parameters: IP =
<PLC_IP>, COMT =350, PT =11169. - Click Connect.
- Browse the object tree. Every registered variable appears with its data type and current value.
- Export the complete variable list.
5.3 Programmatic PVI Access (Python)
If you need scripted access, the B&R PVI protocol can be implemented over TCP. The PVI Manager on the controller accepts text-based commands on port 11169.
import socket
PLC_IP = "192.168.1.100"
COMT_PORT = 11169
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((PLC_IP, COMT_PORT))
sock.settimeout(5)
def pvi_send(cmd):
msg = f"{cmd}\r\n"
sock.send(msg.encode('ascii'))
return sock.recv(4096).decode('ascii', errors='replace')
pvi_send('CN="cp",C="cp",PVT="TCPIP",PVN="<PLC_IP>"')
print(pvi_send('CM="cp",C="ST",O="CPU"'))
print(pvi_send('RN="cp",C="ST",O="CPU",LN="State"'))
print(pvi_send('RG="cp",C="ST",O="CPU",LN="State"'))
sock.close()
This is a simplified example. The full PVI protocol documentation covers connect/read/write/unconnect sequences with specific escape character handling. Refer to the B&R PVI API documentation for complete protocol details.
5.4 PVI Limitations Without Project
- You can only access variables that are registered in the PVI Manager. If the OEM did not register a variable for external access, it is invisible.
- Data structures and arrays appear as registered objects but you need to know their element layout to interpret raw byte reads.
- Variable names in PVI may differ from the OPC-UA display names — cross-reference both for complete coverage.
6. Forced I/O Reading
6.1 The Problem
Direct I/O reading (forcing, observing raw digital/analog I/O state at the hardware level) is not available without the original project configuration that defines the I/O mapping. The Automation Runtime knows which physical I/O points exist, but without the logical mapping from project files, you cannot directly correlate physical inputs/outputs to program variables.
6.2 Indirect I/O Observation via OPC-UA or PVI
If the OEM mapped I/O variables into the OPC-UA namespace or registered them in PVI, you can observe them indirectly:
- Connect via UaExpert or PVI Transfer Tool.
- Look for variables with naming patterns like
DI_,DO_,AI_,AO_,Input_,Output_,IO_. - Manually activate physical inputs (push buttons, sensors) and watch for corresponding variable state changes.
- Toggle outputs via writable variables and observe physical actuator response.
This is labor-intensive but effective for building an I/O map from scratch.
6.3 Automation Studio I/O Cross-Reference
If you eventually obtain a dummy project (see Section 8), the I/O mapping is defined in the Hardware Configuration (.hw file) within Automation Studio. The mapping connects physical I/O modules to logical variable names.
7. AR Log Analysis
7.1 Log Sources
B&R Automation Runtime generates logs from multiple sources:
| Source | Location | Content |
|---|---|---|
| AR System Log | SDM > Logbook, or via system dump | Boot sequence, task starts/stops, memory errors, license issues |
| Application Log | CF card F:/ or via FTP | Application-specific events logged by the PLC program |
| Task Cycle Log | SDM > Task Monitor | Cycle time violations, watchdog errors, task overload |
| Network Log | SDM or system dump | Network interface events, connection drops, ANSL activity |
| mapp Alarm Log | CF card F:/AlarmLog/ or OPC-UA alarm namespace | Machine alarms with timestamps, severity, and context |
| mapp DataLog | CF card F:/DataLog/ | Sampled variable values in CSV or proprietary format |
7.2 Analyzing Logbook Entries
Access logbook entries through SDM or from the system dump .tar.gz:
tar -xzf system_dump.tar.gz -C dump_analysis/
find dump_analysis/ -name "*.log" -o -name "*.arlog" -o -name "logbook*"
What to extract from logs:
- Task names — every task listed in the logbook is a PVI object and likely an OPC-UA node. Build your variable inventory from these names.
- Error patterns — recurring errors reveal weak points in the machine, common failure modes, and what conditions trigger protective stops.
- Timing patterns — timestamps in logs reveal cycle durations, batch processing times, and maintenance schedules.
- Software version mentions — log entries often contain the Automation Runtime version, mapp component versions, and firmware of connected hardware.
7.3 Logbook Export Script
for log in dump_analysis/**/logbook*.txt dump_analysis/**/logbook*.log; do
echo "=== $log ==="
head -100 "$log"
echo ""
done
Extract unique task names from logs:
grep -ohP '(?<=Task\s)[A-Za-z0-9_]+' dump_analysis/**/*.log | sort -u
Extract unique variable names from logs:
grep -ohP '(?<=Variable\s)[A-Za-z0-9_.:]+' dump_analysis/**/*.log | sort -u
8. Online Monitoring with Automation Studio
8.1 Dummy Project Approach
Automation Studio is B&R’s engineering environment. Full online monitoring normally requires the original project, but a dummy project with matching hardware configuration provides partial access.
Prerequisites:
- Automation Studio license
- B&R Automation Runtime version matching the target CP1584 (check SDM for the exact version)
Procedure:
- Create a new Automation Studio project.
- Configure the target in the Physical Hardware view:
- Add the CP1584 CPU with the correct firmware version.
- Add all I/O modules as identified from SDM’s hardware page and serial numbers.
- Set the target IP address in the project configuration.
- Connect to the target: Online > Login.
- If the hardware configuration matches closely enough, you gain access to:
- Variable cross-reference tables
- Force table (for I/O forcing — read the warning below)
- Trace/Scope (for real-time signal visualization)
- I/O mapping display
- You will not see the application code (ladder, ST, C, etc.) without the source — only the runtime objects and their current values.
8.2 Safety Warning
Never force outputs on an undocumented, live production machine. The force table in Automation Studio can override program logic and physically actuate outputs. Use monitoring mode only (read access). Disable the force function or confirm force tables are empty before connecting.
9. Runtime Utility Center
9.1 Overview
The Runtime Utility Center (RUC) is a B&R maintenance tool that can:
- Browse the CF card contents (system and user partitions)
- Back up the complete CF card image
- Read AR system information
- Check and update firmware
- Manage licenses
- Access the logbook
9.2 CF Card Backup
Before doing anything else, create a full CF card backup:
- Launch Runtime Utility Center.
- Connect to
<PLC_IP>. - Navigate to CF Card > Backup.
- Select a destination directory.
- Wait for the complete backup (can take 15-60 minutes depending on card size and network speed).
- Store the backup image securely — it is your primary recovery asset.
9.3 Browsing CF Card Contents
The RUC file browser provides a GUI view of the CF card. Use it to navigate the same paths described in Section 3 (FTP Access). The RUC browser is sometimes able to access files that FTP cannot, particularly files owned by the root system user.
10. VNC Access
10.1 Connecting to the HMI
B&R HMI applications (mapp View or older Panel pages) expose a VNC server. This gives you a live view of the operator interface.
Connection:
vncviewer <PLC_IP>:5900
Or any VNC client pointing to <PLC_IP>:5900 (or :0).
10.2 What You Can Learn from the HMI
Even without documentation, the HMI display is an invaluable information source:
- Screen navigation — map every screen, every button, every indicator.
- Variable names visible in headers/status bars — B&R developers sometimes leave debug information visible.
- Alarm lists — active and historical alarms reveal machine conditions.
- Recipe screens — parameter names, ranges, and units reveal the machine’s process.
- Trends/graphs — trend displays show which variables are being monitored and their expected behavior.
- Axis control screens — reveal the number of servo axes, their names, and control modes.
- Login screen — attempt default passwords:
admin/admin,operator/operator,maintenance/maintenance.
10.3 Screen Capture and Documentation
Systematically document every HMI screen:
import subprocess, time
for i in range(50):
time.sleep(2)
subprocess.run(['scrot', f'hmi_screen_{i:03d}.png'])
(Navigation through screens must be done manually or via touchscreen if accessible.)
11. Network Traffic Analysis
11.1 Passive Capture Strategy
If you can physically tap into the network segment (mirror port, network tap, or hub), capture all traffic to and from the CP1584:
tshark -i eth0 -w cp1584_capture.pcap -f "host <PLC_IP>" -c 500000
11.2 Protocol Analysis
ANSL traffic (port 11169):
tshark -r cp1584_capture.pcap -Y "tcp.port == 11169" -T fields -e tcp.payload | head -20
This reveals PVI Manager communication including variable names, data types, and read/write operations from connected HMI panels, SCADA systems, or secondary controllers.
OPC-UA traffic (port 4840):
tshark -r cp1584_capture.pcap -Y "tcp.port == 4840" -T fields -e frame.time -e ip.src -e ip.dst
OPC-UA traffic reveals what external systems are connected and how frequently they poll the controller.
HTTP traffic (port 80):
tshark -r cp1584_capture.pcap -Y "http" -T fields -e http.request.uri -e http.host
This reveals what web-based systems are accessing the SDM or any custom web pages served from the CF card.
11.3 Discovering Communication Partners
From the captured traffic, build a map of all systems that communicate with the CP1584:
tshark -r cp1584_capture.pcap -T fields -e ip.src -e ip.dst | sort -u
This reveals the full automation network topology — SCADA servers, HMI panels, secondary PLCs, MES systems, and any other devices the CP1584 communicates with.
12. Systematic Extraction Workflow
Execute the following steps in order. Each step builds on the previous and maximizes coverage.
Phase 1: Non-Invasive Discovery
- 1.1 Wireshark ANSL discovery — identify IP, name, firmware
- 1.2 nmap service scan — identify open ports and services
- 1.3 Web browser to
http://<PLC_IP>/sdm— check SDM access - 1.4 Web browser to
http://<PLC_IP>/— check for custom web pages or 404 with B&R headers - 1.5 FTP anonymous login attempt — check CF card access
- 1.6 VNC connection attempt — check HMI visibility
- 1.7 OPC-UA connection attempt with UaExpert — check namespace accessibility
Phase 2: Data Collection
- 2.1 SDM: Export all logbook entries
- 2.2 SDM: Record all running tasks with cycle times
- 2.3 SDM: Record complete hardware configuration
- 2.4 SDM: Create and download system dump
- 2.5 FTP: Recursive download of F:\ (user partition)
- 2.6 FTP: Download any .log, .csv, .xml, .cfg, .ini files from system partition
- 2.7 UaExpert: Export complete OPC-UA address space to CSV
- 2.8 UaExpert: Subscribe to all variables and capture current values
- 2.9 UaExpert: Document all methods (callable functions) and their signatures
- 2.10 UaExpert: Subscribe to events and capture event definitions
- 2.11 PVI Transfer Tool: Connect and export variable list
- 2.12 VNC: Document all HMI screens (screenshots, navigation map)
- 2.13 Runtime Utility Center: Full CF card backup
- 2.14 Network capture: Record all traffic for 24-48 hours if possible
Phase 3: Analysis
- 3.1 Cross-reference OPC-UA variable names with PVI variable names
- 3.2 Cross-reference variable names with CF card file contents (config files, log files)
- 3.3 Cross-reference task names from SDM with variable name prefixes from OPC-UA
- 3.4 Analyze system dump for AR configuration and variable definitions
- 3.5 Analyze log files for recurring patterns, error sequences, and operational context
- 3.6 Map the complete communication network from captured traffic
- 3.7 Build functional group hierarchy from OPC-UA namespace structure
- 3.8 Identify all I/O mapping relationships between physical signals and logical variables
Phase 4: Reconstruction (Prerequisite: see project-reconstruction.md)
- 4.1 Create dummy Automation Studio project with matching hardware
- 4.2 Import OPC-UA namespace export to generate variable declarations
- 4.3 Map all identified variable groups to functional software modules
- 4.4 Document the machine’s complete functional specification
- 4.5 Develop a migration plan if the CP1584 needs replacement
Key Findings Summary
| Finding | Reliability | Effort | Value |
|---|---|---|---|
| OPC-UA namespace is the richest data source | High | Low | Critical |
| FTP CF card user partition F:\ | High | Low | Critical |
| SDM logbook reveals task and variable names | High | Low | High |
| System dump contains AR configuration | High | Medium | High |
| PVI Transfer Tool connects without project | High | Low | High |
| VNC reveals HMI structure and variable names | Medium | Low | Medium |
| ANSL discovery identifies the controller | High | Very Low | Medium |
| Network traffic reveals communication partners | High | Medium | Medium |
| Automation Studio dummy project gives partial access | Medium | High | High |
| Direct I/O forcing without project | Not possible | N/A | N/A |
Cross-References
| File | Purpose |
|---|---|
| firmware.md | B&R firmware versions, upgrade/downgrade procedures, recovery |
| opcua.md | Detailed OPC-UA configuration, namespace structure, security, certificate management |
| pvi-api.md | PVI protocol specification, programmatic access from Python/C/C#, variable enumeration |
| ftp-web-interface.md | Complete FTP/Web interface file listing, credentials, and configuration access |
| config-file-formats.md | File format specifications for all B&R configuration files accessible via FTP |
| project-reconstruction.md | Step-by-step project reconstruction from extracted artifacts |
| ar-rtos.md | AR OS internals — understanding error 25314, SERVICE mode, page faults, CVE table |
| cf-card-boot.md | CF card partition layout, file contents, imaging procedures, and cloning |
| execution-model.md | Task class structure — mapping task names from SDM to cycle times and priorities |
| memory-map.md | IO address mapping — understanding how physical IO maps to variables |
| diagnostics-sdm.md | SDM web interface for hardware overview, logger, system dump, and error analysis |
| network-architecture.md | Network discovery, ANSL protocol, device enumeration, topology mapping |
| system-variables.md | AR system variables — CPU temp, memory, task cycle times, watchdog, battery, network stats |
| alarm-logging.md | Alarm history extraction and format interpretation |
| online-changes.md | Runtime modification techniques when the original project is unavailable |
| access-recovery.md | Password recovery, BOOT mode procedures, brwatch, Pvi.py, VNC access |
| program-reverse-engineering.md | Analyzing compiled .br modules when no source is available |
| spare-parts.md | Identifying hardware from physical inspection and order codes |
| io-card-hardware.md | IO module LED diagnostics, signal conditioning, and fault codes |
| remanufacturing.md | Migration planning when the CP1584 needs replacement |
| time-sync.md | Timestamp accuracy for correlating events during forensic analysis |
| hmi-integration.md | HMI screen documentation and variable extraction via VNC |
| encoder-diagnostics.md | Encoder monitoring via OPC-UA/PVI, phasing procedures |
| python-diagnostics.md | Python diagnostic scripts for automated forensic data collection |
| iiot-retrofit.md | MQTT/InfluxDB/Grafana setup for remote monitoring dashboards |
| ebpf-telemetry.md | Advanced performance profiling with eBPF/systemtap for runtime analysis |
| troubleshooting-index.md | Scenario-based index for finding the right document for any diagnostic problem |
Emergency Recovery Contacts
If all extraction methods fail and the machine is critical:
- B&R Technical Support — can provide firmware recovery images and remote diagnostics. Requires proof of ownership or partnership.
- B&R Academy — training resources for Automation Studio and B&R system architecture.
- B&R Partner Network — authorized B&R partners may have experience with similar machines and can provide consulting.
IO Card Message Sniffing for Sensor Diagnostics on B&R PLCs
A comprehensive technical guide to intercepting, capturing, and analyzing fieldbus traffic for sensor fault diagnosis on B&R Automation PLC systems (X20, X67, System 2003/2005, APROL).
Table of Contents
- Theoretical Approaches to Intercept Fieldbus Traffic
- Passive Tapping vs Active Sniffing
- Hardware Requirements per Protocol
- Wireshark Setup for POWERLINK and PROFINET
- CAN Bus Sniffing Tools
- X2X Bus Sniffing with Logic Analyzers
- Correlating Captured Data with IO Module Addresses
- Filtering Techniques to Isolate Sensor Data
- Timing Analysis for Intermittent Issues
- Practical Diagnostic Workflows
- Legal and Safety Considerations
- Tools Comparison Table
- Sources and References
1. Theoretical Approaches to Intercept Fieldbus Traffic
1.1 B&R Protocol Stack Overview
B&R Automation systems use multiple fieldbus and industrial Ethernet protocols depending on the IO system generation and bus controller selected:
| Protocol | Layer | B&R Product | Typical Use |
|---|---|---|---|
| X2X Link | Physical (RS-485 derivative) | X20 bus controllers (X20BC etc.) | Local IO backplane/bus connection for X20 slices |
| ETHERNET Powerlink (EPL) | L2 Ethernet (EtherType 0x88F6) | X20ET, X67, Power PCs | Real-time deterministic Ethernet, 100 Mbps |
| PROFINET IO | L2 Ethernet (EtherType 0x8892) | X20PN, gateway modules | Siemens-compatible integration, RT/IRT |
| CANopen | L2 CAN (ISO 11898) | X20CC, X20BC0073 | CAN-based IO, motion, drives |
| EtherNet/IP | L4 UDP/TCP | X20EB, gateways | Rockwell-compatible integration |
| Modbus TCP/RTU | L4/L2 | Various gateways | Legacy protocol bridging |
1.2 X2X Link
X2X Link is B&R’s proprietary serial bus for connecting X20 I/O stations to the bus controller. It runs on a twisted-pair physical layer derived from RS-485, operating at up to 12 Mbaud. The protocol is closed-source and undocumented at the packet level, which makes full decoding difficult without reverse engineering.
Key characteristics:
- Physical: RS-485 transceiver (differential pair), daisy-chain topology
- Speed: Up to 12 Mbaud (B&R specific encoding)
- Topology: Multi-drop from bus controller, up to 64 stations per segment
- Frame structure: Proprietary; includes addressing, CRC, and cyclic data payloads
- Update rate: Sub-millisecond, depending on station count and configuration
Interception approach: Since X2X is a closed protocol, interception focuses on signal-level analysis using logic analyzers rather than packet-level decode. You can observe timing, signal integrity, and bus utilization to diagnose physical-layer problems. For data-level analysis, the preferred approach is to use B&R’s own diagnostic tools (Automation Studio watch window, mapp Diagnostic) and correlate with the captured signal patterns.
1.3 ETHERNET Powerlink (EPL)
ETHERNET Powerlink is an open-source (EPL v2.0+) real-time Ethernet protocol managed by the EPSG (Ethernet POWERLINK Standardization Group). It operates on standard Fast Ethernet (100BASE-TX) and uses a slot-based TDMA mechanism managed by a Managing Node (MN) - typically the B&R PLC CPU.
Frame types:
| Frame | Purpose | Direction |
|---|---|---|
| SoA (Start of Async) | Opens asynchronous phase | MN -> all |
| SoC (Start of Cycle) | Marks cycle boundary | MN -> all |
| PReq (Poll Request) | Requests data from CN | MN -> specific CN |
| PRes (Poll Response) | CN responds with data | CN -> MN |
| ASnd (Async Send) | Asynchronous data (configuration, diagnostics) | Any node |
Key characteristics:
- Physical: Standard 100BASE-TX Ethernet, half-duplex
- MAC: Uses custom ethertype or LLC/SNAP encapsulation
- Cycle time: Configurable, 200us to 100ms typical
- Addressing: Node IDs (1-239), node 240 = MN
- Data format: Little-endian
Interception approach: Powerlink runs on shared Ethernet media (hub or switch in “passthrough” mode for EPL phase 1). Since it uses standard Ethernet frames with a recognizable ethertype, you can connect a PC with a standard NIC in promiscuous mode directly to the bus via a hub or tap. Wireshark includes a native POWERLINK dissector.
1.4 PROFINET IO
PROFINET uses standard Ethernet frames for real-time I/O exchange. There are three performance classes:
| Class | Mechanism | Timing | EtherType |
|---|---|---|---|
| NRT (Non-Real-Time) | TCP/UDP | 50-100ms+ | Standard IP |
| RT (Real-Time) | Direct L2 Ethernet | 1-10ms | 0x8892 |
| IRT (Isochronous Real-Time) | Hardware-scheduled TSN-like | <1ms | 0x8892 (priority) |
Key PROFINET protocols on the wire:
- pn_dcp: Discovery and Configuration Protocol (device naming, IP assignment)
- pn_rt: Real-Time cyclic data frames (cyclic I/O)
- pn_io: Application layer (connection setup via DCE/RPC over UDP 34964)
- pn_ptcp: Precision Time Control Protocol (IRT clock sync)
- lldp: Link Layer Discovery Protocol (topology)
Interception approach: PROFINET RT/IRT frames are Layer 2 ethertype 0x8892 - they bypass TCP/IP entirely. You must capture on the Ethernet interface directly (via tap or SPAN port). Wireshark has full PROFINET dissectors built in.
1.5 CANopen
CANopen is a higher-layer protocol built on top of CAN 2.0A/B (ISO 11898). It uses an object dictionary (OD) model with specific communication objects:
| Object | CAN ID | Purpose |
|---|---|---|
| NMT (Network Management) | 0x000 | State machine control (start/stop/reset) |
| SYNC | 0x080 | Cycle synchronization beacon |
| EMCY (Emergency) | 0x080+NodeID | Error/fault notification |
| TPDO (Transmit PDO) | 0x180+NodeID | Cyclic process data out |
| RPDO (Receive PDO) | 0x200+NodeID | Cyclic process data in |
| SDO (Service Data) | 0x580+NodeID (RX), 0x600+NodeID (TX) | Configuration, parameter access |
| HB (Heartbeat) | 0x700+NodeID | Node alive monitoring |
Key characteristics:
- Physical: CAN 2.0B, differential pair (CAN_H, CAN_L), twisted pair
- Speed: 1 Mbps max (typical: 125 kbps - 1 Mbps)
- Addressing: 11-bit (standard) or 29-bit (extended) CAN identifiers
- Topology: Multi-drop bus with termination resistors (120 ohm at each end)
Interception approach: CANopen runs on CAN bus, which requires a CAN interface adapter (USB, PCI, or embedded). You connect the CAN adapter to the bus via a Y-cable or tap, and use specialized software to decode CANopen protocols. The object dictionary mapping (PDO/SDO) tells you which sensor data maps to which CAN IDs and byte offsets.
2. Passive Tapping vs Active Sniffing
2.1 Passive Tapping
Passive tapping inserts a hardware device inline on the communication link that copies all traffic to a monitoring port without participating in the protocol. The key property is zero interference with the live system.
Advantages:
- No impact on timing, latency, or determinism of the live network
- Cannot introduce errors or crash the production system
- Invisible to protocol participants (no MAC address on the network)
- Safe for safety-critical and hard-real-time systems
- Captures all traffic including collisions and physical-layer errors
Disadvantages:
- Requires physical access to insert the tap
- May need network downtime to install (unless using breakout taps on existing connections)
- Full-duplex Ethernet requires two capture interfaces (or an aggregate tap)
- Cannot trigger or inject messages for active diagnostics
Passive tap types:
| Tap Type | Ethernet | CAN | Serial/RS-485 |
|---|---|---|---|
| Optical splitter (fiber) | Yes | N/A | N/A |
| Electrical tap (copper) | Yes (regenerative or passive) | Yes (Y-cable) | Yes (T-connector or breakout board) |
| Magnetic/capacitive coupler | Yes (non-intrusive) | Yes | Yes |
| Breakout box | Yes (BNC/RJ45) | Yes (DB9) | Yes (DB9/terminal block) |
2.2 Active Sniffing
Active sniffing involves connecting a device as a participant on the network, either as a fully-featured node or as a promiscuous-mode listener.
For Ethernet (POWERLINK/PROFINET):
- Connect a PC NIC directly to a switch port or hub
- Configure the NIC in promiscuous mode to capture all frames
- For POWERLINK: connect to a hub or directly to the bus (half-duplex shared medium)
- For PROFINET: use managed switch port mirroring (SPAN) to copy traffic
Advantages:
- Can use standard PC hardware and software (Wireshark)
- Can inject traffic for active testing (e.g., ping, DCP requests)
- No special tap hardware needed for basic capture
- Can participate in protocol negotiations to aid decoding
Disadvantages:
- Adds a device to the network (potential timing impact on shared-medium networks)
- PC NIC OS-level timestamps are inaccurate (microsecond range at best, affected by scheduling)
- May cause issues if the PC sends unwanted packets (TCP/IP stack, ARP, etc.)
- Cannot capture collisions or physical-layer anomalies
- Some protocols may reject unknown nodes
B&R-specific consideration: For POWERLINK, B&R’s own documentation states: “To record data traffic, an Ethernet port of the PC is connected directly to the POWERLINK network at any point.” This works because POWERLINK Phase 1 uses a shared Ethernet medium. However, B&R also notes that PC-based capture has “inaccurate timestamps” and recommends the X20ET8819 hardware analysis tool for precise diagnostics.
2.3 Choosing Between Approaches
| Scenario | Recommended Approach |
|---|---|
| Quick diagnostic on POWERLINK | Active (PC + Wireshark, direct connect) |
| Long-term intermittent fault capture | Passive tap + hardware recorder (X20ET8819) |
| PROFINET on managed switch | Active (SPAN port mirroring + Wireshark) |
| PROFINET on unmanaged switch | Passive (inline Ethernet tap + Wireshark) |
| CANopen bus diagnostics | Active (CAN adapter + PCAN-View/CANalyzer) or passive (CAN tap) |
| X2X bus diagnostics | Passive only (logic analyzer on RS-485 differential pair) |
| Safety-rated systems | Passive only (never introduce active devices on safety networks) |
| Intermittent timing-critical faults | Passive with hardware timestamps (nanosecond accuracy) |
3. Hardware Requirements per Protocol
3.1 ETHERNET Powerlink
| Component | Purpose | Recommended |
|---|---|---|
| Hub (not switch) | Share the Ethernet medium for passive monitoring | Any 10/100 hub; Powerlink Phase 1 requires shared medium |
| Ethernet Tap | Inline passive copper tap for full-duplex capture | Dualcomm DTE (port-stealing), NetOptics, Garland |
| PC with NIC | Active capture via Wireshark | Intel-based NIC (best driver support); half-duplex, 100 Mbps |
| X20ET8819 | B&R’s dedicated Ethernet analysis tool | Nanosecond timestamps, trigger-based recording, filter inputs |
| Managed switch with SPAN | Alternative: port mirroring (Powerlink Phase 2+) | Any managed switch supporting port mirroring |
X20ET8819 Specifications (B&R’s recommended tool):
- X20 form factor, slides directly into X20 backplane
- 2x RJ45 Ethernet ports for inline connection
- Hardware-based timestamps in nanosecond range
- Trigger inputs (digital inputs or software trigger)
- Filter-based recording to minimize file size
- Compatible with Automation Studio for analysis
- Ideal for sporadic/intermittent faults
3.2 PROFINET IO
| Component | Purpose | Recommended |
|---|---|---|
| Managed industrial switch | Port mirroring (SPAN) for traffic copy | Siemens SCALANCE X, B&R X20SW, Phoenix CONTACT |
| Ethernet Tap | Inline passive tap (if no managed switch) | SharkTap, Dualcomm DTE, NetOptics |
| PC with NIC | Wireshark capture | Intel or Realtek-based NIC; promiscuous mode support |
| PROFINET diagnostic tool | PI PROFINET official tools | PNI (PROFINET Investigator), Proneta |
Switch port mirroring setup:
- Configure the switch port where the IO device is connected as the source (monitored) port
- Configure a spare port as the destination (mirror) port
- Connect the capture PC to the destination port
- Ensure the mirror port can handle the full bandwidth of monitored traffic
3.3 CANopen
| Component | Purpose | Recommended |
|---|---|---|
| CAN USB adapter | Physical CAN interface for PC | PEAK PCAN-USB, Vector VN1610/VN1630, Kvaser Leaf |
| CAN tap/Y-cable | Non-intrusive bus connection | PEAK CAN tap, DB9 Y-cable adapter |
| High-speed CAN transceiver | Logic-level to CAN bus level | MCP2551, SN65HVD230 (for custom solutions) |
| 120 ohm termination | Bus termination (critical!) | Built-in to adapters, or external resistor |
| Oscilloscope | Physical signal analysis | Keysight, Tektronix, Rigol (for signal integrity) |
3.4 X2X Link (Serial/RS-485)
| Component | Purpose | Recommended |
|---|---|---|
| Logic analyzer | Digital signal capture on RS-485 pair | Saleae Logic (8+ channels), sigrok/PulseView |
| RS-485 to TTL converter | Convert differential RS-485 to logic levels | MAX485, SP3485 breakout board |
| Oscilloscope | Analog signal quality analysis | 4-channel, 100MHz+ bandwidth |
| Terminal block tap | Non-intrusive breakout on bus wires | Custom DB9 or terminal block breakout |
Connection method for X2X with logic analyzer:
- Locate the X2X bus wires (typically labeled X2L+/X2L- or similar on terminal blocks)
- Connect RS-485-to-TTL converter: A (non-inverting) to one channel, B (inverting) to another
- Set logic analyzer sample rate: minimum 10x the bus speed (for 12 Mbaud: 120 MHz minimum)
- Record for at least one full bus cycle to observe repeating patterns
- Analyze using UART async serial protocol decoder (may require custom baud rate settings)
4. Wireshark Setup for POWERLINK and PROFINET
4.1 Wireshark for POWERLINK
Based on official B&R community documentation:
Step 1: Prepare the network interface
- Deactivate all unneeded protocols (TCP/IP, Windows file sharing, etc.) on the capture interface
- These can interfere with the POWERLINK network by generating unwanted packets
- In Windows: Uncheck all items except “Wireshark Npcap Loopback Adapter” in adapter properties
- In Linux:
ip link set eth0 down && ip link set eth0 up promisc on
Step 2: Recommended NIC settings
- Half-duplex mode
- 100 Mbit/s transmission rate
- Auto-crossover enabled (or use a crossover cable)
Step 3: Connect to the POWERLINK network
- Connect the PC Ethernet port directly to the POWERLINK network at any point
- A hub can be used between the PC and the network if direct connection fails
- Verify link LEDs indicate active connection
Step 4: Start capture in Wireshark
- Select the connected interface in Wireshark’s start screen
- Double-click the interface or click the blue shark fin icon to start recording
Step 5: POWERLINK Display Filters
| Filter | Purpose |
|---|---|
epl.src == 1 | All packets sent by NodeID 1 (typically the MN) |
epl.dest == 1 | All packets sent to NodeID 1 |
epl.service_type == "SoA" | Start of Async frames |
epl.service_type == "PReq" | Poll Request frames |
epl.service_type == "PRes" | Poll Response frames |
epl.service_type == "ASnd" | Asynchronous Send frames |
Step 6: Analysis tips
- Sort packets by the “Time” column to recognize the recurring POWERLINK cycle
- Use Wireshark’s coloring rules to distinguish frame types (SoA = one color, PRes = another, ASnd = another)
- Create a custom column for PRes payload: right-click “Payload” in a PRes frame -> “Apply as Column” -> rename to “PRes-Payload”
- Note: POWERLINK user data is transmitted in little-endian format
Limitations of PC-based capture:
- Inaccurate timestamps (OS scheduling jitter affects precision)
- Large file sizes for extended captures
- Cannot reliably capture sporadic errors
- For precise timing analysis, use B&R X20ET8819 instead
4.2 Wireshark for PROFINET
Step 1: Install Wireshark
- Download from https://www.wireshark.org
- Install with Npcap (Windows) or libpcap (Linux) for packet capture driver
- PROFINET dissectors are built-in:
pn_rt,pn_io,pn_dcp,pn_ptcp
Step 2: Capture setup
- PROFINET RT uses EtherType 0x8892 (not TCP/IP!) - you cannot filter by TCP port
- Capture all Ethernet traffic on the interface (no capture filter) for full visibility
- Optional capture filter to reduce noise:
ether proto 0x8892(only PROFINET RT/DCP/PTCP)
Step 3: Connect to the PROFINET network
- Method A (Preferred): Managed switch with SPAN/port mirroring - mirror the IO device port to a monitoring port, connect PC to monitoring port
- Method B: Inline Ethernet tap between PLC and switch
- Method C: Direct connect (only if the PROFINET device supports it)
Step 4: PROFINET Display Filters
| Filter | What It Shows |
|---|---|
pn_rt | All PROFINET RT cyclic I/O frames |
pn_io | PROFINET IO application layer (connection setup, alarms) |
pn_dcp | PROFINET DCP (discovery, name assignment, IP config) |
pn_ptcp | PROFINET PTCP (IRT clock synchronization) |
lldp | LLDP frames (topology, neighbor detection) |
mrp | Media Redundancy Protocol frames |
eth.type == 0x8892 | All PROFINET frames (RT, DCP, PTCP) |
pn_dcp.service_id == 5 | DCP Identify (device discovery) |
pn_dcp.service_id == 4 | DCP Set (name/IP assignment) |
pn_dcp.block_error != 0 | DCP errors |
pn_rt.data_status.datavalid == 0 | Invalid cyclic data |
pn_rt.transfer_status != 0 | Transfer errors |
pn_rt.cycle_counter | Cycle counter (detect missed frames) |
pn_io.alarm_type | Alarms from IO devices |
pn_io.slot_nr | Specific slot number |
pn_io.subslot_nr | Specific subslot number |
pn_rt && eth.addr == 00:xx:xx:xx:xx:xx | Traffic to/from specific MAC |
Step 5: Decoding cyclic I/O data
- Critical: Wireshark can decode cyclic data to module level ONLY if it captures the DCE/RPC connection setup
- Best practice: Start Wireshark BEFORE powering on the IO device or restarting the PLC
- If connection setup is missed, cyclic data shows as raw bytes without module context
- Import PI PROFINET coloring rules: View -> Coloring Rules -> Import (colors: RT=green, DCP=blue, Alarms=red, LLDP=yellow)
Step 6: Custom columns for PROFINET diagnostics
| Column | Field |
|---|---|
| Frame ID | pn_rt.frame_id |
| Cycle Counter | pn_rt.cycle_counter |
| Data Status | pn_rt.data_status |
| IOxS | pn_io.ioxs |
| Delta Time | frame.time_delta_displayed |
5. CAN Bus Sniffing Tools
5.1 Hardware Interfaces
PEAK PCAN (PEAK-System Technik GmbH)
- PCAN-USB: Basic USB-to-CAN adapter, galvanically isolated
- PCAN-USB FD: Supports CAN FD, 2 channels
- PCAN-USB Pro FD: 4 channels, CAN/CAN FD
- PCAN-View: Free monitoring software included
- Pros: Affordable, reliable, good Linux support, free software
- Cons: Limited scripting compared to Vector
Vector Informat
- VN1610/VN1611: Professional CAN/CAN FD/LIN interfaces (1-4 channels)
- VN1630/VN1640: High-channel-count interfaces
- CANalyzer: Professional analysis software (CANopen, J1939, etc.)
- CANoe: Full simulation + analysis environment
- CANalyzer.CANopen: CANopen-specific analysis option with OD support
- Pros: Industry gold standard, extensive protocol support, powerful scripting (CAPL)
- Cons: Expensive (license starts ~$3,000+)
Kvaser
- Kvaser Leaf Light: Budget single-channel CAN
- Kvaser Memorator: Data logger with onboard storage
- Kvaser CANKing: Included analysis software
- Pros: Robust, good Linux drivers, Scripting with tscript
- Cons: Software less capable than Vector CANalyzer
SocketCAN (Linux)
- Built-in CAN stack in Linux kernel since 2.6.25
- Works with: PEAK PCAN, Kvaser, SocketCAN-native devices (e.g., Microchip MCP2515-based)
- Tools:
candump,cansend,cansequence,cansniffer,canplayer cansnifferprovides a live hexadecimal/ASCII view of the bus- Python:
python-canlibrary provides high-level access - Pros: Free, scriptable, integrates with Linux ecosystem
- Cons: No GUI analysis tool comparable to CANalyzer; limited CANopen decode
Other Tools
- CanLover: Free, modern CAN bus analyzer for Linux/Windows, CANalyzer alternative, native SocketCAN
- Kayak: Java-based open-source CAN traffic GUI
- CanCat: Open-source CAN bus penetration testing tool
- Busmaster: Open-source tool by RBEI (supports CAN, J1939, CANopen)
5.2 CANopen-Specific Analysis
For CANopen sensor diagnostics, the key is mapping CAN IDs to object dictionary entries:
TPDO/RPDO mapping (process data):
- TPDO1: CAN ID 0x180 + NodeID (default)
- RPDO1: CAN ID 0x200 + NodeID (default)
- The PDO mapping (in the OD at index 0x1A00/0x1600) tells you which sensor values are at which byte offset
- Example: A temperature sensor at NodeID 5 sends TPDO1 on CAN ID 0x185; bytes [0:1] = temperature in 0.1°C units
SDO access (configuration/diagnostics):
- SDO Receive: CAN ID 0x600 + NodeID
- SDO Transmit: CAN ID 0x580 + NodeID
- Use SDO to read diagnostic objects, error history, manufacturer-specific status
Emergency messages:
- CAN ID 0x080 + NodeID
- Contains error code, error register, and vendor-specific data
- Filter for these to quickly identify failing devices
Heartbeat monitoring:
- CAN ID 0x700 + NodeID
- Consumer heartbeat time in OD index 0x1016
- Missed heartbeats = node offline or bus problem
5.3 Practical CAN Sniffing Setup for B&R Systems
- Locate the CAN bus access point: B&R X20CC modules have CAN bus terminals. Use a DB9 Y-adapter to tap in.
- Configure the CAN adapter: Set baud rate to match the B&R project configuration (check in Automation Studio)
- Start capture: Use
candump can0(SocketCAN) or PCAN-View - Apply CANopen decode: If using CANalyzer with CANopen option, load the EDS/EDD file from the IO module manufacturer
- Monitor: Watch for EMCY (emergency) messages, heartbeat timeouts, or missing PDOs from specific nodes
6. X2X Bus Sniffing with Logic Analyzers
6.1 Why Logic Analyzers for X2X
Since X2X Link is a closed proprietary protocol with no publicly available dissector, protocol-level decoding is not feasible with standard tools. Logic analyzers capture the raw digital waveform, allowing you to:
- Verify physical signal integrity (rise times, voltage levels, noise)
- Measure timing between transmissions
- Detect bus contention, framing errors, or signal degradation
- Capture long traces for intermittent fault correlation
- Observe the repeating cycle pattern to identify which time slots belong to which stations
6.2 Saleae Logic Analyzer
Supported models: Saleae Logic 8, Logic Pro 8, Logic Pro 16
Setup for X2X capture:
- Connect the RS-485 differential pair (X2L+/X2L-) through an RS-485-to-TTL level shifter (MAX485 or SP3485)
- X2L+ (A line) -> Logic channel 0
- X2L- (B line) -> Logic channel 1
- Optionally: GND -> Logic GND, and the TX/RX enable lines if probing the transceiver IC directly
- Set sample rate: Minimum 10x the baud rate. For 12 Mbaud X2X, use 120+ MHz (Logic Pro 16 supports up to 500 MS/s)
- Set sample duration: Capture at least 10 full bus cycles to see repeating patterns
- In Saleae Logic 2 software:
- Add Async Serial analyzer for each channel
- Set baud rate to match (try 12M, 6M, 3M, 1.5M - B&R uses power-of-2 divisions of 12M)
- Add I2C/SPI analyzer if the X2X uses a chip-select or clock line visible on the bus connector
- Export data to CSV for analysis in spreadsheets or Python scripts
Limitations:
- Buffer depth limits long-term monitoring (use high-performance models with 2GB+ capture)
- Cannot decode proprietary protocol semantics
- TTL input range (must use level shifter for RS-485)
6.3 Sigrok / PulseView (Open Source)
Supported hardware: Any sigrok-compatible logic analyzer (DreamSourceLab, Clone, Sipeed, or even an Arduino with sigrok firmware)
Protocol decoders available in sigrok (relevant for X2X analysis):
- UART (Async Serial) - 131+ total decoders supported
- CAN (Controller Area Network) - for CAN bus analysis
- I2C, SPI - for sub-protocols or chip-level probing
- Modbus RTU - over RS-485 UART
- Jitter, Timing - for timing analysis between signals
Setup for X2X with sigrok:
- Install sigrok and PulseView:
apt install sigrok pulseview(Debian/Ubuntu) - Connect RS-485 through level shifter to logic analyzer channels
- Run
sigrok-clifor command-line capture:sigrok-cli --driver dreamsourcecli --config samplerate=120M --channels 0,1 \ --protocol-decoder uart:baudrate=12000000:rx=0 --protocol-decoder uart:baudrate=12000000:rx=1 \ -o x2x_capture.sr - Analyze in PulseView or export with
sigrok-cli -i x2x_capture.sr -P uart:csv - Write custom Python protocol decoder using libsigrokdecode API for X2X-specific analysis
Advantages of sigrok:
- Free and open source
- Supports 131+ protocol decoders
- Works with cheap logic analyzer hardware ($10-50)
- CLI interface for automated/scripted capture
- Extensible: write custom decoders in Python for proprietary protocols
6.4 Oscilloscope as Complement
Use a 4-channel oscilloscope for X2X physical-layer analysis:
- Channel 1: X2L+ (A line)
- Channel 2: X2L- (B line)
- Channel 3: X2L+ - X2L- (differential, math function)
- Channel 4: Ground reference or another signal
What to look for:
- Differential voltage swing (should be >1.5V for RS-485)
- Signal rise/fall times (degradation indicates cable or connector issues)
- Noise, ringing, reflections on the bus
- Common-mode voltage (should stay within RS-485 receiver range: -7V to +12V)
7. Correlating Captured Data with IO Module Addresses
7.1 Understanding B&R IO Address Mapping
B&R Automation Studio assigns addresses to IO modules based on their physical position in the station:
X20 System addressing:
Bus Controller (X20BCxxxx)
├── Slot 1: X20DI9371 (Digital Input 16ch) → %IX0.0.0 - %IX0.0.15
├── Slot 2: X20AI4631 (Analog Input 4ch) → %IW4 (words 4-7)
├── Slot 3: X20AO4621 (Analog Output 4ch) → %QW8 (words 8-11)
└── Slot 4: X20DO9321 (Digital Output 16ch) → %QX0.0.0 - %QX0.0.15
The %I/%Q prefix indicates input/output, %X = bit, %W = word (16-bit), %B = byte.
7.2 Correlating by Protocol
For POWERLINK:
- Each CN (Controlled Node) has a NodeID (configured in Automation Studio)
- The PRes frame from a CN contains the process image for that station
- Within the PRes payload, the byte order matches the slot order configured in the hardware tree
- To find a specific sensor: look up its NodeID, find its PRes frames, and calculate the byte offset based on slot position and data type
For PROFINET:
- Wireshark decodes cyclic data to slot/subslot level (if connection setup was captured)
- You’ll see:
Module: DI 8x24V (Slot 1, Subslot 1) → Input Data: 0xFF - Use
pn_io.slot_nrandpn_io.subslot_nrfilters to isolate specific IO modules - The AR (Application Relation) and CR (Connection Record) in the connection setup define the mapping
For CANopen:
- CANopen PDOs map to object dictionary entries (index/subindex)
- The PDO mapping (OD index 0x1A00 for TPDO, 0x1600 for RPDO) defines the byte layout
- Each sensor channel maps to a specific object in the OD
- Example: Object 0x6401 (analog input ch1) maps to TPDO1 byte [0:1]
- Load the device’s EDS/EDD file in CANalyzer to see the full mapping
7.3 Practical Correlation Workflow
-
Build an address map: In Automation Studio, export or document the IO configuration for each station:
- Station name/NodeID
- Slot position → module type → variable name → address
- Data type and byte width per channel
-
Identify the failing channel: Use B&R’s mapp Diagnostic or the Automation Studio watch window to determine which variable/address is showing unexpected values.
-
Locate in the capture:
- POWERLINK: Filter by
epl.src == <NodeID>for the failing station, then examine the PRes payload at the byte offset corresponding to the failing channel - PROFINET: Filter by
pn_io.slot_nr == <slot>andpn_io.subslot_nr == <subslot> - CANopen: Calculate the CAN ID for the failing node’s TPDO/RPDO, filter for that ID, and examine the relevant bytes
- POWERLINK: Filter by
-
Verify the data path: Trace the data from the capture back to the IO module’s physical terminal to confirm the channel-to-address mapping.
8. Filtering Techniques to Isolate Sensor Data
8.1 Wireshark Filtering for Ethernet Protocols
POWERLINK - isolate a specific station:
epl.src == 5 && epl.service_type == "PRes"
Shows only Poll Response frames from NodeID 5 (this station’s process data).
POWERLINK - isolate async communication:
epl.service_type == "ASnd"
Async frames carry diagnostics, configuration, and error messages.
PROFINET - isolate a device by MAC:
eth.addr == 00:0e:8c:12:34:56 && pn_rt
All cyclic RT traffic for a specific IO device.
PROFINET - isolate bad data:
pn_rt.data_status.datavalid == 0
Shows only frames where the device reports data as invalid.
PROFINET - isolate alarms:
pn_io.alarm_type
All alarm notifications (plug/pull, diagnosis, process alarms).
8.2 SocketCAN Filtering for CANopen
Capture only from a specific node:
candump can0,185:7FF
(Capture CAN ID 0x185 = TPDO1 of NodeID 5, mask 0x7FF = match all 11 bits)
Capture emergency messages only:
candump can0,080:7FF
(All emergency messages from any node)
Capture with CANopen decode (cansniffer):
cansniffer can0
Shows a live matrix view of all CAN IDs with data bytes, updated in real-time.
Python filtering with python-can:
import can
bus = can.Bus(interface='socketcan', channel='can0', bitrate=500000)
for msg in bus:
if msg.arbitration_id == 0x185: # TPDO1 from NodeID 5
temp_raw = int.from_bytes(msg.data[0:2], 'little')
temp_c = temp_raw / 10.0
print(f"Temperature: {temp_c}°C")
8.3 Logic Analyzer Filtering for X2X
In Saleae Logic 2:
- Time range selection: Highlight a section of the capture to zoom in
- Search: Search for specific byte patterns or transitions
- Export selection: Export only the selected time range to CSV
In sigrok-cli:
sigrok-cli -i capture.sr -P uart:min_tx_len=1 -A uart=rx-0:rx-1 | grep "temperature"
Pipe the decoded output through grep/awk for pattern matching.
8.4 Triggered Capture
For isolating specific events in high-traffic networks:
Wireshark capture filters:
ether proto 0x8892 and ether[0] & 1 = 0
Only unicast PROFINET frames (filter out multicast).
Wireshark stop conditions:
- Capture -> Stop Conditions -> “After X packets” or “After X seconds”
- Useful for capturing exactly one POWERLINK cycle or a specific number of PROFINET RT frames
Hardware trigger (X20ET8819):
- Configure a digital input trigger to start recording when a physical event occurs
- Use filter expressions to pre-select which frames to store
- Essential for capturing sporadic intermittent faults that may not occur during a manual observation window
9. Timing Analysis for Intermittent Communication Issues
9.1 Common Intermittent Fault Patterns
| Symptom | Protocol Layer | Likely Cause | Detection Method |
|---|---|---|---|
| Occasional missed cycle | POWERLINK/PROFINET RT | Network overload, bad cable | CycleCounter gaps |
| Random data corruption | CAN / Serial | EMI, ground loop, poor termination | CRC errors, bit stuffing errors |
| Intermittent node drop | CANopen / X2X | Loose connector, failing transceiver | Heartbeat timeout, bus-off |
| Timing jitter spikes | Any real-time protocol | CPU overload, OS scheduling | Delta time histogram |
| Data staleness | POWERLINK/PROFINET | IO module sensor failure | DataValid=0, IOxS=bad |
9.2 Wireshark Timing Analysis
POWERLINK cycle time analysis:
- Filter for SoC (Start of Cycle) frames:
epl.service_type == "SoC" - Add column:
frame.time_delta_displayed(delta from previous frame) - Sort by time and examine the delta column
- Healthy: consistent delta matching the configured cycle time (e.g., 1.000ms +/- 0.01ms)
- Faulty: delta spikes, missed cycles, or irregular intervals
PROFINET cycle analysis:
- Filter:
pn_rt - Add column:
pn_rt.cycle_counter - If CycleCounter has gaps (e.g., 12340, 12341, 12343 - missed 12342), frames were lost
- Add column:
frame.time_delta_displayed - Build a histogram: Statistics -> Capture File Properties -> “Create Stat” or use Expert Info
PROFINET data validity analysis:
- Filter:
pn_rt.data_status.datavalid == 0 - If this returns frames, the IO device is reporting invalid data
- Cross-reference with
pn_io.alarm_typefor diagnostic alarms - Check timing: does DataValid go to 0 at the same time as alarms? (indicates sensor failure)
- Does DataValid go to 0 without alarms? (indicates communication issue)
9.3 CAN Bus Error Analysis
CAN error types and what they mean:
| Error Type | Meaning | Common Cause |
|---|---|---|
| Bit Error | Transmitted bit differs from monitored bit | Cable length, EMI |
| Stuff Error | 6 consecutive equal bits (violates bit stuffing rule) | Corrupted data |
| CRC Error | Calculated CRC doesn’t match received CRC | Electrical noise, bad connection |
| Form Error | Fixed-format field has wrong value | Transceiver fault |
| ACK Error | No ACK from any receiver | Wiring, termination, bus-off |
| Bus-Off | Node has accumulated too many errors and disconnected itself | Persistent fault (cable, transceiver) |
Detection with CAN tools:
- PCAN-View: Shows error frames, TX/RX error counters, bus state
- CANalyzer: Error frame analysis, bus load measurement, error statistics
- SocketCAN:
ip -details -statistics link show can0shows error counters candump can0 -eincludes error frames in the capture
Intermittent CAN fault diagnostic workflow:
- Monitor the TX error counter (TEC) and RX error counter (REC) over time
- If TEC increases sporadically but recovers: intermittent cable issue
- If REC increases: bus-level noise or another node transmitting errors
- If both TEC and REC increase together with error frames: EMI or ground loop
- If counters go to bus-off: persistent fault - check termination, cable, and connectors
- Use an oscilloscope on CAN_H and CAN_L to check signal quality during the fault
9.4 X2X Timing Analysis
With a logic analyzer:
- Capture a long trace (several minutes) during normal operation to establish baseline
- Measure the time between recurring patterns (each station’s transmission time slot)
- Set a trigger on the “unexpected” pattern: e.g., a frame that appears only during the fault
- Compare signal integrity during normal operation vs. during the fault
- Check for: jitter in frame timing, changes in frame length, missing responses, or signal quality degradation
9.5 Statistical Analysis Methods
Wireshark IO Graphs:
- Statistics -> IO Graph: Plot packet rate, bytes/frame, or custom field values over time
- Useful for visualizing periodic behavior and spotting anomalies
Wireshark Expert Info:
- Analyze -> Expert Info: Shows warnings and notes about unusual patterns
- Detects: retransmissions, duplicate ACKs, out-of-order frames, protocol violations
Custom Python analysis:
import scapy.all as scapy
packets = scapy.rdpcap('capture.pcap')
deltas = [packets[i+1].time - packets[i].time for i in range(len(packets)-1)]
import statistics
print(f"Mean cycle: {statistics.mean(deltas)*1000:.3f} ms")
print(f"Std dev: {statistics.stdev(deltas)*1000:.3f} ms")
print(f"Min: {min(deltas)*1000:.3f} ms, Max: {max(deltas)*1000:.3f} ms")
10. Practical Diagnostic Workflows
10.1 Workflow 1: POWERLINK Sensor Reading Intermittently Wrong
Scenario: An analog input sensor on an X20 AI module occasionally reads zero or max value.
Steps:
- Confirm the symptom in Automation Studio: Watch the variable over time using the watch window or mapp Trend
- Identify the station: Note the NodeID and slot position of the failing module
- Set up Wireshark capture:
- Connect PC to POWERLINK network via hub
- Disable TCP/IP on the capture interface
- Set NIC to half-duplex, 100 Mbps
- Filter for the failing station:
epl.src == <NodeID> && epl.service_type == "PRes"- Add a PRes-Payload column
- Compare good vs bad readings:
- Identify the byte offset of the failing channel in the PRes payload
- Correlate with the known sensor address mapping
- Check for POWERLINK errors:
- Look for ASnd frames with error indications
- Check if other stations are affected
- Physical checks:
- Inspect wiring from sensor to AI module terminals
- Check shield/ground connections
- Verify sensor power supply
- Advanced: If the fault is timing-related, switch to X20ET8819 for nanosecond-precision capture with hardware trigger
10.2 Workflow 2: PROFINET IO Device Randomly Dropping Offline
Scenario: A PROFINET IO device intermittently shows “Not Found” or drops out of data exchange.
Steps:
- Set up capture with SPAN/tap:
- Configure managed switch: mirror the port connected to the failing IO device
- Connect PC to mirror port, start Wireshark
- Critical: Start capture before the device connects to capture the connection setup
- Monitor normal operation:
- Verify cyclic RT frames are arriving regularly:
pn_rt && eth.addr == <device MAC> - Check CycleCounter is incrementing without gaps
- Verify DataValid = 1
- Verify cyclic RT frames are arriving regularly:
- Capture the failure event:
- Let the capture run until the device drops out
- Look for the last cyclic frame before the dropout
- Analyze the failure:
- If cyclic frames stop abruptly with no alarms: cable or power failure
- If DataValid goes to 0 before dropout: sensor/module error
- If DCP re-discovery occurs: device rebooted or was reconnected
- If ARP/LLDP stops: physical link went down
- Check alarms before dropout:
pn_io.alarm_type- look for Pull, Diagnosis, or Status alarms
- Root cause:
- Physical layer: cable, connector, switch port
- Power: check device power supply
- Configuration: verify GSDML version, module configuration match
- Network: check for overloaded switch, VLAN issues
10.3 Workflow 3: CANopen Sensor Sporadically Not Updating
Scenario: A CANopen analog sensor module occasionally stops sending updated values.
Steps:
- Identify the node’s CAN ID: Calculate from the PDO mapping (default TPDO1 = 0x180 + NodeID)
- Set up CAN capture:
- Connect CAN adapter to bus via Y-tap
- Configure matching baud rate
- Start capture
- Monitor PDO traffic:
- Filter for the node’s TPDO CAN ID
- Watch the data bytes for the sensor value
- Check for errors:
- Look for emergency messages (CAN ID 0x080 + NodeID)
- Check heartbeat messages (0x700 + NodeID) - are they still arriving?
- Monitor bus error counters:
ip -s link show can0
- SDO read diagnostic objects:
- Use CANalyzer or python-can to send SDO read requests to diagnostic objects
- Read OD index 0x1001 (Error Register) and 0x10FD (Error History)
- Physical layer:
- Measure CAN_H and CAN_L voltages with a multimeter (recessive: ~2.5V, dominant: ~3.5V/1.5V)
- Verify 120-ohm termination at both bus ends
- Check cable shielding and ground
10.4 Workflow 4: X2X Bus Communication Errors (General)
Scenario: Random communication errors on the X2X bus causing IO modules to show diagnostic LEDs.
Steps:
- Check B&R diagnostics first:
- Use Automation Studio: System Diagnostics -> IO Diagnostics
- Identify which stations and modules are affected
- Set up logic analyzer:
- Connect RS-485 level shifter to X2L+/X2L- wires
- Set sample rate to 10x bus speed (120 MHz for 12 Mbaud)
- Capture for a long duration to catch the intermittent event
- Analyze signal integrity:
- Check differential voltage levels
- Look for signal ringing, reflections, or noise
- Compare with known-good reference capture
- Check physical layer:
- Verify bus termination at both ends
- Inspect connectors for corrosion or loose contacts
- Check cable length (X2X has maximum segment length limits)
- Verify shield grounding
- Bus utilization:
- Measure the percentage of time the bus is active vs. idle
- High utilization can cause timing margin issues
- Reduce cycle time or station count if overloaded
- Replace/swap:
- Swap the bus controller to rule out a failing transceiver
- Swap individual IO modules to isolate the failing node
11. Legal and Safety Considerations
11.1 Authorization and Access Control
- Only authorized personnel should perform network sniffing on industrial control systems
- Obtain written permission from the plant/facility management before installing any monitoring equipment
- Follow the organization’s IT/OT security policies and change management procedures
- Document all monitoring activities, including what was captured, when, and by whom
11.2 Impact on Production Systems
- Passive tapping is the safest method as it introduces zero risk to the live system
- Active sniffing (connecting a PC to the network) carries risks:
- Accidentally sending packets that disrupt real-time communication
- PC NIC flooding the bus with unwanted traffic (ARP, DHCP, IPv6)
- Network card driver issues causing packet storms
- Always disable TCP/IP and other network services on the capture interface before connecting
- Test any monitoring setup during a planned shutdown before deploying on live systems
- Use a dedicated, isolated capture machine (never a production PC)
11.3 Data Privacy and Security
- Captured fieldbus traffic may contain sensitive production data (recipes, process parameters, proprietary configurations)
- pcap files should be treated as confidential data and stored securely
- Do not share capture files outside the organization without proper authorization
- Delete captures after the diagnostic issue is resolved (unless required for compliance)
- Captured data may contain safety-related information - handle with appropriate care
- Some industrial protocols transmit passwords or configuration data in plaintext
11.4 Regulatory Compliance
| Regulation | Relevance |
|---|---|
| IEC 62443 | Industrial cybersecurity: network monitoring must comply with zone/conduit model |
| GDPR | If captures contain personal data (e.g., operator actions) |
| NIST CSF | US: Identify and protect industrial control system communications |
| Machine Directive (EU) | Safety-related systems must not be compromised by monitoring |
| Company policies | IT security policies, OT network access policies, change management |
11.5 Safety-Critical Systems
- Never install monitoring equipment on safety-rated fieldbus segments (e.g., PROFIsafe, openSAFETY, CIP Safety) without:
- Manufacturer approval
- Safety engineer sign-off
- Formal risk assessment
- SIL/PLD verification that monitoring does not compromise safety functions
- Passive taps are generally acceptable on safety networks as they don’t modify traffic
- Active devices (even in promiscuous mode) must be certified for use in safety networks
11.6 Liability
- Monitoring equipment installed on industrial networks becomes part of the safety chain
- If monitoring equipment fails and causes an incident, the installer may be liable
- Always follow manufacturer guidelines for network monitoring
- Use only approved and tested monitoring hardware
- Maintain records of all monitoring installations and configurations
12. Tools Comparison Table
12.1 Ethernet Protocol Analysis Tools
| Tool | Cost | Protocol Support | Platform | Strengths |
|---|---|---|---|---|
| Wireshark | Free | POWERLINK, PROFINET, EtherNet/IP, Modbus TCP, all standard protocols | Win/Linux/macOS | Industry standard, powerful filtering, extensible |
| EPL-Viz | Free (research) | POWERLINK only | Web-based | POWERLINK-specific visualization, state monitoring |
| B&R X20ET8819 | ~$500-1500 (est.) | POWERLINK only | B&R system | Nanosecond timestamps, trigger recording, filter inputs |
| Hilscher netANALYZER | ~$2,000-5,000 | PROFINET, EtherCAT, EtherNet/IP, POWERLINK | PC (Windows) | Professional industrial Ethernet analysis |
| Hilscher netMIRROR | ~$500-1,500 | Any Ethernet | Passive tap | Non-intrusive monitoring, hardware-based |
| PI PROFINET Investigator | ~$1,000-3,000 | PROFINET (all classes) | Windows | Official PI tool, GSD-based decode |
| Proneta | Free | PROFINET | Windows | Network topology, device commissioning |
12.2 CAN Bus Analysis Tools
| Tool | Cost | CANopen Support | Platform | Strengths |
|---|---|---|---|---|
| PEAK PCAN-View | Free (with adapter) | Basic CAN frame display | Win/Linux | Included with PCAN hardware, simple and reliable |
| PEAK PCAN-Explorer 6 | ~$500-1,000 | CANopen with EDS import | Windows | CANopen-specific analysis, free trial |
| Vector CANalyzer | ~$3,000-8,000 | Full CANopen, J1939, LIN, MOST | Windows | Industry gold standard, CAPL scripting, graphics |
| Vector CANalyzer.CANopen | ~$1,500 add-on | CANopen OD, PDO, SDO | Windows | Deep CANopen analysis with EDS/EDD |
| Kvaser CANKing | Free (with adapter) | Basic | Windows | Simple monitoring |
| SocketCAN (candump/cansniffer) | Free | Basic CAN frame capture | Linux | Scriptable, integrates with Python, free |
| python-can | Free | CANopen via canopen library | Cross-platform | Python scripting, automated analysis |
| CanLover | Free | CANopen | Win/Linux | Modern UI, CANalyzer alternative, SocketCAN native |
| Busmaster | Free | CANopen, J1939, ISO 15765 | Windows | Open-source, comprehensive, GUI |
12.3 Logic Analyzers for X2X/Serial
| Tool | Cost | Sample Rate | Channels | Strengths |
|---|---|---|---|---|
| Saleae Logic 8 | ~$500 | 100 MS/s | 8 | Excellent software, easy to use, protocol decode |
| Saleae Logic Pro 16 | ~$1,000 | 500 MS/s | 16 | Higher sample rate for fast X2X at 12Mbaud |
| Saleae Logic Pro 16 (High-Performance) | ~$1,500 | 500 MS/s (with deep memory) | 16 | Long captures, high performance |
| Sigrok/PulseView + cheap LA | $10-100 (hardware) | 24-100 MS/s | 8-16 | Free software, 131+ decoders, extensible |
| DreamSourceLab DSLogic | ~$150-300 | 400 MS/s | 16 | High performance, sigrok compatible |
| Rigol DS1054Z (scope+LA) | ~$400 | 1 GS/s | 16 (LA mode) | Oscilloscope + logic analyzer combined |
12.4 Ethernet Tap Hardware
| Tool | Cost | Type | Supported Media |
|---|---|---|---|
| Dualcomm DTE | ~$30-50 | Port-stealing (regenerative) | Copper 10/100/1000 |
| SharkTap | ~$50-100 | Regenerative inline tap | Copper 10/100/1000 |
| Garland Technology | ~$200-500 | Passive/aggregated | Copper + Fiber |
| NetOptics / Gigamon | ~$500-2,000 | Enterprise passive/aggregated | Copper + Fiber |
| Managed switch (SPAN) | N/A (existing) | Software mirroring | Depends on switch |
| Hilscher netMIRROR | ~$500-1,500 | Industrial passive tap | Industrial Ethernet |
12.5 Comprehensive Capability Matrix
| Tool | POWERLINK | PROFINET | CANopen | X2X | Capture | Timing Accuracy | Cost Range |
|---|---|---|---|---|---|---|---|
| Wireshark | Yes | Yes | No (via CAN adapter) | No | Software | ~microsecond | Free |
| X20ET8819 | Yes | No | No | No | Hardware | Nanosecond | $$$ |
| netANALYZER | Yes | Yes | No | No | Hardware | Nanosecond | $$$$ |
| PCAN-View | No | No | Yes | No | Software | Millisecond | $ (w/adapter) |
| CANalyzer | No | No | Yes | No | Software | Millisecond | $$$$ |
| SocketCAN | No | No | Yes | No | Software/CLI | Millisecond | Free |
| Saleae Logic | No | No | CAN (decode) | Yes (signal) | Hardware | ~nanosecond | $$-$$$ |
| Sigrok/PulseView | No | No | CAN (decode) | Yes (signal) | Hardware/CLI | ~nanosecond | Free-$ |
| Oscilloscope | No | No | CAN (signal) | Yes (signal) | Hardware | Nanosecond-psec | $$-$$$$ |
Legend: Free = $0, $ = <$100, $$ = $100-500, $$$ = $500-2,000, $$$$ = >$2,000
13. Sources and References
Official Documentation
- B&R Community: “Diagnosis of POWERLINK networks using Wireshark” https://community.br-automation.com/t/diagnosis-of-powerlink-networks-using-wireshark/3648
- B&R Automation: POWERLINK in detail https://www.br-automation.com/en/technologies/powerlink/technology/powerlink-in-detail/
- B&R Automation: X20ET8819 Ethernet Analysis Tool https://www.br-automation.com/en/products/io-systems/x20-system/x20-hub-system/x20et8819/
- B&R Automation: POWERLINK Configuration and Diagnostics (TM950TRE.40) http://www.ftp.boss-bravo.fr/wiki/pdf/TM_BR/TM950TRE.40-ENG_POWERLINK%2520Configuration%2520and%2520Diagnostics_V4000.pdf
Wireshark and Protocol References
- SCADA Protocols: “Wireshark for PROFINET: How to Capture and Decode RT, DCP, and IO Traffic” https://scadaprotocols.com/wireshark-profinet-decode-rt-dcp-guide/
- Wireshark Wiki: PROFINET/RT https://wiki.wireshark.org/PROFINET/RT
- Wireshark Wiki: PROFINET/DCP https://wiki.wireshark.org/PROFINET/DCP
- Wireshark Wiki: PROFINET/IO https://wiki.wireshark.org/PROFINET/IO
- Felser Engineering: PROFINET Manual - Wireshark https://www.felser.ch/profinet-manual/wireshark.html
- Felser Engineering: Port Mirroring - PROFINET Manual https://www.felser.ch/profinet-manual/pn_port-mirroring.html
- EPL-Viz: POWERLINK visualization https://epl-viz.github.io/
CAN Bus and CANopen
- CSS Electronics: “CANopen Explained - A Simple Intro” https://www.csselectronics.com/pages/canopen-tutorial-simple-intro
- CSS Electronics: “CAN Bus Errors Explained” https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial
- Analog Devices: “How to map objects to a PDO on a CANopen slave” (AN-076) https://www.analog.com/cn/resources/app-notes/an-076.html
- NI: “The Basics of CANopen” https://www.ni.com/en/shop/seamlessly-connect-to-third-party-devices-and-supervisory-system/the-basics-of-canopen.html
- Grid Connect: “CAN Bus Diagnostics: Step-by-Step Guide” https://www.gridconnect.com/blogs/news/how-to-diagnose-a-controller-area-network-can
- EEVblog: “Kvaser or Peak CAN bus adapters for CAN Open” https://www.eevblog.com/forum/chat/kvaser-or-peak-can-bus-adapters-for-can-open/
- RPubs: “CAN Tool Comparison (Vector vs PEAK)” https://rpubs.com/daniel_pas/can_tool_comparison
- GitHub: “Awesome CAN bus tools, hardware and resources” https://github.com/ajouatom/canbus-tools
- CAN Wiki: “CAN analyzers” http://www.can-wiki.info/doku.php?id=testequipment:cananalyzers
Hardware and Sniffing Tools
- Hilscher: “Sniffing Tool” (glossary/overview) https://www.hilscher.com/service-support/glossary/sniffing-tool
- Sigrok: “Protocol decoders” (131+ decoders) http://sigrok.org/wiki/Protocol_decoders
- Vector: CANalyzer.CANopen product page https://www.vector.com/int/en/products/products-a-z/software/canalyzer/option-canopen/
- PEAK-System: PCAN-View product page https://www.peak-system.com/products/software/analysis-software/pcan-view/
- ControlTech: “Vector CANalyzer Alternative: PEAK PCAN-Explorer 6” https://controltechuk.com/blog/vector-canalyzer-alternative/
- Atomic Object: “Affordable CAN Bus Tools that Won’t Break the Bank” https://spin.atomicobject.com/affordable-can-bus-tools/
- CanLover: Free CAN analyzer alternative https://canlover.ddns.net/
Network Tapping and Monitoring
- Garland Technology: “Network TAPs” https://www.garlandtechnology.com/network-tap
- Gigamon: “Understanding Network TAPs” https://www.gigamon.com/resources/resource-library/white-paper/understanding-network-taps-first-step-to-visibility.html
- Network Critical: “Top 8 Network TAPs for Passive Network Monitoring in 2026” https://www.networkcritical.com/blogs/top-8-network-taps-for-passive-network-monitoring
- Industrial Monitor Direct: “Capturing EtherNet/IP I/O Traffic: Network Taps vs Switch Port Mirroring” https://industrialmonitordirect.com/blogs/knowledgebase/capturing-ethernetip-io-traffic-with-wireshark-network-taps-vs-switch-port-mirroring
- Siemens Industry Support: “Network capture with Wireshark and Port Mirroring using SCALANCE X” https://support.industry.siemens.com/cs/document/109976057
B&R X2X and IO Systems
- B&R Automation: X20 System User’s Manual https://www.phb-electricite.fr/content/doc/br_automation/x20_system_manual.pdf
- Reddit r/PLC: “B&R X2X Link network troubleshooting” https://www.reddit.com/r/PLC/comments/p73low/br_x2x_link_network_troubleshooting/
- B&R Automation: X20BC0063 (X2X to PROFIBUS DP bus controller) https://www.br-automation.com/en/products/io-systems/x20-system/bus-controllers/x20bc0063/
Industrial Ethernet Switches
- Bihl+Wiedemann: “POWERLINK Fieldbus system” https://www.bihl-wiedemann.de/en/company/technological-foundations/bus-systems/powerlink
Academic and Research
- ResearchGate: “Attacking Fieldbus Communications in ICS: Applications to the SWaT Testbed” https://www.researchgate.net/publication/292612170_Attacking_Fieldbus_Communications_in_ICS_Applications_to_the_SWaT_Testbed
- ResearchInventy: “A Comprehensive Study of Cybersecurity in Fieldbus Protocols” http://www.researchinventy.com/papers/v15i9/15092732.pdf
Cross-References
- physical-layer-sniffing.md – physical wire-level signal analysis for fieldbus cables
- powerlink-internals.md – POWERLINK protocol internals and Wireshark capture
- x2x-protocol.md – X2X bus protocol wire-level details
- if2772-canopen.md – CAN bus protocol and CANopen analysis
- cp1584-forensics.md – extracting information from unknown CP1584 systems
- io-card-hardware.md – IO module hardware architecture and signal paths
- grounding-emc.md – grounding and EMC troubleshooting for signal integrity
- diagnostic-workstation.md – protocol analyzer and sniffer hardware recommendations
- network-architecture.md – B&R network topology and device enumeration
Document generated July 2026. Verify all URLs and tool versions before use. Industrial network sniffing should only be performed by qualified personnel following organizational safety and security policies.
Key Findings
- Wireshark with the POWERLINK plugin is the most accessible sniffing tool — it captures EPL traffic from any PC with a supported NIC in promiscuous mode. No expensive hardware required for basic POWERLINK diagnostics.
- X2X bus sniffing requires a logic analyzer — the proprietary protocol has no Wireshark decoder. A Saleae or Sigrok-compatible analyzer with ground clips on the X2X link connector is needed. See x2x-protocol.md for frame format details.
- CAN bus sniffing with PCAN or Vector tools is well-supported — the CANopen protocol on the B&R IF2772 is standard CiA 301, making commercial CAN analyzers fully capable. PDO/SDO mapping can be decoded with standard tools.
- Network tap placement matters — for POWERLINK, tap at the switch mirror port (not inline) to avoid timing disruption. For X2X, probe the backplane connector pins directly with the logic analyzer ground clips.
- Sniffing without disrupting production is the primary challenge — always use non-invasive methods (mirror ports, clamp-on current probes) on running machines. Reserve invasive probing for shutdown windows.
- The most common sniffing use case for undocumented machines is identifying which IO channel is failing — correlate captured sensor data with the IO module’s channel assignment to pinpoint the exact failing channel without any documentation.
eBPF-Based Telemetry for B&R (ABB) PLCs: Comprehensive Technical Analysis
Modern Linux-based B&R controllers (BX/BP series, X20 with embedded Linux) offer opportunities for deep runtime telemetry that were impossible on older VxWorks-based systems. This document explores using eBPF, strace, perf, and SystemTap to capture function calls, message data, and performance metrics from the B&R Automation Runtime — both live on a running controller and from captured dump files for post-mortem analysis of control program bugs. Where eBPF is not available, alternative approaches including ptrace-based tracing and LD_PRELOAD hooking are covered. Cross-references: ar-rtos.md for AR runtime internals, custom-diagnostic-tools.md for building diagnostic tools that run on the PLC, and python-diagnostics.md for external diagnostic scripting.
Table of Contents
- Executive Summary
- B&R Automation Runtime: OS Architecture
- eBPF Feasibility on B&R Controllers
- Alternative Tracing Approaches
- Capturing Function Calls from B&R Runtime
- Message Data Interception: POWERLINK/X2X/CAN
- Task Scheduling, Cycle Times, and Context Switch Monitoring
- Memory Access Monitoring: IO Reads/Writes
- B&R’s Built-in Tracing and Profiling Hooks
- Automation Studio Profiler
- Custom Telemetry Collectors Using B&R’s C/C++ SDK
- Live Monitoring vs. Dump-File Analysis
- Using perf to Profile B&R Tasks on VxWorks-Based Controllers
- Practical Limitations
- SDM and OPC-UA as Alternative Telemetry Paths
- SNMP Monitoring of B&R Hardware Health Metrics
- Recommended Telemetry Architecture
1. Executive Summary
eBPF cannot be used natively on B&R PLCs. Automation Runtime (AR) is based on VxWorks, not Linux. VxWorks does not implement eBPF. This fundamental OS-level constraint means all Linux-native tracing tools (eBPF/bpftrace, perf, SystemTap, strace, ftrace, LD_PRELOAD) are unavailable on standard B&R controllers.
However, B&R provides a rich set of built-in diagnostics tools, and several viable telemetry paths exist:
| Approach | Feasibility | Data Available |
|---|---|---|
| eBPF on AR (VxWorks) | Not possible | N/A |
| eBPF on hypervisor Linux side | Possible on dual-OS APCs | Linux-side data only |
| Automation Studio Profiler | Excellent | Task runtimes, cycle violations, CPU load |
| SDM (System Diagnostics Manager) | Excellent | Hardware status, IO, firmware, network |
| OPC UA Server | Excellent | Any PLC variable in real-time |
| Network Command Trace (NCT) | Good | POWERLINK/CAN bus traffic, commands |
| RTInfo / BRSystem library | Good | Cycle times, task info at application level |
| Custom C modules (AsIO, etc.) | Good | IO access, memory-mapped regions |
| SNMP | Good | Network config, hardware health |
| System Dump analysis | Good (post-mortem) | Full state snapshot |
2. B&R Automation Runtime: OS Architecture
2.1 Core OS: VxWorks-Based
B&R Automation Runtime (AR) is definitely based on VxWorks. This was confirmed by B&R engineering staff on the official community forum:
“Automation Runtime is definitely based on VxWorks. For sure, B&R developed a lot of additional functions, task class scheduling, drivers and abstraction layers needed for PLCs (that’s the reason why it’s called by its own name AutomationRuntime), but the base is still VxWorks until now.” — Alexander Hefner, B&R Community (May 2024) Source: https://community.br-automation.com/t/the-os-behind-ar/3303
Key implications of this architecture:
- Not Linux: Standard Linux tracing tooling (eBPF, perf, SystemTap, strace, LD_PRELOAD) does not apply to the real-time execution environment.
- RTOS with deterministic scheduling: VxWorks provides hard real-time guarantees with priority-based preemptive scheduling. B&R adds custom task class scheduling on top of this.
- Closed/proprietary: The runtime is a proprietary binary distribution. Source code and kernel headers are not available.
2.2 Dual-OS Systems: The Hypervisor
On B&R Automation PCs (APC series), a bare-metal hypervisor runs alongside a General Purpose OS (GPOS):
- Automation Runtime runs as the real-time partition (VxWorks-based)
- Windows IoT Enterprise LTSC or “B&R for Linux” (based on Ubuntu/Debian) runs as the standard partition
- Data exchange occurs via shared memory between partitions
This means on dual-OS APCs, eBPF is technically possible on the Linux side — but only for monitoring the Linux GPOS partition, not the real-time Automation Runtime partition.
Sources:
- https://www.br-automation.com/en-us/products/software/operating-systems/
- https://www.real-time-systems.com/fileadmin/benutzerdaten/real-time-systems/pdf/BnR_TR_17209_Hypervisor_EN.pdf
- https://www.br-automation.com/en/about-us/customer-magazine/2018/20189/two-operating-systems-on-one-device/
2.3 ARsim: Windows Simulation
ARsim (Automation Runtime Simulation) runs on the Windows development machine. It simulates the AR runtime but is not identical to the target execution. It is useful for debugging but does not expose VxWorks-level internals.
2.4 Controller Categories
| Controller Type | Base OS | eBPF Possible? | Notes |
|---|---|---|---|
| X20/X67 CPU modules | VxWorks (AR) | No | Standard PLC hardware |
| Power Panel / Panel PCs | VxWorks (AR) + optional GPOS | Only GPOS side | HMI + control |
| Automation PC (APC) | VxWorks (AR) + Windows/Linux | Only GPOS side | Dual-OS via hypervisor |
| ARsim on dev PC | Windows simulation | N/A | Not representative of target |
3. eBPF Feasibility on B&R Controllers
3.1 On Native AR (VxWorks-Based Controllers)
eBPF is not available. VxWorks does not implement the BPF virtual machine, BPF syscall interface, or any of the kernel infrastructure required for eBPF. This applies to all standard B&R controllers (X20, X67, Power Panel, etc.).
VxWorks has its own instrumentation framework (Wind River Workbench diagnostics, System Viewer), but these are proprietary and not accessible from user code without Wind River development tools.
3.2 On B&R for Linux (GPOS Partition of APC)
On dual-OS Automation PCs running “B&R for Linux”:
- The Linux partition runs a standard Linux kernel (Ubuntu-based)
- eBPF tools (bpftrace, bcc tools, bpftool) can theoretically be installed
- However, you can only monitor the Linux GPOS partition, not the real-time Automation Runtime
- The RTOS partition is isolated by the hypervisor; shared memory is the only communication channel
3.3 What eBPF Could Monitor on the Linux Side
If you deploy eBPF on the Linux partition of an APC:
| Data Point | Accessible? | Notes |
|---|---|---|
| Linux process scheduling | Yes | Standard bpftrace/perf |
| Network stack (TCP/IP) | Yes | But POWERLINK runs on RTOS side |
| File system I/O | Yes | SD card, USB, logging files |
| Shared memory reads/writes | Partially | Can observe the Linux-side end of shared memory transfers |
| PLC task execution | No | RTOS partition, not visible |
| POWERLINK/X2X bus traffic | No | RTOS drivers, not visible |
| IO module access | No | Hardware mapped to RTOS |
Source: https://github.com/SASE-Space/ot-openness-comparison/blob/main/README.md
4. Alternative Tracing Approaches
4.1 strace — System Call Tracing
Status: Not applicable to native AR.
strace relies on the Linux ptrace system call mechanism to intercept and record system calls made by a process. VxWorks has no equivalent mechanism accessible to user programs. The VxWorks kernel shell provides taskShow() and similar commands, but these are not equivalent to strace.
On the Linux GPOS partition of APCs, strace works normally for Linux-side processes.
4.2 perf — Performance Profiler
Status: Not applicable to native AR.
perf uses Linux kernel performance counters (perf_events subsystem) and hardware performance monitoring units (PMUs). These do not exist in the VxWorks kernel.
On the Linux GPOS partition, perf works for Linux processes. See Section 13 for details on VxWorks-specific profiling.
4.3 SystemTap — Dynamic Instrumentation
Status: Not applicable to native AR.
SystemTap requires Linux kernel headers, a compiled kernel module infrastructure, and the Linux kernel’s kprobes/jprobes mechanism. None of these exist in VxWorks.
4.4 LD_PRELOAD Hooking
Status: Not applicable to native AR.
LD_PRELOAD is a Linux dynamic linker feature that allows pre-loading shared libraries to intercept function calls. VxWorks uses its own module loading system (the Object Module Loader, or OML), which does not support this mechanism.
On the Linux GPOS partition, LD_PRELOAD works for Linux processes — but this still only monitors the GPOS side.
4.5 VxWorks-Specific Alternatives
VxWorks provides its own set of diagnostic tools:
| Tool | What it does | Access |
|---|---|---|
| VxWorks Kernel Shell | Interactive command-line on target | Requires shell access (SSH/serial) |
| Wind River Workbench System Viewer | Task-aware tracing with instrumentation | Requires WR development tools |
| Tracealyzer for VxWorks | Visual trace analysis of task scheduling | Third-party, requires instrumentation SDK |
| Lauterbach TRACE32 | Hardware debugger with trace capabilities | JTAG access required |
| GDB (cross-debug) | Source-level debugging | Requires debug symbols and GDB stub |
Source: https://www.windriver.com/blog/tracealyzer-for-vxworks-overview-and-getting-started-guide
5. Capturing Function Calls from B&R Runtime
5.1 The Runtime is Proprietary and Opaque
B&R’s runtime executables (BX/BP binaries compiled from Automation Studio) are proprietary compiled modules loaded by the AR kernel. There is no standard mechanism to:
- Hook into runtime function calls
- Set breakpoints in runtime internals
- Intercept function entry/exit without debug tools
- Dynamically instrument running code
5.2 What CAN Be Observed at the Application Level
Within your own IEC/ST/C programs running on the PLC, you can instrument code using:
-
RTInfo Function Block (BRSystem library): Provides cycle time, task index, and timing information for the current task context. Call
RTInfofrom within your program to get runtime statistics.Source: https://community.br-automation.com/t/cycle-time-in-fb/4372
-
AsBrStr library: String and logging functions for structured diagnostic output.
-
mapp View Trace: If using HMI components, mapp View provides tracing of user interactions and data flow.
-
User-defined logging: Write diagnostic data to data modules (persistent storage) or send via OPC UA/UDP to external collectors.
5.3 Automation Studio Debugger
Automation Studio provides a source-level debugger (C debugger and IEC debugger):
- Breakpoints, single-step, line coverage
- Watch windows for variable monitoring
- Disassemble view for compiled code
- Works online (connected to target) and in ARsim
This requires an active Automation Studio connection to the PLC and is primarily a development tool, not a production telemetry mechanism.
6. Message Data Interception: POWERLINK/X2X/CAN
6.1 POWERLINK
POWERLINK is B&R’s primary industrial Ethernet protocol, implemented as an open-source protocol stack (openPOWERLINK). It runs on standard Ethernet hardware.
At the software level on the PLC:
- POWERLINK communication is handled by AR kernel drivers
- User code does not directly access POWERLINK frames
- Data is exchanged through the process image (IO mapping)
Capturing POWERLINK traffic:
| Method | What you get | Requirements |
|---|---|---|
| Network Command Trace (NCT) | POWERLINK commands, timing, errors | Enabled in AS; captured in system dump |
| Ethernet tap (port mirror) | Full pcap capture of POWERLINK frames | Switch with port mirroring; openPOWERLINK Wireshark dissector |
| SDM POWERLINK diagnostics | Error counters, node status, link quality | Web browser access to SDM |
| OPC UA POWERLINK model | Configured data exchange objects | OPC UA server enabled; subscription-based |
| openPOWERLINK API (Linux) | Full stack control | Only on Linux-side, not on AR |
Sources:
- https://www.br-automation.com/en/technologies/powerlink/faq/
- https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2
- http://www.ftp.boss-bravo.fr/wiki/pdf/TM_BR/TM950TRE.40-ENG_POWERLINK%20Configuration%20and%20Diagnostics_V4000.pdf
6.2 X2X Link
X2X is B&R’s proprietary point-to-point connection protocol for I/O nodes (typically within a single station/bus controller).
Capturing X2X data:
- X2X is a proprietary, non-Ethernet protocol
- No packet capture mechanism exists
- Diagnostics available through SDM: node status, error counters, cycle synchronization
- I/O data visible through the process image (map to PLC variables)
6.3 CAN Bus
B&R controllers support CAN interfaces. CAN diagnostics are available through:
| Method | Data Available |
|---|---|
| ArCAN library (in user code) | CAN frame send/receive from user programs |
| SDM CAN diagnostics | Bus load, error counters, state |
| Network Command Trace | CAN commands logged |
| SDM web interface | Error frame counts, bus-off events |
6.4 Network Command Trace (NCT)
The Network Command Trace is a diagnostic tool built into AR that logs fieldbus communication events:
- Captures POWERLINK, CAN, and other bus commands
- Records timing, errors, and data transfer events
- Can be included in system dumps
- Enabled via Automation Studio diagnostic configuration
- Useful for post-mortem analysis of communication failures
Source: https://www.youtube.com/watch?v=aGNr5DICm8M (B&R “Troubleshoot Hardware Using Network Command Trace”)
7. Task Scheduling, Cycle Times, and Context Switch Monitoring
7.1 B&R Task Class Architecture
B&R AR uses task classes (TC#1 through TC#8+), each with a configurable cycle time:
| Task Class | Typical Cycle | Use Case |
|---|---|---|
| TC#1 (Cyclic#1) | 10 ms (default) | Fast control loops |
| TC#2 (Cyclic#2) | 100 ms | Standard logic |
| TC#3 (Cyclic#3) | 200 ms | Non-critical logic |
| TC#4-8 | User-defined | Various |
| Timer HSTC | Microsecond-range | High-speed timer tasks |
| Event classes | On-demand | Non-cyclic, triggered |
Higher-priority task classes can preempt lower ones. A cycle time violation occurs when a lower-priority task takes too long and prevents a higher-priority task from completing within its cycle.
7.2 Monitoring Task Scheduling
Built-in mechanisms:
-
Automation Studio Profiler (see Section 10): The primary tool for monitoring task execution, preemptions, cycle time consumption, and CPU load per task class.
-
RTInfo Function Block (BRSystem library): Returns the current task’s cycle time and runtime information. Sample from within any cyclic program.
(* Example: Monitor cycle time in ST *) rtInfo_0(enable := TRUE); currentCycleTime := rtInfo_0.cycleTime; -
Logger (Automation Studio): Captures cycle time violation events, errors, and warnings. Viewable online or exported from system dumps.
-
Watchdog monitoring: AR’s watchdog can be configured to trigger SERVICE mode on cycle time violations. The Logger records these events with timestamps.
7.3 Context Switch Visibility
Direct context switch monitoring (equivalent to Linux sched tracepoints or eBPF sched_switch) is not available on AR without Wind River’s proprietary instrumentation tools.
The Profiler provides the closest equivalent: it records task entry/exit events, preemption timing, and idle time — sufficient for most performance analysis needs.
8. Memory Access Monitoring: IO Reads/Writes
8.1 IO System Architecture
B&R uses a process image model:
- Inputs are mapped to
%IXaddresses - Outputs are mapped to
%QXaddresses - Memory areas:
%MX(flags),%MX(merker/flags),%LX(local),%MW(word memory)
IO is updated cyclically by the kernel at the start/end of each cycle. User code reads/writes the process image, not hardware directly.
8.2 Monitoring IO at the Application Level
AsIO library — B&R’s standard IO access library:
AsIOFListDP(): Get data pointers for IO objectsAsIORead(),AsIOWrite(): Direct IO read/write from C/C++ modules- Functions to enumerate IO channels, get mapping information
You can build a custom C module that periodically reads IO data and logs it:
AsIOFListDP() → get pointer to IO data area
memcpy() → copy data to telemetry buffer
Export via OPC UA or send via UDP
Source: https://community.br-automation.com/t/how-to-use-asio-library-function-asioflistdp-to-get-the-pointer-of-a-certain-io/3475
8.3 Watching IO via the Profiler
The Profiler does not capture individual IO read/write operations. It captures task-level timing, not data-level access patterns.
8.4 Watching IO via the Trace
Automation Studio’s Trace function can record variable values over time:
- Configure trace to sample specific variables at defined intervals
- Data is stored in a trace buffer and can be uploaded to Automation Studio
- Resolution limited by trace buffer size and sampling rate
8.5 Hardware-Level Monitoring (Not Possible from Software)
Direct hardware register access monitoring (equivalent to eBPF kprobe on ioread*/iowrite*) is not possible on B&R AR. The RTOS kernel handles all hardware access, and there is no user-space mechanism to observe or intercept it.
9. B&R’s Built-in Tracing and Profiling Hooks
9.1 Diagnostic Infrastructure Overview
B&R provides a comprehensive diagnostic infrastructure within Automation Runtime:
| Component | Purpose | Access Method |
|---|---|---|
| Logger | Event/error logging, cycle violations | AS online / system dump |
| Profiler | Task-level timing and scheduling | AS online / system dump |
| Network Command Trace | Bus communication events | System dump |
| System Diagnostics Manager | Web-based diagnostics | HTTP/HTTPS |
| System Dump | Full state capture | SDM / function block |
| Trace | Variable value recording | AS online |
| Watch | Real-time variable monitoring | AS online |
| ARsim Debugger | Source-level debugging | AS connected |
9.2 AsArProf Library
The AsArProf library provides programmatic control over the Profiler from within PLC code:
| Function Block | Action |
|---|---|
LogStop | Stop running profiler |
LogDeInstall | Remove existing profiler configuration |
LogInstall | Install profiler with custom parameters |
LogStart | Enable and start profiler |
LogStateGet | Query profiler state |
This allows automatic profiler activation on PLC startup, e.g., in an INIT program of TC#1:
- Call
LogStopto stop any running profiler - Call
LogDeInstallto remove old config - Call
LogInstallwith custom parameters (buffer size, recording entries) - Call
LogStartto begin recording - (Optional) Call
LogStateGetto verify
Source: https://community.br-automation.com/t/how-to-create-a-long-profiler-with-enough-data-for-analysis/493
9.3 Library Logging
Individual B&R libraries can be configured for verbose logging within the Profiler. This adds library-specific events (e.g., POWERLINK stack events, motion control events) to the profiler trace.
10. Automation Studio Profiler
10.1 What the Profiler Captures
The Automation Studio Profiler is the primary performance analysis tool for B&R PLCs:
- Task execution times: How long each task class takes per cycle
- Task preemptions: When a higher-priority task interrupts a lower one
- CPU idle time: Percentage of time the CPU is idle
- Cycle time violations: When a task exceeds its configured cycle time
- Non-cyclic task execution: Event-driven task timing
- Call counts: Number of times each task was invoked
- Unknown task detection: Tasks not properly accounted for in the buffer
10.2 Profiler Configuration
The Profiler stores data in circular buffers:
| Parameter | Default | Recommended |
|---|---|---|
| Number of recording entries | ~2000 | 15000+ for long traces |
| Buffer for created tasks | 10 | 50 |
| Buffer for created user tasks | 10 | 30 |
| Config storage | USRROM | USRROM |
| Data object storage | — | USRRAM or DRAM |
The profiler should run for at least 2x the longest task cycle time for meaningful data.
10.3 Profiler Workflow
- Connect Automation Studio to PLC
- Open > Profiler
- Configure buffer sizes (Configuration button)
- Install profiler on target
- Wait for capture period (10+ seconds typical)
- Stop profiler → Upload Data Object
- Analyze in Table view or Gantt-style timeline view
- Save configuration into project for persistence across reboots
10.4 Profiler Output Analysis
- Table view: Shows each task class with min/max/avg cycle time, CPU usage percentage
- Gantt view: Visual timeline of task execution and preemptions
- Export: Data can be part of system dumps for offline analysis
- Archived profilers: Automatic error profilers are created on cycle time violations (stored as
prfmod$f)
10.5 Limitations
- Requires Automation Studio connection (not a standalone tool)
- Buffer sizes limited by PLC memory (USRRAM/DRAM)
- Does not capture individual function/block execution times within a task
- Does not capture IO access patterns or message-level bus data
- No real-time streaming — data is collected in buffers and uploaded post-capture
Sources:
- https://community.br-automation.com/t/how-to-create-a-long-profiler-with-enough-data-for-analysis/493
- https://community.br-automation.com/t/maximum-cycle-time-violation/5749
11. Custom Telemetry Collectors Using B&R’s C/C++ SDK
11.1 Automation Runtime SDK
B&R provides a C/C++ development environment within Automation Studio for creating user modules (custom libraries and function blocks):
- ANSI C modules compiled for the VxWorks-based target
- Access to B&R runtime APIs (AsIO, AsTime, ArCAN, BRSystem, etc.)
- Compiled to
.BRfiles (binary runtime modules) - Runs as part of the cyclic task execution
11.2 Available Libraries for Telemetry
| Library | Telemetry Use |
|---|---|
| BRSystem | RTInfo for cycle times, task info, system timing |
| AsIO | IO access, data pointer enumeration, direct IO read/write |
| AsTime | High-resolution timestamps, time synchronization |
| ArCAN | CAN bus communication (send/receive frames, diagnostics) |
| AsUDP / AsTCP | Network communication (send telemetry to external collectors) |
| AsFile | File system access (write logs to SD card) |
| AsMem | Memory access functions |
| mapp components | Higher-level data logging and connectivity |
11.3 Building a Custom Telemetry Collector
Architecture for a C-based telemetry collector running on the PLC:
Cyclic Task (e.g., TC#2, 100ms)
├── Sample RTInfo → cycle time, task runtime
├── Read AsIO process image → IO values
├── Read ArCAN status → CAN bus counters
├── AsTime → high-resolution timestamp
├── AsUDP → send telemetry packet to collector server
└── AsFile → local buffer/log file
The collector runs as a standard PLC program, with access to all runtime APIs. It can:
- Aggregate metrics over time
- Compute moving averages, min/max, histograms
- Send to external systems via UDP/TCP
- Write to local storage for batch upload
11.4 OPC UA as Telemetry Export
Rather than raw UDP, the OPC UA server provides a structured telemetry path:
- Define telemetry variables in the Automation Studio project
- Enable OPC UA accessibility on each variable
- External OPC UA clients subscribe and receive updates at configurable rates
This is the recommended approach for production telemetry from B&R PLCs (see Section 15).
12. Live Monitoring vs. Dump-File Analysis
12.1 Live Monitoring
| Tool | Data | Latency | Production Use |
|---|---|---|---|
| Watch Window | Variable values | Real-time | Development only |
| Trace | Variable history | Real-time | Development only |
| Profiler | Task timing | Near real-time | Can run in production (with overhead) |
| OPC UA Server | Any PLC variable | Configurable (10ms+) | Production-ready |
| SDM Web UI | Hardware diagnostics | On-demand | Production-ready |
| SNMP | Hardware health | Polling interval | Production-ready |
12.2 Dump-File Analysis (Post-Mortem)
| Tool | Data | Trigger |
|---|---|---|
| System Dump | Full PLC state, logger, profiler, NCT | Manual (SDM/FB) or automatic (error) |
| Profiler upload | Task timing data | Manual capture |
| Trace upload | Variable history | Manual capture |
12.3 System Dump Contents
A system dump (XML-based, collected via SDM or SdmSystemDump() FB) contains:
- General target status
- Software modules and their versions
- System timing information
- Hardware modules: configuration, serial numbers, firmware versions
- IO status at dump timestamp
- Memory status
- Logger entries
- Profiler data
- Network Command Trace data
- Application information
Source: https://github.com/hilch/systemdump.py
12.4 Automating System Dumps
The systemdump.py tool (open-source) automates system dump creation and collection from the command line:
pip install systemdumpy
py -m systemdumpy 192.168.0.100 -cuv -p MyCPU_
This creates, uploads, and saves system dumps programmatically — useful for automated diagnostics pipelines.
Source: https://github.com/hilch/systemdump.py
12.5 Comparison
| Criterion | Live Monitoring | Dump Analysis |
|---|---|---|
| Visibility | Ongoing | Point-in-time snapshot |
| Overhead | Varies (OPC UA low, Profiler moderate) | Capture moment only |
| Automation | OPC UA subscriptions, SNMP polling | systemdump.py, SdmSystemDump() |
| Scope | Limited to configured variables | Comprehensive system state |
| Best for | Trending, dashboards, alerting | Root cause analysis, forensics |
13. Using perf to Profile B&R Tasks on VxWorks-Based Controllers
13.1 perf on VxWorks: Not Possible
The Linux perf tool is not available on VxWorks-based B&R controllers. perf requires:
- Linux perf_events kernel subsystem
- Hardware PMU access through Linux syscalls
- BPF or kernel module support for advanced tracing
None of these exist in VxWorks.
13.2 VxWorks Performance Analysis Tools
Wind River provides proprietary performance tools for VxWorks:
| Tool | What it does | Access |
|---|---|---|
| Wind River Workbench Profiler | Task-level profiling with timing data | Requires WR Workbench license |
| System Viewer | Event-based tracing with kernel/user instrumentation | Requires instrumentation SDK |
| Tracealyzer for VxWorks | Visual trace analysis, timeline view | Percepio product, requires SDK integration |
| VxWorks Kernel Shell | taskShow(), spShow(), memShow() | Shell access required |
| Lauterbach TRACE32 | Hardware-level trace, performance counters | JTAG debugger required |
13.3 Tracealyzer for VxWorks
Tracealyzer is the closest VxWorks equivalent to Linux perf/eBPF tracing:
- Records task scheduling events (start, stop, preemption)
- Provides timeline visualization of task execution
- Supports user-defined events (custom instrumentation points)
- Requires linking a recorder library into the application
- Limitation: Requires the Tracealyzer SDK and integration into the B&R build process, which is not straightforward given AR’s closed nature
Source: https://www.windriver.com/blog/tracealyzer-for-vxworks-overview-and-getting-started-guide
13.4 VxWorks Kernel Shell Commands
If shell access is available (SSH/serial), useful diagnostic commands include:
taskShow() /* List all tasks with stack usage and state */
spShow(taskId) /* Show details of a specific task */
memShow() /* Memory pool statistics */
iosShow() /* IO system status */
netShow() /* Network interface statistics */
13.5 Practical Takeaway
For profiling B&R PLC tasks, use the Automation Studio Profiler rather than trying to use VxWorks-level tools. The AS Profiler is purpose-built for B&R’s task class architecture and does not require additional licenses or access mechanisms.
14. Practical Limitations
14.1 What You CANNOT Monitor
| Constraint | Details |
|---|---|
| Individual function/block execution times | Profiler shows task-level timing only, not per-FB |
| Kernel-internal behavior | VxWorks kernel scheduling decisions are opaque |
| Hardware register access | No mechanism to observe IO hardware reads/writes |
| POWERLINK frame-level data (on-target) | Bus traffic captured only via NCT or external tap |
| X2X Link protocol data | Proprietary, no software-level capture mechanism |
| Memory-mapped IO timing | Not visible from user space |
| Interrupt latency | Requires hardware tools (Lauterbach/oscilloscope) |
| Real-time bus traffic | Must use external network tap + Wireshark |
14.2 What Requires Shell Access
Shell access (SSH or serial console) is needed for:
- VxWorks kernel shell commands (
taskShow,memShow, etc.) - File system browsing on the PLC
- Manual configuration changes not available via AS
- Network diagnostics (
ifconfig,ping, etc.)
Shell access is not enabled by default and requires:
- SSH component to be included in the AR configuration
- SSH credentials configured in the project
- Network access to the PLC
B&R has confirmed SSH is supported on VxWorks (as of VxWorks 6.5+), but enabling it is a configuration choice.
Source: https://community.br-automation.com/t/sftp-support/8247
14.3 What Requires Automation Studio Project Files
| Task | Requires AS Project? |
|---|---|
| Profiler configuration | Yes (or via AsArProf library in code) |
| OPC UA variable exposure | Yes (variable properties must be configured) |
| Trace configuration | Yes |
| Watch window | Yes (project connection) |
| System dump creation | No (SDM web UI works independently) |
| SNMP configuration | Yes (SNMP module must be in project) |
| Custom C modules | Yes (compiled in AS) |
14.4 What Requires Automation Runtime Source/License
| Task | Feasibility |
|---|---|
| Modify AR kernel behavior | Not possible (closed source) |
| Add custom VxWorks kernel modules | Not possible (AR controls kernel) |
| Use Wind River Workbench for profiling | Requires separate WR license, may not be compatible |
| Use Tracealyzer | Requires SDK integration (difficult with AR) |
| B&R for Linux customization | Possible on GPOS partition of APCs |
14.5 Production Safety Considerations
- The Profiler adds CPU overhead (buffer writes every cycle) — minimize buffer sizes or uninstall after capture
- OPC UA subscriptions add network overhead
- System dump creation can briefly pause the PLC
- Custom telemetry C modules must not violate cycle time constraints
- Any monitoring that adds latency can cause cycle time violations in fast tasks
15. SDM and OPC-UA as Alternative Telemetry Paths
15.1 System Diagnostics Manager (SDM)
SDM is an integral component of Automation Runtime V3.0 and higher, providing web-based diagnostics accessible from any browser:
URL: http://<PLC-IP>/sdm
Available data through SDM:
| Category | Data Points |
|---|---|
| Hardware Overview | Module status, serial numbers, firmware versions, temperatures |
| Network | Interface status, IP configuration, POWERLINK node status |
| IO System | Module configuration, channel status, error counts |
| Diagnostics | Event log, warnings, errors, cycle time violations |
| Memory | Memory usage, partition status |
| System Dump | Create and download full system dumps |
SDM is the primary recommended tool for hardware-level health monitoring of B&R PLCs.
Source: https://www.scribd.com/document/916397506/TM213TRE-40-EnG-Automation-Runtime-V4100-B-R-Acopos
15.2 OPC UA Server
B&R provides OPC UA servers and clients on every controller as a standard feature (no additional licensing required):
- OPC UA server runs directly on the PLC
- Port 4840 (standard OPC UA)
- Supports both OPC UA client and server roles
- Any PLC variable can be exposed via OPC UA
- Subscription-based real-time updates
- Compliant with IEC 62443 security standards (AS 6.0+)
Setting up OPC UA telemetry:
- In Automation Studio, open the CPU configuration
- Enable OPC UA Server in the configuration
- For each variable to monitor, set OPC UA accessibility in variable properties
- OPC UA clients (SCADA, MES, custom collectors) subscribe to variables
OPC UA information models:
- B&R provides two OPC UA information models for representing PLC data
- Custom NodeId mapping available
- PLCopen function blocks for OPC UA server/client in user code
Sources:
- https://www.automation.com/article/br-adds-opc-ua-to-automation-studio-software
- https://opcua.brhelp.cn/OPC%2520UA%20Information%2520models.pdf
- http://soup01.com/en/2023/08/31/brautomation-studio_part04_configure-an-opc-ua-server-2/
15.3 Building an OPC UA-Based Telemetry Pipeline
B&R PLC
└─ OPC UA Server (port 4840)
├─ PLC variables (cycle times, IO data, status flags)
├─ mapp component data
└─ Custom telemetry variables from C modules
│
▼
OPC UA Collector (e.g., Telegraf, custom Python/C++ client)
│
▼
Time-Series Database (InfluxDB, TimescaleDB, Prometheus)
│
▼
Dashboard / Alerting (Grafana, etc.)
15.4 OPC UA FX (TSN)
B&R is moving toward OPC UA FX (Field eXchange) over TSN as the next-generation protocol, potentially replacing POWERLINK for new installations. This provides native OPC UA-based telemetry with TSN timing guarantees.
Source: https://www.reddit.com/r/PLC/comments/1pux2cf/is_br_making_a_mistake_choosing_opc_ua_fx_over/
16. SNMP Monitoring of B&R Hardware Health Metrics
16.1 SNMP Support
B&R PLCs support SNMP for network configuration and remote monitoring:
- SNMP v2c and v3 supported (v3 for authentication/encryption)
- SNMP agent runs as part of Automation Runtime
- Requires SNMP module to be included in the AS project configuration
- Standard MIB-II support for network interfaces
- B&R-specific private MIB for hardware diagnostics
16.2 Available SNMP Data
| Category | OID Range | Data |
|---|---|---|
| System description | 1.3.6.1.2.1.1 | System name, uptime, contact |
| Interface status | 1.3.6.1.2.1.2 | Network interface counters, status |
| Network (IP/ICMP/TCP/UDP) | 1.3.6.1.2.1.4-7 | Protocol statistics |
| B&R private MIB | Vendor-specific | Module status, hardware health, temperatures |
16.3 brsnmp — Open-Source Tool
brsnmp (https://github.com/hilch/brsnmp) is a C++ Windows command-line tool that executes PVI-SNMP commands for B&R PLCs. It requires the B&R PVI Development Setup to be installed (PVI 4.x or PVI 6.5.2+). Without a PVI license, PVI Manager runs for 2 hours then must be restarted.
Download the pre-built Windows binary from https://github.com/hilch/brsnmp/releases
Basic usage:
brsnmp --list
brsnmp --filter=X20CP1584 --details
brsnmp --filter=macAddress.+00-60-65-3a-39-10 --ipAddress=192.168.1.50
Capabilities:
- Remote network configuration via SNMP
- Hardware monitoring queries
- Integration with standard SNMP monitoring tools (Zabbix, Nagios, PRTG, etc.)
Source: https://github.com/hilch/brsnmp
16.4 SNMP Monitoring Integration
B&R PLC (SNMP Agent)
└─ snmpd on Automation Runtime
├─ Standard MIB-II data (interfaces, system)
└─ B&R private MIB (hardware health)
│
▼
SNMP Manager (Zabbix, Nagios, LibreNMS, PRTG)
│
▼
Alerts / Dashboards
16.5 SNMP Limitations
- No real-time PLC data: SNMP cannot access process variables, IO data, or cycle times
- Network/hardware only: Primarily useful for infrastructure monitoring (network interfaces, hardware status)
- Requires SNMP module: Must be included in the AS project; not enabled by default
- Polling-based: Not event-driven (unless combined with SNMP traps)
- Cannot replace OPC UA: For PLC application data, OPC UA is the proper protocol
17. Recommended Telemetry Architecture
17.1 For Production Monitoring
┌─────────────────────────────────────────────────┐
│ B&R PLC │
│ │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ OPC UA Server│ │ SNMP Agent │ │
│ │ (port 4840) │ │ (port 161) │ │
│ └──────┬───────┘ └───────────┬──────────────┘ │
│ │ │ │
│ ┌──────┴───────┐ │ │
│ │ Custom C │ │ │
│ │ Telemetry │ │ │
│ │ Module │ │ │
│ │ (via AsIO, │ │ │
│ │ RTInfo, etc)│ │ │
│ └──────────────┘ │ │
└─────────┬──────────────────────┬──────────────────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ OPC UA │ │ SNMP │
│ Collector │ │ Manager │
│ (Telegraf, │ │ (Zabbix, │
│ Node-OPCUA) │ │ LibreNMS) │
└──────┬───────┘ └──────────────┘
│
▼
┌──────────────┐
│ Time-Series │
│ DB │
│ (InfluxDB, │
│ TimescaleDB)│
└──────┬───────┘
│
▼
┌──────────────┐
│ Grafana / │
│ Alerting │
└──────────────┘
17.2 For Deep Diagnostics (Post-Mortem)
- System Dump via SDM or
SdmSystemDump()function block - Upload with
systemdump.pyor AS - Analyze Profiler data, Logger entries, NCT data
- Correlate with OPC UA historical data
17.3 For Development
- Automation Studio Profiler (primary)
- Watch windows + Trace (variable-level)
- AS Debugger (source-level)
- Network Command Trace (bus diagnostics)
- SDM web interface (hardware status)
Appendix A: Source References
| Topic | Source |
|---|---|
| AR is VxWorks-based | https://community.br-automation.com/t/the-os-behind-ar/3303 |
| Hypervisor dual-OS | https://www.real-time-systems.com/fileadmin/benutzerdaten/real-time-systems/pdf/BnR_TR_17209_Hypervisor_EN.pdf |
| B&R OS products | https://www.br-automation.com/en-us/products/software/operating-systems/ |
| B&R for Linux | https://www.br-automation.com/en-us/products/software/operating-systems/operating-systems-components-and-versions/br-for-linux/ |
| IT-OT integration | https://www.br-automation.com/en/about-us/press-room/new-freedom-through-it-ot-integration-09-12-2020/ |
| Profiler configuration guide | https://community.br-automation.com/t/how-to-create-a-long-profiler-with-enough-data-for-analysis/493 |
| RTInfo function block | https://community.br-automation.com/t/cycle-time-in-fb/4372 |
| AsIO library | https://community.br-automation.com/t/how-to-use-asio-library-function-asioflistdp-to-get-the-pointer-of-a-certain-io/3475 |
| systemdump.py | https://github.com/hilch/systemdump.py |
| brsnmp | https://github.com/hilch/brsnmp |
| awesome-B-R resources | https://github.com/hilch/awesome-B-R |
| OPC UA information models | https://opcua.brhelp.cn/OPC%2520UA%20Information%2520models.pdf |
| OPC UA in AS | https://www.automation.com/article/br-adds-opc-ua-to-automation-studio-software |
| OPC UA FX direction | https://www.reddit.com/r/PLC/comments/1pux2cf/is_br_making_a_mistake_choosing_opc_ua_fx_over/ |
| POWERLINK open source | https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2 |
| POWERLINK FAQ | https://www.br-automation.com/en/technologies/powerlink/faq/ |
| POWERLINK diagnostics | http://www.ftp.boss-bravo.fr/wiki/pdf/TM_BR/TM950TRE.40-ENG_POWERLINK%20Configuration%20and%20Diagnostics_V4000.pdf |
| NCT troubleshooting | https://www.youtube.com/watch?v=aGNr5DICm8M |
| SDM CVE (context) | https://www.abb.com/global/en/company/about/cybersecurity/alerts-and-notifications |
| SDM in AR manual | https://www.scribd.com/document/916397506/TM213TRE-40-EnG-Automation-Runtime-V4100-B-R-Acopos |
| AR overview manual | http://www.ftp.boss-bravo.fr/wiki/pdf/TM_BR/TM213TRE.40-ENG_Automation%2520Runtime_V4100.pdf |
| AS diagnostics manual | https://www.scribd.com/document/356519728/TM223TRE.40-EnG-Automation-Studio-Diagnostics-V4200 |
| SSH on VxWorks | https://community.br-automation.com/t/sftp-support/8247 |
| SNMP X20 PLC | https://community.br-automation.com/t/x20-plc-support-for-snmp-v2-v3-sample-project-inquiry/5829 |
| Tracealyzer for VxWorks | https://www.windriver.com/blog/tracealyzer-for-vxworks-overview-and-getting-started-guide |
| VxWorks kernel shell | https://learning.windriver.com/vxworks-kernel-shell |
| Linux tracing systems comparison | https://jvns.ca/blog/2017/07/05/linux-tracing-systems/ |
| eBPF tracing intro | https://www.brendangregg.com/blog/2016-12-27/linux-tracing-in-15-minutes.html |
Appendix B: Quick Reference — Can I Monitor This?
| What | How | Production-Ready? |
|---|---|---|
| Task cycle times | RTInfo FB, Profiler, OPC UA | Yes |
| Task preemptions | Profiler only | Yes (with overhead) |
| CPU load per task | Profiler only | Yes (with overhead) |
| PLC variable values | OPC UA, Watch, Trace | Yes (OPC UA) |
| IO channel values | OPC UA (mapped variables), AsIO in C | Yes |
| POWERLINK node status | SDM, OPC UA model | Yes |
| POWERLINK frame data | External tap + Wireshark | Yes (passive) |
| CAN frame data | ArCAN library, OPC UA | Yes |
| X2X Link data | Process image variables only | Partial |
| Memory usage | SDM, system dump | Post-mortem only |
| Hardware temperatures | SDM, SNMP | Yes |
| Network interface stats | SNMP, SDM | Yes |
| Firmware versions | SDM, system dump, SNMP | Yes |
| Error/warning events | Logger, OPC UA, SDM | Yes |
| Individual FB execution time | Not available | No |
| Kernel scheduling decisions | Not available | No |
| Hardware register access | Not available | No |
| Interrupt latency | Requires external measurement | No |
Last updated: July 2026
SystemDumpViewer for Post-Mortem Analysis
B&R system dumps contain logger data, memory snapshots, task states, and hardware status. The community SystemDumpViewer tool provides a GUI for inspecting these dumps without B&R support portal access.
Installation and Usage:
## Download from the awesome-B-R repository
## https://github.com/br-automation-community/awesome-B-R
## SystemDumpViewer is a Java-based GUI tool
java -jar SystemDumpViewer.jar SystemDump.xml
Alternatively, systemdump.py (https://github.com/hilch/systemdump.py) provides command-line parsing:
pip install systemdump.py
systemdump --input SystemDump.xml --summary
systemdump --input SystemDump.xml --logger
systemdump --input SystemDump.xml --hardware
What the tools extract:
- Logger entries (errors, warnings, info) with timestamps
- Task cycle time statistics (min, max, average per task)
- Memory usage per task
- Hardware status (temperatures, voltages, module states)
- Stack traces for crashes (if captured)
This is the closest thing to eBPF-style post-mortem tracing available for B&R systems. See diagnostics-sdm.md for SDM system dump download procedures.
Key Findings
- eBPF is NOT directly usable on B&R AR/VxWorks — the VxWorks kernel does not support eBPF infrastructure. All eBPF monitoring approaches require running on a separate Linux host, not on the PLC itself.
- The most practical monitoring approach is network-level capture — use Wireshark/tshark to capture POWERLINK, OPC-UA, and Modbus traffic from a mirror port or tap. This reveals communication patterns without PLC access.
- System dump analysis is the primary post-mortem diagnostic tool — the SDM system dump captures logger data, memory snapshots, and hardware state. It is the closest thing to “telemetry” available for B&R AR systems.
- PVI variable monitoring from a PC provides real-time telemetry — the PVI API allows continuous variable polling at rates matching task cycle times. Combined with Python scripting, this creates a powerful external monitoring system.
- strace/perf are irrelevant for the CP1584 — these tools require Linux on the target. For AR internals monitoring, use SDM, the AS Profiler, and the RTInfo function block.
- For debugging control program bugs specifically, the most effective approach is the AS Logger with backtrace (for crashes), Trace/oscilloscope (for timing), and IecCheck (for runtime bounds checking).
Cross-References
| Related File | Relevance |
|---|---|
ar-rtos.md | AR OS architecture (VxWorks vs Linux), process model, and system call interface |
diagnostics-sdm.md | SDM web interface for real-time hardware monitoring and system dump downloads |
system-variables.md | B&R system variables for CPU temperature, memory usage, and task cycle times |
hardware-monitoring.md | Temperature sensors, voltage rails, and hardware health metrics on the CP1584 |
pvi-api.md | PVI API for external variable polling and telemetry data collection from Python/C |
python-diagnostics.md | Python scripts for automated telemetry collection and diagnostic reporting |
iiot-retrofit.md | MQTT, SNMP, and time-series data logging for modern monitoring dashboards |
execution-model.md | Task scheduling, cycle times, and watchdog behavior relevant to performance profiling |
powerlink-internals.md | POWERLINK protocol capture and analysis with Wireshark |
network-architecture.md | Network topology, POWERLINK/Ethernet switching, and VLAN configuration for telemetry data paths |
io-sniffing.md | X2X and fieldbus traffic interception for IO-level diagnostics |
custom-diagnostic-tools.md | Building diagnostic programs that run ON the PLC using the B&R C/C++ SDK |
opcua.md | OPC-UA subscriptions for real-time variable monitoring and alarm events |
B&R CP1584 Compact Flash Card Boot Sequence — Complete Technical Reference
The Compact Flash card is the heart of a B&R CP1584 system — it contains the operating system, firmware, user program, hardware configuration, and all runtime data. Understanding every file on the CF card, their load order, and what happens at each boot stage is critical when you need to modify a program without Automation Studio, recover from a corrupted card, or diagnose boot failures on a legacy machine with no OEM support. This document provides a file-by-file analysis of the CF card contents, the complete boot sequence, and practical procedures for imaging, modifying, and recovering CF card data. Cross-references: bootloader-recovery.md for recovery when the CF card is missing or corrupted, firmware.md for firmware architecture details, and config-file-formats.md for configuration file formats.
Table of Contents
- Overview
- CF Card Hardware Requirements
- CF Card Partition Structure
- File System and Directory Layout
- File Types and Their Purposes
- Boot Sequence — Stage by Stage
- Runtime Operating States
- How AR Determines Which Program to Execute
- Network Configuration Files
- User Partition Structure
- Imaging and Analyzing CF Card Contents
- Modifying Boot Parameters Without Automation Studio
- Changing the Loaded Program Binary Manually
- Backup and Restore Procedures
- CF Card Corruption and Missing Card Scenarios
- Creating a Bootable CF Card from Scratch
- Safe Boot Modes and Recovery Options
- Sources
1. Overview
The B&R CP1584 (also referenced as X20CP1584) is an Industrial PC controller from B&R Automation. It runs Automation Runtime (AR), B&R’s proprietary real-time operating system built on top of VxWorks. The controller boots from an Industrial Compact Flash (CF) card that contains the bootloader, operating system kernel, hardware configuration, and compiled user program.
Key characteristics of the CP1584 platform:
- CPU: x86-based Intel processor
- OS: B&R Automation Runtime (based on Wind River VxWorks)
- Boot media: Compact Flash card (industrial-grade, SLC or high-endurance MLC)
- File system: FAT16 or FAT32 (depending on card size and AR version)
- HMI: None (headless controller — no integrated display)
- Communication: Ethernet (Gigabit), POWERLINK, X2X Link, RS232, USB, plus optional interface modules (CAN, Modbus, etc.)
The entire boot process, runtime environment, and user application are stored on the CF card. Without a valid CF card, the controller cannot boot.
2. CF Card Hardware Requirements
Industrial-Grade Cards Only
B&R controllers are extremely picky about CF card compatibility. Consumer-grade CF cards typically will not work for booting because:
- Missing bootable media flag: Consumer CF cards do not set the “Fixed Disk / Bootable” flag in their ATA identification data. The BIOS requires this flag to attempt booting from the CF card.
- No wear leveling controller: Consumer cards lack the multi-partition controller needed for the 4-partition layout.
- Limited write endurance: Consumer MLC flash may fail after thousands of write cycles; industrial SLC cards handle hundreds of thousands.
- Temperature range: Industrial cards operate -40°C to +85°C; consumer cards typically 0°C to +70°C.
Known Compatible Cards
- SiliconDrive SSD series (e.g., SSD-C64M-3076, part number 5CFCRD.0064-03) — used in Power Panel 300/400
- B&R branded CF cards (part numbers starting with 5CFCRD)
- Siemens SIMATIC industrial CF cards (similar bootable flag requirements)
- Cards with ATA “Fixed Disk” identification set by the manufacturer
Card Sizes
- Older systems (Power Panel 300, early X20): 64MB — 256MB (FAT16)
- Mid-range systems (X20 CP1584 era): 128MB — 1GB (FAT16/FAT32)
- Newer systems: 1GB — 8GB (FAT32)
Warning
Cloning partition tables and files to a consumer CF card will not work even with identical data. The boot process hangs at “Attempting to boot a Hard Drive… VxLD 1.4.1” indefinitely because the BIOS does not recognize the card as a boot device.
3. CF Card Partition Structure
B&R typically creates up to 4 partitions on a CF card. This is one of the reasons consumer CF cards fail — they often lack the on-card controller that can maintain multiple partitions.
Partition Layout
┌─────────────────────────────────────────────┐
│ Master Boot Record (MBR) │
│ - Partition table with 4 entries │
│ - VxWorks bootloader signature │
├─────────────────────────────────────────────┤
│ Partition 1: Active System Partition │
│ - FAT16 or FAT32 │
│ - Contains: bootloader (VxLD), AR kernel, │
│ hardware config, user program │
│ - Boot flag: ACTIVE (0x80) │
├─────────────────────────────────────────────┤
│ Partition 2: Passive / Update Partition │
│ - FAT16 or FAT32 │
│ - Mirror/update partition for fail-safe │
│ updates (used by Runtime Update feature) │
│ - Boot flag: INACTIVE (0x00) │
├─────────────────────────────────────────────┤
│ Partition 3: User Partition │
│ - FAT16 or FAT32 │
│ - Contains: user data files, SystemDump │
│ data, file device storage, recipes, logs │
│ - Non-bootable │
├─────────────────────────────────────────────┤
│ Partition 4: Diagnostic / Utility │
│ - Optional, may not exist on all cards │
│ - Contains: diagnostic logs, crash dumps, │
│ service mode data │
├─────────────────────────────────────────────┤
│ Remaining space (unpartitioned) │
└─────────────────────────────────────────────┘
Active vs. Passive Partition
B&R uses an A/B partition scheme for fail-safe updates:
- Active partition (A): Currently booted and running. Contains the live bootloader + AR + program.
- Passive partition (B): Updated in the background during Runtime Update. On next reboot, if the passive partition is valid, the system switches to boot from it. If boot fails, it falls back to the old active partition.
This dual-partition approach ensures that a failed firmware or program update does not brick the controller.
Partition Types
The MBR partition type IDs used:
0x06— FAT16 (for smaller cards ≤ 2GB)0x0Bor0x0C— FAT32 (for larger cards)- The active partition has the boot flag (
0x80) set in byte 0 of the MBR partition entry
4. File System and Directory Layout
Active System Partition Directory Tree
/ (Root of Active Partition)
├── VxLD — VxWorks Loader (bootloader executable)
├── brconfig.sys — Automation Runtime system configuration
├── autoexec.bat — Optional startup commands (legacy)
├── boot.ini — Boot configuration / boot parameters
├── CPUTemp.ini — CPU temperature monitoring settings
├── *.sys — System driver files
├── *.dll — Runtime libraries
├── *.bin — Binary blobs (kernel extensions, firmware)
│
├── Flash/
│ ├── Project/ — Project folder for Power Panel systems
│ │ ├── *.apj — Automation Studio project file
│ │ ├── *.acp — Compiled automation component package
│ │ ├── *.br — B&R runtime binary
│ │ ├── *.pc — Program configuration
│ │ ├── *.obj — Compiled object modules
│ │ ├── *.par — Parameter/configuration files
│ │ ├── Hardware.hwl — Hardware configuration description
│ │ ├── Hardware.hw — Hardware configuration binary
│ │ └── *.sys — Additional system files
│ └── *.log — Runtime and application log files
│
├── Mynte/ — Automation Runtime package directory
│ ├── X86/ — x86 architecture binaries
│ │ ├── APP/ — Application programs
│ │ │ ├── *.acp — Compiled automation components
│ │ │ ├── *.br — Runtime binaries
│ │ │ ├── *.obj — Object modules
│ │ │ └── *.par — Parameter files
│ │ ├── ACP/ — Automation Component Packages
│ │ ├── SYS/ — System modules
│ │ └── SAFETY/ — Safety application (Safe Series)
│ └── CONFIG/ — Configuration data
│
├── System/ — System-level files and drivers
│ ├── *.sys — Kernel drivers
│ ├── *.dll — Shared libraries
│ └── *.bin — Binary components
│
├── Config/ — Configuration directory
│ ├── *.ini — INI configuration files
│ ├── *.par — Parameter files
│ └── *.xml — XML configuration
│
├── Temp/ — Temporary files
│
├── Log/ — Runtime and application logs
│ ├── *.log — Log files
│ └── SystemDump/ — System crash dump files
│
└── RAS/ — Remote Access Service files (optional)
Directory Path Variations by Controller Model
| Controller Series | Project Path on CF Card |
|---|---|
| X20 (CP1484/CP1584/CP3484) | /Mynte/X86/APP/ |
| Power Panel 400/500 | /Flash/Project/ |
| Power Panel 300 | /Flash/ |
| Automation PC (APC) | /Mynte/ACP/ |
| Safe Series (Safety) | /Mynte/SAFETY/ |
5. File Types and Their Purposes
Boot and System Files
| File Extension | Full Name | Purpose |
|---|---|---|
| (VxLD) | VxWorks Loader | First-stage bootloader. Loaded by BIOS from the CF card. Responsible for loading the VxWorks kernel and Automation Runtime into RAM. The “VxLD 1.4.1” string is printed during early boot. |
| .sys | System File | Driver files and kernel extensions loaded by AR during initialization. brconfig.sys is the primary AR system configuration file. |
| .bin | Binary | Raw binary blobs — kernel images, firmware updates, hardware-specific binary data. |
Configuration Files
| File Extension | Full Name | Purpose |
|---|---|---|
| .apj | Automation Project | Automation Studio project file. Contains the project structure, references to hardware configuration, program organization, and library references. XML-based format. |
| .hwl | Hardware List | Human-readable hardware configuration description file. Lists all hardware modules, their ordering, addresses, and parameters in a structured text format. |
| .hw | Hardware Binary | Compiled binary version of the hardware configuration. Generated from the .hwl file. Contains the precise hardware topology that AR uses to initialize the I/O system. |
| .par | Parameter File | Runtime parameter configuration. Contains tunable parameters for the application and hardware — IP addresses, cycle times, watchdog settings, module-specific parameters. |
| .ini | Initialization File | Standard INI-format configuration files. CPUTemp.ini configures CPU temperature monitoring thresholds. boot.ini may contain boot selection parameters. |
| brconfig.sys | B&R Config System | Master Automation Runtime configuration. Contains OS-level settings: startup sequence, memory allocation, task class definitions, driver parameters, network boot settings. |
Program Files
| File Extension | Full Name | Purpose |
|---|---|---|
| .acp | Automation Component Package | Compiled automation component — the primary executable unit in B&R’s system. Contains compiled PLC logic (ladder, ST, CFC, etc.), HMI visualization, and library references. This is the machine-code representation of the user program. |
| .br | B&R Runtime Binary | Runtime binary file. Contains compiled runtime components including task definitions, function blocks, and data modules. Can include both user code and standard library modules. |
| .pc | Program Configuration | Program configuration file. Defines program structure: task classes, cycle times, program entry points, module ordering. Links .obj files together. |
| .obj | Object Module | Compiled object file — intermediate binary module. Generated by the Automation Studio compiler from individual source files. Linked together during the build process. In the deployed form, these are the individual runtime modules loaded by AR. |
Other Files
| File Extension | Full Name | Purpose |
|---|---|---|
| .log | Log File | Runtime log output — boot sequence, errors, warnings, user program messages. |
| .dll | Dynamic Link Library | Shared libraries used by AR and user programs. |
| .rta | Runtime Archive | Backup archive of the entire runtime. Created by Automation Studio’s “Receive Runtime Archive from Target” function. Contains all compiled modules, configuration, and system files. |
| .zp2 / .zp3 | Zipped Partition Image | Compressed disk image format used by Runtime Utility Center. .zp2 = dual image, .zp3 = triple image. Contains sector-level backup of the entire CF card (or specific partitions). |
| .pkg | Package | Automation Studio project package — the full source project in a single distributable file. This is the source, not compiled code. |
6. Boot Sequence — Stage by Stage
Stage 1: Power-On and BIOS POST (0–3 seconds)
Power On
│
├─ CPU reset, x86 real-mode entry at 0xFFFF0
├─ BIOS POST: RAM test, CPU init, bus scan
├─ Detect CF card on IDE/CF interface
├─ Read CF card ATA identification data
│ └─ Verify "Fixed Disk" flag (industrial cards only)
├─ Read MBR from CF card (sector 0)
├─ Parse partition table, find ACTIVE partition
└─ Load first sector of active partition (VBR)
What happens: The x86 BIOS performs standard POST. It enumerates the CF card as an IDE drive. If the CF card does not report as a “Fixed Disk” (consumer cards typically report as “Removable”), the BIOS may skip it or fail to boot. The BIOS reads the MBR, identifies the active partition, loads the Volume Boot Record (VBR), which then loads the bootloader.
Stage 2: VxWorks Loader — VxLD (3–8 seconds)
VxLD 1.4.1 Loading...
│
├─ Reads FAT filesystem from active partition
├─ Locates and loads VxWorks kernel image (vxWorks)
├─ Loads kernel symbol table (if present)
├─ Parses kernel boot parameters from brconfig.sys
├─ Initializes minimal hardware (CPU, RAM, interrupt controller)
├─ Transfers control to VxWorks kernel entry point
└─ Display: "BR Automation Runtime B4.XX booting..."
What happens: The VxLD bootloader is the second-stage loader. It understands the FAT filesystem, reads the VxWorks kernel binary from the CF card, loads it into RAM, and jumps to its entry point. The VxLD version string (e.g., “VxLD 1.4.1”) appears on the display during this phase. If the bootloader cannot find the kernel, the system hangs here.
Stage 3: VxWorks Kernel Initialization (8–15 seconds)
VxWorks kernel startup
│
├─ Kernel data structures initialization
├─ Memory subsystem initialization (MMU, virtual memory)
├─ Interrupt controller setup
├─ Timer initialization (system clock)
├─ Task scheduler initialization
├─ Load AR kernel modules (*.sys, *.dll from /System/)
├─ Initialize I/O subsystem
├─ Initialize file system drivers (FAT driver for CF access)
├─ Mount CF card partitions
└─ Start Automation Runtime initialization
What happens: The VxWorks kernel initializes its core subsystems. B&R has extended VxWorks with custom task class scheduling, I/O management, abstraction layers, and drivers specific to their hardware platform. The kernel mounts the CF card filesystem(s) so that AR can access its configuration and programs.
Stage 4: Automation Runtime Initialization (15–25 seconds)
Automation Runtime initialization
│
├─ Read brconfig.sys for system configuration
├─ Initialize task class scheduler
│ └─ Task Class 1 (highest priority, cyclic)
│ └─ Task Class 2
│ └─ ...
│ └─ Task Class N (lowest priority, background)
├─ Load and initialize hardware configuration (Hardware.hw)
├─ Scan and initialize hardware modules
│ └─ CPU I/O modules
│ └─ X2X bus modules
│ └─ Fieldbus interfaces
│ └─ Communication interfaces (Ethernet, etc.)
├─ Initialize network stack
│ └─ Read IP configuration from .par or brconfig.sys
│ └─ Configure Ethernet interface
│ └─ Set hostname
├─ Initialize file devices
│ └─ User partition mount point
│ └─ FTP server
│ └─ OPC UA server (if configured)
└─ Enter INIT state
What happens: AR loads its configuration, sets up the real-time task class scheduler (a key B&R differentiator — task classes provide deterministic scheduling), initializes all hardware from the Hardware.hw configuration, and sets up networking. The system is now in the INIT state but no user programs are running yet.
Stage 5: User Program Loading (25–35 seconds)
User program loading
│
├─ Locate program in active partition
│ └─ Search path: /Flash/Project/ or /Mynte/X86/APP/
├─ Load compiled modules (*.acp, *.br, *.obj)
├─ Resolve library dependencies
├─ Link modules together
├─ Load parameter files (*.par)
├─ Initialize program data areas (retain persistent variables)
├─ Execute INIT routines (if configured)
│ └─ User INIT code runs once
└─ Start cyclic task execution
What happens: AR loads the compiled user program from the CF card. It reads the program configuration (.pc files) to determine which modules to load, loads the compiled binary modules (.acp, .br, .obj), and links them together. If the program was previously running and had persistent data, AR restores the retained data from the CF card. INIT routines run once (configurable), then the cyclic tasks begin.
Stage 6: RUN State (35+ seconds)
RUN state
│
├─ All task classes running cyclically
│ └─ Task Class 1: highest priority cyclic tasks
│ └─ Task Class 2: ...
│ └─ Background tasks (HMI update, communication)
├─ Network services active
│ └─ Ethernet/IP
│ └─ OPC UA
│ └─ HTTP (SDM - System Diagnostics Manager)
│ └─ FTP
├─ HMI visualization running (if applicable)
├─ LED indicators: RUN solid green
└─ Ready for Automation Studio connection
Boot State LED Indicators
| LED State | Meaning |
|---|---|
| RUN solid green | Normal RUN state — all task classes executing |
| RDY/F flashing | Boot in progress / INIT state |
| RUN flashing + RDY/F solid | SERVICE mode — task classes stopped, diagnostics available |
| RUN + RDY/F both solid | BOOT mode — AR failed to load or CF card issue |
| Both off | No power, or pre-BIOS stage |
| All flashing alternately | DIAG mode — hardware failure or critical error |
7. Runtime Operating States
B&R Automation Runtime has several operating states that the controller transitions through during boot and operation:
State Diagram
┌──────────────────────────────────────┐
│ POWER ON │
└──────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────┐
│ BOOT mode │
│ (No CF card, or CF card not bootable)│
└──────────────┬───────────────────────┘
│ CF card valid, AR loads
▼
┌──────────────────────────────────────┐
│ INIT state │
│ (AR loaded, hardware initialized, │
│ user program loading) │
└──────────────┬───────────────────────┘
│ INIT routines complete
▼
┌──────────────────────────────────────┐
│ CONF / CONFIG state │
│ (System configured, tasks not started) │
└──────────────┬───────────────────────┘
│ Configuration complete
▼
┌──────────────────────────────────────┐
│ RUN state │
│ (All task classes executing normally) │
└──────────────┬───────────────────────┘
│ Error detected
▼
┌──────────────────────────────────────┐
│ SERVICE mode │
│ (Task classes stopped, │
│ system accessible for diagnostics) │
└──────────────┬───────────────────────┘
│ Critical error
▼
┌──────────────────────────────────────┐
│ DIAG mode │
│ (Diagnostic mode, AR boot failed) │
└──────────────────────────────────────┘
State Descriptions
-
BOOT mode: The controller has power but could not load Automation Runtime. This means the CF card is missing, corrupted, not recognized, or the bootloader/kernel is damaged. The display may show “BOOT mode” text. No network services are available.
-
INIT state: AR is loaded and initializing. Hardware modules are being detected and configured. This is a transient state during normal boot.
-
CONF state: System is fully configured but tasks have not yet started. This state is brief during normal boot but can be entered during configuration changes.
-
RUN state: Normal operating state. All user-defined task classes are executing cyclically. Network services are active. Automation Studio can connect and perform online changes.
-
SERVICE mode: No task classes are running. Triggered by: runtime errors (divide by zero, cycle time violation, page fault, access violation), major transfer operations, or manual warm restart. The system is accessible via Ethernet (SDM at
http://<IP>/sdm) and the logger is available for diagnostics. A warm restart exits service mode if the error condition is resolved. -
DIAG mode: Automation Runtime failed to boot correctly. Triggered by: corrupted CF card memory, kernel panic, or fatal hardware failure. More severe than service mode — AR is not fully operational.
How to Transition Between States
| From | To | Method |
|---|---|---|
| BOOT | INIT | Insert valid CF card + warm restart |
| INIT | CONF | Automatic (after INIT routines complete) |
| CONF | RUN | Automatic (after configuration applied) |
| RUN | SERVICE | Error condition, warm restart, or manual trigger |
| SERVICE | RUN | Warm restart (if error resolved) |
| SERVICE | DIAG | Unrecoverable error |
| Any | BOOT | Cold power cycle with no/invalid CF card |
| Any | INIT | Warm restart with valid CF card |
8. How AR Determines Which Program to Execute
Program Discovery Sequence
Automation Runtime follows a deterministic search order to locate and load the user program:
- Read boot configuration from
brconfig.sys— may specify an explicit program path - Check Hardware.hw for the program module list — the hardware configuration references the program components
- Search standard directories in order:
/Flash/Project/(Power Panel controllers)/Mynte/X86/APP/(X20 controllers including CP1584)/Mynte/ACP/(Automation PC controllers)
- Load the .pc (Program Configuration) file — this is the entry point that defines the program structure
- Load referenced modules (.acp, .br, .obj) as specified in the .pc file
- Load parameter files (.par) for module configuration
- Verify module integrity — checksums and version compatibility
Program-to-Hardware Binding
The program is tightly coupled to the hardware configuration:
- The
.hwfile describes the exact hardware topology (module types, positions, addresses) - The
.pcfile references specific modules that expect certain hardware to be present - If the actual hardware does not match the
.hwconfiguration, AR will not enter RUN state - This is why programs are hardware-specific and cannot simply be moved between different controller models
Runtime Archive (.rta) Loading
When using Automation Studio’s “Download Runtime to Target”:
- The .rta file contains all program modules + hardware config + AR system files
- AS writes these to the active partition of the CF card
- The system is configured to load from the newly written files on next boot
- The passive partition may be updated simultaneously for redundancy
9. Network Configuration Files
IP Address Configuration
Network settings are stored in multiple possible locations depending on the AR version and configuration method:
-
Hardware configuration (.hw / .par files): The primary location. When you configure the Ethernet interface in Automation Studio’s Physical View → CPU → ETH node, the IP address, subnet mask, and gateway are embedded in the hardware configuration.
-
brconfig.sys: May contain override network parameters.
-
Parameter files (.par): Can contain IP-related parameters that are applied at runtime.
Default Network Settings
| Setting | Default Value |
|---|---|
| IP Address | 0.0.0.0 (DHCP) or 192.168.1.10 (factory default varies by model) |
| Subnet Mask | 255.255.255.0 |
| Gateway | 0.0.0.0 (none) |
| Hostname | “br-automation” (configurable in Ethernet configuration) |
Setting IP Without Automation Studio
-
Via SDM (System Diagnostics Manager): Access
http://<current_IP>/sdmin a web browser. Navigate to network configuration and set static IP. -
Via CF card: Mount the CF card, navigate to the project’s configuration directory, and edit the relevant
.parfile to change the IP address values. This requires understanding the binary or text format of the parameter file. -
Via B&R Service Tool (RUC): Runtime Utility Center can set IP addresses during CF card generation.
-
Via Ethernet Setting Mode: On some X20 controllers, hold the RUN/STOP switch in a specific position during power-on to enter an Ethernet configuration mode where the default IP 192.168.100.1 is activated.
10. User Partition Structure
Purpose
The user partition (Partition 3) provides persistent storage for:
- User data files (recipes, configuration data, measurement logs)
- SystemDump files (crash dump data written after fatal errors)
- File device storage (arbitrary user files accessible via AR file functions)
- Application-generated data (CSV exports, data logging)
Setting Up the User Partition
The user partition must be configured to be usable:
-
During CF card creation: Automation Studio or Runtime Utility Center can create the user partition when generating the CF card.
-
Via Automation Studio: In the CPU configuration, set up a “File Device” that points to the user partition.
-
Programmatic: Use the AR
FileDeviceCreate()function to define a file device pointing to the user partition.
File device mapping:
User Partition → /USER/ (or configured mount point)
Active Partition → /SYSTEM/
Important Notes
- RUC (Runtime Utility Center) cannot repartition an existing CF card. If no user partition exists, you cannot create one through RUC alone — you must recreate the CF card from scratch via Automation Studio’s “Generate Compact Flash” or “Offline Install” feature.
- The user partition survives program updates and AR updates (it is not overwritten during normal operations).
- SystemDump data is written to the user partition when configured via
SysDumpsettings.
User Partition Directory Structure
/ (Root of User Partition)
├── data/ — User data files
├── recipes/ — Recipe data
├── logs/ — Application-generated logs
├── SystemDump/ — Crash dump files
│ ├── dump_XXXXX.sys — Individual dump files
│ └── ...
├── backup/ — User backups
└── *.csv, *.txt, etc. — Application data files
11. Imaging and Analyzing CF Card Contents
Method 1: dd (Linux)
Sector-by-sector imaging of the entire CF card:
# Create image from CF card
dd if=/dev/sdX of=/path/to/backup.img bs=512 status=progress
# Write image to new CF card
dd if=/path/to/backup.img of=/dev/sdX bs=512 status=progress
# Verify image integrity
dd if=/dev/sdX of=/dev/null bs=512 status=progress
md5sum /path/to/backup.img
# Create compressed image
dd if=/dev/sdX bs=512 status=progress | gzip > /path/to/backup.img.gz
Where /dev/sdX is the CF card device (verify with lsblk or fdisk -l).
Method 2: Win32DiskImager (Windows)
1. Download Win32DiskImager from https://win32diskimager.org/
2. Insert CF card via USB reader
3. Select the CF card drive letter
4. Click "Read" to create an image file
5. Click "Write" to restore an image to a new card
Method 3: HDD Raw Copy Tool (Windows)
1. Download from https://hddguru.com/software/HDD-Raw-Copy-Tool/
2. Select source CF card
3. Create .imgc (compressed raw image) file
4. Restore to target CF card
This tool is recommended by industrial automation technicians for CF card cloning.
Method 4: B&R Runtime Utility Center (Official)
1. Insert CF card into PC reader
2. Launch Runtime Utility Center (RUC)
3. Press F9 → "Generate Compact Flash"
4. Click "Select disk" → choose CF card
5. Click "Create image file from CF"
6. Image saved as .zp2 or .zp3 format
To restore:
1. RUC → Tools → Restore CF Card Image
2. Select .zp2/.zp3 file
3. Select target CF card
4. Write image
The .zp2/.zp3 format is B&R proprietary and contains metadata about the image in addition to the raw partition data.
Method 5: Automation Studio — Runtime Archive
1. Connect to controller via Ethernet
2. Transfer → Receive Runtime Archive from Target
3. Saves as .rta file
To restore:
1. Transfer → Download Runtime to Target
2. Select .rta file
3. Downloads to CF card via Ethernet (requires AR to be running)
Mounting and Analyzing CF Card Partitions (Linux)
# Identify CF card device
lsblk
# Mount active partition (first partition)
sudo mount /dev/sdX1 /mnt/cf_active -t vfat
# Mount user partition (third partition)
sudo mount /dev/sdX3 /mnt/cf_user -t vfat
# Explore
ls -laR /mnt/cf_active/
ls -laR /mnt/cf_user/
# Examine partition table
sudo fdisk -l /dev/sdX
sudo parted /dev/sdX print
# Hexdump MBR
sudo dd if=/dev/sdX bs=512 count=1 | xxd
# Extract individual files
cp -r /mnt/cf_active/Flash/ /tmp/flash_backup/
12. Modifying Boot Parameters Without Automation Studio
Editing Configuration Files Directly on the CF Card
- Remove CF card from controller (power down first!)
- Mount on PC using a CF card reader
- Navigate to the configuration directory
- Edit the relevant file with a text or hex editor:
IP Address in Parameter Files
Location: /Flash/Project/ or /Mynte/X86/APP/
File: *.par (parameter file, may be text or binary)
If text format, edit IP address values directly.
If binary format, use a hex editor to locate and modify IP octets.
Boot Configuration in brconfig.sys
Location: / (root of active partition)
File: brconfig.sys
This file may be binary or text. If text, edit boot parameters directly.
Common parameters include:
- Default boot partition
- Kernel boot arguments
- Memory allocation settings
- Driver initialization options
Changing the Active Boot Partition
Use fdisk (Linux) or diskpart (Windows) to toggle the ACTIVE flag:
Linux: sudo fdisk /dev/sdX → use 'a' command to toggle boot flag
Windows: diskpart → select disk → select partition → active
Then swap partition contents between active and passive partitions
to boot from the updated partition.
Warnings
- Always backup the CF card before editing — a single corrupted byte can prevent booting.
- Do not edit binary files with a text editor — use a hex editor.
- Verify file checksums after editing if available.
- Test on a spare CF card first if possible.
13. Changing the Loaded Program Binary Manually
Method 1: Copy Program Files to CF Card
If you have a compiled program (from Automation Studio or from another working controller):
- Backup the existing CF card (dd image)
- Mount the active partition on a PC
- Navigate to the program directory:
- X20:
/Mynte/X86/APP/ - Power Panel:
/Flash/Project/
- X20:
- Replace the program files:
- Copy new
.acp,.br,.obj,.pcfiles - Copy matching
.hwand.hwlfiles (hardware must match!) - Copy matching
.parparameter files
- Copy new
- Safely eject the CF card
- Insert into controller and power on
Method 2: Swap Active/Passive Partition
If the passive partition already contains the desired program (e.g., from a previous update):
- Use fdisk/diskpart to make the passive partition active
- Boot the controller — it will now load from the formerly-passive partition
- Verify program operation
Method 3: Replace Individual Modules
AR loads modules individually based on the .pc file. You can:
- Identify which .obj module corresponds to which program function
- Replace individual .obj files on the CF card
- Keep the .hw and .pc files unchanged (unless hardware changed)
- Boot and verify
Critical Constraints
- The hardware configuration (.hw) must match the physical hardware exactly. If you copy a program from a CP1584 to a CP1484, it will fail.
- Library modules must be compatible with the AR version on the CF card.
- The .pc file references modules by name — renamed or missing modules will cause load failure.
- Persistent/retained variables may cause unexpected behavior if the data layout changed.
14. Backup and Restore Procedures
Backup Methods (Ranked by Completeness)
1. Full CF Card Image (Most Complete)
# Linux
dd if=/dev/sdX of=/backup/cp1584_backup_$(date +%Y%m%d).img bs=512 status=progress
# Also backup MBR separately for safety
dd if=/dev/sdX of=/backup/mbr_backup.bin bs=512 count=1
This captures everything: MBR, partition table, all partitions, bootloader, OS, program, user data.
2. Runtime Utility Center Image (.zp2/.zp3)
RUC → F9 → Generate CF → Create image file from CF
Creates compressed image with B&R metadata. Recommended official method.
3. Runtime Archive (.rta)
Automation Studio → Transfer → Receive Runtime Archive from Target
Captures the compiled runtime (program + hardware config + system files) but NOT the bootloader or partition structure. Requires Ethernet connection to a running controller.
4. Individual File Backup
1. Mount CF card
2. Copy entire directory tree:
- /Flash/ or /Mynte/ (program and configuration)
- /Config/
- brconfig.sys, VxLD, boot.ini
- All .apj, .acp, .br, .pc, .obj, .hw, .hwl, .par files
- Log files
3. Note: this misses the MBR, partition table, and bootloader
Restore Procedures
Restoring a Full Image
# Verify target card is correct!
lsblk
# Write image
dd if=/backup/cp1584_backup.img of=/dev/sdX bs=512 status=progress
CRITICAL: The target CF card must be identical in capacity or larger, and must be an industrial-grade card with the bootable flag.
Restoring via RUC
RUC → Tools → Restore CF Card Image → select .zp2/.zp3 → select target disk
Restoring via Automation Studio
1. Create a new project for the target hardware
2. Transfer → Download Runtime to Target → select .rta
3. This requires AR to already be running on the target
Best Practices
- Always create backups after any program change
- Store original Automation Studio project files (.pkg) in version control (Git, SVN)
- Keep multiple backup copies: full image (.img), RUC image (.zp3), and runtime archive (.rta)
- Label CF cards with controller serial number and backup date
- Schedule periodic CF card replacement every 3-5 years (industrial cards have finite write endurance)
- Never remove CF card while controller is powered on
15. CF Card Corruption and Missing Card Scenarios
Missing CF Card
Symptoms:
- Display shows: “no boot device present, halting”
- No LED activity
- No network connectivity
- Controller is completely non-functional
Resolution: Insert a valid CF card and perform warm restart.
Corrupted Boot Sector / MBR
Symptoms:
- Display shows: “Attempting to boot a Hard Drive… VxLD 1.4.1” then hangs
- Continuous reboot loop
- No progress beyond bootloader stage
Cause:
- Improper shutdown (power loss during write)
- CF card wear-out (exceeded write cycle limit)
- Physical card damage
- Corrupted partition table
Resolution:
- Remove CF card and create a sector-by-sector backup using dd or HDD Raw Copy
- Attempt to repair using
fdiskor test disk tools - If repair fails, restore from backup image
- If no backup exists, recreate CF card from scratch (see Section 16)
Corrupted File System
Symptoms:
- Boot progresses past VxLD but AR fails to start
- Controller enters DIAG mode
- Display shows: “BOOT mode: Diagnosis” or “BOOT mode: Service”
- Runtime error messages in log files
Cause:
- Power interruption during file write
- Excessive write cycles degrading flash cells
- File system metadata corruption
Resolution:
- Mount CF card on PC and check file system integrity
- Copy off all readable files
- Run filesystem check:
fsck.vfat -a /dev/sdX1 - If repairable, restore missing/corrupted files from backup
- If not repairable, restore from full image backup
Corrupted User Program
Symptoms:
- AR boots successfully (past INIT state)
- Controller enters SERVICE mode after attempting to run user program
- Cycle time violations or page fault errors in logger
Cause:
- Program file corruption (power loss during download)
- Incompatible program version
- Missing library modules
Resolution:
- Connect via Automation Studio or SDM to read error logs
- Re-download the program from Automation Studio
- If no AS project available, restore from .rta backup
Intermittent Boot Failures
Symptoms:
- Sometimes boots successfully, sometimes fails
- Random reboots during operation
Cause:
- Failing CF card (intermittent bad sectors)
- Loose CF card connector
- Failing card reader pins
Resolution:
- Reseat CF card firmly
- Replace CF card (clone first)
- Inspect card reader pins for damage
16. Creating a Bootable CF Card from Scratch
Method 1: Automation Studio — Generate Compact Flash (Recommended)
This is the official and most reliable method.
1. Open Automation Studio
2. Create a new project or open existing project
3. Configure hardware (Physical View) to match the target controller:
- Add the correct CPU module (X20CP1584)
- Configure I/O modules matching physical hardware
- Configure Ethernet interface (set IP address)
4. Build the project (Ctrl+Shift+B)
5. Online → Create Configuration → select "Compact Flash"
OR
In Automation Studio, use "Transfer" → "Download to Target"
with a CF card connected via USB reader
6. Automation Studio writes:
- MBR and partition table
- Active partition with bootloader, AR, program
- Passive partition (if configured)
- User partition
7. Verify the card boots in the target controller
Method 2: Automation Studio — Offline Install
For larger systems where CF card is too small for the full AR installation:
1. In Automation Studio: Tools → Offline Install
2. Select target AR version
3. Create installation media on CF card or USB stick
4. Insert into controller and boot — AR installs from media
Method 3: Manual Creation (Advanced, Not Recommended)
Creating a CF card from scratch without Automation Studio requires:
- Industrial CF card with bootable flag
- Bootloader binary (VxLD) — must match target AR version
- AR kernel and modules — from B&R service pack or extracted from backup
- Hardware configuration (.hw, .hwl) — matching physical hardware
- User program files (.acp, .br, .obj, .pc) — compiled and matching
# Create partition table
sudo fdisk /dev/sdX
# Create 3-4 primary partitions
# Set partition 1 as ACTIVE (bootable)
# Partition 1: FAT16, ~200MB (or more for larger programs)
# Partition 2: FAT16, ~200MB (passive/backup)
# Partition 3: FAT16/FAT32, remaining space (user)
# Format partitions
sudo mkfs.vfat -F 16 /dev/sdX1
sudo mkfs.vfat -F 16 /dev/sdX2
sudo mkfs.vfat -F 16 /dev/sdX3
# Mount and copy files
sudo mount /dev/sdX1 /mnt/cf
# Copy bootloader, kernel, AR modules, hardware config, program
sudo cp VxLD /mnt/cf/
sudo cp brconfig.sys /mnt/cf/
sudo cp -r System/ /mnt/cf/
sudo cp -r Mynte/ /mnt/cf/
sudo cp -r Flash/ /mnt/cf/
sudo cp -r Config/ /mnt/cf/
sudo umount /mnt/cf
# Install bootloader to MBR/VBR
# (This is the tricky part — requires the correct VBR with
# VxLD chain-loading code, which is specific to B&R's setup)
Method 4: Clone from Working Card
If you have a working CF card:
# Full sector-by-sector clone
dd if=/dev/sdX of=/dev/sdY bs=512 status=progress
The target card must be identical capacity and industrial-grade.
17. Safe Boot Modes and Recovery Options
Warm Restart (Controlled Restart)
- Trigger: Automation Studio command, SDM web interface, RUN/STOP switch
- Effect: AR shuts down gracefully, saves persistent data, restarts from CF card
- Use for: Recovering from SERVICE mode, applying configuration changes
Cold Restart (Power Cycle)
- Trigger: Physical power off → wait → power on
- Effect: Full hardware reset, complete boot from scratch
- Use for: Clearing transient errors, full system restart
BOOT Mode Recovery
When the controller is in BOOT mode (no AR loaded):
- Check CF card insertion — reseat the card
- Verify CF card is industrial-grade with bootable flag
- Connect via serial console (if available) for diagnostic output
- Replace CF card with known-good backup
- Use Runtime Utility Center to create a new CF card from backup image
SERVICE Mode Recovery
When the controller is in SERVICE mode:
- Access SDM at
http://<IP>/sdm— available even in SERVICE mode - Open Logger in Automation Studio or SDM to identify the error
- Review backtrace to find the code location that caused the fault
- Common causes:
- Cycle time violation (code stuck in loop or blocking IO in fast task)
- Page fault / access violation (writing beyond array/string bounds)
- Divide by zero
- Library module incompatibility
- Fix the code in Automation Studio, re-download
- Warm restart to exit SERVICE mode
DIAG Mode Recovery
When the controller is in DIAG mode:
- CF card corruption is likely — the AR kernel failed to fully initialize
- Remove CF card and create a backup (dd image) before attempting repair
- Restore from known-good backup image
- If no backup, recreate CF card from scratch using Automation Studio
- Check for hardware problems — damaged card reader, CPU failure
Emergency Recovery via USB
Some newer B&R controllers support automatic AR installation from USB:
1. Create a USB flash drive (FAT16/FAT32) with AR installation files
2. Download AR service pack from B&R website (www.br-automation.com)
3. Extract to USB drive
4. Insert USB into controller
5. Power on — AR detects USB and offers to install
Recovery via Serial Console
For advanced debugging:
1. Connect serial console cable to controller's serial port
2. Terminal settings: 57600 baud (factory default), 8N1, no flow control. If no output appears, try 9600 or 115200.
3. Boot output includes detailed VxWorks kernel messages
4. Can access VxWorks shell for low-level diagnostics
Key Findings
- Consumer CF cards will not work even with identical partition data cloned onto them — the BIOS requires the ATA “Fixed Disk” flag that only industrial-grade cards (B&R 5CFCRD series) set; the boot hangs at “VxLD 1.4.1” indefinitely on consumer cards.
- The boot sequence has 6 distinct stages from BIOS POST through VxLD bootloader loading, VxWorks kernel init, Automation Runtime initialization, user program loading, to full RUN state — failures at different stages point to different root causes (hardware vs. OS vs. application).
- The A/B (Active/Passive) partition scheme provides fail-safe updates — firmware and program updates are written to the passive partition first; on reboot the system switches to it only if valid, falling back to the old active partition if the new one fails, which prevents bricking during updates.
- The SYSTEM partition must contain at minimum: VxLD bootloader, brconfig.sys (master AR configuration), the VxWorks kernel, Hardware.hw (compiled hardware topology), and the compiled user program (.acp/.br/.pc/.obj files) in
/Mynte/X86/APP/for X20 controllers. - Boot parameters (IP address, kernel arguments) can be modified without Automation Studio by mounting the CF card on a PC and editing
.parfiles orbrconfig.sys— but always image the card first since a single corrupted byte prevents booting, and binary files require a hex editor, not a text editor. - The hardware configuration (.hw) is tightly coupled to the physical I/O topology — programs cannot be moved between different controller models or different I/O configurations without matching the .hw file to the actual hardware, or AR will refuse to enter RUN state.
- Four imaging methods are available ranked by completeness: (1) full sector-level
ddimage captures everything including MBR, (2) Runtime Utility Center .zp2/.zp3 with B&R metadata, (3) Automation Studio .rta runtime archive (misses bootloader and partition structure), (4) individual file copy (misses MBR and partition table). - Runtime Utility Center cannot repartition an existing CF card — if you need a user partition that doesn’t exist, the entire card must be recreated from scratch via Automation Studio’s Offline Installation.
18. Cross-References
| Related File | Relevance |
|---|---|
bootloader-recovery.md | Recovery procedures when the CF card is corrupted or missing |
firmware.md | B&R firmware architecture, SRAM/flash/user partition memory model |
firmware-version-mgmt.md | AR version compatibility and firmware update paths |
config-file-formats.md | Detailed format reference for every configuration file on the CF card |
access-recovery.md | Password recovery and accessing the CF card via FTP without credentials |
ftp-web-interface.md | FTP server access to CF card partitions for remote backup and inspection |
cp1584-forensics.md | Extracting information from a running CP1584, including CF card contents |
ar-rtos.md | Automation Runtime OS internals and kernel boot process |
retentive-data.md | Battery-backed SRAM data preservation during CF card swaps |
online-changes.md | Saving modified programs back to the CF card for persistence |
19. Sources
B&R Official Documentation
- B&R Automation Runtime Overview and Setup (TM213) — https://www.br-automation.com
- B&R Automation Studio Quick Start (MASYS2ASQS) — https://instrumentacionycontrol.net
- B&R BIOS Upgrade Documentation — https://www.br-automation.com/en/downloads/industrial-pcs-and-panels/power-panel-100200/bios-upgrade/
- B&R Automation Runtime Product Page — https://www.br-automation.com/en-us/products/software/automation-runtime/
B&R Community Forum Discussions
- “How to get PLC to go from boot mode to run mode?” — https://community.br-automation.com/t/how-to-get-plc-to-go-from-boot-mode-to-run-mode/5866
- “Configuration Files deleted in CF card” — https://community.br-automation.com/t/configuration-files-deleted-in-cf-card/8210/11
- “The OS behind AR” — https://community.br-automation.com/t/the-os-behind-ar/3303
- “User Program trigger Execution of Init and Exit Routine” — https://community.br-automation.com/t/user-program-trigger-execution-of-init-and-exit-routine/3718
- “Arsim fails to boot” — https://community.br-automation.com/t/arsim-fails-to-boot/1638
- “CF Card stops functioning once variable is changed” — https://community.br-automation.com/t/cf-card-stops-functioning-once-variable-is-changed/2827
- “Creating a CF Card With Files From Mapp Backup” — https://community.br-automation.com/t/creating-a-cf-card-with-files-from-mapp-backup/1987
- “USER partition not creating” — https://community.br-automation.com/t/user-partition-not-creating/4654
- “Service Mode - What is it and how to collect diagnostics” — https://community.br-automation.com/t/service-mode-what-is-it-and-how-to-collect-diagnostics/1613
- “How can I save SystemDump data on the user partition” — https://community.br-automation.com/t/how-can-i-save-systemdump-data-on-the-user-partition-of-the-cf-card/2454
- “Shipping CompactFlash Card” — https://community.br-automation.com/t/shipping-compactflash-card/2033
- “CPU x20cp1584 cannot find target” — https://community.br-automation.com/t/cpu-x20cp1584-cannot-find-target/5019
Third-Party Technical Resources
- Industrial Monitor Direct: “B&R PCMCIA CF Card Backup and Restore Procedure” — https://industrialmonitordirect.com/blogs/knowledgebase/br-pcmcia-cf-card-backup-and-restore-procedure
- Industrial Monitor Direct: “B&R Power Panel 400 CF Card Boot Failure and Program Backup Procedures” — https://industrialmonitordirect.com/blogs/knowledgebase/br-power-panel-400-cf-card-boot-failure-and-program-backup-procedures
- Industrial Monitor Direct: “Uploading B&R Project from CF Card in Automation Studio” — https://industrialmonitordirect.com/blogs/knowledgebase/uploading-br-project-from-compact-flash-card-in-automation-studio
- Industrial Monitor Direct: “How to Backup B&R CF Card Using Runtime Utility Center” — https://industrialmonitordirect.com/blogs/knowledgebase/br-cf-card-backup-using-runtime-utility-center
- DMC Inc: “B&R Automation — Changing Automation Runtime Configurations” — https://www.dmcinfo.com/blog/26437/br-automation-changing-automation-runtime-configurations/
- B&R Process Control: CF Upgrade Instructions — https://www.process-control.com/wp-content/uploads/b-r-cf-upgrade-instructions.pdf
Community Forum Discussions (PLCTalk, Reddit)
- PLCtalk: “Do B&R Industries Power Panel 300 work only with specific models of CF cards?” — https://www.plctalk.net/forums/threads/do-b-r-industries-power-panel-300-work-only-with-specific-models-of-cf-cards.145986/
- PLCtalk: “B&R X20 service mode” — https://www.plctalk.net/forums/threads/b-r-x20-service-mode.91845/
- PLCtalk: “B&R CP476 upload” — https://www.plctalk.net/forums/threads/b-r-cp476-upload.55486/page-3
- Reddit r/PLC: “B&R PLC Program Loading” — https://www.reddit.com/r/PLC/comments/1amxzp6/br_plc_program_loading/
- Reddit r/PLC: “B&R 5PC600 5X02-00 Boot Mode: Diagnosis, Service” — https://www.reddit.com/r/PLC/comments/nd94vw/br_5pc600_5x0200_boot_mode_diagnosis_service/
Technical References
- Scribd: Runtime Utility Center Overview — https://www.scribd.com/document/938093397/03-RuntimeUtilityCenter-V4-7-10-6-2016-EN
- VxWorks Boot Process (general reference) — https://medium.com/@knownsec404team/analysis-of-vxworks-boot-process-and-overflow-testing-599897fb862b
- HDDGURU Raw Copy Tool — https://hddguru.com/software/HDD-Raw-Copy-Tool/
- Win32DiskImager — https://win32diskimager.org/
Document generated from research across B&R official documentation, community forums, and third-party technical resources. Some details are inferred from VxWorks general behavior and B&R community knowledge — verify against your specific AR version and hardware manual.
Related Documents
- firmware.md — B&R firmware architecture, AR version landscape, memory layout, and firmware update mechanisms
- bootloader-recovery.md — Recovery procedures when the CF card is corrupted or the PLC won’t boot
- config-file-formats.md — Detailed format reference for every configuration file on the CF card
- ar-rtos.md — Automation Runtime OS internals including VxWorks boot process and security vulnerabilities
- ftp-web-interface.md — FTP-based remote access to CF card contents for backup and diagnostics
- cp1584-forensics.md — Extracting information from a running CP1584 without project files
- access-recovery.md — Gaining initial access to an undocumented PLC, including CF card backup procedures
- execution-model.md — Task class scheduling and how task configuration is loaded from CF card
- memory-map.md — CPU memory regions including how CF card partitions map to the address space
- retentive-data.md — Battery-backed SRAM data preservation during CF card swaps and cold restarts
- project-reconstruction.md — Rebuilding an AS project from CF card contents
- diagnostics-sdm.md — Using SDM to monitor CF card health and boot errors
- cp1584-hardware-ref.md — CP1584 physical interfaces, CF card slot, and hardware specifications
- online-changes.md — How CF card persistence works when making online changes to running programs
- spare-parts.md — Sourcing replacement CF cards and certified media
- remanufacturing.md — Migration from CF-card-based CP1584 to SD-card-based newer controllers
B&R X2X Link Protocol — Wire-Level Technical Reference
Scope: B&R (Bernecker + Rainer, now ABB) X2X Link and X2X+ backplane/remote-I/O bus systems used in the X20, X67, and Compact-S product families.
Date: July 2026 — Compiled from official B&R datasheets, system manuals, community posts, and third-party technical articles.
Table of Contents
- Protocol Overview
- Physical Layer
- X2X Frame Format and Wire-Level Encoding
- Timing, Bit Rate, and Synchronization
- Node Addressing
- Protocol Versions — X2X Link vs X2X+
- Error Handling and Diagnostics
- Sniffing / Tapping X2X Traffic
- Decoding IO Card Sensor Data at the Protocol Level
- Pinpointing Failing IO Modules / Channels from Captured Traffic
- Tools for X2X Analysis
- Component Reference Tables
- Source URLs and References
1. Protocol Overview
X2X Link is B&R’s proprietary real-time deterministic bus protocol designed for:
- Backplane communication between I/O modules on the X20/X67 bus bases
- Remote I/O expansion up to 100 m from the controller
- Providing a single unified protocol for both local (backplane) and remote (cable) I/O, eliminating the need for separate fieldbus-to-I/O gateways
Key characteristics:
| Property | Value |
|---|---|
| Protocol type | Proprietary, master-slave, cyclic deterministic |
| Media | PCB traces (backplane) + twisted-pair copper cable (remote) |
| Topology | Daisy-chain / multi-drop |
| Max bus speed | 12 Mbps (X2X Link) |
| Max segment length | 100 m per segment (remote cable) |
| Max slave nodes | 62 per master (X20BT9100 / X20BR9300) |
| Cycle time | 0.5 ms to 10 ms (configurable, default 2 ms) |
| Address range | 0x01 – 0xFD (manual) or auto-assigned (0x00) |
| Owner | B&R Industrial Automation (now ABB) — closed/undocumented wire protocol |
IMPORTANT CAVEAT: B&R has never publicly released a wire-level protocol specification for X2X Link. The frame structure, checksum algorithm, and bit-level encoding described below are reconstructed from official hardware documentation, system manuals, community knowledge, and reverse-engineering observations. Some details are necessarily incomplete or inferred.
2. Physical Layer
2.1 Backplane (X20 Local Bus)
On the X20 backplane, X2X Link is carried on the module-to-module bus connectors (8-pin keyed connectors at 12.5 mm pitch). The protocol runs at 12 Mbps over PCB traces directly between modules slotted onto the bus base.
- Each X20 module has an 8-pin bus connector on each side (left/right)
- Modules are physically clipped together onto a DIN-rail-mounted bus base
- The bus base carries: X2X data lines, +24 VDC, GND, and I/O power
- No external cabling is needed for local backplane communication
2.2 Remote X2X Link (Cable)
For remote I/O expansion, X2X Link uses a differential-pair serial link over shielded twisted-pair copper cable. The physical layer is electrically compatible with EIA-485 (RS-485) transceivers, but the protocol and data encoding are entirely proprietary — it is NOT standard UART/RS-485 framing.
2.2.1 Connector — M12, B-keyed, 5-pin
All X2X Link remote cable assemblies use B-keyed M12 circular connectors:
| Pin | Signal | Wire Color | Function |
|---|---|---|---|
| 1 | X2X+ | Red | X2X Link data+ (differential pair A) AND +24 VDC supply for remote backplane |
| 2 | X2X | White | X2X Link data reference (differential pair B) |
| 3 | X2X⊥ | Black | X2X Link inverse data (differential pair A inverse) |
| 4 | X2X\ | Blue | X2X Link data ground / inverse reference |
| 5 | Not assigned | — | Unused (present on connector but NC) |
| Shell | SHLD | Braided shield | 360° shield via knurled-head screw |
Critical note about pin 1 (Red wire / X2X+): Pin 1 carries both the X2X Link data signal AND the +24 VDC power supply for the remote X2X backplane. When connecting to devices with their own power supply (e.g., IF789 or LS189 interfaces), the red wire end must be insulated (heat-shrink) to prevent short circuits. For standard X2X remote stations (X20BR9300, X67 modules), pin 1 provides both data and power.
Source: X2X Link Cables Data Sheet V2.21
2.2.2 Cable Specifications
| Parameter | Value |
|---|---|
| Cable type | 4-core shielded twisted pair |
| Data pair (X2X / X2X⊥) | 2 × 0.25 mm² (AWG 24), tinned Cu, light blue + white |
| Supply pair (X2X+ / X2X\) | 2 × 0.34 mm² (AWG 22), tinned Cu, red + black |
| Shielding | Paired aluminum foil shield + braided tinned Cu overall |
| Outer sheath | PUR mixture, halogen-free, purple |
| Outer diameter | 6.9 mm ± 0.2 mm |
| Max current per contact | 4 A |
| Max connection voltage | 125 V AC/DC |
| Conductor resistance | < 180 Ω/km at 20°C |
| Temperature range (fixed) | -25 to 80°C |
| Temperature range (flexible) | -20 to 80°C |
| Min bend radius (fixed) | ≥ 7.5× outer diameter (≈ 52 mm) |
| Min bend radius (flexing) | ≥ 15× outer diameter (≈ 104 mm) |
| Drag chain rating | Max 7 m/s², 3 m/s velocity |
Standard pre-assembled cable lengths: 0.25 m, 1.0 m, 1.5 m, 2.0 m, 5.0 m, 10.0 m, 15.0 m, 25.0 m, 50.0 m. Bulk cable (X67CA0X99) available in 100 m and 500 m drums for custom assembly.
Cable part numbers:
- X67CA0X01.xxxx — Straight M12-to-M12 connection cables
- X67CA0X11.xxxx — Angled (90°) M12-to-M12 connection cables
- X67CA0X21.xxxx — Straight female-to-open attachment cables
- X67CA0X41.xxxx — Straight male-to-open open cables
- X67CA0X51.xxxx — Angled male-to-open open cables
- X20CA0X48.xxxx — X20 system attachment cables (open-ended one side)
2.2.3 Termination
- 120Ω termination resistors are required at both ends of each X2X Link segment
- B&R dedicated terminator: X20AT6100 (120Ω, 0.25W)
- DC resistance measured between X2X+ and X2X⊥ at bus ends should read ~60Ω (two 120Ω resistors in parallel when both terminators are installed)
- Some modules have built-in termination switches/jumpers
2.2.4 Topology
- Daisy-chain / multi-drop — modules are connected serially with an IN and OUT port
- Each X20BR9300 bus receiver has two X2X ports for daisy chaining
- Maximum of 100 m total cable length per segment
- The X2X Link bus is fed by the X20BR9300 bus receiver (or X20BT9100 transmitter)
- After approximately 30 modules on a single segment, a bus repeater (another X20BR9300/X20BT9100) is needed
- Shield must be grounded at both ends for best EMC immunity; ground the supply line as close as possible to the shield connection point
2.2.5 Physical Verification Checklist
1. Verify DC bus voltage: Should be 2.5V ±0.5V between X2X+ and X2X⊥ when idle
2. Verify DC resistance between A+ and B-: ~60Ω with both terminators installed
3. Check cable shield grounding: One-point grounding minimum, two-point preferred
4. Confirm segment length ≤ 100 m
5. Confirm terminator at first and last node
6. Check for ground potential differences between panels
7. Verify power supply sequencing: X2X modules stabilize before CPU initialization
3. X2X Frame Format and Wire-Level Encoding
3.1 What Is Known
B&R has not published the X2X Link wire-level protocol specification. The following is reconstructed from multiple sources:
3.2 Physical Signaling
- The X2X Link uses differential signaling over twisted pairs, electrically compatible with RS-485 transceivers
- The bus operates at 12 Mbps on the backplane; remote cable speed is determined by the transceiver and cable quality (B&R specifies up to 12 Mbps with their qualified cable over 100 m)
- The encoding is NOT standard UART/async serial (no start/stop bits in the conventional sense). The protocol uses a synchronous, clock-recovered NRZ-like encoding with its own frame delimiters and bit-stuffing
- The master provides the clock reference for all slaves on the bus
3.3 Inferred Frame Structure
Based on community observations and reverse-engineering efforts, X2X Link frames appear to follow this general structure:
┌──────────┬──────────┬──────────┬──────────────┬─────────┬──────────┐
│ Preamble │ Sync │ Header │ Payload Data │ CRC/FCS │ EOM │
│ (edge │ Pattern │ (address │ (I/O data, │ Checksum│ End of │
│ training│ (unique │ + ctrl + │ config, │ │ Message │
│ for PLL │ word for │ frame │ diag) │ │ marker) │
│ lock) │ framing) │ type) │ │ │ │
└──────────┴──────────┴──────────┴──────────────┴─────────┴──────────┘
| Field | Description (Inferred) |
|---|---|
| Preamble | A burst of alternating edges allowing slave receivers to lock their |
| PLL/clock recovery circuits. Duration depends on baud rate and receiver | |
| requirements. | |
| Sync Pattern | A unique bit sequence that marks the start of a valid frame. |
| Distinguishes real data from line noise. | |
| Header | Contains at minimum: destination/source node address, frame type code, |
| and payload length. Likely 2-4 bytes. | |
| Payload | Variable-length data: I/O input/output values, configuration parameters, |
| diagnostic status words, module identification. | |
| CRC/FCS | Frame Check Sequence for integrity verification. Likely CRC-16 or |
| CRC-32, but exact polynomial is unknown. | |
| EOM | End-of-message delimiter or final bit pattern. |
3.4 Frame Types (Inferred)
The X2X Link master cyclically transmits the following frame categories:
| Frame Type | Direction | Description |
|---|---|---|
| Configuration | Master → Slave | Sent during initialization. Assigns node addresses, sets module |
| parameters, configures I/O mapping. Slave must be in RESET/BOOT mode | ||
| to accept configuration. | ||
| Cyclic Data | Master → Slave (outputs) + Slave → Master (inputs) | Real-time I/O data exchanged every cycle. Output data from the master |
| is piggybacked onto the master’s polling frame; input data from the slave | ||
| is returned in the slave’s response slot. | ||
| Diagnostic/Status | Master ↔ Slave | Status words indicating module health, error flags, watchdog state, |
| and per-channel diagnostics. | ||
| Ack/NACK | Slave → Master | Acknowledgment of configuration frames, error responses. |
3.5 Cyclic Communication Model
The X2X Link operates on a master-slave polling model within each cycle:
- Master broadcasts a poll frame containing the destination node address and output data
- The addressed slave responds with input data and status information
- Master polls the next slave in sequence
- All slaves are polled once per cycle time
- The cycle repeats deterministically
This means: Cycle time ≥ (number_of_slaves × per_slave_transaction_time) which is why the X2X cycle time must be at least as fast as the task class that reads/writes its I/O.
NOTE: The exact byte-level frame format, sync word values, CRC polynomial, and bit-level encoding remain proprietary. B&R has not released this information. Any attempt to fully decode X2X traffic from raw captures would require either (a) a leaked specification or (b) significant protocol reverse-engineering effort.
4. Timing, Bit Rate, and Synchronization
4.1 Bit Rate
| Context | Bit Rate |
|---|---|
| X20 backplane (local I/O) | 12 Mbps |
| Remote X2X Link (cable) | 12 Mbps (with qualified B&R cable, ≤ 100 m) |
| X2X+ backplane | ~48 Mbps (estimated, 4× X2X Link) |
Source: B&R System Overview I/O, Fieldbus, and Control Systems (2011/2012 edition) — X20IF1061 and X20IF1063 interface modules listed with “X2X Link, baudrate max. 12 Mbps”
4.2 Cycle Time
The X2X Link cycle time is user-configurable in Automation Studio:
| Parameter | Value |
|---|---|
| Minimum cycle time | 0.5 ms (500 μs) |
| Maximum cycle time | 10 ms (10000 μs) |
| Default cycle time | 2 ms |
| Granularity | Multiples of the system timer base (typically 100-200 μs steps) |
| Constraint | Must be a multiple of or divisor of task class cycle times |
The cycle time determines how fast I/O data is updated:
- At 2 ms cycle time: I/O is refreshed 500 times per second
- At 0.5 ms cycle time: I/O is refreshed 2000 times per second
- The X2X cycle time directly affects the cyclic task classes in Automation Studio; task classes must have cycle times that are multiples of the X2X cycle
4.3 Synchronization Mechanism
- The master node (CPU or bus controller) generates the timing reference for the entire X2X bus
- All slave nodes synchronize to the master’s clock via the X2X frame preamble and sync patterns
- When an ACOPOS drive (POWERLINK) is added to the configuration, the system timer configuration changes to “EPL/X2X Interface” mode, and the POWERLINK and X2X interfaces share the same timing base
- POWERLINK cycle time must be a multiple of 400 μs for motion control applications
- IO-Link cycle times can be synchronized to or explicitly specified independently from the X2X cycle time
4.4 Timing Constraints
- The X2X cycle time must match or be compatible with the task class cycle times that read/write the I/O mapped to that X2X bus
- If a stepper motor controller (e.g., X20SM1436) runs in a 4 ms task, the X2X bus must also run at ≤ 4 ms (typically the same value)
- Default X2X cycle: 2 ms; default POWERLINK cycle: 10 ms (but these can be changed independently in Automation Studio)
Source: Pedronf65 blog post on B&R task timing configuration
5. Node Addressing
5.1 Addressing Scheme
Each X2X Link node has a unique 1-byte address in the range 0x01 to 0xFD (1 to 253 decimal). Address 0x00 has a special meaning (automatic assignment).
5.2 How Nodes Get Addresses — Two Methods
Method 1: Manual Address via DIP Switches
Bus modules equipped with node number switches (e.g., X20BM05) allow manual address assignment:
- Two rotary/hex switches labeled ×16 and ×1 provide a range of 0x00 to 0xFF
- The actual address is:
(×16 switch value × 16) + ×1 switch value - Setting the switches to a value in range 0x01–0xFD sets the X2X Link address permanently for the bus base
- Setting 0x00 enables automatic address assignment (see below)
- Placing a node-number-switch module at the beginning of an X20 block ensures a unique address base; subsequent modules in the block are auto-numbered upward from that base
The switches are physically located on the bus module (bottom of the module), with symbols printed on the locking lever for external visibility.
Method 2: Automatic Address Assignment
- When a bus module’s node number switches are set to 0x00, the X2X Link address is automatically assigned by the master during initialization
- The master assigns addresses in ascending order starting from the last known address + 1
- Manual and automatic addressing can be combined: place one manually-set module to establish a unique base, then let subsequent modules auto-assign
5.3 Address Assignment Rules
- No two nodes on the same X2X segment may share the same address
- The master (CPU/bus controller) always has the lowest address (typically 0x01)
- Addresses must match the configuration in Automation Studio
- Changes to node number switches only take effect after a power cycle
- The X2X Link address is independent of the electronics module plugged into the slot — it depends only on the bus module’s switch setting
5.4 Addressing on X67 System
On X67 remote I/O blocks:
- The left node number switch sets the upper nibble (×16)
- The right node number switch sets the lower nibble (×1)
- Combined value forms the X2X Link address
6. Protocol Versions — X2X Link vs X2X+
6.1 X2X Link (Original)
| Property | Value |
|---|---|
| Introduced | ~2005 with X20 system launch |
| Bus speed | 12 Mbps |
| Cycle time | 0.5 – 10 ms |
| Max slaves | 62 per master |
| Max segment | 100 m cable |
| Availability | All X20/X67 CPUs, bus controllers, interface modules |
| Backward compatible | Yes — universal support |
6.2 X2X+ (Enhanced)
| Property | Value |
|---|---|
| Introduced | January 2023 |
| Bus speed | ~48 Mbps (estimated, 4× X2X Link) |
| Response time | 4× faster than X2X Link |
| Bandwidth | Significantly higher; handles large data volumes |
| Max slaves | Not publicly specified (likely ≥ 62) |
| Max segment | 100 m cable |
| Availability | Selected X20 controllers (e.g., X20CP168x, X20CP368x series) |
| Compatibility | NOT directly combinable with X2X Link in same segment |
6.3 Key Differences
| Feature | X2X Link | X2X+ |
|---|---|---|
| Transfer rate | Base | 4× base |
| Response time | Base | 4× faster |
| Data bandwidth | Standard | High (suitable for vibration analysis, high-speed DAQ) |
| Topology support | Backplane + remote | Backplane only (as of initial release) |
| Mixing | N/A | Cannot mix X2X+ and X2X Link in same segment |
| Controller requirement | Any X20/X67 | Specific SG4 controllers with X2X+ option |
| Cycle time range | 0.5 – 10 ms | Sub-millisecond possible |
From B&R press release (Jan 30, 2023):
“X2X+ enables faster data transfer and up to four times faster response times. In combination with this higher bandwidth, large amounts of data can be handled quickly and easily.”
Source: B&R “Four times more performance” press release
6.4 Migration Notes
- Existing X20 I/O modules are compatible with both X2X Link and X2X+
- If X2X+ is selected in Automation Studio as the backplane bus, all local modules use X2X+; remote X2X Link segments require a separate X2X Link interface
- A separate X2X Link interface module is needed if you need to connect X2X Link remote stations to an X2X+ system
7. Error Handling and Diagnostics
7.1 CPU Operating Modes
| Mode | R-LED Pattern | X-LED Pattern | Behavior |
|---|---|---|---|
| BOOT | Double flash (~1 Hz) | Varies | Firmware loading — DO NOT interrupt |
| RESET | Single flash (~1 Hz) | Off | No valid application or corrupt config |
| RUN | Steady ON (green) | Steady ON (orange) | Application executing, X2X active |
| STOP | Single flash | Varies | Application halted by user or error |
7.2 Module-Specific LED Diagnostics
| Module | LED | Status | Meaning |
|---|---|---|---|
| X20BR9300 (Slave bridge) | R-LED | Solid green | Normal: Power OK |
| X20BR9300 | X-LED | Solid orange | X2X communication active |
| X20BR9300 | R-LED | Single flash | Reset mode / not configured |
| X20BR9300 | X-LED | Off | X2X communication not established |
| X20BT9100 (Master terminal) | R-LED | Single flash | Module not initialized by CPU |
| X20BT9100 | X-LED | Off | No X2X frame transmission |
| X20 I/O Modules | R-LED | Steady green | Module initialized and operational |
| X20 I/O Modules | R-LED | Single flash | Waiting for CPU configuration |
7.3 CPU Error Codes (7-Segment Display)
| Code | Meaning |
|---|---|
| E001 | Hardware initialization error |
| E002 | Memory test failure |
| E003 | Fieldbus initialization error |
| E004 | Application load error |
7.4 Common Failure Modes
| Failure | Symptoms | Likely Cause |
|---|---|---|
| All modules single-flash | No X2X communication | CPU in RESET/STOP, hardware fault, missing config |
| Single slave offline | One panel not responding | Cable fault, termination missing, power issue, address conflict |
| Intermittent comms | Random slave dropouts | Cable length > 100 m, poor shielding, ground loops, failing transceiver |
| All slaves fail after warm start | Complete bus loss | Watchdog timeout, power sequencing, master transceiver failure |
| Configuration mismatch | Slave R-LED solid but X-LED off | Physical topology differs from Automation Studio project config |
7.5 X2X Bus Configuration Error Detection
- During initialization, the master sends configuration frames to each slave in sequence
- If a slave does not acknowledge configuration within the timeout period, that node is marked as not configured
- Address conflicts (duplicate addresses) will cause initialization failures for the conflicting nodes
- The X2X bus is completely inactive if the CPU is not in RUN mode — this is by design, as a safety measure
7.6 Power Supply Sequencing
- 24 VDC power to X2X modules must stabilize before CPU initialization
- Recommended sequence:
- Disconnect all 24 VDC power
- Wait 60 seconds for complete discharge
- Reapply power to X2X modules first, wait 2 seconds
- Apply power to CPU
- Observe LED sequences during boot
7.7 Reset Button Behavior
- Brief press: Warm restart — application program remains in memory
- Hold 3+ seconds then release: Warm restart with re-initialization attempt
- Hold 10+ seconds during power-on: Cold start — clears retain variables, forces complete re-initialization
- Cold start can also be triggered via Automation Studio command
8. Sniffing / Tapping X2X Traffic
8.1 Challenge Level: HIGH
X2X Link is a 12 Mbps differential serial protocol on a proprietary physical layer. There is no off-the-shelf Wireshark dissector or commercial protocol analyzer that natively supports X2X Link. Sniffing requires custom hardware and software.
8.2 Physical Tap Points
For the remote X2X Link cable, the tap point is straightforward — you have accessible M12 connectors. For the local backplane, you would need to either:
- Probe the PCB traces directly (requires opening the module housing)
- Tap into the bus connector pins using fine-pitch probe clips
8.3 Hardware Options
Option A: High-Speed Logic Analyzer
| Tool | Sample Rate | Channels | Suitability |
|---|---|---|---|
| Saleae Logic Pro 16 | 500 MS/s | 16 | Marginal — 500 MS/s gives ~42 samples per bit at 12 Mbps |
| Saleae Logic 2 Pro 16 | 1 GS/s | 16 | Adequate — 83 samples per bit |
| Saleae High-Speed USB | 2 GS/s | 16+ | Good — 166 samples per bit |
| sigrok/Clone (Sainlogic) | 24-100 MS/s | 8-16 | Insufficient for 12 Mbps |
REQUIREMENT: At 12 Mbps, one bit period is ~83.3 ns. You need a minimum of 4-5 samples per bit (16-20 ns resolution), so the logic analyzer must sample at ≥ 48-60 MS/s per channel. A 100 MS/s or better analyzer is strongly recommended.
Option B: RS-485 Transceiver Tap Board
Build a simple passive tap:
┌─────────────────────┐
X2X Master ──────│ A (non-inverting) │────── Logic Analyzer CH1
│ B (inverting) │────── Logic Analyzer CH2
X2X Slave ───────│ GND │────── Logic Analyzer GND
│ │
│ 120Ω term (switchable)│
└─────────────────────┘
- Use a high-speed RS-485 transceiver rated for ≥ 20 Mbps (e.g., SN65HVD1782, MAX1487, ADM485)
- Add a switchable 120Ω termination resistor to avoid affecting bus operation when tapping mid-segment
- Power the tap board from an isolated supply to avoid ground loops
- Connect the transceiver output to the logic analyzer’s digital inputs
Option C: Differential Probe + Oscilloscope
- A differential probe (e.g., Tektronix P5200 or equivalent) connected to an oscilloscope can visually capture the X2X signal waveform
- Not suitable for long captures or automated decoding, but useful for verifying signal integrity and estimating baud rate
8.4 Capture Procedure
- Identify tap point: Disconnect the X2X cable at a convenient junction (between master and first slave, or between two slaves)
- Install passive tap: Insert the tap board inline. Ensure termination is correct (tap mid-segment: no termination; tap at end: enable termination)
- Configure logic analyzer:
- Sample rate: ≥ 100 MS/s (≥ 200 MS/s recommended)
- Channels: CH1 = X2X+ (data+), CH2 = X2X⊥ (data-)
- Trigger: Rising or falling edge on CH1
- Capture duration: ≥ 2× X2X cycle time (4 ms at 2 ms cycle)
- Start capture and observe:
- You should see a periodic pattern corresponding to the X2X cycle
- Each cycle contains multiple bursts (one per slave)
- Idle periods between bursts show the bus in the recessive/idle state
8.5 Signal Characteristics to Expect
┌──┐ ┌──┐ ┌──┐ ┌─────┐ ┌──┐
X2X+ ┘ └──┘ └──┘ └──┘ └───────────┘ └──
X2X⊥ ────────────────────────────────────────────
← Frame 1 → Idle ← Frame 2 →
- Differential voltage swing: approximately 1.5–3.0 V (typical RS-485 levels)
- Idle/bus-free state: X2X+ ≈ X2X⊥ (both at common-mode voltage, ~2.5V)
- Active state: X2X+ and X2X⊥ diverge by ±1.5V differential
9. Decoding IO Card Sensor Data at the Protocol Level
9.1 What You Need to Know Before Decoding
To decode IO data from raw X2X traffic, you need:
- The I/O mapping from the Automation Studio project (which node addresses map to which I/O modules, which channels, and data types)
- The cyclic data layout for each node (how many bytes of input/output data per node per cycle)
- The byte order (likely little-endian, consistent with x86 B&R CPUs)
- The frame boundary markers (sync pattern) to segment the captured bitstream
- The CRC/checksum algorithm (to validate decoded frames)
9.2 Data Mapping Architecture
In Automation Studio, the I/O mapping defines:
Node Address 0x01 (X20BR9300 - Panel 1):
Slot 2: X20DI9372 (16-channel digital input)
→ Input bytes: 2 bytes (16 bits, one per channel)
→ Byte 0: Channels 1-8 (bit 0 = channel 1)
→ Byte 1: Channels 9-16 (bit 0 = channel 9)
Slot 3: X20AO4622 (4-channel analog output, 16-bit)
→ Output bytes: 8 bytes (4 × 16-bit values)
→ Bytes 0-1: Channel 1 value (0 to 32767 = 0 to 10V)
→ Bytes 2-3: Channel 2 value
→ ...
Node Address 0x11 (X20BR9300 - Panel 2):
Slot 2: X20AI4632 (4-channel analog input, 16-bit)
→ Input bytes: 8 bytes (4 × 16-bit values)
→ Bytes 0-1: Channel 1 value (0 to 32767 = 0-10V or 4-20mA)
→ ...
9.3 Digital Input Data Format (Inferred)
- Digital I/O is packed as bit-mapped bytes, 8 channels per byte
- Bit 0 of byte 0 = channel 1 (or channel 0, depending on B&R’s convention)
- Little-endian packing: LSB first
- Sink inputs read 1 = input active (current flowing)
- Source inputs read 1 = input active (voltage present)
9.4 Analog Data Format (Inferred)
- Analog values are typically 16-bit signed or unsigned integers
- Resolution depends on the specific module (12-bit or 16-bit ADC)
- Scaling from raw value to engineering units is done in the PLC program, not in the protocol
- Common analog ranges:
- ±10V: raw 0–32767 (unsigned) or -32768–32767 (signed)
- 0–10V: raw 0–32767
- 4–20mA: raw 0–32767 (where 0 = 4mA, 32767 = 20mA)
9.5 Decoding Workflow (Without Official Specification)
- Capture raw differential signal with logic analyzer
- Convert differential signal to single-ended (X2X+ XOR X2X⊥)
- Identify frame boundaries using sync patterns
- Extract bitstream for each frame
- Parse header to identify source/destination address
- Extract payload based on known I/O mapping
- Verify with CRC (algorithm unknown — trial and error with common CRC-16 polynomials: CRC-16-CCITT, CRC-16-IBM, CRC-16-MODBUS)
Practical reality: Without the official protocol spec, decoding X2X payload data requires significant reverse-engineering effort. The most practical approach is to use known I/O states as test patterns and correlate captured bits with expected values.
10. Pinpointing Failing IO Modules / Channels from Captured Traffic
10.1 Diagnostic Approach Using Captured Traffic
If you can capture and decode X2X traffic (even partially), you can identify failing modules/channels by:
Method 1: Address-Level Identification
- Compare the list of responding node addresses in captured traffic against the expected configuration
- A missing address in the cyclic polling sequence indicates a slave that is not responding (offline, cable fault, or module failure)
- An unexpected address may indicate an address conflict or misconfigured node
Method 2: Status Word Analysis
Each slave’s response frame likely contains a status/diagnostic word. Look for:
- Error flag bits (which bit positions indicate which conditions is unknown without the spec)
- Watchdog timeout flags
- Module-specific error codes
- Per-channel diagnostic bits for digital modules (wire-break, short-circuit)
Method 3: Data Anomaly Detection
- Digital inputs stuck at 0 or 1 despite known physical state → channel fault or wiring issue
- Analog values pegged at 0, full-scale, or random noise → ADC failure, open wire, or signal conditioning fault
- Sudden data loss from a specific node → module failure, cable disconnect, or power loss to that station
Method 4: Timing Analysis
- Increased round-trip time for a specific slave → the slave is taking longer to respond, possibly due to internal retries or hardware degradation
- Missing response frames → slave timeouts, CRC failures, or physical layer errors
10.2 Practical Troubleshooting Without Protocol Decoding
Since full X2X decoding is impractical without the spec, the most effective approach is:
- Use Automation Studio diagnostics: Configure X2X diagnostic information to be sent over EIP/POWERLINK to a central HMI or data logger
- Monitor LED patterns: As described in Section 7.2, LED states provide immediate visual diagnostic information
- Use the B&R “Network Analyzer” (X20ET8819): This is B&R’s own Ethernet/ POWERLINK analysis tool — it can capture POWERLINK traffic but does not directly decode X2X
- Swap-and-test: Replace suspect modules or cables one at a time and observe which change restores communication
- Resistance/continuity testing: Check cable resistance between X2X+ and X2X⊥ along the chain
10.3 Diagnostic Data Export
B&R Automation Studio can be configured to export X2X diagnostic data including:
- Slave online/offline status
- Per-module error counters
- Watchdog status
- Cycle time monitoring
- Configuration match/mismatch flags
This data is typically exported via:
- OPC UA (all SG4 controllers with Ethernet)
- Ethernet/IP tags (X20BC0088 bus controller)
- Modbus/TCP registers (X20BC0087 bus controller)
- POWERLINK process data
11. Tools for X2X Analysis
11.1 Official B&R Tools
| Tool | Function | X2X Support |
|---|---|---|
| Automation Studio | Configuration, programming, online diagnostics | Full — configure bus, set addresses, cycle times, monitor status |
| X20ET8819 | Ethernet/POWERLINK network analyzer | Indirect — captures POWERLINK frames containing X2X status |
| Automation Runtime | Runtime system with diagnostic features | Full — provides I/O diagnostics, error logging, watchdog |
| Target Browser (in Automation Studio) | Device discovery, status monitoring | Shows X2X bus state, slave status |
| mapp View / Panel Builder | HMI with diagnostic displays | Can show X2X error/status tags |
| OPC UA Server (built-in) | Standardized data access | Exposes X2X diagnostic tags via OPC UA |
11.2 Third-Party / Community Tools
| Tool | Function | X2X Support |
|---|---|---|
| Wireshark | Network protocol analyzer | NO native X2X dissector — would need custom Lua/C plugin |
| Saleae Logic / Logic 2 | Logic analyzer software | Captures raw digital waveforms; no X2X protocol decode |
| sigrok / PulseView | Open-source logic analyzer | Captures raw waveforms; no X2X decode |
| Teledyne LeCroy RS-422/485 ComProbe | Serial protocol analyzer | Physical layer capture; no X2X decode |
| Frontline (Teledyne) | Industrial protocol analyzer suite | RS-485/RS-422 physical layer; no X2X decode |
11.3 Writing a Custom Wireshark Dissector for X2X
Since no native X2X dissector exists, you could write one using Wireshark’s Lua API:
-- Pseudo-code for a Wireshark Lua dissector for X2X Link
-- This is a skeleton — the actual frame format is proprietary and unknown
local x2x_proto = Proto("x2x_link", "B&R X2X Link Protocol")
local f_frame_type = ProtoField.uint8("x2x.frame_type", "Frame Type", base.HEX)
local f_src_addr = ProtoField.uint8("x2x.src_addr", "Source Address", base.HEX)
local f_dst_addr = ProtoField.uint8("x2x.dst_addr", "Dest Address", base.HEX)
local f_payload = ProtoField.bytes("x2x.payload", "Payload")
local f_crc = ProtoField.uint16("x2x.crc", "CRC", base.HEX)
x2x_proto.fields = {
f_frame_type, f_src_addr, f_dst_addr, f_payload, f_crc
}
function x2x_proto.dissector(buffer, pinfo, tree)
pinfo.cols.protocol = "X2X Link"
local subtree = tree:add(x2x_proto, buffer())
-- NOTE: Field offsets and sizes are UNKNOWN/INFERRED
-- Actual implementation requires the official spec or RE
subtree:add(f_frame_type, buffer(0, 1))
subtree:add(f_src_addr, buffer(1, 1))
subtree:add(f_dst_addr, buffer(2, 1))
subtree:add(f_payload, buffer(3, buffer:len() - 5))
subtree:add(f_crc, buffer(buffer:len() - 2, 2))
end
-- Register as a user DLT (Data Link Type) for raw capture import
local wtap_dissector_table = DissectorTable.get("wtap_encap")
wtap_dissector_table:add(wtap_dissector_table:get_free_id(), x2x_proto)
To use this:
- Capture X2X traffic with a logic analyzer → export as raw binary/captured stream
- Write a conversion script to import the raw data into a pcap-like format
- Register the custom dissector to decode the frames
11.4 Recommended Hardware Setup for X2X Analysis
┌──────────────┐ X2X Cable ┌──────────────┐ X2X Cable ┌──────────────┐
│ │◄──────────────────►│ │◄──────────────────►│ │
│ CPU/Master │ IN OUT │ X2X Tap │ IN OUT │ Slave I/O │
│ (X20CP...) │ │ Board │ │ (X20BR...) │
│ │ │ │ │ │
└──────────────┘ └──────┬───────┘ └──────────────┘
│
┌─────┴─────┐
│ RS-485 │
│ Transceiver│
└─────┬─────┘
│
┌─────┴─────┐
│ Logic │
│ Analyzer │──► PC (Saleae/sigrok)
│ ≥100MS/s │
└───────────┘
12. Component Reference Tables
12.1 X2X Link Bus Controllers (X20)
| Model | Fieldbus | X2X Addressing | Connector |
|---|---|---|---|
| X20BC0043 | CANopen | DIP switches | 5-pin multipoint |
| X20BC0053 | POWERLINK | DIP switches | 5-pin multipoint |
| X20BC0063 | PROFIBUS DP | DIP switches | 9-pin DSUB |
| X20BC0073 | DeviceNet | DIP switches | 5-pin multipoint |
| X20BC0083 | CAN I/O | DIP switches | 5-pin multipoint |
| X20BC0087 | Modbus/TCP | DIP switches | 2× RJ45 (switch) |
| X20BC0088 | Ethernet/IP | DIP switches | 2× RJ45 (switch) |
| X20BC0089 | POWERLINK | DIP switches | 2× RJ45 (switch) |
| X20BC1083 | POWERLINK | DIP switches | 2× RJ45 (switch) |
12.2 X2X Link Bus Transmitters / Receivers (X20)
| Model | Function | Power | Key Spec |
|---|---|---|---|
| X20BT9100 | Bus transmitter (master side) | 0.85 W | Up to 62 slaves, 100 m segment |
| X20BT9400 | Bus transmitter + X67 power supply | — | Includes X67 module power feed |
| X20BR9300 | Bus receiver (slave side) | 2.5 W | Supply for X2X Link + internal I/O |
12.3 X67 Bus Controllers with X2X Link
| Model | Fieldbus | X2X Support | Connector |
|---|---|---|---|
| X67BC4321 | CANopen | Yes | M12 A-coded |
| X67BC5321 | CAN I/O | Yes | M12 A-coded |
| X67BC6321 | ETHERNET Powerlink | Yes | M12 B-coded |
| X67BC7321-1 | POWERLINK | Yes | M12 A-coded |
| X67BC8321-1 | ETHERNET | Yes | M12 D-coded |
12.4 Bus Modules with Node Number Switches
| Model | Description |
|---|---|
| X20BM05 | Bus module, node number switch, 24VDC keyed, I/O supply interrupted left |
| X20BM01 | Bus module, standard (no node switch, auto-addressing) |
12.5 Termination and Accessories
| Part Number | Description |
|---|---|
| X20AT6100 | 120Ω termination resistor, 0.25W |
| X20AC130x series | X2X Link attachment cables for X20 |
| X67CA0Xxx.xxxx | X2X Link cables for X67 (M12, various lengths/configs) |
| X67CA0X99.xxxx | Bulk cable for custom assembly (100 m / 500 m) |
13. Source URLs and References
Official B&R Documentation
| Document | URL |
|---|---|
| X20 System User’s Manual (v3.50+) | https://assets.euautomation.com/uploads/parts/datasheet/11/x20if1063.pdf |
| X20 System User’s Manual (v3.60) | https://www.all4sps.com/mediafiles/Sonstiges/X20PS3300_1.pdf |
| X2X Link Product Page | https://www.br-automation.com/en-us/products/network-and-fieldbus-modules/x2x-link/ |
| X20BR9300 Datasheet | https://www.br-automation.com/en-us/products/io-systems/x20-system/bus-receivers-and-transmitters/x20br9300/ |
| X20BT9100 Datasheet | https://www.br-automation.com/en-us/products/io-systems/x20-system/bus-receivers-and-transmitters/x20bt9100/ |
| X20BM05 Datasheet | https://static.chipdip.ru/lib2/a/302/DOC071302011.pdf |
| X2X Link Cables Datasheet (v2.21) | https://www.multiwaycontrol.com/multiway/X2X-X67CA0X99.1000-Link-Cable-ENG.pdf |
| X20BC0088 Product Page | https://www.br-automation.com/en-us/products/io-systems/x20-system/bus-controllers/x20bc0088/ |
| B&R X2X+ Press Release (Jan 2023) | https://www.br-automation.com/en/about-us/press-room/four-times-more-performance-30-01-2023/ |
| X20(c)CP168x(X) with X2X+ Info | https://tlauk.net/document/71064/B%2526R%252C%2520X20CCP1684.pdf |
Technical Articles and Community Posts
| Article | URL |
|---|---|
| Control.com: B&R Unveils X2X+ Backplane Bus | https://control.com/news/br-now-offering-x2x-on-the-x20-bus/ |
| B&R Community: Communication Protocol Devices | https://community.br-automation.com/t/communication-protocol-devices/426 |
| B&R Community: RS485 X20 Series | https://community.br-automation.com/t/rs485-communication-x20-series/1787 |
| B&R Community: Siemens and X2X Communication | https://community.br-automation.com/t/siemens-and-b-and-r-x2x-communication/3751 |
| B&R Community: Connecting BB80 Module | https://community.br-automation.com/t/connecting-a-new-plc-module-bb80/4339 |
| B&R Community: IO-Link Cycle Time | https://community.br-automation.com/t/io-link-v-pd-outrunmode/2912 |
| Pedronf65: B&R PLC 4ms Task Config | https://pedronf65.wordpress.com/2015/05/28/br-plc-configuration-4ms-task-with-x20cp1381-cpu-acoposmicro-x20sm1436/ |
Troubleshooting and Diagnostics
| Article | URL |
|---|---|
| IMD: Diagnosing X2X Bus Communication Failures | https://industrialmonitordirect.com/blogs/knowledgebase/diagnosing-br-x2x-bus-communication-failures-and-cpu-reset-mode-symptoms |
| IMD: Resolving X2X Communication and Reset Mode LED Issues | https://industrialmonitordirect.com/blogs/knowledgebase/resolving-br-x2x-communication-and-reset-mode-led-issues |
| Reddit r/PLC: X2X Link Network Troubleshooting | https://www.reddit.com/r/PLC/comments/p73low/br_x2x_link_network_troubleshooting/ |
| Reddit r/PLC: X2X Interface Debugging | https://www.reddit.com/r/PLC/comments/1cdzfly/br_x2x_interface_debugging/ |
System Overview / Reference
| Document | URL |
|---|---|
| B&R System Overview I/O, Fieldbus, Control Systems | https://theengineer.markallengroup.com/production/content/uploads/2012/02/MM-E00640.459.pdf |
| B&R RS Online X20 System Manual | https://docs.rs-online.com/b8f4/A700000013942634.pdf |
| Scribd: X20 System Manual (v3.10) | https://www.scribd.com/document/474939830/X20-System-ENG-pdf |
| Scribd: X67 System Manual (v3.00) | https://www.scribd.com/document/479295115/X67-System-ENG-V3-00-pdf |
| X20BT9100 Datasheet PDF | https://www.nexinstrument.com/assets/images/pdf/X20BT9100.pdf |
Reverse Engineering / Sniffing References
| Resource | URL |
|---|---|
| EEVblog: Figuring out an RS485 Protocol | https://www.eevblog.com/forum/projects/figuring-out-an-rs485-protocol/ |
| Stack Exchange: Reverse-Engineering RS-485 | https://electronics.stackexchange.com/questions/431270/reverse-engineering-rs-485-communication |
| Stack Overflow: Reverse Engineering Serial Protocol | https://stackoverflow.com/questions/67733520/reverse-engineering-serial-protocol |
| Saleae Forum: Two Days Decoding RS-485 | https://discuss.saleae.com/t/two-days-decoding/2558 |
| Teledyne LeCroy: Industrial Protocol Analyzers | https://www.teledynelecroy.com/protocolanalyzer/industrial-network-protocol |
| James Gibbard: Wireshark Lua User DLT | https://www.gibbard.me/wireshark_lua_user_link_layer/ |
| Wireshark Wiki: Lua Dissectors | https://wiki.wireshark.org/lua/dissectors |
Cross-References
- powerlink-internals.md — ETHERNET Powerlink protocol details; X2X and POWERLINK timing interaction
- physical-layer-sniffing.md — Probing X2X signals at the physical wire level with oscilloscopes and logic analyzers
- io-card-hardware.md — IO module hardware internals; how sensor signals are conditioned before X2X transport
- memory-map.md — How IO data from X2X modules maps into the PLC address space
- network-architecture.md — X20 network topology, device discovery, and bus configuration
- cp1584-hardware-ref.md — CP1584 physical specifications, connectors, and X2X link power output
- io-sniffing.md — Higher-level IO sniffing methodology for diagnosing sensor issues
- analog-calibration.md — Analog signal quality analysis across the X2X transport path
- diagnostic-workstation.md — Logic analyzer and oscilloscope setup for X2X protocol analysis
Appendix A: X2X Quick Reference Card
┌──────────────────────────────────────────────────────────────────┐
│ B&R X2X LINK QUICK REFERENCE │
├──────────────────────────────────────────────────────────────────┤
│ Bus Speed: 12 Mbps (X2X Link) / ~48 Mbps (X2X+) │
│ Cycle Time: 0.5 ms – 10 ms (default 2 ms) │
│ Max Slaves: 62 per master │
│ Max Cable: 100 m per segment │
│ Addresses: 0x01–0xFD (manual), 0x00 = auto │
│ Termination: 120Ω at both ends (X20AT6100) │
│ Connector: M12 B-keyed 5-pin (remote) │
│ Pin 1: X2X+ (Red) — Data+ AND +24V supply │
│ Pin 2: X2X (White) — Data reference │
│ Pin 3: X2X⊥ (Black) — Data- inverse │
│ Pin 4: X2X\ (Blue) — Data ground │
│ Pin 5: NC │
│ Shield: 360° via knurled screw (ground both ends) │
│ Idle Voltage: ~2.5V between X2X+ and X2X⊥ │
│ Terminated R: ~60Ω between X2X+ and X2X⊥ (both ends) │
├──────────────────────────────────────────────────────────────────┤
│ LED Patterns: │
│ R-LED steady green = Normal operation │
│ R-LED single flash = Reset/Stop mode │
│ R-LED double flash = Boot mode (don't interrupt) │
│ X-LED steady orange = X2X communication active │
│ X-LED off = No X2X communication │
├──────────────────────────────────────────────────────────────────┤
│ Default CPU IP (Boot mode): 192.168.1.1 │
│ Config Tool: Automation Studio (B&R) │
├──────────────────────────────────────────────────────────────────┤
│ ⚠ X2X+ and X2X Link CANNOT be mixed in the same segment │
└──────────────────────────────────────────────────────────────────┘
Appendix B: X2X LED Diagnostic Pattern Reference (Field Troubleshooting)
LED Types on X2X Modules
| LED | Name | Color | Purpose |
|---|---|---|---|
| R | Run/Ready | Green | Module power and CPU/init status |
| X | X2X Bus | Orange | X2X bus communication activity |
| I/O | Channel status | Green/Red | Per-channel or per-module I/O status |
R-LED Patterns
| Pattern | Meaning | Action |
|---|---|---|
| Steady green | Normal operation; module initialized | None — system is running |
| Single flash (~1 Hz) | CPU in STOP/RESET mode; modules not initialized | CPU has entered reset — check CPU error code, watchdog, application load |
| Double flash | Boot mode — firmware update in progress | Do not power off during double flash; wait for update to complete |
| Off | No power to module | Check 24V supply, fuses, bus base connection |
| Red (some modules) | Hardware fault detected | Replace module; check for overtemperature or overvoltage |
X-LED Patterns
| Pattern | Meaning | Action |
|---|---|---|
| Steady orange | X2X communication active; bus traffic present | Normal — no action needed |
| Flashing orange | X2X bus initializing or intermittent communication | Wait for stabilization; if persistent, check cabling and termination |
| Off | No X2X communication detected | Check bus cable, master module, CPU RUN status, termination |
System-Level LED Interpretation Table
| Module | R-LED | X-LED | Interpretation |
|---|---|---|---|
| X20BT9100 (Master) | Single flash | Off | CPU in reset; X2X master not active |
| X20BR9300 (Slave, OK) | Steady green | Steady orange | Normal — slave communicating with master |
| X20BR9300 (Slave, fail) | Single flash | Off | Slave not receiving valid X2X signals |
| All modules on a panel | Single flash | N/A | CPU in STOP/RESET; entire panel affected |
CPU Reset Mode Entry Conditions
The CPU enters reset/STOP mode when any of the following occur:
- Hardware watchdog timeout (typically 500 ms – 2 s, configurable)
- Critical memory access violation (page fault, illegal address)
- Illegal instruction executed
- Power-up with corrupted non-volatile memory
- Manual reset via Automation Studio (warm restart)
- Firmware update failure
In reset mode:
- CPU stops executing application code
- All X2X/POWERLINK fieldbus masters are disabled
- Digital outputs go to safe state (0V)
- All module R-LEDs flash at ~1 Hz
- Communication with Automation Studio may still be possible via service interface
Recovery Procedure for X2X Communication Failure
1. Disconnect all 24VDC power to CPU and X2X modules
2. Wait 60 seconds for complete discharge (capacitors)
3. Reapply power to X2X bus modules FIRST, wait 2 seconds for stabilization
4. Apply power to CPU
5. Observe LED sequences:
- R-LED: single flash → double flash (init) → steady green (RUN)
- X-LED on master: off → flashing orange → steady orange (X2X active)
- Slave R-LEDs: single flash → steady green (initialized)
- Slave X-LEDs: off → steady orange (communication established)
If LEDs do not progress past single flash:
- Check termination resistors (120Ω) at both bus ends
- Measure DC bus voltage between X2X+ and X2X⊥: should be 2.5V ±0.5V when idle
- Check for ground potential differences between panels
- Verify node address switches on X20BR9300 are unique and match configuration
- Try pressing CPU reset button (3-second hold) for warm restart
X2X Bus Components Quick Reference
| Component | Catalog Number | Key Specification |
|---|---|---|
| X2X Master Bus Transmitter | X20BT9100 | Up to 62 slaves, 100m segment, daisy-chain |
| X2X Slave Bus Receiver | X20BR9300 | 24VDC, 90mA, isolated communication, dual X2X ports |
| X2X Link Cable (standard) | X67CA0X01.xxxx | M12 B-keyed 5-pin, shielded, pre-assembled lengths |
| X2X Link Cable (bulk) | X67CA0X99 | 100m / 500m drums, PUR sheath, purple |
| Termination Resistor | X20AT6100 | 120Ω, 0.25W, for bus ends |
| Bus Controller (POWERLINK) | X20BC0083 | Couples X2X I/O to POWERLINK, synchronous 1:1 cycle |
| Bus Controller (EtherNet/IP) | X20BC0088 | Couples X2X I/O to EtherNet/IP |
| Bus Controller (EtherCAT) | X20BC00G3 | Couples X2X I/O to EtherCAT master |
| Bus Controller (PROFIBUS DP) | X20BC0063 | Couples X2X I/O to PROFIBUS DP |
Appendix C: X2X+ Backplane Bus (2023 Enhancement)
In January 2023, B&R introduced the X2X+ backplane bus as an option for X20 systems, delivering approximately 4× the bandwidth of X2X Link.
Key Differences: X2X Link vs X2X+
| Property | X2X Link | X2X+ |
|---|---|---|
| Backplane speed | 12 Mbps | ~48 Mbps (estimated) |
| Cycle time | 0.5 ms – 10 ms | As low as 0.125 ms (estimated) |
| Dual cycle times | No | Yes — separate fast/slow data channels |
| Timestamping | No | Yes — per-data timestamps |
| Module compatibility | All X20 modules | All X20 modules (backward compatible) |
| Bus module required | Standard X20 bus modules | X2X+ capable bus modules only |
| Segment mixing | N/A | Cannot mix X2X Link and X2X+ in same segment |
X2X+ Advantages for Condition Monitoring
The higher bandwidth and per-data timestamping make X2X+ particularly suited for:
- High-speed vibration monitoring and condition monitoring
- Higher sampling rates on analog channels
- Separate fast/slow cycle times: less time-critical data transported at slower rate to reduce CPU/network load
- Complex high-speed processes controlled with cost-effective standard hardware
Migration Note
All existing X20 I/O modules are compatible with X2X+. To upgrade, only the bus modules (the base/backplane modules) need to be replaced with X2X+-capable versions. The electronic modules (I/O slices) remain the same.
Source: B&R Press Room, “Four times more performance” (2023-01-30) — https://www.br-automation.com/en/about-us/press-room/four-times-more-performance-30-01-2023/
Appendix D: Glossary
| Term | Definition |
|---|---|
| X2X Link | B&R’s proprietary bus protocol for I/O module communication |
| X2X+ | Enhanced version of X2X Link with 4× bandwidth (introduced 2023) |
| Automation Studio | B&R’s integrated development environment for programming and configuration |
| Automation Runtime | B&R’s real-time operating system running on X20/X67 controllers |
| Bus Base | The DIN-rail-mounted backplane that holds X20 modules |
| Bus Module | The base module (e.g., X20BM05) that provides power and X2X bus connections |
| Bus Transmitter (BT) | Module (e.g., X20BT9100) that transmits X2X signals from master to remote slaves |
| Bus Receiver (BR) | Module (e.g., X20BR9300) that receives X2X signals and feeds remote I/O stations |
| Node Number Switch | DIP/rotary switch on bus modules for manual X2X address assignment |
| mapp | B&R’s modular application framework (mapp Motion, mapp View, etc.) |
| POWERLINK | B&R’s Ethernet-based real-time protocol for controller-to-controller communication |
| Task Class | In Automation Runtime, a cyclically-executed group of programs with a defined cycle time |
| SG4 | B&R’s current-generation controller hardware platform |
Key Findings
-
X2X Link is B&R’s proprietary master-slave deterministic serial bus running at 12 Mbps over RS-485 differential signaling. The wire protocol specification has never been publicly released by B&R. Frame format, sync words, CRC polynomial, and bit-level encoding are reconstructed/inferred from hardware documentation and reverse-engineering observations.
-
Physical layer: remote cable uses M12 B-keyed 5-pin connectors with a critical pin 1 dual-function – the red wire (X2X+) carries both differential data AND +24 VDC power for the remote backplane. When connecting to self-powered devices (IF789, LS189), the red wire must be insulated to prevent short circuits. Termination is 120 ohm at both ends (X20AT6100); measured DC resistance across X2X+/X2X perpendicular should read approximately 60 ohm.
-
Cycle time is user-configurable from 0.5 ms to 10 ms (default 2 ms). Cycle time must be compatible with task class cycle times (multiples or divisors). At 2 ms cycle, IO refreshes 500 times/second; at 0.5 ms, 2000 times/second. X2X+ (introduced 2023) provides approximately 4x bandwidth (estimated 48 Mbps backplane) but is not compatible with X2X Link in the same segment.
-
Up to 62 slave nodes per master (X20BT9100 transmitter / X20BR9300 receiver), with a maximum segment length of 100 m. After approximately 30 modules on a single segment, a bus repeater is required. Topology is daisy-chain/multi-drop. Node addressing is via hex rotary DIP switches (0x01-0xFD manual, 0x00 auto-assigned).
-
Sniffing X2X requires a logic analyzer sampling at >= 100 MS/s (200 MS/s recommended) – at 12 Mbps, one bit period is ~83.3 ns, requiring 4-5 samples per bit minimum. A Saleae Logic 2 Pro 16 (1 GS/s, 83 samples/bit) is adequate; cheaper sigrok clones at 24-100 MS/s are insufficient. Build a passive RS-485 tap board using a high-speed transceiver (SN65HVD1782, MAX1487) with switchable 120 ohm termination.
-
IO data decoding from raw traffic requires: the Automation Studio IO mapping (node addresses to module types to channel data types), the byte order (little-endian, consistent with x86 B&R CPUs), frame boundary sync patterns, and the CRC algorithm (unknown – trial with CRC-16-CCITT, CRC-16-IBM, CRC-16-MODBUS). Digital IO is bit-packed (8 channels per byte, LSB first); analog values are 16-bit signed/unsigned integers.
-
LED diagnostic patterns: R-LED steady green = normal operation, single flash = reset/stop mode, double flash = boot mode (do not power off during firmware update), X-LED steady orange = X2X communication active, X-LED off = no X2X communication. Default CPU IP in boot mode is 192.168.1.1.
-
Idle bus voltage between X2X+ and X2X perpendicular is approximately 2.5 V. When actively transmitting, the differential voltage swing is approximately 1.5-3.0 V (standard RS-485 levels). Shield should be grounded at both ends for best EMC immunity.
This document is compiled from publicly available sources. The X2X Link wire protocol is proprietary to B&R Industrial Automation (ABB). Some protocol details are inferred or reconstructed and should be verified against official documentation if available. No confidential or proprietary protocol specifications were accessed in creating this document.
B&R ETHERNET Powerlink (EPL) — Deep Internals Technical Reference
Scope: Comprehensive technical reference covering the architecture, timing, diagnostics, configuration, and troubleshooting of B&R ETHERNET Powerlink networks.
Standards referenced: EPSG DS 301 (Communication Profile), EPSG DS 302-B (Application Layer), IEC 61158-13, IEC 61784-2, EN 50325-4 (CANopen profiles), ISO 15745-4 (XML device description)
Table of Contents
- Architecture Overview
- CN / MN State Machine
- POWERLINK Cycle Timing
- Phase Timing Within a Cycle
- Ethernet Hardware Requirements — PHY / MAC
- POWERLINK Frame Format
- Node Addressing and Identification
- PDO Mapping over POWERLINK
- SDO Communication
- Object Dictionary Layout
- Error Handling and Recovery
- Capturing and Analyzing EPL Traffic with Wireshark
- Identifying Dropped Packets and Timing Violations
- POWERLINK Configuration Files (XML Descriptors)
- Modifying POWERLINK Parameters Without Automation Studio
- Troubleshooting Intermittent Communication Failures
- References and Source URLs
1. Architecture Overview
1.1 What is POWERLINK?
ETHERNET Powerlink is a real-time Ethernet (RTE) communication profile that extends standard IEEE 802.3 Fast Ethernet with deterministic scheduling. It was introduced by B&R (Bernecke+Rainer) in 2001 and was managed by the EPSG (Ethernet POWERLINK Standardization Group) until the EPSG dissolved in 2023. B&R now stewards the technology.
Key facts:
- Software-based protocol — no proprietary ASICs required
- Runs on any standard Ethernet silicon (MAC + PHY)
- Cycle times down to 100 µs with jitter < 1 µs (modern implementations)
- Up to 240 networked real-time devices per segment
- International standards: IEC 61158-13, IEC 61784-2, GB/T 27960-2011 (China)
- CANopen application layer (DS301/DS302) — “CANopen over Ethernet”
1.2 Managing Node (MN) and Controlled Nodes (CN)
| Role | Description |
|---|---|
| MN (Managing Node) | The master. Controls network access via Slot Communication Network Management (SCNM). Sends SoC, PReq, SoA frames. Manages NMT state of all CNs. |
| CN (Controlled Node) | Slaves. Respond to polling with PRes frames. Send ASnd frames when invited. Up to 240 CNs per segment. |
Only one MN exists per POWERLINK segment. The MN grants deterministic media access to each CN sequentially — eliminating the CSMA/CD non-determinism of standard Ethernet.
1.3 Physical Topology
POWERLINK operates on standard IEEE 802.3u 100BASE-TX (or 1000 Mbps with EPL Gigabit).
- Recommended: Repeating hubs (not switches) within the real-time domain — minimizes delay and jitter
- Switches introduce variable latency due to store-and-forward and queuing
- Topologies: line, star, tree (any combination)
- Connectors: RJ-45 (8P8C) and M12 industrial
- Cabling: IAONA Industrial Ethernet Planning and Installation Guide
Real-time and non-real-time domains are separated. Standard IP routing connects the two.
2. CN / MN State Machine (NMT)
The Network Management (NMT) state machine governs boot-up, configuration, and runtime behavior of every POWERLINK device. The MN controls the states of all CNs by issuing NMT commands and monitoring status.
2.1 NMT States
Each POWERLINK device (both MN and CN) implements the following NMT states:
| State | Code | Description |
|---|---|---|
| NMT_Reset_Application | 0x01 | Application is reset. Communication parameters return to defaults. Device is not communicating. |
| NMT_Reset_Communication | 0x02 | Communication is reset (comparable to CANopen Reset Communication). Device reinitializes communication parameters but application state may persist. |
| NMT_Initializing | 0x03 | Device is performing its internal initialization routine (hardware self-test, loading defaults). Transient state. |
| NMT_PreOperational1 | 0x04 | Device has initialized. It can receive SDOs for parameterization and configuration, but does not send or receive PDOs. NMT commands are accepted. |
| NMT_PreOperational2 | 0x05 | Device has been addressed and partially configured. Configuration Manager sets parameters. Still no cyclic PDO exchange. |
| NMT_Ready_To_Operate | 0x06 | All configuration is complete. Device is ready to enter cyclic data exchange. Waiting for MN command to transition to OPERATIONAL. |
| NMT_Operational | 0x07 | Normal runtime state. Device participates in the isochronous cycle — sends/receives PDOs cyclically. |
| NMT_Stopped | 0x08 | Device has been stopped by NMT command. No PDO exchange. Communication parameters retained. Can be restarted to OPERATIONAL. |
2.2 CN State Machine — Transitions
The CN state machine is controlled by the MN through NMT commands sent in ASnd frames:
┌─────────────────────┐
│ NMT_Initializing │
└──────────┬──────────┘
│ (auto: init complete)
▼
┌───────────────────────────────┐
┌──────────│ NMT_Reset_Application (0x01) │◄──────────────────┐
│ └───────────────┬───────────────┘ │
│ │ (NMT_Reset_Communication cmd) │ (NMT_Reset_Application
│ ▼ │ cmd from MN)
│ ┌───────────────────────────────┐ │
│ │ NMT_Reset_Communication (0x02) │◄──────────────────┘
│ └───────────────┬───────────────┘
│ │ (auto: reset complete)
│ ▼
│ ┌───────────────────────────────┐
│ │ NMT_PreOperational1 (0x04) │◄── NMT_Reset_Comm cmd
│ └───────────────┬───────────────┘
│ │ (MN assigns nodeID via DNA; configuration starts)
│ ▼
│ ┌───────────────────────────────┐
│ │ NMT_PreOperational2 (0x05) │
│ └───────────────┬───────────────┘
│ │ (NMT_EnableReadyToOperate cmd from MN)
│ ▼
│ ┌───────────────────────────────┐
│ │ NMT_Ready_To_Operate (0x06) │
│ └───────────────┬───────────────┘
│ │ (NMT_Start_Node cmd from MN)
│ ▼
│ ┌───────────────────────────────┐
│ │ NMT_Operational (0x07) │
│ └──────────┬────────┬───────────┘
│ │ │
│ (NMT_Stop_ │ │ (Error detected:
│ Node cmd) │ │ timeout, loss of PRes, etc.)
│ ▼ ▼
│ ┌───────────────────────────────┐
│ │ NMT_Stopped (0x08) │
│ └───────────────┬───────────────┘
│ │ (NMT_Start_Node cmd)
│ └──────────────► back to Operational
└───────────────────────────┘ (any error or NMT_Reset cmd returns
to appropriate reset state)
2.3 MN Cycle State Machine
In addition to the NMT state machine, each device has a Cycle State Machine that controls the POWERLINK cycle on the Data Link Layer. The Cycle State Machine is itself controlled by the NMT state machine — it only runs when the NMT state is OPERATIONAL.
The MN Cycle State Machine steps through the cycle phases:
- Send SoC (Start of Cycle) — broadcast
- Send PReq to CN #1, wait for PRes
- Send PReq to CN #2, wait for PRes
- … (all configured CNs)
- Send SoA (Start of Asynchronous)
- Wait for ASnd (from invited CN, if any)
- Cycle complete — start next SoC
2.4 Boot-Up Sequence (Observed in Wireshark)
- MN enters Operational and begins sending SoC frames
- Unconfigured CNs send StatusRequest frames (identifying as node 0xF0 — unaddressed)
- MN responds with IdentResponse (IRes) — acknowledges the CN
- MN sends DNA (Dynamic Node Allocation) command — assigns a nodeID
- MN reads CN’s XDD parameters via SDO
- MN configures PDO mapping via SDO
- MN issues NMT_EnableReadyToOperate command
- CN transitions to Ready_To_Operate
- MN issues NMT_Start_Node command
- CN transitions to Operational — now participates in cyclic PDO exchange
3. POWERLINK Cycle Timing
3.1 Key Parameters
| Parameter | Object Index | Description |
|---|---|---|
| CycTime | — | Total POWERLINK cycle time. The period from one SoC to the next. Configured on the MN. |
| PresTime | — | Time reserved for the CN’s PRes response. The MN waits this long for a PRes before declaring a timeout. |
| SendCycle | — | Used internally by the MN to schedule the next SoC transmission. The MN’s internal timer target. |
| AsyncMTU | — | Maximum Transfer Unit for asynchronous phase. Determines how much async data can be sent per cycle. Configurable per-network. |
| LossOfFrameTolerance | — | Number of missed PRes responses before the MN declares the CN as lost and triggers error handling. |
| AsyncTimeout | — | Maximum time the MN waits for an ASnd response in the async phase. |
3.2 Calculating Minimum Cycle Time
From the B&R FAQ, the minimum cycle time is determined by:
Frames per cycle:
1x SoC = 64 bytes
Nx PReq/PRes = 64 to 1500 bytes each (depends on PDO payload size)
1x SoA = 64 bytes
1x ASnd = 300 to 1500 bytes (if async data present)
Transmission time = (payload_bytes * 8 + 64) bits * 10 ns/bit
(at 100 Mbit/s = 10 ns per bit)
Inter-frame gap = 960 ns (IEEE 802.3 minimum IFG; ideal target for EPL)
Total CycleTime >= sum of all frame transmission times
+ all inter-frame gaps
+ PRes response time per CN (typically 960 ns minimum)
Example calculation for 10 nodes, each with 32 bytes of PDO data:
SoC: (64 * 8 + 64) * 10 ns = 5,760 ns
10x PReq: 10 * (64 * 8 + 64) * 10 ns = 57,600 ns
10x PRes: 10 * ((64+32) * 8 + 64) * 10 ns = 96,000 ns
10x IFG (PReq→PRes): 10 * 960 ns = 9,600 ns
SoA: (64 * 8 + 64) * 10 ns = 5,760 ns
ASnd (no data): 0 ns (if unused)
Total minimum: ~174,720 ns ≈ 175 µs
With fewer nodes or smaller payloads, cycle times can reach 100 µs.
3.3 Prescaler and Multiplexed Mode
POWERLINK supports a prescaler mechanism that allows groups of CNs to be polled at different rates:
- Prescale factor N: A CN with prescaler N is only polled every Nth cycle
- The SoC frame contains a
PS(Prescaled Slot) flag andMC(Multiplexed Cycle Completed) flag - This allows combining fast motion axes (polled every cycle) with slow temperature sensors (polled every 10th or 100th cycle)
4. Phase Timing Within a Cycle
The POWERLINK cycle consists of three distinct phases:
|<------------- CycTime (e.g., 200 µs) ----------------->|
| |
| Start | Isochronous Phase | Asynchronous |
| Phase | | Phase |
| | | |
| SoC ──► PReq1──►PRes1 ──► PReq2──►PRes2 ──► ... ──► SoA──►ASnd ──►|
| |<-- Time Slot 1 -->|<-- TS 2 -->| | |
| | (CN1 exclusive) |(CN2 excl.) | | |
4.1 Start Phase
- MN broadcasts a SoC (Start of Cycle) frame to all nodes
- Destination MAC: broadcast (
FF:FF:FF:FF:FF:FF) - Contains:
NetTime(global network timestamp),RelativeTime, flags - All CNs synchronize to this frame — it is the cycle trigger
- Flags in SoC:
PS(Prescaled Slot indicator),MC(Multiplexed Cycle Completed),AN(Asynchronous Needed)
4.2 Isochronous Phase (Real-Time Data Exchange)
During this phase, the MN polls each configured CN sequentially:
-
MN sends PReq (Poll Request) — unicast to the specific CN’s MAC address
- Contains: MN’s TX PDO data for that CN
- Fields:
RD(Ready),EA(Exception Acknowledge),MS(Multiplexed Slot),PDOVersion - Payload: the process data (PDO) directed to this CN
-
CN responds with PRes (Poll Response) — multicast to all nodes
- Contains: CN’s TX PDO data
- Fields:
NMTStatus,RD,PR(Priority),RS(RequestToSend),EN(Exception New) - Multicast: All CNs receive this — enabling peer-to-peer producer/consumer communication (a drive can listen to another drive’s PRes without routing through the MN)
Time Slot: Each PReq/PRes pair occupies a dedicated time slot. The MN tracks elapsed time and if PRes is not received within the configured timeout, the CN is marked as having a communication error.
4.3 Asynchronous Phase
After all isochronous slots, the MN sends SoA (Start of Asynchronous):
- Contains:
EPLVersion, NMT status,synccontrol,svid(service ID),svtg(service target) - The SoA frame names which CN is invited to send asynchronous data
- The invited CN responds with ASnd (Asynchronous Send)
- ASnd can carry: SDO transfers, NMT commands, NMT responses, status/error information
- Standard IP-based protocols (TCP, UDP, HTTP, etc.) can be tunneled through ASnd
- If no async data is needed, the SoA frame alone ends the cycle
4.4 Phase Duration Configuration
- The isochronous phase duration is determined by: number of CNs × (PReq transmission time + PRes transmission time + inter-frame gap + PRes response time)
- The asynchronous phase duration is the remainder of CycTime after the isochronous phase
- If the isochronous phase takes longer than CycTime, the MN cannot maintain the cycle → communication error
5. Ethernet Hardware Requirements — PHY / MAC
5.1 What Makes POWERLINK Special About the PHY/MAC
POWERLINK’s key design principle: it uses completely standard Ethernet hardware. There is no custom ASIC or modified MAC required. This is what distinguishes POWERLINK from protocols like EtherCAT (which requires a custom EtherCAT slave controller ASIC).
However, several hardware considerations are critical:
5.1.1 Half-Duplex Mode
POWERLINK operates in half-duplex mode within the real-time domain.
- All frames are broadcast/multicast on a shared segment
- No switches in the real-time domain — only repeating hubs
- Switches introduce store-and-forward delay (frame must be fully received before forwarding) and queuing latency — both destroy deterministic timing
- Hubs simply repeat bits at the PHY level with minimal delay (typically < 1 µs)
5.1.2 Physical Layer
- 100BASE-TX (100 Mbit/s, twisted pair) — primary specified physical layer
- 1000 Mbps (Gigabit Ethernet) also supported since 2006
- Standard Ethernet PHY transceivers are used
- Auto-negotiation should be disabled or fixed to 100 Mbps half-duplex in the real-time domain
- Auto-crossover (MDI-X) is acceptable and simplifies cabling
5.1.3 MAC Layer
- Standard IEEE 802.3 MAC is used
- The CSMA/CD mechanism is effectively bypassed because POWERLINK’s scheduling ensures only one node transmits at a time — no collisions occur under normal operation
- The MAC does not need any modification; the scheduling is implemented in software
- Some implementations use a hardware-assisted “selective forward” mechanism or FPGA-based MAC to reduce software latency (e.g., port PE2MAC IP core, Xilinx solutions)
5.1.4 Network Card Setup for Diagnostics
When capturing traffic with a PC:
- Set to 100 Mbps, half-duplex
- Disable all protocols (TCP/IP, Windows File Sharing, etc.) on the capture interface
- Connect via a hub (not a switch) to see all traffic
- A switch will only forward unicast traffic to the capture port if the port is the destination, missing all other CNs’ traffic
5.1.5 Hardware Acceleration for CNs
While no custom ASIC is required, many CN implementations use hardware acceleration to meet the strict 960 ns PRes response time requirement:
- FPGA-based implementations: Xilinx Spartan/Virtex, Altera Cyclone
- SoC approaches: TI Sitara (AM335x) with PRU-ICSS, NXP i.MX, ARM Cortex with dedicated Ethernet DMA
- Dedicated communication processors: Hilscher netX, IXXAT, Kunbus
5.2 Frame Timing on the Wire
At 100 Mbps:
- 1 bit = 10 ns
- Minimum Ethernet frame = 512 bits (64 bytes) = 5.12 µs (with preamble and IFG)
- Maximum Ethernet frame = 12,288 bits (1536 bytes with preamble) = 122.88 µs
- Inter-frame gap (IFG) = 96 bits = 960 ns
For a 64-byte SoC frame:
- Preamble (8 bytes) + Frame (64 bytes) + FCS (4 bytes) + IFG (12 bytes) = 88 bytes
- 88 × 8 bits × 10 ns = 7,040 ns ≈ 7 µs
6. POWERLINK Frame Format
6.1 EtherType
POWERLINK frames use EtherType 0x88AB (registered with IEEE).
This is how a protocol analyzer (Wireshark) distinguishes POWERLINK frames from standard IP traffic.
6.2 Frame Structure
┌──────────────────────────────────────────────────────────────────┐
│ Ethernet Header (14 bytes) │
│ ┌──────────────┬──────────────┬──────────────────────────────┐ │
│ │ Dest MAC (6B)│ Src MAC (6B)│ EtherType: 0x88AB (2B) │ │
│ └──────────────┴──────────────┴──────────────────────────────┘ │
├──────────────────────────────────────────────────────────────────┤
│ POWERLINK Header │
│ ┌──────────────────┬──────────┬──────────┐ │
│ │ Message Type (1B)│ Src (1B) │ Dest (1B)│ │
│ └──────────────────┴──────────┴──────────┘ │
├──────────────────────────────────────────────────────────────────┤
│ Message-specific payload (variable length) │
│ SoC: NetTime, RelativeTime, flags │
│ PReq/PRes: PDO data, status flags │
│ SoA: EPL version, NMT status, service IDs │
│ ASnd: SDO commands, NMT commands, status responses │
├──────────────────────────────────────────────────────────────────┤
│ Ethernet FCS (4 bytes — CRC32) │
└──────────────────────────────────────────────────────────────────┘
6.3 POWERLINK Message Types
| Type | Name | Direction | Description |
|---|---|---|---|
| SoC | Start of Cycle | MN → All (broadcast) | Cycle synchronization, contains NetTime |
| PReq | Poll Request | MN → CN (unicast) | Invites specific CN to send its data |
| PRes | Poll Response | CN → All (multicast) | CN’s process data response |
| SoA | Start of Asynchronous | MN → CN (unicast) | Opens async phase, names invited CN |
| ASnd | Asynchronous Send | CN → All (multicast) | CN’s async data (SDO, status, etc.) |
| AInv | Async Invitation | — | Multi-ASnd invitation (EPL v2+) |
6.4 Destination / Source Fields in the EPL Header
- Source (
epl.src): Node ID of the sending device (1-240, 0xF0 for MN, 0xFF for broadcast) - Destination (
epl.dest): Node ID of the intended receiver (or broadcast)
Note: The MAC addresses are derived from the nodeID. POWERLINK uses a convention where the last byte of the MAC address encodes the nodeID.
7. Node Addressing and Identification
7.1 Node ID
- Each POWERLINK device is addressed by an 8-bit Node ID (1 to 240)
- Node ID 0xF0 is reserved for the MN (Managing Node)
- Node ID 0xFF is broadcast (all nodes)
- The Node ID has only local significance within a POWERLINK segment
- A CN with nodeID 0 (unset) sends StatusRequest frames during boot-up to get assigned an ID
7.2 Dynamic Node Allocation (DNA)
During boot-up, the MN assigns nodeIDs to unconfigured CNs via the DNA (Dynamic Node Allocation) command in an ASnd frame. The DNA command contains:
| Field | Description |
|---|---|
currnn | Current Node Number of the CN (if known) |
currmac | Current MAC address of the CN |
newnn | New node number to assign |
flags | Which fields are valid |
mac | Compare current MAC ID flag |
cnn | Compare current node number flag |
nnn | Set new node number flag |
leasetime | Lease time for dynamic allocation |
hpm | Hub Port Mask (for topology-aware setup) |
7.3 CN Number
In B&R systems, the “CN number” is the logical number (1, 2, 3…) assigned to each CN in the Automation Studio project. This maps to the POWERLINK nodeID during configuration.
7.4 MAC Address Convention
POWERLINK uses the assigned nodeID to construct the destination MAC for PReq frames. The MAC address format is:
01:01:00:00:00:XX where XX = NodeID (in hex)
For example:
- Node 1:
01:01:00:00:00:01 - Node 10:
01:01:00:00:00:0A - Node 240:
01:01:00:00:00:F0 - MN broadcast:
FF:FF:FF:FF:FF:FF
PRes frames use multicast MAC addresses so all CNs can receive them (producer/consumer model).
8. PDO Mapping over POWERLINK
8.1 PDO in POWERLINK vs. CANopen
In CANopen, PDOs are limited to 8 bytes. In POWERLINK, a single PDO can carry up to 1490 bytes of net data (limited by the Ethernet MTU minus headers).
POWERLINK has only one TxPDO per device (since the frame can carry all data in one transmission), unlike CANopen which has up to 4 TPDOs and 4 RPDOs.
8.2 PDO Mapping Objects (Object Dictionary)
| Object Index | Name | Description |
|---|---|---|
0x1600 | RPDO Mapping (Receive) | Defines which OD entries are mapped into the Rx PDO (data received from MN) |
0x1610 - 0x161F | Additional RPDO Mappings | Up to 16 mapping objects (though typically only 0x1600 is used in EPL) |
0x1A00 | TPDO Mapping (Transmit) | Defines which OD entries are mapped into the Tx PDO (data sent to MN/CNs) |
0x1A10 - 0x1A1F | Additional TPDO Mappings | Additional transmit mapping objects |
Each mapping object contains sub-indices:
- Sub-index 0: Number of mapped objects
- Sub-index 1..254: Mapping entries (16-bit each)
Each mapping entry encodes:
Bits 15..8: Index of the OD object
Bits 7..0: Sub-index of the OD object
The actual number of bytes per mapped object is determined by the data type of the referenced OD entry (e.g., UNSIGNED16 = 2 bytes, REAL32 = 4 bytes, etc.).
8.3 Static vs. Dynamic Mapping
| Type | Description |
|---|---|
| Static mapping | Defined by the device manufacturer. Cannot be changed by the user. Typical for simple sensors/encoders. |
| Dynamic mapping | Configured by the user via SDO during network startup. Typical for complex devices like drives. |
8.4 PDO Communication Parameters
| Object Index | Parameter | Description |
|---|---|---|
0x1400 sub0 | RPDO Communication | Number of entries |
0x1400 sub1 | RPDO COB-ID | CANopen COB-ID (not used for addressing in EPL, but kept for compatibility) |
0x1400 sub2 | RPDO Transmission Type | 0-240 (synchronous, send every Nth cycle) or 254/255 (async) |
0x1800 sub0 | TPDO Communication | Number of entries |
0x1800 sub1 | TPDO COB-ID | CANopen COB-ID for compatibility |
0x1800 sub2 | TPDO Transmission Type | Cyclic or event-driven transmission |
8.5 PDO Version
The PDOVersion field (epl.preq.pdov / epl.pres.pdov) in PReq/PRes frames indicates
whether the PDO mapping has changed. If the MN detects a PDO version mismatch, it may
trigger reconfiguration.
9. SDO Communication
9.1 SDO Transfer Mechanisms
SDOs (Service Data Objects) are used for non-time-critical parameter exchange:
- Configuration during boot-up
- Reading/writing OD entries at runtime
- Diagnostic data access
SDOs can be transferred via three mechanisms in POWERLINK:
| Mechanism | Description | Use Case |
|---|---|---|
| SDO via ASnd | SDO data embedded directly in ASnd frames | Most common; no IP stack needed |
| SDO via UDP/IP | SDO data in standard UDP datagrams | Allows access from outside the real-time domain via IP routing |
| SDO via PDO | SDO data embedded in a PDO container | Rare; for urgent parameter updates in the isochronous phase |
9.2 SDO Protocol Layers
The SDO protocol in POWERLINK has multiple layers (visible in Wireshark):
-
Command Layer (
epl.asnd.sdo.cmd): Initiate read/write, segment, abortcommand.id: SDO Command IDdata.index/data.subindex: OD object referencedata.size: Total data size
-
Sequence Layer (
epl.asnd.sdo.seq): Segmentation and flow controlsend.sequence.number/receive.sequence.number: Sequence countersend.con/receive.con: Confirmation toggle
-
Fragmentation: Wireshark can reassemble fragmented SDO transfers using the
fragmentfields
9.3 SDO Abort Codes
SDO transfers can be aborted with a 32-bit abort code (visible in epl.asnd.sdo.cmd.abort.code).
Common abort codes include:
0x05040001: Toggle bit not alternated0x06040000: SDO protocol timeout0x06040001: Client/server command specifier not valid0x06040041: SDO blocked by the SDO client0x06040042: Memory size exceeds SDO block size0x06060000: Unsupported access to an object0x06070010: Data type does not match (length error)0x08000000: General error
10. Object Dictionary Layout
10.1 Standard POWERLINK Object Dictionary Structure
| Index Range | Area | Description |
|---|---|---|
0x0000 | — | Not used |
0x0001 - 0x001F | Static Data Types | BOOLEAN, INTEGER8, UNSIGNED16, REAL32, VISIBLE_STRING, etc. |
0x0020 - 0x003F | Complex Data Types | Pre-defined structures (records, arrays) |
0x0040 - 0x005F | Manufacturer Specific Complex Types | Vendor-defined structures |
0x0060 - 0x007F | Device Profile Specific Static Types | Profile-specific data types |
0x0080 - 0x009F | Device Profile Specific Complex Types | Profile-specific structures |
0x00A0 - 0x03FF | Reserved | |
0x0400 - 0x041F | POWERLINK Specific Static Data Types | EPL-specific type definitions |
0x0420 - 0x04FF | POWERLINK Specific Complex Data Types | EPL-specific structures |
0x0500 - 0x0FFF | Reserved | |
0x1000 - 0x1FFF | Communication Profile Area | NMT, PDO, SDO, timing parameters |
0x2000 - 0x5FFF | Manufacturer Specific Profile Area | Vendor-specific parameters |
0x6000 - 0x9FFF | Standardised Device Profile Area | CANopen device profiles (DSP402 drives, etc.) |
0xA000 - 0xBFFF | Standardised Interface Profile Area | Interface profiles |
0xC000 - 0xFFFF | Reserved |
10.2 Key Communication Objects
| Index | Name | Type | Description |
|---|---|---|---|
0x1000 | Device Type | UNSIGNED32 | Bitfield identifying device capabilities |
0x1001 | Error Register | UNSIGNED8 | Generic error indicator (bitfield) |
0x1005 | COB-ID SYNC | UNSIGNED32 | CANopen compatibility (sync object) |
0x1006 | Communication Cycle Period | UNSIGNED32 | NMT_CycleLen_U32 — cycle length in µs |
0x1007 | Synchronous Window Length | UNSIGNED32 | Window for synchronous PDO transmission |
0x1008 | Manufacturer Device Name | VISIBLE_STRING | Device name string |
0x1009 | Manufacturer Hardware Version | VISIBLE_STRING | Hardware version |
0x100A | Manufacturer Software Version | VISIBLE_STRING | Software version |
0x1010 | Store Parameters | UNSIGNED8 | Commands to store params to non-volatile memory |
0x1011 | Restore Default Parameters | UNSIGNED8 | Commands to restore factory defaults |
0x1017 | Producer Heartbeat Time | UNSIGNED16 | Heartbeat time in ms |
0x1018 | Identity Object | RECORD | VendorID, ProductCode, RevisionNo, SerialNo |
0x1400+ | RPDO Communication | RECORD | Receive PDO parameters (COB-ID, type, inhibit, event timer) |
0x1600+ | RPDO Mapping | RECORD | RPDO mapping entries |
0x1800+ | TPDO Communication | RECORD | Transmit PDO parameters |
0x1A00+ | TPDO Mapping | RECORD | TPDO mapping entries |
0x1F12 | NMT Startup Parameters | RECORD | MN-specific startup configuration |
0x1F1x | DLL Error Counters | RECORD | Loss of frame, CRC error, timeout counters |
10.3 Identity Object (0x1018)
| Sub-index | Name | Description |
|---|---|---|
| 0 | NumberOfEntries | Number of vendor-specific entries (typically 4) |
| 1 | VendorID | IEEE OUI of the device manufacturer |
| 2 | ProductCode | Manufacturer-specific product code |
| 3 | RevisionNumber | Hardware/software revision |
| 4 | SerialNumber | Device serial number |
11. Error Handling and Recovery
11.1 Error Detection Mechanisms
POWERLINK uses multiple layers of error detection:
| Layer | Mechanism | Detection |
|---|---|---|
| Ethernet PHY | Signal Quality Error (SQE), carrier loss | Physical layer issues |
| Ethernet MAC | CRC-32 (FCS) | Frame corruption from EMI, cabling issues |
| POWERLINK DLL | Frame timeout, sequence monitoring | Missed PRes, cycle timing violations |
| POWERLINK NMT | State machine monitoring | Communication loss, CN not responding |
| SDO | Abort codes, sequence number validation | Transfer failures, timeout |
| Application | Error register (0x1001), error history | Device-specific errors |
11.2 DLL Error Counters
Each POWERLINK device maintains error counters accessible via SDO:
| Counter | Description | Typical Object |
|---|---|---|
| LossOfFrameCnt | Number of SoC frames not received within expected window | DLL object |
| CRCErrCnt | Number of frames received with CRC/FCS errors | DLL object |
| TimeoutCnt | Number of PReq timeouts (MN) or PRes timeouts (CN) | DLL object |
| InvalidFrameCnt | Number of frames with invalid POWERLINK header/format | DLL object |
| BufferOverflowCnt | Number of times a receive buffer overflowed | DLL object |
B&R devices provide additional Ethernet-level error counters for diagnosing physical network connections (cable and connector quality).
11.3 Timeout Handling
When the MN sends a PReq to a CN and does not receive a PRes within the configured
PresTime:
- Immediate cycle: The MN marks the slot as “missed” and continues to the next CN
- LossOfFrameTolerance: If the CN misses a configurable number of consecutive cycles, the MN declares the CN as lost
- CN state transition: The MN may issue an NMT_Stop_Node or NMT_Reset_Command to the affected CN
- Error logging: The error is recorded in the MN’s error counters and typically triggers a diagnostic alarm (WCC or mapp alarm in Automation Studio)
11.4 CRC Error Handling
CRC errors are detected at the Ethernet MAC level:
- The received frame’s FCS does not match the computed CRC-32
- The frame is discarded — no POWERLINK processing occurs
- The CRCErrCnt counter is incremented
- If the corrupted frame was a PRes, the MN treats it as a missed response (same as timeout)
- Common causes: damaged cables, EMI (variable frequency drives, welding equipment), loose connectors, exceeding cable length limits
11.5 Duplicate Detection
POWERLINK’s sequence layer includes mechanisms to detect duplicate frames:
- The Sequence Layer (
epl.asnd.sdo.seq) maintainsSendSequenceNumberandReceiveSequenceNumbercounters - Wireshark flags duplicated frames with the
epl.asnd.sdo.duplicationexpert info - Invalid sequence values trigger
epl.error.value.send.sequenceorepl.error.value.receive.sequenceerrors
11.6 Error Register (0x1001) — Static Error Bitfield
| Bit | Meaning |
|---|---|
| Bit 0 | Generic error |
| Bit 1 | Current (device drawing excess current) |
| Bit 2 | Voltage (supply voltage out of range) |
| Bit 3 | Temperature (device temperature out of range) |
| Bit 4 | Communication error (EPL-specific) |
| Bit 5 | Device Profile Spec (profile-specific error) |
| Bit 7 | Manufacturer Spec (vendor-specific error) |
11.7 Automatic Recovery
- CN timeout recovery: After the MN declares a CN as lost, the CN may automatically restart its state machine and attempt to re-join the network (back to PreOperational1)
- Watchdog: The MN has an internal watchdog timer. If the MN itself fails, all CNs detect loss of SoC frames and enter a safe state (typically Stopped or Reset)
- Hot-plugging: New CNs can be hot-plugged into a running POWERLINK network. They send StatusRequest frames, get assigned a nodeID via DNA, and go through the full configuration sequence
12. Capturing and Analyzing EPL Traffic with Wireshark
12.1 EPL Protocol Support in Wireshark
Wireshark has built-in POWERLINK (EPL) protocol support since version 1.0.0.
No additional plugin is required — the dissector is registered for EtherType 0x88AB.
The dissector is identified by the protocol field epl.
12.2 Hardware Setup for Capture
| Requirement | Details |
|---|---|
| Network Interface | Any Ethernet NIC (100 Mbps recommended) |
| Connection Method | Connect PC via a hub (not switch) to see all traffic |
| Duplex Setting | Set NIC to half-duplex, 100 Mbps |
| Protocol Cleanup | Disable all protocols (TCP/IP, Client for Microsoft Networks, File and Print Sharing, etc.) on the capture interface to prevent the PC from injecting non-EPL frames |
| Advanced Tip | Use B&R X20ET8819 network analysis tool for nanosecond-precision timestamps and hardware-triggered capture |
12.3 Wireshark Display Filters
Wireshark provides a comprehensive set of epl.* display filters:
Message type filters:
epl.soc # Start of Cycle frames
epl.preq # Poll Request frames
epl.pres # Poll Response frames
epl.soa # Start of Asynchronous frames
epl.asnd # Asynchronous Send frames
epl.ainv # Async Invitation (Multi-ASnd)
Node filters:
epl.src == 1 # All frames sent by NodeID 1
epl.dest == 1 # All frames addressed to NodeID 1
epl.src == 0xf0 # All frames from the MN
Status and error filters:
epl.pres.stat == 0x07 # PRes with NMT state = Operational
epl.pres.stat == 0x04 # PRes with NMT state = PreOperational1
epl.pres.en == 1 # PRes with Exception New flag set
epl.error # Any EPL error expert info
epl.error.payload.length.differs # Payload length mismatch
SDO filters:
epl.asnd.sdo # Any SDO transfer
epl.asnd.sdo.cmd.abort # SDO abort frames
epl.asnd.sdo.cmd.data.index == 0x1006 # SDO access to cycle time object
PDO content visualization: To visualize cyclic user data, add a custom column:
- Select a PRes frame
- Right-click the “Payload” field
- Select “Apply as Column”
- Rename to “PRes-Payload”
12.4 Color Rules for Quick Analysis
Define Wireshark coloring rules for quick visual identification:
epl.soc → Blue (sync frame)
epl.preq → Green (MN polling)
epl.pres → Orange (CN response)
epl.soa → Purple (async phase start)
epl.asnd → Brown (async data)
epl.error → Red (errors)
12.5 Sample Captures
Wireshark includes sample EPL captures on the Wireshark Wiki SampleCaptures page:
- EPLv1 capture: MN and three CNs in operational mode
- EPLv2 capture: Boot-up of MN and one CN
These are excellent references for learning the frame sequences.
12.6 Practical Capture Workflow
- Connect PC to POWERLINK segment via hub
- Disable all network protocols on the capture NIC
- Start Wireshark, select the capture NIC
- Apply a capture filter if needed:
ether proto 0x88AB(captures only EPL frames) - Let it run for several cycles (typically 1-2 seconds is enough)
- Stop capture, save as pcapng
- Sort by “Time” column to see the repeating cycle pattern
- Apply display filters to focus on specific nodes or frame types
13. Identifying Dropped Packets and Timing Violations
13.1 Symptoms of Sensor Glitches Caused by EPL Issues
- Intermittent position/velocity jumps in drives
- Sporadic sensor readout errors (stale data, wrong values)
- Unexpected NMT state transitions on CNs (dropping from Operational to Stopped)
- Watchdog or communication alarms in the PLC
13.2 Identifying Missed PRes in Wireshark
Look for a PReq without a corresponding PRes:
- Filter:
epl.preq - Examine the time between consecutive PReq frames
- If the gap for a PReq→PRes pair is abnormally long (or there’s no PRes between two PReq frames), the CN missed its slot
The MN’s behavior on a missed PRes:
- The cycle continues to the next CN’s PReq
- The CN’s error counter increments
- After
LossOfFrameToleranceconsecutive misses, the CN is dropped
13.3 Identifying CRC Errors
- In Wireshark, look for frames with “Frame check sequence: [incorrect, should be …]” in the Ethernet layer detail
- Filter with
eth.fcs_bad == 1(if the NIC reports FCS errors) - Check the DLL error counters via SDO: read the CRCErrCnt object
Note: Many modern NICs strip the FCS before passing frames to the operating system, so CRC errors may not be visible in Wireshark. Use the device’s internal error counters instead, or use a network analyzer that preserves FCS (like B&R X20ET8819).
13.4 Cycle Timing Violations
To verify cycle timing in Wireshark:
- Filter:
epl.soc - Examine the time delta between consecutive SoC frames
- Compare against the configured CycTime
- If the delta varies significantly (> 10% of CycTime), there may be:
- Too many CNs for the configured cycle time
- Async phase taking too long
- NIC/driver latency on the capture PC
Important: PC-based timestamps are inherently inaccurate for sub-microsecond measurements. For precise jitter analysis, use hardware-based network analyzers.
13.5 Frame Sequence Errors
If the frame order appears wrong in a capture:
- This is almost always a capture artifact (PC NIC buffer timing, OS scheduling)
- Connect the PC via a hub (not switch)
- Disable all protocols on the capture NIC
- Use hardware-based capture for definitive results
The MN itself handles frame timing with much tighter tolerances than a PC can observe.
14. POWERLINK Configuration Files (XML Descriptors)
14.1 XDD — XML Device Description File
Every POWERLINK CN is described by an XDD (XML Device Description) file. This is standardized per ISO 15745-4 and EPSG DS311.
The XDD file contains:
- VendorID, ProductCode, RevisionNo — device identity
- Object Dictionary — all OD entries with index, sub-index, data type, access rights, defaults
- PDO mapping — default TPDO/RPDO mapping entries
- Device profile — profile-specific parameters (e.g., DSP402 for drives)
- EPLVersion — supported POWERLINK version
- Feature flags — isochronous support, SDO by UDP/IP, dynamic PDO mapping, multiplexing, etc.
Format:
<?xml version="1.0" encoding="UTF-8"?>
<ISO15745ProfileContainer>
<ISO15745Profile>
<ProfileBody>
<ApplicationLayers>
<DeviceProfileClass>
<ProfileBody>
<ISO15745ProfileContainer ...>
<!-- Object Dictionary entries -->
</ISO15745ProfileContainer>
</ProfileBody>
</DeviceProfileClass>
</ApplicationLayers>
</ProfileBody>
<ProfileHeader>...</ProfileHeader>
</ISO15745Profile>
</ISO15745ProfileContainer>
14.2 XDC — XML Device Configuration File
After network configuration is complete in Automation Studio, a build process generates an XDC file for each CN. The XDC file is the configured version of the XDD — it contains the actual parameter values (PDO mapping, nodeID, cycle parameters) as configured in the project.
The XDC is used by:
- The MN at runtime to know how to configure each CN
- openCONFIGURATOR or other tools for network setup
- Third-party integration tools
14.3 CDC — Configuration Description File
The MN’s configuration is stored in a CDC file. This is generated by the network configuration tool (Automation Studio, openCONFIGURATOR, or CODESYS) and contains:
- All CN configurations
- Node IDs
- PDO mappings
- Cycle time parameters
- Prescaler assignments
- Asynchronous MTU
14.4 Configuration Files on the CF Card
On B&R PLCs, the POWERLINK configuration is deployed to the Compact Flash (or SD) card as part of the Automation Studio project:
/Synchronize/
└── <ProjectName>/
├── Config.prc
├── <MN_Interface>.cfg
└── Powerlink/
├── MN_Configuration.xml (or .cdc)
├── CN1_Configuration.xdc
├── CN2_Configuration.xdc
├── ...
└── CNn_Configuration.xdc
The exact file structure may vary by Automation Runtime version. The MN reads these configuration files at startup to configure the POWERLINK network.
14.5 ETS/EDS — Legacy CANopen Device Description
Some legacy devices may provide EDS files (CANopen Electronic Data Sheet format). These can be imported into Automation Studio or openCONFIGURATOR, which converts them into XDD/XDC format for POWERLINK use.
15. Modifying POWERLINK Parameters Without Automation Studio
15.1 Via SDO Access
Since POWERLINK uses CANopen’s object dictionary, any OD entry can be read or written via SDO:
Using openCONFIGURATOR:
- Import the XDD files for all devices
- Configure the network visually (node IDs, PDO mapping, cycle time)
- Generate the CDC configuration file
- Deploy to the MN
Using B&R tools:
- The B&R Automation Studio “Physical View” allows direct configuration of the POWERLINK interface parameters
- Configuration is compiled into the project and deployed on next download
15.2 Via OPC UA (POWERLINK for OPC UA)
The OPC UA companion specification (OPC-30110) provides direct access to the POWERLINK Object Dictionary from any OPC UA client. This allows:
- Reading/writing OD entries without Automation Studio
- Diagnostic access from standard HMI/SCADA systems
- Configuration changes at runtime
15.3 Via Network Trace Tools (Read-Only)
You can observe but not modify parameters via Wireshark by examining:
- SDO write commands during boot-up (
epl.asnd.sdo.cmd.write.by.index) - NMT commands (
epl.asnd.nmtcommand) - PDO mapping configuration SDOs
15.4 Using the openPOWERLINK Stack API
For developers using the openPOWERLINK stack, parameters are modified via the API:
// Example: Read/write OD entry
tOplkError oplk_readObject(UINT16 index_p, UINT8 subIndex_p,
tPlkDataType *pDataType_p, void *pDstData_p, UINT16 *pSize_p);
tOplkError oplk_writeObject(UINT16 index_p, UINT8 subIndex_p,
tPlkDataType dataType_p, UINT16 dataSize_p, const void *pSrcData_p);
15.5 Direct File Editing (Advanced)
On B&R systems, the XDC/CDC configuration files on the CF card are XML files that can theoretically be edited directly. However:
- This is NOT recommended by B&R and may void support
- The MN may verify file integrity (checksums, signatures)
- Incorrect edits can cause the network to fail to start
- Always back up the original files before modification
If you must edit offline, use a validated XML editor and check against the DS311/XDD schema.
16. Troubleshooting Intermittent Communication Failures
16.1 Systematic Troubleshooting Checklist
Layer 1 — Physical Layer
- Verify all cable lengths are within 100 m (Cat5) specification
- Check for damaged cables, kinks, sharp bends, crushed sections
- Inspect RJ-45 connectors for oxidation, bent pins, poor crimps
- Ensure proper grounding and shielding (use industrial-grade cable)
- Check for EMI sources near cables (VFDs, welding, power cables)
- Verify hub port LEDs show consistent link activity
- Separate POWERLINK cables from high-power cables
Layer 2 — Ethernet / MAC
- Verify half-duplex mode on all devices (no duplex mismatch)
- Confirm all devices are at 100 Mbps (no speed mismatch)
- Check Ethernet error counters: CRC errors, frame alignment errors, collisions
- Verify no switches in the real-time domain (only hubs)
- Check for broadcast storms from non-EPL sources
Layer 3 — POWERLINK DLL
- Read DLL error counters from all devices via SDO
- Check
LossOfFrameCnt— if incrementing, SoC is not arriving consistently - Check
CRCErrCnt— if incrementing, physical layer issue - Check
TimeoutCnt— if incrementing, CNs are too slow or cycle time too short
Layer 4 — POWERLINK NMT
- Check NMT state of all CNs (should be 0x07 = Operational)
- Look for CNs dropping to Stopped (0x08) or lower states
- Check PLC alarm log for POWERLINK errors (WCC_WATCHDOG, mnuErrorStat)
- Verify all CNs completed boot-up and configuration successfully
Layer 5 — Application / Configuration
- Verify PDO mapping is correct (no mismatch between MN expectation and CN configuration)
- Verify CycTime is long enough for all nodes and their data payloads
- Check async MTU is sufficient for async traffic requirements
- Verify node IDs are unique and correct
16.2 Common Root Causes of Intermittent Failures
| Symptom | Likely Root Cause | Diagnostic |
|---|---|---|
| Random sensor glitches | Cycle time too short for number of nodes | Calculate minimum cycle time; increase CycTime |
| One CN periodically drops out | Cabling issue to that CN; loose connector | Swap cable; check CRC error counters |
| All CNs drop simultaneously | Hub failure; MN issue; power supply | Check MN health; try different hub |
| Delay increases over time | Hub port overheating; cable degradation | Monitor over time; replace hub |
| CNs fail after firmware update | XDC mismatch; PDO version change | Regenerate XDC; clear MN configuration cache |
| Only during certain machine states | EMI from actuators (VFDs, solenoids) | Route cables away from EMI sources; use shielded cable |
| Occurs when adding new nodes | CycTime exceeded; too much data | Reduce PDO payload or increase CycTime |
| Sporadic, cannot reproduce | OS jitter on MN (Windows-based MN); hardware timing | Use Linux-based MN; check MN CPU load |
16.3 Network Diagnostic Tools
| Tool | Capability | Notes |
|---|---|---|
| Wireshark | Free; captures and decodes EPL frames | Timestamps limited by OS; best via hub |
| OmniPeak (Savvius) | Commercial; similar to Wireshark | Better filtering and analysis |
| B&R X20ET8819 | Hardware analyzer; nanosecond timestamps; trigger inputs | Most precise; can capture sporadic errors via DI trigger |
| B&R Automation Studio Diagnostics | Online monitoring of error counters, NMT states | Built-in to B&R PLC runtime |
| openCONFIGURATOR | Network configuration and diagnostics | Open-source; SourceForge |
16.4 B&R PLC Diagnostic Approach
- Check the PLC alarm log (System → Diagnostics in Automation Studio or web interface)
- Look for POWERLINK-specific alarms:
WCC_WATCHDOG,mnuErrorStat,plkErrorState - Use the POWERLINK library diagnostic FBs (e.g.,
MC_Powerlink_STATE,MC_Powerlink_DIAG) - Read error counters from the MN and each CN via SDO or OPC UA
- If the PLC log shows specific nodeIDs failing, focus on those CNs
16.5 Advanced: EPL-Viz
EPL-Viz is a visualization tool for Ethernet POWERLINK networks that provides:
- Network state monitoring
- Cycle timing analysis
- Error pattern detection
- Timeline visualization
Available at: https://epl-viz.github.io/
Cross-References
- x2x-protocol.md — X2X bus protocol; the local IO bus that feeds data into POWERLINK
- physical-layer-sniffing.md — Probing Ethernet/POWERLINK signals at the physical layer
- network-architecture.md — Network topology design, Ethernet switching requirements for POWERLINK
- execution-model.md — How POWERLINK cycle timing interacts with task class scheduling
- acopos-drives.md — ACOPOS servo drive POWERLINK communication and diagnostics
- cp1584-hardware-ref.md — CP1584 POWERLINK interface specifications (IF3)
- io-sniffing.md — Higher-level sniffing methodology combining POWERLINK capture with IO analysis
- config-file-formats.md — POWERLINK configuration in ARConfig.ini and X2X Link settings
- cf-card-boot.md — How POWERLINK configuration is loaded at boot from the CF card
- diagnostic-workstation.md — Wireshark setup and network tap hardware for POWERLINK analysis
- plc-to-plc.md — POWERLINK as the primary PLC-to-PLC communication mechanism
- firmware.md — AR version requirements for POWERLINK features and fixes
17. References and Source URLs
Official Specifications (EPSG / B&R)
| Document | URL |
|---|---|
| EPSG DS 301 V1.5.1 — Communication Profile Specification | https://br-cws-assets.de-fra-1.linodeobjects.com/EPSG_301_V-1-5-1_DS-c710608e.pdf |
| EPSG DS 302-B V1.1.1 — NMT State Machine, MN/CN Cycle States | https://br-cws-assets.de-fra-1.linodeobjects.com/EPSG_302-B_V-1-1-1_DS-39befa02.pdf |
| EPSG DS 310 V1.0.10 — CN State Transitions | https://www.br-automation.com/fileadmin/EPSG_310_V-1-0-10_DS-pdf-b9da88aa.pdf |
| B&R POWERLINK FAQ | https://www.br-automation.com/en-us/technologies/powerlink/faq/ |
| B&R TM950 — POWERLINK Configuration and Diagnostics | https://www.br-automation.com/en/academy/classroom-training/training-modules/connectivity/tm950-powerlink-configuration-and-diagnostics/ |
OPC Foundation — OPC UA for POWERLINK
| Document | URL |
|---|---|
| OPC-30110 — General Information | https://reference.opcfoundation.org/specs/OPC-30110/4 |
| OPC-30110 — Terms, Definitions, Conventions | https://reference.opcfoundation.org/specs/OPC-30110/3 |
Wireshark Resources
| Resource | URL |
|---|---|
| Wireshark EPL Display Filter Reference | https://www.wireshark.org/docs/dfref/e/epl.html |
| B&R Community — Diagnosis of POWERLINK Networks Using Wireshark | https://community.br-automation.com/t/diagnosis-of-powerlink-networks-using-wireshark/3648 |
| Wireshark Sample Captures (EPL) | https://wiki.wireshark.org/samplecaptures |
openPOWERLINK (Open Source)
| Resource | URL |
|---|---|
| openPOWERLINK V2 (GitHub) | https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2 |
| openPOWERLINK (SourceForge) | https://sourceforge.net/projects/openpowerlink/ |
| openCONFIGURATOR | https://sourceforge.net/projects/openconf/ |
Using openPOWERLINK for POWERLINK protocol analysis on Linux: The openPOWERLINK stack implements both MN (master) and CN (slave) roles and runs on standard Linux with either user-space or kernel-space (via Xenomai or PREEMPT_RT) execution. For diagnostic purposes, you can:
- Build a POWERLINK CN (slave) on a Linux PC that joins the B&R POWERLINK network, allowing you to receive and log all PDO data from the MN in real-time without needing Wireshark.
- Use the openPOWERLINK MN (master) on Linux to independently poll all CNs on the network, verifying node addressing and identifying nodes that the B&R MN may not be communicating with.
- Capture raw POWERLINK frames at the application layer using openPOWERLINK’s event/callback system, which provides decoded frame data (SoC, PReq, PRes, SoA, ASnd) — more structured than raw Wireshark captures.
The stack is BSD-licensed and supports Linux, Windows, and Xilinx/Altera FPGAs. See the GitHub README for build instructions. This is an advanced technique for complex multi-node POWERLINK diagnostics where Wireshark capture alone is insufficient. See io-sniffing.md for the full fieldbus sniffing methodology.
Hardware and Implementation
| Resource | URL |
|---|---|
| port GmbH — POWERLINK Products | https://www.port.de/en/products/ethernet-powerlink.html |
| port PE2MAC IP Core | https://www.port.de/fileadmin/user_upload/Dateien_IST_fuer_Migration/Produktbilder/pe2mac_e.pdf |
| Xilinx Ethernet POWERLINK Solution | https://www.xilinx.com/publications/prod_mktg/Ethernet_Powerlink_ssht.pdf |
| POWERLINK on TI Sitara Processors | Texas Instruments Application Report SPRY275A |
| Hilscher POWERLINK Controlled Node API | https://www.hilscher.com/fileadmin/cms_upload/de/Resources/pdf/POWERLINK_Controlled_Node_V3_Protocol_API_05_EN.pdf |
| EPL-Viz Visualization Tool | https://epl-viz.github.io/ |
Community and Knowledge Base
| Resource | URL |
|---|---|
| B&R Community Forum | https://community.br-automation.com/ |
| SEW-Eurodrive POWERLINK Basics | https://download.sew-eurodrive.com/download/html/31550045/en-EN/3139678618731399154827.html |
| CAN/CiA — CANopen on Real-Time Ethernet | https://www.can-cia.org/fileadmin/cia/documents/proceedings/2005_a_pfeiffer.pdf |
| Ethernet Powerlink — Wikipedia | https://en.wikipedia.org/wiki/Ethernet_Powerlink |
Configuration File Tools
| Resource | URL |
|---|---|
| XDD Tool Suite (Eclipse Marketplace) | https://marketplace.eclipse.org/content/ethernet-powerlink-xdd-tool-suite |
| POWERLINK Configuration Editor (CODESYS) | https://us.store.codesys.com/media/n98_media_assets/files/n98_media_assets/files/p/r/product_datasheet_powerlink_en.pdf |
B&R Configuration Guides
| Resource | URL |
|---|---|
| B&R CRA Guide for POWERLINK | https://br-cws-assets.de-fra-1.linodeobjects.com/BR_CRA-Guide-2026-b4951272.pdf |
| ABB — Generic Drive Interface with B&R PLC and EPL | https://library.e.abb.com/public/1473b3a7347d4c338a2d8dcc2d663f12/AN00264_Generic_drive_interface_BanR_PLC_with_EPL_Rev_A_EN.pdf |
Key Findings
-
POWERLINK is a software-based real-time Ethernet protocol requiring no proprietary ASICs – it runs on any standard 100BASE-TX Ethernet MAC/PHY silicon. The MN (Managing Node) controls media access via Slot Communication Network Management (SCNM), granting deterministic time slots to each CN (Controlled Node). Cycle times down to 100 us with jitter < 1 us are achievable; up to 240 CNs per segment are supported.
-
The POWERLINK cycle has three phases: Start Phase (SoC broadcast with NetTime), Isochronous Phase (sequential PReq/PRes polling of each CN), and Asynchronous Phase (SoA + ASnd for SDO, NMT, diagnostics, and tunneled IP traffic). If the isochronous phase exceeds CycTime, the MN cannot maintain the cycle and triggers a communication error.
-
Minimum cycle time calculation: each PReq/PRes pair adds
(payload_bytes * 8 + 64) * 10 nstransmission time plus 960 ns inter-frame gap. For 10 nodes with 32 bytes PDO each, the minimum is approximately 175 us. The Prescaler mechanism allows polling different CN groups at different rates (e.g., every Nth cycle for slow sensors). -
The CANopen application layer means PDO mapping objects (0x1400/0x1600 for RPDO, 0x1800/0x1A00 for TPDO) and SDO communication (abort codes, sequence layers) work identically to CANopen over CAN. The object dictionary structure (0x1000-0x1FFF communication area, 0x6000-0x9FFF device profiles) is standard CiA DS301.
-
Wireshark capture setup: connect a PC NIC directly to the POWERLINK hub (not switch), deactivate TCP/IP on the capture interface, set half-duplex 100 Mbps. Key display filters:
epl.service_type == "PRes"for IO data,epl.service_type == "ASnd"for configuration/diagnostics,epl.src == <NodeID>to isolate a specific station. -
Error handling uses multiple layers: Ethernet CRC-32 (FCS) for frame corruption, DLL error counters (LossOfFrameCnt, CRCErrCnt, TimeoutCnt, InvalidFrameCnt, BufferOverflowCnt accessible via SDO), and NMT state machine transitions. When a CN misses the configurable
LossOfFrameToleranceconsecutive cycles, the MN declares it lost and issues NMT_Stop_Node. -
The MN boot-up sequence visible in Wireshark: unconfigured CNs send StatusRequest (node 0xF0), MN responds with IdentResponse, assigns nodeID via DNA, reads XDD parameters via SDO, configures PDO mapping, issues NMT_EnableReadyToOperate, then NMT_Start_Node to enter Operational state.
-
Intermittent POWERLINK failures are most commonly caused by: damaged cables/loose connectors (CRC errors), EMI from VFDs/welders, exceeding 100 m cable length limit, switches introducing variable latency (use hubs instead), and bus overload (isochronous phase exceeding CycTime). Monitor DLL error counters to distinguish physical-layer errors from timing violations.
Document compiled from official EPSG specifications, B&R documentation, OPC Foundation companion specifications, Wireshark dissector documentation, openPOWERLINK source code references, community knowledge base posts, and hardware vendor application notes.
B&R X20IF2772 CAN Bus Module — Comprehensive Technical Reference
The X20IF2772 is B&R’s CAN bus interface module for the X20 system, implementing CANopen over CAN 2.0B. On legacy machines, CANopen networks often connect sensors, actuators, third-party devices, and subsystems that are critical to machine operation but poorly documented. This document covers the IF2772 hardware specifications, CANopen protocol stack implementation on B&R, PDO/SDO mapping, CAN identifier assignment, hardware-level CAN bus sniffing with tools like PCAN and Vector CANalyzer, and how to decode sensor data from raw CAN messages to diagnose field-level problems. Cross-references: io-card-hardware.md for IO card hardware architecture, physical-layer-sniffing.md for physical-layer CAN probing techniques, and io-sniffing.md for general fieldbus sniffing approaches.
Table of Contents
- IF2772 Module Specifications
- CANopen on B&R: Protocol Stack Implementation
- PDO/SDO Mapping on B&R CAN Modules
- CAN Identifier Assignment
- Bit Timing Configuration
- Hardware CAN Bus Sniffing
- SocketCAN on Linux
- Decoding Sensor Data from CAN Messages
- CANopen Error Handling
- IF2772 Configuration Parameters (Object Dictionary)
- Setting Up CANopen on B&R Without the Original Project
- Common CAN Bus Problems and Diagnostic Procedures
- Wiring and Termination Requirements
- CAN Analysis Tools Comparison
1. IF2772 Module Specifications
Module Overview
The B&R X20IF2772 is a dual CAN bus interface module for the B&R X20 I/O system. It provides application-specific expansion of X20 controllers via two independent, electrically isolated CAN bus interfaces, each capable of up to 1 Mbit/s.
Order number: X20IF2772
B&R ID code: 0x1F25 (decimal 7973)
Key Hardware Specifications
| Parameter | Value |
|---|---|
| CAN Interfaces | 2 (IF1 and IF2) |
| CAN Controller | SJA1000 (NXP/Philips — standalone CAN controller) |
| Max Transfer Rate | 1 Mbit/s per interface |
| Max Bus Distance | 1000 m (at lower baud rates; ~40 m at 1 Mbit/s) |
| CAN ID Format | 11-bit standard; does NOT support CAN RTR with 29-bit extended IDs |
| Connectors | 2x 5-pin multipoint male connector (order terminal block TB2105 separately) |
| Terminating Resistors | Integrated, individually switchable per interface |
| Electrical Isolation | PLC isolated from CAN (IF1 and IF2); interfaces isolated from each other |
| Power Consumption | 1.2 W |
| Node Addressing | 2 hex rotary DIP switches (shared for both interfaces) |
| Operating Temperature | -25 to +60°C (horizontal), -25 to +50°C (vertical) |
| Storage Temperature | -40 to +85°C |
| Protection Rating | IP20 |
Connector Pinout (both IF1 and IF2)
| Pin | Function |
|---|---|
| 1 | CAN_GND — CAN ground |
| 2 | CAN_L — CAN low (dominant low) |
| 3 | SHLD — Shield |
| 4 | CAN_H — CAN high (dominant high) |
| 5 | NC — Not connected |
Required accessory terminal blocks:
0TB2105.9010— screw clamp, 2.5 mm²0TB2105.9110— push-in, 2.5 mm²
LED Status Indicators
| LED | Color | Meaning |
|---|---|---|
| STATUS | Green (on) | Interface module active |
| STATUS | Red (on) | Controller is starting up |
| TxD CAN 1 | Yellow (on) | Module transmitting on IF1 |
| TxD CAN 2 | Yellow (on) | Module transmitting on IF2 |
| TERM CAN 1 | Yellow (on) | Integrated terminating resistor active on IF1 |
| TERM CAN 2 | Yellow (on) | Integrated terminating resistor active on IF2 |
Certifications
CE, UKCA, ATEX Zone 2 (II 3G Ex nA nC IIA T5 Gc), cULus, DNV, CCS, LR, KR, ABS, BV, KC.
Supported CANopen Features
- CANopen master operation (configurable in Automation Studio 3.0+)
- NMT master/slave functionality
- PDO (TPDO and RPDO) communication
- SDO (client and server) for configuration
- SYNC object generation/consumption
- EMCY (Emergency) object support
- Heartbeat producer/consumer
- EDS file-based device configuration
- DTM (Device Type Manager) configuration mode
Limitations: The module does NOT support CAN RTR messages with extended CAN identifiers (29-bit) due to memory/performance constraints of the SJA1000 controller. Standard 11-bit identifiers work fully.
Module Specifications Sources
- B&R X20IF2772 datasheet V2.30: https://docs.rs-online.com/5f80/A700000013921576.pdf
- B&R product page: https://www.br-automation.com/en-us/products/io-systems/x20-system/x20-interface-module-communication/x20if2772/
- Automation Distribution: https://automationdistribution.com/b-r-x20if2772-x20-interface-can-can/
2. CANopen on B&R: Protocol Stack Implementation
Architecture
B&R’s CANopen implementation on the X20 platform is integrated into the Automation Studio development environment and runs on the X20 controller (CPU). The CANopen protocol stack runs as a system-level service managed by the controller’s firmware, not on the IF2772 module itself. The IF2772 provides the physical CAN bus interface (SJA1000 CAN controller + transceiver), while the protocol processing occurs in the controller.
B&R CANopen Module Family
| Module | Function | Notes |
|---|---|---|
| X20IF1041-1 | CANopen Master | DTM configuration, 1 CAN interface, 8 MB SDRAM |
| X20IF1043-1 | CANopen Slave (DTM) | 1 CANopen slave interface |
| X20IF10E3-1 | CANopen Slave | Similar slave variant |
| X20IF2772 | 2x CAN (generic) | Dual CAN, configurable as CANopen master in AS 3.0+ |
| X20IF1063 | CAN bus (X2X Link + CAN) | Hybrid module |
The IF2772 differs from the IF1041-1 in that it has two CAN interfaces and was originally designed as a generic CAN bus module. CANopen master capability was added via firmware/Automation Studio support starting with Automation Studio 3.0.
Configuration Methods
B&R supports two primary configuration approaches for CANopen:
-
DTM (Device Type Manager) Configuration
- Import EDS (Electronic Data Sheet) files for each slave device
- Drag-and-drop configuration in Automation Studio’s hardware tree
- Graphical PDO mapping via the DTM interface
- Recommended for most applications
-
Programmatic (ArCAN Library) Configuration
- Use B&R’s
AsCAN/AsArCANlibrary in Automation Studio - Configure PDOs, SDOs, and node parameters via structured data types in IEC code
- Necessary when no EDS file is available or for custom/raw CAN communication
- Provides full control over CAN identifiers and timing
- Use B&R’s
B&R CANopen in Automation Studio
- Add the X20IF2772 module to the hardware tree
- Right-click the CAN interface and select “CANopen (DTM)”
- Import slave device EDS files via
Tools → Manage 3rd Party Devicesor drag from Hardware Catalog - Configure PDO mappings, node IDs, and baud rates
- The firmware is part of the Automation Studio project and is automatically loaded to the module
CANopen Protocol Sources
- B&R CANopen products: https://www.br-automation.com/en-us/products/network-and-fieldbus-modules/canopen/
- B&R Community — CANopen over X20IF2772: https://community.br-automation.com/t/canopen-communication-over-x20if2772/6000
- B&R Community — CANopen trace guide: https://community.br-automation.com/t/how-to-trace-description-guide-canopen/4929
- CiA CANopen knowledge: https://www.can-cia.org/can-knowledge/canopen
3. PDO/SDO Mapping on B&R CAN Modules
PDO (Process Data Object) Overview
PDOs are single CAN frames (up to 8 bytes in CAN 2.0B) used for time-critical, real-time process data exchange. They are broadcast without acknowledgment — no confirmation or retry.
Two types:
- TPDO (Transmit PDO): Device sends data to the bus (e.g., sensor reading, status)
- RPDO (Receive PDO): Device receives data from the bus (e.g., setpoint, command)
PDO Communication Parameter Objects
| Object Index | Purpose |
|---|---|
| 1400h–15FFh | RPDO communication parameters (up to 512 RPDOs) |
| 1800h–19FFh | TPDO communication parameters (up to 512 TPDOs) |
Each PDO communication record contains:
- Sub 0: Highest sub-index supported
- Sub 1: COB-ID (11-bit CAN identifier + validity bit 31)
- Sub 2: Transmission type (0–255)
- Sub 3: Inhibit time (minimum interval between transmissions, in 100 µs units)
- Sub 5: Event timer (periodic transmission in ms)
PDO Mapping Parameter Objects
| Object Index | Purpose |
|---|---|
| 1600h–17FFh | RPDO mapping parameters |
| 1A00h–1BFFh | TPDO mapping parameters |
Each mapping record contains up to 64-bit (8 bytes) of mapped objects:
- Sub 0: Number of mapped objects
- Sub 1..N: Mapped object = [31:24] sub-index, [23:16] byte length, [15:0] object index
PDO Mapping Procedure (Standard CiA 301)
- Invalidate PDO: Set bit 31 of the COB-ID entry (sub-index 1) to 1
- Clear mapping: Write 0x00 to sub-index 0 of the mapping object
- Write new mapping: Write each object mapping to sub-indices 1, 2, 3…
- Validate mapping: Set sub-index 0 to the number of mapped objects
- Re-enable PDO: Clear bit 31 of the COB-ID entry
SDO (Service Data Object) Overview
SDOs are used for configuration and parameter access. They use a client-server model with confirmed communication (request/response). An SDO transfer requires multiple CAN frames:
- Client → Server (SDO Download): Initiator writes to a remote OD entry
- Server → Client (SDO Upload): Initiator reads from a remote OD entry
SDO CAN IDs default to:
- Rx SDO (Client to Server): 0x600 + Node-ID
- Tx SDO (Server to Client): 0x580 + Node-ID
B&R-Specific PDO Behavior
Important: B&R controllers may not use the PDO channel mappings defined in the EDS file for all objects. B&R’s default PDO mapping in Automation Studio can differ from what the EDS file specifies. When configuring PDOs on a B&R CANopen master:
- Always verify the actual PDO mapping in Automation Studio after importing the EDS
- Check which objects are actually mapped in the generated configuration
- Use the DTM interface to visually confirm mapping before deployment
- If the EDS defines objects that aren’t mapped, use the ArCAN library to add custom mappings programmatically
PDO Transmission Types
| Type | Description |
|---|---|
| 0 | Synchronous, acyclic (transmit after next SYNC) |
| 1–240 | Synchronous, cyclic (transmit every N-th SYNC) |
| 241–251 | Reserved |
| 252–255 | Event-driven, asynchronous (manufacturer-specific) |
| 255 | Asynchronous (device-internal event triggers) |
PDO/SDO Mapping Sources
- CiA PDO protocol: https://www.can-cia.org/can-knowledge/pdo-protocol-1
- CiA CANopen tutorial: https://www.csselectronics.com/pages/canopen-tutorial-simple-intro
- B&R PDO mapping (non-EDS): https://industrialmonitordirect.com/blogs/knowledgebase/br-canopen-pdo-mapping-not-using-eds-file-definitions
- B&R Community — CANopen help: https://community.br-automation.com/t/help-with-canopen-communication-using-x20if1041-1/5158
4. CAN Identifier Assignment
CANopen Default COB-ID Scheme
CANopen uses 11-bit CAN identifiers (COB-IDs) assigned according to a function-code-based scheme:
COB-ID = (Function Code × 0x80) + Node-ID
where Node-ID ranges from 1 to 127.
Default CANopen COB-ID Table
| Function | COB-ID Base | Formula | Direction |
|---|---|---|---|
| NMT Module Control | 0x000 | 0x000 + Node-ID | Master → Slave |
| SYNC | 0x080 | Fixed (broadcast) | Master → All |
| EMCY (Emergency) | 0x080 | 0x080 + Node-ID | Slave → Master |
| TIME STAMP | 0x100 | Fixed (broadcast) | Producer → All |
| TPDO1 | 0x180 | 0x180 + Node-ID | Slave → Bus |
| RPDO1 | 0x200 | 0x200 + Node-ID | Bus → Slave |
| TPDO2 | 0x280 | 0x280 + Node-ID | Slave → Bus |
| RPDO2 | 0x300 | 0x300 + Node-ID | Bus → Slave |
| TPDO3 | 0x380 | 0x380 + Node-ID | Slave → Bus |
| RPDO3 | 0x400 | 0x400 + Node-ID | Bus → Slave |
| TPDO4 | 0x480 | 0x480 + Node-ID | Slave → Bus |
| RPDO4 | 0x500 | 0x500 + Node-ID | Bus → Slave |
| SDO Tx (Server→Client) | 0x580 | 0x580 + Node-ID | Slave → Client |
| SDO Rx (Client→Server) | 0x600 | 0x600 + Node-ID | Client → Slave |
| HEARTBEAT | 0x700 | 0x700 + Node-ID | Producer → All |
| LSS (Layer Setting Service) | 0x7E5 | Fixed | Configuration |
B&R IF2772 Node Addressing
The IF2772 uses two hex rotary switches to set the node number. Both CAN interfaces share the same node number (switches are per-module, not per-interface).
- Valid node IDs: 1–127
- Node ID 0 is reserved for NMT commands (cannot be assigned to a physical node)
Customizing CAN Identifiers
CANopen allows COB-ID customization through the object dictionary:
- NMT state must be Pre-operational or Operational (for some devices)
- Write new COB-ID to the PDO communication parameter (index 1400h–19FFh, sub-index 1)
- Bit 31 of the COB-ID: 0 = PDO valid, 1 = PDO invalid
- Bit 30: 0 = PDO is mapped to the CANopen default COB-ID range, 1 = PDO uses the full 11-bit range (0x000–0x7FF)
When using the B&R ArCAN library, COB-IDs can be assigned directly in structured data types without relying on the default formula.
CAN Identifier Sources
- CiA identifier usage: https://www.microcontrol.net/wp-content/uploads/2021/10/td-03011e.pdf
- Renesas CANopen manual: https://www.renesas.com/en/document/mas/canopen-library-user-manual
- CSS Electronics CANopen intro: https://www.csselectronics.com/pages/canopen-tutorial-simple-intro
5. Bit Timing Configuration
Timing Overview
The SJA1000 CAN controller on the IF2772 uses bit timing registers (BTR0 and BTR1) to configure baud rate, sampling point, and synchronization jump width. In B&R’s Automation Studio, these are abstracted — you select a baud rate and the firmware calculates the register values.
Standard CANopen Baud Rates (CiA 301)
| Baud Rate | Typical Bus Length | Bit Time (Tq total) | Typical Prescaler |
|---|---|---|---|
| 10 kbit/s | 5000 m | 500 Tq | Configurable |
| 20 kbit/s | 2500 m | 250 Tq | Configurable |
| 50 kbit/s | 1000 m | 100 Tq | Configurable |
| 125 kbit/s | 500 m | 16–20 Tq | Common in industrial |
| 250 kbit/s | 250 m | 16–20 Tq | Common default |
| 500 kbit/s | 100 m | 16–20 Tq | High performance |
| 800 kbit/s | 50 m | 16 Tq | Specialized |
| 1000 kbit/s | 40 m | 16 Tq | Maximum for CAN 2.0B |
Bit Timing Parameters
A CAN bit is divided into Time Quanta (Tq) segments:
| SYNC_SEG | TIME_SEG1 | TIME_SEG2 |
| 1 Tq | 1..16 Tq | 1..8 Tq |
- SYNC_SEG: Always 1 Tq — synchronizes nodes on the bus
- TIME_SEG1: Propagation segment + Phase Buffer Segment 1
- TIME_SEG2: Phase Buffer Segment 2
- SJW (Synchronization Jump Width): 1..4 Tq — how much a node can resynchronize per bit
Sampling Point
The sampling point is where the CAN controller samples the bus level to determine bit value:
Sampling Point (%) = (1 + TIME_SEG1) / (1 + TIME_SEG1 + TIME_SEG2) × 100
Recommended sampling points (CiA 301 / CiA 105):
| Baud Rate | Recommended Sampling Point |
|---|---|
| 10–125 kbit/s | 87.5% |
| 250 kbit/s | 87.5% |
| 500 kbit/s | 87.5% |
| 1000 kbit/s | 75–87.5% |
A sampling point of 87.5% is the CANopen standard recommendation. At higher baud rates, slightly lower values (75–80%) provide more tolerance for clock drift.
SJA1000 Register Details
The SJA1000 uses a 16 MHz crystal (typical on B&R modules).
BTR0 (Bus Timing Register 0):
| SJW1 SJW0 | BRP5 BRP4 BRP3 BRP2 BRP1 BRP0 |
- SJW: Synchronization Jump Width (0–3, actual value + 1)
- BRP: Baud Rate Prescaler (0–63, actual value + 1)
BTR1 (Bus Timing Register 1):
| SAM | TSEG2.2 TSEG2.1 TSEG2.0 | TSEG1.3 TSEG1.2 TSEG1.1 TSEG1.0 |
- SAM: Sampling mode (1 = triple sampling, 0 = single)
- TSEG1: Time Segment 1 (0–15, actual value + 1)
- TSEG2: Time Segment 2 (0–7, actual value + 1)
Example: 500 kbit/s with SJA1000 @ 16 MHz
Prescaler = 1 (BRP = 0)
Tq = 2 × (BRP + 1) / 16 MHz = 125 ns
Bit time = 500 kbit/s → 2 µs → 16 Tq
SYNC_SEG = 1 Tq
TSEG1 = 12 Tq (register value 11)
TSEG2 = 3 Tq (register value 2)
SJW = 1 Tq (register value 0)
Sampling = (1 + 12) / 16 = 81.25%
Configuring in B&R Automation Studio
- Open the hardware configuration for the IF2772
- Select the CAN interface (IF1 or IF2)
- Set the baud rate from the dropdown (125k, 250k, 500k, 1M, etc.)
- Automation Studio calculates the SJA1000 BTR0/BTR1 register values automatically
- For non-standard baud rates, use the ArCAN library to write BTR values directly
Bit Timing Sources
- SJA1000 datasheet (NXP): Standard CAN controller reference
- CiA 301 specification: Bit timing requirements
- B&R X20IF2772 datasheet: https://docs.rs-online.com/5f80/A700000013921576.pdf
6. Hardware CAN Bus Sniffing
Sniffing Overview
To capture CAN bus traffic without interfering with the running B&R system, you need a CAN-to-USB/PCI adapter connected in listen-only mode as a passive node on the bus. This is essential for debugging communication between the IF2772 and field devices.
Connection Methods
1. Y-Cable / T-Junction Tap
┌──────────────┐
B&R IF2772 ────────┤ T-junction ├──────── Field Device
│ (tap) │
└──────────────┘
│
CAN Adapter (sniffer)
Connect the CAN adapter’s CAN_H and CAN_L to a tap point on the bus. Do NOT add a third terminating resistor — the adapter should be in high-impedance mode.
2. In-Line Pass-Through Adapter
Some CAN adapters (e.g., Kvaser Leaf, PEAK PCAN) support in-line pass-through where the adapter sits between two bus segments. Ensure proper termination.
PEAK PCAN Hardware
| Product | Interface | CAN FD | Channels | Price Range |
|---|---|---|---|---|
| PCAN-USB | USB 2.0 | No | 1 | $150–250 |
| PCAN-USB FD | USB 2.0 | Yes | 1 | $300–400 |
| PCAN-USB Pro FD | USB 2.0 | Yes | 2 | $500–700 |
| PCAN-PCI Express FD | PCIe | Yes | 2 | $600–900 |
Software:
- PCAN-View (free): Basic monitor, transmit, record
- PCAN-Explorer 6 (paid): Advanced analysis, DBC import, graphical display, scripting
Vector CANalyzer / CANoe
| Product | Use Case | CAN FD | Price Range |
|---|---|---|---|
| CANalyzer | Analysis, measurement, diagnostics | Yes | $3,000–8,000+ |
| CANoe | Development, simulation, test | Yes | $5,000–15,000+ |
Features:
- Real-time trace window
- DBC/LDF/A2L database import for symbolic decoding
- Graphics, data, and statistics windows
- IG (Interactive Generator) for injecting frames
- CAPL scripting for automated tests
- Network management and gateway simulation
Kvaser Hardware
| Product | Interface | CAN FD | Channels | Price Range |
|---|---|---|---|---|
| Kvaser Leaf Light v2 | USB | No | 1 | $100–200 |
| Kvaser Leaf Pro HS | USB | No | 1 | $250–350 |
| Kvaser Memorator | USB/SD | Yes | 2 | $400–600 |
| Kvaser U100 | USB-C | Yes | 1 | $300–500 |
Software: Kvaser CANlib SDK (C/C++ API), Kvaser TRCAN, Kvaser Viewer
Ixxat (HMS Networks)
| Product | Interface | CAN FD | Price Range |
|---|---|---|---|
| Ixxat USB-to-CAN | USB | No | $200–400 |
| Ixxat CAN-IB | PCIe/PCI | Yes | $400–800 |
Important: Listen-Only Mode
When sniffing a live CANopen network with the B&R master, always configure the CAN adapter in listen-only mode:
- PEAK PCAN: Set
PCAN_listen_onlyflag in PCAN-View or API - Vector: Enable “Listen Only” in CANalyzer channel configuration
- SocketCAN: Set
ip link set can0 type can bitrate 500000 listen-only on - Kvaser: Set
canOPEN_LISTEN_ONLYin canOpen() call
Listen-only mode ensures the adapter never sends ACK bits, error frames, or any data on the bus, preventing interference with the production system.
Hardware Sniffing Sources
- PEAK PCAN: https://www.peak-system.com/products/software/analysis-software/pcan-view/
- Vector CANalyzer vs PCAN: https://controltechuk.com/blog/vector-canalyzer-alternative/
- CAN tool comparison: https://rpubs.com/daniel_pas/can_tool_comparison
- Affordable CAN tools: https://spin.atomicobject.com/affordable-can-bus-tools/
7. SocketCAN on Linux
SocketCAN Overview
SocketCAN is the Linux kernel’s native CAN protocol stack, exposing CAN devices as network interfaces (like eth0). This makes CAN accessible through standard socket APIs and network tools.
Setup
# Load the CAN controller driver (varies by hardware)
sudo modprobe peak_pci # PEAK PCAN PCI cards
sudo modprobe vcan # Virtual CAN for testing
sudo modprobe mcp251xfd # Microchip MCP251xFD SPI-based
# Configure a CAN interface
sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
# Verify
ip -details link show can0
Core Utilities (can-utils)
Install: sudo apt install can-utils
candump — Capture CAN Traffic
# Capture all frames
candump can0
# Capture with timestamps
candump -t a can0
# Capture and log to file
candump -l can0
# Filter by CAN ID (only ID 0x181)
candump can0,181#FFFFFFFF
# Filter by ID range
candump can0,180:7FF#00000000
# Filter by data bytes (first byte = 0x01)
candump can0,~0#01000000
# Multiple interfaces
candump can0,can1
cansend — Transmit CAN Frames
# Standard data frame (ID=0x123, data=01 02 03 04)
cansend can0 123#01020304
# Remote frame
cansend can0 123#R
# Extended 29-bit ID
cansend can0 12345678#01020304
cangen — Generate CAN Traffic
# Generate random frames
cangen can0
# Generate at 100 ms interval with ID range 0x100-0x1FF
cangen can0 -g 100 -I 100 -L 1FF
# Generate specific length frames
cangen can0 -l 8 -D r
cansniffer — Real-Time CAN Sniffer
# Interactive sniffer showing changing bytes
cansniffer can0
# Shows which bytes change between frames
# Useful for identifying sensor data in unknown protocols
canplayer — Replay CAN Traffic
# Record
candump -l -n 1000 can0
# Replay
canplayer -I candump-2026-07-10_143022.log can0
slcanattach — Serial/Lawicel CAN Gateway
# For serial-based CAN adapters (e.g., LAWICEL, ELM327)
slcanattach -w -s 500000 -c /dev/ttyUSB0
bcmsocket — Broadcast Manager
# Receive a specific CAN ID with timeout
cansend can0 123#01020304 &
# Set up cyclic transmission
cangen can0 -e -g 100 &
CAN-FD Support
# Configure CAN-FD interface
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 fd on
sudo ip link set up can0
# Capture CAN-FD frames
candump can0
# Send CAN-FD frame (8 bytes data, bit-rate switch)
cansend can0 123##01122334455667788
Python Integration (python-can)
import can
# Initialize SocketCAN interface
bus = can.Bus(channel='can0', interface='socketcan', bitrate=500000)
# Receive messages
for msg in bus:
print(f"ID: {msg.arbitration_id:03X} Data: {msg.data.hex()} DLC: {msg.dlc}")
# Send messages
msg = can.Message(arbitration_id=0x181, data=[1, 2, 3, 4], is_extended_id=False)
bus.send(msg)
SocketCAN Sources
- SocketCAN kernel documentation: https://docs.kernel.org/networking/can.html
- Linux can-utils: https://github.com/linux-can/can-utils
- can-utils tutorial: https://dbcutility.com/blog/can-utils-candump-guide/
- SocketCAN practical guide: http://sgframework.readthedocs.io/en/latest/cantutorial.html
8. Decoding Sensor Data from CAN Messages
The Challenge
When troubleshooting field-level sensor problems via CAN bus traffic, you need to interpret raw CAN data bytes. CANopen PDOs carry sensor values as mapped objects from the device’s object dictionary. Without the correct DBC/EDS file, decoding requires understanding the mapping.
Step-by-Step Decoding
Step 1: Identify the PDO COB-ID
Given a node with ID = 5:
- TPDO1 = 0x180 + 5 = 0x185
- TPDO2 = 0x280 + 5 = 0x285
- TPDO3 = 0x380 + 5 = 0x385
Step 2: Consult the Device’s Object Dictionary
The EDS file (or device manual) tells you which objects are mapped to each TPDO.
Example: A temperature sensor (Node 5) maps:
- TPDO1 (0x185): Object 6004h:01 (Temperature value, INT16, in 0.1°C units)
Step 3: Extract the Data Bytes
Captured frame: ID=0x185 Data=0x01 0xF4 0x00 0x00 0x00 0x00 0x00 0x00
First 2 bytes = 0xF401 (little-endian INT16) Decimal = -179
If the unit is 0.1°C: Temperature = -17.9°C
Common Data Types in CANopen
| Data Type | Size | Range | Description |
|---|---|---|---|
| BOOLEAN | 1 bit | 0/1 | Flag |
| UNSIGNED8 (UNS8) | 1 byte | 0–255 | Unsigned integer |
| UNSIGNED16 (UNS16) | 2 bytes | 0–65535 | Unsigned integer |
| UNSIGNED32 (UNS32) | 4 bytes | 0–4,294,967,295 | Unsigned integer |
| INTEGER8 (INT8) | 1 byte | -128–127 | Signed integer |
| INTEGER16 (INT16) | 2 bytes | -32768–32767 | Signed integer |
| INTEGER32 (INT32) | 4 bytes | -2³¹–2³¹-1 | Signed integer |
| REAL32 | 4 bytes | IEEE 754 | Floating point |
Endianness
CANopen uses little-endian byte order by default (LSB first). For a 16-bit value spanning bytes 0–1 of a CAN frame:
- Byte 0 = low byte (bits 0–7)
- Byte 1 = high byte (bits 8–15)
Practical Diagnostic Example
Suppose you have a pressure sensor on CANopen node 12 and it reports erratic values:
# Capture only this sensor's TPDO1
candump can0,18C#FFFFFFFF
Output:
(1609456789.123456) can0 18C#0300800000000000
(1609456789.623456) can0 18C#0420810000000000
(1609456790.123456) can0 18C#FF3F820000000000
Decoding (assume mapping: sub-index 0 = pressure UNS32, sub-index 1 = status UNS8):
- Frame 1: Pressure = 0x00008003 (32771 units, e.g., 3.277 bar), Status = 0x00 (OK)
- Frame 2: Pressure = 0x00008120 (33056 units, 3.306 bar), Status = 0x04 (Warning)
- Frame 3: Pressure = 0x000082FF (33535 units, 3.354 bar), Status = 0xFF (Error)
This reveals the sensor is drifting and entered error state.
Using DBC Files with candump
# Convert DBC to SocketCAN attribute format
# (Using python-can or cantools)
# With cantools + python-can:
python3 -c "
import cantools, can
db = cantools.database.load_file('sensor.dbc')
for msg in db.messages:
print(f'{msg.name}: ID=0x{msg.frame_id:03X}')
"
Reverse-Engineering Unknown Sensors
When no documentation exists:
- Use cansniffer to observe which bytes change with sensor activity
- Correlate changes with physical events (apply pressure, change temperature, etc.)
- Identify data types by observing value ranges and step sizes
- Document findings in a DBC or mapping table
Sensor Data Decoding Sources
- CSS Electronics — CAN bus data reading: https://www.autopi.io/blog/how-to-read-can-bus-data/
- Tektronix CAN troubleshooting: https://www.tek.com/en/solutions/industry/automotive-test-solutions/in-vehicle-networks/can-bus-troubleshooting-oscilloscope-can-bus-decoder
- PicoScope CAN decoding: https://www.picotech.com/library/knowledge-bases/oscilloscopes/can-bus-serial-protocol-decoding
9. CANopen Error Handling
CAN Error States
Each CAN node maintains two error counters:
- TEC (Transmit Error Counter): Increments on transmit errors, decrements on successful transmits
- REC (Receive Error Counter): Increments on receive errors, decrements on successful receives
Based on these counters, a node transitions between three states:
Error Active (TEC and REC < 128)
- Normal operating state. The node can send and receive normally.
- When an error is detected, the node sends an Active Error Flag (6 dominant bits).
- The active error frame forces all other nodes to acknowledge the error.
- Both counters decrement by 1 on each successful message (TEC) or successful reception (REC).
Error Passive (TEC > 127 OR REC > 127)
- The node can still communicate but with restrictions.
- When an error is detected, the node sends a Passive Error Flag (6 recessive bits).
- The passive error flag does NOT dominate the bus — other nodes may not notice it.
- After sending a passive error flag, the node waits 8 bit times (Suspend Transmission) before trying to transmit again.
- This gives other nodes priority in bus arbitration.
Bus-Off (TEC > 255)
- The node completely disconnects from the bus.
- No transmission or reception is possible.
- The CAN controller internally sets the bus-off status bit.
- Recovery: The node must monitor 128 consecutive occurrences of 11 consecutive recessive bits on the bus (128 × 11 recessive bits = 11 bit times of dominant-free bus).
- In B&R systems, bus-off recovery can be configured:
- Automatic recovery after a timeout (via Automation Studio settings)
- Manual recovery via NMT Reset command or module restart
- Physical reset (power cycle the IF2772)
CAN Error Types
| Error Type | Description | Common Cause |
|---|---|---|
| Bit Error | Bit value differs from what was transmitted (on TX node only) | Wiring issue, EMI |
| Stuff Error | 6 consecutive identical bits not followed by complementary stuff bit | Clock skew, noise |
| CRC Error | Received CRC doesn’t match calculated CRC | Corrupted frame |
| Form Error | Fixed-form bit field is illegal | Corruption |
| ACK Error | Transmitter doesn’t see dominant ACK bit | Disconnected node, wiring |
Error Frame Structure
An error frame consists of:
- Error Flag: 6 dominant bits (active) or 6 recessive bits (passive)
- Error Delimiter: 8 recessive bits (marks end of error frame)
After an error frame, bus arbitration restarts from the beginning.
CANopen Emergency Protocol (EMCY)
CANopen adds an application-level error reporting mechanism via the Emergency object:
- COB-ID: 0x080 + Node-ID
- Triggered when: A device detects an internal error (overcurrent, temperature, communication loss)
- Payload: 8 bytes:
| Byte | Description |
|---|---|
| 0–1 | Error Code (16-bit, CiA-defined) |
| 2 | Error Register (mirror of OD index 1001h) |
| 3–4 | Manufacturer-specific error code |
| 5–7 | Additional info (manufacturer-specific) |
Common CiA Emergency Error Codes
| Error Code | Description |
|---|---|
| 0x0000 | Error Reset / No error |
| 0x1000 | Generic error |
| 0x2310 | Current |
| 0x4310 | Voltage |
| 0x5310 | Temperature (over-temperature) |
| 0x6100 | Device hardware |
| 0x8110 | CAN overrun |
| 0x8120 | CAN passive mode |
| 0x8130 | CAN bus-off |
| 0x8210 | CAN RX queue overflow |
| 0x8220 | CAN TX queue overflow |
| 0x8230 | CAN controller error |
| 0x8240 | CAN life guard error |
| 0x8250 | CAN recovered from bus-off |
| 0x8300 | CAN PDO length exceeded |
Heartbeat / Node Guarding Errors
CANopen uses two mechanisms to detect node failures:
Heartbeat (recommended in modern CANopen):
- Producer sends heartbeat at a configurable interval (OD index 1017h)
- Consumer monitors for heartbeat timeouts
- Consumer sets
HeartbeatTimeoutEventin status register on timeout - Timeout threshold configured in OD index 1016h (consumer)
Node Guarding (legacy):
- Master polls each slave with a Remote Transmission Request (RTR) on the node’s guard COB-ID
- Slave responds with its toggle bit and status
- If toggle bit doesn’t change between polls or response is missing → error
CANopen Error Handling Sources
- HMS Networks error states: https://www.hms-networks.com/support/tech-support/kb-articles/10436555566354-CANOpen-Error-States–Error-Active–Error-Passive–and-Bus-Off
- CSS Electronics CAN errors: https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial
- Kvaser error handling: https://kvaser.com/lesson/can-error-handling/
- STMicroelectronics bus-off recovery: https://www.st.com/resource/en/technical-note/tn1367-spc5x-can-errors-management-and-bus-off-recovery-stmicroelectronics.pdf
10. IF2772 Configuration Parameters (Object Dictionary)
Object Dictionary Structure
The CANopen Object Dictionary (OD) is accessed via 16-bit indices with 8-bit sub-indices. The IF2772, when configured as a CANopen master, exposes configuration parameters through the standard OD ranges.
Communication Profile Area (1000h – 1FFFh)
| Index | Sub-Index | Name | Description |
|---|---|---|---|
| 1000h | 0 | Device Type | Identifies the device type (bit-field: profile, device) |
| 1001h | 0 | Error Register | Bit-field indicating current error conditions |
| 1002h | 0 | Manufacturer Status | Manufacturer-specific status register |
| 1005h | 0 | COB-ID SYNC | CAN identifier for SYNC message |
| 1006h | 0 | Communication Cycle Period | SYNC cycle period in µs |
| 1007h | 0 | Synchronous Window Length | Window for synchronous PDOs in µs |
| 1008h | 0 | Manufacturer Device Name | String |
| 1009h | 0 | Manufacturer Hardware Version | String |
| 100Ah | 0 | Manufacturer Software Version | String |
| 1010h | 0–3 | Store Parameters | Save configuration to non-volatile memory |
| 1011h | 0–3 | Restore Default Parameters | Reset to factory defaults |
| 1014h | 0 | COB-ID EMCY | Emergency object CAN identifier |
| 1016h | 0–127 | Consumer Heartbeat Time | Heartbeat timeout for each monitored node (ms) |
| 1017h | 0 | Producer Heartbeat Time | Heartbeat production interval (ms) |
| 1018h | 0, 1–4 | Identity Object | Vendor ID, Product Code, Revision, Serial Number |
| 1400h–15FFh | 0–1+ | RPDO Communication Parameters | COB-ID, transmission type, inhibit time, event timer |
| 1600h–17FFh | 0–8 | RPDO Mapping Parameters | Mapped object entries |
| 1800h–19FFh | 0–1+ | TPDO Communication Parameters | COB-ID, transmission type, inhibit time, event timer |
| 1A00h–1BFFh | 0–8 | TPDO Mapping Parameters | Mapped object entries |
Error Register (1001h) Bit Definitions
| Bit | Meaning |
|---|---|
| 0 | Generic error |
| 1 | Current |
| 2 | Voltage |
| 3 | Temperature |
| 4 | Communication error |
| 5 | Device profile specific |
| 6 | Reserved (always 0) |
| 7 | Manufacturer specific |
Store Parameters (1010h)
| Sub-Index | Description |
|---|---|
| 0 | Number of sub-indices |
| 1 | Save all parameters to non-volatile memory |
| 2 | Save communication parameters |
| 3 | Save application parameters |
| 4–127 | Manufacturer-specific |
Identity Object (1018h)
| Sub-Index | Description |
|---|---|
| 0 | Number of elements (typically 4) |
| 1 | Vendor-ID (B&R vendor ID) |
| 2 | Product Code (device-specific) |
| 3 | Revision Number (firmware version) |
| 4 | Serial Number (module-specific) |
Device Type (1000h) Format (32-bit)
Bit 31-26: Profile number (0 = CiA301, 402h = DSP, etc.)
Bit 25-16: Additional profile information
Bit 15-8: Device type (flags)
Bit 7-0: Flags (e.g., bit 0 = simple device, bit 1 = complex device)
Object Dictionary Sources
- CiA 301 specification: CANopen application layer and communication profile
- B&R IF2772 datasheet: https://docs.rs-online.com/5f80/A700000013921576.pdf
- Siemens CANopen tutorial: https://cache.industry.siemens.com/dl/files/771/109479771/att_993267/v1/109479771_CANopen_Tutorial_V20_en.pdf
11. Setting Up CANopen on B&R Without the Original Project
Scenario
You have a B&R X20 system with an IF2772 module running an unknown CANopen configuration. The original Automation Studio project is lost or unavailable, and you need to reconfigure CANopen.
Prerequisites
- Automation Studio (version 3.0 or later for IF2772 CANopen master)
- Physical access to the X20 controller and IF2772 module
- EDS files for all CANopen slave devices on the bus
- Knowledge of the target baud rate and node IDs
Step-by-Step Procedure
Step 1: Connect to the Controller
- Connect your PC to the X20 controller via Ethernet
- In Automation Studio:
Online → Connection Settings - Enter the controller’s IP address
- Select “Online without project” if prompted
- Click Connect (F5)
- You can now browse the controller’s running configuration and firmware version
Step 2: Identify Connected CANopen Devices
- Physically inspect the CAN bus — note any slave devices and their node ID switches
- If you have a CAN sniffer (PCAN, Vector, SocketCAN), capture traffic to identify active nodes
- Look for EMCY (0x080+NodeID) and Heartbeat (0x700+NodeID) frames to enumerate nodes
# Using SocketCAN to identify nodes
candump can0 | grep -E "^.*can0 [78][0-9A-F]{2}"
Step 3: Create a New Automation Studio Project
File → New Project- Select the correct controller model (e.g., X20CP1585)
- Add the IF2772 to the hardware tree in the correct slot
- Configure the firmware version to match the controller’s current firmware
Step 4: Configure the CAN Interface
- In the hardware tree, expand the IF2772
- Select IF1 (or IF2) → right-click → “CANopen (DTM)”
- Set the baud rate to match the existing bus (commonly 125k, 250k, or 500k)
- Set the node number (match the DIP switch setting on the module)
Step 5: Import EDS Files and Add Slaves
Tools → Manage 3rd Party Devices(or drag from Hardware Catalog)- Import the EDS file for each slave device
- Set each slave’s node ID to match its physical switch setting
- Configure PDO mappings according to the device documentation
Step 6: Configure PDOs
- In the DTM configuration, open the PDO mapping view
- Verify which TPDOs from the slaves you want to receive (as RPDOs on the master)
- Configure which RPDOs the master sends to the slaves (as TPDOs on the slave side)
- Map the PDO data to variables in your IEC program
Step 7: Configure NMT and Heartbeat
- Set the heartbeat producer time on the master (index 1017h)
- Configure consumer heartbeat times for each slave (index 1016h)
- Set the NMT startup sequence (boot-up → Pre-operational → Operational)
Step 8: Deploy and Verify
- Download the configuration to the controller
- Monitor CAN traffic for proper communication
- Verify PDO data exchange using Automation Studio’s online view
- Check the IF2772 LEDs: STATUS green, TxD yellow (flashing during transmit)
Using the ArCAN Library for Raw CAN
If you need to work with non-CANopen CAN protocols or custom identifiers:
PROGRAM _CAN_Init
// Configure CAN interface
AsArCAN_Init(
pInterface := ADR(ifCAN1),
nBaudrate := 500000,
pTxBuffer := ADR(aTxBuffer),
nTxBufSize := 16,
pRxBuffer := ADR(aRxBuffer),
nRxBufSize := 16
);
END_PROGRAM
CANopen Setup Sources
- B&R Community — CANopen over X20IF2772: https://community.br-automation.com/t/canopen-communication-over-x20if2772/6000
- B&R Community — Vehicle CAN setup: https://community.br-automation.com/t/how-to-setup-communication-on-a-vehicle-can/2778
- B&R Automation Studio connect: https://industrialmonitordirect.com/blogs/knowledgebase/br-automation-studio-connect-to-controller-and-view-program
- B&R Community — CANopen trace guide: https://community.br-automation.com/t/how-to-trace-description-guide-canopen/4929
12. Common CAN Bus Problems and Diagnostic Procedures
Problem 1: No Communication (No TxD LED Activity)
Possible Causes:
- Wrong baud rate (mismatch between master and slaves)
- CAN bus wiring open (broken cable)
- Missing or incorrect terminating resistors
- Module not properly initialized
Diagnostics:
- Verify baud rate matches on all devices
- Measure resistance between CAN_H and CAN_L at the module connector (should read ~60 Ω with two 120 Ω terminators)
- Check the STATUS LED — should be green
- Use oscilloscope to verify CAN_H/CAN_L differential signals
Problem 2: Intermittent Communication Errors
Possible Causes:
- EM interference (cable routing near power cables)
- Poor shield grounding
- Loose connections
- Near baud rate limit for cable length
- Too many nodes causing bus load > 70%
Diagnostics:
- Monitor error frames with CAN sniffer
- Check bus load (should be < 70% at peak)
- Verify cable length is within limits for the baud rate
- Inspect shield connections — SHLD should be grounded at one or both ends
- Check REC/TEC counters on nodes (via SDO read of OD index 1001h or vendor-specific)
Problem 3: Nodes Going Bus-Off
Possible Causes:
- Wiring fault (short, open, corrosion)
- Faulty transceiver on one node
- External interference
- Ground loops
- Incorrect termination
Diagnostics:
- Disconnect nodes one at a time to isolate the faulty device
- Measure CAN_H and CAN_L voltages at idle:
- CAN_H ≈ 2.5–3.5 V (recessive ≈ 2.5 V, dominant ≈ 3.5 V)
- CAN_L ≈ 1.5–2.5 V (recessive ≈ 2.5 V, dominant ≈ 1.5 V)
- Check for shorts between CAN_H and CAN_L (should be ~60 Ω, not 0 Ω)
- Check for shorts between CAN lines and ground
Problem 4: High Bus Load / Too Many Messages
Possible Causes:
- Too many PDOs transmitting at high rates
- Event-driven PDOs firing too frequently
- SYNC rate too high
Diagnostics:
- Use CANalyzer/PCAN-Explorer to measure bus load percentage
- Reduce PDO transmission rates (increase inhibit time, change transmission type from synchronous to event-driven)
- Reduce SYNC period if synchronous PDOs are used
- Consolidate multiple objects into fewer PDOs (use full 8-byte payload)
Problem 5: Heartbeat Timeout Errors
Possible Causes:
- Slave node crashed or powered off
- CAN cable disconnected
- Slave in Error-Active/Passive state, not transmitting
- Wrong heartbeat consumer timeout configured
Diagnostics:
- Verify the slave is powered and its STATUS LED is active
- Check for EMCY messages from the slave before heartbeat loss
- Verify heartbeat producer interval on the slave matches expected rate
- Increase consumer heartbeat timeout if transient delays are expected
Problem 6: PDO Data Not Updating
Possible Causes:
- Wrong COB-ID mapping
- PDO marked invalid (bit 31 of COB-ID set)
- Wrong node ID
- NMT state not Operational
Diagnostics:
- Verify NMT state is Operational (not Pre-operational or Stopped)
- Read PDO communication parameters via SDO to verify COB-ID
- Verify PDO mapping is valid
- Check if the PDO is being transmitted on the bus (use sniffer)
Diagnostic Flowchart
Start
│
├─ No communication at all?
│ ├─ Check STATUS LED (green = active)
│ ├─ Measure bus termination (60 Ω expected)
│ ├─ Check CAN_H/CAN_L voltages
│ └─ Verify baud rate
│
├─ Communication but errors?
│ ├─ Monitor error frames (sniffer)
│ ├─ Check wiring/shielding
│ ├─ Check bus load (< 70%)
│ └─ Measure REC/TEC counters
│
├─ Node going bus-off?
│ ├─ Isolate by removing nodes one by one
│ ├─ Check for ground loops
│ └─ Verify transceiver health
│
└─ Data incorrect/missing?
├─ Verify PDO mapping (EDS vs. actual)
├─ Check NMT state (Operational?)
├─ Verify node IDs match physical switches
└─ Check byte order / data scaling
Diagnostic Procedures Sources
- CSS Electronics CAN bus errors: https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial
- Total Phase CAN debugging: https://www.totalphase.com/blog/2025/09/debugging-can-automotive-industrial-medical-robotics-aerospace-systems/
- Kvaser error handling: https://kvaser.com/lesson/can-error-handling/
13. Wiring and Termination Requirements
CAN Bus Physical Layer (ISO 11898-2)
The CAN bus uses a differential pair (CAN_H and CAN_L) with common-mode rejection to provide noise immunity.
Cable Requirements
| Parameter | Specification |
|---|---|
| Cable Type | Twisted pair, shielded (STP) |
| Characteristic Impedance | 120 Ω (±10%) |
| Wire Cross-Section | 0.25–0.65 mm² (AWG 22–18) |
| Max Stub Length | Typically < 0.3 m at 1 Mbit/s |
| Shielding | Foil + braid recommended |
| Bend Radius | > 5× cable diameter |
Bus Topology
CAN is a linear bus topology (not star or ring). Devices are connected via drop lines (stubs) from the main bus trunk.
┌───────────── 120 Ω ─────────────────────┐
│ │
├──[Node 1]──┬──[Node 2]──┬──[Node 3]──┤ 120 Ω
│ │ │
Stub Stub Stub
(<0.3m) (<0.3m) (<0.3m)
Termination
The bus must be terminated with 120 Ω resistors at both ends of the trunk:
- Without termination: Signal reflections cause data corruption
- With termination: The 120 Ω resistors match the cable’s characteristic impedance, preventing reflections
- Total bus resistance (measured at any point): Should be approximately 60 Ω (two 120 Ω resistors in parallel)
IF2772 Termination
The IF2772 has integrated terminating resistors (one per CAN interface), selectable via hardware switches on the bottom of the module:
- TERM CAN 1: Switch for IF1 terminating resistor (ON/OFF)
- TERM CAN 2: Switch for IF2 terminating resistor (ON/OFF)
LED indicator: The TERM CAN 1/TERM CAN 2 LED lights yellow when the resistor is active.
Proper configuration:
- IF2772 is at one end of the bus → turn terminating resistor ON
- IF2772 is in the middle of the bus → turn terminating resistor OFF
- IF2772 is at both ends (if bus is short and only connects to one IF2772 interface) → turn resistor ON on the far-end device, OFF on IF2772
Wiring Diagram (IF2772 TB2105 Terminal Block)
TB2105 TB2105 (next device)
────── ──────────────────
Pin 1: CAN_GND ─────── Pin 1: CAN_GND
Pin 2: CAN_L ─────── Pin 2: CAN_L
Pin 3: SHLD ─────── Pin 3: SHLD
Pin 4: CAN_H ─────── Pin 4: CAN_H
Pin 5: NC ─────── Pin 5: NC
Shield grounding options:
- One-side grounded: Connect SHLD to ground at one end only (prevents ground loops)
- Both-side grounded (with care): If ground potential difference is < 2 V, can ground at both ends
- Never leave SHLD floating in noisy industrial environments
Voltage Levels
| State | CAN_H | CAN_L | Differential (CAN_H - CAN_L) |
|---|---|---|---|
| Recessive (logic 1) | ~2.5 V | ~2.5 V | ~0 V |
| Dominant (logic 0) | ~3.5 V | ~1.5 V | ~2.0 V |
Common Wiring Mistakes
- Swapped CAN_H and CAN_L — causes total communication failure; the bus appears to work intermittently due to dominant/recessive inversion
- Missing termination — reflections cause errors at high baud rates; may work at low baud rates
- Double termination in the middle — reduces signal swing, causes margin issues
- No ground reference — common-mode voltage drifts outside transceiver range
- Star topology — causes reflections and timing violations
- Long stubs — creates impedance discontinuities
Wiring Sources
- B&R IF2772 datasheet: https://docs.rs-online.com/5f80/A700000013921576.pdf
- CiA 301 specification (physical layer recommendations)
- ISO 11898-2: Road vehicles — Controller area network — High-speed medium access unit
14. CAN Analysis Tools Comparison
Hardware + Software Comparison Matrix
| Tool | Hardware | Software | CANopen Support | DBC Import | CAPL/Script | Linux | Price (HW+SW) |
|---|---|---|---|---|---|---|---|
| Vector CANalyzer | VN1640, VN1630, CANcaseXL | CANalyzer | Excellent (NMT, PDO, SDO trace) | DBC, LDF, ARXML | CAPL scripting | No (Windows) | $3,000–8,000+ |
| Vector CANoe | Same as CANalyzer | CANoe | Full (simulation + analysis) | DBC, LDF, ARXML | CAPL scripting | No | $5,000–15,000+ |
| PEAK PCAN-Explorer 6 | PCAN-USB, PCAN-USB FD | PCAN-Explorer 6 | Good (CANopen trace, NMT) | DBC | VBScript/JScript | Linux SDK | $300–1,000 |
| PEAK PCAN-View | PCAN-USB | PCAN-View (free) | Basic (raw CAN only) | No | No | Via can-utils | HW only ($150–400) |
| Kvaser Memorator | Kvaser Memorator | Kvaser TRCAN, SDK | Good | DBC | C/C++ API | Yes (Linux SDK) | $400–800 |
| Kvaser CANKing | Any Kvaser HW | CANKing (free) | Limited | DBC (via setup) | No | Via can-utils | HW only |
| SocketCAN (Linux) | Any Linux-supported adapter | can-utils, python-can | Basic (raw CAN, python-can has CANopen) | DBC (via cantools) | Python, C | Native | Free (open source) |
| Ixxat CanAnalyser | Ixxat USB-to-CAN | CanAnalyser | Good | DBC | No | No | $500–2,000 |
| CanLover | Any CAN adapter | CanLover | Basic-Moderate | DBC | No | No | Free |
| PicoScope | PicoScope 3000/4000/5000 | PicoScope 7 | Basic (protocol decode) | DBC | No | No | $500–3,000 |
Detailed Comparison
Vector CANalyzer — Industry Standard
Strengths:
- Gold standard for CANopen analysis
- Excellent CANopen NMT, PDO, SDO, EMCY trace with symbolic names
- CAPL scripting for automated tests and simulations
- DBC/LDF/ARXML database support
- Powerful graphics and data analysis windows
- IG (Interactive Generator) for manual frame injection
- Network statistics (bus load, error counters)
Weaknesses:
- Expensive
- Windows only
- Steep learning curve for CAPL
- Requires Vector hardware (or compatible)
Best for: Professional automotive/industrial development labs with budget
PEAK PCAN-Explorer 6 — Cost-Effective Alternative
Strengths:
- Significantly cheaper than Vector
- Good CANopen support with symbolic trace
- DBC import for symbolic decoding
- VBScript/JScript scripting
- Supports CAN FD
- Includes PCAN-View (free basic monitor)
Weaknesses:
- Less powerful scripting than CAPL
- Fewer analysis windows than CANalyzer
- CANopen features not as deep as Vector
Best for: Mid-range industrial applications, cost-conscious teams
SocketCAN + can-utils — Free and Open Source
Strengths:
- Free, included in Linux kernel
- Works with many cheap CAN adapters
- Excellent for scripting and automation
- python-can library for high-level CANopen
- cansniffer for reverse engineering
Weaknesses:
- No built-in CANopen protocol decode (need python-can or manual)
- No graphical DBC viewer (use SavvyCAN, CanLover, or cantools)
- Linux-only
- No official CAN FD database support in core tools
Best for: Linux-based systems, CI/CD pipelines, budget setups, scripting automation
SavvyCAN — Open Source GUI
Strengths:
- Free and open source
- Cross-platform (Windows, Linux, Mac)
- DBC import and symbolic decoding
- CANopen NMT state machine display
- Supports many CAN adapters (SocketCAN, PCAN, Kvaser, Lawicel, etc.)
- Frame injection and playback
- Active development
Best for: Budget-friendly GUI-based analysis with CANopen features
Budget Recommendations by Use Case
| Use Case | Recommended Setup | Est. Cost |
|---|---|---|
| Quick field debugging | PEAK PCAN-USB + PCAN-View | $200 |
| Basic CANopen diagnostics | PEAK PCAN-USB FD + PCAN-Explorer 6 | $700 |
| Professional CANopen analysis | Vector CANalyzer + VN1640 | $5,000+ |
| Linux/DevOps monitoring | SocketCAN + any USB adapter + python-can | $50–200 |
| Automotive reverse engineering | SavvyCAN + cheap USB-CAN adapter | $30–100 |
| Long-term bus recording | Kvaser Memorator (onboard SD) | $500 |
| Production line test | Vector CANoe + automation | $8,000+ |
| Mixed B&R + 3rd party devices | PCAN-Explorer 6 + PCAN-USB FD | $800 |
CAN Analysis Tools Sources
- Vector CANalyzer: https://www.vector.com/int/en/products/products-a-z/software/canalyzer/
- PEAK PCAN-View: https://www.peak-system.com/products/software/analysis-software/pcan-view/
- PCAN-Explorer 6 guide: https://controltechuk.com/blog/vector-canalyzer-alternative/
- Kvaser vs PEAK discussion: https://www.eevblog.com/forum/chat/kvaser-or-peak-can-bus-adapters-for-can-open/
- CAN tool comparison (RPubs): https://rpubs.com/daniel_pas/can_tool_comparison
- CanLover: https://canlover.ddns.net/
- SavvyCAN: https://github.com/savvycan/SavvyCAN
- Linux can-utils: https://github.com/linux-can/can-utils
Cross-References
- x2x-protocol.md — X2X bus; how IF2772 data reaches the CPU
- powerlink-internals.md — ETHERNET Powerlink; the primary real-time fieldbus on CP1584
- network-architecture.md — Overall network topology and device discovery
- physical-layer-sniffing.md — Probing CAN bus signals with oscilloscopes and logic analyzers
- cp1584-hardware-ref.md — CP1584 interface module slot and compatible modules
- io-card-hardware.md — IO module signal conditioning and hardware internals
python-diagnostics.md— Python scripts for CAN message analysis (see canopen-message-interpreter below)
Community Tools for CANopen Diagnostics
| Tool | URL | Purpose |
|---|---|---|
| canopen-message-interpreter | github.com/hilch/canopen-message-interpreter | Python script to interpret CAN traces as CANopen messages per CiA DS301 / V4.2.0. Feeds raw CAN log files and outputs decoded CANopen messages. Essential for post-capture analysis of CAN sniffing sessions. |
| PCAN-View | Comes with PEAK PCAN hardware | Basic CAN bus monitoring and transmit tool included with PCAN USB adapters |
| Vector CANalyzer | Commercial (Vector Informatik) | Professional CAN bus analysis with database import, trace analysis, and signal decoding |
| CANdevStudio | github.com/ecomodeeu/CANdevStudio | Open-source CAN frame visualization and simulation tool |
Appendix: Quick Reference
Common CANopen CAN IDs (Node ID = 1 example)
| Object | COB-ID |
|---|---|
| NMT | 0x000 |
| SYNC | 0x080 |
| EMCY | 0x081 |
| TPDO1 | 0x181 |
| RPDO1 | 0x201 |
| TPDO2 | 0x281 |
| RPDO2 | 0x301 |
| TPDO3 | 0x381 |
| RPDO3 | 0x401 |
| TPDO4 | 0x481 |
| RPDO4 | 0x501 |
| SDO Rx | 0x601 |
| SDO Tx | 0x581 |
| HEARTBEAT | 0x701 |
IF2772 Quick Specs Summary
- 2x CAN interfaces (SJA1000 controller each)
- Max 1 Mbit/s per interface
- Integrated 120 Ω termination (switchable)
- 5-pin TB2105 terminal blocks (order separately)
- Node address: 2 hex DIP switches
- Power: 1.2 W
- CANopen master via Automation Studio 3.0+
- No 29-bit RTR support
- ATEX Zone 2 certified
Key SocketCAN Commands
# Setup
sudo ip link set can0 type can bitrate 500000 && sudo ip link set up can0
# Capture
candump can0 # All frames
candump can0 -t a -l # Timestamped, log to file
candump can0,181#FFFFFFFF # Filter single ID
# Send
cansend can0 181#0102030405060708 # 8-byte data frame
# Monitor changes
cansniffer can0 # Interactive byte-change view
# Replay
canplayer -I logfile can0
# Status
ip -details -statistics link show can0
Key Findings
-
The X20IF2772 uses a SJA1000 standalone CAN controller (NXP/Philips) per interface – not a modern integrated MCU CAN peripheral. This limits the module to standard 11-bit CAN identifiers only; 29-bit extended IDs with RTR are not supported due to SJA1000 memory/performance constraints. Maximum baud rate is 1 Mbit/s per interface.
-
CANopen master configuration on the IF2772 is available in Automation Studio 3.0+. Two configuration approaches exist: DTM (Device Type Manager) for graphical drag-and-drop setup with EDS file import, and programmatic (ArCAN library) for code-based PDO/SDO configuration when no EDS file is available or for custom raw CAN communication.
-
B&R’s default PDO mapping in Automation Studio may differ from what the EDS file specifies. Always verify actual PDO mapping after EDS import using the DTM interface. PDO communication parameters live at object indices 0x1400+ (RPDO) and 0x1800+ (TPDO), with mapping at 0x1600+ and 0x1A00+. The PDO invalidation/remapping procedure requires setting bit 31 of the COB-ID, clearing the mapping, writing new entries, then clearing bit 31.
-
CANopen COB-ID assignment follows
COB-ID = (FunctionCode * 0x80) + NodeID: TPDO1 = 0x180+NodeID, RPDO1 = 0x200+NodeID, SDO Rx = 0x600+NodeID, SDO Tx = 0x580+NodeID, Heartbeat = 0x700+NodeID. The IF2772 uses two hex rotary DIP switches for node addressing (1-127), shared across both interfaces. -
SocketCAN on Linux provides full sniffing and injection capability:
sudo ip link set can0 type can bitrate 500000 && sudo ip link set up can0to configure,candump can0to capture,cansend can0 181#0102030405060708to transmit,cansniffer can0for interactive byte-change monitoring. Thepython-canlibrary (can.Bus(interface='socketcan')) provides programmatic access. -
Built-in 120 ohm termination resistors are individually switchable per interface (TERM CAN 1 / TERM CAN 2 LEDs indicate active state). Both interfaces are electrically isolated from each other and from the PLC. Required terminal blocks (TB2105, screw clamp or push-in 2.5 mm2) are ordered separately.
-
For sensor data decoding from CANopen PDOs: calculate the node’s TPDO1 CAN ID (0x180 + NodeID), consult the EDS object dictionary mapping, extract data bytes in little-endian order (byte 0 = LSB), and apply the device’s scaling (e.g., INT16 in 0.1C units). CANopen data types: UNSIGNED8/16/32, INTEGER8/16/32, REAL32 (IEEE 754).
-
Common diagnostic procedures:
candump can0,080:7FFcaptures all emergency messages;candump can0,181#FFFFFFFFfilters a single node’s TPDO1;ip -details -statistics link show can0shows bus error counters. A correctly terminated two-node bus reads approximately 60 ohm between CAN-H and CAN-L with power off. Single-node CAN-H to ground should be 2.5-3.0 V, CAN-L to ground 2.0-2.5 V when powered.
Document generated from research of B&R Automation documentation, CiA (CAN in Automation) specifications, B&R Community forums, and CANopen reference materials. Last updated: July 2026
B&R Automation Runtime (AR) — RTOS Internals Technical Reference
Compiled from official B&R documentation, B&R Community forum posts, training materials, security advisories, and press releases.
1. Underlying OS Architecture
1.1 Base OS: VxWorks (Wind River Systems)
Automation Runtime is based on VxWorks, the industry-standard RTOS from Wind River Systems (a subsidiary of Aptiv). This was confirmed officially by B&R employees on the B&R Community forum.
“Automation Runtime is definitely based on VxWorks. For sure, B&R developed a lot of additional functions, task class scheduling, drivers and abstraction layers needed for PLCs (that’s the reason why it’s called by its own name AutomationRuntime), but the base is still VxWorks until now.” — B&R Community forum, 2024
Key evidence:
- B&R’s own Cyber Security Advisory #01/2019 states: “B&R Automation Runtime software is based on VxWorks and these vulnerabilities affect a range of Automation Runtime versions…”
- VxWorks is a proprietary, Unix-like, scalable RTOS developed by Wind River Systems, widely deployed in mission-critical embedded systems.
1.2 B&R Extensions on Top of VxWorks
B&R has built a substantial layer on top of VxWorks:
- Custom task class scheduling — B&R’s unique cyclic task class model (Cyclic #1 through #8) with configurable cycle times and tolerance
- PLC-specific drivers — X2X bus drivers, POWERLINK, Ethernet/IP
- Hardware abstraction layer (HAL) — isolates user programs from hardware specifics; applications run identically across different B&R controllers
- I/O management subsystem — synchronized I/O cycle with task classes
- Non-volatile memory management — User ROM, User RAM, Retain, Remanent memory systems
1.3 exOS (Enhanced Crossover Operating System) — Linux Side
Starting around 2020, B&R introduced exOS, allowing Linux code to run alongside Automation Runtime on the same hardware:
“The enhanced crossover Operating System (exOS) allows machine builders to use any Linux code within their B&R system.” — B&R Press Release, 2020-12-09
Architecture:
- On dual-core/multi-core B&R controllers (e.g., Automation PC / APC series), cores can be assigned to either:
- Automation Runtime (RTOS) — real-time control
- GPOS (Linux) — general-purpose OS via exOS
- Starting with AR 6.4 and AS 6.5, cores can be assigned dynamically to either GPOS or AR
- Communication between AR and Linux uses a buffered API for process data exchange
- Shared memory is used for data exchange between the two sides
1.4 Hardware Platform Evolution
| Controller Series | Processor | AR Base | Notes |
|---|---|---|---|
| Older B&R 2003/2005 | PowerPC | VxWorks | Legacy systems |
| X20CP1584 / X20(c)CP158x | Intel Atom 600 MHz | VxWorks | 256 MB DDR2 SDRAM |
| X20CP1684 / X20CP358x | Intel Atom (faster) | VxWorks | Higher performance |
| X20CP0484-1 / X20CP0410 | Intel Atom | VxWorks | Single-core license |
| C80 controller | Intel (multi-core) | VxWorks | With SATA flash |
| APC910 | Intel Core i (co-designed with Intel) | VxWorks + exOS | Multi-core with hypervisor |
| APC3200 | Intel multi-core | VxWorks + exOS | Supports multicore AR |
Note: The CP1584 uses an Intel Atom processor clocked at 0.6 GHz with 256 MB DDR2 SDRAM, USB, Ethernet, POWERLINK, and removable CompactFlash. Newer controllers use increasingly powerful Intel Atom and Core i processors.
2. Process Model
2.1 Program Loading and Execution
AR does not use traditional OS processes. Instead, it uses a flat task model where all user code runs within the AR runtime environment as tasks:
- Program Transfer: Automation Studio compiles IEC 61131-3 code (ST, LD, FBD, IL, SFC), Automation Basic, and C/C++ into object code
- Transfer to controller: Object code is transferred via Ethernet, USB, or loaded from CompactFlash/CFast card
- Storage locations:
- User ROM (Flash): Non-volatile storage for program code and configuration
- User RAM (DRAM): Volatile runtime memory for variables
- Retain memory: Battery-backed or flash-backed persistent data (survives power cycle)
- Remanent memory: Flash-backed persistent data (survives power cycle, no battery needed)
- Startup sequence:
- Controller boots → VxWorks kernel starts → AR runtime initializes
- System configuration loaded from User ROM
- Init routines execute (INIT section of each task)
- Cyclic routines begin executing per task class configuration
2.2 Task Model
- User programs are organized into tasks (logical units of code)
- Tasks are assigned to task classes (Cyclic #1 through #8)
- Each task class has a configurable:
- Cycle time — e.g., 1 ms, 10 ms, 100 ms
- Tolerance — watchdog window for cycle time violation
- Task class idle time — reserved time for system tasks
- Tasks within the same task class are executed sequentially within the cycle
- There is no process isolation between user tasks — all tasks share the same address space (flat memory model)
2.3 No Traditional Process Isolation
Unlike Linux or Windows, AR tasks do not have separate address spaces. All user code runs in a shared memory space within the AR runtime. This means:
- A pointer error in one task can corrupt memory used by another task
- Page faults (error 25314) can be caused by any task accessing invalid memory
- There is no memory protection between tasks
- The IecCheck / AdvIecChk libraries provide runtime bounds checking as a debugging aid (not for production)
3. Task Scheduler Internals
3.1 Priority System (0–255)
AR operates on a priority-based preemptive scheduling system derived from VxWorks, with priorities 0–255:
“Automation Runtime operates on a priority system (0-255). The higher the priority number of a task, the higher priority it has when multiple tasks want to run at the same time.” — B&R Community Wiki
Priority bands (documented by community members):
| Priority Range | Category | Examples |
|---|---|---|
| >230 | HW Interrupts & I/O Scheduling | Higher than Cyclic #1 |
| 190–230 | Cyclic Tasks | Cyclic #1 (highest) to Cyclic #8 (lowest), motion/system operations |
| 4–190 | System Tasks | Ethernet, ANSL/TCP/UDP, file ops, logger, visualization, webserver, SDM |
| <4 | Idle Tasks | IDLE (priority 0), TcIdleFiller (priority 3) |
3.2 Cyclic Task Classes
- Up to 8 cyclic task classes (Cyclic #1 through Cyclic #8)
- Cyclic #1 has the highest priority among cyclics; Cyclic #8 has the lowest
- Each task class has a configurable cycle time and tolerance (watchdog window)
- Tasks within a task class execute sequentially each cycle
- The System Tick (base timer for all AR) determines the minimum configurable cycle time
3.3 Preemptive Scheduling
- When a higher-priority task becomes ready to run, it preempts the currently running lower-priority task
- Cyclic tasks always preempt system tasks
- Within cyclic task classes, tasks run to completion before the next task in the same class starts
3.4 Task Class Idle Time
A critical mechanism for allowing system tasks to execute:
- Configured per task class (by default: Cyclic #2, 20ms cycle, with 2ms idle time at the end)
- During the idle time window, cyclic tasks yield and system tasks can execute
- Implemented via the TcIdleFiller mechanism:
- Affected task classes are moved to priority 2
- TcIdleFiller runs at priority 3 (always ready to run, yields to everything higher)
- If no system tasks need to run, TcIdleFiller runs no-ops
- This time is counted as CPU usage (not idle), which can make SDM report artificially high CPU
3.5 Cycle Time Enforcement (Watchdog)
- Each task class has a tolerance value — if the cycle exceeds cycle_time + tolerance, a cycle time violation occurs
- Violation behavior:
- Logged in the logbook
- Controller enters Service Mode (all task classes halted)
- Revision notes (AR 6.6.2): Added “Watchdog after a cycle time violation when the task (task class) is in the safe state (e.g. in a critical section)”
3.6 Multicore Scheduling (AR 6.1+)
Starting with Automation Runtime 6.1, B&R introduced multicore support:
| AR Version | Multicore Capability |
|---|---|
| AR 6.1 | Multicore platform for mapp packages, AR API |
| AR 6.3 | Multicore diagnostics (Profiler, SDM) |
| AR 6.4 | Full multicore for non-hard-RT system tasks; parallel ANSL communication; hypervisor with Windows 11 + efficiency cores; Reader/Writer Locks; SMB 1.0 permanently disabled |
| AR 6.5 | Hard real-time multicore — task classes assignable to specific CPU cores; ManagedCertificateStore extended to ANSL/FTP/HTTP/SMTP; FTP RBAC; SNI support; ArCert CSR generation; hypervisor repair boot for PCIe interrupt conflicts; ARsim 4 GB process memory |
| AR 6.x (future) | mapp Track, IEC Task classes parallelization |
- Tasks can be dynamically distributed across cores based on load
- Dynamic load balancing to least-utilized cores
- AR 6.5 hard real-time core assignment: In AS 6.5, individual task classes (Cyclic #1-#8) can be pinned to specific CPU cores via the Hardware Configuration in Automation Studio. This enables true deterministic hard real-time execution on dedicated cores, isolating time-critical control tasks from system and communication tasks. Configuration is per-task-class under the CPU’s “Multicore” settings. Note: not all CPUs have multiple cores available for AR (some cores may be reserved for GPOS/exOS or the BIOS); check the system datasheet for core availability.
- IO scheduler cannot benefit from multicore
- Synchronization primitives needed (AsSem Standard Library) to prevent race conditions on shared memory
- Not all hardware supports multicore (check System Datasheets; BIOS may reserve cores)
4. System Call Interface
4.1 How User Code Interacts with the RTOS
User programs interact with AR through B&R standard libraries (function blocks / FUBs) rather than direct OS system calls. These libraries wrap underlying VxWorks and B&R-specific OS calls.
4.2 Key Standard Libraries
| Library | Purpose |
|---|---|
| AsArProf | Runtime profiling — LogIdleShow() for CPU usage measurement |
| AsMem | Memory allocation and management functions |
| AsFile | File operations (FileOpen, FileRead, FileWrite, FileClose, DirOpen, etc.) |
| ArEventLog | User logbook entries (logline function) |
| AsSem | Semaphores and synchronization (critical for multicore) |
| AsBrStr | String manipulation |
| AsTCP | TCP/IP socket operations |
| AsUDP | UDP socket operations |
| AsMbTCP | Modbus TCP implementation |
| IecCheck | Runtime IEC code validation (division by zero, null ptr, array bounds) |
| AdvIecChk | Extended IEC validation with backtrace info |
| DataObj | Data object persistent storage |
| ST (System Tasks) | Suspend/resume system modules at runtime |
4.3 No Direct VxWorks API Access
User programs in IEC languages (ST, LD, FBD, etc.) cannot call VxWorks APIs directly. Only C/C++ programs compiled with the B&R C compiler can potentially access lower-level functions, but this is not documented for general use.
4.4 Online Services API
Automation Studio communicates with the controller via an online protocol for:
- Variable monitoring (Watch window)
- Trace/oscilloscope
- Logger access
- Program transfer (download/compare)
- Profiling
- Force variables
These use the ANSL (Automation Network Service Layer) protocol running as a system task.
4.5 Practical Runtime Monitoring from IEC Code
The AsArProf library provides runtime profiling capabilities directly from IEC code:
PROGRAM _CYCLIC
VAR
cpuUsage : REAL;
cycleTime : LTIME;
idleShow : DINT;
taskInfo : STRING;
END_VAR
(* Read CPU usage using AsArProf *)
cpuUsage := AsArProf.GetCpuUsage();
(* Read current task's cycle time *)
cycleTime := _taskGetCurrentCycleTime();
(* Log idle time statistics (for diagnosing high CPU) *)
(* This shows how much time is available for system tasks *)
idleShow := AsArProf.LogIdleShow();
(* Write diagnostic info to the logbook *)
IF cpuUsage > 80.0 THEN
ArEventLog.LogInfo(0, 0, 'High CPU usage detected: %.1f%%', cpuUsage);
END_IF
END_PROGRAM
For monitoring system variables externally without IEC code access, see system-variables.md. For building external Python-based monitoring tools, see python-diagnostics.md.
5. Interrupt Handling
5.1 No User-Defined ISRs
This is a critical design decision:
“Since the Automation Runtime and the whole hardware ecosystem is based on a deterministic runtime behavior, there’s no functionality like ‘user defined IRQ / ISR’ (because this could disturb the realtime operation, for example if the ISR takes too long to execute).” — B&R Community, 2024
AR deliberately excludes user-defined interrupt service routines to maintain deterministic timing.
5.2 IRQ Task Classes
B&R provides IRQ task classes for hardware interrupt handling:
“Each interrupt capable module can be assigned an interrupt task (IRQ task for short) which is processed each time the corresponding interrupt is triggered.” — B&R Programming Training Document
- IRQ tasks are assigned to specific hardware modules (e.g., digital input modules with interrupt capability)
- They execute at a priority higher than Cyclic #1 (>230 priority range)
- The interrupt triggers the associated task to execute in its configured task class
- This is the sanctioned way to handle hardware events in AR
5.3 HW Interrupts and I/O Scheduling
- Hardware interrupts and I/O scheduling run at priorities greater than 230
- This includes the X2X bus cycle, POWERLINK communication
- The I/O cycle is synchronized with task class cycles (configurable per task class)
5.4 Interrupt Latency
Not publicly documented with specific numbers. However:
- AR guarantees deterministic behavior with configured cycle times
- Minimum achievable cycle time depends on the specific controller (some support sub-1ms)
- The X2X bus and I/O updates are deterministic and synchronized with the task class cycle
5.5 reACTION Technology
For extremely fast responses, B&R offers reACTION modules (X20DS/DSP and X20DC/counter modules):
- Hardware-level response times in the microsecond range
- Edge detection and nettime timestamps at the module level
- Offloads time-critical processing from the CPU to the I/O module itself
6. Memory Management
6.1 Memory Regions
AR uses a structured memory layout with named partitions. For the complete CP1584 address map with specific addresses and sizes, see memory-map.md. For battery-backed data management, see retentive-data.md.
| Memory Area | Type | Persistence | Purpose |
|---|---|---|---|
| User ROM | Flash | Non-volatile | Program code, configuration, data objects |
| User RAM | DRAM | Volatile | Runtime variables, heap, stack |
| Retain | Battery-backed / Flash | Persistent (power cycle) | Retained variable values |
| Remanent | Flash | Persistent (power cycle) | Remanent variable values (no battery) |
| System | DRAM/Flash | Mixed | AR kernel, drivers, system tasks |
| I/O | DRAM | Volatile | Process image (input/output data) |
6.2 Memory Configuration
- Memory sizes are configurable per controller in the CPU properties (Memory configuration section)
- Configurable devices for Retain and Remanent memory
- Must ensure configured sizes >= used sizes (build error if insufficient)
- Automation Studio provides offline memory usage analysis
6.3 Heap Management
- AsMem library provides memory allocation functions for dynamic memory
- No detailed public documentation on heap implementation (VxWorks memPartLib / memLib likely underneath)
- Memory fragmentation can occur with dynamic allocation
- System tasks like NvFlushHandler handle non-volatile memory flush operations
6.4 Stack Management
- Each task has its own stack (size typically configurable)
- No public documentation on default stack sizes or limits
- Stack overflow could cause page faults
6.5 Memory Protection
- Limited memory protection between user tasks (flat address space)
- The processor MMU can detect accesses to invalid/protected memory regions → triggers page fault (error 25314)
- No isolation between tasks — a corrupt pointer in one task can corrupt another task’s data
- Memory can become invalid and be relocated during online transfers, causing “Value applied from references” issues
6.6 Memory Access Violations
Error 6804 (memory access violation) can precede error 25314 (page fault / EXCEPTION). The AR exception handler logs these and transitions the controller to Service Mode.
7. Hardware Abstraction Layer (HAL)
7.1 Purpose
The HAL is a B&R-developed abstraction layer that sits between the AR runtime and the underlying hardware:
“Thanks to an abstraction layer, applications run identically on all B&R hardware platforms.” — B&R Automation Runtime product page
7.2 What the HAL Abstracts
- Processor architecture (PowerPC → Intel Atom → Intel Core i migration)
- Memory controller and bus interfaces
- I/O bus (X2X backplane communication)
- Communication interfaces (Ethernet, POWERLINK, USB, serial)
- Storage (CompactFlash, CFast, SATA flash, onboard flash)
- Hardware timers and interrupt controllers
7.3 HAL Benefits
- Portability: User programs compiled once can run on different B&R controllers
- Hardware independence: Same program runs on X20CP1584, X20CP1684, APC910, etc.
- Online software comparison: AR can compare the compiled code on the controller with the code in Automation Studio
8. Monitoring Runtime Behavior for Debugging
8.1 Automation Studio Profiler
- Task and system runtime measurement built into Automation Studio
- Shows per-task CPU usage, execution times, priorities
- From AR 6.3+: multicore-aware profiler showing per-core utilization
- Shows the TcIdleFiller no-op time separately
- Can identify which tasks consume the most CPU time
8.2 System Diagnostics Manager (SDM)
- Web-based diagnostic interface built into AR (V3.0+)
- Accessible via standard web browser from any location
- Displays:
- CPU usage (historical and real-time)
- Task class cycle times
- Memory usage
- System status
- I/O module status
- Runs as a low-priority system task — does not interfere with cyclic tasks
- Opening SDM in a browser adds some CPU load due to cyclic data transfer (CGI interface)
- CPU usage is calculated as:
100% - [time spent at Priority 0, IDLE]
8.3 Logger (Logbook)
- Central logging system accessible via Automation Studio (Open → Logger) or SDM
- Multiple log categories:
- System log — OS-level events, errors, warnings (includes error 25314, 6804, etc.)
- User log — Application-specific log entries via ArEventLog library
- Each log entry has a timestamp, severity, and optional backtrace
- Backtrace tab: For errors like page faults, shows the call stack with clickable links to source code (when debug symbols are available)
- Logbook persists across reboots; stored on non-volatile memory
8.4 Watch Window
- Real-time variable monitoring
- Can watch any variable from any task
- Does not require code changes
8.5 Trace (Oscilloscope)
- Variable trace function for graphical display of variable values over time
- Common commissioning tool for timing analysis
8.6 Single Step and Disassemble
- Automation Studio supports single-stepping through code on the target
- Disassemble function for examining compiled code
- Debugger stops tasks (not cores) — in multicore, all instances of a task are stopped regardless of which core they run on
8.7 System Dump
- Diagnostic tool for collecting complete logs from the PLC
- Downloadable over Ethernet without needing a CF card
- Includes logger files and system state information
- Openable in Automation Studio for analysis
9. System Variables Exposed by AR
9.1 CPU Usage
- LogIdleShow function block (AsArProf library) — provides CPU usage as a programmable variable
- Returns the same value as the SDM CPU usage display
- Based on underlying system functions measuring idle time
- SDM: Always available via web interface
- Not available as a direct CPU datapoint — must use LogIdleShow function block
9.2 Task Cycle Times
- Visible in the Profiler and SDM
- Shows current execution time per task class
- Shows tolerance and configured cycle time
- Task class idle time visible
9.3 Memory Usage
- Automation Studio provides offline memory usage analysis (per variable, per task, total)
- DRAM usage measured once on the target
- Memory configuration sizes visible in CPU configuration
- Used vs. configured for User ROM, User RAM, Retain, Remanent
9.4 CPU Temperature
- Available as a CPU datapoint (unlike CPU usage)
- Configurable datatype
9.5 I/O Module Status
- Available via SDM and I/O configuration
- Module insertion/removal detection
- Diagnostic data per channel
9.6 System Task Information
Visible in the Profiler:
IDLE— priority 0 no-op taskTcIdleFiller— priority 3 no-op during task class idle timeNvFlushHandler— non-volatile memory flush handlersataXbdReqSvc— SATA/flash disk request servicemvLoader— module loadermvRpctxtfmt— runtime context formatting- ANSL, TCP, UDP, webserver, visualization tasks
- I/O bus cycle tasks
10. Crash, Exception, and Watchdog Handling
10.1 Service Mode
When a critical error occurs, the controller enters Service Mode — all task classes are halted:
“Service mode means that no task classes are running on the PLC. The application program is not running; the PLC is halted.”
Triggers for Service Mode:
- Reset button pressed on the PLC
- “Stop Target” command from Automation Studio
- Critical error at runtime (the error-driven case)
10.2 Exception: Page Fault (Error 25314)
The most common runtime crash:
“The processor throws an exception to the operating system if it tries to access an invalid or protected memory location. The B&R operating system logs this type of serious memory violation as a page fault (error 25314).”
Causes:
- Null or incorrect pointer
- Division by zero
- Array index out of bounds
- Incorrect memory copy (buffer overflow)
- Memory relocation during online transfer
Diagnostic procedure:
- Check the Logger (System log) for error 25314
- Examine the Backtrace tab — may link directly to source code
- Add IecCheck or AdvIecChk library for enhanced diagnostics
- Systematically disable tasks to isolate the faulting task
- Use remanent variables to narrow down faulting code section
10.3 Exception: Memory Access Violation (Error 6804)
- Can precede or accompany error 25314
- Indicates the processor detected invalid memory access before the full page fault
10.4 Cycle Time Violation (Watchdog Timeout)
- When a task class exceeds its configured cycle_time + tolerance
- Logged in the logbook
- Can trigger Service Mode (controller halts)
- AR 6.6.2 fix: Watchdog now also triggers when task is in safe state (e.g., critical section)
10.5 Watchdog Behavior Summary
| Violation Type | Error Code | Action |
|---|---|---|
| Page Fault | 25314 | Enter Service Mode, log backtrace |
| Memory Access Violation | 6804 | Log error, may lead to 25314 |
| Cycle Time Violation | varies | Log error, may enter Service Mode |
| IEC Runtime Error (with IecCheck) | 55555 | Enter Service Mode with detailed info |
| User ROM cleared | varies | Auto-restart into diagnostic mode |
10.6 Exception During Startup
- Documented issue: intermittent “EXCEPTION Page Fault” during startup
- Error chain: 6804 memory access violation → 25314 page fault
- Related to
mvLoaderandmvRpctxtFmtthreads during module loading - Can be caused by memory moving around during transfer
10.7 Crash Handling Flow
Exception occurs (hardware trap)
→ VxWorks exception handler
→ B&R exception handler logs error
→ Error code written to logbook (with backtrace if available)
→ Controller enters Service Mode
→ All cyclic task classes halted
→ SDM, Logger, web interface remain available for diagnostics
11. File System
11.1 Storage Media
| Controller Type | Storage |
|---|---|
| X20CP1584 and similar | Removable CompactFlash (CF) card |
| Newer controllers | CFast card |
| C80 controller | Onboard SATA flash |
| Automation PC (APC) | SSD/HDD + SATA flash |
11.2 CF Card Contents
- AR system image and boot files
- User configuration
- User programs (User ROM contents)
- Logbook files
- User files (created via AsFile library)
- System dump files
11.3 File Operations from User Programs
The AsFile library provides file system access:
FileOpen— Open/create files on the CF cardFileRead/FileWrite— Read/write file dataFileClose— Close file handlesDirOpen/DirRead/DirClose— Directory operations- File paths reference the CF card’s file system
Important considerations:
- File operations run as system tasks (priority 4–190 range)
- Heavy file I/O can impact system performance (sataXbdReqSvc system task)
- NvFlushHandler system task manages non-volatile memory writes (DataObj, logger objects, user files)
- Files written during runtime persist on the storage media
11.4 File System Diagnostics
sataXbdReqSvc— system task handling SATA/flash disk requests- High CPU usage in this task can indicate excessive file writes
- Configuration files can be deleted from CF card by system (reported bug on community)
11.5 CF Card Backup/Restore
- Runtime Utility Center tool for creating backup images of CF/CFast cards
- Image files can be stored on PC and restored to spare cards
- LogBook can be retrieved directly from CF/CFast card
12. Networking Stack
12.1 TCP/IP Implementation
AR’s networking is built on VxWorks’ TCP/IP stack (historically Wind River’s IPnet stack):
“The vulnerability exists in the TCP/IP stack implementation of the underlying operating system.” — B&R Security Notice for NAME-WRECK vulnerability
- This confirms AR uses the underlying VxWorks TCP/IP stack
- B&R has issued security advisories related to VxWorks TCP/IP vulnerabilities (e.g., NAME-WRECK)
12.2 Network Protocols Supported
- POWERLINK — B&R’s real-time Ethernet protocol (deterministic, time-critical)
- Ethernet/IP — For interoperability with Rockwell/Allen-Bradley systems
- Modbus TCP — Via AsMbTCP library
- OPC UA — Client/Server and FX (fieldbus eXtensible) with multicore support (6.1+)
- TCP/UDP sockets — Available via AsTCP/AsUDP libraries for custom protocols
- REST/HTTP — Possible via socket-level implementation
- SDM web interface — HTTP server built into AR
12.3 Network Architecture
- Ethernet traffic handling runs as a system task (priority 4–190 range)
- ANSL (Automation Network Service Layer) handles online communication between AS and the controller
- POWERLINK cycle is deterministic and integrated with the I/O cycle
- Network tasks yield to cyclic tasks — high cyclic load can block network responses (100-500ms delays)
12.4 POWERLINK TCP/IP Gateway
- X20HB8815 gateway module provides an additional Ethernet port for TCP/IP
- Separates POWERLINK traffic from general TCP/IP traffic
13. AR Log System and Diagnostic Output
13.1 Logger Architecture
The Logger is AR’s central logging and diagnostic system:
Log Categories:
- System log — OS and runtime events:
- Startup/shutdown events
- Error 25314 (page fault) with backtrace
- Error 6804 (memory access violation)
- Cycle time violations
- I/O module events (insertion, removal, errors)
- Watchdog events
- System task events
- User log — Application events via ArEventLog library:
- Custom log entries with configurable severity
- Accessed via
loglinefunction
13.2 Accessing the Logger
| Method | Access |
|---|---|
| Automation Studio | Open → Logger (Ctrl+L) |
| SDM (web) | Logger page in web interface |
| System Dump | Logger files included in system dump |
| CF/CFast card | LogBook files on storage media |
| ArEventLog library | Programmatic access from user code |
13.3 Log Entry Format
- Timestamp
- Severity level
- Error code (for system errors)
- Description/message
- Backtrace (for exceptions like 25314) — call stack with module names, addresses, and source line references
13.4 Backtrace Feature
For page fault (25314) entries:
- Backtrace tab shows the call stack
- Lines with green arrows can be double-clicked to jump to source code in Automation Studio
- Requires debug symbols (not available for stripped/optimized builds)
13.5 User Logging (ArEventLog)
(* Example: Writing to user logbook *)
logline(severity_level, message_string);
- The
loglinefunction uses the ArEventLog library - Entries appear in the Logger accessible via Ctrl+L or SDM
- Useful for application-level diagnostics without custom file operations
13.6 Profiling Data
- The Profiler provides runtime measurement data:
- Per-task execution time
- CPU usage percentage
- Priority information
- Time spent in idle vs. system vs. cyclic tasks
- Available as a recording (trace) or real-time view
- From AR 6.3+: per-core data in multicore systems
13.7 Logbook Persistence
- Log entries are stored in non-volatile memory
- Survives warm starts and power cycles
- Log capacity is finite — oldest entries may be overwritten
- System Dump collects the full logbook for offline analysis
14. Security Vulnerability History (VxWorks-Derived)
Because AR is based on VxWorks, it inherits vulnerabilities from the underlying OS components. B&R (now part of ABB) publishes Cyber Security Advisories when affected products are identified. This section documents known vulnerabilities relevant to the CP1584 running AR 4.x.
14.1 URGENT/11 (2019) — VxWorks TCP/IP Stack (IPnet)
Discovered by Armis Research, URGENT/11 comprised 11 vulnerabilities in the VxWorks IPnet TCP/IP stack affecting all VxWorks versions since 6.5. B&R issued Cyber Security Advisory #01/2019 confirming impact on AR.
Impact on CP1584:
- Remote code execution possible via crafted TCP/IP packets
- Denial of service via malformed network frames
- Information leakage through stack-based buffer overflows
- Affected AR versions: All AR versions using the vulnerable IPnet stack (most AR 3.x and early 4.x versions)
Mitigation: Update AR to the patched version specified in B&R’s advisory. Network isolation (VLAN, firewall) is the primary mitigation when patching is not immediately possible.
14.2 NAME-WRECK (2021) — DNS Protocol Vulnerabilities
B&R issued a separate security notice for NAME-WRECK, a set of DNS-related vulnerabilities in VxWorks’ TCP/IP implementation.
- Affected: AR versions using VxWorks IPnet stack
- Impact: Remote code execution, denial of service via crafted DNS responses
- Mitigation: Update AR; block unsolicited DNS traffic at the firewall
14.3 SA24P011 (August 2024) — Multiple VxWorks and OpenSSL Vulnerabilities
B&R published Cyber Security Advisory SA24P011 covering six CVEs in AR versions prior to 6.0.2:
| CVE | Vulnerability | CVSS | Impact |
|---|---|---|---|
| CVE-2020-28895 | VxWorks memory allocator integer overflow (calloc) | 7.3 High | Memory corruption, DoS |
| CVE-2020-1971 | OpenSSL X.509 EDIPartyName NULL pointer deref | 5.9 Medium | DoS via malicious certificate |
| CVE-2021-23840 | OpenSSL EVP_CipherUpdate integer overflow | 7.5 High | App crash or incorrect behavior |
| CVE-2021-23841 | OpenSSL X509_issuer_and_serial_hash NULL deref | 5.9 Medium | DoS via malicious certificate |
| CVE-2024-5800 | Weak Diffie-Hellman groups in SSL/TLS stack | 6.5 Medium | Decryption of SSL/TLS communications |
| CVE-2024-5801 | IP forwarding enabled by default | 6.5 Medium | Network segment bypass, packet injection |
Affected AR versions: All versions before AR 6.0.2 — this includes the CP1584 running AR 4.x.
Practical implications for AR 4.x CP1584 systems:
- The CP1584 cannot upgrade to AR 6.x (incompatible hardware). These vulnerabilities remain unpatched on AR 4.x systems.
- CVE-2024-5800 (weak TLS) means FTP and OPC-UA communication using the built-in SSL/TLS may be decryptable.
- CVE-2024-5801 (IP forwarding) means the PLC could be used as a network bridge to bypass firewall segmentation.
- CVE-2020-28895 (memory corruption) could allow remote DoS via crafted packets.
Mitigation for unpatched AR 4.x systems:
- Network isolation: Place the CP1584 on a dedicated VLAN with no direct internet access. Allow only necessary protocols (ANSL on 11169, POWERLINK on dedicated interface, FTP on 21).
- Disable IP forwarding if possible via the runtime firewall configuration.
- Block unnecessary services — if FTP is not needed, disable it. If SDM web access is not needed, restrict access.
- Use VPN for remote access — never expose B&R PLC interfaces directly to the internet.
- Monitor for anomalous traffic — use SNMP or an IIoT platform to detect unusual network activity from the PLC.
14.4 CVE-2025-11044 (January 2026) — ANSL Server DoS (Race Condition)
B&R published SA25P005 identifying a permanent denial-of-service vulnerability in the ANSL Server component of AR. CISA also published ICSA-26-125-03.
| Detail | Value |
|---|---|
| CVE | CVE-2025-11044 |
| CVSS | v3.1 6.8 (Medium), v4.0 8.9 (High) |
| CWE | CWE-770 (Allocation of Resources Without Limits or Throttling) |
| Affected | AR < 6.5.0 and AR < R4.93 |
| Impact | Permanent DoS — ANSL Server crash requiring controller restart |
| Authentication | Unauthenticated (network-based) |
| Advisory | B&R SA25P005 (2026-01-19) |
Exploitation details: The vulnerability is caused by insufficient throttling and limiting mechanisms in the ANSL Server. Successful exploitation requires winning a race condition (not guaranteed on every attempt). B&R determined that shorter cycle times in customer projects increase the likelihood of exploitation.
Mitigation for unpatched AR 4.x systems:
- Update to AR R4.93 or later (patches this vulnerability on the CP1584 platform)
- For versions that cannot be updated: increase application cycle times (longer cycles reduce exploit probability)
- Configure the Control Network Firewall to limit maximum data traffic and concurrent connections to the ANSL server to no more than 80% of measured peak traffic
- Test maximum load capacity before commissioning
14.5 CVE-2025-3450 (October 2025) — SDM DoS (Improper Resource Locking)
B&R published SA25P002 identifying a denial-of-service vulnerability in the System Diagnostics Manager (SDM) web interface.
| Detail | Value |
|---|---|
| CVE | CVE-2025-3450 |
| CVSS | v3.1 7.5 (High), v4.0 8.2 (High) |
| Affected | AR < 6.3 and AR = 6.0 |
| Impact | System node stop via crafted SDM request |
| Authentication | Unauthenticated (network-based) |
| Advisory | B&R SA25P002 (2025-10-07) |
Practical implications for CP1584: All AR 4.x versions are affected. An attacker who can reach the SDM web interface (port 80) can send a specially crafted message to crash the entire controller. See diagnostics-sdm.md for SDM-specific mitigations.
Mitigation for CP1584:
- Restrict SDM access to trusted personnel only — disable SDM in the AS project if not needed for maintenance
- Configure the HTTP protocol over TLS (HTTPS) — use mutual TLS (mTLS) in AS project option “Validate SSL communication partner”
- Restrict webserver access to trusted IP addresses using the AR host-based firewall (Automation Help GUID 75b8994b-f97a-4e0f-8278-43c2a737e65f)
- Block port 80/443 at the network firewall except during active maintenance windows
14.6 CVE-2025-11043 (January 2026) — Automation Studio Certificate Validation
B&R published SA25P004 identifying insufficient server certificate validation in Automation Studio’s ANSL and OPC-UA clients.
| Detail | Value |
|---|---|
| CVE | CVE-2025-11043 |
| CVSS | v3.1 7.4 (High), v4.0 9.1 (Critical) |
| CWE | CWE-295 (Improper Certificate Validation) |
| Affected | Automation Studio < 6.5 |
| Impact | Man-in-the-middle — attacker can spoof trusted server, intercept data, alter PLC program during transfer |
| Advisory | B&R SA25P004 (2026-01-19) |
Practical implications: This affects the engineering workstation, not the PLC directly. However, if you use Automation Studio to connect to a CP1584 over an untrusted network, an attacker could impersonate the PLC and inject malicious code during online changes or program transfers. Critical for remote maintenance scenarios.
Mitigation:
- Update Automation Studio to version 6.5
- Operate Automation Studio within Level 2 of the ABB ICS Cyber Security Reference Architecture
- Never connect Automation Studio to PLCs over public networks or untrusted WiFi
- Use VPN with proper certificate validation for any remote maintenance
14.7 CVE-2025-3449 — Automation Studio Privilege Escalation
| Detail | Value |
|---|---|
| CVE | CVE-2025-3449 |
| CVSS | High |
| Affected | Automation Studio (specific versions pending) |
| Impact | Incorrect Permission Assignment for Critical Resource — privilege escalation |
An attacker with local access to the engineering workstation could exploit this to gain elevated privileges. Relevant for shared engineering workstations or compromised developer laptops.
14.8 CVE-2024-0323 — FTP Server Weak TLS
| Detail | Value |
|---|---|
| CVE | CVE-2024-0323 |
| CVSS | 9.8 (Critical) |
| Affected | Automation Runtime (all versions with FTP enabled) |
| Impact | Man-in-the-middle on FTP connections; supports SSLv3, TLSv1.0, TLSv1.1 |
Practical implications for CP1584: The built-in FTP server uses insecure encryption. Any FTP session to/from the CP1584 (including CF card backup/restore) can be intercepted and decrypted. Do not use FTP over untrusted networks. This vulnerability is unlikely to be patched on AR 4.x.
14.9 CVE-2023-3242 — Portmapper DoS
| Detail | Value |
|---|---|
| CVE | CVE-2023-3242 |
| CVSS | 8.6 (High) |
| Affected | Automation Runtime < G4.93 |
| Impact | Permanent denial-of-service via improper initialization in Portmapper |
| Authentication | Unauthenticated (network-based) |
Patched in AR R4.93. On older AR 4.x versions, the Portmapper service can be exploited to permanently crash the controller.
14.10 CVE-2023-1617 — VC4 VNC Authentication Bypass (Critical)
| Detail | Value |
|---|---|
| CVE | CVE-2023-1617 |
| CVSS | 9.8 (Critical) |
| Affected | B&R VC4 (VNC Server): 3.x–4.45.3, 4.7.x–4.72.9 |
| Impact | Unauthenticated bypass of VNC authentication — full HMI access without credentials |
| CWE | CWE-287 (Improper Authentication) |
Practical implications for CP1584: If the CP1584 runs a visualization (mapp View, VC4), an attacker on the network can connect to the VNC server (port 5900) and see the full HMI display without any authentication. This exposes all machine state, operator interactions, and potentially allows input injection.
Mitigation:
- Update VC4 to the latest version (4.45.1+ or 4.72.9+)
- Block VNC ports (5900, 5800) at the network firewall
- Disable VNC if not needed for remote monitoring
- See access-recovery.md for VNC security guidance
14.11 CVE-2021-22289 — Automation Studio Code Injection (Project Upload)
| Detail | Value |
|---|---|
| CVE | CVE-2021-22289 |
| CVSS | 8.3 (High) |
| Affected | Automation Studio >= 4.0 |
| Impact | Remote code execution via malicious project upload mechanism |
| Authentication | Unauthenticated (network-based) |
If Automation Studio is running and listening for incoming connections, a network attacker could exploit the project upload mechanism to execute arbitrary code on the engineering workstation.
14.12 CVE-2021-22275 — AR Webserver Buffer Overflow
| Detail | Value |
|---|---|
| CVE | CVE-2021-22275 |
| CVSS | 8.6 (High) |
| Affected | Automation Runtime |
| Impact | Unauthenticated attacker can stop cyclic program and cause DoS via webserver buffer overflow |
Practical implications for CP1584: An attacker sending a crafted HTTP request to the PLC’s web interface (port 80) can crash the cyclic program, stopping the machine. This is distinct from CVE-2025-3450 which targets SDM specifically.
14.13 CVE-2022-4286 — SDM Reflected XSS
| Detail | Value |
|---|---|
| CVE | CVE-2022-4286 |
| CVSS | 6.1 (Medium) |
| Affected | Automation Runtime >= 3.00 and <= C4.93 |
| Impact | Reflected cross-site scripting in SDM web interface |
Patched in AR R4.93. If an authenticated user visits a malicious URL while logged into SDM, JavaScript can execute in their browser session. See diagnostics-sdm.md.
14.14 CVE-2024-2637 — Search Path Code Execution
| Detail | Value |
|---|---|
| CVE | CVE-2024-2637 |
| CVSS | 7.2 (High) |
| Affected | Multiple B&R products including Automation Runtime, mapp components, ADI driver, HMI Service Center |
| Impact | Local code execution via uncontrolled search path element |
| CWE | CWE-427 |
An authenticated local attacker could place specially crafted files in the loading search path to execute malicious code. Relevant for shared engineering workstations.
14.15 CVE-2025-3449 — SDM Predictable Session ID (Session Takeover)
B&R published SA25P003 (CISA ICSA-26-141-04) identifying a session takeover vulnerability in SDM.
| Detail | Value |
|---|---|
| CVE | CVE-2025-3449 |
| CVSS | v3.1 4.2 (Medium) |
| CWE | CWE-340 (Generation of Predictable Numbers or Identifiers) |
| Affected | AR < 6.4 |
| Impact | Unauthenticated attacker can take over an already-established SDM session by guessing the predictable session ID |
| Authentication | Unauthenticated (network-based) |
| Advisory | B&R SA25P003 (2025-10-07), CISA ICSA-26-141-04 |
Practical implications for CP1584: All AR 4.x versions are affected. Since SDM does not implement authentication in older AR versions, session takeover could allow an attacker to view diagnostic data or inject commands if they can predict the session ID. However, B&R notes that SDM “does not process any session-specific data” at this time, so the practical impact is limited to browser-level interaction.
Mitigation for CP1584:
- Update to AR R4.93 if possible (partial mitigation — does not fix this CVE on AR 4.x)
- Block SDM access (port 80/443) at the network firewall when not actively debugging
- Never access SDM over public networks or untrusted WiFi
- Use VPN for remote SDM access
14.16 CVE-2025-3448 — SDM Reflected XSS (New)
| Detail | Value |
|---|---|
| CVE | CVE-2025-3448 |
| CVSS | v3.1 6.1 (Medium) |
| CWE | CWE-79 (Improper Neutralization of Input During Web Page Generation) |
| Affected | AR < 6.4 |
| Impact | Reflected XSS — attacker can execute arbitrary JavaScript in the context of the victim’s browser session via crafted SDM URL |
| Authentication | Requires user interaction (victim must click malicious link) |
| Advisory | B&R SA25P003 (2025-10-07), CISA ICSA-26-141-04 |
Practical implications for CP1584: All AR 4.x versions are affected. This is distinct from CVE-2022-4286 (which was patched in R4.93). An attacker could craft a malicious link that, when clicked by an authenticated user, executes JavaScript in their browser. The exploit requires social engineering.
Mitigation: Do not click untrusted links while authenticated to SDM. Deploy a Web Application Firewall (WAF) to filter reflected XSS attempts. Block SDM at the network level when not needed.
14.17 CVE-2025-11498 — SDM CSV Injection
| Detail | Value |
|---|---|
| CVE | CVE-2025-11498 |
| CVSS | v3.1 6.1 (Medium) |
| CWE | CWE-1236 (Improper Neutralization of Formula Elements in a CSV File) |
| Affected | AR < 6.4 |
| Impact | Attacker can inject formula data into a generated CSV file via crafted SDM URL. The CSV must then be manually opened by the victim in a spreadsheet application (e.g., Excel) that evaluates formulas. |
| Authentication | Requires user to click malicious link AND manually open resulting CSV |
| Advisory | B&R SA25P003 (2025-10-14), CISA ICSA-26-141-04 |
Practical implications for CP1584: All AR 4.x versions are affected. This is a multi-step attack requiring both clicking a malicious link and opening a CSV export. The impact is limited to the user’s machine (formula injection in spreadsheets can execute local commands in some configurations).
Mitigation: Never use hyperlinks from untrusted sources to access SDM. Disable CSV export functionality in SDM if not needed. Be cautious opening CSV files exported from SDM if the URL source was not manually typed.
14.18 CVE-2026-0936 — PVI Logfile Credential Leak
| Detail | Value |
|---|---|
| CVE | CVE-2026-0936 |
| CVSS | 5.0 (Medium) |
| CWE | CWE-532 (Insertion of Sensitive Information into Log File) |
| Affected | PVI client versions prior to 6.5 |
| Impact | PVI client logging function (disabled by default) may log credential information processed by the PVI client application |
| Authentication | Requires local authenticated attacker + logging explicitly enabled |
| Advisory | B&R SA26P001 (2026-01-29) |
Practical implications for CP1584: The PVI logging feature is disabled by default and must be explicitly enabled. If enabled, PVI may log sensitive information including connection credentials used to access the PLC. If you have enabled PVI logging on your diagnostic workstation, review log files for embedded credentials before sharing them.
Mitigation: Do not enable PVI logging unless actively debugging PVI communication issues. Purge any existing PVI log files that may contain credentials.
14.19 CVE-2025-11043 — Automation Studio Certificate Validation Bypass
| Detail | Value |
|---|---|
| CVE | CVE-2025-11043 |
| CVSS | 7.4 (High) |
| CWE | CWE-295 (Improper Certificate Validation) |
| Affected | Automation Studio versions before 6.5 |
| Impact | OPC-UA client and ANSL over TLS client in AS could accept certificates from unauthorized parties, allowing MITM attacks |
| Authentication | Unauthenticated (network-based) |
| Advisory | B&R SA25P004 (2026-01-19) |
Practical implications for CP1584: When using Automation Studio to connect to a CP1584 over TLS-secured ANSL connections, an attacker on the network could intercept and modify the communication. This affects the engineering workstation, not the PLC directly, but could lead to malicious code being downloaded to the PLC.
Mitigation: Upgrade to Automation Studio 6.5+. If stuck on AS 4.x, use direct IP connections on an isolated network segment rather than relying on TLS for security.
14.20 CVE-2025-11482 — PPT30 OPC-UA Server Connection Exhaustion DoS
| Detail | Value |
|---|---|
| CVE | CVE-2025-11482 |
| CVSS | 7.5 (High) |
| CWE | CWE-400 (Uncontrolled Resource Consumption) |
| Affected | PPT30 Operating System versions before 1.8.0 |
| Impact | Unauthenticated network-based attacker can permanently prevent legitimate users from accessing the OPC-UA service by exhausting connection resources |
| Advisory | B&R SA25P006 (2026-05-26) |
Practical implications: If the machine uses a PPT30 HMI panel with OPC-UA server enabled, an attacker on the same network can exhaust the OPC-UA connection pool, denying access to OPC-UA data. Block OPC-UA port (4840) at the switch port if the PPT30 does not need external OPC-UA access.
14.21 CVE-2024-8603 — Broken or Risky Cryptographic Algorithm in SSL/TLS
| Detail | Value |
|---|---|
| CVE | CVE-2024-8603 |
| CVSS | v3.1 7.5 (High), v4.0 8.2 (High) |
| CWE | CWE-327 (Use of a Broken or Risky Cryptographic Algorithm) |
| Affected | AR before 6.1, mapp View before 6.1 |
| Impact | Unauthenticated network attacker can masquerade as services on impacted devices |
| Authentication | Unauthenticated (network-based) |
| Advisory | B&R SA25P001 (2025-01-15) |
Practical implications for CP1584: All AR 4.x versions use the affected SSL/TLS component. An attacker on the network could impersonate legitimate services (OPC-UA server, SDM, FTP) by exploiting weak cryptographic algorithms in the TLS implementation. This is distinct from CVE-2024-5800 (weak DH groups) — this vulnerability relates to the broader SSL/TLS algorithm selection, including cipher suite negotiation and certificate validation weaknesses.
Mitigation for CP1584:
- Network isolation — place CP1584 on a dedicated VLAN with no direct internet access
- Use VPN with proper certificate validation for any remote access
- Do not trust TLS connections from AR 4.x devices — the cryptographic protection is inadequate
- Consider using OPC-UA with security policy “None” on internal networks rather than relying on broken TLS for protection — a broken TLS session provides a false sense of security
- This vulnerability is unpatchable on AR 4.x — requires AR >= 6.1 for the fix
Source: NVD CVE-2024-8603, B&R SA25P001 advisory PDF
14.22 CVE-2024-5800 — Weak Diffie-Hellman Groups in TLS Stack
| Detail | Value |
|---|---|
| CVE | CVE-2024-5800 |
| CVSS | 7.5 (High) |
| CWE | CWE-326 (Inadequate Encryption Strength) |
| Affected | AR versions before 6.0.2 |
| Impact | Insufficient Diffie-Hellman group strength allows network attacker to decrypt SSL/TLS communications |
| Advisory | B&R SA24P011 (2024-08-09, updated 2024-08-30) |
Practical implications for CP1584: All AR 4.x versions use weak DH groups. Any TLS-encrypted communication (FTP over TLS, HTTPS for SDM on AR 6.x, OPC-UA with security) on a CP1584 running AR 4.x is vulnerable to decryption by a network attacker with sufficient computational resources. This means FTP credentials and OPC-UA data transmitted over TLS on AR 4.x PLCs should be considered compromised if the network is not physically secured.
Mitigation: Use network isolation rather than relying on TLS encryption. For FTP access, accept that credentials may be intercepted on AR 4.x and use ephemeral credentials. For OPC-UA, use a VPN tunnel or dedicated VLAN for additional protection.
14.22 CVE-2026-6900/6901 — APROL Certificate Validation and Search Path (APROL-only)
| Detail | Value |
|---|---|
| CVE | CVE-2026-6900 (CVSS 7.4) / CVE-2026-6901 (CVSS 7.7) |
| Affected | APROL before R 4.4-01P5 |
| Impact | Improper certificate validation + untrusted search path |
| Advisory | B&R SA26P011 (2026-07-06) |
Note: APROL is B&R’s process control system (DCS/SCADA), not directly related to CP1584 PLCs. Listed here for completeness as it affects B&R products.
14.23 Complete B&R Security Advisory Timeline (2024-2026)
The following table provides a chronological reference of all B&R security advisories affecting Automation Runtime and related components. This is critical for understanding what firmware versions address which vulnerabilities.
| Date | Advisory | Products Affected | CVE(s) | Severity | AR Version Fix |
|---|---|---|---|---|---|
| 2024-02-05 | SA23P004 | AR FTP | (legacy) | Medium | AR 6.x (TLS hardening) |
| 2024-02-05 | SA23P018 | AR SDM | CVE-2022-4286 | Medium | AR R4.93 |
| 2024-02-14 | SA24P004 | AR SSH | (TerraPin) | Medium | Updated SSH component |
| 2024-02-22 | SA23P019 | AS + TG | CVE-2024-0220 | High | AS 4.12+ / Updated TG |
| 2024-04-10 | SA24P002 | B&R PCs/HMI | (LogoFail) | Medium | UEFI firmware update |
| 2024-05-14 | SA24P005 | Multiple B&R products | CVE-2024-2637 | High (7.2) | Product-specific updates |
| 2024-08-09 | SA24P011 | AR (multiple) | CVE-2024-5800, others | High | AR R4.93 / AR 6.x |
| 2024-11-27 | SA22P014 | mapp components | (auth bypass) | High | mapp component updates |
| 2025-01-15 | SA25P001 | AR SSL/TLS, PVI client | CVE-2024-8603, CVE-2026-0936 | High (7.5-8.2) | AR >= 6.1 / PVI >= 6.5 |
| 2025-03-24 | SA24P015 | APROL | CVE-2022-43762/63/64 | Critical (9.8) | APROL R 4.4-01P5 |
| 2025-10-07 | SA25P002 | AR SDM | CVE-2025-3450 | High (7.5) | AR >= 6.3 / R4.93 |
| 2025-10-07 | SA25P003 | AR SDM | CVE-2025-3448/3449/11498 | Medium (4.2-6.1) | AR >= 6.4 |
| 2026-01-19 | SA25P004 | Automation Studio | CVE-2025-11043 | High (7.4) | AS >= 6.5 |
| 2026-01-19 | SA25P005 | AR ANSL | CVE-2025-11044 | Medium (6.8) | AR >= 6.5 / R4.93 |
| 2026-01-29 | SA26P001 | PVI client | CVE-2026-0936 | Medium (5.0) | PVI >= 6.5 |
| 2026-02-18 | SA25P007 | Automation Studio (SQLite) | (SQLite vuln) | Medium | AS update |
| 2026-05-26 | SA25P006 | PPT30 OPC-UA | CVE-2025-11482 | Medium | PPT30 firmware update |
| 2026-06-10 | SA26P009 | B&R products (XZ Utils) | CVE-2024-3094 related | Critical | Updated system components |
| 2026-06-11 | SA26P010 | B&R products (Linux kernel) | CVE-2026-31431, CVE-2026-43284, CVE-2026-46333, CVE-2026-46300, CVE-2026-43494 | High (7.8) | Linux for B&R <=12, APROL, X20EDS410 |
| 2026-07-06 | SA26P011 | APROL | CVE-2026-6900/6901 | High (7.4-7.7) | APROL R 4.4-01P5 |
Key takeaway for CP1584 operators: The CP1584 maxes out at AR R4.93, which patches CVE-2025-3450 (critical SDM data deletion), CVE-2025-11044 (ANSL DoS), CVE-2024-5800 (weak TLS), and CVE-2022-4286 (SDM XSS). However, 20+ CVEs remain unpatchable on AR 4.x, including all SA25P003 vulnerabilities (session takeover, XSS, CSV injection) and all certificate validation issues. Network isolation is not optional — it is mandatory.
14.24 Security Posture Summary for CP1584 (Updated)
| AR Version | URGENT/11 | NAME-WRECK | SA24P011 | CVE-2025-11044 | CVE-2025-3450 | SA25P003 | CVE-2024-5800 | CVE-2024-0323 | CVE-2021-22275 | CVE-2023-1617 | CVE-2025-11043 (AS) | CVE-2026-0936 (PVI) | Recommendation |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AR 3.x | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | N/A (AS-side) | N/A (PVI-side) | Critical — isolate immediately |
| AR 4.10-4.80 | Partially patched | Partially patched | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | N/A (AS-side) | N/A (PVI-side) | High — update to 4.93 if possible |
| AR 4.90-4.92 | Patched | Patched | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | Vulnerable | N/A (AS-side) | N/A (PVI-side) | High — network isolation critical |
| AR 4.93 (R4.93) | Patched | Patched | Partially | Patched | Patched | Vulnerable | Partially | Vulnerable | Vulnerable | Update VC4 | N/A (AS-side) | N/A (PVI-side) | Medium — best achievable for CP1584 |
SA25P003 covers CVE-2025-3449 (SDM session takeover), CVE-2025-3448 (SDM reflected XSS), and CVE-2025-11498 (SDM CSV injection). These require AR >= 6.4 to patch and cannot be patched on any AR 4.x version.
Key observations:
- AR R4.93 patches CVE-2025-11044 (ANSL DoS), CVE-2025-3450 (critical SDM data deletion), CVE-2023-3242, CVE-2022-4286 (SDM XSS), and partially addresses SA24P011
- CVE-2025-11043 (AS certificate validation) and CVE-2026-0936 (PVI credential logging) affect the engineering workstation software, not the PLC runtime. Mitigate by upgrading AS to 6.5+ and keeping PVI logging disabled.
- No AR 4.x version patches CVE-2024-0323 (FTP weak TLS), CVE-2021-22275 (webserver buffer overflow), CVE-2024-5800 (weak DH groups), CVE-2024-8603 (broken/risky crypto algorithm in SSL/TLS), CVE-2023-1617 (VC4 VNC bypass), or any SA25P003 CVEs (SDM XSS/session/CSV injection)
- The SA25P003 vulnerabilities (CVE-2025-3448, CVE-2025-3449, CVE-2025-11498) further strengthen the case for disabling SDM on production CP1584s when not actively needed
- The VC4 VNC authentication bypass is independently patchable via VC4 component updates
- FTP should be considered insecure on all AR 4.x versions — the weak DH groups (CVE-2024-5800) and broken crypto algorithms (CVE-2024-8603) in AR 4.x TLS mean even TLS-encrypted FTP sessions may be decryptable
- Total unpatchable CVEs on CP1584 (AR R4.93): 20+ known vulnerabilities remain unpatchable due to the AR 4.x ceiling. Network isolation is mandatory, not optional.
14.25 SA26P009 (June 2026) — XZ Utils Vulnerability Impact on B&R Products
| Detail | Value |
|---|---|
| Advisory | B&R SA26P009 (2026-06-10) |
| CVE | Related to CVE-2024-3094 (XZ Utils backdoor) |
| Affected | B&R products incorporating XZ Utils |
| Impact | Supply chain compromise risk via compromised compression library |
CP1584 impact: NONE. The CP1584 runs VxWorks, not Linux, and does not use XZ Utils. SA26P009 affects B&R products that run Linux (Automation PCs, Linux for B&R, APROL, edge controllers). The XZ Utils vulnerability (CVE-2024-3094) was a backdoor inserted into the xz compression library that could enable unauthorized SSH access on affected systems. While this was one of the most significant supply chain attacks in recent history, it does not affect VxWorks-based PLCs like the CP1584.
Source: B&R SA26P009 advisory PDF, CISA AL26-009
14.26 SA26P010 (June 2026) — Linux Kernel Vulnerabilities Impact on B&R Products
| Detail | Value |
|---|---|
| Advisory | B&R SA26P010 (2026-06-11) |
| CVEs | CVE-2026-31431, CVE-2026-43284, CVE-2026-46333, CVE-2026-46300, CVE-2026-43494 |
| CVSS | v3.1 7.8 (High) |
| Affected | Linux for B&R <=12, APROL <4.4-010.10.260602, X20EDS410 /all |
| Impact | Local privilege escalation to root on affected Linux-based systems |
| Advisory | B&R SA26P010 / CISA ICSA-26-174-06 |
CP1584 impact: NONE. The CP1584 runs VxWorks (AR), not Linux. SA26P010 affects only B&R products that include a Linux kernel: Automation PCs running “B&R for Linux,” APROL process control systems, and the X20EDS410 edge controller. The X20CP1584 is a pure VxWorks PLC and is not affected by any Linux kernel vulnerability.
For migration planning: If you are planning to migrate from CP1584 to an X20CP3xxx series or APC platform, be aware that these newer controllers may run Linux components and will require ongoing Linux kernel security patches. See remanufacturing.md for migration analysis.
Source: B&R SA26P010 advisory PDF, CISA ICSA-26-174-06
14.27 Recommended Firewall Rules for CP1584 (AR 4.93)
Control Network Firewall Rules for B&R CP1584:
INBOUND:
Allow TCP 11169 from [Engineering subnet] — ANSL (Automation Studio online)
Allow TCP 4840 from [SCADA/HMI subnet] — OPC-UA (if used)
Allow UDP 123 from [NTP server] — NTP time sync
Allow TCP 80/443 from [Maintenance subnet] — SDM (restrict to maintenance windows only)
Block TCP 21 from ALL — FTP (insecure, use only for emergency backup)
Block TCP 5900 from ALL — VNC (update VC4 first if needed)
Block ALL from [Office/Guest networks] — No PLC access from non-control networks
OUTBOUND:
Allow UDP 123 to [NTP server] — NTP time sync
Allow TCP 11160 to [PVI Manager IP] — PVI callbacks
Block ALL other outbound — PLC should not initiate external connections
The CP1584 cannot be fully patched against all known vulnerabilities. The best achievable security posture is AR R4.93 (latest AR 4.x) with updated VC4, combined with strict network isolation, firewall rules above, and disabling all unnecessary services. See access-recovery.md for security implications, network-architecture.md for network isolation guidance, and diagnostics-sdm.md for SDM-specific mitigations.
Appendix A: Source URLs
| Source | URL |
|---|---|
| B&R Community: “The OS behind AR” | https://community.br-automation.com/t/the-os-behind-ar/3303 |
| B&R Automation Runtime Product Page | https://www.br-automation.com/en-us/products/software/automation-runtime/ |
| B&R Cyber Security Advisory #01/2019 (VxWorks) | https://www.br-automation.com/fileadmin/2019_01_VxWorks_IPnet_Vulnerabilities_en-ffaeca09.pdf |
| B&R exOS Press Release | https://www.br-automation.com/en/about-us/press-room/new-freedom-through-it-ot-integration-09-12-2020/ |
| B&R Community: “Idle task class and TcIdleFiller” | https://community.br-automation.com/t/idle-task-class-and-tcidlefiller/1451 |
| TM213 Training Manual (Automation Runtime V4.1) | https://www.scribd.com/document/916397506/TM213TRE-40-EnG-Automation-Runtime-V4100-B-R-Acopos |
| B&R Community: “Troubleshooting Page Faults” | https://community.br-automation.com/t/troubleshooting-page-faults/494 |
| B&R Community: “CPU usage FUB” | https://community.br-automation.com/t/is-there-a-fub-or-i-o-datapoint-to-read-the-cpu-usage/2825 |
| B&R Community: “Multicore Processing in AS6” | https://community.br-automation.com/t/innovation-2025-multicore-processing-in-automation-software-6/8477 |
| B&R Community: “Service Mode” | https://community.br-automation.com/t/service-mode-what-is-it-and-how-to-collect-diagnostics/1613 |
| B&R Community: “Hardware Interrupt” | https://community.br-automation.com/t/hardware-interrupt-equivalent-or-alternative-function/4743 |
| B&R Community: “NvFlushHandler CPU load” | https://community.br-automation.com/t/cpu-loading-is-increased-by-10-in-c80-controller-due-to-system-tasks-nvflushhandler-and-sataxbdreqsvc/7696 |
| B&R Community: “Page Fault during startup” | https://community.br-automation.com/t/intermittent-exception-page-fault-during-startup-mvloader-mvrpctxtfmt-threads/10157 |
| B&R Community: “System Dump” | https://community.br-automation.com/t/how-to-collect-a-system-dump-from-a-b-r-controller/10497 |
| B&R Community: “Access to logging” | https://community.br-automation.com/t/access-to-logging-in-plc/3243 |
| B&R Community: “Memory relocation” | https://community.br-automation.com/t/value-applied-from-references/7017 |
| B&R Community: “Two Operating Systems” | https://www.br-automation.com/en/about-us/customer-magazine/2018/20189/two-operating-systems-on-one-device/ |
| B&R X20CP1584 Product Page | https://www.br-automation.com/en-us/products/plc-systems/x20-system-coated/x20-plc/x20ccp1584/ |
| B&R NAME-WRECK Security Notice | https://www.br-automation.com/fileadmin/2021-03-Security-Notice-NAME-WRECK-f442adc5.pdf |
| B&R SA24P011 (Multiple Vulnerabilities) | https://www.br-automation.com/fileadmin/SA24P011-d8aaf02f.pdf |
| B&R SA25P002 — CVE-2025-3450 (SDM DoS) | https://www.br-automation.com/fileadmin/SA25P002-f6a69e61.pdf |
| B&R SA25P004 — CVE-2025-11043 (AS Certificate Validation) | https://www.br-automation.com/fileadmin/SA25P004-4f45197f.pdf |
| B&R SA25P005 — CVE-2025-11044 (ANSL Server DoS) | https://www.br-automation.com/fileadmin/SA25P005-26597bd0.pdf |
| CISA ICSA-26-125-03 (CVE-2025-11044) | https://www.cisa.gov/news-events/ics-advisories/icsa-26-125-03 |
| OpenCVE B&R Vulnerability Database | https://app.opencve.io/cve/?vendor=br-automation |
| Armis URGENT/11 Research | https://www.armis.com/research/urgent-11/ |
| B&R Diagnostics Product Page | https://www.br-automation.com/en-us/products/software/additional-information/diagnostics/ |
| B&R Programming Training (IRQ) | https://www.infoplc.net/files/descargas/b_r/infoplc_net_br_leccion_2_basic_programing.pdf |
| awesome-B&R (GitHub) | https://github.com/hilch/awesome-B-R |
| B&R SA25P003 — CVE-2025-3449/3448/11498 (SDM XSS/Session/CSV) | https://www.cisa.gov/news-events/ics-advisories/icsa-26-141-04 |
| B&R SA26P001 — CVE-2026-0936 (PVI Logfile Credential Leak) | https://br-cws-assets.de-fra-1.linodeobjects.com/SA26P001-2862434c.pdf |
| B&R SA25P004 — CVE-2025-11043 (AS Certificate Validation) | https://br-cws-assets.de-fra-1.linodeobjects.com/SA25P004-4f45197f.pdf |
| B&R SA25P005 — CVE-2025-11044 (ANSL Server DoS) | https://br-cws-assets.de-fra-1.linodeobjects.com/SA25P005-26597bd0.pdf |
| B&R SA25P006 — CVE-2025-11482 (PPT30 OPC-UA DoS) | https://br-cws-assets.de-fra-1.linodeobjects.com/SA25P006-0eec719c.pdf |
| B&R SA26P009 — XZ Utils Impact on B&R Products | https://br-cws-assets.de-fra-1.linodeobjects.com/SA26P009-b2b4dd6d.pdf |
| B&R SA26P010 — Linux Kernel Impact on B&R Products | https://br-cws-assets.de-fra-1.linodeobjects.com/SA26P010-0ea64434.pdf |
| B&R SA26P011 — APROL R 4.4-01P5 Security Fixes | https://br-cws-assets.de-fra-1.linodeobjects.com/SA26P011-661853b7.pdf |
| B&R Cyber Security Advisories Index | https://www.br-automation.com/en-us/service/cyber-security/cyber-security-advisories-and-notices/ |
| B&R Lifecycle Policy | https://www.br-automation.com/en/about-us/br-lifecycle/ |
| B&R X20 20th Anniversary Press Release | https://www.br-automation.com/en/about-us/press-room/twenty-years-and-still-going-strong/ |
Cross-References
- firmware.md – firmware architecture and update mechanisms
- execution-model.md – IEC 61131-3 task scheduling on AR, exception handling, cycle time violations
- memory-map.md – CPU memory layout and address space
- cf-card-boot.md – CF card boot sequence and file loading
- ebpf-telemetry.md – eBPF/perf monitoring approaches for AR
- system-variables.md – AR system variables and RTInfo
- diagnostics-sdm.md – SDM for OS-level diagnostics
- custom-diagnostic-tools.md – C/C++ diagnostic programs on AR
- program-reverse-engineering.md – AR binary format analysis
- bootloader-recovery.md – recovery procedures for AR systems
- cp1584-hardware-ref.md – CPU hardware specs, LED diagnostics, overtemperature thresholds
- io-card-hardware.md – IO module hardware architecture and I/O processor interaction
- network-architecture.md – Network stack architecture for ANSL/POWERLINK/Ethernet
- cybersecurity-hardening.md – AR security vulnerabilities, CVE catalog, hardening procedures
- pvi-api.md – PVI protocol running as an AR system task (ANSL server)
- online-changes.md – How online code changes work at the OS level, page fault risks
- acopos-drives.md – ACOPOS drive communication as POWERLINK system task
- hardware-monitoring.md – CPU temperature and hardware health monitoring at OS level
- python-diagnostics.md – External monitoring of AR runtime behavior via Python/PVI/OPC-UA
Key Findings
- Automation Runtime is confirmed VxWorks-based — B&R employees confirmed this on the community forum, and security advisories reference VxWorks vulnerabilities. Understanding VxWorks behavior helps explain AR’s characteristics.
- No user-defined ISRs exist in AR — deterministic timing is maintained by excluding user interrupt handlers. Use IRQ task classes for hardware events instead.
- All user tasks share a flat address space — no memory protection between tasks. A pointer error in one task can corrupt another task’s data. The
IecCheck/AdvIecChklibraries provide runtime bounds checking for debugging. - The TcIdleFiller mechanism can cause SDM to report artificially high CPU usage — idle time at the end of a task class cycle is filled with no-ops counted as CPU time, not actual idle.
- Page faults (error 25314) are the most common runtime crash — caused by null pointers, array bounds violations, or memory relocation during online transfers. The backtrace feature in the Logger is the primary diagnostic tool.
- exOS allows Linux to run alongside AR on multi-core controllers (not applicable to single-core CP1584, but relevant for migration planning to newer hardware).
- System tasks (networking, file I/O, SDM, OPC-UA) run at priorities 4-190, always below cyclic tasks (190-230). Heavy system task load can delay network responses but cannot affect real-time cyclic execution.
B&R CPU Memory Map and Direct Memory Access — Comprehensive Technical Reference
Scope: X20/X67 systems, CP1584/CP1484 series, Automation Studio (AS4.x through AS6.x), Automation Runtime (AR), IEC 61131-3 on B&R, and direct/pointer-based IO access patterns.
Last updated: July 2026
Table of Contents
- Overview of B&R Memory Architecture
- IO Data Mapping in the PLC Address Space
- Software Addressing vs Hardware Addressing
- IEC 61131-3 Direct Addressing Prefixes on B&R
- How IO Modules Are Mapped to Address Ranges Automatically
- Memory Regions: IO Image, System Variables, User Program, Retentive Data
- Direct Memory Access via ADR(), ACCESS, and brsmemcpy
- AT / Overlay Mechanisms in IEC 61131-3 on B&R
- Memory Addressing for Digital IO, Analog IO, and Special Function Modules
- Accessing IO Data When Normal IO Access Is Unreliable
- Direct Memory Access via Automation Studio — mapp and System Functions
- Memory Mapping Differences: CP1584 vs X20/X67 Systems
- Memory Layout of a Typical B&R CP1584 (SRAM, Flash, IO Space)
- Diagnostic Use of Direct Memory Access
- Sources and References
1. Overview of B&R Memory Architecture
B&R Automation controllers (Power Panel, X20 CPUs, X67 CPUs, APC industrial PCs) are built on PC-based architectures using Intel-compatible processors (Atom, Celeron, Core i-series). The memory model differs significantly from traditional PLCs in that it combines a flat PC memory space with an IEC 61131-3 compliant IO addressing layer on top.
1.1 Memory Hierarchy
+-------------------------------------------------------+
| CompactFlash / Flash (Application) | — User application code, HMI, configuration
| (Removable, non-volatile) |
+-------------------------------------------------------+
| System Flash (Internal) | — Automation Runtime firmware, boot loader
| (Non-removable, non-volatile) |
+-------------------------------------------------------+
| SRAM — User RAM (1 MB typical) | — Retentive variables, fast data area
| (Battery-backed) |
+-------------------------------------------------------+
| DDR SDRAM — System RAM | — OS, runtime, task memory, heap
| (128–512 MB typical for X20CP15xx) |
+-------------------------------------------------------+
| IO Image / IO Data Space | — Mapped IO from X2X Link / POWERLINK bus
| (Dedicated background I/O processor) |
+-------------------------------------------------------+
1.2 Key Architectural Principles
- Integrated I/O Processor: X20 CPUs have a dedicated I/O processor that handles I/O data points in the background, independent of the main CPU cycle. This means IO data is continuously refreshed regardless of task execution timing.
- Flat Memory Model: Underlying x86 architecture provides a flat 32-bit (or 64-bit on newer models) address space. The IEC 61131-3 addressing layer provides a structured abstraction over this flat space.
- Battery-Backed Retentive Memory: A lithium battery (CR2477N, 3V/950mAh) backs retentive variables, User RAM, System RAM, and the real-time clock. Battery life: minimum 2 years at 23°C, replacement recommended every 4 years.
- CompactFlash for Application Storage: The application (compiled code, configuration, HMI pages) is stored on a removable CompactFlash card in a dedicated slot.
Source: X20(c)CP158x and X20(c)CP358x Data Sheet
2. IO Data Mapping in the PLC Address Space
2.1 The IO Image Concept
B&R controllers maintain an IO Image — a memory area that mirrors the current state of all physical I/O points. The IO image is divided into:
- Input Image: Contains the latest values read from all input modules
- Output Image: Contains the values to be written to all output modules
The dedicated I/O processor continuously updates the input image from field hardware and transfers output image values to field hardware, independently from the PLC task cycle.
2.2 How IO Data Flows
Physical Input → X2X Link / POWERLINK Bus → IO Image (Input Side) → User Program
User Program → IO Image (Output Side) → X2X Link / POWERLINK Bus → Physical Output
During each task cycle, the user program reads from the input image and writes to the output image. The actual physical I/O is handled asynchronously by the I/O processor.
2.3 IO Mapping File: IoMap.iom
In Automation Studio, IO mapping is managed through the IoMap.iom file. This file maps hardware
I/O channels to software variables using the AT directive and IEC addressing syntax:
VAR_CONFIG
gBatterie AT %IB."PLC1".BatteryStatusCPU;
MODUL1 AT %IX."X20CS1012_3003A1".ModuleOk;
MODUL2 AT %IX."X20DI9371_3003DI01".ModuleOk;
MODUL3 AT %IX."X20DI9371_3003DI02".ModuleOk;
::MODUL13 AT %IX."X20DO9322_3003DO01".ModuleOk;
::MODUL14 AT %IX."X20AI4622_3003AI01".ModuleOk;
END_VAR
The :: prefix is a visibility/scope qualifier for application module variables. Variables in
application modules require the :: prefix with the application module name.
Source: B&R Community — Use of “::” in IoMap.iom
3. Software Addressing vs Hardware Addressing
3.1 Two Addressing Paradigms
B&R Automation Studio supports two distinct addressing paradigms:
Software Addressing (Symbolic / Variable-Based)
- Variables are declared in
.varfiles with meaningful names - The compiler assigns physical addresses automatically
- IO is linked to variables through the IoMap.iom configuration
- Preferred for readability, maintainability, and portability
- Example:
LimitSwitch1 AT %IX.0.0— the variableLimitSwitch1is mapped to hardware address
Hardware Addressing (Direct / Absolute)
- Variables are declared with explicit IEC 61131-3 addresses directly in code
- The programmer specifies exact addresses (
%IX0.0,%QW2.5,%MD100) - Useful for low-level debugging, diagnostic access, and porting legacy code
- Less portable — address may change if hardware configuration changes
3.2 When to Use Which
| Scenario | Software Addressing | Hardware Addressing |
|---|---|---|
| Normal application programming | Yes | No |
| Porting from other IEC platforms | No | Yes |
| Diagnostic/debug reads | No | Yes |
| Memory-mapped register access | No | Yes |
| Generic software modules (reusable) | Yes | No |
| Legacy B&R 2000/2003 code | No | Yes |
3.3 B&R-Specific Extensions
B&R extends standard IEC 61131-3 addressing with:
- Module-qualified addressing:
%IX."X20DI9371_3003DI01".Channel1— directly addresses a specific channel of a specific hardware module by its B&R hardware name - CPU data points:
%IB."PLC1".BatteryStatusCPU— addresses CPU-internal diagnostic data - General data points: System-wide data such as time and temperature, accessible from any module in the station
4. IEC 61131-3 Direct Addressing Prefixes on B&R
4.1 Prefix Notation
The IEC 61131-3 standard defines a prefix notation for direct variable addressing. B&R implements this as follows:
| Prefix | Meaning | Data Type | Size | Example |
|---|---|---|---|---|
%IX | Input bit | BOOL | 1 bit | %IX0.0 |
%IY | Input byte (legacy) | BYTE/USINT | 8 bits | %IY0 |
%IB | Input byte | BYTE/USINT | 8 bits | %IB0 |
%IW | Input word | WORD/UINT | 16 bits | %IW0 |
%ID | Input double word | DWORD/UDINT | 32 bits | %ID0 |
%QX | Output bit | BOOL | 1 bit | %QX0.0 |
%QB | Output byte | BYTE/USINT | 8 bits | %QB0 |
%QW | Output word | WORD/UINT | 16 bits | %QW0 |
%QD | Output double word | DWORD/UDINT | 32 bits | %QD0 |
%MX | Memory bit | BOOL | 1 bit | %MX0.0 |
%MB | Memory byte | BYTE/USINT | 8 bits | %MB0 |
%MW | Memory word | WORD/UINT | 16 bits | %MW0 |
%MD | Memory double word | DWORD/UDINT | 32 bits | %MD0 |
4.2 Address Structure
The general format is: %<prefix><byte_offset>.<bit_offset>
- Byte offset: Address in bytes from the start of the respective IO area
- Bit offset: Bit number within the byte (0-7), used only with
Xsuffix (bit-level)
Examples:
// Digital input — first station, first module, channel 0
LimitSwitch AT %IX0.0 : BOOL;
// Analog input — word at byte offset 4 (covers channels 2-3 of a 16-bit module)
Temperature AT %IW4 : INT;
// Digital output — byte 0, bit 3
Valve1 AT %QX0.3 : BOOL;
// Memory word for internal calculations
Counter AT %MW100 : UINT;
// Input double word for a 32-bit encoder value
Encoder AT %ID8 : DINT;
4.3 Automatic Address Assignment
When B&R hardware modules are inserted into the physical configuration in Automation Studio, addresses are assigned automatically starting from:
%IX0.0/%IW0for inputs%QX0.0/%QW0for outputs
The system allocates address space sequentially based on:
- Station order in the X2X Link chain
- Slot position within the station (left to right)
- Module type and channel count (digital modules use bit addressing, analog modules use word addressing)
Users can override automatic addresses manually in the hardware configuration if needed.
Source: Industrial Monitor Direct — B&R Hardware Guide
5. How IO Modules Are Mapped to Address Ranges Automatically
5.1 X2X Link Address Allocation
B&R’s X2X Link is the local bus connecting I/O modules to the CPU (or bus controller). When you configure hardware in Automation Studio’s Physical View, the system:
- Detects module types: Each module’s hardware catalog entry specifies how many bytes of I/O data it requires
- Allocates address ranges sequentially: Starting from offset 0, each module consumes its required number of bytes
- Creates the IoMap.iom entries: Software variable mapping is generated based on the hardware configuration
5.2 Address Allocation Example
Station: X20CS1012 (Bus Controller, slot 0)
├── X20DI9371 (12ch Digital Input) → %IX0.0 through %IX1.3 (12 bits = 2 bytes)
├── X20DO9322 (8ch Digital Output) → %QX0.0 through %QX0.7 (8 bits = 1 byte)
├── X20AT4222 (4ch Analog Input) → %IW2.0 through %IW9.0 (4 × 16-bit = 8 bytes)
└── X20AI4622 (4ch Analog Input) → %IW10.0 through %IW17.0 (4 × 16-bit = 8 bytes)
5.3 POWERLINK Remote Station Mapping
For remote stations connected via POWERLINK (V1/V2), the MN (Managing Node) allocates PDO (Process Data Object) mapping. The IO data from remote stations appears in the IO image at addresses determined by the POWERLINK configuration. The mapping is defined in the Automation Studio POWERLINK configuration and is reflected in the IoMap.iom.
5.4 Module-Qualified Addressing
B&R provides an alternative addressing mode that uses the hardware module name directly:
// Instead of %IX0.0, reference the specific module and channel by name:
ChannelValue AT %IX."X20DI9371_3003DI01".Channel1;
ModuleOk AT %IX."X20DI9371_3003DI01".ModuleOk;
This is hardware-address-relative but not position-dependent — if you move the module to a different slot, the address remains valid because it references the module identity, not the byte offset. This is a B&R extension to IEC 61131-3.
6. Memory Regions: IO Image, System Variables, User Program, Retentive Data
6.1 Memory Region Overview
| Memory Region | Volatility | Backed By | Purpose |
|---|---|---|---|
| IO Image (Input) | Volatile (refreshed each bus cycle) | X2X Link / POWERLINK | Current input states |
| IO Image (Output) | Volatile (written each bus cycle) | X2X Link / POWERLINK | Pending output states |
| System RAM | Battery-backed | DDR SDRAM + battery | OS, runtime system, task memory |
| User RAM (SRAM) | Battery-backed | 1 MB SRAM + battery | Fast user data, non-remanent vars |
| Retentive / Remanent Memory | Battery-backed | SRAM portion | Variables declared with RETAIN |
| Persistent / Permanent Memory | Non-volatile | Flash file system | Variables declared with PERSISTENT |
| System Flash | Non-volatile | Internal flash | Automation Runtime firmware, bootloader |
| CompactFlash | Non-volatile | Removable CF card | Application code, HMI, configuration |
| User Flash | Non-volatile | Onboard flash (if available) | Stored user data |
6.2 Variable Storage Classes
B&R Automation Studio supports several variable storage classes:
6.2.1 Non-Retain (Default)
VAR
MyCounter : UINT; // Lost on warm/cold restart
MyFlag : BOOL; // Lost on warm/cold restart
END_VAR
Stored in User RAM (SRAM). Initialized on every program start.
6.2.2 Retain (VAR RETAIN)
VAR RETAIN
AccumulatedTime : UDINT; // Survives warm restart, battery-backed
LastSetpoint : REAL; // Survives warm restart, battery-backed
END_VAR
Stored in the remanent memory area (a dedicated portion of the 1 MB SRAM).
Critical behavior: If any variable in a function block is marked RETAIN, the entire
instance of that function block is stored in the remanent memory area. Non-retained variables
within that instance are also placed in remanent memory but are re-initialized according to their
declaration. This can significantly increase remanent memory usage.
Example:
FB instance has 96 bytes total, but only 8 bytes are RETAIN (2x UDINT)
→ Entire 96 bytes allocated in remanent memory area
→ Only the 8 RETAIN bytes preserve their value across restart
Source: B&R Community — Retain Tag and Remanent Memory Usage
6.2.3 Persistent (VAR PERSISTENT)
VAR PERSISTENT
CalibrationData : REAL;
SerialNumber : STRING[32];
END_VAR
Stored in non-volatile flash memory (file system on CompactFlash). Survives both warm and cold restarts, including complete power loss (no battery required). However, flash has limited write cycles, so frequent writes to PERSISTENT variables should be avoided.
6.2.4 Configurable Remanent Memory Size
On X20CP1584:
- Maximum remanent memory: 256 kB (configurable in Automation Studio)
- Available SRAM: 1 MB total, of which
1 MB - configured remanent sizeis available for non-remanent user data
On X20CP1586:
- Maximum remanent memory: 1 MB
The remanent memory size is configurable in Automation Studio under the CPU configuration properties.
6.3 What the Battery Backs Up
- Remanent variables (VAR RETAIN)
- User RAM
- System RAM
- Real-time clock
Source: X20(c)CP158x Data Sheet — Battery Section
7. Direct Memory Access via ADR(), ACCESS, and brsmemcpy
7.1 The ADR() Operator
The ADR() operator returns the memory address (pointer) of a variable. On B&R, this returns
a 32-bit address (or 64-bit on 64-bit targets):
VAR
MyVar : UINT;
pMyVar : REFERENCE TO UINT;
MyArray : ARRAY[0..99] OF USINT;
ptrArray : UDINT;
END_VAR
// Get the address of a variable
ptrArray := ADR(MyArray);
// Use a typed reference
pMyVar REF= MyVar; // or: pMyVar ACCESS ADR(MyVar);
7.2 The ACCESS Keyword (Dynamic Variables)
B&R uses the ACCESS keyword to create a dynamic variable — a typed reference to a memory
location determined at runtime. This is B&R’s primary mechanism for overlaying a variable type onto
an arbitrary memory address:
// Dereference a pointer to write
CurrentValue ACCESS ADR(PointerArray[x]);
CurrentValue := TRUE;
// If the array already contains references, omit ADR()
CurrentValue ACCESS PointerArray[x];
CurrentValue := TRUE;
Source: B&R Community — How to dereference a pointer
7.3 ACCESS with INDEX for Array Overlay
The ACCESS keyword can be combined with INDEX to create dynamically indexed access to
arrays or structures at arbitrary memory offsets:
VAR
DataBuffer : ARRAY[0..255] OF BYTE;
pValue : REFERENCE TO UINT;
Offset : USINT;
END_VAR
// Access a UINT at a variable offset within the buffer
pValue ACCESS ADR(DataBuffer[0]) INDEX Offset;
pValue := 1234;
7.4 brsmemcpy() — Safe Memory Block Transfer
The brsmemcpy() function from the AsBrStr library is the recommended way to copy blocks of
memory (strings, arrays, structs) between arbitrary addresses:
// Copy a UINT into a byte array (little-endian on x86)
brsmemcpy(ADR(Data[0]), ADR(myUINT), SIZEOF(myUINT));
// Copy back
brsmemcpy(ADR(myUINT), ADR(Data[0]), SIZEOF(myUINT));
brsmemcpy() is preferred over brsstrcpy() for memory operations because it requires an
explicit length parameter, preventing buffer overflows.
Important: When using brsmemcpy() with string destinations, do not pass the start address
of the destination variable as the starting address if the destination is a string with a specific
maximum length. Use ADR(DestVar) with SIZEOF(DestVar) to prevent memory corruption.
Source: B&R Community — Working with large strings; B&R Community — Variable Addresses
7.5 Pointer Arithmetic Examples
Converting between byte arrays and larger data types:
VAR
Data : ARRAY[0..27] OF USINT;
pUINT : REFERENCE TO UINT;
myUINT : UINT;
END_VAR
// Method 1: Using ACCESS (pointer dereference)
pUINT ACCESS ADR(Data[0]);
pUINT := myUINT; // Write UINT to bytes 0-1
myUINT := pUINT; // Read UINT from bytes 0-1
// Method 2: Using brsmemcpy
brsmemcpy(ADR(Data[0]), ADR(myUINT), SIZEOF(myUINT)); // Write
brsmemcpy(ADR(myUINT), ADR(Data[0]), SIZEOF(myUINT)); // Read
// Method 3: Bit access within a word
myBOOL := myUINT.0; // Access bit 0 of the UINT
On x86 (little-endian), a UINT value of 258 (0x0102) is stored as:
Data[0]= 0x02 (low byte)Data[1]= 0x01 (high byte)
Source: B&R Community — Moving Bytes into Integers and back
7.6 Memory Access Violations
Common causes of memory access violations on B&R:
- Accessing a variable by its address after the memory has been moved (e.g., after task initialization)
- Array overflow or string buffer overflow
- Pointer pointing to invalid/freed memory
ADR()used with wrong data type alignment
Mitigation:
- Deploy the
IecChecklibrary during debugging to detect overflow errors (remove before production!) - Use
ACCESSin the CYCLIC task, not in INIT, to avoid access violations from moved memory - Prefer
brsmemcpy()over pointer manipulation for bulk transfers
Source: B&R Community — Value applied from references
8. AT / Overlay Mechanisms in IEC 61131-3 on B&R
8.1 The AT Directive
The AT directive is the standard IEC 61131-3 mechanism for mapping a variable to a specific
memory address. B&R fully implements this:
// Map a BOOL to a specific input bit
LimitSwitch AT %IX0.0 : BOOL;
// Map a UINT to a specific input word
AnalogValue AT %IW4 : UINT;
// Map a variable to a specific memory word
Counter AT %MW100 : UDINT;
// Map a variable to a memory byte (overlay)
StatusByte AT %MB50 : BYTE;
// Overlay multiple variables on the same memory location
MultiAccess1 AT %MW200 : UINT;
MultiAccess2 AT %MW200 : ARRAY[0..1] OF USINT; // Same address, different view
8.2 Union-Like Overlay via AT
B&R supports overlaying multiple variables on the same memory address, effectively creating union-like behavior:
VAR
RawValue AT %MW10 : WORD;
LowByte AT %MB10 : USINT; // Same memory, low byte
HighByte AT %MB11 : USINT; // Same memory, high byte
Bit0 AT %MX10.0 : BOOL; // Same memory, bit 0
Bit1 AT %MX10.1 : BOOL; // Same memory, bit 1
END_VAR
8.3 AT with Hardware-Module-Qualified Addresses
VAR
// Map to specific module channel
DI_Ch1 AT %IX."X20DI9371_3003DI01".Channel1 : BOOL;
DI_Ch2 AT %IX."X20DI9371_3003DI01".Channel2 : BOOL;
// Map to module status
ModuleStatus AT %IX."X20DI9371_3003DI01".ModuleOk : BOOL;
// Map to CPU diagnostic data
BatteryStatus AT %IB."PLC1".BatteryStatusCPU : BOOL;
END_VAR
8.4 AT in IoMap.iom vs AT in Variable Declarations
| Location | Usage | Scope |
|---|---|---|
.var files (VAR_CONFIG / AT in declarations) | Permanent variable-to-IO mapping | Build-time, compiled |
IoMap.iom (VAR_CONFIG block) | IO mapping configuration | Build-time, compiled |
Runtime ACCESS | Dynamic, runtime-determined mapping | Runtime, pointer-based |
The IoMap.iom approach is the standard way to map IO in Automation Studio — it provides a GUI
for point-and-click mapping and separates IO configuration from code logic.
9. Memory Addressing for Digital IO, Analog IO, and Special Function Modules
9.1 Digital IO (X20DI93xx / X20DO93xx)
Digital modules use bit-level addressing (%IX / %QX):
// 12-channel digital input module
DI_1 AT %IX0.0 : BOOL;
DI_2 AT %IX0.1 : BOOL;
...
DI_12 AT %IX1.3 : BOOL;
// 8-channel digital output module
DO_1 AT %QX0.0 : BOOL;
DO_2 AT %QX0.1 : BOOL;
...
DO_8 AT %QX0.7 : BOOL;
Module-specific diagnostic channels:
ModuleOk AT %IX."X20DI9371_3003DI01".ModuleOk : BOOL; // Module status
9.2 Analog IO (X20AT42xx / X20AI46xx / X20AO46xx)
Analog modules use word-level addressing (%IW / %QW). Each analog channel typically
occupies 2 bytes (16 bits) or 4 bytes (32 bits for high-resolution modules):
// 4-channel analog input module (16-bit per channel)
AI_Ch1 AT %IW0 : INT; // Channel 1 (bytes 0-1)
AI_Ch2 AT %IW2 : INT; // Channel 2 (bytes 2-3)
AI_Ch3 AT %IW4 : INT; // Channel 3 (bytes 4-5)
AI_Ch4 AT %IW6 : INT; // Channel 4 (bytes 6-7)
// 4-channel analog output module
AO_Ch1 AT %QW0 : INT;
AO_Ch2 AT %QW2 : INT;
AO_Ch3 AT %QW4 : INT;
AO_Ch4 AT %QW6 : INT;
For analog temperature modules (e.g., X20AT4232), the module handles ADC conversion internally and provides scaled values in the IO image.
9.3 Special Function Modules
Special modules (communication gateways, encoder interfaces, IO-Link masters, etc.) typically provide larger data structures in the IO image:
- X20IF10xx (Interface Modules): Provide data areas for protocol-specific communication. Data sizes depend on the protocol and configuration.
- X20CS1010 (Encoder Interface): Encoder values are mapped as double words (
%ID) in the IO image. - X20IF1043 (CAN Interface): CAN receive/transmit data mapped via IoMap to variables. Users assign variables to the IO mapping of the interface module.
- IO-Link Masters: IO-Link data is typically mapped as byte arrays in the IO image.
Boolean process data within IO-Link devices can be mapped to
%IX/%QXaddresses.
Source: B&R Community — X20IF1043 IO Mapping
10. Accessing IO Data When Normal IO Access Is Unreliable
10.1 Scenarios Requiring Direct IO Access
Normal IO access through mapped variables may become unreliable in these situations:
- The IO image is corrupted or not properly initialized
- A module has lost communication but the bus is still running
- During diagnostic mode (DIAG switch position)
- When the IO mapping configuration is incorrect or outdated
- When investigating sporadic IO glitches that don’t manifest in the mapped variables
10.2 Diagnostic Mode Access
The X20 CPU has a DIAG operating mode switch position. In this mode:
- Program sections in User RAM and User Flash are not initialized
- The CPU boots in diagnostic mode
- After diagnostic mode, the CPU always performs a warm restart
- IO image data is accessible for diagnostic inspection
This allows maintenance personnel to read IO states without the user program affecting outputs.
10.3 Direct Memory Access via Watch/Trace
In Automation Studio, with the debugger halted on a breakpoint and the Watch window open:
- Pointers can be dereferenced to inspect memory content at arbitrary addresses
- In AS4, use the debugger watch with pointer dereferencing
- In AS6.3+, a function is available that reveals a variable name given its address
Source: B&R Community — Watching memory content with AS
10.4 Bypassing IO Mapping with Direct Addresses
When IO mapping is unreliable, you can read IO directly by using absolute addresses in your code:
VAR
DirectInput : BOOL;
DirectAnalog : INT;
END_VAR
// Direct read from IO image — bypassing IoMap mapping
DirectInput := %IX0.5; // Read digital input directly
DirectAnalog := %IW10; // Read analog input directly
// Direct write to IO image
%QX2.3 := TRUE; // Write digital output directly
%QW20 := 32768; // Write analog output directly
10.5 PVI (Process Visualization Interface) External Access
The B&R PVI system allows external applications (C#, Python, etc.) to read and write PLC variables — including IO data — via:
- PVI Services (COM/ActiveX)
- PVI .NET
- PVIservices REST API (newer systems)
This provides an external path to IO data that bypasses the PLC program entirely, useful for:
- Automated testing (e.g., reading/writing IO from external tools)
- SCADA/HMI systems
- Data logging
Source: B&R Community — Automated IO Access from External Tools
11. Direct Memory Access via Automation Studio — mapp and System Functions
11.1 System Libraries for Memory Access
B&R provides several system libraries for direct memory operations:
| Library | Key Functions | Purpose |
|---|---|---|
AsBrStr | brsmemcpy(), brsstrcpy(), brsmemset() | Memory block transfer and string operations |
AsMem | Memory utility functions | Memory allocation, deallocation |
SysMem | System memory access | System-level memory operations |
IecCheck | Boundary checking | Debug library for detecting memory violations |
SysFile | File I/O | Read/write files on CompactFlash |
11.2 mapp Technology
B&R’s mapp (modular application) technology provides pre-engineered software components:
- mapp Control: PID controllers and signal processing
- mapp Motion: Motion control functions
- mamp View: Web-based HMI
- mapp AlarmX: Alarm management
- mapp Recipe: Recipe management
- mapp Database: Data logging to SQLite
mapp components internally manage their own memory regions and IO mappings. Access to mapp internal data is provided through standardized FB interfaces, not direct memory access.
11.3 System Functions for Diagnostic Data
BatteryInfo:
BatteryInfo(stBatteryInfo);
// stBatteryInfo contains battery status from CPU diagnostics
CPU IO Mapping Diagnostic Data: CPU status registers (battery, temperature, module errors) are accessible through:
- The CPU’s IO mapping (available in IoMap.iom)
- Software registers (accessible via
%IB."PLC1".*addresses)
11.4 General Data Points
X20 CPUs provide general data points that are not CPU-specific:
- System time
- Heat sink temperature
- Other general system information
These are accessible from any module in the station and are described in the X20 system user’s manual under “Additional information — General data points”.
Source: X20(c)CP158x Data Sheet — General Data Points
12. Memory Mapping Differences: CP1584 vs X20/X67 Systems
12.1 System Comparison
| Feature | X20CP1584 | X20CP1585 | X20CP1586 | X20CP1484 | X67 CPUs |
|---|---|---|---|---|---|
| Processor | Atom E640T 0.6 GHz | Atom E680T 1.0 GHz | Atom E680T 1.6 GHz | Celeron 266 MHz | Varies (ARM/x86) |
| DDR RAM | 256 MB DDR2 | 256 MB DDR2 | 512 MB DDR2 | 32 MB DRAM | Varies |
| User SRAM | 1 MB | 1 MB | 1 MB | 1 MB | Varies |
| Max Remanent | 256 kB | 256 kB | 1 MB | Varies | Varies |
| Interface Slots | 1 | 1 | 1 | 1 | Varies |
| POWERLINK | V1/V2 (MN/CN) | V1/V2 (MN/CN) | V1/V2 (MN/CN) | V1/V2 | V1/V2 |
| Ethernet | 10/100/1000 | 10/100/1000 | 10/100/1000 | 10/100 | Varies |
| Min Cycle Time | 400 µs | 200 µs | 100 µs | 2 ms | Varies |
| USB | 2x USB 1.1/2.0 | 2x USB 1.1/2.0 | 2x USB 1.1/2.0 | 2x USB | Varies |
| Redundancy | No | No | No | No | Varies |
12.2 X20 vs X67 Differences
- X20: Modular system with DIN-rail mounting, separate bus controller and I/O modules, supports both local (X2X Link) and remote (POWERLINK) I/O
- X67: IP67-rated, field-mountable I/O system. Similar addressing model to X20 but designed for harsh environments with M12 connectors
Both X20 and X67 share the same IO addressing model and Automation Studio configuration approach.
The IO mapping is identical in terms of %IX, %QX, %IW, %QW notation.
12.3 Power Panel / APC Differences
B&R Power Panel targets (PP100, PP200, etc.) and APC industrial PCs run the same Automation Runtime but may have:
- Larger DDR RAM (up to several GB)
- Solid-state drives instead of CompactFlash
- Additional PCIe slots for specialized interface cards
- Different IO connection methods (e.g., direct onboard IO vs X2X bus)
The IO addressing model remains the same, but the physical connection to IO hardware differs.
12.4 CP358x vs CP158x
The CP358x series (e.g., X20CP3584, X20CP3586) differs from CP158x primarily in:
- 3 interface module slots (vs 1 on CP158x)
- CPU redundancy support (CP3586 supports controller redundancy)
- Same processor options, same SRAM, same IO addressing
Source: X20(c)CP158x and X20(c)CP358x Data Sheet
13. Memory Layout of a Typical B&R CP1584 (SRAM, Flash, IO Space)
13.1 Detailed Memory Map
=== X20CP1584 Memory Layout ===
0x00000000 ┌─────────────────────────────┐
│ System Flash (Internal) │ Automation Runtime firmware
│ (Size: varies) │ Boot loader
├─────────────────────────────┤
│ CompactFlash (Removable)│ Application code (.pc executable)
│ (512 MB – 16 GB) │ HMI pages
│ │ Configuration files
│ │ mapp data
├─────────────────────────────┤
0x???????? │ │
│ DDR2 SDRAM (256 MB) │ Automation Runtime OS
│ │ Task memory (Cyclic, Event, etc.)
│ │ Heap/Stack for C programs
│ │ mapp component memory
│ │ System buffers
├─────────────────────────────┤
│ │
│ SRAM — User Area │ Total: 1 MB
│ (Battery-backed) │
│ ┌───────────────────────┐ │
│ │ Remanent Memory │ │ Configurable, max 256 KB
│ │ (VAR RETAIN data) │ │ Battery-backed
│ │ │ │ Preserved across warm restart
│ ├───────────────────────┤ │
│ │ Non-Remanent User RAM │ │ 1 MB - remanent size
│ │ (VAR data) │ │ Battery-backed, but cleared on
│ │ │ │ cold restart if battery fails
│ └───────────────────────┘ │
├─────────────────────────────┤
│ IO Image / IO Space │ Managed by integrated I/O processor
│ ┌───────────────────────┐ │ Continuously updated in background
│ │ Input Image │ │ %IX*, %IW*, %IB*, %ID*
│ │ (Digital + Analog) │ │
│ ├───────────────────────┤ │
│ │ Output Image │ │ %QX*, %QW*, %QB*, %QD*
│ │ (Digital + Analog) │ │
│ ├───────────────────────┤ │
│ │ CPU Diagnostic Data │ │ Battery status, temperature,
│ │ │ │ module status, etc.
│ └───────────────────────┘ │
└─────────────────────────────┘
13.2 User Flash Data Area
For CPUs with onboard flash (not CP1584 specifically but common on newer models):
- Typically 512 kB of flash for user data
- Used for persistent storage of calibration data, recipes, etc.
- Accessible via
SysFilelibrary functions
13.3 Task Memory Organization
Within the DDR SDRAM, Automation Runtime allocates memory for each configured task:
Task Cyclic1 ──────────── Stack + Code + Variables
Task Cyclic2 ──────────── Stack + Code + Variables
Task Event ────────────── Stack + Code + Variables
...
System overhead ────────── OS kernel, drivers, buffers
13.4 Overtemperature Protection
- CPU shutdown at 110°C processor temperature or 95°C board temperature
- Logbook entries: Error 9204 (temperature restart), Error 9210 (halt after reset)
14. Diagnostic Use of Direct Memory Access
14.1 Common Diagnostic Patterns
Reading Module Status via IO Image
VAR
ModuleOk : BOOL;
END_VAR
ModuleOk := %IX."X20DI9371_3003DI01".ModuleOk;
// If FALSE, module is in error state
Reading CPU Diagnostic Registers
VAR
BatteryStatus : BOOL;
Temperature : INT; // From general data points
END_VAR
BatteryStatus := %IB."PLC1".BatteryStatusCPU;
// TRUE = battery OK, FALSE = battery empty/dead
Memory Inspection via ADR() + ACCESS
VAR
TargetAddress : UDINT;
ViewAsUINT : UINT;
END_VAR
// Given a memory address (from ADR() or other source), inspect contents
ViewAsUINT ACCESS TargetAddress;
// Watch ViewAsUINT in the watch window to see the memory contents
Using IecCheck for Runtime Bounds Checking
Deploy the IecCheck library to detect:
- Array boundary violations
- String overflow
- Memory access violations
- Stack corruption
Important: Remove IecCheck before deploying to production — it adds significant overhead.
14.2 Trace and Watch Tools
- Watch Window: Monitor live variable values when online. Supports override of output variables that are not driven by code. In AS4, dereference pointers with the debugger halted.
- Trace Window: Continuously record variable values with configurable sample rate. Maximum trace size is configurable. After stopping, zoom into the timeline to inspect values at each CPU scan.
- Logbook: System events (errors, warnings, temperature, battery) are automatically logged and can be accessed via the Automation Studio Logbook viewer.
14.3 Memory Access Violation Troubleshooting
Common diagnostics for “memory access violation” errors:
- Check ADR() targets: Ensure all ADR()-derived pointers point to valid, initialized memory
- Check task timing: ACCESS in INIT task may access memory before tasks are fully initialized
- Check array bounds: Use IecCheck to detect overflow
- Check string operations:
brsstrcpy()can corrupt adjacent memory if the destination is too small — preferbrsmemcpy()with explicit length - Check function block retain: If retain variables in an FB are corrupted, the entire FB instance may be affected due to the all-or-nothing remanent allocation
14.4 External Diagnostic Access
- PVIservices / PVI .NET: External applications can read PLC variables including IO data, useful for automated diagnostic scripts
- SNMP: Some B&R devices support SNMP for basic health monitoring
- OPC UA: Available on newer Automation Runtime versions for standardized data access
Cross-References
- x2x-protocol.md — X2X bus carries IO data that populates the IO image in memory
- io-card-hardware.md — IO module hardware; which modules map to which address ranges
- execution-model.md — How task classes interact with the IO image at configured cycle times
- network-architecture.md — POWERLINK remote station IO mapping
- retentive-data.md — Battery-backed SRAM and retentive variable memory management
- cp1584-hardware-ref.md — CP1584 memory specifications (256 MB DDR2, 1 MB SRAM, 256 KB retentive max)
- analog-calibration.md — Analog IO scaling and calibration using memory-mapped ADC/DAC values
- io-sniffing.md — Sniffing fieldbus traffic to correlate with IO image values
- safe-io-diagnostics.md — Safety IO memory mapping and SafeLOGIC address space
- online-changes.md — Memory integrity risks during online code changes (shifted addresses)
- cf-card-boot.md — How IO configuration is loaded from CF card into memory at boot
- config-file-formats.md — IO mapping configuration file formats on the CF card
- pvi-api.md — Using PVI to read/write IO memory addresses programmatically
15. Sources and References
Official B&R Documentation
- X20(c)CP158x and X20(c)CP358x Data Sheet — PDF
- X20 System User’s Manual — PDF (RS Online)
- B&R Automation Studio Product Page — br-automation.com
- B&R Online Help (Automation Help) — help.br-automation.com
- B&R mapp Technology — br-automation.com/mapp
B&R Community Forum Posts
- Variable Addresses after Compilation — community.br-automation.com/7920
- Watching Memory Content with AS (4.xx) — community.br-automation.com/7685
- How to Dereference a Pointer — community.br-automation.com/6740
- Moving Bytes into Integers and Back — community.br-automation.com/3075
- Retain Tag and Remanent Memory Usage — community.br-automation.com/4320
- Use of “::” in IoMap.iom — community.br-automation.com/2176
- Value Applied from References — community.br-automation.com/7017
- Retain Variable Reset to Zero — community.br-automation.com/8142
- Working with Large Strings — community.br-automation.com/5239
- How to Assign Variables to IO Mapping of X20IF1043 — community.br-automation.com/8116
- Automated Read/Write Access to ARSim Hardware I/O — community.br-automation.com/10409
Technical Articles and Guides
- Programming B&R PLCs with Automation Studio — control.com
- B&R PLC Hardware and Automation Studio Overview — industrialmonitordirect.com
- B&R Automation Studio: Program & Transfer to PLC Hardware Guide — industrialmonitordirect.com
Community Knowledge
- Reddit: B&R X20 Setup — reddit.com/r/PLC
- Reddit: B&R Use of Pointers — reddit.com/r/PLC
- Awesome B&R — Curated Resources — GitHub
Key Findings
-
B&R X20 CPUs use a dedicated I/O processor that refreshes the IO Image independently of the PLC task cycle. Input and output images are separate memory areas updated asynchronously from user program execution.
-
IO addresses are assigned automatically by Automation Studio starting from
%IX0.0/%IW0(inputs) and%QX0.0/%QW0(outputs), allocated sequentially based on station order in the X2X Link chain, slot position, and module channel count. Module-qualified addressing (e.g.,%IX."X20DI9371_3003DI01".Channel1) survives slot repositioning. -
The
AToverlay directive allows multiple variables to share the same memory address, creating union-like behavior: aWORDat%MW10can be simultaneously accessed asBYTEat%MB10/%MB11or individual bits at%MX10.0through%MX10.7. This is the primary mechanism for type-punning and bit-level IO access. -
Direct memory access uses
ADR()to get pointers,ACCESSfor type-safe dereferencing, andbrsmemcpy()(from theAsBrStrlibrary) for raw block copies. TheIECChecklibrary provides runtime bounds checking for pointer operations – critical for preventing page faults during online changes. -
Six variable storage classes exist: Non-Retain (lost on restart), Retain (battery-backed SRAM, survives warm restart), Remanent (like Retain but initialized on first cold boot), Persistent (Flash file system, survives cold restart), Persistent_Volatile (Persistent read but Non-Retain write), and Constant (compile-time). Maximum retentive data on CP1584 is 256 KB.
-
B&R extends IEC 61131-3 with CPU-qualified addressing (
%IB."PLC1".BatteryStatusCPU) for reading internal CPU diagnostics like battery status, temperature, and firmware version directly from the IO image without system function calls. -
For diagnostic access when IO mapping is unreliable, use absolute addressing (
%IX0.5,%IW10) in code, the DIAG switch position on the CPU (prevents program execution while keeping IO image accessible), or PVI/OPC-UA external access to bypass the PLC program entirely. -
The
IoMap.iomfile generated by Automation Studio maps hardware IO to software variables usingVAR_CONFIGblocks. The::prefix on variable names indicates application module scope. This file is the single source of truth for IO-to-variable mapping and must match the hardware configuration on the PLC.
Disclaimer: This document is compiled from publicly available sources including official B&R documentation, B&R community forum posts, technical articles, and community knowledge. For the most authoritative and up-to-date information, consult the official B&R Automation Help system at help.br-automation.com and the official data sheets available from br-automation.com.
B&R X20 IO Card Hardware Architecture — Technical Reference
Comprehensive hardware-level reference for B&R Automation X20 I/O modules covering signal conditioning, ADC/DAC paths, electrical isolation, filtering, diagnostics, and fault identification.
Table of Contents
- System Architecture Overview
- Signal Conditioning Circuits
- ADC/DAC Paths on Analog Modules
- Electrical Isolation
- Digital Input Filtering and Debounce
- LED Diagnostic Codes and Patterns
- Failure Modes and LED Indications
- B&R X20 IO Card Types and Model Numbers
- Thermocouple and RTD Input Handling
- 4-20mA vs 0-10V Input Considerations
- Output Types: Relay, Transistor, Analog
- Identifying Faulty IO Card vs Wiring vs Sensor
- IO Card Power Supply: Rails and Current Limits
- Diagnostic Features per Card Type
- Hot-Swap Capabilities
- Sources
1. System Architecture Overview
The B&R X20 system is a slice-based I/O and control system where individual I/O modules plug into a DIN rail alongside bus modules, power supply modules, and CPUs. Modules communicate via the proprietary X2X Link backplane — a daisy-chain real-time fieldbus that carries both data and power between adjacent slices on the rail.
Core Components
| Component | Function | Key Models |
|---|---|---|
| Bus Module | Backbone for bus supply, bus data, and I/O electronics power | X20BM01, X20BM05, X20BM11, X20BM15, X20BM31 |
| Power Supply Module | 24 VDC feed for X2X Link and internal I/O supply | X20PS2100, X20PS2110, X20PS3300, X20PS3310 |
| Terminal Block | Field wiring connection point (6-pin or 12-pin) | X20TB06, X20TB12 |
| I/O Module | Signal processing (digital, analog, temperature, special) | DI/DO/AI/AO/AT/CM/MM/DC series |
| Bus Controller / CPU | Fieldbus gateway (POWERLINK, EtherNet/IP, Modbus/TCP) | BC0087, BC0088, CP148x, CP348x |
| Bus Receiver/Transmitter | X2X segment bridging over distance | X20BR9300, X20BT9100 |
X2X Link Architecture
- Topology: Daisy-chain with terminator jumpers required on last node per segment
- Maximum segment length: 100 m
- Characteristic impedance: ~120 Ω (terminated)
- Communication: Deterministic cyclic data exchange synchronized to network cycle
- SyncOut offset: Digital outputs update with fixed offset (<60 µs) relative to network cycle
Mechanical Design
- Pitch: 12.5 mm +0.2 mm per slice
- Mounting: Standard 35 mm DIN rail with snap-lock mechanism
- IP Rating: IP20 (modules are cabinet-mounted)
- Keyed bus modules: Prevent incorrect module insertion
- Terminal blocks: Plug-on design — field wiring remains in place during module swap
2. Signal Conditioning Circuits
Analog Input Signal Path (AI4622 Example)
The analog input signal chain for a module like the X20AI4622 (4-channel, ±10V / 0-20mA):
Field Signal → Terminal Block → Input Protection (overvoltage/reverse polarity)
→ Voltage Divider / Current Shunt → 1st-Order Anti-Aliasing Filter
→ Multiplexer → Sigma-Delta ADC → Digital Filter → X2X Link → PLC
Voltage Input Path (±10V):
- Input range scaled to ADC full-scale via precision resistor divider
- First-order low-pass anti-aliasing filter before ADC
- 13-bit converter resolution (including sign), effectively ±12-bit
Current Input Path (0-20mA / 4-20mA):
- Current converted to voltage via precision shunt resistor
- Same ADC path as voltage inputs
- Configurable via software — no hardware jumpers needed
RTD Input Signal Path (AT2222 Example)
For the X20AT2222 (2-channel Pt100/Pt1000):
Sensor (Pt100/1000) → Terminal Block → Constant Current Source (250 µA)
→ Sense Resistor Network → Multiplexer → Sigma-Delta ADC
→ Digital Linearization (EN 60751) → X2X Link → PLC
- Measurement current: 250 µA ±1.25% constant current source
- Reference resistor: 4530 Ω ±0.1%
- Connection modes: Configurable 2-wire or 3-wire per module
- Input filter: First-order low-pass, cutoff frequency 500 Hz
Thermocouple Input Signal Path (AT2402 Example)
For the X20AT2402 (2-channel thermocouple):
Thermocouple → Terminal Block → Input Filter (1st-order LP, 500 Hz cutoff)
→ Multiplexer → Sigma-Delta ADC → Cold Junction Compensation
→ Linearization (EN 60584) → X2X Link → PLC
Digital Input Signal Path (DI9371 Example)
Field Signal (24 VDC) → Terminal Block → Reverse Polarity Protection
→ Configurable Input Filter (RC debounce) → Optocoupler / Digital Isolator
→ Status Register → X2X Link → PLC
3. ADC/DAC Paths on Analog Modules
ADC Specifications
| Module | Channels | Input Range | Resolution | Conversion Method | Conversion Time |
|---|---|---|---|---|---|
| X20AI4622 | 4 | ±10V / 0-20mA | 13-bit (incl. sign) | Sigma-delta | Per filter time |
| X20AI4632 | 4 | ±10V / 0-20mA | 13-bit (incl. sign) | Sigma-delta | Per filter time |
| X20AT2222 | 2 | Pt100/Pt1000 | 16-bit | Sigma-delta | 20 ms (1ch, 50Hz) |
| X20AT2402 | 2 | TC types J,K,N,S,B,R | 16-bit | Sigma-delta | 80.4 ms (2ch, 50Hz) |
| X20AT6402 | 6 | TC types B,E,J,K,N,R,S,T | 16-bit | Sigma-delta | ~100 ms/ch |
ADC Sampling Modes
X20AI4622 configurable filter times (determines effective sampling rate and noise rejection):
| Filter Setting | Cutoff Frequency | Filter Time |
|---|---|---|
| 15 Hz | 15 Hz | 66.7 ms |
| 25 Hz | 25 Hz | 40 ms |
| 30 Hz | 30 Hz | 33.3 ms |
| 50 Hz (default) | 50 Hz | 20 ms |
| 60 Hz | 60 Hz | 16.7 ms |
| 100 Hz | 100 Hz | 10 ms |
| 500 Hz | 500 Hz | 2 ms |
| 1000 Hz | 1000 Hz | 1 ms |
X20AT2402/AT2222 configurable filter times (same settings as above).
Synchronous Mode (AI4622)
When synchronous mode is enabled in the A/D converter configuration, the module operates the ADC synchronized to the bus cycle. This ensures deterministic sampling aligned with the control loop.
DAC Specifications
| Module | Channels | Output Range | Resolution | Conversion Time | Settling Time |
|---|---|---|---|---|---|
| X20AO4622 | 4 | ±10V or 0-20mA/4-20mA | 13-bit (±12-bit V / 12-bit I) | 300 µs (all outputs) | 500 µs full range |
X20AO4622 output architecture:
PLC Value (INT) → D/A Converter → Solid-State Relay (SSR) → Output Filter
(1st-order LP, 10 kHz cutoff) → Terminal Block → Field Device
- Output protection: Short-circuit proof with current limiting at ±40 mA
- Internal enable relay: Controls power-up behavior — outputs remain in defined state during startup
- Voltage output: Load ≥1 kΩ, max ±10 mA
- Current output: Load max 600 Ω (Rev. ≥J0), max 20 mA
DAC Function Models
| Mode | Description | Minimum Cycle |
|---|---|---|
| Function Model 0 (Standard) | I/O without jitter — corrected values output in next cycle | ≥400 µs |
| Function Model 1 (Fast Response) | I/O with fast response — corrected values output in same cycle | ≥400 µs |
4. Electrical Isolation
Isolation Architecture
All X20 I/O modules provide galvanic isolation between the I/O channels and the X2X bus:
Field Side (24V / Sensors / Actuators)
|
[Optocouplers / Transformers / Capacitive Isolators]
|
[Isolation Barrier: 500 Veff test voltage]
|
Bus Side (X2X Link / Internal Logic)
Isolation Ratings
| Parameter | Rating |
|---|---|
| Insulation voltage (channel to bus) | 500 Veff |
| Common-mode rejection (TC modules, DC) | >70 dB |
| Common-mode rejection (TC modules, 50 Hz) | >70 dB |
| Common-mode rejection (RTD modules, DC) | >95 dB |
| Common-mode rejection (RTD modules, 50 Hz) | >80 dB |
| Crosstalk between channels (RTD) | <-93 dB |
| Crosstalk between channels (TC) | <-70 dB |
Channel-to-Channel Isolation
- Channel isolated from bus: YES (all modules)
- Channel isolated from channel: NO (channels within same module share a common reference)
- Channel isolated from I/O power supply: NO (digital output modules)
Isolation Methods Used
- Optocouplers: Digital input and output modules use optical isolation between field-side circuitry and bus-side logic
- Transformer/Capacitive isolation: Analog modules employ galvanic isolation barriers (typically capacitive or transformer-coupled) between the ADC/DAC front-end and the X2X bus interface
- Internal isolation barrier: Rated for 500 Veff, providing safety isolation per IEC 61131-2
5. Digital Input Filtering and Debounce
Configurable Filter Times
Digital input modules (e.g., X20DI9371 — 12 digital inputs, 24 VDC, sink) feature configurable input filters to debounce mechanical contacts and suppress noise:
| Filter Setting | Filter Time | Use Case |
|---|---|---|
| 0 ms | No filter | Clean digital signals (e.g., solid-state outputs) |
| 0.1 ms | 100 µs | Fast response, minimal debounce |
| 0.5 ms | 500 µs | Standard fast-switching sensors |
| 1 ms | 1 ms | Medium-speed mechanical contacts |
| 3 ms | 3 ms | Typical relay/switch debounce |
| 10 ms | 10 ms | Slow mechanical contacts |
| 25 ms | 25 ms | Very noisy environments, slow switches |
Hardware Filter Implementation
The debounce is implemented as an RC filter followed by a digital threshold detection:
Field Input → Reverse Polarity Protection → RC Filter (configurable time constant)
→ Schmitt Trigger / Comparator → Optocoupler → X2X Link
Digital Input Module Specifications (X20DI9371)
| Parameter | Value |
|---|---|
| Nominal voltage | 24 VDC |
| Switching voltage | 15-30 VDC (typical) |
| Connection type | Sink (1-wire connections) |
| Filter time | Configurable (0-25 ms range) |
| Status indicators | Per-channel I/O LEDs + module status LEDs |
| Diagnostic status | Software-readable per channel |
| Power consumption (bus) | ~0.1 W |
| Power consumption (internal I/O) | ~0.5 W |
6. LED Diagnostic Codes and Patterns
Standard LED Layout
All X20 I/O modules have three categories of status LEDs:
| LED | Color | Location | Purpose |
|---|---|---|---|
| r (Run) | Green | Module top-left | Operating state indicator |
| e (Error) | Red | Module top-right (next to r) | Error/fault indicator |
| 1-N (Channel) | Green/Orange | Per channel | Individual channel I/O status |
Module Operating State LEDs
These two LEDs (r and e) follow a consistent pattern across all X20 I/O modules:
Green LED (r — Run/Operating State)
| Status | Meaning |
|---|---|
| Off | No power to module |
| Single Flash | RESET mode — Module powered but not configured / waiting for valid configuration from CPU |
| Double Flash | BOOT mode — Firmware update in progress (DO NOT power off during this) |
| Blinking | PREOPERATIONAL mode — Module initialized but not yet in RUN state |
| Steady ON | RUN mode — Module operational, processing I/O normally |
Red LED (e — Error)
| Status | Meaning |
|---|---|
| Off | No error — everything OK (or no power to module) |
| Steady ON | Error or reset state — Module has detected a fault |
| Single Flash | Warning/Error on an I/O channel — Overflow or underflow on analog inputs, level monitoring triggered on digital outputs |
Combined Indicators
| Status | Meaning |
|---|---|
| Red ON + Green single flash | Invalid firmware — Module has detected firmware corruption or version mismatch |
| Red ON (safety modules SE LED) | Defective module — Must be replaced immediately (safety modules only) |
Channel Status LEDs (Per Channel)
| LED Color | Status | Meaning |
|---|---|---|
| Off | Channel disabled or no power | Input is switched off / channel not active |
| Green steady ON | Value OK | Analog/digital converter running, value within normal range |
| Green blinking | Error condition | Overflow, underflow, or open line detected |
| Orange steady ON | Output active | Digital output channel is switched ON (output modules only) |
| Orange Off | Output inactive | Digital output channel is switched OFF (output modules only) |
Safety Module LEDs (X20SDxxxx, X20SIxxxx)
Safety I/O modules have additional LEDs:
| LED | Meaning |
|---|---|
| SE (System Error) — Steady Red | Defective module — Must be replaced immediately |
| SE — Flashing | Error detected but module not defective |
| SL | Safe Logic communication status |
| FD | Failsafe diagnostic status |
Critical: On safety modules (X20SL…), a constantly lit SE LED indicates a defective module that must be replaced immediately. On X20SLX… modules (no hardware acknowledge interface), replacement requires software acknowledgment via SafeDESIGNER.
7. Failure Modes and LED Indications
Failure Mode Classification
| Failure Mode | Root Cause | LED Pattern | Software Diagnostic |
|---|---|---|---|
| No power to module | Module supply disconnected, blown fuse, wiring fault | All LEDs OFF | Module not visible on bus |
| Reset mode | No valid application, corrupt configuration, CPU halted | r: single flash, e: OFF, x-led: OFF | Module not initialized |
| Boot mode | Firmware update, forced boot entry | r: double flash | Firmware loading indicator |
| Preoperational | Module initialized but CPU not in RUN | r: blinking | Module detected, not yet active |
| Channel overrange (analog) | Signal exceeds ±10V or 0-20mA range | e: single flash, channel: green blinking | Status register: 0x7FFF (overshoot) |
| Channel underrange (analog) | Signal below valid range | e: single flash, channel: green blinking | Status register: 0x8001 (undershoot) |
| Open circuit (analog) | Wire broken, sensor disconnected | e: single flash, channel: green blinking | Status register: 0x7FFF (open circuit) |
| Invalid firmware | Corrupted firmware, version mismatch | Red ON + green single flash | Module non-functional |
| Short circuit (digital output) | Output wiring shorted to ground/V+ | e: single flash, channel: orange off (output disabled) | Status bit: 1 for that channel |
| Overload (digital output) | Total current exceeds module rating | e: single flash | Thermal shutdown activated |
| X2X bus communication loss | X2X cable break, missing terminator, bad connector, or CPU in STOP/SERVICE mode | All modules: r: continuously blinking (not single flash) | No communication across entire rack. Check X2X daisy-chain cable, terminator jumpers on last module, and confirm CPU is in RUN mode. This is one of the most common “all outputs off” failure modes. See x2x-protocol.md. |
| Missing I/O field power (e blinking + r steady) | I/O power supply rail lost (e.g., E-stop relay dropped the I/O supply, blown fuse, bad jumper) | e: single flash (per-channel), r: steady green | Module communicating normally but has no field power. The X20 system separates logic power (+24V LOGIC) from field power (+24V I/O). Check the power supply module’s terminal 1-5/1-6, verify jumpers, and confirm the E-stop relay is not dropping the I/O supply rail. The X20PS2100 and X20PS3300 power supply modules have separate logic and I/O power terminals specifically for this E-stop scenario. |
| Missing I/O supply (channel-level) | Field power supply failure | e: single flash (per-channel) | Status bit set for ON channels |
| X2X bus failure | Cable break, missing terminator, bad connector | All modules: r: single flash | No communication |
| Defective module (safety) | Internal hardware failure (safety modules) | SE: steady red | Replace immediately |
| Cold junction error (temperature) | CJC sensor drift, ambient conditions | e: single flash, channel: green blinking | 2-3°C offset typical |
Per-Channel Error Values (Analog Modules)
| Error Condition | Digital Value (INT) | Hex Value |
|---|---|---|
| Open circuit | +32767 | 0x7FFF |
| Upper limit overshoot | +32767 | 0x7FFF |
| Lower limit undershoot | -32767 | 0x8001 |
| Invalid value / General fault | -32768 | 0x8000 |
| Channel not switched on | -32768 | 0x8000 |
Per-Channel Status Bits (Digital Output Modules — DO9322)
| Status Bit | Meaning |
|---|---|
| 0 | No error |
| 1 | Short circuit or overload |
| 1 | Channel ON but missing I/O power supply |
| 1 | Channel OFF but external voltage applied |
Digital output monitoring has a 10 ms diagnostic delay before reporting an error.
8. B&R X20 IO Card Types and Model Numbers
Digital Input Modules
| Model | Channels | Voltage | Connection | Filter | Special |
|---|---|---|---|---|---|
| X20DI2371 | 2 | 24 VDC | 2-wire | Configurable | Sink |
| X20DI2372 | 2 | 24 VDC | 2-wire | Configurable | Source |
| X20DI2377 | 2 | 24 VDC | 2-wire | Configurable | Sink, high-speed |
| X20DI2653 | 2 | 230 VAC | 2-wire | Configurable | AC input |
| X20DI4371 | 4 | 24 VDC | 2-wire | Configurable | Sink |
| X20DI4372 | 4 | 24 VDC | 2-wire | Configurable | Source |
| X20DI4653 | 4 | 230 VAC | 2-wire | Configurable | AC input |
| X20DI4760 | 4 | 24 VDC | 2-wire | Configurable | Diagnostic |
| X20DI6371 | 6 | 24 VDC | 1-wire | Configurable | Sink |
| X20DI6372 | 6 | 24 VDC | 1-wire | Configurable | Source |
| X20DI6553 | 6 | 230 VAC | 1-wire | Configurable | AC input |
| X20DI8371 | 8 | 24 VDC | 1-wire | Configurable | Sink |
| X20DI9371 | 12 | 24 VDC | 1-wire | Configurable | Sink |
| X20DI9372 | 12 | 24 VDC | 1-wire | Configurable | Source |
Digital Output Modules
| Model | Channels | Voltage | Current | Connection | Type | Special |
|---|---|---|---|---|---|---|
| X20DO2321 | 2 | 24 VDC | 2 A | 1-wire | Transistor (sink) | |
| X20DO2322 | 2 | 24 VDC | 0.5 A | 1-wire | Transistor (source) | |
| X20DO2623 | 2 | 24 VDC | 2 A | 2-wire | Transistor | Diagnostic |
| X20DO2649 | 2 | 24 VDC | 2 A | 2-wire | Relay | Relay output |
| X20DO4321 | 4 | 24 VDC | 2 A | 1-wire | Transistor (sink) | |
| X20DO4322 | 4 | 24 VDC | 0.5 A | 1-wire | Transistor (source) | |
| X20DO4331 | 4 | 24 VDC | 2 A | 1-wire | Transistor (source) | |
| X20DO4332 | 4 | 24 VDC | 2 A | 1-wire | Transistor | Diagnostic |
| X20DO4529 | 4 | 24 VDC | 2 A | 2-wire | Relay | Relay output |
| X20DO4623 | 4 | 24 VDC | 2 A | 2-wire | Transistor | Diagnostic |
| X20DO6321 | 6 | 24 VDC | 2 A | 1-wire | Transistor (sink) | |
| X20DO6322 | 6 | 24 VDC | 0.5 A | 1-wire | Transistor (source) | |
| X20DO6529 | 6 | 24 VDC | 2 A | 2-wire | Relay | Relay output |
| X20DO8322 | 8 | 24 VDC | 0.5 A | 1-wire | Transistor (source) | |
| X20DO8331 | 8 | 24 VDC | 2 A | 1-wire | Transistor (source) | |
| X20DO8332 | 8 | 24 VDC | 2 A | 1-wire | Transistor | Diagnostic |
| X20DO9321 | 12 | 24 VDC | 0.5 A | 1-wire | Transistor (sink) | |
| X20DO9322 | 12 | 24 VDC | 0.5 A | 1-wire | Transistor (source) | Output monitoring |
Analog Input Modules
| Model | Channels | Range | Resolution | Filter |
|---|---|---|---|---|
| X20AI1744 | 1 | Full | 16-bit | Configurable |
| X20AI2622 | 2 | ±10V / 0-20mA | 13-bit | Configurable |
| X20AI2632 | 2 | ±10V / 0-20mA | 13-bit | Configurable |
| X20AI4622 | 4 | ±10V / 0-20mA / 4-20mA | 13-bit | Configurable |
| X20AI4632 | 4 | ±10V / 0-20mA / 4-20mA | 13-bit | Configurable |
Analog Output Modules
| Model | Channels | Range | Resolution | Filter |
|---|---|---|---|---|
| X20AO2622 | 2 | 0-20mA / 4-20mA | 12-bit | 1st-order LP |
| X20AO2632 | 2 | ±10V / 0-20mA / 4-20mA | 13-bit | 1st-order LP |
| X20AO4622 | 4 | ±10V / 0-20mA / 4-20mA | 13-bit | 1st-order LP |
| X20AO4632 | 4 | ±10V / 0-20mA / 4-20mA | 13-bit | 1st-order LP |
Temperature Modules
| Model | Channels | Sensor Types | Resolution | Special |
|---|---|---|---|---|
| X20AT2222 | 2 | Pt100, Pt1000 | 16-bit (0.1°C) | 2-wire / 3-wire |
| X20AT4222 | 4 | Pt100, Pt1000 | 16-bit (0.1°C) | 2-wire / 3-wire |
| X20AT2311 | 2 | Thermocouple | 16-bit | Special function |
| X20AT2402 | 2 | TC: J,K,N,S,B,R | 16-bit (0.1°C) | Cold junction comp. |
| X20AT6402 | 6 | TC: B,E,J,K,N,R,S,T | 16-bit (0.1°C) | Cold junction comp. |
| X20ATA492 | 2 | TC: J,K,N,S,B,R,E,C,T | 16-bit | NetTime timestamping |
Mixed / Special Function Modules
| Model | Description |
|---|---|
| X20DM9324 | 8 digital inputs + 4 digital outputs |
| X20CM1201 | Combination module (digital + analog) |
| X20CM8281 | Universal mixed module (digital + analog + counter) |
| X20MM2436 | PWM motor bridge, 2 channels |
| X20MM4456 | PWM motor bridge, 4 channels |
| X20SM1426 | Stepper motor module |
| X20SM1436 | Stepper motor module |
| X20DC1196 | Counter module, 1x 5V AB incremental encoder |
| X20DC1198 | Counter module, 1x 5V SSI |
| X20DC1396 | Counter module, 1x 24V incremental encoder |
| X20DC1398 | Counter module, 1x 24V SSI |
| X20DC2395/2396/2398/4395 | Multi-channel counter modules |
| X20DS1119/DS1319 | Ultrasonic distance measurement |
Coated Modules
All modules are available in coated variants (prefix X20c instead of X20) for protection against condensation and corrosive gases, certified to BMW GS 95011-4 and EN 60068-2-60. Electronics are fully compatible with standard versions.
9. Thermocouple and RTD Input Handling
Thermocouple Modules (X20AT2402, X20AT6402)
Cold Junction Compensation (CJC)
Thermocouples measure the temperature difference between the hot junction (measurement point) and the cold junction (terminal block). The module must compensate for the cold junction temperature:
- Internal CJC sensor: Pt1000 (or equivalent) integrated into the terminal block
- Automatic compensation: Module continuously measures terminal temperature and adds it mathematically to the thermocouple EMF
- CJC precision: ±2°C (natural convection after 10 min), ±4°C (forced convection after 10 min)
- CJC temperature range: -25°C to +85°C
- CJC resolution: 0.1°C (1 LSB)
External Cold Junction
For large distances between controller and measurement point, or for higher precision:
- Route thermocouple via copper extension wire from external cold junction to terminal
- Measure cold junction temperature with separate RTD sensor (e.g., X20AT2222)
- Write external CJC temperature into the module’s
ExternalCompensationTemperatureregister - Module uses this value instead of internal measurement
External CJC recommended when:
- Large distances between controller and measurement point
- Module consuming more than 1 W is connected adjacent
- Strongly fluctuating ambient conditions (draft, temperature changes)
Linearization
- Standard: EN 60584 for thermocouples
- Method: Internal linearization — the module’s firmware performs the conversion from EMF to temperature
- Supported types: J, K, N, S, B, R (AT2402); B, E, J, K, N, R, S, T (AT6402)
Thermocouple Measurement Ranges
| Type | Range | Max Error @25°C (Gain) | Max Error @25°C (Offset) |
|---|---|---|---|
| J (Fe-CuNi) | -210 to 1200°C | 0.06% | 0.04% |
| K (NiCr-Ni) | -270 to 1372°C | 0.06% | 0.05% |
| N (NiCrSi-NiSi) | -270 to 1300°C | 0.06% | 0.05% |
| S (PtRh10-Pt) | -50 to 1768°C | 0.06% | 0.11% |
| B (PtRh30-PtRh60) | 0 to 1820°C | 0.06% | 0.13% |
| R (PtRh13-Pt) | -50 to 1664°C | 0.06% | 0.09% |
Conversion Time (X20AT2402, Function Model 0)
| Channels Active | Filter | Conversion Time |
|---|---|---|
| 1 channel | 50 Hz (20 ms) | 40.2 ms |
| 2 channels | 50 Hz (20 ms) | 120.6 ms |
| 1 channel | 1000 Hz (1 ms) | 2.2 ms |
| 2 channels | 1000 Hz (1 ms) | 4.4 ms |
Formula: (n + 1) * (2 * Filter time + 200 µs) for Function Model 0.
RTD Modules (X20AT2222)
Measurement Principle
Constant Current Source (250 µA) → Pt100/Pt1000 Sensor → Sense Resistor
→ Multiplexer → Sigma-Delta ADC → Linearization (EN 60751) → Temperature
RTD Specifications
| Parameter | Value |
|---|---|
| Sensor types | Pt100, Pt1000 |
| Measurement range | -200°C to +850°C |
| Resistance range | 0.1 to 4500 Ω / 0.05 to 2250 Ω |
| Resolution | 0.1°C (1 LSB) |
| Measurement current | 250 µA ±1.25% |
| Reference resistor | 4530 Ω ±0.1% |
| Connection modes | 2-wire or 3-wire (configurable per module) |
| Max error (gain, @25°C) | ±0.037% |
| Max error (offset, @25°C) | ±0.0015% |
| Max gain drift | ±0.004%/°C |
| Nonlinearity | <0.001% |
| Crosstalk | <-93 dB |
| CMRR (DC) | >95 dB |
| CMRR (50 Hz) | >80 dB |
Conversion Time (X20AT2222)
| Channels | Configuration | Filter | Time |
|---|---|---|---|
| 1 | Any | 50 Hz (20 ms) | 20 ms |
| 2 | Same sensor type | 50 Hz (20 ms) | 80 ms |
| 2 | Different sensor types | 50 Hz (20 ms) | 120 ms |
10. 4-20mA vs 0-10V Input Considerations
Comparison
| Parameter | 4-20 mA Current Loop | 0-10 V Voltage Signal |
|---|---|---|
| Noise immunity | Excellent — current signals are immune to voltage drops from wiring resistance and EMI | Poorer — susceptible to ground loops, EMI, and voltage drops |
| Cable length | Up to 1000+ m (practically limited by compliance voltage) | Typically <30 m for good accuracy |
| Wire resistance impact | None (current is constant regardless of resistance) | Significant — voltage divider effect with wire resistance |
| Open wire detection | Built-in — 0 mA = open wire (below 4 mA threshold) | No built-in detection |
| Short circuit detection | Possible via underrange detection | Risk of damage without protection |
| Ground loops | Immune (floating current source) | Susceptible — may need isolated modules |
| Resolution usage | 4 mA offset wastes ~20% of range but provides “live zero” | Full range used (0-100%) |
| Live zero | Yes — 4 mA = zero process value, 0 mA = fault | No — 0 V could be zero or fault |
| Load requirements | Module’s shunt resistor; field device must supply current | Module’s input impedance (typically >100 kΩ) |
B&R Module Considerations
On the X20AI4622, both 0-20mA/4-20mA and ±10V are available on the same module. Signal type is determined by terminal connection:
- Voltage terminals: Connect signal to U+ and U- terminals
- Current terminals: Connect signal to I+ and U- (common) terminals
- Configuration: Set via software register
ConfigOutput01
Error Values (4-20mA)
| Condition | Current | Digital Value | Hex |
|---|---|---|---|
| 0% process | 4 mA | 0 | 0x0000 |
| 100% process | 20 mA | 32767 | 0x7FFF |
| Open wire | 0 mA | Status register flags error | 0x7FFF (error value) |
| Underrange | <4 mA | Status bit set | 0x8001 |
| Overshoot | >20 mA | Status bit set | 0x7FFF |
When to Choose Each
- Use 4-20mA when: Long cable runs (>10m), noisy industrial environment, outdoor installations, need open-wire detection, multiple devices on same loop
- Use 0-10V when: Short distances, clean environment, simple sensors (potentiometers, pressure transducers with voltage output), cost-sensitive applications
11. Output Types: Relay, Transistor, Analog
Transistor Outputs (Solid-State)
The most common digital output type in the X20 system. Uses current-sourcing or current-sinking FETs:
| Parameter | X20DO9322 (0.5A source) | X20DO8332 (2A source) | X20DO2321 (2A sink) |
|---|---|---|---|
| Output type | Current-sourcing FET | Current-sourcing FET | Current-sinking FET |
| Nominal current | 0.5 A per channel | 2 A per channel | 2 A per channel |
| Total current | 6 A module max | 16 A module max | 4 A module max |
| Switching delay | <300 µs | <300 µs | <300 µs |
| Max frequency (resistive) | 500 Hz | 500 Hz | 500 Hz |
| Leakage current (off) | 5 µA | 5 µA | 5 µA |
| RDS(on) | 210 mΩ | 50 mΩ | 50 mΩ |
| Short-circuit current | <12 A peak | <12 A peak | <12 A peak |
| Protection | Thermal shutdown, freewheeling diode | Thermal shutdown, freewheeling diode | Thermal shutdown, freewheeling diode |
Inductive load handling: Built-in freewheeling diode with typical braking voltage of 50 VDC when switching off inductive loads. Maximum switching frequency for inductive loads depends on coil inductance (see module derating curves).
Relay Outputs
Available on select modules (e.g., X20DO2649, X20DO4529, X20DO6529):
- Contact type: Electromechanical relay
- Rated current: 2 A per channel
- Connection: 2-wire (isolated contacts)
- Advantages: Complete galvanic isolation of output contacts, can switch AC or DC, no leakage current
- Disadvantages: Limited switching life (mechanical wear), slower switching speed, contact bounce
- Use cases: Switching different voltage levels, AC loads, applications requiring true isolation
Analog Outputs (X20AO4622)
| Parameter | Voltage Mode | Current Mode |
|---|---|---|
| Range | ±10 V | 0-20 mA / 4-20 mA |
| Resolution | ±12-bit (1 LSB = 2.441 mV) | 12-bit (1 LSB = 4.883 µA) |
| Max load | ≥1 kΩ | 600 Ω |
| Short-circuit protection | Current limiting ±40 mA | Short-circuit proof |
| Output filter | 1st-order LP, 10 kHz cutoff | 1st-order LP, 10 kHz cutoff |
| Start-up behavior | Internal enable relay — defined state at power-up | Same |
| Gain accuracy | 0.08% | 0.09% |
| Offset accuracy | 0.05% | 0.05% |
| Gain drift | 0.015%/°C | 0.02%/°C |
| Nonlinearity | <0.007% | <0.007% |
12. Identifying Faulty IO Card vs Wiring vs Sensor
Systematic Diagnostic Approach
Step 1: Check module LEDs (quick visual diagnosis)
Step 2: Read software status registers (detailed per-channel info)
Step 3: Measure field signals with multimeter
Step 4: Isolate the fault source (card / wiring / sensor)
Decision Matrix
| Symptom | IO Card Fault | Wiring Fault | Sensor Fault |
|---|---|---|---|
| All channels dead, all LEDs OFF | X (no power) | X (main supply) | |
| All modules showing single flash (r-led) | X (bus failure) | X (X2X cable) | |
| Single channel error, adjacent channels OK | Possible | X (broken wire) | X (failed sensor) |
| Multiple random channel errors | X (internal fault) | Possible | Possible |
| Consistent offset on analog value | X (CJC drift, calibration) | Possible (resistance) | X (sensor drift) |
| Open circuit on one channel | Unlikely | X (broken wire) | X (open sensor) |
| Short circuit error flagged | Unlikely | X (short to GND/V+) | Possible |
| Overshoot on analog input | X (ADC fault) | Unlikely | X (sensor overrange) |
| Intermittent errors | X (loose connection internally) | X (loose terminal) | X (intermittent sensor) |
| Error persists after module swap | Ruled out | X | X |
| Error moves with module | X | Ruled out | Ruled out |
Step-by-Step Procedure
For Digital Input Issues:
-
Check LED: Is the channel LED changing state?
- LED OFF = No signal → Check sensor, wiring, power supply
- LED ON but PLC reads wrong → Possible bus communication issue
-
Measure at terminal block:
- 0 V when expected 24 V → Sensor not actuating or wiring broken
- 24 V when expected 0 V → Sensor stuck or wiring shorted
- Voltage present but unstable → Loose connection, ground fault
-
Swap sensor: Connect known-good sensor → If error persists, issue is wiring or card
-
Swap module: Replace with known-good module → If error follows module, card is faulty
For Analog Input Issues:
- Read status register: Check for overflow (0x7FFF), underrange (0x8001), open circuit (0x7FFF with open flag), or invalid (0x8000)
- Measure signal at terminal: Compare multimeter reading to PLC value
- Check error values:
- 2-3°C offset on thermocouple: Normal (CJC inherent accuracy ±1-2°C for Type K). Apply software calibration offset.
- Large offset: Check wiring resistance, sensor type configuration, grounding
- Monitor CJC register (
CompensationTemperature): Should read close to ambient temperature
For Digital Output Issues:
- Check status register: Each bit reports short circuit, overload, or missing supply
- Check output LED: Orange = ON, Off = OFF
- Measure output voltage at terminal:
- 0 V when commanded ON → Short circuit, overload, or module fault
- 24 V when commanded OFF → External voltage applied (wiring fault)
- Total current check: Sum of all active outputs must not exceed module rating
Thermocouple-Specific Troubleshooting
| Symptom | Likely Cause | Action |
|---|---|---|
| 2-3°C offset from reference | Inherent thermocouple accuracy + CJC error | Apply software calibration offset in PLC |
| Large offset (>10°C) | Wrong thermocouple type configured | Check ConfigOutput02 register setting |
| Reading -25°C or max range | Open thermocouple or broken wire | Check wiring continuity |
| Erratic readings | Incorrect extension wire used | Replace with correct type (KX for Type K) |
| All channels reading same value | Multiplexer fault | Replace module |
RTD-Specific Troubleshooting
| Symptom | Likely Cause | Action |
|---|---|---|
| Open circuit flagged | Broken sensor or wiring | Measure resistance at terminal |
| Reading 0°C when hot | Short circuit in sensor leads | Check resistance (should be ~100-385 Ω for Pt100 at room temp) |
| Offset between channels | Wire resistance imbalance | Use 3-wire connection instead of 2-wire |
| Crosstalk between channels | Exceeding common-mode range | Check wiring grounding |
13. IO Card Power Supply: Rails and Current Limits
Power Architecture
The X20 system has two distinct power domains:
24 VDC Field Supply
|
[X20PSxxxx Power Supply Module]
/ \
X2X Link Bus Supply Internal I/O Supply
(Bus Module) (I/O Module Electronics)
| |
[X20BMxx Bus Module] [I/O Modules]
|
X2X Data + Bus Power
|
[I/O Module Bus Side]
Power Supply Modules
| Model | Description | X2X Link | Internal I/O Supply | Notes |
|---|---|---|---|---|
| X20PS2100 | 24 VDC supply | Yes (feed) | Continuous through | 10 A slow-blow fuse |
| X20PS2110 | 24 VDC supply | Yes (feed) | Continuous through | 10 A slow-blow fuse |
| X20PS3300 | 24 VDC supply | Yes (feed) | Interrupted to left | Bus + I/O supply |
| X20PS3310 | 24 VDC supply | Yes (feed) | Interrupted to left | Bus + I/O supply |
Bus Modules
| Model | Description | I/O Supply |
|---|---|---|
| X20BM01 | Basic 24 VDC bus module | Not specified |
| X20BM05 | 24 VDC, with node switch | Not specified |
| X20BM11 | 24 VDC keyed | Internal I/O supply connected through |
| X20BM15 | 24 VDC keyed, node switch | Internal I/O supply connected through |
| X20BM31 | 24 VDC | Not specified |
Current Limits and Monitoring
- Bus supply current monitoring: Bus supply current >2.3 A is flagged as a warning
- Internal current limiting: Power supply modules have internal current limit (short circuit protection) and connections for external fuse
- I/O module current budget: Each module’s datasheet specifies bus power consumption and internal I/O power consumption
- Total I/O current: Must be calculated based on the sum of all connected modules
Power Consumption Examples
| Module | Bus Power | Internal I/O Power |
|---|---|---|
| X20DI9371 (12 DI) | ~0.1 W | ~0.5 W |
| X20DO9322 (12 DO, 0.5A) | 0.26 W | 1.15 W |
| X20AI4622 (4 AI) | 0.01 W | ~1 W |
| X20AO4622 (4 AO) | 0.01 W | 1.8 W (Rev. ≥J0) |
| X20AT2222 (2 RTD) | 0.01 W | 1.1 W |
| X20AT2402 (2 TC) | 0.01 W | 0.72 W |
| X20BR9300 (Bridge) | 2.5 W | N/A |
| X20BT9100 (Terminal) | 0.85 W | N/A |
Derating
Modules require derating above certain ambient temperatures. For example:
- X20DO9322: No derating below 55°C; max current per channel reduced to 0.35 A above 55°C
- X20AO4622: Derating curves for voltage vs. ambient temperature (see datasheet)
14. Diagnostic Features per Card Type
Diagnostic Capabilities Summary
| Feature | Digital Input | Digital Output | Analog Input | Analog Output | Temperature (TC) | Temperature (RTD) |
|---|---|---|---|---|---|---|
| Module run/error LED | Yes | Yes | Yes | Yes | Yes | Yes |
| Per-channel LED | Yes (green) | Yes (orange) | Yes (green) | Yes (orange) | Yes (green) | Yes (green) |
| Software error register | Yes | Yes (per-ch) | Yes (per-ch) | Yes (channel type) | Yes (per-ch) | Yes (per-ch) |
| Open circuit detection | N/A | N/A | Yes | N/A | Yes | Yes |
| Overrange/underrange | N/A | N/A | Yes | N/A | Yes | Yes |
| Short circuit detection | N/A | Yes (per-ch, 10ms) | N/A | Yes | N/A | N/A |
| Overload detection | N/A | Yes (thermal) | N/A | Yes | N/A | N/A |
| Wire break detection | Via input state | N/A | Yes (via underrange) | N/A | Yes | Yes |
| Invalid firmware detection | Yes | Yes | Yes | Yes | Yes | Yes |
| IO Cycle Counter | N/A | N/A | Yes | N/A | Yes | Yes |
| Serial number readout | Yes | Yes | Yes | Yes | Yes | Yes |
| Hardware variant readout | Yes | Yes | Yes | Yes | Yes | Yes |
| Power supply monitoring | N/A | Yes (per-ch) | N/A | N/A | N/A | N/A |
General Data Points (All Modules)
Accessible via the bus controller, these are common to all X20 I/O modules:
- Serial number — Unique module identifier
- Hardware variant — Hardware revision
- B&R ID code — Module type identifier (e.g., 0x1BA8 for AT2402, 0x1BA3 for AO4622)
Automation Studio Diagnostics
In Automation Studio (B&R’s IDE):
- TM920 Diagnostics and Service: Module-level diagnostics including I/O status, error history, and module identification
- mapp View Diagnostics: HMI visualization for monitoring module status
- Remote Diagnostics (SDM): Access via
http://<IP>/SDM/for runtime diagnostic information - SafeDESIGNER (safety modules): Safety-specific diagnostics, module acknowledgment, parameter monitoring
15. Hot-Swap Capabilities
X20 Module Replacement Procedure
The X20 system supports hot-swapping of individual I/O modules without powering down the entire system:
- Release the module from the DIN rail using the snap-lock mechanism
- Disconnect the terminal block from the I/O module (field wiring stays connected to the terminal block)
- Insert replacement module into the same position on the DIN rail
- Reconnect the terminal block to the new module
- Module auto-initializes on the X2X bus (LED sequence: single flash → blinking → steady ON)
Key Design Features Enabling Hot-Swap
- Terminal block separation: Terminal blocks remain connected to field wiring; only the electronic module is removed
- X2X Link hot-insertion: Bus modules detect new modules automatically
- Keyed bus modules: Prevent incorrect module insertion (keying ensures correct module type and orientation)
- Internal enable relay (analog outputs): Analog output modules have an internal enable relay that holds outputs in a defined state during power-up
- SafeLOGIC acknowledgment: Safety modules require software acknowledgment after replacement (X20SL: hardware button; X20SLX: software only)
Safety Module Replacement
Safety I/O modules have additional requirements:
- X20SL (SafeLOGIC): Has a hardware acknowledge button on the module
- X20SLX (SafeLOGIC X): No hardware interface — acknowledgment can only be done via software (SafeDESIGNER + password)
- The SafeLOGIC stores all module serial numbers; replacing a module triggers a safety acknowledgment requirement
- System remains in safe state until the new module is acknowledged
Limitations
- Bus module replacement: Requires re-initialization of all downstream modules
- Power supply module replacement: Momentary power interruption to downstream I/O modules
- CPU replacement: Full system restart required
- X2X cable hot-plug: Not recommended — terminator jumpers must be maintained
Coated Module Starting Temperature
Coated modules (X20c prefix) can be powered on at temperatures as low as -40°C (cold start), though operating temperature must still meet specifications (-25°C to +60°C horizontal) once running. This is relevant for hot-swap in cold environments.
Sources
- B&R X20 System Product Page
- X20 System User’s Manual v3.50 (EU Automation)
- X20AT2402 Thermocouple Module Datasheet
- X20AT6402 Thermocouple Module — B&R Product Page
- X20AT2222 RTD Module Datasheet (RS Online)
- X20AO4622 Analog Output Module Datasheet (RS Online)
- X20AI4622 Analog Input Module — B&R Product Page
- X20AI4622 Datasheet (Multiway Control)
- X20DO9322 Digital Output Module Datasheet (ChipDip)
- X20DI9371 Digital Input Module — B&R Product Page
- X20DO9321 Digital Output Module — B&R Product Page
- X20PS3300 Power Supply Module — B&R Product Page
- X20ATA492 Temperature Module — Hartfiel
- B&R Community — X20 LED Status Indicators Discussion
- B&R X20AT6402 Thermocouple Temperature Error Fix (Industrial Monitor Direct)
- B&R X2X Communication and Reset Mode LED Issues (Industrial Monitor Direct)
- Troubleshooting B&R X20 DO Module LED Indicators (Industrial Monitor Direct)
- X20 System Overview — YUMPU (Nordwel PDF)
- X20 System User’s Manual — all4sps.com
- B&R X2X Bus Receiver BR9300 Troubleshooting (Reddit)
- CDP Studio — B&R Automation I/O Modules Reference
Key Findings
- X20 IO modules use plug-in connectors with spring-cage terminals (X20TB series) — these are keyed and cannot be inserted incorrectly. Always note the terminal block type when documenting an undocumented machine.
- Digital input LED behavior reveals connection status and diagnostic state: solid green = input active, blinking = diagnostic (short circuit, wire break, or module fault), off = no signal. The pattern differs between standard and diagnostic-capable modules.
- Analog modules offer 12-bit or 16-bit resolution — the resolution choice affects measurement precision and noise susceptibility. Higher resolution modules have higher per-channel cost but better accuracy for critical measurements.
- Module power consumption is documented per-module but often overlooked — summing all module currents against the X20PS power supply rating (typically 24V/10A) prevents brownout-related IO failures. See power budgets in each module’s datasheet.
- Diagnostic-capable modules (X20SD/x models) provide channel-level wire-break and short-circuit detection — these modules cost more but are invaluable for troubleshooting intermittent sensor issues on undocumented machines.
- X2X Link bus power is limited to 7W (derated to 5W above 55C) — large IO stations may require additional bus power supplies. Overloading causes the red X2X LED on the power supply module to illuminate.
- The ‘e’ (error) LED blinking on any X20 module means I/O power supply is missing — the X20 system separates logic power (+24V LOGIC) from field power (+24V I/O). A blinking ‘e’ LED with ‘r’ steady green means the module is communicating fine but has no field power. Check the power supply module’s terminal 1-5/1-6, verify jumpers, and confirm the E-stop relay is not dropping the I/O supply rail. The X20PS2100 and X20PS3300 power supply modules have separate logic and I/O power terminals specifically for this E-stop scenario.
- A continuously blinking ‘r’ LED on all modules indicates X2X bus communication loss — if every module in a rack shows blinking ‘r’, the bus controller (X20BC0087) has lost its X2X link to the CPU. Check the X2X daisy-chain cable, verify terminator jumpers on the last module, and confirm the CPU is in RUN mode (not STOP or SERVICE). This is one of the most common “all outputs off” failure modes on B&R machines. See x2x-protocol.md for X2X troubleshooting.
- Missing X20 end plates (X20EB8011) can cause intermittent shorts — the orange plastic end plates are not decorative. Without them, the exposed bus contacts of the rightmost module can short against cabinet metal, causing sporadic I/O faults that stop the machine. Always verify both left and right end plates are installed on every X20 rack.
- Power supply module LEDs have specific meanings: ‘r’ single flash = RESET mode; ‘r’ blinking = PREOPERATIONAL; ‘r’ steady green = RUN; ‘e’ double flash = X2X power overload OR I/O power too low; ‘e’ steady red = X2X power overloaded; ‘S’ yellow = RS232 activity; ‘l’ red = X2X power overload. The power supply module is the first thing to check when any I/O fault occurs.
Cross-References
- analog-calibration.md — Analog signal conditioning, calibration procedures, and noise diagnosis
- memory-map.md — How IO data is mapped in the PLC address space
- x2x-protocol.md — X2X bus protocol and wire-level details
- physical-layer-sniffing.md — Physical-layer signal analysis for fieldbus cables
- grounding-emc.md — Grounding, shielding, and EMC troubleshooting
- io-sniffing.md — Intercepting fieldbus traffic for sensor diagnostics
- powerlink-internals.md — ETHERNET Powerlink protocol deep internals
- if2772-canopen.md — CANopen on B&R, PDO/SDO mapping
- cf-card-boot.md — CF card boot sequence and file structure
- execution-model.md — Task scheduling and IO update timing
- cp1584-hardware-ref.md — CP1584 X2X link power output and IO station power budget
- diagnostics-sdm.md — SDM web interface for monitoring IO module status and fault history
- safe-io-diagnostics.md — Safety IO module diagnostics and acknowledgment procedures
- online-changes.md — IO hot-connect capabilities and runtime parameter changes
- network-architecture.md — X20 bus controller and remote IO station architecture
- system-variables.md — IO-related system variables for module health monitoring
B&R PLC Program Reverse Engineering: Technical Analysis
A comprehensive technical reference for analyzing, disassembling, and recovering information from compiled B&R (Bernecker + Rainer) IEC 61131-3 programs.
1. B&R Object Code File Formats
B&R Automation Studio uses several proprietary file formats throughout the development, compilation, and deployment lifecycle. Understanding each is essential to any analysis of compiled B&R code.
1.1 .br Files — Compiled Binary Modules
The .br extension is the primary B&R compiled object format. The Automation Studio compiler produces executable program modules (“B&R modules”) in machine code as .br files. These are transferred to the controller as “system objects” during project download.
Contents:
- Native machine code (x86 or ARM depending on target CPU)
- Compiled library references and dependency information
- Configuration parameters for the module
- Symbolic variable names (if symbol export is enabled at compile time)
- Module metadata: name, version, size in bytes, target architecture
The .br format is proprietary and undocumented. B&R has not publicly released format specifications. The compiled binary cannot be decompiled back to source code using any B&R-provided tool.
Source: B&R Automation Studio Quick Start guide states: “The compiler provides an executable program module (B&R module) in machine code. B&R modules (*.BR files) can be transferred to the controller as system objects.” — https://instrumentacionycontrol.net/wp-content/uploads/2017/11/IyCnet_BR_AutomationStudio_QuickStart_MASYS2ASQS-E_240.pdf
1.2 .pc Files — Project Configuration
The .pc file is the Automation Studio project container. It is not a compiled binary but rather a project-level configuration and metadata file that holds references to all project components.
Contents:
- Project-level metadata (name, version, Automation Studio version)
- Hardware tree configuration (left panel in AS project view)
- Software tree configuration (right panel in AS project view)
- References to all programs, user files, hardware configuration options
- I/O mapping definitions and hardware module assignments
- Task configuration (cycle times, priorities)
- References to library dependencies
The .pc file acts as the top-level manifest for the entire Automation Studio project. It does not contain compiled code itself but references the .br binary modules that are generated during compilation.
Source: B&R Community forum: “The project itself is a collection of programs, user files, hardware trees, hardware configuration options, configuration files, I/O mappings…” — https://community.br-automation.com/t/referencing-all-resources-from-another-project/2354
1.3 .obj Files — Intermediate Object Files
During the B&R compilation pipeline, intermediate object files may be generated. These are linker-able binary units that contain partially compiled code. In the B&R ecosystem, .obj files typically appear in the build directory of an Automation Studio project and represent pre-linked object code for individual Program Organization Units (POUs) or C source files before final linking into a .br module.
Contents (typical):
- Relocatable machine code sections
- Symbol table (local and external references)
- Relocation entries for linker resolution
- Debug information (if compiled with debug symbols)
These are standard object file formats (likely COFF or ELF derivatives) used by the GNU toolchain that underpins the B&R compiler for C programs, rather than a B&R-proprietary format.
1.4 .l5k Files — Allen-Bradley Export (Not B&R)
The .l5k extension is associated with Rockwell/Allen-Bradley RSLogix/Studio 5000 PLC export files (L5K is an XML-like ASCII export format for ControlLogix/CompactLogix programs). This format is not used by B&R and is included here only for clarity, as it frequently appears in general PLC reverse engineering discussions.
For B&R systems, the relevant export format would be the Automation Studio archive format (.ar) or individual source files (.st, .ld, .c, .h, .var).
1.5 Other Relevant B&R File Formats
| Extension | Purpose |
|---|---|
.st | Structured Text source files |
.ld | Ladder Diagram source files |
.var | Variable declaration files (Global.var, Local.var) |
.c / .h | ANSI C source and header files (B&R supports C programming) |
.ar | Automation Studio project archive (includes all dependencies) |
.exp | Export files (legacy PG2000 format) |
.lh | Library header files |
.vis | Visualization pages |
2. B&R IEC 61131-3 Compiler Architecture
2.1 Compilation Pipeline Overview
B&R Automation Studio compiles IEC 61131-3 programs (Structured Text, Ladder Diagram, Function Block Diagram, Sequential Function Chart) through a multi-stage pipeline:
Source (.st/.ld/.sfc) → Frontend Parser → Intermediate Representation (IR)
↓
C Source (.c/.h) → GCC Cross-Compiler → Object (.obj)
↓
Linker → Binary Module (.br)
Key characteristics:
- The IEC 61131-3 languages are compiled through a proprietary frontend that produces an intermediate representation
- This IR is then translated to C code, which is compiled by an embedded GCC cross-compiler targeting the PLC’s CPU architecture
- Final linking produces the
.brbinary module in native machine code - B&R supports both IEC 61131-3 languages and native ANSI C programming on the same controller
2.2 Target Architectures
B&R controllers span multiple CPU architectures, which determines the instruction set of the compiled binary:
| Controller Series | CPU Architecture | Example CPUs |
|---|---|---|
| X20/X67 | Intel Atom (x86) or ARM | Atom E3940, ARM Cortex |
| Power Panel / Panel PC | Intel Core-i (x86_64) | Celeron to Core i7 |
| CP47x Series | 32-bit (proprietary, ~150 MHz) | CP474-EL |
| APC (Automation PC) | Intel x86_64 | Various Core-i generations |
| ACOPOStrak/motors | ARM or PowerPC | Various embedded cores |
The Claroty Team82 research confirmed: “B&R X20 series offers a modular and compact PLC configuration. It is based on an Intel ATOM CPU (X86) or ARM architecture, and runs VxWorks as its RTOS firmware.”
2.3 Runtime Environment
All modern B&R controllers run Automation Runtime (AR), B&R’s proprietary real-time operating system based on VxWorks (see ar-rtos.md for full OS internals). Older B&R 2005 systems and some legacy controllers used different RTOS solutions. Automation Runtime provides:
- Deterministic cyclic task execution (see execution-model.md for task scheduling details)
- I/O bus management (X2X, POWERLINK, EtherCAT) — see x2x-protocol.md and powerlink-internals.md
- Memory management for program modules — see memory-map.md for the full address layout
- Communication stack (OPC UA, Modbus, proprietary protocols) — see opcua.md and modbus-gateway.md
The compiled .br modules are loaded and executed by Automation Runtime as native code, running directly on the CPU without any bytecode virtual machine layer. The boot sequence that loads these modules is documented in cf-card-boot.md.
3. Bytecode vs. Native Code: B&R’s Approach
3.1 B&R Compiles to Native Code
B&R does not use an intermediate bytecode format like Siemens MC7. This is a critical architectural difference from other major PLC vendors:
| Vendor | Compilation Target | Execution Model |
|---|---|---|
| B&R | Native machine code (x86/ARM) | Direct CPU execution |
| Siemens S7-300/400 | MC7 bytecode | Virtual machine interpreter |
| Siemens S7-1200/1500 | MC7+ bytecode | Virtual machine with JIT |
| CODESYS (generic) | Proprietary bytecode | Virtual machine interpreter |
| Beckhoff TwinCAT | Native machine code | Direct execution |
The B&R compilation pipeline translates IEC 61131-3 source code through C to native machine code using GCC. This means:
- No virtual machine layer — the compiled code runs as direct x86/ARM instructions
- Better performance — no interpretation or JIT overhead
- Harder to reverse engineer — the output is standard machine code, not a structured bytecode with documented opcodes
- Standard tools apply — disassemblers for x86/ARM can analyze the binary directly
3.2 Contrast with Siemens MC7 Bytecode
Siemens S7 PLCs compile all IEC 61131-3 languages into MC7/MC7+ bytecode, a lower-level representation executed by a virtual machine in the PLC. As Claroty’s research describes: “Regardless of input sources, the PLC program will be compiled into MC7 / MC7+ bytecode, which is a lower-level representation of the code. After being compiled by the engineering station, code blocks (in MC7/MC7+ format) are downloaded and installed into a PLC.”
MC7 bytecode has been partially reverse-engineered by the security community:
- The rizin reverse engineering framework includes
rz-libmc7for disassembling MC7 bytecode - PNF Software’s JEB decompiler supports S7 PLC program analysis
Source: https://claroty.com/team82/research/the-race-to-native-code-execution-in-plcs Source: https://github.com/rizinorg/rz-libmc7
B&R’s native code compilation means no equivalent bytecode specification exists to leverage for analysis.
4. Approaches to Decompilation and Disassembly
4.1 Disassembly (Native Code)
Since B&R compiles to native x86/ARM machine code, standard disassembly toolchains apply. The CP1584 uses an Intel Atom E640T (x86, 32-bit). See cp1584-hardware-ref.md for the full CPU specification and ar-rtos.md for the AR runtime environment details.
For x86-based controllers (X20, APC, Power Panel):
- Use disassemblers that support x86 (32-bit or 64-bit depending on CPU)
- Identify code regions by looking for function prologues and epilogues
- The GCC-compiled code will follow standard x86 calling conventions
For ARM-based controllers:
- Use ARM disassemblers (ARMv7, ARMv8 depending on CPU)
- Standard ARM calling conventions (AAPCS) will apply
Practical Disassembly Workflow with Ghidra
Ghidra (NSA’s open-source reverse engineering suite) is the recommended tool for analyzing B&R .br binaries:
# Install Ghidra (requires JDK 17+)
# Download from https://github.com/NationalSecurityAgency/ghidra/releases
# Create a project and import the .br file
# Ghidra will prompt for language/specification:
# - For CP1584 (Intel Atom, 32-bit): x86:LE:32:default
# - For newer X20CP3xxx (x86_64): x86:LE:64:default
# - For ARM-based modules: ARM:LE:32:v8
# After import, run auto-analysis. Key steps:
# 1. Window → Defined Strings — extract all string constants
# 2. Window → Functions — review identified function boundaries
# 3. Window → Data Type Manager — look for known B&R data structures
# 4. Symbol Tree → Exports/Imports — find library function calls
# Search for IO address patterns (memory-mapped IO ranges):
# Search → For Bytes → 0x...
# B&R IO ranges are documented in memory-map.md
Binary Identification Commands
# Step 1: Identify file format
file binary.br
# Expected: may show "data" if proprietary, or "ELF" if B&R wraps standard format
# Step 2: Find embedded format signatures
binwalk binary.br
# Look for: ELF headers, PE headers, LZMA/zlib compressed sections
# Step 3: Extract all strings (minimum 6 characters for useful output)
strings -n 6 -t x binary.br > strings_output.txt
# Step 4: Extract Unicode strings (B&R IEC STRING type may use wide chars)
strings -e l -n 4 binary.br > unicode_strings.txt
# Step 5: Look for B&R-specific identifiers
grep -i "BR_\|Automation\|POWERLINK\|X2X\|mbtcp\|AsMb\|mapp" strings_output.txt
# Step 6: Quick hex analysis of file header
xxd -l 512 binary.br | head -32
Python Script: Automated B&R Binary Analyzer
#!/usr/bin/env python3
"""Analyze B&R .br binary files for recoverable information."""
import struct
import sys
import re
from collections import Counter
def analyze_br_binary(filepath):
with open(filepath, 'rb') as f:
data = f.read()
print(f"=== B&R Binary Analysis: {filepath} ===")
print(f"File size: {len(data):,} bytes ({len(data)/1024:.1f} KB)")
print()
# Check for known file format magic bytes
magic_checks = [
(b'\x7fELF', 'ELF binary'),
(b'MZ', 'PE executable'),
(b'\x1f\x8b', 'gzip compressed'),
(b'BZh', 'bzip2 compressed'),
(b'\x5d\x00\x00', 'LZMA compressed'),
]
for magic, name in magic_checks:
if data[:len(magic)] == magic:
print(f"Format: {name}")
# Check if file starts with a B&R-specific header
if data[:2] == b'BR' or data[:4] == b'BR\x00\x00':
print("Format: B&R proprietary header detected")
print(f"Header bytes: {data[:32].hex()}")
print()
# Extract ASCII strings (min 6 chars)
ascii_pattern = re.compile(rb'[\x20-\x7e]{6,}')
strings_found = ascii_pattern.findall(data)
print(f"ASCII strings found: {len(strings_found)}")
# Categorize strings
categories = Counter()
interesting = []
for s in strings_found:
s_decoded = s.decode('ascii', errors='ignore')
if re.search(r'\.st|\.ld|\.var|\.c|\.h|\.vis', s_decoded):
categories['source_file_refs'] += 1
interesting.append(s_decoded)
elif re.search(r'mapp|AsMb|POWERLINK|X2X|Modbus|OPC|SDM', s_decoded):
categories['library_refs'] += 1
interesting.append(s_decoded)
elif re.search(r'Error|Fault|Alarm|Warning', s_decoded):
categories['diagnostics'] += 1
interesting.append(s_decoded)
elif re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', s_decoded):
categories['ip_addresses'] += 1
interesting.append(s_decoded)
print("String categories:")
for cat, count in categories.most_common():
print(f" {cat}: {count}")
if interesting:
print(f"\nInteresting strings (top 30):")
for s in interesting[:30]:
print(f" {s}")
# Look for x86 function prologue patterns (push ebp; mov ebp, esp)
prologue = b'\x55\x8b\xec'
prologue_count = 0
pos = 0
while True:
pos = data.find(prologue, pos)
if pos == -1:
break
prologue_count += 1
pos += 1
print(f"\nPotential x86 function prologues (55 8B EC): {prologue_count}")
# Look for standard calling convention patterns
ret_count = data.count(b'\xc3') # x86 RET instruction
print(f"RET instructions (C3 hex): {ret_count}")
print(f"\n=== Analysis complete ===")
print(f"For IO address mapping, cross-reference with [memory-map.md](memory-map.md)")
print(f"For runtime environment details, see [ar-rtos.md](ar-rtos.md)")
if __name__ == "__main__":
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} <binary.br>")
sys.exit(1)
analyze_br_binary(sys.argv[1])
4.2 Decompilation
Decompilation of native machine code to recover IEC 61131-3 source is effectively impossible. The compilation pipeline goes through C as an intermediate step, and:
- The IEC 61131-3 → C translation is lossy (structured control flow is linearized)
- The C → machine code compilation is lossy (variable names stripped, optimizations applied)
- No decompiler can reconstruct structured text, ladder diagrams, or function block diagrams from x86/ARM machine code
- At best, you can recover C-like pseudocode showing control flow and data operations
4.3 Structured Analysis Methodology
A practical approach to understanding B&R compiled code:
- Binary format identification — Use
file,binwalk, or hex analysis to determine the format - Architecture detection — Identify the target CPU from file headers
- Section mapping — Identify code, data, and symbol sections
- String extraction — Pull all string literals for contextual clues
- Function identification — Locate function boundaries using prologue patterns
- Cross-reference building — Track data references and call relationships
- IO address correlation — Match memory-mapped IO addresses with hardware documentation
4.4 Academic Frameworks
The research community has developed frameworks for PLC binary analysis, though none are B&R-specific:
ICSREF (NDSS 2019): Automated reverse engineering of CODESYS PLC binaries. While focused on CODESYS (not B&R), the methodology of binary format reverse engineering, symbol table recovery, and control flow analysis is applicable.
Source: https://www.ndss-symposium.org/ndss-paper/icsref-a-framework-for-automated-reverse-engineering-of-industrial-control-systems-binaries/ Code: https://github.com/momalab/ICSREF
PLC-BinX (2025): Cross-platform binary code analysis for PLC binaries. Implements CODESYS-specific reverse engineering with three stages: identifying code regions, recovering function boundaries, and semantic analysis.
5. Tools for Analyzing B&R Binary Files
5.1 Standard Reverse Engineering Tools
| Tool | Applicability to B&R | Notes |
|---|---|---|
| IDA Pro | High | Industry-standard disassembler/decompiler. Supports x86, ARM. IDAPython scripting for custom analysis. Commercial license required. |
| Ghidra | High | NSA’s open-source reverse engineering suite. Supports x86, ARM. Built-in decompiler produces C pseudocode. Scriptable via Java/Python. Free. |
| rizin/radare2 | High | Open-source framework. Has rz-libmc7 plugin for Siemens MC7 but also supports standard x86/ARM disassembly. |
| Binary Ninja | Medium-High | Commercial RE platform with good x86/ARM support and API. |
| objdump | Medium | GNU binutils tool. Can disassemble x86/ARM sections if the .br format uses standard ELF/COFF object wrappers. Limited without format documentation. |
| readelf | Medium | Reads ELF headers and sections. Useful if B&R’s internal format wraps standard ELF. |
| file | Low-Medium | Identifies file type from magic bytes. May or may not recognize B&R proprietary formats. |
| binwalk | Medium | Scans for embedded file signatures, compressed sections, and known file headers within the binary. |
| strings | High | Extracts printable ASCII/Unicode strings. Simple but effective for finding variable names, error messages, configuration strings. |
5.2 B&R-Specific Considerations
Standard tools work on B&R binaries only if the underlying format is recognizable (e.g., ELF-wrapped). If B&R uses a fully proprietary container format with custom headers, initial analysis requires:
- Manual hex analysis to identify format structure
- Custom parsing scripts (Python with
structmodule) to extract sections - Pattern-based identification of code vs. data regions
The B&R C compiler is GCC-based, which means compiled C code within B&R modules will exhibit standard GCC characteristics:
- Standard function prologues (
push ebp; mov ebp, espfor x86) - DWARF debug sections (if debug info is present)
- Standard calling conventions
For the complete CP1584 hardware specification (CPU, memory, interfaces) that determines the binary architecture, see cp1584-hardware-ref.md.
5.3 Extracting the Binary from a Running CP1584
When you have physical access to the PLC but no project files, the compiled binaries reside on the CompactFlash card. See cf-card-boot.md for the full CF card file layout and ftp-web-interface.md for remote extraction methods:
# Method 1: FTP access (if FTP server is enabled on the CP1584)
ftp 192.168.10.1
# Navigate to /Card/ or /System/ directories
# Compiled binaries are typically in:
# /Card/System/B&R/ or /System/Objects/
# Files may have .br, .obj, or no extension
# Method 2: Physical CF card extraction (power down first!)
# Remove CF card, image it with dd on a Linux workstation:
dd if=/dev/sdb of=cp1584_cf_card.img bs=4M status=progress
# Mount and explore:
sudo mount -o ro,loop cp1584_cf_card.img /mnt/cf_card/
find /mnt/cf_card/ -name "*.br" -o -name "*.obj"
# Method 3: ARsim (if you have the binary file)
# Load the .br into Automation Studio's ARsim for behavioral analysis
# This runs the binary in a PC-based simulation environment
5.3 Automation Studio’s Own Analysis Tools
While not reverse engineering tools per se, Automation Studio provides capabilities for understanding code structure:
- Cross-Reference Generator: Must be explicitly generated (not built by default). Shows all uses of any variable, function block, or data object across the project.
- List Usage: Tracks variable usage across all code blocks.
- Find in Files: Global text search across project source files.
6. Information Recoverable from Compiled Code
6.1 What CAN Be Recovered
| Information | Recoverability | Method |
|---|---|---|
| String literals | High | strings tool or manual extraction from data sections |
| Error messages / alarm text | High | String extraction from read-only data sections |
| Constant values | High | Found as immediate operands in disassembled code |
| Control flow structure | Medium | Disassembly and control flow graph reconstruction |
| Function boundaries | Medium | Prologue/epilogue pattern matching |
| Library function calls | Medium | External call references and imported function names |
| Symbolic variable names | Medium-Low | Only if symbol table was included in the binary |
| Data structure layout | Low-Medium | Inferred from access patterns in disassembled code |
| IO mapping addresses | Low-Medium | Memory-mapped addresses in data access instructions |
6.2 What CANNOT Be Recovered
| Information | Reason |
|---|---|
| Original IEC 61131-3 language (ST/LD/FBD/SFC) | Language-specific constructs are lost during compilation to C and then to machine code |
| Original variable names | Stripped during compilation unless explicitly retained in symbol table |
| Comments | Never included in compiled output |
| Ladder diagram topology | Rung structure, contacts, and coils cannot be reconstructed from machine code |
| Function block diagram connections | Visual wiring is lost; only the resulting logic remains |
| Visualization pages | Separate from program code; not included in compiled binary |
| Task configuration | Stored in project metadata, not in the compiled binary module |
| Hardware configuration | Separate from program code; defined in the .pc project file |
| Original project organization | POU hierarchy and project tree structure not preserved in binary |
6.3 B&R’s Own Statement
B&R explicitly states that compiled application objects loaded to the controller contain:
- Binary machine code for the CPU
- Compiled library references
- Configuration parameters
- Symbolic variable names (if enabled)
And explicitly do not contain:
- Original POU source files
- Task configuration in XML format
- Visualization pages
7. Configuration Data in Compiled Binaries
7.1 IO Mapping
B&R IO mapping is typically defined in the project hardware configuration and stored in the .pc project file and associated configuration objects. The compiled binary itself contains the machine code that reads from and writes to memory-mapped IO addresses, but the mapping metadata (which physical terminal maps to which software variable) is stored separately in the project configuration.
In the compiled code, IO access appears as memory reads/writes to specific address ranges:
- Digital IO: bit-level access to memory-mapped regions
- Analog IO: word/dword access to specific address offsets
- Communication data: structure-based access to protocol buffer areas
7.2 Task Configuration
Task configuration (cycle times, priorities, task-to-POU assignments) is defined at the project level and is part of the project metadata downloaded to the controller. This configuration tells Automation Runtime when and how to invoke each compiled program module.
The task configuration is likely stored in a separate configuration block within the download package, not within the .br binary module itself. Automation Runtime reads this configuration to set up the cyclic execution schedule.
7.3 Parameter Data
B&R supports “Data Objects” (DatObj) — persistent parameter blocks that can be read/written at runtime. These are managed via the DataObj library and stored in separate memory areas on the PLC, distinct from the compiled program code.
Source: https://community.br-automation.com/t/as4-as6-datobj-data-modules-on-the-plc/7656
8. String Extraction from Compiled Code
8.1 Techniques
String extraction is one of the most productive analysis techniques for B&R binaries:
Basic string extraction:
strings -n 6 -t x binary.br > strings_output.txt
Unicode string extraction:
strings -e l -n 4 binary.br > unicode_strings.txt
Context-aware extraction:
- Look for string references in disassembled code (addresses of
leaormovinstructions pointing to data sections) - Cross-reference string addresses with code that uses them for functional context
- B&R IEC string type uses a structure with length + data; look for these patterns
8.2 What Strings Reveal
In B&R compiled code, strings typically include:
- Variable names: If the symbol table is embedded (controlled by compiler settings)
- Error/alarm messages: Hardcoded message strings from alarm handling
- OPC UA tag names: If OPC UA server configuration includes string identifiers
- File paths: Configuration file paths or log file names
- Network addresses: Hardcoded IP addresses or hostnames
- Protocol identifiers: POWERLINK, EtherCAT, Modbus identifiers
- Function block instance names: If debugging information is included
- User-defined string constants: Any
STRINGtyped constant in the source code
8.3 B&R IEC String Format
B&R’s IEC 61131-3 STRING type uses a specific memory layout: a header byte containing the maximum length followed by the actual string data (not null-terminated in the traditional C sense, though a null terminator may be present for compatibility). When searching for IEC strings in binary data, look for patterns of a length byte followed by ASCII text.
9. Cross-Referencing with Live PLC Behavior
9.1 Online Monitoring with Automation Studio
Automation Studio provides online monitoring capabilities when connected to a running PLC:
Watch/Trace:
- Add variables to the watch window to monitor real-time values
- Force variables to specific values to observe program response
- Set breakpoints in source code (only with source available)
- Single-step through program execution
Online View:
- Connect to a running target via Ethernet
- Monitor variable states in real time
- Examine IO states
- View task cycle information and timing
9.2 Using Online Data to Understand Compiled Code
When source code is unavailable but you can connect to a running PLC:
-
Variable enumeration via PVI: B&R’s PVI (Process Visualization Interface) protocol can enumerate all variables available in the runtime, including their symbolic names and memory addresses. This works without source code. See pvi-api.md for the complete PVI API reference.
-
PVI Monitor tool: Can view all available variables in real-time and export the variable list. The runtime stores variable metadata in its memory structure.
-
OPC UA browsing: If OPC UA is configured on the PLC, any OPC UA client can browse the address space and extract variable names, types, and current values. See opcua.md for OPC-UA configuration details.
-
System variables: AR system variables (CPU temperature, cycle times, task info) are always available and provide runtime context. See system-variables.md for the full list.
-
Behavioral analysis: By manipulating inputs and observing outputs, you can map the functional behavior of the compiled program, even without understanding the internal code. Use io-sniffing.md for intercepting fieldbus traffic and diagnostics-sdm.md for SDM-based error tracking.
9.3 Limitations of Online Analysis
- Cannot see internal logic or program flow
- Cannot modify program code
- Cannot recover original source structure
- Variable names are only available if they were included in the compiled binary
- No access to visualization or task configuration through online monitoring alone
10. Legal Considerations
10.1 Overview of Applicable Law
Reverse engineering of industrial control software is subject to multiple overlapping legal frameworks. This section provides general information, not legal advice. Consult qualified counsel for specific situations.
10.2 U.S. Law — Key Statutes
DMCA Section 1201 (17 U.S.C. § 1201): Prohibits circumventing “technological protection measures” that control access to copyrighted works. Software vendors may argue that authentication, code signing, obfuscation, and protocol encryption are protected technical measures. Section 1201(f) provides a narrow exception for reverse engineering “for the sole purpose of identifying and analyzing elements of the program necessary to achieve interoperability” with an independently created program.
Copyright Law (17 U.S.C. § 107 — Fair Use): Making copies of software for analysis may qualify as fair use, particularly for interoperability research (established in Sega v. Accolade and Sony v. Connectix). However, fair use is a fact-specific defense, not a guarantee.
Trade Secret Law: Reverse engineering through fair and independent means does not generally violate trade secret law. However, if you obtained the software subject to an NDA or contractual obligation prohibiting reverse engineering, analysis may constitute misappropriation.
Contract Law (EULAs/NDAs): Many industrial software licenses include “no reverse engineering” clauses. The Blizzard v. BnetD case established that mass-market EULA provisions prohibiting reverse engineering can be enforceable, potentially overriding fair use rights.
ECPA (18 U.S.C. § 2510): Network packet inspection during analysis may require consent of parties or the network operator.
Source: https://www.eff.org/issues/coders/reverse-engineering-faq
10.3 Industrial Control-Specific Considerations
- Safety implications: Modifying or incorrectly reconstructing PLC logic can cause physical harm, equipment damage, or environmental releases. Any reverse engineering of safety-critical systems carries extraordinary liability risk.
- OEM contractual obligations: Machine builders and system integrators typically own the PLC programs and may have contractual rights protecting their intellectual property.
- Regulatory compliance: Industries such as pharmaceutical, food, nuclear, and chemical have regulatory requirements around validated control systems. Unauthorized modification of validated PLC programs can violate regulations (FDA 21 CFR Part 11, etc.).
- B&R licensing: B&R Automation Studio itself is licensed software. Using it in ways that violate the B&R license agreement creates contractual risk.
10.4 Legitimate Use Cases
Reverse engineering of PLC code may be legally defensible in certain scenarios:
- Security research: Analyzing binaries for vulnerabilities (with responsible disclosure)
- Interoperability: Developing compatible systems when no documentation exists
- Legacy system maintenance: When the original vendor is unavailable and no source exists
- Malware analysis: Investigating known or suspected PLC malware (e.g., Stuxnet-style attacks)
- Forensic investigation: Post-incident analysis after a cybersecurity event
10.5 Risk Mitigation
- Consult legal counsel before beginning any reverse engineering
- Ensure lawful acquisition of the software
- Avoid agreeing to “no reverse engineering” clauses where possible
- Use least-intrusive techniques first (online monitoring before binary disassembly)
- Document the legitimate purpose of the analysis
- Consider engaging the vendor or OEM for authorized access to documentation
11. Using Automation Studio’s Online View
11.1 Connection Setup
- Connect PC to PLC via Ethernet
- In Automation Studio:
Online → Settings → Browse for Targets - Select the target controller from the list
- Establish the online connection
11.2 Available Online Capabilities (Without Source)
Even without the source project, Automation Studio can connect to a running PLC and provide:
| Capability | Without Source | With Source |
|---|---|---|
| Monitor variable values | Yes (if symbols available) | Yes |
| Force variables | Yes (with appropriate permissions) | Yes |
| View task status | Yes | Yes |
| Examine IO states | Yes | Yes |
| Set breakpoints | No | Yes |
| Single-step execution | No | Yes |
| Cross-reference variables | No | Yes |
| Modify program code | No | Yes |
11.3 Extracting Symbol Tables Online
When connected to a running PLC with Automation Studio (even without source code), you may be able to:
- Browse the online variable list
- Export the symbol table if the runtime exposes it
- Monitor and log variable values over time
- Identify the data types and memory addresses of variables
This provides partial documentation of the running program’s data model, which can be combined with binary analysis for a more complete picture.
11.4 ARsim (Simulation)
Automation Studio includes ARsim (Automation Runtime Simulation), which allows running compiled programs on a PC without physical hardware. If you have the compiled binary, you can potentially load it into ARsim and observe its behavior, which provides a controlled environment for behavioral analysis.
12. Recovery of IO Mapping from Compiled Binaries
12.1 Approaches
From the binary itself:
- Disassemble the compiled code and look for memory access patterns to known IO address ranges (see memory-map.md for the full CP1584 address space)
- B&R IO is memory-mapped; IO modules appear at specific addresses in the controller’s address space — see io-card-hardware.md for IO card architecture details
- Identify reads from input addresses and writes to output addresses by analyzing
mov,load, andstoreinstructions - Cross-reference these addresses with B&R hardware documentation to identify physical IO points
From the runtime (online):
- Connect to the running PLC via PVI or OPC UA
- Browse the variable namespace for IO-mapped variables
- Examine the addressing in the variable declarations
- Use Automation Studio’s hardware comparison feature (AS 4.0+): “Automation Studio provides a new access to compare configured hardware and software with online connected hardware.”
- Use the system diagnostic manager (SDM) to identify IO module status — see diagnostics-sdm.md
From project artifacts:
- If any project files survive (even partial), the hardware configuration in the
.pcfile contains the IO mapping — see config-file-formats.md for the file format details - IO configuration is typically stored in XML within the project structure
- Check for backup files, version control archives, or configuration exports
- The CF card contains configuration files that define the IO layout — see cf-card-boot.md
12.2 B&R IO Addressing
B&R uses a hierarchical addressing scheme:
- Hardware modules are addressed by bus and slot position
- Software variables are mapped to these hardware addresses through the IO mapping configuration
- The compiled code accesses IO through these mapped addresses
Without the project configuration, you must reverse-engineer the mapping by:
- Identifying all memory-mapped IO addresses in the disassembled code
- Determining which addresses are reads (inputs) vs. writes (outputs)
- Correlating addresses with known hardware module specifications
- Testing hypotheses by manipulating physical IO and observing program behavior
12.3 Limitations
- Complex IO mapping (aliasing, scaling, offset calculations) embedded in the code may be difficult to identify
- Network-based IO (POWERLINK, EtherCAT, OPC UA) may not follow simple memory-mapped patterns
- IO configuration for Safety systems (Safety PLC) may be additionally protected
13. B&R Symbol Export/Import Mechanisms
13.1 Library-Based Symbol Management
B&R provides a library system that supports partial IP protection through compiled libraries:
Compiled Libraries:
- Functions and function blocks can be compiled into binary libraries and distributed without source code
- The library exports symbolic interface definitions (function names, parameter types) while hiding the implementation
- Consumers can import and use the library in their projects, but cannot view the internal code
- Binary libraries are compiled for specific CPU architectures (ARM, x86)
Library Export:
- Automation Studio supports exporting libraries in compiled (binary) form
- “When exporting binary libraries they are only compiled for the CPU architectures used in the project. So a good way is to have one ARM CPU (Like X20CP0484) and one Intel CPU (Like X20CP1585) to make sure the library can be used on both.”
13.2 Symbol Table Settings
B&R provides compiler settings that control whether symbolic information is included in compiled binaries:
- Symbol export: Can be enabled/disabled at the project or module level
- Debug information: DWARF debug sections can be included (increases binary size but preserves variable names and types)
- Variable address information: Can be exported for online monitoring purposes
13.3 Source Code Protection Features
B&R offers several mechanisms for protecting intellectual property:
- Compiled libraries: Distribute code as pre-compiled binaries with only interface definitions exposed
- Password protection: Tasks and libraries can be password-protected (anyone can use them, but only the password holder can modify them)
- Source file “encryption”: Automation Studio has a source file protection feature, though B&R community discussions reveal it is “more of an access control check/deterrent than true encryption”
Source: https://community.br-automation.com/t/automate-encrypting-source-files/11031 Source: https://community.br-automation.com/t/hiding-parts-of-my-program/3247
13.4 Technology Guarding
B&R’s Technology Guarding system provides additional protection for intellectual property through a server-based licensing system. It uses SSL/TLS encryption for secure communication with Automation Studio. For license recovery procedures when the OEM is unavailable, see license-mgmt.md.
13.5 Extracting Binaries Without Automation Studio Access
When you cannot connect Automation Studio to the PLC (e.g., password-protected — see access-recovery.md for recovery procedures), alternative binary extraction paths exist:
- FTP server: If enabled, the FTP interface exposes the CF card file system remotely (see ftp-web-interface.md)
- Physical CF card removal: Power down, remove the CF card, and image it on a workstation (see cf-card-boot.md)
- Web server / SDM: The System Diagnostics Manager web interface may expose limited file access
- Serial console: The bootloader recovery mode provides limited file system access via serial (see bootloader-recovery.md)
14. Practical Limitations
14.1 Hard Limitations — What Cannot Be Done
-
Source code recovery: B&R compiled binaries cannot be decompiled back to original IEC 61131-3 source code. This is a fundamental limitation, not a tool limitation.
-
Source upload from PLC: “By default, B&R does not save source code on the target. Only the compiled binary is stored, which cannot be decompiled to source code.” Automation Studio cannot upload source code from a connected controller.
-
Language reconstruction: You cannot determine whether the original code was written in Structured Text, Ladder Diagram, or any other IEC 61131-3 language from the compiled binary.
-
Visualization recovery: HMI/visualization pages are never included in compiled program binaries.
-
Project organization: The original project structure, naming conventions, and organization are lost in compilation.
-
Comments and documentation: All developer comments and inline documentation are stripped during compilation.
14.2 Partial Recovery — What Can Sometimes Be Done
-
Variable names: Recoverable if symbol table was included in the binary (controlled by compiler settings) or via online PVI enumeration from a running PLC.
-
Control flow: Recoverable at the machine code level using disassemblers and decompilers, yielding C-like pseudocode. The high-level IEC semantics are lost.
-
String constants: Fully recoverable from the data sections of the binary.
-
IO mapping: Partially recoverable through combination of binary analysis and online monitoring.
-
Library dependencies: Import/export symbols reveal which external libraries the code depends on.
-
Functional behavior: Can be observed and documented through online monitoring and IO manipulation.
14.3 Effort vs. Reward Assessment
| Goal | Feasibility | Effort Required | Practical Approach |
|---|---|---|---|
| Full source recovery | Impossible | N/A | Contact OEM/B&R support |
| Functional understanding | Possible | Very High | Online monitoring + behavioral analysis |
| IO mapping documentation | Possible | High | PVI enumeration + manual tracing |
| Variable list extraction | Possible | Low-Medium | PVI tools or OPC UA browsing |
| Security audit | Possible | Very High | Binary disassembly + fuzzing + protocol analysis |
| Migration to new platform | Possible | Very High | Recreate logic from behavioral analysis + documentation |
14.4 Recommended Practical Workflow
When faced with a B&R PLC running unknown compiled code:
- Connect online and extract the variable list via PVI/OPC UA
- Document all IO behavior by systematically toggling inputs and recording outputs
- Extract all strings from the binary for contextual information
- Identify the CPU architecture to select appropriate disassembly tools
- Disassemble the binary with Ghidra or IDA Pro for structural analysis
- Cross-reference online behavior with disassembled code to build understanding
- Document findings in a format suitable for recreation in a new project
- Recreate the program in a new Automation Studio project based on documented behavior
References
B&R Official Documentation
- B&R Automation Studio Quick Start: https://instrumentacionycontrol.net/wp-content/uploads/2017/11/IyCnet_BR_AutomationStudio_QuickStart_MASYS2ASQS-E_240.pdf
- B&R Automation Runtime product page: https://www.br-automation.com/en-us/products/software/automation-runtime/
- B&R Programming overview: https://www.br-automation.com/en-us/products/software/additional-information/programming/
- Awesome B&R (curated resource list): https://github.com/hilch/awesome-B-R
B&R Community Forum Discussions
- Source code upload from PLC: https://community.br-automation.com/t/upload-program-from-a-plc/1520
- Source file encryption: https://community.br-automation.com/t/automate-encrypting-source-files/11031
- Library export/import: https://community.br-automation.com/t/error-occured-while-build-source-after-export-import-library/6564
- Variable tracking and cross-reference: https://community.br-automation.com/t/new-to-b-r-best-practices-for-tracking-variables-list-usage-cross-ref-and-tracing-physical-i-os/11429
- Cross-reference generation: https://community.br-automation.com/t/cross-reference-doesnt-work/3737
- Data modules on PLC: https://community.br-automation.com/t/as4-as6-datobj-data-modules-on-the-plc/7656
- Technology Guarding: https://community.br-automation.com/t/ssl-tls-encryption-required-for-access-to-technology-guarding-server-and-automation-studio-upgrades/3049
- Password protection: https://community.br-automation.com/t/preventing-unauthorized-writing-to-a-plc-program/3607
- Variable addresses after compilation: https://community.br-automation.com/t/automation-studio-4-7-4-12-variable-addresses-after-compilation/7920
Reverse Engineering Research
- ICSREF Framework (NDSS 2019): https://www.ndss-symposium.org/ndss-paper/icsref-a-framework-for-automated-reverse-engineering-of-industrial-control-systems-binaries/
- ICSREF GitHub: https://github.com/momalab/ICSREF
- PLC-BinX Cross-Platform Analysis: https://arxiv.org/html/2605.17392v2
- Bridging the PLC Binary Analysis Gap: https://arxiv.org/html/2502.19725v1
Siemens MC7 and Comparative Analysis
- Claroty: The Race to Native Code Execution in PLCs: https://claroty.com/team82/research/the-race-to-native-code-execution-in-plcs
- rz-libmc7 (MC7 disassembler): https://github.com/rizinorg/rz-libmc7
- PNF Software: Reversing Simatic S7 PLC Programs: https://www.pnfsoftware.com/blog/reversing-simatic-s7-plc-programs/
- JEB S7 Decompiler: https://www.pnfsoftware.com/decompilation
- PLC Ladder Logic to Machine Code compilation: https://industrialmonitordirect.com/blogs/knowledgebase/how-plcs-compile-ladder-logic-to-machine-code
- PLC Bytecode Decompilation technique: https://www.semanticscholar.org/paper/A-technique-for-bytecode-decompilation-of-PLC-Lv-Xie/af413f314cc5ab57bb94d96ffc110f521a8284b0
Security Research
- Claroty: Evil PLC Attack whitepaper: https://web-assets.claroty.com/resource-downloads/team82-evil-plc-attack-research-paper-1661285586.pdf
Legal References
- EFF Reverse Engineering FAQ: https://www.eff.org/issues/coders/reverse-engineering-faq
- 17 U.S.C. § 1201 (DMCA Anti-Circumvention): https://www.law.cornell.edu/uscode/text/17/1201
- PLC Password Protection and IP: https://industrialmonitordirect.com/blogs/knowledgebase/plc-password-protection-source-code-escrow-and-intellectual-property-management-for-industrial-autom?srsltid=AfmBOopuLnOpof2E3gCKMNhGvoeeNun-gW7fS9KtzlnXhKMcnI9oT661
Practical Guides
- B&R CP474 Source Code Recovery: https://industrialmonitordirect.com/blogs/knowledgebase/br-cp474-source-code-upload-is-recovery-possible
- Extracting Variables Without Source Code: https://industrialmonitordirect.com/blogs/knowledgebase/extracting-variables-from-br-cp476-plc-without-source-code
- Reverse Engineering PLC Programs Without Documentation: https://industrialmonitordirect.com/blogs/knowledgebase/reverse-engineering-plc-programs-without-documentation
- B&R Binary Code Transfer Without Source: https://industrialmonitordirect.com/blogs/knowledgebase/br-3if26060-1-plc-binary-code-transfer-without-source
- B&R Automation Studio Locating Data Files: https://industrialmonitordirect.com/blogs/knowledgebase/br-automation-studio-locating-data-files-and-cross-references
Community Discussions
- Reddit: Reverse engineering a PLC: https://www.reddit.com/r/PLC/comments/tmibn8/my_boss_wants_to_reverse_engineer_a_plc_and_put/
- Reddit: Methods for reverse engineering ladder logic: https://www.reddit.com/r/PLC/comments/1e5kiq6/what_methods_do_you_use_to_reverse_engineer/
- PLCtalk: B&R PLC software formats: https://www.plctalk.net/forums/threads/b-r-plc-software.108978/
- PLCtalk: Uploading from B&R X20CP0292: https://www.plctalk.net/forums/threads/upload-its-program-from-b-r-x20cp0292-by-using-automation-studio-4-3.118261/
- MrPLC: Opening B&R 2005 files: https://mrplc.com/forums/topic/33225-open-br-2005-files/
Key Findings
-
B&R compiles IEC 61131-3 source through a proprietary frontend to C code, then through an embedded GCC cross-compiler to native x86/ARM machine code (
.brfiles). There is no intermediate bytecode layer like Siemens MC7, meaning standard disassemblers (IDA Pro, Ghidra, rizin) can analyze the binaries directly using conventional x86/ARM techniques. -
Source code cannot be recovered from compiled
.brbinaries. The IEC-to-C-to-machine-code pipeline is doubly lossy: language-specific constructs (ladder rungs, FBD wiring, SFC steps) are destroyed in the first translation, and variable names, comments, and project structure are stripped in the second. At best, C-like pseudocode can be recovered via Ghidra’s decompiler. -
Automation Studio cannot upload source code from a running PLC – only compiled binaries are stored on the controller. Without the original
.arproject archive, the only actionable recovery paths are: (a) online monitoring via PVI/AS to extract variable names and values, (b) binary disassembly to recover control flow and constant values, and (c) IO mapping recovery from memory access patterns in the disassembled code. -
Information with the highest recoverability from binaries includes string literals, error messages, constant values (immediate operands), function boundaries (prologue/epilogue patterns), and library call references. Symbolic variable names are only recoverable if the compiler’s symbol export option was enabled at build time.
-
The ICSREF framework (NDSS 2019, github.com/momalab/ICSREF) and PLC-BinX (2025) provide automated PLC binary analysis methodologies, though neither is B&R-specific. ICSREF’s approach – format identification, symbol table recovery, control flow analysis – is directly applicable to B&R’s GCC-compiled output.
-
B&R provides four IP protection mechanisms: compiled libraries (binary distribution with only interface definitions), password protection (per-task/library), source file “encryption” (actually access control, not real encryption), and Technology Guarding (server-based licensing with SSL/TLS). The encryption mechanism is acknowledged by the community as a deterrent, not cryptographic protection.
-
For practical analysis without source code, connect Automation Studio to the running PLC to monitor variable values, force IO states, and browse the online variable list. ARsim can load compiled binaries for behavioral analysis in a sandboxed PC environment without physical hardware.
-
IO mapping recovery requires identifying memory-mapped read/write patterns in disassembled code (mov/load/store instructions targeting known IO address ranges), then cross-referencing those addresses with B&R hardware documentation to map them to physical IO points. Network-based IO (POWERLINK, EtherCAT) does not follow simple memory-mapped patterns.
Cross-References
| Related File | Relevance |
|---|---|
| cp1584-forensics.md | Information extraction methodology from a running CP1584 without project files |
| project-reconstruction.md | Building a new Automation Studio project from an unknown running PLC |
| memory-map.md | CPU memory map and IO address ranges for binary analysis cross-referencing |
| cf-card-boot.md | CF card file structure where compiled binaries are stored |
| config-file-formats.md | Configuration file formats related to compiled project deployment |
| pvi-api.md | PVI API for online variable browsing and runtime analysis |
| execution-model.md | Task structure and IEC 61131-3 execution model relevant to binary analysis |
| firmware.md | AR firmware architecture and how compiled modules are loaded |
| license-mgmt.md | IP protection and Technology Guarding for compiled libraries |
| access-recovery.md | Gaining access to an undocumented PLC for analysis |
| io-card-hardware.md | IO module addressing for mapping binary IO access patterns to physical modules |
| ar-rtos.md | VxWorks-based OS internals that execute the compiled binaries |
| cp1584-hardware-ref.md | CPU architecture (Intel Atom E640T) determining x86/32-bit binary format |
| opcua.md | OPC-UA server for online variable browsing without source code |
| modbus-gateway.md | Modbus TCP as an alternative data extraction protocol |
| system-variables.md | AR system variables available for runtime monitoring during behavioral analysis |
| diagnostics-sdm.md | System Diagnostics Manager for error tracking on running systems |
| io-sniffing.md | Fieldbus traffic interception for IO behavior mapping |
| ftp-web-interface.md | Remote file access methods for binary extraction |
| bootloader-recovery.md | Serial console access in bootloader mode for binary retrieval |
| online-changes.md | Runtime patching techniques for behavioral testing |
| custom-diagnostic-tools.md | Building diagnostic programs that run on the PLC itself |
| python-diagnostics.md | Python + PVI/OPC-UA scripts for automated data extraction |
| documentation-reconstruction.md | Systematic documentation of undocumented B&R machines |
| safe-io-diagnostics.md | Safety system considerations when analyzing safety-related code |
Document compiled from public sources including B&R documentation, academic research, security publications, and community forums. Last updated: July 2026.
B&R PVI (Process Visualization Interface) — Complete Technical Reference
A comprehensive guide for programmatic PLC access via B&R’s PVI middleware.
Table of Contents
- What PVI Is and How It Works
- The PVI API: C/C++, .NET, COM
- Connecting to a CP1584 via PVI
- Reading and Writing Variables
- Browsing the Variable Namespace Without Project Files
- Pulling Diagnostic Data from a Running CP1584
- Error Handling: Error Codes and Recovery
- Data Types: B&R Types to PVI/C Types
- Callbacks and Event Handling
- Performance Considerations
- Python PVI Bindings
- Using PVI from Linux
- PVI vs OPC-UA: When to Use Which
- PVI License Requirements
- Example Code for Common Diagnostic Tasks
1. What PVI Is and How It Works
Overview
PVI (Process Visualization Interface) is B&R Industrial Automation’s proprietary communication middleware. It abstracts physical connections (Ethernet, serial, CAN, USB) behind a uniform API, enabling PC-based software to discover controllers, access variables symbolically, read/write process data, and manage controller lifecycle.
All higher-level B&R products consume PVI internally — OPC servers, B&R HMI panels, mapp View, Automation Studio’s online functionality, and PVI Transfer.
Client-Server Architecture
PVI uses a client-server principle allowing PVI applications to be operated remotely:
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ PVI Client │ TCP/ │ PVI Manager │ ANSL/ │ B&R Controller │
│ (Application) │◄──────► │ (PviMan.exe) │◄───────►│ (CP1584, X20, │
│ - C API DLL │ │ Windows service │ INA │ APC, PowerPanel│
│ - .NET DLL │ │ or process │ │ Automation RT) │
│ - COM objects │ │ Routes/lines │ │ Port 11160/ANSL │
└──────────────────┘ └──────────────────┘ └──────────────────┘
Key Components
| Component | Location | Function |
|---|---|---|
| PviMan.exe (PVI Manager) | Windows host | Central service: manages line configurations, routes traffic to controllers. Runs as Windows service or process. |
| PVIServer | Automation Runtime (controller) | Exposes process variables from controller tasks to the network. |
| PVI Client Libraries | Application (DLLs) | C/C++ DLL (PviCom.dll), .NET assemblies (BR.AN.PviServices), COM objects. |
| PVI OPC Server | Windows host | Translates OPC DA / UA calls into PVI calls. |
| PVI Monitor | Windows host | GUI tool for monitoring connections, configuring logging, snapshots. |
PVI Lines (Protocols)
PVI routes communication through “lines,” each a different protocol driver:
| Line | Driver Code | Protocol | Use Case |
|---|---|---|---|
| ANSL | LNANSL | Automation Net Standard Language (TCP) | Primary modern protocol for variable access to AR ≥ V4.08 controllers. |
| INA2000 | LNINA | INA2000 (UDP, legacy) | Legacy protocol for older controllers. 255-byte payload per frame limit. REMOVED in PVI 6.x — see critical note below. |
| SNMP | LNSNMP | SNMP v1 | Network configuration (IP, subnet, gateway) of B&R PLCs. |
| MODBUS | LNMODBUS | Modbus TCP | Communication with third-party Modbus devices. |
| NET2000 | LNNET | NET2000 | B&R’s legacy proprietary fieldbus. |
| ADI | LNADI | Automation Device Interface | Direct local access on B&R IPCs (no network). |
| DCAN | LNDCAN | Device CAN | CAN bus communication. |
⚠️ CRITICAL: PVI 6.x Drops INA2000 Support
Starting with PVI version 6 (bundled with Automation Studio 6), B&R completely removed INA2000 protocol support. PVI 6.x supports only ANSL and SNMP lines. This means:
- Any existing code, scripts, or tools using
LNINAwill fail with missing DLL errors on AS6 installations.- The INA2000 DLL (
PviIna.dll) is no longer shipped and cannot be side-loaded.- ANSL is backward-compatible with all AR ≥ V4.08 controllers, including the CP1584 — so migration is straightforward: replace
LNINAwithLNANSLin your connection code.- If you are using a recovered AS4 project and upgrading to AS6, search the entire project for “INA” or “LNINA” and replace with ANSL equivalents.
Migration checklist for existing PVI code:
1. Find all occurrences of: "LNINA", "INA2000", "PviIna" 2. Replace driver code: LNINA → LNANSL 3. Replace protocol string: "INA" → "ANSL" 4. Update connection: UDP port → TCP port (default 1212) 5. Test ANSL connectivity: PVI Manager → Add Line → ANSL → your PLC IPSee firmware-version-mgmt.md §5.3.1 for full AS4→AS6 migration details.
PVI Object Hierarchy
PVI organizes objects in a strict hierarchy. All objects must be created parent-first:
PVI (root)
└── Line (e.g., LNANSL)
└── Device (e.g., TCP/IP interface)
└── CPU/Station (e.g., PLC at 192.168.1.50)
├── Task
│ ├── Variable (process variable)
│ └── Variable ...
├── Module
└── CPU-level Variables (global scope)
PVI Architecture Sources
- B&R PVI Online Help
- B&R Community: How-to guide — all about Automation Net PVI
- B&R PVI Development Setup Download
- Industrial Monitor Direct: B&R PLC Communication Guide
2. The PVI API: C/C++, .NET, COM
C/C++ API (Native)
The C API is the foundational interface exposed through PviCom.dll (on Windows). It uses a flat function-based API with string-based object creation and callback-based event handling.
Key functions:
// Initialization / Shutdown
DWORD PviInitialize( DWORD dwFlags );
DWORD PviUninitialize( void );
DWORD PviInitializeEx( DWORD dwFlags, char *szPviManName ); // connect to specific PVI Manager
// Object Management
DWORD PviCreate( LPSTR lpszParent, LPSTR lpszName, LPSTR lpszAccess, PFN_PVI_COMPLETION pfnCompletion, DWORD dwUserData );
DWORD PviCreateLink( LPSTR lpszParent, LPSTR lpszName, LPSTR lpszAccess, PFN_PVI_COMPLETION pfnCompletion, DWORD dwUserData );
DWORD PviDelete( LPSTR lpszIdent, PFN_PVI_COMPLETION pfnCompletion, DWORD dwUserData );
// Variable Read / Write
DWORD PviRead( LPSTR lpszIdent, LPSTR lpszAccess, LPVOID pBuffer, DWORD dwLength, DWORD dwTimeout, PFN_PVI_COMPLETION pfnCompletion, DWORD dwUserData );
DWORD PviWrite( LPSTR lpszIdent, LPSTR lpszAccess, LPVOID pBuffer, DWORD dwLength, DWORD dwTimeout, PFN_PVI_COMPLETION pfnCompletion, DWORD dwUserData );
DWORD PviReadValue( LPSTR lpszIdent, LPVOID pBuffer, DWORD dwLength, DWORD dwTimeout );
DWORD PviWriteValue( LPSTR lpszIdent, LPVOID pBuffer, DWORD dwLength, DWORD dwTimeout );
// Information / Status
DWORD PviGetInfo( LPSTR lpszIdent, LPSTR lpszAccess, LPVOID pBuffer, DWORD dwLength, LPDWORD lpdwRetLen, DWORD dwTimeout );
DWORD PviGetList( LPSTR lpszIdent, LPSTR lpszMask, LPSTR lpszAccess, LPVOID pBuffer, DWORD dwLength, LPDWORD lpdwRetLen, DWORD dwTimeout );
// Callbacks
DWORD PviSetCallbackMode( LPSTR lpszIdent, PFN_PVI_COMPLETION pfnCompletion, DWORD dwMode, DWORD dwUserData );
DWORD PviSetCallbackX( LPSTR lpszIdent, PFN_PVI_COMPLETION_X pfnCompletionX, DWORD dwMode, DWORD dwUserData );
// Error
LPSTR PviGetErrorText( DWORD dwError, LPSTR lpszBuffer, DWORD dwLength );
DWORD PviGetLastError( void );
// ActiveX / COM (legacy)
DWORD PviCreateAx( LPSTR lpszParent, LPSTR lpszName, LPSTR lpszAccess, PFN_PVI_COMPLETION pfnCompletion, DWORD dwUserData );
Callback signature:
typedef void (CALLBACK *PFN_PVI_COMPLETION)(
LPSTR lpszIdent, // object identifier
DWORD dwError, // error code (0 = success)
DWORD dwEvent, // event type (PVI_EVENT_LINK, etc.)
DWORD dwInfo1,
DWORD dwInfo2,
DWORD dwUserData
);
// Extended callback (PVI 4.x+)
typedef void (CALLBACK *PFN_PVI_COMPLETION_X)(
LPSTR lpszIdent,
DWORD dwError,
LPSTR lpszEvent,
DWORD dwInfo1,
LPSTR lpszInfo2,
DWORD dwUserData
);
Headers and libraries are provided in the PVI Development Setup:
C:\BrAutomation\PVI\V4.xx\Include\PviCom.hC:\BrAutomation\PVI\V4.xx\Lib\x64\PviCom.lib
.NET API (BR.AN.PviServices)
The .NET wrapper (BR.AN.PviServices.dll) provides an object-oriented interface. It is a GUI variable interface that uses the Windows Message Loop to trigger events.
Key classes:
using BR.AN.PviServices;
// Hierarchy
PviConnection connection = new PviConnection(); // connects to Pvi Manager
connection.Root // PVI root object
Line line = new Line(connection.Root, "LNANSL", "CD=LNANSL");
Device device = new Device(line, "TCP", "CD=/IF=TcpIp");
Cpu cpu = new Cpu(device, "myPLC", "CD=/IP=192.168.1.50");
Task task = new Task(cpu, "myTask");
Variable variable = new Variable(task, "myVar");
// Read/Write
variable.ReadValue();
variable.WriteValue(42);
// Event-driven updates
variable.ValueChanged += (sender, e) => {
Console.WriteLine($"Value: {variable.Value}");
};
// CPU diagnostics
cpu.Connected += (sender, e) => { /* connected */ };
cpu.ErrorChanged += (sender, e) => { /* handle errors */ };
// CPU info
string cpuStatus = cpu.Status.RunState; // "Run", "Stop", "Init", ...
DateTime cpuTime = cpu.Time;
// Start/stop tasks
task.Start();
task.Stop();
task.Cycle(3); // single-cycle mode, N cycles
task.Resume(); // resume single-cycle
// Connection lifecycle
connection.Start(); // begins event loop
connection.Stop(); // shuts down
Thread safety note:
BR.AN.PviServicesis NOT thread-safe. All modifications to PVI object members must be done on the main UI thread. UseInvoke/BeginInvokeif updating from background threads.
COM API (Legacy)
PVI also exposes a COM/ActiveX interface via PviCreateAx(). This is primarily for legacy VB6 applications and is not recommended for new development. The COM interface wraps the same underlying C API.
PVI Services Version Compatibility
| PVI Version | AR Compatibility | API Changes |
|---|---|---|
| PVI 3.x | AR 3.x | INA2000 primary, ANSL emerging |
| PVI 4.x | AR 4.x+ | ANSL primary, INA2000 legacy. Extended callbacks. |
| PVI 5.x | AR 5.x | Improved .NET API, 64-bit support |
| PVI 6.x | AR 6.x | ANSL and SNMP only (INA removed) |
PVI API Sources
3. Connecting to a CP1584 via PVI
Target Overview: CP1584
The CP1584 is a B&R Power Panel with an integrated controller and display (Automation Runtime). It exposes PVI via ANSL (TCP) and legacy INA2000 (UDP).
Connection Parameters
| Parameter | Value | Notes |
|---|---|---|
| Protocol | ANSL (recommended) | Automation Net Standard Language |
| Default TCP Port | 11160 | Default INA2000 transport port. Note: Some B&R documentation and tools (e.g., ANSL discovery) reference port 11169. Both ports may be active depending on AR version and configuration. Port 11160 is the INA2000/PVI TCP port; port 11169 is the ANSL COMT port. Try both if one doesn’t respond. |
| OPC UA Port | 4840 | If OPC UA is enabled (AR ≥ 4.0) |
| INA2000 Port | 11160 (UDP) | Legacy; 297-byte frame limit (255 payload + 42 headers) |
ANSL Connection String Format
/IF=TcpIp /IP=<ip_address> [/PORT=<port>] [/SLOT=<slot>] [/PASS=<password>]
C/C++ Example: Connect to CP1584
#include "PviCom.h"
DWORD err;
// Initialize PVI (connects to local PVI Manager)
err = PviInitialize(0);
if (err != 0) {
char errMsg[256];
PviGetErrorText(err, errMsg, sizeof(errMsg));
printf("PviInitialize failed: %s\n", errMsg);
return -1;
}
// Create ANSL line
err = PviCreate("PVI", "LNANSL", "CD=LNANSL", myCallback, 0);
// Create TCP device
err = PviCreate("LNANSL", "TCP", "CD=/IF=TcpIp", myCallback, 0);
// Create CPU station (CP1584)
err = PviCreate("LNANSL/TCP", "CP1584",
"CD=/IP=192.168.1.50 /PORT=11160",
myCallback, 0);
// Wait for PVI_EVENT_LINK (connection established)
.NET Example: Connect to CP1584
using BR.AN.PviServices;
var connection = new PviConnection();
var line = new Line(connection.Root, "LNANSL", "CD=LNANSL");
var device = new Device(line, "TCP", "CD=/IF=TcpIp");
var cpu = new Cpu(device, "CP1584", "CD=/IP=192.168.1.50 /PORT=11160");
cpu.ErrorChanged += (sender, e) => {
if (cpu.ErrorCode == 11020) {
Console.WriteLine("Unable to establish connection");
} else if (cpu.ErrorCode != 0) {
throw new PviException(cpu.ErrorCode);
} else {
Console.WriteLine("Connected to " + cpu.Name);
}
};
connection.Start();
Python (Pvi.py) Example: Connect to CP1584
from pvi import *
pviConnection = Connection()
line = Line(pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.1.50')
def cpuErrorChanged(error: int):
if error == 11020:
print("Unable to establish connection")
pviConnection.stop()
elif error != 0:
raise PviError(error)
else:
print(f"Connected to CPU, AR-Version: {cpu.version}")
cpu.errorChanged = cpuErrorChanged
pviConnection.start()
SNMP Line: Network Configuration
SNMP is used for IP configuration of B&R devices (set IP, subnet, gateway):
line = Line(pviConnection.root, 'LNSNMP', CD='LNSNMP')
device = Device(line, 'SNMP', CD='/IF=SNMP /IP=192.168.1.50 /CM=public')
Connection Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| “Unable to establish connection” (error 11020) | Wrong IP, controller not reachable, ANSL disabled | Verify IP with ping; check ANSL enabled in project |
| PVI line shows “Station not responding” | Subnet mismatch, firewall blocking port 11160 | Check subnet; open TCP 11160 |
| Timeout on high-latency links (>300ms) | INA2000’s request-response protocol has high latency sensitivity | Switch to ANSL which is TCP-based and more latency-tolerant |
| Error 4806 | Requested data not found | Variable doesn’t exist or isn’t exposed; check variable name |
Connecting to CP1584 Sources
4. Reading and Writing Variables
Variable Access Paths
Variables are addressed hierarchically:
LNANSL/TCP/CP1584/<TaskName>/<VariableName>
For global (CPU-scope) variables:
LNANSL/TCP/CP1584/<VariableName>
C/C++: Synchronous Read/Write
// Synchronous read (blocks until complete)
float value;
DWORD err = PviReadValue("LNANSL/TCP/CP1584/myTask/myRealVar",
&value, sizeof(float), 5000); // 5s timeout
// Synchronous write
int newValue = 42;
err = PviWriteValue("LNANSL/TCP/CP1584/myTask/myIntVar",
&newValue, sizeof(int), 5000);
C/C++: Asynchronous Read/Write
// Asynchronous read — callback fires when data arrives
err = PviRead("LNANSL/TCP/CP1584/myTask/myRealVar",
"CV=0", // access string (Control Value, format 0 = raw)
&buffer, sizeof(buffer), 5000,
readCompleteCallback, userData);
// Asynchronous write
err = PviWrite("LNANSL/TCP/CP1584/myTask/myIntVar",
"CV=0",
&newValue, sizeof(newValue), 5000,
writeCompleteCallback, userData);
C/C++: Access Strings
The access string parameter (lpszAccess) controls formatting:
| Access Code | Meaning |
|---|---|
CV=0 | Raw binary value |
CF=<format> | Format string for display |
RF=<ms> | Refresh rate in milliseconds (for cyclic reads) |
HY=<threshold> | Hysteresis — only report changes above threshold |
VT=<type> | Variable type override |
VL=<bytes> | Variable length |
VN=<count> | Array dimension count |
.NET: Read/Write with Events
// Read with auto-refresh
var tempVar = new Variable(task, "gHeating.status.actTemp");
tempVar.RF = 200; // refresh every 200ms
tempVar.HY = 0.5; // hysteresis 0.5°C
tempVar.ValueChanged += (sender, e) => {
Console.WriteLine($"Temperature: {tempVar.Value}");
};
// Direct write
var setpoint = new Variable(task, "gHeating.setpoint");
setpoint.WriteValue(75.0f);
Python (Pvi.py): Read/Write
from pvi import *
pviConnection = Connection()
line = Line(pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.1.50')
task = Task(cpu, 'myLogic')
# Read a variable with auto-refresh (200ms)
temperature = Variable(task, 'gHeating.status.actTemp', RF=200, HY=0.5)
temperature.valueChanged = lambda v: print(f'Temp = {v}')
# Write a variable
setpoint = Variable(task, 'gHeating.setpoint')
def onConnected(error):
if error == 0:
setpoint.value = 75.0
print(f'Wrote setpoint: {setpoint.value}')
task.errorChanged = onConnected
pviConnection.start()
Reading/Writing All IEC Data Types (Python Example)
from datetime import datetime, time, date, timedelta
from pvi import *
# Writing all basic IEC types (from Pvi.py basics1.py example)
variableList = (
('myBOOL', True),
('myUSINT', 123),
('mySINT', -123),
('myUINT', 1234),
('myINT', -1234),
('myUDINT', 1234567),
('myDINT', -124567),
('myREAL', 1.234e2),
('myLREAL', -3.1415e100),
('mySTRING', b'hello, world'),
('myWSTRING', 'hello, world'),
('myDT', datetime.fromisoformat('2011-11-04T00:05:23')),
('myTIME', timedelta(minutes=3, seconds=45, milliseconds=33)),
('myTOD', time(hour=14, minute=30, second=13)),
('myDATE', date.today()),
('myINTArray', (1, 2, 3, 4, 5, 6, 7)),
('mySTRINGArray', (b'Huey', b'Dewey', b'Louie')),
('myREALArray', 100.0), # broadcast single value to all elements
)
for name, value in variableList:
variable = Variable(task, name)
variable.value = value # write
print(f'{name}: {variable.value}') # read back
variable.kill()
ANSL Read Path Size Threshold
From the B&R community documentation:
- Variables > 64 kB are read asynchronously
- Variables ≤ 64 kB are read synchronously
This has implications for large arrays and structs — plan for callback-based handling.
Reading and Writing Variables Sources
5. Browsing the Variable Namespace Without Project Files
PVI can enumerate all objects on a controller without needing the Automation Studio project. This is critical for diagnostics, generic HMI tools, and data discovery.
C/C++: PviGetList
// Get list of tasks on a CPU
char buffer[8192];
DWORD retLen;
DWORD err = PviGetList(
"LNANSL/TCP/CP1584", // CPU ident
"*Task*", // mask: list all tasks
"C=Info", // access: return info objects
buffer, sizeof(buffer),
&retLen,
5000
);
// Parse the returned buffer — contains formatted list of task objects
.NET: Cpu.ExternalObjects
// Wait for CPU connection, then enumerate
cpu.Connected += (s, e) => {
var allObjects = cpu.ExternalObjects;
var modules = allObjects.Where(o => o.Type == "Module").Select(o => o.Name);
var tasks = allObjects.Where(o => o.Type == "Task").Select(o => o.Name);
var globalVars = allObjects.Where(o => o.Type == "Pvar").Select(o => o.Name);
foreach (var taskName in tasks) {
var task = new Task(cpu, taskName);
// task.ExternalObjects gives task-local variables
}
};
Python (Pvi.py): List All Objects on a CPU
from pvi import *
from pprint import pprint
pviConnection = Connection()
line = Line(pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.1.50')
def cpuErrorChanged(error):
if error == 0:
allObjects = cpu.externalObjects
# Modules
moduleNames = [o['name'] for o in allObjects if o['type'] == 'Module']
for name in moduleNames:
module = Module(cpu, name)
print(f"Module: {name}, Status: {module.status}")
module.kill()
# Tasks
taskNames = [o['name'] for o in allObjects if o['type'] == 'Task']
for name in taskNames:
task = Task(cpu, name)
print(f"Task: {name}, Status: {task.status}")
task.kill()
# Global variables (CPU scope)
globalVarNames = [o['name'] for o in allObjects if o['type'] == 'Pvar']
for name in globalVarNames:
var = Variable(cpu, name)
print(f"Global Var: {name}, Type: {var.dataType}, Value: {var.value}")
var.kill()
# Task-local variables
for taskName in taskNames:
task = Task(cpu, taskName)
taskVars = [o['name'] for o in task.externalObjects if o['type'] == 'Pvar']
print(f"\nTask '{taskName}' variables:")
for vname in taskVars:
print(f" {vname}")
task.kill()
pviConnection.stop()
elif error:
raise PviError(error)
cpu.errorChanged = cpuErrorChanged
pviConnection.start()
ANSL UIF Library: Browsing on Linux
When using the ANSL UIF library (Linux native), variable browsing works at the task level:
// Get module list
ANSLI_CPU_ListModules(identCpu); // returns list of modules
ANSLI_CPU_ListTasks(identCpu); // returns list of tasks
// Get variables (IMPORTANT: use TASK, not CPU for variables)
ANSLI_TASK_ListVariables(identTask); // returns task-local variables
ANSLI_CPU_ListVariables(identCpu); // NOTE: may not be supported in all ANSL expansions
Important: According to B&R community,
ANSLI_CPU_ListVariablesmay not be supported in ANSL expansion I. UseANSLI_TASK_ListVariableswith a connected task ident instead.
Browsing Variable Namespace Sources
6. Pulling Diagnostic Data from a Running CP1584
CPU Status Information
from pvi import *
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.1.50')
def onConnected(error):
if error == 0:
# PVI version
print(f"PVI Version: {pviConnection.root.version}")
# AR version
print(f"AR Version: {cpu.version}")
# CPU run state
print(f"Run State: {cpu.status.get('RunState', 'unknown')}")
# CPU clock
print(f"CPU Time: {cpu.time.isoformat()}")
# CPU type info
print(f"CPU Type: {cpu.cpuInfo.get('CT', 'unknown')}")
# Installed tasks
print(f"Tasks: {len(cpu.tasks)}")
Task Status and Control
from datetime import datetime, timedelta
task = Task(cpu, 'brewing')
def stateMachine(init):
# Read task status
print(f"Task status: {task.status}")
print(f"Task version: {task.version}")
# Task control operations
task.stop() # stop the task
task.cycle(3) # set single-cycle mode, 3 cycles
task.resume() # execute a single cycle
task.start() # restart normal cyclic execution
pviConnection.start(stateMachine)
Module Status
allObjects = cpu.externalObjects
moduleNames = [o['name'] for o in allObjects if o['type'] == 'Module']
for name in moduleNames:
module = Module(cpu, name)
status = module.status # dict with module-specific status fields
print(f"Module {name}: {status}")
module.kill()
System Dump / Profiler Data
Pvi.py includes utilities for parsing B&R system dump files:
from pvi.utils import BrProfilerDataFile
import csv
profilerData = BrProfilerDataFile('path/to/BuR_SDM_profiling_*.pd')
# Summary info
print("Summary:", profilerData.info)
print("Cyclic tasks:", profilerData.cyclicTasks)
print("System tasks:", profilerData.systemTasks)
# Export to CSV
with open('profiler.csv', 'w', newline='') as f:
writer = csv.writer(f, delimiter=';')
writer.writerow(["Nr", "time", "object name", "ident", "event", "description"])
for n, entry in enumerate(profilerData.entries):
writer.writerow((n+1, entry.microseconds, entry.objectName,
hex(entry.objectIdent), hex(entry.event),
entry.eventDescription))
SNMP-Based Diagnostics
Use the SNMP line to read network configuration:
line = Line(pviConnection.root, 'LNSNMP', CD='LNSNMP')
device = Device(line, 'SNMP', CD='/IF=SNMP /IP=192.168.1.50 /CM=public')
# Read device info (IP settings, MAC address, firmware version, etc.)
Diagnostic Data Sources
7. Error Handling: Error Codes and Recovery
Error Code Categories
PVI error codes are returned as DWORD values. Common error ranges:
| Range | Category |
|---|---|
| 0 | Success |
| 1–99 | General PVI errors |
| 100–999 | PVI Manager / system errors |
| 1000–1999 | Line/driver errors |
| 2000–3999 | Connection errors |
| 4000–4999 | Variable access errors |
| 5000–5999 | Memory/buffer errors |
| 10000–11999 | ANSL-specific errors |
Common Error Codes
| Error Code | Meaning | Typical Cause | Recovery |
|---|---|---|---|
| 0 | Success | — | — |
| 11020 | Unable to establish connection | Target unreachable, wrong IP, ANSL disabled | Verify IP, check ANSL configuration |
| 4806 | Requested data not found | Variable doesn’t exist or not exposed | Check variable name/path |
| 12050 | PVI is locked | License issue — 2-hour trial expired | Restart PVI Manager or obtain license |
| 1056 | Can’t start PVI Manager service | Service already running, timing issue | Use PVI Registry Changer to switch to process mode |
| 5882 | Function block error in C library | B&R library function issue in custom C library | Check library version compatibility |
| various | Object creation failed | Parent not connected yet | Wait for parent PVI_EVENT_LINK callback |
Getting Error Text
// C API
char errMsg[512];
PviGetErrorText(errorCode, errMsg, sizeof(errMsg));
printf("Error %lu: %s\n", errorCode, errMsg);
# Pvi.py
raise PviError(error_code) # automatically formats error text
Recovery Strategies
-
Reconnection logic: PVI does not auto-reconnect. Implement retry logic:
cpu.errorChanged = lambda err: reconnect_cpu() if err == 11020 else None -
PVI Manager restart: If PVI locks up (2-hour trial), you must stop and restart the PVI Manager. This also requires restarting any application using PVI (including Automation Studio).
-
Object re-creation: If a connection drops, delete and re-create the PVI objects in the hierarchy.
PVI Logging for Debugging
Enable detailed logging via PVI Monitor (Options > PVI Diagnostics):
Key components to log:
| Component | Log File | Purpose |
|---|---|---|
PviMan.exe | PviMan.log | General PVI Manager activity |
PviMan.exe/LnAnsl.dll | LnAnsl.log | ANSL protocol tracing |
PviMan.exe/LnAnsl.dll/Ansl | LnAnslA.log | ANSL layer details |
PviMan.exe/LnAnsl.dll/Communication | LnAnslC.log | ANSL communication traces |
PviMan.exe/LnIna2.dll | LnIna2.log | INA protocol (legacy) |
PviMan.exe/Icomm.dll | Icomm.log | Internal communication |
pg.exe/PviCom.dll/Client | PviClient.log | Client-side PVI calls |
Set Break Function to stop logging automatically on a specific error:
Use Break Function: True
Expression: E=4806
Turn-off global logging mode: True
Error Handling Sources
- B&R Community: PVI Exception handling, Logging
- B&R Community: PVI System error 1056
- B&R Community: Error 5882
8. Data Types: B&R Types to PVI/C Types
IEC 61131-3 to C/C++ Type Mapping
| IEC Data Type | B&R Name | C Type | Size (bytes) | Range |
|---|---|---|---|---|
BOOL | BOOL | unsigned char / bool | 1 | 0 or 1 |
SINT | SINT | signed char / int8_t | 1 | -128 to 127 |
USINT | USINT | unsigned char / uint8_t | 1 | 0 to 255 |
BYTE | BYTE | unsigned char / uint8_t | 1 | 0 to 255 |
INT | INT | short / int16_t | 2 | -32768 to 32767 |
UINT | UINT | unsigned short / uint16_t | 2 | 0 to 65535 |
WORD | WORD | unsigned short / uint16_t | 2 | 0 to 65535 |
DINT | DINT | int / int32_t | 4 | -2^31 to 2^31-1 |
UDINT | UDINT | unsigned int / uint32_t | 4 | 0 to 2^32-1 |
DWORD | DWORD | unsigned int / uint32_t | 4 | 0 to 2^32-1 |
LINT | LINT | long long / int64_t | 8 | -2^63 to 2^63-1 |
ULINT | ULINT | unsigned long long / uint64_t | 8 | 0 to 2^64-1 |
REAL | REAL | float | 4 | IEEE 754 single precision |
LREAL | LREAL | double | 8 | IEEE 754 double precision |
TIME | TIME | int32_t (milliseconds) | 4 | T#0S to T#24D_23H_59M_59S_999MS |
DATE | DATE | int32_t (days since 1970-01-01) | 4 | D#1970-01-01 to D#2106-02-06 |
TIME_OF_DAY | TOD | int32_t (ms since midnight) | 4 | TOD#00:00:00 to TOD#23:59:59.999 |
DATE_AND_TIME | DT | struct { date; time } | 8 | Combined date + time |
STRING[n] | STRING | char[n+1] | n+1 | Null-terminated, max 80 chars default |
WSTRING[n] | WSTRING | wchar_t[n+1] | 2*(n+1) | UTF-16LE, max 80 chars default |
Struct and Array Handling
| Type | PVI Behavior |
|---|---|
| Structs | Transferred as raw byte block. Structure layout (alignment, member offsets) must be known to the client. ANSL UIF cannot provide struct format information — alignment must match. |
| Arrays | Contiguous memory. Access individual elements with array index in variable name or write a slice. Pvi.py supports tuple broadcast to set all elements to one value. |
| Nested structs | Treated as flat byte arrays over the wire. Client must know the exact memory layout including any padding/alignment. |
B&R-Specific Alignment Rules
B&R follows standard C struct alignment rules on the target (typically PowerPC or ARM alignment). When reading/writing structs via C or ctypes, ensure:
- Use
#pragma packor equivalent to match B&R alignment - Account for target-specific alignment (PowerPC uses 4-byte alignment for 32-bit types)
- Test with known values before deploying
Python Type Mapping (Pvi.py)
Pvi.py automatically maps between Python and IEC types:
| IEC Type | Python Type |
|---|---|
| BOOL | bool |
| SINT/USINT/BYTE | int |
| INT/UINT/WORD | int |
| DINT/UDINT/DWORD | int |
| REAL | float |
| LREAL | float |
| STRING | bytes |
| WSTRING | str |
| TIME | datetime.timedelta |
| DATE | datetime.date |
| TOD | datetime.time |
| DT | datetime.datetime |
| Array | tuple |
9. Callbacks and Event Handling
PVI Event Types (C API)
| Event | Description |
|---|---|
PVI_EVENT_LINK | Object connected/linked successfully |
PVI_EVENT_UNLINK | Object disconnected |
PVI_EVENT_READ | Asynchronous read completed |
PVI_EVENT_WRITE | Asynchronous write completed |
PVI_EVENT_DATA | Cyclic data update (when RF is set) |
PVI_EVENT_ERROR | Error occurred on this object |
PVI_EVENT_INFO | Information message |
Setting Callbacks in C
// Set completion callback for a variable (receives all events)
err = PviSetCallbackX(
"LNANSL/TCP/CP1584/myTask/myVar",
myVariableCallback, // PFN_PVI_COMPLETION_X
PVI_CB_MODE_ALL, // mode: receive all events
userData
);
// Callback function
void CALLBACK myVariableCallback(
LPSTR lpszIdent,
DWORD dwError,
LPSTR lpszEvent, // event name string
DWORD dwInfo1,
LPSTR lpszInfo2, // additional info
DWORD dwUserData
) {
if (dwError != 0) {
// handle error
return;
}
if (strcmp(lpszEvent, "PVI_EVENT_DATA") == 0) {
// Variable value updated — read new value
float value;
PviReadValue(lpszIdent, &value, sizeof(value), 0);
printf("Variable %s = %f\n", lpszIdent, value);
}
else if (strcmp(lpszEvent, "PVI_EVENT_LINK") == 0) {
printf("Variable %s linked\n", lpszIdent);
}
}
.NET Events
// Variable-level events
variable.ValueChanged += (sender, e) => { /* value changed */ };
variable.ErrorChanged += (sender, e) => { /* error on variable */ };
// CPU-level events
cpu.Connected += (sender, e) => { /* connection established */ };
cpu.ErrorChanged += (sender, e) => { /* error on CPU connection */ };
// Task events
task.StatusChanged += (sender, e) => { /* task run state changed */ };
task.ErrorChanged += (sender, e) => { /* error on task */ };
Python (Pvi.py) Callbacks
# Variable change callback with refresh
temperature = Variable(task, 'gHeating.status.actTemp', RF=200, HY=0.5)
def onTempChange(value):
print(f'Temperature changed to {value}')
temperature.valueChanged = onTempChange
# CPU error callback
cpu.errorChanged = lambda err: print(f'CPU error: {err}') if err else print('Connected')
# Connection lifecycle
def runtimeMonitor(init):
"""Called every PVI cycle — implement state machines here"""
pass
pviConnection.start(runtimeMonitor)
Cyclic Refresh vs Polled Read
| Approach | Latency | CPU Load | Best For |
|---|---|---|---|
| Cyclic refresh (RF parameter) | Deterministic (set interval) | Low (PVI handles it) | Continuous monitoring, HMI displays |
| Polled read (explicit PviRead) | Variable (depends on poll rate) | Higher (client-driven) | On-demand diagnostics, conditional reads |
| Event-based (PVI_EVENT_DATA with HY) | Near-instant on change | Lowest | State monitoring, alarm detection |
Hysteresis (HY): Only triggers callback when value changes by more than the threshold. Reduces network traffic and callback frequency.
# Only notify if temperature changes by > 0.5°C
temperature = Variable(task, 'actTemp', RF=100, HY=0.5)
Callbacks and Event Handling Sources
10. Performance Considerations
Latency Benchmarks
| Communication Path | Typical Latency | Notes |
|---|---|---|
| PVI ANSL (local LAN) | 5–20 ms | TCP-based, 1–2 round trips |
| PVI INA2000 (local LAN) | 10–50 ms | UDP-based, 297-byte frame limit adds overhead |
| PVI ANSL (high latency, >300ms) | Degraded but functional | ANSL handles it; INA does not |
| OPC UA (on-controller) | 10–50 ms | Additional protocol overhead |
| OPC UA (via PVI OPC Server) | 20–100 ms | Extra hop through PVI Manager |
Refresh Rate Limits
| Parameter | Recommended Range | Hard Limit |
|---|---|---|
| Variable refresh (RF) | 100–1000 ms | ~10 ms floor (depends on CPU and variable count) |
| Hysteresis (HY) | Application-dependent | 0 = report every change |
| Cyclic data trending | 10–100 ms | Very fast trending requires dedicated C# companion (see br-automation-pvi MCP) |
CPU Load Impact
The OPC UA server on a mid-range X20 CPU (e.g., X20CP3584) consumes approximately 0.3–0.8 ms per 100 variables per cycle. Budget accordingly when the controller also runs motion and I/O tasks.
For PVI (ANSL) direct access, the load is lower than OPC UA since there’s no serialization overhead.
Sizing Formula for Variable Load
ServerLoad ≈ N_variables × (1000 / Refresh_ms) × Payload_bytes / 1024^2 [MB/s]
Example: 500 variables at 100 ms refresh, 8-byte payloads:
500 × 10 × 8 = 40,000 B/s ≈ 0.038 MB/s (negligible on Ethernet, but CPU-bound)
Best Practices
- Batch reads: Read multiple variables in a single PVI cycle rather than individual synchronous calls.
- Use hysteresis: Set HY to filter out noise and reduce callbacks.
- Limit refresh rate: 200 ms is a good default for HMI; 1000 ms for logging/scada.
- Avoid large struct reads in tight loops: Structs > 64 kB use the async path, adding latency.
- INA2000 limitations: Max 255 bytes per UDP frame. Use ANSL for any data exceeding this.
- High-frequency trending: For 10–100 ms trending, use a C# companion service or specialized data logger rather than direct PVI polling from Python/interpreted languages.
Performance Considerations Sources
11. Python PVI Bindings
Pvi.py (Recommended)
Repository: https://github.com/hilch/Pvi.py
Install: pip install pvipy
License: MIT
Docs: https://hilch.github.io/Pvi.py/
Pvi.py is a comprehensive Python wrapper that handles the complexity of the C API. Features:
- Object-oriented hierarchy matching PVI’s object model
- Automatic type conversion between Python and IEC types
- Callback-based event handling
- Variable browsing, CPU diagnostics, task control
- System dump / profiler data parsing
- SNMP support for network configuration
Requirements: PVI Development Setup must be installed on the machine (provides the underlying DLLs).
Limitations:
- Writing to basic datatypes only (no direct struct write support). Workaround: write to simple wrapper variables in the PLC.
- Not thread-safe (inherent PVI limitation).
Wrapping the C API with ctypes (Manual Approach)
For environments where Pvi.py can’t be used, you can wrap PviCom.dll directly:
import ctypes
from ctypes import wintypes, c_char_p, c_uint, c_void_p, POINTER, WINFUNCTYPE
# Load PVI DLL
pvicom = ctypes.WinDLL("PviCom.dll")
# Define callback type
PFN_PVI_COMPLETION = WINFUNCTYPE(
None, # return void
c_char_p, # lpszIdent
c_uint, # dwError
c_uint, # dwEvent
c_uint, # dwInfo1
c_uint, # dwInfo2
c_uint # dwUserData
)
# PviInitialize
pvicom.PviInitialize.argtypes = [c_uint]
pvicom.PviInitialize.restype = c_uint
pvicom.PviUninitialize.argtypes = []
pvicom.PviUninitialize.restype = c_uint
# PviCreate
pvicom.PviCreate.argtypes = [c_char_p, c_char_p, c_char_p,
PFN_PVI_COMPLETION, c_uint]
pvicom.PviCreate.restype = c_uint
# PviReadValue
pvicom.PviReadValue.argtypes = [c_char_p, c_void_p, c_uint, c_uint]
pvicom.PviReadValue.restype = c_uint
# PviWriteValue
pvicom.PviWriteValue.argtypes = [c_char_p, c_void_p, c_uint, c_uint]
pvicom.PviWriteValue.restype = c_uint
# Initialize
err = pvicom.PviInitialize(0)
print(f"PviInitialize: {err}")
# Callback
@PFN_PVI_COMPLETION
def myCallback(ident, error, event, info1, info2, userdata):
ident_str = ident.decode('ascii') if ident else ""
print(f"Callback: {ident_str} Error={error} Event={event}")
# Create objects (simplified — real code needs to wait for LINK events)
pvicom.PviCreate(b"PVI", b"LNANSL", b"CD=LNANSL", myCallback, 0)
pvicom.PviCreate(b"LNANSL", b"TCP", b"CD=/IF=TcpIp", myCallback, 0)
pvicom.PviCreate(b"LNANSL/TCP", b"PLC", b"CD=/IP=192.168.1.50", myCallback, 0)
# Read a float
value = ctypes.c_float()
err = pvicom.PviReadValue(b"LNANSL/TCP/PLC/myTask/myFloat",
ctypes.byref(value), ctypes.sizeof(value), 5000)
print(f"Value: {value.value}")
pvicom.PviUninitialize()
Other Third-Party Tools
| Tool | Description | Link |
|---|---|---|
| brsnmp | Python CLI for PVI-SNMP commands (list/search PLCs, change IP) | github.com/hilch/brsnmp |
| br-automation-pvi MCP | MCP server bridging B&R PLCs with AI assistants (Claude, etc.) | mcpmarket.com/server/br-automation-pvi |
| ListAllBurPLCs | Lists all B&R PLCs on network | Listed in awesome-B-R |
| brwatch | Service tool: watch, change, log variables, set IP addresses | Listed in awesome-B-R |
| BRLibToHelp | Python tool to parse B&R Automation Studio libraries and generate CHM help files | github.com/br-automation-community/BRLibToHelp |
| VS Code B&R Extension | VS Code extension for building B&R Automation Studio projects | github.com/br-automation-community/vscode-brautomationtools |
| AS6 Migration Tools | Open-source scripts for detecting deprecated libraries/FBs when migrating AS4 to AS6 | github.com/br-automation-community/as6-migration-tools |
| B&R SBOM Generator | Scans AS6 projects and generates CycloneDX 1.5 SBOMs per configuration | github.com/br-automation-community |
| OPCUA_Simple | Demonstration of OPC UA client-server communication with B&R PLC | github.com/rparak/OPCUA_Simple |
Python PVI Bindings Sources
- Pvi.py on GitHub
- awesome-B-R: B&R Frameworks and Libraries
- B&R Community: Python PVI wrapper discussion
12. Using PVI from Linux
Option 1: ANSL UIF Library (Native C/C++)
The AnslUIF library is the official path for Linux PLC communication. It is a C/C++ library included in the PVI Development Setup.
Location in PVI package: C:\BrAutomation\PVI\V4.12\AN\ (documentation, libraries, samples)
Supported platforms: Linux x86, Linux x64
Capabilities:
- ANSL TCP communication with B&R PLCs (AR ≥ V4.08)
- Connect, enumerate modules/tasks/variables
- Read and write variables
- No PVI Manager dependency (direct TCP connection)
Limitations:
- No TLS support — ANSL communication is unencrypted
- No struct format information — only basic data type info. Client must know struct layout and alignment.
ANSLI_CPU_ListVariablesmay not be supported in ANSL expansion I; useANSLI_TASK_ListVariablesinstead.
Key functions:
ANSLI_Initialize()
ANSLI_Deinitialize()
ANSLI_CPU_Connect(identCpu, ...) // connect to CPU
ANSLI_CPU_ListModules(identCpu) // list modules
ANSLI_CPU_ListTasks(identCpu) // list tasks
ANSLI_CPU_GetInfo(identCpu, ...) // CPU info
ANSLI_TASK_Connect(identCpu, taskName, ...)
ANSLI_TASK_ListVariables(identTask) // list task-local variables
ANSLI_TASK_GetInfo(identTask, ...)
ANSLI_PVAR_Read(identVar, buffer, size) // read variable
ANSLI_PVAR_Write(identVar, buffer, size) // write variable
Option 2: Pvi.py via WINE (Not Recommended)
The Pvi.py wrapper depends on the Windows PVI Manager and PviCom.dll. Running through WINE is theoretically possible but not documented and likely fragile due to the Windows service model of PviMan.exe.
Option 3: OPC UA from Linux (Recommended Alternative)
For Linux-based systems, the recommended path is OPC UA (no PVI needed):
- Enable OPC UA on the B&R controller (AR ≥ 4.0)
- Use Python’s
asyncuaoropcualibraries to connect directly - No Windows dependency
import asyncio
import asyncua
async def main():
client = asyncua.Client(url="opc.tcp://192.168.1.50:4840")
await client.connect()
var = await client.get_node("ns=2;s=gHeating.status.actTemp")
value = await var.read_value()
print(f"Temperature: {value}")
await client.disconnect()
asyncio.run(main())
Option 4: PVI Manager on Windows, Client on Linux
Run the PVI Manager on a Windows machine, then connect remotely from a Linux client using the PVI client DLL over the network. This requires the PVI client/server remote feature, which routes PVI client calls through the PVI Manager’s TCP interface.
Using PVI from Linux Sources
- B&R Community: ANSL UIF Library details
- B&R Community: ANSL UIF variable listing
- awesome-B-R: OPC-UA samples for B&R
13. PVI vs OPC-UA: When to Use Which
Decision Matrix
| Criterion | PVI | OPC UA | Raw TCP/UDP |
|---|---|---|---|
| Standardization | B&R proprietary | IEC 62541 (international standard) | None |
| Encryption / Auth | None | Yes (certificates, user tokens, SecurityPolicies) | Application layer |
| Typical Latency | 5–20 ms | 10–50 ms | Application-defined |
| SCADA Integration | Via PVI OPC bridge (extra hop) | Native (any OPC UA client) | Custom driver |
| Platform Support | Windows native, Linux via ANSL UIF | Cross-platform (any OPC UA SDK) | Any |
| Effort to expose new variable | Low (auto-exposed via PVI) | Low (mark as OPC UA accessible in AS) | High (custom code in PLC) |
| Cross-vendor compatibility | B&R only | Any OPC UA server/client | Custom |
| Real-time deterministic | No | No | Optional |
| Overhead | Low | Medium (XML/Binary encoding) | Lowest |
| Max throughput | High (raw binary) | Medium | Highest |
When to Use PVI
- Integrating with B&R HMI panels that use PVI internally
- Using B&R PVI Transfer for firmware deployment
- Need SNMP-based network configuration of B&R devices
- Accessing module-level diagnostics not exposed via OPC UA
- Tools that need to start/stop tasks or perform CPU control actions
- Legacy controllers (AR < 4.0) that don’t support OPC UA
- Lowest latency access where OPC UA overhead is unacceptable
When to Use OPC UA
- New projects — OPC UA is the modern standard
- Linux-based clients — no PVI Manager dependency
- Multi-vendor SCADA integration (Ignition, UA Expert, etc.)
- Security required — encrypted communication with certificate auth
- Eliminating Windows dependency — OPC UA runs directly on the controller
- Non-B&R consumers — any OPC UA client can connect
Both Can Coexist
Both protocols can run simultaneously on the same B&R controller:
- PVI/ANSL on TCP port 11160
- OPC UA on TCP port 4840
PVI vs OPC-UA Sources
14. PVI License Requirements
License Overview
PVI requires a license on non-B&R IPCs (standard PCs). Without a license, PVI runs in trial mode for 2 hours. After this, all PVI-based programs stop working. PVI Manager must be stopped and restarted to reset.
Important: The 2-hour trial is per PVI Manager session, not per application. All PVI clients on the machine are affected.
License Products
| Order Code | Type | Notes |
|---|---|---|
| 0TG1000.01 | Technology Guard (USB Dongle) | Hardware dongle for PVI license |
| 0TG1000.02 | Technology Guard (USB Dongle, newer) | Requires PVI ≥ 4.1.06 / 4.2.02 |
| 1TG0500.01 | Software Container License | No physical dongle; software-based (PVI ≥ 4.9) |
| 1TG0500.02 | Technology Guard License | Used with 0TG1000.01/02 dongle |
| 5S0500.99 | Mass License (Software DLL) | Implemented as BrLcmode.dll in PVI bin folder. One-time purchase for unlimited devices. Requires negotiation with B&R sales. |
License Check
The PVI Manager checks the license via:
- Hardware ADI driver — installed on B&R IPCs, exempts them from license requirement
- USB dongle (Technology Guard)
- Software container (1TG0500.01)
- Software DLL (BrLcmode.dll for mass licensing)
License holder information is displayed in the PviMonitor window.
Exemptions
| Environment | License Required? |
|---|---|
| B&R IPC (with ADI driver) | No |
| B&R Windows CE devices | No (PVI Manager doesn’t check) |
| Automation Studio | No (bundled license) |
| PVI Transfer Tool | No (bundled license) |
| Standard PC (non-B&R) | Yes |
| B&R Panel without ADI | Yes |
Verifying License
# Run license checker (PVI ≥ 4.9)
C:\BrAutomation\PVI\V4.x\Bin\BrSecChk.exe
# Under "Configuration", ensure "Search Technology Guarding License" is enabled
32-bit vs 64-bit
The 32-bit BrLcmode.dll is not compatible with a 64-bit PVI Manager. If migrating from 32-bit to 64-bit, a new 5S0500.99 order must be placed.
Changing the PVI Manager Version
- Open PVI Monitor with administrator rights
- Options > PVI Registry Changer
- Select the
PviMan.exeof the desired PVI version - Click OK
PVI License Sources
15. Example Code for Common Diagnostic Tasks
15.1 Complete Diagnostic Connection (Python)
"""
Connect to a B&R CP1584, read CPU status, list all tasks,
enumerate global variables, and read task-local variables.
"""
from pvi import *
from pprint import pprint
import json
class PlcDiagnostics:
def __init__(self, ip_address, cpu_name='CP1584'):
self.ip = ip_address
self.cpu_name = cpu_name
self.connection = Connection()
self._setup()
self.result = {}
def _setup(self):
self.line = Line(self.connection.root, 'LNANSL', CD='LNANSL')
self.device = Device(self.line, 'TCP', CD='/IF=TcpIp')
self.cpu = Cpu(self.device, self.cpu_name,
CD=f'/IP={self.ip}')
def _on_cpu_ready(self, error):
if error == 11020:
print(f"ERROR: Cannot reach {self.ip}")
self.connection.stop()
return
if error != 0:
raise PviError(error)
print(f"=== Connected to {self.cpu_name} at {self.ip} ===")
self.result['cpu_info'] = {
'pvi_version': self.connection.root.version,
'ar_version': self.cpu.version,
'run_state': self.cpu.status.get('RunState', 'unknown'),
'cpu_time': self.cpu.time.isoformat(),
'cpu_type': self.cpu.cpuInfo.get('CT', 'unknown'),
}
print(f"AR Version: {self.result['cpu_info']['ar_version']}")
print(f"Run State: {self.result['cpu_info']['run_state']}")
self._enumerate_objects()
def _enumerate_objects(self):
all_objects = self.cpu.externalObjects
modules = [o['name'] for o in all_objects if o['type'] == 'Module']
tasks = [o['name'] for o in all_objects if o['type'] == 'Task']
global_vars = [o['name'] for o in all_objects if o['type'] == 'Pvar']
self.result['modules'] = []
for name in modules:
m = Module(self.cpu, name)
self.result['modules'].append({name: dict(m.status)})
m.kill()
self.result['tasks'] = []
for name in tasks:
t = Task(self.cpu, name)
info = {name: {'status': dict(t.status), 'version': t.version}}
task_vars = [o['name'] for o in t.externalObjects if o['type'] == 'Pvar']
info[name]['variables'] = task_vars
self.result['tasks'].append(info)
t.kill()
self.result['global_variables'] = []
for name in global_vars:
v = Variable(self.cpu, name)
info = {'name': name, 'type': str(v.dataType), 'value': str(v.value)}
self.result['global_variables'].append(info)
v.kill()
print(f"\nModules: {[m for m in modules]}")
print(f"Tasks: {[t for t in tasks]}")
print(f"Global Variables ({len(global_vars)}): {global_vars}")
with open('diagnostics.json', 'w') as f:
json.dump(self.result, f, indent=2, default=str)
print("\nDiagnostics saved to diagnostics.json")
self.connection.stop()
def run(self):
self.cpu.errorChanged = self._on_cpu_ready
self.connection.start()
if __name__ == '__main__':
diag = PlcDiagnostics('192.168.1.50')
diag.run()
15.2 Monitor Variable Changes with Logging (Python)
"""
Monitor temperature and pressure variables from a CP1584.
Log changes to CSV with timestamps.
"""
import csv
import time
from datetime import datetime
from pvi import *
PLC_IP = '192.168.1.50'
CSV_FILE = 'plc_log.csv'
variables_to_monitor = [
('gHeating.status.actTemp', 200, 0.5), # (name, refresh_ms, hysteresis)
('gHeating.status.pressure', 500, 0.1),
('gMotor.speed.actual', 100, 1.0),
('gMotor.status.running', 500, 0), # BOOL, report every change
]
connection = Connection()
line = Line(connection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD=f'/IP={PLC_IP}')
task = Task(cpu, 'mainlogic')
csv_file = open(CSV_FILE, 'w', newline='')
writer = csv.writer(csv_file)
writer.writerow(['timestamp', 'variable', 'value'])
def make_callback(var_name):
def callback(value):
ts = datetime.now().isoformat()
writer.writerow([ts, var_name, value])
csv_file.flush()
print(f'{ts} | {var_name} = {value}')
return callback
pvi_vars = []
def on_task_ready(error):
if error == 0:
for name, rf, hy in variables_to_monitor:
v = Variable(task, name, RF=rf, HY=hy)
v.valueChanged = make_callback(name)
pvi_vars.append(v)
task.errorChanged = on_task_ready
try:
connection.start()
finally:
csv_file.close()
15.3 Batch Read Multiple Variables (C/C++)
#include <stdio.h>
#include "PviCom.h"
#define TIMEOUT_MS 3000
#define NUM_VARS 5
typedef struct {
const char *name;
void *buffer;
size_t size;
} PviVar;
volatile int completed = 0;
void CALLBACK readCallback(LPSTR ident, DWORD error, DWORD event,
DWORD info1, DWORD info2, DWORD userData) {
if (event == 4) { // PVI_EVENT_READ
if (error == 0) {
int idx = (int)userData;
printf("Read %s: OK\n", ((PviVar*)vars)[idx].name);
} else {
printf("Read failed: error %lu\n", error);
}
completed++;
}
}
void batchRead() {
PviVar vars[NUM_VARS] = {
{"LNANSL/TCP/CP1584/mainlogic/gHeating.status.actTemp", &(float){0}, sizeof(float)},
{"LNANSL/TCP/CP1584/mainlogic/gHeating.status.pressure", &(float){0}, sizeof(float)},
{"LNANSL/TCP/CP1584/mainlogic/gMotor.speed.actual", &(double){0}, sizeof(double)},
{"LNANSL/TCP/CP1584/mainlogic/gMotor.status.running", &(unsigned char){0}, 1},
{"LNANSL/TCP/CP1584/mainlogic/gMachine.cycleCount", &(int){0}, sizeof(int)},
};
completed = 0;
for (int i = 0; i < NUM_VARS; i++) {
PviRead(vars[i].name, "CV=0", vars[i].buffer, vars[i].size,
TIMEOUT_MS, readCallback, i);
}
while (completed < NUM_VARS) {
// Wait for all reads to complete (application-specific message loop)
}
}
15.4 CPU Control: Warm Start / Cold Start (Python)
"""
Read CPU state and perform control actions.
"""
from pvi import *
connection = Connection()
line = Line(connection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.1.50')
def on_connected(error):
if error != 0:
raise PviError(error)
state = cpu.status.get('RunState', 'unknown')
print(f"Current run state: {state}")
if state == 'Run':
# Stop all cyclic tasks for controlled shutdown
for task_name in cpu.tasks:
task = Task(cpu, task_name)
task.stop()
print(f"Stopped task: {task_name}")
task.kill()
# To restart, use cpu methods:
# cpu.warmStart() — warm restart (retain data)
# cpu.coldStart() — cold restart (clear retained data)
# These may require specific access parameters
connection.stop()
cpu.errorChanged = on_connected
connection.start()
15.5 Browse and Export Variable List to CSV (Python)
"""
Export complete variable namespace to CSV.
"""
import csv
from pvi import *
connection = Connection()
line = Line(connection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.1.50')
def on_ready(error):
if error != 0:
raise PviError(error)
with open('variable_export.csv', 'w', newline='') as f:
writer = csv.writer(f)
writer.writerow(['Scope', 'Name', 'Type', 'Size', 'Value'])
# Global variables
for obj in cpu.externalObjects:
if obj['type'] == 'Pvar':
v = Variable(cpu, obj['name'])
writer.writerow(['Global', obj['name'], str(v.dataType),
v.descriptor.get('VL', '?'), str(v.value)])
v.kill()
# Task-local variables
for obj in cpu.externalObjects:
if obj['type'] == 'Task':
task = Task(cpu, obj['name'])
for var_obj in task.externalObjects:
if var_obj['type'] == 'Pvar':
v = Variable(task, var_obj['name'])
writer.writerow([obj['name'], var_obj['name'],
str(v.dataType),
v.descriptor.get('VL', '?'), str(v.value)])
v.kill()
task.kill()
print("Exported to variable_export.csv")
connection.stop()
cpu.errorChanged = on_ready
connection.start()
Source URLs Summary
| Resource | URL |
|---|---|
| B&R PVI Online Help | https://help.br-automation.com/#/en/4/automationnet/pvi/pvi.htm |
| B&R PVI Development Setup | https://www.br-automation.com/en/downloads/software/automation-netpvi/pvi-development-setup/ |
| B&R Community: PVI How-to Guide | https://community.br-automation.com/t/how-to-guide-all-about-automation-net-pvi/4846 |
| B&R Community: ANSL UIF Variable Listing | https://community.br-automation.com/t/reading-variable-list-using-ansl-uif-library/8180 |
| B&R Community: Python PVI Wrapper | https://community.br-automation.com/t/python-pvi-wrapper-question-regarding-pvi-py/4996 |
| Industrial Monitor Direct: Communication Guide | https://industrialmonitordirect.com/blogs/knowledgebase/br-plc-communication-pvi-opc-and-tcpip-integration |
| Pvi.py (GitHub) | https://github.com/hilch/Pvi.py |
| Pvi.py Documentation | https://hilch.github.io/Pvi.py/ |
| Pvi.py Examples | https://github.com/hilch/Pvi.py/tree/main/examples |
| awesome-B-R (Curated List) | https://github.com/hilch/awesome-B-R |
| brsnmp (GitHub) | https://github.com/hilch/brsnmp |
| br-automation-pvi MCP Server | https://mcpmarket.com/server/br-automation-pvi |
| B&R Community Main | https://community.br-automation.com |
16. Security: PVI Credential Logging Vulnerability (CVE-2026-0936)
16.1 Advisory Details
| Field | Value |
|---|---|
| CVE | CVE-2026-0936 |
| B&R Advisory | SA26P001 |
| CISA Advisory | ICSA-26-125-02 |
| CVSS v3.1 | 5.0 (Medium) |
| CWE | CWE-532 (Insertion of Sensitive Information into Log File) |
| Affected | PVI client < 6.5.0 |
| Fixed In | PVI 6.5.0 (bundled with AS 6.5) |
16.2 What the Vulnerability Does
When PVI client logging is enabled, credentials (passwords, connection parameters, authentication tokens) are written in plaintext to the PVI log file. An authenticated local attacker with read access to the log directory can extract these credentials and use them to access the PLC or other B&R devices.
16.3 Practical Impact for CP1584 Engineers
- Risk is LOW if logging is disabled (default state) — no credentials are written anywhere
- Risk is HIGH if logging was enabled for troubleshooting — plaintext PLC passwords may be sitting in log files on engineering workstations
- The vulnerability is client-side only — it does NOT affect the PLC’s PVI server component or ANSL protocol
16.4 Mitigation Steps
- Check if PVI logging is enabled on all engineering workstations:
- PVI logging is not enabled by default — it must be explicitly activated
- Check for PVI log files (typically in the PVI application directory or a user-specified path)
- Delete any existing PVI log files if they contain connection history:
Get-ChildItem -Path "C:\Program Files*\B&R*\Pvi*" -Filter "*.log" -Recurse Get-ChildItem -Path "$env:LOCALAPPDATA\B&R" -Filter "*.log" -Recurse - Restrict log file access via NTFS permissions if logging must remain enabled:
icacls "C:\path\to\pvi\logs" /inheritance:r /grant:r "%USERNAME%:(OI)(CI)F" - Upgrade PVI to 6.5.0 (bundled with Automation Studio 6.5) — this version removes credential information from log output
- Rotate PLC passwords if PVI logging was previously enabled and log files were accessible to other users
16.5 Interaction with Access Recovery
When performing credential recovery on an undocumented CP1584 (see access-recovery.md), be aware that previous engineers may have left PVI log files on shared workstations that contain the PLC’s credentials. Search engineering PCs for PVI log files as a credential discovery method — but also ensure any discovered log files are secured or deleted to prevent credential leakage.
Cross-References
- opcua.md – OPC-UA as alternative to PVI for PLC access
- cp1584-forensics.md – using PVI for forensic data extraction
- python-diagnostics.md – Python PVI wrapper usage
- network-architecture.md – ANSL network requirements for PVI
- diagnostics-sdm.md – ANSL port 11169 and SDM vs PVI
- ftp-web-interface.md – FTP as alternative to PVI for file access
- plc-to-plc.md – PVI for inter-PLC data exchange
- access-recovery.md – PVI access without credentials
- iiot-retrofit.md – PVI to MQTT/OPC-UA bridges
- execution-model.md – how PVI tasks interact with cyclic tasks
- cybersecurity-hardening.md – PVI security hardening and CVE-2026-0936
- ar-rtos.md – CVE table including SA26P001/PVI credential leak
Document generated from web research. Some details are based on community reports and may vary with PVI/AR version. Always verify against the official B&R documentation for your specific version.
Key Findings
- PVI is the primary programmatic interface to B&R PLCs — it provides read/write access to process variables, alarm events, and logger data from any Windows PC. No AS project required for variable access.
- Connection requires the ANSL protocol on port 11169 — PVI communicates via the Automation Network Service Layer, which must be reachable. The PLC must be in RUN or SERVICE mode (not BOOT).
- Variable enumeration via CmpObject is the most valuable PVI capability for undocumented machines — it reveals all global variables, their data types, and memory addresses without needing the original project.
- PVI supports both synchronous and asynchronous data transfer — synchronous calls block the calling thread; asynchronous use callbacks and are preferred for continuous monitoring.
- Python wrappers for PVI exist — the community has developed Python bindings via Ctypes that expose PVI functionality to Python scripts. See python-diagnostics.md for complete examples.
- PVI cannot change CPU configuration — it can read/write runtime variables but cannot modify IP addresses, task configuration, or module settings. Use AS or FTP for configuration changes.
- The PVI Transfer Tool is separate from PVI runtime — it handles CF card creation and mass deployment, not real-time variable access.
B&R Automation Studio Project Reconstruction from an Unknown Running CP1584
Overview
This document describes the end-to-end process of creating a new B&R Automation Studio project for a CP1584 controller that is already running in the field but has no known project files. Since B&R PLCs store only compiled binaries on-target, the original source code cannot be recovered — instead, the approach relies on extracting every observable artifact from the running system to reconstruct a functional project. The methodology covers network discovery to locate the PLC, AR log analysis for configuration clues, OPC-UA browsing and PVI enumeration to surface all accessible variables, hardware configuration reading, and exploiting the CF/CFast card for additional data. Throughout, cross-references are provided to companion documents that expand on specific techniques: cp1584-forensics.md for low-level forensic analysis, opcua.md for OPC-UA setup and browsing details, pvi-api.md for the PVI Python API used during enumeration, and diagnostics-sdm.md for System Diagnostics Manager (SDM) usage and remote diagnostics capabilities.
Table of Contents
- Executive Summary
- Critical Limitation: Source Code Cannot Be Extracted
- Network Discovery: Finding the PLC
- AR Log Analysis
- System Dump: The Most Important Diagnostic Tool
- OPC-UA Browsing for Variable Discovery
- Using PVI to Enumerate All Accessible Variables
- Reading Hardware Configuration from a Running PLC
- Using the CF/CFast Card to Aid Reconstruction
- Creating a New Automation Studio Project
- Creating a Matching Hardware Configuration
- Capturing the Current Program State
- Building a Configuration Export Tool
- Systematic Step-by-Step Workflow
- Documenting Findings: IO Maps, Variable Lists, Program Structure
- What Information Is Permanently Lost
- Best Practices for Documenting Undocumented Machines
- Open-Source Tool Reference
- Sources
1. Executive Summary
Reconstructing an Automation Studio project for a B&R X20CP1584 PLC without the original source code is a challenging but partially achievable task. B&R PLCs store only compiled binary code on the controller – the source code (structured text, ladder logic, C code) is never stored on the PLC unless the programmer explicitly enabled the “Transfer source files to target” option during the original download.
However, a surprising amount of information can be recovered: the complete hardware tree (modules, firmware versions, serial numbers), all runtime variables with their names and types, task configurations, AR version information, IO states, network configuration, and diagnostic logs. This information, combined with systematic observation of the machine’s behavior, allows you to create a new Automation Studio project that matches the hardware and can connect to the running program – even if you cannot view or modify the original logic.
This document covers every known method for extracting information from a running B&R PLC and assembling it into a usable project.
2. Critical Limitation: Source Code Cannot Be Extracted
“There is no way to get the code out of a B&R PLC. If you need to make changes to the PLC you need to have the source code to begin with.” – Reddit r/PLC community
“There is only compiled code on the control that is not readable. Only if the programmer has explicitly stored the source code on the flash can it be downloaded.” – Stephan Herbig, B&R Community
Key facts:
- B&R PLCs store only compiled binaries by default
- The compiled code cannot be decompiled or reverse-engineered back to readable source
- Two optional mechanisms exist that may have stored source on the target:
- Target Source Files Comparison (Project > Compare Source Files On Target) – stores a copy of source for comparison purposes
- Store project source files directly on target – stores the full source on the CF card’s user partition
To check if source exists on the target:
- Open Automation Studio
- Connect to the PLC (Online > Settings, configure the IP, click “Connect”)
- Try File > Open Project From Target
- If you get “No valid Automation Studio project file found”, no source was stored
Sources:
- https://community.br-automation.com/t/upload-program-from-a-plc/1520
- https://www.reddit.com/r/PLC/comments/1ja6zbk/problem_getting_program_from_a_plc_x20_br/
3. Network Discovery: Finding the PLC
3.1 Method 1: B&R SNMP Scan via Automation Studio
The primary method for finding a B&R PLC on the network:
- Open Automation Studio
- Go to Online > Settings
- Click Browse – Automation Studio uses SNMP to discover B&R devices
- All B&R PLCs on the network segment will appear with their IP addresses, serial numbers, and device types
Requirements:
- The PLC must have SNMP enabled (it is by default on AR < 6.0, but disabled by default in AS 6.0+ projects)
- If SNMP is disabled, put the PLC in BOOT mode – SNMP re-enables automatically
- WinPcap/Npcap must be installed on the PC (required for the browsing feature)
- The PC must be on the same subnet
Sources:
- https://community.br-automation.com/t/browse-for-targets-in-as-not-working/2065
- https://community.br-automation.com/t/finding-browsing-plc-in-online-settings-not-possible-under-windows-11/4840
3.2 Method 2: brsnmp (Open-Source CLI Tool)
brsnmp is an open-source command-line tool that uses B&R’s PVI-SNMP protocol to discover and manage PLCs on the network without Automation Studio.
## List all B&R PLCs as JSON with full details
brsnmp --details
## Output example:
[
{
"targetTypeDescription": "X20CP1583",
"serialNumber": "D45B0168612",
"cfSerialNumber": "000060076643A1000085",
"arVersion": "B04.45",
"arVersionNorm": "04.45.2",
"arState": "4",
"arBootPhase": "40",
"deviceName": "IF2",
"macAddress": "00-60-65-16-fd-da",
"ipAddress": "192.168.0.14",
"subnetMask": "255.255.255.0",
"ipMethod": "0",
"nodeNumber": "129",
"inaActivated": "1",
"inaPortNumber": "11159",
"hostName": "br-automation",
"defaultGateway": "",
"dnsActivated": "0"
}
]
## List only MAC addresses
brsnmp --list
## Filter to a specific PLC type
brsnmp --filter="X20CP1584" --details
## Change IP settings remotely
brsnmp --filter="X20CP1584" ipAddress=192.168.1.100 subnetMask=255.255.255.0
## Save discovery results
brsnmp --details > plc_inventory.json
Key fields for reconstruction:
| Field | Value for Reconstruction |
|---|---|
targetTypeDescription | Exact CPU model (e.g., X20CP1584) |
arVersion | Automation Runtime version (determines AS version needed) |
serialNumber | Hardware serial for asset tracking |
ipAddress / subnetMask | Network configuration |
nodeNumber / inaNodeNumber | POWERLINK/X2X bus address |
hostName | Configured hostname |
Note: AS 6.0+ projects disable SNMP by default. If the PLC is running AS 6.0+ code, you may need to put it in BOOT mode first to enable SNMP.
Sources:
- https://github.com/hilch/brsnmp
3.3 Method 3: Wireshark / ARP Scan
If SNMP is completely unavailable:
- Connect your PC to the same physical network as the PLC
- Set your PC’s IP to the same subnet (B&R default is typically 192.168.100.x)
- Open Wireshark and capture on the Ethernet interface
- Look for B&R’s SNMP responses or POWERLINK multicast traffic (group address 01:E0:AF:00:00:00)
- The PLC’s MAC address starts with
00:60:65(B&R’s OUI) - Use ARP scan:
arp -aornmap -sn 192.168.100.0/24
3.4 Method 4: Physical Inspection
The X20CP1584 has:
- DIP switches on the bottom for node number (POWERLINK address)
- Default IP:
192.168.100.Xwhere X is derived from the DIP switch settings (when switches are set to FF, default is192.168.100.1) - Ethernet ports: IF1 (left) and IF2 (right, typically IF2 is the main connection)
- LED indicators: RUN (green = running), ERR (red = error), MAINT (yellow = service mode)
Sources:
- https://community.br-automation.com/t/determining-a-plcs-ip-address-using-wireshark/495
- https://community.br-automation.com/t/how-to-find-your-b-r-plc-in-a-network-with-python/7227
4. AR Log Analysis
4.1 What Is the AR Log?
The AR Log (Automation Runtime Log) is the PLC’s internal logbook. It records:
- Startup/shutdown events
- Module insertion/removal
- Configuration errors
- Runtime errors and warnings
- Task class execution information
- Software module loading
- Network events
- POWERLINK/X2X bus events
The primary log file is arlogsys which contains the system logbook entries.
4.2 Accessing the AR Log
Method 1: Via SDM (System Diagnostics Manager)
- Navigate to
http://<PLC_IP>/sdmin a web browser (orhttps://<PLC_IP>/sdmfor AR 6.0+) - Click the Logger tab
- Click Upload from target to download the log file
- The log file can be opened in Automation Studio’s Logger (Open > Logger > Load Data)
Method 2: Via Automation Studio Logger
- Connect to the PLC in Automation Studio (Online > Settings)
- Go to Open > Logger (or Ctrl+L)
- The Logger connects to the PLC and displays log messages in real-time
- Use Load Data to load historical logs
Method 3: Via CF Card (for ARembedded systems)
- Remove the CF card from the PLC
- Open Runtime Utility Center
- Select Tools > Back up files from Compact Flash
- Navigate to
DATA1 Partition > RPSHD > SYSROM - Select all files beginning with
$(these are the log files) - Save them to your PC
Method 4: Via System Dump The System Dump (see Section 5) includes the complete log files bundled into a single archive.
4.3 What Information the Log Reveals for Reconstruction
| Information Category | Description |
|---|---|
| AR Version | The exact Automation Runtime version (critical for matching AS version) |
| Software Modules | Which libraries and function blocks are loaded |
| Hardware Detection | Which modules were detected at startup |
| Task Configuration | Task class names and cycle times |
| Error History | Recurring errors that indicate configuration issues |
| Network Events | POWERLINK node assignments, bus errors |
| Boot Sequence | Order of module initialization |
4.4 Important: AS Version Matching
Your Automation Studio version must match the AR major version of the PLC:
- PLC running AR B4.93 → Use AS 4.12
- PLC running AR 6.5.1 → Use AS 6.x
- Mismatched versions will fail to read logs properly
Sources:
- https://community.br-automation.com/t/how-to-collect-a-system-dump-from-a-b-r-controller/10497
- https://community.br-automation.com/t/service-mode-what-is-it-and-how-to-collect-diagnostics/1613
- https://community.br-automation.com/t/access-to-logging-in-plc/3243
5. System Dump: The Most Important Diagnostic Tool
5.1 What Is a System Dump?
The System Dump is the single most valuable artifact you can extract from a running B&R PLC for reconstruction purposes. It is a .tar.gz archive that collects comprehensive diagnostic data about the PLC into one file.
Available starting with AR V3.08. Created via the SDM web interface.
5.2 Information Contained in a System Dump
The system dump XML file contains:
| Category | Contents |
|---|---|
| General Target Status | CPU mode (RUN/SERVICE/BOOT), AR version, uptime, hostname |
| Software Modules | All loaded libraries and their exact versions |
| System Timing | Task class configurations, cycle times, task priorities |
| Hardware Modules | Complete hardware tree with module types, serial numbers, firmware versions, slot positions, bus topology |
| IO Status | Current state of all digital and analog IO at the timestamp of the dump |
| Memory Status | Memory usage, partition sizes |
| Logger Data | Full log files (when “Parameters + Data-Files” is selected) |
| Network Configuration | IP settings, gateway, DNS, SNMP state |
| Network Command Trace (NCT) | Network communication trace if enabled |
| Application Info | Task names, module configuration details |
5.3 Creating a System Dump via Web Browser
- Open browser:
http://<PLC_IP>/sdm - Click the System Dump icon
- Select “Parameters + Data-Files” (recommended for full information)
- Click OK
- Click Upload from target
- Save the resulting
.tar.gzfile
5.4 Creating a System Dump via Python (Automated)
Using the open-source systemdump.py tool:
pip install systemdumpy
# Create, upload, and save a system dump
py -m systemdumpy 192.168.0.100 -cuv -p MachineA_
# Create an inventory spreadsheet from the dump
py -m systemdumpy BuR_SDM_Sysdump_2024-01-15_11-51-55.tar.gz -iv
5.5 Viewing a System Dump
Method 1: SystemDumpViewer (Open Source, Recommended)
- SystemDumpViewer is a Qt-based application that visualizes system dump data in a format similar to the SDM
- Shows hardware tree, module details, software versions, IO status, log data
- Built with Qt 6.4.2, supports multiple languages
- Download releases from GitHub
Method 2: Automation Studio Logger
- Open Automation Studio
- Open > Logger
- Load Data (top-left icon)
- Select the
.tar.gzfile - Logs will populate with all available modules on the left
Method 3: Direct XML Extraction
The .tar.gz contains a SystemDump.xml file that can be parsed programmatically to extract hardware inventories, software lists, and configuration data.
5.6 System Dump for Hardware Inventory
The system dump is the primary source for discovering the complete hardware configuration:
py -m systemdumpy <dumpfile>.tar.gz -iv
This generates an .xlsx spreadsheet with:
- Every module in the system (CPU, IO modules, bus couplers, communication modules, drives)
- Slot/position within the bus tree
- Serial numbers
- Firmware versions
- Module types
This information directly maps to what you need to recreate in Automation Studio’s Hardware Configuration.
Sources:
- https://github.com/hilch/systemdump.py
- https://github.com/bee-eater/SystemDumpViewer
- https://community.br-automation.com/t/how-to-collect-a-system-dump-from-a-b-r-controller/10497
- https://help.br-automation.com/#/en/6/automationruntime/targets/sdm/sdm/sdm.htm
6. OPC-UA Browsing for Variable Discovery
6.1 Enabling OPC-UA on the PLC
The X20CP1584 supports an integrated OPC-UA server, but it must be enabled and configured. If it was enabled in the original project, you can use it to browse variables without the source code.
Note: OPC-UA must be explicitly configured in the original Automation Studio project. If it was never configured, this method will not work.
To enable OPC-UA (if you can get a blank project connected):
- In Automation Studio, open the Configuration View
- Right-click on the CPU and select Properties
- Navigate to the OPC-UA tab
- Enable the OPC-UA server
- Configure the port (default: 4840)
- Transfer to target
6.2 Browsing Variables via OPC-UA
If OPC-UA is active:
- Use any OPC-UA client (UA Expert, Prosys Simulation, Ignition, Node-RED)
- Connect to
opc.tcp://<PLC_IP>:4840 - Browse the address space
- Variable nodes will show symbolic names and data types
Important: Only variables that were explicitly mapped to the OPC-UA server in the original project’s UA Map will be visible. This is typically a subset of all variables.
6.3 Automation Studio Code Watch (Online Monitoring)
Automation Studio’s Code Watch Extension (AS 2025) provides an online watch capability:
“The extension displays live variable values and, in development versions, supports writing to variables.”
Even without source code, Automation Studio’s Watch Window (Online > Compare > Software) can access all variables on the PLC if the project has been configured for online comparison.
Using Online > Compare > Software without source:
- Connect to the PLC
- Open Online > Compare > Software
- Scroll to Diagnosis Objects to see configured diagnostic items
- The watch window shows variables that are available for monitoring
6.4 Automation Studio Code Watch Access Limitation
“It seems like AS Code Watch window has access to all the variables on the PLC even if they aren’t enabled in the UA Map.”
This means the Automation Studio IDE can see variables through PVI even without OPC-UA, but you need an AS project connected to the PLC to use this feature.
Sources:
- https://community.br-automation.com/t/opc-ua-server-enable-steps-for-x20cp1584/3036
- https://community.br-automation.com/t/exposing-all-variables-over-opcua/11799
- https://community.br-automation.com/t/release-2025-automation-studio-code-watch-extension-overview/8620
7. Using PVI to Enumerate All Accessible Variables
7.1 What Is PVI?
PVI (Process Visualization Interface) is B&R’s proprietary communication protocol between PLCs and PC applications. It is the foundation for all online monitoring, HMI communication, and diagnostic access. PVI can enumerate all process variables (PVs) on a running PLC, including their symbolic names, data types, and current values.
7.2 Method 1: Runtime Utility Center (RUC)
The Runtime Utility Center is installed with the PVI Development Setup (free download from B&R).
To extract all variables:
- Install PVI Development Setup from https://www.br-automation.com/en/downloads/software/automation-netpvi/pvi-development-setup/
- Open Runtime Utility Center
- Select “Create, modify and execute projects (.pil)”
- Create a new connection to the PLC (specify IP and protocol)
- Once connected, expand the variable tree to browse all available variables
- Use the Variable List feature to export all variables to a file
“If you have installed PVI, you will find the Runtime Utility Center on your computer. This allows you to save all the controller variables in a file.”
“You can get the variable list using PVI and even create a new HMI using those variables in .NET on a PC using the PVIservices dll.”
7.3 Method 2: brwatch (Open-Source Variable Browser)
brwatch is the most practical open-source tool for variable enumeration on a B&R PLC.
Features:
- Lists all B&R PLCs on the network via SNMP/UDP scan
- Browses the complete variable tree of a connected PLC
- Watches variables in real-time (with configurable number representation)
- Changes variable values (with confirmation)
- Starts/stops/restarts tasks
- Logs variable values to CSV files
- Changes IP settings
- Supports both INA and ANSL protocols
Usage for variable enumeration:
- Download brwatch.exe from https://github.com/hilch/brwatch/releases
- Requires PVI Development Setup to be installed (for PVI DLLs)
- Run brwatch.exe
- Click on the TCP/IP device to start network scanning
- Select the target PLC
- Left-click on each node in the tree view to scan/expand variables
- Drag variables to the watch list on the right
- Save the configuration via File > Save
Configuration (brwatch.ini):
[General]
; Use ANSL=1 for newer PLCs (AR >= 4.x)
; Default is INA protocol
ANSL=0
Limitations:
- Without a PVI license (1TG0500.02), PVI runs for only 2 hours at a time, then requires restart
- Built in plain C using Win32 API, Windows only
7.4 Method 3: PVIservices DLL (.NET Development)
For programmatic variable enumeration:
// Requires PVIservices library (installed with PVI Development Setup)
using B&R.PVI;
PviConnection pvi = new PviConnection();
pvi.Connect("192.168.1.100", PVIProtocol.INA);
// Enumerate all variables
foreach(var variable in pvi.GetAllVariables())
{
Console.WriteLine($"{variable.Name}: {variable.Address} [{variable.DataType}]");
}
7.5 Method 4: pvipy (Python PVI Wrapper)
pvipy is a Python wrapper for B&R’s PVI interface:
pip install pvipy
This allows you to write Python scripts that connect to the PLC and enumerate all variables programmatically, export them to CSV, or build custom tools.
7.6 What Variable Information Is Available
| Property | Available Via |
|---|---|
| Symbolic variable name | PVI, brwatch, RUC |
| Data type (BOOL, INT, REAL, STRING, etc.) | PVI, brwatch, RUC |
| Current value | PVI, brwatch, RUC |
| Variable scope (global/local) | Partially (via naming convention) |
| Variable structure (if struct member) | PVI, brwatch (tree browse) |
| Array dimensions | PVI, brwatch |
| Memory address | PVI (internal) |
Sources:
- https://community.br-automation.com/t/read-values-with-pvi/3497
- https://github.com/hilch/brwatch
- https://industrialmonitordirect.com/blogs/knowledgebase/extracting-variables-from-br-cp476-plc-without-source-code
- https://www.plctalk.net/forums/threads/b-r-cp476-visualisation-on-b-r-studio.96158/
8. Reading Hardware Configuration from a Running PLC
8.1 Via System Dump (Recommended)
As detailed in Section 5, the System Dump provides the complete hardware tree including:
- CPU model and firmware
- All X20 bus couplers and their stations
- IO module types, positions, and configurations
- Communication module types and settings
- Drive system topology
- Serial numbers for all modules
# Extract hardware inventory to Excel
py -m systemdumpy <dumpfile>.tar.gz -iv
8.2 Via SDM Web Interface
Navigate to http://<PLC_IP>/sdm and browse the following sections:
- System Page > General: CPU model, AR version, serial number, uptime
- System Page > Hardware: Complete module list with status and firmware versions
- System Page > Timing: Task class list with cycle times
- IO Viewer: Live state of all IO points
8.3 Via brsnmp
## Get detailed PLC information
brsnmp --details
This shows the CPU type, serial number, AR version, network configuration, and POWERLINK node number.
8.4 Via Automation Studio Online
- Create a new blank project (File > New Project)
- Go to Online > Settings
- Configure the connection to the PLC’s IP
- Click Connect
- If hardware recognition succeeds, AS can auto-detect the hardware configuration
Automation Studio’s “Load Hardware Configuration from Target”: When creating a new project, Automation Studio offers the option to load the hardware configuration from the target system. This is one of the most powerful methods:
- File > New Project
- When prompted, select the option to detect hardware from the target
- AS queries the PLC’s hardware tree and populates the Hardware Configuration
Note: This works best when AS and AR versions match. The hardware detection identifies module types and positions but may not capture all parameter settings.
8.5 Via SDM IO Viewer
The SDM’s IO Viewer shows live IO states:
- Navigate to
http://<PLC_IP>/sdm - Select the IO Viewer tab
- See all digital inputs, digital outputs, analog inputs, analog outputs with their current values
- This helps map physical IO points to functional purposes
Sources:
- https://community.br-automation.com/t/unable-to-find-hardware-configuration-online/1049
- https://instrumentacionycontrol.net/wp-content/uploads/2017/11/IyCnet_BR_AutomationStudio_QuickStart_MASYS2ASQS-E_240.pdf
- https://www.dmcinfo.com/blog/24942/creating-new-projects-and-adding-hardware-modules-br-automation-studio-blog-series-part-one/
9. Using the CF/CFast Card to Aid Reconstruction
9.1 CF Card Partition Structure
B&R typically creates 4 partitions on the CF/CFast card:
| Partition | Purpose |
|---|---|
| Partition 0 | Boot loader / system firmware |
| Partition 1 (Active) | Runtime system files, compiled binaries, configuration |
| Partition 2 | Passive/backup (passive copy of active) |
| User Partition | Optional; may contain user files, source code, recipes, logs |
Important: Consumer card readers often cannot handle multi-partition industrial CF cards. Use the Runtime Utility Center or a card reader specifically designed for industrial CF cards.
9.2 What May Be on the CF Card
- Compiled binaries (always present): The compiled PLC program in
.brformat - Source code (optional): Only if “Transfer source files to target” was enabled in the original project
- Configuration files:
CFCfg.iniand other configuration files - Log files: In the
RPSHD/SYSROMdirectory - User files: On the User partition – recipes, data logs, custom files
- AR system files: The complete Automation Runtime installation
9.3 Creating a CF Card Image (Critical First Step)
Before doing anything else, create a complete backup image of the CF card:
- Install Runtime Utility Center (from PVI Development Setup)
- Open Runtime Utility Center
- Select “Create, modify and execute projects (.pil)”
- Go to Tools > Back up files from Compact Flash / Image file
- Select the CF card drive letter
- Choose “Create Image” and save the complete
.imgfile - This image can be restored to a replacement CF card using “Restore Image”
“You could also create a copy or image of the compact flash card. You are then not able to change the program code since there are just compiled binaries on it, but you could restore it on another CPU if your current CPU fails.”
9.4 Exploring CF Card Contents
Using Runtime Utility Center:
- Tools > Back up files from Compact Flash
- Select the CF card
- Wait for disk information to load
- Expand: DATA1 Partition > RPSHD > SYSROM
- Select files beginning with
$(log files) - Browse other directories for configuration files and user data
9.5 Checking for Source Code on the CF Card
If you’re very lucky, the source project may be stored on the user partition:
“If you are very lucky, the source project will be stored on the F:\ (user partition) of the CF card.”
To check:
- In Runtime Utility Center, browse the user partition (usually the last partition on the card)
- Look for
.apj(Automation Studio project) files or.ac(Automation Studio Configuration) directories - If found, these can potentially be loaded in Automation Studio
9.6 CF Card for Backup and Migration
Even without source code, the CF card image serves as:
- A complete backup of the running system
- A way to restore the exact same program on a replacement CPU
- A source of configuration and log information
Sources:
- https://www.reddit.com/r/PLC/comments/1amxzp6/br_plc_program_loading/
- https://community.br-automation.com/t/how-to-reset-a-plc-without-removable-media/3383
- https://community.br-automation.com/t/runtime-utility-center-create-restore-backups-plc-images/11710
- https://industrialmonitordirect.com/blogs/knowledgebase/br-pcmcia-cf-card-backup-and-restore-procedure
10. Creating a New Automation Studio Project
10.1 Prerequisites
- Determine the AR version from the System Dump or SDM or brsnmp
- Install the matching Automation Studio version
- Install hardware support packages for the CPU and modules
- Install PVI Development Setup for additional tools
10.2 Create a New Project with Hardware Auto-Detection
Option A: Load Hardware from Target (Best Method)
- File > New Project
- Select “Standard Project”
- Assign a project name
- During hardware configuration, select “Load Hardware Configuration from Target”
- Enter the PLC’s IP address
- Automation Studio queries the PLC and auto-populates the hardware tree
- The complete hardware configuration (CPU, bus couplers, IO modules, communication modules) is imported
Option B: Manual Hardware Configuration
- File > New Project
- Select “Standard Project”
- Manually add hardware based on System Dump inventory
- Navigate to Physical View
- Right-click > Insert Module
- Add the CPU (X20CP1584)
- Add bus couplers and IO modules matching the System Dump
10.3 Configure Network Settings
- In Configuration View, select the CPU
- Set the IP address to match the PLC’s current IP
- Configure subnet mask, gateway, hostname
- Enable SNMP (required for online browsing)
- Configure Ethernet POWERLINK settings if applicable
10.4 Connecting to the Running PLC
- Online > Settings
- Add a new connection
- Set the IP address (must match exactly)
- Set the transport protocol (INA or ANSL)
- Click “Connect”
- The PLC’s status should change to “Online”
10.5 What You Can Do Once Connected
| Action | Possible Without Source? |
|---|---|
| Watch variables in real-time | YES (via Watch window, brwatch, PVI) |
| Change variable values | YES (most variables are writable) |
| Start/Stop/Restart tasks | YES (via brwatch, AS, or PVI) |
| View IO states | YES (via SDM, AS System Monitor) |
| Modify program logic | NO (requires source code) |
| Add new variables | NO (requires source code) |
| Change task configurations | NO (requires recompilation) |
| Transfer a new program | YES (overwrites running binary) |
Sources:
- https://www.dmcinfo.com/blog/24942/creating-new-projects-and-adding-hardware-modules-br-automation-studio-blog-series-part-one/
- https://community.br-automation.com/t/getting-started-with-b-r-hello-community-first-project-backend-plc-part/4676
- https://instrumentacionycontrol.net/wp-content/uploads/2017/11/IyCnet_BR_AutomationStudio_QuickStart_MASYS2ASQS-E_240.pdf
11. Creating a Matching Hardware Configuration
11.1 Using the System Dump Inventory
The system dump provides everything needed to recreate the hardware tree:
- Run
py -m systemdumpy <dump>.tar.gz -ivto generate the hardware inventory spreadsheet - Use the inventory as a checklist for adding modules in Automation Studio
- Pay special attention to:
- Module order: The position of modules on the bus matters
- Bus couplers: X20 bus couplers (BC, BB, etc.) and their station numbers
- Slot positions: Some modules are slot-sensitive
- Firmware versions: Match firmware versions in the new configuration
11.2 Physical Inspection Checklist
Since the System Dump provides module types but not physical wiring:
- Photograph all IO modules in the cabinet, noting:
- Module part numbers (visible on the module label)
- Slot/position on the bus
- Terminal wiring labels
- Document the bus topology:
- Which bus couplers are at which addresses
- Which station numbers are configured via DIP switches
- Cable routing between bus couplers
- Record DIP switch settings on all bus couplers
11.3 X20 Bus Topology Notes
The X20 system uses a right-side bus (X2X) to connect modules:
- The CPU’s IF3 or IF4 port connects to the first bus coupler
- Bus couplers have station numbers (configured via hardware switches or software)
- Each bus coupler can have up to 12 modules attached
- Station numbers must be unique within a bus segment
- Bus couplers may be connected in a chain (daisy-chain topology)
11.4 POWERLINK Configuration
The X20CP1584 typically has:
- IF3: Ethernet POWERLINK (managed node or CN)
- IF1/IF2: Standard Ethernet for programming and OPC-UA
Document the POWERLINK configuration:
- Node number (from brsnmp
nodeNumberfield) - Whether the CPU is a Managing Node (MN) or Controlled Node (CN)
- Connected drives/slaves on the POWERLINK bus
Sources:
- https://community.br-automation.com/t/automation-studio-hardware-list-export/8312
- https://store.sim3d.com/demo3d_2024/configuring_a_br_automation_connection
12. Capturing the Current Program State
12.1 What CAN Be Captured
| Data | Method | Tool |
|---|---|---|
| Complete variable list with types | PVI enumeration | brwatch, RUC, PVIservices |
| Current variable values | Online monitoring | brwatch, AS Watch, PVI |
| Hardware configuration | System dump, SDM | systemdump.py, SDM web |
| Task class list and cycle times | System dump, SDM | systemdump.py |
| Software modules and versions | System dump | systemdump.py |
| IO mapping and live states | SDM IO Viewer | Web browser |
| Network configuration | brsnmp, SDM | brsnmp |
| Log history | SDM Logger, CF card | Web browser, RUC |
| CF card image | RUC backup | Runtime Utility Center |
12.2 What CANNOT Be Captured
| Data | Reason |
|---|---|
| Source code (ST, LD, C, SFC) | Only compiled binary exists on PLC |
| Comments and documentation | Compiled out |
| Original variable declarations | Only runtime metadata survives |
| Program structure/file organization | Binary is flattened |
| Configuration parameter comments | Only values survive |
| Library source code | Only compiled references |
| Timer/counter presets in code | May be visible as variable values but not the code logic |
12.3 Snapshot Procedure
Before making any changes, capture a complete snapshot:
# 1. System dump
py -m systemdumpy <PLC_IP> -cuv -p MachineName_
# 2. SNMP details
brsnmp --details > <PLC_IP>_snmp_details.json
# 3. Variable list (via brwatch: browse all tree nodes, save config)
# In brwatch: File > Save As > variables.bww
# 4. CF card image
# In Runtime Utility Center: Tools > Back up files from Compact Flash > Create Image
# 5. IO states (manual: screenshot SDM IO Viewer)
Sources:
- https://community.br-automation.com/t/upload-program-from-a-plc/1520
- https://community.br-automation.com/t/backup-program-from-plc-x20cp1381-so-i-can-restore-it-in-another-cpu-same-as-the-first-one/8140
13. Building a Configuration Export Tool
13.1 Python-Based Export Script Concept
A reconstruction toolkit can be built using open-source components:
"""
B&R PLC Configuration Export Tool
Combines system dump parsing, SNMP discovery, and PVI variable enumeration
"""
import json
import subprocess
import xml.etree.ElementTree as ET
from pathlib import Path
from datetime import datetime
class BRConfigExporter:
def __init__(self, plc_ip: str, output_dir: str = "./export"):
self.plc_ip = plc_ip
self.output_dir = Path(output_dir) / f"BR_Export_{datetime.now():%Y%m%d_%H%M%S}"
self.output_dir.mkdir(parents=True, exist_ok=True)
def export_system_dump(self):
"""Create and download system dump from PLC"""
subprocess.run([
"py", "-m", "systemdumpy",
self.plc_ip, "-cuv",
"-p", f"Export_{self.plc_ip.replace('.', '_')}"
])
# Find the downloaded file and move to output dir
def export_snmp_details(self):
"""Export PLC network and hardware details via SNMP"""
result = subprocess.run(
["brsnmp", "--filter", self.plc_ip, "--details"],
capture_output=True, text=True
)
with open(self.output_dir / "snmp_details.json", "w") as f:
f.write(result.stdout)
def parse_system_dump_xml(self, dump_path: str) -> dict:
"""Parse system dump XML to extract structured data"""
# The .tar.gz contains SystemDump.xml
# Parse: hardware modules, software modules, tasks, memory, network
pass
def export_hardware_inventory(self, dump_path: str):
"""Generate hardware inventory spreadsheet"""
subprocess.run([
"py", "-m", "systemdumpy", dump_path, "-iv"
])
def generate_io_map_template(self, hardware_data: dict):
"""Create IO mapping template from hardware data"""
# Generate a spreadsheet with columns:
# Module, Slot, Channel, Type, Current Value, Purpose (to be filled), Wire Label
pass
def generate_variable_list_template(self):
"""Create variable documentation template"""
# Generate a spreadsheet with columns:
# Variable Name, Data Type, Scope, Current Value, Purpose (to be filled)
pass
def export_all(self):
"""Run all export operations"""
self.export_system_dump()
self.export_snmp_details()
# ... additional exports
print(f"All exports saved to: {self.output_dir}")
13.2 System Dump XML Structure (Key Elements)
The SystemDump.xml contains these primary sections:
<SystemDump>
<GeneralStatus>
<TargetMode>RUN</TargetMode>
<ARVersion>B04.45</ARVersion>
<SerialNumber>...</SerialNumber>
<HostName>br-automation</HostName>
</GeneralStatus>
<Software>
<Module Name="AsBrStr" Version="4.45.2"/>
<Module Name="AsIec" Version="4.45.2"/>
<Module Name="MpCore" Version="4.45.0"/>
<!-- ... all loaded libraries -->
</Software>
<Hardware>
<Module Type="X20CP1584" Slot="0" Serial="..." Firmware="...">
<SubModule Type="X20BC0087" Station="1" Slot="1"/>
<SubModule Type="X20DI9371" Slot="2"/>
<SubModule Type="X20DO9322" Slot="3"/>
<!-- ... complete hardware tree -->
</Module>
</Hardware>
<Timing>
<TaskClass Name="Cyclic#1" CycleTime="10000"/>
<TaskClass Name="Cyclic#2" CycleTime="100000"/>
</Timing>
<Memory>
<Partition Name="RPSHD" Used="..." Total="..."/>
<Partition Name="User" Used="..." Total="..."/>
</Memory>
</SystemDump>
13.3 Leveraging Existing Tools
| Tool | Language | Purpose |
|---|---|---|
| systemdump.py | Python | Create/parse system dumps |
| SystemDumpViewer | C++/Qt | Visualize system dump data |
| brwatch | C | Browse and watch variables |
| brsnmp | C++ | Network discovery and configuration |
| pvipy | Python | Python PVI wrapper for variable access |
| Pvi.py | Python | Alternative Python PVI wrapper |
| brOscatLib | AS | Standard utility library (useful for reference) |
Sources:
- https://github.com/hilch/systemdump.py
- https://github.com/bee-eater/SystemDumpViewer
- https://github.com/hilch/brwatch
- https://github.com/hilch/brsnmp
14. Systematic Step-by-Step Workflow
Phase 1: Discovery (No Changes to PLC)
| Step | Action | Tool | Output |
|---|---|---|---|
| 1.1 | Photograph cabinet, note all module labels | Camera | Photo archive |
| 1.2 | Record all DIP switch settings | Visual | Switch settings doc |
| 1.3 | Discover PLC on network | brsnmp / AS browse | IP, model, AR version, serial |
| 1.4 | Create complete CF card image | Runtime Utility Center | .img backup file |
| 1.5 | Create system dump | SDM web / systemdump.py | .tar.gz dump file |
| 1.6 | Download AR log | SDM / AS Logger | Log files |
| 1.7 | Capture SNMP details | brsnmp –details | snmp_details.json |
| 1.8 | Screenshot SDM IO Viewer | Web browser | IO state reference |
Phase 2: Variable Enumeration
| Step | Action | Tool | Output |
|---|---|---|---|
| 2.1 | Install PVI Development Setup | B&R website | PVI tools available |
| 2.2 | Browse complete variable tree | brwatch / RUC | Variable list |
| 2.3 | Export variable list with types | brwatch / RUC | Variable documentation |
| 2.4 | Record current values of all variables | brwatch CSV logger | variables_<timestamp>.csv |
| 2.5 | Identify task names and classes | brwatch / systemdump | Task configuration |
Phase 3: Hardware Documentation
| Step | Action | Tool | Output |
|---|---|---|---|
| 3.1 | Parse system dump for hardware inventory | systemdump.py -iv | inventory.xlsx |
| 3.2 | Build hardware tree in AS matching the dump | Automation Studio | AS project with hardware |
| 3.3 | Document bus topology (stations, couplers) | Visual + system dump | Bus diagram |
| 3.4 | Verify IO module types against physical inspection | Visual comparison | Verified hardware list |
| 3.5 | Configure network settings in new project | Automation Studio | Matching IP config |
Phase 4: Project Assembly
| Step | Action | Tool | Output |
|---|---|---|---|
| 4.1 | Install matching AS version | B&R website | Compatible AS installed |
| 4.2 | Create new project, load hardware from target | Automation Studio | Project with hardware config |
| 4.3 | If hardware auto-detect fails, manually add from inventory | Automation Studio | Complete hardware tree |
| 4.4 | Configure task classes based on system dump data | Automation Studio | Task configuration |
| 4.5 | Test online connection to PLC | Automation Studio | Confirmed connectivity |
| 4.6 | Verify all variables accessible via Watch window | Automation Studio | Variable access confirmed |
Phase 5: Documentation
| Step | Action | Tool | Output |
|---|---|---|---|
| 5.1 | Create IO map from hardware inventory + IO Viewer | Spreadsheet | IO map document |
| 5.2 | Create variable reference from exported list | Spreadsheet | Variable reference |
| 5.3 | Document task configuration | Spreadsheet | Task documentation |
| 5.4 | Document network configuration | Text | Network diagram |
| 5.5 | Create functional description from observed behavior | Text | Functional spec |
| 5.6 | Archive all exports in version control | Git | Reconstruction repository |
15. Documenting Findings: IO Maps, Variable Lists, Program Structure
15.1 IO Map Template
| Station | Slot | Module Type | Channel | Type (DI/DO/AI/AO) | Wire Label | Current State | Purpose (observe) |
|---------|------|-------------|---------|-------------------|------------|---------------|-------------------|
| 1 | 1 | X20BC0087 | - | Bus Coupler | BC1 | OK | Cabinet 1 base |
| 1 | 2 | X20DI9371 | CH1 | DI | X1-E1 | TRUE | Safety door closed |
| 1 | 2 | X20DI9371 | CH2 | DI | X1-E2 | FALSE | Start button |
15.2 Variable List Template
| Variable Name | Data Type | Scope | Current Value | Structure/Parent | Purpose (observe) |
|---------------|-----------|-------|---------------|-----------------|-------------------|
| gMachineState | DINT | Global| 2 | - | Machine state enum |
| stAxis1 | AxAxisRef | Global| [struct] | - | Axis 1 parameters |
| stAxis1.nPos | LREAL | Member| 1234.56 | stAxis1 | Current position |
| bStartButton | BOOL | Global| FALSE | - | Start command |
15.3 Task Configuration Template
| Task Class | Name | Cycle Time (ms) | Priority | Watchdog (ms) | Estimated Purpose |
|------------|------|-----------------|----------|----------------|-------------------|
| 1 | Cyclic#1 | 10 | 1 | 50 | Fast IO / motion |
| 2 | Cyclic#2 | 100 | 5 | 500 | Standard logic |
| 3 | Cyclic#3 | 1000 | 10 | 5000 | Slow / HMI update |
15.4 Program Structure Inference
Without source code, program structure must be inferred:
- Variable naming conventions: Well-named variables reveal functional groupings (e.g.,
stConveyor_*,axisHeater_*) - Task class count and cycle times: Fast tasks suggest motion/safety, slow tasks suggest HMI/recipes
- Software modules loaded:
MpAxissuggests motion,MpRecipesuggests recipe handling - Observed behavior: Watch variable changes during machine operation to understand logic flow
- IO patterns: Correlate IO changes with machine actions to infer interlocks and sequences
16. What Information Is Permanently Lost
16.1 Completely Lost (Cannot Be Recovered)
| Information | Reason |
|---|---|
| Source code (ST, LD, C, SFC) | Only compiled binary exists; cannot be decompiled |
| Comments and inline documentation | Stripped during compilation |
| Original project file structure | Binary is flattened; no file boundaries survive |
| Program logic and algorithms | Compiled to machine code |
| Timer/counter presets in logic | Only visible if exposed as variables |
| Function block internal implementations | Library internals not exposed |
| Configuration parameter comments | Only values, not rationale |
| Original developer’s intent | Cannot be inferred from binary |
16.2 Partially Recoverable
| Information | Recovery Method | Quality |
|---|---|---|
| Variable names | PVI enumeration | Full (symbolic names preserved in binary) |
| Variable types | PVI enumeration | Full (type metadata preserved) |
| Current variable values | Online monitoring | Full (real-time) |
| Hardware configuration | System dump, SDM | Full (complete hardware tree) |
| Task configuration | System dump | Partial (names and cycle times) |
| Software modules | System dump | Full (library list with versions) |
| Network configuration | brsnmp, SDM | Full |
| IO mapping | SDM IO Viewer | Partial (physical → logical mapping requires observation) |
16.3 The “Golden Scenario”: Source Code Was Stored on Target
In rare cases, the original developer enabled “Transfer source files to target” or “Target Source Files Comparison”. In this case:
- File > Open Project From Target in Automation Studio will load the complete source
- The source files are stored on the CF card’s active partition
- You can fully edit and rebuild the program
Check this FIRST before attempting any reconstruction.
Sources:
- https://community.br-automation.com/t/upload-program-from-a-plc/1520
- https://www.reddit.com/r/PLC/comments/1ja6zbk/problem_getting_program_from_a_plc_x20_br/
- https://community.br-automation.com/t/problem-getting-program-from-a-plc-x20/5019
17. Best Practices for Documenting Undocumented Machines
17.1 Immediate Actions
- NEVER power off the PLC until you have at minimum:
- A CF card image backup
- A system dump
- A complete variable list export
- Work on a copy: Clone the CF card image and work with the clone, never the original
- Document everything as you go: Don’t rely on memory; photograph and record immediately
- Use version control: Store all exports and documentation in a Git repository
17.2 Documentation Standards
- Naming convention: Use consistent naming for all discovered elements
- Date stamps: Include dates on all exports and observations
- Machine state context: Record what the machine was doing when you captured each piece of data
- Correlation: Cross-reference variable names with IO points and observed behavior
- Confidence levels: Mark information as “Observed”, “Inferred”, or “Guessed”
17.3 Functional Reverse Engineering Approach
Since you cannot see the code, reverse-engineer the function:
- Map all IO: For each input, trigger it and observe which outputs/variables change
- Map sequences: Track the order of operations by watching state variables
- Identify modes: Determine machine states (auto, manual, fault, setup) from state variables
- Map safety interlocks: Identify which conditions prevent certain actions
- Document recipes/parameters: Capture all setpoint/parameter values
- Record timing: Measure cycle times and sequence durations
- Map communication: Identify external device communication (Modbus, PROFINET, OPC-UA, etc.)
17.4 Building a Replacement Strategy
If modification is required and source code is truly lost:
- Keep the original running: Do NOT overwrite the existing binary
- Build a parallel system: Create a new project that runs alongside the original, taking over functions incrementally
- Use the CF card image as safety net: If anything goes wrong, you can restore the original image
- Consider external overrides: For simple changes, an external PLC or soft-PLC can modify IO signals without touching the original program
- Contact B&R support: They may be able to help identify the original system integrator
17.5 Long-Term Recommendations
- Label everything: Every wire, every module, every terminal
- Create as-built drawings: Update cabinet drawings to match actual configuration
- Record all setpoints: Many machines have critical parameters visible as variables
- Document startup sequence: Record the order the machine goes through on power-up
- Archive all discovered data in multiple locations: Local PC, network share, cloud backup
18. Open-Source Tool Reference
Essential Tools
| Tool | URL | Language | Purpose |
|---|---|---|---|
| brwatch | https://github.com/hilch/brwatch | C (Win32) | Variable browsing, monitoring, logging, IP config |
| brsnmp | https://github.com/hilch/brsnmp | C++ | Network discovery, PLC details, IP management |
| systemdump.py | https://github.com/hilch/systemdump.py | Python | Create/parse system dumps from CLI |
| SystemDumpViewer | https://github.com/bee-eater/SystemDumpViewer | C++/Qt | Visualize system dump data |
| Pvi.py | https://github.com/hilch/Pvi.py | Python | Python PVI wrapper for PLC communication |
| awesome-B-R | https://github.com/hilch/awesome-B-R | - | Curated list of B&R tools and libraries |
B&R Official Tools
| Tool | Included With | Purpose |
|---|---|---|
| Automation Studio | B&R license | Full IDE for B&R PLCs |
| Runtime Utility Center | PVI Development Setup | CF card backup/restore, variable lists |
| PVI Manager | PVI Development Setup | Manages PVI connections |
| PVI Monitor | PVI Development Setup | Real-time variable monitoring |
| SDM (web-based) | PLC itself (AR >= 3.0) | System diagnostics, system dump, logger |
Python Ecosystem
| Tool | URL | Purpose |
|---|---|---|
| pvipy | https://pypi.org/project/pvipy/ | Python PVI wrapper |
| demo-br-asyncua | https://github.com/hilch/demo-br-asyncua | Async OPC-UA client for B&R PLCs |
| systemdumpy | https://pypi.org/project/systemdumpy/ | CLI system dump tool |
19. Sources
B&R Official Documentation
- B&R Online Help: https://help.br-automation.com/
- B&R SDM Documentation: https://help.br-automation.com/#/en/6/automationruntime/targets/sdm/sdm/sdm.htm
- B&R System Dump Help: https://help.br-automation.com/#/en/6/automationruntime/targets/sdm/sdm/sdm2_sdmpage_systemdump.html
- PVI Development Setup Download: https://www.br-automation.com/en/downloads/software/automation-netpvi/pvi-development-setup/
- B&R Tutorial Portal: https://www.br-automation.com/en/academy/virtual-classroom/br-tutorial-portal/
B&R Community Forum Posts
- How to collect a System Dump: https://community.br-automation.com/t/how-to-collect-a-system-dump-from-a-b-r-controller/10497
- Service Mode Diagnostics: https://community.br-automation.com/t/service-mode-what-is-it-and-how-to-collect-diagnostics/1613
- Upload program from a PLC: https://community.br-automation.com/t/upload-program-from-a-plc/1520
- OPC UA Server enable steps for X20CP1584: https://community.br-automation.com/t/opc-ua-server-enable-steps-for-x20cp1584/3036
- Exposing all variables over OPCUA: https://community.br-automation.com/t/exposing-all-variables-over-opcua/11799
- Read values with PVI: https://community.br-automation.com/t/read-values-with-pvi/3497
- Browse for targets troubleshooting: https://community.br-automation.com/t/browse-for-targets-in-as-not-working/2065
- Finding PLC in Online Settings: https://community.br-automation.com/t/finding-browsing-plc-in-online-settings-not-possible-under-windows-11/4840
- SNMP scan from CLI: https://community.br-automation.com/t/scan-network-snmp-from-terminal-cli/10280
- Runtime Utility Center backups: https://community.br-automation.com/t/runtime-utility-center-create-restore-backups-plc-images/11710
- Open Project from Target: https://community.br-automation.com/t/x20cp0292-program-upload-no-valid-automation-studio-project-file/8613
- Hardware list export: https://community.br-automation.com/t/automation-studio-hardware-list-export/8312
- Logger access: https://community.br-automation.com/t/access-to-logging-in-plc/3243
- PLC IP via Wireshark: https://community.br-automation.com/t/determining-a-plcs-ip-address-using-wireshark/495
- SystemDumpViewer guide: https://community.br-automation.com/t/how-to-open-and-view-a-systemdump/6006
Open-Source Repositories
- brwatch: https://github.com/hilch/brwatch
- brwatch manual: http://hilch.github.io/brwatch/manual.html
- brsnmp: https://github.com/hilch/brsnmp
- systemdump.py: https://github.com/hilch/systemdump.py
- SystemDumpViewer: https://github.com/bee-eater/SystemDumpViewer
- Pvi.py: https://github.com/hilch/Pvi.py
- awesome-B-R: https://github.com/hilch/awesome-B-R
- ListAllBurPLCs: https://github.com/Chihing/ListAllBurPLCs
- B&R Automation Tools VS Code Extension: https://github.com/br-automation-community/vscode-brautomationtools
Third-Party Guides
- DMC: Creating New Projects: https://www.dmcinfo.com/blog/24942/creating-new-projects-and-adding-hardware-modules-br-automation-studio-blog-series-part-one/
- DMC: AR Configuration Changes: https://www.dmcinfo.com/blog/26437/br-automation-changing-automation-runtime-configurations/
- IMD: PVI Variable Extraction: https://industrialmonitordirect.com/blogs/knowledgebase/extracting-variables-from-br-cp476-plc-without-source-code
- IMD: CF Card Backup: https://industrialmonitordirect.com/blogs/knowledgebase/br-pcmcia-cf-card-backup-and-restore-procedure
- Automation Studio Quick Start: https://instrumentacionycontrol.net/wp-content/uploads/2017/11/IyCnet_BR_AutomationStudio_QuickStart_MASYS2ASQS-E_240.pdf
Community Discussions
- Reddit: Getting program from B&R X20: https://www.reddit.com/r/PLC/comments/1ja6zbk/problem_getting_program_from_a_plc_x20_br/
- Reddit: Recover code from controller: https://www.reddit.com/r/PLC/comments/vtxc9b/help_request_with_rb_x20_plc_can_i_upload_the/
- PLCtalk: X20CP1584 upload program: https://www.plctalk.net/forums/threads/b-r-plc-x20cp1584-v4-10-upload-program.144873/
- PLCtalk: CP476 variable extraction: https://www.plctalk.net/forums/threads/b-r-cp476-visualisation-on-b-r-studio.96158/
Key Findings
- Full source code recovery is impossible — B&R compiles IEC 61131-3 code to object modules (*.BR files). You can upload configuration and variable names but NOT the original ladder/ST/FBD source code. Reconstruction means building a NEW project that matches the RUNNING behavior.
- The upload from target gives you ~80% of what you need — hardware configuration, IO mapping, variable declarations, task configuration, and library references are all recoverable. What’s lost is the program logic (the actual code).
- SDM is your first tool on any undocumented machine — it reveals the complete hardware tree, module firmware versions, task configuration, and system logs without any software installation.
- OPC-UA namespace browsing can expose the complete variable structure — if the OEM enabled OPC-UA, browsing the address space reveals all global variables, their data types, and even array structures.
- PVI variable extraction from a PC provides the variable list without AS — using the PVI API’s
CmpObjectinterface to enumerate variable names and types gives you the data declarations needed for a new project. - The process is: discover hardware → extract configuration → map IO → document behavior → write replacement logic. See documentation-reconstruction.md for the parallel documentation track.
Cross-References
| Related Document | Content | Relevance |
|---|---|---|
| cp1584-forensics.md | Forensic analysis without project files | The primary reference for extracting data from an unknown CP1584 |
| cf-card-boot.md | CF card contents, file layout, boot sequence | Understanding what’s on the CF card for upload/recovery |
| pvi-api.md | PVI API for variable access and enumeration | Programmatic variable discovery without Automation Studio |
| opcua.md | OPC-UA server browsing, namespace inspection | Alternative method for variable and data type discovery |
| config-file-formats.md | .acp, .apj, Hardware.hwl format details | Understanding the configuration files recovered from the CF card |
| execution-model.md | Task classes, cycle times, priority system | Reconstructing task configuration from online observation |
| memory-map.md | IO mapping, addressing, direct memory access | Reconstructing IO mapping when online monitoring is available |
| diagnostics-sdm.md | SDM for hardware/software discovery | First tool for discovering what’s running on an undocumented machine |
| program-reverse-engineering.md | Binary analysis, decompilation approaches | For analyzing compiled code when source is unrecoverable |
| ftp-web-interface.md | FTP access, remote file download | Pulling files from the CF card remotely |
| documentation-reconstruction.md | Systematic documentation methodology | Building the maintenance manual for the reconstructed project |
| firmware-version-mgmt.md | Version identification, compatibility | Ensuring reconstructed project targets correct firmware version |
| access-recovery.md | Password recovery, credential discovery | Getting access to the PLC when credentials are unknown |
B&R Automation Configuration File Formats on CF Card
A comprehensive reference for all configuration file formats used by B&R Automation Studio and Automation Runtime (AR) on CompactFlash (CF) / CFast cards.
Table of Contents
- CF Card Partition Structure
- Automation Runtime Boot Process
- Key Data Objects on the CF Card
- Project Files (.apj, .acp, .aci, .arp)
- Hardware Configuration Files (Hardware.hwl, Hardware.hw)
- Software Configuration Files
- I/O Mapping Files
- Network Configuration (IP Address, Hostname, POWERLINK)
- mapp IO Template Files (Conf0.xml, .io, .ar)
- Source Project Storage (AsProject.br)
- Runtime Utility Center and .pil Files
- Configuration Backup and Restore
- Editing Files Manually
- Complete File Extension Reference
1. CF Card Partition Structure
B&R CF cards use a proprietary multi-partition layout. A standard B&R CF card typically contains 4 partitions:
| Partition | Purpose | Filesystem | Notes |
|---|---|---|---|
| System / SYSROM | Automation Runtime OS image | Proprietary / FAT | Contains the AR operating system kernel, drivers, and boot loader. Often stored in System ROM on the controller itself rather than the CF card. |
| APP | Application binaries and configuration | Proprietary B&R format | Contains compiled user programs (.br modules), data objects (arconfig, iomap, sysconf), and runtime binaries. This is the primary partition the AR OS reads at boot. |
| User | User data / file storage | FAT16 / FAT32 | Available for application file storage, recipes, logs, system dumps, and user-accessible files. Accessed via FileIO function blocks. Configurable minimum size in CPU properties. |
| Data / TransferSystem | Runtime data and transfer buffers | Proprietary | Used for data exchange, transfer system files, and intermediate runtime data. |
Project Location on CF Card by Controller Series
| Controller Series | Project / APP Path on CF |
|---|---|
| X20 (e.g. X20CP1484, X20CP1585) | /Mynte/X86/APP/ |
| Power Panel (e.g. PP41) | /Flash/Project/ |
| Automation PC (APC) | /Mynte/ACP/ |
| Safe Series | /Mynte/SAFETY/ |
Important Notes
- B&R controllers require industrial-grade CF/CFast cards. Consumer cards often fail because they lack the controller needed to maintain separate partitions.
- CF cards should be formatted FAT16 for older controllers; newer controllers support FAT32 on the User partition.
- Never remove a CF card while the controller is powered on.
- The 4-partition layout means a standard PC card reader may only show 1-2 partitions (typically the User partition), hiding the System and APP partitions.
2. Automation Runtime Boot Process
When a B&R controller powers on, the following sequence occurs:
- BIOS / Bootloader - The controller’s BIOS initializes hardware and locates the boot device (CF card or internal flash).
- AR Kernel Load - The Automation Runtime kernel is loaded from the System partition or System ROM. This is a real-time, deterministic, multitasking operating system.
- Partition Mount - AR mounts the APP partition and reads its contents.
- Data Object Loading - AR reads the critical data objects in sequence:
sysconf(system configuration) - task scheduling, bus configuration, timer device settingsarconfig(runtime configuration) - IP address, hostname, subnet mask, gateway, network parametersiomap(I/O mapping) - mapping between hardware I/O points and software variablescntrl(control configuration) - controller-specific settings
- Hardware Initialization - Based on sysconf, AR initializes communication buses (X2X, POWERLINK, EtherNet/IP, etc.) and enumerates connected hardware modules.
- SDM (System Diagnostic Manager) - Starts the SDM, which builds a hardware tree reflecting the physical topology. PNP (Plug and Play) generates communication devices.
- Task Execution - Cyclic tasks begin execution according to the task configuration defined in sysconf.
- Application Startup - User programs (.br modules) are loaded into their assigned tasks and begin executing.
- Transition to RUN State - The controller enters RUN mode once all initialization is complete.
Boot Modes
| Mode | Behavior |
|---|---|
| COLDSTART | Full initialization. All RAM is cleared, all hardware re-initialized, all tasks restarted. Corresponds to power-on or watchdog reset. |
| WARMSTART | Selective re-initialization. Retains persistent variables (RETAIN data), some hardware state preserved. Triggered by software command or configuration change. |
| INIT | Initialization mode used for firmware updates and system maintenance. |
3. Key Data Objects on the CF Card
The APP partition contains several critical data objects. These are not plain text files in the traditional sense – they are compiled binary data objects generated by Automation Studio during the build process. However, they originate from XML-based source files in the AS project.
3.1 sysconf (System Configuration)
The sysconf data object is the master configuration for the entire controller. It is stored in the APP partition and defines:
- Task scheduling - Task classes, priorities, cycle times, and which programs are assigned to each task
- Bus configuration - X2X bus parameters, POWERLINK settings, bus cycle times
- Timer device - I/O scheduler timer configuration (a timer device entry is required for each task class)
- Hardware topology - The physical hardware tree (CPU, bus couplers, I/O modules, interface modules)
- Communication device parameters - Settings for each communication interface
- Watchdog configuration - Hardware and software watchdog timeouts
The sysconf originates from the Hardware.hwl and Hardware.hw files in the AS project, plus the CPU configuration in the Configuration View. It is compiled into a binary .syc (sysconf.syc) file.
Key limitation: The sysconf data object cannot be modified at runtime using mapp IO or AsIOMMan. These libraries only modify arconfig and iomap. Adding interface modules (e.g. FPSC, IF485, IFPLK) requires sysconf changes, which means those modules cannot be dynamically added via mapp IO alone.
3.2 arconfig (Automation Runtime Configuration)
The arconfig data object contains the network and runtime settings for the controller:
- IP address (e.g.
192.168.1.10) - Subnet mask (e.g.
255.255.255.0) - Default gateway
- Hostname
- DNS server settings
- Time server (NTP) configuration
- Various runtime parameters
ArConfig is accessible in the Configuration View of Automation Studio under the CPU properties. It can also be read and written at runtime using the AsARCfg library functions:
(* Read IP address *)
CfgGetIPAddr_1.enable := 1;
CfgGetIPAddr_1.pDevice := ADR(pDevice);
CfgGetIPAddr_1.pIPAddr := ADR(IPString);
CfgGetIPAddr_1.Len := 20;
CfgGetIPAddr_1();
(* Write IP address *)
CfgSetIPAddr_1.enable := 1;
CfgSetIPAddr_1.pDevice := ADR(pDevice);
CfgSetIPAddr_1.pIPAddr := ADR(NewIPString);
CfgSetIPAddr_1();
Other AsARCfg functions include: CfgGetSubnetMask(), CfgSetSubnetMask(), CfgGetHostname(), CfgSetHostname(), etc.
3.3 iomap (I/O Mapping)
The iomap data object defines the mapping between physical I/O hardware and software variables. It maps:
- Digital inputs (DI) and outputs (DO) to boolean variables
- Analog inputs (AI) and outputs (AO) to integer/real variables
- Bus coupler data points to structured variables
- Module-specific data (e.g. temperature, counters, encoder values)
I/O mapping is configured in Automation Studio via the I/O register card view. Each module has a list of data points that can be assigned variable names.
The iomap can be modified at runtime using the mapp IO library (AsIOMMan) via the ASIOMMRemove and ASIOMMCreate functions, or by loading XML configuration templates.
Important: When replacing iomap, a warm restart is needed. I/O data point “not found” warnings occur if arconfig is removed before iomap, or if the new configuration is loaded without a warm restart.
3.4 cntrl (Control Configuration)
The cntrl data object contains controller-specific configuration including:
- CPU operating parameters
- Memory allocation settings
- Safety-related parameters (on safety controllers)
- Watchdog configuration
4. Project Files
4.1 .apj – Automation Studio Project File (XML)
The .apj file is the main project file for an Automation Studio project. It is an XML file that serves as the project manifest. When you open a project in Automation Studio, you open the .apj file.
Key characteristics:
- XML format, human-readable with a text editor
- Contains project metadata: name, target system, Automation Studio version
- References all other project files (hardware trees, configuration files, software packages)
- Defines the project structure (configurations, packages, referenced libraries)
Typical .apj XML structure (conceptual):
<?xml version="1.0" encoding="utf-8"?>
<Project Version="4.12" xmlns="...">
<Name>MyMachineProject</Name>
<Target>
<Type>X20CP1585</Type>
<RuntimeVersion>J4.25</RuntimeVersion>
</Target>
<Configurations>
<Configuration Name="Config1" Default="true">
<HardwareTree>Hardware/Hardware.hw</HardwareTree>
<ConfigurationFile>Configuration.cfg</ConfigurationFile>
<PackageRefs>
<PackageRef Name="Software" />
</PackageRefs>
</Configuration>
</Configurations>
<Packages>
<Package Name="Software" Path="Software/" />
</Packages>
<Libraries>
<Library Name="AsBrStr" />
<Library Name="AsIOMMan" />
</Libraries>
</Project>
4.2 .acp – Automation Configuration Package
The .acp file is a configuration package that contains hardware and software configuration data for a specific configuration variant. Projects can have multiple configurations (e.g., different machine variants), each represented by its own .acp or set of configuration files.
- Contains references to hardware configuration, I/O mapping, task configuration
- One configuration can be selected as the active/default configuration for building and downloading
4.3 .aci – Configuration Index / Data
The .aci file stores configuration data and index information. It is used by Automation Studio to track configuration state and is part of the project’s configuration system.
4.4 .arp – Project Resources
The .arp file contains project-level resources such as:
- Global variable definitions
- User-defined data types shared across configurations
- OPC-UA mapping configurations
- Visualization resources
4.5 Project File Collection Summary
An Automation Studio project is a collection of:
| Component | Description |
|---|---|
| Programs (POUs) | .st, .ld, .il, .sfc, .c source files (Structured Text, Ladder, etc.) |
| User files | Custom data types, global variables (.dat, .var) |
| Hardware trees | Hardware.hwl, Hardware.hw |
| Configuration files | .acp, .aci, .arp, .cfg |
| I/O mappings | I/O mapping configuration linked to the hardware tree |
| Imported software | mapp components, third-party libraries |
| Libraries | .br binary library packages |
5. Hardware Configuration Files
5.1 Hardware.hwl – Hardware Library (XML)
The Hardware.hwl file is an XML-based hardware library that defines the physical hardware components available in the project. It acts as a catalog of all hardware modules that can be used.
- XML format
- Lists hardware module types and their properties
- Referenced by
Hardware.hwto build the actual hardware tree - Generated and maintained by Automation Studio when modules are added/removed from the hardware catalog
- Contains module type definitions, parameter ranges, default settings
Not typically edited manually – changes are made through the Automation Studio hardware catalog interface.
5.2 Hardware.hw – Hardware Tree (XML)
The Hardware.hw file is an XML file that defines the actual hardware tree for a specific configuration. It specifies:
- The CPU model (e.g., X20CP1585)
- Connected bus couplers (e.g., X20BC0087)
- All I/O modules in their physical positions (stations/addresses)
- Bus module types (X20BM05, X20BM11, X20BM15) for address assignment
- Interface modules (e.g., X20IF10A1, X20IF1043, X20IF1081)
- Power supply modules (e.g., X20PS9400)
- Network topology and bus addressing
Conceptual Hardware.hw structure:
<?xml version="1.0" encoding="utf-8"?>
<Hardware xmlns="...">
<Device Type="X20CP1585" Name="CPU">
<BusCoupler Type="X20BC0087" Station="1">
<Module Type="X20DI9371" Station="2" />
<Module Type="X20DO8322" Station="3" />
<Module Type="X20AI4322" Station="4" />
<Module Type="X20PS4951" Station="5" />
<Module Type="X20AI4222" Station="6" />
<BusModule Type="X20BM11" Station="7" />
</BusCoupler>
</Device>
</Hardware>
How to edit Hardware.hw:
- Open the project in Automation Studio
- Use the hardware tree editor (left panel, Configuration View) to add/remove modules
- Modify station addresses by changing bus module types
- Automation Studio regenerates
Hardware.hwautomatically - Manual XML editing is possible but risky – Automation Studio validates the structure
Important addressing rules:
- Without addressable bus modules (X20BM15, X20BM05), stations are assigned sequentially
- X20BM15 allows arbitrary station address assignment
- Power supply modules (X20PS series) use bus modules just like I/O modules
- The hardware tree in SDM on the target will reflect whatever
Hardware.hwspecifies, not necessarily the physical wiring
5.3 Relationship to sysconf
During the build process, Hardware.hw is compiled into the sysconf binary data object. Changes to the hardware tree require a full rebuild and redownload to the target.
6. Software Configuration Files
6.1 Task Configuration
Task configuration is part of the sysconf data object and defines how the controller’s CPU time is allocated:
Task classes in B&R AR (from highest to lowest priority):
| Class | Priority | Typical Use | Default Cycle |
|---|---|---|---|
| Class 1 | Highest | Safety functions, motion control | 100 us - 1 ms |
| Class 2 | High | Fast I/O processing, positioning | 1 ms |
| Class 3 | Medium | Standard cyclic programs | 10 ms |
| Class 4 | Low | Background processing, HMI | 100 ms |
| Class 5 | Lowest | Non-time-critical tasks | 1000 ms |
Each task class has:
- A cycle time (deterministic, guaranteed execution interval)
- Assigned programs/POUs that execute within the task
- A watchdog timeout (if the task exceeds its cycle time)
Task configuration is set in the Configuration View under the CPU properties, in the “Task Configuration” tab. It is compiled into sysconf.
6.2 Program References
Programs (POUs - Program Organization Units) are assigned to tasks in the Configuration View:
- In the Logical View, programs are organized under the Software tree
- In the Configuration View, programs are linked to specific task classes
- Programs reference each other through the global variable/data object system
- Program entry points are mapped to task classes via the task configuration
6.3 Software Tree Structure
The right panel of Automation Studio (Software tree) contains:
Software/
Data Objects/
GlobalVars.dat -- Global variable declarations
MachineConfig.var -- Configuration data types
RetainData.dat -- Persistent variables
Programs/
Main/
MainProgram.st -- Entry program (Cyclic)
AxisControl.st -- Motion program
Functions/
CalculateSpeed.st
FilterSignal.st
Function Blocks/
Motor.fb
Libraries/
AsBrStr.br -- B&R standard library
AsMath.br -- Math functions
mapp.br -- mapp components
6.4 Configuration View Structure
The Configuration View provides a two-panel layout:
| Left Panel (Hardware Tree) | Right Panel (Software / Config) |
|---|---|
| CPU (with properties: IP, hostname, task config) | Task Configuration |
| Bus Couplers | Data Objects |
| I/O Modules (with I/O register card) | Program References |
| Interface Modules | OPC-UA Mapping |
| Network Devices | Memory Configuration |
| Additionally Supported Hardware |
7. I/O Mapping Files
7.1 I/O Mapping Overview
I/O mapping connects physical hardware I/O points to software variables. In Automation Studio:
- Each hardware module has an I/O register card showing all available data points
- Variables are assigned to individual data points (e.g.,
DI1->gStopButton) - The I/O mapping is stored as part of the configuration data
- At runtime, the
iomapdata object contains the compiled mapping
Data point types:
| Module Type | Typical Data Points |
|---|---|
| X20DI9371 (Digital Input) | DI1 through DI32 (BOOL) |
| X20DO8322 (Digital Output) | DO1 through DO32 (BOOL) |
| X20AI4322 (Analog Input) | AI1 through AI4 (INT, 16-bit) |
| X20AO4622 (Analog Output) | AO1 through AO4 (INT, 16-bit) |
| X20AT4222 (Temp Input) | AT1 through AT2 (REAL) |
| X20PS4951 (Power Supply) | Status, diagnostics |
7.2 I/O Mapping Configuration
I/O mapping is configured through:
- Automation Studio GUI: Click on a module in the hardware tree to open its I/O register card, then assign variable names to data points
- mapp IO Library: For runtime reconfiguration using XML templates
- AsIOMMan Library: Programmatic I/O management using
ASIOMMRemove/ASIOMMCreatefunction blocks
7.3 mapp IO Template Format (.io files)
For runtime I/O reconfiguration, mapp IO uses .io template files that define I/O mappings for specific module types:
- Each module type can have a corresponding
.iofile - These files contain the I/O mapping definitions in a structured format
- Referenced by
Conf0.xmlconfiguration files - Stored in the project or in a template directory
8. Network Configuration
8.1 IP Address and Network Parameters
Network configuration is stored in the arconfig data object and includes:
| Parameter | Description | Example |
|---|---|---|
| IP Address | Controller’s static IP | 192.168.1.10 |
| Subnet Mask | Network subnet | 255.255.255.0 |
| Default Gateway | Router for external networks | 192.168.1.1 |
| Hostname | Controller name on network | X20CP1585-MyMachine |
| DNS Server | Domain name resolution | 192.168.1.100 |
Methods to change IP address:
- Automation Studio (Online Mode): Connect to PLC -> Online -> Settings -> Set IP Parameters (volatile, resets on reboot unless saved to arconfig)
- Configuration View: Edit the arconfig properties for the CPU, rebuild and redownload (persistent)
- Runtime API: Use
AsARCfglibrary (CfgSetIPAddr()) from user program (persistent, writes to arconfig) - brwatch utility: Use
brwatchservice tool to set IP addresses via command line
8.2 POWERLINK Configuration
POWERLINK (Ethernet POWERLINK, EPL) is B&R’s real-time Ethernet protocol. Configuration includes:
Ethernet parameters:
- IP address for the POWERLINK interface
- Subnet mask
- Cycle time (typically 200 us - 10 ms)
- Poll timeout
POWERLINK-specific parameters:
- Node address / station ID
- IsManaging flag (MN = Managing Node / CNC = Controlled Node)
- Asynchronous bandwidth allocation
- Multi-phase cycle settings
- Prescale factor
Configuration in Automation Studio:
- POWERLINK settings are in the CPU’s network properties
- The
sysconfdata object contains bus cycle timing - The
arconfigdata object contains the IP addressing - POWERLINK V2 requires a valid binding configuration
8.3 Additional Network Protocols
| Protocol | Configuration Location |
|---|---|
| EtherNet/IP | arconfig + specific module configuration |
| Modbus TCP/IP | Module-specific configuration (e.g., X20IF1081) |
| CANopen | Interface module parameters (e.g., X20IF1043) |
| OPC UA | Configuration View -> OPC-UA mapping |
| ANSL (Automation Network Service Layer) | arconfig (auto-discovery settings) |
9. mapp IO Template Files
The mapp IO technology enables runtime hardware reconfiguration. It uses a set of template files:
9.1 Conf0.xml – Configuration Definition
The Conf0.xml file defines a complete hardware configuration variant:
<?xml version="1.0" encoding="utf-8"?>
<Configuration Name="Conf0">
<Modules>
<Module Type="X20DI9371" Source="Template" Station="2" />
<Module Type="X20DO8322" Source="Template" Station="3" />
<Module Type="X20AI4322" Source="Template" Station="4" />
</Modules>
<IOMapping>
<Mapping Module="X20DI9371" File="X20DI9371.io" />
<Mapping Module="X20DO8322" File="X20DO8322.io" />
<Mapping Module="X20AI4322" File="X20AI4322.io" />
</IOMapping>
</Configuration>
Source attribute options:
Source="AR"– Use configuration from the currently running AR (default for mapp IO)Source="Template"– Use template files (.io, .ar) from the project file system
9.2 .io Files – I/O Mapping Templates
.io files contain I/O mapping definitions for specific module types. Each file defines the data points and their variable mappings for a particular module.
9.3 .ar Files – Module Configuration Templates
.ar files contain module-specific configuration parameters for a particular module type. These are the AR-side configuration templates that complement the .io mapping files.
9.4 Using mapp IO at Runtime
To switch hardware configurations at runtime:
- Create template files (Conf0.xml, .io, .ar) for each configuration variant
- Use
mapp IOfunction blocks to load a new configuration - The system removes the current arconfig and iomap data objects
- New arconfig and iomap are generated from the template files
- A warm restart is required for the new configuration to take effect
- The SDM hardware tree updates to reflect the new configuration
Limitations:
- Interface modules (FPSC, IF485, IFPLK) require
sysconfchanges, which mapp IO cannot do - Modules not listed in “Additionally Supported Hardware” in CPU properties will not work
- The system must be designed with modular hardware support from the start
10. Source Project Storage
10.1 AsProject.br – Archived Source Project
When a project is downloaded to a B&R target (or via offline installation), the source project files can be stored as an AsProject.br module on the target’s CF card or onboard flash memory.
AsProject.bris a compressed archive of the complete Automation Studio project source- It includes all source code (.st, .ld files), configuration files, hardware trees, and libraries
- This allows recovering the project from the target using Project -> Open from Target in Automation Studio
Enabling source storage on the target:
- In Automation Studio, open the project
- Switch to Configuration View
- Right-click the CPU folder -> Properties
- Navigate to the Comparison tab
- Enable “Source comparison on the target”
- Rebuild and download the project
Requirements:
- Automation Runtime V3.08 or higher (SG4 targets)
- The source comparison option must be enabled before the build that is downloaded
- Offline Installation (
Project -> Project Install -> Offline Installation, shortcut Alt+F8) explicitly transfers source files
10.2 Downloading Source from Target
To recover a project from a target’s CF card:
- Remove the CF card from the controller (power off first)
- Insert into a PC card reader
- Navigate to the APP partition directory
- Copy the project files or AsProject.br module
- In Automation Studio: File -> Open Project and select the .apj file
- Or use Project -> Open from Target via Ethernet connection
11. Runtime Utility Center and .pil Files
11.1 Runtime Utility Center (RUC)
B&R Runtime Utility Center is a standalone tool for CF/CFast card management:
- Create CF card images: Backup entire CF card contents as
.imgfiles - Restore CF cards: Write image files to replacement cards
- Create installation packages: Generate
.pilfiles for offline installation - Format cards: Prepare new CF/CFast cards for B&R use
11.2 .pil Files – Program Installation Lists
.pil files are command list files used by the B&R Runtime to execute installation sequences. They are text-based instruction files that tell AR what to install from the CF card.
Creating a .pil file:
- In Automation Studio: Project -> Project Install -> Offline Installation (Alt+F8)
- This generates an installation package including the .pil file
- The .pil file lists the sequence of binary modules to load
11.3 .abk Files – Backup Files
.abk files are Automation Studio backup files created through the online backup function:
Target -> Backup -> Createin Automation Studio- Contains the full runtime state including configuration and binaries
- Can be restored via
Target -> Backup -> Restore
12. Configuration Backup and Restore
12.1 Method 1: Automation Studio Online Backup
- Connect to the target via Ethernet (Online -> Connect)
- Target -> Backup -> Create
- Select backup scope: Full Backup (OS + runtime + data) or Application Only
- Save as
.abkfile - Restore: Target -> Backup -> Restore -> select .abk file
12.2 Method 2: Runtime Utility Center (Offline)
- Power down controller, remove CF card
- Insert CF card into PC card reader
- Open Runtime Utility Center
- Create Image -> select CF card -> save as .img file
- Restore Image -> select .img -> write to new CF card
12.3 Method 3: Raw Disk Imaging
## Linux - Create backup
dd if=/dev/sdX of=BR_CF_Image.img bs=4M conv=noerror,sync
## Linux - Restore to new card
dd if=BR_CF_Image.img of=/dev/sdX bs=4M conv=noerror,sync
## Windows - Use Win32 Disk Imager or similar
12.4 Method 4: File-Level Copy
For accessible files on the User partition:
- Navigate to the User partition via PC card reader
- Copy relevant files (recipes, logs, user data)
- For APP partition files: use Runtime Utility Center or raw imaging (the APP partition is not directly accessible from a PC)
12.5 Backup Best Practices
- Maintain multiple backup copies on separate media
- Document backup date and controller firmware version with each backup
- Test restore procedures on a spare controller
- Use
.abkfiles for version-matched restores (same AS version) - Use raw
.imgfiles for exact sector-by-sector clones - Never modify CF card contents while the controller is running
13. Editing Files Manually
13.1 What Can Be Edited Manually
| File | Editable Manually? | Tool | Risk |
|---|---|---|---|
.apj (project file) | Yes (XML) | Any text editor | Low-Medium |
Hardware.hw | Possible (XML) | Text editor | High (validation needed) |
Hardware.hwl | Not recommended | – | Very High |
arconfig (binary) | No | Automation Studio or AsARCfg API | – |
iomap (binary) | No | Automation Studio or mapp IO | – |
sysconf (binary) | No | Automation Studio only | – |
Conf0.xml | Yes (XML) | Any text editor | Low (for mapp IO templates) |
.io templates | Yes | Automation Studio or text editor | Low |
.pil | Yes (text) | Text editor | Medium |
| User partition files | Yes | Any file editor | Low |
13.2 Changing IP Addresses
Method A – Automation Studio (recommended):
- Configuration View -> CPU Properties -> arconfig
- Modify IP address, subnet mask, gateway, hostname
- Rebuild and download
Method B – AsARCfg library (at runtime):
CfgSetIPAddr_1.pIPAddr := ADR('192.168.1.20');
CfgSetIPAddr_1();
Method C – brwatch (command line):
brwatch -s <target_ip> -i <new_ip>
Method D – Online Settings (temporary): Automation Studio -> Online -> Settings -> Set IP Parameters (volatile, resets on reboot)
13.3 Inspecting Configuration Files via FTP (No Automation Studio)
When you have no AS project but need to understand or modify configuration, you can access files via FTP:
## Connect to the PLC FTP server
ftp 192.168.1.10
## Try: anonymous / (any email), or admin / admin, or admin / (blank)
## List the system partition root
ls -la
## Key files to look for:
## BrWebSvr.ini - Web server config
## arlogsys.log - System log
## SysDir/*.cfg - Runtime configuration files
## List the SysDir configuration directory
ls SysDir/
## Download the web server configuration for inspection
get BrWebSvr.ini
## Download the ARConfig (if accessible - typically binary)
## Note: arconfig, iomap, sysconf are binary data objects, NOT plain text
## They cannot be meaningfully edited with a text editor
What you CAN do via FTP:
- Download and inspect
.ini,.cfg,.xml,.txtfiles from the system partition - Download and modify user partition files (recipes, logs, CSV data)
- Upload replacement configuration files for web server, OPC-UA, etc.
- Download
.logfiles for analysis
What you CANNOT do via FTP:
- Modify binary data objects (arconfig, iomap, sysconf, cntrl) — these are compiled binaries
- Modify the hardware tree or task configuration
- Install new software modules
For modifying binary configuration, you need either Automation Studio or the AsARCfg/mapp IO runtime libraries. See ftp-web-interface.md for the complete FTP access guide and pvi-api.md for programmatic runtime configuration changes.
13.4 Changing I/O Mapping via mapp IO (Runtime)
When you need to change I/O mapping at runtime without Automation Studio:
- Create new
Conf0.xmlwith modified.iotemplate files - Load via mapp IO function blocks (requires mapp IO license)
- Warm restart required for changes to take effect
13.5 Changing I/O Mapping via Automation Studio (Recommended)
Method A – Automation Studio:
- Open I/O register card for the module
- Change variable assignments
- Rebuild and download
13.6 Changing Program References / Task Configuration
- Edit task configuration in Configuration View -> CPU Properties -> Tasks
- Assign programs to different task classes
- Rebuild and download (affects sysconf)
- Cannot be changed at runtime – requires rebuild
13.5 Changing Hardware Configuration
- Modify Hardware.hw through the hardware tree editor
- Add/remove modules, change station addresses
- Rebuild (regenerates sysconf)
- Download to target (requires cold restart for hardware changes)
14. Complete File Extension Reference
| Extension | Type | Description |
|---|---|---|
.apj | XML | Main Automation Studio project file |
.acp | XML/Binary | Configuration package for a project variant |
.aci | Binary | Configuration index / data |
.arp | Binary/XML | Project resources (globals, types, OPC-UA mapping) |
.cfg | Text | Configuration settings |
.hwl | XML | Hardware library (module type definitions) |
.hw | XML | Hardware tree (physical topology) |
.st | Text | Structured Text program source |
.ld | Text | Ladder Diagram program source |
.il | Text | Instruction List program source |
.sfc | Text | Sequential Function Chart source |
.c | Text | ANSI C program source |
.dat | Text | Data object (variable/type declarations) |
.var | Text | Variable declarations |
.fb | Text | Function block definition |
.br | Binary | Compiled binary module (library, program, or data) |
.pil | Text | Program Installation List (offline install commands) |
.abk | Binary | Automation Studio backup file |
.img | Binary | Raw disk image of CF/CFast card |
.io | Text/XML | I/O mapping template (mapp IO) |
.ar | Text/XML | Module configuration template (mapp IO) |
.xml | XML | Generic XML configuration (mapp IO, OPC-UA, etc.) |
.syc | Binary | Compiled sysconf data object |
.zp | Binary | Compressed project archive (legacy format) |
AsProject.br | Binary | Compressed source project archive on target |
Summary: What Each Major File Controls
| File / Data Object | Controls | How to Edit |
|---|---|---|
| Hardware.hw | Physical hardware topology, module placement, bus addressing | AS hardware tree editor (or direct XML edit) |
| Hardware.hwl | Available hardware module definitions | AS hardware catalog (not recommended manual edit) |
| sysconf (binary) | Task scheduling, bus timing, hardware init, timer config | AS Configuration View (CPU properties) |
| arconfig (binary) | IP address, hostname, network parameters, runtime settings | AS Configuration View or AsARCfg API at runtime |
| iomap (binary) | Physical I/O to software variable mapping | AS I/O register card or mapp IO at runtime |
| cntrl (binary) | Controller-specific parameters | AS CPU properties |
| .apj | Project structure, file references, target system | Text editor (XML) or AS |
| Conf0.xml | Runtime hardware reconfiguration variant | Text editor (XML) for mapp IO |
| .pil | Offline installation sequence | AS or text editor |
| AsProject.br | Source project backup on target | Automatically generated by AS build |
Key Findings
-
The CF card holds the complete system definition. Every configuration file on the CF card — from
ARConfig.inito hardware tree (.hw) files — collectively defines how the CP1584 operates. Understanding these files is the key to modifying a system without Automation Studio. -
Configuration files are plain text and editable. Most B&R configuration files use INI-style formats that can be edited with any text editor. This means IP addresses, IO mapping, and program references can be changed directly on the CF card via FTP or a card reader.
-
Hardware configuration lives in
.hwand.hwlfiles. The.hwfile is the machine-specific instance; the.hwlis the template library. Modifying the.hwfile changes what hardware the AR expects to find at boot — a wrong edit causes immediate module detection failures. -
Multiple configuration files reference each other. The project configuration (
.acp), the AR configuration (ARConfig.ini), and the hardware tree files form an interconnected web. Changes to one often require corresponding changes to others. -
Configuration changes require a restart to take effect. Unlike online changes to variable values, modifications to configuration files on the CF card only take effect when the AR restarts. Plan configuration work accordingly.
-
Backup the entire CF card before any configuration edits. A single incorrect edit to a critical configuration file can prevent the system from booting. Always have a complete CF card image as a rollback point.
References
Cross-References
| Related File | Relevance |
|---|---|
| cf-card-boot.md | CF card partition structure, file system layout, and boot sequence |
| bootloader-recovery.md | Recovery procedures when configuration files are corrupted |
| firmware.md | Firmware architecture and how AR loads configuration files |
| ftp-web-interface.md | Accessing configuration files remotely via FTP |
| cp1584-forensics.md | Using configuration files to reconstruct knowledge of an undocumented system |
| project-reconstruction.md | Building a new AS project from unknown configuration files |
| network-architecture.md | Network configuration files and device enumeration settings |
| powerlink-internals.md | POWERLINK configuration parameters in ARConfig.ini |
| modbus-gateway.md | Modbus configuration files and register mapping |
| opcua.md | OPC-UA server configuration in BrOpcUaSvr.ini |
| license-mgmt.md | License key files and Technology Guarding configuration |
| access-recovery.md | BOOT mode configuration access when credentials are lost |
| online-changes.md | How runtime configuration changes persist (or don’t) across restarts |
B&R Documentation
- B&R Automation Runtime Training Module TM213TRE
- B&R POWERLINK Configuration and Diagnostics TM950TRE
- B&R Community Forum: https://community.br-automation.com
- B&R Runtime Utility Center Documentation
- mapp IO Online Help (Automation Studio)
- AsARCfg Library Reference (Automation Studio)
B&R Automation X20 CP1584 – Bootloader and Recovery Procedures
Applies to: B&R X20 CP1484, CP1584, CP1585, CP1586 and related X20 Compact CPUs. Based on: B&R X20 System User’s Manual, X20CP148x/158x datasheets, B&R Community forums, and field experience. This is unofficial documentation compiled from publicly available sources. Always consult the official B&R manuals at br-automation.com for authoritative procedures.
Table of Contents
- Boot Sequence Overview
- What Happens When the CF Card Is Corrupted or Missing
- Bootloader Modes and Operating Mode Switch
- LED Indications During Boot Failure
- How to Enter Bootloader Mode on the CP1584
- Serial Console Access
- Firmware Recovery via Serial (B&R Service Utility)
- TFTP Recovery Procedure
- USB-Based Recovery
- Runtime Utility Center for Firmware Operations
- Automation Studio Offline Installation
- Creating Recovery Media
- Safe Mode and Diagnostic Mode
- Minimum Files Needed on CF Card for Boot
- How to Unbrick a CP1584 That Won’t Boot
- How to Reload the Entire System from Scratch
- Prevention and Best Practices
- References
1. Boot Sequence Overview
When power is applied to an X20 CP1584, the following boot sequence occurs:
- Hardware POST – The CPU performs power-on self-test. Internal flash boots the embedded bootloader firmware (stored in internal flash, not on the CF card).
- CF Card Detection – The bootloader checks the CompactFlash slot for a valid storage card. The CF LED illuminates green if a card is detected.
- Boot Mode Evaluation – The bootloader reads the operating mode switch position (BOOT / RUN / DIAG) and determines the startup strategy:
- BOOT: Starts “Boot AR” – a minimal runtime environment that allows firmware installation via the online interface (Ethernet or RS-232). No user application runs.
- RUN: Attempts to load Automation Runtime from the CF card, initialize the I/O bus, and start the user application.
- DIAG: Boots into diagnostic mode. User RAM and User Flash contents are not initialized.
- Runtime Load – In RUN mode, the bootloader reads the SYSTEM partition on the CF card, loads Automation Runtime, and begins I/O bus initialization.
- Application Start – The user application (task classes) begins execution. The R/E LED turns solid green.
- Runtime to Run – Automation Runtime transitions from RUN state to normal operation. The full X2X bus and POWERLINK networks are brought up.
The embedded bootloader is stored in internal flash on the CPU itself. It cannot be erased by CF card corruption. This is the safety net that allows recovery even when the CF card is completely destroyed.
2. What Happens When the CF Card Is Corrupted or Missing
CF Card Missing (No Card Inserted)
| Condition | Behavior |
|---|---|
| Switch in RUN | CPU enters BOOT mode from internal flash. The internal embedded firmware starts a limited runtime that allows online connections for firmware transfer. R/E LED = red, RDY/F LED = yellow. |
| Switch in BOOT | CPU enters BOOT mode normally (same as missing card in RUN). |
| Switch in DIAG | CPU enters DIAG mode from internal flash. |
The CPU does not become a brick when no CF card is present. The internal bootloader always fires and provides a minimal environment for recovery.
CF Card Corrupted
| Corruption Type | Behavior |
|---|---|
| Invalid partition table (partition count = 0) | CPU stays in BOOT mode. Automation Runtime cannot find a SYSTEM partition. |
| SYSTEM partition filesystem corruption | CPU may enter BOOT mode or, if Automation Runtime partially loads, may enter DIAG mode (Diagnostic). Automation Runtime has failed to boot correctly. |
| Missing or corrupted user application | CPU boots Automation Runtime successfully but enters SERVICE mode – no task classes are running. |
| Firmware/B&R component files corrupted | CPU may enter BOOT mode with error in the Logger. Automation Runtime fails to fully initialize. |
| RAW filesystem (unformatted) | CF LED may light green (card detected) but the CPU cannot read it. Stays in BOOT mode. |
Key Diagnostic: CF Card Recognition
- CF LED off – No CF card detected at all (physical seating issue, dead card).
- CF LED green – Card is detected and readable at the hardware level.
- CF LED yellow – Card is being read from or written to (normal during boot).
- CPU stays in BOOT mode after setting switch to RUN with CF card inserted – Strong indicator that CF card is not recognized, not formatted correctly (needs FAT16), or does not contain a valid operating system.
3. Bootloader Modes and Operating Mode Switch
The X20 CP1584 has a physical operating mode switch on the front panel:
Switch Positions
| Switch Position | Mode | Description |
|---|---|---|
| BOOT | Boot Mode | Starts “Boot AR” – the minimal embedded runtime. The online interface (Ethernet + RS-232) is initialized, allowing firmware download and initial installation via Automation Studio. No user application runs. User flash memory is erased only when the download begins. |
| RUN | Run Mode | Normal operation. CPU loads Automation Runtime from the CF card, initializes all bus systems and I/O modules, and starts the user application. If no valid CF card or runtime is found, falls back to BOOT behavior. |
| DIAG | Diagnostic Mode | CPU boots into diagnostic mode. Program sections in User RAM and User FlashPROM are not initialized. After diagnostic mode, the CPU always boots with a warm restart. Used for troubleshooting without affecting user program memory. |
Important: A switch position between BOOT, RUN, and DIAG is not permitted. The switch has detents at these three positions only.
Reset Button Behavior
The reset button is located below the USB interfaces on the bottom of the CPU housing. It can be pressed with a small pointed object (e.g., paperclip).
| Action | Result |
|---|---|
| Press < 2 seconds | Warm restart (reboot). The CPU restarts. |
| Press 2 – 5 seconds | Stops all application programs, sets all outputs to zero, and the PLC starts up in SERVICE mode by default. The startup mode that follows can be configured in Automation Studio. |
| Press > 5 seconds (or hold through a short-press reboot cycle) | On X20 Panel-based controllers: enters DIAGNOSTIC mode. On X20 CPUs: the behavior is similar – a full reset that stops all running programs. Some B&R documentation indicates holding through the initial reboot (< 2s pulse, then hold > 2s within 2 seconds) can force diagnostic entry. |
Note: Pressing Reset does not erase the program from CF card. It stops execution and reboots.
4. LED Indications During Boot Failure
Primary CPU Status LEDs (CP1484 / CP1584 / CP1585 / CP1586)
| LED | Color | State | Meaning |
|---|---|---|---|
| R/E | Green | On | Application running (normal RUN) |
| R/E | Green | Blinking | Boot mode – CPU is initializing application, all bus systems, and I/O modules. This can take several minutes. |
| R/E | Green | Double flash | Mode BOOT (during firmware update). |
| R/E | Red | On | SERVICE mode |
| R/E | Red | Blinking | License violation (R/E blinks red AND RDY/F blinks yellow) |
| RDY/F | Yellow | On | CPU is active in SERVICE or BOOT mode |
| RDY/F | Yellow | Blinking | License violation (with R/E red blink) |
| RDY/F | Red | On | Overtemperature shutdown (110°C CPU / 95°C board per B&R datasheet; error 9204 in logbook) |
| S/E | Green | On | POWERLINK/Ethernet link established |
| S/E | Green | Blinking | Ethernet activity |
| S/E | Red | On | System error (check logbook) |
| S/E | Red | Blinking | System stop with error code (see error codes below) |
| PLK | Green | On | POWERLINK link established |
| PLK | Green | Blinking | POWERLINK activity |
| ETH | Green | On | Ethernet link established |
| ETH | Green | Blinking | Ethernet activity |
| CF | Green | On | CompactFlash inserted and detected |
| CF | Yellow | On | CompactFlash read/write access |
| DC | Yellow | On | CPU power supply OK |
| DC | Red | On | Backup battery empty |
System Stop Error Codes (S/E LED Blinking Red)
The error code is indicated by the S/E LED blinking red. The pattern consists of 4 switch-on phases, each either short (150 ms) or long (600 ms), repeated every 2 seconds.
| Code Pattern | Error | Resolution |
|---|---|---|
| Short Short Short Long | RAM error | Device is defective and must be replaced. |
| Short Short Long Long | Hardware error | Device or a system component is defective and must be replaced. |
| Short Short Short Short | Not an error | Normal startup blinking (several red blinks immediately after power-on are normal). |
Power Supply LEDs
| LED | Color | State | Meaning |
|---|---|---|---|
| r (green) | Off | Module not supplied with power | |
| r (green) | Single flash | Mode RESET | |
| r (green) | Blinking | Mode PREOPERATIONAL | |
| r (green) | On | Mode RUN | |
| e (red) | Off | Everything OK | |
| e (red) | On | Error (single state) | |
| e (red) | Double flash | X2X Link overload, I/O supply too low, or input voltage too low | |
| e + r | Solid red + single green flash | Invalid firmware |
Interpreting Common Boot Failure LED Patterns
| LED Pattern | Diagnosis |
|---|---|
| R/E red ON, RDY/F yellow ON | SERVICE mode (program crashed, missing, or fault) |
| R/E green blinking (stuck) | BOOT mode – system initializing (could take minutes; if stuck, CF card issue) |
| R/E red blinking + RDY/F yellow blinking | License violation |
| CF LED OFF | CF card not detected (remove and re-seat, or replace card) |
| DC LED red | Backup battery empty (replace CR2477N battery) |
| S/E red blinking with code pattern | Hardware or RAM error (device may need replacement) |
| No LEDs at all | No power to module (check power supply and wiring) |
5. How to Enter Bootloader Mode on the CP1584
Method 1: Operating Mode Switch (Primary)
- Set the switch to BOOT – Slide the mode switch to the BOOT position.
- Power cycle – Power off the X20 system, wait 30 seconds, power back on.
- The CPU will start in BOOT mode. R/E LED = red, RDY/F LED = yellow.
- In BOOT mode, the embedded Boot AR runtime initializes the Ethernet and RS-232 interfaces, allowing you to connect for firmware download.
Method 2: Missing/Invalid CF Card with Switch in RUN
- Remove the CF card (or leave a corrupted card in place).
- Set switch to RUN.
- Power cycle – the CPU will fall back to BOOT mode since no valid runtime is found on the CF card.
- This gives you the same recovery environment as Method 1.
Method 3: Reset Button
- With the CPU running, press the reset button for less than 2 seconds to trigger a warm restart.
- Within 2 seconds of the restart, press and hold the reset button for more than 2 seconds (while R/E LED is red indicating reboot).
- This can force the CPU into diagnostic/reset mode, which also allows recovery operations.
Method 4: Software Stop Target
- Connect to the CPU via Automation Studio (Ethernet or serial).
- Use Online > Stop Target to halt the application.
- The CPU enters SERVICE mode. From here you can perform diagnostics and recovery.
6. Serial Console Access
Serial Port (IF1) Specifications
| Parameter | Value |
|---|---|
| Interface | RS-232 (non-isolated) |
| Connector | 12-pin terminal block (X20TB12) |
| Pinout | Power supply: GND, +24V I/O, +24V I/O, GND, +24V CP/X2X, +24V CP/X2X, I_r, S, (reserved). RS232: TX, RX, GND (bottom row, separate from power pins) |
| Max distance | 900 m (B&R rating; see note in cp1584-hardware-ref.md regarding standard RS232 limits) |
| Max baud rate | 115.2 kbit/s |
| Default baud rate | 57600 bps (factory default) |
| Default parity | Even |
| Data bits | 8 |
| Stop bits | 1 (8,E,1) |
| Flow control | None (hardware flow control not typically used) |
Connection Procedure
-
Wire RS-232 correctly:
PLC RX (Pin 5) <---> PC TX (Pin 3) PLC TX (Pin 3) <---> PC RX (Pin 2) PLC GND (Pin 7) <---> PC GND (Pin 5)Double-check the pin assignments on your specific terminal block. The X20TB12 pin numbering follows B&R conventions shown in the datasheet.
-
Configure terminal emulation software (e.g., PuTTY, Tera Term, HyperTerminal):
- Baud: 57600
- Parity: Even
- Data: 8 bit
- Stop: 1
- Flow: None
-
Open the serial connection. If using PVI Transfer Tool or Automation Studio, configure these same settings in the online connection settings.
-
The RS-232 LED on the power supply module will light yellow when data is being transmitted or received.
RS-232 Serial Interface — Important Notes
- The RS-232 interface is not electrically isolated from the PLC. Use caution with ground loops.
- In BOOT mode, the RS-232 interface is initialized and ready for communication – this is the fallback path when Ethernet is unavailable.
- If the default 57600 baud doesn’t work, try 9600 or 115200. The baud rate can be configured in the project’s serial interface settings (IF1) in Automation Studio. If someone changed it, you may need to cycle through baud rates.
- USB interfaces (IF4/IF5) on the X20 CPUs are USB 1.1 and are only for B&R-approved devices (dongles, approved USB storage). They cannot be used for serial communication with a PC.
7. Firmware Recovery via Serial (B&R Service Utility)
The B&R Service Utility is a firmware installation tool that can set the embedded firmware of a B&R PLC via serial connection. It is typically provided by B&R service and is not part of the standard Automation Studio distribution.
When Serial Recovery Is Needed
- The CF card is completely corrupted or missing.
- You have no way to connect via Ethernet (no IP address, unknown subnet, etc.).
- The embedded firmware itself needs to be reflashed (rare – this is the lowest-level firmware in the CPU’s internal flash).
Serial Recovery Procedure
- Obtain the B&R Service Utility and the appropriate firmware files from B&R support.
- Connect the RS-232 serial cable between your PC and the CPU’s IF1 terminal block.
- Set the CPU mode switch to BOOT.
- Power on the CPU.
- Launch the B&R Service Utility on your PC.
- Configure the serial port settings (57600, 8, E, 1).
- Select the firmware file(s) appropriate for your CPU model.
- Follow the utility’s prompts to begin the firmware transfer.
- After completion, the CPU should be able to boot from a properly prepared CF card.
Note: The B&R Service Utility and its firmware files are generally only available through B&R service/support channels, not through public download. Contact your local B&R support office if you need this tool.
8. TFTP Recovery Procedure
B&R X20 CPUs with the embedded Boot AR runtime in BOOT mode support firmware installation over the network. While B&R does not publicly document a “TFTP boot” command set in the same way consumer routers do, the recovery process uses the standard B&R online transfer mechanism which internally uses the B&R protocol (not raw TFTP).
Network-Based Firmware Installation (BOOT Mode)
This is the standard network recovery path:
-
Prepare the CPU:
- Set mode switch to BOOT.
- Power on the CPU. Wait for BOOT mode (R/E red, RDY/F yellow).
-
Establish Network Connectivity:
- Connect an Ethernet cable from the CPU’s IF2 (Ethernet port) to your PC or network switch.
- The CPU in BOOT mode may default to IP 0.0.0.0 until configured, or may have a previously configured IP.
- Set your PC’s Ethernet interface to the same subnet (e.g., 192.168.0.10).
- Optionally set the CPU’s IP via SNMP in Automation Studio’s Browse window, or use a DHCP server on the network.
-
Browse for the Target:
- Open Automation Studio.
- Go to Online > Settings.
- Click Browse targets – the CPU should appear in the list.
- Right-click the CPU and select Set IP parameters if needed.
-
Transfer Automation Runtime:
- In Automation Studio, go to Project > Services > Transfer Automation Runtime.
- Follow the wizard to select the target and transfer the runtime to the CF card.
- This formats the SYSTEM partition, installs Automation Runtime, and prepares the card.
-
Transfer Your Application:
- After Automation Runtime is installed, transfer your application project:
- Project > Transfer > Total (or configure individual transfer types).
What Happens Internally
The Boot AR runtime in the CPU listens on the configured network interface. Automation Studio connects using the B&R PVI (Process Visualization Interface) protocol, which internally manages file transfer. This is not a raw TFTP session but rather a proprietary B&R protocol running over TCP/IP.
9. USB-Based Recovery
X20 CPU USB Limitations
The USB interfaces (IF4 and IF5) on X20 CPUs are USB 1.1 host ports designed only for B&R-approved devices:
- B&R dongles (license keys)
- B&R-approved USB floppy drives
- B&R-approved USB mass storage (DiskOnKey)
The USB ports cannot be used for:
- Direct PC-to-PLC communication (online connection)
- Serial-over-USB communication
- Keyboard/mouse
USB Installation for Panel Controllers
For B&R Panel controllers with built-in HMI (e.g., PowerPanel, Panel PCs like the 4PPC70 series), USB installation is a supported recovery method:
- Format a USB stick as FAT32.
- In Automation Studio, go to Project > Project Installation > Offline Installation.
- Select USB as the target and generate the installation package.
- Insert the USB stick into the controller’s USB port.
- Set the mode switch to BOOT (press reset < 2s, then hold > 2s within 2 seconds).
- The installation should automatically execute.
Note: For the X20 CP1584 CPU (no built-in HMI display), USB installation may not be directly applicable in the same way. The primary recovery paths for X20 CPUs are: CF card (offline install to CF card reader), Ethernet online transfer, and RS-232 serial transfer.
USB CF Card Reader Method (Recommended for X20 CPUs)
Since X20 CPUs use removable CompactFlash, the standard “USB recovery” is:
- Remove the CF card from the CPU.
- Connect the CF card to your PC using a USB CF card reader.
- Use Automation Studio’s Offline Installation to write the CF card.
- Reinsert the CF card into the CPU and power on.
This is covered in detail in Section 11.
10. Runtime Utility Center for Firmware Operations
Overview
Runtime Utility Center (RUC) is part of the PVI Development Setup package, available for free download from B&R’s website under Software > Automation Runtime. It provides tools for creating, backing up, and restoring CompactFlash cards without needing an active PLC connection.
Key Functions
| Function | Description |
|---|---|
| Create CompactFlash (F9) | Generates a complete CF card image from a project/configuration, writing all necessary files to a CF card in a USB card reader. |
| Create Image (Backup) | Creates a sector-level backup (.img file) of an existing CF card to your PC. |
| Restore Image | Writes a previously backed-up image (.img) to a CF card. |
| PVI Transfer | Upload/download program modules between PC and a connected PLC. |
| Format/Partition | Prepares CF card with correct partition structure. |
Creating a CF Card with RUC
- Download and install PVI Development Setup from br-automation.com.
- Launch Runtime Utility Center from the Start menu.
- Insert a blank CF card into a USB card reader connected to your PC.
- Press F9 or use the menu to open Create CompactFlash.
- Click Select source and browse to your configuration/backup files.
- Select the CF card drive letter from the list.
- Click Create to generate the CF card.
- Wait for completion. The card will be formatted and populated with the required files.
Backing Up a CF Card
- Insert the source CF card into a USB card reader.
- Open Runtime Utility Center.
- Navigate to CF Card Tools.
- Select Create Image to save a backup (.img file) to your PC.
- Save with a descriptive name (e.g.,
CP1584_backup_2026-07-10.img).
Restoring a CF Card from Backup
- Insert a blank (or same-capacity/larger) CF card into the card reader.
- Open Runtime Utility Center.
- Navigate to CF Card Tools.
- Select Restore Image.
- Browse to your .img backup file.
- Confirm the restore operation.
Backup File Formats
RUC creates backup files named zp.1, zp.2, zp.3 etc. These are incremental sector images of the CF card. To restore, select the latest zp file.
CF Card Backup and Restore — Important Notes
- Always use a quality card reader. Many CF card issues during backup/restore are caused by cheap or faulty readers.
- For X20 CPUs, use B&R-approved CF cards (SLC type preferred): 5CFCRD series.
- The CF card must have a valid FAT16 partition for the CPU to recognize it.
- RUC may show “partitions = 0” if the card has no valid partition table or is in RAW format.
11. Automation Studio Offline Installation
The Offline Installation is the most common method for preparing a CF card for an X20 CPU. It does not require the CPU to be connected at all – you write the card on your PC.
Offline Installation Procedure
- Open your project in Automation Studio.
- Go to Project > Project Installation > Offline Installation (in some versions: Tools > Create CompactFlash or the wizard).
- Select the target:
- CompactFlash card – requires a CF card reader connected to your PC.
- USB stick – for controllers that support USB boot (Panel PCs).
- Configure the installation:
- Select the Automation Runtime version to install.
- Choose whether to create a USER partition for user files.
- Select any additional files to include.
- Click Create or Install.
- Automation Studio will:
- Format/prepare the CF card with correct partitions (SYSTEM partition formatted FAT16, then converted to the B&R raw filesystem for speed).
- Install the Automation Runtime operating system.
- Copy the application project files.
- Set up the transfer folder with installation instructions.
- Insert the CF card into the CPU.
- Power on with the mode switch in RUN.
- On first boot, the CPU performs the initial installation:
- The transfer folder contents are unpacked.
- SYSTEM partition is finalized.
- The CPU will reboot one or more times.
- After several minutes, it should enter RUN mode (R/E green solid).
CF Card Preparation Requirements
Before offline installation:
- Windows Disk Management: The CF card should have its partitions removed (show as “Unallocated”) or have a single primary FAT16/FAT32 partition.
- If the card shows as RAW: Delete the volume first in Disk Management (right-click > Delete Volume), then create a new primary partition.
- Run Automation Studio as Administrator: This ensures partition-level access to the CF card.
Troubleshooting Offline Installation
| Problem | Solution |
|---|---|
| “One or more partitions do not have assigned drive letters” | Format the card first in Disk Management (FAT16 or FAT32). |
| “Invalid partitioning data (partition count = 0)” | Card has no valid partition. Use Disk Management or diskpart to create one. |
| CPU doesn’t enter RUN after offline install | Check Logger on CF card (RPSHD folder). May need to update BIOS/MTCX on APC units. Verify the project was built successfully. |
| Card keeps reverting to RAW | Likely a faulty card reader. Try a different reader or a different CF card. |
12. Creating Recovery Media
What You Need
| Item | Details |
|---|---|
| CF card reader | USB CompactFlash card reader (quality brand recommended) |
| CF card | B&R SLC CF card (5CFCRD series). Minimum 512 MB recommended. |
| Automation Studio | Version matching your project (or newer, with migration). |
| PVI Development Setup | For Runtime Utility Center (backup/restore). |
| Project file | Your Automation Studio project (.apj) with the full configuration. |
| Automation Runtime installer | The AR version your project requires. |
Creating a Recovery CF Card (Full Method)
-
Obtain a new or known-good CF card of appropriate capacity.
-
Connect the CF card to your PC via card reader.
-
In Windows Disk Management, ensure the card has a clean partition layout:
diskpart select disk X (where X is the CF card disk number) clean create partition primary format fs=fat16 assign letter=ZWARNING: Double-check the disk number.
cleandestroys all data on the selected disk. -
Open Automation Studio and load your project.
-
Go to Project > Project Installation > Offline Installation.
-
Select the CF card as target.
-
Enable:
- Automation Runtime installation
- User partition creation (if needed)
- Any user files to pre-populate
-
Generate the installation.
-
Label the CF card with the project name, date, and AR version.
-
Store in a safe location as your recovery media.
Creating a Recovery Image (Backup Method)
- Take the working CF card from a running system.
- Back up using Runtime Utility Center Create Image.
- Save the .img file to your PC and external backup storage.
- To restore: Use RUC Restore Image to write to a new CF card.
Disk Image Method (Alternative)
If RUC is unavailable, use sector-level imaging:
-
Backup: Use a disk imaging tool (e.g.,
ddon Linux, Clonezilla, or Win32DiskImager) to create a raw image of the entire CF card:dd if=/dev/sdX of=cp1584_backup.img bs=4M status=progress -
Restore: Write the image back:
dd if=cp1584_backup.img of=/dev/sdX bs=4M status=progress
Warning: This creates a byte-for-byte clone. The destination card must be the same capacity or larger, and may need manual partition resizing if larger.
13. Safe Mode and Diagnostic Mode
Diagnostic Mode
Diagnostic mode is entered when:
- The mode switch is set to DIAG.
- The reset button is held for longer than 5 seconds (on some controller types).
In Diagnostic mode:
- Program sections in User RAM and User FlashPROM are not initialized.
- I/O modules are initialized and the bus system is checked.
- You can connect via Automation Studio to run diagnostics, inspect I/O states, and read the logbook.
- After leaving DIAG mode (power cycle or switch change), the CPU always performs a warm restart.
Service Mode
Service mode is entered when:
- The reset button is pressed for 2-5 seconds.
- The “Stop Target” command is sent from Automation Studio.
- A critical runtime error occurs (cycle time violation, page fault, divide by zero, etc.).
In Service mode:
- No task classes are running. The application program is halted.
- Outputs are set to zero (or their configured safe state).
- You can connect via Automation Studio to diagnose the fault.
- Check the Logger (Open > Logger in Automation Studio) for error codes.
- The Diagnostic buffer contains the fault information.
System Diagnostics Manager (SDM)
When Automation Runtime is running (or in SERVICE mode), the CPU runs a built-in web server for diagnostics:
- Connect your PC to the same network as the CPU.
- Open a web browser and navigate to
http://<CPU_IP>/sdm(default:http://10.0.0.220/sdmfor some configurations). - The SDM web interface shows:
- Hardware status
- Software components and versions
- Error and event log
- I/O module status
- Network diagnostics
Note: SDM may be disabled in some project configurations. Check the project’s Ethernet settings if you cannot reach the SDM page.
Safe Commissioning
B&R provides a SafeCommissioning mechanism for initial commissioning and recovery. This allows a controlled initial startup where the system can be verified before full operation:
- The SafeCommissioning configuration is stored in the SYSTEM partition.
- A backup of the modified SafeCommissioning file should be maintained separately from the SYSTEM partition.
Safety-Relevant Boot Behavior
- The CPU does not silently ignore faults during boot.
- Any unrecoverable error during boot causes the CPU to enter SERVICE or BOOT mode, not RUN mode.
- The logbook records all boot errors with timestamps and error codes.
14. Minimum Files Needed on CF Card for Boot
CF Card Partition Structure
A properly formatted B&R X20 CF card has (at minimum) a SYSTEM partition containing the Automation Runtime:
[SYSTEM Partition - B&R Raw Filesystem]
|-- Automation Runtime files
|-- System configuration
|-- Transfer folder (used during initial installation)
|-- Logger data (RPSHD folder)
|-- ...
[USER Partition - FAT16/FAT32] (optional)
|-- User application data
|-- Configuration files
|-- Backups
|-- ...
Minimum Requirements for Boot to RUN
- Valid partition table – At least one partition must exist.
- SYSTEM partition – Formatted with the B&R raw filesystem (created by Automation Studio during offline install).
- Automation Runtime files – The operating system components:
- B&R Automation Runtime kernel
- Required system libraries and drivers
- Hardware support packages (for the specific CPU model)
- System configuration – Network settings, I/O configuration, task class definitions.
- Application project – At minimum, a project with configured task classes (even if empty tasks). Without any application, the CPU may enter SERVICE mode rather than RUN mode.
What the Boot AR Internal Firmware Provides
Even with no CF card, the CPU’s internal flash contains enough firmware to:
- Initialize the Ethernet interface (limited functionality)
- Initialize the RS-232 serial interface
- Respond to network browsing from Automation Studio
- Enter BOOT mode for firmware download
- Display basic boot status via LEDs and serial console
CF Card Corruption Recovery: Decision Tree
When a CF card is suspected to be corrupted (PLC won’t boot to RUN, or keeps entering SERVICE mode), follow this decision tree:
PLC won't boot to RUN
|
|-- Are LEDs lit on power-up?
| |-- NO LEDs at all → Check 24V power supply to CPU
| |-- Only PWR LED → Internal firmware OK, CF card not being read
| | |-- Remove CF card → Clean contacts with isopropyl alcohol → reinsert
| | |-- Try known-good CF card → If boots → original card is faulty
| | `-- If still no boot with known-good card → CPU hardware fault
| |
| |-- RDY/F flashing rapidly → CF card is being read but system files are corrupt
| | |-- Check arlogsys.log via FTP (anonymous, C: partition may be partially readable)
| | |-- Image the CF card with dd for forensic analysis before any recovery attempt
| | |-- Restore from backup image → if works, card had logical corruption
| | `-- If backup fails → create new CF card via AS Offline Installation
| |
| |-- RDY/F solid red → SERVICE mode
| |-- Connect via AS and check Logger → identifies the specific error
| |-- If Logger shows "file system error" → CF card filesystem corruption
| |-- If Logger shows cycle time violation (144/145) → application bug, not CF issue
| `-- If Logger shows no error → may be retentive data corruption or battery issue
|
`-- CPU enters BOOT mode (RDY/F alternating red/green)
|-- Mode switch is in BOOT position → move to RUN
|-- CF card has only transfer folder (not yet installed) → normal for first-time install
`-- CF card is blank or unrecognizable → need fresh Offline Installation
Community-sourced tip (B&R Community Forum): If the files on the CF card are corrupt, the PLC will boot into Diagnostic mode and Automation Runtime won’t start. You can still access the CF card contents via FTP (anonymous, read-only to C: partition) to pull the arlogsys.log and diagnose what went wrong. On some AR versions, a partial boot allows limited SDM access even with corrupted files — try browsing to http://<PLC_IP>/sdm before removing the CF card.
CF Card Write Endurance and Failure Patterns
B&R-branded SLC (Single-Level Cell) CF cards have significantly higher write endurance than consumer MLC cards. However, they still have finite lifespan:
| Card Type | Write Endurance | Expected Life in PLC Service | Failure Mode |
|---|---|---|---|
| B&R SLC (5CFCRD series) | ~100,000 write cycles per block | 5-10 years typical | Gradual — bad blocks detected and remapped |
| Consumer MLC | ~3,000-10,000 cycles per block | 1-2 years (often less) | Sudden — card dies without warning |
| Consumer TLC | ~1,000-3,000 cycles per block | < 1 year | Sudden — unpredictable failure |
Failure progression pattern for B&R SLC cards:
- Phase 1: Increased boot time (filesystem wear leveling overhead)
- Phase 2: Occasional file write errors (logged in arlogsys.log)
- Phase 3: Files becoming unreadable (0-byte files, corrupted data)
- Phase 4: Complete card failure — CPU cannot read any partition
The CP1584 bootloader is designed to handle Phase 1-3 gracefully:
- In Phase 1-2, the PLC boots normally but may show slower startup
- In Phase 3, the PLC may enter Diagnostic mode or fall back to BOOT mode
- In Phase 4, the CPU enters BOOT mode and the system LED shows a solid pattern
- At this point the bootloader still accepts firmware via serial/TFTP, so the CPU itself is not bricked — only the CF card is dead
Detection: Monitor arlogsys.log for filesystem-related errors (error codes related to file I/O, bad sectors). If you see increasing filesystem errors over weeks/months, the CF card is approaching end of life. Replace it proactively — do not wait for complete failure.
Recommended Minimum CF Card Size
| Use Case | Minimum Size |
|---|---|
| Automation Runtime only (no user data) | 512 MB |
| Automation Runtime + typical application | 1 GB |
| Automation Runtime + application + user data + logs | 2 GB |
| Full installation with user partition | 4 GB |
Always use B&R SLC CF cards for reliability:
- 5CFCRD.0512-06 (512 MB)
- 5CFCRD.1024-06 (1 GB)
- 5CFCRD.2048-06 (2 GB)
- 5CFCRD.4096-06 (4 GB)
15. How to Unbrick a CP1584 That Won’t Boot
Diagnosis Flowchart
Power on CPU
|
+-- No LEDs at all?
| --> Check power supply (24VDC), wiring, fuse.
|
+-- CF LED off?
| --> Re-seat CF card. Try a known-good CF card.
| --> If still off, possible CF slot hardware failure.
|
+-- Stuck in BOOT mode (R/E red, RDY/F yellow)?
| --> CF card issue. Proceed to "CF Card Recovery" below.
|
+-- Stuck in SERVICE mode (R/E red)?
| --> Application issue. Connect via AS, check Logger.
|
+-- S/E red blinking with error code?
| --> Hardware error. May need CPU replacement.
|
+-- DC LED red?
--> Battery empty. Replace CR2477N battery.
Step-by-Step Unbrick Procedure
Phase 1: Quick Checks
- Check all LED states and document them before doing anything.
- Full power cycle: Power off, wait 30 seconds, power on.
- Check backup battery: Replace if DC LED is red. Use only Renata CR2477N.
- Re-seat the CF card: Remove it, inspect for damage/corrosion, reinsert firmly.
- Try a known-good CF card: If you have a spare, try it.
Phase 2: CF Card Recovery
If the CF card is suspected corrupted:
Option A: Recreate from Automation Studio (Preferred)
- Remove the CF card and connect it to your PC via card reader.
- Back up the card if possible (RUC Create Image or file copy).
- In Windows Disk Management, delete all partitions and create a single FAT16 primary partition.
- Use Automation Studio Offline Installation to write the CF card.
- Reinsert into CPU, power on with switch in RUN.
Option B: Total CF Card Replacement
- Obtain a new B&R CF card.
- Connect to PC via card reader.
- Format as FAT16 primary partition (via Disk Management or
diskpart). - Use Automation Studio Offline Installation.
- Insert and power on.
Option C: Restore from Backup Image
- If you have a backup .img or zp files, use RUC Restore Image.
- Write to a new CF card.
- Insert and power on.
Phase 3: Network Recovery (No Valid CF Card)
If you cannot prepare a CF card:
- Set mode switch to BOOT.
- Connect Ethernet cable directly from CPU to your PC.
- Set your PC’s IP to the same expected subnet.
- Open Automation Studio > Online > Settings > Browse.
- Find the CPU in the list (it appears in BOOT mode).
- Right-click > Set IP parameters if needed.
- Perform Transfer Automation Runtime (Project > Services > Transfer Automation Runtime).
- After AR is transferred to the CF card, perform Total Transfer of your project.
Phase 4: Serial Recovery (No Network)
If Ethernet is unavailable:
- Connect RS-232 cable from PC to CPU IF1 terminal block.
- Configure terminal: 57600, 8, E, 1, no flow control.
- Set mode switch to BOOT.
- Power on.
- In Automation Studio, configure a serial connection to the CPU.
- Transfer Automation Runtime and project via serial.
- Serial transfers are slow but reliable.
Phase 5: Hardware Failure
If none of the above works:
- Module swap test: Remove the CPU and test it in a different X20 rack/slot with a known-good power supply and CF card.
- Check for bent pins or corrosion on the backplane connectors.
- If S/E LED shows a RAM or Hardware error code (see Section 4), the CPU may be defective.
- Contact B&R support for RMA/repair.
Special Case: APC Panels (Automation PC)
For B&R Automation PCs (APC3100, APC910, etc.) that use CFast instead of CF:
- Check BIOS settings: Ensure “Realtime Environment” is enabled, “Hypervisor Environment” is disabled.
- Update BIOS and MTCX to the latest versions.
- Disable “Quick Boot” and “Quiet Boot” in BIOS to see boot messages.
- CFast cards can be prepared the same way as CF cards via Offline Installation.
- If the screen shows BIOS-level messages about SATA mass storage, the CFast card or BIOS may be the issue.
16. How to Reload the Entire System from Scratch
This procedure assumes you want to start from a completely blank state.
Prerequisites
- PC with Automation Studio installed
- CF card reader
- New or wiped CF card
- Your project file (.apj)
- Automation Runtime installer package (matching your project’s AR version)
Step-by-Step
1. Prepare the CF Card
diskpart
list disk
select disk X (your CF card -- double-check!)
clean
create partition primary
format fs=fat16
assign
exit
2. Create the Installation Media
- Open Automation Studio with your project loaded.
- Project > Project Installation > Offline Installation.
- Target: The CF card drive.
- Options:
- Install Automation Runtime: Yes
- Create USER partition: Yes (if you need persistent user data)
- Include user files: Point to any configuration files to pre-load
- SYSTEM partition size: Leave default (minimum ~488 MB)
- Click Create/Install.
- Wait for completion.
3. Install in the CPU
- Power off the X20 system.
- Insert the prepared CF card into the CPU.
- Set mode switch to RUN.
- Power on.
- The CPU will:
- Boot from the CF card
- Perform initial installation (unpack transfer folder)
- Reboot one or more times
- Transition through PREOPERATIONAL to RUN
- Watch the LEDs:
- R/E green blinking: Initializing (wait)
- R/E green solid: Application running (success)
- If stuck red/yellow: Something went wrong – check the CF card or use the Logger
4. Verify
- Connect via Automation Studio (Ethernet).
- Go to Online > Settings and verify the CPU appears and is in RUN mode.
- Check the Logger for any warnings or errors.
- Verify all I/O modules are detected and operating.
- Verify POWERLINK/Ethernet communication.
5. Configure Network (if needed)
If you need to change the IP address after installation:
- Open the project in Automation Studio.
- Navigate to the CPU’s Ethernet configuration.
- Set the desired IP address, subnet mask, and gateway.
- Enable SNMP for future diagnostics.
- Transfer the updated configuration (Project > Transfer > Configuration or Total).
17. Prevention and Best Practices
Backup Strategy
| What to Back Up | How | Frequency |
|---|---|---|
| Automation Studio project | Version control (Git) or file copies | Every change |
| CF card image | RUC Create Image or sector clone (.img) | After every successful commissioning |
| User data files | Copy from USER partition | Regularly |
| Logger data | Extract RPSHD folder from CF card | After fault events |
| Hardware configuration | Screenshot or export from AS | After changes |
CF Card Handling
- Never remove the CF card while the CPU is powered on.
- Use only B&R SLC CF cards (5CFCRD series) for industrial environments.
- Store spare CF cards in anti-static packaging.
- Replace CF cards every 3-5 years in harsh industrial environments (SLC cards have limited write cycles).
Battery Maintenance
- Replace the backup battery (CR2477N) every 4 years or whenever the DC LED shows red.
- Only use Renata CR2477N batteries. Other brands may present fire/explosion hazards.
- Replace within 1 minute if power is off to prevent data loss.
- The battery buffers: remanent variables, user RAM, system RAM, and the real-time clock.
Firmware and Software
- Keep Automation Studio and PVI updated to the latest stable version.
- Keep Automation Runtime at the version specified by your project.
- Test firmware upgrades on a spare CPU before deploying to production.
- Use B&R’s Update tool for firmware upgrades to ensure compatibility.
Power Quality
- Ensure proper 24VDC power conditioning.
- Verify power supply can handle the full load of the X20 system.
- Use slow-blow fuses (max 10A) as specified.
- Protect against power surges and voltage sags.
Network Configuration
- Always enable SNMP in the project for diagnostics.
- Document all IP addresses and network settings.
- Keep a record of the CPU’s station address (hex switches).
- Ensure your PC can reach the CPU’s default IP before making changes.
Key Findings
- The CP1584 cannot be bricked by CF card damage alone — the embedded bootloader in internal flash always provides a minimal recovery environment (Boot AR) with Ethernet and RS-232 access, even with no CF card inserted.
- Serial console defaults to 57600 baud, 8 data bits, even parity, 1 stop bit (8,E,1) on the IF1 RS-232 terminal block — this is your fallback path when Ethernet is unavailable, and the baud rate may have been changed from default by a prior configuration.
- BOOT mode vs. SERVICE mode are fundamentally different — BOOT mode means Automation Runtime failed to load from the CF card (firmware/OS issue); SERVICE mode means AR loaded successfully but the user application crashed or was stopped (application issue). The diagnostic approach for each is completely different.
- The operating mode switch (BOOT/RUN/DIAG) is the primary recovery control — set to BOOT, power cycle, and the CPU enters the minimal Boot AR runtime ready for firmware transfer via Ethernet or serial.
- CF card corruption is the most common failure cause — always re-seat the card first, then try a known-good spare before escalating to firmware reflash or hardware replacement. The CF LED being off immediately indicates a physical detection problem.
- Three recovery paths exist in priority order: (1) prepare a new CF card via Automation Studio Offline Installation, (2) network recovery via BOOT mode and Transfer Automation Runtime, (3) serial recovery at 57600 baud as last resort.
- USB ports on X20 CPUs cannot be used for PC communication or serial console — they are USB 1.1 host ports restricted to B&R-approved devices only; the serial-to-USB approach requires the RS-232 terminal block, not USB.
- Always image a CF card before any recovery attempt using Runtime Utility Center (Create Image) or sector-level
dd— the original card may contain the only copy of the safety configuration and application parameters.
18. Cross-References
| Related File | Relevance |
|---|---|
cf-card-boot.md | Detailed CF card partition structure, file types, boot stages, and imaging procedures |
firmware.md | B&R firmware architecture, memory layout, and firmware update mechanisms |
firmware-version-mgmt.md | Firmware version inventory, compatibility matrices, and update procedures without OEM access |
config-file-formats.md | Configuration file formats found on the CF card that control boot behavior |
access-recovery.md | Password recovery and admin access restoration when credentials are lost |
cp1584-hardware-ref.md | Physical switch settings, LED indicators, and connector pinouts for bootloader recovery |
ar-rtos.md | Automation Runtime OS internals relevant to understanding boot failures |
retentive-data.md | Battery-backed SRAM data preservation during recovery and cold restarts |
ftp-web-interface.md | FTP-based CF card access for backup before recovery attempts |
19. References
Official B&R Documentation
| Document | Source |
|---|---|
| X20 System User’s Manual | br-automation.com |
| X20CP148x Data Sheet | B&R Downloads |
| X20CP158x Data Sheet | B&R Downloads |
| PVI Development Setup | br-automation.com |
| Automation Runtime Downloads | br-automation.com |
| B&R Community Forum | community.br-automation.com |
Community and Third-Party References
| Resource | URL |
|---|---|
| B&R Community - Service Mode Diagnostics | community.br-automation.com/t/service-mode |
| B&R Community - Boot Mode Troubleshooting | community.br-automation.com/t/boot-mode |
| B&R Community - Offline Installation | community.br-automation.com/t/offline-installation |
| B&R Community - CF Card from Mapp Backup | community.br-automation.com/t/creating-cf |
| Johnson Controls - X20 CPU LED Reference | docs.johnsoncontrols.com |
Cross-References
| Related Document | Relevance |
|---|---|
| cf-card-boot.md | CF card file layout, partition structure, and boot sequence stages |
| firmware.md | Firmware architecture, AR components, and firmware update procedures |
| firmware-version-mgmt.md | Firmware version identification, downgrade paths, and compatibility |
| config-file-formats.md | Configuration files that the bootloader reads (ARConfig.ini, etc.) |
| access-recovery.md | Gaining access to BOOT mode when passwords are unknown |
| cp1584-hardware-ref.md | CP1584 hardware specs, mode switch, LED indicators, serial console pinout |
| first-60-minutes.md | Emergency recovery playbook for immediate response to boot failures |
| diagnostics-sdm.md | Using SDM to diagnose boot-related issues before resorting to bootloader recovery |
| license-mgmt.md | License reactivation after firmware reload or CF card replacement |
| remanufacturing.md | Migration planning when bootloader recovery is insufficient |
Revision History
| Date | Description |
|---|---|
| 2026-07-10 | Initial document – compiled from public sources and B&R documentation |
Physical Layer Fieldbus Sniffing with Oscilloscopes and Logic Analyzers
A practical guide to probing, diagnosing, and debugging the physical layers of industrial fieldbus systems — X2X, CAN bus, and Ethernet POWERLINK — at the wire level.
Table of Contents
- Probing X2X at the Physical Wire Level (RS-485 Differential Signaling)
- CAN Bus Physical Layer Probing (CAN-H, CAN-L)
- Ethernet POWERLINK Physical Layer (MII/RMII, Link Status)
- Signal Patterns That Indicate Cable/Connector/Termination Problems
- RS-485 Signal Integrity: Common-Mode Voltage, Differential Voltage
- CAN Bus Signal Analysis: Recessive/Dominant States, Bit Timing
- Ethernet Signal Quality: Eye Diagrams, Jitter
- Common Physical Layer Faults Causing Intermittent Sensor Failures
- Recommended Equipment: Oscilloscopes, Logic Analyzers, Protocol Analyzers
- Probe Techniques: Differential Probes, Current Probes, Near-Field Probes
- Termination and Biasing Verification
- EMC Testing at the Physical Layer
- Ground Loops and Their Effect on Signal Integrity
1. Probing X2X at the Physical Wire Level (RS-485 Differential Signaling)
X2X Protocol Overview
B&R Automation’s X2X is a proprietary serial backplane and extension bus used primarily for communication between X20/X67 I/O modules and B&R controllers. The physical layer of X2X is based on RS-485 differential signaling over twisted-pair copper cabling. Understanding this foundation is essential for any physical-layer investigation.
X2X operates as a multi-master serial line bus. In backplane configurations it rides on the PCB traces connecting I/O slices; in field extensions it runs over external RS-485 cable through interface modules such as the X20IF1030 (which includes an integrated terminating resistor for RS-485/RS422). The bus is half-duplex: at any moment one node transmits while all others listen.
RS-485 Differential Signaling Fundamentals
RS-485 uses a balanced differential driver (H-bridge topology) to drive complementary voltages onto two wires, labeled A and B:
- Logic 1 (Mark): Line A is higher than line B by +1.5 V to +5 V. Example: A = 3.0 V, B = 1.0 V, differential = +2.0 V.
- Logic 0 (Space): Line A is lower than line B by -1.5 V to -5 V. Example: A = 1.0 V, B = 3.0 V, differential = -2.0 V.
The absolute voltage on each wire varies, but the difference (V_A - V_B) is what the receiver decodes. The common-mode offset (the average of both lines with respect to ground) typically sits near V_CC/2 and can legally range from -7 V to +12 V per the EIA-485 standard, accommodating ground-potential differences between nodes.
Probing the X2X Bus
Method 1 — Two-Channel Single-Ended Probing:
Connect oscilloscope Channel 1 to line A and Channel 2 to line B, with both probe ground clips connected to the circuit ground reference of the device under test. Use the oscilloscope’s math function (Ch1 - Ch2) to display the true differential waveform. This is the most accessible approach but is only safe when the oscilloscope ground and the circuit ground are at the same potential.
Method 2 — Differential Probe:
Connect a differential probe directly across the A and B lines. The differential probe rejects common-mode voltage and provides a clean view of the differential signal without requiring a local ground reference. This is the preferred method when ground-potential differences exist between nodes — a common situation in industrial installations with distributed power supplies.
Method 3 — Protocol Decode:
Many modern oscilloscopes (Keysight, Tektronix, Rohde & Schwarz, Pico Technology) include built-in RS-485/UART decoders. Configure the decode to trigger on the start bit, set the baud rate, and overlay decoded hex data on the analog waveform. This allows you to correlate physical anomalies (ringing, reflections, amplitude droop) with the actual data being transmitted.
Practical Probing Checklist for X2X
| Step | Action |
|---|---|
| 1 | Identify the X2X bus wires (A/B twisted pair) on the backplane or cable connector |
| 2 | Verify power is applied and the bus is active (traffic present) |
| 3 | Attach differential probe across A and B at a convenient tap point |
| 4 | Set oscilloscope timebase to display 2–4 complete characters at the operating baud rate |
| 5 | Verify differential amplitude is ≥ 1.5 V (minimum per EIA-485 under 54 Ω load) |
| 6 | Check common-mode voltage is within -7 V to +12 V range |
| 7 | Enable RS-485 protocol decode if available |
| 8 | Look for ringing, reflections, overshoot, or amplitude sag on edges |
X2X-Specific Considerations
- Backplane probing requires fine-pitch probe tips or micro-hooks to contact the RS-485 traces between I/O module slots without shorting adjacent pins.
- External X2X cables may be accessed via RJ-45 or proprietary B&R connectors; check pinout documentation for A/B pair assignment.
- Termination resistors on B&R interface modules (e.g., X20IF1030) are often integrated and switchable. Verify the correct termination state for the bus length and configuration.
2. CAN Bus Physical Layer Probing (CAN-H, CAN-L)
CAN Physical Layer Overview
CAN (Controller Area Network) uses a two-wire half-duplex bus with lines CAN-High and CAN-Low. Unlike RS-485, CAN is a non-return-to-zero (NRZ) bitwise arbitration protocol where the physical state directly encodes bus access priority.
Voltage Levels
| State | CAN-H | CAN-L | Differential |
|---|---|---|---|
| Recessive (Logic 1) | ~2.5 V | ~2.5 V | ~0 V |
| Dominant (Logic 0) | ~3.5 V | ~1.5 V | ~2.0 V |
During idle periods, both lines sit at the common-mode bias voltage (~2.5 V). When any node drives a dominant bit, CAN-H is pulled high and CAN-L is pulled low simultaneously. The dominant state always overwrites the recessive state, which is the foundation of CAN’s bitwise arbitration.
Oscilloscope Probing Procedure
- Connect Ch1 to CAN-H and Ch2 to CAN-L at a convenient access point (OBD-II connector, branch connector, or directly at a node’s transceiver pins).
- Reference both probe grounds to the local circuit ground of the node you are probing. If probing across nodes with different ground potentials, use a differential probe or a battery-powered portable oscilloscope to avoid ground loops.
- Set timebase to show several complete bit periods. For a 500 kbps CAN bus, one bit = 2 µs; set timebase to ~10 µs/div to see 5–10 bits.
- Trigger on CAN-H falling edge (dominant-to-recessive transition) or use the oscilloscope’s built-in CAN trigger/decode.
- Verify voltage levels: CAN-H should swing between ~2.5 V and ~3.5 V; CAN-L between ~2.5 V and ~1.5 V.
CAN Protocol Decoding on Oscilloscopes
Most modern oscilloscopes support CAN and CAN FD decoding:
- Trigger on specific CAN ID to capture only messages of interest.
- Decode the arbitration field, control field, data field, and CRC in real time on the waveform.
- Search for error frames (dominant bits for 6+ consecutive bit times) to identify bus errors.
- Measure bus load by analyzing the ratio of dominant-to-recessive time.
CAN Bus Diagnostic Measurements with a Multimeter
Before connecting an oscilloscope, perform these quick multimeter checks:
- Termination resistance: With bus powered off, measure resistance between CAN-H and CAN-L. A correctly terminated bus reads ~60 Ω (two 120 Ω termination resistors in parallel). If the reading is ~120 Ω, one termination is missing; if ~40 Ω, there may be an extra terminator.
- CAN-H to ground: With only one node powered on the bus, measure CAN-H to ground. Expect 2.5–3.0 V.
- CAN-L to ground: With only one node powered on, measure CAN-L to ground. Expect 2.0–2.5 V.
- Transceiver health: With device disconnected and powered off, measure CAN-H and CAN-L to ground. Both should read megaohms (open). A low resistance indicates a damaged transceiver (common after lightning or surge events).
CAN FD Considerations
CAN FD (Flexible Data-rate) supports two different bit rates within a single frame: a slower arbitration phase and a faster data phase (up to 8 Mbps). When probing CAN FD, the oscilloscope must have sufficient bandwidth (>40 MHz) and deep memory to capture the fast data phase while also showing the slower arbitration phase. Some oscilloscopes offer automatic CAN FD phase detection.
3. Ethernet POWERLINK Physical Layer (MII/RMII, Link Status)
Ethernet POWERLINK Architecture
Ethernet POWERLINK is a real-time Ethernet protocol, originally developed by B&R and now managed by the EPSG (Ethernet POWERLINK Standardisation Group). It runs on standard IEEE 802.3 Ethernet hardware but adds a time-slot-based scheduling layer on top for deterministic communication.
The physical layer stack for POWERLINK typically follows:
Application Layer (POWERLINK protocol)
|
Data Link Layer (Ethernet MAC)
|
MAC-PHY Interface (MII or RMII)
|
PHY Transceiver (100BASE-TX)
|
Magnetics + RJ-45 Connector
|
Cat5e/Cat6 Twisted Pair Cable
MII vs. RMII MAC-PHY Interface
The Media Independent Interface (MII) and Reduced MII (RMII) are the digital interfaces between the Ethernet MAC (in the MCU/FPGA) and the PHY transceiver:
| Parameter | MII | RMII |
|---|---|---|
| Data width | 4 bits (TXD[3:0], RXD[3:0]) | 2 bits (TXD[1:0], RXD[1:0]) |
| Clock | 25 MHz (independent TX/RX clocks) | 50 MHz (single reference clock) |
| Signal count | ~18 signals | ~9 signals |
| Pins on PHY | TX_CLK, RX_CLK, TX_EN, TXD[3:0], RX_DV, RXD[3:0], COL, CRS, MDC, MDIO | REF_CLK, TX_EN, TXD[1:0], RX_DV, RXD[1:0], CRS_DV, MDC, MDIO |
Probing the MII/RMII Interface
These signals are internal to the PCB and typically not accessible without a test point or flying lead connection:
- Clock signals (TX_CLK / REF_CLK): Verify frequency (25 MHz for MII, 50 MHz for RMII) with minimal jitter. Clock quality is critical — jitter here translates directly to jitter on the transmitted Ethernet signal.
- TX data (TXD) and TX enable (TX_EN): Capture transmitted data bursts. The MAC asserts TX_EN and drives TXD synchronous to the clock.
- RX data (RXD) and RX valid (RX_DV): Capture received data. On RMII, CRS_DV combines carrier sense and data valid.
- MDIO/MDC: The management interface for configuring the PHY register space. Use a logic analyzer with MDIO decode to read/write PHY registers (including link status, speed, and duplex settings).
Probing the 100BASE-TX Physical Layer
At the RJ-45 connector, 100BASE-TX uses MLT-3 encoding over two pairs (TX+/TX- and RX+/RX-). The differential signal swings ±1 V nominal with a symbol rate of 125 Mbaud. Probing at this level requires:
- Differential probe with ≥200 MHz bandwidth for 100 Mbps Ethernet.
- Oscilloscope with ≥500 MHz bandwidth for accurate edge reproduction (5x rule).
- Access through a TAP or directional coupler to avoid disrupting the active link.
Link Status Debugging
PHY link status is typically reported via:
- MDIO register 1 (Basic Status Register): Bit 2 = link status. Read with a logic analyzer monitoring MDIO transactions, or use PHY vendor diagnostic software.
- LED indicators on the RJ-45 jack or PCB: Green = link, Amber = activity (exact meanings vary by PHY vendor).
- Oscilloscope probing of the auto-negotiation fast link pulses (FLP): During link establishment, the PHY sends FLP bursts. Capturing these confirms the PHY is attempting to establish a link.
Common POWERLINK Physical Layer Issues
- PHY-MAC clock domain issues: RMII’s 50 MHz reference clock must meet tight jitter specifications (<0.5 ns period jitter). A noisy clock causes intermittent CRC errors.
- Magnetics saturation or damage: Ethernet magnetics (transformers in the RJ-45 module) can be damaged by surge events, causing asymmetric transmit waveforms and high bit-error rates.
- Cable length and quality: POWERLINK over 100BASE-TX is limited to 100 m of Cat5e cable. Exceeding this or using degraded cable causes signal attenuation that manifests as FCS errors and lost packets.
4. Signal Patterns That Indicate Cable/Connector/Termination Problems
When probing a fieldbus with an oscilloscope, specific waveform signatures indicate specific physical-layer faults. Learning to recognize these patterns dramatically accelerates troubleshooting.
Reflections (Impedance Mismatch)
Appearance: Ringing or “ghost” transitions that follow the intended edge after a short delay. Multiple reflections may appear as a damped oscillation.
Cause: Missing, incorrect, or damaged termination resistors; incorrect cable impedance; stubs from T-connectors or long device taps.
Severity: At low data rates, reflections decay before the sample point and may be benign. At high data rates (where the bit time is comparable to the cable round-trip time), reflections interfere with subsequent bits, causing errors.
On RS-485: Visible on the differential waveform as damped oscillations on rising and falling edges. The reflection amplitude relative to the signal amplitude determines severity.
On CAN bus: Reflections cause the dominant/recessive edges to ring, potentially causing false dominant detections or corrupting the sample point.
Amplitude Attenuation / Sagging
Appearance: The differential voltage is below the specified minimum (e.g., <1.5 V for RS-485) or droops during a long run of identical bits.
Cause: Cable resistance over long runs; too many nodes loading the bus; damaged or corroded connections adding resistance; incorrect wire gauge.
On RS-485: The standard requires ≥1.5 V differential output across a 54 Ω load. If the measured differential voltage is below this threshold, receivers may not correctly decode data.
On CAN bus: A weak dominant level may be overwritten by noise, causing bit errors. The dominant differential should be ≥1.5 V per ISO 11898-2.
Edge Speed Abnormalities
Slow edges: Excessive rise/fall time caused by cable capacitance (too many stubs or long cables), damaged transceivers with degraded drive strength, or incorrect probe compensation.
Fast edges with overshoot: Excessively fast edges (relative to the data rate) cause EMI radiation and can indicate a missing slew-rate limiter or a transceiver operating beyond its specified data rate. Some RS-485 transceivers include adjustable slew rate for this reason.
Asymmetric Waveforms
Appearance: The positive differential level has a significantly different amplitude than the negative differential level, or rise time differs substantially from fall time.
Cause: Mismatched H-bridge output transistors in the transceiver; damaged transceiver output stage; one side of the twisted pair has higher series resistance (corroded contact, damaged wire).
On RS-485: The standard requires that the difference in |V_OD| between positive and negative output states be less than 200 mV. Large imbalances increase common-mode noise and radiated EMI.
Intermittent Dropouts
Appearance: Periodic or random complete loss of signal; the bus falls to the recessive/idle state unexpectedly.
Cause: Loose connectors; intermittent shorts due to vibration or flexing; failing transceiver thermal shutdown; power supply brownout to the transceiver.
Common-Mode Excursions
Appearance: The average voltage of both lines (relative to ground) drifts outside the specified range or follows a low-frequency oscillation.
Cause: Ground loops between nodes; heavy machinery switching injecting common-mode transients; cable shield carrying ground currents; missing or incorrect grounding.
Noise Patterns
Continuous high-frequency noise: EMI coupling from nearby power electronics, motor drives, or variable-frequency drives. Often correlated with machinery operation cycles.
Periodic noise bursts: Correlate with specific equipment (relay switching, contactor closure, welder firing). Use the oscilloscope’s persistence or infinite-persistence mode to capture infrequent transients.
Random single-event transients: ESD events, lightning-induced surges, or switching power supply noise. Capture with peak-detect acquisition mode and a long timebase.
5. RS-485 Signal Integrity: Common-Mode Voltage, Differential Voltage
Differential Voltage (V_OD)
The differential output voltage (V_OD) is the parameter that RS-485 receivers actually decode. Per the EIA-485 standard:
- Minimum V_OD under load: ≥ 1.5 V across a 54 Ω differential load (which represents the parallel combination of two 120 Ω termination resistors = 60 Ω, approximately).
- Typical V_OD: 2.0 V to 3.5 V in well-designed systems.
- Maximum V_OD: 5.0 V (some transceivers produce up to 6 V unloaded).
Measurement technique: Use a differential probe across the A and B lines, or compute Ch1 - Ch2 from two single-ended channels. Measure peak-to-peak differential voltage during active transmission.
Common fault signatures:
| Measured V_OD | Likely Cause |
|---|---|
| < 1.0 V | Excessive cable length, too many nodes, corroded connections, or failing transceiver |
| 1.0–1.5 V | Marginal — may work at low data rates but fail at higher speeds |
| 1.5–5.0 V | Normal operating range |
| > 5.0 V | Check for unloaded bus or non-standard transceiver |
Common-Mode Voltage (V_CM)
The common-mode voltage is the average of the A and B line voltages with respect to local ground:
V_CM = (V_A + V_B) / 2
The EIA-485 standard specifies a common-mode input range of -7 V to +12 V for standard transceivers. Extended-range transceivers (e.g., Analog Devices ADM3095E) support up to ±25 V.
Why common-mode matters:
- RS-485 receivers contain internal resistor-divider attenuators that bias the bus voltage toward V_CC/2. If the common-mode voltage exceeds the receiver’s input range, the attenuator cannot properly bias the comparator, and the receiver saturates — producing incorrect output regardless of the differential signal.
- Common-mode voltage that exceeds ±7 V may cause permanent damage to unprotected transceivers.
- Even within the specified range, large common-mode swings increase the error in the received differential voltage due to finite common-mode rejection ratio (CMRR) of the receiver.
Measurement technique: Measure V_A and V_B individually with respect to ground using two single-ended channels, then compute the math function (Ch1 + Ch2) / 2. Alternatively, set the oscilloscope to average mode.
The “silent killer” of RS-485 networks: Common-mode voltage excursions are the most common cause of mysterious RS-485 failures in industrial environments. They are often invisible to logic analyzers (which only see decoded bits) and can only be observed with an oscilloscope measuring the analog waveform.
Receiver Input Thresholds
The RS-485 receiver decodes the bus state based on the differential input voltage:
- V_ID ≥ +200 mV → Output = HIGH (Logic 1, Mark)
- V_ID ≤ -200 mV → Output = LOW (Logic 0, Space)
- -200 mV < V_ID < +200 mV → Indeterminate region — no defined output
This 400 mV indeterminate band is the noise margin. A well-designed system ensures that the differential signal at the receiver is well outside this zone (typically >1 V) even under worst-case conditions of cable attenuation, noise, and common-mode voltage.
Fail-Safe Biasing
When no node is actively driving the bus (all transceivers in high-impedance state), the termination resistors pull the differential voltage to 0 V — squarely in the indeterminate region. Two solutions:
-
Internal fail-safe receivers: Transceivers with built-in bias current (e.g., TI THVD14xx family) that shifts the input threshold so that 0 V differential produces a known HIGH output. No external components needed, but every node on the network must have this feature.
-
External bias resistors: A pull-up resistor from A to V_CC and a pull-down resistor from B to GND (typically ~645 Ω each for a 5 V system). This creates a known idle-state differential voltage of ~200 mV. Drawback: these resistors add common-mode load equivalent to approximately 18.6 unit loads, reducing the maximum number of nodes on the bus.
6. CAN Bus Signal Analysis: Recessive/Dominant States, Bit Timing
CAN Physical State Analysis
The CAN bus has only two physical states:
Recessive state (Logic 1):
- CAN-H = CAN-L = ~2.5 V
- Differential voltage ≈ 0 V
- Driven by the network’s termination bias (internal or external)
- The bus naturally returns to recessive through the termination resistors
Dominant state (Logic 0):
- CAN-H ≈ 3.5 V, CAN-L ≈ 1.5 V
- Differential voltage ≈ 2.0 V
- Actively driven by one or more CAN transceivers
- Any node can pull the bus dominant, overriding recessive
Oscilloscope Waveform Analysis
A healthy CAN bus waveform on an oscilloscope shows:
- Clean transitions: Sharp edges with minimal ringing, settling within 10–20% of the nominal transition time.
- Symmetrical voltage levels: CAN-H recessive ≈ CAN-L recessive (both at 2.5 V); dominant CAN-H peak - 3.5 V ≈ 2.5 V - dominant CAN-L trough ≈ 1.5 V.
- Stable recessive baseline: During idle periods, both lines should sit quietly at 2.5 V with minimal noise (<100 mV p-p).
- Consistent dominant levels: The dominant differential should remain above 1.5 V across the entire bus and all nodes.
Bit Timing and Sample Point
CAN bit timing is controlled by a programmable bit timing controller in each node. A single bit time is divided into time quanta (tq):
|<-------------- 1 Bit Time --------------->|
|--Sync--|--Prop Seg--|--Phase Seg 1--|--Phase Seg 2--|
(PROG_SEG) (PHASE_SEG1) (PHASE_SEG2)
[Sample Point] [Transmit Point]
- SYNC_SEG: 1 tq — synchronizes to the falling edge of the incoming bit
- PROP_SEG: Programmed length — compensates for bus propagation delay
- PHASE_SEG1: Programmable — used for resynchronization
- PHASE_SEG2: Programmable — the sample point falls between PHASE_SEG1 and PHASE_SEG2
The sample point is where the receiver decides whether the bit is dominant or recessive. It is typically set at 75–87.5% of the bit time. If the signal has not settled by the sample point (due to reflections, slow edges, or noise), a wrong decision is made.
Timing Measurement with Oscilloscope
- Measure bit width: Should match the configured baud rate. At 500 kbps, one bit = 2.000 µs. Measure across several bits and average for accuracy.
- Measure bit timing error: Compare the measured bit width to the expected value. A deviation >2% may cause synchronization errors.
- Edge jitter: Measure the variation in edge positions relative to the ideal timing. CAN is resilient to small amounts of jitter (corrected by the resynchronization mechanism), but large jitter (>15% of a time quantum) causes errors.
CAN Error Frame Detection
An error frame on CAN appears as a sequence of 6 or more consecutive dominant bits — a violation of the normal bit-stuffing rule (which requires a complementary bit after 5 consecutive identical bits). On an oscilloscope, this looks like an extended period where CAN-H stays high and CAN-L stays low.
Common CAN error types visible on the oscilloscope:
- Bit errors: The monitored bit value differs from what was transmitted.
- Stuff errors: Expected stuff bit not found after 5 consecutive identical bits.
- CRC errors: Calculated CRC does not match the received CRC in the frame.
- Acknowledgment errors: No dominant bit received in the ACK slot (indicating no other node on the bus acknowledged the message).
CAN Bus Loading Analysis
Measure bus load by triggering on the CAN-H falling edge and using the oscilloscope’s histogram or measurement statistics:
- Bus load < 30%: Normal, plenty of margin.
- Bus load 30–70%: Increasing susceptibility to timing errors and message latency.
- Bus load > 70%: Critical — message queues overflow, timing margins are exhausted, error frames become frequent.
7. Ethernet Signal Quality: Eye Diagrams, Jitter
Eye Diagrams
An eye diagram is the fundamental tool for evaluating Ethernet (and all high-speed serial link) physical layer signal quality. It is created by overlaying many unit intervals (UI) of the signal, typically triggered by a clock recovery circuit or the transmitted data clock.
How to generate an eye diagram:
- Connect the oscilloscope (≥500 MHz bandwidth for 100BASE-TX; ≥2.5 GHz for Gigabit Ethernet) with a differential probe to the TX+/TX- or RX+/RX- pair at the PHY output or RJ-45 test jack.
- Enable the oscilloscope’s eye diagram mode or use a clock-recovery trigger.
- Accumulate many thousands of transitions to build up the statistical overlay.
Reading the eye diagram:
_____
/ \ <- Eye opening (vertical)
/ OPEN \ (amplitude margin)
/ CLEAR \ <- Width indicates timing margin
/ area \
| +-------- | <- Zero-crossing point
| / \ |
+_/____________\_+
^ ^
Rise Fall
time time
Key parameters:
| Parameter | Good | Bad |
|---|---|---|
| Eye height | Tall (large vertical opening) | Collapsed (noise, attenuation) |
| Eye width | Wide (large timing margin) | Narrow (excessive jitter) |
| Zero-crossing width | Narrow jitter band | Wide scatter (deterministic jitter) |
| Mask compliance | No mask violations | Violations at corners or crossings |
Eye diagram mask testing: IEEE 802.3 defines mask templates for each Ethernet physical layer (10BASE-T, 100BASE-TX, 1000BASE-T). The oscilloscope overlays the template on the accumulated eye diagram; any sample points falling within the mask region indicate a compliance failure.
Jitter Analysis
Jitter is the deviation of signal edges from their ideal timing positions. For Ethernet, jitter analysis distinguishes several components:
- Total Jitter (TJ): The peak-to-peak timing deviation of all edges. Includes all components.
- Random Jitter (RJ): Unbounded, Gaussian-distributed timing noise from thermal effects, shot noise, and other stochastic sources. Characterized by the RMS value and grows with sqrt of the measurement bandwidth.
- Deterministic Jitter (DJ): Bounded jitter with specific causes:
- Inter-Symbol Interference (ISI): Pattern-dependent timing shifts caused by frequency-dependent attenuation and reflections.
- Periodic Jitter (PJ): Correlated with a periodic source (clock crosstalk, switching power supply ripple).
- Duty-Cycle Distortion (DCD): Unequal rise and fall times causing a systematic timing offset.
Measurement techniques:
- Time Interval Error (TIE) histogram: Plot the distribution of edge timing deviations from the ideal clock position. A Gaussian shape indicates random jitter; distinct peaks indicate deterministic jitter components.
- Jitter decomposition: Use the oscilloscope’s jitter analysis software (e.g., Tektronix DPOJET, Teledyne LeCroy SDA II) to separate RJ and DJ mathematically.
- Jitter trend: Plot jitter values over time to identify thermal drift, intermittent coupling events, or vibration-induced jitter.
100BASE-TX Physical Layer Testing
For 100BASE-TX (the physical layer used by most Ethernet POWERLINK installations):
- MLT-3 encoding: Three-level signaling (+V, 0, -V). The eye diagram has three levels with four transition regions.
- Link pulse verification: Verify the idle link pulses (NLP) and auto-negotiation fast link pulses (FLP) are present and correctly formatted.
- Signal amplitude: Differential peak-to-peak should be ≥1.0 V at the transmitter output; ≥200 mV at the receiver input (after cable attenuation).
- Overshoot: Should be <10% of signal amplitude per IEEE 802.3.
- Rise/fall time: 1–5 ns for 100BASE-TX per IEEE 802.3 specification.
MII/RMII Signal Quality at the MAC-PHY Boundary
While MII and RMII signals are internal digital signals (not differential), their quality directly impacts the transmitted Ethernet signal:
- Clock quality (TX_CLK / REF_CLK): Period jitter should be <500 ps for RMII, <1 ns for MII. Use the oscilloscope’s jitter measurement on the clock signal.
- Setup/hold time verification: Measure the timing relationship between data signals and the clock to verify they meet the MAC and PHY timing specifications. This requires a logic analyzer or an MSO (Mixed Signal Oscilloscope) with high-timing-resolution digital channels.
- Crosstalk between MII/RMII signals: Route length mismatches and tight parallel routing can cause crosstalk. Probe multiple signals simultaneously and look for correlated glitches.
8. Common Physical Layer Faults Causing Intermittent Sensor Failures
Fault Category 1: Cable Degradation
Symptoms: Sensor readings intermittently drop out or return invalid values, especially during temperature changes, vibration, or after cable flexing.
Root causes:
- Conductor breakage: Especially in continuously flexing cables (drag chains, robot arms). The copper conductor develops micro-cracks that only separate under specific bend angles or thermal expansion.
- Insulation degradation: Heat, UV exposure, chemical exposure, or mechanical abrasion degrades insulation, causing increased capacitance between conductors and leakage currents.
- Water ingress: Moisture in cable jackets changes the dielectric properties, increases attenuation, and can cause intermittent shorts between conductors.
Detection: Oscilloscope capture during mechanical stress (wiggle test, bend test). Look for sudden amplitude drops, noise bursts, or complete signal loss correlated with cable movement.
Fault Category 2: Connector Problems
Symptoms: Communication failures that appear and disappear; failures correlated with vibration, thermal cycling, or connector mating/unmating cycles.
Root causes:
- Contact oxidation: Tin-plated contacts oxidize over time, increasing contact resistance. Gold-plated contacts resist oxidation but can suffer from fretting corrosion under vibration.
- Contact fretting: Micro-motion between mated contacts (caused by vibration or thermal cycling) wears away the contact plating and exposes the base metal, which oxidizes rapidly.
- Insertion force loss: After many mating cycles, the spring force in female contacts decreases, reducing contact pressure and increasing resistance.
- Backshell/cable strain relief failure: Mechanical stress transfers to the solder joints or crimp connections inside the connector, causing intermittent opens.
Detection: Probe on both sides of the connector simultaneously (one probe before, one after) and compare waveforms. Intermittent amplitude drops or noise on the downstream side indicate a connector issue.
Fault Category 3: Termination Problems
Symptoms: Communication works with few nodes but fails as devices are added; errors increase at higher baud rates; sporadic CRC errors or retransmissions.
Root causes:
- Missing termination: One or both ends of the bus lack the required termination resistor (120 Ω for both RS-485 and CAN). This causes reflections that become more severe as data rate increases or cable length increases.
- Incorrect termination value: Using 150 Ω resistors with 120 Ω cable, or vice versa. The mismatch causes partial reflections.
- Dual termination at one end: Two devices at the same end of the bus both have termination enabled, producing an incorrect total termination (e.g., 60 Ω instead of 120 Ω).
- Termination resistor failure: The resistor itself has drifted in value or opened due to overheating or surge damage.
Detection: Measure bus resistance with power off. RS-485 or CAN bus should read ~60 Ω between the differential pair (two 120 Ω terminators in parallel). Deviations indicate a termination fault.
Fault Category 4: Grounding and Shielding Issues
Symptoms: Errors that correlate with specific equipment operation (motors starting, heaters cycling, welders firing); errors that change with cable routing; different behavior when devices are powered from different circuits.
Root causes:
- Ground loops: Different ground potentials between nodes cause common-mode currents to flow through the cable shield and signal reference, corrupting the differential signal.
- Improper shield grounding: Shield grounded at both ends creates a ground loop; shield grounded at neither end provides no EMI protection.
- Missing signal reference: RS-485 relies on a common ground reference between nodes (often a third wire in Modbus installations). Without it, ground-potential differences between nodes can exceed the receiver’s common-mode range.
Detection: Measure common-mode voltage on the bus with respect to local ground at each node. Large variations (>1 V) between nodes indicate ground potential differences that may cause intermittent failures.
Fault Category 5: Transceiver Degradation
Symptoms: A specific node or I/O module consistently causes bus errors when transmitting; errors worsen with temperature; device works when cold but fails after warm-up.
Root causes:
- Thermal degradation: Semiconductor aging causes increased leakage current, reduced output drive strength, and degraded noise immunity.
- ESD/surge damage: Prior transient events may have weakened (but not destroyed) the transceiver’s ESD protection structures, reducing noise immunity.
- Supply voltage sag: A failing power supply or decoupling capacitor in the transceiver’s local power domain causes the output drive to weaken momentarily.
Detection: Compare the signal quality of a suspect node to a known-good node transmitting on the same bus. Reduced differential amplitude, increased edge jitter, or asymmetric waveform on the suspect node indicates transceiver degradation.
Fault Category 6: Electromagnetic Interference
Symptoms: Communication failures only during specific machinery operation; failures that follow a daily or shift-based pattern; seasonal failures (e.g., worse in winter when air is dry and ESD is more likely).
Root causes:
- Radiated EMI: Motor drives, VFDs, welders, and other high-dI/dt sources radiate electromagnetic fields that couple into fieldbus cables acting as unintended antennas.
- Conducted EMI: Noise on the power supply rails couples into transceiver circuits through inadequate decoupling.
- Crosstalk: Fieldbus cables routed parallel to power cables pick up induced noise.
Detection: Use near-field probes (see Section 10) to identify radiation sources. Use the oscilloscope’s FFT or spectrum analyzer mode to identify the frequency of interfering signals. Correlate with machinery operation using external trigger inputs.
9. Recommended Equipment: Oscilloscopes, Logic Analyzers, Protocol Analyzers
Oscilloscopes
The oscilloscope is the primary tool for physical-layer fieldbus analysis. Key specifications:
| Specification | RS-485/X2X | CAN Bus | 100BASE-TX | GbE |
|---|---|---|---|---|
| Minimum bandwidth | 100 MHz | 200 MHz | 500 MHz | 2.5 GHz |
| Minimum channels | 2 | 2+ (4 preferred) | 2+ | 4 |
| Sample rate | 500 MSa/s | 1 GSa/s | 2 GSa/s | 10 GSa/s |
| Memory depth | 10k+ points | 10M+ points | 10M+ points | 100M+ points |
| Decode support | RS-485/UART | CAN/CAN FD | Ethernet | Ethernet |
Recommended oscilloscopes by tier:
- Entry-level ($500–$2,000): Rigol DS1054Z (4-ch, 100 MHz, upgradeable), Siglent SDS1104X-E (4-ch, 100 MHz, WiFi). Sufficient for RS-485 and basic CAN analysis. Limited decode capabilities.
- Mid-range ($2,000–$8,000): Keysight InfiniiVision 3000T (4-ch, up to 1 GHz, built-in serial decode), Tektronix MDO3000 series (mixed-signal with 16 logic channels), Rigol MSO5000 (4 analog + 16 digital). Full CAN/RS-485 decode, basic eye diagram, and jitter analysis.
- Professional ($8,000–$25,000): Tektronix MDO4000C/5000B (4-6 analog + up to 64 digital), Keysight InfiniiVision 6000 X-Series, Rohde & Schwarz RTH1000 (ruggedized, handheld for field use). Full serial decode, eye diagrams, jitter analysis, spectrum analysis, near-field probe support.
- High-end ($25,000+): Teledyne LeCroy WaveRunner 8000HD/9000HD (12-bit resolution), Tektronix DPO70000SX (real-time), Keysight UXR-Series (110 GHz). For Gigabit Ethernet and beyond, with advanced jitter decomposition and compliance testing.
For Ethernet POWERLINK specifically: A mid-range 4-channel scope with ≥500 MHz bandwidth and Ethernet/CAN/RS-485 decode is the minimum practical tool. An MSO (Mixed Signal Oscilloscope) with 16+ digital channels is ideal for simultaneously probing the MII/RMII signals and the PHY output.
Logic Analyzers
Logic analyzers capture digital states (high/low) across many channels simultaneously with deep memory. They excel at protocol-level analysis but provide no analog signal quality information.
| Feature | Logic Analyzer | Oscilloscope |
|---|---|---|
| Channel count | 8–136+ | 2–8 |
| Signal type | Digital only | Analog + Digital (MSO) |
| Memory depth | Very deep (Gigabits) | Limited (Megapoints) |
| Timebase | Discrete clock/sample | Continuous analog capture |
| Analog detail | None | Full waveform |
| Protocol decode | Extensive | Varies |
Recommended logic analyzers:
- Entry-level ($15–$300): Saleae Logic (8-ch or 16-ch), DreamSourceLab DSLogic (16-ch), clones (sigrok-compatible). Ideal for protocol decode of RS-485 traffic, MDIO/MDC management interface analysis, and MII/RMII timing verification.
- Mid-range ($500–$3,000): Saleae Logic Pro (8-ch at 500 MSa/s, 16-ch at 250 MSa/s), Keysight U1620A/U1670A (handheld). Good for long captures of high-speed serial data.
- Professional ($3,000+): Keysight 16800 Series, Teledyne LeCroy Studio. Deep memory, advanced protocol analysis, multi-bus triggering.
Best practice: Use a logic analyzer and oscilloscope together. The logic analyzer captures long protocol traces (identifying what went wrong), while the oscilloscope captures the analog waveform detail (identifying why it went wrong).
Protocol Analyzers
Dedicated protocol analyzers are specialized instruments that provide deep protocol-level analysis for specific fieldbus types:
- CAN bus analyzers: Peak System PCAN-USB, Vector CANalyzer, Kvaser CAN interfaces. These connect via USB to a PC and provide real-time CAN/CAN FD message monitoring, transmission, filtering, and logging. Some handheld units (e.g., Peak PCAN-Diag FD) also include physical-layer diagnostics: termination resistance measurement, voltage measurement, and an integrated two-channel oscilloscope.
- Ethernet analyzers: Wireshark (software) with a dedicated tap; specialized industrial Ethernet analyzers that decode POWERLINK, EtherNet/IP, PROFINET, and other industrial protocols.
- RS-485/Modbus analyzers: Dedicated RS-485 protocol analyzers that decode Modbus RTU/TCP, Profibus DP, and other RS-485-based protocols.
- All-in-one handheld: Tools like the Peak PCAN-Diag 2 combine CAN physical-layer measurements (voltage, resistance, oscilloscope) with protocol-level analysis (message decode, bus load, error frame detection) in a single portable unit.
Equipment Selection Guide by Task
| Task | Primary Tool | Supporting Tool |
|---|---|---|
| Verify RS-485 signal levels and quality | Oscilloscope with diff probe | Logic analyzer for protocol decode |
| Analyze CAN bus errors | CAN protocol analyzer | Oscilloscope for physical-layer |
| Check Ethernet link quality | Oscilloscope with eye diagram | PHY register access via MDIO |
| Probe MII/RMII timing | MSO or logic analyzer | Oscilloscope for clock quality |
| Verify termination/biasing | Multimeter + oscilloscope | — |
| Locate EMI sources | Oscilloscope + near-field probes | Spectrum analyzer |
| Long-term bus monitoring | Protocol analyzer with logging | Oscilloscope on trigger |
10. Probe Techniques: Differential Probes, Current Probes, Near-Field Probes
Differential Probes
Purpose: Measure the voltage difference between two points without requiring a ground reference. Essential for probing differential buses (RS-485, CAN, Ethernet) when the local circuit ground differs from the oscilloscope ground.
How they work: A differential probe has two high-impedance inputs and an internal differential amplifier that outputs the voltage difference (V+ - V-). The inputs are isolated from the oscilloscope ground, allowing safe measurement of floating signals.
Key specifications:
| Parameter | Typical Value | Significance |
|---|---|---|
| Attenuation | 10x, 20x, 50x | Trade-off between dynamic range and sensitivity |
| Bandwidth | 50 MHz – 1 GHz | Must exceed the signal’s highest frequency component |
| CMRR | 60–80 dB @ DC | Common-mode rejection ratio; higher is better |
| Max input voltage | ±50 V to ±1400 V (HV models) | Determines what circuits can be safely probed |
| Input impedance | 1 MΩ |
Probing RS-485 with a differential probe:
- Connect the probe’s + input to line A and the - input to line B.
- Set attenuation to 10x (or appropriate for the voltage range).
- Set the oscilloscope channel scale to compensate (e.g., 50 mV/div at 10x = 500 mV/div actual).
- Verify the probe compensation using the oscilloscope’s calibration signal (follow the probe manufacturer’s procedure).
Probing CAN with a differential probe:
Same procedure as RS-485. The low common-mode voltage of CAN (~2.5 V) is easily within the range of any differential probe. However, for routine CAN work, two single-ended channels (Ch1 = CAN-H, Ch2 = CAN-L, math = Ch1-Ch2) may be more convenient since it also shows each line individually.
Current Probes
Purpose: Measure current flowing through a conductor without breaking the circuit. Used for:
- Measuring the current consumption of transceivers during transmit/receive cycles
- Detecting ground-loop currents flowing in cable shields
- Measuring surge current events
- Verifying power supply adequacy under load
Types:
- AC current probes (transformer-based): Measure AC and transient currents. Cannot measure DC. Typical bandwidth: 10 kHz – 100 MHz. Suitable for detecting AC ground-loop currents and EMI-related currents.
- DC/AC current probes (Hall-effect or hybrid): Measure both DC and AC currents. Typical bandwidth: DC – 50 MHz. Suitable for measuring transceiver supply current, steady-state ground-loop DC, and dynamic current consumption.
- Cable current probes (clamp-on): Large aperture probes that clamp around entire cable bundles. Used for measuring common-mode currents flowing on cable shields. Essential for EMC troubleshooting (see Section 12).
Measuring common-mode cable current:
- Place a clamp-on current probe around the entire cable bundle (including all signal wires and the shield).
- The probe measures the net common-mode current — the current that flows on the cable bundle as a whole, which is the current that radiates as an antenna.
- Common-mode current should be <1 mA for compliant installations; higher values indicate ground loops or EMI coupling.
Near-Field Probes
Purpose: Detect and localize electromagnetic field emissions from circuits and cables at close range. Used for:
- Identifying the specific component or trace that is radiating EMI
- Finding sources of interference that couple into fieldbus cables
- Pre-compliance EMC testing (before formal certification testing)
- Debugging signal integrity issues caused by radiation
Types:
- H-field (magnetic field) probes: Small loop antennas that detect magnetic fields from current flow. Available in various sizes:
- Large diameter (10–30 mm): High sensitivity, low spatial resolution. Best for general surveying and finding the general area of radiation.
- Small diameter (1–5 mm): Lower sensitivity, high spatial resolution. Best for pinpointing the exact trace, pin, or component generating the emission.
- E-field (electric field) probes: Small rod antennas that detect electric fields from voltage changes. More sensitive to high-impedance, voltage-driven emissions.
Using near-field probes:
- Connect the near-field probe to a spectrum analyzer or oscilloscope with FFT/spectrum mode.
- Systematically scan the circuit board or cable with the probe, holding it close (1–5 mm) to the surface.
- Increase the signal level at the identified source by narrowing the probe size or repositioning.
- The frequency of the detected emission often correlates with the operating frequency of a specific circuit (e.g., RS-485 data rate, CAN baud rate, Ethernet clock harmonics).
Home-built near-field probes: A simple H-field probe can be made from a coaxial cable with the shield formed into a small loop (shield soldered to center conductor at the tip). This costs essentially nothing and works surprisingly well for frequencies above 10 MHz. For pre-compliance work, commercial probe sets (e.g., Rohde & Schwarz, Tektronix, Aaronia, Com-Power) provide calibrated probes with known transfer impedance, enabling quantitative measurements.
Probe Loading Considerations
Any probe connected to a circuit affects that circuit through its input impedance (resistance and capacitance):
- Voltage probes: Input impedance of 10 MΩ || 8–15 pF (typical passive probe). This capacitance loads high-frequency signals; for a 10 MHz RS-485 signal, 10 pF at 120 Ω source impedance introduces a pole at ~130 MHz — usually acceptable. But for MII/RMII 50 MHz signals, the same 10 pF can cause noticeable edge degradation.
- Differential probes: Higher input capacitance (typically 5–10 pF per input) but with the advantage of no ground reference needed.
- Near-field probes: Minimal loading; essentially a receive-only antenna.
Best practice: Use the highest impedance probe available (lowest capacitance), and verify by comparing the signal with and without the probe connected (if possible).
11. Termination and Biasing Verification
RS-485 Termination Verification
Standard parallel termination:
Two 120 Ω resistors, one at each end of the bus, matched to the characteristic impedance of the twisted-pair cable.
Verification procedure:
- Power off all devices on the bus.
- Measure resistance between A and B at any point on the bus:
- ~60 Ω: Correct (two 120 Ω terminators in parallel).
- ~120 Ω: One terminator missing (measuring only one end’s resistor).
- ~40 Ω: Possible extra terminator (three 120 Ω resistors in various parallel combinations produce ~40 Ω).
- Very high (kΩ–MΩ): No termination present.
- Verify termination location: Disconnect devices one at a time and re-measure. The resistance should jump to ~120 Ω when each terminating device is removed, confirming the terminators are at the bus endpoints.
AC termination verification:
AC termination uses a series RC network (R = 120 Ω, C ≈ 0.1 µF) at each bus end instead of a plain resistor. This cannot be verified with a DC resistance measurement because the capacitor blocks DC. Instead:
- Probe the bus with an oscilloscope during active transmission.
- Verify signal edges are clean (no excessive ringing) while also verifying that the DC current through the termination is zero (measure current with a current probe — should be near-zero during idle state).
- Check the RC time constant: The capacitor and resistor form a low-pass filter with τ = R × C = 120 Ω × 0.1 µF = 12 µs. This time constant should be much shorter than the minimum bit time to avoid distorting the signal.
RS-485 Biasing Verification
External bias resistors:
If external fail-safe bias resistors are used (pull-up on A to V_CC, pull-down on B to GND):
- Power off all transceivers but leave the biasing node powered.
- Measure voltage on line A: Should be pulled to approximately V_CC × R_TERM / (R_TERM + R_PULLUP). For 120 Ω termination and 645 Ω pull-up, V_A ≈ 5 × 120 / (120 + 645) ≈ 0.79 V above the divider midpoint.
- Measure voltage on line B: Should be pulled correspondingly low.
- Measure differential voltage: Should be ≥200 mV (the minimum receiver threshold for a defined state).
- Verify bias current does not overload the driver: The parallel combination of the two bias resistors should present a common-mode load that, combined with all node loads, does not exceed the equivalent of 32 unit loads (375 Ω).
Internal fail-safe verification:
For transceivers with built-in fail-safe biasing (no external resistors):
- Power off all transceivers on the bus.
- With no driver active, measure the differential voltage. With only termination resistors present, V_diff should be 0 V. This is in the indeterminate zone.
- Verify the transceiver’s data sheet specifies internal fail-safe bias. If it does, the receiver output will be HIGH despite the 0 V differential input. This can only be verified by observing the receiver’s output (R pin), not at the bus itself.
CAN Bus Termination Verification
CAN bus uses the same 120 Ω parallel termination scheme as RS-485:
- Power off all CAN devices.
- Measure resistance between CAN-H and CAN-L at any point:
- ~60 Ω: Correct (two 120 Ω terminators in parallel).
- ~120 Ω: One terminator missing.
- ~40 Ω: Extra terminator present.
- Very high (kΩ–MΩ): No termination.
Split termination (optional):
Some CAN implementations use split termination: two 60 Ω resistors in series with a capacitor to ground at the midpoint. This provides both impedance matching and common-mode filtering. To verify:
- Measure CAN-H to CAN-L: should read ~120 Ω (two 60 Ω resistors in series).
- Measure CAN-H to GND and CAN-L to GND: each should read ~60 Ω to the midpoint.
- Verify the capacitor value with an LCR meter (if accessible) or verify proper common-mode filtering by checking for reduced common-mode noise on the bus during active communication.
Termination during operation:
A handheld CAN diagnostic tool (e.g., Peak PCAN-Diag FD) can measure termination resistance while the bus is running, by injecting a known test current and measuring the resulting voltage change. This catches intermittent termination faults (e.g., a resistor that opens under thermal stress).
12. EMC Testing at the Physical Layer
Why EMC Matters for Fieldbus
Industrial environments present severe electromagnetic challenges: variable-frequency drives, motor contactors, welders, power electronics, and switching power supplies all generate conducted and radiated emissions. Fieldbus cables running through these environments act as unintended antennas, picking up noise that corrupts signals. Conversely, poorly designed fieldbus interfaces can radiate emissions that interfere with other equipment.
Conducted Emissions Testing
Conducted emissions testing measures the noise current flowing on power supply lines and I/O cables in the frequency range of 150 kHz to 30 MHz.
Equipment needed:
- LISN (Line Impedance Stabilization Network): Placed between the device under test and the power source to present a defined impedance (50 Ω) to the noise currents and couple them to the measurement instrument.
- Spectrum analyzer or EMI receiver: Measures the amplitude of conducted noise at each frequency.
- Current probe: Alternative to LISN for measuring common-mode current on cable bundles.
Procedure for fieldbus cables:
- Connect the LISN between the device’s power input and the power source.
- Connect the spectrum analyzer to the LISN measurement port.
- Scan 150 kHz to 30 MHz and record the conducted emission levels.
- Compare against the applicable EMC standard limits (e.g., IEC 61131-2 for industrial control equipment, EN 55032 for multimedia equipment).
- If emissions exceed limits, use current probes on individual cables to identify which cable carries the offending noise.
Common-mode current on fieldbus cables: Use a clamp-on current probe around the entire fieldbus cable bundle. Common-mode current should typically be below 5 mA in the 150 kHz – 30 MHz range for industrial environments. Higher values indicate inadequate filtering or grounding.
Radiated Emissions Testing
Radiated emissions testing measures the electromagnetic field strength radiated by the device and its cables at distances of 1, 3, or 10 meters in the frequency range of 30 MHz to 1 GHz (and beyond for some standards).
Pre-compliance testing (bench-level):
Near-field probing is the primary pre-compliance technique:
- Set up the spectrum analyzer with a near-field probe connected via a low-noise amplifier (LNA) if available.
- Scan the circuit board systematically with H-field and E-field probes to identify emission sources:
- Start with a large H-field probe for a broad survey.
- Narrow down with smaller probes for pinpointing.
- Note the frequency and amplitude of each emission.
- Common emission sources on fieldbus hardware:
- RS-485/CAN transceiver output stages (fast switching edges radiate at the data rate and its harmonics)
- Crystal oscillator circuits (fundamental frequency and overtones)
- Switching voltage regulators
- MII/RMII clock traces (50 MHz fundamental + harmonics)
- Correlate emissions with bus activity: Toggle the bus traffic on/off and observe whether emission levels change. If emissions correlate with bus activity, the bus interface is a radiation source.
Mitigation techniques:
| Technique | Application |
|---|---|
| Slew-rate limiting on RS-485 transceivers | Reduces high-frequency harmonics of the data signal |
| Common-mode chokes on bus cables | Attenuates common-mode current (the component that radiates) |
| Shielded twisted-pair cable | Provides both differential-mode balance and common-mode shielding |
| Proper cable shield grounding | Single-point ground prevents ground loops; 360° termination at connectors |
| PCB layout improvements | Minimize loop areas, keep high-speed traces short, use ground planes |
| Ferrite beads on cables | Absorbs high-frequency common-mode current |
Radiated Immunity Testing
Radiated immunity testing verifies that the device continues to operate correctly when subjected to external electromagnetic fields.
Procedure:
- Place the device under test in the radiated field generated by a calibrated antenna.
- Apply a calibrated field strength (e.g., 3 V/m, 10 V/m, or higher per the applicable standard) at various frequencies.
- Monitor device operation: Watch for communication errors (using a protocol analyzer or the device’s own diagnostics), sensor reading anomalies, or system crashes.
- Identify susceptible frequencies: Note which frequencies cause errors and correlate with known clock frequencies, bus data rates, or resonances.
Fieldbus-specific immunity testing:
- During radiated immunity testing, actively monitor the fieldbus traffic with a protocol analyzer or oscilloscope. Count error frames (CAN), CRC errors (RS-485/Modbus), or dropped packets (Ethernet).
- Pay special attention to the frequency ranges near the bus operating frequency and its harmonics — these are often the most problematic.
- Cable orientation matters: maximum susceptibility occurs when the cable is aligned with the electric field vector.
Electrostatic Discharge (ESD) Testing
ESD testing simulates human-touch discharges that can damage or upset fieldbus interfaces.
Test points for fieldbus systems:
- RJ-45 connector pins (Ethernet)
- DB-9 / terminal block contacts (RS-485/RS-422)
- X2X backplane connectors
- Cable shields
- Device enclosures and panel cutouts
ESD levels per IEC 61000-4-2:
- ±4 kV contact discharge (commercial)
- ±8 kV contact discharge (industrial)
- ±8 kV air discharge (commercial)
- ±15 kV air discharge (industrial)
Monitoring during ESD testing: Use an oscilloscope with a high-voltage differential probe (isolated) to capture the transient on the bus lines during discharge. A properly protected transceiver will clamp the transient within its common-mode range; an unprotected transceiver may show voltage excursions far beyond the rated range, causing permanent damage or temporary corruption.
13. Ground Loops and Their Effect on Signal Integrity
What Is a Ground Loop?
A ground loop occurs when two or more devices that are connected by signal cables have their ground references at different potentials. The signal cable (and particularly its shield or ground reference wire) provides a path for current to flow from the higher-potential ground to the lower-potential ground. This circulating current is the ground loop.
Device A (GND @ 0 V) Device B (GND @ 2 V)
┌─────────────────┐ ┌─────────────────┐
│ │ │ │
│ GND ─────┐ │ Signal Cable │ ┌──── GND │
│ │ ├────────────────┤ │ │
│ │ │ Shield/GND │ │ │
│ │ │ carries 2V │ │ │
└────────────┼────┘ ground loop └────┼────────────┘
│ current │
└──────────────────────────┘
How Ground Loops Affect Signal Integrity
Common-mode voltage shift:
The ground loop current flowing through the cable’s resistance creates a voltage drop that shifts the common-mode voltage seen by the receivers. If this shift pushes the common-mode voltage outside the receiver’s specified range (-7 V to +12 V for standard RS-485), the receiver fails to decode the signal correctly, even if the differential voltage is perfectly clean.
Noise injection:
Ground loop currents are rarely steady DC. They often carry AC noise from motors, power supplies, or other equipment operating on different ground potentials. This noise modulates the common-mode voltage, creating time-varying errors that are difficult to diagnose because they correlate with other machinery operation rather than the communication system itself.
Cable shield current:
When the cable shield is connected to ground at both ends, it forms a low-impedance path for ground-loop current. The shield current generates a magnetic field that couples into the signal conductors inside the cable, inducing noise voltage in the differential pair. This noise appears as common-mode interference (affecting both A and B equally) which the differential receiver should reject — but only if the common-mode voltage remains within the receiver’s specified range.
Cable heating:
In severe cases, large ground-loop currents can heat the cable, accelerating insulation degradation and potentially creating a fire hazard in installations with significant ground potential differences.
Identifying Ground Loops
Measurement technique:
- Measure the voltage difference between the ground terminals of two devices on the same bus using a multimeter:
- < 0.5 V: Generally safe.
- 0.5–3 V: May cause marginal issues; monitor for errors.
- > 3 V: Likely causing communication problems; must be addressed.
- Measure the AC ground difference: Set the multimeter to AC mV mode. Significant AC voltage (>100 mV) between grounds indicates active ground-loop currents carrying noise.
- Oscilloscope measurement: Use a differential probe to measure the common-mode voltage on the bus relative to local ground. Set a long timebase (10–100 ms/div) with AC coupling and observe slow drift or noise in the common-mode level.
Correlation testing:
- Connect and disconnect the shield at one end of the cable. If errors decrease when the shield is disconnected at one end, a ground loop on the shield path is likely.
- Disconnect the signal ground reference wire (if present) at one end. If errors decrease, the ground wire is carrying ground-loop current.
- Operate suspected noise-generating equipment (motors, heaters, drives) on/off while monitoring bus errors. If errors correlate, the equipment’s ground system is interacting with the fieldbus ground.
Preventing Ground Loops
Galvanic isolation:
The most effective solution. Isolated RS-485 transceivers (e.g., Analog Devices ADM2587E, TI ISO1540) provide electrical isolation between the bus side and the logic side using transformers or capacitive isolation barriers. This breaks the ground loop path entirely. Isolation ratings of 2.5 kV to 5 kV are common.
Single-point shield grounding:
Connect the cable shield to ground at only one end of the cable (typically the master/controller end). This prevents shield ground-loop currents while still providing EMI shielding. The unconnected end should be left floating or terminated with a capacitor to provide high-frequency EMI coupling without a DC ground path.
Signal ground reference (third wire):
For RS-485 networks, include a dedicated signal ground reference wire (often pin 1 of the DB-9 connector in Modbus installations). Connect this wire at both ends but through a resistor (e.g., 100 Ω) or a parallel combination of a 100 Ω resistor and a 0.1 µF capacitor. This limits the ground-loop current while providing a common reference for the receiver’s input attenuator.
Optical isolation:
For extreme ground potential differences, fiber-optic media converters can be used to completely eliminate the electrical connection between nodes. This is the ultimate solution but adds cost and complexity.
Star grounding:
In multi-device installations, use star grounding where each device has its own ground path back to a single common ground point, rather than daisy-chaining grounds through the devices. This prevents ground currents from one device from flowing through the ground path of another.
Ground Loop Effects on Specific Fieldbuses
RS-485/X2X:
- Most susceptible due to the wide common-mode range (-7 V to +12 V) being frequently exceeded in industrial installations.
- Ground loop effects manifest as intermittent character errors (wrong data bytes received) or complete communication failures.
- The bus’s differential nature rejects common-mode noise, but only within the receiver’s specified range.
CAN bus:
- CAN transceivers (ISO 11898-2) are specified for -2 V to +7 V common-mode range (tighter than RS-485). Some automotive-qualified CAN transceivers support extended ranges.
- Ground loops cause error frames, increased error counters, and bus-off conditions in extreme cases.
- The CAN bus’s non-return-to-zero (NRZ) coding and bit-stuffing rules make it relatively robust to moderate common-mode noise, but susceptible to large transients.
Ethernet POWERLINK:
- Standard Ethernet PHYs use transformer coupling (magnetics) at the RJ-45 connector, which provides inherent galvanic isolation (~1500 V) between the cable and the device’s ground.
- This makes Ethernet POWERLINK inherently resistant to ground loops through the cable.
- However, ground loops can still affect the PHY’s power supply and the MII/RMII signals on the PCB side of the magnetics.
- Ground potential differences between devices on the same Ethernet segment can stress the magnetics, potentially causing saturation and signal distortion.
Cross-References
- x2x-protocol.md — X2X bus protocol details for interpreting captured X2X signals
- if2772-canopen.md — CAN bus protocol details for interpreting captured CAN signals
- powerlink-internals.md — POWERLINK frame format for interpreting captured Ethernet signals
- io-card-hardware.md — IO module hardware; what signals exist before and after the module
- grounding-emc.md — Grounding, shielding, and EMC troubleshooting for signal integrity
- encoder-diagnostics.md — Encoder signal quality analysis and diagnostics
- diagnostic-workstation.md — Recommended oscilloscopes, logic analyzers, and test equipment
- io-sniffing.md — Higher-level protocol sniffing building on physical layer capture
- cp1584-hardware-ref.md — CP1584 physical connectors and pinout specifications for probing
- analog-calibration.md — Analog signal quality verification and noise measurement at the physical layer
Appendix A: Quick Reference — Oscilloscope Settings by Protocol
RS-485 / X2X
| Setting | Recommended Value |
|---|---|
| Coupling | DC |
| Bandwidth limit | Off (or 20 MHz for general survey) |
| Timebase | 5 × (1/baud_rate) per division |
| Volts/div | 1–2 V (adjust to fill ~80% of screen) |
| Trigger | Edge on Ch1 or Ch2 (single-ended) or on math function (differential) |
| Trigger level | 50% of signal amplitude |
| Acquisition | Normal or Peak Detect (for intermittent events) |
| Decode | RS-485 / UART, set baud rate to match system |
| Math | Ch1 - Ch2 (differential), (Ch1 + Ch2) / 2 (common-mode) |
CAN Bus — Oscilloscope Settings
| Setting | Recommended Value |
|---|---|
| Coupling | DC |
| Bandwidth limit | Off |
| Timebase | 2–5 µs/div (for 500 kbps); adjust proportionally for other rates |
| Volts/div | 1 V/div |
| Trigger | CAN bus decode trigger (if available), or edge on CAN-H |
| Acquisition | Normal |
| Decode | CAN or CAN FD, set bit rate |
| Math | Ch1 - Ch2 (differential) |
100BASE-TX (Ethernet POWERLINK)
| Setting | Recommended Value |
|---|---|
| Coupling | AC (for eye diagram), DC (for DC levels) |
| Bandwidth limit | Off |
| Timebase | 2 ns/div for single transitions; eye diagram mode for composite |
| Volts/div | 200 mV/div |
| Trigger | Clock recovery (for eye diagram) |
| Acquisition | High-resolution (12-bit if available) |
| Decode | Ethernet (if available) |
Appendix B: Quick Reference — Multimeter Tests
RS-485 Bus
| Test | Expected Result | Fault Indication |
|---|---|---|
| A-B resistance (power off) | ~60 Ω | Missing/extra termination |
| A to GND resistance (power off) | >1 kΩ | Shorted receiver/transceiver |
| B to GND resistance (power off) | >1 kΩ | Shorted receiver/transceiver |
| A to GND voltage (powered, idle) | Varies (depends on biasing) | N/A |
| B to GND voltage (powered, idle) | Varies (depends on biasing) | N/A |
| Differential voltage during TX | 1.5–5.0 V | <1.5 V indicates weak signal |
CAN Bus — Multimeter Tests
| Test | Expected Result | Fault Indication |
|---|---|---|
| CAN-H to CAN-L resistance (power off) | ~60 Ω | Missing/extra termination |
| CAN-H to GND (single node, powered) | 2.5–3.0 V | Out of range = damaged transceiver |
| CAN-L to GND (single node, powered) | 2.0–2.5 V | Out of range = damaged transceiver |
| CAN-H to GND (power off, disconnected) | MΩ (open) | <100 kΩ = damaged transceiver |
| CAN-L to GND (power off, disconnected) | MΩ (open) | <100 kΩ = damaged transceiver |
Appendix C: Further Reading
- TI SLLA545 — RS-485 Basics Series (comprehensive RS-485 fundamentals)
- TI SNLA266 — 10/100Mbps Industrial Ethernet PHY compliance and debug
- Renesas AN-13335 — EMC and signal integrity for Ethernet PHYs
- Analog Devices AN-1399 — Enhanced RS-485 receiver fail-safe performance
- ISO 11898-2 — CAN bus physical layer specification
- TIA/EIA-485-A — RS-485 electrical characteristics standard
- IEEE 802.3 — Ethernet physical layer specifications (Clause 14: 10BASE-T, Clause 24: 100BASE-TX, Clause 35: 1000BASE-T)
- IEC 61000-4-2 — Electrostatic discharge immunity test
- IEC 61131-2 — EMC requirements for programmable controllers
- EPSG DS 301 — Ethernet POWERLINK Communication Profile Specification
Key Findings
-
RS-485/X2X differential voltage must be >= 1.5 V across a 54 ohm load per EIA-485. Typical healthy systems show 2.0-3.5 V. Values below 1.0 V indicate excessive cable length, too many nodes, corroded connections, or transceiver failure. Common-mode voltage must stay within -7 V to +12 V; excursions beyond this saturate the receiver’s internal bias network regardless of differential signal quality.
-
CAN bus diagnostic multimeter checks (power off): CAN-H to CAN-L should read ~60 ohm (two 120 ohm terminators in parallel). Single-node powered: CAN-H to GND = 2.5-3.0 V, CAN-L to GND = 2.0-2.5 V. Disconnected and powered off: both lines to GND should be megaohms (lower = damaged transceiver, common after lightning/surge). Active differential must be >= 1.5 V per ISO 11898-2.
-
Six categories of physical-layer faults cause intermittent sensor failures: (1) cable/connector issues (reflections from missing termination, ~120 ohm = one missing, ~40 ohm = extra), (2) signal integrity degradation (amplitude attenuation, slow edges from cable capacitance), (3) grounding/shielding problems (ground loops, improper shield grounding), (4) power supply issues (brownouts, inadequate decoupling), (5) transceiver degradation (thermal aging, post-ESD weakness), (6) EMI (radiated from VFDs/welders, conducted via power rails, crosstalk from parallel power cables).
-
Oscilloscope minimum requirements by protocol: RS-485/X2X = 100 MHz bandwidth / 500 MSa/s; CAN bus = 200 MHz / 1 GSa/s; 100BASE-TX POWERLINK = 500 MHz / 2 GSa/s. For POWERLINK specifically, a 4-channel scope with >= 500 MHz bandwidth and Ethernet decode capability is the practical minimum. An MSO with 16+ digital channels enables simultaneous MII/RMII probing.
-
Ethernet POWERLINK physical-layer issues: RMII 50 MHz reference clock jitter must be < 0.5 ns period jitter (noisy clock = intermittent CRC errors); magnetics (RJ-45 transformers) can be damaged by surge events causing asymmetric waveforms; cable length must not exceed 100 m of Cat5e. Probe the MII/RMII interface with a logic analyzer to verify clock quality and TX/RX data timing.
-
Differential probes are essential when probing ground-referenced signals where the oscilloscope ground differs from the circuit ground (common in industrial installations with distributed power supplies). Key specs: CMRR 60-80 dB, bandwidth >= signal’s highest frequency component, input impedance 1 Mohm || 5-10 pF. For routine CAN work, two single-ended channels (Ch1 = CAN-H, Ch2 = CAN-L, math = Ch1-Ch2) may be more convenient.
-
Termination verification procedure: power off all devices, measure A-B resistance at any bus point. RS-485: ~60 ohm = correct, ~120 ohm = one missing, ~40 ohm = extra terminator, very high = none present. CAN: same 60 ohm rule applies. If bias resistors are present (1:1 split, e.g., 560 ohm pull-up to Vcc, 560 ohm pull-down to GND), the idle-state voltage between A and B should be ~200 mV (ensuring defined recessive state).
-
Near-field probes for EMI source identification: H-field loop probes detect magnetic fields from current flow (large loop = survey, small loop = pinpoint). Connect to spectrum analyzer or oscilloscope FFT mode. A home-built H-field probe from coaxial cable (shield formed into small loop, soldered to center conductor) costs nothing and works above 10 MHz. Common-mode cable current measured by clamp-on probe around the entire cable bundle should be < 1 mA for compliant installations.
Analog IO Signal Conditioning and Calibration on B&R Automation
Analog input and output signals are the most failure-prone signals in any B&R installation. Noise, grounding problems, aging sensors, and drifting calibration all produce symptoms that are difficult to distinguish from software bugs. This document covers how B&R analog IO cards handle 0-10V, 4-20mA, thermocouple, and RTD signals; how to perform calibration; how noise and grounding issues manifest as reading errors; and how to systematically determine whether a problem originates at the sensor, the cabling, or the IO card itself. Cross-references: io-card-hardware.md for IO card hardware internals, grounding-emc.md for grounding and EMC troubleshooting, and memory-map.md for direct memory access to analog channels.
Comprehensive Technical Reference
Table of Contents
- Analog Input Signal Types and Module Overview
- Signal Conditioning Circuits on B&R Analog Modules
- Calibration Procedures for Analog Inputs and Outputs
- Offset/Gain Adjustment Methods
- Noise and Grounding Issues as Analog Reading Errors
- Distinguishing Sensor Faults from IO Card Faults
- Resolution and Accuracy Specifications
- Sampling Rate and Aliasing Considerations
- Cold Junction Compensation for Thermocouple Inputs
- 3-Wire and 4-Wire RTD Measurement
- Current Loop (4-20 mA) Diagnostics
- Filter Settings and Response Time Trade-offs
- Grounding Best Practices for Analog Signals
- Calibration Certification and Traceability
1. Analog Input Signal Types and Module Overview
1.1 Voltage Inputs (0-10V, +/-10V)
B&R analog input modules support voltage measurement through differential input configurations. The front-end circuit presents a high input impedance (typically 20 MOhm on modules like the X20AI4622) to minimize loading on the signal source.
Supported modules and ranges:
| Module | Channels | Voltage Range | Resolution | Input Impedance |
|---|---|---|---|---|
| X20AI2222 | 2 | +/-10V | 13-bit (incl. sign) | 20 MOhm |
| X20AI2237 | 2 | +/-10V | 16-bit | 20 MOhm |
| X20AI4622 | 4 | +/-10V | 13-bit (incl. sign) | 20 MOhm |
| X20AI4632 | 4 | +/-10V | 16-bit | 20 MOhm |
| X20AI4636 | 4 | +/-10V | 16-bit | 20 MOhm |
| X20AI8039 | 8 | +/-10V | 16-bit | Per channel configurable |
LSB resolution for voltage (13-bit modules):
- +/-10V range: 1 LSB = 2.441 mV (INT format 0x8001 to 0x7FFF)
LSB resolution for voltage (16-bit modules):
- +/-10V range: 1 LSB = 0.305 mV (finer granularity from higher resolution)
The conversion procedure on standard modules uses Successive Approximation Register (SAR) ADCs with conversion times as low as 400 us for all inputs (X20AI4622). Galvanically isolated variants (e.g., X20AI2237, X20AI2437) provide per-channel isolation with their own sensor power supply, eliminating channel-to-channel coupling.
Input protection: All B&R analog voltage inputs include protection against wiring with supply voltage, tolerating up to +/-30V on the input without damage.
1.2 Current Inputs (4-20 mA, 0-20 mA)
Current measurement on B&R modules is performed using an internal precision shunt resistor. The input circuit automatically switches between voltage and current measurement modes based on the terminal used and the software configuration (an integrated switch inside the module activates the appropriate signal path).
Supported current ranges:
| Module | Channels | Current Range | Resolution | Shunt/Load |
|---|---|---|---|---|
| X20AI2322 | 2 | 0-20 mA / 4-20 mA | 12-bit | <400 Ohm |
| X20AI2437 | 2 | 4-20 mA | 16-bit | Isolated per channel |
| X20AI2438 | 2 | 4-20 mA | 16-bit | Isolated, HART support |
| X20AI4622 | 4 | 0-20 mA / 4-20 mA | 13-bit (incl. sign) | <400 Ohm |
| X20AI4632 | 4 | 0-20 mA / 4-20 mA | 16-bit | <400 Ohm |
| X20AI8039 | 8 | 0-20 mA / 4-20 mA | 16-bit | Per channel |
LSB resolution for current (13-bit modules):
- 0-20 mA range: 1 LSB = 4.883 uA
- 4-20 mA range: INT -8192 to +32767 (value 0 corresponds to 4 mA)
Input protection: Current inputs tolerate up to +/-50 mA without damage.
Galvanically isolated current modules (X20AI2437, X20AI2438) provide single-channel galvanic isolation with an independent sensor power supply, making them ideal for applications requiring isolation between measurement loops. The X20AI2438 additionally supports the HART protocol, enabling bidirectional digital communication superimposed on the 4-20 mA analog signal.
1.3 Thermocouple Inputs
B&R offers dedicated thermocouple input modules that support types J, K, N, S, B, and R:
| Module | Channels | TC Types | Resolution | Filter Time |
|---|---|---|---|---|
| X20AT2402 | 2 | J, K, N, S, B, R | 16-bit (0.1C) | 1-66.7 ms configurable |
| X20AT6402 | 6 | J, K, N, S, B, R | 16-bit (0.1C or 0.01C) | 1-66.7 ms configurable |
Measurement ranges per thermocouple type:
| Type | Range | Output Range (0.1C res.) |
|---|---|---|
| J (Fe-CuNi) | -210 to 1200C | -2100 to +12000 |
| K (NiCr-Ni) | -270 to 1372C | -2700 to +13720 |
| N (NiCrSi-NiSi) | -270 to 1300C | -2700 to +13000 |
| S (PtRh10-Pt) | -50 to 1768C | -500 to +17680 |
| B (PtRh30-PtRh6) | 0 to 1820C | 0 to +18200 |
| R (PtRh13-Pt) | -50 to 1664C | -500 to +16640 |
The X20AT6402 supports dual resolution: 0.1C (INT, range +/-32767) and 0.01C (DINT, range +/-2,147,483,647). Raw value measurement without linearization is also available for custom sensor types.
Conversion procedure: Thermocouple modules use sigma-delta converters (as opposed to SAR on voltage/current modules). Conversion times depend on the number of enabled channels and the filter setting:
- Function Model 0, n channels: (n + 1) * (2 * Filter time + 200 us)
- Function Model 1, n channels: n * (2 * Filter time + 200 us)
- Example: 6 channels with 50 Hz filter = 281.4 ms total conversion time
1.4 RTD Inputs (Pt100, Pt1000)
B&R provides both dedicated RTD modules and universal multi-signal modules:
| Module | Channels | Sensor Types | Wiring | Resolution |
|---|---|---|---|---|
| X20AT2222 | 2 | Pt100, Pt1000 | 2-wire, 3-wire | 16-bit (0.1C) |
| X20AI8039 | 8 | Pt100, Pt1000 (mixed with V/I) | 2-wire, 3-wire | 16-bit (0.1C) |
Measurement method: RTD modules use a constant current source (250 uA +/-1.25% on X20AT2222) with a precision reference resistor (4530 Ohm +/-0.1%) to measure resistance. The sigma-delta ADC converts the voltage drop across the RTD element. Internal linearization follows IEC/EN 60751.
Measurement range: -200 to 850C for both Pt100 and Pt1000. The resistance measurement range is 0.1 to 4500 Ohm (gain=1) or 0.05 to 2250 Ohm (gain=2).
Key RTD specifications (X20AT2222):
- Max. error at 25C: Gain 0.037%, Offset 0.0015%
- Gain drift: 0.004%/C
- Offset drift: 0.00015%/C
- Non-linearity: <0.0010%
- Crosstalk between channels: <-93 dB
- Common-mode rejection: DC >95 dB, 50 Hz >80 dB
1.5 Universal/Multi-Signal Modules
The X20AI8039 is the most versatile analog input module, offering 8 configurable channels where each channel can independently be set to:
- +/-10V voltage
- 0-20 mA / 4-20 mA current
- Pt100 / Pt1000 (2- or 3-wire)
- ICTD measurement (integrated circuit temperature diode)
This makes it ideal for mixed-signal applications where temperature and process signals coexist on the same I/O node.
1.6 Strain Gauge / Load Cell Inputs
For precision measurement applications, B&R offers:
- X20AI1744 (1 channel) and X20AIA744 (2 channels): Full-bridge strain gauge inputs, 24-bit resolution, 5 kHz input filter
- X20AIB744 (4 channels): Full-bridge strain gauge inputs, 24-bit resolution, 2.5 kHz input filter
These support both 4-wire and 6-wire load cell connections, with internal compensation for lead wire resistance.
1.7 Specialty Modules
- X20AP3111/3121/3131/3161/3171: Energy metering modules with 3 analog voltage inputs (up to 480 VAC) and 4 analog current inputs (20 mA / 1 A / 5 A / Rogowski), calculating RMS values, active/reactive/apparent power and energy.
- X20CM4800X: Vibration measurement module with configurable sampling rate of 200 to 50,000 samples/second and 4 input channels.
- X20RT8201/8381/8401: reACTION Technology modules with 500 kHz sampling frequency, 13-bit resolution analog inputs for ultra-fast control loops.
- X20SA4430: Safe analog current input module (2x2 type A), 0.5 to 25 mA, individually galvanically isolated channels for safety-related applications.
2. Signal Conditioning Circuits on B&R Analog Modules
2.1 Input Stage Architecture
B&R analog input modules follow a consistent front-end architecture:
Terminal Block (field wiring)
|
v
Input Protection (PTC, clamping diodes)
|
v
Multiplexer / Analog Switch (channel selection)
|
v
Signal Conditioning
|-- Voltage mode: Buffer amplifier (high-Z input, 20 MOhm)
|-- Current mode: Precision shunt resistor + instrumentation amplifier
|-- TC mode: Low-drift amplifier with high CMRR
|-- RTD mode: Constant current source + differential amplifier
|
v
Anti-Aliasing Filter (3rd-order low-pass, 500 Hz - 1 kHz)
|
v
ADC (SAR for V/I, Sigma-Delta for TC/RTD)
|
v
Digital Filter (configurable first-order or third-order)
|
v
Linearization / Calibration Coefficients
|
v
Output Register (INT/DINT format)
2.2 Voltage Signal Conditioning
For voltage inputs, the conditioning chain consists of:
- High-impedance buffer amplifier (20 MOhm input impedance) prevents loading the signal source
- Third-order low-pass anti-aliasing filter with 1 kHz cutoff frequency (on X20AI4622)
- SAR ADC performs the digitization
- Digital output filter provides additional configurable smoothing (see Section 12)
The input circuit includes PTC thermistors and protection circuitry to guard against miswiring (connection to supply voltage up to +/-30V).
2.3 Current Signal Conditioning
Current measurement uses an internal shunt resistor topology:
AI+ (current in) --> [PTC] --> [Shunt Resistor < 400 Ohm] --> [GND reference]
|
[Amp to ADC]
The switch between voltage and current measurement is implemented via an integrated analog switch inside the module, automatically activated based on:
- Which terminal is used (U terminals for voltage, I terminals for current)
- The channel type configuration register setting
2.4 Thermocouple Signal Conditioning
Thermocouple modules use a significantly different architecture:
TC+ / TC- terminals
|
v
Multiplexer (channels 1-6)
|
v
Low-noise instrumentation amplifier (high CMRR >70 dB)
|
v
Sigma-Delta ADC (16-bit)
|
v
Digital filter (first-order low-pass, 500 Hz cutoff)
|
v
Linearization (polynomial approximation per TC type to EN 60584)
|
v
Cold Junction Compensation (internal PT1000 sensor)
|
v
Temperature output (C)
Key features of the TC conditioning chain:
- Common-mode range: +/-15V (accommodates the high common-mode voltages that thermocouples may pick up)
- Permissible input signal: Max +/-5V
- Common-mode rejection: DC >70 dB, 50 Hz >70 dB (critical for rejecting ground-loop noise in TC wiring)
2.5 RTD Signal Conditioning
RTD measurement on the X20AT2222 uses constant-current excitation:
RTD+ terminal
|
v
[Constant Current Source: 250 uA]
|
v
[RTD Sensor element]
|
v
[3-wire compensation network]
|
v
[Reference Resistor: 4530 Ohm]
|
v
[Sigma-Delta ADC]
|
v
[IEC/EN 60751 Linearization]
|
v
Temperature output
The 3-wire measurement compensates for lead wire resistance by measuring the voltage drop on the sense leads and subtracting the lead resistance from the total measured resistance.
2.6 Galvanic Isolation
B&R offers modules with different isolation levels:
| Isolation Type | Example Modules | Isolation Voltage |
|---|---|---|
| Channel to Bus (all modules) | X20AI4622, X20AT6402 | 500 Veff |
| Channel to Channel (none in standard) | – | – |
| Per-Channel Isolated | X20AI2237, X20AI2437, X20AI2438 | Channel isolated from bus |
| Safety-Rated Isolated | X20SA4430 | Individual galvanic isolation per channel |
Standard X20 analog modules isolate all channels from the bus (500 Veff) but not from each other. For applications requiring channel-to-channel isolation, the galvanically isolated variants (X20AI2237 for voltage, X20AI2437/2438 for current) provide this with independent sensor power supplies per channel.
3. Calibration Procedures for Analog Inputs and Outputs
3.1 Factory Calibration
B&R analog modules are factory-calibrated at the B&R facility in Eggelsberg, Austria. The calibration is performed using traceable reference standards, and the calibration coefficients are stored in the module’s internal firmware.
Key points about B&R factory calibration:
- Each module is individually calibrated; calibration data is stored in the module’s internal memory
- No user-accessible calibration trim pots exist on the modules (calibration is digital)
- Modules ship with a Certificate of Conformance confirming they meet published specifications
- Factory calibration covers gain error, offset error, and linearity within the published specifications
3.2 Verification Procedure for Analog Inputs
To verify the accuracy of a B&R analog input module in the field:
Equipment required:
- Calibrated multi-function process calibrator (e.g., Fluke 789, Beamex MC6)
- Calibrated precision multimeter (for cross-checking)
- Test leads and appropriate terminations
Procedure for voltage inputs (e.g., X20AI4632):
- Disconnect field wiring from the channel to be tested
- Configure the channel for the appropriate voltage range via Automation Studio
- Set the process calibrator to output 0.000V
- Apply the signal to the AI+/AI- terminals
- Read the value in Automation Studio (mapp View, online values in PLC program, or via the oscilloscope function on X20AI4632)
- Record the reading and compare to the expected value (should be near 0)
- Repeat at 25%, 50%, 75%, and 100% of the range (+/-2.5V, +/-5.0V, +/-7.5V, +/-10V)
- Calculate the error at each point as: Error (%) = [(Reading - Applied) / Full Scale] * 100
Acceptance criteria (X20AI4622, 13-bit, at 25C):
- Gain error: < 0.08% of measured value
- Offset error: < 0.015% of 20V range
- Non-linearity: < 0.025% of 20V range
Procedure for current inputs (e.g., X20AI4622):
- Configure the channel for 4-20 mA mode
- Apply 4.000 mA from the calibrator in series with the input
- The reading should be near 0 (4 mA = 0 in 4-20 mA scaled mode)
- Step through 8 mA, 12 mA, 16 mA, and 20 mA
- Record readings and calculate error at each point
Acceptance criteria for 4-20 mA (X20AI4622):
- Gain error: < 0.1% of measured value
- Offset error: < 0.0375% of 20 mA range
3.3 Verification Procedure for Analog Outputs
Procedure for X20AO4622 (4 channels, +/-10V or 0-20 mA):
- Disconnect field wiring from the channel to be tested
- Connect the calibrated multimeter across AO+/AO-
- Configure the channel for the appropriate range
- Write known values to the output register in Automation Studio
- Measure the actual output voltage/current
- Compare measured vs. commanded values
Acceptance criteria (X20AO4622 at 25C):
- Voltage gain error: < 0.08% of measured value
- Voltage offset error: < 0.05% of full range
- Current gain error: < 0.09% of measured value
- Current offset error: < 0.05% of full range
- Non-linearity: < 0.007% (voltage), < 0.005% (current)
3.4 Verification Procedure for Temperature Inputs
Thermocouple module (X20AT6402):
- Disconnect the field thermocouple
- Connect a thermocouple calibrator (cold-junction compensated) to the TC+/TC- terminals
- Set the sensor type in the module configuration (e.g., Type K)
- Set the calibrator to 0.0C and observe the module reading
- Step through temperature points (e.g., 100C, 250C, 500C, 1000C)
- Verify readings are within specifications
Acceptance criteria (X20AT6402 at 25C):
- Gain error: +/-0.06%
- Type K offset error: +/-0.05%
- Non-linearity: +/-0.001%
RTD module (X20AT2222):
- Disconnect the field RTD
- Connect a precision decade resistance box (or RTD calibrator)
- Configure the channel for Pt100 (IEC 60751)
- Apply resistance values corresponding to known temperatures (e.g., 100 Ohm = 0C, 138.5 Ohm = 100C, 214.6 Ohm = 300C)
- Compare the module reading to the expected temperature
Acceptance criteria (X20AT2222 at 25C):
- Gain error: 0.037% of current resistance value
- Offset error: 0.0015% of full resistance range
- Non-linearity: <0.0010%
3.5 Software-Based Calibration Correction
Since B&R modules do not have user-accessible trim adjustments, calibration correction (if needed beyond factory accuracy) must be performed in software:
Two-point calibration in Automation Studio (ST language):
FUNCTION AnalogCalibrate : LREAL
VAR_INPUT
RawValue : INT;
CalLow : INT; (* Raw reading at zero/low calibration point *)
CalHigh : INT; (* Raw reading at span/high calibration point *)
ScaleLow : LREAL; (* Engineering units at low point *)
ScaleHigh : LREAL; (* Engineering units at high point *)
END_VAR
AnalogCalibrate := ScaleLow + (TO_LREAL(RawValue - CalLow) / TO_LREAL(CalHigh - CalLow)) * (ScaleHigh - ScaleLow);
mapp components: B&R’s mapp Control technology provides built-in scaling and linearization function blocks that can incorporate calibration offsets directly.
3.6 Recalibration and Repair
B&R modules that drift beyond specification should be returned to B&R for recalibration or repair through the B&R Support Portal or Material Return Portal. B&R offers repair services at their facilities with recalibration using traceable standards.
4. Offset/Gain Adjustment Methods
4.1 Understanding Offset and Gain Errors
In ADC systems, two fundamental errors affect measurement accuracy:
-
Offset error: A constant shift in the reading, present even when the input is zero. On B&R modules, offset is specified at 25C (e.g., X20AI4622 voltage offset: 0.015% of 20V range = 3 mV).
-
Gain error: The slope of the transfer function deviates from the ideal. A reading at full scale will be proportionally incorrect (e.g., X20AI4622 voltage gain error: 0.08% of measured value).
-
Linearity error: The transfer function is not perfectly straight between the calibrated endpoints. B&R specifies this separately (e.g., <0.025% for voltage on the X20AI4622).
4.2 Temperature Drift
Both offset and gain errors drift with temperature. B&R specifies maximum drift coefficients:
| Parameter | X20AI4622 (Voltage) | X20AI4622 (Current 4-20mA) | X20AT6402 (TC) | X20AT2222 (RTD) |
|---|---|---|---|---|
| Gain drift | 0.006%/C | 0.0113%/C | +/-0.01%/C | 0.004%/C |
| Offset drift | 0.002%/C | 0.005%/C | +/-0.0024%/C (Type K) | 0.00015%/C |
| Non-linearity | <0.025% | <0.05% | +/-0.001% | <0.001% |
Practical impact: For a X20AI4622 measuring +/-10V, operating in a 30C range (e.g., 10C to 40C ambient), the worst-case gain drift is:
- 0.006%/C * 30C * 20V range = 0.036V = 36 mV
This is larger than the 1 LSB resolution (2.441 mV), demonstrating why temperature control in the cabinet matters for precision applications.
4.3 Software Offset/Gain Compensation
Since B&R modules have no hardware trim adjustments, compensation is done in software:
Method 1: Two-Point Calibration (offset + gain correction)
Apply two known reference signals and compute correction factors:
Apply ZERO reference -> Read RawZero
Apply SPAN reference -> Read RawSpan
CorrectedValue = (RawValue - RawZero) * (SpanReference / (RawSpan - RawZero)) + ZeroReference
Method 2: Single-Point Offset Correction
For applications where gain error is acceptable but offset drift needs correction:
Apply ZERO reference -> Read RawZero
CorrectedValue = RawValue - RawZero
Method 3: mapp Scaling Function Blocks
Use B&R’s mapp Control components (AsCal, AsScale) which provide integrated scaling with offset and gain parameters configurable through Automation Studio.
4.4 Using the Oscilloscope Function for Calibration
The X20AI4632 and X20AI4636 modules feature built-in oscilloscope functions that allow real-time visualization of analog signals directly in Automation Studio. This is useful during calibration to:
- Observe signal stability and noise levels
- Verify filter performance
- Detect oscillations or interference
- Capture transients that may affect calibration accuracy
4.5 Oversampling for Improved Resolution (X20AI4636)
The X20AI4636 supports oversampling functions, where multiple ADC conversions are averaged to effectively increase resolution and reduce noise:
- Oversampling ratio is configurable
- Effective resolution improvement follows: N_additional_bits = log2(oversampling_ratio) / 2
- 4x oversampling yields approximately 1 additional bit of resolution
- Trade-off: increased conversion time
5. Noise and Grounding Issues as Analog Reading Errors
5.1 How Noise Manifests in Analog Readings
Noise on B&R analog inputs appears in several characteristic patterns:
| Symptom | Likely Cause | Diagnostic Approach |
|---|---|---|
| Random fluctuations of 1-5 LSB | Broadband EMI, digital crosstalk | Use oscilloscope function (X20AI4632) or monitor raw values |
| 50/60 Hz periodic ripple | Power line coupling, ground loops | FFT analysis; check shield grounding |
| Sudden spikes followed by recovery | Motor starting, relay switching | Correlate with plant events |
| All channels drift together | Temperature change affecting module | Monitor CompensationTemperature register (TC modules) |
| Single channel noisy, others stable | Sensor or wiring issue for that channel | Swap sensors between channels to isolate |
| Offset changes over time | Ground potential shifts, corrosion | Measure ground potential difference |
5.2 Noise Sources in B&R X20 Systems
External noise sources:
- Variable frequency drives (VFDs) and motor inverters
- Switching power supplies
- Relay and contactor switching
- Radio frequency interference (RFI) from wireless devices
- Welding equipment
- Power line harmonics
Internal noise sources:
- X2X Link communication (between bus modules)
- Digital I/O switching on adjacent modules
- Power supply ripple on the internal I/O supply
- ADC quantization noise
5.3 Crosstalk Between Channels
B&R specifies crosstalk between channels:
- X20AI4622 (V/I): <-70 dB
- X20AT6402 (TC): <-70 dB
- X20AT2222 (RTD): <-93 dB
At -70 dB crosstalk, a 10V signal on one channel can induce up to approximately 3.16 mV on an adjacent channel (which is about 1 LSB on a 13-bit module). For high-precision applications, this is significant and requires careful signal routing and filtering.
5.4 Common-Mode Rejection
Common-mode noise (noise that appears equally on both input terminals) is rejected by the differential input architecture:
| Module | CMRR (DC) | CMRR (50 Hz) | Common-Mode Range |
|---|---|---|---|
| X20AI4622 | 70 dB | 70 dB | +/-12V |
| X20AT6402 | >70 dB | >70 dB | +/-15V |
| X20AT2222 | >95 dB | >80 dB | >0.7V |
70 dB CMRR means that 1V of common-mode noise is reduced to approximately 316 uV at the ADC input. For the RTD module (X20AT2222) with 95 dB CMRR at DC, 1V of common-mode noise is reduced to approximately 18 uV.
5.5 Ground Loops
Ground loops occur when there are multiple ground paths between the sensor and the I/O module, creating a current loop that introduces offset errors and noise:
Sensor Ground --> [Sensor Cable] --> AI- terminal
| |
+------ [Earth Ground Path] -------> [Module Ground]
The resulting loop current flows through the cable shield or signal ground and creates voltage drops that appear as measurement error. A 10 mA ground loop current through a 1 Ohm ground path creates 10 mV of error, which exceeds the 0.015% offset specification of the X20AI4622.
Solutions:
- Single-point shield grounding (see Section 13)
- Use galvanically isolated modules (X20AI2237, X20AI2437) which break the ground loop path
- Isolation amplifiers or signal conditioners at the sensor
- Star-point grounding in the panel
6. Distinguishing Sensor Faults from IO Card Faults
6.1 Systematic Fault Isolation Approach
When an analog reading is incorrect, follow this systematic approach to isolate the fault:
Step 1: Check module diagnostics
B&R analog modules provide real-time diagnostics via:
- LED indicators: Per-channel green LEDs (solid = OK, blinking = overflow/underflow/open), module status LEDs (green = RUN, red = error)
- Status registers:
StatusInput01andStatusInput02registers report per-channel status bits
Status bit interpretation for X20AI4622:
| Bits | Meaning |
|---|---|
| 00 | No error |
| 01 | Lower limit value undershot |
| 10 | Upper limit value overshot |
| 11 | Open circuit (voltage mode only) |
For thermocouple modules (X20AT6402), additional status bits indicate:
- Open circuit (wire break detection)
- Range overshoot/undershoot
- General fault
Step 2: Swap channels
Move the sensor to a different channel on the same module:
- If the error follows the sensor –> sensor or wiring fault
- If the error stays on the original channel –> IO card fault
Step 3: Apply known reference signal
Disconnect the sensor and apply a precision reference:
- Voltage: Use a calibrated voltage source
- Current: Use a calibrated current source (4-20 mA calibrator)
- Thermocouple: Use a TC simulator with cold junction compensation
- RTD: Use a precision decade resistance box
If the module reads the reference correctly, the fault is in the sensor or field wiring.
Step 4: Cross-check with another module
If a spare analog channel or module is available, connect the sensor to it:
- Confirms whether the original module has degraded
6.2 Common Sensor Faults and Symptoms
| Sensor Type | Fault Mode | Symptom on B&R Module |
|---|---|---|
| Voltage transmitter | Output drift | Reading shifts gradually over time; status bits normal |
| Current transmitter | Power supply failure | Reading drops to 0 or shows open circuit; status bit = open circuit |
| Thermocouple | Wire break | Reading jumps to +32767 (0x7FFF); status bit = open circuit |
| Thermocouple | Degraded junction | Reading offset by fixed amount at all temperatures |
| RTD (Pt100) | Wire break | Reading jumps to +32767 (0x7FFF); status bit = open line |
| RTD | Short circuit | Reading drops to minimum or shows unexpected value |
| RTD | Lead wire corrosion | Measurement offset proportional to temperature (3-wire doesn’t fully compensate) |
6.3 Common IO Card Faults and Symptoms
| Fault Mode | Symptom | Diagnostic |
|---|---|---|
| ADC channel degradation | All readings on one channel offset; other channels correct | Swap sensor to confirm; fails calibration verification |
| Reference voltage drift | All channels on module drift together | Check if error is consistent across channels |
| Input filter failure | Excessive noise on one or all channels | Compare noise levels across channels |
| Multiplexer fault | Readings cross-contaminated between channels | Apply signal to one channel; observe others |
| Isolation breakdown | Offset changes with common-mode voltage | Vary sensor ground potential and observe reading |
| Firmware corruption | Invalid values, status bits erratic | Module LED shows error; invalid firmware indication |
6.4 Using B&R Diagnostic Tools
B&R provides several diagnostic tools:
- Automation Studio Diagnostics: Real-time I/O value monitoring, status register inspection
- Oscilloscope function (X20AI4632): Visualize raw analog waveforms to detect noise, oscillations
- mapp AlarmX: Configure alarms based on analog status bits (open circuit, limit violations)
- mapp View: Create HMI screens showing real-time status with color-coded health indicators
- Web browser diagnostics: Many B&R controllers expose diagnostic web pages for remote monitoring
7. Resolution and Accuracy Specifications
7.1 Understanding Resolution vs. Accuracy
Resolution is the smallest change in the analog input that can be represented in the digital output. It is determined by the ADC bit depth.
Accuracy is the combined effect of all errors (gain, offset, non-linearity, noise, drift) and describes how close the reading is to the true value. Accuracy is always worse than resolution.
7.2 Resolution by Module Type
| Module Family | ADC Resolution | Effective Resolution | LSB Size (Voltage) | LSB Size (Current) |
|---|---|---|---|---|
| 13-bit (incl. sign) | 12-bit + sign = 13-bit | 12-bit | 2.441 mV (20V range) | 4.883 uA (20 mA range) |
| 16-bit | 16-bit | 16-bit | 0.305 mV (20V range) | 0.305 uA (20 mA range) |
| 24-bit (strain gauge) | 24-bit | ~20-22 effective | Sub-uV | N/A |
| 16-bit (thermocouple) | 16-bit | 0.1C or 0.01C | 1 uV or 2 uV raw | N/A |
| 16-bit (RTD) | 16-bit | 0.1C | 0.1 Ohm (Pt100) | N/A |
7.3 Accuracy Summary
Voltage measurement accuracy (25C):
| Module | Gain Error | Offset Error | Non-linearity | Total (approx.) |
|---|---|---|---|---|
| X20AI4622 (13-bit) | 0.08% | 0.015% | <0.025% | ~0.12% FS |
| X20AI4632 (16-bit) | ~0.1% | ~0.02% | ~0.02% | ~0.14% FS |
Current measurement accuracy (25C):
| Module | Gain Error (0-20 mA) | Gain Error (4-20 mA) | Offset Error |
|---|---|---|---|
| X20AI4622 (13-bit) | 0.08% | 0.1% | 0.0375% |
| X20AI4632 (16-bit) | ~0.08% | ~0.08% | ~0.03% |
Thermocouple accuracy (25C, X20AT6402):
| TC Type | Gain Error | Offset Error | Temperature Error at 500C |
|---|---|---|---|
| Type K | +/-0.06% | +/-0.05% | ~ +/-0.55C |
| Type J | +/-0.06% | +/-0.04% | ~ +/-0.50C |
| Type S | +/-0.06% | +/-0.11% | ~ +/-0.85C |
| Type B | +/-0.06% | +/-0.13% | ~ +/-0.95C |
RTD accuracy (25C, X20AT2222):
| Parameter | Value |
|---|---|
| Gain error | 0.037% of resistance value |
| Offset error | 0.0015% of range |
| Non-linearity | <0.001% |
| Temperature error at 100C | ~ +/-0.1C |
7.4 Total Error Budget
When calculating total measurement uncertainty, combine all error sources:
- Module errors (gain, offset, linearity) – from datasheet
- Temperature drift errors – calculated from drift coefficients and operating temperature range
- Sensor errors – from sensor datasheet (e.g., Class A Pt100: +/-0.15C + 0.002*|t|)
- Lead wire errors – for RTD, uncompensated lead resistance
- Noise and resolution – typically 1-2 LSB
- Calibration reference uncertainty – uncertainty of the calibration standard
Example total error calculation for Pt100 at 300C on X20AT2222:
- Module gain: 0.037% of 212.05 Ohm = 0.078 Ohm = 0.2C
- Module offset: 0.0015% of range = negligible
- Sensor (Class A): +/-0.15C + 0.002*300 = +/-0.75C
- Module non-linearity: <0.001% = negligible
- Total (RSS): sqrt(0.2^2 + 0.75^2) = +/-0.78C
7.5 Accuracy Over Temperature
The derating curves in B&R datasheets specify how accuracy degrades at elevated temperatures. For example, the X20AO4622 shows reduced permissible load at temperatures above 50C (horizontal mounting) due to increased power dissipation in the output stage.
For the X20AI4622 operating between 0C and 55C:
- Worst-case gain drift from 25C reference: 0.006%/C * 30C = 0.18%
- Worst-case offset drift from 25C reference: 0.002%/C * 30C = 0.06%
8. Sampling Rate and Aliasing Considerations
8.1 Sampling Architecture
B&R analog input modules use two different sampling approaches:
Standard modules (X20AI4622, X20AI4632):
- SAR ADC with fixed conversion time per channel
- X20AI4622: 400 us conversion for all 4 inputs (channels sampled sequentially, 200 us offset between channels)
- Conversion is asynchronous to the network cycle
- Update rate is determined by bus cycle time (minimum 100 us without filter, 500 us with filter)
- Minimum I/O update: 300 us (no filter), 1 ms (with filter)
Thermocouple/RTD modules (X20AT6402, X20AT2222):
- Sigma-delta ADC with configurable filter time
- All enabled channels are converted during each conversion cycle
- Conversion time depends on filter setting and number of channels
- Example: X20AT6402 with 50 Hz filter, 6 channels = 281.4 ms total update
8.2 High-Speed Modules
| Module | Max Sampling Rate | ADC Type | Notes |
|---|---|---|---|
| X20RT8201 | 500 kHz (2 channels) | SAR, 13-bit | reACTION Technology |
| X20RT8381 | 500 kHz (2 AI + 1 AO) | SAR, 13-bit | reACTION Technology |
| X20CM4800X | 200-50,000 samples/s | Configurable | Vibration measurement |
| X20AI4636 | Standard + oversampling | SAR, 16-bit | Oversampling improves SNR |
| X20AI4632 | Standard + oscilloscope | SAR, 16-bit | Oscilloscope capture mode |
8.3 Anti-Aliasing Filters
All B&R analog input modules include hardware anti-aliasing filters before the ADC:
| Module Type | Filter Order | Cutoff Frequency |
|---|---|---|
| X20AI4622 (V/I) | 3rd-order low-pass | 1 kHz |
| X20AT6402 (TC) | 1st-order low-pass | 500 Hz |
| X20AT2222 (RTD) | 1st-order low-pass | 500 Hz |
| X20AO4622 (Output) | 1st-order low-pass | 10 kHz |
The hardware filter attenuates frequencies above the cutoff, preventing aliasing. For the standard 13-bit modules, the 1 kHz third-order filter provides approximately -18 dB/octave rolloff, which combined with the effective sampling rate (minimum 2.5 kHz for 400 us conversion), ensures adequate anti-aliasing for most industrial process signals.
8.4 Nyquist Considerations
For standard process control (voltage/current, 400 us conversion):
- Effective sampling rate: ~2,500 samples/s per module (all 4 channels within 400 us)
- Nyquist frequency: ~1,250 Hz
- With 1 kHz hardware filter: signals up to ~500 Hz are accurately captured
- Sufficient for virtually all process control applications
For thermocouple measurement (50 Hz filter):
- Effective sampling rate: 1 channel = 80.4 ms = ~12.4 samples/s
- Nyquist frequency: ~6.2 Hz
- Temperature signals typically change at <1 Hz, so this is adequate
For vibration monitoring (X20CM4800X):
- Configurable 200-50,000 samples/s
- Anti-aliasing must be considered: with 50,000 samples/s, Nyquist = 25,000 Hz
- External anti-aliasing filters may be needed if measuring signals above 10 kHz
- Standard practice: use at least 2.56x oversampling relative to the highest frequency of interest
8.5 Practical Aliasing Mitigation
- Use the built-in digital filter to reject high-frequency noise (see Section 12)
- Ensure analog signals are bandwidth-limited before reaching the module (shielded cable acts as a low-pass filter for long runs)
- For the X20CM4800X vibration module: configure the sampling rate at least 2.56x the maximum frequency of interest
- Apply input ramp limiting (X20AI4622) to suppress transient spikes that could alias
9. Cold Junction Compensation for Thermocouple Inputs
9.1 Principle of Cold Junction Compensation
Thermocouples generate a voltage proportional to the temperature difference between the measurement junction (hot) and the reference junction (cold), where the thermocouple wires connect to the copper terminals of the IO module. To determine the absolute temperature at the measurement point, the temperature of the reference junction (the terminal block) must be known and added to the measured temperature difference.
B&R thermocouple modules (X20AT2402, X20AT6402) implement cold junction compensation (CJC) using an integrated PT1000 sensor mounted on the terminal block. The module measures the terminal temperature and applies the correction internally.
9.2 Internal Cold Junction Compensation
How it works on X20AT6402:
- The internal PT1000 sensor measures the terminal block temperature
- This value is available in the
CompensationTemperatureregister (-250 to +850, representing -25.0 to +85.0C) - During each conversion cycle, the module:
- Converts all enabled TC channels
- Measures the terminal temperature (one extra conversion in Function Model 0)
- Applies the polynomial correction for the TC type (per EN 60584)
- Adds the cold junction temperature correction
- Outputs the linearized temperature value
Conversion time impact:
- Function Model 0 (internal CJC): (n+1) conversions per cycle (n TC channels + 1 terminal temperature)
- Function Model 1 (external CJC): n conversions per cycle (terminal temperature measurement skipped)
9.3 Cold Junction Compensation Accuracy
The CJC precision depends on thermal conditions:
| Condition | CJC Precision (stabilized) |
|---|---|
| Natural convection | +/-2C after 10 minutes |
| Artificial convection (fan) | +/-4C after 10 minutes |
Factors affecting CJC accuracy:
- Self-heating: Other modules on the same X2X Link dissipating heat onto the TC module
- Air currents: Fans or forced ventilation create temperature gradients across the terminal block
- Ambient temperature fluctuations: Rapid changes in cabinet temperature cause lag in the CJC sensor
- Module power dissipation: The X20AT6402 itself consumes 0.91 W (internal I/O)
9.4 Configuring Ambient Conditions
The X20AT6402 provides an “Ambient Conditions” configuration register to adapt the internal CJC thermal model:
| Value | Ambient Condition |
|---|---|
| 0000 | Default (no calculation for adjustment) |
| 0001 | Power dissipation <0.2 W (neighboring modules) |
| 0010 | Power dissipation <1 W (neighboring modules) |
| 0011 | Power dissipation >1 W (neighboring modules) |
How to configure: Check the power consumption of the modules immediately adjacent to the X20AT6402 on the X2X Link (from their datasheets). Use the higher value for the setting.
9.5 External Cold Junction Compensation
For improved accuracy or for long thermocouple cable runs, B&R supports external cold junction compensation:
When to use external CJC:
- Large distances between the controller and measurement point (copper extension wires from external junction to module)
- Adjacent high-power modules (>1 W) are connected to the same X2X Link
- Fluctuating ambient conditions (drafts, temperature cycling)
- No other modules connected near the TC module
Implementation (using X20AT6402 + X20AT4222):
Measurement Point
|
v
[Thermocouple]
|
v
External Cold Junction (copper wire extension)
|
+--> [X20AT4222 RTD module] measures cold junction temperature
| |
| v
| Register: ExternalCompensationTemperature
|
v
[X20AT6402 TC module] uses ExternalCompensationTemperature
|
v
Corrected temperature output
Configuration:
- Select Function Model 1 on the X20AT6402 (External Cold Junction Temperature)
- Measure the cold junction temperature with a separate RTD module (e.g., X20AT4222 with a Pt100 sensor)
- Write the cold junction temperature to the
ExternalCompensationTemperatureregister of the X20AT6402 - The X20AT6402 will use this value for all channel corrections
9.6 Recommended Wiring for Thermocouples
B&R recommends connecting the minus input of the thermocouple to the minus input of the power supply module (e.g., X20PS2100) to prevent measurement errors from ripple voltage effects:
[Power Supply X20PS2100]
|-
|
v
[X20AT6402]
TC1- --> Connected to PS minus input
TC2- --> Connected to PS minus input
TC3-
...
10. 3-Wire and 4-Wire RTD Measurement
10.1 RTD Wiring Configurations
2-Wire Connection: The simplest but least accurate method. Both the current source and voltage measurement share the same lead wires, so lead wire resistance adds directly to the measured RTD resistance.
Module RTD
I+ -------- Lead Wire A --------+
RTD Element
I- -------- Lead Wire B --------+
Error = 2 * R_lead. For 10m of 0.5 Ohm/m cable: error = 10 Ohm = ~26C for Pt100.
3-Wire Connection (B&R X20AT2222, X20AI8039): The most common industrial configuration. Two wires carry the excitation current, and the third wire provides a sense connection. If all three wires have equal resistance, the lead resistance cancels out.
Module RTD
I+ -------- Lead Wire A --------+
RTD Element
Sense ----- Lead Wire B --------+
RTD Element (continued)
I- -------- Lead Wire C --------+
The module measures:
- V1 = V across (RTD + 2 * R_lead) [using I+ and I-]
- V2 = V across (RTD + R_lead) [using Sense and I-]
- RTD_resistance = V2 - (V1 - V2) = 2*V2 - V1 (assuming equal lead resistances)
Residual error = R_lead_A - R_lead_C (difference in lead wire resistance). For matched wires: negligible.
4-Wire Connection: The most accurate method, using separate pairs for current excitation and voltage sensing. No lead resistance error.
Module RTD
I+ -------- Lead Wire A --------+
RTD Element
I- -------- Lead Wire B --------+
V+ -------- Lead Wire C --------+
RTD Element (continued)
V- -------- Lead Wire D --------+
Error = 0 (lead resistance fully eliminated). This is used in laboratory and calibration applications.
10.2 B&R Module RTD Wiring Support
| Module | 2-Wire | 3-Wire | 4-Wire | Notes |
|---|---|---|---|---|
| X20AT2222 | Yes | Yes | No | Dedicated RTD module, 2 channels |
| X20AI8039 | Yes | Yes | No | Universal module, 8 configurable channels |
Note: B&R X20 RTD modules do not natively support 4-wire RTD connections. For 4-wire measurement, a dedicated 4-wire RTD transmitter or signal conditioner can be used to convert to a 4-20 mA signal, which is then connected to a B&R current input module (e.g., X20AI2437).
10.3 RTD Measurement Parameters (X20AT2222)
| Parameter | Value |
|---|---|
| Measurement method | Constant current excitation |
| Excitation current | 250 uA +/-1.25% |
| Reference resistor | 4530 Ohm +/-0.1% |
| Resistance range (G=1) | 0.1 to 4500 Ohm |
| Resistance range (G=2) | 0.05 to 2250 Ohm |
| Resolution (Pt100) | 1 LSB = 0.1C |
| Resolution (Pt1000) | 1 LSB = 0.1C |
| Sensor standard | IEC/EN 60751 |
| Conversion procedure | Sigma-Delta |
| Filter time | Configurable 1 ms to 66.7 ms |
10.4 Conversion Time for RTD
| Channels | Filter Setting | Total Conversion Time |
|---|---|---|
| 1 | 50 Hz (20 ms) | 20 ms (Function Model 1) or 40.2 ms (Model 0) |
| 2 | 50 Hz (20 ms) | 80 ms (Function Model 0) |
With 2 channels and 50 Hz filter, the update rate is 12.5 Hz, which is more than sufficient for temperature process control.
10.5 Self-Heating Considerations
The 250 uA excitation current causes self-heating in the RTD element. For a Pt100 sensor:
- At 100C: R = 138.5 Ohm
- Power dissipation: I^2 * R = (250e-6)^2 * 138.5 = 8.66 uW
This is negligible for most industrial Pt100 sensors in typical mounting configurations (sensor element to sheath thermal resistance is much larger than this would heat).
For Pt1000 sensors (10x the resistance), self-heating is 10x higher (~86.6 uW), still negligible.
11. Current Loop (4-20 mA) Diagnostics
11.1 Current Loop Fundamentals on B&R Modules
The 4-20 mA current loop provides inherent diagnostic capabilities because:
- 4 mA = live zero (scale minimum): any reading below 4 mA indicates a problem
- 0 mA = broken wire or no power: definitive open circuit
- >20 mA = over-range: sensor fault or incorrect calibration
B&R modules leverage this by monitoring the input against configurable limits.
11.2 Open Circuit Detection
B&R analog modules detect open circuits differently depending on the signal type:
Voltage mode (X20AI4622):
- Open circuit detection is supported via the status register
- When the input is disconnected, the high-impedance input floats to an undefined voltage
- The module detects this and sets the status bit to “Open circuit”
- The analog value is frozen at +32767 (0x7FFF)
- Per-channel green LED turns off (no green = no signal)
Current mode (X20AI4622):
- Open circuit detection is based on limit monitoring
- When the current loop is broken, the current drops to 0 mA
- For 4-20 mA configuration: values <4 mA can be detected by setting the lower limit to 0 mA (corresponding to INT value -8192)
- The status bit shows “Lower limit value undershot”
B&R recommended configuration for 4-20 mA open circuit detection:
- Set the channel type to “4 to 20 mA current signal”
- Set the lower limit value register to -8192 (corresponding to 0 mA)
- Monitor the StatusInput register for the “Lower limit value undershot” bit
11.3 Short Circuit Detection
On analog inputs:
- A short circuit on a voltage input results in 0V reading
- A short circuit on a current input may cause the current to exceed 20 mA (if the transmitter is not current-limited)
- B&R modules tolerate up to +/-50 mA on current inputs without damage (input protection)
- The upper limit monitoring detects readings above 20 mA
On analog outputs (X20AO4622):
- Outputs are short-circuit proof with current limiting at +/-40 mA
- This protects both the module and the field wiring
- A short circuit on a current output will not damage the module
11.4 Diagnostic Status Values
When monitoring detects a fault, B&R modules freeze the analog value at defined error codes:
| Error Condition | Digital Value (X20AI4622) |
|---|---|
| Open circuit | +32767 (0x7FFF) |
| Upper limit exceeded | +32767 (0x7FFF) |
| Lower limit undershot | -32767 (0x8001) |
| Invalid value | -32768 (0x8000) |
For thermocouple modules (X20AT6402):
| Error Condition | Value (0.1C) | Value (0.01C) |
|---|---|---|
| Open circuit | +32767 (0x7FFF) | +2,147,483,647 |
| Range overshoot | +32767 (0x7FFF) | +2,147,483,647 |
| Range undershoot | -32767 (0x8001) | -2,147,483,647 |
| Invalid value | -32768 (0x8000) | -2,147,483,648 |
11.5 Implementing Current Loop Diagnostics in Software
Example ST implementation for 4-20 mA channel monitoring:
FUNCTION CheckCurrentLoop : BOOL
VAR_INPUT
RawValue : INT;
Status : USINT;
Channel : USINT;
END_VAR
VAR
ChStatus : USINT;
Shift : USINT;
BEGIN
Shift := Channel * 2;
ChStatus := SHR(Status, Shift) AND 16#03;
CASE ChStatus OF
0: (* No error - normal operation *)
CheckCurrentLoop := FALSE;
1: (* Lower limit undershot - possible open circuit *)
CheckCurrentLoop := TRUE;
2: (* Upper limit exceeded - possible short or over-range *)
CheckCurrentLoop := TRUE;
3: (* Open circuit - for voltage mode *)
CheckCurrentLoop := TRUE;
END_CASE;
END_FUNCTION
11.6 NAMUR NE43 Recommendation
For advanced current loop diagnostics, the NAMUR NE43 standard defines failure modes:
| Signal Level | Meaning |
|---|---|
| < 3.6 mA | Sensor failure / wire break |
| 3.6 - 4.0 mA | Below normal range |
| 4.0 - 20.0 mA | Normal measurement range |
| 20.0 - 21.0 mA | Above normal range |
| > 21.0 mA | Sensor failure / over-range |
To implement NAMUR NE43 on a B&R module:
- Set the lower limit to detect <4 mA (or <3.6 mA for the first threshold)
- Use software to check if the raw value is between 3.6 mA and 4 mA (warning zone)
- The X20AI2438 (HART-capable) provides additional digital diagnostic data from smart transmitters
12. Filter Settings and Response Time Trade-offs
12.1 B&R Module Filter Architecture
B&R analog modules implement a two-stage filtering approach:
- Hardware anti-aliasing filter: Fixed 3rd-order (voltage/current modules) or 1st-order (temperature modules) low-pass filter at the ADC input
- Digital filter: Configurable first-order IIR filter or input ramp limiter applied after ADC conversion
12.2 Digital Filter on Voltage/Current Modules (X20AI4622)
The X20AI4622 provides a configurable digital filter with two components:
Component 1: Input Ramp Limiting (applied first)
Suppresses transient spikes by limiting the maximum change per cycle:
| Setting | Limit Value | LSB Change/Cycle |
|---|---|---|
| 0 | No limitation | Unlimited |
| 1 | 16383 | Large step allowed |
| 2 | 8191 | |
| 3 | 4095 | |
| 4 | 2047 | |
| 5 | 1023 | |
| 6 | 511 | |
| 7 | 255 | Small step allowed (aggressive spike suppression) |
Component 2: Averaging Filter (applied after ramp limiting)
First-order IIR filter with configurable time constant:
| Setting | Filter Level | Effective Time Constant |
|---|---|---|
| 0 | Off | No filtering |
| 1 | Level 2 | ~2 bus cycles |
| 2 | Level 4 | ~4 bus cycles |
| 3 | Level 8 | ~8 bus cycles |
| 4 | Level 16 | ~16 bus cycles |
| 5 | Level 32 | ~32 bus cycles |
| 6 | Level 64 | ~64 bus cycles |
| 7 | Level 128 | ~128 bus cycles |
Filter formula:
Value_New = Value_Old - (Value_Old / Filter_Level) + (Input_Value / Filter_Level)
This is equivalent to: Value_New = Value_Old * (1 - 1/N) + Input * (1/N), where N is the filter level.
Important constraint: The filter function is disabled for cycle times <500 us. The minimum cycle time with filtering is 500 us.
12.3 Filter Settings on Temperature Modules (X20AT6402, X20AT2222)
Temperature modules offer selectable hardware-level filter time constants:
| Value | Filter | Filter Time | Converter Resolution |
|---|---|---|---|
| 0 | 15 Hz | 66.7 ms | 16-bit |
| 1 | 25 Hz | 40 ms | 16-bit |
| 2 | 30 Hz | 33.3 ms | 16-bit |
| 3 | 50 Hz | 20 ms | 16-bit (default) |
| 4 | 60 Hz | 16.7 ms | 16-bit |
| 5 | 100 Hz | 10 ms | 16-bit |
| 6 | 500 Hz | 2 ms | 16-bit |
| 7 | 1000 Hz | 1 ms | 16-bit |
Default setting: 50 Hz (20 ms) – this is tuned to reject 50 Hz power-line interference, which is the most common noise source in temperature measurements. For 60 Hz regions, use setting 4 (60 Hz, 16.7 ms).
12.4 Response Time Trade-offs
| Application | Recommended Filter | Response Time | Noise Rejection |
|---|---|---|---|
| Fast process control (pressure, flow) | Level 2-4 | 2-4 ms | Moderate |
| Standard process control (level, temperature) | Level 8-16 | 8-16 ms | Good |
| Slow processes (tank temperature) | Level 32-64 | 32-64 ms | Very Good |
| Very noisy environments | Level 64-128 | 64-128 ms | Excellent |
| TC measurement (50 Hz rejection) | 50 Hz (20 ms) | 20 ms per channel | Rejects 50 Hz |
| TC measurement (60 Hz rejection) | 60 Hz (16.7 ms) | 16.7 ms per channel | Rejects 60 Hz |
Key trade-off: Higher filter levels (longer time constants) provide better noise rejection but introduce latency. In closed-loop control systems, excessive filtering can cause instability or poor controller performance. The filter time constant should be significantly shorter than the process time constant.
12.5 Using Input Ramp Limiting for Spike Rejection
Input ramp limiting is particularly effective for suppressing:
- Contact bounce from relay switching
- Inverter switching noise
- Electromagnetic pulses from nearby equipment
Example configuration for a noisy 4-20 mA pressure signal:
- Input ramp limiting = 4 (limit 2047 LSB)
- Filter level = 16 (16 bus cycles)
This combination will:
- Block any single-cycle spike >2047 LSB (approx. 10 mA instantaneous)
- Smooth remaining fluctuations over ~16 cycles
12.6 Minimum Cycle Time Impact
| Configuration | Min Cycle Time | Min I/O Update |
|---|---|---|
| No filter | 100 us | 300 us (all inputs) |
| With filter | 500 us | 1 ms (all inputs) |
| TC module (any filter) | 150 us | Depends on channels + filter |
13. Grounding Best Practices for Analog Signals
13.1 B&R Shield Grounding System
B&R provides a dedicated cable shield grounding clamp (model X20AC0SG1) that latches to the X20 terminal block and connects to the bus module’s ground connection using a cable lug. This provides a proper EMC ground path for cable shields.
Shield grounding clamp specifications:
- Model: X20AC0SG1 (package of 10 pcs: X20AC0SG1.0010, package of 100: X20AC0SG1.0100)
- Mounts to X20 terminal block
- Accepts cable shields from 3 mm to 8 mm diameter (depending on variant)
- Connects to bus module ground via cable lug
13.2 Shield Wiring Rules for B&R X20
Rule 1: Use shielded cables for all analog signals
The X20 system user’s manual mandates shielded cables for analog input modules. The ground connection for the shield is made on the terminal block shield connections provided on each module.
Rule 2: Single-point shield grounding (default)
Ground the cable shield at one end only – typically at the B&R I/O module (panel end). This prevents ground loops:
Field Panel
[Sensor] -- [Shielded Cable] -- [X20 Module]
| |
Floating Shield clamp
to bus module ground
Rule 3: Both-end grounding for high-frequency noise (with caution)
For RF interference above 10 MHz, grounding the shield at both ends provides better shielding. However, this creates a ground loop for low-frequency noise. If both-end grounding is required:
- Use galvanically isolated modules (X20AI2237, X20AI2437) to break the ground loop
- Or use a shield isolation barrier
Rule 4: Separate analog and digital cable routing
Route analog signal cables separately from:
- Motor power cables
- VFD output cables
- Digital I/O cables with high switching rates
- Power supply cables
Maintain at least 200 mm separation, or use grounded metallic cable trays as segregation.
Rule 5: Star-point grounding in the panel
All ground connections in the control panel should converge to a single star-point ground bar, which is then connected to the protective earth (PE) at one point. This prevents ground loop currents between different equipment grounds.
13.3 Grounding for Thermocouple Signals
Thermocouple wiring is particularly susceptible to ground loops because the TC junction itself may be grounded (welded to a metal pipe or vessel). B&R recommendations:
- Connect the TC minus terminal to the power supply minus (X20PS2100) to prevent ripple coupling
- Use shielded twisted-pair thermocouple extension wire
- Ground the shield at the module end only
- If the TC measurement junction is grounded, ensure the module’s common-mode range is not exceeded (check that the ground potential difference between the TC location and the panel is within +/-15V)
13.4 Grounding for RTD Signals
RTD wiring is less susceptible to noise than thermocouples due to the low impedance of the sensor. However:
- Use shielded cables for runs >10m
- Ground the shield at one end only
- Ensure all three wires in a 3-wire connection have equal length and routing
13.5 Grounding for 4-20 mA Current Loops
Current loops are inherently immune to ground-loop-induced voltage noise (since the signal is a current, not a voltage). However:
- The transmitter (sensor) and receiver (B&R module) may have different ground references
- Use shielded twisted-pair cable
- Ground the shield at the panel end (B&R module)
- If using 2-wire transmitters, ensure the loop power supply can drive the total loop resistance
13.6 B&R Coated Modules (X20c) for Harsh Environments
B&R offers coated X20c modules with a protective conformal coating for the electronics. The coating protects against:
- Condensation (certified per BMW GS 95011-4)
- Corrosive gases (certified per EN 60068-2-60, method 4, 21 days exposure)
Coated modules are electrically and functionally identical to standard X20 modules. They require the same grounding practices but offer additional reliability in harsh environments.
13.7 EMC Installation Guide Reference
B&R publishes a dedicated Installation / EMC Guide (document MAEMV) that covers:
- Panel layout and cable routing
- Shield termination methods
- Ground bar installation
- Filter placement
- EMC testing and verification
This document should be consulted for new installations and when troubleshooting EMC-related analog signal issues.
14. Calibration Certification and Traceability
14.1 B&R Factory Calibration and Certificates
B&R analog modules are calibrated during manufacturing with reference standards traceable to national and international standards (SI units). The calibration process includes:
- Gain calibration: Applying known reference signals at multiple points across the measurement range
- Offset calibration: Verifying the zero/offset point
- Linearity verification: Checking linearity across the full range
- Temperature testing: Verifying specifications over the operating temperature range
- EMC testing: Ensuring accuracy is maintained under electromagnetic stress
Documentation supplied with each module:
- Certificate of Conformance (CoC): Confirms the module meets all published specifications
- Test report: Available upon request, containing measured performance data
- Traceability chain: Calibration standards used are traceable to national metrology institutes (e.g., PTB in Germany, BEV in Austria)
14.2 ISO/IEC 17025 Calibration
For applications requiring formal calibration certification (pharmaceutical, food & beverage, aerospace, nuclear):
Option 1: Third-party calibration laboratory
- Send the B&R module to an ISO/IEC 17025 accredited calibration laboratory
- The lab will verify all analog specifications using their traceable standards
- A calibration certificate is issued with:
- Measurement results (as-found and as-left data)
- Uncertainty of measurement for each point
- Traceability statement
- Environmental conditions during calibration
- Accreditation body and certificate number
- Validity period and recommended recalibration interval
Option 2: B&R factory recalibration
- Contact B&R Support Portal or Material Return Portal
- B&R can recalibrate modules at their facility in Eggelsberg, Austria
- Module firmware is updated with new calibration coefficients if needed
Option 3: In-house calibration (if accredited)
- If your facility has an ISO 17025 accredited metrology lab
- Perform verification per the procedures in Section 3 of this document
- Issue calibration certificates under your lab’s accreditation scope
14.3 Calibration Intervals
Recommended recalibration intervals for B&R analog modules:
| Module Type | Recommended Interval | Notes |
|---|---|---|
| Standard V/I (X20AI4622, X20AO4622) | 2-3 years | Stable SAR ADC technology |
| High-precision (X20AI4632, 16-bit) | 1-2 years | Higher resolution shows drift sooner |
| Thermocouple (X20AT6402) | 1-2 years | CJC sensor may drift |
| RTD (X20AT2222) | 2-3 years | Very stable sigma-delta + current source |
| Strain gauge (X20AI1744) | 1 year | Highest precision, most sensitive to drift |
| Safety-rated (X20SA4430) | Per SIL requirements | May require annual verification |
14.4 Traceability Chain
International Bureau of Weights and Measures (BIPM)
|
v
National Metrology Institute (e.g., NIST, PTB, BEV)
|
v
Calibration Laboratory (ISO 17025 accredited)
|
v
Reference Standards (multifunction calibrator, decade box, etc.)
|
v
B&R Analog Module Under Test
|
v
Process Measurement (connected to field sensor)
14.5 Calibration Record Keeping
Maintain calibration records including:
- Module serial number and B&R ID code
- Calibration date and next due date
- Calibrating organization (with accreditation number)
- As-found data (measurements before any adjustment)
- As-left data (measurements after calibration)
- Uncertainty of measurement at each test point
- Environmental conditions during calibration
- Reference standards used (with their calibration dates)
- Technician name and approval signature
14.6 Uncertainty Budget for Analog Verification
When performing calibration verification, the total measurement uncertainty includes:
| Source of Uncertainty | Typical Value |
|---|---|
| Calibration standard (multifunction calibrator) | 0.01-0.05% |
| Resolution of standard | 0.001-0.01% |
| Connection/lead resistance | Negligible (voltage), 0.01% (current) |
| Environmental temperature effect on standard | 0.005-0.02% |
| Repeatability | 0.01-0.05% |
| B&R module resolution | 0.003% (16-bit) to 0.015% (13-bit) |
| Combined (RSS) | 0.02-0.08% |
The calibration uncertainty should be significantly smaller than the module’s specification (typically at least a 4:1 TUR – Test Uncertainty Ratio).
Appendix A: B&R Analog Module Quick Reference
Voltage/Current Input Modules
| Model | Ch | Signal | Resolution | Filter | Special |
|---|---|---|---|---|---|
| X20AI2222 | 2 | +/-10V | 13-bit | Configurable | |
| X20AI2237 | 2 | +/-10V | 16-bit | Configurable | Galvanically isolated, NetTime |
| X20AI2322 | 2 | 0-20/4-20mA | 12-bit | Configurable | |
| X20AI2437 | 2 | 4-20mA | 16-bit | Configurable | Galvanically isolated, NetTime |
| X20AI2438 | 2 | 4-20mA | 16-bit | Configurable | Galvanically isolated, HART, NetTime |
| X20AI2622 | 2 | +/-10V, 0-20/4-20mA | 13-bit | Configurable | |
| X20AI2632 | 2 | +/-10V, 0-20mA | 16-bit | Configurable | Oscilloscope |
| X20AI2636 | 2 | +/-10V, 0-20mA | 16-bit | Configurable | Oversampling |
| X20AI4222 | 4 | +/-10V | 13-bit | Configurable | |
| X20AI4322 | 4 | 0-20/4-20mA | 12-bit | Configurable | |
| X20AI4622 | 4 | +/-10V, 0-20/4-20mA | 13-bit | Configurable | |
| X20AI4632 | 4 | +/-10V, 0-20mA | 16-bit | Configurable | Oscilloscope |
| X20AI4636 | 4 | +/-10V, 0-20mA | 16-bit | Configurable | Oversampling |
| X20AI8039 | 8 | +/-10V, 0-20/4-20mA, Pt100/1000 | 16-bit | Configurable | Universal |
Voltage/Current Output Modules
| Model | Ch | Signal | Resolution | Protection | Special |
|---|---|---|---|---|---|
| X20AO4622 | 4 | +/-10V, 0-20/4-20mA | 13-bit | Short-circuit proof | |
| X20AO2437 | 2 | 4-20/0-20/0-24mA | 16-bit | Short-circuit proof | Galvanically isolated |
Temperature Input Modules
| Model | Ch | Sensor Type | Resolution | Filter | Special |
|---|---|---|---|---|---|
| X20AT2222 | 2 | Pt100/Pt1000 | 16-bit (0.1C) | 1-66.7 ms | 2 or 3-wire |
| X20AT2402 | 2 | J, K, N, S, B, R | 16-bit (0.1C) | 1-66.7 ms | Internal CJC |
| X20AT6402 | 6 | J, K, N, S, B, R | 16-bit (0.1/0.01C) | 1-66.7 ms | Internal CJC, external CJC |
Appendix B: Common Error Codes and Troubleshooting
| Symptom | Module Status LED | Channel LED | Register Status | Likely Cause | Action |
|---|---|---|---|---|---|
| No reading | Off | Off | – | No power | Check 24V supply and bus module |
| All channels maxed | Green (flashing) | Blinking | Upper limit exceeded | Common-mode overvoltage | Check input wiring |
| One channel stuck high | Green | Off/Blinking | Open circuit (11) | Wire break | Check sensor connection |
| One channel stuck low | Green | Blinking | Lower limit undershot (01) | Short circuit | Check sensor wiring |
| Erratic readings | Green | Solid | No error (00) | Noise/grounding | Check shields, grounding |
| Module error LED | Red (solid) | – | General fault | Firmware/hardware | Restart, reflash firmware |
| Invalid firmware | Red + Green flash | – | Invalid | Corrupt firmware | Reflash via Automation Studio |
Appendix C: Register Quick Reference
X20AI4622 Key Registers
| Register | Name | Type | Access | Description |
|---|---|---|---|---|
| ConfigOutput01 | Input Filter | USINT | R/W | Filter level + ramp limiting |
| ConfigOutput02 | Channel Type | USINT | R/W | Voltage/current per channel |
| ConfigOutput03 | Lower Limit | INT | R/W | Lower limit value (all channels) |
| ConfigOutput04 | Upper Limit | INT | R/W | Upper limit value (all channels) |
| AnalogInput01-04 | Input Values | INT | R | Converted analog values |
| StatusInput01 | Channel Status | USINT | R | Error status per channel |
X20AT6402 Key Registers
| Register | Name | Type | Access | Description |
|---|---|---|---|---|
| ConfigOutput01 | Filter/Ambient | USINT | R/W | Filter setting + ambient conditions |
| ConfigOutput02 | Sensor Type | USINT | R/W | TC type per channel (J/K/S/N/R/B/raw) |
| ConfigOutput03 | Channel Disable | USINT | R/W | Enable/disable individual channels |
| Temperature01-06 | TC Values | INT | R | Temperature in 0.1C |
| Temperature01-06_H_Res | TC High Res | DINT | R | Temperature in 0.01C |
| StatusInput01 | Status Ch 1-4 | USINT | R | Error status per channel |
| StatusInput02 | Status Ch 5-6 | USINT | R | Error status per channel |
| CompensationTemperature | CJC Value | INT | R | Internal terminal temperature (-25.0 to 85.0C) |
Cross-References
- io-card-hardware.md – analog IO card signal conditioning and ADC/DAC paths
- grounding-emc.md – grounding and EMC for analog signal integrity
- system-variables.md – runtime IO status monitoring
- physical-layer-sniffing.md – analog signal quality measurement
- memory-map.md – analog IO memory address mapping
- encoder-diagnostics.md – analog encoder signal analysis
- safe-io-diagnostics.md – safe analog input diagnostics
- alarm-logging.md – analog limit alarm configuration
- online-changes.md – runtime calibration parameter adjustment
- diagnostic-workstation.md – oscilloscope requirements for analog signals
Document compiled from B&R Automation official datasheets, X20 system user’s manuals, and installation/EMC guides. All specifications are subject to change – refer to the latest B&R documentation at br-automation.com for current values.
Sources: X20(c)AI4622 Data Sheet V3.40, X20(c)AT6402 Data Sheet V3.22, X20AT2402 Data Sheet V3.09, X20AT2222 Product Page, X20(c)AO4622 Data Sheet V3.25, B&R X20 System User’s Manual, B&R Installation/EMC Guide.
Key Findings
- Analog card resolution ranges from 12-bit to 16-bit depending on module (e.g., X20AI4622 = 13-bit incl. sign, X20AI4632 = 16-bit, X20AI2322 = 12-bit). Higher resolution is critical for precision measurement but requires better signal conditioning. See Appendix A for the full module reference table.
- Distinguishing sensor faults from IO card faults requires a systematic approach: check with a known reference signal, swap channels on the same module, and inspect the analog LED diagnostic patterns.
- Noise and grounding issues are the most common cause of analog reading errors — always check shield termination and grounding before suspecting the IO card or sensor. See grounding-emc.md.
- B&R analog input modules use software-configurable ranges (0-10V, +/-10V, 0/4-20mA) — an incorrect range setting on an undocumented machine can cause readings to appear wrong when the hardware is fine.
- B&R analog modules are factory-calibrated with digital calibration coefficients stored in the module’s internal memory. When replacing a module, the new module has its own factory calibration — you verify it, you don’t re-program it. Document your verification results before and after any analog module replacement.
- Thermocouple cold junction compensation is built into B&R temperature modules — incorrect thermocouple type selection (J/K/S/R/T/B/N) produces readings that are wrong by a predictable offset, not random noise.
B&R Serial Communication Diagnostics — Complete Reference
Serial communication (RS232 and RS485) remains pervasive on legacy B&R machines, connecting the PLC to drives, scales, barcode readers, operator terminals, and other devices. When serial communication fails, the symptoms can range from intermittent data corruption to complete device unresponsiveness — and the original device specifications are almost never available. This document covers how to sniff serial traffic between the PLC and serial-connected devices, common B&R serial protocol patterns, how to decode the data streams, and how to replace or reconfigure serial connections when the original setup is unknown. Cross-references: cp1584-hardware-ref.md for RS232/RS485 hardware details, io-sniffing.md for general sniffing techniques, and modbus-gateway.md for Modbus serial gateway configuration.
Table of Contents
- Overview of B&R Serial Communication
- B&R Hardware Platforms and Serial Capabilities
- Serial Interface Modules: System 2003 / 2005
- Serial Interface Modules: X20 System
- Wiring and Pinouts for RS232 and RS485
- Baud Rate, Parity, and Stop Bit Configuration
- Flow Control and Handshake Issues
- B&R Software Libraries for Serial Communication
- How to Sniff Serial Traffic Between PLC and Serial-Connected Devices
- Tools for Serial Sniffing
- How to Decode Serial Data
- Protocol Analysis: MODBUS RTU Over Serial
- Protocol Analysis: Custom ASCII and Binary Protocols
- Reconfiguring or Replacing Serial Connections When Specs Are Unknown
- Serial-to-Ethernet Conversion Options
- Common Serial Communication Failures and Debugging
- Troubleshooting Matrices
- References and Further Reading
1. Overview of B&R Serial Communication
B&R Automation (Bernecker + Rainer) industrial controllers use serial communication (RS232, RS485, RS422) extensively for connecting to third-party devices — sensors, drives, HMIs, barcode readers, weigh scales, temperature controllers, and more. Understanding how to diagnose, sniff, and decode serial traffic is critical when commissioning systems, troubleshooting intermittent failures, or reverse-engineering undocumented connections.
B&R serial communication spans three major hardware families:
- System 2003 — compact DIN-rail controllers with integrated or plug-in serial modules
- System 2005 — modular rack-based controllers with interface modules (IF260, IF671, IF622, etc.)
- X20 System — modular I/O with base modules providing integrated serial, plus dedicated communication interface modules (X20CS1020, X20IF1030, X20IF1082, etc.)
On the software side, two primary libraries handle serial I/O:
- DV_Frame — general-purpose raw serial frame I/O (user-defined protocols, ASCII, binary)
- DRV_mbus — Modbus RTU master/slave with automatic CRC and function code handling
2. B&R Hardware Platforms and Serial Capabilities
2.1 X20CP1584 / X20CP1585 / X20CP1586
The X20CP158x series are compact X20 CPUs with integrated serial and Ethernet:
| Interface | Type | Connection | Max Distance | Max Rate |
|---|---|---|---|---|
| IF1 | RS232 | 12-pin terminal block X20TB12 | 15 m | 115.2 kbit/s |
| IF2 | Ethernet (10/100/1000) | RJ45 | 100 m | 1 Gbit/s |
IF1 RS232 Pinout on X20TB12 terminal block:
| Terminal | Signal | Direction |
|---|---|---|
| 9 | TxD (Transmit Data) | Output from PLC |
| 10 | RxD (Receive Data) | Input to PLC |
| 11 | GND (Signal Ground) | Reference |
| 12 | Shield / FE (Functional Earth) | Chassis/shield |
The RS232 interface is not electrically isolated from the PLC logic on most X20CP158x models. Use shielded cable with shield bonded at one end only to prevent ground loops.
2.2 X20CP1484 / X20CP1485 / X20CP1486
Similar to the 158x series but with Ethernet limited to 10/100 Mbit/s on IF2. IF1 is RS232 via the same X20TB12 terminal block pinout.
2.3 X20CP0482 / X20CP0484
Entry-level X20 CPUs. The serial interface is provided by the base module (X20BB52) and exposed on the power supply module’s (X20PS9600) terminal block. IF1 = RS232 at up to 115.2 kbit/s.
2.4 CP476 (System 2003)
Compact controller with integrated serial port. Uses DB9 connector for RS232:
- Pin 2: TXD (Transmit)
- Pin 3: RXD (Receive)
- Pin 5: GND (Signal Ground)
Supports both RS232 and RS485 depending on model variant. Programmed using the DV_Frame library.
2.5 Base Modules with Integrated Serial (X20 System)
A critical architectural detail: on the X20 system, the integrated serial interface lives on the base module, not on the power supply module:
| Base Module | Integrated Serial | Interface Type | Max Rate |
|---|---|---|---|
| X20BB52 | COM1 (RS232) | RS232 | 115.2 kbit/s |
| X20BB62 | None | Power feed only | — |
| X20BB72 | COM1 (RS232) | RS232 | 115.2 kbit/s |
| X20BB82 | COM1 (RS232/RS422/RS485) | Software-selectable | 115.2 kbit/s |
The X20PS9600 power supply module passes the RS232 signals from the base module to its terminal block. A second X20PS9600 will not provide a second serial port — each X20 segment allows exactly one PS module.
3. Serial Interface Modules: System 2003 / 2005
3.1 IF260 — Programmable Interface Module
The IF260 (3IF260.60-1) is a System 2005 interface module that can function as either a CPU or as a programmable interface processor. The module auto-detects its operating mode from the slot position:
- Slot 0 — operates as a CPU
- Other slots — operates as a programmable interface processor
This allows the IF260 to offload serial communication processing from the main CPU. It runs its own Automation Basic program and can handle multiple serial protocols independently.
3.2 IF622 — Triple Serial Interface (1×RS232, 2×RS485/RS422)
The IF622 (3IF622.9) provides:
- IF1: 1× RS232 interface
- IF2, IF3: 2× RS485/RS422 interfaces
All interfaces are electrically isolated. Used in System 2005 racks for expanding serial connectivity beyond what the CPU provides natively.
3.3 IF671 — Triple Communication Module (RS232, RS485/RS422, CAN)
The IF671 (3IF671.9) provides three isolated communication interfaces on a single module:
- IF1: RS232
- IF2: RS485/RS422
- IF3: CAN bus
This is the most versatile serial interface module for System 2005, covering RS232 point-to-point, RS485 multi-drop, and CAN bus in one card.
3.4 IF261 / IF262 / IF3xx Series
- IF261 — CPU module variant for System 2003/2005
- IF262 — Interface processor for serial protocols
- IF3xx series — Various interface modules for specific fieldbus protocols (Profibus DP, CANopen, DeviceNet) with optional serial sub-interfaces
3.5 CP260 — Serial + CAN Interface Module
The CP260 (3CP260.60-1) provides:
- 1× RS485/RS422 interface
- 1× CAN interface
Used as a compact interface processor or standalone communication node.
4. Serial Interface Modules: X20 System
4.1 X20CS1020 — RS232/RS422/RS485 Communication Module
| Parameter | Value |
|---|---|
| Interface standard | EIA-232-F / EIA-422 / EIA-485 |
| Configuration | Software selectable (no DIP switches) |
| Max baud rate | 115.2 kbit/s |
| Handshake | RTS/CTS or XON/XOFF (RS232 mode) |
| Bus connection | X2X Link to local controller |
| Electrical isolation | Yes |
Device name in Automation Studio: CS1020_IF1
This is the standard choice for adding a second serial port to an X20 controller when the base module’s integrated port is already in use.
4.2 X20IF1030 — RS232 Interface Module
| Parameter | Value |
|---|---|
| Interface standard | EIA-232-F |
| Max baud rate | 115.2 kbit/s |
| Connector | 9-pin D-Sub female |
| Electrical isolation | No |
Designed for point-to-point RS232 serial connections. Note: The X20IF1030 is RS232 only — do not confuse it with the X20IF1031 (RS422/RS485) or X20IF1041 (RS422/RS485 isolated). For multi-drop RS485 networks, use X20IF1031 or X20IF1041. See modbus-gateway.md for the complete serial module comparison.
4.3 X20IF1082 — Configurable RS232/RS485
Single configurable channel supporting either RS232 or RS485 communication. Software-configurable interface standard.
4.4 X20IF1072 — RS485 Interface Module
Dedicated RS485 interface for the X20 system. Used for serial remote connection of complex devices.
4.5 X20PS9600 — Power Supply (Serial Pass-Through)
Not a serial module itself — the X20PS9600 passes RS232 signals from the base module (e.g., X20BB52) to its terminal block:
| Terminal | Signal | Direction |
|---|---|---|
| 1 | +24 VDC | Input (field supply) |
| 2 | 0 VDC | Input (field return) |
| 9 | TxD (RS232) | Output |
| 10 | RxD (RS232) | Input |
| 11 | GND | Signal ground |
| 12 | Shield / FE | Functional Earth |
5. Wiring and Pinouts for RS232 and RS485
5.1 RS232 DB9 Standard Pinout (Male Connector, DTE Side)
| Pin | Signal | Abbreviation | Direction (DTE) |
|---|---|---|---|
| 1 | Data Carrier Detect | DCD | Input |
| 2 | Received Data | RXD | Input |
| 3 | Transmitted Data | TXD | Output |
| 4 | Data Terminal Ready | DTR | Output |
| 5 | Signal Ground | GND | — |
| 6 | Data Set Ready | DSR | Input |
| 7 | Request To Send | RTS | Output |
| 8 | Clear To Send | CTS | Input |
| 9 | Ring Indicator | RI | Input |
5.2 RS232 Wiring: Straight-Through vs Null-Modem
Straight-through cable (PC/PLC to modem/peripheral):
DTE (PLC) DCE (Device)
Pin 3 (TXD) → Pin 2 (RXD)
Pin 2 (RXD) ← Pin 3 (TXD)
Pin 5 (GND) — Pin 5 (GND)
Null-modem cable (PLC to PLC, or PLC to PC configured as DTE):
Device A Device B
Pin 3 (TXD) → Pin 2 (RXD) (crossed)
Pin 2 (RXD) ← Pin 3 (TXD) (crossed)
Pin 5 (GND) — Pin 5 (GND) (straight)
Pin 7 (RTS) → Pin 8 (CTS) (crossed)
Pin 8 (CTS) ← Pin 7 (RTS) (crossed)
5.3 RS485 Wiring
RS485 uses differential signaling (A/B or +/−) and supports multi-drop (up to 32 devices on a single bus):
120Ω
Master ──── A ───────────────── A ──── Slave 1
│ │
└──── B ───────────────── B ─┘
│ │
GND GND
120Ω (at far end)
RS485 connection rules:
- Use twisted pair cable (e.g., 1 pair of Cat5e or dedicated RS485 cable)
- 120 Ω termination resistors at both ends of the bus
- Common ground connection recommended but keep ground currents minimized
- Maximum cable length depends on baud rate (EIA-485 standard, twisted-pair cable, 120 Ω termination):
- 115.2 kbit/s → max ~200 m (conservative: 100 m in noisy environments)
- 19.2 kbit/s → max ~1000 m
- 9600 baud → max ~1200 m
5.4 B&R X20 Terminal Block Serial Wiring
For X20CP1584 and similar CPUs using X20TB12:
- TxD connects to terminal 9
- RxD connects to terminal 10
- GND connects to terminal 11
- Shield connects to terminal 12 (FE)
Use shielded twisted pair cable (LiYCY 3×2×0.14 mm²). Bond shield to FE at the cabinet entry only — do not ground both ends.
5.5 RJ45 to DB9 RS232 Adapter (Common for B&R Field Wiring)
Some B&R installations use RJ45 connectors for serial field wiring. A common mapping:
| RJ45 Pin | DB9 Pin | Signal |
|---|---|---|
| 1 | 8 (CTS) | Clear To Send |
| 2 | 6 (DSR) | Data Set Ready |
| 3 | 2 (RXD) | Receive Data |
| 4 | 20 (DTR) | Data Terminal Ready |
| 5 | 3 (TXD) | Transmit Data |
| 6 | 5 (GND) | Signal Ground |
| 7 | 7 (RTS) | Request To Send |
| 8 | 4 (DTR) | Data Terminal Ready |
Note: RJ45-to-serial pinout varies by manufacturer. Always verify with a multimeter before connecting.
6. Baud Rate, Parity, and Stop Bit Configuration
6.1 Standard Configuration Parameters
| Parameter | Standard Values | Common Industrial Setting |
|---|---|---|
| Baud rate | 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 | 9600 (most common), 19200, 38400 |
| Data bits | 7, 8 | 8 |
| Parity | None, Even, Odd, Mark, Space | None or Even |
| Stop bits | 1, 2 | 1 (or 2 with parity=Even at 9600 → “9600-8-E-1”) |
6.2 Common Configurations
| Notation | Baud | Data | Parity | Stop | Use Case |
|---|---|---|---|---|---|
| 9600-8-N-1 | 9600 | 8 | None | 1 | Most common default; Modbus RTU, generic sensors |
| 19200-8-N-1 | 19200 | 8 | None | 1 | Faster sensors, HMIs |
| 9600-8-E-1 | 9600 | 8 | Even | 1 | Modbus RTU with error detection |
| 9600-7-E-1 | 9600 | 7 | Even | 1 | Legacy serial devices |
| 115200-8-N-1 | 115200 | 8 | None | 1 | High-speed serial, programming ports |
6.3 Configuring in B&R Automation Studio
In the IO Configuration view, set the serial port properties:
| Parameter | Automation Studio Setting |
|---|---|
| Device name | IF1, CS1020_IF1, etc. |
| Baud rate | Integer (9600, 19200, etc.) |
| Data bits | 8 (or 7) |
| Parity | dvPARITY_NONE, dvPARITY_EVEN, dvPARITY_ODD |
| Stop bits | 1 (or 2) |
| Handshake | dvHANDSHAKE_NONE, dvHANDSHAKE_RTSCTS |
In code (DV_Frame):
openInfo.baudrate := 9600;
openInfo.dataBits := 8;
openInfo.parity := dvPARITY_EVEN;
openInfo.stopBits := 1;
openInfo.handshake := dvHANDSHAKE_NONE;
In code (DRV_mbus for Modbus RTU):
openInfo.baudrate := 9600;
openInfo.parity := dvPARITY_EVEN; (* Modbus RTU commonly uses Even parity *)
6.4 Maximum Baud Rates by B&R Hardware
| Hardware | Max Baud Rate |
|---|---|
| X20CP1584 IF1 (RS232) | 115.2 kbit/s |
| X20CS1020 | 115.2 kbit/s |
| X20IF1030 (RS232) | 115.2 kbit/s |
| IF622, IF671 | 115.2 kbit/s |
| System 2003 CP modules | 115.2 kbit/s |
7. Flow Control and Handshake Issues
7.1 Types of Flow Control
| Type | Method | Use Case |
|---|---|---|
| None | No flow control | Most industrial devices, short cables, well-matched speeds |
| Hardware (RTS/CTS) | PLC asserts RTS when ready to receive; device asserts CTS when ready | High-speed links, large data transfers, printers |
| Software (XON/XOFF) | Embedded control characters (0x11/0x13) in data stream | Legacy systems, avoid in binary protocols |
| DSR/DTR | Peripheral signals ready state | Modems, some legacy equipment |
7.2 Common Handshake Problems
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| RTS/CTS not connected | Partial data, truncated frames | Missing handshake lines in cable | Add RTS/CTS wires or disable handshake |
| CTS held low | No data transmitted | Device not asserting CTS | Check device ready state, disable RTS/CTS |
| RTS/CTS polarity mismatch | Data flow stops | Some devices use inverted RTS/CTS | Use null-modem adapter with crossed handshake lines |
| XON/XOFF in binary data | Communication corruption | Binary data contains 0x11/0x13 bytes | Disable XON/XOFF; use hardware handshake or none |
7.3 B&R-Specific Flow Control Notes
- X20BB52 base module exposes RTS and CTS on the PS9600 terminal block (check exact pin assignment in datasheet)
- X20CS1020 supports RTS/CTS and XON/XOFF in RS232 mode
- For Modbus RTU over RS485, flow control is typically None — the protocol handles framing via 3.5 character silent intervals
- When using DV_Frame with
dvHANDSHAKE_RTSCTS, the library manages RTS automatically
8. B&R Software Libraries for Serial Communication
8.1 DV_Frame Library
The DV_Frame library is the primary general-purpose serial communication library for B&R controllers. It provides raw frame-level access to serial ports.
Key Functions:
| Function | Purpose |
|---|---|
DV_FrameOpen | Open serial port with configuration (baud, parity, data bits, stop bits, handshake) |
DV_FrameWrite | Write raw bytes to serial port |
DV_FrameRead | Read bytes with configurable terminators (CRLF, timeout, length) |
DV_FrameClose | Close serial port and release handle |
DV_FrameIoctl | Ioctl-level control (line status, buffer flush, break signal) |
Modes:
dvFRAME_MODE_RAW— raw byte I/O, no protocol framing- Terminator options:
dvFRAME_TERMINATOR_CRLF,dvFRAME_TERMINATOR_LF, custom delimiter
Example — Opening a Serial Port:
VAR
fbFrame : DV_FrameOpen_Type;
openInfo : DV_FrameOpen_Info_Type;
rxBuffer : ARRAY[0..63] OF USINT;
rxLen : UDINT;
handle : UDINT;
END_VAR
openInfo.deviceName := 'IF1';
openInfo.mode := dvFRAME_MODE_RAW;
openInfo.baudrate := 9600;
openInfo.dataBits := 8;
openInfo.parity := dvPARITY_NONE;
openInfo.stopBits := 1;
openInfo.handshake := dvHANDSHAKE_NONE;
openInfo.rxBufferSize := SIZEOF(rxBuffer);
openInfo.rxBuffer := ADR(rxBuffer);
DV_FrameOpen(fbFrame, openInfo);
IF fbFrame.status = 0 THEN
handle := fbFrame.handle;
END_IF
Example — Sending a Query:
VAR
fbWrite : DV_FrameWrite_Type;
query : USINT := 16#52; (* 'R' = ASCII 0x52 *)
END_VAR
DV_FrameWrite(fbWrite, handle, ADR(query), 1);
Example — Reading a CRLF-Terminated Response:
VAR
fbRead : DV_FrameRead_Type;
END_VAR
DV_FrameRead(fbRead, handle, ADR(rxBuffer), SIZEOF(rxBuffer), rxLen,
dvFRAME_TERMINATOR_CRLF);
IF fbRead.status = 0 THEN
(* rxBuffer[0..rxLen-1] contains the response *)
END_IF
8.2 DRV_mbus Library (Modbus RTU)
The DRV_mbus library provides Modbus RTU master and slave functionality with automatic CRC-16 handling.
Key Functions:
| Function | Purpose |
|---|---|
DRV_mbusOpen | Open Modbus RTU channel (master or slave mode) |
DRV_mbusReadReg | Read holding registers (FC03) or input registers (FC04) |
DRV_mbusWriteReg | Write single register (FC06) or multiple registers (FC16) |
DRV_mbusClose | Close Modbus channel |
Example — Modbus RTU Master:
VAR
fbMbus : DRV_mbusOpen_Type;
fbRead : DRV_mbusReadReg_Type;
openInfo : DRV_mbusOpen_Info_Type;
regValue : UINT;
END_VAR
openInfo.deviceName := 'IF1';
openInfo.mode := dvMBUS_MODE_RTU_MASTER;
openInfo.baudrate := 9600;
openInfo.parity := dvPARITY_EVEN;
openInfo.timeout := 500; (* ms *)
DRV_mbusOpen(fbMbus, openInfo);
IF fbMbus.status = 0 THEN
DRV_mbusReadReg(fbRead, fbMbus.handle,
slaveAddr := 1,
funcCode := dvMBUS_FC04_INPUT,
regAddr := 16#0001,
regQty := 1,
pData := ADR(regValue),
dataLen := SIZEOF(regValue));
END_IF
8.3 Choosing Between DV_Frame and DRV_mbus
| Criterion | Use DV_Frame | Use DRV_mbus |
|---|---|---|
| Protocol | Custom/proprietary, ASCII, binary | Modbus RTU |
| CRC handling | Manual | Automatic |
| Frame delimiters | Configurable | 3.5 char silent interval |
| Complexity | Higher (you build the protocol) | Lower (function call API) |
9. How to Sniff Serial Traffic Between PLC and Serial-Connected Devices
9.1 Why Sniff Serial Traffic?
- Determine unknown protocol parameters (baud rate, parity, framing)
- Capture request/response patterns for reverse engineering
- Debug intermittent communication failures
- Verify PLC program behavior against expected protocol
- Identify timing issues, bus contention, or signal integrity problems
9.2 Methods for Sniffing
Method 1: Hardware Tap (Non-Intrusive — RS232 Only)
For RS232 point-to-point connections, insert a Y-cable or hardware tap between the PLC and the device:
PLC TXD ────────────────────── Device RXD
│
└──── Sniffer RXD
PLC RXD ────────────────────── Device TXD
│
└──── Sniffer TXD
Hardware needed:
- Passive RS232 monitor Y-cable (3-plug DB9)
- Or build one: connect sniffer’s RXD to both TXD lines (with diodes for isolation)
Limitations: RS232 only (voltage levels must be compatible). Cannot easily tap RS485 mid-bus without disturbing differential signaling.
Method 2: RS485 Tap (Intrusive but Low-Impact)
For RS485 multi-drop buses:
- Connect the sniffer as an additional node on the bus with a high-impedance RS485 transceiver
- The sniffer listens only (never transmits) to avoid disturbing bus traffic
- Ensure proper 120 Ω termination is maintained
Method 3: Oscilloscope / Logic Analyzer (Non-Intrusive)
Connect probes to the TXD/RXD (RS232) or A/B (RS485) lines. This is the best method because:
- No electrical loading of the bus
- Captures exact timing and signal integrity
- Can detect electrical noise, reflections, and voltage levels
- Works for both RS232 and RS485
Method 4: Software Sniffer (Windows PC)
If the serial traffic passes through a PC (e.g., USB-to-serial adapter):
- Install a serial port monitor driver that intercepts IOCTL calls
- Tools: HHD Serial Port Monitor, COM Sniffer, Serial Port Monitor (eltima)
- These capture all read/write operations at the driver level
- Non-intrusive to the application but requires the traffic to pass through the monitored PC
9.3 Sniffing B&R PLC Serial Traffic
B&R PLCs run their own real-time OS, so software-based sniffing directly on the PLC is not possible with standard tools. To sniff traffic from a B&R controller:
- Hardware approach (recommended): Use a logic analyzer or oscilloscope on the serial lines
- Y-cable approach (RS232): Insert a passive tap between PLC and device, connect to a PC running serial terminal software
- B&R diagnostic approach: Add logging in the PLC program using DV_Frame to echo both TX and RX data to a second serial port or to Ethernet
- Modbus diagnostic: Use DRV_mbus built-in error counters to track CRC errors, timeouts, and exception codes
10. Tools for Serial Sniffing
10.1 Software Tools
| Tool | Platform | Key Features | Best For |
|---|---|---|---|
| HHD Serial Port Monitor | Windows | Non-intrusive driver-level sniffing, multiple view modes (table, dump, terminal), Modbus RTU/ASCII decoding, session recording | General RS232/RS485 debugging on PC |
| Serial Port Monitor (eltima) | Windows | COM port interception, data filtering, IRP/IOCTL tracking, Modbus RTU decode | Deep protocol analysis on Windows |
| COM Sniffer | Windows | Logs data, IOCTLs, and signals; works on ports already in use | Monitoring already-open COM ports |
| SerialTool | macOS/Linux/Windows | COM sniffer with multi-platform support, data logging | Cross-platform serial monitoring |
| Free Serial Analyzer | Windows | Non-intrusive RS232/RS422/RS485 packet sniffer | Budget option |
| PuTTY / TeraTerm | Windows/Linux | Terminal emulation for raw serial monitoring | Simple connect-and-observe |
| RealTerm | Windows | Serial terminal with hex display, logging, macro scripting | Binary protocol debugging |
10.2 Hardware Tools
| Tool | Key Features | Best For |
|---|---|---|
| Saleae Logic / Logic 2 | 8–16 channel digital logic analyzer with async serial protocol decode, Modbus RTU analyzer, export to CSV | Timing analysis, protocol decode, baud rate verification |
| Sigrok / PulseView | Open-source logic analyzer software supporting many hardware probes | Budget logic analysis, open-source workflow |
| PicoScope | Oscilloscope with serial protocol decoding (RS232, RS485, Modbus, CAN) | Signal integrity + protocol decode in one tool |
| Bus Pirate | Multi-protocol tool supporting UART, SPI, I2C, raw binary; can sniff and inject | Reverse engineering, protocol exploration |
| RS232 / RS485 breakout box | Inline connector with LEDs for TXD/RXD/CTS/RTS status | Quick visual verification of signal activity |
| USB-to-Serial adapter + software sniffer | FTDI/CH340 adapter to capture traffic on PC | Software-level monitoring when traffic routes through PC |
10.3 Saleae Logic Analyzer for Serial Protocol Decode
Saleae Logic analyzers (Logic 4, Logic 8, Logic Pro 8/16) can read and decode RS232, RS485, and RS422 signals up to ±25V:
Setup steps:
- Connect ground probe to circuit ground
- Connect channel probes to TXD and RXD (RS232) or A and B (RS485 differential pair)
- For RS232: Use the “Async Serial” analyzer with correct baud rate, parity, stop bits
- For RS485: May require RS485-to-TTL receiver chip to convert differential to logic levels
- Set up “Modbus RTU” analyzer on top of the async serial decode for Modbus devices
What you get:
- Decoded hex/ASCII data in real time
- Timing measurements between frames
- Protocol-level decode (Modbus function codes, register addresses, CRC)
- Export to CSV, JSON, or screenshot for documentation
11. How to Decode Serial Data
11.1 Step-by-Step Decode Process
Step 1: Capture Raw Data
Use a logic analyzer or serial sniffer to capture the raw bitstream. Record:
- All bytes in hex format
- Timestamps between bytes
- Direction (TX vs RX)
Step 2: Determine Baud Rate
If baud rate is unknown:
- Measure bit duration with oscilloscope: Connect to TXD line, trigger on falling edge, measure one bit width. Baud rate = 1 / bit_width_seconds.
- Common baud rates to try: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
- Auto-detect approach: Set logic analyzer to each common baud rate and see which produces valid ASCII or consistent framing
- Bit-width reference table:
| Baud Rate | Bit Duration (μs) | Character Time (10 bits) |
|---|---|---|
| 300 | 3333 μs | 33.3 ms |
| 1200 | 833 μs | 8.33 ms |
| 2400 | 417 μs | 4.17 ms |
| 4800 | 208 μs | 2.08 ms |
| 9600 | 104 μs | 1.04 ms |
| 19200 | 52 μs | 0.52 ms |
| 38400 | 26 μs | 0.26 ms |
| 57600 | 17.4 μs | 0.174 ms |
| 115200 | 8.68 μs | 0.087 ms |
Step 3: Determine Frame Format
Standard UART frame: [Start bit (0)] [5-9 data bits] [Parity bit (optional)] [1-2 Stop bits (1)]
If the data looks garbled, try:
- 8-N-1 (most likely)
- 8-E-1 (common for Modbus RTU)
- 7-E-1 (legacy devices)
- 8-O-1, 7-N-2
Step 4: Identify Protocol Type
| Indicators | Protocol Type |
|---|---|
| Readable ASCII text (letters, numbers, CR, LF) | ASCII/text protocol |
| Hex bytes with fixed-length blocks and checksum | Binary protocol |
Byte patterns: [addr][FC][data][CRC_lo][CRC_hi] | Modbus RTU |
| Fixed header + length byte + payload + checksum | Custom binary protocol |
<STX>...<ETX><LRC> | Start/stop delimited protocol |
$GP...*CS<CR><LF> | NMEA 0183 (GPS, marine) |
Step 5: Analyze Message Structure
For each captured message:
- Identify the master request (PLC sends) and slave response (device replies)
- Look for fixed patterns in the first few bytes (address, command)
- Look for repeating structures in the data payload
- Look for the last 1-2 bytes — often a checksum (CRC-16, LRC, sum)
- Note timing between request and response
Step 6: Verify Checksums
Common checksum algorithms:
- CRC-16 (Modbus): Polynomial 0x8005, init 0xFFFF — used in Modbus RTU
- LRC (Longitudinal Redundancy Check): XOR of all bytes — used in Modbus ASCII
- Sum checksum: Add all bytes, take lower byte
- CRC-CCITT (0x1021): Used in various industrial protocols
Use an online CRC calculator or embedded code to verify.
11.2 Example: Decoding a Custom ASCII Protocol
Captured hex dump (PLC → Sensor):
52 0D 0A
Decoded: R\r\n (ASCII “R” + CRLF) — this is a read request.
Captured hex dump (Sensor → PLC):
2B 32 33 2E 34 35 20 43 0D 0A
Decoded: +23.45 C\r\n — temperature reading in ASCII.
11.3 Example: Decoding a Binary Protocol
Captured hex dump (PLC → Device):
01 03 00 00 00 0A C5 CD
Decoded as Modbus RTU:
01= Slave address (1)03= Function code (Read Holding Registers)00 00= Starting register address (0x0000)00 0A= Quantity of registers (10)C5 CD= CRC-16 (Modbus)
12. Protocol Analysis: MODBUS RTU Over Serial
12.1 Modbus RTU Frame Structure
┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ Address │ Function │ Data │ Data │ CRC Low │ CRC High │
│ (1 byte) │ (1 byte) │ (N bytes)│ (N bytes)│ (1 byte) │ (1 byte) │
└──────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
- Address: Slave device address (1–247)
- Function code: Operation type (01–06, 15–16 most common)
- Data: Register address, quantity, write values
- CRC-16: CRC-16/Modbus (polynomial 0x8005, initial value 0xFFFF)
12.2 Common Function Codes
| FC | Name | Direction | Data Bytes |
|---|---|---|---|
| 01 | Read Coils | Master → Slave → Master | Addr (2) + Qty (2) → Coil status (N) |
| 02 | Read Discrete Inputs | Master → Slave → Master | Addr (2) + Qty (2) → Input status (N) |
| 03 | Read Holding Registers | Master → Slave → Master | Addr (2) + Qty (2) → Register values (2×N) |
| 04 | Read Input Registers | Master → Slave → Master | Addr (2) + Qty (2) → Input register values (2×N) |
| 05 | Write Single Coil | Master → Slave → Master | Addr (2) + Value (2) |
| 06 | Write Single Register | Master → Slave → Master | Addr (2) + Value (2) |
| 15 | Write Multiple Coils | Master → Slave → Master | Addr (2) + Qty (2) + Outputs (N) |
| 16 | Write Multiple Registers | Master → Slave → Master | Addr (2) + Qty (2) + Values (2×N) |
12.3 Modbus RTU Timing
The end of a Modbus RTU frame is defined by a 3.5 character silent interval on the bus:
| Baud Rate | 3.5 Char Time |
|---|---|
| 9600 (11 bits/char) | ~4.0 ms |
| 19200 (11 bits/char) | ~2.0 ms |
| 38400 (11 bits/char) | ~1.0 ms |
| 115200 (11 bits/char) | ~0.3 ms |
The inter-frame delay must be at least this long. The inter-character delay must be less than 1.5 character times or the frame is considered incomplete.
12.4 Modbus Exception Response
If a slave cannot process a request, it returns an exception response:
┌──────────┬──────────┬──────────┬──────────┬──────────┐
│ Address │ FC + 0x80│Exception │ CRC Low │ CRC High │
│ (1 byte) │ (1 byte) │ Code │ (1 byte) │ (1 byte) │
└──────────┴──────────┴──────────┴──────────┴──────────┘
Common exception codes:
| Code | Meaning |
|---|---|
| 01 | Illegal Function |
| 02 | Illegal Data Address |
| 03 | Illegal Data Value |
| 04 | Server Device Failure |
12.5 Analyzing Modbus RTU with B&R DRV_mbus
When using DRV_mbus, the library handles CRC and framing automatically. To debug:
- Monitor
fbRead.statusafter eachDRV_mbusReadRegcall - Check for CRC errors:
dvMBUS_ERR_CRCindicates electrical noise or baud rate mismatch - Check for timeouts:
dvMBUS_ERR_TIMEOUTmeans the slave didn’t respond - Check for exception codes: Non-zero slave response with error code indicates addressing or register problems
- Log all reads/writes: Echo the request parameters and responses to a log file or HMI for pattern analysis
12.6 Tools for Modbus RTU Analysis
| Tool | Type | Capabilities |
|---|---|---|
| QModMaster | Free Windows GUI | Modbus RTU master/slave simulator, register read/write |
| PicoScope + Modbus decode | Oscilloscope | Physical-layer decode with timing analysis |
| Saleae Logic 2 + Modbus RTU analyzer | Logic analyzer | Protocol-level decode with function code parsing |
| HHD Serial Port Monitor | Software sniffer | Driver-level capture with Modbus RTU decoding overlay |
| CAS Modbus Scanner | Free scanner | Scans slave addresses and registers on a serial bus |
Python pyModbus | Scripting | Programmatic Modbus RTU scanning and testing |
13. Protocol Analysis: Custom ASCII and Binary Protocols
13.1 ASCII Protocols
Many industrial sensors use simple ASCII request/response patterns:
Pattern 1: Command-Response (read request)
PLC sends: "R\r\n" (request reading)
Device: "+23.45 C\r\n" (response with value)
Pattern 2: Addressed Multi-Drop
PLC sends: "$01RD\r\n" (address 01, read command)
Device 01: "!01+23.45\r\n" (addressed response)
Pattern 3: Set-Command
PLC sends: "SET 100\r\n" (set value to 100)
Device: "OK\r\n" (acknowledgment)
Analysis approach for ASCII:
- Capture traffic and view as ASCII text
- Identify request vs response by direction
- Look for delimiters (CR, LF, CRLF, semicolon, comma)
- Identify data format (decimal, hex, scientific notation)
- Map command set by observing different PLC operations
13.2 Binary Protocols
Binary protocols use structured byte sequences with headers, addresses, commands, data, and checksums:
Typical structure:
┌───────┬───────┬───────┬───────┬───────┬──────────┐
│ STX │ ADDR │ CMD │ LEN │ DATA │ CHECKSUM │
│ 0x02 │ (1B) │ (1B) │ (1B) │ (nB) │ (1-2B) │
└───────┴───────┴───────┴───────┴───────┴──────────┘
Analysis approach for binary:
- Capture multiple transactions and align them by frame boundaries
- Look for fixed byte values in position 0 (start marker: 0x02, 0xAA, 0x55)
- Look for the length field — count data bytes to confirm
- Verify the checksum against candidate algorithms
- Correlate known values (e.g., if you know a sensor reads 25.3°C, find 0x0199 or 0x9919 in the data)
- Determine byte order (big-endian vs little-endian) by comparing known values
13.3 Mixed Protocols
Some devices use a mix of ASCII commands and binary data (e.g., text headers with binary payloads). Look for transitions between printable and non-printable byte ranges.
14. Reconfiguring or Replacing Serial Connections When Specs Are Unknown
14.1 Systematic Approach to Unknown Serial Connections
When you inherit a system with undocumented serial connections:
Phase 1: Physical Investigation
- Identify the hardware: Locate the serial module (IF1, CS1020, IF622, etc.)
- Trace the wiring: Follow cables from the PLC serial port to the connected device
- Identify the connector type: DB9, terminal block, RJ45
- Note the cable type: Shielded/unshielded, twisted pair count
- Check for RS485 termination: Look for 120 Ω resistors on the bus ends
Phase 2: Capture Traffic
- Use a logic analyzer to capture raw serial data
- Determine baud rate by measuring bit width (see Section 11)
- Determine frame format (8-N-1, 8-E-1, etc.)
- Save hex dumps of multiple request/response cycles
Phase 3: Protocol Identification
- Check if the traffic matches Modbus RTU (address + FC + data + CRC pattern)
- Check for ASCII patterns (readable text, CR/LF delimiters)
- Check for known vendor protocols (Mitsubishi MC Protocol, Siemens S7, Omron Host Link, Allen-Bradley DF1)
- Search online for the connected device’s protocol documentation
Phase 4: Replication
- Once the protocol is understood, implement it in B&R using DV_Frame (custom) or DRV_mbus (Modbus)
- Test with the captured device to verify matching behavior
- Document the protocol for future maintenance
14.2 Common Vendor Serial Protocols Found in B&R Installations
| Protocol | Vendor | Detection Pattern |
|---|---|---|
| Modbus RTU | Many vendors | [addr][FC 01-16][data][CRC-16] |
| Modbus ASCII | Many vendors | Colon start :, LRC end, CRLF |
| DF1 | Rockwell/Allen-Bradley | ACK 0x06, NAK 0x15, DLE 0x10 escape |
| MC Protocol | Mitsubishi | [ENQ][station][PC][command][data][SUM] |
| Host Link | Omron | @xx[cmd][data][FCS]*\r\n |
| S7-200 PPI | Siemens | Start 0x10, dest/src address, function, CRC |
| CompoWay/F | Omron | [STX 0x02][station][SID][data][ETX 0x03][FCS] |
14.3 Practical Tips for Unknown Protocol Reverse Engineering
- Start with the defaults: Try 9600-8-N-1 first (covers ~80% of industrial devices)
- Leverage the device manual: Even partial documentation helps identify the protocol family
- Correlate with known I/O: If you know what the PLC is controlling (e.g., a drive speed), look for that value in the captured data
- Use pattern matching: Many binary protocols use fixed headers or sync bytes (0x55AA, 0x0243, etc.)
- Test with a Bus Pirate: Send known bytes and observe the device response to build a command set
- Check B&R source code: If you have the Automation Studio project, search for DV_Frame or DRV_mbus calls to understand the current implementation
14.4 Migrating from Serial to Ethernet
When replacing a serial connection:
- Keep the serial link operational during migration
- Install serial-to-Ethernet converters (see Section 15)
- Configure the converter for the exact serial parameters (baud, parity, etc.)
- Test Ethernet-side connectivity before cutting over
- Update the B&R PLC program to use TCP/UDP or Modbus TCP instead of serial
15. Serial-to-Ethernet Conversion Options
15.1 Why Convert Serial to Ethernet?
- Extend serial device reach beyond 1200 m (RS485) or 15 m (RS232)
- Centralize serial devices on an Ethernet network for SCADA/PC access
- Replace aging serial infrastructure while keeping legacy devices
- Enable remote monitoring of serial traffic over IP
- Add redundancy and easier troubleshooting via network tools
15.2 Serial-to-Ethernet Device Servers
Moxa NPort Series (Industry Standard)
| Model | Ports | Serial Types | Features |
|---|---|---|---|
| NPort 5110 | 1 | RS232 | Basic, cost-effective |
| NPort 5150 | 1 | RS232/422/485 selectable | Software selectable |
| NPort 5210 | 2 | RS232/422/485 | Multi-port |
| NPort 5250 | 2 | RS232/422/485 | Industrial-grade |
| NPort 6110 | 1 | RS232 | Basic |
| NPort 6250 | 2 | RS232/422/485 | Advanced |
| NPort DE-211 | 1 | RS232/422/485 | Compact |
Operating modes:
- Virtual COM mode: Presents serial ports as virtual COM ports on a remote PC — transparent to existing software
- TCP Server mode: Device server listens for TCP connections — PLC or PC initiates connection
- TCP Client mode: Device server initiates TCP connection to a specified IP:port
- UDP mode: Connectionless datagram mode for low-latency applications
- Pair connection: Two device servers form a transparent serial tunnel
Other Manufacturers
| Manufacturer | Product Line | Notes |
|---|---|---|
| Lantronix | XPort, UDS1100 | Compact embedded solutions |
| Digi International | PortServer, ConnectPort | Wide range of port counts |
| Perle | IOLAN | Industrial-grade, DIN-rail mount |
| Silex Technology | SX-DS Series | Cost-effective alternatives |
| USR IOT | USR-TCP232 | Budget-friendly |
15.3 B&R-Specific Integration
B&R X20 controllers can communicate with serial-to-Ethernet converters using:
| Method | Library | Configuration |
|---|---|---|
| Modbus TCP → Modbus RTU conversion | NPort in “Modbus Gateway” mode | Configure NPort to translate Modbus TCP to Modbus RTU; PLC uses Modbus TCP library |
| TCP Socket (raw) | B&R Socket libraries (AsTCP, AsUDP) | B&R opens TCP connection to NPort in TCP Server mode; sends/receives raw serial data |
| Virtual COM (Windows) | DV_Frame via USB/COM port | If B&R Gateway PC is used, NPort creates virtual COM; PC software uses COM port |
15.4 Serial-to-Serial Conversion
When the PLC has the wrong serial type:
| Converter | Converts | Notes |
|---|---|---|
| RS232 → RS485 converter | Single-ended to differential | Enables RS485 multi-drop from RS232 port |
| RS485 → RS232 converter | Differential to single-ended | Isolates RS485 device from RS232 PLC |
| RS422 → RS232 converter | Differential to single-ended | For RS422 sensors |
| RS485 → Ethernet (Moxa) | Serial to IP | Full protocol conversion |
15.5 Configuration Considerations
When setting up serial-to-Ethernet converters:
- Match serial parameters exactly: Baud rate, parity, data bits, stop bits, flow control must match the device
- Set TCP timeouts: Configure idle timeout, connection retry, and reconnection behavior
- Latency: Add inter-character delay if the converter sends too fast for the serial device
- Buffering: Configure FIFO size for burst data
- Termination: If converting RS485, maintain proper 120 Ω bus termination
- Network redundancy: Use dual-NIC converters (e.g., Moxa NPort 6000 series) for redundant Ethernet
16. Common Serial Communication Failures and Debugging
16.1 Physical Layer Problems
| Failure | Symptoms | Cause | Debug Method |
|---|---|---|---|
| No signal on TXD | No response from device | Port not opened, wrong device name, hardware fault | Probe TXD with oscilloscope; check DV_FrameOpen status |
| Garbled data | Random/wrong characters | Baud rate mismatch, parity mismatch | Try all common baud rates; check parity settings |
| Intermittent failures | Communication works sometimes | Loose connector, noise, ground loop, cable too long | Reseat connectors; add ferrite chokes; check shielding |
| No signal on RXD | Device sends but PLC doesn’t receive | RXD/TXD swapped, cable fault, wrong pinout | Verify pin-to-pin mapping; swap TXD/RXD; test with null-modem |
| Signal reflection / corruption | Errors increase with cable length | Missing termination resistors on RS485 | Add 120 Ω resistors at both ends of RS485 bus |
| Ground loop | Erratic behavior, equipment resets | Shield grounded at both ends | Ground shield at one end only; use isolated serial modules |
16.2 Protocol Layer Problems
| Failure | Symptoms | Cause | Debug Method |
|---|---|---|---|
| Timeout errors | dvFRAME_ERR_TIMEOUT or dvMBUS_ERR_TIMEOUT | Device not responding, wrong slave address, wiring fault | Verify device power; check slave address; probe bus activity |
| CRC errors | dvMBUS_ERR_CRC | Parity mismatch, electrical noise, baud rate error | Set correct parity; add termination; reduce cable length |
| Framing errors | Wrong byte values | Baud rate close but not exact (e.g., 4800 vs 9600) | Verify baud rate precisely with oscilloscope |
| Buffer overrun | dvFRAME_ERR_OVERRUN | PLC not reading fast enough, high baud rate | Increase read frequency; lower baud rate; increase buffer size |
| Wrong register values | Device responds but data is wrong | Incorrect register address, wrong data type, byte order | Verify register map; check big/little endian interpretation |
16.3 Configuration Problems
| Failure | Symptoms | Cause | Fix |
|---|---|---|---|
| Port won’t open | DV_FrameOpen returns error | Port already in use by another task | Check for duplicate open calls; close unused ports |
| Wrong device name | Cannot open serial port | Incorrect device name string | Verify name in IO configuration: IF1, CS1020_IF1 |
| PS9600 red overload LED | Segment power fault | Overvoltage, short circuit, second PS module | Check 24 V supply; inspect for shorts; remove duplicate PS |
| Second serial port not working | Only one port active | Added second PS9600 instead of CS1020 | Replace second PS9600 with X20CS1020 |
| Flow control mismatch | Partial data transfer | RTS/CTS enabled on one side only | Set flow control to None on both sides, or wire all handshake lines |
16.4 Environmental Problems
| Problem | Impact | Mitigation |
|---|---|---|
| EMI/RFI interference | Corrupted frames, CRC errors | Use shielded cable; route away from VFDs and motors; add ferrite chokes |
| Temperature extremes | Intermittent failures, connector corrosion | Use industrial-rated connectors; proper cabinet ventilation |
| Vibration | Loose connections, intermittent open circuits | Use screw terminals with lock-washers; avoid relying on friction-fit connectors |
| Moisture | Short circuits, corrosion | Use IP-rated enclosures; sealed connectors; desiccant in cabinet |
17. Troubleshooting Matrices
17.1 Quick Diagnostic Flowchart
Serial Communication Failure
│
├─ No data at all?
│ ├─ Probe TXD with oscilloscope → No signal?
│ │ ├─ Check DV_FrameOpen / DRV_mbusOpen status
│ │ ├─ Verify device name (IF1 vs CS1020_IF1)
│ │ └─ Check if port is already open by another task
│ │
│ └─ TXD active but no response?
│ ├─ Verify RXD wiring (swap TXD/RXD)
│ ├─ Check device power
│ ├─ Verify slave address (Modbus)
│ └─ Check signal ground connection
│
├─ Garbled/wrong data?
│ ├─ Try 9600-8-N-1 (most common)
│ ├─ Try 9600-8-E-1 (Modbus RTU)
│ ├─ Try 19200-8-N-1
│ ├─ Measure bit width with oscilloscope for exact baud rate
│ └─ Check parity on both sides
│
├─ Intermittent failures?
│ ├─ Check RS485 termination (120 Ω at both ends)
│ ├─ Check for ground loops (shield grounded at both ends)
│ ├─ Inspect connectors for looseness
│ ├─ Measure cable length vs baud rate limits
│ └─ Check for EMI sources near cable run
│
└─ CRC / framing errors?
├─ Verify parity matches on both sides
├─ Reduce baud rate
├─ Replace cable with shielded twisted pair
├─ Add RS485 termination if missing
└─ Check for signal reflections with oscilloscope
17.2 B&R-Specific Troubleshooting Matrix
| Symptom | Likely Root Cause | Action |
|---|---|---|
| No characters on TxD (terminal 9) | DV_FrameOpen/DRV_mbusOpen never reached status 0 | Check function block status in watch window; verify IO config of COM port |
| Garbage characters | Baud rate / parity mismatch | Compare device DIP/settings with IO config; measure bit width |
dvFRAME_ERR_TIMEOUT | No response from device | Swap TXD/RXD; verify GND; check shield termination; verify device power |
dvFRAME_ERR_OVERRUN | Baud rate too high or noisy cable | Lower baud rate; use shielded twisted pair cable |
| DRV_mbus CRC error | Parity mismatch or electrical noise | Set parity to Even; add 120 Ω termination on RS485 legs |
| PS9600 red overload LED | Overvoltage or short on bus | Check 24 V supply; inspect terminals for shorts |
| Second PS9600 fitted | Bus conflict (one PS per segment) | Remove second PS9600; install X20CS1020 for additional serial |
| Intermittent communication | Ground loop from double-grounded shield | Ground shield at cabinet entry only |
17.3 Field Commissioning Checklist
| # | Step | Expected Result | Pass Criteria |
|---|---|---|---|
| 1 | Power segment with 24 VDC | PS green LED solid | No red overload LED |
| 2 | Measure +24 V on PS terminals | 23.5–28.0 VDC | Within input spec |
| 3 | Verify TxD idle voltage | -5 V to -12 V (RS232) | RS232 spec compliant |
| 4 | Send test byte; probe RxD at device | Correct byte on scope | Signal polarity matches |
| 5 | Trigger query; capture response on RxD | Expected data pattern visible | No framing errors |
| 6 | Run cyclic program | Values update correctly | Status = 0 in watch window |
| 7 | Run for 1 hour | No intermittent errors | Error counter remains 0 |
18. References and Further Reading
B&R Documentation
- B&R Automation Help Portal: https://help.br-automation.com — DV_Frame library reference, DRV_mbus library reference, X20 system manuals
- X20CP158x / X20CP358x Datasheet: Available from br-automation.com — IF1/IF2 interface specifications and pinouts
- X20 System User’s Manual: Comprehensive X20 hardware and configuration guide
- B&R Automation Studio Online Help: Integrated in IDE; covers IO configuration, serial port setup, library functions
- System 2005 User’s Manual: Covers IF260, IF622, IF671 interface modules
Serial Communication References
- TIA-232-F (RS-232) Standard: Official electrical specification
- TIA-485 (RS-485) Standard: Differential multi-point serial specification
- Modbus Protocol Specification: https://www.modbus.org — Free download of Modbus RTU/TCP specification
- Saleae Logic Analyzer Documentation: Protocol decode guides, async serial analyzer setup
- PicoScope Modbus Decoding Guide: https://www.picotech.com/library/knowledge-bases/oscilloscopes/modbus-serial-protocol-decoding
Tools and Software
- HHD Serial Port Monitor: https://hhdsoftware.com/serial-port-monitor
- Saleae Logic Analyzer: https://www.saleae.com
- COM Sniffer: https://comsniffer.com
- Moxa NPort Configuration Guide: https://www.moxa.com
- QModMaster (free Modbus tool): Available on SourceForge
- RealTerm (serial terminal): https://realterm.sourceforge.io
- PuTTY (terminal emulator): https://www.putty.org
Community Resources
- B&R Community Forum: https://community.br-automation.com — Search for serial communication topics
- PLCtalk.net: https://www.plctalk.net — Industrial automation forums with B&R discussions
- EEVblog Forum: https://www.eevblog.com/forum — Reverse engineering and protocol analysis discussions
- Stack Overflow / Electronics Stack Exchange: Serial protocol debugging Q&A
Cross-References
- io-sniffing.md – general IO traffic sniffing approaches
- physical-layer-sniffing.md – RS-485 physical layer probing
- cp1584-forensics.md – first-contact diagnostic procedures
- modbus-gateway.md – Modbus RTU communication (serial-based)
- config-file-formats.md – serial port configuration files
- diagnostic-workstation.md – serial tap hardware and RS-232/485 adapters
- plc-to-plc.md – inter-PLC serial communication discovery
- grounding-emc.md – serial cable shielding and EMC considerations
- program-reverse-engineering.md – understanding serial protocol implementations
Document covers B&R serial communication diagnostics for System 2003, System 2005, and X20 platforms. Compiled from B&R official documentation, community forums, and industrial automation reference materials.
Key Findings
- B&R serial interfaces (IF1030/IF1041/IF1051) are standard RS232/RS485 — any serial sniffer or protocol analyzer can capture the traffic. The challenge is decoding the application-layer protocol, not the physical layer.
- The RS232 interface (IF1) factory default is 57600 bps, not 115200 bps — always try 57600 first when connecting to an unknown PLC. The baud rate can be configured higher but the default must be assumed.
- Non-invasive serial tapping requires a Y-cable or tap adapter — never break the serial connection on a running machine. Use a 3-port RS232/RS485 tap that monitors traffic passively. See diagnostic-workstation.md for hardware recommendations.
- B&R has no proprietary serial protocol documentation for serial-connected devices — the protocol implementation is in the PLC program (which you don’t have). Reverse-engineer the protocol by capturing traffic and correlating with known device behavior.
- Serial baud rate auto-detection is feasible using statistical analysis — capture raw byte traffic at a high sample rate and use Python to identify the most likely baud rate by analyzing inter-byte timing patterns.
- Modbus RTU over RS485 is the most common serial protocol on B&R systems — if the OEM used Modbus RTU, standard Modbus tools can decode the traffic immediately. See modbus-gateway.md for details.
B&R Automation: Alarm and Event Logging Internals
Understanding how B&R Automation Runtime (AR) stores, structures, and exposes alarm and event data is essential for diagnosing problems on legacy machines where the OEM left no documentation. This document covers where alarms live on the CF card and in AR memory, the internal record format, how to bulk-export alarm history without the original Automation Studio project, and how to set up remote alarm notification when you have no OEM support. Cross-references: diagnostics-sdm.md for SDM-based alarm diagnostics, hmi-integration.md for HMI alarm display, and iiot-retrofit.md for modern alarm forwarding via MQTT/SNMP.
Table of Contents
- Where Alarms Are Stored
- Alarm Record Format and Fields
- Bulk-Exporting Alarm History Without the Original Project
- Remote Alarm Notification: Email, OPC-UA, SNMP
- Alarm Severity Classification
- mapp Alarm Configuration
- Alarm Groups and Categories
- How Alarms Relate to IO States and System Variables
- Custom Alarm Generation from User Programs
- Alarm Visualization on HMI
- Alarm History Analysis and Trending
- Archiving Alarm Data for Compliance
- Alarm Acknowledgment Workflow
- Resetting / Clearing Alarm Buffers
1. Where Alarms Are Stored
1.1 CF Card / CFast Card
B&R controllers store persistent runtime data on CompactFlash (CF) or CFast cards. The card contains multiple partitions:
| Partition | Purpose |
|---|---|
| System partition | Automation Runtime (AR) operating system, logger data, system logbook ($$arlogsys), safety logbook ($$safety) |
| User partition | User application data, custom file exports, CSV files generated by FileIO library calls |
| Configuration | Runtime configuration parameters, network settings, OPC UA certificates |
The CF card also stores AR logbooks in a binary format (*.br files). Logbooks can be retrieved by:
- Plugging the CF card into a PC reader and copying files directly (pre AR 4.91)
- Using Runtime Utility Center (RUC):
Tools > Back up files from Compact Flash / Image file - Using
MO_info()function block (AR 4.91+) to copy logbook modules to the USER partition as.brfiles, then downloading via FTP
Important: Since AR version A4.91, the System partition is protected. Direct FileCopy from the FileIO library no longer works for system logbooks. You must use MO_info() to identify the module’s memory address and length, create a file on the USER partition, then transfer it.
1.1.1 AR Logbook Binary Format (.br files)
The .br logbook files on the CF card are B&R proprietary binary format — there is no public specification for this format. What is known from community reverse-engineering and B&R documentation:
- Header: Contains a magic number/version identifier, creation timestamp, logbook name, and a record count
- Records: Variable-length records, each containing:
- Timestamp (8 bytes: 4-byte date + 4-byte time, B&R format with millisecond resolution on newer AR versions)
- Message severity level (1 byte)
- Message category/code (2 bytes)
- Message text (variable length, null-terminated UTF-8 or ASCII string)
- Additional data fields (depending on logbook type)
- Endianness: Little-endian (x86 native for the CP1584’s Intel Atom)
- No compression: Files are stored uncompressed (unlike some B&R object files)
Practical implications:
- You cannot reliably parse
.brlogbook files without B&R’s proprietary tools (Runtime Utility Center, Automation Studio Logger view) - For custom log analysis, use
ArEventLogorFileIOto write log data in CSV or text format to the user partition - If you need to extract logbook contents programmatically from a running PLC, use the PVI API or OPC UA connection to read the logger data, rather than trying to parse the
.brbinary format - The
MO_info()function block can copy logbook modules to the user partition as.brfiles, but you’ll need Automation Studio’s Logger or the RUC to read them
1.2 AR Memory (Runtime Logger)
Automation Runtime maintains an in-memory Logger system accessible from Automation Studio via Ctrl+L or Open > Logger. There are multiple logbook modules:
| Logbook Name | Identifier | Description |
|---|---|---|
| System logbook | $$arlogsys | General system events, state changes, errors |
| User logbook | (custom name) | Application-specific log messages via ArEventLog or UserLog library |
| Safety logbook | $$safety | Safety-related events and diagnostics |
| Alarm logbook | MpAlarmX managed | Alarm events (raise, acknowledge, clear) |
The ArEventLog library allows user programs to write custom entries into these logbooks. The logger is a ring buffer in memory; older entries are overwritten when the buffer is full. Capacity is configurable in the Runtime configuration.
1.3 Alarm Buffers (MpAlarmX)
The MpAlarmXCore component maintains the live alarm buffer in AR memory. This buffer contains:
- Active alarms: Currently triggered/unresolved alarms
- Acknowledged alarms: Alarms that were raised and acknowledged but the condition still persists
- History ring buffer: A configurable-size circular buffer storing past alarm events
The history buffer size is set during MpAlarmX configuration in Automation Studio. When the buffer fills, oldest entries are overwritten. For persistent history, MpAlarmXHistory exports records to non-volatile storage.
1.4 Storage Architecture Summary
[PLC Program]
|
v
[MpAlarmXCore] -----> In-memory alarm buffer (active + acknowledged)
| |
| v
| [MpAlarmXHistory] -----> CF Card: /AlarmHistory/*.csv
|
v
[ArEventLog / UserLog] -----> AR Logger ring buffer (in-memory)
|
v
[MO_info()] -----> USER partition: *.br files (binary logbook export)
2. Alarm Record Format and Fields
2.1 MpAlarmX Alarm Configuration Fields
Each alarm configured in MpAlarmX has the following properties:
| Field | Type | Description |
|---|---|---|
| Name | STRING | Unique alarm identifier within the alarm list |
| Description / Text | STRING (localizable) | Human-readable alarm description, supports .tmx translation files |
| Group | MpAlarmXGroupIdent | The alarm group this alarm belongs to |
| Category | MpAlarmXCategory | Numeric category code for classification |
| Code | UDINT | Unique alarm code within the system |
| Severity | MpAlarmXSeverity | Severity level (Info, Warning, Error) |
| Priority | USINT | Numeric priority for sorting/display ordering |
| MultipleInstances | BOOL | If TRUE, the same alarm can appear multiple times simultaneously |
| Comment | STRING | Optional static comment text |
| Snippet | STRING | Dynamic text placeholder for runtime-variable content |
2.2 Alarm Record (History Entry) Fields
When an alarm event is recorded (raise, acknowledge, clear), the history record typically contains:
| Field | Description |
|---|---|
| Timestamp | Date and time of the event (AR system clock) |
| AlarmName | The configured alarm name |
| AlarmCode | Numeric alarm code |
| Group | Alarm group identifier |
| Category | Category code |
| Severity | Severity level at time of event |
| State | Current state: Inactive, Active, Acknowledge Required, Acknowledged |
| PreviousState | State before this transition |
| Event Type | What happened: Raise, Acknowledge, Clear, Reset |
| Description | Localized alarm text (with snippet variables resolved) |
| Instance | Instance index (when MultipleInstances = TRUE) |
| PV (Process Value) | The monitored value that triggered the alarm |
| Operator | User who acknowledged (if applicable) |
2.3 CSV Export Format
The MpAlarmXHistory component exports to CSV with semicolon-separated values (typical European format). The column set is fixed and cannot be customized through the standard configuration. Community reports indicate that the standard CSV columns are:
Timestamp;AlarmName;Code;Category;Severity;State;Description;Group;...
If custom column content is needed, users must build their own export using FileIO and reading from the alarm list via the MpAlarmX API.
3. Bulk-Exporting Alarm History Without the Original Project
3.1 Via CF Card Direct Access
If you have physical access to the controller:
- Power down the controller
- Remove the CF/CFast card
- Insert into a PC card reader
- Navigate to the alarm history directory on the USER partition
- Copy CSV files directly
This works if MpAlarmXHistory was configured to periodically export to the CF card’s file system.
3.2 Via Runtime Utility Center (No Project Required)
- Connect to the controller via Ethernet
- Open Runtime Utility Center
- Select
Tools > Back up files from Compact Flash / Image file - Browse the file system to locate alarm history CSVs
- Download files to PC
This method does not require the original Automation Studio project.
3.3 Via FTP
B&R controllers run an FTP server by default:
ftp <controller-ip>
Username: admin (default)
Password: (configured)
Alarm history CSVs are typically located under:
/User/AlarmHistory/(if MpAlarmXHistory was configured with a file device path)/User/(user-defined paths)
3.4 Via OPC UA Client
If OPC UA is active on the controller:
- Connect with any OPC UA client (UA Expert, Prosys, etc.)
- Browse to the alarm node hierarchy under
MpAlarmXList/MpAlarmXCore - The OPC UA Alarm and Events server exposes alarm history that can be queried
- Export the queried events to CSV or database using the client tool
3.5 Programmatic Export via User Program on Controller
If you can load any program (not necessarily the original), you can:
(* Example: Read alarm list and write to CSV using FileIO *)
PROGRAM _ExportAlarms
VAR
fbFileOpen : FileOpen;
fbFileWrite : FileWrite;
fbFileClose : FileClose;
sFileName : STRING := '/User/AlarmExport.csv';
bExecute : BOOL;
sLine : STRING;
END_VAR
The MpAlarmXList function block provides access to alarm data programmatically. You iterate through the alarm list, build CSV strings, and write using the FileIO library.
3.6 Important Caveat
Without the original project, you lose the alarm configuration context (alarm name meanings, severity mappings, group definitions). The exported data will contain raw alarm codes and names. Having the .tmx translation files from the CF card helps decode alarm descriptions.
4. Remote Alarm Notification: Email, OPC-UA, SNMP
4.1 Email Notification (mapp Tweet)
B&R offers mapp Tweet (product code 1TGMPTWEET.20-01) for sending alarm notifications directly from the machine to service technicians via:
- SMS text messages
Configuration in Automation Studio:
- Add
MpTweetmapp component to the project - Configure SMTP server settings (server address, port, authentication)
- Define recipient lists (phone numbers for SMS, email addresses)
- Link alarm events to tweet triggers using function block calls
Typical trigger pattern:
(* When critical alarm is raised, send notification *)
IF MpAlarmXCore.AlarmState[ALARM_CRITICAL_OVERTEMP].bActive THEN
MpTweet.Send(
sRecipient := '+1234567890',
sMessage := 'ALARM: Critical overtemperature detected on Unit 3'
);
END_IF
4.2 OPC UA Alarm and Events
B&R provides native OPC UA Alarm and Events (A&E) server functionality:
- MpAlarmXCore is the core alarm management instance
- MpAlarmXList provides the list interface linked to the core
- Link
MpAlarmXListtoMpAlarmXCorein the mapp Services configuration view - The OPC UA server automatically exposes alarms as OPC UA condition objects
Any standard OPC UA client can subscribe and receive real-time alarm notifications. The OPC UA A&E model supports:
- Alarm severity
- Acknowledge/confirm methods
- Alarm condition state transitions
- Historical alarm queries
To activate OPC UA on the target:
- Enable OPC UA in the Runtime configuration
- Configure certificates (B&R’s user role system manages OPC UA access rights)
- Ensure the
MpAlarmXListandMpAlarmXCoreare properly linked
Note: Activating OPC UA can cause exceptions on some controllers (particularly X20 CP 0482) if memory or configuration parameters are not properly set.
4.3 SNMP
B&R controllers support SNMP v1 for monitoring. While B&R does not have a built-in mapp component specifically for SNMP alarm traps, you can:
- Use the controller’s SNMP agent (configured in Runtime network settings)
- Send SNMP traps via custom program logic using the
MpSNMPlibrary or third-party approaches - Use mapp Tweet as the primary notification mechanism instead of SNMP traps
- For APROL systems, the alarm system integrates with SNMP notifications natively
In practice, most B&R alarm remote notification is done through OPC UA (for SCADA/DCS integration) or mapp Tweet (for email/SMS to service technicians).
B&R SNMP OIDs relevant to alarm/system monitoring:
The B&R Enterprise MIB root is 1.3.6.1.4.1.2706 (B&R’s PEN). Known OID branches include:
| OID Branch | Description | Alarm Relevance |
|---|---|---|
1.3.6.1.4.1.2706.1 | B&R products system group | Controller identification |
1.3.6.1.4.1.2706.1.1 | System description | Firmware version, model |
1.3.6.1.4.1.2706.1.2 | System status | CPU load, memory, temperature |
1.3.6.1.4.1.2706.1.3 | IO system status | IO module health indicators |
Important: B&R does not publish a formal alarm-specific SNMP MIB for the CP1584. The standard MIB provides hardware health metrics but not individual alarm instances. For alarm-level SNMP notifications, you must implement custom trap generation in the PLC program using the
AsSnmplibrary (if available) or use a PLC-to-SCADA bridge (OPC UA to SNMP).
Quick SNMP health check:
snmpwalk -v1 -c public <CP1584_IP> 1.3.6.1.4.1.2706.1
4.4 Notification Architecture
[MpAlarmXCore]
|
+---> [MpAlarmXList] -- OPC UA Server -- OPC UA Clients (SCADA, Historian)
|
+---> [User Program Logic]
|
+---> [MpTweet] -- SMTP -- Email / SMS
|
+---> [Custom SNMP] -- SNMP Traps -- NMS
|
+---> [HTTP Client] -- REST API -- Custom endpoints
5. Alarm Severity Classification
5.1 Severity Levels in mapp AlarmX
B&R’s mapp AlarmX uses a severity-based classification system with three primary levels:
| Severity | Level | Typical Color | Machine Response |
|---|---|---|---|
| Info | Low | Blue / Cyan | Informational notification only; no machine reaction |
| Warning | Medium | Yellow / Orange | Warning message displayed; machine may enter reduced operation mode |
| Error | High / Critical | Red | Controlled shutdown sequence; safety stop may be triggered |
5.2 Severity in Practice
Alarm severity determines how the machine should respond. The AlarmX Framework (mapp Framework 6) provides a complete reaction-mapping template using these three severity groups:
- Info reactions: Log event, display on HMI, optional notification
- Warning reactions: Warning banner on HMI, reduced operation mode, alert operator
- Error reactions: Emergency stop, safe shutdown, mandatory acknowledgment, alert service
5.3 Severity as Numeric Value
Internally, severity is represented as a numeric value. B&R enumerations are always internally a DINT (32-bit signed integer). The MpAlarmXSeverity enumeration values used in the mapp AlarmX API are:
| Enum Value | Name | Severity Level | OPC UA Range | Typical Use |
|---|---|---|---|---|
| 0 | MpAlarmXSeverityInfo | Info / Low | 1-399 | Informational events, cycle counters, state changes |
| 1 | MpAlarmXSeverityWarning | Warning / Medium | 400-699 | Threshold warnings, approaching limits, reduced operation |
| 2 | MpAlarmXSeverityError | Error / High | 700-999 | Faults, shutdown events, safety violations |
Note: These are the native B&R enumeration values. When alarms are exposed via OPC UA, B&R applies a severity scaling factor to map into the OPC UA 1-999 range. The OPC UA severity for a B&R
Erroralarm is typically 700-800,Warningis 400-500, andInfois 100-200. The exact OPC UA mapping depends on the mapp AlarmX configuration (severity can be customized per alarm instance).
Using severity in program code:
// Filtering alarms by severity in a PLC program
IF alarm.eSeverity >= MpAlarmXSeverityError THEN
// Critical alarm: trigger safe shutdown
bEmergencyStop := TRUE;
ELSIF alarm.eSeverity >= MpAlarmXSeverityWarning THEN
// Warning: log and notify operator
nWarningCount := nWarningCount + 1;
ELSE
// Info: log only
nInfoCount := nInfoCount + 1;
END_IF;
// Comparing severity numerically (since enum is DINT internally)
IF alarm.eSeverity = 2 THEN
// Error-level alarm
END_IF
5.4 OPC UA Severity Mapping
When alarms are exposed via OPC UA, B&R severity levels map to OPC UA severity fields:
- OPC UA defines severity as a
UInt16where:- 1-399: Low (informational)
- 400-699: Medium (warning)
- 700-999: High (critical/error)
The B&R mapping typically places:
- Info = low severity range
- Warning = mid range
- Error = high range
6. mapp Alarm Configuration
6.1 Core Components
The mapp AlarmX system consists of several key components configured in Automation Studio:
| Component | Role |
|---|---|
| MpAlarmXCore | Central alarm management engine; processes alarm states, maintains buffer |
| MpAlarmXList | Alarm list instance; defines a collection of alarms linked to a core |
| MpAlarmXConfig | Runtime alarm configuration function block for dynamic alarm creation |
| MpAlarmXConfigAlarm | Used to create/modify individual alarms programmatically |
| MpAlarmXHistory | Alarm history export to persistent storage (CSV) |
| MpAlarmXSet | Function to manually set/trigger an alarm |
| MpAlarmXReset | Function to manually reset/clear an alarm |
| MpAlarmXAcknowledge | Function to acknowledge an alarm |
6.2 Configuration in Automation Studio
- Create MpAlarmXCore in the mapp Services configuration tree
- Create MpAlarmXList and link it to the core instance
- Add alarms to the list using the configuration editor:
- Right-click the alarm list > Add Alarm
- Configure Name, Description, Group, Category, Code, Severity
- Set monitoring type (discrete, analog limit, etc.)
- Configure history by adding
MpAlarmXHistoryand specifying the export path (e.g.,/User/AlarmHistory/) - Configure snippets for dynamic text content (e.g., showing the actual process value in the alarm text)
6.3 Performance Considerations
MpAlarmXConfigAlarm opens, loads, and writes the configuration every time you save an alarm (new or modified). For large alarm counts (100+), configuration save time increases exponentially. Solutions:
- Use the AS6 Alarm List configuration (more modular, avoids programmatic creation overhead)
- Batch alarm creation during initialization, not at runtime
- Use the
MpAlarmXConfigAlarmsparingly
6.4 Alarm Types
| Type | Description |
|---|---|
| Discrete Value Monitoring | Monitors a Boolean variable; alarm triggers on FALSE-to-TRUE (or TRUE-to-FALSE) transition |
| Analog Limit Monitoring | Monitors a numeric variable against high/low limits |
| Deviation Monitoring | Detects when a value deviates from a setpoint by a configured threshold |
| Rate-of-Change Monitoring | Triggers when a value changes too quickly |
| User Alarm (Manual Trigger) | Alarms set/reset programmatically via MpAlarmXSet / MpAlarmXReset |
7. Alarm Groups and Categories
7.1 Alarm Groups
Alarm groups provide organizational structure for alarms. In the configuration:
- Group names are defined per group for display, acknowledgment, and blocking purposes
- Alarms are assigned to a group via the
Groupproperty - The APROL alarm system uses groups extensively: “The group names used in the alarm modules are defined for a group with regard to display, acknowledgment and blocking”
- Groups enable:
- Bulk acknowledge all alarms in a group
- Filter alarm lists by group on HMI
- Group-based blocking/inhibition during maintenance
7.2 Categories
Categories provide a numeric classification separate from severity:
- Category is a
UDINTvalue assigned per alarm - Used for additional filtering and classification beyond severity
- Can represent alarm source (IO module, axis, safety system, etc.)
- The
Codefield combined withCategoryuniquely identifies an alarm across the system - In OPC UA, category maps to the alarm’s condition type
7.3 Multiple Instances
When MultipleInstances is set to TRUE in the MpAlarmX configuration:
- The same alarm definition can appear multiple times simultaneously
- Each instance tracks its own state independently
- Useful for array-based monitoring (e.g., 100 identical sensors with the same alarm definition)
- Each instance is identified by an instance index
8. How Alarms Relate to IO States and System Variables
8.1 Discrete Alarm Binding to Digital IO
The most direct binding uses Discrete Value Monitoring:
Alarm configuration:
Monitoring type: Discrete Value Monitoring
PV (Process Variable): gAxis[1].stStatus.Error (BOOL)
Trigger: Rising edge (FALSE -> TRUE)
When the linked variable transitions from FALSE to TRUE, the alarm is automatically raised. No explicit MpAlarmXSet call is required. When the variable returns to FALSE, the alarm clears automatically.
8.2 Analog Limit Binding
For analog inputs (e.g., temperature, pressure):
Alarm configuration:
Monitoring type: Analog Limit Monitoring
PV: gTempSensor[3].rValue (REAL)
High limit: 85.0
Low limit: 10.0
Hysteresis: 2.0
The alarm triggers when the process value crosses the configured limits. Hysteresis prevents chattering near the limit boundary.
8.3 Array-Based Alarm Checking
For systems with many similar IO points, B&R supports efficient array-based monitoring:
FOR i := 1 TO MAX_CONVEYORS DO
gConveyorAlarm[i].bTrigger := gConveyor[i].stIO.bError;
END_FOR
Link each array element to its corresponding alarm via the alarm configuration, avoiding manual configuration of hundreds of individual alarms.
8.4 IO Module Diagnostics as Alarm Sources
B&R IO modules provide diagnostic datapoints that can feed alarms:
- SerialNumber and ModuleID datapoints for module-specific diagnostics
- Module status registers (wire-break, short-circuit, overload)
- X20/X67 bus diagnostics
- Temperature monitoring of the IO module itself
8.5 System Variable Monitoring
Any AR global variable can be monitored:
- Motion control status (
mcAxisstate, following error) - Communication status (EtherCAT, POWERLINK, OPC UA connection state)
- Timer and counter values
- Computed process values
9. Custom Alarm Generation from User Programs
9.1 Using MpAlarmXSet / MpAlarmXReset
For alarms that require complex trigger logic beyond simple limit monitoring:
(* Manual alarm trigger from application logic *)
IF (gMotor[1].stStatus.bOverload AND gMotor[1].bEnabled) THEN
MpAlarmXSet(
xListIdent := gAlarmListIdent,
wAlarmName := 'MotorOverload',
xMultipleInstance := FALSE
);
END_IF
(* Clear the alarm when condition resolves *)
IF NOT gMotor[1].stStatus.bOverload THEN
MpAlarmXReset(
xListIdent := gAlarmListIdent,
wAlarmName := 'MotorOverload'
);
END_IF
9.2 Using ArEventLog for Custom Log Messages
For logging custom messages (not formal alarms) to the system logbook:
(* Using the ArEventLog library *)
ArEventLogWriteLog(
pLogName := 'UserLog',
eLogLevel := AR_EVENT_LOG_LEVEL_WARNING,
sMessage := 'Maintenance mode activated by operator'
);
The UserLog library also provides user-specific logging:
- Creates custom logger instances in the PLC
- Accessible via the standard Logger in Automation Studio (Ctrl+L)
- Supports different log levels (Info, Warning, Error, Fatal)
9.3 Advanced: MpAlarmXConfigAlarm for Dynamic Alarms
For scenarios where alarms must be created at runtime (e.g., after configuration is loaded from a recipe):
MpAlarmXConfigAlarm(
xListIdent := gAlarmListIdent,
sAlarmName := sDynamicAlarmName,
sDescription := sDynamicDescription,
udiCode := udiAlarmCode,
eSeverity := MpAlarmXSeverity#Error,
eCategory := 10,
xEnable := TRUE
);
Warning: This approach has significant performance implications for large alarm counts. Use sparingly.
9.4 The AlarmX Framework Approach
The open-source AlarmX Framework (mapp Framework 6) provides a cleaner pattern:
- 100 preconfigured discrete monitoring alarms
- Unified Boolean trigger interface
- Localizable text templates
- Built-in severity-based reaction mapping
- Per-alarm inhibition logic (for maintenance/commissioning modes)
10. Alarm Visualization on HMI
10.1 Standard mapp View Widgets
| Widget | Purpose |
|---|---|
| AlarmList | Primary alarm list display; shows active and historical alarms with filtering |
| AlarmBanner | Horizontal bar showing count of unacknowledged/active alarms |
| AlarmPopup | Pop-up dialog when a new alarm is raised |
| AlarmDetails | Detailed view of a selected alarm with all fields |
10.2 AlarmList Widget Configuration
The AlarmList widget subscribes to the OPC UA alarm node set and renders:
- Active alarms (unacknowledged)
- Acknowledged alarms (condition still present)
- Historical alarms (cleared)
Configuration options:
- Link to a
MpAlarmXListinstance - Filter by group, category, severity
- Sort by timestamp, severity, name
- Column visibility
- Item selection events (returns
severity,index)
10.3 Severity-Based Styling
Alarm items’ color/icon changes based on severity:
- Error: Red background/icon
- Warning: Yellow/orange background/icon
- Info: Blue background/icon
Custom styling is possible:
- Use the configuration dialogue to set severity-dependent colors
- For advanced customization beyond the standard dialogue, connect widgets directly to
MpAlarmXListUIConnectTypefor full programmatic control
10.4 Custom Alarm UI (MpAlarmXListUIConnectType)
For requirements beyond the standard widgets (role-based acknowledge, custom comments):
(* Connect to alarm list UI *)
gAlarmUIConnect.xListIdent := gAlarmListIdent;
gAlarmUIConnect.bAcknowledge := bAckButton AND bUserHasPermission;
(* Check selected alarm properties *)
IF gAlarmUIConnect.wSelectedSeverity >= 400 AND gCurrentUserRole >= ROLE_SHIFT_LEADER THEN
bAckEnabled := TRUE;
ELSE
bAckEnabled := FALSE;
END_IF
10.5 mapp View Pages for Alarm Interaction
The AlarmX Framework includes prebuilt mapp View pages:
- Active alarm display
- Alarm history browsing
- Alarm query execution and results viewing
- Acknowledge and reset actions
11. Alarm History Analysis and Trending
11.1 MpAlarmXHistory Component
The MpAlarmXHistory function block manages alarm history export:
- Configured as a separate component in the mapp Services tree
- Exports alarm events to CSV files on persistent storage
- Configurable export path (e.g.,
/User/AlarmHistory/) - Supports periodic or on-demand export
- CSV format is fixed (cannot customize columns through standard configuration)
11.2 Accessing History Data
On the controller:
- CSV files in the configured directory on the CF card USER partition
- Accessible via FTP for download
- Can be read programmatically with
FileIOlibrary
In Automation Studio:
- Logger view (Ctrl+L) shows real-time alarm events
- Alarm events from MpAlarmX are visible in the logger alongside system events
Via OPC UA:
- OPC UA historical alarm queries supported by the alarm server
- OPC UA clients can browse, filter, and aggregate historical alarm data
11.3 AlarmX Framework Query Architecture
The AlarmX Framework provides a built-in alarm query system:
- State machine for query execution
- Preconfigured
ActiveAlarmsquery - Support for adding additional queries (e.g., “all Error-severity alarms from the last 24 hours”)
- mapp View pages for selecting and viewing query results
11.4 External Analysis
For deeper trending and analysis:
- Export CSV via
MpAlarmXHistoryor FTP - Import into analysis tools (Excel, Python/pandas, Grafana, etc.)
- Typical analyses:
- Alarm frequency by severity over time
- Most frequently occurring alarms
- Mean time between alarm occurrences (MTBA)
- Alarm flood detection (rate-of-change analysis)
- Correlation with process data
- Root cause analysis via alarm sequence patterns
11.5 APROL Alarm System
For B&R’s APROL process control system, the AlarmMonitor provides the logged-in operator with a clear display of all alarms assigned based on the authorization system, with advanced filtering, grouping, and analysis capabilities beyond the standard mapp AlarmX.
12. Archiving Alarm Data for Compliance
12.1 Regulatory Requirements
Industrial compliance standards (FDA 21 CFR Part 11, ISA-18.2, IEC 62682) require:
- Tamper-proof alarm records
- Time-stamped audit trail
- Retention for defined periods (typically 1-5 years)
- Operator identification for acknowledgments
- Complete alarm lifecycle recording (raise, acknowledge, clear)
12.2 B&R Archiving Strategies
Level 1 - On-Controller Archiving:
- Use
MpAlarmXHistorywith regular CSV export to CF card - Implement file rotation (by date) to manage storage
- Copy files to USB via
AsUSBlibrary for physical offload
(* Daily alarm history export *)
IF gClock.bNewDay THEN
MpAlarmXHistory.Export(
sFilePath := CONCAT('/User/AlarmHistory/', gClock.sDateStr, '.csv')
);
END_IF
Level 2 - Network Archiving:
- FTP alarm history files to a central server
- Use OPC UA subscription for real-time alarm logging to a historian database
- SNMP traps to a network management system with logging
Level 3 - Enterprise Archiving:
- OPC UA A&E integration with SCADA/historian (e.g., APROL, Wonderware, Ignition)
- MpAudit integration for audit-trail compliance
- Automated backup of CF card contents via Runtime Utility Center scripting
12.3 Using MpAudit for Compliance
B&R’s MpAudit system provides audit-trail logging:
- “User Defined Events” can be sent to the audit log
- Operator actions (acknowledgments, resets) can be logged with user identity
- Audit data includes timestamp, user, action description
- Can be combined with alarm acknowledgment workflows
Example pattern:
"Service - John Doe acknowledged error 558 by changing broken sensor"
12.4 Data Integrity
- CF cards use SLC or MLC NAND flash with error detection and correction
- System partition is protected since AR 4.91
- Binary logbook exports via
MO_info()preserve data integrity - OPC UA communication is secured with X.509 certificates
12.5 Backup and Retention
- Regular CF card backup via Runtime Utility Center
- Network-based backup to file server (FTP/SMB)
- Consider CF card replacement schedule (flash memory has finite write cycles)
- SLC cards offer significantly longer endurance than MLC
13. Alarm Acknowledgment Workflow
13.1 Alarm Lifecycle States
[Inactive] --(condition TRUE)--> [Active / Unacknowledged]
|
v
[Acknowledged] --(condition FALSE)--> [Inactive]
|
v
(condition remains TRUE)
|
+---> stays [Acknowledged]
State transitions:
- Inactive -> Active: Alarm condition detected (variable change, limit exceeded, manual set)
- Active -> Acknowledged: Operator acknowledges the alarm
- Acknowledged -> Inactive: Alarm condition clears (variable returns to normal, manual reset)
- Active -> Inactive: Condition clears before acknowledgment (flash alarm)
13.2 Acknowledgment Methods
HMI Acknowledgment:
- Click acknowledge button on the AlarmList widget
- Built-in acknowledge button in the alarm viewer
- Individual alarm acknowledge (select alarm, then press acknowledge)
AcknowledgeAllbutton to acknowledge all active alarms simultaneously
Programmatic Acknowledgment:
(* Acknowledge a specific alarm *)
MpAlarmXAcknowledge(
xListIdent := gAlarmListIdent,
wAlarmName := 'MotorOverload'
);
(* Acknowledge all alarms in a list *)
MpAlarmXAcknowledgeAll(
xListIdent := gAlarmListIdent
);
Role-Based Acknowledgment (Custom Implementation): B&R does not natively support role-based acknowledgment within MpAlarmX. Workarounds:
- Widget event binding: Use the AlarmList widget’s
ItemClickevent (returnsseverity), combine with current user role to conditionally enable/disable the acknowledge button - Custom UI with MpAlarmXListUIConnectType: Build your own alarm table with full control over acknowledge permissions
- Application-level control: Disable HMI acknowledge entirely; use
MpAlarmXAcknowledge()in application code after checking user role:IF bAckButtonPressed AND gCurrentUser.eRole >= ROLE_SERVICE THEN MpAlarmXAcknowledge(...); END_IF
13.3 Acknowledgment with Comments
Native operator comments on individual alarms are not built into MpAlarmX. Workarounds:
- Snippets: Add comment-like text via configured snippets in the alarm definition (set when alarm activates, not by operator later)
- MpAudit integration: Before acknowledging, let operator select a reason from a dropdown/text input, then send the combined message (alarm ID + operator + reason) to the audit log as a “User Defined Event”
13.4 Acknowledgment Persistence
- Acknowledgment state is maintained in the MpAlarmXCore buffer
- If the controller restarts, acknowledgment state may be lost (alarms return to “Active” state)
- For persistent acknowledgment tracking, use
MpAlarmXHistoryexport or external logging
14. Resetting / Clearing Alarm Buffers
14.1 Clearing Individual Alarms
(* Reset a specific alarm manually *)
MpAlarmXReset(
xListIdent := gAlarmListIdent,
wAlarmName := 'SensorFault_42'
);
This transitions the alarm from any state back to Inactive, regardless of the underlying condition.
14.2 Clearing All Alarms in a List
(* Reset all alarms *)
MpAlarmXResetAll(
xListIdent := gAlarmListIdent
);
Caution: This clears all alarm states, including those that may still have active conditions. The alarms will be re-triggered on the next cycle if the condition persists.
14.3 Deleting Alarm History
The MpAlarmXHistory component supports deleting alarm history:
- History can be cleared/deleted through the
MpAlarmXHistoryfunction block - Typically done via a maintenance-mode routine
- Confirm before executing as this is irreversible
Community guidance: Use MpAlarmXHistory.DeleteAlarmHistory() or equivalent method through the history component configuration.
14.4 Clearing the AR Logger / Logbook
The AR system logbooks are ring buffers in memory. To clear:
- In Automation Studio: Open Logger (Ctrl+L), right-click a logbook module, select “Clear”
- Programmatically: Not directly supported; the ring buffer is managed by AR
14.5 Resetting the MpAlarmXCore Buffer
To reset the entire in-memory alarm buffer (not history):
- Stop the MpAlarmXCore cyclic task
- Clear all alarms using
MpAlarmXResetAll - Restart the cyclic task
- Or simply perform a warm restart of the controller
14.6 Maintenance Mode Considerations
The AlarmX Framework provides per-alarm inhibition logic:
- Alarms can be disabled based on a shared condition
- Common conditions: maintenance mode, commissioning mode, tool change, manual jogging
- This is preferred over clearing buffers, as it preserves alarm configuration while suppressing false triggers during maintenance
(* Inhibit all alarms during maintenance *)
gAlarmInhibit := gSystemMode = MODE_MAINTENANCE;
(* Each alarm checks the inhibit flag before triggering *)
IF gAlarmInhibit THEN
(* Alarm is suppressed, not triggered, not logged *)
ELSE
(* Normal alarm processing *)
END_IF
14.7 CF Card File Management
For managing accumulated alarm history CSVs on the CF card:
(* Delete alarm files older than 90 days *)
IF gClock.bNewDay THEN
FileDelete(sFileName := CONCAT('/User/AlarmHistory/', sOldDate, '.csv'));
END_IF
Use the FileIO library for file operations:
FileOpen,FileRead,FileWrite,FileCloseFileDelete,FileRenameDirGetFirstEntry,DirGetNextEntryfor directory listing
Appendix A: Key Function Blocks Reference
| Function Block | Library | Purpose |
|---|---|---|
MpAlarmXCore | mapp AlarmX | Core alarm management engine |
MpAlarmXList | mapp AlarmX | Alarm list instance linked to core |
MpAlarmXSet | mapp AlarmX | Manually trigger an alarm |
MpAlarmXReset | mapp AlarmX | Manually reset/clear an alarm |
MpAlarmXAcknowledge | mapp AlarmX | Acknowledge a specific alarm |
MpAlarmXAcknowledgeAll | mapp AlarmX | Acknowledge all alarms in a list |
MpAlarmXResetAll | mapp AlarmX | Reset/clear all alarms |
MpAlarmXConfigAlarm | mapp AlarmX | Create/modify alarm at runtime |
MpAlarmXHistory | mapp AlarmX | Export alarm history to file |
ArEventLogWriteLog | ArEventLog | Write to AR system logbook |
MO_info | Runtime | Get logbook module address/length for export |
MpTweet | mapp Services | Send SMS/email notifications |
Appendix B: Key File Paths
| Path | Description |
|---|---|
/System/ | AR system files, logbooks (protected since AR 4.91) |
/User/ | User partition for application data |
/User/AlarmHistory/ | Default location for MpAlarmXHistory CSV exports |
/User/*.br | Exported binary logbook files |
Appendix C: Runtime Utility Center Quick Reference
- Connect to controller via Ethernet
Tools > Back up files from Compact Flash / Image file- Select target CF card or image
- Browse file system, select files, download
Appendix D: Useful B&R Community Links
- MpAlarmX - Complete alarm management (Automation Studio Help)
- mapp AlarmX video tutorials (YouTube: B&R Industrial Automation channel)
- mapp Framework 6: AlarmX Framework (open source, B&R Community CoLab)
- OPC UA Alarm and Events with MpAlarmXList & MpAlarmXCore (Community thread)
- Role-Based Acknowledge Permissions (Community thread)
- ArEventLog example code (Community thread)
- Saving logbook to file device (Community thread)
- Retrieving log book from CF/CFast (Community thread)
Cross-References
- diagnostics-sdm.md – system-level diagnostics and SDM logbook
- system-variables.md – AR system variables for runtime monitoring
- opcua.md – OPC-UA alarm integration and subscription
- pvi-api.md – PVI alarm event callbacks
- cp1584-forensics.md – forensic analysis of alarm history
- ftp-web-interface.md – FTP access to alarm log files on CF card
- time-sync.md – timestamp correlation across alarm events
- iiot-retrofit.md – remote alarm notification (MQTT, SNMP, email)
- hmi-integration.md – alarm display on HMI panels
- online-changes.md – runtime alarm threshold modification
Key Findings
- B&R alarm management is split across multiple systems: MpAlarmX (mapp framework), Visual Components (legacy HMI), and OPC-UA alarms. On an undocumented machine, check which system is in use by examining the running program’s libraries.
- Alarms are stored on the CF card in non-volatile memory and persist across power cycles, but buffer capacity is finite — oldest entries get overwritten. Extract alarms proactively via FTP or SDM system dumps.
- The SDM system dump is the single most valuable alarm artifact for undocumented machines — it captures the full alarm history, logger output, and configuration without needing Automation Studio.
- Remote alarm notification (email, OPC-UA, SNMP, MQTT) requires configuration that the OEM may not have set up. The IIoT retrofit path in iiot-retrofit.md covers bridging alarms to modern protocols.
- Alarm severity classification follows the MpAlarmX priority levels (Info, Warning, Error, Critical), and each alarm instance carries timestamps, acknowledge status, and optional parameter data.
- Legacy Visual Components alarms use a different architecture than mapp MpAlarmX — when working with older AR versions, alarm access patterns differ significantly.
B&R Safe I/O and Safety System Diagnostics
Safety systems on B&R installations — including Safe I/O modules, SafeLOGIC controllers, and openSAFETY communication — operate independently of the standard control program and enforce SIL-rated safety functions. When a safety system faults, the machine stops, and diagnosing the root cause without OEM documentation or safety engineering expertise is extremely challenging. This document covers how B&R safe I/O modules work, SIL rating verification, safety program structure, how to diagnose safety system faults, and how to back up and restore safety parameters when the OEM is no longer available. Cross-references: io-card-hardware.md for general IO card architecture, diagnostics-sdm.md for SDM diagnostic integration, and cp1584-hardware-ref.md for CP1584 hardware specifications relevant to safety.
Comprehensive Technical Reference
Table of Contents
- B&R Safe I/O Modules (Safe I/O, SafeLOGIC)
- SIL Rating Verification
- Safety Program Structure in B&R
- Diagnosing Safety System Faults
- Safety Parameter Backup/Restore When OEM is Unavailable
- SafeLOGIC Configuration Files on CF Card
- FSoE (Fail Safe over EtherCAT/Ethernet) on B&R
- Safety-Rated I/O Modules and Their Diagnostics LEDs
- How to Replace a Safe I/O Module
- Safety System Reset Procedures
- Diagnostic Events and Error Codes for Safe Systems
- Certification Requirements and Documentation
- Black Channel Concept and Safety Communication
1. B&R Safe I/O Modules (Safe I/O, SafeLOGIC)
1.1 Architecture Overview
B&R’s integrated safety technology eliminates the need for standalone safety relays by embedding safety functions directly into the standard automation controller and I/O infrastructure. The B&R safety system architecture comprises:
- SafeLOGIC Controllers — dedicated safety processing units that execute the safety application independently from the standard PLC program.
- Safe I/O Modules — safety-rated input and output modules that connect physical safety devices (E-stops, light curtains, guard switches, safety mats) to the SafeLOGIC controller.
- SafeLOGIC-X Controllers — intelligent programmable safety modules that integrate SafeLOGIC functionality directly into an I/O slice, enabling decentralized safety logic at the I/O station level.
- SafeDESIGNER — the integrated development tool within Automation Studio for programming safety functions.
- openSAFETY — B&R’s open, TUV-certified safety protocol for transmitting safety data over industrial Ethernet.
1.2 SafeLOGIC Controller Families
| Controller | System | Network | Max Safe Nodes | Key Features |
|---|---|---|---|---|
| X20SL8001 | X20 | POWERLINK | 100 | Base SafeLOGIC, 1 ms cycle, SIL 3 / PL e |
| X20SL8100 | X20 | POWERLINK | 100 | Extended SafeLOGIC, integrated on X2X link |
| X20SL811 | X20 | POWERLINK | 100 | SafeLOGIC with SafeKEY hardware key |
| X20SLX811 | X20 | X2X | Station-level | SafeLOGIC-X, decentralized safety at I/O station, SIL 3 / PL e, ATEX |
| X67 SafeLOGIC | X67 | X2X/IP67 | Station-level | IP67-rated decentralized safety controller |
1.3 Safe I/O Module Families
X20 Safe Digital Input Modules:
| Module | Channels | Rating | Features |
|---|---|---|---|
| X20SI9100 | 20 DI + 4 pulse | SIL 3 / PL e, Cat. 4 | Safe digital inputs with pulse evaluation |
| X20SI4100 | 4 DI | SIL 3 / PL e, Cat. 4 | Compact safe digital input |
| X20SD5141 | 4 DI | SIL 3 / PL e, Cat. 4 | Safe digital input, compact form |
X20 Safe Digital Output Modules:
| Module | Channels | Rating | Features |
|---|---|---|---|
| X20SO9110 | 20 DO | SIL 3 / PL e, Cat. 4 | Safe digital outputs for actuator control |
| X20SO4110 | 4 DO | SIL 3 / PL e, Cat. 4 | Compact safe digital output |
| X20SO4111 | 4 DO (dual-ch) | SIL 3 / PL e, Cat. 4 | Dual-channel test output |
X20 Safe Mixed I/O Modules:
| Module | Channels | Rating | Features |
|---|---|---|---|
| X20SM5143 | 4 DI + 4 DO | SIL 3 / PL e, Cat. 4 | Mixed safe I/O for guard monitoring + safe stop |
X67 Safe I/O Modules (IP67):
| Module | Channels | Rating | Features |
|---|---|---|---|
| X67SB4100 | 4 DI | SIL 3 / PL e | IP67 safe digital input |
| X67SB4110 | 4 DO | SIL 3 / PL e | IP67 safe digital output |
| X67SC4122 | 4 DI + 4 DO | SIL 3 / PL e | IP67 mixed safe I/O |
1.4 Safe I/O and Standard I/O Coexistence
Safe I/O modules can be freely combined with standard I/O modules on the same X2X or POWERLINK bus. Each SafeLOGIC controller is assigned a unique SafeLOGIC ID (safety domain number) that defines which safe I/O modules belong to its safety domain. This allows multiple SafeLOGIC controllers to operate on the same physical network without interference.
1.5 SafeLOGIC-X Technology
SafeLOGIC-X is B&R’s decentralized safety concept where the safety controller is integrated directly into the I/O slice (e.g., X20SLX811). This approach:
- Reduces response times by processing safety logic locally at the I/O station
- Eliminates the need for a central SafeLOGIC controller for distributed machines
- Supports up to SIL 3 / PL e
- Communicates over the X2X link (bus module backplane)
- Maintains the same SafeDESIGNER programming environment
2. SIL Rating Verification
2.1 Applicable Standards
B&R safety products are certified to the following functional safety standards:
| Standard | Scope | Applicability |
|---|---|---|
| IEC 61508 | Functional safety of E/E/PE systems | SIL 1–3 for system design |
| IEC 62061 | Safety of machinery — functional safety | SIL 1–3 for machine safety |
| ISO 13849-1 | Safety of machinery — safety-related parts of control systems | PL a–e, Cat. B/1/2/3/4 |
| IEC 61800-5-2 | Adjustable speed electrical power drive systems — safety functions | STO, SS1, SS2, SLS, SOS, SBC, SSM, SLI, STI, SLP |
| EN ISO 25119 | Safety of agricultural machinery | AgPL a–d |
2.2 B&R Safety Ratings
B&R’s X20 SafeLOGIC controllers and Safe I/O modules achieve:
- SIL 3 per IEC 61508 (hardware) and IEC 62061 (system)
- PL e, Category 4 per ISO 13849-1
- Certified by TUV Rheinland and TUV SUD
These ratings apply to the complete safety channel (SafeLOGIC + Safe I/O module + safe application programmed in SafeDESIGNER). The achieved SIL/PL must be verified for each individual safety function in the machine risk assessment.
2.3 How to Verify SIL Rating on a B&R Safety System
-
Check the module datasheet: Every B&R Safe I/O module and SafeLOGIC controller datasheet states the maximum achievable SIL/PL/Cat. rating. Datasheets are available from the B&R product page or via the Automation Studio help system.
-
Review the safety report: After compiling a safety project in SafeDESIGNER, a
*.safetcreportfile is generated. This report documents:- PFHd (Probability of Dangerous Failure per Hour) for each safety function
- Achieved SIL/PL for the complete safety function chain
- Diagnostic coverage (DC) per channel
- Mean Time to Dangerous Failure (MTTFd) values
- Common Cause Failure (CCF) metrics
- Architecture class (A, B, C, D) per ISO 13849-1
-
Verify with the module status: Each SafeLOGIC controller provides diagnostic datapoints accessible in Automation Studio:
ModuleOk— indicates hardware health of the safety controllerConfigMatch— verifies that the downloaded safety configuration matches the hardwareSafetyState— shows the current state of the safety application
-
Cross-reference the TUV certificate: B&R publishes TUV certificates for safety products. The certificate number and scope are listed on the product page at br-automation.com.
-
Automation Studio verification workflow:
SafeDESIGNER > Safety Project > Build → Check the .safetcreport output → Verify PFHd ≤ required threshold for target SIL → Confirm architecture meets Cat. 3 or Cat. 4 requirements → Verify DCavg ≥ 99% for SIL 3 / PL e
2.4 SIL Verification During Commissioning
During commissioning, SIL verification involves:
- Confirming all safety components in the bill of materials are certified to the required level
- Verifying wiring meets dual-channel requirements for Cat. 3/4
- Running the safety acceptance test (SAT) documented in the machine’s safety design report
- Recording all test results and comparing against the safety requirements specification (SRS)
3. Safety Program Structure in B&R
3.1 SafeDESIGNER — The Safety Programming Tool
SafeDESIGNER is B&R’s integrated safety engineering tool, embedded within Automation Studio. It provides:
- Graphical Function Block programming (CFC — Continuous Function Chart) with virtual wiring of certified safety function blocks
- PLCopen-certified safety function blocks — a TUV Rheinland-certified library of 20+ function blocks for machine automation
- IEC 61131-3 language support — ST (Structured Text) for safety logic alongside graphical CFC
- Strict data type separation — safe data types (prefixed
SAFE) cannot be mixed with standard data types, enforced by the compiler - Integrated simulation — ARsim supports safety program simulation offline
- Safety project compilation — the AR safety compiler generates a signed safety configuration that is transferred to the SafeLOGIC controller
3.2 Safe Task Classes
B&R safety programs execute in dedicated task classes, separate from standard PLC task classes:
| Task Class Type | Typical Cycle Time | Purpose | Notes |
|---|---|---|---|
| Safety Task | 1 ms (minimum) | Executes the safety application on the SafeLOGIC controller | Configured in SafeDESIGNER, not in the standard task configuration |
| Cyclic Task | 1–100 ms | Standard PLC application, exchanges data with safety task via I/O mapping | Priority hierarchy: Safety > high-priority cyclic > normal cyclic |
The safety application cycle time is a critical parameter:
- Configured via the
Cycle_Time_usparameter in SafeDESIGNER (in microseconds) - Minimum cycle time is 1 ms (1000 us)
- The safety cycle time directly affects the safety response time of the overall system
- Safety response time = input filter time + cycle time * 0.05 + cycle time of safety application + output reaction time
3.3 Safe IEC Functions — PLCopen Safety Library
B&R provides a TUV-certified library of safety function blocks conforming to the PLCopen standard. Function blocks are identified by a red “S” on a yellow background in the SafeDESIGNER palette.
Core Safety Function Blocks:
| Function Block | Standard | Description |
|---|---|---|
SF_EmergencyStop | PLCopen | Emergency stop evaluation with dual-channel monitoring |
SF_SafetyDoor | PLCopen | Guard door / safety gate monitoring with interlock |
SF_LightCurtain | PLCopen | Safety light curtain Type 2/4 monitoring |
SF_TwoHandControl | PLCopen | Two-hand control station evaluation (Type IIIC) |
SF_SafetyMat | PLCopen | Safety mat and edge evaluation |
SF_ESPE | PLCopen | Emergency stop evaluation (type-dependent) |
SF_SSD | PLCopen | Safety standstill detection |
SF_SLS | PLCopen | Safely limited speed monitoring |
SF_SLP | PLCopen | Safely limited position |
SF_STO | PLCopen | Safe torque off |
SF_SS1 | PLCopen | Safe stop 1 |
SF_SS2 | PLCopen | Safe stop 2 |
SF_TimerESTOP | PLCopen | Emergency stop timer for Category 0/1 stop |
SF_LatchReset | PLCopen | Latch with reset (acknowledge required) |
SF_Gate_2Ch | PLCopen | Two-channel gate switch monitoring |
SF_Bypass | PLCopen | Manual bypass for maintenance mode |
SF_Diagnostics | PLCopen | Diagnostic code output for each safety function block |
User-defined function blocks (green background) can also be created for reusable safety logic patterns.
3.4 Data Mapping Between Safety and Standard Programs
The safety application and standard PLC application are strictly separated. Data exchange occurs through mapped variables:
SafeDESIGNER I/O Mapping:
Safe Application Variable → Mapped Variable → Standard Application Variable
──────────────────────── ────────────── ────────────────────────────
SF_EmergencyStop.SafeOut → mapp Safety → bEStop_Active (BOOL)
DiagCode → mapp Safety → nDiagCode (USINT)
SafeLOGIC controller channels can transfer diagnostic codes from PLCopen function blocks to the standard application. Diagnostic data flows unidirectionally from safe to standard — the standard program can read safety status but cannot write to safety inputs.
3.5 Safety+ — Next Generation Safety Programming
B&R’s Safety+ platform extends the traditional SafeDESIGNER model with:
- Open code base with digital fingerprint protection — the safety configuration is versioned and traceable, enabling Git-based workflows
- CLI “headless” architecture — safety projects can be built, verified, and deployed without the full AS GUI, enabling CI/CD pipelines
- Third-party tool integration — static analysis (e.g., SCA tools), version control (Git), and automated testing can validate safety changes
- Automatic safety configuration updates — when hardware is replaced, Safety+ automatically downloads the correct safety configuration to the replacement module, eliminating manual parameter transfer
- Remote maintenance and integrated diagnostics — remote safety system monitoring with structured diagnostic output
- mapp Safety components — mapp Safety components for rapid safety function development ( alarms, diagnostics, parameter management)
Safety+ and the OEM-unavailable scenario:
Safety+ addresses several critical pain points for engineers maintaining undocumented systems:
- The automatic configuration download feature means that replacing a safe I/O module of the same type does not require SafeDESIGNER access — the controller pushes the safety configuration to the new module automatically (see Section 9.2 for SafeLOGIC-X replacement)
- The CLI headless build capability enables automated safety validation pipelines that check safety configuration integrity without manual GUI interaction
- Digital fingerprints allow you to verify that a safety configuration hasn’t been tampered with by comparing fingerprints before and after maintenance
Safety+ vs SafeDESIGNER comparison:
| Feature | SafeDESIGNER (Traditional) | Safety+ (Next Gen) |
|---|---|---|
| Programming | GUI-only (CFC) | CLI + GUI |
| Version control | Manual file management | Git-native with digital fingerprints |
| Module replacement | May require re-download of config | Automatic config download |
| CI/CD integration | Not supported | Headless CLI build |
| Static analysis | Manual | Tool-integrated |
| Remote maintenance | Limited | Built-in remote diagnostic |
| Automation Studio version | AS 4.x | AS 6.x (with mapp Framework 6) |
Important: Safety+ requires Automation Studio 6.x and mapp Framework 6. These are incompatible with AS 4.x. If the CP1584 runs AS4, Safety+ features are not available — you must use traditional SafeDESIGNER. However, if you migrate to newer B&R hardware (X20CP3484+), Safety+ becomes available and significantly simplifies safety system maintenance. See firmware-version-mgmt.md for AS6 migration details and remanufacturing.md for hardware migration planning.
4. Diagnosing Safety System Faults
4.1 B&R Diagnostic Toolchain
B&R provides a layered diagnostic approach for safety system troubleshooting. Use tools in this priority order:
| Tool | Access Method | Best For | Safety Relevance |
|---|---|---|---|
| Module LEDs | Visual inspection | First-pass hardware health | Primary safety fault indicator |
| System Diagnostics Manager (SDM) | http://<plc-ip>/sdm | System dump, log files, drive I&M data | Safety subsystem logs, SBC errors |
| Automation Studio Online Diagnostics | AS > Online > Diagnostics | Real-time error trace, variable monitoring | Safety variable states, diagnostic codes |
| SafeDESIGNER Diagnostics | AS > SafeDESIGNER > Online | Safety function block states, diagnostic outputs | Per-FB diagnostic codes |
| mapp Alarm / mapp Logger | AS > mapp components | Structured event capture, severity classification | Safety alarm events |
| Network Command Trace | AS > Configuration > Network | Telegram-level POWERLINK/EtherCAT analysis | Safety communication integrity |
| ARsim | AS > Simulation | Offline testing of safety logic | Logic verification before deployment |
4.2 Systematic Fault Diagnosis Procedure
Step 1 — Identify the fault indicator:
- Which LED is in error state on the SafeLOGIC controller or Safe I/O module?
- Is the
ModuleOkdatapoint FALSE in Automation Studio? - Is there a safety diagnostic code from a PLCopen function block?
- Is the SDM Logger showing a SafetyError entry?
Step 2 — Determine fault domain:
Safety Fault?
/ \
Yes No
/ \
Safety Hardware? Standard PLC fault
/ \ (not safety-related)
SafeLOGIC? Safe I/O?
(controller (module LEDs,
LEDs/SDM) module OK)
Step 3 — Check the SDM Logger:
- Open browser →
http://<plc-ip>/sdm - Navigate to System > Logger
- Filter by
SafetyError,SafetyWarning,SBC - Download as CSV for analysis
- Cross-reference timestamps with operator actions and safety I/O events
Step 4 — Check Safety Function Block Diagnostics:
- In SafeDESIGNER, go Online
- Monitor the diagnostic output of each safety function block (typically a USINT diagnostic code)
- Cross-reference the diagnostic code against the PLCopen function block documentation
Step 5 — Verify Safety Configuration:
- In Automation Studio, check if the I/O configuration matches the physical hardware
- Verify that the SafeLOGIC ID matches the expected safety domain
- Confirm the safety CRC checksum matches (displayed in the SDM)
- Check for firmware/parameter version mismatch
4.3 Common Safety Fault Patterns
| Symptom | Likely Cause | Diagnostic Method | Resolution |
|---|---|---|---|
ModuleOk = FALSE on SafeLOGIC | Hardware fault or power issue | Check SDM Logger, verify 24V supply | Replace SafeLOGIC controller, check power |
ModuleOk = FALSE on Safe I/O module | Module fault, wiring error, or config mismatch | SDM Logger, physical LED check | Replace module, verify wiring, re-download config |
| Safety outputs stuck in safe state | Safety input active, or internal latch | Check which FB diagnostic code is nonzero | Clear safety input, acknowledge latch |
| Safety configuration CRC mismatch | Configuration downloaded but hardware changed | SDM > System > I&M data | Re-download safety configuration |
| Safety communication timeout | openSAFETY/FSoE connection lost | SDM Logger, Network Command Trace | Check cabling, verify network topology |
| Safe task class cycle violation | Safety program exceeds cycle time | AS > Online > Task Class Monitor | Optimize safety logic, increase cycle time |
4.4 SDM (System Diagnostics Manager) — Deep Dive
The SDM is the on-board web server embedded in every B&R controller. It is the primary diagnostic tool when safety faults are not visible in the standard PLC Logger.
Access: http://<controller-ip>/sdm
Key SDM Features for Safety Diagnostics:
- System Dump: Bundles logger entries, runtime measurements, and I&M data for all connected devices including safety modules
- Logger: Historical log of all events including safety subsystem events (SafetyError, SafetyWarning, SBC entries)
- I&M (Identification & Maintenance): Serial numbers, firmware versions, module type, operating hours for each safety module
- Network Topology: Shows all connected modules and their communication status
Important: The safety subsystem writes diagnostic entries to the SDM Logger even when the standard PLC Logger is empty. When investigating safety faults, always check the SDM Logger first.
5. Safety Parameter Backup/Restore When OEM is Unavailable
5.1 The Challenge
When the original OEM is unavailable and the Automation Studio project file is lost, the safety configuration (parameters, I/O mapping, safety program logic) must be recovered from the running system. B&R safety systems store safety configurations on the controller’s CompactFlash (CF) card, but there are important constraints.
5.2 What Can Be Backed Up
| Data | Backup Method | Restore Method |
|---|---|---|
| Standard PLC program + configuration | Automation Studio: Target > Backup > Create (produces .abk file) | Target > Backup > Restore |
| CF card raw image | dd disk imaging (sector-by-sector copy) | dd restore to identical CF card |
| Safety configuration (compiled) | Downloaded to SafeLOGIC via SafeDESIGNER — embedded in the AS backup | Re-upload via SafeDESIGNER from backup |
| Safety parameter sets | Stored on CF card as part of the configuration | CF card imaging restores them |
| I&M data and logger | SDM > System > Dump (downloadable) | Not directly restorable (informational) |
5.3 Method 1 — Automation Studio Online Backup (Preferred)
Requirements: Automation Studio software installed, Ethernet connection to PLC.
- Connect to the B&R PLC via Ethernet (target IP address)
- Open Automation Studio →
Online > Connect - Select the target device and establish communication
- Navigate to
Target > Backup > Create - Select Full Backup (includes OS, runtime, user data, and safety configuration)
- Save to local PC (e.g.,
Machine1_FullBackup_20260710.abk) - Verify backup completes without errors
Restore:
- Connect to target PLC in Online mode
Target > Backup > Restore- Select the
.abkbackup file - Confirm — this overwrites all runtime data
- Controller restarts automatically
5.4 Method 2 — Direct CF Card Imaging (When AS Project is Unavailable)
Requirements: Card reader, disk imaging software, replacement CF card.
Backup:
- Power down the B&R controller
- Remove the CF card
- Connect CF card to PC via card reader
- Create raw image:
# Linux dd if=/dev/sdX of=BR_Safety_CF_Backup_20260710.img bs=4M conv=noerror,sync # Windows (via Win32 Disk Imager or WSL dd) dd if=\\.\E: of=BR_Safety_CF_Backup.img bs=4M conv=noerror,sync - Verify the image by mounting it and checking contents
- Store the image file with documentation of: controller model, firmware version, date, machine ID
Restore:
- Insert replacement CF card (same capacity or larger, same type)
- Write the image:
dd if=BR_Safety_CF_Backup_20260710.img of=/dev/sdX bs=4M conv=noerror,sync - Safely eject and insert into B&R controller
- Power on and verify boot sequence completes
5.5 Method 3 — CF Card File-Level Backup
The B&R CF card typically contains these directories and files relevant to safety:
/ (CF card root)
├── System/
│ ├── ARconfig — Automation Runtime configuration
│ ├── Safety/ — Safety configuration files (SafeLOGIC)
│ │ ├── SafetyConfig.dat
│ │ ├── SafetyCRC.chk
│ │ └── SafetyParams/
│ │ └── *.par — Safety parameter sets
│ └── I&M/ — Identification & Maintenance data
├── User/
│ └── <project_name>/ — User application files
└── Log/ — Runtime logger files
Note: Safety configuration files on the CF card are compiled and signed by the SafeDESIGNER safety compiler. They cannot be edited directly — they can only be replaced by a new compilation from SafeDESIGNER or by restoring the raw image.
5.6 Critical Limitations
- Safety program source code cannot be recovered from a compiled safety configuration. Without the original SafeDESIGNER project, you cannot modify the safety logic — you can only restore an exact copy.
- CF card imaging preserves the running configuration but does not allow viewing or editing the safety program.
- Version matching is critical: The Automation Studio version used to restore must match the runtime version on the PLC.
- After restore, a full safety acceptance test must be performed before returning the machine to production.
5.7 Best Practices for OEM-Unavailable Scenarios
- Always perform a raw CF card backup immediately upon receiving a machine with unknown history
- Document the current safety state before any changes: capture SDM dump, logger output, and I&M data
- Store backups on multiple media (network drive, USB, cloud)
- Record the controller firmware version, AS version, and module serial numbers with each backup
- If modifications are needed and no AS project exists, contact B&R support or a certified B&R integrator for project recovery options
6. SafeLOGIC Configuration Files on CF Card
6.1 CF Card Directory Structure for Safety
The B&R CompactFlash card stores both the standard Automation Runtime image and the safety-related configuration. The safety-specific files reside under the System/Safety/ directory tree.
6.2 Key Safety Files
| File/Directory | Description |
|---|---|
System/Safety/SafetyConfig.dat | Compiled safety configuration generated by SafeDESIGNER (binary, signed) |
System/Safety/SafetyCRC.chk | CRC checksum of the safety configuration — verified by SafeLOGIC at startup |
System/Safety/SafetyParams/*.par | Safety parameter sets including SafeLOGIC IDs, cycle time, safety response time defaults |
System/Safety/SafeLOGIC_X/ | SafeLOGIC-X specific configuration (for decentralized safety controllers) |
System/Safety/FSoE/ | FSoE / openSAFETY configuration files for safety communication |
System/ARconfig | Automation Runtime master configuration (references safety module placement) |
System/Safety/SafeKEY.dat | SafeKEY hardware key data (for X20SL811 controllers) |
6.3 SafeLOGIC ID Configuration
The SafeLOGIC ID is a unique identifier that defines the safety domain. It is configured:
- In SafeDESIGNER under Safety Project Properties
- Written to the CF card as part of the safety parameter set
- Each safe I/O module must be assigned to a SafeLOGIC ID to be part of that safety domain
- The SafeLOGIC ID is verified at startup — a mismatch between the CF card configuration and the physical module placement will cause a configuration fault
6.4 Safety Response Time Parameters
Critical safety timing parameters stored on the CF card:
| Parameter | Location | Default/Range | Description |
|---|---|---|---|
Cycle_Time_us | SafetyParams | 1000 us (min 1000) | Safety application cycle time |
Response_Time_Default | SafetyParams | Configurable | Default safety response time for the safety domain |
SBC_t_diag | SafeMOTION config | 200 ms (typical) | Safe Brake Control diagnostic time |
Filter_Time | Per-module config | Configurable | Input filter time for safe digital inputs |
6.5 Configuration Verification at Startup
When the SafeLOGIC controller boots, it performs these verification steps:
- Read the safety configuration from the CF card
- Verify the CRC checksum against
SafetyCRC.chk - Verify the SafeLOGIC ID matches the configured hardware topology
- Verify each safe I/O module’s position matches the expected configuration
- Initialize the safety communication (openSAFETY / FSoE) connections
- If all checks pass, transition to SafeOperational state
- If any check fails, transition to SafeFault state (safe outputs de-energized)
6.6 Protecting Safety Configuration Files
- Safety configuration files are signed by the SafeDESIGNER safety compiler
- Modifying safety files outside SafeDESIGNER invalidates the signature
- The SafeLOGIC controller will reject unsigned or CRC-failed configurations
- For X20SL811, the SafeKEY hardware token provides an additional layer of protection — the safety configuration is encrypted to the specific SafeKEY
7. FSoE (Fail Safe over EtherCAT/Ethernet) on B&R
7.1 FSoE Overview
Safety over EtherCAT (FSoE) is the open protocol for transmitting safety data over EtherCAT, developed within the EtherCAT Technology Group (ETG). FSoE uses the Black Channel principle (see Section 13) and is certified to SIL 3 per IEC 61508, standardized in IEC 61784-3.
B&R supports both openSAFETY (B&R’s own open safety protocol) and FSoE (EtherCAT safety protocol), depending on the communication infrastructure:
| Protocol | Transport | Standard | Max SIL/PL |
|---|---|---|---|
| openSAFETY | POWERLINK, Ethernet, X2X, EtherCAT | IEC 61784-3 Ed. 2 | SIL 3 / PL e |
| FSoE | EtherCAT | IEC 61784-3 Ed. 2 (profile) | SIL 3 / PL e |
7.2 FSoE Frame Structure
The FSoE protocol embeds safety data as a container within standard EtherCAT process data:
FSoE Frame (minimum 6 bytes):
┌─────────┬───────────┬───────┬───────┬─────────────┐
│ CMD │ Safe Data │ CRC_0 │ CRC_1 │ ConnID │
│ (1 byte)│ (N bytes) │(2 b) │(2 b) │ (1 byte) │
└─────────┴───────────┴───────┴───────┴─────────────┘
- CMD: Command byte (init, data, acknowledge, etc.)
- Safe Data: Actual safety payload (every 2 bytes protected by CRC)
- CRC_0 / CRC_1: 16-bit CRC checksums for data integrity verification
- ConnID: Connection identifier (1-byte) to prevent cross-connection errors
The maximum Safe Data length is not restricted by the protocol itself.
7.3 FSoE on B&R — Topology
B&R supports two FSoE topology models:
Decentralized Safety Logic:
- The FSoE MainInstance (safety logic) is implemented in an EtherCAT SubDevice (e.g., SafeLOGIC-X on X2X link)
- The EtherCAT MainDevice (B&R CPU) handles standard data and routes FSoE frames
- SubDevice-to-SubDevice communication is required — the MainDevice copies relevant input data blocks between SubDevices
- Configuration defined in the ENI file (EtherCAT Network Information) via
CopyInfoselements
Centralized Safety Logic:
- The FSoE MainInstance is integrated into the EtherCAT MainDevice (B&R SafeLOGIC controller)
- Simpler configuration — no SubDevice-to-SubDevice communication needed
- The controller must be safety-certified
- Reduced cycle time overhead for safety data
7.4 openSAFETY on B&R
openSAFETY is B&R’s contribution to open safety communication:
- Runs on POWERLINK, standard Ethernet, EtherCAT, and X2X link
- Supports up to 100 openSAFETY nodes per SafeLOGIC controller
- Features deterministic safety communication with guaranteed cycle times
- TUV-certified, IEC 61508 SIL 3
- Configuration via SafeDESIGNER within Automation Studio
7.5 Configuring FSoE/openSAFETY Communication
- In Automation Studio, add the SafeLOGIC controller to the I/O configuration
- Assign SafeLOGIC IDs to define safety domains
- Connect safe I/O modules to the appropriate SafeLOGIC ID
- Configure safety communication parameters (guard time, watchdog time)
- In SafeDESIGNER, map safety variables to FSoE/openSAFETY communication objects
- Build and transfer the safety configuration to the SafeLOGIC controller
7.6 Safety Communication Monitoring
The SafeLOGIC controller continuously monitors safety communication integrity:
- Watchdog timer: If an FSoE frame is not received within the watchdog time, a communication fault is declared
- CRC verification: Every received frame’s CRC is verified
- Connection ID check: Prevents frames from being misinterpreted between different connections
- Sequence monitoring: Detects dropped, duplicated, or out-of-sequence frames
- Guard time: Minimum time between consecutive FSoE frames (detects overrun)
8. Safety-Rated I/O Modules and Their Diagnostics LEDs
8.1 LED Layout on Safe I/O Modules
B&R X20 Safe I/O modules use a consistent LED layout for at-a-glance diagnostics:
| LED | Color/State | Meaning |
|---|---|---|
| Run (R/E) | Green steady | Module operational, no fault |
| Run (R/E) | Green blinking | Module booting / firmware loading |
| Run (R/E) | Red blinking | Class 1 warning (non-safety warning) |
| Run (R/E) | Red steady | Class 2/3 error (hardware or configuration fault) |
| Run (R/E) | Off | No 24V control supply |
| Error (ERR) | Green steady | Safety communication active (FSoE/openSAFETY OK) |
| Error (ERR) | Red steady | Safety fault — configuration mismatch, CRC error, or safety latch |
| Error (ERR) | Off | No safety communication established |
| Channel LEDs (DI) | Green/Yellow/Red | Per-channel input state and diagnostic status |
| Channel LEDs (DO) | Green/Red | Per-channel output state and short-circuit diagnostic |
8.2 SafeLOGIC Controller LEDs
| LED | Color/State | Meaning |
|---|---|---|
| RDY | Green steady | SafeLOGIC ready, in SafeOperational state |
| RDY | Green blinking | SafeLOGIC booting, loading safety configuration |
| RDY | Red steady | SafeLOGIC fault — safe outputs de-energized |
| R/E | Green | Run state (SafeLOGIC-X) |
| R/E | Red | Error state (SafeLOGIC-X) |
| SE | Green | Safety stop active (STO requested) |
| SE | Red steady | Safety latch — SafeMOTION/SBC fault (for SafeMOTION controllers) |
8.3 ACOPOS-Multi SAFE Drive LEDs
| R/E | SE | L/A | State |
|---|---|---|---|
| Off | Off | Off | No 24V control supply / DC bus not powered |
| Green blink | Off | Green blink | Booting / firmware load |
| Green steady | Off | Green/Off | Run, no safety fault |
| Green steady | Green steady | Green | Run with safe stop active (STO requested) |
| Red blink | Off | * | Class 1 drive warning |
| Red steady | Off | * | Class 2/3 drive fault (non-safety) |
| Red steady | Red steady | * | SafeMOTION latch (STO/SBC/SS1/SS2/SOS/SDI/SLS) |
| Red steady | Off | Off | Communication loss |
8.4 Interpreting LED Patterns for Safety Diagnosis
Algorithm for Safe I/O Module LED Diagnosis:
IF Run = RED steady AND Error = RED steady:
→ Safety configuration fault (CRC mismatch, module position wrong, or config not downloaded)
→ Action: Re-download safety configuration from SafeDESIGNER, verify module placement
IF Run = RED steady AND Error = OFF:
→ Standard hardware fault or 24V supply issue (not safety-related)
→ Action: Check 24V supply, replace module if hardware fault
IF Run = GREEN steady AND Error = GREEN steady:
→ Normal operation with active safety communication
→ No action needed
IF Run = GREEN steady AND Error = RED steady:
→ Safety communication established but safety function in fault state
→ Action: Check SafeDESIGNER diagnostics for FB diagnostic codes
IF Channel LED = RED on a safe DI:
→ Channel diagnostic fault (wire break, short circuit, or cross-channel error)
→ Action: Check wiring to that channel, verify dual-channel integrity
IF Channel LED = RED on a safe DO:
→ Output diagnostic fault (short circuit or overload)
→ Action: Check load wiring, verify load does not exceed module rating
9. How to Replace a Safe I/O Module
9.1 Prerequisites Before Replacement
- Verify the replacement module is identical: Same part number, same hardware revision, same firmware version
- Have the safety configuration available: The safety configuration (from SafeDESIGNER) must be ready to download after the hardware swap
- Document the current state: Record module serial number, position in the I/O station, LED states, and any diagnostic codes
- Perform a full backup: Use Method 1 (Automation Studio backup) or Method 2 (CF card imaging) before touching the hardware
9.2 Replacement Procedure (SafeLOGIC System)
For SafeLOGIC (centralized safety controller):
- Stop the machine and place it in a safe state per the machine’s lockout/tagout procedure
- Do NOT power down the controller if the system supports hot-swap of I/O modules (X20 system supports hot-swap for standard I/O; verify support for the specific safe I/O module type)
- Note the exact module position (station number, slot number within the X20 slice assembly)
- Remove the old module:
- Release the terminal block from the electronics module
- Release the electronics module from the bus module
- Remove the bus module from the DIN rail (if required)
- Install the new module:
- Insert the bus module onto the DIN rail
- Attach the electronics module to the bus module
- Reconnect the terminal block (verify wiring matches the terminal diagram)
- Ensure the module clicks into place
- In Automation Studio, go Online and verify the new module is detected:
- Check
ModuleOkfor the replacement module - Verify the module appears in the correct position in the I/O tree
- Check the SDM for any configuration mismatch errors
- Check
- If configuration mismatch occurs (CRC error after module swap):
- Re-download the safety configuration from SafeDESIGNER
- The SafeLOGIC controller will re-verify the configuration against the new hardware
- If using SafeLOGIC-X (X20SLX811), the configuration verification happens automatically — B&R guarantees consistent module configuration across replacements
- Clear any safety latches (see Section 10)
- Run the safety acceptance test:
- Test each safety function connected to the replaced module
- Verify E-stops, guard doors, light curtains, and safe outputs respond correctly
- Document the test results
For SafeLOGIC-X (decentralized safety at I/O station):
SafeLOGIC-X controllers (X20SLX811) provide automatic configuration verification on module replacement. The system guarantees:
- Automatic safety parameter download to replacement modules
- CRC verification of the safety configuration
- Configuration consistency check across the safety domain
- No manual parameter transfer required for same-type module replacements
9.3 Module Replacement for SafeMOTION Drives (ACOPOS-Multi SAFE)
- Power down the drive section (disable DC bus via supply module, wait for capacitor discharge)
- Replace the 8BVI inverter module (match the module variant exactly)
- Re-download the safety configuration — the safety CRC must match
- Execute SafeMOTION acknowledge sequence:
McAcknowledge(mappMotion) orNC.Ack(ACP10) - Re-run the full safety acceptance test (STO, SBC, SS1, SLS)
9.4 Post-Replacement Verification Checklist
- All module LEDs show expected state (green run, no error)
-
ModuleOkis TRUE for all safety modules in Automation Studio -
ConfigMatchis TRUE for the SafeLOGIC controller - No SafetyError entries in the SDM Logger
- All safety inputs respond correctly (E-stops, guards, light curtains)
- All safety outputs switch correctly (contactors, STO on drives)
- Safety response time meets the required specification
- SDM system dump captured and stored with maintenance log
10. Safety System Reset Procedures
10.1 Understanding Safety Latches
B&R safety systems use intentional latching for safety faults. When a safety fault occurs:
- The safety outputs are de-energized (safe state)
- The fault is latched — it persists even after the cause is removed
- The latch must be explicitly acknowledged before the safety system can resume operation
This is by design: It forces the operator to investigate the fault cause before resuming, preventing automatic recovery that could mask a dangerous condition.
10.2 Reset Methods
| Method | When to Use | Procedure |
|---|---|---|
| SafeDESIGNER Acknowledge | After clearing the physical cause of a safety fault | In SafeDESIGNER, use the SF_LatchReset function block or acknowledge via the standard HMI reset button mapped to the safety acknowledge input |
| McAcknowledge (mappMotion) | SafeMOTION safety latch on ACOPOS drives | Call McAcknowledge from the HMI or PLC code on the affected safety axis |
| NC.Ack (ACP10/ACP10M) | SafeMOTION safety latch in ACP10 projects | Use NC.Ack with the safety error class enabled |
| SafeLOGIC Reset (via rotary switch) | SafeLOGIC controller restart | Set rotary switch to position 2, press ENTER; SafeLOGIC restarts and re-initializes |
| Power Cycle | Only as last resort | Power cycle the controller; note that safety latches are retentive — power cycling alone does NOT clear them |
Important: Power cycling does not clear safety latches. The SE LED on ACOPOS-Multi SAFE drives, for example, remains solid red after a power cycle if the fault was not acknowledged. This is intentional.
10.3 Safe Reset Procedure (Step-by-Step)
- Identify and resolve the root cause of the safety fault (check wiring, fix sensor, correct configuration)
- Verify the physical cause is eliminated (measure voltage, check sensor state, confirm wiring)
- Acknowledge the safety fault using the appropriate method above
- Confirm all safety LEDs return to normal state (green run, error off)
- Verify the safety function operates correctly by testing the safety input/output pair
- Resume machine operation only after confirming the safety system is fully operational
10.4 Emergency Safety Reset (Machine-Level)
For machines with a safety reset button (hardware acknowledge):
- Ensure all guard doors are closed
- Ensure all E-stops are released (pulled out)
- Ensure no safety devices are active
- Press and release the safety reset button
- The SafeLOGIC controller verifies all safety inputs are in the permissive state
- Safety outputs are re-energized if all conditions are met
10.5 SafeLOGIC Controller Restart
To fully restart the SafeLOGIC controller:
- Set the rotary switch on the SafeLOGIC module to position 2
- Press the ENTER button
- The SafeLOGIC controller restarts, re-reads the safety configuration from the CF card
- Re-verifies the CRC checksum and module topology
- If all checks pass, transitions to SafeOperational
- If any check fails, remains in SafeFault state
Note: For SafeLOGIC-X (X20SLX811), the procedure is different — it uses the X2X station-level reset procedure. Refer to the module-specific manual.
11. Diagnostic Events and Error Codes for Safe Systems
11.1 PLCopen Safety Function Block Diagnostic Codes
Each PLCopen safety function block in SafeDESIGNER provides a diagnostic code output (typically USINT). These codes indicate the specific state and error condition of each safety function:
Common Diagnostic Code Patterns:
| Code (hex) | Code (dec) | Description | Typical FB |
|---|---|---|---|
| 0x00 | 0 | No fault, function operating normally | All FBs |
| 0x01 | 1 | Input channel A wire break | SF_EmergencyStop, SF_Gate_2Ch |
| 0x02 | 2 | Input channel B wire break | SF_EmergencyStop, SF_Gate_2Ch |
| 0x03 | 3 | Both channels wire break / cross-channel error | SF_EmergencyStop, SF_Gate_2Ch |
| 0x04 | 4 | Input test pulse error | All dual-channel input FBs |
| 0x10 | 16 | Output test pulse error | SF_STO, SF_SS1, SF_SS2 |
| 0x20 | 32 | Safety function timeout | SF_TimerESTOP, timers |
| 0x40 | 64 | Bypass active | SF_Bypass |
| 0x80 | 128 | Internal fault (processor, memory) | Any FB |
11.2 SafeLOGIC Controller Error Codes
| Error Code | Category | Description | Resolution |
|---|---|---|---|
SafetyConfigMismatch | Fatal | Safety CRC on CF card does not match SafeLOGIC checksum | Re-download safety configuration |
ModulePositionMismatch | Fatal | Module is not in the expected position | Verify module placement, re-download config |
SafeLOGIC_ID_Mismatch | Fatal | SafeLOGIC ID on module does not match safety domain | Reassign SafeLOGIC ID in SafeDESIGNER |
CycleTimeViolation | Warning | Safety task exceeded configured cycle time | Optimize safety logic, increase cycle time |
CommunicationTimeout | Fatal | openSAFETY/FSoE communication lost | Check network cabling, verify topology |
WatchdogExpired | Fatal | Safety communication watchdog timer expired | Check bus load, verify cycle time |
FirmwareMismatch | Fatal | Safety firmware version incompatible | Update firmware via Automation Studio |
SafeKEY_Error | Fatal | SafeKEY hardware key not detected or invalid (X20SL811) | Verify SafeKEY insertion |
11.3 SafeMOTION / ACOPOS-Multi Error Codes
| Error Code | Category | Description | Resolution |
|---|---|---|---|
0xFB02 | SBC Error | Brake feedback open circuit | Check brake wiring at X6 connector |
0xFB03 | SBC Error | Brake voltage out of range (< 21.6V or > 26.4V) | Check 24V brake supply |
0xFB10 | SBC Error | Brake driver overtemperature | Wait for cooldown, then acknowledge |
0xFB20 | SS1 Error | Safe stop 1 timeout exceeded | Check drive and motor, verify load |
0xFB30 | SLS Error | Speed exceeded safely limited speed | Reduce speed, check encoder |
0xFB40 | SOS Error | Safe operating stop position violated | Check encoder, verify positioning |
0xFB50 | SDI Error | Safe direction violation detected | Check motor wiring, verify direction config |
0xFB60 | SLP Error | Safely limited position exceeded | Check encoder, verify position config |
SafetyConfigMismatch | Fatal | Drive safety CRC does not match project | Re-download safety config to drive |
11.4 Safe I/O Module Error Codes (SDM Logger)
The SDM Logger reports safety errors with the following pattern entries:
SafetyError— critical safety fault that has de-energized safety outputsSafetyWarning— non-critical safety anomaly that does not affect safety outputsSBC_WARN— Safe Brake Control warning (approaching threshold)SafetyError SBC— Safe Brake Control fault (has latched safety outputs)SafetyError STO— Safe Torque Off activatedSafetyError SS1— Safe Stop 1 activatedSafetyError SLS— Safely Limited Speed violationSafetyError SOS— Safe Operating Stop violation
11.5 Reading Diagnostic Codes in Automation Studio
To monitor safety diagnostic codes online:
- Open Automation Studio, go Online > Connect
- Navigate to the SafeDESIGNER safety project
- Add the diagnostic output variables of each safety function block to a watch window
- Monitor the
DiagCodeoutputs in real-time - Cross-reference diagnostic codes with the PLCopen function block documentation (AS Help > Safety technology > SafeDESIGNER > Function blocks)
Alternatively, transfer diagnostic codes to the standard application via the I/O mapping and display them on the HMI using mapp Alarm.
12. Certification Requirements and Documentation
12.1 B&R Safety Product Certifications
| Certification Body | Scope | Certificate Reference |
|---|---|---|
| TUV Rheinland | X20 SafeLOGIC, Safe I/O modules, SafeDESIGNER safety compiler | TUV certificate per product family |
| TUV SUD | ACOPOS drive safety functions (STO, SS1, SS2, SLS, SOS, SBC, SSM, SLI, STI, SLP) | Z10 16 06 20080 004 |
| TUV SUD Rail GmbH | SIL 3 per IEC 61508, PL e/Cat. 4 per ISO 13849-1, SIL 3 per IEC 62061 | Rail-specific certificate |
12.2 Standards Compliance Matrix
| Standard | Title | B&R Compliance |
|---|---|---|
| IEC 61508 | Functional safety of E/E/PE safety-related systems | SIL 3 (product level) |
| IEC 62061 | Safety of machinery — functional safety | SIL CL 3 (system level) |
| ISO 13849-1 | Safety of machinery — safety-related parts of control systems | PL e, Category 4 |
| IEC 61800-5-2 | Safety functions of power drive systems | STO, SS1, SS2, SLS, SOS, SBC, SSM, SLI, STI, SLP |
| IEC 61784-3 | Functional safety communication profiles | openSAFETY, FSoE |
| EN ISO 25119 | Tractors and machinery for agriculture — safety | AgPL a–d (X90 mobile) |
| IEC 61131-3 | Programmable controllers — programming languages | Supported (ST, CFC, LD, FBD) |
| IEC 62443 | Industrial communication networks — IT security | Supported (mapp Security) |
12.3 Required Documentation for Safety Systems
For compliance with IEC 61508 / ISO 13849-1, the following documentation must be maintained:
| Document | Purpose | Owner |
|---|---|---|
| Safety Requirements Specification (SRS) | Defines all safety functions, their required SIL/PL, and safety integrity requirements | Machine builder / integrator |
| Safety Design Report | Documents the safety architecture, component selection, and verification calculations | Machine builder |
| Safety Validation Report | Records the results of the safety acceptance test (SAT) | Machine builder / integrator |
| PFHd Calculation / SIST Report | Documents the probability of dangerous failure calculations for each safety function | Machine builder |
| Safety Circuit Diagrams | Detailed wiring diagrams showing safety-rated connections (dual-channel) | Machine builder |
B&R Safety Report (.safetcreport) | Auto-generated by SafeDESIGNER, documents achieved SIL/PL for each safety function | Automation engineer |
| Firmware Version Log | Records firmware versions of all safety components | Maintenance / commissioning |
| Certificate of Conformity | B&R’s product-level certificate (TUV) | B&R (product documentation) |
| Operational Manual (Safety Chapter) | Safety-specific operating and maintenance instructions for the end user | Machine builder |
| Proof Test Procedure | Periodic proof test instructions to verify safety function integrity over the machine lifecycle | Machine builder |
12.4 Periodic Proof Testing
Per IEC 61508 and ISO 13849-1, safety functions must be periodically tested to detect latent faults that could cause a dangerous failure. The proof test interval is determined during the PFHd / SIST calculation and depends on:
- The PFHd achieved by the safety function
- The required SIL/PL target
- The diagnostic coverage of the safety components
- The mean time to dangerous failure (MTTFd)
B&R SafeDESIGNER supports proof test configuration:
- Automatic proof testing via the safety application (test pulses on inputs)
- Manual proof test procedures documented in the safety validation report
- Proof test results logged via mapp Audit for traceability
12.5 Safety Acceptance Test (SAT) Checklist
At commissioning or after any safety system modification, execute this minimum test set:
- Emergency Stop Test: Activate each E-stop → verify all motion stops, all safety outputs de-energize
- Guard Door Test: Open each guard door → verify safe state; close and reset → verify normal operation resumes
- Light Curtain Test: Break the light curtain beam → verify safe state; restore beam and reset
- Two-Hand Control Test: Verify both buttons must be pressed within 0.5s; verify release stops motion
- STO Test: Trip STO from safety input → verify drive enters SafeTorqueOff
- SBC Test: Activate STO → verify brake engages (if brake installed)
- SLS Test: Exceed safely limited speed → verify safe stop
- Communication Fault Test: Disconnect safety communication → verify safe state
- Single-Channel Fault Test: Simulate single-channel wire break on a dual-channel input → verify fault detected
- Response Time Test: Measure actual safety response time → verify within specification
13. Black Channel Concept and Safety Communication
13.1 Black Channel Principle
The Black Channel concept is the foundational principle of modern safety communication protocols (FSoE, openSAFETY, PROFIsafe, CIP Safety). It dictates that:
- The communication channel is not trusted: The underlying transport network (EtherCAT, POWERLINK, Ethernet) is treated as unreliable and potentially unsafe (“black”).
- Safety integrity is added on top: Safety-specific mechanisms (CRC, watchdog, connection IDs, sequence numbers) are layered on top of the standard communication to guarantee data integrity and detect all possible communication errors.
- The transport layer does not need to be safety-certified: Because the safety protocol handles all error detection, the underlying network infrastructure can be standard, non-certified hardware and software.
This approach dramatically reduces cost and complexity:
- No need for redundant safety networks
- Standard Ethernet cabling and switches can be used
- Safety data and standard data coexist on the same physical network
- Network equipment does not require safety certification
13.2 Safety Communication Mechanisms (How Black Channel Works)
To achieve SIL 3 integrity over a black channel, the safety protocol implements these mechanisms:
| Mechanism | Purpose | Detects |
|---|---|---|
| CRC (Cyclic Redundancy Check) | Data integrity verification for each safety frame | Data corruption, bit errors, byte errors |
| Connection ID (ConnID) | Prevents frames from being misrouted between different safety connections | Cross-connection, address confusion |
| Watchdog Timer | Detects loss of communication or excessive delay | Communication timeout, frozen device |
| Sequence Number / Toggle Bit | Detects dropped, duplicated, or reordered frames | Frame loss, duplication, reordering |
| Guard Time | Minimum interval between consecutive frames | Frame injection, replay attacks |
| Acknowledgment | Confirms each safety frame was received by the communication partner | Unacknowledged frames |
| Timeout Detection | Detects if the safety cycle is not completed in time | Cycle time overrun, device stall |
13.3 FSoE Black Channel Implementation
In the FSoE protocol specifically:
- The FSoE MainInstance sends an FSoE frame to each FSoE SubInstance within the standard EtherCAT process data
- Each SubInstance responds with its own FSoE frame
- The safety cycle consists of a MainInstance Frame confirmed by a SubInstance Frame
- Each frame includes CMD, Safe Data, CRC_0, CRC_1, and Connection ID
- Every 2 bytes of Safe Data are protected by a 2-byte CRC
- The minimum FSoE frame is 6 bytes
The safety integrity is mathematically proven to detect:
- All single-bit errors
- All double-bit errors in any data unit
- All errors affecting an odd number of bits
- All burst errors up to 16 bits
- Frame duplication, omission, insertion, and reordering
13.4 openSAFETY Black Channel Implementation
B&R’s openSAFETY protocol provides equivalent safety integrity:
- Runs on POWERLINK, Ethernet, EtherCAT, and X2X link
- Uses a similar CRC + sequence number + connection ID + watchdog approach
- Supports up to 100 safety nodes per SafeLOGIC controller
- Safety data is transmitted within standard POWERLINK/Ethernet frames
- Deterministic cycle time guarantees
13.5 Practical Implications for B&R Safety Systems
Network Design:
- Use standard EtherCAT or POWERLINK network infrastructure for safety communication
- No need for special safety switches or redundant network cabling
- Safety data and standard process data share the same network
Commissioning:
- Verify the safety communication watchdog time is set correctly (typically 2-3x the safety cycle time)
- Verify the guard time is appropriate for the network topology
- Confirm the safety CRC is verified at startup (check SDM Logger)
Troubleshooting:
- Communication timeouts are safety faults — check network cabling and topology
- FSoE/openSAFETY connection ID mismatches indicate a configuration error
- Network overload can cause safety communication watchdog expirations — monitor cycle time
Maintenance:
- Standard network switches and cables can be replaced without affecting safety integrity
- Replacing a safety node requires the safety configuration to be re-verified (automatic for SafeLOGIC-X)
- Network changes (adding/removing nodes) may affect safety communication timing — verify after changes
Key Findings
- SafeLOGIC executes safety logic independently from the standard PLC program — safety applications run in dedicated task classes (minimum 1 ms cycle) with strict data type separation (SAFE-prefixed types cannot mix with standard types), ensuring safety integrity even if the standard program crashes.
- Centralized vs. decentralized safety is a critical architectural distinction — centralized (X20SL8001/SL8100/SL811) concentrates safety logic in one controller; decentralized (SafeLOGIC-X, X20SLX811) embeds safety processing at the I/O station for faster local response and eliminates the single point of failure.
- FSoE and openSAFETY both use the Black Channel principle — safety integrity (CRC, watchdog, connection ID, sequence numbering) is layered on top of standard POWERLINK/EtherCAT/EtherNET, meaning standard network switches and cabling require no safety certification and can be replaced without affecting safety integrity.
- SIL 3 / PL e / Category 4 verification requires checking the SafeDESIGNER
.safetcreportoutput — this auto-generated report documents PFHd, diagnostic coverage, MTTFd, and architecture class for each safety function and is the primary evidence for compliance with IEC 61508 and ISO 13849-1. - Safety configuration files on the CF card are compiled and cryptographically signed — they reside under
System/Safety/(SafetyConfig.dat, SafetyCRC.chk) and cannot be edited with a text editor; modifying them outside SafeDESIGNER invalidates the signature and the SafeLOGIC controller will reject them. - Back up safety parameters before any hardware or configuration change — the only ways to preserve the safety configuration are Automation Studio’s full backup (
.abk) or raw CF card imaging (dd); without the original SafeDESIGNER project source, the safety logic cannot be modified, only restored as an exact copy. - Safety latches are intentional and persist through power cycles — a safety fault latch requires explicit acknowledgment (McAcknowledge, NC.Ack, or SF_LatchReset) after the root cause is resolved; power cycling alone will not clear a latched fault, which is by design to prevent masking dangerous conditions.
- After any safety module replacement, a full safety acceptance test must be performed covering all connected safety functions (E-stops, guards, light curtains, STO, SBC) and documented before returning the machine to production — this is mandatory per IEC 61508 / ISO 13849-1.
Appendix A: Quick Reference — Common B&R Safety Part Numbers
| Part Number | Description | SIL/PL |
|---|---|---|
| X20SL8001 | SafeLOGIC controller (POWERLINK) | SIL 3 / PL e |
| X20SL8100 | SafeLOGIC controller (extended) | SIL 3 / PL e |
| X20SL811 | SafeLOGIC controller with SafeKEY | SIL 3 / PL e |
| X20SLX811 | SafeLOGIC-X (decentralized, ATEX) | SIL 3 / PL e |
| X20SI9100 | Safe digital input module (20 DI + 4 pulse) | SIL 3 / PL e, Cat. 4 |
| X20SO9110 | Safe digital output module (20 DO) | SIL 3 / PL e, Cat. 4 |
| X20SM5143 | Safe mixed I/O (4 DI + 4 DO) | SIL 3 / PL e, Cat. 4 |
| X67SB4100 | IP67 safe digital input (4 DI) | SIL 3 / PL e |
| X67SB4110 | IP67 safe digital output (4 DO) | SIL 3 / PL e |
Appendix B: Quick Reference — Diagnostic LED Summary
| Module | Run LED | Error/SE LED | Diagnosis |
|---|---|---|---|
| Safe I/O | Green | Off | Normal |
| Safe I/O | Red steady | Red steady | Configuration/CRC fault |
| Safe I/O | Red steady | Off | Hardware fault |
| SafeLOGIC | Green (RDY) | — | SafeOperational |
| SafeLOGIC | Red (RDY) | — | SafeFault |
| ACOPOS SAFE | Red steady | Red steady | SafeMOTION latch (SBC/STO/etc.) |
| ACOPOS SAFE | Red steady | Off | Standard drive fault |
| ACOPOS SAFE | Green | Green | STO active (normal safe stop) |
Appendix C: Key B&R Safety Software Tools
| Tool | Purpose | Access |
|---|---|---|
| SafeDESIGNER | Safety program development (CFC + ST) | Automation Studio (integrated) |
| Safety+ | Next-gen safety programming with DevOps support | Automation Studio (mapp Safety) |
| SafeMOTION Editor | Safe drive function configuration (STO, SBC, SLS, etc.) | Automation Studio (integrated) |
| SDM (System Diagnostics Manager) | On-board web diagnostics | http://<plc-ip>/sdm |
| ARsim | Offline simulation including safety | Automation Studio |
| Task Class Monitor | Real-time cycle time monitoring per task | Automation Studio > Online > Diagnostics |
| mapp Alarm | Safety alarm management and HMI display | Automation Studio (mapp component) |
| mapp Audit | Audit trail for safety-related operator actions | Automation Studio (mapp component) |
| mapp Logger | Structured event logging with severity classification | Automation Studio (mapp component) |
Appendix D: Safety Troubleshooting Flowchart
START: Safety system fault detected
│
├─ Check module LEDs (visual inspection)
│ ├─ All green → Check SDM Logger for SafetyWarning entries
│ ├─ Run=Red, Error=Red → Configuration fault → Re-download safety config
│ ├─ Run=Red, Error=Off → Hardware fault → Replace module
│ └─ SE=Red (drive) → SafeMOTION latch → Check SDM Logger for SBC/STO/SLS codes
│
├─ Open SDM (http://<plc-ip>/sdm)
│ ├─ System > Logger → Search for SafetyError, SafetyWarning, SBC
│ ├─ System > I&M → Check firmware versions and serial numbers
│ └─ System > Dump → Download full system dump for analysis
│
├─ Open Automation Studio > Online > Diagnostics
│ ├─ Check ModuleOk for all safety modules
│ ├─ Check ConfigMatch for SafeLOGIC controller
│ ├─ Monitor safety function block diagnostic codes
│ └─ Check Task Class Monitor for cycle time violations
│
├─ Identify root cause (wiring, configuration, hardware, communication)
│
├─ Fix the root cause
│
├─ Acknowledge safety latch (McAcknowledge / NC.Ack / LatchReset)
│
├─ Verify all LEDs return to normal (green)
│
└─ Run safety acceptance test → Document results
Appendix E: Cross-References
| Related File | Relevance |
|---|---|
diagnostics-sdm.md | SDM web interface for monitoring safety system status and retrieving logbook entries |
online-changes.md | Online change limitations for safety programs — safety modifications cannot be made online |
alarm-logging.md | Alarm and event logging including safety alarm severity classification |
system-variables.md | System variables related to safety module status and diagnostics |
config-file-formats.md | SafeLOGIC configuration file formats on the CF card |
cf-card-boot.md | CF card backup and restore for safety parameter preservation |
access-recovery.md | Password recovery for SafeDESIGNER and safety program access |
license-mgmt.md | Safety software licensing (SafeDESIGNER, mapp Safe) |
acopos-drives.md | SafeMOTION integration with ACOPOS drives via FSoE |
grounding-emc.md | EMC and grounding requirements for safety-rated IO wiring |
io-card-hardware.md | IO module hardware architecture relevant to safety module diagnostics |
time-sync.md | Timestamp correlation for safety event analysis |
program-reverse-engineering.md | Analyzing safety program binaries when source is unavailable |
hmi-integration.md | Safety HMI display requirements and operator acknowledgment workflows |
cp1584-hardware-ref.md | CP1584 hardware specs relevant to safety system integration |
remanufacturing.md | Safety system migration considerations during control system replacement |
encoder-diagnostics.md | Encoder feedback diagnostics relevant to SafeMOTION SLS/SDI/SOS speed and position monitoring |
io-sniffing.md | X2X and fieldbus traffic interception for diagnosing safety communication integrity |
plc-to-plc.md | PLC-to-PLC communication patterns that affect inter-controller safety data exchange |
execution-model.md | Task class scheduling and cycle time constraints affecting safety task execution |
Document generated: July 2026 Sources: B&R Industrial Automation documentation, TUV certificates, ETG FSoE specification, PLCopen safety function block standard, IEC 61508 / ISO 13849-1 / IEC 62061 standards Community tools: SafeDODiag (github.com/br-automation-community/SafeDODiag), openSAFETYLogbrowser (github.com/banickn/openSAFETY-logbrowser)
Online Changes and Runtime Patching on B&R Automation
A comprehensive guide to modifying running PLC programs on B&R (ABB) Automation platforms using Automation Studio, covering safe production techniques, limitations, and best practices.
Table of Contents
- Modifying a Running PLC Program Without Stopping the Machine
- Online Force/Override Techniques in Automation Studio
- Changing Setpoints, Timers, and Parameters at Runtime
- Saving Modified Programs Back to the CF Card for Persistence
- Online Change Limitations: What Can/Cannot Be Changed Online
- Hot-Connecting: Adding/Removing Hardware at Runtime
- Using PVI/OPC-UA to Write Variables on a Running PLC
- Runtime Parameter Modification from HMI
- Online Monitoring and Cross-Reference
- Rollback Procedures if an Online Change Causes Problems
- Change Management for Safety-Critical Systems
- Using mapp View for Runtime Parameter Changes
1. Modifying a Running PLC Program Without Stopping the Machine
Online Program Modification Overview
B&R Automation Studio supports downloading modified program code to a running controller without requiring a full machine stop. This is one of B&R’s key production-engineering capabilities, allowing engineers to push bug fixes, logic adjustments, and parameter tuning to machines in active production.
How Online Download Works
Automation Studio communicates with the target controller over Ethernet (or USB). When you trigger a download to a running system, Automation Studio evaluates whether the change requires only an online change (hot swap of code/data in memory) or a warm restart (reinitialization of variables and tasks). The download dialog indicates this with a red exclamation mark when a warm restart is needed.
Key mechanism:
- Automation Runtime (AR) keeps track of the memory layout of all tasks, programs, and libraries.
- When new code is downloaded, AR patches the in-memory binary of affected programs without stopping the cyclic tasks that are not impacted.
- Tasks that are impacted may be briefly suspended, reloaded, and resumed.
When Online Download is Possible
Online download (no restart) is possible when:
- Only program logic within existing function blocks or programs changes.
- Constant values (e.g., timer presets, setpoints declared as
VAR CONSTANT) are modified. - Internal variable initial values change, but the variable’s data type and scope remain the same.
- The AR version is >= G4.33 (transfer configuration options were significantly improved starting from this version).
Prerequisites
- The project in Automation Studio must match the installed configuration on the PLC (same hardware tree, same task structure).
- The controller must be in RUN or SERVICE mode.
- An online connection must be established via the Online Settings dialog
(configured under
Tools > Options > Online Settingsor via the project’sLogical View > Controller > Online Settings). - Ensure the correct PVI line (TCP) is configured pointing to the controller’s IP address.
Download Procedure
- Make the desired code changes in Automation Studio.
- Compile the project (
F7). Resolve any compilation errors. - Open the Transfer to Target dialog (
Application > Transfer to Targetor the toolbar icon). - Select the target controller and check the transfer options:
- Transfer Configuration: Available from AR >= G4.33, this lets you configure whether a change requires a warm restart, an INIT cycle, or if it can be applied fully online.
- Look for the red exclamation mark (
!) in the download window. If present, Automation Studio is warning that a warm restart will occur. - Click Transfer to begin the download.
Risks and Caveats
Online download to a running system carries risks, primarily page faults (memory access violations) that can crash the controller. Key risk areas identified by the B&R community:
- Pointer-based code: If code uses pointers to absolute memory addresses, those addresses may shift when new code is loaded, causing invalid memory access.
- Global variables shared across tasks: If a global variable is written by one cyclic task and read by another with different cycle times, an online change that shifts the variable’s memory location can cause corrupted reads.
- Library changes: Downloading after modifying a library without a full rebuild is risky. Always perform a Rebuild All before downloading to a running system.
- String manipulation: String concatenation and buffer operations can overflow if buffers were resized or relocated during the transfer.
- Communication cleanup: Protocols like OPC UA clients must be correctly handled in the task’s EXIT routine to prevent orphaned connections during online code replacement.
Mitigation Strategies
- Use the IECCheck library in your project. It provides runtime checks for pointer access, division by zero, array bounds violations, and other common errors, stopping the PLC gracefully before a page fault can cause uncontrolled behavior.
- Refresh pointers every cycle or protect shared data with semaphores (B&R provides the
AsSemlibrary for this purpose). - Avoid writing to the same global variable from multiple tasks without synchronization.
- Always perform a full Rebuild All (not just Build) before downloading to a running system, especially when library changes are involved.
Remote Online Downloads
Online downloads can be performed remotely over a VPN or plant network. The procedure is identical; the only difference is that the PVI line configuration must reference the controller’s remote IP address. Ensure network latency is acceptable (preferably < 50 ms) to avoid transfer timeouts.
2. Online Force/Override Techniques in Automation Studio
Force/Override Techniques Overview
Forcing (also called overriding) is the technique of overriding the logical value of a variable in the PLC, regardless of what the program logic computes. This is essential for troubleshooting, testing, and temporarily overriding sensor states or outputs without changing the program code.
Forcing in the LAD Monitor
Automation Studio’s Ladder (LAD) Monitor provides a built-in force function:
- Open the LAD Monitor for the program you want to debug (
Online > LAD Monitor). - Locate the variable you want to force (e.g., a digital input contact).
- Right-click the variable and select Force.
- Set the forced value (TRUE/FALSE for booleans, numeric values for integers/reals).
- The variable will now hold the forced value regardless of the program logic driving it.
The forced state is visually indicated in the LAD diagram — forced contacts and coils are typically shown in a distinct color or with a force icon overlay.
Forcing in the Watch Window
The Watch Window is the primary tool for forcing variables in B&R:
- Open the Watch Window (
Online > Watch Window). - Add variables by dragging them from the program editor or typing variable names.
- Each variable row shows:
- PV Value: The current process value (what the PLC logic computed).
- ForceActivated: A checkbox to enable/disable forcing for this variable.
- ForceActivated Value: The value to force the variable to.
- To force a variable:
- Check the Force On checkbox (or right-click and select “Force On”).
- Enter the desired value in the ForceActivated Value column.
- The variable will now be overridden.
- To release the force, right-click and select Force Off, or use Force All Off to release all forced variables at once.
Important: The “Force On” button is context-sensitive. If a variable is already forced, the button appears greyed out and only “Force Off” and “Force All Off” are active.
Prerequisites for Forcing
- The project in Automation Studio must match the program installed on the target PLC. If there is a mismatch, the PV Value column shows an error indicator (warning triangle), and forcing may not work correctly. Perform a Transfer to Target to synchronize the project before attempting to force.
- An active online connection to the controller must be established.
Programmatic Forcing via AsIO Library
B&R provides the AsIO library for enabling/disabling forcing from within PLC code itself:
| Function Block | Purpose |
|---|---|
AsIOEnableForcing | Enables forcing for a specific I/O data point |
AsIODisableForcing | Disables forcing for a specific I/O data point |
AsIOGlobalDisableForcing | Disables all forcing globally |
AsIODPStatus | Reads the status of a data point, including force status flags |
This is useful for automated testing scenarios where you need to programmatically override inputs/outputs.
Forcing via PVI (External Applications)
External applications can interact with the force mechanism through PVI’s link nodes
(via the ANSL variable object). The Python PVI wrapper (Pvi.py) supports writing to
force values using the 'F+' syntax:
var = Variable(task, "AF_AI[6].ModuleOk")
var.value = True # writes to force value via 'F+' syntax
Limitations of PVI forcing:
- You can write the force value and read the force status via
POBJ_ACC_STATUS. - You cannot enable/disable forcing status itself through PVI writes — forcing must be
activated either through Automation Studio or the
AsIOEnableForcingfunction block.
Safety Considerations for Forcing
- Always document forced variables. B&R’s watch window shows forced variables, but if the online connection is lost, there may be no visible indication on the HMI.
- Never leave forces active on a production machine after troubleshooting. Use “Force All Off” before disconnecting.
- Forcing outputs can cause unexpected machine motion. Always follow your plant’s lockout/tagout (LOTO) procedures when working on active machinery.
- Forcing on safety I/O is restricted by the SafeLOGIC safety controller. Standard forcing does not affect safety-rated signals.
3. Changing Setpoints, Timers, and Parameters at Runtime
Runtime Parameter Changes Overview
Runtime parameter modification is the most common and safest form of online change. Unlike code modifications (which carry page-fault risk), changing the values of variables at runtime simply writes new data to the controller’s memory without altering the executable code.
Methods for Runtime Parameter Changes
Method 1: Watch Window (Engineering Tool)
The simplest method, available directly in Automation Studio:
- Establish an online connection to the PLC.
- Open the Watch Window.
- Add the setpoint, timer preset, or parameter variable.
- Double-click the PV Value column and enter the new value.
- Press Enter to write the value to the PLC.
This is a temporary change — the value will revert to its initialized value after a warm/cold restart unless persisted (see Section 4).
Method 2: Programmatic (Internal PLC Logic)
Parameters can be changed by PLC logic itself, for example:
(* Change a timer preset based on a recipe selection *)
IF gRecipeSelect = 10 THEN
tonCycleDelay.PT := T#5s;
ELSIF gRecipeSelect = 20 THEN
tonCycleDelay.PT := T#8s;
END_IF
(* Change a temperature setpoint *)
rTempSetpoint := rOperatorSetpoint + rCalibrationOffset;
This is the preferred method for production systems, as the logic is deterministic, traceable, and version-controlled.
Method 3: ArConfig (Runtime Configuration Parameters)
For system-level parameters (IP address, hostname, subnet mask), B&R provides the AsARCfg library:
(* Example: Change IP address at runtime *)
IF IPSet THEN
CfgSetIPAddr_1.enable := 1;
CfgSetIPAddr_1.pDevice := ADR(pDevice);
CfgSetIPAddr_1.pIPAddr := ADR(NewIPTemp);
CfgSetIPAddr_1();
IF CfgSetIPAddr_1.status = 0 THEN
(* Read back to confirm *)
CfgGetIPAddr_1.enable := 1;
CfgGetIPAddr_1.pDevice := ADR(pDevice);
CfgGetIPAddr_1.pIPAddr := ADR(NewIP);
CfgGetIPAddr_1.Len := 20;
CfgGetIPAddr_1();
END_IF
IF CfgGetIPAddr_1.status = 0 AND CfgSetIPAddr_1.status = 0 THEN
IPSet := FALSE;
CfgGetIPAddr_1.enable := 0;
CfgSetIPAddr_1.enable := 0;
END_IF
END_IF
The AsARCfg library also provides functions for:
CfgGetSubnetMask/CfgSetSubnetMaskCfgGetHostName/CfgSetHostName- And many more configuration parameters
Method 4: Persistent Variable Initialization
Variables can be initialized from files or recipes loaded at startup:
(* Load parameters from a configuration file *)
fbFileOpen(
enable := TRUE,
pDevice := ADR('CF'),
pFileName := ADR('config/setpoints.csv'),
mode := fmRead
);
This approach ensures parameters survive power cycles and are managed as data files rather than hardcoded values.
Timer Modification Specifics
B&R timers (TON, TOF, TP from the IEC_Timers library) have:
- PT (Preset Time): Can be changed at runtime simply by writing to
timerName.PT. - IN: The trigger input, also writable at runtime.
- ET (Elapsed Time): Read-only (computed by the timer block).
- Q: The output, also writable at runtime (though forcing is the preferred override method).
When you change PT while the timer is running, the new preset takes effect immediately.
If PT is shortened below the current elapsed time, the timer may or may not expire
immediately depending on the timer type and implementation.
Best Practices
- Centralize parameters in a dedicated data structure (e.g.,
ST_MachineConfig) to make runtime tuning systematic and auditable. - Validate all operator-entered setpoints with range checks before applying them.
- Log parameter changes to a data file or the AR event log for traceability.
- Use the mapp Recipe framework for managing sets of parameters that change together (e.g., product changeovers).
4. Saving Modified Programs Back to the CF Card for Persistence
The Persistence Problem
When you make changes to a running PLC via the watch window, force, or online download, those changes exist only in the controller’s volatile DRAM. After a power cycle or warm restart, all non-persisted values revert to their initialized state. To make changes permanent, you must write them back to the CF card (CompactFlash) or CFast card.
Method 1: Transfer to Target (Full Program Persistence)
The standard way to persist program changes is through the Transfer to Target operation:
- Compile the project with the desired changes.
- Transfer to Target (
Application > Transfer to Target). - Automation Studio writes the new program to the controller’s non-volatile storage (CF/CFast card or internal flash).
After transfer, the program will survive power cycles. The controller boots from the non-volatile storage on each startup.
Method 2: Save/Upload from PLC to CF Card
When you modify variables online (via watch window) and want those values to persist:
- In the Logical View, right-click the controller and select Save or use the Transfer > Upload from Target option.
- Automation Studio reads the current state of all process variables and writes them to the project.
- You then transfer the updated project back to the target.
Caveat: Simply changing a variable via the watch window does NOT automatically save it to the CF card. The B&R community has reported issues where a CF card stops functioning after variable changes via the watch window — this is typically caused by the project getting out of sync with the installed configuration.
Method 3: CF Card Image Backup (Binary Level)
For complete persistence and backup, use the Runtime Utility Center:
- Open Runtime Utility Center (installed with Automation Studio).
- Connect to the target controller.
- Navigate to CF Card Tools.
- Select Create Image to create a binary image of the entire CF card.
- Save the image file to your PC (
.imgformat).
To restore:
- Insert a blank CF card into your PC’s card reader.
- In Runtime Utility Center, select CF Card Tools > Restore Image.
- Select the saved image file and write it to the blank card.
This method captures:
- The complete Automation Runtime installation.
- All user programs and configurations.
- All persistent data (recipes, logs, parameter files).
- The AR configuration (IP settings, hostname, etc.).
Method 4: Offline Installation (AS Compile to CF)
Automation Studio can compile and write a project directly to a CF card without a running controller:
- Connect a CF card reader to the engineering PC.
- Insert the target CF card.
- In Automation Studio, use
Application > Transfer > Install CF/SD Card(Offline Install). - Select the CF card drive letter and the target partition.
- Automation Studio formats the card, installs AR if needed, and writes the compiled program.
Method 5: Persistent Data Files
For parameter data that changes frequently, store it in files on the CF card:
(* Save current parameters to file *)
fbFileWrite(
enable := bSaveTrigger,
pDevice := ADR('CF'),
pFileName := ADR('config/params.dat'),
data := ADR(stCurrentParams),
datalen := SIZEOF(stCurrentParams)
);
This approach separates program code from operational data, allowing frequent parameter updates without recompiling.
Recommended Backup Strategy
- Before any online change: Create a CF card image backup using Runtime Utility Center.
- After confirming the change works: Transfer the updated project to the target to persist the code changes.
- Periodically: Upload PVs (process variables) using Runtime Utility Center to capture the current state of all runtime values.
- For critical machines: Keep a spare CF card with a known-good image at the machine site for rapid recovery.
5. Online Change Limitations: What Can/Cannot Be Changed Online
Changes That CAN Be Made Online (No Restart)
| Change Type | Description |
|---|---|
| Constant values | Changing the value of a VAR CONSTANT declaration |
| Internal logic | Modifying expressions, comparisons, math operations within existing code |
| Variable initial values | Changing the initial value (not the data type or scope) |
| Timer/counter presets | Changing PT values of IEC timers |
| Adding new variables | Adding new VAR declarations (may require INIT cycle depending on task config) |
| Adding new function blocks | Adding new FB instances in existing programs (non-structural change) |
| Modifying existing FB instances | Changing the logic inside a function block that is already instantiated |
Changes That REQUIRE a Warm Restart
| Change Type | Description |
|---|---|
| Data type changes | Changing a variable from INT to REAL, adding array dimensions, changing STRING length |
| Task configuration changes | Changing task cycle time, priority, or phase |
| Adding/removing tasks | Creating or deleting a cyclic, freewheeling, or event-triggered task |
| Adding new programs | Adding a new program file to the project |
| Hardware configuration | Changing the I/O tree (adding/removing modules in the hardware configuration) |
| Library version changes | Upgrading a library version (may require full rebuild and warm restart) |
| Memory layout changes | Any change that shifts the absolute memory address of existing variables or code |
Changes That REQUIRE a Cold Restart (Power Cycle)
| Change Type | Description |
|---|---|
| Automation Runtime upgrade | Installing a new AR version on the controller |
| Firmware updates | Updating controller or module firmware |
| Network interface changes | Changing the IP configuration of the controller’s primary interface (sometimes) |
| System partition changes | Modifying the AR system configuration (partition sizes, boot parameters) |
Detecting What Requires a Restart
Automation Studio provides visual indicators:
- Transfer Configuration Dialog (AR >= G4.33): Before downloading, Automation Studio analyzes the differences between the installed and compiled code and indicates which changes will require a restart.
- Red Exclamation Mark: In the download dialog, a red
!icon warns that a warm restart is required. The controller will briefly leave RUN mode and execute INIT cycles for affected tasks before resuming. - No Warning: If no warning is displayed, the change can be applied purely online without any task interruption.
Structural vs. Non-Structural Changes
The distinction between structural and non-structural changes is critical:
- Non-structural changes (logic within existing functions, constant values, initial values) can typically be applied online.
- Structural changes (new data types, new tasks, hardware tree changes, library upgrades) require a warm or cold restart because they alter the memory layout that AR uses to manage running tasks.
Guidelines by Scenario
| Scenario | Can You Stop the Machine? | Can You Restart the Machine? | Recommended Approach |
|---|---|---|---|
| Urgent bug fix (logic only) | No | No | Online change (non-structural) |
| Urgent bug fix (new variable type) | No | Yes | Warm restart (download with ! warning) |
| New feature (new task) | No | Yes | Warm restart after changeover |
| Major update (library upgrade) | Yes | Yes | Full cold restart, test thoroughly |
| Parameter tuning | No | No | Watch window or HMI input |
6. Hot-Connecting: Adding/Removing Hardware at Runtime
Hot-Connecting Overview
B&R’s Automation Runtime supports hot-connecting — the ability to add or remove I/O modules from the X20 bus while the controller is running. This is primarily facilitated through the mappIO service and the AsIO library.
Enabling/Disabling Hardware Modules at Runtime with mappIO
The mappIO mapp service provides a high-level interface for modifying the hardware
configuration at runtime:
- Configure all possible hardware modules in the Automation Studio hardware tree (include optional modules even if they are not physically installed).
- Instantiate the
mappIOcomponent in your project. - Use the mappIO API to enable or disable specific modules based on runtime conditions:
(* Enable a specific I/O module based on a machine configuration *)
MappIO.EnableModule(
moduleIdent := 'X20DO9321',
slot := 3,
enable := bModuleRequired
);
Use Cases:
- Machines with optional equipment where modules are installed for some configurations but not others.
- Module replacement during operation (e.g., swapping a failed analog input module).
- Configuration-driven machines where the hardware setup depends on a recipe or model selection.
AsIO Library for Hardware Configuration
For lower-level control, the AsIO library allows creating and removing hardware configurations programmatically:
| Function | Purpose |
|---|---|
AsIOCreateConfiguration | Create a new hardware configuration at runtime |
AsIORemoveConfiguration | Remove an existing hardware configuration |
AsIOReadConfiguration | Read current configuration status |
AsIOEnableForcing | Enable I/O forcing for specific data points |
The AsIO approach was the traditional method before mappIO became available. It is more flexible but less user-friendly than mappIO.
X20 Bus Module Hot-Swap Behavior
The X20 bus system has specific hot-swap characteristics:
- Bus modules (X20BM01, X20BM11, etc.) are the backbone of the X20 I/O system. They provide the X2X backplane connection between modules.
- I/O modules can typically be inserted or removed while the bus is powered, provided the bus module supports hot-swap and the software configuration accounts for the change.
- When a module is physically removed, the AR runtime detects the absence and sets the
module’s
ModuleOkflag to FALSE. ThemappIOservice can then handle the diagnostic and optionally reconfigure the system. - When a module is inserted, AR detects the new hardware and initializes it. If the module matches the configured hardware tree, it becomes operational automatically. If it does not match, a diagnostic alarm is generated.
Practical Example: Optional Machine Configurations
(* Configuration 1: Standard machine *)
IF iConfig = 1 THEN
(* Enable standard I/O, disable optional modules *)
MappIO.SetModuleState('AI_Option', MODULE_DISABLED);
MappIO.SetModuleState('AO_Option', MODULE_DISABLED);
END_IF
(* Configuration 2: Machine with optional sensor package *)
IF iConfig = 2 THEN
(* Enable optional modules *)
MappIO.SetModuleState('AI_Option', MODULE_ENABLED);
MappIO.SetModuleState('AO_Option', MODULE_ENABLED);
END_IF
Limitations
- CPU modules cannot be hot-swapped — they are the core of the system.
- Bus modules that are in the middle of the rack chain (between two other modules) cannot be removed without breaking the X2X connection for downstream modules.
- Power supply modules obviously cannot be removed while the system is running.
- Hot-swap behavior depends on the specific module type — check the module’s datasheet for hot-swap support.
- For safety-rated modules (SafeLOGIC, SafeI/O), hot-swap is handled differently and must comply with safety standards (see Section 11).
7. Using PVI/OPC-UA to Write Variables on a Running PLC
PVI — Process Visualization Interface
PVI is B&R’s native communication middleware for accessing process variables. It abstracts the physical connection (Ethernet, USB, serial) behind a uniform API.
PVI Architecture
| Component | Location | Function |
|---|---|---|
| PVIServer | On the controller (AR) | Exposes process variables from running tasks |
| PVI Manager | Windows host | Centralized line configuration and routing |
| PVI OPC Server | Windows host | Translates OPC calls into PVI calls |
| PVI Client Libraries | Application | C/C++, .NET, VBS, Python access via PVI DLL |
Configuring a PVI Line
PVI is configured via the PVI Lines tree in Automation Studio or standalone PVI Manager:
[TCP]
Driver = TCPIP
StationA = PC_Main
StationB = PLC_01
IP_StationB = 192.168.10.50
Port_StationB = 11160
Default PVI TCP port: 11160. Modern controllers (AR >= B4.0) also expose OPC UA on port 4840.
Writing Variables via PVI (Python Example)
Using the Pvi.py wrapper (available at github.com/hilch/Pvi.py):
from pvi import *
# Connect to the PLC
line = Line()
line.connect("TCP", "PLC_01")
# Access a task
task = Task(line, "Task1")
# Write a setpoint variable
temp_setpoint = Variable(task, "gRecipe.rTemperatureSetpoint")
temp_setpoint.value = 85.5
# Write a boolean
pump_enable = Variable(task, "gMachine.bPumpEnable")
pump_enable.value = True
PVI Forcing
PVI supports writing to the force value of a variable using the 'F+' syntax:
var = Variable(task, "AF_AI[6].ModuleOk")
var.value = True # Writes to force value
## Read the force status
status = var.read_status(POBJ_ACC_STATUS)
Limitation: PVI cannot change the force activation status itself — only Automation Studio
or the AsIOEnableForcing function block can enable/disable forcing.
OPC UA — Standardized Access
OPC UA is the recommended communication method for new projects. It is supported natively on B&R controllers running AR >= 4.0.
Enabling OPC UA on the Controller
- In Automation Studio, open the Logical View > Controller > Configuration.
- Navigate to OPC UA settings.
- Enable the OPC UA Server.
- Configure:
- Endpoint URL:
opc.tcp://<controller-ip>:4840 - Security Policy:
None,Basic128Rsa15,Basic256,Basic256Sha256 - Max Sessions: Default 50, adjustable for SCADA fan-out
- Publishing Interval: Default 100 ms (minimum practical: 50 ms)
- Endpoint URL:
- Mark variables as OPC UA accessible: In the variable properties dialog, enable the OPC UA accessibility flag.
- Recompile and download.
Writing Variables via OPC UA (Python Example)
import asyncio
from asyncua import Client
async def write_setpoint():
url = "opc.tcp://192.168.10.50:4840"
async with Client(url=url) as client:
setpoint_node = client.get_node("ns=2;s=Task1.gRecipe.rTemperatureSetpoint")
await setpoint_node.write_value(85.5)
print("Setpoint written successfully")
asyncio.run(write_setpoint())
OPC UA Parameters
| Parameter | Default | Notes |
|---|---|---|
| Endpoint URL | opc.tcp://<ip>:4840 | Configurable |
| Security Policies | None, Basic128Rsa15, Basic256, Basic256Sha256 | Use Basic256Sha256 in production |
| Max Sessions | 50 | Adjust for large SCADA systems |
| Publishing Interval | 100 ms | Lower = more CPU load |
| Sampling Interval | 50 ms | Must be <= publishing interval |
PVI vs OPC UA Decision Guide
| Criterion | PVI | OPC UA |
|---|---|---|
| Standardization | B&R proprietary | IEC 62541 (international standard) |
| Encryption/Auth | None | Certificate-based, user tokens |
| Typical Latency | 5-20 ms | 10-50 ms |
| SCADA Support | Via PVI OPC bridge | Native |
| Effort to expose variable | Low (auto-exposed) | Low (mark as accessible) |
| Safety I/O Access | Yes (with restrictions) | Must exclude safety task variables |
Rule of thumb: Use OPC UA for new projects. Use PVI when integrating with B&R HMI panels or legacy systems.
Performance Considerations
Server CPU load scales approximately as:
ServerLoad ≈ N_variables × (1000 / Sampling_ms) × Payload_bytes
For 500 variables at 100 ms sampling with 8-byte payloads on an X20CP3584:
- CPU consumption: ~0.3-0.8 ms per 100 variables per cycle
- Bandwidth: ~40 KB/s (negligible on 100 Mbit Ethernet)
8. Runtime Parameter Modification from HMI
HMI Parameter Modification Overview
HMI-based parameter modification is the most operator-friendly method for runtime changes. B&R provides several HMI technologies, with mapp View being the current standard.
Architecture
The typical parameter modification chain is:
Operator → HMI Screen (mapp View) → OPC UA → PLC Variable → Machine Logic
mapp View communicates with the PLC via OPC UA internally. When an operator enters a new value in an HMI widget, the value is written through OPC UA to the corresponding PLC variable.
Designing HMI Screens for Parameter Changes
Input Widgets
mapp View provides several widgets for parameter input:
| Widget | Use Case |
|---|---|
| TextField | Free-form numeric or text entry (setpoints, filenames) |
| NumericInput | Numeric entry with min/max limits and unit display |
| Slider | Analog value adjustment with visual feedback |
| ToggleButton | Boolean on/off switches |
| RadioButton Group | Selection among predefined options |
| ListBox / ComboBox | Selection from a list (recipe names, mode selections) |
| DateTimePicker | Date/time parameter entry |
Binding Variables to Widgets
In mapp View, widgets are bound to PLC variables through the Content property:
- In the mapp View page editor, select the widget.
- In the Properties panel, set the Content to reference the PLC variable
(e.g.,
MainTask.gMachine.rSpeedSetpoint). - Configure input constraints:
- Minimum/Maximum: Numeric range limits.
- Format: Decimal places, unit display.
- Access Level: Restrict modification to authorized operators.
Implementing Access Levels
B&R provides the mapp User service for managing operator access:
(* In PLC code: define access levels *)
VAR_GLOBAL CONSTANT
ACCESS_LEVEL_OPERATOR : UINT := 10;
ACCESS_LEVEL_SUPERVISOR : UINT := 20;
ACCESS_LEVEL_ENGINEER : UINT := 50;
END_VAR
In mapp View, bind the widget’s Access Level property to the user’s current access level. When the user’s access level is insufficient, the widget is displayed as read-only.
Validation and Confirmation
For critical parameter changes, implement validation in the PLC:
FUNCTION fbSetSpeedSetpoint : BOOL
VAR_INPUT
rNewSpeed : REAL;
rMinSpeed : REAL;
rMaxSpeed : REAL;
bConfirm : BOOL;
END_VAR
IF bConfirm THEN
IF rNewSpeed >= rMinSpeed AND rNewSpeed <= rMaxSpeed THEN
gMachine.rSpeedSetpoint := rNewSpeed;
fbSetSpeedSetpoint := TRUE;
ELSE
(* Log error, reject change *)
fbSetSpeedSetpoint := FALSE;
END_IF
END_IF
Feedback to the Operator
Always provide visual feedback when a parameter is changed:
- Status indicators (green checkmark for success, red X for error).
- Current value display alongside the input field.
- Audit log visible to operators showing who changed what and when.
9. Online Monitoring and Cross-Reference
Online Monitoring Tools
Watch Window
The Watch Window (Online > Watch Window) is the primary monitoring tool:
- Displays real-time values of selected variables.
- Shows variable type, scope (global/local), and current value.
- Supports forcing (see Section 2).
- Can display values in different formats (decimal, hex, binary, float).
LAD Monitor
The LAD Monitor (Online > LAD Monitor) provides graphical monitoring of ladder logic:
- Shows real-time power flow through contacts and coils.
- Displays the current value of each variable in the rung.
- Supports forcing directly in the ladder diagram.
- Color-coded indicators show TRUE/FALSE states.
Trace (Oscilloscope)
The Trace tool (Online > Trace) is a digital oscilloscope for PLC variables:
- Record up to 4 channels of data simultaneously.
- Configure trigger conditions (rising edge, falling edge, value threshold).
- Variable time base from microseconds to hours.
- Export data to CSV for analysis.
- Essential for debugging timing-sensitive issues.
Scope View
The Scope provides real-time graphical display of variables over time, similar to an analog oscilloscope, but in a live view without recording.
I/O Monitoring
The I/O Monitor (Online > I/O Status) shows the state of all physical I/O points:
- Digital inputs and outputs with status LEDs.
- Analog input/output values with engineering units.
- Module status (ModuleOk, diagnostics).
- Bus module communication status.
Cross-Reference Tools
Go to Definition / Go to Reference
In the Automation Studio code editor:
- F12 (or right-click > Go to Definition): Jumps to where a variable is declared.
- Shift+F12 (or right-click > Show References): Shows all locations where the variable is used (read or written).
Cross-Reference View
The Cross-Reference window (View > Cross-Reference) provides a comprehensive list:
- All variables in the project with their usage locations.
- Filterable by read/write reference type.
- Shows which task/program accesses each variable.
- Essential for understanding the impact of a variable change before making an online modification.
Online Cross-Reference
When connected online, the cross-reference information is enriched with runtime data:
- Actual memory addresses of variables.
- Current values (via Watch Window integration).
- Task cycle time impact assessment.
Using Cross-Reference for Safe Online Changes
Before making an online change:
- Identify the variable you want to change using Cross-Reference.
- Check all read locations: Will any code behavior change unexpectedly if the value changes?
- Check all write locations: Will another task overwrite your change? Are there race conditions?
- Check for forcing: Is the variable currently forced? If so, your change will be overridden.
- Check task assignments: Which tasks access this variable? Different task cycle times can cause race conditions when modifying shared data.
10. Rollback Procedures if an Online Change Causes Problems
Immediate Response: Force All Off
If an online change causes unexpected behavior:
- Immediately click Force All Off in the Watch Window to release all forced values.
- If the problem was caused by a forced value, releasing it should restore normal operation.
Recovery via Online Download (Rollback Code)
If the problem is in the code itself:
- Revert the code changes in Automation Studio (use version control — Git, SVN, etc.).
- Recompile the project.
- Download to the running controller using Transfer to Target.
- If the download requires a warm restart, the controller will briefly execute INIT cycles before resuming RUN mode.
Recovery via Warm Restart
If the controller is in an inconsistent state:
- In Automation Studio, switch the controller to SERVICE mode:
Online > Set Mode > SERVICE
- This stops all cyclic tasks and initializes variables.
- Fix the code, recompile, and download.
- Switch back to RUN mode:
Online > Set Mode > RUN
Recovery via CF Card Swap (Cold Restart)
If the controller is unresponsive or in a fault state:
- Power off the controller.
- Replace the CF card with a known-good backup (created with Runtime Utility Center).
- Power on the controller.
- The controller boots from the known-good CF card with the previous working program.
Recovery via AR System Reset
If the controller is in SERVICE mode and will not start:
- Place the PLC into BOOT mode (via the hardware mode switch or by deleting the system partition).
- Connect via Automation Studio.
- Delete partitions using the HDD/CF Utility.
- Cycle power.
- Reinstall AR and the program from scratch (Offline Install to CF card).
Preventive Measures
| Measure | Description |
|---|---|
| CF Card Image Backup | Create a binary image before any online change using Runtime Utility Center |
| Version Control | Use Git/SVN to track all code changes; tag known-good versions |
| Upload PVs | Upload current process variables before changes using Runtime Utility Center |
| Test in Simulation | Use ARsim (Automation Runtime Simulation) to test changes before applying to hardware |
| Document Changes | Maintain a change log with date, description, who, and rollback version |
| Spare CF Card | Keep a known-good CF card at the machine for rapid recovery |
CF Card Backup Procedure (Detailed)
- Connect to the PLC via Runtime Utility Center.
- Navigate to Tools > Back up files from Compact Flash / Image file.
- Select Create Image to create a complete binary backup.
- Save to a PC with a meaningful filename (e.g.,
MachineA_backup_2026-07-10.img). - Store the backup in a versioned directory alongside the source code.
Restore Procedure (Detailed)
- Insert a blank CF card into the PC card reader.
- Open Runtime Utility Center.
- Navigate to CF Card Tools > Restore Image.
- Select the backup image file.
- Write the image to the CF card.
- Install the CF card in the PLC and power on.
11. Change Management for Safety-Critical Systems
Safety-Critical Change Management Overview
Modifying safety-related PLC programs requires strict adherence to IEC 61508, ISO 13849, and other applicable functional safety standards. B&R’s safety platform (SafeLOGIC, SafeI/O, openSAFETY) has specific rules for runtime modifications.
B&R Safety Architecture
B&R safety technology is built on:
- SafeLOGIC controllers: Dedicated safety PLCs (e.g., X20SL81xx, X20(c)SL81xx).
- SafeI/O modules: Safety-rated input/output modules.
- openSAFETY: B&R’s open safety protocol over POWERLINK or other fieldbuses.
- Safety+: B&R’s next-generation safety software framework with an open, digitally fingerprint-protected code base.
Rules for Online Changes to Safety Programs
-
Standard forcing does NOT affect safety I/O. The forcing mechanism in Automation Studio applies only to standard (non-safety) process variables. Safety-rated inputs and outputs are protected by the SafeLOGIC hardware and cannot be overridden through standard force functions.
-
Safety program changes require re-certification. Any modification to safety-related logic (programs running in the SafeLOGIC task) invalidates the current safety certification. The machine must undergo:
- Risk re-assessment
- Re-verification of safety functions
- Updated safety documentation
- Sign-off by a competent safety engineer
-
Safety tasks are isolated. Safety programs run in a dedicated task with higher priority and are protected from interference by standard tasks. Online changes to standard tasks do not affect safety task execution.
-
OPC UA must not expose safety variables. When configuring OPC UA on a controller that also runs safety programs, the OPC UA address space must be filtered to exclude variables in the safety task. Exposing safety variables to external systems violates IEC 62443 security requirements.
Management of Change (MoC) Procedure
For safety-critical systems, follow a formal Management of Change process:
- Request: Document the proposed change, including justification and scope.
- Risk Assessment: Evaluate the impact on safety functions. Identify any new hazards introduced by the change.
- Review: Have the change reviewed by a safety engineer and the machine builder’s quality team.
- Approval: Obtain sign-off from all relevant stakeholders (safety, engineering, production management).
- Implementation: Apply the change using a controlled procedure:
- Create a CF card backup before the change.
- Test in simulation first (ARsim).
- Apply the change during a planned downtime window.
- Verify all safety functions after the change.
- Verification: Test all affected safety functions (E-stop, light curtains, guard interlocks, etc.) to confirm they operate correctly.
- Documentation: Update all safety documentation, including:
- Safety requirements specification
- Safety validation report
- Operating manual
- Maintenance procedures
- Release: Only after successful verification, return the machine to production.
Best Practices for Safety-Related Online Work
- Never make online changes to safety programs while the machine is running. Always stop the machine, apply lockout/tagout, and work in a controlled environment.
- Use Safety+ for safety development where possible. It provides an open code base with digital fingerprinting that protects safety-critical code while enabling collaborative development.
- Separate safety and standard logic. Keep safety functions in dedicated SafeLOGIC programs, not mixed with standard machine control logic.
- Maintain a safety change log. Every modification to safety-related code must be recorded with date, description, who performed it, and verification results.
- Keep safety backups separate. Store CF card images of safety-related configurations with restricted access and formal version control.
Safety+ Considerations
B&R’s Safety+ framework introduces modern safety development practices:
- Open code base: Safety functions can be developed with third-party tools, enabling better collaboration and flexibility.
- Digital fingerprint: Protects the integrity of safety-critical code, ensuring unauthorized modifications are detected.
- Headless architecture: Supports CLI interaction for automated safety validation.
- Automatic safety configuration updates: Reduces maintenance effort and ensures consistency across machine variants.
12. Using mapp View for Runtime Parameter Changes
mapp View Runtime Changes Overview
mapp View is B&R’s HMI framework built on web technology (HTML5, CSS, JavaScript). It communicates with the PLC through OPC UA and provides a powerful, modern interface for operators to modify runtime parameters.
Setting Up mapp View for Parameter Changes
Step 1: Add mapp View to the Project
- In Automation Studio’s Logical View, right-click the controller.
- Select Add > mapp Component > mapp View.
- Configure the mapp View settings (web server port, default page, etc.).
Step 2: Create an OPC UA Variable Mapping
- In the Logical View, expand the OpcUa node under the controller.
- An OPC UA default view file is automatically added.
- Mark variables as OPC UA tags by checking the OPC UA accessible property in the variable’s properties dialog.
Step 3: Design the HMI Page
- Open the mapp View page editor.
- Create a new page or open an existing one.
- Add widgets from the widget palette for each parameter you want to expose:
+------------------------------------------+
| Temperature Control |
| |
| Setpoint: [ 85.5 ] °C |
| ^^^^^^^^ |
| NumericInput widget |
| bound to gTemp.rSetpoint |
| |
| Actual: 82.3 °C |
| Status: HEATING |
| |
| [Apply] [Reset to Default] |
+------------------------------------------+
Step 4: Bind Widgets to PLC Variables
For each widget:
- Select the widget.
- In the Properties panel, set the Content property to the PLC variable path
(e.g.,
MainTask.gMachine.rSpeedSetpoint). - Configure constraints:
- Minimum/Maximum: Prevent out-of-range entries.
- Step size: Define increment granularity for the widget.
- Unit: Display engineering units.
- Decimal places: Set display precision.
mapp Recipe for Parameter Groups
For managing groups of parameters that change together (e.g., product changeovers), use the mapp Recipe framework:
- Add the mapp Recipe component to your project.
- Define recipe structures in your PLC code:
TYPE ST_Recipe :
STRUCT
rTemperature : REAL;
rSpeed : REAL;
rPressure : REAL;
iDwellTime : TIME;
bEnableOption : BOOL;
END_STRUCT
END_TYPE
- Link recipe variables to mapp Recipe component.
- In mapp View, add recipe management widgets:
- RecipeSelector: Choose a recipe by name.
- RecipeEditor: Edit individual parameters within a recipe.
- RecipeSave/Load: Store or recall recipe data.
Changing Setpoints Through mapp View (Complete Example)
PLC Side:
PROGRAM Main
VAR
rTemperatureSetpoint : REAL := 25.0;
rTemperatureActual : REAL;
bHeaterEnabled : BOOL;
(* mapp View widget status *)
bSetpointChanged : BOOL;
bApplySetpoint : BOOL;
END_VAR
(* Apply new setpoint when operator confirms *)
IF bApplySetpoint THEN
IF rTemperatureSetpoint >= 0.0 AND rTemperatureSetpoint <= 200.0 THEN
(* Valid range — accept the change *)
bSetpointChanged := TRUE;
bApplySetpoint := FALSE;
ELSE
(* Invalid — reject and notify *)
bSetpointChanged := FALSE;
bApplySetpoint := FALSE;
END_IF
END_IF
(* Temperature control logic *)
IF rTemperatureActual < rTemperatureSetpoint THEN
bHeaterEnabled := TRUE;
ELSE
bHeaterEnabled := FALSE;
END_IF
mapp View Side (Widget Configuration):
| Widget | Property | Value |
|---|---|---|
| NumericInput (Setpoint) | Content | MainTask.rTemperatureSetpoint |
| NumericInput (Setpoint) | Minimum | 0.0 |
| NumericInput (Setpoint) | Maximum | 200.0 |
| NumericInput (Setpoint) | Decimal Places | 1 |
| Button (Apply) | Content | MainTask.bApplySetpoint |
| TextDisplay (Status) | Content | MainTask.bSetpointChanged |
| Rectangle (Heater) | Fill Color | MainTask.bHeaterEnabled (TRUE = red, FALSE = gray) |
Dynamic Page Content
mapp View supports dynamic page changes at runtime:
- Use NavigationButton widgets to switch between pages.
- Pages can be selected programmatically through a PLC variable bound to the navigation widget’s content.
- This enables context-sensitive displays (e.g., showing different parameter pages based on the selected machine mode or recipe).
Advanced: Runtime Image Positioning
While mapp View is designed for static widget layouts, dynamic visual changes can be achieved through:
- Visibility toggling: Show/hide widgets based on PLC variables.
- Color changes: Bind fill/stroke colors to status variables.
- Value formatting: Display different text based on ranges.
- Page switching: Load completely different pages for different operating modes.
For truly dynamic positioning (e.g., moving an image based on a variable), additional JavaScript can be used in the page’s client-side scripts, though this is an advanced technique that goes beyond standard mapp View practice.
Performance Tips
- Limit widget count per page: Each widget adds OPC UA subscription overhead. Keep pages under ~100 active widgets for optimal performance.
- Use polling vs. subscription: For slowly changing parameters, use a longer sampling interval to reduce controller CPU load.
- Optimize update rates: Set the refresh rate of each widget appropriately. Status indicators need 100-500 ms, while trend displays can use 1-5 seconds.
- Test with real data: Use ARsim to test the HMI with realistic data volumes before deploying to the target hardware.
Appendix A: Quick Reference Card
Online Change Decision Matrix
| What do you want to change? | Method | Restart Required? | Risk Level |
|---|---|---|---|
| A constant value | Online download | No | Low |
| Logic inside an existing FB | Online download | No (if non-structural) | Medium |
| A variable value temporarily | Watch Window write | No | Low |
| A variable value permanently | Watch Window + Transfer | No | Low |
| A setpoint from HMI | mapp View widget binding | No | Low |
| An I/O module configuration | mappIO / AsIO | No (if supported) | Medium |
| A variable data type | Online download | Warm restart | Medium |
| A task cycle time | Online download | Warm restart | Medium |
| A library version | Rebuild + download | Warm restart | High |
| The hardware tree | Rebuild + download | Warm restart | High |
| The AR firmware | Install AR | Cold restart | High |
| Safety program logic | N/A — not allowed online | Full stop + recertification | Critical |
Key B&R Libraries for Runtime Operations
| Library | Purpose |
|---|---|
AsIO | I/O configuration, forcing, hardware management |
AsARCfg | Runtime configuration (IP, hostname, etc.) |
AsSem | Semaphore-based synchronization for shared variables |
IECCheck | Runtime error detection (pointer errors, division by zero, etc.) |
mappIO | High-level I/O management and hot-connect |
mapp Recipe | Recipe management for parameter groups |
mapp User | Operator access level management |
mapp View | HMI framework for runtime parameter display and modification |
Key Automation Studio Shortcuts
| Shortcut | Function |
|---|---|
F7 | Build/Compile |
Ctrl+F7 | Rebuild All |
F12 | Go to Definition |
Shift+F12 | Show References |
F9 | Generate CF/SD Card |
Ctrl+D | Transfer to Target |
Appendix B: References and Sources
- B&R Community Forum: https://community.br-automation.com
- B&R Coding Guidelines (TM231TRE.001): B&R Download Portal
- B&R Automation Studio Online Help (built into AS)
- B&R Safety Technology: https://www.br-automation.com/en-us/technologies/safety-technology/
- B&R mapp View Documentation: https://www.br-automation.com/en-us/products/software/mapp-technology/mapp-view/
- PVI.py Python Wrapper: https://github.com/hilch/Pvi.py
- Awesome B&R Frameworks: https://github.com/hilch/awesome-B-R
- mapp Recipe Tutorial: Available on B&R GitHub training repository
- DMC B&R Communication Reference: DMC Blog
Key Findings
-
Online download to a running B&R controller requires AR >= G4.33 for transfer configuration options. Automation Studio indicates whether a change needs a warm restart (red exclamation mark) or can be applied fully online. Always perform Rebuild All (Ctrl+F7, not just Build/F7) before downloading to a running system, especially when library changes are involved.
-
The primary risk of online code changes is page faults from shifted memory addresses. Pointer-based code, global variables shared across tasks with different cycle times, and string buffer operations are the highest-risk areas. Use the
IECChecklibrary for runtime bounds checking andAsSemfor semaphore-protected access to shared variables. -
Variable forcing is available through three mechanisms: Automation Studio Watch Window (right-click variable, set Force On/Off), the
AsIOlibrary (AsIOEnableForcing/AsIODisableForcingfunction blocks for programmatic control), and PVI external writes using theF+syntax. PVI can write force values but cannot enable/disable forcing itself. -
Runtime parameter changes (setpoints, timers, configuration) are safest when done via PLC logic (deterministic, traceable, version-controlled),
AsARCfglibrary (for IP/hostname/subnet changes), mapp Recipe (for parameter groups), or mapp View HMI with access level controls (mapp Userservice). Watch Window changes are temporary and revert after restart unless persisted. -
Hot-connecting IO hardware at runtime is supported by B&R via the
mappIOlibrary and theAsIOlibrary’s hot-connect function blocks. The IO processor automatically detects newly inserted/removed modules. This requires AR >= G4.0 and proper module initialization in the hardware tree configuration. -
Safety program logic cannot be changed online – any safety modification requires a full machine stop, safety program re-download, and recertification. The SafeLOGIC safety controller’s forcing mechanisms are separate from standard IO forcing and require SafeDESIGNER software plus password.
-
OPC UA (port 4840) is the recommended communication method for new projects for external variable access, with certificate-based security and up to 50 sessions at 100 ms publishing interval. PVI (port 11160, ANSL protocol) remains necessary for B&R HMI panels and legacy systems. PVI does not auto-reconnect – implement retry logic for error code 11020.
-
Rollback procedure: (a) stop all forced variables with Force All Off, (b) download the last known-good version via Transfer to Target, (c) if a warm restart occurs, verify all tasks have re-entered RUN state, (d) if problems persist, perform a cold restart (power cycle) to restore from the CF card image. The CF card image is updated only when explicitly transferred with
Application > Generate CF/SD Card(F9).
Cross-References
| Related File | Relevance |
|---|---|
| execution-model.md | Task class scheduling, cycle times, and watchdog behavior affected by online changes |
| cf-card-boot.md | CF card persistence — how programs are saved to CF for persistence across power cycles |
| config-file-formats.md | Configuration files that control program loading and runtime parameters |
| pvi-api.md | PVI API for external variable writes and forcing from Python/C applications |
| opcua.md | OPC-UA variable subscriptions and writes for runtime parameter modification |
| safe-io-diagnostics.md | Safety system constraints — what cannot be changed online in safety programs |
| memory-map.md | IO memory mapping relevant to understanding force/override targets |
| firmware.md | AR version requirements for online change support (G4.33+) |
| diagnostics-sdm.md | Monitoring system health after online changes via SDM |
| hmi-integration.md | mapp View HMI parameter access levels and runtime modification workflows |
| retentive-data.md | How retentive variables are affected by warm restarts during online changes |
| access-recovery.md | Access level requirements for making online changes to a running system |
Document compiled from B&R official documentation, B&R Community Forum discussions, Automation Studio online help, and field engineering best practices. Always consult the official B&R documentation for your specific Automation Runtime version and controller model.
Building Custom Diagnostic Tools ON the B&R PLC (CP1584)
Overview
One of the most powerful (and underutilized) capabilities of the B&R Automation Runtime (AR) platform is the ability to write custom C/C++ programs that execute directly on the PLC itself. The CP1584 runs Automation Runtime with a built-in GNU C/C++ compiler accessible through Automation Studio. This means you can build diagnostic tools, data loggers, custom monitors, and analysis programs that run in the real-time environment with direct access to IO, system variables, and the file system — all without any external PC connection.
This is critical when you are the sole maintainer of a machine built by a defunct OEM: you need tools that can run autonomously on the PLC, capturing data and diagnosing problems 24/7 without a laptop plugged in.
Why Build Tools ON the PLC?
- Autonomous monitoring: Capture intermittent faults that happen at 3 AM with no one watching
- No external dependencies: Works without a PC, OPC-UA client, or Python script running somewhere
- Deterministic timing: Your diagnostic code runs in the real-time cycle with microsecond precision
- Direct IO access: Read raw IO data at the bus cycle level, before any software filtering
- Persistence: Log data to CF card or USB stick for later retrieval
- Zero-intrusion: Can monitor the running program without modifying it (read-only access to variables)
Programming Languages Available
Automation Studio supports the following languages that execute on the PLC:
| Language | Use Case | Notes |
|---|---|---|
| ANSI C | Low-level system access, performance-critical code | Most powerful for diagnostics; full POSIX-like API |
| C++ | Object-oriented design, complex data structures | Requires C++ options package in AS 3.0+ |
| Structured Text (IEC 61131-3) | Quick logic, calling function blocks | Can mix freely with C programs |
| Ladder Diagram | Relay logic, simple sequencing | Limited for diagnostics |
| Sequential Function Chart | State machine logic | Useful for diagnostic state machines |
For diagnostic tools, ANSI C is the strongest choice — it provides direct memory access, file system operations, and can call any function block in the system.
See ar-rtos.md for details on the underlying OS and execution-model.md for how tasks are scheduled.
Creating a C Program in Automation Studio
Step 1: Create a C POU
- In Automation Studio, right-click Programs → Add Object → Program
- Select ANSI C as the language
- Choose Function or Cyclic Cyclic type
- Name it (e.g.,
DiagnosticTool)
Step 2: Understand the C POU Structure
A cyclic C POU has three sections:
/* DiagnosticTool.c - Runs every cycle in its assigned task class */
#include <bur/plc.h>
#include <bur/plctypes.h>
#include <sys_lib.h>
#include <FileIO.h>
#include <ArEventLog.h>
#ifdef _DEFAULT_INCLUDES
#include <AsDefault.h>
#endif
/* ============================================================
INIT - Runs once on PLC startup (warm/cold start)
============================================================ */
void _INIT DiagnosticToolInit(void)
{
/* Initialize diagnostic buffers, open log files, etc. */
}
/* ============================================================
CYCLIC - Runs every cycle (main diagnostic loop)
============================================================ */
void _CYCLIC DiagnosticToolCyclic(void)
{
/* This is your main diagnostic loop.
It runs at the task class rate you assign.
Keep it fast - don't block! */
}
/* ============================================================
EXIT - Runs on PLC stop / program download
============================================================ */
void _EXIT DiagnosticToolExit(void)
{
/* Close log files, flush buffers, cleanup */
}
Step 3: Assign to a Task Class
In the Logical View, assign your C POU to a task class:
- Task Class 1 (typically 10 ms): For high-speed IO monitoring
- Task Class 2 (typically 100 ms): For general diagnostics
- Task Class 8 or background: For slow logging (avoid impacting control)
Critical rule: Your diagnostic code must complete within its cycle time. If it exceeds the watchdog time, the entire PLC will fault. Keep cyclic logic lean — do file I/O and complex processing in lower-priority tasks.
Step 4: Add Required Libraries
In the Configuration View → Libraries, add the libraries you need:
sys_lib— System-level functions (time, string, memory)FileIO— File operations on CF card / USBArEventLog— Write to the PLC’s event logAsArSdm— SDM diagnostic dataAsOpcUac— OPC-UA client functionalityAsTcp— TCP/IP client/serverAsUdp— UDP communication
Accessing IO Data from C Programs
Method 1: Through Mapped Variables (Recommended)
The safest and simplest way — map IO in the hardware configuration, then access the global variables directly from C:
/* If you have a digital input mapped to variable gDiSensor1 */
extern unsigned short gDiSensor1;
extern unsigned short gDoActuator1;
void _CYCLIC DiagnosticToolCyclic(void)
{
static unsigned long cycle_count = 0;
static unsigned long sensor_changes = 0;
static unsigned short last_state = 0;
if (gDiSensor1 != last_state) {
sensor_changes++;
last_state = gDiSensor1;
/* Log the edge transition */
LogSensorEdge(cycle_count, 0, gDiSensor1);
}
cycle_count++;
}
Method 2: Direct IO Data Pointers via AsIO Library
For accessing IO without mapped variables — useful when you don’t have the project’s IO mapping:
#include <AsIO.h>
void _CYCLIC ReadDirectIO(void)
{
/* Enumerate all IO data points and read their values */
PLCCHECKSUCCESS(AsIOListDP());
/* After listing, you can iterate through IO data points
using the AsIO data structures. Each DP has:
- pVariable: pointer to the data value
- dwIdent: the IO identifier
- byDirection: input/output
- szName: data point name
*/
}
The AsIOFListDP() variant filters to specific IO data points. See memory-map.md for the complete memory mapping scheme and io-card-hardware.md for IO module internals.
Method 3: Direct Memory Access (Advanced)
For the deepest access — reading raw memory addresses where IO is mapped:
#include <sys_lib.h>
/* Access IO via hardware addressing (software addressing must be
configured in the CPU hardware configuration) */
void _CYCLIC ReadMemoryMappedIO(void)
{
/* Access a known IO address - format depends on addressing mode
Software addressing: %IX0.0.1.0 (input, module 0, channel 0)
Hardware addressing: %IW0 (direct word access)
In C, use the PV identifier from the variable declaration */
}
Reading System Variables (CPU Health, Timing, etc.)
B&R Automation Runtime exposes numerous system variables that give you insight into the PLC’s health. These are accessible from C as global structures:
Key System Variable Structures
#include <sys_lib.h>
void _CYCLIC ReadSystemHealth(void)
{
/* CPU temperature (available on CP1584 with hardware monitoring) */
/* Access via sys_br structure or mapped system variables */
/* Task cycle time monitoring */
/* Each task class has cycle time data available through
the sys_task system variables */
/* Watchdog status */
/* Available through system diagnostic variables */
/* Memory usage */
/* SRAM/flash usage stats available at runtime */
}
Common System Variables to Monitor
| Variable / Structure | Description | Normal Range |
|---|---|---|
sys_br.bWarmStart | Warm start counter | Increment on restart |
sys_br.bColdStart | Cold start counter | Increment on full reboot |
| Task cycle time vars | Actual cycle time per task class | Should be < configured max |
| CPU temperature | Hardware sensor reading | Typically < 70°C |
| Memory utilization | Heap/stack usage | Monitor for leaks |
| Network interface stats | Ethernet error counters | Zero errors ideal |
| Powerlink node status | EPL bus communication health | All nodes present |
| IO module diagnostics | Per-module status bits | All modules OK |
See system-variables.md for the complete list and hardware-monitoring.md for temperature and voltage monitoring details. For CPU specs and physical hardware details, see cp1584-hardware-ref.md.
File System Operations (Logging to CF Card / USB)
Using the FileIO Library
The FileIO library provides function blocks for file operations on the PLC’s file system (CF card, USB stick, or network share):
#include <FileIO.h>
/* FileIO uses function blocks, not direct C calls.
Declare and call them from your C POU: */
FileCreate fcCreate;
FileOpen foOpen;
FileWrite fwWrite;
FileClose fclClose;
static int log_file_open = 0;
static unsigned long log_handle = 0;
void _INIT OpenLogFile(void)
{
fcCreate.pDevice = (UDINT)"/CF_CARD";
fcCreate.pFileName = (UDINT)"diag_log.csv";
fcCreate.ulOption = FILE_CREATE_ALWAYS; /* Overwrite each restart */
fcCreate.enable = 1;
FCCreate(&fcCreate); /* Call the function block */
if (fcCreate.status == 0) {
foOpen.pDevice = (UDINT)"/CF_CARD";
foOpen.pFileName = (UDINT)"diag_log.csv";
foOpen.ulOption = FILE_OPEN_WRITE;
foOpen.enable = 1;
FOOpen(&foOpen);
if (foOpen.status == 0) {
log_file_open = 1;
log_handle = foOpen.ident;
/* Write CSV header */
fwWrite.ident = log_handle;
fwWrite.pData = (UDINT)"Timestamp,Sensor1,Sensor2,Actuator1,CycleTime\n";
fwWrite.ulLen = 52;
fwWrite.enable = 1;
FWWrite(&fwWrite);
}
}
}
void _CYCLIC LogDiagnosticData(void)
{
static unsigned long write_counter = 0;
static char buffer[256];
if (log_file_open && (write_counter++ % 100 == 0)) {
/* Log every 100th cycle to reduce file I/O overhead */
snprintf(buffer, sizeof(buffer), "%lu,%d,%d,%d,%d\n",
cycle_count, gDiSensor1, gDiSensor2,
gDoActuator1, current_cycle_time);
fwWrite.ident = log_handle;
fwWrite.pData = (UDINT)buffer;
fwWrite.ulLen = strlen(buffer);
fwWrite.enable = 1;
FWWrite(&fwWrite);
}
}
File System Paths
| Device | Path | Notes |
|---|---|---|
| Internal CF card | /CF_CARD | Default storage, limited write cycles |
| USB port 1 | /USB0 or /DEVICE0 | Hot-pluggable, good for log export |
| USB port 2 | /USB1 or /DEVICE1 | If available on CPU |
| Network share | Configured mount point | Requires network share setup |
| RAM disk | /RAM | Fast, volatile — lost on power cycle |
Gotchas with File I/O on PLC
-
CF Card Write Endurance: CompactFlash cards have finite write cycles. Do NOT log at high frequency to the CF card. Use RAM disk for high-speed logging, then periodically copy to CF card or USB.
-
File Handle Limits: The PLC has a limited number of open file handles (typically 32-64). Always close files you’re not actively using.
-
Blocking I/O: File writes block the calling task. Keep writes short and infrequent, or use a dedicated low-priority task for all file I/O.
-
File System Synchronization: The AR file system buffers writes. Data may not be physically written to CF card immediately. Use
FileFlushor close/reopen files to force a sync before power cycling. -
USB Stick Detection: The PLC may take 1-3 seconds to detect a newly inserted USB stick. Check for device availability before writing.
Using USB Sticks for Data Export
#include <FileIO.h>
void _CYCLIC CheckUSBAndLog(void)
{
static int usb_available = 0;
static int file_copied = 0;
/* Check if USB stick is available by attempting to open a file */
if (!usb_available) {
foOpen.pDevice = (UDINT)"/USB0";
foOpen.pFileName = (UDINT)"test.dat";
foOpen.ulOption = FILE_OPEN_READ;
foOpen.enable = 1;
FOOpen(&foOpen);
usb_available = (foOpen.status == 0);
if (usb_available) {
fclClose.ident = foOpen.ident;
fclClose.enable = 1;
FClose(&fclClose);
}
}
/* When USB appears, copy diagnostic logs to it */
if (usb_available && !file_copied) {
/* Use FileCopy function block to copy from CF_CARD to USB0 */
file_copied = 1;
}
}
Community libraries simplify this:
FindUsbStickOnBAndRPlc— Automatically detects USB sticks and mounts them as FileIO devicesCSVFileLib— Easy CSV file read/write interfacemappCleanUp— Delete old log files by age or size
Writing to the PLC Event Log (ArEventLog)
The ArEventLog library lets you write custom diagnostic messages that appear in the PLC’s built-in Logger (visible in Automation Studio, SDM web interface, and downloadable via FTP).
#include <ArEventLog.h>
ArLogCreate logCreate;
ArLogWriteMessage logWrite;
ArLogDelete logDelete;
static unsigned long log_handle = 0;
void _INIT InitEventLogger(void)
{
logCreate.pName = (UDINT)"MachineDiagnostic";
logCreate.ulLogLevel = 0x00000001; /* Level: Info */
logCreate.enable = 1;
ArLogCreate(&logCreate);
if (logCreate.status == 0) {
log_handle = logCreate.hLog;
}
}
void _CYCLIC WriteDiagnosticEvents(void)
{
static unsigned short last_module_ok = 1;
if (gModuleOk != last_module_ok) {
logWrite.hLog = log_handle;
if (gModuleOk) {
logWrite.ulLogLevel = 0x00000001; /* Info */
logWrite.pMessage = (UDINT)"Module recovered - status OK";
} else {
logWrite.ulLogLevel = 0x00000010; /* Error */
logWrite.pMessage = (UDINT)"Module fault detected!";
}
logWrite.enable = 1;
ArLogWriteMessage(&logWrite);
last_module_ok = gModuleOk;
}
}
Log Levels
| Level | Hex Value | Use Case |
|---|---|---|
| Debug | 0x00 | Detailed trace info (usually filtered) |
| Info | 0x01 | Normal operational events |
| Warning | 0x08 | Recoverable anomalies |
| Error | 0x10 | Faults requiring attention |
| Fatal | 0x20 | Critical failures |
Community Logging Libraries
- LogThat — Simplified wrapper around ArEventLog with single-call functions
- UserLog — Synchronous write to user logbooks (avoids async issues)
- MyDiag — Combines ArEventLog with AsArSdm for comprehensive diagnostic logging
Exposing Diagnostic Data via OPC-UA
If you need external tools (Python scripts, SCADA, dashboards) to access your diagnostic data, expose it through OPC-UA:
#include <AsOpcUac.h>
/* Configure OPC-UA variables in the CPU configuration,
then reference them in your C code as globals.
The AsOpcUac library handles the server side automatically
when OPC-UA is enabled in the hardware configuration.
Your diagnostic variables just need to be declared as
global PV (process variable) types, and they appear in
the OPC-UA namespace. */
Simplified Approach Using Variable Declaration
The easiest way to expose diagnostic data via OPC-UA is to declare global variables with proper attributes. In the Variables tab of your C POU:
/* These globals are automatically exposed via OPC-UA
if the variable has PV attributes set in the
OPC-UA server configuration */
GLOBAL DiagData_t gDiagData;
Then in the OPC-UA server configuration (CPU properties → OPC-UA), add these variables to the namespace. External clients can subscribe to changes.
For more details on OPC-UA configuration, see opcua.md.
Exposing Diagnostic Data via Built-in Web Server
The CP1584 has an integrated HTTP server that can serve custom HTML/JS pages. You can build a diagnostic dashboard accessible from any web browser on the network.
Setting Up the Web Server
- In Automation Studio, open CPU Configuration → Web Server
- Enable the web server on the desired port (default 80)
- Configure the Web Server Directory (typically on the CF card)
- Place your HTML/CSS/JS files in the web directory
HTML + PV_Access.js Example
<!-- /CF_CARD/WebServer/diag.html -->
<!DOCTYPE html>
<html>
<head>
<title>Machine Diagnostics</title>
<script src="PV_Access.js"></script>
</head>
<body>
<h1>CP1584 Live Diagnostics</h1>
<div>Cycle Count: <span id="cycleCount">--</span></div>
<div>Sensor 1: <span id="sensor1">--</span></div>
<div>CPU Temp: <span id="cpuTemp">--</span>°C</div>
<div>Task 1 Cycle: <span id="task1Cycle">--</span> ms</div>
<div>Module OK: <span id="moduleOk">--</span></div>
<script>
// Connect to PLC PV access
var pv = new PVAccess();
// Read variables by name (must be configured in OPC-UA or PV access)
pv.readVariable("gDiagData.cycleCount", function(value) {
document.getElementById("cycleCount").textContent = value;
});
pv.readVariable("gDiagData.sensor1", function(value) {
document.getElementById("sensor1").textContent = value;
});
// Poll every 1 second
setInterval(function() {
pv.readVariable("gDiagData.cycleCount", function(value) {
document.getElementById("cycleCount").textContent = value;
});
}, 1000);
</script>
</body>
</html>
Community Resources
- br-plc-as-webserver (GitHub) — Complete demo project for using the PLC as a web server with live data
- Loupe UX — JavaScript library for web-based HMI on B&R PLCs
- OMJSON — WebSocket + JSON interface for PLC communication
Network Communication (TCP/UDP)
For custom protocol diagnostics or sending data to external systems:
TCP Client/Server
#include <AsTcp.h>
/* AsTcp library provides TCP client and server function blocks
Use TCP client to push diagnostic data to a remote server,
or TCP server to allow external tools to query the PLC */
/* Example: Send diagnostic data to a remote monitoring server */
AsTcpClient tcpClient;
void _CYCLIC SendDiagToServer(void)
{
static int connected = 0;
if (!connected) {
tcpClient.pServerAddr = (UDINT)"192.168.1.100";
tcpClient.ulServerPort = 9000;
tcpClient.enable = 1;
AsTcpClient(&tcpClient);
if (tcpClient.status == 0) connected = 1;
}
if (connected) {
tcpClient.pData = (UDINT)diag_buffer;
tcpClient.ulDataLen = buffer_length;
tcpClient.enable = 1;
AsTcpClient(&tcpClient);
}
}
UDP Communication
#include <AsUdp.h>
/* UDP is lower overhead than TCP - good for broadcast diagnostics */
AsUdpSend udpSend;
void _CYCLIC BroadcastDiagStatus(void)
{
static unsigned long counter = 0;
if (++counter % 1000 == 0) { /* Every 1000 cycles */
snprintf((char*)diag_buffer, sizeof(diag_buffer),
"DIAG|%lu|%d|%d|%d",
cycle_count, gDiSensor1, gModuleOk, current_temp);
udpSend.pRemoteAddr = (UDINT)"192.168.1.255"; /* Broadcast */
udpSend.ulRemotePort = 9876;
udpSend.pData = (UDINT)diag_buffer;
udpSend.ulDataLen = strlen((char*)diag_buffer);
udpSend.enable = 1;
AsUdpSend(&udpSend);
}
}
Community Libraries
- TCPComm — Simplified TCP wrapper around AsTCP
- UDPComm — Simplified UDP wrapper around AsUDP
- AsUdp AsTcp demo1 — Official demo project for both libraries
- paho.mqtt.c-ar — MQTT client for AR (publish diagnostic data to MQTT brokers)
Practical Diagnostic Tool Patterns
Pattern 1: High-Speed IO Edge Detector
Captures every state change on a digital input with microsecond timestamps:
#define MAX_EDGES 10000
typedef struct {
unsigned long cycle_count;
unsigned long timestamp_us;
unsigned short old_state;
unsigned short new_state;
} EdgeRecord_t;
static EdgeRecord_t edge_buffer[MAX_EDGES];
static unsigned long edge_index = 0;
static unsigned short last_state = 0;
void _CYCLIC EdgeDetectorCyclic(void)
{
if (gDiSensor1 != last_state) {
if (edge_index < MAX_EDGES) {
edge_buffer[edge_index].cycle_count = cycle_count;
edge_buffer[edge_index].timestamp_us = sys_br.ulCycleTime; /* System tick */
edge_buffer[edge_index].old_state = last_state;
edge_buffer[edge_index].new_state = gDiSensor1;
edge_index++;
}
last_state = gDiSensor1;
}
}
/* Save to file in a lower-priority task when buffer is full
or on a periodic basis (every N seconds) */
void _CYCLIC FlushEdgeBuffer(void)
{
if (edge_index > 0 && (edge_index >= MAX_EDGES || flush_timer_expired)) {
/* Open file and write edge buffer */
for (unsigned long i = 0; i < edge_index; i++) {
snprintf(line_buf, sizeof(line_buf), "%lu,%lu,%d,%d\n",
edge_buffer[i].cycle_count,
edge_buffer[i].timestamp_us,
edge_buffer[i].old_state,
edge_buffer[i].new_state);
/* FileWrite... */
}
edge_index = 0;
}
}
Pattern 2: Analog Signal Quality Monitor
Continuously tracks analog input statistics (min, max, average, noise, dropout detection):
#define ANALOG_SAMPLE_COUNT 1000
typedef struct {
double min_val;
double max_val;
double avg_val;
double noise_rms; /* RMS of (value - avg) = noise floor */
unsigned long dropout_count; /* Number of times value dropped to zero */
unsigned long spike_count; /* Number of sudden large changes */
double last_rate_of_change;
} AnalogStats_t;
static AnalogStats_t stats;
static double samples[ANALOG_SAMPLE_COUNT];
static unsigned long sample_idx = 0;
void _CYCLIC AnalogMonitorCyclic(void)
{
double current = (double)gAiTemperature; /* Read analog input */
static double prev = 0.0;
samples[sample_idx++] = current;
if (sample_idx >= ANALOG_SAMPLE_COUNT) sample_idx = 0;
/* Simple running statistics */
if (current == 0.0) stats.dropout_count++;
double rate = current - prev;
if (fabs(rate) > (stats.noise_rms * 5 + 1.0)) {
stats.spike_count++;
}
stats.last_rate_of_change = rate;
prev = current;
/* Recalculate full stats periodically (every 1000 cycles) */
if (sample_idx == 0) {
double sum = 0.0, min_v = 999999.0, max_v = -999999.0;
for (unsigned long i = 0; i < ANALOG_SAMPLE_COUNT; i++) {
sum += samples[i];
if (samples[i] < min_v) min_v = samples[i];
if (samples[i] > max_v) max_v = samples[i];
}
stats.avg_val = sum / ANALOG_SAMPLE_COUNT;
stats.min_val = min_v;
stats.max_val = max_v;
double sq_sum = 0.0;
for (unsigned long i = 0; i < ANALOG_SAMPLE_COUNT; i++) {
double diff = samples[i] - stats.avg_val;
sq_sum += diff * diff;
}
stats.noise_rms = sqrt(sq_sum / ANALOG_SAMPLE_COUNT);
}
}
Pattern 3: Task Cycle Time Watchdog
Monitors all task classes for cycle time violations:
typedef struct {
char task_name[32];
unsigned long configured_cycle_us;
unsigned long actual_cycle_us;
unsigned long max_cycle_us;
unsigned long watchdog_violations;
unsigned long last_violation_cycle;
} TaskMonitor_t;
static TaskMonitor_t task_monitors[8]; /* Up to 8 task classes */
void _CYCLIC TaskCycleMonitor(void)
{
/* Task cycle time data is available through system variables.
The exact variable names depend on AR version, but typically:
- sys_task[0].ulCycleTime (actual cycle time in microseconds)
- sys_task[0].ulCycleTimeMax (maximum cycle time observed)
- sys_task[0].ulWatchdogTime (configured watchdog limit)
Check each task class every cycle. */
for (int i = 0; i < 8; i++) {
unsigned long actual = /* sys_task[i].ulCycleTime */;
unsigned long limit = /* sys_task[i].ulWatchdogTime */;
if (actual > task_monitors[i].max_cycle_us) {
task_monitors[i].max_cycle_us = actual;
}
if (actual > limit * 80 / 100) { /* 80% of limit = warning */
task_monitors[i].watchdog_violations++;
task_monitors[i].last_violation_cycle = cycle_count;
/* Log warning */
LogWriteMessage(LOG_WARN, "Task %d near watchdog: %lu us",
i, actual);
}
}
}
Pattern 4: Periodic Diagnostic Report Generator
Writes a comprehensive diagnostic snapshot to file every N minutes:
void _CYCLIC DiagnosticReportGenerator(void)
{
static unsigned long report_timer = 0;
static const unsigned long REPORT_INTERVAL_CYCLES = 60000; /* ~10 min at 10ms */
report_timer++;
if (report_timer < REPORT_INTERVAL_CYCLES) return;
report_timer = 0;
char report[2048];
int offset = 0;
offset += snprintf(report + offset, sizeof(report) - offset,
"=== DIAGNOSTIC REPORT ===\n"
"Timestamp: %lu\n"
"Cycle Count: %lu\n"
"Uptime: %lu seconds\n\n",
GetSystemTime(), cycle_count, uptime_seconds);
offset += snprintf(report + offset, sizeof(report) - offset,
"--- Digital Inputs ---\n"
"Sensor1: %d Sensor2: %d Sensor3: %d\n"
"E-Stop: %d SafetyOK: %d\n\n",
gDiSensor1, gDiSensor2, gDiSensor3,
gDiEStop, gSafetyOK);
offset += snprintf(report + offset, sizeof(report) - offset,
"--- Analog Inputs ---\n"
"Temperature: %.1f °C (min:%.1f max:%.1f noise:%.3f)\n"
"Pressure: %.1f bar\n"
"Level: %.1f mm\n\n",
gAiTemperature, stats.min_val, stats.max_val, stats.noise_rms,
(double)gAiPressure, (double)gAiLevel);
offset += snprintf(report + offset, sizeof(report) - offset,
"--- IO Module Status ---\n"
"Module OK: %d Module ID: %d\n"
"X2X Bus Status: %d EPL Status: %d\n\n",
gModuleOk, gModuleID, gX2XStatus, gEPLStatus);
offset += snprintf(report + offset, sizeof(report) - offset,
"--- Task Health ---\n"
"Task1 cycle: %lu us (max: %lu us)\n"
"Task2 cycle: %lu us (max: %lu us)\n"
"Watchdog violations: %lu\n\n",
task_monitors[0].actual_cycle_us, task_monitors[0].max_cycle_us,
task_monitors[1].actual_cycle_us, task_monitors[1].max_cycle_us,
total_watchdog_violations);
/* Write to file */
FileWrite(...report, offset...);
}
Building a Complete Diagnostic Task Architecture
Recommended Task Layout
Task Class 1 (1 ms or 10 ms) - CONTROL LOGIC + Edge Detection
├── Machine control program (existing)
└── Edge detector (minimal overhead, just captures transitions)
Task Class 2 (10 ms or 100 ms) - MAIN DIAGNOSTICS
├── Analog signal monitor
├── Task cycle time monitor
├── IO module health check
└── Statistics accumulator
Task Class 4 or 8 (1000 ms) - LOGGING & REPORTING
├── File I/O (CSV logging, report generation)
├── Event log writing (ArEventLog)
├── UDP broadcast of status
└── USB stick check and data export
Data Flow
IO Hardware → Task 1 (raw capture) → Task 2 (analysis) → Task 8 (storage/output)
↓
OPC-UA Server (external access)
Web Server (browser access)
UDP Broadcast (network monitoring)
Working Without the Original Project
When you don’t have the original Automation Studio project, building diagnostic tools requires extra steps. See project-reconstruction.md for the full process, but here’s the diagnostic-specific approach:
Step 1: Create a Minimal Project
- Install Automation Studio (any version compatible with the AR version on the PLC)
- Create a new project with just the CPU (X20CP1584) configured
- Set the correct IP address and hardware configuration
- Download this minimal project — it won’t run the machine, but it gives you AR access
Step 2: Use Online Browsing
Connect to the running PLC and browse:
- Online → Variables: See all variables with their current values
- Online → IO Mapping: See all mapped IO points
- Online → Task Configuration: See all running task classes and their cycle times
- SDM (web browser): See complete hardware and software diagnostics
Step 3: Reconstruct IO Mapping
Use brwatch or PVI to read IO values and map them to meaningful names based on:
- Physical inspection of the machine
- Wire labeling
- Behavior observation
- Cross-referencing with similar B&R machines
Step 4: Add Your Diagnostic C Program
Add your diagnostic C POU to this minimal project. Configure it in a task class. Download with online changes if the machine must keep running.
Step 5: Use OPC-UA or Web Server for Data Access
Since you can’t add your variables to the original program’s OPC-UA namespace easily, expose your diagnostic data through:
- Your own OPC-UA server instance
- The built-in web server with PV_Access
- UDP broadcast
- Direct file logging to CF card / USB
External Tools That Complement On-PLC Diagnostics
These tools run on a PC but work with data your on-PLC tools produce:
| Tool | Description | Source |
|---|---|---|
| brwatch | Command-line variable watch/change/log tool | GitHub |
| SystemDumpViewer | Viewer for SystemDump.xml files from PLC | Community |
| simple data trace | Records PLC variables in high-priority task, saves to CSV | Community |
| PVI.py | Python wrapper for B&R PVI API | Community |
| systemdump.py | CLI tool to create/load system dumps | Community |
See pvi-api.md for external PC-based programmatic access and python-diagnostics.md for Python-based diagnostic scripting.
Advanced Techniques
Ring Buffer Data Capture
For capturing high-speed data before a fault (like a flight data recorder’s black box):
#define RING_BUFFER_SIZE 100000
#define TRIGGER_CHANNELS 4
typedef struct {
unsigned long timestamp;
unsigned short values[TRIGGER_CHANNELS];
} RingSample_t;
static RingSample_t ring_buffer[RING_BUFFER_SIZE];
static unsigned long ring_write_idx = 0;
static unsigned long ring_full = 0;
void _CYCLIC RingBufferCapture(void)
{
ring_buffer[ring_write_idx].timestamp = cycle_count;
ring_buffer[ring_write_idx].values[0] = gDiSensor1;
ring_buffer[ring_write_idx].values[1] = gDiSensor2;
ring_buffer[ring_write_idx].values[2] = gDoActuator1;
ring_buffer[ring_write_idx].values[3] = gModuleStatus;
ring_write_idx++;
if (ring_write_idx >= RING_BUFFER_SIZE) {
ring_write_idx = 0;
ring_full = 1;
}
}
/* Trigger: save ring buffer to file when a fault is detected */
void _CYCLIC FaultTrigger(void)
{
if (gFaultDetected) {
SaveRingBufferToFile();
gFaultDetected = 0; /* Reset trigger */
}
}
JSON Diagnostic Output (via OMSQL/OMJSON)
The OMJSON community library lets you build JSON strings on the PLC, useful for REST API-like diagnostic output:
/* Using OMSQL/OMJSON to build structured diagnostic output
that can be consumed by external systems */
void _CYCLIC BuildJsonDiagnostic(void)
{
/* Build JSON: {"sensor1":true,"temp":23.5,"cycle":1234567,"faults":0} */
/* OMJSON library provides serialize/deserialize functions */
}
MQTT Diagnostic Publishing
The paho.mqtt.c-ar library (Eclipse Paho MQTT ported to Automation Runtime) lets you publish diagnostic data to an MQTT broker:
/* Using paho.mqtt.c-ar library:
- Connect to an MQTT broker (local or cloud)
- Publish diagnostic topics:
machine/cp1584/digital_inputs
machine/cp1584/analog_inputs
machine/cp1584/task_health
machine/cp1584/io_status
- Subscribe to commands:
machine/cp1584/commands/reset_counters
machine/cp1584/commands/force_output
*/
This is especially useful for IIoT retrofit scenarios.
Safety and Caution
What Can Go Wrong
-
PLC crash from bad pointers: A NULL pointer dereference or invalid memory access in your C code will cause a page fault. The PLC will stop all task classes and enter service mode. Always validate pointers before accessing them.
-
Watchdog violation from slow code: If your diagnostic code takes too long in a high-priority task, the hardware watchdog will trigger and reboot the PLC. Profile your code carefully.
-
CF card wearout from excessive logging: CompactFlash cards have limited write cycles (typically 10,000-100,000 per sector). Log to RAM disk or reduce logging frequency.
-
Memory exhaustion: Dynamic memory allocation (malloc) on a PLC is dangerous. Memory leaks accumulate and eventually crash the PLC. Use static buffers with fixed sizes.
-
Interference with control logic: Your diagnostic code runs in the same AR environment as the machine control program. Never modify outputs or control variables from diagnostic code unless absolutely necessary.
Best Practices
- Read-only access: Design all diagnostic tools as read-only monitors. Never write to outputs from diagnostic code unless it’s a deliberate override with safety interlocks.
- Static allocation: Avoid
malloc()/free(). Use static arrays with known sizes. - Error handling: Every function block call should check its status. Never assume success.
- Graceful degradation: If file I/O fails, continue monitoring in memory. If memory is full, stop capturing but keep the most recent data.
- Minimal overhead: A diagnostic tool on a production machine should use < 5% of the CPU’s processing capacity.
- Isolation: Put diagnostic code in its own task class, not mixed into the control task.
Key Findings
-
ANSI C is the most powerful tool for on-PLC diagnostics — it gives you direct memory access, file system operations, and the ability to call any function block in the system.
-
Use the layered task architecture — fast capture in high-priority tasks, analysis in mid-priority, file I/O and networking in low-priority background tasks.
-
File I/O is the biggest risk — CF card wearout and blocking I/O in cyclic tasks are the two most common causes of problems. Always use a dedicated low-priority task for file operations.
-
The ecosystem is surprisingly rich — community libraries (CSVFileLib, LogThat, UserLog, paho.mqtt.c-ar, TCPComm, OMJSON, Persist, FindUsbStickOnBAndRPlc, PLC-data-trace, mappRemoteShell) fill most gaps that the standard libraries don’t cover.
-
VS Code can replace Automation Studio for editing — the community B&R Automation Tools extension (github.com/br-automation-com/vscode-brautomationtools) provides IntelliSense for C/C++ programs, build tasks via BR.AS.Build.exe, and PLC transfer via PVITransfer.exe. Combined with the Structured Text VS Code extension, you can develop and deploy diagnostic programs entirely from VS Code. See remanufacturing.md §“Development Tools Update” for the full tool list.
-
The awesome-B-R community repository was archived in April 2025 — the curated list at github.com/hilch/awesome-B-R is now read-only. Active development continues in individual repositories. Use the archived list as a starting reference, then check individual repos for current status.
-
You can build a complete diagnostic dashboard using the built-in web server with PV_Access.js — no external software needed, just a web browser.
-
Ring buffers are your friend for intermittent faults — capture high-speed data continuously and dump to file only when a fault is detected (black box approach).
-
Without the original project, create a minimal AS project, connect online, browse variables, reconstruct IO mapping, and add your diagnostic program as an additional task. The existing program will continue to run alongside it.
Cross-References
- ar-rtos.md — Automation Runtime OS internals
- execution-model.md — Task scheduling and priorities
- memory-map.md — CPU memory layout and addressing
- io-card-hardware.md — IO module hardware details
- system-variables.md — Complete system variable listing
- pvi-api.md — External programmatic PLC access (PVI)
- opcua.md — OPC-UA server configuration
- python-diagnostics.md — Python-based external diagnostic scripts
- iiot-retrofit.md — MQTT and modern monitoring retrofits
- project-reconstruction.md — Rebuilding a project from an unknown PLC
- cf-card-boot.md — CF card file system layout
- hardware-monitoring.md — Temperature and voltage monitoring
B&R ACOPOS Drive Communication and Diagnostics (CP1584)
Overview
ACOPOS servo drives are B&R’s primary motion control platform for precision servo applications. On a CP1584-based machine, the PLC communicates with ACOPOS drives primarily over ETHERNET Powerlink (EPL) or CAN bus, using B&R’s proprietary ACP10/ACPOSmotion firmware. When you inherit a machine with no documentation, understanding how to monitor, diagnose, back up, and replace these drives is essential.
This document covers the ACOPOS drive family (8V1 single-axis, 8BVE ACOPOSmulti, and 8I7 ACOPOSinverter), communication architecture, fault diagnosis, parameter management, and replacement procedures — all from the perspective of a sole maintainer with zero OEM support.
ACOPOS Drive Family Overview
| Series | Model Format | Power Range | Key Feature |
|---|---|---|---|
| 8V1 ACOPOS | 8V1010, 8V1016, 8V1022, 8V1045, 8V1180 | 1-18 kW | Single-axis, modular, most common on CP1584 systems |
| 8BVE ACOPOSmulti | 8BVE0500… | Up to 30 kW shared bus | Multi-axis, common DC bus, compact multi-axis |
| 8I7 ACOPOSinverter | 8I74… (A/B/C/D frame) | 0.37-15 kW | Compact, integrated EMC filter, for conveyor/fan applications |
| ACOPOS P3 | Various (1/2/3-axis) | 0.6-64 kW per axis | Newest generation, 1-3 axes in single compact module |
ACOPOS P3 Details (Newer Generation)
The ACOPOS P3 is B&R’s latest servo drive platform. If you’re maintaining a newer CP1684 or CP3686 system (or upgrading from a CP1584), you may encounter P3 drives:
- Form factors: 1-axis, 2-axis, and 3-axis in a single compact housing
- Power range: 0.6 kW to 64 kW per axis (up to 48A continuous)
- Communication: POWERLINK (primary), EtherCAT (optional)
- Key advantage: Up to 3 axes in one housing saves cabinet space significantly
- Firmware: Uses
acp10syssame as 8V1 — configuration methodology is identical - Safety: Integrated SafeMOTION (STO, SLS, SDI, SLP, SS1, SS2)
- Not backward compatible with 8V1 hardware — different form factor, different power connector
- Migration path: If upgrading from 8V1 to P3, motor and encoder cables may need adapters; acp10sys must be regenerated for P3 hardware targets
Note for CP1584 maintainers: The CP1584 can communicate with ACOPOS P3 drives via POWERLINK, but the combined cycle time budget may be tighter. The P3’s higher bandwidth demands more from the MN. Monitor cycle time carefully when mixing 8V1 and P3 drives on the same POWERLINK segment.
ACOPOSmulti (8BVE) Details
ACOPOSmulti uses a shared DC bus architecture for multi-axis systems:
- Common DC bus: Multiple axes share a single DC bus, allowing regenerative energy from one axis (decelerating) to feed another (accelerating)
- Module format: Power supply module + axis modules in a rack
- Communication: POWERLINK or CAN, same acp10sys approach
- Diagnostic note: A fault on one axis module does NOT necessarily indicate a problem with that specific axis — a DC bus overvoltage (7200) or undervoltage (7211) affects ALL axes on the shared bus
- Spare parts: Axis modules can be individually replaced without replacing the power supply module, but firmware versions must match across all modules in the rack
Performance Characteristics
- Communication cycle time: as low as 400 µs over POWERLINK
- Control loop update: as fast as 50 µs (8V1), faster on P3
- Peak current: typically 3x continuous for 2 seconds
- Auto-recognition of B&R motor parameters via embedded chip (HIPERFACE DSL encoders)
- Non-B&R motors: Manual parameter entry required — backup parameters from existing drive before replacement
Communication Architecture
How the CP1584 Talks to ACOPOS Drives
The CP1584 communicates with ACOPOS drives through one of these protocols:
-
ETHERNET Powerlink (EPL) — Most common on X20 systems. The CP1584 acts as the POWERLINK Managing Node (MN), and each ACOPOS drive is a Controlled Node (CN). Configuration happens through the
acp10syssystem file. -
CAN bus — Used on older B&R systems (PP100, PP015 Power Panels). Requires a CAN interface module (8AC110.60-2) and node addressing.
-
EtherCAT (CoE) — Available on newer 8V1 drives as an alternative protocol.
The acp10sys Configuration File
This is the most critical file for ACOPOS drive operation. The acp10sys file contains:
- Drive-specific parameters (axis configuration, encoder settings, current limits)
- CAN/POWERLINK network node assignments
- Motor and encoder interface configurations
- Safety and limit parameters
- All drive parameters as a monolithic configuration blob
The CP1584 automatically downloads acp10sys to all connected ACOPOS drives on startup. Without a valid acp10sys, drives will not operate.
Critical gotcha: When replacing a drive, the new drive has factory defaults and NO configuration. It needs acp10sys downloaded from the controller before it will function. If the controller doesn’t have the correct acp10sys, you have a chicken-and-egg problem.
See powerlink-internals.md for EPL protocol details and cf-card-boot.md for how acp10sys fits into the boot sequence.
Hardware Interface: X2 Connector
The X2 connector on ACOPOS drives provides:
| Pin | Signal | Direction | Description |
|---|---|---|---|
| X2.1 | 0V DC | Reference | Control ground |
| X2.2 | 24V DC (optional reference) | Input | May be used as reference |
| X2.5 | Ready | Output | Drive is ready (24V when OK) |
| X2.6 | Enable+ | Input | Enable the drive (24V = enabled) |
| X2.7 | Run+ | Input | Start motion (optional hardwire run) |
LED Status Diagnostics
ACOPOS drives have multi-color LEDs for quick visual diagnosis:
ACOPOS Error Code Reference
B&R ACOPOS drives generate numeric error/fault codes that identify the root cause of a failure. These codes are displayed on the drive’s front panel, logged by the PLC, and accessible via SDM.
Comprehensive error code reference: brtschi.ch/automation — This reference documents over 60 error codes (1 through 6047) with descriptions of the drive’s reaction, cause, and correction for each. It is one of the most complete publicly-available ACOPOS error code resources.
Common error code categories:
| Code Range | Category | Examples | Typical Cause |
|---|---|---|---|
| 1-99 | Parameter/configuration errors | 1: Invalid parameter ID, 2: Data block error | acp10sys mismatch, wrong parameter address |
| 100-999 | Communication errors | 6021: Enable unstable, 7100: POWERLINK timeout | Cable fault, enable signal noise, bus timing |
| 1000-1999 | Drive initialization | 1234: Firmware mismatch, 1721: Hardware fault | Wrong firmware, hardware damage |
| 2000-2999 | Motion/control faults | 29203: Drive not enabled, 2105: Position error | Following error, encoder fault, overload |
| 3000-3999 | Power system faults | 3235: Overcurrent, 32399: Manual restart needed | Short circuit, overvoltage, motor stall |
| 7000-7999 | Bus/power supply | 7210: DC bus unstable, 7215: Phase failure | Input power fault, regeneration fault |
Community resources for ACOPOS troubleshooting:
- Wake Industrial: Common ACOPOS Error Scenarios
- B&R Community: ACOPOS 1090 servo drive issue
- B&R Community: PLCopen error 6021 and 29203
LED States
| LED State | Meaning | Action |
|---|---|---|
| Green - steady | Normal operation, no errors | None |
| Green - blinking | No error but drive cannot enable | Check X2.6 enable signal and three-phase power |
| Red - steady | Active fault present | Identify fault code, fix cause, reset |
| Red - blinking | Non-fatal warning or config error | Check parameters and input signals |
| Red/Green - alternating | Bootloader mode or firmware update in progress | Wait — do not power off |
| Off | No power or deep sleep | Check 24V DC supply and main power |
No LEDs Lit
If no LEDs are lit at all, the drive is not receiving 24V DC control power. Check:
- 24V DC supply to the X2 connector
- DC breaker or fuse for the 24V control circuit
- Wiring continuity from the 24V power supply
Complete ACOPOS Fault Code Reference
ACOPOS fault codes are numeric identifiers organized by category. Below is the comprehensive reference extracted from B&R error text modules. This is the complete list — when diagnosing a drive fault, look up the code here first.
Diagnostic/Status Codes (Low-Level)
These are returned during parameter access, data block operations, and firmware download:
| Code | Description | Diagnostic Action |
|---|---|---|
| 1 | Invalid parameter ID | Check parameter number in program or acp10sys |
| 2 | Data block for upload not available | acp10sys missing or corrupted — re-download |
| 3 | Write access for a read-only parameter | Software bug — remove write attempt |
| 4 | Read access for a write-only parameter | Software bug — remove read attempt |
| 8 | Data block read access already initialized | Double-init bug in NC manager |
| 9 | Data block write access already initialized | Double-init bug in NC manager |
| 10 | Data block read access not initialized | Missing init call before read |
| 11 | Data block write access not initialized | Missing init call before write |
| 16 | Data segment is already last (read) | Expected more segments |
| 17 | Data segment is already last (write) | Expected more segments |
| 21 | Checksum after data block write invalid | Corrupted data transfer — retry download |
| 23 | Parameter ID in data block invalid | acp10sys corruption — regenerate |
| 25 | Burn system module only allowed immediately after download | Timing issue during firmware update |
| 27 | OS not able to start (not on FPROM) | Flash corruption — recovery needed |
| 40 | Value higher than maximum | Parameter out of range |
| 52 | Value lower than minimum | Parameter out of range |
| 64 | Hardware ID in BR module invalid | Wrong target hardware |
| 65 | Hardware version in BR module invalid | Version mismatch |
| 66 | Drive OS incompatible with existing network | Downgrade/upgrade drive firmware |
| 67 | Necessary parameter missing or invalid | Check motor/encoder configuration |
| 68 | Data block length invalid | acp10sys corruption |
| 69 | Command interface is occupied | Wait and retry |
| 72 | Firmware version below minimum necessary | Update drive firmware |
| 73 | Invalid R4 floating point format | Data corruption in parameter block |
1000-Series: Communication and Parameter Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 1001 | Error-FIFO overflow | Too many errors — check network/drive health |
| 1002 | Parameter outside valid range | Check value being written |
| 1003 | Parameter cannot be written while loop control is active | Stop controller first, then write |
| 1004 | Timeout in network life sign monitor | POWERLINK/CAN communication lost — check cable, node |
| 1005 | Parameter cannot be written while movement is active | Stop axis first |
| 1006 | Invalid parameter for trigger event (digital input + edge) | Check trigger configuration |
| 1007 | Network coupling master deactivated — another master sending | Check multi-master configuration |
| 1008 | Network coupling master deactivated — Encoder error | Check encoder on coupled axis |
| 1009 | Error during memory allocation | RAM issue or memory leak |
| 1011 | Quickstop input active | Quickstop is asserted — release it |
| 1012 | Breakdown of cyclic network communication | POWERLINK/CAN bus failure — critical |
| 1013 | Station not available for network communication | Drive offline — check power, cable, node assignment |
| 1014 | Network command interface is occupied | Wait and retry |
| 1016 | Maximum cycle time exceeded — CPU load too high | Reduce CPU load or increase cycle time |
| 1017 | Invalid parameter ID for cyclic read access | Check PDO mapping configuration |
| 1018 | Invalid parameter ID for cyclic write access | Check PDO mapping configuration |
| 1021 | Parameter cannot be written: Function block active | Deactivate FB first |
| 1022 | Timeout in life sign monitoring of cyclic data to drive | Check POWERLINK cable and timing |
| 1025 | Value incompatible with holding brake config | Check brake parameter settings |
| 1026 | Value incompatible with SAFETY modules | Check SafeMOTION configuration |
| 1027 | Function not available for this hardware | Hardware does not support feature |
4000-Series: Position Controller Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 4005 | Controller cannot be switched on: Drive in error state | Clear drive fault first |
| 4007 | Lag error stop limit exceeded | Most common motion fault — increase tolerance, check load, check encoder |
| 4008 | Positive limit switch reached | Check physical limit switch and wiring |
| 4009 | Negative limit switch reached | Check physical limit switch and wiring |
| 4010 | Controller cannot be switched on: Both limit switches closed | Wiring fault or both switches triggered |
| 4011 | Controller cannot be switched off: Movement active | Wait for axis to stop |
| 4012 | Controller cannot be switched on: Init parameters missing | acp10sys incomplete — motor data missing |
| 4014 | Two encoder control: Stop limit of position difference exceeded | Check second encoder alignment |
5000-Series: Motion, Homing, and Cam Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 5001 | Target position exceeds positive SW limit | Check target position in program |
| 5002 | Target position exceeds negative SW limit | Check target position in program |
| 5003 | Positive SW limit reached | Software limit hit — check setpoint |
| 5004 | Negative SW limit reached | Software limit hit — check setpoint |
| 5005 | Start not possible: Position controller inactive | Enable controller first |
| 5006 | Start not possible: Axis not referenced | Run homing procedure first |
| 5010 | Move positive not possible: Pos limit switch closed | Release limit switch |
| 5011 | Move negative not possible: Neg limit switch closed | Release limit switch |
| 5015 | Start not possible: Homing procedure active | Wait for homing to complete |
| 5022 | Second limit switch signal: Reference switch not found | Homing failed — check reference switch |
| 5024 | Cyclic set value mode aborted: Set positions missing | POWERLINK data missing |
| 5034 | Homing not possible: Encoder error | Fix encoder before homing |
| 5035 | Reference marks not detected | Check encoder and reference switch |
| 5037 | Homing not possible: Wrong encoder type | Check encoder configuration |
| 5038 | Homing not possible: Restore data invalid | Re-initialize drive parameters |
| 5039 | Function not possible: Encoder error | Fix encoder first |
6000-Series: Power Stage, Controller Enable, and Hardware Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 6011 | Controller is not in speed mode | Switch to correct mode |
| 6015 | CAN bus disturbance (receive error counter > 96) | Check CAN bus wiring, termination, interference |
| 6016 | CAN bus disturbance (transmit error counter > 96) | Check CAN bus wiring, termination, interference |
| 6017 | Software watchdog active | CPU overload — check task class timing |
| 6018 | Hardware: 15V power supply fail | Check internal power supply |
| 6019 | ACOPOS: Overcurrent | Check motor wiring, IGBT stage |
| 6020 | Hardware: 24V power supply fail | Check 24V supply to drive |
| 6021 | Low level at controller enable input | Check enable wiring (X2.6) — marginal 24V or noise |
| 6023 | Voltage sag at controller enable input | Enable signal dropping during operation |
| 6026 | Holding brake: Stator current limit exceeded during release | Check brake mechanism and supply |
| 6028 | Holding brake: Undervoltage/wire breakage | Check 24V to brake |
| 6032 | Interface: FPGA configuration error | Drive hardware fault — may need replacement |
| 6033 | Servo amplifier type not supported by firmware | Update drive firmware |
| 6036 | Motor parameters missing or invalid | Re-enter motor parameters from nameplate |
| 6045 | Power stage X5: No current flow | Check motor connection at X5 |
| 6049 | Power stage X5: Current measurement faulty | Calibration or hardware fault |
| 6052 | Power stage: High-side overcurrent | IGBT or motor fault |
| 6053 | Power stage: Low-side overcurrent | IGBT or motor fault |
| 6054 | Power stage: Overcurrent | IGBT or motor fault — check motor insulation |
| 6057 | Position loop: Load encoder error | Check load-side encoder |
| 6060 | Power stage: Limit speed exceeded | Check for mechanical binding or runaway |
7000-Series: Encoder and Feedback Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 7012 | Encoder: HIPERFACE error bit | Check encoder cable and connections |
| 7013 | Encoder: Status message | Read encoder status register for detail |
| 7014 | Encoder: CRC error during parameter transfer | Cable issue — replace encoder cable |
| 7015 | Encoder: Timeout during parameter transfer | Check cable length and termination |
| 7021 | Encoder: Timeout reading absolute position | Encoder not responding — check cable/power |
| 7029 | Encoder: Incremental signal amplitude too small | Cable or connector issue — check all connections |
| 7030 | Encoder: Incremental signal amplitude too large | Encoder fault or wrong encoder type |
| 7032 | Encoder: Incremental signal too small (disturbance, no connection) | Disconnected or broken cable |
| 7033 | Encoder: Incremental position step too large | Interference or mechanical shock |
| 7036 | Encoder: Interface ID invalid | Check module slot and EEPROM |
| 7039 | Incremental encoder: Cable disturbance track A | Damaged cable — track A signal degradation |
| 7040 | Incremental encoder: Cable disturbance track B | Damaged cable — track B signal degradation |
| 7041 | Incremental encoder: Cable disturbance track R | Damaged cable — reference track degradation |
| 7042 | Incremental encoder: Edge distance too small | Speed too high or encoder damage |
| 7043 | Encoder: Cable disturbance track D | Data track issue — HIPERFACE encoder |
| 7045 | Resolver: Signal disturbance | Check resolver connections |
| 7046 | Resolver: Cable disturbance | Replace resolver cable |
| 7047 | Invalid distance of reference marks | Mechanical encoder fault |
| 7050 | Incremental encoder: Illegal AB signal change | Severe cable damage or EMC interference |
| 7051 | Encoder: Acceleration too large (disturbance) | Mechanical shock or vibration |
| 7052 | Encoder is not supported | Wrong encoder type configured |
| 7053 | Encoder: Power failure | Check encoder power supply |
7200-Series: DC Bus and Power Supply Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 7200 | DC bus: Overvoltage | Braking resistor failure or excessive regen energy |
| 7210 | DC bus: Charging — voltage unstable | Check mains supply quality |
| 7211 | DC bus: Voltage dip | Mains sag — check supply, add line reactor |
| 7212 | DC bus: Large voltage dip | Severe mains issue or DC bus capacitor degradation |
| 7214 | DC bus: Charging resistor hot (too many power fails) | Cycling power too often — let cool |
| 7215 | Power mains: At least one phase failed | Check three-phase input |
| 7217 | DC bus: Nominal voltage too high | Check mains voltage |
| 7218 | DC bus: Nominal voltage too low | Check mains voltage |
| 7219 | DC bus: Charging voltage too low | Check precharge circuit |
| 7221 | Mains: Failure | No three-phase power to drive |
| 7222 | Power stage: Summation current X5 overcurrent | Ground fault — check motor insulation |
| 7223 | DC bus: Overvoltage DC-GND | Isolation issue |
| 7225 | DC bus: Overvoltage | Same as 7200 — braking issue |
| 7226 | DC bus: Overcurrent | Internal fault — may need replacement |
| 7227 | Bleeder: Overcurrent | Braking transistor fault |
9000-Series: Temperature and Overload Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 9000 | Heatsink: Overtemperature — Movement stopped | Check cooling fan and ambient temperature |
| 9001 | Heatsink: Overtemperature — Limiter active | Thermal throttling — reduce duty cycle |
| 9002 | Heatsink temp sensor not connected/damaged | Replace drive or sensor |
| 9010 | Motor/choke/external temp: Overtemperature | Check motor cooling |
| 9030 | Junction temperature model: Overtemperature — Stopped | Internal thermal fault |
| 9031 | Junction temperature model: Overtemperature — Limited | Reduce load |
| 9050 | ACOPOS peak current: Overload — Stopped | Reduce peak load or acceleration |
| 9051 | ACOPOS peak current: Overload — Limited | Reduce acceleration/torque demand |
| 9060 | ACOPOS continuous current: Overload — Stopped | Motor or drive undersized for application |
| 9061 | ACOPOS continuous current: Overload — Limited | Reduce continuous load |
| 9070 | Motor temperature model: Overload — Stopped | Check motor cooling and load |
| 9078 | Power stage: Temp sensor 1 overtemp — Stopped | Internal overheating |
| 9080 | Charging resistor: Overtemperature | Power cycling too fast |
| 9300 | Current controller: Overcurrent | Motor or drive fault |
32000-Series: NC Manager and Network Configuration Errors
These are critical for diagnosing POWERLINK/CAN communication between the CP1584 and ACOPOS drives:
| Code | Description | Diagnostic Action |
|---|---|---|
| 32001 | Error calling CAN_xopen() | CAN driver failure |
| 32010 | Drive not responding to Read Request | Drive offline on network — check cable, node number |
| 32011 | Drive not responding to Write Request | Drive offline on network — check cable, node number |
| 32013 | No operating system on drive | Drive firmware not loaded — download via acp10sys |
| 32014 | Drive OS not compatible with NC manager version | Firmware version mismatch — update drive or NC manager |
| 32020 | System module data could not be read from drive | Communication failure |
| 32036 | Different system module data after download | Download corruption — retry |
| 32037 | Error messages lost: FIFO overflow | Network instability |
| 32047 | CAN node number in acp10cfg is invalid | Fix node assignment in configuration |
| 32048 | CAN node number used repeatedly | Fix duplicate node numbers |
| 32077 | POWERLINK node number in acp10cfg is invalid | Fix EPL node assignment |
| 32078 | POWERLINK node number used repeatedly | Fix duplicate node numbers |
| 32084 | NC configuration has no ACOPOS module | Missing drive in acp10cfg |
| 32085 | Module acp10cfg invalid (AS V2.2+ required) | Update Automation Studio |
| 32098 | Module acp10cfg version not compatible | Update NC manager library |
| 32213 | Timeout for POWERLINK interface | EPL communication failure — check cable, switch, MN |
| 32225 | ACOPOS POWERLINK node not in AR configuration | Drive node not configured in AS project |
| 32398 | acp10sys has no OS for this ACOPOS hardware type | Wrong acp10sys version for drive model |
| 32399 | Manual ACOPOS restart needed after NCSYS download | Power cycle drive after firmware update |
35000-Series: SMC Fail Safe (Safety) Errors
| Code | Description | Diagnostic Action |
|---|---|---|
| 35000 | Internal error: Program flow | Safety controller firmware fault |
| 35004 | Internal error: EnDat communication | Check safety encoder communication |
| 35005 | Internal error: ACOPOS communication | Safety communication failure |
| 35006 | Internal error: Encoder communication | Check encoder cable |
| 35035 | Internal state machine in Fail Safe State | Safety system tripped — check all safety inputs |
| 35036 | Deactivated safety function was requested | Software tried to use disabled safety function |
| 35037–35041 | SLS1-SLS4 speed limit out of range | Check Safe Limited Speed configuration |
| 35085 | Safe output: Stuck at high detected | Safety output fault — possible hardware failure |
| 35087 | Encoder: Speed limit exceeded (safety) | Safety speed limit violated |
Quick Diagnostic Flowchart
When an ACOPOS drive faults on a CP1584 system:
Drive Fault?
├── Green blink (can't enable)?
│ ├── Check X2.6 enable signal (24V present?)
│ ├── Check three-phase power at power terminals
│ └── Check drive 24V DC supply
├── Red steady (active fault)?
│ ├── Note the fault code (SDM, AS online, or OPC-UA)
│ ├── Error 1012/1013? → Network communication lost
│ │ ├── Check POWERLINK cable
│ │ ├── Check drive node number
│ │ └── Check MN (CP1584) POWERLINK status
│ ├── Error 4007? → Following error / lag error
│ │ ├── Check encoder cable (codes 7029, 7032, 7039?)
│ │ ├── Check mechanical load (binding?)
│ │ ├── Check acceleration/torque settings
│ │ └── Check encoder alignment
│ ├── Error 7200/7225? → DC bus overvoltage
│ │ ├── Check braking resistor (open circuit?)
│ │ ├── Check deceleration rate
│ │ └── Check mains voltage
│ ├── Error 6021? → Enable signal unstable
│ │ ├── Check X2.6 wiring
│ │ ├── Check for ground loop
│ │ └── Add debouncing if noisy
│ ├── Error 70xx? → Encoder fault
│ │ ├── Replace encoder cable (most common fix)
│ │ ├── Check encoder power supply
│ │ ├── Check connector seating
│ │ └── See [encoder-diagnostics.md](encoder-diagnostics.md)
│ ├── Error 9000/9030? → Temperature
│ │ ├── Check cooling fan
│ │ ├── Check ambient temperature
│ │ ├── Reduce duty cycle
│ │ └── Check drive mounting/ventilation
│ └── Error 32013/32014? → Firmware mismatch
│ ├── Check drive firmware version
│ ├── Check acp10sys version
│ └── See [firmware-version-mgmt.md](firmware-version-mgmt.md)
├── Red blink (warning)?
│ ├── Check parameters in SDM
│ ├── May indicate approaching thermal or current limits
│ └── Review drive configuration
└── No LEDs?
├── Check 24V DC control power
├── Check DC breaker/fuse
└── Check wiring from power supply
Common Error Scenarios
- “ERROR IN PALA DRIVE” on the HMI — acp10sys is missing or corrupted, firmware version mismatch, or hardware failure. Error code 32013 (no OS) or 32014 (version mismatch).
- Drive enables then immediately faults — Motor phasing wrong (6044), encoder disconnected (7032, 7053), or power supply issue (7215, 7221).
- Drive won’t enable (green blink) — Enable signal (X2.6) not present (6021) or three-phase power missing (7215).
- 24V breaker trips when enable applied — Enable input short circuit, internal drive fault, ground loop (6054, 7222).
- Drive works intermittently, faults under load — Lag error (4007) from encoder cable degradation (7039, 7040), or thermal overload (9000, 9050).
- All drives fault simultaneously — POWERLINK MN failure on CP1584 (1012), or DC bus issue (7200).
- Drive faults only after warm-up — Thermal fault (9000, 9030) — check cooling, or encoder cable expanding with heat (7039).
- PLCopen error 6021 (“Enable unstable”) — The enable signal at X2.6 is fluctuating. Common causes: marginal 24V supply at the enable input, ground loop causing voltage sag, loose terminal connection, or wiring running parallel to motor power cables picking up noise. Measure the enable voltage with a scope while the fault is active — it must be stable above the threshold (typically >18V). See grounding-emc.md for noise mitigation.
- PLCopen error 29203 (“Drive not enabled”) — The PLC program is commanding motion (MC_MoveAbsolute, MC_MoveVelocity, etc.) but the drive’s enable chain is not complete. Check: (a) MC_Power function block has Enable=TRUE and Status=TRUE, (b) no active fault on the drive, (c) safety chain allows enable, (d) STO is released. This error means the software is trying to move before the hardware is ready.
- Error 32280 (“Timeout during drive initialization”) — The ACOPOS drive is taking too long to boot on the POWERLINK network. This can be caused by excessive network traffic during startup, a damaged POWERLINK cable, or a drive with corrupted firmware. If it happens intermittently, check cable quality and POWERLINK cycle timing.
Monitoring Drive Status Without the Original Project
Method 1: SDM (System Diagnostics Manager)
Open a web browser and navigate to the CP1584’s IP address. The SDM web interface shows:
- Drive status (online/offline/fault)
- POWERLINK node status for each drive
- DC link voltage
- Motor current (per phase)
- Drive temperature
- Encoder feedback status
- Fault history
Method 2: Automation Studio Online Monitoring
Even without the project source, you can connect Automation Studio to the running PLC:
- Create a minimal project with just the CP1584 CPU
- Set the correct IP address
- Go to Online → Login
- Browse available variables in the Watch window
- Look for motion-related variables (axis status, position, velocity, torque)
Method 3: OPC-UA Browsing
If OPC-UA is configured on the CP1584, use any OPC-UA client (UaExpert, Prosys) to browse the address space. Drive data typically appears under motion-related namespaces.
See opcua.md for setup details and cp1584-forensics.md for extracting information from an unknown PLC.
Method 4: PVI API
Use the B&R PVI library from a PC to programmatically access drive variables:
## Using PVI.py
from pvi import *
pvi = PviConnection()
line = pvi.add_line('LN1', 'TCP')
cpu = line.add_device('CP1584', 'TCP', '192.168.1.10')
## Browse available variables
vars = cpu.list_variables()
## Read axis position
pos = cpu.read_variable('gAxis1.Position')
See pvi-api.md for the complete PVI programming reference.
Parameter Backup and Restore
Backup Parameters Before Anything Else
If you do nothing else from this document, BACK UP YOUR DRIVE PARAMETERS NOW.
Method A: Export via Automation Studio
- Connect to the PLC with the project that contains the drive configuration
- Navigate to Hardware Configuration → Drive Parameters
- Select all parameters → File → Export → XML
- Save the XML file with the drive model number, serial number, date, and machine identifier
Method B: Export Individual Drive Parameters
- In Automation Studio, expand Physical View → ACOPOS → Parameters
- Right-click → Export Parameters
- This creates a
.paror.xmlfile specific to each drive
Method C: Backup the acp10sys File
The acp10sys file IS your complete drive system configuration. It’s stored in the Automation Studio project under:
Physical View → ACOPOS → System Files → acp10sys
Also found on the CF card as part of the deployed project. Make a copy of the entire CF card image (see cf-card-boot.md).
Method D: Backup via SDM
Some drive parameters can be exported through the SDM web interface under the drive diagnostics section.
What Parameters Are Critical to Back Up
| Category | Examples | Why Critical |
|---|---|---|
| Motor data | Rated current, pole pairs, inertia | Without these, drive won’t match motor |
| Encoder config | Type, resolution, commutation offset | Wrong encoder = no position control |
| Controller gains | Kp, Ki, Kd (position, velocity, current) | Tuning lost = poor or unstable motion |
| Limits | Max velocity, acceleration, torque | Safety limits must be preserved |
| Home position | Homing mode, offset, direction | Machine zero reference |
| Network config | Node address, cycle time, PDO mapping | Communication won’t work otherwise |
| Safety params | STO configuration, safe limits | Required for safety system compliance |
Drive Replacement Procedure
Complete Step-by-Step Replacement
WARNING: Always de-energize and wait 5+ minutes for DC link capacitors to discharge before servicing servo drives. Measure DC link voltage to confirm < 50V.
Step 1: Backup Everything
- Export all drive parameters to XML (see above)
- Image the CF card from the CP1584
- Photograph all wiring connections
- Document the drive model number, firmware version, and slot configuration
- Record the CAN/POWERLINK node address
Step 2: Remove the Failed Drive
- Remove AC mains power
- Wait 5 minutes, verify DC link < 50V
- Disconnect: motor power, encoder cable, communication bus, X2 control signals, 24V supply
- Label ALL cables with their source/destination
- If the drive has a CF card or option modules in slots, remove them carefully and note slot positions
Step 3: Install the Replacement Drive
- Verify the replacement drive is the exact same model (8V1016.00-2, etc.)
- Install any option modules (encoder interface, communication) in the same slots as the original
- Mount the drive and reconnect all cables per your labels
- Do not apply power yet
Step 4: Restore Configuration
Option A — You have the Automation Studio project with acp10sys:
- Power on the CP1584 and all drives
- Download the project (including acp10sys) from Automation Studio
- The acp10sys automatically provisions all drives
- Verify: no error LEDs on the ACOPOS, SDM shows all nodes online
Option B — You don’t have the project (worst case):
- If you have an XML parameter backup, you can load it via Automation Studio to a minimal project
- If you only have the CF card image, you may be able to reconstruct a project from the configuration files (see project-reconstruction.md)
- As a last resort, you can download acp10sys directly to the drive using a CAN interface (PCAN-USB or 8AC110.60-2), but the drive must be in bootloader mode (cycle power while holding MODE button)
Step 5: Verify and Re-zero
- Check all drive LEDs — green steady is the target
- Verify DC link voltage in SDM (should be ~1.35 × line voltage for 3-phase)
- Verify motor nameplate data matches drive configuration
- If using an absolute encoder (EnDat 2.2), position is retained — no re-zeroing needed
- If using an incremental encoder, run the homing routine (
MC_Home) to re-establish zero - Test axis movement in manual/jog mode at low speed
- Verify emergency stop (STO) functions correctly
Re-zeroing Methods
| Method | When to Use | Procedure |
|---|---|---|
| Software Zero | Encoder position known, small offset needed | Automation Studio → Motion → Zero Position → Set Software Zero |
| Hardware Homing | Incremental encoder, standard homing switch | Execute MC_Home in the PLC program |
| Absolute Encoder | EnDat/Hiperface absolute encoder | Position retained automatically — no action needed |
Verification Checklist
| Test | Procedure | Acceptance Criteria |
|---|---|---|
| DC Link Voltage | Measure on power-up or read in SDM | Within ±10% of expected (1.35 × line voltage) |
| Motor Current Balance | Monitor per-phase in SDM at rated load | Balanced within 5% |
| Position Accuracy | Move to known reference position | Within ±1 encoder count |
| Velocity Control | Jog at constant speed | Steady velocity, no hunting |
| E-Stop Response | Actuate STO input | Drive de-energizes immediately |
| Following Error | Move at production speed | Within configured following error limit |
Motor Parameter Recognition
B&R motors have an embedded parameter chip (EEPROM/HIPERFACE DSL memory) that contains:
- Motor type and model number
- Rated current and voltage
- Pole pairs
- Thermal time constants
- Inertia and friction data
- Encoder type and resolution
- Commutation offset (for EnDat 2.2 encoders) — stored in the encoder’s non-volatile memory
When an ACOPOS drive is connected to a B&R motor and powered on, the drive reads this chip and automatically configures the motor parameters. This auto-recognition feature means:
- If you’re replacing a motor with an identical B&R motor, the drive will auto-configure
- If you’re using a non-B&R motor, you MUST enter parameters manually (including commutation offset)
- If the motor’s parameter chip is corrupted, the drive won’t recognize the motor
- Commutation offset is critical for torque control — it defines the electrical angle relationship between the encoder zero position and the motor’s magnetic poles. For B&R EnDat 2.2 motors, this offset is stored in the encoder memory and is read automatically. For non-B&R motors or when using incremental/resolver encoders, the commutation offset must be determined via a phasing routine.
Commutation Offset for Non-B&R Motors
When using motors without embedded commutation data (e.g., third-party motors with incremental encoders), the ACOPOS drive must perform a phasing routine to determine the commutation offset:
- Via Automation Studio:
Motion → Axis → Parameters → Motor → Commutation Offset— set to 0 for resolver-based motors (commutation offset is always 0 for resolvers because resolver zero aligns with the magnetic pole) - Via acp10sys parameter: The commutation offset is stored as a signed integer in the motor parameter block
- Phasing procedure: The drive energizes the motor windings in a known pattern, measures the rotor position from the encoder, and calculates the offset. This is done automatically by the ACOPOS during initial commissioning when “Auto Phasing” is enabled
Important: Per B&R training module TM460, phasing is NOT necessary when using B&R motors because the commutation offset is either 0 (resolver) or stored in the EnDat encoder memory. This is a significant advantage of B&R motors — if you need to replace a motor and can source a B&R equivalent, you avoid the entire commutation alignment process.
HIPERFACE DSL (HDSL) Single-Cable Technology
B&R motors with HIPERFACE DSL encoders use a single cable for both motor power and encoder communication:
- Encoder data is transmitted digitally over the same two cores that carry motor power
- Eliminates the separate encoder cable — reduces wiring complexity and failure points
- Fully digital signal transmission, immune to analog interference
- Supports safety data transmission (HDSL Safety) with a firmware update on the drive
- Cable length up to 100m supported
Diagnostic note: If an HDSL motor shows encoder errors (70xx codes), the single-cable design means the fault could be in either the power cable or the encoder itself. Test with a known-good cable to isolate. See encoder-diagnostics.md for full procedures.
Manual Motor Parameter Entry
In Automation Studio, navigate to:
Hardware Configuration → ACOPOS → Parameters → Motor
Enter: rated current, rated voltage, pole pairs, encoder resolution, inertia. The drive will use these for current control and commutation.
Drive Firmware Management
Checking Firmware Version
- Via SDM: Browse to the drive in the SDM web interface — firmware version displayed
- Via Automation Studio: Online → System Diagnostics → ACOPOS firmware version
- Via drive LEDs: bootloader mode shows version during startup (red/green alternating)
Updating Firmware
Firmware updates are distributed as part of the Automation Studio installation or from B&R’s download portal. The update process:
- Download the new firmware files to the CF card or via Automation Studio
- Power cycle the drive while holding the MODE button (enters bootloader)
- Automation Studio detects the drive in bootloader mode
- Online → Download → Firmware Update
- Wait for completion (red/green alternating LEDs)
- Do not power off during update — this can brick the drive
Version Compatibility
| Automation Studio Version | acp10sys Version | ACOPOS Firmware |
|---|---|---|
| 3.0.x | 1.x - 2.x | 1.x - 2.x |
| 3.5.x - 3.9.x | 3.x | 3.x |
| 4.x+ | 4.x+ | 4.x+ |
Mismatched versions are a common cause of “drive won’t work after replacement.” Always match the Automation Studio version to the original project version.
Encoder Diagnostics
Supported Encoder Types
| Encoder Type | Interface | Notes |
|---|---|---|
| Incremental TTL/RS422 | Standard differential | Common, requires homing |
| Sin/Cos (1Vpp) | Analog | Higher resolution than TTL |
| Hiperface | Digital (RS485) | Absolute, single-turn |
| EnDat 2.1/2.2 | Digital | Absolute, multi-turn, B&R preferred |
| Resolver | Analog | Rugged, used in harsh environments |
| Tamagawa | Digital | Absolute, used on some Japanese motors |
Diagnosing Encoder Problems
- Encoder loss fault — Check encoder cable continuity, connector seating, and cable routing (keep away from motor power cables)
- Position jumping — Signal interference (EMC issue) or failing encoder — see grounding-emc.md
- Wrong direction — Encoder A/B channels swapped or commutation offset incorrect
- Following error exceeds limit — Encoder resolution mismatch, mechanical binding, or tuning issue
See encoder-diagnostics.md for detailed encoder troubleshooting procedures.
Common ACOPOS Problems and Solutions
Problem: Drive Won’t Enable
Symptoms: Green blinking LED, Ready output (X2.5) not active
Diagnosis sequence:
- Verify 24V DC at X2.1/X2.6 (enable input)
- Verify three-phase power is present at the drive input
- Check that acp10sys is loaded and valid
- Check the PLC program is asserting the enable (MC_Power function block)
- Check safety chain — STO may be preventing enable
- Verify no active faults on the drive (check SDM)
Problem: Drive Faults Immediately After Enable
Symptoms: Green briefly, then red steady with fault code
Diagnosis sequence:
- Note the fault code — look it up in the ACOPOS manual or error code list
- Check motor cable connections (U, V, W phases) for correct order
- Verify encoder cable is connected and seated
- Check that motor parameters match the actual motor
- Measure motor insulation resistance (megger test)
- If fault code indicates DC link issue, check braking resistor
Problem: Following Error / Position Deviation
Symptoms: Drive moves but position error grows, or motor oscillates
Diagnosis sequence:
- Reduce velocity and acceleration to see if it stabilizes
- Check mechanical system for binding or excessive friction
- Verify load inertia settings match actual load
- Check encoder signal quality (scope the encoder signals if possible)
- Verify controller gains haven’t been accidentally changed
- Check for EMC interference on encoder cables
Problem: DC Link Overvoltage
Symptoms: Fault on deceleration or during rapid speed changes
Diagnosis sequence:
- Check braking resistor — measure resistance (should not be open circuit)
- Verify braking resistor is connected to the correct terminals
- Check that regenerative energy isn’t exceeding drive capacity
- Reduce deceleration rate or add external braking resistor
Problem: Phase Current Imbalance
Symptoms: Motor runs rough, excess heat, vibration
Diagnosis sequence:
- Measure motor current per phase in SDM or with clamp meter
- If imbalance > 5%, suspect:
- Motor winding fault (megger test)
- IGBT failure in drive (need drive repair)
- Loose connection in motor cable
- Run motor disconnected from mechanical load to isolate drive vs mechanical issue
Safety Features
Safe Torque Off (STO)
Most ACOPOS drives support STO (STO per IEC 61800-5-2). When STO is activated:
- Drive power stage is disabled immediately
- Motor coasts to stop (no regenerative braking from drive)
- This is NOT the same as an emergency stop — the drive does not actively brake
SafeMOTION (B&R Extended Safety)
Newer ACOPOS drives and the CP1584 with SafeLOGIC support:
- Safe Limited Speed (SLS)
- Safe Direction (SDI)
- Safe Stop (SS1, SS2)
- Safe Position (SLP)
See safe-io-diagnostics.md for safety system diagnostics.
Finding Spare Parts and Replacement Drives
Identifying the Drive
B&R part numbers follow the pattern: 8V1016.00-2
8V= ACOPOS single-axis series1016= Current rating (10A continuous, 16A model).00-2= Version/revision
Sourcing Replacements
When the OEM is gone:
- B&R direct — Requires active service contract or B&R portal account
- Third-party refurbishers — Companies like Wake Industrial, Roc Industrial, and various servo repair shops stock and repair ACOPOS drives
- Used/surplus market — eBay, industrial surplus dealers — verify firmware compatibility
- Cross-reference — No direct cross-reference exists to other brands; ACOPOS is proprietary
Firmware Matching Is Critical
A replacement drive from stock may have different firmware than your system. You MUST:
- Check the replacement drive’s firmware version (SDM or bootloader mode)
- If it doesn’t match your system, update firmware BEFORE installing
- Or use an Automation Studio version that supports the drive’s firmware
ACOPOS D1 — Next-Generation Servo Drive (2026)
B&R announced the ACOPOS D1 servo drive at Innovation Days 2026 (Pune, India, March 2026). This is a new generation of servo drives positioned alongside (not replacing) the ACOPOS P3. As of mid-2026, detailed technical specifications have not been publicly released beyond marketing announcements. Key information known:
What We Know
| Aspect | Detail |
|---|---|
| Launch date | March 2026, Innovation Days Pune |
| Market focus | India-first launch, global rollout expected |
| Key themes | Compact form factor (“shrinking cabinets”), scalable multi-axis, edge computing intelligence for predictive maintenance |
| Executive quote | Florian Schneeberger (ABB Division President): “Intelligent ecosystems over silos — agile, sustainable factories” |
| Context | Part of B&R’s 2026 “adaptive automation” strategy — moving from rigid production to flexible modular systems |
What This Means for CP1584 Machine Maintainers
- ACOPOS D1 does NOT replace your existing 8V1/P3 drives — it is a new product line. Existing 8V1 drives remain supported and available.
- If sourcing replacement 8V1 drives becomes difficult (long-term), the D1 may become an alternative. However, migration from 8V1 to D1 will require:
- New drive hardware with different form factor
- Updated acp10sys (or equivalent configuration methodology)
- Possible motor/encoder cable changes
- Automation Studio version that supports D1 (likely AS 6.x+)
- Edge intelligence is a key differentiator — the D1’s built-in “predictive uptime” capabilities suggest integrated condition monitoring that could reduce unplanned downtime. If this proves valuable, retrofitting may justify the migration cost.
- Monitor the B&R product catalog for D1 specifications. When detailed technical data (power range, communication protocols, safety certifications, form factor dimensions) becomes available, this section will be updated.
Status: This section will be updated as B&R releases technical specifications for the ACOPOS D1. Check B&R’s product page at br-automation.com/en-us/products/motion-control/acopos/ and the B&R Community forum for announcements.
Sources: B&R Innovation Days 2026 Pune (press coverage), LinkedIn posts from Florian Schneeberger (B&R/ABB), Industrial Automation Magazine India.
Key Findings
-
The acp10sys file is everything — Without it, ACOPOS drives are paperweights. Back it up religiously. It’s part of the Automation Studio project and also on the CF card.
-
LEDs tell you 90% of the story — Green steady = good. Green blink = no enable. Red steady = fault (look up the code). Red blink = warning. Off = no power.
-
Drive replacement is plug-and-play ONLY if you have the configuration — Move CF card, move option modules to same slots, reload acp10sys. Without configuration, you’re doing reverse engineering.
-
Version matching is the #1 cause of replacement failure — The new drive’s firmware must match the acp10sys version from the original project. Mismatched versions cause communication failures.
-
Motor auto-recognition only works with B&R motors — If you’re using third-party motors, you must have the manual parameter values. Back them up.
-
Encoder problems are the most common intermittent fault — Signal degradation, cable damage, and EMC interference cause position errors that manifest as drive faults. See encoder-diagnostics.md and grounding-emc.md.
-
SDM is your best friend without the project — The System Diagnostics Manager web interface shows drive status, fault history, and live data without needing Automation Studio or any project files.
Cross-References
- powerlink-internals.md — EPL communication protocol between CP1584 and drives
- cf-card-boot.md — How acp10sys is loaded during boot
- encoder-diagnostics.md — Encoder troubleshooting for motion systems
- pvi-api.md — Programmatic drive access from a PC
- opcua.md — OPC-UA access to drive data
- safe-io-diagnostics.md — Safety system (STO, SafeMOTION) diagnostics
- grounding-emc.md — EMC troubleshooting for encoder/drive signal quality
- project-reconstruction.md — Rebuilding a project when the original is lost
- cp1584-forensics.md — Extracting information from an unknown CP1584
- custom-diagnostic-tools.md — Building diagnostic programs that run on the PLC
B&R Network Architecture and Device Enumeration
Overview
B&R X20 systems use a multi-layer network architecture: ETHERNET Powerlink (EPL) for real-time control communication, standard Ethernet/TCP-IP for IT-level traffic, X2X for local IO bus expansion, and optional CAN bus. Understanding this architecture is essential when you inherit an undocumented machine — you need to map out what devices exist, how they’re connected, and what data flows between them.
Network Topology Types
ETHERNET Powerlink Topologies
POWERLINK supports any combination of the following topologies without manual configuration:
| Topology | Description | When Used |
|---|---|---|
| Star | All devices connect to a central hub/switch | Clean installations, easy isolation |
| Daisy Chain | Devices connected in series using built-in 2-port switches | Most common — minimizes cabling |
| Tree | Hierarchical branching from central hub | Large machines with multiple sections |
| Ring | Daisy chain with last device connected back to first | Redundancy — automatic failover on cable break |
B&R POWERLINK hubs (e.g., X20HB8880) support all these topologies. The Compact Link Selector enables ring redundancy for critical applications.
X2X Bus Topologies
The X2X bus (backplane bus connecting X20 IO modules) is always a daisy chain:
CPU/BC → [Module 1] → [Module 2] → [Module 3] → [Terminal Module]
Each module has an X2X in and X2X out connector. The terminal module provides termination.
Typical Machine Network Layout
Standard Ethernet (TCP/IP)
┌──────────────────────┐
│ Engineering PC │
│ HMI / SCADA │
│ SDM (web browser) │
└──────────┬───────────┘
│
┌──────┴──────┐
│ Ethernet │
│ Switch │
└──────┬──────┘
│
┌────────────┐ POWERLINK ┌──────┴──────┐ POWERLINK ┌────────────┐
│ ACOPOS │◄──────────────►│ CP1584 │◄──────────────►│ ACOPOS │
│ Drive 1 │ │ (MN node) │ │ Drive 2 │
└────────────┘ └──────┬──────┘ └────────────┘
│ X2X Bus
┌──────┴──────┐
│ X20 IO │
│ Modules │
└──────┬──────┘
│ X2X Bus
┌──────┴──────┐
│ X20 IO │
│ Modules │
└─────────────┘
Device Discovery on an Unknown Network
Method 1: Automation Studio Browse
- Open Automation Studio
- Go to Online → Settings
- Toggle Browse ON
- Automation Studio broadcasts on the local subnet and discovers all B&R devices
- Devices appear with: IP address, device name, model number, serial number
Method 2: Standard Network Scan
Since B&R devices respond to standard Ethernet protocols:
## ARP scan - finds all devices on the local subnet
arp -a
## Nmap scan - detailed device discovery
nmap -sn 192.168.1.0/24
## Ping sweep
for i in {1..254}; do ping -c 1 -W 1 192.168.1.$i | grep "bytes from" & done; wait
## DNS reverse lookup (some B&R devices register their name)
nmap -sL 192.168.1.0/24
Method 3: B&R Community Tools
| Tool | Description | Source |
|---|---|---|
| brsnmp | SNMP commands for B&R PLCs — list/search PLCs, change IP | awesome-B-R GitHub |
| ListAllBurPLCs | Lists all B&R PLCs on the network | awesome-B-R GitHub |
| brwatch | Service tool — watch variables, change IP | awesome-B-R GitHub |
Method 4: Wireshark / POWERLINK Capture
- Install Wireshark with the POWERLINK plugin
- Connect your PC to the same network segment
- Start capture on the Ethernet interface
- Filter:
eplfor POWERLINK frames - The Managing Node (MN) — your CP1584 — will be visible in
SoC(Start of Cycle) frames - All Controlled Nodes (CNs) respond with their node addresses
The POWERLINK MN node is typically node 240 (0xF0). CNs are assigned sequentially.
See powerlink-internals.md for detailed POWERLINK protocol analysis.
Method 5: SDM Web Interface
- Open a browser to the PLC’s IP address (default often 192.168.1.10)
- The SDM shows all connected POWERLINK nodes, their status, and firmware versions
- Navigate to System → Network for full device enumeration
Method 6: Finding a PLC with Unknown IP
If you don’t know the PLC’s IP address:
- Connect directly with an Ethernet cable (no switch)
- Set your PC to DHCP
- B&R PLCs often have DHCP enabled by default, or respond to ARP from any IP
- In Wireshark, look for ARP packets from the PLC’s MAC address (B&R OUI prefix)
- In Automation Studio, enable Browse — it discovers devices via UDP broadcast
- Reset to factory IP: hold the MODE button during power-on for 5 seconds (resets IP to 192.168.1.10)
Network Addressing
IP Address Configuration
B&R devices have IP addresses configured via:
- Automation Studio — set in the CPU’s Ethernet configuration
- SDM web interface — accessible via browser
- SNMP — using brsnmp tool
- Hardware reset — MODE button during power-on (factory default: 192.168.1.10)
POWERLINK Node Addressing
POWERLINK uses node IDs (1-239 for CNs, 240 for MN):
- MN (Managing Node): Always node 240 — this is the CP1584
- CN (Controlled Node): Assigned sequentially 1, 2, 3… by the MN
- Node addresses are automatically assigned during POWERLINK startup (SoC phase)
- No manual IP configuration needed for POWERLINK communication — it uses MAC-based addressing
X2X Station Addressing
X2X stations are addressed by their position in the daisy chain:
- Station 0: The bus controller (BC module on the CPU)
- Station 1: First IO module after the BC
- Station 2: Second IO module, etc.
Addresses are automatic — the bus controller enumerates stations during initialization.
Network Diagnostic Tools
Built-in Diagnostics
| Tool | Access Method | What It Shows |
|---|---|---|
| SDM | Web browser → PLC IP | All devices, faults, firmware, network stats |
| Automation Studio Online | AS → Online → Login | Variable values, task status, IO mapping |
| PLC Logger | AS → Tools → Logger | System events, warnings, errors with timestamps |
External Network Tools
| Tool | Use | Notes |
|---|---|---|
| Wireshark + EPL plugin | Capture POWERLINK traffic | Filter by node, analyze cycle timing |
| nmap | Network discovery and port scanning | Standard TCP/IP layer |
| ping | Basic connectivity test | Check if PLC responds |
| ARP | Find devices on local subnet | Quick scan without tools |
| brsnmp | B&R-specific SNMP commands | Change IP, list PLCs |
| brwatch | Real-time variable monitoring | Command-line, lightweight |
Common Network Issues
POWERLINK Communication Failure
Symptoms: Drives/IO modules show as offline, red LEDs on modules
Diagnosis:
- Check SDM — which nodes are missing?
- Verify POWERLINK cable connections (daisy chain: each module has IN and OUT)
- Check termination — the last device in the chain needs a terminator or the bus controller must have termination enabled
- Verify the bus controller (BC) module is correctly configured in the project
- Check cable continuity with a cable tester
- Look for the POWERLINK activity LEDs on the bus controller and hub modules
Ethernet Connectivity Problems
Symptoms: Can’t reach PLC from PC, HMI disconnected
Diagnosis:
- Verify IP address is correct and on the same subnet
- Check physical Ethernet cable and link LEDs on the PLC and switch
- Ping the PLC — if no response, check cabling and IP configuration
- Verify subnet mask and gateway settings
- Check if the PLC’s Ethernet interface is enabled in the hardware configuration
IP Address Conflicts
Symptoms: Intermittent connectivity, PLC appears and disappears from network
Diagnosis:
- Check for duplicate IPs using
arp -a— look for the same IP with different MAC addresses - Ensure no other device is using the PLC’s IP
- Change the PLC’s IP if needed (via SDM, brsnmp, or Automation Studio)
Network Performance Degradation
Symptoms: POWERLINK cycle time violations, intermittent timeouts
Diagnosis:
- Check POWERLINK cycle time configuration — is it too fast for the number of nodes?
- Verify cable quality — damaged cables cause retransmissions
- Check for excessive non-real-time traffic on the same Ethernet segment
- Separate real-time (POWERLINK) and IT (TCP/IP) traffic onto different VLANs or physical networks if possible
- Monitor POWERLINK timing in Wireshark — look for cycle time jitter
Documenting an Unknown Network
When you inherit an undocumented machine, systematically document the network:
Step 1: Physical Inspection
- Follow every cable from the PLC to each device
- Note cable types (Ethernet, X2X flat cable, motor power, encoder)
- Label every cable at both ends
- Photograph the cabinet layout
Step 2: Software Discovery
- Connect to the PLC’s SDM web interface
- Use Automation Studio Browse to find all B&R devices
- Run a network scan (nmap or arp) to find non-B&R devices (switches, HMIs)
- Capture POWERLINK traffic in Wireshark to see all active nodes
Step 3: Create a Network Map
Document:
- Device model, serial number, firmware version
- IP address / POWERLINK node address / X2X station address
- Cable connections (what port connects to what)
- Network configuration (subnet, gateway, cycle time)
Step 4: Record Network Configuration
| Device | Model | IP Address | PLK Node | X2X Station | Firmware | Status |
|---|---|---|---|---|---|---|
| CPU | X20CP1584 | 192.168.1.10 | 240 (MN) | — | V4.10 | OK |
| Bus Controller | X20BC0083 | — | — | 0 | V2.x | OK |
| IO Module 1 | X20DI9371 | — | — | 1 | V1.x | OK |
| IO Module 2 | X20DO9321 | — | — | 2 | V1.x | OK |
| Drive 1 | 8V1016.00-2 | — | 1 (CN) | — | V3.x | OK |
| Drive 2 | 8V1016.00-2 | — | 2 (CN) | — | V3.x | OK |
| HMI | 4PPC70… | 192.168.1.11 | — | — | V3.x | OK |
Ethernet Switching Requirements for POWERLINK
Why Switches Matter
POWERLINK is a time-sliced protocol that requires deterministic Ethernet frame delivery. Standard managed switches can interfere with POWERLINK timing. Understanding this is critical for network design.
POWERLINK Switching Rules
| Rule | Details |
|---|---|
| Dedicated segment recommended | POWERLINK should have its own physical Ethernet segment when possible |
| No IGMP snooping needed | POWERLINK uses directed frames (not multicast in the traditional sense) |
| Managed switches | Can be used but must not introduce latency spikes. Avoid spanning tree, QoS reshaping, or storm control |
| B&R POWERLINK hubs | X20HB8880 hubs are purpose-built — 2-port, non-blocking, no processing delay |
| Standard switches (daisy chain) | Each switch adds ~1-5 µs latency; acceptable for cycle times > 1 ms |
| Full-duplex switches | Acceptable for POWERLINK V2 with some implementations; not for V1 real-time domain |
Network Segregation Strategies
GOOD: Separate physical networks
┌──────────────┐ ┌──────────────┐
│ IT Network │ │ POWERLINK │
│ (Switch) │ │ (Hub chain) │
│ HMI/SCADA │ │ Drives/IO │
└──────┬───────┘ └──────┬───────┘
│ │
└────────┬───────────┘
│
┌──────┴──────┐
│ CP1584 │
│ IF2=Ethernet │
│ IF3=POWERLINK│
└─────────────┘
ACCEPTABLE: Same switch with VLANs
┌──────────────────────┐
│ Managed Switch │
│ VLAN 10: IT traffic │
│ VLAN 20: POWERLINK │
└──────────┬───────────┘
│
┌──────┴──────┐
│ CP1584 │
└─────────────┘
Important: When POWERLINK and TCP/IP share IF3 (same physical port), they are time-multiplexed. The POWERLINK real-time phase has absolute priority. Non-real-time traffic fills the remaining time slots. If the cycle time is very tight, TCP/IP performance on IF3 will be severely degraded. Use IF2 (dedicated Ethernet) for IT traffic.
OPC UA Network Integration
Port and Protocol
| Parameter | Default |
|---|---|
| OPC UA endpoint | opc.tcp://<PLC_IP>:4840 |
| Discovery URL | opc.tcp://<PLC_IP>:4840 |
| Security | None (default), Basic128Rsa15, Basic256, Basic256Sha256 |
| Max sessions | 50 (configurable) |
OPC UA on the Network
- OPC UA runs on IF2 (Ethernet), not IF3 (POWERLINK)
- If IF2 is on the same subnet as POWERLINK address range (192.168.100.x), there may be routing issues
- OPC UA traffic is standard TCP — works through routers, VPNs, and firewalls
- See opcua.md for detailed configuration and client access
Network Security Considerations
B&R systems from defunct OEMs often have minimal security:
| Risk | Mitigation |
|---|---|
| No authentication on OPC UA | Add firewall rules; restrict port 4840 to trusted IPs |
| FTP access with default/no password | Disable FTP service if not needed; restrict via firewall |
| SDM web interface open to all | Restrict port 80/443; use VPN for remote access |
| SNMP community strings default (“public”) | Change SNMP community in AR configuration |
| Telnet/SSH access | Disable if not needed; check AR configuration for remote shell |
Remote Access Options
For monitoring machines remotely:
| Method | Pros | Cons |
|---|---|---|
| VPN tunnel to plant network | Secure, full access | Requires IT infrastructure |
| OPC UA via port forwarding | Standard protocol, works through NAT | Security risk if not secured |
| MQTT bridge (via OPC UA→MQTT gateway) | Lightweight, IoT-friendly | Requires additional hardware/software |
| SDM via HTTPS | No extra software needed | Limited to SDM capabilities |
See iiot-retrofit.md for detailed remote monitoring setup.
Compact Link Selector (Ring Redundancy)
B&R POWERLINK supports automatic ring redundancy via the Compact Link Selector:
- Connect the last node in the daisy chain back to the first (forming a ring)
- If any cable in the ring breaks, communication continues via the alternate path
- Failover is automatic and typically completes within 1-2 POWERLINK cycles
- Requires compatible B&R hubs (X20HB8880 with Compact Link support)
- Configured in Automation Studio’s POWERLINK network configuration
When to Use Ring Redundancy
- High-availability applications (continuous processes)
- Long cable runs where damage risk is elevated
- Multi-machine lines where one cable break would stop the entire plant
- Not typically needed for standalone machines
Subnet Design Guidelines
Default Address Ranges
| Interface | Typical Default | Notes |
|---|---|---|
| IF2 (Ethernet) | 192.168.1.x | Configurable via AS or SDM |
| IF3 (POWERLINK) | 192.168.100.x | Reserved for POWERLINK; do not overlap with IF2 |
Best Practices
- Keep POWERLINK on its own subnet (192.168.100.x)
- IT traffic on a separate subnet (192.168.1.x)
- Use a dedicated VLAN if sharing physical switches
- Document all IP addresses — use the network map template above
- Reserve IP ranges for future expansion (spare PLCs, new drives)
DHCP and IP Configuration
| Method | Description |
|---|---|
| Static (default) | IP set in AS project or SDM; persistent across reboots |
| DHCP | Can be enabled; PLC requests IP from DHCP server at boot |
| BOOTP | Legacy protocol; some older configurations use this |
| INA2000 formula | IP = 192.168.1.<hex_switch_value> (when INA mode is active) |
For an undocumented machine: check if DHCP is enabled by connecting a PC to the same switch and running a DHCP discovery. If the PLC responds, you’ll find its IP. Otherwise, use ANSL discovery (nmap port 11169/11160) or factory reset (hold MODE button during power-up).
DNS Configuration
Why DNS Matters in B&R Automation
DNS is required for several B&R system services, even on isolated plant networks:
| Service | DNS Dependency | Notes |
|---|---|---|
| NTP time synchronization | NTP servers resolved by hostname (e.g., pool.ntp.org) | Without DNS, NTP sync fails and PLC clocks drift |
| OPC-UA endpoint discovery | Server certificates may reference DNS names | Client certificate validation can fail without proper DNS |
| PLC hostname resolution | Other devices reference PLCs by hostname | Cross-device communication may break |
| Software updates | B&R update servers resolved by hostname | Not relevant for isolated networks, but DNS is still configured |
| ANSL discovery | Uses UDP broadcasts, not DNS | Works without DNS |
DNS Configuration in Automation Runtime
DNS servers are set in the CPU properties under Ethernet Interface → TCP/IP → DNS:
| Parameter | Description | Example |
|---|---|---|
| Primary DNS Server | First DNS server queried | 8.8.8.8 or plant DNS (e.g., 10.0.0.2) |
| Secondary DNS Server | Fallback if primary is unreachable | 8.8.4.4 or secondary plant DNS |
| DNS Domain | Appended to unqualified hostnames | plant.local or company.com |
| Get DNS from DHCP | Automatically receive DNS settings via DHCP | Enabled or disabled |
DNS Servers for Industrial Use
| Server | Address | Use Case |
|---|---|---|
| Plant DNS server | Plant-specific (e.g., 10.0.0.2) | Preferred — resolves internal hostnames |
| Google Public DNS | 8.8.8.8 (primary), 8.8.4.4 (secondary) | Internet-connected networks, reliable fallback |
| Cloudflare DNS | 1.1.1.1 | Alternative public DNS |
| B&R default | None configured | Must be set manually for NTP |
On isolated plant networks without internet access, configure DNS to point at the plant’s internal DNS server. If no internal DNS exists and NTP is required, either use IP addresses directly for NTP or set up a local DNS resolver.
“Get DNS from DHCP” Option
When enabled, the PLC obtains DNS server addresses from the DHCP response alongside the IP address. This is convenient but has caveats:
- Only works on interfaces configured for DHCP (typically IF2)
- DNS settings are lost if the DHCP server is unreachable at boot
- The PLC may boot with stale DNS if the DHCP lease expires during a network outage
- For critical systems, use static DNS configuration for reliability
DNS Troubleshooting for B&R Networks
| Symptom | Diagnosis | Fix |
|---|---|---|
| NTP sync fails | DNS cannot resolve NTP server hostname | Check DNS server reachability from PLC; try IP address for NTP server |
| OPC-UA certificate errors | Certificate CN does not match resolved IP | Configure proper DNS or use IP-based endpoint URLs |
| PLC hostname not resolving | DNS not configured or hostname not registered in DNS | Add PLC to plant DNS or use hosts file on client machines |
| Slow network operations | DNS timeout before fallback | Configure reachable DNS servers or disable DNS if unused |
For detailed NTP and DNS interdependencies, see time-sync.md.
Ethernet Interface Configuration
IF2 vs IF3 on X20CP1584
The X20CP1584 has two independent Ethernet interfaces, each serving a different purpose:
| Interface | Name | Purpose | Connector |
|---|---|---|---|
| IF2 | ETHx (Ethernet) | Standard TCP/IP — OPC UA, SDM, FTP, SNMP, NTP | RJ45 |
| IF3 | ETHx+1 (POWERLINK) | POWERLINK real-time bus + multiplexed TCP/IP | RJ45 |
Critical distinction: IF3 can carry both POWERLINK real-time frames and non-real-time TCP/IP traffic in a time-division multiplexed manner. The POWERLINK cycle owns the isochronous phase; TCP/IP traffic fills the remaining asynchronous phase slots. If the POWERLINK cycle time is tight (e.g., 200 µs), very little bandwidth remains for TCP/IP on IF3. For heavy IT traffic, use IF2 exclusively.
Interface Configuration in CPU Properties
Each interface is configured independently in Automation Studio under the CPU’s hardware configuration:
| Setting | IF2 (Ethernet) | IF3 (POWERLINK) |
|---|---|---|
| IP Address | Static or DHCP | Static (POWERLINK uses MAC-based addressing) |
| Subnet Mask | Configurable | 255.255.255.0 typical |
| Default Gateway | Configurable | Rarely set (used for multiplexed TCP/IP) |
| DNS Servers | Configurable | Inherited or separate |
| MAC Address | Hardware-fixed | Hardware-fixed |
| Speed/Duplex | Auto-negotiate or forced | Auto-negotiate or forced |
Speed and Duplex Settings
| Setting | Options | Recommendation |
|---|---|---|
| Speed | 10 Mbps, 100 Mbps, Auto | Auto-negotiate for standard installations; force 100 Mbps Full if auto-negotiation fails |
| Duplex | Half, Full, Auto | Always Full Duplex — Half Duplex causes collisions and retransmissions |
| Auto-Negotiation | Enabled/Disabled | Leave enabled unless troubleshooting duplex mismatches |
Forcing speed/duplex on one end without matching the other causes a duplex mismatch, leading to late collisions, CRC errors, and severe performance degradation. If forcing is necessary, both the PLC port and the switch port must match exactly.
MAC Address Format (B&R OUI)
B&R Automation assigns MAC addresses from their registered OUI (Organizationally Unique Identifier):
| Prefix | OUI Owner | Example MAC |
|---|---|---|
| 00:07:6C | B&R Industrial Automation | 00:07:6C:XX:XX:XX |
| 08:00:06 | B&R (legacy assignment) | 08:00:06:XX:XX:XX |
When scanning a network, filtering by B&R OUI prefixes identifies B&R devices among all network endpoints:
# Find all B&R devices by MAC prefix in ARP table
arp -a | grep -i "00:07:6c"
Link Aggregation and Multi-Homing
The X20CP1584 does not support IEEE 802.3ad link aggregation (LACP) natively. However, multi-homing — using both IF2 and IF3 simultaneously on different subnets — is fully supported and is the standard operating mode:
- IF2: Connected to the IT/SCADA network (192.168.1.x)
- IF3: Connected to the POWERLINK real-time bus (192.168.100.x)
Each interface routes independently. The PLC maintains separate routing tables per interface. Traffic for the POWERLINK subnet goes out IF3; traffic for the IT subnet goes out IF2. If both subnets overlap, ambiguous routing occurs and connectivity becomes unpredictable.
Interface LED Indicators
| LED | State | Meaning |
|---|---|---|
| Link/ACT (Green) | On | Physical link established |
| Link/ACT (Green) | Blinking | Data transmission active |
| Link/ACT (Green) | Off | No physical link — check cable |
| Speed (Amber/Yellow) | On | 100 Mbps connection |
| Speed (Amber/Yellow) | Off | 10 Mbps connection |
| Error (Red) | On | CRC error, duplex mismatch, or collision detected |
On POWERLINK hubs (X20HB8880), additional LEDs indicate POWERLINK bus activity and ring redundancy status. See cp1584-hardware-ref.md for complete LED reference.
Latency and Performance Analysis
POWERLINK Cycle Time Latency Components
A single POWERLINK cycle is divided into phases, each contributing to overall latency:
| Phase | Duration (typical) | Contribution |
|---|---|---|
| SoC (Start of Cycle) | Broadcast from MN to all CNs | ~10-20 µs |
| PReq (Poll Request) | MN polls each CN sequentially | ~2-5 µs per CN |
| PRes (Poll Response) | CN responds to MN | ~2-5 µs per CN |
| Async Phase | Non-real-time data exchange | Remaining time |
| SoA (Start of Async) | Signals async phase beginning | ~2 µs |
Total cycle time = sum of all phases. For a system with 5 CNs at 200 µs cycle time, the isochronous portion consumes approximately 50-75 µs, leaving the remainder for asynchronous traffic.
Ethernet Switch Latency
Each switching element in the POWERLINK path adds latency:
| Device | Per-Hop Latency | Notes |
|---|---|---|
| B&R POWERLINK hub (X20HB8880) | < 1 µs | Store-and-forward at wire speed; essentially transparent |
| Unmanaged switch | 1-5 µs | Fast switching, minimal overhead |
| Managed switch (no features) | 2-10 µs | Depends on switching ASIC |
| Managed switch (IGMP/STP) | 5-50 µs | Processing features add jitter; avoid on POWERLINK |
| Router | 50-500 µs | Never route POWERLINK traffic; use bridges only |
X2X Bus Latency Contribution
The X2X backplane bus adds latency for IO data to reach the CPU:
| Parameter | Value | Notes |
|---|---|---|
| X2X bus cycle time | 200-500 µs | Configurable in Automation Studio |
| Per-module propagation | ~1-2 µs | Daisy chain delay accumulates |
| Typical 10-module chain | ~20-30 µs total | Including bus controller processing |
| Bus controller processing | ~10-15 µs | CPU reads/writes IO image |
X2X latency is independent of POWERLINK cycle time. The CPU updates the IO image at the X2X rate and maps it into the POWERLINK cycle. If X2X cycle time exceeds POWERLINK cycle time, IO data may be stale by one cycle.
End-to-End Latency Budget Calculation
For a signal traveling from a digital input to a drive command output:
| Stage | Latency |
|---|---|
| Input module debounce + X2X transport | ~300 µs (X2X cycle) |
| CPU program scan (logic processing) | ~100-500 µs (depends on program) |
| POWERLINK cycle (MN sends command to drive) | ~200 µs (one cycle) |
| Drive processing and motor response | ~500 µs - 2 ms (drive-dependent) |
| Total (typical) | ~1.1 - 3.0 ms |
| Total (best case) | ~0.6 ms |
This budget explains why cycle time configuration is critical — reducing POWERLINK cycle time from 1 ms to 200 µs saves 800 µs per cycle in the command path.
Measuring Latency with Wireshark
To measure actual POWERLINK latency from captures:
- Capture POWERLINK traffic on the MN’s interface
- Apply filter:
epl && epl.soc - Calculate time delta between consecutive SoC frames — this is the actual cycle time
- Apply filter:
epl && epl.preq && epl.node == 1 - Measure time from PReq to matching PRes — this is the round-trip to CN 1
- Compare actual cycle times against configured cycle time to detect jitter
Wireshark column setup for latency analysis:
| Column | Display Filter Field | Purpose |
|---|---|---|
| Frame Delta | frame.time_delta | Cycle-to-cycle timing |
| EPL Service | epl.service | Identify SoC, PReq, PRes |
| EPL Node | epl.node | Identify which CN |
| Frame Length | frame.len | Detect oversized frames |
Acceptable Latency Thresholds
| Application | Acceptable E2E Latency | POWERLINK Cycle Time |
|---|---|---|
| Simple on/off control | < 50 ms | 10 ms (not latency-critical) |
| Conveyor synchronization | < 10 ms | 2-5 ms |
| Motion coordination (multi-axis) | < 5 ms | 1-2 ms |
| High-dynamic servo control | < 2 ms | 200-400 µs |
| Registration/cutting applications | < 1 ms | 100-200 µs |
| Electronic camming | < 0.5 ms | 100 µs |
When the application requires cycle times below 200 µs, the number of nodes in the POWERLINK chain must be carefully managed — each additional CN consumes time in the isochronous phase.
Network Troubleshooting Deep Dive
POWERLINK Packet Loss Diagnosis
Packet loss in POWERLINK manifests as drives going to fault state, IO modules showing communication errors, or cycle time violations. Use Wireshark to diagnose:
## Wireshark capture filter for POWERLINK traffic
## Capture on the interface connected to the POWERLINK segment
## Display filter: show only Poll Requests to detect missing responses
epl && epl.preq
## Display filter: show only Start of Cycle to check cycle consistency
epl && epl.soc
## Display filter: show errors
epl && epl.error
## Display filter: isolate a specific node
epl && epl.node == 3
Steps to diagnose packet loss:
- Start Wireshark capture on the POWERLINK segment
- Apply
epl && epl.soc— verify SoC frames arrive at the configured interval - Apply
epl && epl.preq— for each PReq, confirm a matching PRes follows within the timeout window - Missing PRes frames indicate the CN is not responding — check cabling and power to that node
- Late PRes frames (arriving outside the isochronous window) indicate switch latency or cable issues
- Count total frames over 60 seconds; compare expected vs. actual to calculate loss percentage
Cycle Timing Violation Analysis
When the PLC logs POWERLINK cycle time violations, the actual cycle exceeded the configured maximum. Diagnose by:
- Capture a 10-second Wireshark trace with filter
epl - Export to CSV and calculate the time delta between consecutive SoC frames
- Plot the cycle times — look for outliers and patterns
- Common causes:
- Too many CNs for the configured cycle time
- Async phase overflow — too much TCP/IP traffic on IF3
- Switch latency spikes from managed switch features
- Cable integrity issues causing retransmissions
- Competing traffic from a misconfigured VLAN
Duplex Mismatch Detection
Duplex mismatch causes late collisions, FCS errors, and severe throughput degradation (often 40-60% packet loss):
| Symptom | Diagnostic |
|---|---|
| High FCS/CRC error count on switch port | Check port statistics on managed switch |
| Late collisions (after 64 bytes) | Duplex mismatch almost certain |
| Intermittent POWERLINK node drops | Mismatch causes frame loss at line rate |
| Works at 10 Mbps, fails at 100 Mbps | One end forcing speed without matching duplex |
Fix: configure both ends to the same speed/duplex, or ensure both are set to auto-negotiate. Never mix auto-negotiate on one end with forced settings on the other.
Cable Quality Testing
| Method | Tool | What It Tests |
|---|---|---|
| Continuity test | Basic cable tester | Pin-to-pin connectivity |
| Cable certification | Fluke DSX or equivalent | Cat5e/Cat6 compliance, NEXT, return loss, length |
| TDR (Time Domain Reflectometry) | Cable certifier or network switch | Cable length, impedance mismatches, open/short locations |
| Bit Error Rate Test | Managed switch port statistics | BER over extended test period |
For POWERLINK networks, use Cat5e minimum (Cat6 preferred). Maximum cable run: 100 meters per segment. Longer runs require repeaters or fiber media converters. B&R fiber optic POWERLINK modules (X20ET001) are available for runs up to 2 km.
Network Storm Detection and Prevention
A network storm occurs when broadcast or multicast traffic floods the segment, blocking POWERLINK frames:
| Storm Type | Cause | Detection |
|---|---|---|
| Broadcast storm | Spanning tree loop, misconfigured mirror port | Switch port statistics show >1000 broadcasts/sec |
| Multicast storm | IGMP misconfiguration, POWERLINK flooding | Wireshark shows excessive POWERLINK SoC frames |
| ARP storm | Duplicate IP, rogue DHCP server | Wireshark filter arp shows continuous ARP requests |
Prevention: enable broadcast storm control on managed switches (~100 pps threshold), disable unused ports, avoid creating loops without spanning tree, and use B&R POWERLINK hubs which do not propagate broadcasts.
Spanning Tree Issues with Managed Switches
Spanning Tree Protocol (STP/RSTP/MSTP) can disrupt POWERLINK:
| Problem | Impact | Fix |
|---|---|---|
| STP blocking port | POWERLINK nodes behind blocked port unreachable | Configure port as edge/portfast |
| STP reconvergence | 30-50 second outage during topology change | Disable STP on POWERLINK ports |
| RSTP rapid reconvergence | 1-3 second outage | Still disruptive for real-time; disable on POWERLINK ports |
| BPDU guard violation | Port shuts down | Configure BPDU guard appropriately |
For POWERLINK segments, disable spanning tree on the relevant ports or use “edge port” / “portfast” designation to skip the listening/learning phases.
Auto-Negotiation Failures
Auto-negotiation can fail between B&R devices and certain switches, resulting in:
| Failure Mode | Symptom | Fix |
|---|---|---|
| Speed mismatch | No link or 10 Mbps instead of 100 Mbps | Force both ends to 100 Mbps Full |
| Duplex mismatch | Link up but high CRC errors | Force both ends to same duplex |
| Link not established | No LED activity | Force speed/duplex; try different cable |
| Intermittent link | Link drops under load | Replace cable; check connector seating |
B&R Ethernet interfaces generally implement IEEE 802.3ab auto-negotiation correctly. Issues typically arise with older switches or non-standard Ethernet implementations. When auto-negotiation fails, forcing 100 Mbps Full Duplex on both the PLC and the switch port resolves the issue.
Firewall and Security Configuration
Ports Used by B&R Systems
| Port | Protocol | Service | Direction | Notes |
|---|---|---|---|---|
| 4840 | TCP | OPC UA | Inbound | Default OPC UA endpoint port |
| 80 | TCP | SDM (HTTP) | Inbound | System Diagnostics Manager web interface |
| 443 | TCP | SDM (HTTPS) | Inbound | Encrypted SDM access |
| 11169 | TCP/UDP | ANSL | Inbound | Automation NET Service Layer — device discovery |
| 11160 | UDP | ANSL Discovery | Inbound | Broadcast discovery protocol |
| 20-21 | TCP | FTP | Inbound | File transfer — transfer projects, firmware |
| 161 | UDP | SNMP | Inbound | Simple Network Management Protocol |
| 162 | UDP | SNMP Trap | Outbound | SNMP trap notifications |
| 22 | TCP | SSH | Inbound | Secure shell access (if enabled) |
| 23 | TCP | Telnet | Inbound | Unencrypted remote access (disable if unused) |
| 123 | UDP | NTP | Outbound | Time synchronization (client) |
| 502 | TCP | Modbus TCP | Inbound | If Modbus gateway configured |
Firewall Rule Recommendations for B&R PLC Isolation
A minimum-viable firewall configuration for a B&R PLC:
| Rule | Source | Destination | Port | Action | Purpose |
|---|---|---|---|---|---|
| 1 | SCADA Server | PLC | 4840 | Allow | OPC UA access |
| 2 | Engineering PC | PLC | 80, 443 | Allow | SDM web interface |
| 3 | Engineering PC | PLC | 20-21 | Allow | FTP for project transfer |
| 4 | Engineering PC | PLC | 11169 | Allow | ANSL device discovery |
| 5 | NTP Server | PLC | 123 | Allow | Time synchronization |
| 6 | SNMP Manager | PLC | 161 | Allow | SNMP monitoring |
| 7 | Any | PLC | Any | Deny | Default deny all other traffic |
For outbound traffic from the PLC, allow: NTP to NTP Server (123/UDP), Syslog to Log Server (514/UDP), and default deny all other outbound.
Network Segmentation for Security
Deploy B&R PLCs in a dedicated automation zone separated from the corporate IT network:
Corporate IT ──► Firewall (rules above) ──► Automation Zone (VLAN)
├── PLC 1 (192.168.1.10)
├── PLC 2 (192.168.1.11)
├── HMI (192.168.1.20)
├── SCADA Server (192.168.1.30)
└── Engineering PC (192.168.1.100)
Key segmentation principles:
- All traffic between IT and automation traverses a firewall
- The automation zone has no direct internet access
- Engineering PCs are dual-homed or access the automation zone via VPN
- SNMP community strings are unique per device and not “public”
- OPC UA uses certificate-based security (not “None” mode)
PLC-to-PLC Firewall Rules
When PLCs communicate directly (PLC-to-PLC, see plc-to-plc.md):
| Rule | Source | Destination | Port | Action |
|---|---|---|---|---|
| 1 | PLC 1 | PLC 2 | 11169 | Allow (ANSL) |
| 2 | PLC 1 | PLC 2 | 4840 | Allow (OPC UA) |
| 3 | PLC 1 | PLC 2 | 11160 | Allow (ANSL Discovery) |
Restrict PLC-to-PLC communication to only the required ports. If PLCs only use POWERLINK for inter-communication (via shared bus), no TCP/IP firewall rules between them are needed.
SCADA/IT Network Demilitarized Zone (DMZ)
For plants requiring SCADA connectivity to both the automation zone and the corporate network, place SCADA servers in a DMZ between two firewalls: Corporate IT -> Firewall A -> DMZ (SCADA Server, Historian, OPC UA Gateway) -> Firewall B -> Automation Zone.
- The SCADA server sits in the DMZ with two network interfaces
- Firewall A allows SCADA-specific ports from corporate IT to the DMZ
- Firewall B allows only SCADA-to-PLC ports from DMZ to automation zone
- OPC UA gateways in the DMZ can bridge protocols (OPC UA to MQTT, OPC UA to REST)
- The DMZ provides a buffer — if the corporate network is compromised, the attacker cannot directly reach PLCs
Multicast and Broadcast Handling
POWERLINK’s Use of Multicast and Broadcast
POWERLINK uses destination addresses that appear as multicast or broadcast on the wire:
| Frame Type | Destination MAC | Purpose |
|---|---|---|
| SoC (Start of Cycle) | 01:EF:00:00:00:01 (POWERLINK multicast) | MN signals start of new cycle to all CNs |
| PReq (Poll Request) | Target CN’s unicast MAC | MN polls individual CN |
| PRes (Poll Response) | MN’s unicast MAC | CN responds to MN |
| SoA (Start of Async) | 01:EF:00:00:00:01 (POWERLINK multicast) | Signals async phase |
POWERLINK SoC and SoA frames use a reserved multicast MAC address (01:EF:00:00:00:01) to simultaneously reach all CNs. This is not standard IPv4 multicast — it is an Ethernet-level multicast specific to POWERLINK.
IGMP Snooping Interaction
IGMP snooping on managed switches can interfere with POWERLINK:
| Scenario | Behavior |
|---|---|
| IGMP snooping OFF | POWERLINK multicast floods all ports — works correctly for POWERLINK |
| IGMP snooping ON (no IGMP queries) | Switch may block POWERLINK multicast after aging timeout — nodes go offline |
| IGMP snooping ON with queries | PLC does not respond to IGMP queries (not IP multicast) — multicast gets pruned |
Recommendation: Disable IGMP snooping on all POWERLINK ports. If the switch requires IGMP snooping for other VLANs, place POWERLINK on a separate VLAN with snooping disabled, or use B&R POWERLINK hubs.
Broadcast Domain Sizing
The POWERLINK segment should be sized appropriately:
| Parameter | Recommended Limit | Maximum |
|---|---|---|
| Nodes per MN | 10-20 CNs | 239 CNs (theoretical) |
| Nodes per hub chain | 4-8 devices | Limited by cable length and hub ports |
| Cable length (total chain) | < 100 m per segment | 100 m per segment (Cat5e/6) |
| Cycle time with many nodes | Scale cycle time with node count | Each CN adds ~5 µs to isochronous phase |
Large POWERLINK networks (>50 nodes) require careful planning: use tree or star topology to reduce cable length per chain, increase cycle time proportionally to node count, consider multiple MNs for very large installations, and use ring topology for redundancy on critical paths.
ANSL Discovery Broadcast
ANSL (Automation NET Service Layer) uses broadcast for device discovery:
| Protocol | Port | Direction | Purpose |
|---|---|---|---|
| ANSL Discovery | UDP 11160 | Broadcast | Locates B&R devices on the subnet |
| ANSL Service | TCP 11169 | Unicast | Device information retrieval |
ANSL discovery broadcasts from Automation Studio (engineering PC) and from SDM. These broadcasts are limited to the local broadcast domain and do not traverse routers. If the engineering PC and PLC are on different subnets, ANSL discovery will not work — use direct IP connection or configure a DHCP relay. For network scanning:
# Scan for B&R devices using ANSL discovery
nmap -sU -p 11160 192.168.1.0/24 --open
# Check ANSL service on a known PLC
nmap -sT -p 11169 192.168.1.10
Key Findings (Updated)
-
POWERLINK topology is auto-configuring — star, daisy chain, tree, ring, any combination works without manual setup. The MN (CP1584) automatically discovers and addresses all CNs.
-
SDM is your first stop for network discovery — the web interface shows every device, its status, firmware version, and connection topology without needing any tools or software.
-
B&R community tools are invaluable — brsnmp, ListAllBurPLCs, and brwatch give you command-line access to discover and manage B&R devices without Automation Studio.
-
Physical cable tracing is essential — no software tool can tell you where cables actually run. Get your hands on the cabinet and follow every cable.
-
POWERLINK and TCP/IP can share the same physical network, but separating them improves performance for critical applications.
-
Node addressing is automatic for both POWERLINK and X2X — you don’t need to configure addresses manually (unless using specific addressing modes).
-
POWERLINK requires deterministic switching — avoid standard managed switches with spanning tree or storm control. B&R POWERLINK hubs (X20HB8880) are purpose-built for zero-delay frame forwarding.
-
Always keep POWERLINK on its own subnet (192.168.100.x) separate from Ethernet/IT traffic (192.168.1.x) to prevent routing conflicts and performance degradation.
-
Default PLC IP is often 192.168.1.10 — if you can’t find the PLC, try this address. Factory reset restores it.
Cross-References
- powerlink-internals.md — POWERLINK protocol deep internals and Wireshark analysis
- x2x-protocol.md — X2X bus protocol and wire-level details
- cp1584-forensics.md — Extracting info from an unknown CP1584
- diagnostics-sdm.md — System Diagnostics Manager usage
- acopos-drives.md — ACOPOS drive communication details
- cp1584-hardware-ref.md — CP1584 hardware specifications, interfaces, LED indicators
- opcua.md — OPC-UA server configuration and client access
- time-sync.md — NTP/DNS configuration for time synchronization
- iiot-retrofit.md — Adding modern monitoring protocols (MQTT, SNMP), network integration
- modbus-gateway.md — Modbus TCP/RTU gateway configuration, Modbus TCP networking
- plc-to-plc.md — Inter-PLC communication discovery and monitoring
- firmware.md — Firmware architecture and update mechanisms
- ftp-web-interface.md — FTP and web server interfaces for remote access
- cybersecurity-hardening.md — Network isolation and firewall strategies
- cf-card-boot.md — CF card contents and boot sequence
- io-card-hardware.md — IO module hardware architecture and LED diagnostics
PLC-to-PLC Communication on B&R Systems: Discovery, Interception, and Reverse Engineering Without Project Files
Overview
You have inherited a machine built by a now-defunct OEM. It has multiple B&R CP1584 PLCs, zero documentation, and no Automation Studio project files. The PLCs are clearly talking to each other — production halts when one goes down, and fault codes propagate across stations — but you have no idea how they communicate or what data they share.
This guide covers every practical method for discovering, tapping into, and understanding inter-PLC communication on B&R Automation systems when you are starting from scratch. It assumes familiarity with basic PLC concepts but no prior B&R-specific knowledge.
Related files in this repository:
| File | Why It Matters Here |
|---|---|
| opcua.md | OPC-UA is the most accessible inter-PLC protocol; that file covers server config, namespace browsing, and certificate management |
| powerlink-internals.md | POWERLINK is B&R’s native deterministic bus; PDO mapping and cycle timing are covered in depth there |
| network-architecture.md | Network topology, device enumeration, and physical layer layout for B&R systems |
| pvi-api.md | PVI is B&R’s proprietary middleware; the file covers programmatic variable access without project files |
| x2x-protocol.md | X2X is the backplane bus; relevant if PLCs share I/O through bus couplers |
Communication Mechanisms Between B&R PLCs
B&R PLCs can exchange data through at least six distinct mechanisms. On a multi-PLC machine, more than one may be active simultaneously. Your first job is to figure out which ones are in use.
Summary of Inter-PLC Communication Paths
| Mechanism | Latency | Deterministic? | Requires Project Config? | Discoverable Without Project? |
|---|---|---|---|---|
| POWERLINK (PDO exchange) | 0.1–10 ms | Yes | Yes | Partially (Wireshark capture) |
| POWERLINK CN-to-CN cross-traffic | 0.1–4 ms | Yes | Yes | Partially (Wireshark capture) |
| OPC-UA (server/client) | 10–200 ms | No | Yes | Yes (browse namespace) |
| Modbus TCP | 50–500 ms | No | Yes | Yes (port scan + sniff) |
| Ethernet/IP | 10–100 ms | No | Yes | Yes (port scan + sniff) |
| Raw TCP/UDP sockets | Variable | No | Yes (custom code) | Yes (port scan) |
| PVI/INA2000 | 10–100 ms | No | Automatic | Yes (port 11160) |
| CAN / CANopen | 1–10 ms | Yes | Yes | Yes (bus analyzer) |
| Serial (RS-232/485) | Variable | No | Yes (custom code) | Yes (serial sniffer) |
Method 1: POWERLINK-Based Communication
POWERLINK How It Works
POWERLINK is B&R’s native real-time Ethernet protocol. It uses a Managing Node (MN) / Controlled Node (CN) architecture. For PLC-to-PLC communication, one PLC acts as the MN and the others as CNs, or all PLCs operate as CNs with a dedicated MN device.
There are two POWERLINK patterns for inter-PLC data exchange:
-
MN-mediated exchange: The MN collects data from all CNs and redistributes it. PLC-A sends its data to the MN in its PRes frame, the MN copies relevant data into PLC-B’s PReq, and PLC-B receives it. This is the simplest and most common pattern.
-
CN-to-CN direct cross-traffic: PRes frames are multicast. PLC-B can directly read PLC-A’s PRes payload without going through the MN. This requires explicit configuration in Automation Studio (both PLCs must be in the same project or referenced together) and the receiving CN must support cross-traffic (B&R iCNs do; third-party CNs may not).
What You’ll See on the Wire
POWERLINK uses ethertype 0x88AB. A typical cycle looks like:
[MN SoC] → [PReq to CN1] → [CN1 PRes] → [PReq to CN2] → [CN2 PRes] → [SoA] → [ASnd...]
- SoC (Start of Cyclic): MN initiates the isochronous phase
- PReq (Poll Request): MN polls a specific CN by NodeID
- PRes (Poll Response): CN responds with its process data (PDOs)
- SoA (Start of Asynchronous): Opens the async phase
- ASnd (Asynchronous Send): Non-real-time data (SDO, NMT commands)
Wireshark Capture
# Capture POWERLINK traffic on interface eth0
wireshark -i eth0 -f "ether proto 0x88AB"
# Or use BPF filter
tcpdump -i eth0 -w powerlink.pcap "ether[12:2] = 0x88AB"
Useful Wireshark display filters:
epl.src == 1 # All packets from NodeID 1 (typically the MN)
epl.dest == 3 # All packets addressed to NodeID 3
epl.type == 0x0001 # SoC frames only
epl.type == 0x0013 # PReq frames only
epl.type == 0x0014 # PRes frames only
epl.type == 0x0016 # SoA frames only
epl.type == 0x0017 # ASnd frames only
Identifying Which PLCs Are POWERLINK Nodes
- Connect a PC to the POWERLINK network (any tap point works — see physical-layer-sniffing.md for methods)
- Capture traffic for 5–10 seconds
- In Wireshark, look at the
epl.srcandepl.destfields - NodeID
0is broadcast, NodeID240(0xF0) is the MN by convention - Other NodeIDs (1–239) are CNs — each is a PLC or drive
Understanding the PDO Payload
The PRes frame payload contains the mapped process data objects (PDOs). Without the project file, you won’t know the data layout, but you can:
- Count the payload bytes in each PRes frame to determine the data width per CN
- Create a custom column in Wireshark: right-click a PRes payload field → “Apply as Column” → rename to “PRes-Payload”
- Watch for patterns: If a payload has a section that changes only when a specific physical event occurs (e.g., a conveyor starts), you can correlate it
For detailed PDO mapping internals, see powerlink-internals.md Section 8.
Determining MN vs CN Role for Each PLC
- The MN sends SoC, PReq, and SoA frames. It never sends PRes.
- CNs only send PRes and ASnd frames.
- If you see a PLC sending SoC frames, it is the MN.
- If PLCs are using an X20ET8819 network analysis module or similar dedicated MN hardware, none of the PLCs will be the MN.
Method 2: OPC-UA Server/Client Communication
OPC-UA How It Works
OPC-UA is the most “modern” and most accessible inter-PLC mechanism. One PLC runs an OPC-UA server (exposing its variables), and other PLCs run OPC-UA client components (OpcUa_Any hardware object in Automation Studio) that subscribe to those variables.
B&R supports both:
- Configuration-only OPC-UA (no code required): Using the
OpcUa_Anyhardware object in Physical View - Code-based OPC-UA: Using
AsOpcUaclibrary or the communityEasyUaClntwrapper for complex types (strings, structs, methods)
Discovering OPC-UA Communication
This is the one mechanism you can fully discover without any project files:
Step 1: Find the servers
# Scan for OPC-UA discovery servers on the control network
nmap -p 4840 --open 192.168.1.0/24
# Or use opcua-commander if available
# python3 -m opcua opc.tcp://192.168.1.50:4840
The default OPC-UA port is 4840. If a PLC has OPC-UA enabled, it will respond.
Step 2: Browse the namespace with UAExpert
- Download UAExpert (Unified Automation) — free client
- Add a new server:
opc.tcp://<PLC-IP>:4840 - If security is configured, you may need certificates. Try “None” security first.
- Browse the address space tree
B&R OPC-UA namespace structure:
Objects
└── PLC
├── Modules
│ ├── Default
│ │ ├── <TaskName>
│ │ │ ├── Variable1 (BOOL)
│ │ │ ├── Variable2 (REAL)
│ │ │ └── Variable3 (DINT)
│ │ └── <OtherTask>
│ └── Global PV
│ ├── gVar1 (USINT)
│ └── gVar2 (BOOL)
└── Server
└── (diagnostic info)
Step 3: Identify inter-PLC variables
Look for variables whose names suggest inter-PLC data exchange. Common naming patterns from OEMs:
StationX_.../CellX_...— station/cell identifiersFrom_PLC1_.../To_PLC1_...Handshake_.../HS_...Command_.../Status_...Interlock_.../Safety_...Recipe_.../Setpoint_...Heartbeat_.../Watchdog_...
Step 4: Monitor values in real-time
In UAExpert, subscribe to suspected inter-PLC variables. Watch how they change when you:
- Cycle the machine through different states
- Trigger faults on one station
- Change recipes or product types
Critical Limitation: Variables Must Be Explicitly Enabled
OPC-UA does not automatically expose all variables. Each variable must be explicitly marked as an OPC-UA tag by the OEM in the OpcUaMap configuration. If the OEM didn’t enable a variable, it won’t appear in the namespace — even if it exists in the running PLC program. See opcua.md for details on the enable/disable mechanism.
OPC-UA Browse Path Syntax (B&R to B&R)
When configuring a B&R OPC-UA client to connect to a B&R OPC-UA server, the browse path syntax is:
# Local variables (inside a specific task):
/0:Root/0:Objects/4:PLC/6:Modules/6:&:&:/6:/6:
# Global variables (PV scope):
/0:Root/0:Objects/4:PLC/6:Modules/6:&:&:/6:Global PV/6:
If the server uses Information Models (PV 2.00), replace 6:Modules with 4:Modules.
Checking if a PLC Is an OPC-UA Client
You cannot directly determine from outside whether a PLC is running an OPC-UA client. Indirect evidence:
- Port scan shows TCP connections to port 4840 on other PLCs
- The PLC has an
OpcUa_Anyobject in its configuration (requires project file to confirm) - OPC-UA server logs on the target PLC show active sessions from the suspect PLC’s IP
Method 3: Modbus TCP
Modbus TCP How It Works
Modbus TCP is widely supported on B&R SG4 controllers via the AsMbTCP (master) and AsMbTCPS (slave) libraries. It runs on standard Ethernet (not POWERLINK). Any PLC with an Ethernet port can act as a Modbus master or slave.
Discovering Modbus TCP
# Modbus TCP uses TCP port 502 by default
nmap -p 502 --open 192.168.1.0/24
# Attempt to read holding registers from a suspected slave
# (requires modbus client tool like mbpoll or pymodbus)
mbpoll -m tcp -t 3 -1 192.168.1.50
# Scan a range of register addresses
pymodbus.console -m tcp --host 192.168.1.50 --port 502
> client.read_holding_registers(0, 100)
> client.read_input_registers(0, 100)
> client.read_coils(0, 100)
> client.read_discrete_inputs(0, 100)
Identifying Register Maps
Without the project, you’ll need to brute-force the register space:
import modbus_tk.modbus_tcp as modbus_tcp
import modbus_tk.defines as defines
master = modbus_tcp.TcpMaster(host='192.168.1.50', port=502)
master.set_timeout(5.0)
# Scan holding registers in blocks
for base in range(0, 10000, 100):
try:
result = master.execute(1, defines.READ_HOLDING_REGISTERS, base, 100)
if any(v != 0 for v in result):
print(f"Active registers at {base}: {result}")
except:
pass
Watch which registers change when you manipulate different parts of the machine.
Method 4: Ethernet/IP (CIP)
Ethernet/IP How It Works
B&R controllers support EtherNet/IP via the AsEthIP library. This is common when integrating with Rockwell/Allen-Bradley equipment, but B&R-to-B&R communication over EIP is also possible.
Discovering EtherNet/IP
# EIP discovery uses TCP port 44818 and UDP port 44818
nmap -p 44818 -sU -sS --open 192.168.1.0/24
# EIP explicit messaging uses TCP 44818
nmap -p 44818 --open 192.168.1.0/24
Method 5: PVI/INA2000 (Legacy Proprietary)
PVI/INA2000 How It Works
PVI (Process Visualization Interface) is B&R’s proprietary middleware. The INA2000 protocol runs on TCP port 11160 by default. Every B&R controller running Automation Runtime has a PVIServer that responds to INA2000 connections.
This is not typically used for PLC-to-PLC data exchange in production, but it IS used for:
- HMI panels connecting to PLCs
- SCADA systems via the PVI OPC bridge
- Automation Studio online connections
Discovering PVI/INA2000
# Scan for INA2000/PVI servers
nmap -p 11160 --open 192.168.1.0/24
If a PLC responds on port 11160, you can connect using:
- Automation Studio (Connection → Set Target)
- PVI Browser (part of PVI installation)
- Custom PVI client (see pvi-api.md)
Browsing Variables via PVI
Using the PVI API from a PC, you can enumerate variables on a running PLC without project files:
# Pseudo-code using PVI .NET API
# See pvi-api.md for full examples
line = PviConnection("TCP", "192.168.1.50", 11160)
cpu = line.CPU("PLC")
variables = cpu.Variables.Browse() # Lists all PV variables
for v in variables:
print(f"{v.Name}: {v.Read()}")
For complete PVI reference, see pvi-api.md.
Method 6: Raw TCP/UDP Sockets
Raw TCP/UDP How It Works
OEMs sometimes implement custom inter-PLC communication using B&R’s AsTcp library (part of the AsEth family). This gives complete flexibility but is the hardest to reverse-engineer because there is no standard protocol — the data format is entirely up to the programmer.
Discovering Custom TCP Communication
# Comprehensive TCP port scan
nmap -sS -p- --open 192.168.1.0/24
# After identifying open ports, capture traffic:
tcpdump -i eth0 -w custom-tcp.pcap "host 192.168.1.50 and host 192.168.1.51"
Analyzing Custom Protocols
- Capture traffic while the machine runs through different states
- Look for periodic traffic with consistent message sizes (likely cyclic data exchange)
- Look for request/response patterns (likely command/status)
- Check if payloads are ASCII (text-based protocol) or binary
- Correlate payload changes with physical machine events
Common patterns you might encounter:
- Fixed-size binary frames with a header byte, data payload, and checksum
- ASCII-based protocols using delimiter characters (CR/LF, semicolons)
- Length-prefixed messages with a 2-byte or 4-byte length header
Step-by-Step Discovery Procedure
When you are starting with zero knowledge, follow this systematic approach:
Phase 1: Physical Network Mapping
- Trace cables from each PLC’s Ethernet ports (IF1, IF2, IF3)
- IF1 / IF2: Standard Ethernet (TCP/IP, OPC-UA, Modbus, etc.)
- IF3: POWERLINK (or configurable as Ethernet)
- Note which PLCs share switches/hubs
- Draw a physical topology map showing every PLC, switch, and cable
See network-architecture.md for detailed enumeration procedures.
Phase 2: Network Scanning
# Discover all B&R devices on the network
# B&R controllers respond to SNMP on UDP port 161 (if enabled)
nmap -sU -p 161 --open 192.168.1.0/24
# Scan for all common B&R service ports
nmap -p 80,443,11160,4840,502,44818,4000-4100 --open 192.168.1.0/24
| Port | Service | Indicates |
|---|---|---|
| 80/443 | SDM web interface | Automation Runtime web server |
| 11160 | PVI/INA2000 | PVIServer — always present on AR |
| 4840 | OPC-UA | OPC-UA server enabled in project |
| 502 | Modbus TCP | Modbus slave configured |
| 44818 | EtherNet/IP | EIP communication active |
| 4000-4100 | Custom TCP | AsTcp socket servers |
Phase 3: Protocol Identification
For each pair of PLCs that you suspect communicate:
# Monitor all traffic between two specific PLCs
tcpdump -i eth0 -w plc-pair.pcap "host 192.168.1.50 and host 192.168.1.51"
# Run for 60 seconds during normal operation, then review in Wireshark
In Wireshark, check:
- Ethertype 0x88AB → POWERLINK traffic (if on shared PLK segment)
- TCP to port 4840 → OPC-UA
- TCP to port 502 → Modbus TCP
- TCP to port 11160 → PVI/INA2000
- TCP to other ports → Custom socket communication
- UDP traffic → Could be POWERLINK async or custom UDP
Phase 4: POWERLINK Deep Dive
If POWERLINK is present:
# Capture POWERLINK frames
tcpdump -i eth0 -w powerlink-dump.pcap "ether proto 0x88AB"
In Wireshark:
- Identify the MN: Look for SoC frames (type
0x0001). The source is the MN. - List all CNs: Every unique NodeID in PRes frames is a CN (PLC or drive).
- Map the cycle: Sort by time to see the polling sequence.
- Extract PRes payloads: Create a custom column for the payload data.
- Identify which CNs are PLCs vs drives: Drives typically have larger payloads with motion-related data patterns.
Phase 5: OPC-UA Namespace Mining
For each PLC with port 4840 open:
- Connect UAExpert to
opc.tcp://<IP>:4840 - Browse the full namespace tree
- Export the variable list (UAExpert: File → Export → CSV)
- Compare exported lists between PLCs — overlapping variable names suggest shared data
- Subscribe to variables and monitor value changes during machine operation
- Document every variable with: name, data type, observed value range, what machine event changes it
Identifying What Data Is Being Shared
Once you know how the PLCs communicate, you need to figure out what they’re exchanging. This is the hardest part without documentation.
Approach 1: OPC-UA Variable Mining (Best Case)
If OPC-UA is enabled and the OEM exposed inter-PLC variables, this is straightforward:
- Export the full namespace from each PLC
- Sort variables by name patterns
- Create a correlation matrix
PLC-1 Variable PLC-2 Variable Relationship
------------------ ------------------ -----------
Station1_Ready Station2_StartReq Handshake
Conv1_Speed_Setpoint Conv1_Speed_Actual Setpoint/Feedback
Heartbeat_Timer Heartbeat_Watchdog Liveness check
Recipe_Number Recipe_Active Recipe propagation
Approach 2: POWERLINK Payload Correlation
Without OPC-UA visibility into the mapped variables:
- Capture POWERLINK traffic during a controlled test sequence
- Force specific machine states one at a time
- For each state, compare PRes payloads to identify which bytes change
- Build a byte-level map of each CN’s payload
Practical procedure:
Test Sequence:
1. Machine idle (all stations stopped)
2. Station 1 running alone
3. Station 2 running alone
4. Both stations running
5. Fault on Station 1
6. Fault on Station 2
7. E-stop
8. Recipe change
For each test: capture 10 seconds of PRes data
Compare payloads between tests to isolate station-specific data regions
Approach 3: TCP Payload Pattern Analysis
For Modbus TCP or custom socket communication:
- Capture all traffic between PLC pairs during a full production cycle
- Use Wireshark’s “Follow TCP Stream” feature
- Look for repeating patterns in payload data
- Try common industrial data encoding:
- Big-endian or little-endian 16/32-bit integers
- IEEE 754 floating point
- BCD-encoded values
- Packed bits (bit 0 = status1, bit 1 = status2, etc.)
Approach 4: SDM Web Interface (Limited)
B&R’s SDM (Service and Diagnosis Management) web interface (port 80/443) provides:
- System Overview: Running tasks, CPU load, memory usage
- I/O Status: Digital and analog I/O states
- POWERLINK status: Node states, error counters
- File browser: CF card contents (can reveal configuration files)
Access via: http://<PLC-IP> in a web browser.
Configuration files on the CF card that may contain communication setup:
/System/
OpcUa.Config.xml # OPC-UA server configuration
PLC_Configuration.xml # Hardware and software configuration
AR_Config.xml # Runtime configuration
/Powerlink/
mn_config.xml # MN configuration with node list
cn_config.xml # CN configuration
Approach 5: Firmware Object Dictionary SDO Read
If you can access a PLC via SDO (Service Data Object) over POWERLINK or CANopen, you can read the object dictionary to discover communication parameters:
- Object
0x1A00–0x1AFF: TPDO (Transmit PDO) mapping — what this node sends - Object
0x1600–0x16FF: RPDO (Receive PDO) mapping — what this node receives - Object
0x1400–0x14FF: TPDO communication parameters — timing and destination - Object
0x1400–0x14FF: RPDO communication parameters
SDO access is available through:
- Automation Studio’s “Object Configurator” online mode
- B&R PVI API with POWERLINK line
- Custom tools using the POWERLINK SDO protocol
Building an Inter-PLC Communication Map
After completing discovery, document your findings in a structured format:
Template
INTER-PLC COMMUNICATION MAP
Machine: [Machine Name]
Date: [Date]
Engineer: [Your Name]
=== PLC INVENTORY ===
PLC-1: X20CP1584 @ 192.168.1.50, NodeID=240 (MN), Role: Main Controller
PLC-2: X20CP1584 @ 192.168.1.51, NodeID=1 (CN), Role: Station 2 Controller
PLC-3: X20CP1584 @ 192.168.1.52, NodeID=2 (CN), Role: Station 3 Controller
=== COMMUNICATION CHANNELS ===
Channel 1: PLC-1 ↔ PLC-2
Protocol: POWERLINK (MN-mediated)
Direction: Bidirectional
Cycle: 2 ms
Data: [Describe payload bytes and what they mean]
Payload size: 64 bytes TX / 64 bytes RX
Channel 2: PLC-1 ↔ PLC-3
Protocol: OPC-UA (PLC-1 server, PLC-3 client)
Endpoint: opc.tcp://192.168.1.50:4840
Variables:
- PLC-1.gConv_Speed_Setpoint → PLC-3.localConvSpeed (REAL, 100ms)
- PLC-3.gStation_Status → PLC-1.gStation3Status (UDINT, 50ms)
Channel 3: PLC-2 ↔ PLC-3
Protocol: Modbus TCP (PLC-2 master, PLC-3 slave)
Port: 502
Registers:
- Holding Register 0-9: PLC-2 → PLC-3 (command/status)
- Holding Register 100-109: PLC-3 → PLC-2 (feedback)
Tapping Into Existing Communication (Read-Only)
Monitoring Without Disruption
The safest approach to understanding inter-PLC data is passive monitoring:
POWERLINK:
- Use a hub (not a switch) to tap into the POWERLINK segment — hubs broadcast all frames to all ports
- Or use a managed switch with port mirroring (SPAN) configured
- The B&R X20ET8819 network analysis tool provides hardware-timestamped captures with nanosecond accuracy
- Important: POWERLINK V1 used half-duplex, but POWERLINK V2 (the version supported by CP1584) uses full-duplex. When monitoring a V2 segment, set your NIC to auto-negotiate or 100 Mbit/s full-duplex. Only use half-duplex if you know the segment is running V1 (rare on CP1584 systems). See network-architecture.md for details.
- Recommended NIC settings: 100 Mbit/s, auto-negotiate (or full-duplex for V2), auto-crossover
OPC-UA:
- Connect UAExpert as an additional client — OPC-UA servers support multiple simultaneous sessions
- Set a high sampling interval (1000 ms) to minimize server load
- Never write to a variable you don’t understand
Modbus TCP:
- Capture traffic with tcpdump — Modbus requests and responses are plaintext
- Use a protocol-aware switch to mirror traffic without disrupting timing
Custom TCP:
- tcpdump with full payload capture:
tcpdump -i eth0 -s 0 -w full-capture.pcap
Adding Your Own Monitoring Point
If you need ongoing visibility, consider adding a sniffer PLC or OPC-UA aggregation point:
Option A: OPC-UA Client on a Raspberry Pi
import asyncio
from asyncua import Client
servers = [
"opc.tcp://192.168.1.50:4840",
"opc.tcp://192.168.1.51:4840",
"opc.tcp://192.168.1.52:4840",
]
async def browse_plc(server_url):
async with Client(url=server_url) as client:
root = client.get_root_node()
children = await root.get_children()
for child in children:
print(f" {await child.get_browse_name()}")
async def main():
for url in servers:
try:
await browse_plc(url)
except Exception as e:
print(f"Failed to connect to {url}: {e}")
asyncio.run(main())
Option B: Wireshark + tshark Continuous Capture
# Capture all inter-PLC traffic to PCAP files with rotation
tshark -i eth0 -w /captures/inter-plc-%H%M%S.pcap \
-f "ether proto 0x88AB or port 4840 or port 502" \
-b duration:300 -b files:10
Common Inter-PLC Data Patterns on B&R Machines
Based on common OEM practices, these are the data types you are likely to find being exchanged:
Handshake Protocols
The most common pattern is a four-signal handshake between stations:
Station A sends: Station B responds:
Command_Ready ──────► Status_Ready
Command_Go ──────► Status_Busy
Status_Done ──► (Station A reads this)
Command_Ack ──────►
Implemented as:
- POWERLINK: 4 BOOLs in the PDO payload
- OPC-UA: 4 BOOL variables
- Modbus: 4 coils or 2 registers (packed BOOLs)
Heartbeat/Watchdog
Almost every multi-PLC machine has a heartbeat:
- One PLC increments a counter every N ms
- Other PLCs check that the counter changes within a timeout
- If the counter stops changing, the watching PLC triggers a fault
Look for variables named: Heartbeat, HB, LifeCounter, Watchdog, CommOK
Recipe/Setpoint Distribution
One “master” PLC distributes recipe parameters to “slave” PLCs:
- Recipe number or name
- Process setpoints (temperature, speed, pressure targets)
- Product type selectors
- Batch identifiers
Safety Interlock Signals
Critical safety signals between PLCs:
- E-stop propagation (one E-stop stops all stations)
- Safety gate status sharing
- Light curtain acknowledgment
- Guard locking status
These may run on a separate safety PLC or through openSAFETY over POWERLINK. See safe-io-diagnostics.md for safety-specific considerations.
Reconstructing Project-Level Configuration
Using Automation Studio Online Mode
If you can get Automation Studio connected to a running PLC (see cp1584-forensics.md):
- Connection → Set Target → Enter PLC IP
- The physical view populates with the hardware tree from the running configuration
- Logical View shows task names, program names, and library references
- Variable Overview shows all PV variables with their types and current values
- Hardware Configuration shows POWERLINK node list, PDO mappings, and module configuration
This is the single most valuable step for understanding inter-PLC communication. Even without the project source code, the online view reveals the entire hardware and communication configuration.
Extracting Configuration from the CF Card
If you can access the CF card (via SDM file browser, FTP, or physical card reader):
Key files to examine:
/System/PLC_Configuration.xml # Full hardware tree
/System/AR_Config.xml # Runtime config with task list
/System/OpcUa.Config.xml # OPC-UA server config with variable list
/System/Powerlink/mn_config.xml # POWERLINK MN node list and PDO map
/System/Powerlink/cn_config.xml # POWERLINK CN parameters
The PLC_Configuration.xml file contains the entire physical and logical hardware tree, including all communication interfaces and their configuration. This is the closest thing to having the project file.
Troubleshooting Inter-PLC Communication Failures
Symptom: One PLC Shows “Communication Lost” Fault
Diagnostic steps:
- Check physical connectivity (link LEDs on Ethernet ports)
- Ping from the faulting PLC to its communication partner
- Check POWERLINK node state in SDM (System Diagnosis → POWERLINK)
- If POWERLINK: check if the faulted CN is in OPERATIONAL state
- If OPC-UA: check if the
ModuleOkflag is TRUE in the client PLC’s I/O mapping - If Modbus: check for timeout errors in the master PLC’s diagnostic variables
Symptom: Intermittent Data Corruption
- Capture POWERLINK traffic and look for timing violations (SoC-to-SoC jitter)
- Check for cyclic redundancy errors in the POWERLINK diagnostic counters
- Verify cable lengths and termination
- Check for electromagnetic interference sources near POWERLINK cables
- Look for duplicate NodeIDs on the POWERLINK segment
Symptom: All PLCs Go Down Simultaneously
- The MN has likely failed — no MN means no POWERLINK communication
- Check if the MN PLC is running (power LED, run/fault LED)
- If the MN is running but POWERLINK is down, check the IF3 port link status
- Consider whether a POWERLINK ring redundancy failover has occurred
Symptom: New PLC Replacement Won’t Communicate
- Verify the replacement PLC has the correct firmware version (AR version)
- Check NodeID configuration — must match the original
- The MN needs to recognize the new CN’s device description
- If using cross-traffic configuration, the project on the MN must reference the new CN
- Without the project, you may need to reconfigure the MN (see project-reconstruction.md)
Key Findings
-
POWERLINK is the most likely inter-PLC mechanism on B&R machines. Check for ethertype
0x88ABfirst. The MN-mediated exchange pattern is standard; CN-to-CN cross-traffic requires explicit project configuration. -
OPC-UA is the most accessible discovery path when you have no project files. Port 4840, browse with UAExpert. Variable names alone tell you what data is shared — if the OEM exposed them.
-
PVI/INA2000 (port 11160) is always available on running B&R controllers and provides variable enumeration via the PVI API, even without project files.
-
Wireshark is your primary discovery tool for POWERLINK and custom TCP communication. The B&R POWERLINK dissector provides full protocol decoding including NodeID, frame type, and payload.
-
Variable naming conventions reveal purpose. OEMs typically use prefixes like
Station_,Cell_,From_,To_,HS_(handshake),HB_(heartbeat) for inter-PLC variables. -
Four-signal handshakes are the dominant pattern for inter-PLC coordination: Ready/Go/Done/Ack or equivalent BOOL exchanges.
-
The heartbeat/watchdog pattern is nearly universal in multi-PLC machines — one PLC increments a counter that others monitor for liveness.
-
Automation Studio online mode reveals the full hardware configuration of a running PLC, including POWERLINK node lists and PDO mappings — connect before anything else if you can get AS.
-
CF card configuration files (especially
PLC_Configuration.xmlandOpcUa.Config.xml) contain the entire communication setup. Access these via SDM, FTP, or physical card reader. -
You cannot discover cross-traffic or custom TCP socket communication from outside — only through traffic capture and pattern analysis. These require the most effort to reverse-engineer.
-
Modbus TCP and EtherNet/IP are easy to discover via port scanning but hard to fully map without brute-forcing register spaces or CIP object models.
-
The SDM web interface (port 80/443) provides POWERLINK diagnostic status, I/O states, and file browser access — use it before reaching for Wireshark.
Sources
- B&R POWERLINK Communication Profile Specification (EPSG)
- B&R Automation Studio Online Help — POWERLINK configuration, OPC-UA server, and PVI settings
- B&R OPC-UA Server Configuration Guide — namespace, security, and endpoint configuration
- B&R PVI (Process Visualization Interface) Reference — variable enumeration and data exchange
- openPOWERLINK Wireshark Dissector Documentation — protocol decoding reference
- Wireshark Protocol Reference — ethertype 0x88AB (POWERLINK) filtering and analysis
- B&R Community Forum (community.br-automation.com) — inter-PLC communication discussions
Related Documents
- powerlink-internals.md — POWERLINK protocol deep internals and Wireshark analysis
- opcua.md — OPC-UA server configuration and variable browsing
- pvi-api.md — PVI API for programmatic variable access between PLCs
- network-architecture.md — Network topology and device enumeration
- modbus-gateway.md — Modbus TCP gateway as alternative inter-PLC communication
- cp1584-forensics.md — Initial information extraction from unknown PLCs
- config-file-formats.md — Configuration files controlling PLC communication
SNMP, MQTT, and IIoT Retrofits for Legacy B&R CP1584 Systems
Overview
This document covers how to add modern monitoring protocols (SNMP, MQTT, OPC-UA to MQTT bridging, time-series data logging, and dashboard visualization) to aging B&R X20CP1584 PLCs on machines built by defunct OEMs with zero documentation. The CP1584 is an Intel Atom 0.6 GHz CPU with 256 MB DDR2 RAM, 1 MB SRAM, CompactFlash storage, two independent network interfaces (IF2 = Ethernet 10/100/1000BASE-T, IF3 = POWERLINK V1/V2), and one X20 interface module slot. Its hardware constraints – limited RAM, CF card storage – shape every retrofit decision. See network-architecture.md for the full network interface details.
The goal is to achieve remote visibility into machines never designed for it, without touching the running PLC program, without the original Automation Studio project, and without vendor support.
AS6 / PVI 6.x Compatibility Note
If you are setting up your engineering workstation fresh, note that Automation Studio 6 ships PVI 6.x, which drops support for the legacy INA2000 protocol entirely. Only ANSL and SNMP lines remain. Since most IIoT retrofits in this document use OPC-UA or SNMP (not INA2000), this mainly affects PVI-based diagnostic scripts. Ensure any external tools connecting via PVI use ANSL, not INA2000. See pvi-api.md §2 and firmware-version-mgmt.md §5.3.1 for details.
Related Documents
| Document | Relevance |
|---|---|
| opcua.md | OPC-UA server configuration, namespace layout, certificate management |
| custom-diagnostic-tools.md | Building C/C++ tools that run ON the PLC – data loggers, custom monitors |
| python-diagnostics.md | Python-based diagnostics from external PC — OPC-UA and PVI scripts |
| ftp-web-interface.md | FTP and web interface access to CF card and SDM |
| cf-card-boot.md | CF card boot process, firmware, and runtime system details |
| pvi-api.md | PVI (Process Visualization Interface) for external programmatic access |
| diagnostics-sdm.md | System Diagnostics Manager built into Automation Runtime |
| cp1584-forensics.md | Forensic analysis techniques for undocumented CP1584 systems |
The Retrofit Problem: Why These Machines Are Hard
Machines built by defunct OEMs share common characteristics that make IIoT retrofits non-trivial:
- No Automation Studio project: The compiled binary runs on the CF card but there is no source code. You cannot modify the PLC program.
- OPC-UA tags not enabled: Even if the OPC-UA server is running, each variable must be explicitly enabled as a tag. On machines where the OEM never intended remote monitoring, zero variables are exposed. See opcua.md for the full explanation of this limitation.
- No network architecture documentation: IP addresses, VLANs, firewall rules – all unknown.
- Single Ethernet port: The CP1584 has only one RJ45 interface (IF2). POWERLINK (IF3) is a separate RJ45 but runs a different protocol. Adding a second network path requires an interface module (X20IF10xx series) in the single expansion slot.
- CF card storage is limited: Logging must be carefully budgeted. Write wear on CF cards is a real concern.
- CPU load budget: At 0.6 GHz with 256 MB RAM, adding a data pipeline on the PLC itself is feasible only if it is lightweight.
Retrofit Constraints Summary
| Resource | CP1584 Capability | Retrofit Impact |
|---|---|---|
| CPU | Atom 0.6 GHz | MQTT client on-PLC is feasible but budget cycles carefully |
| RAM | 256 MB DDR2, 1 MB SRAM | OPC-UA server + MQTT client simultaneously possible on AR 4.x |
| Storage | CompactFlash (512 MB - 8 GB SLC) | Rotate log files aggressively; avoid FAT fragmentation |
| Network | 1x Ethernet + 1x POWERLINK | Gateway/Bridge approach keeps traffic off PLC |
| Expansion | 1 slot for interface module | Add a second Ethernet module if network segmentation needed |
Protocol Stack Overview
Where Each Protocol Fits
Cloud / MES / Dashboard
|
MQTT Broker <-- Lightweight pub/sub, fan-out to N consumers
|
OPC-UA to MQTT <-- Bridge/gateway layer
Bridge (Gateway)
|
OPC-UA Server <-- Built into B&R Automation Runtime
|
B&R X20CP1584 <-- PLC running the machine program
- SNMP: Used for infrastructure-level monitoring (CPU temperature, battery status, network interface state, IP configuration). Read-only, poll-based. Does NOT access process variables.
- OPC-UA: The native B&R protocol for structured access to PLC process variables. Requires variables to be explicitly enabled as tags.
- MQTT: The IIoT distribution protocol. Lightweight, pub/sub, supports QoS levels, works over constrained networks. The CP1584 can run an MQTT client directly via the paho.mqtt.c-ar library.
- Gateway/Bridge pattern: For machines where you cannot modify the PLC program, an edge gateway (small PC, Raspberry Pi, or Docker container) sits between the PLC’s OPC-UA server and the MQTT broker.
SNMP Monitoring on B&R Systems
B&R SNMP Architecture
B&R PLCs expose a PVI-SNMP agent that provides infrastructure-level data. This is NOT the same as an OPC-UA server – SNMP cannot read process variables. What it CAN read:
| Data Category | Examples |
|---|---|
| Device identification | Model name, serial number, MAC address, firmware version |
| Network configuration | IP address, subnet mask, gateway, DNS, hostname |
| POWERLINK status | Node number, MN/CN role, INA settings |
| Runtime state | AR version, AR state, boot phase, process control state |
| Interface properties | Device name, baudrate, port numbers |
Enabling SNMP Discovery
SNMP is active on B&R PLCs by default for PVI communication. The community string for PVI-SNMP is typically public (B&R-specific implementation, not standard SNMPv2c security).
Using brsnmp – Open-Source PVI-SNMP Tool
The brsnmp tool (https://github.com/hilch/brsnmp) is a free Windows utility that wraps PVI-SNMP commands for B&R PLCs. It does not require Automation Studio.
Installation: Requires PVI 4.x Development Setup. Download binary from the GitHub releases.
Basic discovery:
brsnmp --list
Returns JSON array of MAC addresses for all reachable B&R PLCs on the network.
Detailed inventory:
brsnmp --details
Returns JSON with full properties for each PLC:
{
"targetTypeDescription": "X20CP1584",
"serialNumber": "D45B0168612",
"cfSerialNumber": "000060076643A1000085",
"arVersion": "B04.45",
"arVersionNorm": "04.45.2",
"arState": "4",
"arBootPhase": "40",
"macAddress": "00-60-65-16-fd-da",
"ipAddress": "192.168.0.14",
"subnetMask": "255.255.255.0",
"hostName": "br-automation",
"deviceName": "IF2",
"snmpMode": "2",
"processCtrlState": "65535"
}
Filtering to a specific PLC:
brsnmp --filter=X20CP1584 --details
brsnmp --filter=macAddress.+00-60-65-3a-39-10 --details
Setting IP address remotely (CPU must be in BOOT or SERVICE state):
brsnmp --filter=macAddress.+00-60-65-3a-39-10 --ipAddress=192.168.1.50 --subnetMask=255.255.255.0
Critical warning: Always use --filter when writing parameters. Without a filter, brsnmp targets ALL reachable PLCs.
B&R ADI SNMP Agent
B&R also provides a formal ADI SNMP Agent (download: 1SWHMADS from br-automation.com) that runs on B&R PC-based panels and controllers (Automation Panel 800, Power Panel, etc.). This is separate from the PVI-SNMP agent used by brsnmp. The ADI SNMP Agent provides:
- Temperature readings from B&R PC hardware
- Device information and health status
- Standard MIB-II support plus B&R enterprise MIB
The ADI SNMP Agent is designed for Windows-based B&R panels and may not run directly on the CP1584’s Automation Runtime. It is relevant if you have a B&R panel HMI alongside the CP1584.
SNMP for Infrastructure Monitoring (Non-B&R Specific)
Standard SNMP monitoring of the CP1584 Ethernet interface can be done with any SNMP manager (PRTG, Zabbix, Observium, LibreNMS) using standard MIB-II OIDs:
| OID | Description |
|---|---|
| 1.3.6.1.2.1.1.1 | sysDescr (system description) |
| 1.3.6.1.2.1.1.3 | sysUpTime (uptime) |
| 1.3.6.1.2.1.2.1 | ifNumber (interface count) |
| 1.3.6.1.2.1.2.2.1.1 | ifIndex |
| 1.3.6.1.2.1.2.2.1.5 | ifSpeed |
| 1.3.6.1.2.1.2.2.1.6 | ifPhysAddress (MAC) |
| 1.3.6.1.2.1.2.2.1.8 | ifOperStatus (up/down) |
| 1.3.6.1.2.1.2.2.1.10 | ifInOctets |
| 1.3.6.1.2.1.2.2.1.16 | ifOutOctets |
Step-by-Step: SNMP Infrastructure Setup
-
Discover the PLC on the network using brsnmp:
brsnmp --list brsnmp --filter=X20CP1584 --details > cp1584_inventory.json -
Record all discovered parameters (IP, MAC, AR version, serial number) for your asset database.
-
Set up SNMP polling with Telegraf (see Section on Time-Series Pipeline) pointing at the PLC’s IP address using standard MIB-II OIDs.
-
Add B&R-specific checks: Use brsnmp in a scheduled script (Windows Task Scheduler or cron on WSL) to poll
arStateandprocessCtrlStatefor runtime health. -
Set up alerting: When
arStatechanges from normal (4 = RUN) to SERVICE (2) or ERROR, trigger an alert.
MQTT on the B&R CP1584 (On-PLC Approach)
paho.mqtt.c-ar: B&R Community MQTT Library
The B&R community maintains a port of the Eclipse Paho MQTT C client for Automation Runtime, available at: https://github.com/br-automation-community/paho.mqtt.c-ar
What it provides:
- IotMqtt – Function Block (FUB) library for IEC programs. This is the recommended interface. Supports Publish, Subscribe, RegParPublish, RegParSubscribe.
- PahoMQTT – Static C library for direct API access. Use only for special cases.
Runtime compatibility (built versions available):
- A4.73, C4.63, D4.53, N4.34, M4.26, H3.10 (Intel and ARM)
Key characteristics:
- Based on OpenSSL 1.1.1g and paho.mqtt.c 1.3.8 (rev.05)
- Supports MQTT v3.1.1 and v5.0 (rev.05 added LastWillDelayInterval, SessionExpiryInterval, CleanStart)
- Supports TLS/SSL with certificates
- Supports WebSocket transport
- Up to 50 Publish/Subscribe FUBs per client
- Multiple simultaneous connections supported (MQTTAsync-based)
- QoS 0, 1, and 2
- Offline message buffering (publishes stored internally until connection established)
- JSON serialization of PLC structures via IotMqttRegParPublish/Subscribe
Critical Limitation: Requires Automation Studio Project
The paho.mqtt.c-ar library must be compiled into the PLC program using Automation Studio. You cannot deploy it to a running PLC without source code. This means:
- If you HAVE the Automation Studio project: Add IotMqtt to your program, configure broker connection, publish your variables.
- If you DO NOT have the project: You CANNOT add MQTT to the PLC itself. Use the edge gateway approach (Section “OPC-UA to MQTT Bridge”) instead.
Code Examples
Minimal Publish (IEC ST)
PROGRAM _CYCLIC
IotMqttParameters.ServerUri := 'broker.hivemq.com';
IotMqttParameters.Port := 1883;
IotMqttParameters.ClientID := 'BR_CP1584_Machine01';
IotMqttClient_0.Enable := TRUE;
IotMqttClient_0.Connect := TRUE;
IotMqttClient_0.IotMqttLink := ADR(IotMqttLink);
IotMqttClient_0.Parameters := IotMqttParameters;
IotMqttClient_0();
PublishMessage := 'Machine01: running';
IotMqttPublish_0.Enable := TRUE;
IotMqttPublish_0.IotMqttLink := IotMqttClient_0.IotMqttLink;
IotMqttPublish_0.Topic := ADR('factory/line1/machine01/status');
IotMqttPublish_0.Buffer := ADR(PublishMessage);
IotMqttPublish_0.BufferLength := brsstrlen(ADR(PublishMessage));
IotMqttPublish_0();
END_PROGRAM
JSON Structure Publishing (RegParPublish)
The IotMqttRegParPublish FUB serializes an entire PLC structure to JSON and publishes it on a configurable trigger (on change, on interval, or on trigger event):
PROGRAM _CYCLIC
IotMqttParameters.ServerUri := '192.168.1.100';
IotMqttParameters.Port := 1883;
IotMqttParameters.ClientID := 'BR_CP1584_Machine01';
IotMqttClient_0.Enable := TRUE;
IotMqttClient_0.Connect := TRUE;
IotMqttClient_0.IotMqttLink := ADR(IotMqttLink);
IotMqttClient_0.Parameters := IotMqttParameters;
IotMqttClient_0();
IotMqttRegParPublish_0.Enable := TRUE;
IotMqttRegParPublish_0.IotMqttLink := IotMqttClient_0.IotMqttLink;
IotMqttRegParPublish_0.Topic := ADR('factory/line1/machine01/telemetry');
IotMqttRegParPublish_0.PvName := ADR('MachineData');
IotMqttRegParPublish_0.PublishMode := IOTMQTT_PUB_MODE_TRIGGER;
IotMqttRegParPublish_0.DataFormat := IOTMQTT_VAR_JSON;
IotMqttRegParPublish_0();
END_PROGRAM
Publish modes available:
IOTMQTT_PUB_MODE_TRIGGER– publish on trigger eventIOTMQTT_PUB_MODE_TIME– publish on time intervalIOTMQTT_PUB_MODE_CHANGED– publish on value change- Combinations supported (e.g., time OR changed)
Subscribe Example
PROGRAM _CYCLIC
IotMqttSubscribe_0.Enable := TRUE;
IotMqttSubscribe_0.IotMqttLink := IotMqttClient_0.IotMqttLink;
IotMqttSubscribe_0.Topic := ADR('factory/line1/machine01/commands');
IotMqttSubscribe_0.QueueSize := 50;
IotMqttSubscribe_0.Buffer := ADR(ReceiveBuffer);
IotMqttSubscribe_0.BufferSize := SIZEOF(ReceiveBuffer);
IotMqttSubscribe_0();
END_PROGRAM
DNS and Network Configuration for MQTT
The CP1584 needs DNS configured to reach external MQTT brokers (e.g., AWS IoT, HiveMQ Cloud):
- In Automation Studio, open CPU Configuration
- Navigate to the Ethernet interface (IF2)
- Enable DNS service
- If using DHCP: check “Get DNS from DHCP server”
- If using static IP: manually enter DNS server addresses (e.g., 8.8.8.8, 8.8.4.4)
- Set the default gateway if the broker is outside the local network
MQTT File Device and Logging Configuration
IotMqtt generates log files to the IOTMQTT file device by default. Create this in CPU configuration:
- In Automation Studio, CPU Configuration, add a File Device named
IOTMQTT - Point it to a directory on the CF card or a mounted USB stick
- Configure logging in
_INIT:
PROGRAM _INIT
IotMqttConfigParams.UseLogger := TRUE;
IotMqttConfigParams.LoggerName := 'IotMqtt';
IotMqttConfigParams.UseFile := TRUE;
IotMqttConfigParams.LogFileDevice := 'USER';
IotMqttConfigParams.LogFileName := 'IotMqttLog';
IotMqttConfigParams.OverwritteLogs := TRUE;
IotMqttConfigParams.LogLevel := IOTMQTT_LOG_LEVEL_PROTOCOL;
IotMqttConfig(ADR(IotMqttConfigParams));
END_PROGRAM
Certificates for TLS Connections
MQTT over TLS (port 8883) requires certificates. On B&R AR, certificates can be stored in:
- Certificate store (project-level, accessed with container prefix like
TaskName:orCertStore:) - File system (accessed with file device prefix like
USER:or default device = no prefix)
For AWS IoT, Azure IoT Hub, or Google IoT Cloud connections, sample projects are provided in the paho.mqtt.c-ar repository under the Samples directory.
OPC-UA to MQTT Bridge (Edge Gateway Approach)
When to Use This Approach
Use the edge gateway when:
- You do NOT have the Automation Studio project (cannot modify PLC program)
- The OPC-UA server is running with variables already exposed
- You want to keep data pipeline traffic off the PLC
- You need protocol translation (OPC-UA to MQTT) without touching the control system
Architecture
[Grafana Dashboard]
|
[InfluxDB / TimescaleDB]
|
[Telegraf]
|
[MQTT Broker (Mosquitto)]
|
[OPC-UA to MQTT Gateway] <-- Small PC or Raspberry Pi
|
[OPC-UA Server on CP1584] <-- Built into Automation Runtime
Option 1: Frankenstein Automation Gateway (Open Source)
The Frankenstein Gateway (https://github.com/vogler75/automation-gateway) is a Java-based open-source OPC-UA to MQTT bridge. Key features:
- Connects as an OPC-UA client to any OPC-UA server
- Exposes values via MQTT publish and GraphQL (HTTP)
- Supports subscription-based data change notifications
- Includes a data logger that publishes statistics
- Maps OPC-UA node IDs to MQTT topics
- No cost, community-maintained
Setup steps:
- Install Java 11+ on the edge PC
- Download the latest release from GitHub
- Configure
application.properties:opcua.server.url=opc.tcp://192.168.0.14:4840 opcua.namespace.index=3 mqtt.broker.url=tcp://localhost:1883 mqtt.topic.prefix=factory/line1/machine01 - Run the gateway:
java -jar frankenstein-gateway.jar
Verification: Subscribe to the MQTT topic to confirm data flow:
mosquitto_sub -h localhost -t 'factory/line1/machine01/#' -v
Option 2: EMQX Neuron (Open Source, Docker)
Neuron (https://github.com/emqx/neuron) is an industrial IoT connectivity server from EMQX that supports 100+ industrial protocols including OPC-UA. It runs in Docker and is designed for edge deployment.
Key features:
- OPC-UA client (southbound) to MQTT publish (northbound)
- Supports subscription to OPC-UA monitored items (report-by-exception)
- Group configuration for organizing tags
- Data processing (scale, offset, JSON formatting)
- Web UI for configuration
- Docker container:
docker pull emqx/neuron
Docker Compose for Neuron + Mosquitto:
version: '3.8'
services:
neuron:
image: emqx/neuron:latest
ports:
- "9000:9000" # Neuron web UI
volumes:
- neuron_data:/neuron/data
restart: unless-stopped
mosquitto:
image: eclipse-mosquitto:2
ports:
- "1883:1883"
- "9001:9001" # WebSocket
volumes:
- mosquitto_data:/mosquitto/data
- mosquitto_config:/mosquitto/config
restart: unless-stopped
volumes:
neuron_data:
mosquitto_data:
mosquitto_config:
Configuration steps:
- Access Neuron web UI at
http://<edge-pc>:9000 - Add a southbound device with protocol “OPC-UA Client”
- Set endpoint URL:
opc.tcp://<CP1584-IP>:4840 - Configure security: None for initial testing, certificate-based for production
- Browse the OPC-UA address space to discover available nodes
- Create a group of tags to subscribe to
- Add a northbound application with protocol “MQTT”
- Set MQTT broker URL:
tcp://mosquitto:1883 - Map the group to the MQTT application with topic template
- Start the pipeline
Option 3: Custom Python Bridge
For maximum control, write a lightweight Python script using asyncua (async OPC-UA client) and paho-mqtt:
import asyncio
import json
import paho.mqtt.client as mqtt
from asyncua import Client
OPCUA_URL = "opc.tcp://192.168.0.14:4840"
MQTT_BROKER = "localhost"
MQTT_PORT = 1883
TOPIC_PREFIX = "factory/line1/machine01"
SUBSCRIBE_NODES = [
"ns=3;s=MachineData.Temperature",
"ns=3;s=MachineData.Pressure",
"ns=3;s=MachineData.RPM",
"ns=3;s=MachineData.Status",
]
mqtt_client = mqtt.Client()
mqtt_client.connect(MQTT_BROKER, MQTT_PORT)
async def main():
async with Client(OPCUA_URL) as client:
nodes = []
for node_path in SUBSCRIBE_NODES:
node = client.get_node(node_path)
nodes.append(node)
sub = await client.create_subscription(500)
handlers = DataChangeHandler(mqtt_client, TOPIC_PREFIX)
for node in nodes:
await sub.subscribe_data_change(node, handlers)
while True:
await asyncio.sleep(1)
class DataChangeHandler:
def __init__(self, mqtt_client, prefix):
self.mqtt_client = mqtt_client
self.prefix = prefix
def datachange_notification(self, node, val, data):
topic = f"{self.prefix}/{node.nodeid.Identifier}"
payload = json.dumps({
"value": val,
"timestamp": data.source_timestamp.isoformat() if data.source_timestamp else None,
"quality": "good" if not data.status.is_bad() else "bad",
})
self.mqtt_client.publish(topic, payload, qos=1)
asyncio.run(main())
Option Comparison
| Feature | Frankenstein | EMQX Neuron | Custom Python |
|---|---|---|---|
| Setup effort | Medium | Low (Docker) | High (code) |
| OPC-UA version | Client | Client | Client |
| MQTT publish | Yes | Yes | Yes |
| Data processing | Limited | Scale/offset/JSON | Unlimited |
| Web UI | No | Yes | No |
| Docker support | No | Yes | Yes |
| Maintenance | Community | Active (EMQX) | Your responsibility |
| Cost | Free | Free | Free |
| Best for | Quick POC | Production edge | Custom logic |
Time-Series Data Logging
Strategy 1: Log on the PLC (CF Card / USB)
If you have the Automation Studio project, the most reliable approach is to log data directly on the PLC using the built-in Logger function or custom C code. See custom-diagnostic-tools.md for details on building on-PLC tools.
B&R Logger configuration:
- In Automation Studio, open the Logger configuration
- Create a new data log
- Select variables to log (must be in scope)
- Configure trigger: cyclic (every N ms) or event-based
- Configure storage: file device path on CF card
- Set maximum file size and rotation policy
File device setup for logging:
- Use the
USERfile device pointing to a directory on the CF card - Mount a USB stick as a separate file device for log export
- Implement log rotation to prevent CF card exhaustion
CF card write considerations:
- Use SLC (Single-Level Cell) CF cards only (B&R part numbers 5CFCRD.xxxx-06)
- Avoid frequent small writes – buffer data and flush periodically
- Rotate files before they exceed 50 MB to keep FAT defragmentation manageable
- Monitor CF card health via the PLC’s CF LED and software status register
Strategy 2: Log via OPC-UA Subscription (External)
When you cannot modify the PLC program but the OPC-UA server has tags enabled:
- Run an OPC-UA client on an edge PC (Python
asyncua, or a dedicated logger) - Subscribe to monitored items with a 1000 ms sampling interval
- Write values to a local InfluxDB or CSV files
- The CP1584 handles the subscription without additional CPU load (OPC-UA server handles sampling internally)
InfluxDB line protocol output:
machine01,location=line1 temperature=72.3,pressure=14.7,rpm=1200,status=1 1718035200000000000
Strategy 3: Log via MQTT (External Subscriber)
When data flows through the MQTT broker (via on-PLC MQTT client or OPC-UA bridge):
- Run Telegraf with the MQTT consumer input plugin
- Parse JSON payloads from MQTT topics
- Write to InfluxDB
Telegraf configuration:
[[inputs.mqtt_consumer]]
servers = ["tcp://localhost:1883"]
topics = [
"factory/line1/machine01/telemetry",
]
data_format = "json"
json_string_fields = []
tags = {source = "cp1584", machine = "machine01"}
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
token = "your-token"
organization = "factory"
bucket = "machine_data"
Building Monitoring Dashboards
Recommended Stack: Grafana + InfluxDB + Telegraf + Mosquitto
This is the standard open-source IIoT monitoring stack:
[B&R CP1584]
|
| OPC-UA or MQTT
|
[Edge Gateway / Telegraf]
|
[Mosquitto MQTT Broker]
|
[Telegraf --> InfluxDB --> Grafana]
Step-by-Step: Full Stack Setup on an Edge PC
1. Install Mosquitto MQTT Broker
sudo apt install mosquitto mosquitto-clients
sudo systemctl enable mosquitto
sudo systemctl start mosquitto
Test with:
mosquitto_sub -h localhost -t 'test/#' -v
mosquitto_pub -h localhost -t 'test/hello' -m 'world'
2. Install InfluxDB
sudo apt install influxdb2
sudo systemctl enable influxdb
sudo systemctl start influxdb
Create organization and bucket:
influx setup \
--username admin \
--password adminpassword \
--org factory \
--bucket machine_data \
--retention 30d
3. Install Telegraf
sudo apt install telegraf
Configure Telegraf with both MQTT and SNMP inputs:
[[inputs.mqtt_consumer]]
servers = ["tcp://localhost:1883"]
topics = ["factory/#"]
data_format = "json"
name_override = "plc_data"
[[inputs.snmp]]
agents = ["udp://192.168.0.14"]
version = 2
community = "public"
interval = "60s"
[[inputs.snmp.field]]
name = "uptime"
oid = "1.3.6.1.2.1.1.3.0"
[[inputs.snmp.field]]
name = "ifOperStatus"
oid = "1.3.6.1.2.1.2.2.1.8.1"
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
token = "your-api-token"
organization = "factory"
bucket = "machine_data"
4. Install Grafana
sudo apt install -y apt-transport-https
sudo apt install grafana
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
Access at http://<edge-pc>:3000 (default admin/admin).
5. Configure Grafana Data Source
- Add InfluxDB as a data source
- URL:
http://localhost:8086 - Auth: Token-based
- Organization: factory
- Bucket: machine_data
Dashboard Panels for Undocumented Machines
For machines with no documentation, build dashboards around these themes:
Infrastructure Health Panel
| Metric | Source | Visualization |
|---|---|---|
| PLC uptime | SNMP sysUpTime | Stat panel |
| Ethernet link status | SNMP ifOperStatus | Status indicator (green/red) |
| Network traffic | SNMP ifInOctets/ifOutOctets | Graph (bytes/sec) |
| AR state | brsnmp arState | Stat panel with conditional colors |
| Battery status | PLC BatteryInfo function | Status indicator |
Process Telemetry Panel
| Metric | Source | Visualization |
|---|---|---|
| Key temperatures | OPC-UA / MQTT | Time series graph |
| Pressures | OPC-UA / MQTT | Time series graph |
| Speeds / RPMs | OPC-UA / MQTT | Gauge + time series |
| Machine state | OPC-UA / MQTT | Status panel (Running/Idle/Fault) |
| Cycle counts | OPC-UA / MQTT | Counter (totalize) |
Alert Rules
| Alert Condition | Severity | Action |
|---|---|---|
| PLC goes to SERVICE mode | Critical | Email/page on-call |
| Ethernet link down | Critical | Email + dashboard red panel |
| Temperature exceeds threshold | Warning | Dashboard amber + email |
| OPC-UA connection lost | Warning | Dashboard indicator + log |
| MQTT broker unreachable | Warning | Dashboard indicator |
Practical Retrofit Procedures
Procedure 1: Zero-Documentation Discovery (Start Here)
When you inherit a B&R CP1584 machine with no documentation:
- Physical inspection: Read the model number, serial number, AR version from the CPU label
- Network discovery: Run brsnmp on a PC on the same subnet:
brsnmp --list brsnmp --details > machine_inventory.json - OPC-UA probe: Install UaExpert (free from Unified Automation). Try connecting to
opc.tcp://<PLC-IP>:4840with no security and anonymous login - SDM check: Open a browser to
http://<PLC-IP>– the System Diagnostics Manager web interface may be running - Network scan: Use nmap to identify open ports on the PLC:
Key ports to look for: 4840 (OPC-UA), 11159 (INA/ANSI), 80 (HTTP/SDM), 21 (FTP), 161 (SNMP)nmap -sV -p 1-65535 <PLC-IP> - CF card dump: See cf-card-boot.md for safely reading the CF card contents to discover the project structure
Procedure 2: Add OPC-UA Data Export (Server Already Running)
If the OPC-UA server is already running with some tags enabled:
- Connect with UaExpert and browse the full namespace tree
- Document all exposed variables: node IDs, data types, current values
- Export the node list from UaExpert (File > Export Address Space)
- Set up an OPC-UA subscription in your data pipeline (Python asyncua, Telegraf OPC-UA input, or Neuron)
- Validate data types and ranges before connecting to your time-series database
Procedure 3: Full MQTT Pipeline (Have Automation Studio Project)
- Add IotMqtt library to the Automation Studio project
- Configure broker parameters in a persistent variable structure
- Create publish FUBs for each data group (telemetry, alarms, status)
- Use RegParPublish for structured data – it serializes entire PLC structures to JSON
- Configure QoS 1 for critical data (alarms), QoS 0 for telemetry
- Set up offline buffering so messages are stored if broker is unreachable
- Build and transfer to the PLC
- Set up the broker (Mosquitto or EMQX) on an edge PC
- Validate with
mosquitto_subbefore connecting Telegraf/InfluxDB
Procedure 4: Full MQTT Pipeline (No Automation Studio Project)
- Verify OPC-UA server is running and has tags enabled (use UaExpert)
- Set up edge gateway (Neuron recommended for easiest setup)
- Configure OPC-UA connection from gateway to PLC
- Browse and select variables in Neuron web UI
- Configure MQTT output to local Mosquitto broker
- Add Telegraf to consume MQTT and write to InfluxDB
- Build Grafana dashboards
Procedure 5: Add a Dedicated Monitoring Network Interface
The CP1584 already has IF2 (Ethernet 10/100/1000) and IF3 (POWERLINK V1/V2). If IF2 is already used for PLC control and you need a dedicated IT monitoring interface, you can add a third NIC:
- Purchase an X20 Ethernet interface module (e.g., X20IF1061-1)
- Install in the CP1584’s single expansion slot
- Configure in Automation Studio under Physical View
- Assign the third interface to a different subnet
- Configure the MQTT broker connection to use the third interface
- This requires a project rebuild – not possible without Automation Studio source
Alternative: If IF2 is free, simply configure it for monitoring traffic and use IF3 (POWERLINK) for PLC control, or use an external managed switch with VLANs on IF2 to segment OT and IT traffic.
Topic Naming Convention
Use ISA-95 / UNS (Unified Namespace) conventions for MQTT topics:
enterprise/site/area/line/cell/equipment/measurement
Example for a B&R CP1584-controlled machine:
factory/line1/cnc01/telemetry/temperature
factory/line1/cnc01/telemetry/pressure
factory/line1/cnc01/telemetry/rpm
factory/line1/cnc01/status/mode
factory/line1/cnc01/status/faults
factory/line1/cnc01/alarms/#
factory/line1/cnc01/config/#
Sparkplug B (MQTT) adds structure to payloads with timestamps, quality, and sequence numbers. If using EMQX or HiveMQ, consider Sparkplug B as the payload format for interoperability with MES/SCADA systems.
Security Considerations
Network Segmentation
- Never expose OPC-UA (port 4840) or MQTT (port 1883) directly to the internet
- Use a firewall between OT (PLC network) and IT (monitoring network)
- The edge gateway should be dual-homed: one NIC on OT network, one on IT network
- Or use a VPN for remote access to the monitoring stack
OPC-UA Security
- Default: No security, anonymous access. This is common for internal OT networks but unacceptable for IT crossover
- Enable X.509 certificate-based security for production deployments
- The CP1584 generates self-signed certificates; see opcua.md for certificate management including the
ArMcsRecreateCertfunction block
MQTT Security
- Use TLS (MQTT over port 8883) for any data crossing network boundaries
- Configure username/password authentication on Mosquitto
- Use ACLs to restrict which topics each client can publish/subscribe to
- For cloud connections (AWS IoT, Azure), use mutual TLS (client certificates)
SNMP Security
- B&R PVI-SNMP uses a proprietary mechanism, not standard SNMPv3 security
- Standard SNMP to the CP1584 Ethernet interface (MIB-II) uses community string “public” by default
- Restrict SNMP access with firewall rules if the PLC is on a shared network
- Never expose SNMP to untrusted networks
Troubleshooting
OPC-UA Server Not Reachable
| Symptom | Cause | Fix |
|---|---|---|
| Connection refused on port 4840 | OPC-UA server not activated | Server requires activation in AR configuration. Without project, check if the running firmware has it enabled |
| Certificate error | Expired or self-signed cert | Use ArMcsRecreateCert function block or accept self-signed in client settings |
| No variables visible | Tags not enabled | Variables must be explicitly enabled as OPC-UA tags. Without project, you cannot add new ones |
| Connection timeout | Firewall blocking | Open port 4840 on intermediate switches/firewalls |
MQTT Connection Issues on PLC
| Symptom | Cause | Fix |
|---|---|---|
| Cannot resolve broker hostname | DNS not configured | Enable DNS service in AR configuration with valid DNS server |
| Connection drops frequently | Network quality or broker overload | Check cabling; reduce publish rate; use QoS 1 with offline buffering |
| Messages not arriving | Wrong topic or QoS mismatch | Verify topic strings match between publish and subscribe; check broker logs |
| Library won’t compile | AR version mismatch | Use IotMqtt version matching your AR version (see compatibility table) |
| Certificate error on TLS | Missing or wrong certificate | Check certificate path prefix (task:, certstore:, or file device name:) |
SNMP Discovery Issues
| Symptom | Cause | Fix |
|---|---|---|
| brsnmp finds no PLCs | Wrong subnet or PVI not installed | Ensure PC is on same broadcast domain; install PVI 4.x |
| Can list but not set parameters | PLC in wrong state | PLC must be in BOOT or SERVICE state to accept IP changes via SNMP |
| Filter matches nothing | Regex syntax error | Test regex on https://regex101.com with ECMA syntax |
Key Findings
-
Three viable retrofit paths exist for the CP1584: (a) on-PLC MQTT via paho.mqtt.c-ar (requires Automation Studio project), (b) OPC-UA to MQTT bridge via edge gateway (works without project), (c) SNMP polling for infrastructure health only.
-
The OPC-UA to MQTT bridge is the most practical approach for undocumented machines. It does not require the Automation Studio project, does not add load to the PLC, and works with the OPC-UA server already built into Automation Runtime. The open-source Neuron gateway (Docker) provides the lowest-friction deployment.
-
paho.mqtt.c-ar is mature and well-documented but fundamentally requires source code access. It supports MQTT v5.0, TLS, WebSocket transport, offline buffering, and JSON serialization of PLC structures. The library is built for AR versions from H3.10 through A4.73.
-
SNMP on B&R PLCs is PVI-SNMP, not standard SNMPv3. The brsnmp open-source tool provides the most practical access. Standard MIB-II OIDs work for the Ethernet interface but B&R-specific data (AR state, firmware version, serial number) requires the PVI-SNMP mechanism.
-
The CP1584 already has two built-in network interfaces (IF2 = Ethernet, IF3 = POWERLINK), so network segmentation for OT/IT separation is possible without any expansion module. However, if you need a third interface (e.g., a dedicated IT monitoring NIC), the X20IF1061-1 can fill the single expansion slot. An external switch with VLANs is a simpler alternative. See network-architecture.md for details on the built-in interfaces.
-
OPC-UA variable exposure is the critical gating factor. Even with a perfect MQTT pipeline, if the OEM did not enable OPC-UA tags, you have zero process data. This is the first thing to check when inheriting an undocumented B&R machine. See opcua.md for the full discovery procedure.
-
The Grafana + InfluxDB + Telegraf + Mosquitto stack is the de facto standard for IIoT monitoring dashboards. All components are open-source, well-supported, and run on modest hardware (a Raspberry Pi 4 or any small PC is sufficient).
-
Security at the OT/IT boundary is non-negotiable. The edge gateway pattern naturally provides a security boundary point. Implement TLS on MQTT, certificate-based security on OPC-UA, and firewall rules to restrict access to the PLC’s Ethernet interface.
-
CF card longevity must be managed. When logging on the PLC, use SLC cards only, implement log rotation, buffer writes, and monitor card health. Industrial CF cards from B&R (5CFCRD series) are rated for extended temperature and higher write cycles.
-
The Frankenstein Automation Gateway and EMQX Neuron are the two best open-source OPC-UA to MQTT bridges. Frankenstein is Java-based and simpler for small deployments. Neuron runs in Docker, has a web UI, and is better suited for production edge deployments. Both are free and actively maintained.
-
brwatch provides an alternative no-code discovery and monitoring tool for initial IIoT assessment. Before building any pipeline, use brwatch (github.com/hilch/brwatch) to enumerate all visible variables, log their values to CSV, and validate that the OPC-UA server is actually exposing process data. This 5-minute assessment determines whether the bridge approach is even viable. See access-recovery.md §12 and python-diagnostics.md §Community Tools.
-
The awesome-B-R repository (github.com/br-automation-community/awesome-B-R) catalogs all community tools for B&R PLCs. Key tools for IIoT retrofits: paho.mqtt.c-ar (on-PLC MQTT), brsnmp (SNMP discovery), demo-br-asyncua (OPC-UA examples), and as6-migration-tools (for AR 6.x migration planning).
-
OMJSON (github.com/loupeteam/OMJSON) provides WebSocket + JSON communication from the PLC — an alternative to MQTT/OPC-UA for lightweight data exchange when you need a simple JSON-based API from the PLC to a web server or custom application.
-
OMSQL (github.com/loupeteam/OMSQL) provides SQL database communication from the PLC — useful for writing diagnostic data, alarm histories, or production records directly to MySQL/PostgreSQL databases from the PLC without an external gateway.
-
mappRemoteShell (github.com/br-automation-community/mappRemoteShell) demonstrates bidirectional OPC-UA communication for remote diagnostics — the PLC sends commands via OPC-UA that trigger shell scripts on a remote PC, enabling complex diagnostic sequences orchestrated from the PLC.
Document updated: July 2026 (added OMJSON, OMSQL, mappRemoteShell community tools)
B&R CP1584 FTP and Web Server Interface Reference
Overview
Every B&R CP1584 (X20CP1584) running Automation Runtime ships with two built-in network services that are invaluable when maintaining machines from defunct OEMs with no documentation: an FTP server for direct file system access to the Compact Flash card, and a web server hosting the System Diagnostics Manager (SDM) and optionally custom HTML/ASP pages with live process variable access.
Neither service requires Automation Studio to use. A laptop on the same subnet with any FTP client or web browser is sufficient to pull configuration files, extract logs, download system dumps, and inspect live PLC data. This makes them critical survival tools when you have no AS project and no OEM support.
The CP1584 uses a PCMCIA Compact Flash card that holds the Automation Runtime OS and all application data. The FTP server exposes the CF card partitions directly. The web server runs on the same Ethernet interface as SDM and any custom pages the OEM may have deployed.
FTP Server
Connection Basics
| Parameter | Value |
|---|---|
| Protocol | FTP (plain text, no encryption) |
| Default Port | 21 |
| FTPS Support | Available in AR 4.x via configuration (not SFTP) |
| Port Change | AR P4.93+ via CfgSetFTPServerPort FB; AS UI from AS 4.12.9 |
| Authentication | Configured in Automation Studio (CPU > FTP settings) |
| Anonymous Access | C: partition only (read-only); F: requires credentials |
| RBAC (AR 6.5+) | Role-based access control for authentication and permissions (AS 6.5 / AR 6.5) |
Access Levels and Partitions
The FTP server presents two root-level directories corresponding to CF card partitions:
C: – System Partition (Anonymous / Read-Only)
- Anonymous FTP login grants access to the C: partition in read-only mode.
- Contains the Automation Runtime OS files, system configuration, and log files.
- Attempting
CWD F:while anonymous returns550 Guest access denied. - You cannot write to C: via FTP under any circumstances.
F: – User Partition (Requires Credentials)
- The F: (user) partition stores application data, project backups, recipe files, CSV logs, and anything the PLC program writes via FileIO.
- Access requires the username and password configured in the AS project under CPU > FTP configuration.
- If no credentials were configured by the OEM, common defaults reported in the field include
admin/adminor empty credentials. - On very old B&R systems, any username/password combination reportedly worked.
- Read/write access level is also configured per-file-device in the AS project.
File System Layout
Key directories typically found via FTP:
C:\
BrWebSvr.ini -- Web server configuration
BrWebSvr.cfg -- Web server user/group definitions (legacy)
arlogsys.log -- System logger output
SysDir\ -- System configuration directory
*.cfg -- Runtime configuration files
*.ini -- Initialization files
AS\ -- Automation Runtime module libraries
WebServer\ -- Web server binary and support files
Temp\ -- Temporary files
web\ -- Default web server root directory
index.htm -- Default start page
PV_Access.js -- JavaScript library for process variable access
*.asp -- Active Server Pages (if deployed)
mappView\ -- mappView HMI files (if mappView is used)
*.widget -- Widget definitions
*.page -- Page definitions
*.css -- Stylesheets
F:\
(user files - varies by OEM project)
*.csv -- Data logs, recipes, production records
*.txt -- Text log files
*.zip -- Project backups (if OEM stored them here)
*.dat -- Parameter or recipe files
TimLogger\ -- If mapp TimLogger is used
*.csv -- Time-stamped log files
DataXfer\ -- File transfer directories
UserDir\ -- Custom user data directory
The USER_PATH keyword in Automation Runtime automatically resolves to the F: partition root.
Practical FTP Commands
Connecting with FileZilla (recommended over WinSCP for B&R):
Host: <PLC_IP_ADDRESS>
Username: <configured_username or "anonymous" for C: only>
Password: <configured_password or blank for anonymous>
Port: 21
FileZilla works reliably across all AR versions. WinSCP has known compatibility issues with AR P4.93+ due to FTP server implementation changes.
Connecting with curl (command line, for scripting):
# List system partition files (anonymous)
curl -s ftp://192.168.0.1/ --user anonymous:
# Download a configuration file
curl -s ftp://192.168.0.1/SysDir/Config.cfg --user anonymous: -o Config.cfg
# Download a file from the user partition
curl -s ftp://192.168.0.1/data/recipe.csv --user admin:admin -o recipe.csv
# Upload a file to the user partition
curl -s -T local_file.csv ftp://192.168.0.1/data/ --user admin:admin
# List user partition contents
curl -s ftp://192.168.0.1/ --user admin:admin
# Download the entire web directory for offline inspection
curl -s ftp://192.168.0.1/web/ --user admin:admin --list-only
Bulk backup with lftp (mirrors the entire user partition):
lftp -e "mirror --verbose / /path/to/local_backup" -u admin,admin ftp://192.168.0.1
Python script for automated log retrieval:
import ftplib
ftp = ftplib.FTP("192.168.0.1")
ftp.login("admin", "admin")
ftp.cwd("TimLogger")
filenames = ftp.nlst()
for f in filenames:
with open(f, "wb") as fh:
ftp.retrbinary(f"RETR {f}", fh.write)
ftp.quit()
FTP Configuration in Automation Studio
If you have access to an AS project (or can obtain one), the FTP server is configured under:
CPU > Properties > FTP Server
Key settings:
- FTP Server Enabled: Checkbox to enable/disable
- Password: Sets the FTP access password
- File Device Access: Per-device read/write permissions under the File Device configuration
- User Partition Minimum Size: Must be > 0 for F: to exist (check CPU > Module system on target)
FTP Gotchas and Known Issues
-
WinSCP incompatibility with AR P4.93: The FTP server implementation changed in P4.93, breaking WinSCP directory listing. Use FileZilla instead. This is a known regression.
-
No SFTP: B&R supports FTPS (FTP over SSL/TLS) but not SFTP (SSH-based). For AR 4.x, configure FTPS in the CPU properties. For security on plant networks, consider tunneling FTP through an SSH tunnel or VPN rather than relying on FTPS.
-
Minimum user partition size: If the “Minimum user partition size” in CPU > Module system on target is set to 0, the F: partition will not exist and FTP access to user data will fail. This must be set > 0 and the CF card must be re-initialized (offline installation).
-
Concurrent connection limits: The FTP server supports limited concurrent connections (typically 4-8 sessions). Excessive simultaneous sessions may cause connection refused errors or intermittent timeouts.
-
File locking: Files currently open by the PLC program (via FileIO) cannot be overwritten via FTP. This is particularly relevant for active log files. Lock duration is typically until the FileIO handle is closed or the PLC program cycle ends.
-
Path navigation quirk: The FTP root shows a
..entry (parent directory) that returns “Permission denied” when clicked. This is normal – you are already at the partition root. -
Timeout behavior: Long-running transfers may timeout on slow networks. The FTP server does not support resume/partial transfers reliably on older AR versions.
-
Case sensitivity: The B&R file system is case-insensitive on C: but this can vary on F: depending on AR version. Use exact case when in doubt.
FTP Active vs Passive Mode
FTP uses two channels: a control channel (port 21, always used for commands) and a data channel (for file transfers). The data channel can be established in two ways:
Active Mode (PORT):
Client → Server: PORT command with client IP and port number
Server → Client: Server initiates data connection TO the client
Problem: The server connects back to the client on an unpredictable port (typically 20).
Most firewalls and NAT routers block incoming connections on arbitrary ports.
Passive Mode (PASV):
Client → Server: PASV command
Server → Client: Server responds with IP and port number
Client → Server: Client initiates data connection TO the server
Solution: The client connects to a known server port. Only outbound connections from client needed.
Works through firewalls and NAT.
For B&R FTP on plant networks:
| Scenario | Recommended Mode | Why |
|---|---|---|
| Direct connection (same subnet) | Either mode works | No firewall in path |
| Through corporate firewall | Passive | Firewall blocks server-to-client data connections |
| Behind NAT/DSL modem | Passive | NAT cannot forward server’s data connection |
| VPN tunnel | Passive preferred | Some VPNs block active mode data connections |
| Automation Studio “Transfer to target” | Active (AS default) | AS manages the connection automatically |
Configuring passive mode in clients:
# curl (useful for scripted FTP operations)
curl --ftp-pasv ftp://admin:[email protected]/F:/logfile.txt -o logfile.txt
# FileZilla: Edit > Settings > Connection > FTP > Transfer Mode > Passive
# Python ftplib
from ftplib import FTP
ftp = FTP('192.168.1.10')
ftp.login('admin', 'password')
ftp.set_pasv(True) # Force passive mode
# lftp
lftp -e "set ftp:passive-mode on; ls" admin:[email protected]
Passive port range on B&R controller: B&R’s FTP server uses a default passive port range (typically ports 49152-65535). If a firewall sits between the client and controller, open this port range for TCP traffic. The range cannot be reconfigured on AR 4.x controllers.
FTPS Configuration
B&R supports FTPS (FTP over SSL/TLS) for encrypted file transfers. This is distinct from SFTP (which B&R does not support — confirmed on B&R Community).
Configuration in Automation Studio:
-
CPU > Properties > FTP Server
-
Enable FTPS checkbox
-
Select SSL/TLS mode:
- Explicit FTPS (AUTH TLS): Client requests TLS upgrade via
AUTH TLScommand on port 21. Most compatible option. - Implicit FTPS: TLS is assumed from the start on port 990. Less compatible, deprecated by RFC.
- Explicit FTPS (AUTH TLS): Client requests TLS upgrade via
-
Certificate management: FTPS requires an SSL/TLS certificate on the controller.
- For AR 4.x: Certificates are managed in CPU > Properties > SSL/TLS
- Self-signed certificates can be generated in Automation Studio
- Certificate is stored on the CF card and loaded at startup
FTPS gotchas:
- FTPS requires multiple ports — the control connection on 21 AND the data connection ports must both allow TLS. Active mode adds another connection direction.
- Minimum TLS version should be set to TLS 1.0 or higher in client settings (some B&R AR versions may have issues with TLS 1.2 negotiation — check community posts for your specific AR version).
- Certificate validation may fail with self-signed certificates unless the client is configured to accept them.
Using FTPS with FileZilla:
Host: ftps://192.168.1.10
Username: admin
Password: [configured password]
Port: 21
Protocol: Require explicit FTPS
SFTP is NOT available:
B&R Community confirmed: “SFTP Support — B&R does not provide SFTP (SSH-based file transfer). FTPS (FTP + TLS/SSL) is the only encrypted file transfer option.” Source: https://community.br-automation.com/t/sftp-support/8247
Web Server and System Diagnostics Manager (SDM)
Web Server Overview
B&R Automation Runtime includes an integrated web server that serves multiple purposes:
- System Diagnostics Manager (SDM) – Built-in diagnostic web interface
- Custom HTML/ASP pages – OEM-deployed web pages for monitoring/control
- PV_Access – JavaScript-based live process variable read/write from the browser
- mappView – HTML5 HMI served directly from the PLC
SDM Access
| Parameter | Value |
|---|---|
| URL (AR 4.x default) | http://<PLC_IP>/sdm |
| URL (AR 6.x default) | https://<PLC_IP>/sdm (HTTPS by default) |
| Port | 80 (HTTP) or 443 (HTTPS) |
| Alternative port | 81 sometimes used for web app separation |
| Authentication | None by default (AS 6.x can enable auth) |
| AR Version Required | V3.0+ for SDM; V3.08+ for System Dump |
| Enabled by default | Yes in AR 4.x; No in AS 6.0+ (must enable manually) |
Accessing SDM
- Configure your laptop’s Ethernet adapter to the same subnet as the PLC
- Open a web browser (Chrome recommended)
- Navigate to
http://<PLC_IP>/sdm - If HTTP fails, try
https://<PLC_IP>/sdm
SDM remains accessible even when the PLC is in SERVICE mode, as long as the network configuration is intact.
SDM Capabilities
The SDM provides:
- Hardware Overview: All connected modules, firmware versions, serial numbers
- Task Monitor: Real-time cycle time monitoring for all task classes (Cyc0-Cyc3)
- Logger: View system log entries (arlogsys) without needing Automation Studio
- System Dump: Download a complete diagnostic archive (.tar.gz) over HTTP
- Network Configuration: View IP, subnet, gateway, DNS settings
- CF Card Status: Partition sizes, free space, file system health
- User Partition Status: Monitor F: partition usage
Downloading a System Dump via SDM
This is the single most valuable diagnostic procedure available without Automation Studio:
- Open
http://<PLC_IP>/sdmin Chrome - Click the System Dump icon (center of the SDM interface)
- Select Parameters + Data-Files
- Click OK on the confirmation dialog
- Click Upload from target
- Wait for the download to complete (Chrome may show a “Keep” warning – click Keep)
- The file will be named
BuR_SDM_Sysdump_<timestamp>.tar.gz
The system dump contains:
arlogsys.log– System logger output- Configuration files from SysDir
- Hardware topology information
- Task and module status data
- Memory usage snapshots
To analyze the dump, open it in Automation Studio Logger (File > Load Data) or use the third-party SystemDumpViewer tool. The AS version must match the AR major version on the PLC.
Custom Web Pages (Legacy ASP/HTML)
Older B&R systems (AR 2.x/3.x era) used the legacy BrWebSvr web server with ASP-like pages. The configuration file is C:\BrWebSvr.ini:
BaseDir = C: ; Base directory on the CF card
WebDir = web ; Subdirectory containing web pages
StartPage = index.htm ; Default start page
The web server binary is located at C:\AS\WebServer\i386\webserv.br.
Complete Legacy ASP Function Reference
These functions are available in .asp files on the legacy web server. The web server binary is located at C:\AS\WebServer\i386\webserv.br (or C:\AS\WebServer\Y0200\i386\webserv.br on newer AR versions).
| Function | Syntax | Purpose |
|---|---|---|
| ReadPLC | <% ReadPLC("varname"); %> | Insert the current value of a global PLC variable. Only global variables are accessible. If the variable does not exist, “Unknown variable” is displayed. Supports array indexing: <% ReadPLC("Program:array[0]"); %> |
| WebPrint | <% WebPrint("param"); %> | Insert the value of an HTTP GET/POST parameter into the page output. Used with form submissions and the ReadWrite action. |
| UserGroup | <% UserGroup(rights); %> | Conditional display — HTML after this tag only renders if the logged-in user has the required rights bitmask. Rights are checked as bitwise AND. Call with UserGroup(0) to re-enable display for all users. |
| ErrorMsg | <% ErrorMsg(); %> | Display the authorization error message from the last UserGroup() check. Shows why access was denied. |
| ReadALARM | <% ReadALARM("Errorstr", index); %> | Display alarm history from Visual Components. Index: 1=date/time, 2=group number, 3=alarm number, 4=alarm text, 5=alarm status. The errorstring comes from VA_GetAlarmList or VA_GetExAlarmList VISAPI calls. |
| UserLogin | /goform/UserLogin?username=X&password=Y&redirect=page.asp&error_redirect=err.asp | Authenticate a user. Credentials are defined in BrWebSvr.cfg. Only one user per IP address can be logged in simultaneously. Login persists until logout or web server restart. |
| UserLogout | /goform/UserLogout?redirect=page.asp | Log out the current user. Must be from the same IP as login. |
UserGroup Rights Bitmask System
The UserGroup function uses a bitmask to check authorization. Rights values are summed from individual permission bits:
| Bit | Decimal | Meaning |
|---|---|---|
| Bit 0 | 1 | Permission level 1 |
| Bit 1 | 2 | Permission level 2 |
| Bit 2 | 4 | Permission level 3 |
| Bit 3 | 8 | Permission level 4 |
| Bit 4 | 16 | Permission level 5 |
Example: UserGroup(20) checks if the user has bits 3 and 4 set (8 + 16 = 24, or 4 + 16 = 20). The user’s rights bitmask in BrWebSvr.cfg is ANDed with the parameter.
BrWebSvr.cfg Configuration File Format
The BrWebSvr.cfg file defines web server users, passwords, and rights:
[User1]
Name=admin
Password=mypassword
Rights=31
[User2]
Name=operator
Password=operator
Rights=1
- One user per IP address can be logged in simultaneously
- If no BrWebSvr.cfg exists or it contains no users, no login is required
- Passwords are stored in plaintext in the configuration file (not hashed)
Read/Write Variables via HTTP Forms (goform/ReadWrite)
The /goform/ReadWrite endpoint is the primary mechanism for bidirectional variable access from web pages:
/goform/ReadWrite?variable=VarName&value=NewValue&write=1&redirect=result.asp
Parameters:
| Parameter | Description |
|---|---|
variable | PLC variable name to read/write (indexed arrays supported: myArray[5]) |
value | Value to write (for write operations) |
write | Set to 1 to write, or omit/0 for read-only |
read | Set to 1 to read the variable |
redirect | Page to redirect to after the operation |
var | Name of the variable in the redirect (echoes back the variable name) |
val | Value of the variable in the redirect (echoes back the value) |
Batching multiple variables in a single call: The goform/ReadWrite endpoint supports up to 10 variables per call. Additional variables use suffixed parameter names:
/goform/ReadWrite?redirect=target.html
&variable=myVar[0]&value=none&read=1
&variable__1__=myVar[1]&value__1__=none&read=1
&variable__2__=myVar[2]&value__2__=none&read=1
...
&variable__9__=myVar[9]&value__9__=none&read=1
This is critical for performance — reading 10 variables in one request is roughly 10x faster than 10 individual requests.
Read result page example (result.asp):
<%-- Display the variable name and value from the redirect parameters --%>
Variable: <% WebPrint("var"); %> = <% WebPrint("val"); %>
PV_Access (Modern JavaScript API)
For AR 4.x systems, the modern approach uses PV_Access.js located in the web server root (C:\web\PV_Access.js). This JavaScript library provides real-time read/write access to PLC process variables directly from the browser using HTTP or WebSocket connections.
How PV_Access.js Works Internally
PV_Access.js wraps the legacy goform/ReadWrite ASP endpoint. Under the hood, every readVariable() or writeVariable() call from PV_Access.js generates an HTTP request to /goform/ReadWrite with the appropriate parameters. This means:
- PV_Access is not a WebSocket or binary protocol — it is HTTP-based
- Each variable read/write is a separate HTTP request by default
- The 10-variable batching limit of goform/ReadWrite applies to PV_Access as well
- Port 80 is used by default; port 81 is recommended to separate web application traffic from SDM
Basic PV_Access Usage
<html>
<head>
<script src="PV_Access.js"></script>
</head>
<body>
<script>
var pv = new PVAccess("192.168.0.1");
pv.readVariable("gMachineStatus", function(value) {
document.getElementById("status").innerText = value;
});
pv.writeVariable("gCmd_Start", 1);
</script>
<div>Machine Status: <span id="status">--</span></div>
</body>
</html>
High-Performance JSON Data Approach (Recommended for Data-Rich Pages)
Reading variables one-by-one via PV_Access is slow for large datasets (100 variables via PV_Access can take 15+ seconds). A much faster approach uses ASP pages that output JSON data, loaded via fetch():
Step 1: Create an ASP page with all variables as a JSON array (C:\web\data.asp):
[
"<%ReadPLC("Program:array[0]");%>",
"<%ReadPLC("Program:array[1]");%>",
"<%ReadPLC("Program:array[2]");%>",
"<%ReadPLC("Program:temperature");%>",
"<%ReadPLC("Program:pressure");%>",
"<%ReadPLC("Program:status_word");%>"
]
Step 2: Fetch with JavaScript:
function cyclicFetch(url, interval) {
function fetchData() {
fetch(url)
.then(response => response.json())
.then(data => {
// Process array data
document.getElementById("temp").innerText = data[3];
document.getElementById("pressure").innerText = data[4];
document.getElementById("status").innerText = data[5];
setTimeout(fetchData, interval);
})
.catch(error => console.error('Error:', error));
}
fetchData();
}
// Refresh every 200ms
cyclicFetch("/data.asp", 200);
Performance comparison (measured on B&R 4PPC30, local network):
| Method | 100 INT variables | 10 INT variables |
|---|---|---|
| PV_Access.js (one-by-one) | >15 seconds | ~2 seconds |
| JSON ASP + fetch() | <80 ms | <20 ms |
The JSON approach is roughly 200x faster than individual PV_Access reads because:
- A single HTTP request retrieves all variables
- The web server processes all
<%ReadPLC()%>tags server-side in one pass - No per-variable HTTP overhead
- The
fetch()API is non-blocking and efficient
Important considerations:
- This technique works on AR 4.x with the legacy web server (not mappView)
- The ASP page must be served from the B&R web server (not a local file)
- Array variables use the syntax
Program:array[index]whereProgramis the task/library name - Global variables (no program prefix) are also accessible:
<%ReadPLC("gVarName");%>
Custom Web Services via AsHTTP Library
For maximum control over web server responses, B&R provides the AsHTTP library for creating custom HTTP endpoints in IEC/C code running on the PLC:
- Build custom REST/JSON APIs entirely within PLC tasks
- Define URL routes, request parsing, and response formatting
- No dependency on goform/ReadWrite limitations
- Full control over data formatting, caching, and access control
- Requires more development effort but provides the best performance and flexibility
This approach is preferred when:
- You need to expose structured data (JSON/XML) to external systems
- You need authentication beyond what BrWebSvr.cfg provides
- You need to serve large datasets efficiently
- You are building custom dashboards or IIoT integrations
mappView (HTML5 HMI)
Modern B&R systems use mappView, an HTML5-based HMI framework built on OPC UA FX. If the CP1584 is running a mappView application, the HMI will be accessible via:
http://<PLC_IP>/mappView/ (AR 4.x)
https://<PLC_IP>/mappView/ (AR 6.x)
mappView requires the OPC UA server to be running on the PLC. The HMI loads in any modern browser and provides the full visualization that was deployed by the OEM.
The mappView files are typically stored in C:\mappView\ on the CF card and can be inspected via FTP for understanding the HMI structure without AS.
Using FTP and Web Server for Diagnostics and Data Extraction
Procedure: Full Remote Backup Without Automation Studio
This procedure captures everything available without AS:
PLC_IP="192.168.0.1"
BACKUP_DIR="./cp1584_backup_$(date +%Y%m%d)"
mkdir -p "$BACKUP_DIR/system" "$BACKUP_DIR/user" "$BACKUP_DIR/web" "$BACKUP_DIR/sdm"
# 1. Download SDM system dump (via browser or curl)
curl -k -o "$BACKUP_DIR/sdm/sysdump.tar.gz" \
"https://$PLC_IP/sdm/systemdump" 2>/dev/null || \
curl -o "$BACKUP_DIR/sdm/sysdump.tar.gz" \
"http://$PLC_IP/sdm/systemdump" 2>/dev/null
# 2. Mirror system partition (C:) via anonymous FTP
lftp -e "mirror --verbose / '$BACKUP_DIR/system'" \
-u anonymous, "ftp://$PLC_IP"
# 3. Mirror user partition (F:) via authenticated FTP
# Replace credentials with those from the AS project or try common defaults
lftp -e "mirror --verbose / '$BACKUP_DIR/user'" \
-u admin,admin "ftp://$PLC_IP/F:"
# 4. Mirror web directory
lftp -e "mirror --verbose /web '$BACKUP_DIR/web'" \
-u admin,admin "ftp://$PLC_IP"
Procedure: Extracting Configuration Files
Key configuration files to retrieve for understanding a PLC setup:
# Network configuration
curl "ftp://$PLC_IP/SysDir/Config.cfg" --user anonymous: -o Config.cfg
curl "ftp://$PLC_IP/SysDir/ARConfig.ini" --user anonymous: -o ARConfig.ini
# Web server configuration (if custom pages exist)
curl "ftp://$PLC_IP/BrWebSvr.ini" --user anonymous: -o BrWebSvr.ini
curl "ftp://$PLC_IP/BrWebSvr.cfg" --user anonymous: -o BrWebSvr.cfg
# Runtime parameters
curl "ftp://$PLC_IP/SysDir/Param.cfg" --user anonymous: -o Param.cfg
# System log
curl "ftp://$PLC_IP/arlogsys.log" --user anonymous: -o arlogsys.log
Procedure: Pulling Data Logs and Production Records
OEMs commonly store production data, alarm logs, and recipes on the F: partition:
# List all CSV files on the user partition
curl "ftp://$PLC_IP/" --user admin:admin --list-only | grep -i csv
# Download all CSV files
curl "ftp://$PLC_IP/" --user admin:admin --list-only | while read f; do
[[ "$f" == *.csv ]] && curl "ftp://$PLC_IP/$f" --user admin:admin -o "$f"
done
# Download TimLogger archives (if mapp TimLogger is used)
curl "ftp://$PLC_IP/TimLogger/" --user admin:admin --list-only
Procedure: Checking if a Project Backup Exists on the CF Card
OEMs sometimes store project files on F: for recovery:
# Search for zip files (project archives)
curl "ftp://$PLC_IP/" --user admin:admin --list-only | grep -i zip
# Search for AS project files
curl "ftp://$PLC_IP/" --user admin:admin --list-only | grep -i "\.apj\|\.at2\|\.at4"
If a project archive exists on F:, it can be downloaded via FTP and opened in the matching version of Automation Studio to recover full source code.
Procedure: Real-Time Variable Monitoring via Web
If PV_Access pages exist (check for .asp or .htm files with PV_Access.js references in the web\ directory):
- Browse to
http://<PLC_IP>/orhttp://<PLC_IP>/web/ - Check the page source for PV_Access.js script tags
- If custom monitoring pages exist, they provide live variable readout without any software
Procedure: Checking Hardware State via SDM
Without any software installed:
- Open
http://<PLC_IP>/sdm - Navigate through each tab:
- Overview: Lists all X20 I/O modules, their order in the X2X bus, firmware versions, and status
- Logger: Shows runtime errors, warnings, and info messages with timestamps
- Task Monitor: Reveals task class assignments and cycle times
- Memory: Shows RAM and Flash utilization
- Use this information to document the hardware configuration for a machine with no existing documentation
Default Credentials and Discovery
Finding the IP Address
When no documentation exists:
- B&R Automation Studio “Project Configuration”: Can auto-detect controllers on the network
- B&R Service Tool (RUC - Runtime Utility Center): Can scan for devices
- Wireshark: Capture DHCP requests or B&R discovery packets on startup
- Default IP: Many B&R X20 controllers ship with
192.168.0.1as the default IP address with DHCP enabled - Physical inspection: Check the front panel display (if equipped) or the AS project backup on the CF card
FTP Credentials Recovery
If FTP credentials are unknown:
- Check
C:\BrWebSvr.cfgfor legacy web server credentials (may hint at password patterns) - Check
C:\SysDir\*.cfgfiles for configuration references - Try common defaults:
admin/admin,br/br,operator/operator, empty/empty - On legacy systems, any username/password was reported to work
- If you have the AS project file (
.apj), open it in Automation Studio and check CPU > FTP settings
SDM Authentication
SDM typically requires no authentication in AR 4.x. In AR 6.x, it may require login if configured by the OEM. There is no standard default credential for SDM – if locked, the AS project must be modified to reset it.
Undocumented Features and Gotchas
Undocumented Behaviors
-
Anonymous C: access persists even when FTP is “disabled”: On some AR versions, disabling the FTP server in the AS project only disables authenticated access. Anonymous read-only access to C: may still function.
-
BrWebSvr.ini overrides AS project settings: If a
BrWebSvr.inifile exists on C:, it takes precedence over AS project web server settings. Deleting or renaming this file reverts to project-configured behavior. -
Multiple web servers can coexist: The legacy BrWebSvr and the modern SDM web server can run simultaneously on different ports (e.g., 80 and 443). Check both.
-
PV_Access port 81 convention: While not enforced, B&R documentation recommends using port 81 for PV_Access application traffic to separate it from SDM on port 80. Check if the OEM configured this.
-
CF card partition scheme: B&R typically creates 4 partitions on CF cards. Standard consumer CF cards may not support the multi-partition layout, which is why B&R branded cards are often required. Attempting to clone to a generic card may fail.
-
FTP file device path must use
USER_PATH: When configuring file devices in AS, the path for the user partition device must be set toUSER_PATH(notUSER_PATH:\orF:\). An incorrect path causes FTP directory listing to fail with “Permission denied”. -
System dump requires SDM enabled: If the OEM disabled SDM, you cannot download system dumps via the web interface. As a fallback, pull
arlogsys.logdirectly via FTP from C:. -
Logger buffer wraps: The system logger (
arlogsys.log) has a fixed buffer size. On long-running systems, old entries are overwritten. If a fault occurred days ago, the log entry may already be gone. Extract logs proactively. -
AR 6.x drive mapping changes: In Automation Runtime 6, the drive mappings C: through F: no longer correspond to the same partitions as in AR 4.x. If the CP1584 was upgraded from AR 4.x to AR 6.x, file locations change. See cf-card-boot.md for details.
-
Web server start page: If no custom pages exist, browsing to
http://<PLC_IP>/may return a generic B&R page, a 404, or the SDM redirect depending on AR version and configuration.
Security Warnings
- The FTP server transmits credentials in plain text. On shared plant networks, anyone with a network sniffer can capture passwords.
- SDM has no authentication by default in AR 4.x, exposing full hardware and diagnostic information.
- Custom ASP pages with ReadWrite forms can modify PLC variables from any browser – a potential safety hazard on process equipment.
- If the machine controls physical equipment, verify that web-accessible variables cannot cause unintended motion or state changes.
Known Security Vulnerabilities (CVEs)
The following CVEs affect the FTP and web server interfaces on CP1584 systems. Check your AR version against the B&R security advisories:
| CVE | Component | Severity | Status in AR 4.93 | Mitigation |
|---|---|---|---|---|
| CVE-2025-11044 | Multiple (AR core) | Critical | Patched | Upgrade to AR R4.93 |
| CVE-2025-3450 | Multiple (AR core) | High | Patched | Upgrade to AR R4.93 |
| CVE-2023-3242 | FTP weak TLS | Medium | Not patched | Use VPN or isolated network segment; FTPS if available |
| Webserver buffer overflow | BrWebSvr | High | Not patched | Disable custom web pages; restrict web server access via firewall |
| SDM XSS | SDM web UI | Medium | Not patched | Restrict SDM access to trusted networks; do not click untrusted links |
| SDM session fixation | SDM | Medium | Not patched | Clear browser session after SDM access |
| SDM CSV injection | SDM export | Low | Not patched | Open exported CSV files in a sandboxed viewer |
Practical recommendations for undocumented machines:
- Place the CP1584 on an isolated VLAN, not the corporate network
- If FTP must be used across network segments, tunnel through SSH or a VPN
- Disable custom web pages (remove
.aspfiles fromC:\web\) if not needed - Consider the OPC-UA to MQTT bridge pattern from iiot-retrofit.md to expose data without exposing the FTP/web attack surface
Sources
Official Documentation
- B&R AR WebServer Technical Manual — PDF (infoPLC) — Complete BrWebSvr ASP function reference, configuration files, and deployment guide
- B&R Automation Studio Online Help — Web server configuration, FTP settings, SDM configuration
B&R Community Forum Discussions
- PLC Web Server Data Read Performance — goform/ReadWrite 10-variable batching, JSON ASP + fetch() optimization technique (200x faster than PV_Access), AsHTTP custom web services
- Integrated webserver — Web server setup, ASP configuration, ReadPLC usage, GitHub demo project reference
- B&R PLC as Web Server Demo — Community sample project by B&R expert Christoph Hilchenbach
Related Documents
- cf-card-boot.md: CF card partition layout, boot sequence, AR installation files, and CF card cloning procedures
- config-file-formats.md: Detailed format reference for BrWebSvr.ini, BrWebSvr.cfg, ARConfig.ini, and other configuration files accessible via FTP
- diagnostics-sdm.md: Comprehensive SDM usage guide, log interpretation, system dump analysis, and error code reference
- iiot-retrofit.md: Building modern monitoring dashboards using B&R web server, OPC-UA, and custom REST endpoints
- custom-diagnostic-tools.md: Building custom diagnostic tools on the PLC including AsHTTP-based web services
Key Findings
-
FTP and SDM are the primary no-software-required access methods for undocumented B&R CP1584 systems. Together they provide full file system access, complete hardware diagnostics, and all system logs over a standard Ethernet connection.
-
FileZilla is the safest FTP client choice. WinSCP breaks on AR P4.93+ due to a known FTP server regression. The root cause is a change in the FTP server’s directory listing response format.
-
Anonymous FTP gives read-only access to C: – the system partition containing configuration files, logs, and web pages. Authenticated FTP (credentials from the AS project) is required for F: (user partition) access.
-
The SDM is accessible at
http://<PLC_IP>/sdmand works even when the PLC is in SERVICE mode. It provides hardware overview, task monitoring, logger output, and system dump downloads – all from a web browser. -
System dumps are the single most valuable diagnostic artifact. Downloadable as a
.tar.gzfile via SDM, they contain everything needed for B&R support to diagnose issues without physical access to the machine. -
OEM project backups may exist on F:. Always check for
.zipor.apjfiles in the user partition – they can contain the full Automation Studio project with source code, enabling complete system recovery. -
PV_Access.js enables browser-based live variable monitoring without any installed software. If the OEM deployed custom web pages, they provide real-time process data access from any device on the network.
-
FTP credentials are not recoverable from the PLC if the AS project is lost. The password is stored in the compiled project binary, not in a plain-text configuration file. Common defaults may work on legacy systems.
-
AR 6.x changes defaults to HTTPS and disables SDM by default. For systems running AR 6.x, use
https://URLs and check that SDM is enabled in the AS project configuration under “System diagnostics”. -
The combined FTP + SDM approach covers approximately 90% of remote maintenance needs for undocumented B&R machines: configuration extraction, log retrieval, hardware inventory, data backup, and live diagnostics are all achievable without Automation Studio.
-
The legacy BrWebSvr ASP system provides complete bidirectional PLC variable access via the
/goform/ReadWriteendpoint. Up to 10 variables can be batched in a single HTTP request. The UserGroup/UserLogin/UserLogout system provides role-based page protection via BrWebSvr.cfg. On undocumented machines, checking for.aspfiles in theC:\web\directory can reveal OEM-built monitoring pages with live variable displays. -
The JSON ASP + fetch() approach is ~200x faster than PV_Access.js for bulk variable reads. Creating an ASP page that outputs
<%ReadPLC()%>tags as a JSON array, then fetching it with JavaScriptfetch(), can retrieve 100 INT variables in under 80ms compared to 15+ seconds via individual PV_Access calls. This is the recommended approach for any data-rich custom monitoring pages. -
PV_Access.js wraps the goform/ReadWrite protocol — it is not a WebSocket or binary protocol. Each read/write generates a standard HTTP request. This means PV_Access is subject to the same 10-variable-per-request batching limit and HTTP overhead as direct goform calls.
-
B&R provides the AsHTTP library for custom REST/JSON endpoints running directly on the PLC. For advanced IIoT integrations, this provides full control over HTTP responses without the limitations of the legacy ASP system. See iiot-retrofit.md and custom-diagnostic-tools.md for implementation approaches.
-
Community GitHub resource: B&R expert Christoph Hilchenbach maintains
github.com/hilch/br-plc-as-webserverwith demonstration projects for the built-in web server. This is a practical reference for understanding web server configuration and deploying custom pages to the PLC. -
The web server binary location differs by AR version:
C:\AS\WebServer\i386\webserv.br(older) orC:\AS\WebServer\Y0200\i386\webserv.br(newer). The Y0200 path corresponds to AR version 2.2+ module structure. Both binaries serve the same ASP/HTTP functionality. -
SystemDumpViewer provides GUI analysis of downloaded system dumps. After downloading a system dump via SDM (
http://<PLC_IP>/sdm), use the community SystemDumpViewer Java tool or systemdump.py CLI (github.com/hilch/systemdump.py) to parse theSystemDump.xmlfile. This extracts logger entries, task cycle statistics, memory usage, and hardware status in a structured view. See ebpf-telemetry.md for the analysis workflow. -
Multiple unpatched CVEs affect FTP and web server on AR 4.93. Even the latest AR 4.x does not patch FTP weak TLS, webserver buffer overflow, or SDM XSS/session vulnerabilities. Isolate the PLC on a dedicated VLAN and restrict FTP/web access to trusted hosts. See ar-rtos.md §Security for the complete CVE table.
B&R Modbus Gateway Configuration on the CP1584
Overview
When you inherit a machine built by a defunct OEM with a B&R CP1584 PLC and zero documentation, Modbus is often your fastest path to data extraction and integration. The CP1584 (B&R Automation PC) runs Automation Runtime and supports both Modbus TCP (over Ethernet) and Modbus RTU (over serial). This guide covers every approach to using the CP1584 as a Modbus gateway, mapping variables to registers, integrating legacy field devices, and extracting data when OPC-UA is unavailable.
Two distinct Modbus strategies exist on the B&R platform:
- Software-based Modbus (AsMbTCP / AsMbRTU libraries running on the CPU itself) — the CP1584 acts as Modbus master or slave directly from its application code.
- Hardware-based Modbus (X20BC0087 bus controller on the X2X bus) — a dedicated module speaks Modbus TCP/UDP and exposes its I/O process image to any Modbus master. No B&R CPU is required.
Both strategies can coexist. The CP1584 can run AsMbTCP for programmatic data exchange and host an X20BC0087 for independent I/O gateway access.
Prerequisites:
- Automation Studio 4.x or 6.x (downloadable free from br-automation.com with an evaluation license)
- Physical Ethernet link and an IP plan on the same subnet
- For serial RTU: an X20IF1030/X20IF1031/X20IF1041 serial interface module
Modbus Protocol Reference
Function Codes
| FC | Code | Name | Data Type | Access |
|---|---|---|---|---|
| 01 | 0x01 | Read Coils | Bit (1-bit) | Read |
| 02 | 0x02 | Read Discrete Inputs | Bit (1-bit) | Read |
| 03 | 0x03 | Read Holding Registers | 16-bit WORD | Read/Write |
| 04 | 0x04 | Read Input Registers | 16-bit WORD | Read |
| 05 | 0x05 | Write Single Coil | Bit (1-bit) | Write |
| 06 | 0x06 | Write Single Register | 16-bit WORD | Write |
| 15 | 0x0F | Write Multiple Coils | Bit (1-bit) | Write |
| 16 | 0x10 | Write Multiple Registers | 16-bit WORD | Write |
Register Address Conventions
| Object | Function Code | B&R Base | Common SCADA Prefix |
|---|---|---|---|
| Coils | 01/05/15 | 0-based | 00001, 1xxxx |
| Discrete Inputs | 02 | 0-based | 10001, 2xxxx |
| Holding Regs | 03/06/16 | 0-based | 40001, 4xxxx |
| Input Registers | 04 | 0-based | 30001, 3xxxx |
B&R maps are 0-based. If upstream SCADA/HMI uses 1-based addressing (e.g., register 40001 = holding register address 0), subtract 1 when configuring the B&R side.
Byte Ordering
Modbus TCP defines Big-Endian (network order) within each 16-bit register: high byte first, low byte second. B&R internally uses little-endian. When bridging to Modbus, apply a ROL/ROR or explicit byte swap before exposing data to the Modbus map. This is especially critical for 4-byte (UDINT, REAL) and 8-byte (LREAL) types.
Unit ID (Slave Address)
| Value | Usage |
|---|---|
| 1–247 | Device-specific addressing for RTU-over-TCP gateways |
| 255 | Recommended for Modbus TCP-only (no serial gateway) |
| 0 | Valid per spec; some devices treat same as 255 |
When routing through a Modbus RTU-to-TCP gateway, the Unit ID selects the downstream serial slave. For direct Modbus TCP communication between peers, set Unit ID to 255.
X20BC0087 Modbus TCP Bus Controller
Hardware Details
The X20BC0087 is a dedicated bus controller that bridges X2X Link I/O nodes to Modbus TCP/UDP. It operates as a Modbus slave and does not require a B&R CPU — any Modbus TCP master (PLC, SCADA, Python script) can read/write its process image.
| Parameter | Value |
|---|---|
| B&R ID Code | 0x227C |
| Interface | 2x shielded RJ45 (integrated switch) |
| Transfer Rate | 10/100 Mbit/s, auto-negotiation |
| Cable Length | Max 100 m per segment |
| Default IP | 192.168.100.1 (switches set to 0xFF) |
| Default Port | 502 |
| Power Consumption | 2 W (bus) |
| I/O Cycle Time | 0.5 to 4 ms (configurable) |
| Response Time | <1 to 8 ms |
| Required Accessories | X20BB80 (bus base), X20PS9400 (power), X20TB12 (terminal block) |
Network Address Switches
Set via flat-head screwdriver on the module body. Changes apply after power cycle.
| Switch Position | Behavior |
|---|---|
| 0x00 | Factory default; uses flash memory parameters |
| 0x01–0x7F | Overwrites last octet of IP address from flash |
| 0x80–0xEF | DHCP mode; hostname = brmb + switch value (3 digits) |
| 0xF0 | Auto-store: DHCP/BOOTP values saved to flash |
| 0xFE | Initialize all params to defaults (no flash read) |
| 0xFF | Default IP 192.168.100.1, port 502; other params from flash |
LED Indicators
| LED | Color | Pattern | Meaning |
|---|---|---|---|
| S/E | Green | On | At least one client connection active |
| S/E | Green | 2 pulses | No client connections |
| S/E | Green | Blinking | I/O module initialization in progress |
| S/E | Green | 4 pulses | Duplicate IP address detected |
| S/E | Green | 5 pulses | Missing, defective, or wrong I/O module |
| S/E | Green | 6 pulses | Flash memory error (incomplete save) |
| S/E | Red | On | Major unrecoverable fault |
| L/A IFx | Green | On | Link established, no activity |
| L/A IFx | Green | Blinking | Ethernet activity on RJ45 port |
Register Layout (Configuration Space)
The X20BC0087 exposes configuration data in holding registers starting at address 0x1000:
| Address Range | Content | Length |
|---|---|---|
| 0x1003–0x100E | IP address, subnet, gateway | 4 words each |
| 0x1140 | Write 0xC1 to apply IP save | 1 word |
Process data (live I/O values) is mapped in the process image section. The exact layout depends on the I/O modules connected and the configuration loaded via the ModbusTCP Toolbox (see ModbusTCP Toolbox below).
ModbusTCP Toolbox
The ModbusTCP Toolbox is B&R’s free Windows application for configuring and diagnosing the X20BC0087. Download it from the B&R website (search “ModbusTCP Toolbox” in Downloads).
Connecting to the X20BC0087
- Connect a laptop Ethernet port directly to either RJ45 on the X20BC0087.
- Set your laptop IP to the same subnet (e.g.,
192.168.100.10/24for the default192.168.100.1). - Verify with
ping 192.168.100.1. - If the IP is unknown, set the network address switches to F/F (0xFF) and power cycle to force factory default IP.
Network Configuration via Toolbox
- Open ModbusTCP Toolbox → Tools > Configure Network Parameters.
- Enter the IP address and port (default: 192.168.100.1, 502).
- If the connection succeeds, the wizard shows MAC address and current network parameters.
- Modify IP, subnet, gateway as needed. Click Next.
- Choose whether to save to flash and reboot. Click Finish.
Error 12092 indicates a network connectivity issue — verify the IP and physical link.
Loading a New Configuration from Automation Studio
- Create an Automation Studio project with CPU type “ModbusCPU”.
- In the Physical View, add the X20BC0087 to the Modbus interface and add I/O modules to the X2X interface in the exact physical order they appear on the bus.
- Configure I/O module channels (enable/disable, filter settings, ranges) by right-clicking each module → Configuration.
- Build the project. When prompted to Transfer, select “Don’t Transfer”.
- Note the output path containing
ModbusConfig.xml(insideTemp\Objects\Config1\ModbusCPU\AsFDOutput\). - Open ModbusTCP Toolbox → File > Open → navigate to
ModbusConfig.xml. - Select the bus controller → Transfer Configuration.
Device Diagnostics
In the Toolbox, use Tools > Device Diagnostic → connect with IP/port. This displays:
- Register spaces (configuration and process image)
- Live data from all connected I/O modules
- Module status and identification
Watchdog Considerations
If the watchdog timer expires (controlled by Watchdog Mode and Threshold settings), write commands return error code 0x0004 (slave device failure). Reads continue to work regardless. Use the watchdog_reset() method or periodic write-refresh to keep the watchdog satisfied.
Software-Based Modbus on the CP1584 (AsMbTCP / AsMbRTU)
AsMbTCP Library Architecture
The AsMbTCP library is B&R’s standard Modbus TCP implementation, bundled with the Automation Net package in Automation Studio.
| Function Block | Role | Use Case |
|---|---|---|
FB_MbTcpMaster | TCP Client | Polling remote Modbus slaves |
FB_MbTcpSlave | TCP Server | Exposing a Modbus data map for external masters |
MbTCPSlave (data type) | Server Instance | Bound to ETH via ModbusTCP_any config |
ModuleOk flag | Diagnostic | TRUE = service running and accepting connections |
Configuration Procedure: Both Logical and Physical Views Required
This is the single most common failure mode — omitting the Physical View step causes ModuleOk to stay FALSE with no compile errors.
Step 1 — Logical View: Add the Library
- Open the CP1584 configuration in Automation Studio.
- In the Logical View, right-click Libraries → Add Library → select AsMbTCP from the Automation Net package.
- Confirm no yellow warning icons.
Step 2 — Physical View: Bind to an Ethernet Interface
- Open the Physical View of the same configuration.
- Double-click the ETH interface (e.g., IF2 on the CP1584).
- Set IP address, subnet mask, gateway.
- Click Add → ModbusTCP_any. This places a Modbus TCP server on the interface at port 502.
- Assign a unique name (e.g.,
MbSlave1). - Set Unit ID (255 for typical TCP-only, or 1–247 for RTU gateway routing).
Step 3 — Instantiate the Function Block
PROGRAM _CYCLIC
VAR
mbSlave : FB_MbTcpSlave;
modbusMap : ARRAY[0..99] OF WORD;
END_VAR
mbSlave.Enable := TRUE;
mbSlave.Interface := 'MbSlave1';
mbSlave.UnitId := 255;
mbSlave.HoldingReg := ADR(modbusMap);
mbSlave.HoldingCnt := SIZEOF(modbusMap) / 2;
mbSlave();
IF mbSlave.ModuleOk THEN
(* healthy — external masters can read/write modbusMap *)
ELSE
diagMsg := mbSlave.DiagString;
END_IF
END_PROGRAM
For a master, instantiate FB_MbTcpMaster with the remote slave IP, port 502, Unit ID, and a poll request structure.
Ethernet Interface Parameters
| Parameter | Typical Value | Notes |
|---|---|---|
| IP Address | 192.168.10.1 (master) | Must be unique on the subnet |
| Subnet Mask | 255.255.255.0 | Required for broadcast behavior |
| Default Gateway | 192.168.10.254 | Leave empty for isolated networks |
| Modbus Port | 502 | IANA-registered standard port |
| Unit ID | 1 or 255 | 255 = ignore for TCP-only |
| Connection Timeout | 5000 ms | Tune for WAN links |
| Max Connections | Application-dependent | Shared across master FB instances |
Master Configuration (Reading External Devices)
To configure the CP1584 as a Modbus TCP master reading external field devices:
- In the Physical View, open the ETH port Configuration.
- Under Modbus parameters, set Activate Modbus communication = on and Use as Modbus master = on.
- Add ModbusTcp_any devices to the ETH interface — each represents one remote slave.
- Configure each ModbusTcp_any:
- Mode: Internet address
- IP address: The slave’s IP
- Unit identifier: 255 (or matching the slave’s Unit ID)
- TCP port: 502 (or slave-specific)
- Number of pending requests: 1 (default)
- Configure Channel Configuration blocks matching the slave’s register map:
- Register type (Holding Register FC03, Input Register FC04, Coil FC01, Discrete Input FC02)
- Starting address
- Number of items (set to 0 for auto-calculation based on channel datatypes)
- Channel datatypes (USINT, UINT, UDINT, REAL, LREAL — note byte swap warnings for multi-byte types)
- Open I/O Mapping of each ModbusTcp_any → assign Process Variables to channels.
Limitation
Slave IP addresses configured in the Physical View cannot be changed at runtime. If dynamic IP discovery is required, use the community modbusTCP-Automation-Studio library (GitHub: br-automation-community/modbusTCP-Automation-Studio) which provides programmatic IP control.
Mapping B&R Variables to Modbus Registers
Dynamic Channel Mode
When configuring the CP1584 as a Modbus TCP slave in dynamic channel mode, the system sequentially maps variables to registers based on their position in the hardware tree. Add an I/O channel → it gets the next available register address automatically.
In this mode, a Holding Register is defined as an Input IO Channel — this means the data flows into the Modbus map from the application. Use AsMbTCPS (slave function block) WordPut() / WordGet() methods to programmatically read and write holding registers from your application code.
Fixed Memory Mode
Fixed mode creates a static memory space. You define the address range and manually copy data in/out using pointer arithmetic or the AsMbTCPS block methods. This gives explicit control over register placement but requires manual management.
Mapping Pattern for Common Data Types
| Data Type | Registers Occupied | Byte Order Consideration |
|---|---|---|
| USINT | 1 | None (fits in single register) |
| UINT | 1 | None |
| DINT | 2 | Swap register order for little-endian devices |
| UDINT | 2 | Swap register order; watch high/low word placement |
| REAL | 2 | Same as UDINT; IEEE 754 float split across two registers |
| LREAL | 4 | Four registers; verify endianness with remote device |
Practical Example: Exposing Machine Data via Modbus
PROGRAM _CYCLIC
VAR
mbSlave : FB_MbTcpSlave;
holdingRegs : ARRAY[0..49] OF WORD;
machineTemp : LREAL;
machineSpeed : DINT;
faultCode : UINT;
END_VAR
(* Map application variables into the holding register image *)
(* LREAL machineTemp at registers 0-3 (raw memory copy, 8 bytes) *)
MemCpy(ADR(holdingRegs[0]), ADR(machineTemp), 8);
(* DINT machineSpeed at registers 4-5 *)
(* B&R is big-endian: register 4 = high word, register 5 = low word *)
MemCpy(ADR(holdingRegs[4]), ADR(machineSpeed), 4);
(* UINT faultCode at register 6 (single register, no byte-order issue) *)
holdingRegs[6] := faultCode;
mbSlave.Enable := TRUE;
mbSlave.Interface := 'MbSlave1';
mbSlave.UnitId := 255;
mbSlave.HoldingReg := ADR(holdingRegs);
mbSlave.HoldingCnt := 50;
mbSlave();
END_PROGRAM
Note on endianness: B&R PLCs use big-endian word order for Modbus registers by default. A DINT (32-bit) occupies two consecutive registers, with the most significant word in the lower register number. The
MemCpyapproach above preserves the PLC’s native byte order — the remote device must be configured to expect big-endian (ABCD) word order. If connecting to a little-endian device, swap the two registers manually.
Cross-Reference to Memory Map
For the full CP1584 internal memory layout (global variables, persistent storage, retentive memory), see memory-map.md. When building a Modbus register map, cross-reference the memory map to avoid conflicts with system-reserved addresses.
Integrating Legacy Modbus Devices into the B&R System
Scenario: Adding a Modbus RTU Device to the CP1584
When a legacy sensor, drive, or instrument speaks only Modbus RTU over RS485, you need:
- An X20 serial interface module (X20IF1030 = RS232, X20IF1031 = RS422/485, X20IF1041 = RS422/485 isolated)
- The AsMbRTU library (separate from AsMbTCP)
RTU Configuration Steps
- Add the serial IF module to the X2X bus in the Physical View.
- Configure the serial port: baud rate, parity, stop bits, character timeout to match the legacy device.
- In the Logical View, add the AsMbRTU library from the Automation Net package.
- Instantiate
FB_MbRtuMasterin your cyclic task. - Configure the Modbus RTU request structure (slave address, function code, register address, count).
- Read responses into Process Variables via I/O mapping or directly from the FB’s output data.
Scenario: RTU-to-TCP Gateway (B&R PLC as Protocol Bridge)
A powerful pattern for undocumented machines: the B&R PLC acts simultaneously as Modbus RTU master (talking to legacy serial devices) and Modbus TCP server (exposing that data to modern SCADA/IIoT systems).
- Configure ETH port as Modbus TCP server (ModbusTCP_any).
- Configure serial IF as Modbus RTU master (AsMbRTU).
- In application code, poll RTU devices cyclically.
- Copy received data into the TCP server’s holding register image.
- External systems connect to the CP1584 via Modbus TCP on port 502.
This eliminates the need for a separate hardware gateway (e.g., Moxa MB3180, Anybus AB7702). The CP1584 IS the gateway.
Cross-Reference to Network Architecture
For detailed network topology patterns including VLAN segmentation and firewall placement for Modbus networks, see network-architecture.md.
Extracting Data via Modbus When OPC-UA Is Not Available
When to Use Modbus Instead of OPC-UA
| Condition | Recommended Protocol |
|---|---|
| OPC-UA server already configured | OPC-UA (preferred) |
| No OPC-UA license, no AS project | Modbus TCP |
| Third-party SCADA requires Modbus | Modbus TCP |
| Quick data grab without B&R tools | Modbus TCP + Python |
| Legacy device only supports RTU | Modbus RTU |
| Network isolation / no OPC-UA port | Modbus TCP |
Approach 1: X20BC0087 Standalone Gateway
If the CP1584 has X20 I/O on its X2X bus, an X20BC0087 can be inserted (or may already be present). Any Modbus TCP master can then read the I/O process image directly — no B&R application code changes required.
- Verify X20BC0087 presence in the X2X bus (green LED activity).
- Set IP via network address switches or ModbusTCP Toolbox.
- Use any Modbus TCP client (Modbus Poll, Python
pymodbus, Node-RED) to connect. - Read input registers for analog inputs, coils for digital inputs.
Approach 2: AsMbTCP Slave on the CP1584
If you have the Automation Studio project (or can upload from the running CPU):
- Add the AsMbTCP library and ModbusTCP_any binding.
- Expose key variables as holding registers.
- Connect external systems to the CP1584 IP on port 502.
Approach 3: AsMbTCP Master from External System
If you only know the CP1584 IP and have no AS project access:
- If the CPU was configured as a Modbus TCP slave by the OEM, attempt connection with a generic Modbus TCP client on port 502.
- Scan holding register address ranges (0–100, 100–500, 1000+) to discover live data.
- Use
pymodbusfor automated scanning:
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient('192.168.1.10', port=502)
client.connect()
# Scan holding registers
for start in range(0, 2000, 100):
result = client.read_holding_registers(start, count=100)
if not result.isError():
vals = [v for v in result.registers if v != 0]
if vals:
print(f"Holding registers {start}-{start+99}: {result.registers}")
client.close()
Cross-Reference to OPC-UA
For the full OPC-UA server configuration on the CP1584, including certificate management and namespace setup, see opcua.md. Modbus is the fallback when OPC-UA is not licensed or not configured.
Cross-Reference to PVI API
For programmatic data access from a PC using the B&R PVI (Process Visualization Interface) library — which does not require Modbus — see pvi-api.md. PVI provides direct access to B&R process variables via a proprietary protocol and may be available even when Modbus is not configured.
Diagnostic Verification
Four-Layer Check
Always verify connectivity in this order:
- PHY layer:
LinkActivemust be TRUE on both endpoints. Check LED link lights. - IP layer: Ping the peer from Automation Studio (Online → Diagnostic Tools) or command line.
- Modbus layer:
ModuleOkon the FB must be TRUE. Verify outbound/inbound byte counters incrementing. - Application layer: Write a known test value (e.g., holding register 0 = 0xAA55) and read it back.
Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
ModuleOk stays FALSE, ping OK | ModbusTCP_any not added in Physical View | Add ModbusTCP_any to ETH port; re-download |
| No traffic on Wireshark | IP misconfigured or VLAN tagged | Verify IP settings, switch VLAN compatibility |
| Master connection timeout | Slave firewall blocks TCP/502 | Open port 502 inbound on slave / fix VLAN |
| Holding registers return swapped bytes | Endian mismatch with remote device | Apply byte-swap or explicit converter |
ModuleOk toggles after restart | IP conflict on subnet | Free conflicting address or change local IP |
| “Unit ID not supported” error | Remote gateway requires specific Unit ID | Set master’s UnitId to match the gateway |
| Multiple masters cannot connect | Connection pool exhausted | Increase Max Connections or rate-limit polls |
| Watchdog timeout (error 0x0004) | Write commands fail; reads work | Reset watchdog periodically; check Watchdog Mode/Threshold |
| Error 12092 in ModbusTCP Toolbox | Cannot reach X20BC0087 | Check physical link, IP address, switch settings |
Logger and Communication Diagnostics
In Automation Studio, check the Logger (specifically the “Communication” module) for error messages. Use Online → Diagnostic Tools for real-time ETH port status (LinkActive, Speed, Duplex).
Community Libraries and Tools
GitHub: br-automation-community/modbusBR-Python
A Python class for interacting with the X20BC0087 bus controller. Provides:
Connect(ip, port)/Disconnect()ReadDigitalInputs(module_nr, size, offset)→ list of boolsWriteDigitalOutputs(module_nr, values, offset)→ boolReadAnalogInputs(module_nr, size, offset)→ list of intsWriteAnalogOutputs(module_nr, values, offset)→ boolMasterMDinfo()— enumerate connected X20 hardware modulesMasterBRBCinfo— bus controller info (IP, MAC, firmware, watchdog, process data counts)ctrl_save(),ctrl_load(),ctrl_reboot(),ctrl_erase(),ctrl_reset_cfg()
Repository: https://github.com/br-automation-community/modbusBR-Python
This is the fastest way to script data extraction from an X20BC0087 without Automation Studio.
GitHub: br-automation-community/modbusTCP-Automation-Studio
A community Modbus TCP library for Automation Studio supporting legacy runtimes that don’t support native Modbus TCP. Supports both master and slave modes. Version 3.0 targets AS6.x.
Key advantage over built-in AsMbTCP: runtime-configurable IP addresses — slave IPs can be changed programmatically at runtime.
Repository: https://github.com/br-automation-community/modbusTCP-Automation-Studio
Other Useful Tools
| Tool | Purpose | Platform |
|---|---|---|
| ModbusTCP Toolbox | Configure/diagnose X20BC0087 | Windows |
| Modbus Poll | Generic Modbus master test client | Windows |
| pymodbus | Python Modbus TCP/RTU client library | Cross-platform |
| CDP Studio | Third-party IDE with native X20BC0087 support | Windows/Linux |
| Node-RED | Flow-based Modbus integration | Cross-platform |
| Wireshark | Protocol analysis on TCP/502 | Cross-platform |
Security Considerations
Modbus TCP has no native authentication or encryption. For industrial environments:
- Isolate Modbus TCP on a dedicated VLAN or back-to-back IP segment
- Disable Modbus on ETH ports not in use; remove unused
ModbusTCP_anybindings - Front the network with a stateful firewall; allow only known peer IPs on TCP/502
- For new deployments, prefer OPC-UA with certificate-based security (see opcua.md)
- Consider tunneling Modbus TCP inside a VPN for remote access scenarios
- Follow IEC 62443 network zoning rules for critical infrastructure
Performance and Timing
| Parameter | Typical Value |
|---|---|
| TCP round-trip | 2–8 ms (100 Mbit/s, same subnet) |
| I/O cycle (X20BC0087) | 0.5–4 ms configurable |
| Max holding registers | 65536 (0-based addressing) |
| Max registers per read | 125 words (FC03/FC04 spec limit) |
| Recommended task cycle | 5 ms (small maps) to 20 ms (large maps) |
| Watchdog timeout | Configurable via ModbusTCP Toolbox |
Verification Checklist
- AsMbTCP library added in Logical View for the target CPU
-
ModbusTCP_anyelement added in Physical View of the same CPU - ETH interface IP / mask / gateway configured and saved
- FB instance declared in cyclic program with
Enable = TRUE -
ModuleOk = TRUEobserved within 2 s of download - Wireshark shows TCP/502 PDUs in both directions
- End-to-end read/write test passes (write holding register, read back)
- Disconnect test: unplug cable →
ModuleOk = FALSEwithin timeout - Byte ordering verified for multi-register data types (UDINT, REAL, LREAL)
- Watchdog configuration checked (if writing to X20BC0087)
Modbus Exception Codes: Complete Reference
Understanding exception codes is critical when scanning unknown devices or debugging communication failures. Every Modbus slave returns an exception response (function code + 0x80, followed by a single-byte exception code) when it cannot fulfill a request.
Exception Response Format
TCP Response: [MBAP Header 7 bytes] [FC + 0x80] [Exception Code]
Example: 00 01 00 00 00 03 01 83 02
← MBAP Header → FC ExcCode
(Exception: FC03 + 0x80 = 0x83, Code 02 = Illegal Data Address)
All Standard Exception Codes
| Code (Hex/Dec) | Name | When It Happens on a B&R System |
|---|---|---|
| 0x01 / 1 | Illegal Function | The register type (FC03 holding, FC04 input) does not match what the slave exposes |
| 0x02 / 2 | Illegal Data Address | Register address out of range – most common when scanning unknown devices |
| 0x03 / 3 | Illegal Data Value | Quantity exceeds FC limits (FC03/04 max=125, FC16 max=123) or quantity=0 |
| 0x04 / 4 | Slave Device Failure | Internal error – on X20BC0087, this is the watchdog timeout error code |
| 0x05 / 5 | Acknowledge | Long operation in progress (rare in normal polling) |
| 0x06 / 6 | Slave Device Busy | Slave processing another request |
| 0x08 / 8 | Memory Parity Error | Only with FC20/21 file record functions (not typical) |
| 0x0A / 10 | Gateway Path Unavailable | RTU-to-TCP gateway has no route to target Unit ID |
| 0x0B / 11 | Gateway Target No Response | Gateway forwarded but target slave did not answer |
Codes 07 and 09 are not assigned in the Modbus specification.
B&R-Specific Exception Behavior
- X20BC0087 Watchdog Timeout: Write commands return exception code 0x04 (Slave Device Failure) when the watchdog expires. Read commands continue to work regardless of watchdog state. Reset the watchdog periodically or adjust the watchdog threshold in the ModbusTCP Toolbox.
- AsMbTCP Slave Bounds: If the master requests registers beyond the configured
HoldingCntsize, the CP1584 returns exception 0x02. - AsMbTCP Dual Role: One ETH port can host both master and slave simultaneously by adding two
ModbusTCP_anyelements with distinct names.
Detecting Exception Responses in Wireshark
| Filter | Purpose |
|---|---|
modbus.func_code >= 128 | Show all exception responses |
modbus.exception_code == 2 | Show only Illegal Data Address |
modbus.exception_code == 4 | Show only Slave Device Failure |
modbus && tcp.port == 502 | All Modbus TCP traffic |
Exception Code vs. Communication Failure
| Condition | What Happens | Master Sees |
|---|---|---|
| Exception response | Slave heard the request but cannot fulfill it | Response frame with FC + 0x80 + error code |
| Communication error | Request lost, slave offline, or CRC error | Timeout after configured period |
An exception means the slave heard the request. A timeout means it did not. These require different troubleshooting approaches.
Wireshark Deep-Dive for Modbus TCP on B&R Systems
Capture Setup
Modbus TCP runs on TCP port 502. Modern managed switches forward unicast traffic only to the destination port, so a laptop connected to a mirror port or a cheap unmanaged hub is required for visibility.
# Capture filter on the mirror port
tcpdump -i eth0 -w modbus_capture.pcap port 502
# Or in Wireshark capture options: "tcp port 502"
Wireshark Display Filters
# All Modbus TCP traffic
modbus
# Only requests (master → slave)
modbus.func_code <= 16
# Only responses (slave → master)
modbus.func_code > 16 && modbus.func_code < 128
# Only exception responses
modbus.func_code >= 128
# Traffic to/from specific B&R device
modbus && ip.addr == 192.168.10.1
# Timing analysis: show round-trip times
modbus && tcp.time_delta > 0.05
# Identify connection problems
tcp.analysis.flags
MBAP Header Structure
Every Modbus TCP frame starts with the MBAP header (7 bytes):
| Field | Bytes | Description |
|---|---|---|
| Transaction ID | 2 | Matches request/response pairs (incremented by master) |
| Protocol ID | 2 | Always 0x0000 for Modbus |
| Length | 2 | Number of following bytes (Unit ID + PDU) |
| Unit ID | 1 | Slave address (1-247 for RTU gateways, 255 for TCP-only) |
Diagnostic Patterns in Packet Captures
| Pattern | Meaning | Likely Cause |
|---|---|---|
| Duplicate Transaction IDs | Master retransmitting | Slave not responding; timeout too short |
| TCP retransmissions at L2 | Network congestion or duplex mismatch | Check switch settings; verify cable |
| Response delay > 100 ms | Slave processing slowly | Task cycle too long; CPU overloaded |
| Exception 0x02 in every response | Register map mismatch | Wrong addressing convention (0-based vs 1-based) |
| RST packets after idle period | Connection timeout | Firewall or NAT killing idle connections |
| TCP zero-window | Slave buffer full | Master polling too fast; increase poll interval |
Port Mirroring Configuration
When the B&R PLC and Modbus devices are connected through a managed switch (typical), configure SPAN/mirroring:
# Cisco-like managed switch example
monitor session 1 source interface gi1/0/1 (B&R PLC port)
monitor session 1 dest interface gi1/0/10 (laptop port)
# Alternatively: use a cheap 5-port unmanaged hub (not switch)
# between the PLC and the first Modbus device for guaranteed visibility
Advanced Python Scripting for B&R Modbus Data Extraction
Automated Register Map Discovery
When connecting to an unknown CP1584 that may have Modbus TCP enabled, use this script to discover the active register map:
#!/usr/bin/env python3
"""B&R Modbus TCP register map discovery tool.
Scans a Modbus TCP slave for active holding registers and input registers.
"""
import time
from pymodbus.client import ModbusTcpClient
def discover_registers(ip, port=502, unit_id=255, max_addr=2000, batch_size=100):
client = ModbusTcpClient(ip, port=port, timeout=3)
if not client.connect():
print(f"Cannot connect to {ip}:{port}")
return {}
active_ranges = {}
for start in range(0, max_addr, batch_size):
for fc_name, fc in [("holding_registers", 3), ("input_registers", 4)]:
try:
if fc == 3:
result = client.read_holding_registers(start, count=batch_size,
slave=unit_id)
else:
result = client.read_input_registers(start, count=batch_size,
slave=unit_id)
if not result.isError():
non_zero = [i for i, v in enumerate(result.registers) if v != 0]
if non_zero:
key = f"{fc_name}[{start}-{start + batch_size - 1}]"
active_ranges[key] = result.registers
print(f" FOUND {key}: {len(non_zero)} non-zero registers")
elif result.isError():
exc_code = getattr(result, 'exception_code', None)
if exc_code == 2:
break # past end of register map
elif exc_code == 4:
print(f" ERROR {fc_name}[{start}]: Slave Device Failure (0x04)")
break
except Exception as e:
print(f" Error at {fc_name}[{start}]: {e}")
time.sleep(0.05)
client.close()
return active_ranges
if __name__ == "__main__":
import sys
ip = sys.argv[1] if len(sys.argv) > 1 else "192.168.10.1"
print(f"Scanning {ip}:502 for Modbus TCP registers...")
results = discover_registers(ip)
print(f"\nFound {len(results)} active register ranges")
Continuous Data Logger with Timestamps
#!/usr/bin/env python3
"""B&R Modbus TCP continuous data logger.
Polls specified registers at a fixed interval and logs to CSV.
Cross-references [time-sync.md](time-sync.md) for timestamp accuracy.
"""
import csv
import time
from datetime import datetime, timezone
from pymodbus.client import ModbusTcpClient
REGISTERS = {
"machine_temp": (0, 4, "LREAL"),
"machine_speed": (4, 2, "DINT"),
"fault_code": (6, 1, "UINT"),
"run_status": (7, 1, "UINT"),
}
def read_registers(client, addr, count, unit_id=255):
result = client.read_holding_registers(addr, count, slave=unit_id)
if result.isError():
return None
return result.registers
def decode_lreal(words):
if len(words) < 4:
return None
import struct
bytes_data = struct.pack('>HH', words[0], words[1]) + \
struct.pack('>HH', words[2], words[3])
return struct.unpack('>d', bytes_data)[0]
def decode_dint(words):
if len(words) < 2:
return None
val = (words[0] << 16) | words[1]
if val >= 0x80000000:
val -= 0x100000000
return val
def main(ip, output_file, poll_interval=1.0):
client = ModbusTcpClient(ip, port=502, timeout=3)
if not client.connect():
print(f"Cannot connect to {ip}")
return
print(f"Connected to {ip}. Logging every {poll_interval}s to {output_file}")
print("Press Ctrl+C to stop.")
with open(output_file, 'w', newline='') as f:
writer = csv.writer(f)
headers = ["timestamp_iso", "timestamp_epoch"] + list(REGISTERS.keys())
writer.writerow(headers)
try:
while True:
ts = datetime.now(timezone.utc)
row = [ts.isoformat(), ts.timestamp()]
for name, (addr, count, dtype) in REGISTERS.items():
words = read_registers(client, addr, count)
if words is None:
row.append("ERROR")
elif dtype == "LREAL":
row.append(f"{decode_lreal(words):.2f}")
elif dtype == "DINT":
row.append(decode_dint(words))
else:
row.append(words[0])
writer.writerow(row)
f.flush()
print(f" {ts.isoformat()} | {' | '.join(str(v) for v in row[2:])}")
time.sleep(poll_interval)
except KeyboardInterrupt:
print("\nLogging stopped.")
finally:
client.close()
if __name__ == "__main__":
import sys
ip = sys.argv[1] if len(sys.argv) > 1 else "192.168.10.1"
main(ip, "modbus_log.csv")
Using the modbusBR-Python Community Library
The modbusBR-Python library (GitHub: br-automation-community/modbusBR-Python) is purpose-built for the X20BC0087 and provides direct methods for I/O module enumeration and data access without needing to know register addresses:
from modbusBR import ModbusBR
br = ModbusBR()
br.Connect("192.168.100.1", 502)
# Enumerate all connected X20 modules
info = br.MasterMDinfo()
for module in info:
print(f"Module: {module}")
# Read analog inputs from first I/O module
ai_values = br.ReadAnalogInputs(module_nr=0, size=8, offset=0)
print(f"Analog inputs: {ai_values}")
# Read digital inputs
di_values = br.ReadDigitalInputs(module_nr=0, size=16, offset=0)
print(f"Digital inputs: {di_values}")
# Write digital outputs
br.WriteDigitalOutputs(module_nr=0, values=[True, False, True], offset=0)
# Get bus controller info
bc_info = br.MasterBRBCinfo()
print(f"IP: {bc_info.ip}, MAC: {bc_info.mac}")
print(f"Firmware: {bc_info.firmware_version}")
print(f"Process data in: {bc_info.process_data_in_count}")
print(f"Process data out: {bc_info.process_data_out_count}")
br.Disconnect()
Modbus RTU Deep-Dive: AsMbRTU on the CP1584
Serial Interface Modules
| Module | Interface | Isolation | Use Case |
|---|---|---|---|
| X20IF1030 | RS232 | Non-isolated | Point-to-point, short distances, legacy devices |
| X20IF1031 | RS422/485 | Non-isolated | Multi-drop RS485 networks, longer distances |
| X20IF1041 | RS422/485 | Galvanically isolated | Electrically noisy environments, long cable runs |
AsMbRTU Function Blocks
| Function Block | Role | Key Parameters |
|---|---|---|
FB_MbRtuMaster | RTU Master (poller) | Interface, BaudRate, SlaveAddr, FC, RegAddr, RegCnt |
FB_MbRtuSlave | RTU Slave | Interface, BaudRate, CoilRef, InputRef, HoldingRef, InputRegRef |
RTU Master Configuration Example
PROGRAM _CYCLIC
VAR
rtuMaster : FB_MbRtuMaster;
request : MbRtuRequest;
response : MbRtuResponse;
slaveData : ARRAY[0..49] OF WORD;
errorCount: UDINT;
END_VAR
(* Configure the RTU request *)
request.SlaveAddr := 1;
request.FunctionCode:= 3; (* Read Holding Registers *)
request.DataAddr := 0;
request.DataCnt := 50;
request.Timeout := T#500MS;
rtuMaster(
Enable := TRUE,
Interface := 'IF1.Serial1',
BaudRate := 9600,
Parity := 0, (* 0=None, 1=Odd, 2=Even *)
StopBits := 1,
Request := request,
Response := response
);
IF rtuMaster.ModuleOk THEN
IF NOT rtuMaster.Busy AND rtuMaster.Done THEN
IF rtuMaster.Error THEN
errorCount := errorCount + 1;
ELSE
MemCpy(ADR(slaveData), ADR(response.Data), SIZEOF(slaveData));
END_IF
END_IF
END_IF
END_PROGRAM
Multi-Drop RTU Wiring
For RS485 multi-drop networks with multiple slave devices:
120 Ohm 120 Ohm
CP1584 ── IF1031 ────┤├──── Slave 1 ──────┤├──── Slave 2 ──── (open)
(Terminated) (not terminated) (terminated)
- Terminate only the first and last devices on the bus with 120 ohm resistors
- Maximum 32 devices per RS485 segment (standard)
- Max cable length: 1200 m at 9600 baud, decreasing with higher baud rates
- Use twisted pair cable (Cat5e shielded works well)
- Bias resistors (if required): 1 kohm pull-up to V+ and pull-down to GND at the master
RTU Timing Parameters
| Parameter | Recommended Value | Notes |
|---|---|---|
| Character timeout | 1.5 × character time at current baud | 3.5 character times per Modbus spec |
| Inter-frame delay | Silent interval ≥ 3.5 character times | Modbus RTU frame delimiter |
| Response timeout | 100-500 ms | Depends on slave processing time |
| Poll interval | 2 × max response time minimum | Avoid flooding slow slaves |
RTU vs. TCP Decision Matrix
| Factor | Modbus RTU | Modbus TCP |
|---|---|---|
| Physical layer | RS232/RS422/485 | Ethernet |
| Speed | 9600-115200 baud | 10/100/1000 Mbit/s |
| Distance | Up to 1200 m | 100 m per segment |
| Devices per segment | Up to 32 (RS485) | Unlimited (IP addressing) |
| Noise immunity | Good (differential signaling on RS485) | Excellent (Ethernet PHY) |
| Additional hardware | Serial IF module needed | No extra hardware |
| Diagnostics | Limited (no ACK from protocol itself) | TCP ACK, Wireshark visibility |
| Best for | Legacy field devices, long cable runs | New installations, high speed, IIoT |
Modbus-to-MQTT Bridge with Node-RED
For IIoT retrofits, bridging Modbus data to MQTT enables cloud connectivity and modern dashboards. See iiot-retrofit.md for the full IIoT architecture guide.
Node-RED Flow for B&R Modbus TCP to MQTT
[Modbus TCP Read] → [Function: Decode] → [MQTT Out]
↓ ↑
Poll every 1s topic: machine/br/{var}
Sample Node-RED Configuration
[
{
"id": "modbus_poll",
"type": "modbus-flex-getter",
"server": "br_modbus_tcp",
"fc": 3,
"address": 0,
"quantity": 10
},
{
"id": "decode_and_publish",
"type": "function",
"func": "var words = msg.payload;\nmsg.topic = 'machine/br/registers';\nmsg.payload = words.map(function(w) { return w; });\nreturn msg;"
},
{
"id": "mqtt_out",
"type": "mqtt out",
"broker": "mqtt_broker",
"topic": "machine/br/registers"
}
]
Performance Considerations for Bridges
| Parameter | Recommended Setting |
|---|---|
| Poll interval | ≥ task cycle time of the B&R Modbus FB |
| MQTT QoS | 0 for telemetry, 1 for alarms |
| Batch size | Keep ≤ 125 registers per Modbus read (FC03 limit) |
| Payload format | JSON array or individual MQTT messages per register |
| TLS/SSL | Enable on MQTT if crossing network boundaries |
Dual Master/Slave Configuration on a Single Port
One CP1584 ETH port can simultaneously be a Modbus TCP master (polling external devices) and a server (exposing data to SCADA). This is powerful for undocumented machines where the PLC bridges legacy field devices to modern monitoring.
Configuration Steps
- In the Physical View, add two
ModbusTCP_anyelements to the same ETH interface with distinct names (e.g.,MbSlave1andMbMaster1). - In the program, instantiate both
FB_MbTcpSlaveandFB_MbTcpMaster:
PROGRAM _CYCLIC
VAR
mbSlave : FB_MbTcpSlave;
mbMaster : FB_MbTcpMaster;
holdingRegs : ARRAY[0..99] OF WORD;
masterResp : MbTcpResponse;
masterReq : MbTcpRequest;
END_VAR
(* Slave: expose holding registers to SCADA *)
mbSlave.Enable := TRUE;
mbSlave.Interface := 'MbSlave1';
mbSlave.UnitId := 255;
mbSlave.HoldingReg := ADR(holdingRegs);
mbSlave.HoldingCnt := 100;
mbSlave();
(* Master: poll an external device and copy into holding registers *)
masterReq.IP := '192.168.10.50';
masterReq.Port := 502;
masterReq.UnitId := 1;
masterReq.FC := 3;
masterReq.Addr := 0;
masterReq.Cnt := 20;
masterReq.Timeout := T#2000MS;
mbMaster(
Enable := TRUE,
Interface := 'MbMaster1',
Request := masterReq,
Response := masterResp
);
IF mbMaster.Done AND NOT mbMaster.Error THEN
(* Copy polled data into holding register area for SCADA access *)
MemCpy(ADR(holdingRegs[20]), ADR(masterResp.Data), SIZEOF(masterResp.Data));
END_IF
END_PROGRAM
Modbus Gateway for Spare Parts Replacement
When a legacy third-party device that communicated via Modbus fails and must be replaced:
Register Map Reconstruction from Packet Capture
- Capture Modbus traffic with Wireshark before the device fails (if possible)
- Export the capture as CSV:
File → Export Packet Dissections → As CSV - Parse to build a register map:
import csv
def build_register_map(csv_file):
registers = {}
with open(csv_file, 'r') as f:
reader = csv.DictReader(f)
for row in reader:
if 'Modbus' in row.get('Protocol', ''):
func_code = int(row.get('Function Code', '0'), 0)
address = int(row.get('Reference Number', '0'), 0)
quantity = int(row.get('Quantity', '0'), 0)
key = f"FC{func_code:02d}"
if key not in registers:
registers[key] = set()
for i in range(quantity):
registers[key].add(address + i)
return registers
- Cross-reference the register map with the replacement device’s documentation
- If the replacement device uses different addressing, create a mapping table in the CP1584 program
See Also
- spare-parts.md — Identifying replacement hardware and compatible modules
- documentation-reconstruction.md — Systematically documenting undocumented systems
- project-reconstruction.md — Rebuilding an AS project from a running PLC
Key Findings
-
Two-step configuration trap: The most common failure on B&R Modbus is adding the AsMbTCP library in the Logical View but forgetting to add
ModbusTCP_anyin the Physical View. The program compiles cleanly, butModuleOknever goes TRUE. Both registrations are mandatory. -
X20BC0087 is self-contained: It does not need a B&R CPU. Any Modbus TCP master (SCADA, Python script, HMI) can read/write its I/O process image. This makes it the ideal gateway for undocumented machines — if one is on the X2X bus, you may not need to touch the PLC at all.
-
Default IP is 192.168.100.1: Set network address switches to FF and power cycle to recover the factory default. The MAC address is printed on the housing and also serves as the NetBIOS name (
br+ MAC). -
ModbusTCP Toolbox is free and essential: Download from B&R (current version V1.5.0). It configures IP, loads XML configurations from Automation Studio, and provides live diagnostic access to the process image and module configuration.
-
Watchdog blocks writes on timeout: The X20BC0087 watchdog does not affect reads, but expired watchdog causes all write FCs to return error 0x0004. Periodic watchdog resets are required if you need to write to I/O.
-
Community Python library exists: The
modbusBR-Pythonlibrary on GitHub provides a complete interface to the X20BC0087 including module enumeration, analog/digital I/O read/write, and configuration management. -
Runtime IP change limitation: The built-in Modbus master configuration uses static IPs from the Physical View and cannot change them at runtime. The community
modbusTCP-Automation-Studiolibrary bypasses this limitation for dynamic IP scenarios. -
Byte order is the silent killer: B&R is little-endian internally; Modbus is big-endian. Always verify byte ordering with a known value when reading/writing multi-register types. This is the second most common field issue after the Physical View omission.
-
Modbus is the OPC-UA fallback: When OPC-UA is not available or not licensed on the CP1584, Modbus TCP over the built-in Ethernet port is the most practical data extraction method.
-
Exception 0x02 is your friend when scanning: When probing an unknown register map, exception code 02 (Illegal Data Address) tells you the slave heard the request but the address is out of range — use this to binary-search for the boundaries of the register map. Exception 0x04 (Slave Device Failure) on the X20BC0087 specifically indicates watchdog expiration on writes.
-
Dual master/slave on one port: The CP1584 can simultaneously be a Modbus TCP master (polling legacy devices) and server (exposing data to SCADA) on the same ETH interface by adding two
ModbusTCP_anyelements. This makes the PLC itself a protocol bridge. -
Wireshark visibility requires port mirroring: Modern managed switches do not forward unicast traffic to other ports. Use a managed switch SPAN/mirror port or insert a cheap unmanaged hub to capture Modbus TCP traffic between PLC and slaves.
-
RTU termination rules: Only terminate the first and last devices on an RS485 multi-drop network with 120 ohm resistors. The master (CP1584) should be terminated if it is at one end of the bus.
-
Modbus-to-MQTT bridge is trivial with Node-RED: A few nodes connect Modbus TCP polling to MQTT publishing, enabling cloud dashboards for machines never designed for remote monitoring. See iiot-retrofit.md.
Sources
- B&R Automation Studio AsMbTCP / AsMbRTU Library Online Help
- B&R X20BC0087 Bus Controller Data Sheet and ModbusTCP Toolbox documentation
- Modbus Protocol Specification (Modbus.org) — function codes, register types, and exception codes
- B&R Community Forum (community.br-automation.com) — Modbus TCP configuration and troubleshooting discussions
- GitHub: community Modbus libraries for B&R (modbusBR-Python, modbusTCP-Automation-Studio)
- Industrial Monitor Direct: Configuring AsMbTCP Library for Modbus TCP on B&R PLC/IPC (July 2026)
- SCADA Protocols: Modbus Exception Codes Explained (April 2026)
- FlowFuse: How to Bridge Modbus to MQTT with Node-RED (December 2024)
Related Documents
- opcua.md — OPC-UA as an alternative (and preferred) data extraction method
- config-file-formats.md — Configuration file formats for Modbus library settings
- network-architecture.md — Network topology and device enumeration
- python-diagnostics.md — Python scripts for Modbus data extraction
- iiot-retrofit.md — MQTT bridges and IIoT integration from Modbus data
- plc-to-plc.md — PLC-to-PLC communication alternatives to Modbus
- serial-diagnostics.md — Serial port sniffing and diagnostics for RTU wiring
- spare-parts.md — Replacement hardware identification for Modbus devices
- documentation-reconstruction.md — Documenting undocumented Modbus register maps
- project-reconstruction.md — Building a new AS project from a running PLC
- time-sync.md — Timestamp accuracy for Modbus data logging
- memory-map.md — CP1584 memory layout for Modbus register placement
Battery-Backed SRAM and Retentive Data on the B&R CP1584
Scope: X20CP1584, Automation Runtime (AR), IEC 61131-3 on B&R, retentive/permanent variable semantics, battery maintenance, and data recovery.
Audience: Automation engineers maintaining B&R X20 PLCs on machines from defunct OEMs with zero documentation.
Last updated: July 2026
Table of Contents
- Overview
- Memory Hierarchy Relevant to Retentive Data
- What the Battery Actually Backs Up
- Battery Hardware on the X20CP1584
- VAR RETAIN vs VAR PERSISTENT: Critical Semantics
- Cold Start vs Warm Start vs INIT: What Survives
- Battery Status Monitoring
- Battery Replacement Procedure (Without Data Loss)
- Backing Up Retentive Data
- Restoring Retentive Data
- Recovery After Battery Death and Total Data Loss
- Function Block RETAIN Memory Trap
- Identifying All Retentive Variables in an Unknown Project
- Best Practices for Long-Term Maintenance
- Key Findings
- Sources
- Cross-References
1. Overview
The X20CP1584 uses a lithium backup battery to maintain the contents of 1 MB of SRAM when main power is removed. This SRAM holds retentive (remanent) variables, the real-time clock, and working data buffers. If the battery dies or is removed for too long, every value in SRAM is lost irreversibly.
B&R Automation Runtime provides two distinct mechanisms for data survival across restarts: VAR RETAIN (battery-backed SRAM) and VAR PERSISTENT (stored on CompactFlash). Understanding the difference is critical because each behaves differently during cold starts, program transfers, and battery failures.
See also: memory-map.md for the full CPU memory layout, cf-card-boot.md for CF card partition structure, ar-rtos.md for AR internals and boot states.
2. Memory Hierarchy Relevant to Retentive Data
+----------------------------------------------------------+
| CompactFlash (removable) |
| +------------------------------------------------------+ |
| | User Flash / User ROM | | Application code, configuration
| | (Non-volatile) | |
| +------------------------------------------------------+ |
| | Cpu.per / persistent data area | | VAR PERSISTENT values live here
| | (File-based, non-volatile) | | Survives everything except CF loss
| +------------------------------------------------------+ |
| +------------------------------------------------------+ |
| | Automation Runtime / OS files | |
| | (Non-volatile) | |
| +------------------------------------------------------+ |
+----------------------------------------------------------+
+----------------------------------------------------------+
| SRAM — 1 MB (User RAM) [BATTERY-BACKED] |
| +------------------------------------------------------+ |
| | Retentive variables (VAR RETAIN) | | Max 256 KB on CP1584
| | (Remanent data area) | |
| +------------------------------------------------------+ |
| | User RAM buffers, working data | |
| +------------------------------------------------------+ |
| | Real-time clock data | |
| +------------------------------------------------------+ |
+----------------------------------------------------------+
+----------------------------------------------------------+
| DDR2 SDRAM — 256 MB (System RAM) [NOT battery-backed] |
| OS, task memory, heap, I/O image |
+----------------------------------------------------------+
+----------------------------------------------------------+
| System Flash (internal) [NOT battery-backed] |
| Boot loader, AR kernel, hardware drivers |
+----------------------------------------------------------+
Key distinction: Only the SRAM layer is battery-backed. Everything in DDR SDRAM is volatile and is discarded on every restart. See memory-map.md Section 13 for the full CP1584 memory layout with address ranges.
3. What the Battery Actually Backs Up
The lithium backup battery maintains the following areas during power loss:
| Area | Size | Description |
|---|---|---|
| Retentive variables (VAR RETAIN) | Max 256 KB | All variables declared with VAR RETAIN |
| User RAM (SRAM) | 1 MB total | Working data buffers |
| System RAM | — | Runtime system buffers |
| Real-time clock | — | Time-of-day (non-volatile on CP1584, but battery prevents drift during power loss) |
The battery voltage is monitored cyclically by Automation Runtime. A load test is performed that does not significantly shorten battery life but provides early warning of weakened capacity. See Section 7.
What Is NOT Battery-Backed
- DDR2 SDRAM (256 MB) — all task memory, I/O images, non-retained variables
- CompactFlash contents — application code, persistent variable files, configuration
- System Flash — bootloader and AR firmware
4. Battery Hardware on the X20CP1584
4.1 Battery Specifications
| Property | Value |
|---|---|
| Type | Lithium button cell |
| Voltage | 3 V |
| Capacity | 950 mAh |
| Part number (single) | 4A0006.00-000 |
| Part number (4-pack) | 0AC201.91 |
| Recommended replacement interval | Every 4 years |
| Minimum service life | 2 years at 23 degrees C ambient |
| Storage temperature | -20 to +60 degrees C |
| Max storage time | 3 years at 30 degrees C |
| Humidity tolerance | 0 to 95% (non-condensing) |
4.2 Battery Location
The lithium battery is located in a separate compartment on the CPU module, protected by a sliding cover. It is positioned under the USB interface IF4 (the left USB port when looking at the front of the CPU).
The battery compartment is on the CPU module itself — not on the power supply module or any bus module.
4.3 Battery Status LED
The X20CP1584 has a dedicated battery status indicator:
| LED Label | Color | State | Meaning |
|---|---|---|---|
| DC OK | Green | On | CPU power supply OK |
| DC OK | Red | On | Backup battery is EMPTY or MISSING |
If the DC OK LED is red, the battery is depleted or absent. The SRAM is at risk of data loss during any power interruption. Replace the battery immediately.
Important: The DC OK LED being red does NOT mean the CPU is failing. The CPU runs fine on main power. The red LED only warns that the battery cannot maintain SRAM during a power loss.
4.4 Capacitor Bridge
In addition to the lithium battery, the CPU board has a capacitor (condensator) that provides a short-term SRAM bridge during very brief power interruptions. This capacitor holds SRAM for a short duration (seconds, not minutes). It is NOT a substitute for a functional battery.
5. VAR RETAIN vs VAR PERSISTENT: Critical Semantics
B&R Automation Runtime uses distinct terminology from CODESYS and other IEC 61131-3 systems. Understanding these differences is essential when reverse-engineering an unknown project.
5.1 VAR RETAIN (Remanent Variables)
VAR RETAIN
PartCounter : UDINT;
MachineHours : TIME;
LastFaultCode : USINT;
END_VAR
| Property | Value |
|---|---|
| Storage location | Battery-backed SRAM (remanent data area) |
| Max size on CP1584 | 256 KB |
| Survives warm restart | Yes |
| Survives cold restart | No — reset to 0/default |
| Survives program download/transfer | No — reset to 0/default |
| Survives battery failure + power loss | No — all values lost |
| Survives CF card replacement | No (SRAM is on the CPU, not the CF) |
| Scope | Can be local (inside function blocks) or global |
| Declaration file | Any .var file in the project |
RETAIN variables live entirely in SRAM. They survive as long as the CPU has power (or battery backup). Any cold restart, program transfer, or battery death resets them to their initial values (typically zero unless explicitly initialized).
5.2 VAR PERSISTENT (Permanent Variables)
(* In Cpu.per or global persistent variable list *)
VAR PERSISTENT
CalOffset_Axis1 : LREAL;
Recipe_SetPoint : REAL;
StationEnabled : ARRAY[1..16] OF BOOL;
END_VAR
| Property | Value |
|---|---|
| Storage location | CompactFlash file system (Cpu.per area) |
| Survives warm restart | Yes |
| Survives cold restart | Yes — values preserved |
| Survives program download/transfer | Usually yes (see caveat below) |
| Survives battery failure + power loss | Yes — values preserved |
| Survives CF card replacement | No — lost with the CF card |
| Scope | Global only — cannot be local to a function block |
| Declaration file | Cpu.per or persistent global variable list |
PERSISTENT variables are written to the CF card. They survive everything except CF card removal, formatting, or physical failure.
Caveat: There is a known issue where PERSISTENT variables can be reset to zero after certain program transfer operations in Automation Studio. Always back up PERSISTENT variable values before any software transfer.
5.3 Quick Comparison
| Scenario | VAR RETAIN | VAR PERSISTENT |
|---|---|---|
| Normal power cycle (warm start) | Kept | Kept |
| Cold restart / INIT | Lost | Kept |
| Program download (AS transfer) | Lost | Usually kept (risk of reset) |
| Battery dead + power loss | Lost | Kept |
| CF card removed/replaced | Kept (in SRAM) | Lost |
| Both battery dead AND CF replaced | Lost | Lost |
6. Cold Start vs Warm Start vs INIT: What Survives
Automation Runtime defines distinct restart types. See ar-rtos.md for operating state details and cf-card-boot.md Section 7 for runtime operating states.
6.1 Warm Restart
A warm restart preserves the current state of the runtime system. This is what normally happens when the PLC is rebooted (power cycle with battery intact, software restart command).
- VAR RETAIN: Values preserved
- VAR PERSISTENT: Values preserved
- Non-retained variables: Re-initialized to defaults
- I/O image: Reset
Triggered by: normal power cycle, software restart via Automation Studio or operator panel.
6.2 Cold Restart
A cold restart reinitializes the runtime system from scratch. The application is loaded from CF and all runtime state is discarded.
- VAR RETAIN: Reset to initial values (0 unless explicitly set)
- VAR PERSISTENT: Values preserved (loaded from CF)
- All other variables: Initialized to defaults
- I/O image: Reset
Triggered by: operating mode switch to DIAG then back to RUN, certain runtime commands, Service Mode operations.
6.3 INIT Routines
The INIT routine of each task is executed once during startup. INIT is NOT executed on a warm restart — only on cold restart or after a program download.
- Use INIT routines to set up default states for RETAIN variables that should start at known values after a cold start
- Do NOT rely on INIT to restore values that must survive cold starts — use PERSISTENT for those
6.4 Operating Mode Switch Behavior
| Switch Position | Behavior |
|---|---|
| RUN | Normal operation; warm restart after power cycle |
| BOOT | Default AR starts; ready for OS download; User Flash is deleted on new download |
| DIAG | Diagnostics mode; program sections NOT initialized; always followed by warm restart when returning to RUN |
Warning: DIAG mode does NOT clear retentive data. When the switch is returned to RUN, a warm restart is performed, meaning RETAIN variables keep their values. DIAG mode is safe for inspecting the system without losing retentive data.
7. Battery Status Monitoring
7.1 Hardware Indicator: DC OK LED
The simplest battery check requires no software at all:
- DC OK = Green — Battery OK
- DC OK = Red — Battery empty or missing
Check this LED during every routine machine inspection.
7.2 Software: BatteryInfo Function
B&R provides a system library function called BatteryInfo that returns battery status
information. This function is available in the B&R System library.
(* Pseudocode — exact syntax depends on AR version *)
BatteryInfo(
wStatus => wBatteryStatus, (* Battery OK / not OK *)
...
);
The BatteryInfo function reads the cyclically-monitored battery voltage and load-test
results. The battery monitoring system performs periodic load testing that does not
significantly reduce battery life.
7.3 I/O Mapping
Battery status is also available through the CPU’s I/O mapping. The “Battery OK” flag appears as a digital input in the CPU I/O mapping. This can be read in your program or monitored via the watch window in Automation Studio.
7.4 Recommended Monitoring Strategy
For undocumented machines, add a simple cyclic task that:
- Calls
BatteryInfoevery cycle - Logs a warning when
BatteryOK = FALSE - Triggers a HMI alarm or sets a status bit visible to operators
- Optionally writes a timestamp to a PERSISTENT variable recording when the battery was first detected as low
8. Battery Replacement Procedure (Without Data Loss)
The X20CP1584 battery can be replaced with the PLC either powered on or powered off. However, local safety regulations in some jurisdictions prohibit battery replacement while the module is energized. Follow your facility’s lockout/tagout procedures.
8.1 Method A: Hot-Swap (PLC Powered On) — Preferred
This is the safest method for data preservation. The SRAM remains powered by main supply during the swap.
Steps:
- Ensure the PLC is running normally (RUN mode, no faults)
- Confirm DC OK LED is green (battery still has some charge — if red, proceed anyway as main power will maintain SRAM)
- Discharge electrostatic charge — touch the DIN rail or a ground connection (NOT the power supply terminals)
- Slide the battery cover down to remove it from the CPU
- Remove the old battery from the holder using fingers or insulated tweezers. Do NOT use uninsulated metal pliers — risk of short-circuit
- Insert the new battery with correct polarity: “+” side up, positioned under USB interface IF4 (left USB port). Press the left side of the holder to secure the battery
- Replace the cover
- Verify DC OK LED returns to green within a few seconds
8.2 Method B: Power-Off Swap
If you must power down the PLC to change the battery, the on-board capacitor provides a brief SRAM hold-up time, but you must work quickly.
Steps:
- Ensure the machine is in a safe state and locked out
- Prepare the new battery — have it unwrapped and ready
- Power off the PLC
- Immediately (within 1 minute) perform steps 3-7 from Method A
- Power the PLC back on
- Verify all retentive values are correct
- Verify DC OK LED is green
Critical: The 1-minute limit is generous, but the actual hold-up time depends on the on-board capacitor condition and temperature. Work as fast as possible. If you exceed the time window, all RETAIN variables will be lost.
8.3 Post-Replacement Verification
After any battery replacement:
- Check DC OK LED is green
- Compare critical RETAIN variable values against your last backup
- Check the real-time clock is correct (if it drifted, set it via Automation Studio or NTP)
- Log the replacement date for your maintenance records
- Set a calendar reminder for the next replacement (4 years)
8.4 Battery Disposal
Lithium batteries are hazardous waste. Dispose of used batteries according to local regulations. Do not incinerate or puncture.
9. Backing Up Retentive Data
There is no single “export all retentive data” button. You need a strategy that covers both VAR RETAIN and VAR PERSISTENT variables. Use multiple methods for redundancy.
9.1 Method 1: Runtime Utility Center (RUC) Variable Lists
RUC can read and write variables from a running PLC via the PVI interface.
Steps:
- Connect to the PLC via Runtime Utility Center (Ethernet or serial)
- Create a template variable list containing all RETAIN and PERSISTENT variable names
- Use RUC to read all values from the PLC and save to a
.varlistfile - Store the backup file with a timestamp
The template can be built by copying variable names from Cpu.per (for PERSISTENT) and
scanning .var files for VAR RETAIN declarations (see Section 13).
9.2 Method 2: CF Card Image Backup
A full CF card image preserves everything — application, configuration, PERSISTENT variables, and runtime files. This is the most comprehensive backup.
See cf-card-boot.md Section 14 for detailed CF card imaging procedures.
Quick procedure:
- Power off the PLC
- Remove the CF card
- Create a binary image using
ddor a disk imaging tool:dd if=/dev/sdX of=cp1584_backup_YYYY-MM-DD.img bs=4M status=progress - Store the image in multiple locations
- Reinsert the CF card and power on
9.3 Method 3: Service Mode Export
If the application provides PV (Persistent Variable) backup functionality, use it. Alternatively, restart the PLC in Service Mode and export all PVs whose value differs from zero. This captures meaningful runtime data while avoiding default-initialized values.
9.4 Method 4: MpRecipeXml (If Available)
If the machine uses the B&R mapp framework, the MpRecipeXml component can save/load any
set of variables as XML files on the PLC’s CF card.
MpRecipeXml(
xSave := bTriggerSave,
sFileName := 'RetentiveBackup',
...
);
9.5 Method 5: Python Script with PVI.py
For automated or scheduled backups, a Python script using the PVI.py library can:
- Parse
Cpu.perto get PERSISTENT variable names - Parse all
.varfiles to findVAR RETAINdeclarations - Connect to the PLC via PVI
- Read all retentive variable values
- Save to a CSV or structured file
The Pvi.py library is available at: https://github.com/hilch/Pvi.py
9.6 Method 6: Automation Studio Watch Window Export
As a manual fallback, use the Automation Studio Watch window to:
- Add all known RETAIN/PERSISTENT variables to the watch list
- Connect online
- Export the values (right-click, Export)
This is slow but requires no special tools beyond Automation Studio.
10. Restoring Retentive Data
10.1 Restoring VAR PERSISTENT Values
Since PERSISTENT values live on the CF card, they typically survive most disruptions. If they need to be restored from backup:
- Connect via Runtime Utility Center
- Load your saved variable list
- Write values back to the PLC
- Verify all values
10.2 Restoring VAR RETAIN Values After Data Loss
RETAIN variables must be written back one at a time (or via a variable list) since their SRAM contents were lost:
- Ensure the battery is good and the PLC is running
- Connect via RUC or Automation Studio
- Write each RETAIN variable back to its known-good value
- If you have no backup, you must manually re-enter all values from production records, calibration sheets, or last-known-good documentation
10.3 Restoring from a Full CF Image
If you have a full CF card backup:
- Power off the PLC
- Remove the current CF card
- Write the backup image to a spare CF card (same model/spec):
dd if=cp1584_backup_YYYY-MM-DD.img of=/dev/sdX bs=4M status=progress - Insert the restored CF card
- Power on the PLC
- Verify application loads and all values are correct
Warning: This restores the entire CF including the application binary. If the CF card has been updated since the backup, you will lose those changes. Use this method only when recovering from total data loss.
11. Recovery After Battery Death and Total Data Loss
This is the worst-case scenario: the battery died while the machine was powered off and unattended for an extended period. All RETAIN variables are zeroed. The machine may behave erratically or fail to start production cycles.
11.1 Immediate Actions
- Replace the battery using the procedure in Section 8
- Power on the PLC and verify it boots
- Check the DC OK LED — it should now be green
- Check the real-time clock — if wrong, correct it
11.2 Assess the Damage
- Identify all RETAIN variables (see Section 13)
- Determine which RETAIN variables are critical for machine operation
- Check PERSISTENT variables — these should be intact on the CF card
11.3 Restore Critical Values
Priority order for restoration:
| Priority | Variable Type | Why |
|---|---|---|
| 1 | Calibration offsets, scaling factors | Machine produces out-of-spec product without these |
| 2 | Axis positions / homing flags | Motion system may crash without correct home references |
| 3 | Production counters / part counts | Needed for traceability and maintenance schedules |
| 4 | Recipe parameters | Production cannot proceed with correct settings |
| 5 | Diagnostic counters / fault logs | Lower priority — these will accumulate again |
11.4 Sources for Restoration Values
If you have no backup file:
- Calibration certificates — may have recorded calibration offsets
- Last batch records — may show recipe parameters and setpoints
- HMI screenshots — if anyone photographed the HMI before the failure
- Similar machines — if you have identical machines, read their RETAIN values as a starting point (NOT a perfect match, but better than zero)
- OEM documentation — if any manuals survived, they may list default values
- Source code inspection — the
.varfiles may contain initial values that serve as reasonable defaults
11.5 Preventing This From Happening Again
After recovery, implement the monitoring and backup procedures described in Section 7 and Section 9. Set calendar reminders for battery replacement.
12. Function Block RETAIN Memory Trap
When you declare a function block instance and mark any variable inside it with RETAIN,
B&R stores the entire function block instance in the remanent (SRAM) memory area — including
variables NOT marked RETAIN.
FUNCTION_BLOCK fbMotor
VAR RETAIN
TotalRuns : UDINT; (* This is RETAIN *)
END_VAR
VAR
CurrentSpeed : REAL; (* This is NOT RETAIN — but still stored in remanent area *)
IsRunning : BOOL; (* This is NOT RETAIN — but still stored in remanent area *)
END_VAR
In this example, all three variables occupy remanent memory even though only TotalRuns
needs to be retained. The non-RETAIN variables will not actually retain their values on a cold
restart, but they consume remanent memory space.
Impact: If you create many instances of this function block, you can exhaust the 256 KB remanent memory limit on the CP1584 quickly. Automation Studio reports the total remanent memory usage per task — check this if you see “not enough remanent memory” errors.
Workaround: Move RETAIN variables out of the function block into global variable declarations, and pass them to the FB via references or input/output parameters.
13. Identifying All Retentive Variables in an Unknown Project
When you inherit a machine with no documentation, you need to find every variable whose value matters after a restart.
13.1 Find All VAR RETAIN Declarations
Search all .var files in the project for the VAR RETAIN keyword:
## Linux/macOS
grep -rn "VAR RETAIN" /path/to/project/ --include="*.var"
## Output example:
## /Logical/AxisControl/Variables.var:17:VAR RETAIN
## /Logical/Recipe/Variables.var:9:VAR RETAIN
## /Logical/Conveyor/Variables.var:23:VAR RETAIN
For each match, read the file to find the actual variable names and types declared after the
VAR RETAIN line and before the END_VAR.
13.2 Find All VAR PERSISTENT Declarations
Open Cpu.per in the project root. All PERSISTENT variables are declared here:
grep -A 50 "VAR PERSISTENT" /path/to/project/Cpu.per
13.3 Find All RETAIN Variables Inside Function Blocks
Function blocks may declare RETAIN variables internally. Search all program files:
grep -rn "VAR RETAIN" /path/to/project/ --include="*.var" --include="*.st" --include="*.txt"
13.4 Check Automation Studio Remanent Memory Usage
In Automation Studio, the task configuration shows the total remanent memory used. This helps you understand the scale of retentive data in the project even without identifying every variable.
13.5 Build a Master Variable List
Combine all found variables into a single list with:
- Variable name and full path
- Data type
- Declaration type (RETAIN or PERSISTENT)
- Current value (read from running PLC)
- Expected/default value (from source code)
- Criticality rating
This list becomes your backup checklist and recovery reference.
14. Best Practices for Long-Term Maintenance
14.1 Preventive Maintenance
| Action | Frequency | Notes |
|---|---|---|
| Check DC OK LED | Weekly | Takes 2 seconds during walkthrough |
| Battery replacement | Every 4 years | Regardless of LED status |
| Full RETAIN variable backup | Monthly | Use Method 1 or 5 from Section 9 |
| CF card image backup | Quarterly | Before any software changes |
| Review retentive variable list | After any program change | New RETAIN variables may have been added |
14.2 Before Any Software Transfer
Before downloading new software to the PLC:
- Back up all RETAIN and PERSISTENT variable values (Method 1 or 5)
- Back up the CF card image (Method 2)
- Document the current software version on the PLC
- Download the new software
- Verify all retentive values after the transfer
- If values changed unexpectedly, restore from backup
14.3 Before Any Planned Power Outage
- Back up all retentive variable values
- Verify the battery is good (DC OK = green)
- If battery is questionable, replace it before the outage
- After power is restored, verify all values
14.4 Spare Parts Inventory
Keep on hand:
- At least 2 spare batteries (part number
4A0006.00-000) - At least 1 spare CF card (same capacity and industrial grade as the installed card)
- A copy of your latest CF card image on a USB drive stored near the machine
15. Key Findings
-
The CP1584 battery (3 V / 950 mAh lithium, part
4A0006.00-000) backs up 1 MB of SRAM holding all VAR RETAIN variables, the RTC, and system RAM buffers. It does NOT back up the application code (on CF) or the DDR SDRAM. -
VAR RETAIN and VAR PERSISTENT are fundamentally different. RETAIN lives in battery-backed SRAM and is lost on cold restarts, program transfers, and battery death. PERSISTENT lives on the CF card and survives everything except CF card loss.
-
The DC OK LED is your first warning. Red = battery empty/missing. Green = battery OK. Check it weekly.
-
Battery replacement every 4 years is mandatory. The recommended interval is not the maximum — the actual lifespan depends on temperature and load testing patterns.
-
You have approximately 1 minute to swap the battery with power off before the on-board capacitor can no longer maintain SRAM. Hot-swap with the PLC powered on is preferred and safer.
-
Function block RETAIN wastes memory. If any variable in a function block is RETAIN, the entire instance goes into remanent memory. The CP1584 has a 256 KB remanent limit.
-
There is no built-in “export all retentive data” function. You must use RUC variable lists, PVI scripts, MpRecipeXml, or CF card imaging to back up retentive data.
-
PERSISTENT variables can be silently reset to zero during program transfers. Always back up before any software download.
-
When you inherit an undocumented machine, scan all
.varfiles forVAR RETAINand readCpu.perfor PERSISTENT declarations to build your variable master list. -
The worst-case scenario (battery dead + no backup) means manual re-entry of all calibration offsets, recipe parameters, axis references, and production counters from whatever records survive. Implement automated backup immediately after recovery.
16. Cross-References
| Related Document | Content | Relevance |
|---|---|---|
| cp1584-hardware-ref.md | CP1584 hardware specs, battery compartment location | Physical details for battery replacement |
| cf-card-boot.md | CF card file layout, where persistent data is stored | Understanding the storage medium for retentive data |
| memory-map.md | Memory architecture, SRAM layout, addressing | How retentive memory fits in the overall memory map |
| firmware.md | Firmware architecture, program storage locations | Relationship between retentive data and firmware |
| bootloader-recovery.md | Recovery procedures when data is lost | What to do after a dead battery causes data loss |
| ftp-web-interface.md | FTP backup of configuration and data | Using FTP to back up persistent variables before battery replacement |
| online-changes.md | Runtime parameter modification | How to restore values at runtime after data loss |
| documentation-reconstruction.md | Documenting retentive variable values | Recording calibration offsets and setpoints for disaster recovery |
| python-diagnostics.md | Python scripts for automated backup | Building automated retentive data backup and restore scripts |
| hardware-monitoring.md | Temperature sensors, voltage rails, and hardware health monitoring | Hardware conditions that affect battery-backed SRAM longevity and reliability |
17. Sources
- B&R Official Product Page: X20CP1584 technical data (br-automation.com)
- B&R Community Forum: “Do permanent variables work properly when the PLC battery is low?” (2025)
- B&R Community Forum: “Retain Tag and Remanent Memory Usage” (2024)
- B&R Community Forum: “Storing remanent memory values in a file” (2025)
- B&R Community Forum: “Easy and quick way to save/restore values of permanent variables?” (2024)
- B&R Community Forum: “Guideline: Minimizing Information Loss Risks During PLC Software Updates” (2026)
- B&R Community Forum: “Retain variable reset to zero” (multiple replies)
- B&R Community Forum: “In userdefined Library, Function Block to Reset Variables to FALSE on Cold or Warm Restart” (2024)
- X20CPx58x Hardware Manual (B&R, V1.56) — battery replacement procedure, data sheet
- X20CP148x/348x Hardware Manual (B&R, V1.00) — battery compartment details, DC OK LED table
- Pvi.py Python Library: github.com/hilch/Pvi.py
- Runtime Utility Center documentation (B&R)
B&R Firmware Version Management on B&R X20 Systems Without OEM Access
Overview
Maintaining B&R Automation hardware on machines from defunct OEMs means you have no service contract, no project source files, no Automation Studio license tied to the machine, and no support portal credentials. This guide covers how to inventory firmware versions, obtain firmware without a B&R customer account, understand compatibility between Automation Studio (AS), Automation Runtime (AR), and module firmware, safely update firmware on a production machine, and troubleshoot version mismatches.
The primary hardware target is the B&R X20CP1584 CPU (Atom 0.6 GHz, 256 MB DDR2, CompactFlash, POWERLINK V1/V2, Ethernet) and its associated X20 I/O modules, bus controllers, and ACOPOS drives. The CP1584 has been supported since Automation Studio V3.0.90.20 and runs AR versions in the standard (non-SGC, non-Embedded) track.
Audience: Automation engineers maintaining B&R X20 systems on machines where the OEM is gone and no documentation exists.
Related documents:
- firmware.md — General firmware concepts and inventory templates
- cf-card-boot.md — CompactFlash card boot procedure and recovery
- acopos-drives.md — ACOPOS servo drive firmware and parameter management
1. Understanding B&R Version Architecture
1.1 The Three-Layer Firmware Stack
B&R systems have three interdependent firmware/version layers:
| Layer | What It Is | Where It Lives | Example |
|---|---|---|---|
| Automation Studio (AS) | Development IDE running on your PC | Windows workstation | V4.10, V4.12, V6.0 |
| Automation Runtime (AR) | Real-time OS on the target CPU | CompactFlash (target) | E4.10, I4.12, D4.80 |
| Hardware Firmware | Module-level firmware on I/O, bus controllers, drives | Flash inside each module | X20BC0088 V1.05, ACOPOS V2.47 |
A mismatch at any layer prevents downloads, causes errors, or bricks modules.
1.2 Automation Runtime (AR) Version Naming Convention
AR versions use a prefix letter + version number format:
| Prefix | System Generation | Typical Hardware |
|---|---|---|
No prefix (e.g., 4.10) | Standard / Industrial PC / Power Panel | X20CP1584, Power Panel 500 |
E (e.g., E4.10) | Embedded | Panel PCs with embedded runtime |
D (e.g., D4.80) | Different platform target | Older B&R hardware |
I (e.g., I3.10) | Intel-based legacy platform | Older PLC systems |
N (e.g., N4.02) | Another platform variant | Specific Power Panel models |
F (e.g., F2.33) | SGC (System Generation Compact) | X20CP0291 and similar compact CPUs |
T (e.g., T2.80) | SG4 platform | Specific target systems |
For the X20CP1584: The runtime version will typically be in the standard track (no prefix, e.g., 4.10, 4.12, 4.90, 4.93) or may display as E4.xx on the boot screen depending on the firmware generation. Check the CPU’s boot screen or the System Diagnostics Manager to confirm the exact AR version string.
1.3 AS-to-AR Compatibility Rules
- Each AS version ships with a set of AR “upgrades” (runtime packages). The project specifies which AR version the target runs.
- AS version must be >= the minimum AS version that supports the chosen AR version.
- Newer AS versions can generally target older AR versions (backward compatible), but older AS versions cannot target newer AR versions.
- The AR upgrade must be installed on the development PC (via
Tools > Upgradesin AS) before you can build a project targeting that AR version. - Automation Studio 4.x targets AR 4.x. Automation Studio 6.x targets AR 6.x. These are NOT cross-compatible — an AS6 project cannot be downloaded to an AR4 target.
2. Determining Firmware Versions on an Existing System
2.1 CPU / Automation Runtime Version
Method 1: Boot Screen (No Tools Required)
When the X20CP1584 powers on, the boot screen displays the AR version briefly. Connect a monitor/keyboard or observe via serial console (IF1 RS232 at 115.2 kbps). Look for a line like:
B&R Automation Runtime N4.02
or
B&R Automation Runtime E4.10
This is the fastest way to identify the runtime version with zero tooling.
Method 2: System Diagnostics Manager (SDM) via Web Browser
- Determine the CPU’s IP address (check any network scanner, or try the default B&R range 192.168.1.x)
- Open a web browser and navigate to
http://<CPU-IP> - SDM shows detailed hardware/software info including:
- AR version
- CPU model and hardware revision
- All connected I/O modules and their firmware versions
- X2X Link topology and module status
- Battery status
- SDM works even when the PLC is in SERVICE mode
Method 3: Automation Studio — Online > Device Information
With AS connected to the target over Ethernet:
Online > Settings— confirm IP connectivityOnline > Device Information— shows target AR version, CPU model, serial number- Physical View shows each module with its firmware version in the properties panel
Method 4: Read AR Version from the CompactFlash Card
If you have the CF card removed from the CPU (see cf-card-boot.md):
- Mount the CF card on a PC
- The AR version is embedded in the boot configuration files on the card
- Look for the
BrAppDatadirectory and configuration files that reference the runtime version
2.2 I/O Module Firmware Versions
X20 I/O modules receive their firmware from the CPU during the download process. The CPU pushes the correct firmware to each module via the X2X Link bus.
Method 1: SDM (Recommended)
Via http://<CPU-IP> in SDM, the I/O tree shows each X20 module with its current firmware version and hardware revision.
Method 2: Automation Studio Physical View
When connected online (Online > Go Online), the Physical View displays each module. Right-click a module > Properties to see the firmware version running on the target vs. the version in the project.
Method 3: Module LEDs
While not version-specific, I/O module LED behavior indicates firmware mismatch:
- Blinking
r(red) LED: The module is in an error state, which can include firmware mismatch with the CPU’s expected version - Solid
rLED: Fatal error; module will not operate
2.3 Bus Controller Firmware (X20BC0083, X20BC0088)
Method 1: Web Server on the Bus Controller
For EtherNet/IP bus controllers (X20BC0088):
- Connect to the bus controller’s IP address via web browser
- Navigate to the Adapter Status page — Version Information section shows firmware version
- Login: default username
admin, passwordX20BC0088(case sensitive, model-specific)
Method 2: Automation Studio
When the bus controller is part of the AS project, its firmware version appears in the Physical View. If the BC is a standalone gateway not managed by a CPU, use the web interface.
2.4 ACOPOS Drive Firmware Versions
Method 1: ACOPOS Service Menu
On the drive front panel:
- Access the ACOPOS Service menu (procedure varies by drive model — consult acopos-drives.md)
- Navigate to the firmware/software version parameter
- The display shows the current drive firmware (e.g., V2.47)
Method 2: Automation Studio — Drive Parameters
When connected to the CPU controlling the drives:
- Open Hardware Configuration > Drive Parameters
- The parameter tree shows the drive firmware version
- Compare against the
.GDMfile version — open the GDM as text (right-click > Open With > Notepad) and search for theVprefix version string
Method 3: SDM
If drives are connected via POWERLINK, SDM at http://<CPU-IP> may show drive status including firmware versions in the motion diagnostic section.
3. Obtaining Firmware Without an Active Service Contract
3.1 The Access Problem
B&R’s download portal (br-automation.com/downloads) requires a login for most firmware files. Many downloads show “Login for download.” Without an OEM relationship, you face:
- No portal credentials
- No support ticket channel
- No access to firmware upgrade packages through official channels
3.2 Obtaining Automation Studio (Development Tooling)
90-Day Evaluation License (Recommended Starting Point)
- Go to
br-automation.com > Service > Software Registration - Register for an evaluation license — provides unrestricted AS functionality for 90 days
- After 90 days, you can request a new 90-day extension repeatedly
- The evaluation license gives you full AS access including
Tools > Upgradesto download AR packages - Limitation: Commercial use is technically not permitted under the evaluation license. For emergency maintenance on a machine with no OEM, this is your practical option.
Important: AS Version Selection
- AS 4.12 is the last version in the AS4 product line and supports all AR 4.x versions
- AS 6.x requires an AR 6.x target — incompatible with older X20 hardware running AR 4.x
- For the X20CP1584 running AR 4.x, install Automation Studio 4.12 (latest AS4)
- AS4.12 includes all hardware upgrades for X20 modules up to the AS4 end-of-life
Automation Studio 6.x Ecosystem (2024-2025)
B&R released Automation Studio 6.0 in mid-2024 as a major overhaul with a reimagined user interface and revised editing rules. Subsequent releases through AS 6.3 (June 2025) added significant new capabilities. AS 6.x does NOT replace AS 4.x — it is a parallel product line with a separate license. Projects from AS 4.x cannot be opened directly in AS 6.x; they must be ported using community migration tools.
| Release | Date | Key Changes |
|---|---|---|
| AS 6.0 | Mid-2024 | Complete UI overhaul, revised editing rules, compatibility mode for AS 4.x projects |
| AS 6.1 | Late 2024 | Stability fixes, expanded hardware support |
| AS 6.2 | Early 2025 | Multicore processing support for AR 6.x targets (core assignment per task) |
| AS 6.3 | June 30, 2025 | AS Code (VS Code-based editor, open beta), AS Copilot (AI assistant), hybrid library import, CLI tool for 3rd party device import, ST-OOP support |
| AS 6.4 | Late 2025 | Multicore ANSL communication tasks, hypervisor Windows 11 + efficiency cores, GPOS driver 2.1.0, FTP server port config, ManagedCertificateStore with ArMcsRecreateCert, Reader/Writer Locks, SMB 1.0 permanently disabled |
| AS 6.5 | Dec 18, 2025 | Hard real-time multicore (task classes assignable to specific cores), ST-OOP inheritance/polymorphism/access specifiers/abstract methods, FTP RBAC, ManagedCertificateStore extended to ANSL/FTP/HTTP/SMTP, TFTP default Off, self-signed certificate warning dialog, CLI library exporter (BR.AS.LibraryExporter.exe), SNI support in AsHttp, ArCert CSR generation, warnings-as-errors build option, removal of source file encryption, telemetry data collection |
| AS 6.5.1 | Feb 4, 2026 | Bugfix release. Fixes ST-OOP issues in PV Watch, ARM configuration build fixes for ST-OOP migration. Known issue: upgrade menu may not show latest upgrades (workaround: use “Local” tab). Some users report build crashes (6.5.1.17) — update to 6.5.2 if affected. |
| AS 6.5.2 | Mar 2026 | Bugfix release. Fixes upgrade service connectivity issues (AS 6.5.1 upgrade server problems), additional ST-OOP stability fixes. If using AS 6.5.x, update to 6.5.2 as minimum — 6.5.0 and 6.5.1 have known upgrade service issues documented in the B&R Community. |
AS Code is a VS Code-based editor fully compatible with AS 6 projects, offering modern editors for ST and C/C++, syntax error highlighting, minimap, multiline edit, dark/light themes, references/refactoring, and Git integration. It includes an AI assistant (AS Copilot) for code generation and commenting (ST only as of 6.3). AS Code requires PVI License (1TG0500.01) for smooth debug/transfer. AS 6.3 installs as an update to AS 6.1 — both versions coexist in compatibility mode.
Multicore processing (AS 6.2+): On multi-core AR 6.x controllers, cores can be assigned dynamically to AR or GPOS (Linux via exOS). Not applicable to single-core CP1584, but relevant for migration planning to newer B&R hardware.
Sources: B&R Community — AS 6.3 release, B&R Community — Multicore in AS6, B&R Community — AS 6 features
3.3 Obtaining AR Upgrades and Hardware Upgrades
Once you have AS installed with an evaluation license:
- Open Automation Studio
Tools > Upgrades- The Upgrade Manager connects to B&R’s server and downloads available:
- AR upgrades (runtime versions for the CPU)
- HW upgrades (firmware for individual hardware modules — I/O modules, bus controllers, interface modules)
- Install the upgrades you need — they are stored locally and can be used offline afterward
- Save these upgrade packages to external media for archival. If your evaluation license lapses before you need them again, having the upgrade files stored locally means you can install them on a fresh AS instance without re-downloading.
3.4 Downloading Specific Module Firmware Files
Some firmware files are available on the B&R website without login:
- Browse to
br-automation.com > Downloadsand filter by hardware type - Power Panel firmware upgrades are sometimes publicly downloadable
- Bus controller firmware (for web-update method) may be available via B&R support ticket or community
For firmware not available publicly:
- B&R Community Forum (
community.br-automation.com): Search for your module and firmware version. Community members sometimes share links or guidance. - Third-party industrial parts suppliers (EU Automation, all4sps, etc.): Sometimes provide firmware with refurbished modules
- B&R local sales office: Even without a service contract, a local B&R office may provide firmware files as a courtesy, especially for safety-related hardware
3.5 The CF Card as Firmware Carrier
When you download a project from Automation Studio to a target via Transfer, AS writes:
- The AR runtime image
- The application program
- All module firmware files
The resulting CF card contains everything the target needs. Back up every CF card you encounter — it is a complete firmware snapshot of the system.
4. Firmware Downgrade Paths
4.1 Can You Downgrade?
| Component | Downgrade Possible? | Method | Notes |
|---|---|---|---|
| CPU AR version | Yes | CF card rebuild with older AR, or Change Runtime in AS | May erase user data; re-transfer required |
| I/O module firmware | Yes (automatic) | CPU pushes firmware during download | Newer modules may not support very old firmware |
| Bus controller | Depends | Web interface (X20BC0088) or via CPU download | Some versions block downgrade |
| ACOPOS drives | Generally no | Not typically supported | Drive firmware is usually forward-only |
4.2 Downgrading the CPU Runtime
- In Automation Studio, open the project
Physical View > Right-click CPU > Change Runtime- Select the older AR version from the installed upgrades
- Re-transfer the project to the target — this will re-flash the CF card with the older runtime
- The CPU will reboot with the downgraded runtime
Warning: Downgrading the runtime may clear retentive data. Back up all parameters and recipes first.
4.3 Downgrading I/O Module Firmware
When you transfer a project to the CPU, the CPU automatically pushes the correct firmware to all modules on the X2X Link. If the project specifies an older firmware version for a module, the CPU will downgrade it during the transfer.
Known issue: Some very old firmware versions of bus controllers (X20BC0083, X20BC0088) are incompatible with modern web browsers. If you need to access the web interface for diagnostics after a downgrade, use an older browser or access via Automation Studio instead.
4.4 Interface Module Upgrade Requirements for CP1584
When replacing an X20CPx48x with an X20CPx58x, certain interface modules require a minimum hardware upgrade AND hardware revision. Key modules that may need upgrades:
| Module | Minimum Upgrade | Minimum HW Revision |
|---|---|---|
| X20IF1020 | 1.1.5.1 | H0 |
| X20IF1030 | 1.1.5.1 | I0 |
| X20IF1061 | — | E0 |
| X20IF1063 | 1.1.5.0 | — |
| X20IF1072 | 1.0.5.1 | — |
| X20IF1082 | 1.2.2.0 | — |
| X20IF2772 | 1.0.6.1 | — |
| X20IF2792 | 1.0.5.1 | — |
Modules not listed (X20IF1041-1, X20IF1043-1, X20IF1051-1, etc.) work without upgrade requirements.
5. Compatibility Matrix: AS, AR, and Module Firmware
5.1 How the Matrix Works
There is no single publicly-published table that maps every AS version to every AR version and every module firmware version. The compatibility information is distributed across:
- AS Release Notes — lists supported AR versions
- Hardware Upgrade Descriptions — each HW upgrade package specifies which AS version it requires and what modules it covers
- Product Data Sheets — show first/last supported AS version for each hardware item
- Automation Studio Upgrade Dialog — filters available upgrades by AS version
5.2 Practical Compatibility for X20CP1584
| AS Version | AR Versions Available | Notes |
|---|---|---|
| AS 3.0.90+ | AR 3.x | Earliest AS supporting CP1584 |
| AS 4.x (4.1–4.12) | AR 4.x (4.10, 4.12, 4.90, 4.93) | Primary target for CP1584 |
| AS 6.x | AR 6.x | Incompatible with AR 4.x targets |
Key principle: The CP1584 is a legacy X20 CPU. Its latest supported AR versions are in the 4.x series (up to 4.93). Automation Studio 4.12 is the last AS version that can target it.
5.3.1 AS4 to AS6 Migration (When Upgrading Hardware)
B&R has released Automation Studio 6 as the successor to AS4. AS6 targets AR 6.x and introduces a new project format, updated IDE, and shared upgrades. Migration from AS4 to AS6 is a one-way process — AS6 projects cannot be opened in AS4.
Community migration tools (free, open-source):
| Tool | URL | Purpose |
|---|---|---|
| as6-migration-tools | github.com/br-automation-community/as6-migration-tools | Python scripts that analyze AS4 projects and generate migration reports highlighting deprecated libraries, unsupported function blocks, and syntax changes |
| AS6 Conversion Tool | Built into AS6 | Official B&R conversion tool (File > Convert); requires AS4.12 project as input |
| BRLibToHelp | github.com/br-automation-community/BRLibToHelp | Parses B&R Automation Studio libraries and generates CHM help files — useful for documenting library dependencies before migration |
| SBOM Generator | github.com/br-automation-community | Generates CycloneDX 1.5 SBOMs from AS6 projects — useful for inventorying library usage |
Migration path for CP1584 users upgrading to newer X20 hardware (e.g., X20CP3484):
- Install AS4.12 (your current version) and AS6 side by side on the same PC
- Use as6-migration-tools on your existing AS4 project to generate a migration report
- In AS4.12, ensure the project is at the latest AS4 version (4.12)
- Open AS6 and use File > Convert to import the AS4.12 project
- Address any migration issues flagged by the conversion tool
- The converted AS6 project targets AR 6.x, which runs on newer X20 CPUs (CP3484, CP3584)
- See remanufacturing.md for the full hardware migration workflow
Key AS4 → AS6 changes affecting migration:
- mapp Framework 6 is now available for AS6 (see community.br-automation.com/t/mapp-framework-6-released-for-automation-studio-6-voting-started/10277)
- Shared upgrades: AS6 uses a central upgrade repository instead of per-version installs
- PVI 6.x drops INA2000 protocol support — only ANSL and SNMP lines are available (see pvi-api.md)
- OPC-UA configuration model updated; check namespace migration paths
- Some C library APIs may have changed — verify with the migration report
5.3 Checking Compatibility for Your System
- Determine the CPU’s current AR version (Section 2.1)
- Install AS 4.12 with evaluation license
- Install all available upgrades via
Tools > Upgrades— click the “Legacy” button to show older/supported packages - Create a matching project: In AS, when you add the CPU to the Physical View, the available runtime versions shown in
Change Runtimeare those compatible with that CPU - For each I/O module: The HW upgrade installed on the PC determines what firmware the project will push to the module. Ensure the HW upgrade for each module is installed
5.4 Safety Module Firmware Constraints
Safety I/O modules (X20SLx, X20SLXx) have additional firmware constraints:
- Only firmware versions listed in the FS certificates (Funktionssicherheit / Functional Safety certificates) are permitted
- FS certificates are available from the B&R website
- Using uncertified firmware on safety modules violates safety compliance — do NOT update safety module firmware without the correct FS certificate documentation
- If you encounter firmware mismatch warnings on safety I/O during bootup, check B&R community — some firmware versions generate false mismatch messages during boot that can be ignored if the module runs normally afterward
6. Safely Updating Firmware on a Production Machine
6.1 Pre-Update Checklist
Before any firmware update on a running production machine:
- Back up the existing CF card — image the entire CF card to a file using a card reader. This is your recovery path. See cf-card-boot.md for the backup procedure.
- Document all current versions — CPU AR version, every I/O module firmware, bus controller firmware, drive firmware. Use SDM or AS Physical View.
- Back up all parameters — ACOPOS drive parameters, recipe data, any retentive variables. Use AS to upload from target if possible.
- Verify AS version compatibility — the AS version on your PC must support the target AR version you plan to use
- Install required upgrades — AR upgrade and all HW upgrades on the development PC
- Schedule downtime — firmware updates require a full download cycle, which stops the application
- Notify operations — the machine will be unavailable during the update
- Have a fallback plan — the CF card backup allows you to restore the previous state if the update fails
6.2 Hot Download vs. Cold Download
Hot Download (Online Transfer Without Restart)
B&R supports downloading to a running system without stopping, under these conditions:
- The download does NOT require a runtime change
- The download does NOT require hardware configuration changes
- Only application code/logic is being updated
- Automation Studio determines whether a hot download is possible
When a hot download is possible, AS performs the transfer while the system continues running. The new code is activated on the next cycle boundary.
Cold Download (Full Download With Restart)
Required when:
- Changing the AR version
- Adding/removing/changing hardware configuration
- Updating module firmware
- Initial installation
The PLC will restart and re-initialize all I/O. Expect machine downtime of 2–10 minutes depending on configuration complexity.
6.3 Step-by-Step Firmware Update Procedure
Updating the CPU Runtime and Application
- Verify connectivity — AS
Online > Settings, confirm you can reach the target - Stop the target —
Online > Stop Target(or schedule during a maintenance window) - Change runtime if needed —
Physical View > Right-click CPU > Change Runtime - Install upgrades —
Tools > Upgrades, install AR and HW upgrade packages - Transfer —
Online > Transfer > Create File and Transfer(orTransfer All) - Monitor — watch the CPU LEDs:
- Green RDY/F double flash = system startup / firmware update in progress (can take several minutes)
- Solid green RDY/F = application running
- Red R/E = SERVICE mode (error or intentional stop)
- Warm restart —
Online > Warm Restartto start the application - Verify — confirm all I/O modules are online (check via SDM), check for error log entries
Updating Bus Controller Firmware (Web Method — X20BC0088)
- Connect to bus controller’s web server at
http://<BC-IP> - Navigate to
Advanced > BC Firmware Update - Login (default: admin / X20BC0088)
- Select the firmware file and click Start Download
- Wait for Download Progress to reach 100%
- Click Restart Bus Controller
- Verify on the Adapter Status page
Updating I/O Module Firmware
I/O module firmware is managed by the CPU during the download process. There is no separate firmware update procedure for X20 I/O modules:
- Ensure the correct HW upgrade is installed in AS
- Transfer the project to the CPU
- The CPU automatically pushes firmware to all X2X-connected modules
- If a module shows a firmware mismatch after transfer, verify the HW upgrade matches
Updating ACOPOS Drive Firmware
- Via Automation Studio: Connect to the CPU, open Drive Configuration, the firmware update happens as part of the download
- Via ACOPOS Service Tool: Direct serial connection to the drive for firmware updates independent of the CPU
- Warning: Drive firmware updates are typically one-directional (upgrade only). Confirm the new firmware is compatible with your ACP10/ACP10MC configuration before proceeding.
6.4 Recovery from a Failed Update
- Restore the backed-up CF card — insert the original CF card and power cycle. The machine should return to its pre-update state.
- If the CF card was corrupted during the update, use the CF card backup image to create a new card.
- If the CPU will not boot at all, set the mode switch to BOOT position and retry the transfer from AS.
7. Version Mismatch Symptoms and Resolution
7.1 Common Version Mismatch Scenarios
| Scenario | Symptom | Root Cause | Resolution |
|---|---|---|---|
| AS project AR != target AR | Transfer fails with version error | Project specifies a different AR than what is installed | Change Runtime to match target, or update target AR |
| Module firmware mismatch | Red blinking r LED on module; PLC logbook error 123416 | Module firmware doesn’t match what CPU expects | Transfer project again; install correct HW upgrade in AS |
| Standard library version mismatch | Compile error: “Module mtfilter has version V5.16 instead of required range V5.12” | Library version in project doesn’t match AS/AR version | Update library packages via Tools > Upgrades, or use correct AS version |
| AS version too new for AR | Target not found, or “No hardware” error | Newer AS cannot manage older AR targets | Install older AS version matching the AR generation |
| AS version too old for modules | Modules not listed in hardware catalog | HW upgrades for newer modules require newer AS | Install latest AS in the same major version line (e.g., AS 4.12 for AR 4.x) |
| Safety I/O false mismatch | Warning during boot but module runs normally | Known issue with certain safety module firmware versions | Verify in B&R community; ignore if module is operational and no real fault exists |
| Bus controller web interface issues | Cannot access BC web interface | Old BC firmware incompatible with modern TLS/browsers | Update BC firmware via Automation Studio download, or use older browser |
7.2 The “No Certificate” Problem
After upgrading AS (especially from v4.11 to v4.12.6 or to AS6), you may see a “No Certificate” status when trying to upgrade targets. This is related to B&R’s Technology Guarding cryptographic system. Resolution:
- Ensure the AS upgrade service has internet access (known issue in AS 6.5.2, fixed in 6.5.3)
- Reinstall the Technology Guard component
- Check that the evaluation license is active and valid
7.3 License Violation on Target
If the CPU’s RDY/F LED blinks yellow and the R/E LED blinks red simultaneously, this indicates a license violation. The application will not run. This typically occurs when:
- The AR version requires a license not present on the target
- The evaluation/runtime license has expired on the target
- A runtime feature (e.g., mapp components) requires additional licensing
Resolution: Upload the existing project from the target first (if possible), resolve the license issue, then re-transfer.
7.4 Configuration Version Mismatch
When trying to go online with a project that doesn’t match the target, AS will refuse the connection. The fix:
- Upload the configuration from the target (
Online > Upload) - Compare with the project offline
- Align the project to match the target, or vice versa
8. B&R Download Portal Access Issues for Non-Customers
8.1 What Requires Login
Most firmware files on br-automation.com require a B&R portal account. This includes:
- HW upgrade packages (module firmware)
- AR runtime upgrades
- Safety certificates
- Some product documentation
8.2 Workaround Strategies
| Strategy | How | Limitations |
|---|---|---|
| 90-day eval license | Register at br-automation.com/software-registration | Grants AS download; upgrade downloads work within AS |
| B&R Community Forum | community.br-automation.com — ask for guidance | Community members may provide firmware links or files |
| Local B&R office | Contact directly, explain the situation (defunct OEM, no support contract) | May provide files as a goodwill gesture |
| Industrial parts suppliers | EU Automation, all4sps, UsedBrAutomation | Some include firmware with module purchases |
| CF card archival | Back up every CF card you encounter | Pre-loaded CF cards contain the firmware that was running |
| Third-party forums | PLCTalk.net, Reddit r/PLC | Occasional file sharing, use at your own risk |
8.3 Self-Registration for Portal Access
As of recent B&R policy, anyone can register on br-automation.com for a basic account. The registration provides access to:
- Software downloads (including AS evaluation)
- Some firmware upgrade packages
- Product documentation and data sheets
- Automation Help (online documentation)
Register at: br-automation.com > Service > Software Registration
8.4 Downloading Firmware Via Automation Studio Tools > Upgrades
The primary method for obtaining AR runtime and hardware firmware packages is through Automation Studio itself, not the B&R website. This is a critical workflow for engineers without OEM support contracts:
How it works:
- Install Automation Studio (any version — evaluation license is sufficient for this purpose)
- Launch AS and go to Tools > Upgrades
- The upgrades dialog connects to B&R’s server and downloads a catalog of all available upgrades
- Select the target platform (e.g., “PPC5x” for X20CP1584) and browse available AR versions
- Click “Download Selected Upgrades” to download firmware packages to your local PC
- The downloaded packages are installed locally and become available for use in projects and online transfers
Important details from B&R Community (community.br-automation.com):
- The upgrade service accesses
https://www.br-automation.comto download files — your IT firewall must allow this - Downloaded files are temporarily stored in
C:\Temp(or extracted fromhttps://www.br-automation.com/addons_xml.zip) - The Windows service running the upgrade process needs rights to: access B&R homepage, download files to
C:\Temp, unzip files, and install them - If
Tools > Upgradesshows outdated or missing upgrades, delete everything inC:\Tempand restart the PC — this is the standard fix per B&R support - AS versions older than V4.6 have discontinued upgrade servers — if you need very old AR versions (3.0.x), you must use AS 3.0.90 or manually locate the upgrade files
Local upgrade installation:
If Tools > Upgrades > Online doesn’t work (no internet access, firewall issues, or discontinued service for older versions):
- Obtain the upgrade
.exeor.zipfiles from another source (colleague, archived backup, CF card extraction) - In AS, go to Tools > Upgrades > Local
- Point to the directory containing the upgrade files
- Install manually
With evaluation license:
Per the B&R Community, with an evaluation version of AS you can still download upgrades via Tools > Upgrades. The evaluation license is sufficient for this purpose. You must manually select and download the correct upgrade files.
8.5 Long-Term Firmware Archival Strategy
8.6 Known AR Version History for CP1584
This is a partial reconstruction of the AR version history relevant to the CP1584, compiled from community discussions, release notes, and field reports:
| AR Version | AS Version Required | Key Changes | Status |
|---|---|---|---|
| 3.0.90 | AS 3.0.90 | Initial CP1584 support (CPx58x migration from CPx48x) | Obsolete |
| 4.10 | AS 4.x | Major feature release for X20; widely deployed on CP1584 machines | Classic |
| 4.33 | AS 4.x | Enhanced OPC-UA, performance improvements | Classic |
| 4.80 | AS 4.x | OPC-UA FX, mappView improvements | Classic |
| 4.93 | AS 4.x (4.3.5+) | Latest AR 4.x; security patches (CVE-2025-11044, CVE-2025-3450) | Active |
| 6.x | AS 6.x | Next generation; requires hardware migration (CP1684 or newer) | Active |
Note: The jump from AR 4.x to AR 6.x is a generational change, not an incremental update. AR 6.x does NOT run on CP1584 hardware. The CP1584 maxes out at AR 4.93 (the latest AR 4.x release).
AR 4.93 is the recommended target for all CP1584 machines — it is the final AR 4.x release and includes all security patches. If your machine is running an older AR 4.x version, upgrading to 4.93 should be your first priority.
AR 4.93 upgrade packages for CP1584 (known filenames):
| Package | Filename | AR Version | Date | Size | Notes |
|---|---|---|---|---|---|
| Standard upgrade | AS4_AR_G0493_X20CP1584.exe | 4.93.x | 07/25/2023 | ~13 MB | Standard (no prefix) AR upgrade |
| Embedded upgrade | AS4_AR_E0493_X20CP1584.exe | E4.93.5.2 | 04/14/2023 | ~13 MB | Embedded variant (same hardware, different prefix) |
Note: Both
G(standard) andE(embedded) prefix variants exist for the CP1584 AR 4.93 upgrade. The correct one depends on which AR version string your CF card currently reports. Use the boot screen or SDM to check before downloading. If unsure, theG(no prefix) variant is the standard track for X20CP1584.
Since portal access can be revoked and OEM relationships don’t exist:
- Download and archive all upgrade packages from
Tools > Upgradeswhile you have AS access - Image every CF card immediately upon receiving a machine — store as
.imgor.isofiles - Document the upgrade chain — which AS version, which AR version, which HW upgrade versions for each module
- Store offline copies of Automation Studio installers — the installer contains the base upgrade set
- Maintain a version compatibility spreadsheet for each machine documenting the exact stack
9. Quick Reference Procedures
9.1 Complete Firmware Inventory (No Project Files)
1. Power cycle the machine, watch the boot screen — note AR version
2. Connect PC to machine network, scan for B&R devices (try 192.168.1.x)
3. Open browser to CPU IP — use SDM to catalog all I/O modules and firmware versions
4. If bus controllers are present, connect to their web interfaces for firmware info
5. For ACOPOS drives, check Service Menu for firmware version
6. Record everything in a firmware inventory log
9.2 Preparing a Development Environment From Scratch
1. Register for B&R evaluation license at br-automation.com
2. Download and install Automation Studio 4.12 (for AR 4.x targets)
3. Activate evaluation license via CodeMeter
4. Open AS, go to Tools > Upgrades
5. Click "Legacy" button to show all upgrade packages
6. Install the AR upgrade matching the target's current version
7. Install all HW upgrades — these cover module firmware
8. Create a new project matching the hardware configuration
9. Connect to the target and verify online access
9.3 Emergency Firmware Recovery
1. Power down the machine
2. Remove the CF card from the CPU
3. Insert the CF card into a PC card reader
4. Image the card (dd or Win32DiskImager) — save as backup
5. If you have a known-good CF image, restore it to the card
6. Reinsert CF card into CPU
7. Set mode switch to RUN
8. Power up — machine should return to the last known state
10. Troubleshooting Table
| Problem | First Check | Resolution Path |
|---|---|---|
| Cannot connect AS to target | Ping target IP | Check Ethernet cable, IP subnet, firewall |
| Target not found in AS | Online > Settings | Verify IP; mode switch must be in RUN |
| “No hardware” when going online | AS version vs AR version | AS version must match AR generation |
Module r LED blinking after transfer | Module firmware mismatch | Install correct HW upgrade; re-transfer |
| Transfer fails with version error | Project AR vs target AR | Change Runtime to match target |
| CF card not detected | CF LED on CPU | Try known-good CF card; check CF slot contacts |
| CPU stuck in SERVICE mode | Check PLC logbook via SDM | Address the error; warm restart from AS |
| Bus controller web interface not loading | Firmware too old for modern browsers | Update BC firmware via AS transfer |
| ACOPOS drive fault after AS transfer | Drive parameter mismatch | Re-transfer drive parameters; check .GDM version |
| Battery LED red | Backup battery depleted | Replace CR2477N battery within 1 minute |
Key Findings
-
The 90-day evaluation license is the primary access path. B&R’s self-service evaluation registration provides unrestricted AS functionality including
Tools > Upgradesfor downloading AR and HW packages. The 90-day window can be renewed indefinitely. This is the most practical method for non-customers to obtain firmware. -
Firmware lives in three layers. CPU (AR), I/O modules (HW firmware pushed by CPU via X2X), and drives (separate firmware). All three must be compatible for the system to function. Mismatches at any layer cause errors.
-
The CF card is a complete firmware snapshot. Backing up the CF card preserves the AR runtime, application, and module firmware references. This is your most important recovery asset. Archive every CF card image.
-
I/O module firmware is managed by the CPU, not individually. You cannot update a single X20 I/O module’s firmware in isolation — the CPU pushes firmware during the project transfer. The correct HW upgrade must be installed on the development PC.
-
AS 4.12 is the end of the line for X20CP1584. The CP1584 runs AR 4.x, and AS 4.12 is the last AS version in the 4.x product line. AS 6.x targets AR 6.x and is not backward compatible with AR 4.x targets. Always use AS 4.12 for these systems.
-
Version mismatches generate specific error patterns. Red blinking module LEDs, PLC logbook error 123416 for firmware mismatch, compile errors citing exact version ranges for library mismatches. Learn these patterns to diagnose quickly.
-
Downgrades are possible for CPU and I/O modules but not drives. CPU runtime can be changed via
Change Runtimein AS. I/O modules are automatically downgraded by the CPU during transfer. ACOPOS drives generally do not support firmware downgrade. -
Safety module firmware has legal constraints. Only firmware versions listed in the FS (Functional Safety) certificates are permitted. Never update safety module firmware without the correct certificate documentation. Some versions generate false mismatch warnings during boot — verify via B&R community before taking action.
-
The System Diagnostics Manager (SDM) is your best friend. Accessible via web browser at the CPU’s IP address, SDM provides complete firmware inventory, I/O topology, drive status, logbook access, and diagnostic tools without requiring Automation Studio or any B&R account. It works even when the PLC is in SERVICE mode.
-
Archive everything offline. Portal access, evaluation licenses, and community resources may not be available when you need them most. Store AS installers, upgrade packages, CF card images, and documentation on local media that is independent of any B&R infrastructure.
-
AR R4.93.5.2 is the latest available patch for CP1584. The V4.12 AR Upgrade package
AS4_AR_E0493_X20CP1584.exe(version 4.93.5.2, dated 2023-04-14) is the last known AR upgrade specifically for the X20CP1584. After applying this, the system is protected against CVE-2025-11044 (ANSL DoS), CVE-2025-3450 (SDM DoS), CVE-2023-3242 (Portmapper DoS), and CVE-2022-4286 (SDM XSS). However, CVE-2024-0323 (FTP weak TLS), CVE-2021-22275 (webserver buffer overflow), and the SA25P003 CVEs (CVE-2025-3449/3448/11498 — SDM session takeover, XSS, CSV injection) remain unpatched on all AR 4.x versions. -
B&R software lifecycle follows Active → Classic → Limited → Obsolete phases. Software/firmware maintenance starts during Active phase and continues through Classic. During Classic, B&R recommends not deploying new instances. The Limited phase ends production. See spare-parts.md for lifecycle details and remanufacturing.md for migration planning.
11. Complete CVE and Security Advisory Reference for AR 4.x
The CP1584 runs AR 4.x, which is the end-of-life firmware branch. Security patches are no longer being produced for AR 4.x. The following CVEs are known to affect AR 4.x systems. This is the definitive reference for understanding your security exposure.
11.1 CVEs Patched in AR 4.93.5.2 (Last AR 4.x Patch)
The AR upgrade package AS4_AR_E0493_X20CP1584.exe (version 4.93.5.2, dated 2023-04-14) is the last security update for AR 4.x on the CP1584. It addresses:
| CVE | CVSS | Component | Vulnerability | Status on AR 4.93.5.2 |
|---|---|---|---|---|
| CVE-2025-11044 | 7.5 (High) | ANSL Service | Denial of Service via crafted packet | Patched |
| CVE-2025-3450 | 7.5 (High) | SDM | Denial of Service via improper resource locking | Patched |
| CVE-2023-3242 | 7.5 (High) | Portmapper | Denial of Service via crafted request | Patched |
| CVE-2022-4286 | 6.1 (Medium) | SDM | Cross-site scripting (stored XSS) | Patched |
11.2 CVEs UNPATCHED on All AR 4.x Versions
These vulnerabilities remain unpatched on the CP1584 regardless of what AR 4.x version is installed. B&R has confirmed fixes only exist in AR 6.x+.
| CVE | CVSS | Component | Vulnerability | Impact | Mitigation |
|---|---|---|---|---|---|
| CVE-2025-3449 | 4.2 (Medium) | SDM | Session ID prediction — predictable session tokens allow session takeover | Network attacker can hijack SDM session | Disable SDM if not needed; place on isolated network segment |
| CVE-2025-3448 | 6.1 (Medium) | SDM | Reflected XSS — arbitrary JavaScript execution in browser | Attacker can execute code in victim’s browser via crafted URL | Use WAF; do not follow untrusted links to SDM |
| CVE-2025-11498 | 6.1 (Medium) | SDM | CSV injection — formula injection in exported CSV files | Attacker can inject formulas via crafted link to exported data | Do not open SDM CSV exports in Excel; use text editor |
| CVE-2024-0323 | 9.8 (Critical) | FTP Server | Use of broken/risky cryptographic algorithm (SSLv3, TLSv1.0, TLSv1.1) | Man-in-the-middle can decrypt FTP traffic including credentials and CF card backups | Disable FTP; use VPN for any FTP access; use SFTP tunnel |
| CVE-2021-22275 | 9.8 (Critical) | Web Server | Buffer overflow in web server | Remote code execution via crafted HTTP request | Disable web server; place on isolated network; use firewall |
| SA25P002 (ICSA-26-125-03) | 7.5 (High) | ANSL Server | DoS via insufficient throttling (newly disclosed) | Network attacker can cause ANSL service denial | Isolate ANSL traffic; use network firewall rules |
| SA25P007 (ICSA-26-141-03) | 9.8 (Critical) | Automation Studio | 25 SQLite CVEs (heap overflow, out-of-bounds read, use-after-free, NULL pointer deref) in bundled SQLite library. Criticals: CVE-2025-3277 (heap buffer overflow CVSS 9.8), CVE-2025-6965 (numeric truncation CVSS 9.8), CVE-2019-8457 (OOB read CVSS 9.8). Exploitation requires opening a crafted project file | Code execution via malformed .apj/.ar files | Upgrade AS to 6.5; do not open untrusted project files |
| SA24P011 | Varies | Multiple | Several vulnerabilities (see B&R advisory PDF) | Varies by component | Apply AR 4.93.5.2 if not already installed |
11.3 CVEs Patched in Earlier AR 4.x Versions
These were addressed in intermediate AR 4.x patches. If you are running an AR version earlier than 4.93.5.2, these also affect your system.
| CVE | CVSS | Patched In AR | Component | Vulnerability |
|---|---|---|---|---|
| CVE-2020-28207 | 9.8 (Critical) | ~4.80 | OPC-UA Server | Remote code execution via crafted OPC-UA message |
| CVE-2020-28208 | 9.8 (Critical) | ~4.80 | OPC-UA Server | Heap overflow in OPC-UA binary message decoder |
| CVE-2020-28209 | 9.8 (Critical) | ~4.80 | OPC-UA Server | Integer overflow in OPC-UA message processing |
11.4 Risk Assessment for CP1584 on Production Networks
Given the unpatched vulnerabilities, the CP1584 on a production network presents the following risk profile:
| Attack Vector | Severity | Likelihood | Impact | Mitigation |
|---|---|---|---|---|
| FTP credential capture (CVE-2024-0323) | Critical | High (any network attacker) | Full CF card access including credentials, configuration, and program backups | Disable FTP service; use VPN if FTP must be used; enforce network segmentation |
| Web server RCE (CVE-2021-22275) | Critical | Medium (requires crafted request) | Full system compromise | Disable web server; place CPU on isolated control network; use PLC-side firewall |
| SDM session takeover (CVE-2025-3449) | Medium | Low (requires network access + active session) | Read diagnostic data; no write impact | Disable SDM; monitor SDM access logs; use only from trusted workstations |
| SDM XSS (CVE-2025-3448) | Medium | Low (requires user to click crafted link) | Browser session compromise | Educate operators; do not follow untrusted links to PLC IP |
| ANSL DoS (CVE-2025-11044, SA25P002) | High | Medium | Loss of AS connectivity; inability to download/upload; no program changes | AR 4.93.5.2 patches CVE-2025-11044; isolate ANSL traffic for SA25P002 |
| OPC-UA RCE (CVE-2020-28207/208/209) | Critical | Low (requires OPC-UA enabled + network access) | Full system compromise | AR 4.80+ patches these; ensure AR >= 4.80 if OPC-UA is used; use OPC-UA security policies |
11.5 Practical Security Hardening for Legacy AR 4.x CP1584
Since no more patches are coming for AR 4.x, implement these compensating controls:
Network Segmentation (Most Important)
┌─────────────────────────────┐
│ Plant Ethernet Switch │
│ (managed, VLAN-capable) │
└──────────┬──────────────────┘
│
┌──────────┴──────────────────┐
│ Firewall / ACL Rules: │
│ - Block all inbound to PLC │
│ - Allow only ANSL (30303/11169 UDP)
│ - Allow OPC-UA (4840) from SCADA only
│ - Block FTP (21) at switch │
│ - Block HTTP (80/443) at switch│
└──────────┬──────────────────┘
│
┌──────────┴──────────────────┐
│ CP1584 Control Network │
│ (isolated VLAN or physical │
│ network segment) │
└─────────────────────────────┘
Service Disabling Checklist
| Service | Port | Disable If | How to Disable |
|---|---|---|---|
| FTP Server | 21 | Not needed for operations | CPU > FTP settings > uncheck (requires AS project download) |
| Web Server / SDM | 80/443 | SDM not needed for operations | CPU > System diagnostics > uncheck (requires AS project download) |
| OPC-UA Server | 4840 | OPC-UA not used | CPU > OPC-UA settings > disable (requires AS project download) |
| ANSL Discovery | 30303, 11169 UDP | Only needed during AS development | CPU > Ethernet > disable ANSL (requires AS project download) |
| VNC Server | 5900 | VNC not configured | N/A (only active if configured in project) |
Important limitation: Disabling services requires modifying the Automation Studio project and re-downloading. If you have no AS project and no credentials, the services remain active. In that case, network-level blocking is your only option.
Firewall Rules for PLC Protection
## iptables example for Linux-based firewall protecting a CP1584
## Block all inbound to PLC except required services
iptables -A INPUT -s <PLC_IP> -j DROP
## Allow ANSL from Automation Studio workstation only
iptables -A INPUT -s <AS_WORKSTATION_IP> -d <PLC_IP> -p udp --dport 30303 -j ACCEPT
iptables -A INPUT -s <AS_WORKSTATION_IP> -d <PLC_IP> -p udp --dport 11169 -j ACCEPT
## Allow OPC-UA from SCADA server only (if used)
iptables -A INPUT -s <SCADA_IP> -d <PLC_IP> -p tcp --dport 4840 -j ACCEPT
## Block FTP at the network level (CVE-2024-0323 mitigation)
iptables -A INPUT -d <PLC_IP> -p tcp --dport 21 -j DROP
## Block web server at the network level (CVE-2021-22275 mitigation)
iptables -A INPUT -d <PLC_IP> -p tcp --dport 80 -j DROP
iptables -A INPUT -d <PLC_IP> -p tcp --dport 443 -j DROP
11.6 B&R Security Advisory Reference Links
| Advisory | Source | URL |
|---|---|---|
| SA25P003 (SDM session takeover, XSS, CSV injection) | ABB PSIRT / CISA | ICSA-26-141-04 |
| SA25P002 (SDM DoS) | ABB PSIRT | SA25P002 PDF |
| SA25P003 CSAF JSON | GitHub | cisagov/CSAF |
| CVE-2025-3450 | NVD | NVD |
| CVE-2025-3449 | NVD | NVD |
| CVE-2025-3448 | NVD | NVD |
| CVE-2025-11498 | NVD | NVD |
| CVE-2024-0323 | Tenable | Tenable OT Plugin 503274 |
| CVE-2021-22275 | B&R / NVD | Search NVD |
| ANSL DoS (ICSA-26-125-03) | CISA | ICSA-26-125-03 |
| B&R Cyber Security Advisories Portal | B&R | br-automation.com/cyber-security |
| Community Cyber Security FAQ | B&R Community | community.br-automation.com |
Cross-References
| Related Document | Content | Relevance |
|---|---|---|
| firmware.md | Firmware architecture, CF card boot, update mechanism | The companion document covering firmware internals and the boot process |
| cf-card-boot.md | CF card file layout, boot sequence, firmware partitions | Understanding where firmware files live on the CF card |
| bootloader-recovery.md | Recovery mode, unbrick procedures, TFTP firmware reload | What to do when a firmware update fails |
| ar-rtos.md | AR internals, CVE table, OS architecture | Understanding which CVEs are fixed in which AR version |
| cybersecurity-hardening.md | Security hardening, unpatchable CVEs, network isolation | Why firmware updates matter for security |
| cp1584-hardware-ref.md | CP1584 hardware specs, LED codes, DIP switches | Hardware identification for firmware compatibility checks |
| remanufacturing.md | Migration paths, hardware replacement, platform changes | When to upgrade firmware vs replace hardware |
| ftp-web-interface.md | FTP access to CF card, remote firmware backup | Using FTP to back up firmware before updating |
Sources: B&R AR Upgrade download page (br-automation.com), B&R SA25P003/ICSA-26-141-04, B&R SA25P002, B&R Lifecycle Policy, CISA ICS Advisories, NVD vulnerability database, B&R Community Forum
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
B&R Spare Parts Identification and Compatible Hardware Reference
Overview
When you inherit a B&R CP1584-based machine from a defunct OEM with zero documentation, the first challenge is knowing what parts are installed and how to replace them. This guide covers practical methods for identifying B&R hardware from physical inspection alone, decoding the B&R order code system, finding compatible replacements for discontinued parts, building a spare parts inventory from scratch, and sourcing components from third-party channels.
B&R’s part numbering system is highly structured — once you understand the conventions, you can determine the exact specifications, power ratings, and compatibility of any module from the label alone.
1. Identifying B&R Part Numbers from Physical Inspection
1.1 Label Locations
B&R modules have their order number printed on a label affixed to the side or front face of every component. Look in these locations:
| Component Type | Label Location | Typical Label Content |
|---|---|---|
| X20 I/O modules | Side of the electronic module (the center slice) | Order number, B&R ID code, revision, serial number |
| X20 bus modules | Side of the bus module (bottom slice) | Order number, revision letter |
| X20 terminal blocks | Front face of the connector block | Part number stamped or printed |
| ACOPOS drives | Front face plate, left side | Full order number (e.g., 8V1016.00-2) |
| CPU modules (CP1584) | Side panel near the DIN rail clip | Order number, revision, serial number, firmware version |
| Interface modules (IFxxxx) | Side panel | Order number with variant suffix |
1.2 What You’ll Find on the Label
Every B&R module label contains at minimum:
- Order number — the full part number for ordering (e.g.,
X20DI9371,8V1016.00-2) - Revision — a letter+number code (e.g.,
H0,J0). Higher letters are newer hardware revisions - Serial number — a 12-digit alphanumeric code unique to that individual unit
- B&R ID code — a 4-digit hexadecimal hardware identifier used by the controller (e.g.,
0xC370for X20CP1584)
1.3 Using the Serial Number
B&R assigns a unique serial number to every hardware unit. The format is a 12-character alphanumeric string printed on the module label. You can:
- Look up serial numbers on the B&R website at
https://www.br-automation.com/en/search/— enter the serial number to find manufacturing date, warranty status, and firmware compatibility - Read serial numbers via software using Automation Studio’s HWInfo function, which returns both the 4-digit module ID and 8-digit serial number for every module in the X2X tree
- Use SDM (System Diagnostics Manager) to retrieve serial numbers of all connected modules through the web interface — see cp1584-forensics.md for SDM access procedures
1.4 Using Module ID Codes for Recognition
The B&R ID code is a 4-digit hex value (0x prefix) burned into every module’s firmware. The controller reads this at startup to identify what hardware is present. Key IDs:
| B&R ID Code | Module | Notes |
|---|---|---|
0xC370 | X20CP1584 | Your main CPU |
0xE21B | X20cCP1584 | Coated variant of CP1584 |
0xC3B0 | X20CP1586 | Faster sibling (1.6 GHz, Atom E680T) |
0xD45B | X20CP1583 | Slower sibling (333 MHz compatible) |
0x12C8 | 8V1090.00-2 | ACOPOS 1090 drive |
0x26D8 | X20BC0088 | Bus controller |
Use the HWInfo function block or browse the SDM web UI to dump the full module ID table from a running system. This is critical when labels are damaged or missing.
2. Reading B&R Order Codes
2.1 General Principles
B&R order codes follow a systematic naming convention. While the exact structure varies by product family, these rules hold across all B&R hardware:
- Prefix digits (e.g.,
8V,8AC,X20) identify the product family - Middle digits identify the specific model, power rating, or channel count
- Suffix after a dot (
.00-2) identifies options, accessories, and version - Coated variants are prefixed with
c(e.g.,X20cCP1584= coated X20CP1584)
2.2 X20 System Order Codes
The X20 system uses a prefix-based structure. Each I/O module is actually three separate parts stacked together:
+-------------------+
| Terminal Block | <- X20TB06 or X20TB12 (field wiring)
+-------------------+
| Electronic Module | <- X20DI9371, X20AO4622, etc. (the "smart" part)
+-------------------+
| Bus Module | <- X20BM11, X20BM31, X20BM01 (backplane)
+-------------------+
X20 I/O Module Naming Convention
Format: X20 + TT + CC + SS + [-N]
| Position | Meaning | Examples |
|---|---|---|
TT | Module type | DI = Digital Input, DO = Digital Output, AI = Analog Input, AO = Analog Output, AT = Temperature, CM = Counter, MM = Motion, DC = DC motor, SI = Safety Input, SO = Safety Output, BC = Bus Controller, PS = Power Supply, IF = Interface, BM = Bus Module, TB = Terminal Block |
CC | Channel count / capability | 93 = 12-ch digital, 46 = 4-ch analog, 11 = basic bus module |
SS | Subtype / feature variant | 71 = 24VDC sink, 22 = 0-20mA/4-20mA |
-N | Variant suffix (optional) | -1 = variant revision, indicates specific connector or feature set |
X20 CPU Module Naming Convention
Format: X20 + [c] + CP + N + G + PP
| Position | Meaning | Values |
|---|---|---|
c | Coated variant | Present = conformal-coated for harsh environments (corrosive gas, condensation) |
CP | CPU module | CompactProcessor |
N | Number of interface slots | 1 = 1 slot (CP158x), 3 = 3 slots (CP358x) |
G | CPU generation | 5 = Atom E6xx series, 6 = newer generation, E = X20EM (newest, ARM-based) |
PP | Performance tier | 83 = 333 MHz, 84 = 600 MHz, 85 = 1.0 GHz, 86 = 1.6 GHz |
Key cross-compatibility note: X20CPx58x and X20CPx68x are not drop-in replacements for each other. You must update the hardware configuration in Automation Studio. Similarly, the new X20EM series requires different firmware and is not a direct replacement for the CP series.
| Module | Processor | RAM | Interface Slots | Shortest Task Cycle |
|---|---|---|---|---|
| X20CP1583 | Atom 333 MHz | 128 MB DDR2 | 1 | 800 us |
| X20CP1584 | Atom 600 MHz | 256 MB DDR2 | 1 | 400 us |
| X20CP1585 | Atom 1.0 GHz | 256 MB DDR2 | 1 | 200 us |
| X20CP1586 | Atom 1.6 GHz | 512 MB DDR2 | 1 | 100 us |
| X20CP3584 | Atom 600 MHz | 256 MB DDR2 | 3 | 400 us |
| X20CP3586 | Atom 1.0 GHz | 512 MB DDR2 | 3 | 100 us |
2.3 ACOPOS Drive Order Codes (8V1 Series)
Format: 8V1 + RRR + . + OO + - + V
| Position | Meaning | Examples |
|---|---|---|
8V1 | ACOPOS single-axis servo drive family | Always this prefix for single-axis drives |
RRR | Current rating / power class | 010 = 1.5 A / 0.75 kW, 016 = 3.6 A / 0.75 kW, 022 = 4 A / 1.5 kW, 045 = 8 A / 4 kW, 090 = 16 A / 8 kW, 132 = 34 A / 16 kW, 180 = 48 A / 24 kW |
.OO | Options code | .00 = standard (integrated line filter, no plug-in module) |
-V | Version | -2 = current hardware version |
ACOPOS 8V1 Drive Range
| Order Number | Mains Voltage | Current | Power | Notes |
|---|---|---|---|---|
| 8V1010.00-2 | 3x 400-480 V | 1.5 A | 0.75 kW | Smallest single-axis |
| 8V1016.00-2 | 3x 110-230 V / 1x 110-230 V | 3.6 A | 0.75 kW | Low voltage variant |
| 8V1016.50-2 | 3x 110-230 V / 1x 110-230 V | 3.6 A | 0.75 kW | With line filter |
| 8V1022.00-2 | 3x 400-480 V | 4 A | 1.5 kW | |
| 8V1045.00-2 | 3x 400-480 V | 8 A | 4 kW | Common on packaging machines |
| 8V1090.00-2 | 3x 400-480 V | 16 A | 8 kW | Common on larger machines |
| 8V1180.00-2 | 3x 400-480 V | 48 A | 24 kW | High power |
The number after 8V1 roughly correlates with current: 010 ~1.5A, 016 ~3.6A, 022 ~4A, 045 ~8A, 090 ~16A, 132 ~34A, 180 ~48A.
2.4 ACOPOS P3 Drive Order Codes (8EI Series)
Format: 8EI + ccc + d + e + f + g + h + i + kk + -1
| Position | Meaning | Values |
|---|---|---|
8EI | ACOPOS P3 servo drive family | Multi-axis drive platform |
ccc | Continuous current (Aeff) | 1X6=1.6A, 2X2=2.2A, 4X5=4.5A, 8X8=8.8A, 013=13A, 017=17A, 022=22A, 024=24A, 034=34A, 044=44A |
d | Voltage class | H=3x200-480VAC, M=3x200-230V or 1x110-230VAC |
e | Mounting | W=wall mounting |
f | Axis count | S=1-axis, D=2-axis, T=3-axis |
g | Safety/encoder | 1=hardwired STO, S=SafeMOTION with digital encoder |
h | Module-specific options | 0=standard, 1=dual-use (export restricted) |
i | Plug-in module included | 0=none, A=resolver 1x, C=resolver 3x, D=digital I/O, H/J=digital multi-encoder, K/L=incremental encoder, M/N=analog multi-encoder, P=digital I/O with terminal |
kk | Configurable accessories | 00=none, 01-7=combinations of braking resistor, front cover, connector sets |
-1 | Version | Current version |
2.5 ACOPOSmotor Order Codes (8DI Series)
Format: 8DI + c + d + e + . + ff + ggg + h + i + k + -1
| Position | Meaning | Values |
|---|---|---|
c | Frame size | 3, 4, or 5 (larger = more power) |
d | Length variant | 3-6 (determines power data within a frame size) |
e | Safety technology | 0=hardwired safety, S=SafeMOTION EnDat 2.2 |
ff | Encoder system | S8/S9=EnDat single/multi-turn, size 3; SA/SB/DA/DB=size 4/5 |
ggg | Nominal speed (rpm) | 022=2200 rpm, 045=4500 rpm |
h | Electronics options | 0=standard, 7=with POWERLINK + 24V outputs + trigger inputs |
i | Motor options | 0-7 = combinations of holding brake, keyed shaft, oil seal |
k | Special options | 0=none, 1=special-purpose shaft |
2.6 Bus Module and Power Supply Order Codes
| Order Number | Description | Usage |
|---|---|---|
| X20BM01 | Bus module, 24 VDC, single-width | Standard digital/analog I/O |
| X20BM11 | Bus module, 24 VDC, single-width (updated) | Replacement for BM01 in newer builds |
| X20BM31 | Bus module, 24 VDC, double-width | For double-width I/O modules |
| X20BM12 | Bus module, 240 VAC | For AC-voltage I/O modules |
| X20PS2100 | Power supply, 24 VDC, system | Standard system power |
| X20PS2110 | Power supply, 24 VDC, with diagnostics | Diagnostic variant |
| X20PS3300 | Power supply, 24 VDC, 3A | Compact supply |
| X20PS3310 | Power supply, 24 VDC, 3A, extended features | With additional I/O power |
2.7 Accessory Order Codes
| Order Number | Description | Notes |
|---|---|---|
4A0006.00-000 | Backup battery, CR2477N, 3V/950mAh | Replaces every 4 years; CRITICAL — must be Renata CR2477N only |
0AC201.91 | Lithium batteries, 4 pcs | Bulk pack |
X20TB06 | 6-pin terminal block, 24V coding | Standard for digital I/O |
X20TB12 | 12-pin terminal block, 24V coding | Used on CPUs and analog modules |
X20AC0SR1 | X20 end cover plate (right) | Required to terminate unused slots |
5CFCRD.1024-06 | CompactFlash 1 GB, B&R SLC | CF card for CP158x application memory |
5CFCRD.2048-06 | CompactFlash 2 GB, B&R SLC | Larger CF card |
5CFCRD.8192-06 | CompactFlash 8 GB, B&R SLC | Maximum capacity for CP158x |
8AC110.60-3 | ACOPOS plug-in module, CAN interface | For CAN-based ACOPOS communication |
8AC110.60-2 | ACOPOS plug-in module, CAN interface | Older revision |
3. Finding Compatible Replacement Modules
3.1 I/O Module Hot-Swap Compatibility
X20 I/O modules support hot-swap in most configurations. The key compatibility rules:
Terminal blocks are universal within their pin-count class:
- All
X20TB06blocks interchange with any 6-pin X20 electronic module - All
X20TB12blocks interchange with any 12-pin X20 electronic module
Bus modules must match the voltage class:
X20BM01/X20BM11/X20BM31for 24 VDC I/O modulesX20BM12for 240 VAC I/O modules- Mixing voltage classes on the same bus segment will cause faults
Electronic modules are independent of bus/terminal:
- Any X20 electronic module (DI, DO, AI, AO, AT, etc.) plugs into any matching-width bus module
- You can swap a
X20DI9371for aX20DI6371as long as the application mapping is updated in Automation Studio - The controller detects the new module type via the B&R ID code automatically
3.2 CPU Upgrade Path from CP1584
If your CP1584 fails or needs replacement:
| From | Direct Replacement | Upgrade Path | Notes |
|---|---|---|---|
| X20CP1584 | X20CP1584 (same rev or newer) | X20CP1585 (1.0 GHz) | Same slot count, faster processor |
| X20CP1584 | X20CP1584 | X20CP1586 (1.6 GHz) | Same slot count, fastest in 1-slot series |
| X20CP1584 | X20CP1584 | X20CP3584 (3 slots) | More interface slots, same clock |
| X20CP1584 | X20cCP1584 (coated) | — | If environment requires conformal coating |
Migration from CPx48x to CPx58x requires Automation Studio V3.0.90.20 or later and firmware upgrades for some interface modules. Refer to B&R’s migration guide (see table in Section 12).
3.3 ACOPOS Drive Replacement
When replacing an ACOPOS drive:
- Match the current rating — use the same or next-higher
8V1model number - Match the mains voltage —
8V1016(low voltage) is NOT interchangeable with8V1045(high voltage) without rewiring - Transfer plug-in modules — remove encoder interface, I/O, and communication modules from the failed drive and install in the replacement
- Re-download
acp10sys— the controller will automatically push configuration to the new drive on startup. See acopos-drives.md for details on theacp10sysconfiguration file - Re-configure node addressing — if using CAN, set the node number on the replacement drive’s hex switches to match the original
Critical: A new ACOPOS drive ships with factory defaults and NO configuration. Without a valid acp10sys download from the controller, it will not operate.
3.4 CompactFlash Card Replacement
The CP1584 stores its application on a CompactFlash card. CF cards are consumable items with finite write cycles.
Compatible CF cards for X20CP158x:
| Order Number | Capacity | Type | Notes |
|---|---|---|---|
5CFCRD.0512-06 | 512 MB | B&R SLC | Minimum recommended |
5CFCRD.1024-06 | 1 GB | B&R SLC | Standard choice |
5CFCRD.2048-06 | 2 GB | B&R SLC | Good for logging-heavy applications |
5CFCRD.4096-06 | 4 GB | B&R SLC | Large applications |
5CFCRD.8192-06 | 8 GB | B&R SLC | Maximum supported |
Important: Use only B&R-branded SLC (Single-Level Cell) CF cards. Commercial MLC cards will fail prematurely under industrial write patterns. Extended temperature variants (0CFCRD.0512E.01) are available for extreme environments.
For CF card backup and cloning procedures, see cf-card-boot.md.
4. Cross-Referencing Discontinued Parts
4.1 How B&R Manages Product Lifecycle
B&R (as part of ABB since 2017) follows a structured product lifecycle with four phases:
| Phase | Status | Availability | Customer Action |
|---|---|---|---|
| Active | Full production | Unconditionally available for order | Use for new projects |
| Classic | Superseded but still produced | Available, but do not use for new projects | B&R notifies customers 3 years before phase-out; plan migration |
| Limited | Last-Time-Buy (LTB) phase | Only LTB orders fulfilled; no new orders accepted | Must have placed binding LTB order during Classic phase |
| Obsolete | No longer manufactured | B&R repair service available for 3 years after obsolescence | Source from third-party refurbishers or upgrade |
Last-Time-Buy (LTB) Process:
- During the Classic phase, B&R notifies customers of the upcoming phase-out
- Customers must place a binding LTB order specifying annual quantities for the Limited phase
- If B&R accepts the order, quantities are binding — cancellation fees apply (50% for standard, 85% for customized)
- Prices are staggered per delivery year during the Limited phase
- After the Limited phase ends, the product becomes Obsolete
Checking Lifecycle Status:
- Online:
https://www.br-automation.com— product pages show lifecycle status - Customer portal: Log in to view lifecycle status of purchased products
- B&R support: Contact for lifecycle matrix queries
- SDM: Connected modules show hardware revision; cross-reference with B&R lifecycle database
Source: B&R Lifecycle Policy
X20 System Longevity Note: The X20 system celebrated its 20th anniversary in 2024 with B&R confirming continued development and long-term availability. B&R Product Manager Andreas Hager stated the X20 “will remain crucial to the success of machine builders in the future.” This means X20 IO modules, bus controllers, and interface modules are likely to remain available for the foreseeable future, reducing spare-parts risk for the IO layer even as individual CPU models cycle through the lifecycle.
Source: B&R Press Release, October 2024
4.2 Common Discontinued Parts and Replacements
| Discontinued Part | Replacement | Migration Notes |
|---|---|---|
| X20CP1484 (V4.xx firmware) | X20CP1584 | Newer firmware, different module ID. Requires Automation Studio update and project re-configuration |
| X20CP0484 | X20CP1584 | Significant hardware generation change. Requires firmware migration |
| X20BM01 (early revisions) | X20BM11 | Drop-in replacement on same bus segment |
| Power Panel PP100/PP015 | X20CP1584 + separate HMI | Requires full application rewrite |
| ACOPOS with CAN communication | ACOPOS with POWERLINK | Requires interface module change and protocol migration |
| CompactFlash cards < 256 MB | 5CFCRD.1024-06 (1 GB SLC) | Older small cards may not have enough space for newer firmware |
4.3 Interrogating the Controller for Installed Hardware
When you have no documentation, use these methods to discover exactly what hardware is installed:
Method 1: SDM Web Interface
- Connect to the CP1584 via Ethernet
- Open a browser to
http://<PLC-IP>/sdm/ - Navigate to Hardware > Modules to see every module in the X2X tree with its order number, revision, and serial number
Method 2: Automation Studio Online Connection
- Create a new project in Automation Studio
- Add a generic X20CP1584 to the hardware tree
- Connect online via Ethernet or RS232
- Use “Upload from target” to pull the actual hardware configuration
Method 3: ANSL Discovery + Telnet/SSH
- Use Wireshark to capture ANSL packets (UDP ports 30303, 11169) to find the PLC
- Telnet to the PLC’s IP and use B&R diagnostic commands to query the module table
- See cp1584-forensics.md for detailed procedures
Method 4: Physical Walkdown
- Photograph every module label in the cabinet
- Record the position (DIN rail slot number) and order number
- Note the wiring connections on each terminal block
- Build a physical inventory spreadsheet
4.4 Checking B&R ID Codes Against Known Values
The controller’s hardware tree uses B&R ID codes internally. When you read these via HWInfo, you can cross-reference against the known ID table. If you encounter an unknown ID code, search the B&R Automation Help system or post on the B&R Community forum (https://community.br-automation.com).
5. Building a Spare Parts Inventory for Defunct OEM Machines
5.1 Prioritization Framework
When building a spare parts inventory with limited budget, prioritize by criticality x difficulty of sourcing x lead time:
Tier 1 — Keep on Hand (immediate failure = machine down):
- CP1584 CPU unit or equivalent upgrade
- CompactFlash card with known-good backup image
- Backup batteries (CR2477N) — at least 2 per machine
- Most-commonly-used I/O modules (digital inputs, digital outputs)
- ACOPOS drives (at least one spare per unique current rating in use)
- Power supply modules (X20PS series)
Tier 2 — Source Within 48 Hours (failure degrades capability):
- Less-common I/O modules (analog, temperature, special function)
- Interface modules (IFxxxx for fieldbus communication)
- Terminal blocks (X20TB06, X20TB12)
- Bus modules (X20BM11, X20BM31)
- End cover plates (X20AC0SR1)
- ACOPOS plug-in modules (encoder interfaces, I/O modules)
Tier 3 — Source Within 2 Weeks (failure reduces functionality):
- HMI panels and touch screens
- Network cables and connectors
- Additional CompactFlash cards
- Mounting hardware and DIN rail accessories
5.2 Minimum Recommended Spares for a CP1584 Machine
| Qty | Part Number | Description | Rationale |
|---|---|---|---|
| 1 | X20CP1584 | CPU, Atom 600 MHz | CPU failure = total machine stop |
| 2 | 5CFCRD.1024-06 | CF card 1 GB SLC | One spare + one backup image carrier |
| 4 | 4A0006.00-000 | Backup battery CR2477N | Replace every 4 years; keep extras |
| 2 | X20DI9371 (or your specific DI module) | Digital input module | Most common failure point |
| 2 | X20DO9322 (or your specific DO module) | Digital output module | High cycle count, wear-prone |
| 1 | X20BM11 | Bus module | Bus module failure takes down entire segment |
| 1 | X20PS2100 | System power supply 24 VDC | Power supply failure = total stop |
| 1 | Matching ACOPOS drive (your model) | Servo drive | Match your highest-current axis drive |
| 1 | Matching ACOPOS plug-in module | Encoder interface | For your specific motor encoder type |
| 2 | X20TB06 | 6-pin terminal block | Wiring damage during maintenance |
| 2 | X20TB12 | 12-pin terminal block | Wiring damage during maintenance |
5.3 Creating the Inventory from an Undocumented Machine
Step-by-step procedure:
-
Network discovery — Follow cp1584-forensics.md to connect to the PLC and pull the hardware tree via SDM
-
Capture the hardware configuration via brwatch — Use the
brwatchGUI tool (github.com/hilch/brwatch) to browse the PLC’s variable tree and extract module info. brwatch is a Windows-only GUI application that requires B&R PVI to be installed. It cannot be pip-installed and has no CLI/JSON mode. To capture hardware info:- Download brwatch.exe from github.com/hilch/brwatch/releases
- Configure
BRWATCH.iniwith ANSL=1 (or leave as INA for older AR) - Click the TCP device node to scan for PLCs on the network
- Browse the CPU node to see all connected hardware
- Use File > Save to preserve the watch configuration
- See pvi-api.md and access-recovery.md for alternatives using PVI Python or OPC-UA
-
Create a system dump for full inventory — The
systemdump.pytool (github.com/hilch/systemdump.py) can generate an inventory from a dump file:
pip install systemdumpy
## Create and download a system dump from the PLC
py -m systemdumpy 192.168.1.10 -cuv -p Inventory_
## Extract hardware inventory as .xlsx spreadsheet
py -m systemdumpy Inventory_BuR_SDM_Sysdump_2026-07-10_14-30-55.tar.gz -iv
The resulting .xlsx file contains a complete inventory of all modules with order numbers, serial numbers, firmware versions, and status — ready to paste into your spare parts BOM spreadsheet.
-
Physical walkdown — Walk every cabinet and photograph every module. Record position, order number, revision, and wiring connections. Pay special attention to:
- ACOPOS drives in the drive cabinet
- Bus couplers and remote I/O nodes
- Any non-B&R components (relays, contactors, fuses)
-
Build a BOM spreadsheet with columns:
- Position/location in cabinet
- Order number
- Description
- Revision
- Serial number
- B&R ID code (from SDM)
- Quantity installed
- Spare quantity on hand
- Supplier / last price
- Lead time
- Priority tier
-
Identify unique vs. common parts — Group parts by order number. Parts used in only one position are highest risk (no redundancy)
-
Determine obsolescence status — For each unique order number, check:
- B&R website product lifecycle
- Third-party distributor stock levels
- Community forums for replacement discussions
-
Order critical spares — Start with Tier 1 items, then Tier 2 based on budget
5.4 Backup Strategy
Beyond physical spare parts, maintain these digital backups:
| Backup Type | What | Where | Frequency |
|---|---|---|---|
| CF card image | Full binary clone of CF card | Offline storage (USB drive, NAS) | After every program change |
| Automation Studio project | .apj file + all source | Version control (Git) | After every change |
acp10sys configuration | Drive parameter file | Export from project | After any drive parameter change |
| Hardware configuration | Module list with order numbers | Spreadsheet + photos | After any hardware change |
| Network configuration | IP addresses, node numbers, firmware versions | Documentation | After any network change |
See cf-card-boot.md for CF card imaging procedures and project-reconstruction.md for project recovery.
6. Third-Party Sources for B&R Parts
6.1 Authorized B&R Channels
| Channel | Contact | Best For |
|---|---|---|
| B&R Direct (ABB) | https://www.br-automation.com | New parts, warranty, technical support, firmware |
| B&R Support Portal | Online ticket system | Technical issues, obsolescence queries |
| B&R Value Providers | Find at https://www.br-automation.com | Local sales, commissioning, spare parts stock |
6.2 Third-Party Distributors (New and Surplus)
| Distributor | Website | Specialty | Warranty |
|---|---|---|---|
| EU Automation | euautomation.com | Wide B&R stock, fast delivery, obsolete parts | 12 months |
| Wake Industrial | wakeindustrial.com | Repair, replacement, refurbishment, surplus purchase | Varies |
| Allaoui | allaoui.com | Genuine and compatible B&R parts, global shipping | Varies |
| CJS Automation | cjsautomation.com | New, reconditioned, obsolete B&R parts | 12 months |
| AI Automation | aiautomation.global | Legacy and obsolete B&R parts, US-based | 12 months |
| KC Kim Consulting | kc-co.com | B&R spare parts export, global | Varies |
| K2 Automation | k2automation.com | Legacy B&R parts, full compatibility | Varies |
| Xindustra | xindustra.com | ACOPOS, X20 I/O, HMI, industrial PCs | 12 months |
| Larraioz Elektronika | larraioz.com | Spain-based, large B&R stock, obsolete elements | Varies |
| Classic Automation | classicautomation.com | B&R surplus and repair services | Varies |
| Automation Warehouse | automation-warehouse.com | Surplus and refurbished B&R products | Varies |
| Omega Electronics | omega-e.eu | B&R repair — PLC, HMI, drives | Varies |
| Standard Exchange Industry | standard-exchange-industry.com | France-based, B&R servo drives | Varies |
| all4sps | all4sps.com | Large inventory, datasheets available online | Varies |
6.3 Repair Services
For drives and modules that can be repaired rather than replaced:
| Service | Type | Notes |
|---|---|---|
| Wake Industrial | ACOPOS drive repair, refurbished units | US-based, phone: 1-919-443-0207 |
| Omega Electronics | PLC, HMI, drive repair | Power modules, I/O, cooling systems |
| Standard Exchange Industry | Servo drive repair and exchange | Exchange program for faster turnaround |
6.4 Online Marketplaces (Use with Caution)
| Platform | Notes |
|---|---|
| eBay | Many B&R parts listed; verify seller reputation, check for counterfeit risk. Search by full order number |
| Alibaba | Some B&R-compatible parts from Chinese suppliers. Quality varies widely. Verify specifications carefully |
| IndiaMART | Some B&R parts available from Indian distributors at competitive prices |
Warning when buying from marketplaces:
- Always verify the full order number including suffix (
.00-2matters) - Check hardware revision — older revisions may not be compatible with your firmware
- Request photos of the actual label, not stock photos
- Prefer sellers who test before shipping
- Budget for potential returns — some marketplace sellers charge restocking fees
6.5 B&R Community Forum
The B&R Community (https://community.br-automation.com) is an invaluable resource for:
- Asking about discontinued parts and replacements
- Confirming compatibility between module revisions
- Getting help with order code interpretation
- Finding migration guides for older hardware
- B&R engineers actively participate in discussions
7. Lead Times and Availability Considerations
7.1 Typical Lead Times
| Source | New Parts | Surplus/Refurbished | Repair Turnaround |
|---|---|---|---|
| B&R Direct (active parts) | 2-8 weeks | N/A | 4-12 weeks |
| EU Automation (in-stock) | Next day - 1 week | Same/next day | N/A |
| Wake Industrial | 1-2 weeks | 1-3 days | 1-3 weeks |
| Allaoui / CJS / Xindustra | 1-4 weeks | 1-2 weeks | N/A |
| eBay / marketplaces | 1-5 days | 1-5 days | N/A |
| Repair services | N/A | N/A | 1-4 weeks depending on fault |
7.2 Factors Affecting Availability
- Active vs. obsolete — Active B&R parts are available through B&R and distributors. Obsolete parts require surplus channels or repair
- Voltage variants — Low-voltage ACOPOS drives (8V1016 series) are less common than high-voltage (8V1045/1090 series) and may have longer lead times
- Coated modules — X20c (conformal-coated) variants are less common than standard X20 and may need to be ordered from B&R directly
- CF cards — B&R-branded SLC CF cards are becoming harder to source as CompactFlash is being phased out industry-wide. Stock up while available
- Battery (CR2477N) — Standard lithium cell, available from battery suppliers. Not B&R-specific, but must be the Renata CR2477N to avoid fire/explosion risk
- Global chip shortages — Since 2020, industrial semiconductors have experienced intermittent shortages. Active B&R parts may have extended lead times during shortage periods
7.3 Emergency Sourcing Strategy
When a critical part fails and no spare is available:
- Check all third-party distributors simultaneously — Use the order number to search EU Automation, Wake Industrial, CJS, and Allaoui in parallel
- Check eBay with exact order number — Sort by “Buy It Now” for fastest procurement
- Consider repair — Send the failed unit to a repair service (Wake Industrial, Omega Electronics). Even a 2-week repair is better than a 2-month new-part wait
- Consider upgrade — If the exact part is obsolete, a newer compatible part may be in stock. Check B&R’s migration guides
- Contact B&R support — Even if you have no direct relationship, B&R support can check global inventory across their distribution network
- Cross-post on the B&R Community — Other engineers may have spare units they are willing to sell
8. Practical Walkdown Checklist
Use this checklist when doing a first-time physical inspection of an undocumented B&R machine:
Cabinet 1 — Main Control Cabinet
- Photograph every DIN rail with all modules installed
- Record CPU module order number, revision, serial number (typically X20CPxxxx)
- Record all I/O module order numbers (DI, DO, AI, AO, AT)
- Record all bus module order numbers (X20BMxx)
- Record power supply modules (X20PSxxxx)
- Record interface modules (X20IFxxxx)
- Note bus couplers (X20BC0087, X20BC0088) if present
- Record terminal block types (X20TB06, X20TB12)
- Check battery compartment — is a battery installed? Note replacement date
- Check CF card — is one installed? Note capacity marking
- Photograph the interior wiring layout
Cabinet 2 — Drive Cabinet (if separate)
- Record all ACOPOS drive order numbers (8V1xxx.xx-x)
- Record all ACOPOS plug-in modules (8AC110.xx-x)
- Note the plug-in module installed in each drive slot
- Record motor nameplates (8DI, 8LS, 8LVA, 8WSA series)
- Record drive node addresses from hex switches
- Photograph the DC bus and power wiring
- Note any fusing and their ratings
Cabinet 3 — Field I/O (if remote nodes exist)
- Record bus couplers at each remote node
- Record all I/O modules at each node
- Record bus receiver/transmitter modules (X20BR9300, X20BT9100)
- Photograph cable routing and node addresses
Network Configuration
- Record all Ethernet station addresses (hex switches on CPUs and interfaces)
- Record POWERLINK node numbers
- Capture the network diagram from the physical cable routing
- Note any managed switches or network infrastructure
10. Migration Checklist for CPx48x to CPx58x
When upgrading from X20CPx48x generation to X20CPx58x (e.g., from CP1484 to CP1584), the following interface modules require specific hardware revisions or firmware upgrades:
| Interface Module | Minimum Upgrade Version | Minimum Hardware Revision |
|---|---|---|
| X20IF1020 | 1.1.5.1 | H0 |
| X20IF1030 | 1.1.5.1 | I0 |
| X20IF1041-1 | — | — |
| X20IF1043-1 | — | — |
| X20IF1051-1 | — | — |
| X20IF1053-1 | — | — |
| X20IF1061 | — | E0 |
| X20IF1061-1 | — | — |
| X20IF1063 | 1.1.5.0 | — |
| X20IF1063-1 | — | — |
| X20IF1065 | — | — |
| X20IF1072 | 1.0.5.1 | — |
| X20IF1082 | 1.2.2.0 | — |
| X20IF1082-2 | 1.2.1.0 | — |
| X20IF1086-2 | 1.1.1.0 | — |
| X20IF1091 | 1.0.5.1 | — |
| X20IF2772 | 1.0.6.1 | — |
| X20IF2792 | 1.0.5.1 | — |
Modules not listed require no upgrade — they are compatible as-is.
Requires Automation Studio V3.0.90.20 minimum.
11. Quick Reference: Order Number to Specification Lookup
Digital Input Modules
| Order Number | Channels | Voltage | Wiring | Filter |
|---|---|---|---|---|
| X20DI6371 | 6 | 24 VDC | 1 or 2 wire | Configurable |
| X20DI9371 | 12 | 24 VDC | 1 wire (sink) | Configurable |
| X20DI9372 | 12 | 24 VDC | 1 wire (source) | Configurable |
Digital Output Modules
| Order Number | Channels | Voltage | Type |
|---|---|---|---|
| X20DO9322 | 8 | 24 VDC | Transistor (source) |
| X20DO6321 | 4 | 24 VDC | Transistor (sink) |
Analog Input Modules
| Order Number | Channels | Range | Resolution |
|---|---|---|---|
| X20AI4622 | 4 | 0/4-20 mA | 16-bit |
| X20AI4631 | 4 | 0-10 V | 16-bit |
| X20AI2631 | 2 | +/-10 V | 24-bit |
Analog Output Modules
| Order Number | Channels | Range | Resolution |
|---|---|---|---|
| X20AO4622 | 4 | 0/4-20 mA | 16-bit |
| X20AO2622 | 2 | +/-10 V | 16-bit |
Temperature Modules
| Order Number | Type | Channels |
|---|---|---|
| X20AT6421 | RTD (Pt100/NI1000) | 4 |
| X20AT6401 | Thermocouple | 4 |
Bus Controllers
| Order Number | Fieldbus | Notes |
|---|---|---|
| X20BC0087 | POWERLINK V1/V2 | Most common for CP1584 systems |
| X20BC0088 | POWERLINK V2 only | Updated variant |
| X20BC0083 | EtherNet/IP | For integration with non-B&R systems |
Key Findings
-
Every B&R module label follows a structured order code — once you learn the convention for each product family (X20, 8V1, 8EI, 8DI), you can determine specifications, power ratings, and compatibility from the part number alone without any documentation.
-
The X20 system’s three-part module design (terminal block + electronic module + bus module) means individual components can be replaced independently. Terminal blocks and bus modules are universal within their class; only the electronic module is specific to the I/O function. See io-card-hardware.md for signal processing details.
-
CPU upgrades within the CP158x family are generally compatible (CP1583/1584/1585/1586 share the same platform), but crossing generations (CPx48x → CPx58x → X20EM) requires Automation Studio project changes and firmware upgrades for interface modules. See cp1584-hardware-ref.md for hardware specifications and firmware-version-mgmt.md for version compatibility.
-
ACOPOS drives require
acp10sysdownload from the controller — a replacement drive will not operate until the controller pushes its configuration on startup. Always verify your controller has the correctacp10sysbefore replacing a drive. See acopos-drives.md for the complete drive management procedures. -
B&R serial numbers can be looked up on the B&R website (
https://www.br-automation.com/en/search/) to determine manufacturing date and compatibility. The B&R ID code (4-digit hex) can be read viaHWInfoor SDM to identify modules even when labels are missing or damaged. -
Third-party distributors are the primary sourcing channel for machines from defunct OEMs. EU Automation, Wake Industrial, CJS, Allaoui, and Xindustra all maintain significant B&R stock with 12-month warranties. Budget 1-4 weeks for standard delivery and keep critical Tier 1 spares on hand.
-
CompactFlash cards are the most critical consumable — use only B&R-branded SLC cards. Stock multiple cards and maintain verified backup images. CF card failure is the most common cause of unplanned downtime on CP1584 machines. See cf-card-boot.md for imaging and backup procedures.
-
The backup battery (Renata CR2477N) must be replaced every 4 years and is the only permitted battery type. Using a different battery is a fire and explosion hazard per B&R’s safety documentation. This item should always be in your spares inventory. See retentive-data.md for battery replacement procedures.
-
The B&R Community forum is an active and valuable resource — B&R engineers participate, and the community collectively maintains institutional knowledge about part compatibility, migration, and sourcing that is not available in official documentation.
-
When sourcing from the surplus/used market, verify firmware compatibility before purchasing. An X20IF1082 Modbus module requires upgrade version 1.2.2.0 for CP1584 compatibility. See remanufacturing.md for evaluation criteria and network-architecture.md for network topology planning.
-
The awesome-B-R community repository (github.com/br-automation-community/awesome-B-R) is the single best resource for finding compatible alternatives, migration tools, and community-maintained compatibility lists. It includes the as6-migration-tools for AR version upgrades, links to B&R part number databases, and user-reported compatibility experiences for third-party hardware substitutions.
-
brwatch can read module serial numbers and firmware versions without Automation Studio. When inventorying a machine, use brwatch (github.com/hilch/brwatch) to extract the hardware tree from the running PLC — this gives you module IDs, serial numbers, and firmware versions for every device in the X2X chain. See access-recovery.md §12 for the procedure.
-
systemdump.py (github.com/hilch/systemdump.py) can generate Excel hardware inventories from a system dump file, saving hours of manual transcription. Run
py -m systemdumpy <dump_file> -ivto produce a ready-to-use.xlsxinventory spreadsheet. See diagnostics-sdm.md §11.7 for full CLI usage. -
brsnmp (github.com/hilch/brsnmp) can scan entire subnets to find all B&R devices, even those you don’t know the IP of. This is useful when a machine has multiple PLCs or network segments:
pip install brsnmp
# Discover all B&R PLCs on the subnet with full details
brsnmp --details
# Output example:
# [
# {"targetType": "X20CP1584", "serialNumber": "C37012345678",
# "arVersion": "B04.73", "ipAddress": "192.168.1.10"},
# {"targetType": "X20CP1586", "serialNumber": "C3B00009876",
# "arVersion": "B04.93", "ipAddress": "192.168.1.11"}
# ]
Cross-References
| Related File | Relevance |
|---|---|
| cp1584-hardware-ref.md | Complete CP1584 specifications, LED codes, pinouts, and hardware revision compatibility |
| io-card-hardware.md | IO card signal processing, LED diagnostic codes, and module-level troubleshooting |
| firmware-version-mgmt.md | Firmware compatibility checks before purchasing replacement modules |
| cf-card-boot.md | CompactFlash card specifications and imaging procedures for CF spares |
| retentive-data.md | Battery (CR2477N) replacement procedure and retentive data preservation |
| acopos-drives.md | ACOPOS drive parameter backup and replacement procedures |
| remanufacturing.md | Migration paths and upgrade evaluation criteria when replacing entire subsystems |
| network-architecture.md | Network topology and interface module compatibility for replacement planning |
| access-recovery.md | Using brwatch to extract hardware tree for spare parts inventory |
| diagnostics-sdm.md | Using systemdump.py for generating hardware inventory spreadsheets |
| bootloader-recovery.md | Recovery procedures when replacement hardware requires firmware reload |
| online-changes.md | Runtime considerations when replacing modules in a running system |
| ftp-web-interface.md | Remote CF card access for backup before hardware replacement |
| cp1584-forensics.md | Network discovery, SDM access, extracting hardware info from running CP1584 |
| project-reconstruction.md | Rebuilding an Automation Studio project from an undocumented machine |
System Variable Monitoring on B&R Automation Runtime
Overview
This document is a survival guide for automation engineers maintaining B&R X20CP1584 (and related CP15xx/CP35xx) PLCs from defunct OEMs with zero documentation. It covers every system variable you can read from a running B&R Automation Runtime (AR) controller, how to access them without the original project, and how to interpret abnormal values for proactive failure detection.
B&R AR exposes system health through three distinct mechanisms:
- CPU I/O Mapping / General Data Points – hardware-level registers available in the controller’s I/O tree (temperature, battery status)
- System Library Function Blocks (FUBs) – software functions from
BRSystem,AsArProf, and other standard libraries (CPU usage, task cycle times, memory diagnostics) - System Diagnostics Manager (SDM) – built-in web server providing real-time dashboards without any development tools
Cross-references: See custom-diagnostic-tools.md for building external monitoring scripts, hardware-monitoring.md for physical inspection procedures, and execution-model.md for task class architecture details.
X20CP1584 Hardware Reference
| Parameter | Value |
|---|---|
| Processor | Intel Atom E640T @ 0.6 GHz |
| System RAM | 256 MB DDR2 SDRAM |
| User RAM (SRAM) | 1 MB (minus configured remanent variables) |
| Remanent Variables | Max 256 kB (configurable) |
| Shortest Task Class Cycle | 400 us |
| Typical Instruction Cycle | 0.0075 us |
| CompactFlash | Removable, ordered separately |
| Battery | 3 V / 950 mAh lithium (Renata CR2477N) |
| Battery Life | Min. 2 years at 23 C ambient |
| Cooling | Fanless |
| Operating Temp (horizontal) | -25 to 60 C |
| Operating Temp (vertical) | -25 to 50 C |
| Storage Temp | -40 to 85 C |
| Power Consumption | 8.6 W (without interface module) |
| B&R ID Code | 0xC370 |
| Integrated I/O Processor | Processes I/O data points in the background |
Thermal Protection
| Protection Level | Temperature | Action |
|---|---|---|
| CPU overtemperature shutdown | 110 C (processor die) | PLC enters reset state, error 9204 logged |
| Board overtemperature shutdown | 95 C (PCB) | PLC enters reset state, error 9204 logged |
| Software thermal protection | 105 C (component) | Controller enters SERVICE mode to self-protect |
LED Status Indicators
| LED | Color | State | Meaning |
|---|---|---|---|
| RDY/F | Green | On | Application running |
| RDY/F | Green | Blinking | System startup (initializing) |
| RDY/F | Green | Double flash | Firmware update in progress |
| RDY/F | Yellow | On | SERVICE or BOOT mode |
| R/E | Red | On | SERVICE or BOOT mode |
| R/E | Red | Double flash | Installation error (AR 4.93+) |
| S/E | Green | On | POWERLINK running, no errors |
| S/E | Red | On | System error (check logbook) |
| S/E | Green+Red | Alternating blink | POWERLINK managing node failed |
| S/E | Red | Blinking (off/green) | System stop error code |
| PLK | Green | On | POWERLINK link established |
| ETH | Green | On | Ethernet link established |
| CF | Green | On | CompactFlash detected |
| CF | Yellow | On | CF read/write active |
| DC | Red | On | Battery empty |
| DC | Yellow | On | CPU power supply OK |
System Stop Error Codes (S/E LED Red Blink)
| Code | Pattern | Description |
|---|---|---|
| RAM error | Short-Short-Short-Long | RAM failure – device defective, replace |
| Hardware error | Short-Short-Long-Long | Hardware failure – device defective, replace |
Pattern encoding: 4 phases of short (150 ms) or long (600 ms) pulses, repeated every 2 seconds.
System Variable Categories
1. CPU Temperature
Source: I/O Mapping (controller data points) / General Data Points
The X20CP1584 provides two temperature measurement points in its I/O mapping:
| Data Point | Location | Description |
|---|---|---|
| CPU Temperature | On-die / CPU package | Direct CPU silicon temperature |
| Housing Temperature | Near circuit board inside housing | Internal ambient reference |
Note: There is no direct ambient/cabinet temperature sensor on the CPU. For external ambient monitoring, B&R offers X20CMR010/011/111/100 climate measurement modules.
| Temperature Range | Status | Action |
|---|---|---|
| 40 - 55 C | Normal (at 20-25 C ambient) | No action |
| 55 - 75 C | Elevated (cabinet 35-45 C) | Verify ventilation, check cabinet temp |
| 75 - 89 C | Warning zone | Alert operator, investigate airflow |
| 89 - 100 C | Critical | Plan maintenance window, check cooling |
| > 105 C | Shutdown imminent | CPU enters SERVICE mode automatically |
| >= 110 C | Hard shutdown | Error 9204 logged, PLC enters reset state |
Temperature delta rule: A 10 C rise in ambient temperature produces approximately a 10 C rise in both CPU and housing temperature.
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| CPU 70+ C at 20 C ambient on desk | Mounting orientation wrong (flat on table blocks airflow) |
| Steady climb over hours | Cabinet cooling failure (fan dead, filter clogged) |
| Sudden spike after software change | New task consuming excess CPU cycles |
| Temperature oscillates rapidly | Intermittent high-priority task blocking idle time |
2. CPU Usage (Idle Time)
Source: LogIdleShow FUB from AsArProf library / SDM web interface
CPU usage is NOT available as a direct I/O data point. It must be read via software or the SDM.
The LogIdleShow function block from the AsArProf library calculates CPU usage from task idle time – the percentage of time when cyclic tasks are not consuming their allocated time slices. This is a measured average over a time interval, not an instantaneous value.
(* Example: LogIdleShow instantiation *)
fbIdleTime : LogIdleShow;
(* In cyclic task *)
fbIdleTime();
cpuIdlePercent := fbIdleShow.idle; (* Higher = more idle = lower CPU usage *)
| CPU Usage (100% - idle%) | Status | Interpretation |
|---|---|---|
| 0 - 40% | Healthy | Plenty of headroom for communication and events |
| 40 - 70% | Moderate | Normal for loaded applications |
| 70 - 85% | Elevated | Watch for cycle time creep, limit new features |
| 85 - 95% | Danger zone | Risk of cycle time violations, watchdog trips |
| > 95% | Critical | Imminent SERVICE mode entry from watchdog |
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| Usage jumps from 40% to 90% | Blocking operation in fast task (File I/O, TCP socket, string ops in <10 ms class) |
| Gradual increase over weeks/months | Memory leak consuming resources, growing data structures |
| Usage spikes every N cycles | Periodic task with variable execution time |
| High usage only when SDM is open | SDM cyclic data transfer overhead (significant on smaller CPUs, ~10% on X20CP13xx) |
Cross-reference: See execution-model.md for task class priority and time-slice allocation details.
3. Task Cycle Times
Source: RTInfo FUB from BRSystem library / Profiler / SDM Task Monitor
Each task class (Cyc0, Cyc1, Cyc2, Cyc3, and event tasks) is assigned a fixed time slice. When execution exceeds this slice, the watchdog timer triggers and can place the controller in SERVICE mode.
The RTInfo function block from the BRSystem library returns real-time task information:
(* Example: RTInfo for task monitoring *)
fbRTInfo : RTInfo;
(* In cyclic task -- pass task class name *)
fbRTInfo(pTask := 'Cyclic#1'); (* or 'Cyclic#2', 'Cyclic#3', etc. *)
fbRTInfo();
currentCycleTime := fbRTInfo.cycTime; (* Current cycle execution time in us *)
minCycleTime := fbRTInfo.cycTimeMin; (* Minimum observed cycle time *)
maxCycleTime := fbRTInfo.cycTimeMax; (* Maximum observed cycle time *)
| Task Class | Typical Default Cycle | Typical Use |
|---|---|---|
| Cyclic#1 (Cyc0) | 1 ms (fastest possible: 400 us on CP1584) | Motion control, high-speed I/O |
| Cyclic#2 (Cyc1) | 10 ms | Process control, regulation loops |
| Cyclic#3 (Cyc2) | 100 ms | Sequencing, HMI updates |
| Cyclic#4 (Cyc3) | Configurable | Slow background tasks |
| Event tasks | On-trigger | Alarm handling, state machines |
Cycle time monitoring thresholds:
| Metric | Warning | Critical |
|---|---|---|
| Cycle time / allocated slice | > 60% | > 85% |
| Jitter (max - min) | > 30% of slice | > 50% of slice |
| Consecutive near-misses | 3+ cycles > 70% | 1+ cycle > 90% |
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| Cycle time suddenly 2-3x normal | Infinite loop (while/for without exit condition), stuck state machine |
| Gradual increase over shift | Growing string buffer operations, memory fragmentation |
| Spikes every few minutes | Garbage collection, File I/O flush, OPC UA communication |
| Max cycle >> average | Rare code path hit (error handling branch, first-cycle initialization) |
Key fact: Approximately 80% of all B&R SERVICE mode entries are caused by cycle time violations.
4. Memory Usage
Source: sys_br_get_info / I/O mapping / SDM
The X20CP1584 has 256 MB DDR2 SDRAM system RAM and 1 MB SRAM for user data. Memory usage can be monitored through:
- The SDM System page (web browser, no tools needed)
sys_brsystem variable structures (if accessible in your runtime)- Automation Studio memory diagnostic tools (with project)
| Memory Region | Size (CP1584) | Purpose |
|---|---|---|
| DDR2 SDRAM (System RAM) | 256 MB | OS, libraries, application code, runtime objects |
| SRAM (User RAM) | 1 MB | Fast user variables, data processing |
| Remanent Variables | Up to 256 kB | Persistent data across power cycles (FRAM/battery-backed) |
| CompactFlash | 16 MB - 8 GB (card dependent) | Application storage, file system |
| Battery-backed | System RAM + User RAM + RTC | Maintained by lithium battery |
Memory pressure indicators:
| Symptom | Interpretation |
|---|---|
| SRAM approaching 100% | Add more variables -> reduce available headroom |
| SDRAM > 80% consumed | Large arrays, string buffers, or memory leak |
| CompactFlash > 90% full | Log files accumulating, limit log rotation |
| Remanent variable space full | Cannot add new persistent variables |
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| SDRAM usage climbing steadily | Memory leak (dynamically allocated objects never freed) |
| SRAM exhausted after download | Project too large for this CPU model |
| CompactFlash writes every cycle | Application logging in fast task class |
5. Watchdog Status
Source: System configuration / SDM / Error logbook
B&R AR implements per-task-class watchdog timers. Each task class has a configurable watchdog timeout that defaults to slightly longer than the configured cycle time.
| Watchdog Event | Result | Error Code |
|---|---|---|
| Cycle time violation | Task watchdog triggers | Varies by AR version |
| Watchdog after cycle exceed (task in safe state) | SERVICE mode | 9210 (halt/service after watchdog) |
| Continuous violations | PLC enters reset state | 9204 |
Watchdog configuration is in the Hardware Configuration -> Task Settings. Each task class can have its watchdog timeout independently adjusted.
Abnormal values / events indicate:
| Symptom | Likely Cause |
|---|---|
| Intermittent watchdog trips (random intervals) | Network-induced blocking, garbage collection, priority inversion |
| Consistent watchdog trip at startup | Configuration mismatch between cycle time and task content |
| Watchdog trip only when HMI connected | Communication overload from visualization |
6. Battery Status
Source: BatteryInfo system library function / CPU I/O mapping / DC LED
Battery status is available both as a software-readable value and via the front-panel DC LED.
| Battery Info Value | Status | Action |
|---|---|---|
| Battery OK | Green | Normal operation |
| Battery low | Warning | Schedule replacement within maintenance window |
| Battery empty | DC LED red, error logged | Immediate replacement required (replace within 1 min if power removed) |
What battery backup covers:
- Remanent variables
- User RAM
- System RAM
- Real-time clock (RTC)
Replacement: Renata CR2477N only. Replace every 4 years. Can be hot-swapped under power, or within 1 minute without power. Never use a different battery model number.
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| Battery low warning | Normal aging (replace every 4 years) |
| Battery low after 1 year | Extreme temperature cycling, poor storage conditions |
| Battery OK but RTC drifting | Crystal oscillator issue (separate from battery) |
| Loss of remanent variables after power cycle | Battery completely depleted, FRAM failure |
7. I/O Status
Source: I/O mapping / SDM Hardware page / LED indicators
The X20CP1584 uses an integrated I/O processor that handles I/O data points in the background, independently from the main CPU task execution.
| I/O Diagnostic | Source | Description |
|---|---|---|
| Module Run/Error | LED + software | Per-module operational status |
| X2X Link status | LED + SDM | Bus communication health |
| I/O power supply overload | Red LED (l) | X2X Link power overloaded |
| I/O power supply undervoltage | Red LED (r) double flash | Input voltage too low |
| Module insertion/removal | SDM event | Hot-swap detection |
The I/O mapping in the controller configuration automatically provides status structures for each connected module. When accessed through SDM or PVI, these data points are available without the project.
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| Intermittent I/O dropout on single module | Loose bus connector, damaged X2X cable |
| All modules showing errors | X2X Link power supply issue, bus termination problem |
| Module error after power cycle | Firmware mismatch, hardware fault on module |
| I/O values frozen | Task stopped (SERVICE mode), I/O processor still running |
8. Network Statistics
Source: SDM Network page / Ethernet & POWERLINK LED indicators
| Network Parameter | Interface | How to Monitor |
|---|---|---|
| Link status (up/down) | ETH (IF2) | Green LED, SDM |
| Link activity (tx/rx) | ETH (IF2) | LED blinking, SDM |
| POWERLINK state | PLK (IF3) | S/E LED pattern, SDM |
| POWERLINK cyclic data exchange | PLK (IF3) | S/E LED (OPERATIONAL = data flowing) |
| Ethernet collisions/errors | ETH (IF2) | SDM diagnostics |
| POWERLINK frame timeout | PLK (IF3) | Auto fallback to BASIC_ETHERNET |
POWERLINK S/E LED State Machine (V2 mode):
| S/E LED Pattern | State | Description |
|---|---|---|
| Off/Off | NOT_ACTIVE | Powered off, startup, or misconfigured |
| Flickering ~10 Hz / Off | BASIC_ETHERNET | Ethernet fallback (CN only, auto-recover) |
| Single flash ~1 Hz / Off | PRE_OPERATIONAL_1 | MN: reduced cycle / CN: waiting for SoC |
| Double flash ~1 Hz / Off | PRE_OPERATIONAL_2 | MN: cyclic starting / CN: configured |
| Triple flash ~1 Hz / Off | READY_TO_OPERATE | Cyclic data flowing but not yet evaluated |
| Blinking ~2.5 Hz / Off | OPERATIONAL | Full cyclic communication active |
| Off / Blinking red | STOPPED | CN stopped by MN command |
| Off / On | Error mode | Failed frames, collisions |
| Blinking (green+red) / On | Error with state | Error in PREOP/READYTOOP state |
Abnormal values indicate:
| Symptom | Likely Cause |
|---|---|
| POWERLINK cycling between PREOP1 and BASIC_ETHERNET | Cable issue, MN not running, wrong node address |
| ETH LED off | Cable unplugged, switch port failure, wrong VLAN |
| Frequent POWERLINK reconnections | Electromagnetic interference, marginal cable |
| S/E solid red | Check PLC logbook for specific error |
Reading System Variables Without the Project
This is the critical section for engineers working with defunct OEM equipment.
Method 1: System Diagnostics Manager (SDM) – No Tools Required
The SDM is a built-in web server on every B&R controller running AR V3.0 or higher. It requires only a web browser and TCP/IP connectivity.
Access: http://<PLC_IP_ADDRESS>/sdm
| SDM Feature | Information Available | Requires Project? |
|---|---|---|
| System page | CPU usage, task cycle times, memory usage, uptime | No |
| Hardware page | All I/O modules, temperatures, bus status, module errors | No |
| Network page | Ethernet/POWERLINK status, IP configuration | No |
| Error logbook | Historical errors, exceptions, SERVICE mode entries | No |
| Profiler | Task runtime profiling, cycle time analysis | No |
| Software page | Installed modules, versions, license status | No |
Procedure:
- Connect PC to same network as PLC (or directly via crossover cable)
- Ping the PLC IP address to verify connectivity
- Open browser:
http://<PLC_IP>/sdm - Navigate System / Hardware / Network tabs for diagnostics
- Use the Error logbook tab for historical fault analysis
Tip: The SDM is always running in the background (even when the web page is not loaded). It provides historical CPU usage data for time intervals when no browser was connected. On smaller CPUs, opening the SDM can increase CPU usage by ~10%.
Cross-reference: See custom-diagnostic-tools.md for automating SDM data collection via scripts.
Method 2: PVI (Process Visualization Interface) – No Project Required
B&R’s PVI protocol can enumerate and read all controller variables (including system data points) without the source project. PVI tools ship with the B&R Runtime installation.
| Tool | Purpose | Project Required? |
|---|---|---|
| PVI Manager | Establish connections to PLCs | No |
| PVI Monitor | Real-time variable monitoring and export | No |
| Runtime Utility Center (RUC) | Save all controller variables to file | No |
| PVIservices DLL | .NET library for custom applications | No |
| OPC Server | OPC UA/DA access to all variables | No (if configured) |
Procedure with PVI Monitor:
- Install B&R Runtime components (includes PVI tools)
- Open PVI Manager
- Create new device connection (Ethernet: enter PLC IP; or RS232 for serial)
- Launch PVI Monitor from the Runtime group
- Browse the variable tree – system data points and I/O mapping are visible
- Export variable list to CSV for documentation
Procedure with PVIservices (.NET):
// Conceptual -- PVIservices connects via PVI protocol
PVIConnection pvi = new PVIConnection();
pvi.Connect("192.168.1.100", PVIProtocol.ANSL);
foreach(var variable in pvi.GetAllVariables()) {
Console.WriteLine($"{variable.Name}: {variable.Address}");
}
Procedure with OPC:
- If OPC server is enabled on the PLC, connect with any OPC client
- Browse the address space – system variables appear in the tree
- No source code needed
Note: On legacy B&R PLCs (CP476 era), PVI communications do not require authentication. On newer AR versions, authentication may be configured.
Method 3: Automation Studio Online Mode – No Project Required
Even without the project source, Automation Studio can connect to a running PLC in online mode:
- Install Automation Studio
- Open AS without a project
- Use Online -> Connect to Target (enter PLC IP)
- Logger shows real-time and historical events
- Watch Window can monitor variables by entering their names/addresses manually
- Trace (oscilloscope) can capture variable values over time
- Profiler captures task runtime behavior
Method 4: PLC I/O Mapping Direct Access
System data points (temperature, battery status) are in the controller’s own I/O mapping – not in the application project. They are always accessible through:
- SDM Hardware page
- PVI Monitor (browse to controller -> I/O mapping)
- Automation Studio I/O assignment in monitor mode
Trending System Variables Over Time
Built-in: Profiler
The Automation Studio Profiler captures task runtime behavior over extended periods:
- Connect to PLC via Automation Studio (no project needed for basic profiling)
- Open Tools -> Profiler
- Configure which task classes to profile
- Set recording duration (supports multi-hour captures)
- Download and analyze in Automation Studio
- Profiler logs can also be uploaded via SDM
Built-in: Trace (Variable Oscilloscope)
Automation Studio’s Trace function records variable values over time at high resolution:
- Connect to PLC
- Open Tools -> Trace
- Add variables to trace (enter names manually if no project)
- Set trigger conditions and recording depth
- Supports continuous recording up to available memory
- Export captured data for analysis
Limitation: Trace duration is limited by capture buffer size. For continuous 1-hour traces, the buffer must be sized appropriately.
Built-in: SDM Historical Data
The SDM automatically maintains historical data for:
- CPU usage (time-series graphs in System page)
- Error logbook entries with timestamps
This data persists across browser sessions and power cycles (stored in controller memory).
External: PVI + Custom Data Logger
For continuous, long-term trending without Automation Studio:
- Use PVIservices DLL (.NET/C#) or Python (via ANSL protocol)
- Create a service that polls system variables at regular intervals
- Log to CSV, database, or time-series database (InfluxDB, Grafana)
- Create dashboards for trend visualization
Key variables to poll:
- CPU idle percentage (via
LogIdleShowif callable, or SDM) - Task cycle times (via
RTInfoor SDM) - CPU and housing temperature (via I/O mapping data points)
- Battery status (via
BatteryInfoor I/O mapping) - POWERLINK state (via S/E LED or SDM)
- Error logbook entries
Cross-reference: See custom-diagnostic-tools.md for sample code and architecture for external monitoring systems.
External: OPC UA Subscriptions
If OPC UA is configured on the PLC:
- Set up OPC UA subscriptions for system variables
- Use any OPC UA client (free: Prosys Simulation, UA Expert)
- Subscription-based monitoring provides real-time updates without polling
System Variable Quick Reference Tables
All Monitorable Variables (No Project Required)
| Variable | Category | Access Method | Unit | Typical Range |
|---|---|---|---|---|
| CPU Temperature | Thermal | I/O mapping, SDM, PVI | C | 40 - 70 |
| Housing Temperature | Thermal | I/O mapping, SDM | C | 35 - 60 |
| CPU Usage | Performance | LogIdleShow, SDM | % | 5 - 60 |
| Task Cycle Time (per class) | Performance | RTInfo, Profiler, SDM | us/ms | Varies |
| Task Cycle Time Min/Max | Performance | RTInfo, Profiler | us/ms | Varies |
| Battery Status | Power | BatteryInfo, I/O mapping, DC LED | Boolean | OK / Low |
| System RAM Usage | Memory | SDM | % or MB | 40 - 70 |
| User RAM (SRAM) Usage | Memory | SDM, AS | kB | Varies |
| Remanent Variable Usage | Memory | SDM, AS | kB | Varies |
| CompactFlash Free Space | Storage | SDM | MB | Varies |
| POWERLINK State | Network | S/E LED, SDM | Enum | OPERATIONAL |
| Ethernet Link Status | Network | ETH LED, SDM | Boolean | Up/Down |
| Module Run/Error (per module) | I/O | LED, SDM, I/O mapping | Boolean | OK/Error |
| X2X Link Status | Bus | SDM, I/O mapping | Enum | OK/Error |
| I/O Power Overload | Power | LED, SDM, I/O mapping | Boolean | OK/Overload |
| Error Logbook Entries | Diagnostics | SDM, Logger | Text | – |
| System Uptime | Diagnostics | SDM | Seconds | – |
| Operating State | Diagnostics | RDY/F LED, SDM | Enum | RUN/SERVICE/BOOT |
Key System Library Function Blocks
| Library | FUB | Purpose | Returns |
|---|---|---|---|
BRSystem | RTInfo | Real-time task info | cycTime, cycTimeMin, cycTimeMax |
BRSystem | BatteryInfo | Battery status | OK/Low/Empty |
AsArProf | LogIdleShow | CPU idle percentage | idle (%) |
BRSystem | sys_br_get_info | System info structure | Various system parameters |
BRSystem | McBaseInfo | Motion control base info | Axis diagnostics |
BRSystem | MpAlarmXCoreInfo | mapp alarm system info | Active alarms count |
| Standard | FileDir | File system directory listing | CompactFlash contents |
| Standard | FileStatus | File size, attributes | Storage info |
Key System Variable Structures
| Structure | Library | Description |
|---|---|---|
sys_br | BRSystem | Base runtime system info (AR version, build date, serial number, memory layout) |
sys_task | BRSystem | Per-task-class runtime info (current/minimum/maximum cycle times, overload count) |
sys_br_get_info | BRSystem | Function to populate sys_br structure with current system data |
sys_task_get_info | BRSystem | Function to populate sys_task structure for a specific task class |
sys_br Structure Members (AR 4.x)
The sys_br structure from the BRSystem library provides system-level information. While the exact member layout varies by AR version, the following fields are consistent across AR 4.x:
| Field | Type | Description |
|---|---|---|
sys_br.wARVersionMajor | USINT | AR major version (e.g., 4) |
sys_br.wARVersionMinor | USINT | AR minor version (e.g., 93) |
sys_br.wARVersionBuild | USINT | AR build/patch version (e.g., 5) |
sys_br.wARVersionSub | USINT | AR sub-build version (e.g., 2) |
sys_br.awSerialNumber | ARRAY[0..7] OF USINT | CPU serial number (8 x USINT = 32 hex chars) |
sys_br.aCPUName | STRING | CPU model name (e.g., “X20CP1584”) |
sys_br.wBRCpuId | UDINT | B&R CPU ID code (e.g., 0xC370) |
sys_br.bSystemState | USINT | Current operating state (0=INIT, 1=RUN, 2=SERVICE, 3=BOOT) |
sys_br.dwSystemTick | UDINT | System tick counter (free-running timer) |
sys_br.wSystemTickFreq | UDINT | System tick frequency in Hz |
sys_br.wMaxCyclicTasks | USINT | Maximum number of cyclic task classes (typically 8) |
sys_br.wUsedCyclicTasks | USINT | Number of cyclic task classes in use |
sys_br.dwTotalSDRAM | UDINT | Total SDRAM in kB (256000 for CP1584) |
sys_br.dwFreeSDRAM | UDINT | Free SDRAM in kB |
sys_br.dwTotalSRAM | UDINT | Total SRAM in kB (1024 for CP1584) |
sys_br.dwFreeSRAM | UDINT | Free SRAM in kB |
sys_br.dwRemanentSize | UDINT | Configured remanent variable space in kB |
sys_br.bBatteryStatus | USINT | Battery status (0=OK, 1=Low, 2=Empty) |
sys_br.wCpuTemperature | SINT | CPU temperature in 0.1 C units (e.g., 520 = 52.0 C) |
sys_br.wBoardTemperature | SINT | Board/housing temperature in 0.1 C units |
sys_br.bOvertemperatureShutdown | BOOL | TRUE if CPU/board overtemperature shutdown has occurred |
Reading sys_br in IEC code:
PROGRAM ReadSystemInfo
VAR
sysInfo : sys_br;
END_VAR
sys_br_get_info(); (* Populate the structure *)
(* Log system info to diagnostic string *)
diagString := CONCAT(
'AR Version: ', USINT_TO_STRING(sysInfo.wARVersionMajor), '.',
USINT_TO_STRING(sysInfo.wARVersionMinor),
' Build: ', USINT_TO_STRING(sysInfo.wARVersionBuild), '.',
USINT_TO_STRING(sysInfo.wARVersionSub),
'\r\nCPU: ', sysInfo.aCPUName,
'\r\nState: ',
IF sysInfo.bSystemState = 0 THEN 'INIT'
ELSIF sysInfo.bSystemState = 1 THEN 'RUN'
ELSIF sysInfo.bSystemState = 2 THEN 'SERVICE'
ELSIF sysInfo.bSystemState = 3 THEN 'BOOT'
END_IF,
'\r\nCPU Temp: ', REAL_TO_STRING(sysInfo.wCpuTemperature / 10.0, 1), ' C',
'\r\nBattery: ',
IF sysInfo.bBatteryStatus = 0 THEN 'OK'
ELSIF sysInfo.bBatteryStatus = 1 THEN 'LOW'
ELSIF sysInfo.bBatteryStatus = 2 THEN 'EMPTY'
END_IF
);
sys_task Structure Members (AR 4.x)
The sys_task structure provides per-task-class performance data. Index by task class number (0 = Cyclic#1, 1 = Cyclic#2, etc.):
| Field | Type | Description |
|---|---|---|
sys_task.wTaskClassNumber | USINT | Task class number (0-7) |
sys_task.wCycleTime | UDINT | Current cycle execution time in us |
sys_task.wMinCycleTime | UDINT | Minimum cycle time observed (since last reset) |
sys_task.wMaxCycleTime | UDINT | Maximum cycle time observed (since last reset) |
sys_task.wOverloadCount | UDINT | Number of cycle time violations / overloads |
sys_task.wJitterTime | UDINT | Current jitter deviation in us |
sys_task.wTaskLoad | USINT | Task load as percentage (0-100) |
Reading sys_task in IEC code:
PROGRAM MonitorAllTasks
VAR
taskInfo : sys_task;
i : USINT;
END_VAR
FOR i := 0 TO 7 DO
sys_task_get_info(i); (* Populate for task class i *)
IF taskInfo.wTaskClassNumber = i THEN
(* Task class is active *)
diagMsg := CONCAT(
'TC#', USINT_TO_STRING(i + 1),
': cycle=', UDINT_TO_STRING(taskInfo.wCycleTime), 'us',
' max=', UDINT_TO_STRING(taskInfo.wMaxCycleTime), 'us',
' load=', USINT_TO_STRING(taskInfo.wTaskLoad), '%',
' overloads=', UDINT_TO_STRING(taskInfo.wOverloadCount)
);
(* Log or send via OPC-UA *)
END_IF
END_FOR
These structures are defined in the BRSystem library header files. To use them in your own diagnostic code, reference the BRSystem library in Automation Studio.
Note: The sys_br and sys_task structures are available within the AR runtime but their exact member layout varies by AR version. Consult the BRSystem library help in Automation Studio for the specific structure definition matching your controller’s AR version. The field names above are typical for AR 4.x but may differ slightly in AR 3.x or AR 6.x.
SysInfo Function Block (Community Discovery)
B&R community members have discovered that the SysInfo function block from the BRSystem library can detect whether the controller is in SERVICE mode or has recently rebooted. This is valuable for automated recovery scripts:
VAR
fbSysInfo : SysInfo;
END_VAR
fbSysInfo();
IF fbSysInfo.bServiceMode THEN
(* Controller is currently in SERVICE mode *)
(* Implement automatic recovery or notification logic *)
END_IF
The SysInfo FUB provides additional fields beyond what is in sys_br, including flags for SERVICE mode, error state, and boot type (cold/warm/init).
Cross-reference: See custom-diagnostic-tools.md for building external monitoring systems that query these structures via PVI or OPC-UA.
Failure Mode Analysis: What Abnormal Values Really Mean
Failure Mode: Imminent SERVICE Mode (Watchdog Trip)
Leading indicators (detectable hours/days before failure):
| Indicator | Normal | Warning | Critical |
|---|---|---|---|
| Task cycle time (Cyc0) | < 60% of slice | 60-85% of slice | > 85% of slice |
| CPU idle time | > 30% | 15-30% | < 15% |
| Cycle time jitter | < 20% of slice | 20-40% | > 40% |
| Max cycle / avg cycle ratio | < 3x | 3-10x | > 10x |
Most common root causes:
- Infinite loop in cyclic code (~80% of SERVICE mode entries)
- Blocking I/O in fast task class (File I/O, TCP socket in Cyc0/Cyc1)
- Excessive string manipulation in time-critical task
- Memory leak gradually consuming resources
- ANSL (Automation Net) communication overload
Failure Mode: Thermal Shutdown
Leading indicators:
| Indicator | Normal | Warning | Critical |
|---|---|---|---|
| CPU temperature | 40-60 C | 60-89 C | 89-105 C |
| Temperature rate of change | < 1 C/min | 1-3 C/min | > 3 C/min |
| CPU usage at elevated temp | Any | Higher usage = more heat | – |
Most common root causes:
- Cabinet ventilation failure (fan, filter)
- Blocked airflow (cables, debris over CPU)
- Incorrect mounting orientation (horizontal vs vertical derating)
- High ambient temperature (> 50 C)
- Elevated above 2000 m elevation (requires 0.5 C derating per 100 m)
Failure Mode: Battery Depletion
Leading indicators:
| Indicator | Normal | Warning | Critical |
|---|---|---|---|
| Battery status | OK | Low | Empty |
| RTC accuracy | < 10 ppm drift | 10-50 ppm | > 50 ppm |
| Remanent variable integrity | Stable | Occasional reset | Variables lost on power cycle |
Failure Mode: Network Communication Loss
Leading indicators:
| Indicator | Normal | Warning | Critical |
|---|---|---|---|
| POWERLINK state | OPERATIONAL | PREOP cycling | BASIC_ETHERNET fallback |
| POWERLINK reconnection count | 0 / hour | 1-5 / hour | > 5 / hour |
| Ethernet frame errors | 0 | < 10 / hour | > 10 / hour |
Failure Mode: Memory Exhaustion
Leading indicators:
| Indicator | Normal | Warning | Critical |
|---|---|---|---|
| System RAM usage | < 70% | 70-85% | > 85% |
| SRAM usage | < 80% | 80-90% | > 90% |
| CompactFlash free space | > 20% | 10-20% | < 10% |
SERVICE Mode: Entry, Diagnosis, and Recovery
What Causes SERVICE Mode
| Cause Category | Percentage | Examples |
|---|---|---|
| Cycle time violation (watchdog) | ~80% | Infinite loop, blocking I/O, excessive computation |
| Page fault (memory access) | ~10% | Array out of bounds, invalid pointer, buffer overflow |
| Divide by zero | ~5% | Unvalidated divisor in calculation |
| Hardware fault | ~3% | RAM error, module failure |
| Thermal protection | ~2% | CPU/board overtemperature |
| Unknown / Other | < 1% | License violation, firmware corruption |
Diagnostic Procedure When in SERVICE Mode
The PLC remains network-accessible in SERVICE mode. The IP address, SDM, and all diagnostic interfaces continue to function.
Step 1: Check the Logger / SDM Error Logbook
- Open SDM at
http://<PLC_IP>/sdmor use AS Logger - Find the timestamped error entry that caused SERVICE mode
- Note the error code and backtrace (if available)
Step 2: Common Error Codes
| Error Code | Description | Likely Fix |
|---|---|---|
| EXCEPTION Page Fault (25314) | Invalid memory access | Check array bounds, string operations |
| EXCEPTION Divide by Zero | Division by zero | Validate divisor before division |
| Watchdog timeout | Cycle time exceeded | Reduce task content, move blocking ops to slower class |
| 9204 | Temperature shutdown | Check cooling, wait for cooldown, warm restart |
| 9210 | Halt after watchdog | Fix code, warm restart |
Step 3: Recovery
- Identify and correct the root cause
- In Automation Studio: Online -> Warm Restart
- If no AS available, press the physical Reset button (enters SERVICE mode)
- If Reset -> RUN mode switch: set switch to RUN position for automatic restart
Critical: A PLC in SERVICE mode is NOT executing control logic. Verify process state before warm restart.
Cross-reference: See hardware-monitoring.md for physical troubleshooting procedures when software diagnostics are insufficient.
Recommended Monitoring Strategy for Defunct OEM Systems
Minimum Viable Monitoring (No Code Changes)
| Method | What You Get | Effort |
|---|---|---|
| SDM web dashboard (weekly check) | CPU usage, temperature, errors, task times | 15 min/week |
| DC LED visual inspection (shift walk) | Battery status | 30 sec/shift |
| RDY/F LED visual inspection | Application running vs. SERVICE mode | Instant |
| SDM Error Logbook review (weekly) | Historical faults | 15 min/week |
Enhanced Monitoring (With PVI / External Script)
| Method | What You Get | Effort |
|---|---|---|
| PVI Monitor periodic export | All variable values to CSV | Setup once, automate |
| Custom Python/.NET service | Continuous polling of key variables | 1-2 day setup |
| OPC UA subscriptions | Real-time variable updates | 1 day setup |
| Grafana dashboard | Visual trending over weeks/months | 1 day setup |
Full Instrumentation (Requires Code Deployment)
| Method | What You Get | Effort |
|---|---|---|
Deploy LogIdleShow in each task class | Real-time CPU usage per task | Modify existing program |
Deploy RTInfo for all task classes | Cycle time monitoring with min/max | Modify existing program |
| Deploy custom alarm logic | Automatic alerts on threshold breach | Modify existing program |
| File-based data logging | Long-term trend data on CompactFlash | New task class |
| mapp AlarmX integration | Standard alarm management | Modify existing program |
Important: Without the project source, you CANNOT modify the PLC program. Methods 1 and 2 are your only options. See custom-diagnostic-tools.md for building external monitoring that requires no PLC code changes.
Key Findings
-
SDM is your primary lifeline. Available at
http://<PLC_IP>/sdmwith zero tools, it provides CPU usage, task cycle times, memory usage, temperature, I/O status, network status, and the complete error logbook – all without the project source code. -
CPU temperature is available as an I/O data point. Two sensors (CPU die + housing) are in the controller’s I/O mapping and readable via PVI, SDM, or direct I/O access. Shutdown occurs at 110 C (CPU) / 95 C (board). Normal operating range is 40-70 C at typical ambient temperatures.
-
CPU usage is NOT an I/O data point. It requires the
LogIdleShowFUB from theAsArProflibrary (code deployment) or reading from the SDM (no code needed). Opening the SDM itself increases CPU usage by ~5-10% on smaller CPUs. -
Task cycle times are the #1 failure indicator. ~80% of all SERVICE mode entries are caused by cycle time violations. Monitor via
RTInfoFUB (BRSystem library), Profiler, or SDM Task Monitor. Watch for cycle time exceeding 85% of the configured time slice. -
All system variables are readable via PVI without the project. PVI Monitor, Runtime Utility Center, and PVIservices DLL can enumerate and read every variable on the controller, including system data points, I/O mapping, and application variables. This is the recommended path for defunct OEM scenarios.
-
Battery status is dual-indicated (software register + DC LED). The battery buffers remanent variables, user RAM, system RAM, and the RTC. Replace every 4 years with Renata CR2477N only. Battery depletion causes loss of all persistent data on power cycle.
-
The
sys_brandsys_tasksystem variable structures from the BRSystem library provide structured access to runtime information (AR version, memory layout, per-task cycle statistics). Their exact member layout varies by AR version – consult the library help in Automation Studio. -
POWERLINK state is fully diagnosable from the S/E LED. The 6-state LED pattern machine (NOT_ACTIVE -> BASIC_ETHERNET -> PREOP1 -> PREOP2 -> READY -> OPERATIONAL) provides immediate visual diagnostics without any tools.
-
For continuous external trending, use PVI + custom data logger (Python/.NET) or OPC UA subscriptions to push system variables into a time-series database. This requires zero PLC code changes and provides long-term trend analysis.
-
Thermal protection is automatic and aggressive. Per the official B&R datasheet, the X20CP1584 hard-shuts down (reset state) at 110°C CPU temperature or 95°C board temperature (error 9204). B&R may enter SERVICE mode at a lower temperature (~105°C estimated) before the hard shutdown. This is not configurable. Proper cabinet ventilation is the only mitigation.
Python Script: Comprehensive System Health Check
This script connects to a B&R CP1584 via OPC-UA and reads all accessible system variables for a complete health snapshot. It requires no project files or Automation Studio:
"""
B&R CP1584 System Health Check via OPC-UA.
Usage: python system_health_check.py <PLC_IP>
Requires: pip install asyncua
"""
import asyncio, sys
from datetime import datetime
from asyncua import Client
PLC_IP = sys.argv[1] if len(sys.argv) > 1 else "192.168.0.1"
async def check_health():
url = f"opc.tcp://{PLC_IP}:4840"
print(f"B&R CP1584 System Health Check")
print(f"Connecting to {url}...")
print("=" * 60)
async with Client(url=url) as client:
root = client.get_root_node()
print("Connected. Scanning address space...\n")
children = await root.get_children()
all_vars = {}
async def scan_node(node, depth=0):
if depth > 5:
return
try:
for child in await node.get_children():
name = (await child.get_browse_name()).Name
node_id = child.nodeid.to_string()
dtype = (await child.get_data_type()).to_string()
keywords = [
"temperature", "cpu", "battery", "cycle", "load",
"task", "memory", "ram", "status", "error",
"uptime", "state", "power", "link", "plk",
"idle", "free", "watchdog"
]
if any(kw in name.lower() for kw in keywords):
try:
val = await child.get_value()
all_vars[node_id] = {
"path": node_id,
"name": name,
"value": val,
"type": dtype
}
except Exception:
all_vars[node_id] = {
"path": node_id,
"name": name,
"value": "READ_ERROR",
"type": dtype
}
await scan_node(child, depth + 1)
except Exception:
pass
await scan_node(root)
if not all_vars:
print("No system variables found in OPC-UA namespace.")
print("Possible causes:")
print(" - OPC-UA server not configured")
print(" - System variables not exposed in address space")
print(" - Authentication required (try credentials)")
print("\nAlternative: Use SDM at http://<PLC_IP>/sdm")
return
print(f"Found {len(all_vars)} system variables\n")
for node_id, info in sorted(all_vars.items(),
key=lambda x: x[1]["name"]):
val = info["value"]
status = " "
if isinstance(val, (int, float)):
if "temp" in info["name"].lower():
if val > 89:
status = "!!"
elif val > 75:
status = "! "
elif "load" in info["name"].lower() or "usage" in info["name"].lower():
if val > 85:
status = "!!"
elif val > 70:
status = "! "
elif "error" in info["name"].lower():
if val != 0:
status = "!!"
print(f" {status} {info['name']:40s} = {val}")
print(f"\nLegend: = normal, ! = warning, !! = critical")
print(f"\nTimestamp: {datetime.now():%Y-%m-%d %H:%M:%S}")
print(f"Total variables scanned: {len(all_vars)}")
asyncio.run(check_health())
SNMP-Based System Monitoring
For continuous monitoring without OPC-UA or PVI, the B&R SNMP agent exposes system variables via standard SNMP MIB:
# Install brsnmp for B&R device discovery and SNMP queries
pip install brsnmp
# Quick system health check via SNMP
brsnmp --walk 192.168.0.1
# Monitor CPU temperature via SNMP (OID varies by AR version)
snmpget -v2c -c public 192.168.0.1 1.3.6.1.4.1.2808.1.2.1
# Monitor system uptime
snmpget -v2c -c public 192.168.0.1 sysUpTime.0
See iiot-retrofit.md for full SNMP configuration and access-recovery.md for brsnmp discovery procedures.
Cross-References
| Related File | Relevance |
|---|---|
| execution-model.md | Task class priority, cycle time configuration, watchdog behavior, exception codes |
| diagnostics-sdm.md | SDM web interface for reading all system variables without any tools |
| hardware-monitoring.md | Physical temperature monitoring, fan diagnostics, voltage rail monitoring |
| custom-diagnostic-tools.md | Building diagnostic programs that run ON the PLC using system variables |
| python-diagnostics.md | Python + PVI/OPC-UA scripts for automated system monitoring |
| opcua.md | OPC-UA server configuration and address space browsing |
| pvi-api.md | PVI protocol for reading system data points programmatically |
| cp1584-forensics.md | Extracting system info from an unknown PLC via network discovery |
| firmware.md | AR version identification and firmware architecture |
| memory-map.md | CPU memory layout and direct memory access for IO data |
| alarm-logging.md | Exception and watchdog event logging |
| ebpf-telemetry.md | Advanced performance profiling with eBPF (Linux-based controllers) |
| retentive-data.md | Battery-backed data management and battery replacement procedures |
| cp1584-hardware-ref.md | Complete CP1584 hardware specifications and physical indicators |
| troubleshooting-index.md | Scenario-based index for system variable-related diagnostics |
| access-recovery.md | brwatch and Pvi.py tools for no-project variable monitoring |
Document generated from research across B&R official documentation, B&R Community forums, Automation Runtime training materials, X20CP158x datasheets, and field engineering sources. Applicable to X20CP1583/1584/1585/1586 and X20CP358x series with Intel Atom processors running Automation Runtime V3.0+.
Encoder and Feedback Signal Diagnostics for B&R ACOPOS Motion Systems
Overview
Encoder faults are the most common intermittent failure mode on B&R ACOPOS servo systems. On a CP1584 machine with defunct OEM support, you have no calibration data, no motor nameplate parameters, and no spare encoders with pre-loaded commutation offsets. This document provides everything needed to diagnose encoder faults, verify signal quality, replace encoders, and recover alignment without factory data.
The encoder is the sensor that closes the feedback loop in the servo drive. Without valid encoder data, the ACOPOS cannot commutate the motor (control which phase is energized) or close the position/velocity control loops. An encoder fault will immediately shut down the axis — and often the entire machine.
See also: acopos-drives.md for drive-level diagnostics, analog-calibration.md for signal measurement techniques, and grounding-emc.md for EMC troubleshooting of encoder signal quality.
Encoder Types Supported by ACOPOS
Supported Interface Standards
The ACOPOS drive family supports multiple encoder interfaces through plug-in option modules installed in the drive’s module slots. The encoder type is determined by the option module installed and the EncoderType parameter in the acp10sys configuration.
| Encoder Type | ACOPOS Module | Signal Characteristics | Cable Requirement |
|---|---|---|---|
| Resolver | Built-in (standard) | Two sinusoidal outputs (sin/cos), passive, no battery | 4-wire + shield, unshielded OK for short runs |
| EnDat 2.1 | 8AC122.60-1 | Bidirectional digital, 1 MHz clock, absolute + incremental | 6-wire shielded, twisted pairs |
| EnDat 2.2 | 8AC122.60-2 | Bidirectional digital, up to 2 MHz (16 MHz w/ delay compensation), SIL 2 capable | 6-wire shielded, twisted pairs |
| HIPERFACE | 8AC122.60-3 | Bidirectional, RS-485 based, absolute + sin/cos incremental | 6-wire shielded, twisted pairs |
| HIPERFACE DSL | Module-dependent | All-digital over 2 wires, 9.375 Mbaud, integrated in motor cable | 2-wire (with transformer) |
| BiSS-C | 8AC122.60-x (varies) | Bidirectional, up to 10 MHz, CRC error checking | 4-wire + power |
| TTL (RS-422) | Incremental module | 5V differential square wave, 1000+ lines minimum | Differential pair per channel + shield |
| Sin/Cos 1 Vpp | 8AC122.60-1 / built-in | Analog sinusoidal, 1 Vpp amplitude, incremental | Shielded twisted pair per channel |
| SSI | Via BiSS/EnDat modules | Unidirectional synchronous, up to 1.5 MHz, gray/binary code | 2 twisted pairs + power |
How to Identify Your Encoder Type
When you have zero documentation, identify the encoder through these methods:
-
Check the option module in the ACOPOS drive. Open the drive and look at the module in the encoder slot. The part number (e.g., 8AC122.60-2 = EnDat 2.2) identifies the interface. Record the full part number.
-
Read the acp10sys configuration. In Automation Studio, open the drive configuration and look at the
EncIf(Encoder Interface) parameter. The encoder type is defined here. -
Read the motor nameplate. B&R 8LS series motors encode the feedback type in the ordering code. For example,
8LSA66.E3030D100— theEsection encodes the encoder type. Cross-reference with B&R motor catalogs. -
Count the wires in the encoder cable. This gives a strong clue:
- 2 wires: Hiperface DSL (or resolver with excitation shared)
- 4-5 wires: Resolver or SSI
- 6-8 wires: EnDat, Hiperface, or BiSS
- 8+ wires: Incremental TTL with reference mark
-
Measure the encoder supply voltage at the drive connector. EnDat encoders typically use 5V from the drive; Hiperface encoders use 5-9.5V; TTL encoders use 5V; resolvers use AC excitation (varies).
B&R Encoder Memory Architecture
B&R motors with EnDat 2.2 or Hiperface encoders store critical data in the encoder’s parameter memory (EEPROM/EEPROM). This memory contains:
- Motor electrical nameplate — rated current, voltage, pole pairs, thermal constants
- Commutation offset (MOTOR_COMMUT_OFFSET) — the angle between the encoder zero position and the motor’s electrical zero. This is the single most critical value.
- Encoder resolution — lines per revolution, single-turn/multi-turn bits
- Motor inertia and friction data
The ACOPOS drive reads this memory on every warm start. If the memory is corrupted or the encoder is replaced with a blank unit, the drive will not know the commutation angle and cannot drive the motor safely.
Critical fact (confirmed by B&R engineering, 2023): For motors with encoder memory, B&R does not align the encoder to any specific orientation during factory assembly. The encoder is mounted arbitrarily, and then the commutation offset is measured and stored in memory. The offset can be any value between -2pi and +2pi. There is no physical “zero mark” you can rely on without reading the encoder memory.
ACOPOS Encoder Error Codes
Primary Encoder Fault Codes
| Error Code | Category | Description | Immediate Action |
|---|---|---|---|
| 31220 | Configuration | Encoder not configured | Encoder interface module missing or EncIf parameter unset |
| 31221 | Signal | Cable disturbance or signal disturbance | Check cable, connectors, EMC; scope the signals |
| 31222 | Signal | Signal amplitude out of range | Measure encoder supply voltage, check cable length |
| 31223 | Signal | Signal quality insufficient | Scope signals, check for noise/degraded cable |
| 31224 | Hardware | Encoder interface HW module not OK | Replace the encoder interface option module |
| 31225 | Communication | Encoder communication error (EnDat/BiSS/Hiperface) | Check cable, try re-seating connector, test with known-good cable |
| 31226 | Communication | Encoder data read error | Encoder memory corruption; may need encoder replacement |
| 31227 | Position | Position tracking error / following error exceeded | Mechanical binding, encoder slip, or tuning issue |
| 15206 | Position | Position feedback / encoder communication loss | Same root causes as 31221/31225 |
| 15236 | Thermal | Power stage overtemperature (can be caused by bad commutation) | Verify commutation; if encoder gives wrong angle, drive fights itself |
Interpreting the Info Field
ACOPOS encoder errors include an Info(UINT) value indicating the encoder interface index. On drives with multiple encoder interfaces (e.g., main encoder + secondary feedback), this tells you which interface faulted:
EncIf Index = 1— Primary encoder interfaceEncIf Index = 2— Secondary encoder interface (if equipped)
Record the full error code and Info field. This is essential for targeted troubleshooting.
Error Escalation Pattern
Encoder faults typically follow this escalation:
- Intermittent signal glitches — Error 31221 appears during high-speed operation or when adjacent equipment is running. Machine recovers after reset.
- Frequent communication timeouts — Error 31225 appears with increasing frequency. Cable or connector is failing.
- Persistent fault at startup — Error 31220 or 31224. Hardware module failure or complete cable disconnect.
- Thermal fault — Error 15236 follows encoder problems because incorrect commutation causes excessive current draw, overheating the power stage. This is a cascading failure — fix the encoder before the drive is destroyed.
Signal Quality Analysis
Oscilloscope Diagnostic Techniques
An oscilloscope is the essential tool for encoder diagnostics. A multimeter cannot capture dynamic signal problems. Use a 2-channel or 4-channel digital oscilloscope (preferably a portable ScopeMeter rated for industrial use, such as Fluke 190 Series III or equivalent).
Probe Setup and Safety
WARNING: Encoder signals are referenced to drive electronics ground. Improper grounding of the oscilloscope can inject noise or create ground loops. Use differential probes or isolated probes whenever possible.
- Set the oscilloscope to use isolated/differential probing mode
- Connect the probe ground to the encoder signal ground (not chassis ground)
- Use 10x attenuation probes to minimize loading on the encoder signal
- For digital encoder signals (EnDat, BiSS, TTL): set time base to show 5-20 complete pulses
- For analog encoder signals (Sin/Cos 1 Vpp, resolver): set time base to show 2-4 complete cycles
Expected Waveforms by Encoder Type
TTL Incremental (RS-422):
Channel A: ┌──┐ ┌──┐ ┌──┐
│ │ │ │ │ │
─────┘ └────┘ └────┘ └────
Channel B: ┌──┐ ┌──┐
│ │ │ │
─────────┘ └────┘ └───────
Channel /A: (inverse of A)
Channel /B: (inverse of B)
Reference: ────────┐ ┌─────── (one pulse per revolution)
│ │
────────────┘ └─────────
- Amplitude: 4.5-5.5V differential (2.25-2.75V single-ended)
- Phase relationship: Channel B leads Channel A by 90 degrees (quadrature) in one direction of rotation
- Duty cycle: 50% ±5% at any speed
- Rise/fall time: < 100 ns for short cables; slower for long cables but must be < 1/4 of pulse period
Sin/Cos 1 Vpp:
Channel A (sin): ╱╲ ╱╲ ╱╲
╱ ╲ ╱ ╲ ╱ ╲
╱ ╲╱ ╲╱ ╲
Channel B (cos): ╱╲ ╱╲ ╱╲
╱ ╲ ╱ ╲ ╱ ╲
╱ ╲╱ ╲╱ ╲
- Amplitude: 1.0 Vpp ±10% (peak-to-peak)
- DC offset: typically 0.5V (midpoint)
- Phase: B leads A by 90 degrees
- Signal-to-noise ratio: should be > 40 dB (noise < 10 mVpp)
Lissajous Test (Sin/Cos encoders):
Connect Channel A to the X input and Channel B to the Y input of the oscilloscope. Display in X-Y mode. A healthy encoder produces a perfect circle:
╭─────╮
╱ ╲
│ o │ ← Circle centered at origin
╲ ╱
╰─────╯
- Circle indicates correct amplitude balance and 90-degree phase
- Ellipse = amplitude imbalance (one channel stronger) or phase error
- Figure-8 or other distortion = serious encoder damage (disk contamination, head misalignment)
- Oval that shifts = bearing wear or mechanical runout
Resolver:
Resolver output requires a demodulator to view the position signal. On ACOPOS drives, the resolver interface module handles this internally. To check resolver signals with a scope:
- Measure the excitation signal at the encoder connector: should be a clean sine wave at the drive’s excitation frequency (typically 5-10 kHz), amplitude per motor spec (usually 2-7 Vrms)
- Measure the sin and cos output signals: two sinusoidal signals whose amplitude varies with rotor angle
- The envelope of the resolver outputs should modulate smoothly as the shaft rotates
- Check for excitation signal distortion — if the excitation is noisy, the resolver outputs will be corrupted
EnDat / BiSS / Hiperface Digital:
These are bidirectional digital serial protocols. On a scope, you will see:
- Clock signal: clean square wave from the drive to the encoder (typically 1-16 MHz)
- Data signal: bidirectional digital bursts during communication windows
- Between communication windows: the incremental sin/cos signals (on EnDat 2.2 and Hiperface)
Diagnostic approach for digital encoders:
- Verify the encoder supply voltage (5.0V ±0.25V for EnDat, typically 5-9.5V for Hiperface)
- Check the clock signal integrity — clean edges, correct frequency
- Look for data corruption: CRC errors reported by the drive indicate bit-level errors on the data line
- Verify the incremental sin/cos signals between communication frames — same criteria as analog Sin/Cos above
Signal Quality Checklist
| Parameter | Healthy | Failing | Likely Cause |
|---|---|---|---|
| Amplitude | Within ±10% of spec | Low or dropped | Cable resistance, bad connector, failing encoder |
| Duty cycle (TTL) | 50% ±5% | Skewed | Unbalanced differential pair, failing comparator |
| Rise/fall time (TTL) | < 100 ns | > 500 ns | Excessive cable capacitance, long cable, damaged driver |
| Noise floor | < 5% of signal | > 20% of signal | Poor shielding, ground loop, EMI from VFD/power cables |
| Pulse jitter | < 2% of period | > 10% of period | Bearing wear, mechanical play, signal degradation |
| Lissajous shape | Circle | Ellipse/distorted | Amplitude imbalance, phase error, encoder damage |
| Common-mode noise | Negligible | Visible on both channels | Ground loop, shield not connected |
Feedback Cable Diagnostics
Cable Construction Requirements
B&R encoder cables are precision-manufactured assemblies designed for drag chain installations. Key construction features:
- Shielded twisted pairs — each differential signal pair is individually twisted and shielded
- Overall foil + braid shield — provides both high-frequency and low-frequency EMI protection
- Drag-chain rated jacket — designed for millions of flex cycles
- Molded connectors — IP67 rated, with locking mechanisms
Cable Inspection Procedure
Follow this procedure whenever an encoder fault is reported:
-
Visual inspection at the drive connector (X3/X3A/X3B on ACOPOS):
- Check connector is fully seated and locked
- Look for bent pins or damaged contacts
- Verify the cable strain relief is intact
- Check for heat damage (discolored connector housing)
-
Visual inspection along the cable run:
- Look for kinks, sharp bends, or crushed sections (minimum bend radius is typically 10x cable diameter)
- Check for abrasion damage, especially at cable carrier entry/exit points
- Look for oil or coolant contamination on the cable jacket
- Check cable carrier for proper routing and tension
-
Visual inspection at the motor connector:
- Same checks as drive-side
- Critical: verify the motor-side shield termination is intact (shield connected to motor housing via the connector)
- Check for contamination ingress into the connector
-
Continuity testing:
- Measure resistance of each signal pair end-to-end: should be < 1 ohm per wire
- Measure resistance between each signal wire and shield: should be > 10 Mohm (open circuit)
- Measure resistance between adjacent signal pairs: should be > 10 Mohm
- Measure resistance between signal wires and motor power wires (U/V/W): should be > 10 Mohm
-
Shield continuity:
- Verify the overall shield is continuous from drive connector to motor connector
- The shield should connect to the drive’s PE terminal at the cabinet end
- Ground the shield at one end only (typically the cabinet/drive end) to prevent ground loops. The motor end connects to the motor housing, which connects to PE through the motor cable shield.
Cable Routing Rules
Improper cable routing is the number one cause of encoder signal problems. Enforce these rules:
| Rule | Requirement | Rationale |
|---|---|---|
| Separation | Encoder cables ≥ 300 mm from motor power cables | Prevents capacitive and inductive coupling |
| Parallel runs | Never run encoder cables parallel to power cables | Even with separation, parallel runs couple noise |
| Crossing | Cross power cables at 90 degrees only | Minimizes coupling length |
| Cable trays | Separate encoder and power in different trays | Physical barrier prevents EMI |
| Ferrite cores | Install ferrite cores on encoder cables near the drive | Attenuates high-frequency common-mode noise |
| Cable length | Do not exceed maximum cable length for encoder type | Signal degradation and timing issues on long cables |
Maximum Cable Lengths by Encoder Type
| Encoder Type | Maximum Recommended Length | Notes |
|---|---|---|
| Resolver | 50 m | Passive sensor; less sensitive to length |
| TTL (RS-422) | 30-50 m | Differential, but rise time degrades with length |
| Sin/Cos 1 Vpp | 30 m | Analog signal attenuates with cable resistance/capacitance |
| EnDat 2.1 | 50 m (at 1 MHz) | Degrades at higher clock rates |
| EnDat 2.2 | 100 m (with delay compensation) | Propagation delay compensation extends useful range |
| Hiperface | 50 m | RS-485 based, reasonably robust |
| Hiperface DSL | 100 m (integrated in motor cable) | Requires transformer for noise rejection |
| BiSS-C | 50 m (at 10 MHz) | Speed depends on cable quality |
Interference Isolation Test
When encoder errors are intermittent and correlated with machine operation (other axes running, pumps cycling, etc.), perform this test:
- Monitor the encoder signals on an oscilloscope while triggering the suspect equipment
- If noise appears on the encoder signals when the other equipment operates, you have EMI coupling
- Systematically: a. Disconnect and re-connect the encoder cable shield at the cabinet PE bar b. Add ferrite cores at the drive end of the cable c. Temporarily run the encoder cable outside the cable tray (in air) to test if the tray itself is coupling noise d. If the problem resolves when the cable is outside the tray, re-route the cable with proper separation
Encoder Replacement Procedures
Before You Start: Assess the Situation
When replacing an encoder on a B&R servo motor, you are facing one of two scenarios:
Scenario A: The encoder memory is readable (encoder partially functional)
- You can read the commutation offset from the old encoder before removing it
- You may be able to write the same offset to a new encoder (if the new encoder supports it and you have the B&R EPROM function block — see notes below)
Scenario B: The encoder is completely dead (no memory access)
- You have lost the commutation offset
- You must either: (a) run the ACOPOS phasing procedure on every power-up, (b) configure the motor as a third-party motor with manual offset, or (c) send the motor to B&R repair for re-phasing
Physical Encoder Replacement Steps
WARNING: Servo motor encoder replacement requires precision mechanical work. The encoder is typically mounted to the motor’s rear shaft extension. Shaft runout of more than 0.01 mm can cause signal quality problems. If you are not experienced with servo motor repair, consider sending the motor to a qualified service center.
-
Remove the motor from the machine — Do not attempt encoder replacement with the motor installed. You need a clean work area and the ability to rotate the shaft freely.
-
Remove the motor end bell — This exposes the encoder assembly. On B&R 8LS motors, the encoder is typically mounted on the non-drive end (NDE). The end bell is secured with socket head cap screws.
-
Record the encoder orientation — Before removing the old encoder:
- Mark the encoder housing relative to the motor end bell with a scribe or punch mark
- Photograph the encoder mounting from multiple angles
- If the encoder has a reference mark on the shaft, record its position relative to the housing
-
Disconnect the encoder cable at the motor connector.
-
Remove the encoder — The encoder is typically secured to the shaft with a set screw or clamp, and to the housing with screws. Remove carefully to avoid damaging the shaft or housing bore.
-
Inspect the shaft and housing bore — Clean any debris, check for burrs or corrosion. The mounting surfaces must be pristine.
-
Install the new encoder — Reverse of removal. Ensure:
- The encoder is fully seated against the housing shoulder
- The shaft coupling is secure (set screw torqued to spec, or clamp tightened)
- The connector is oriented correctly for cable routing
- No debris is trapped between the encoder and housing
-
Test before closing — Before reinstalling the end bell:
- Connect the encoder cable (temporarily) to the drive
- Power on the drive
- Verify the drive can communicate with the encoder (no 31220/31224 errors)
- Rotate the shaft slowly by hand and verify position changes in Automation Studio
Post-Replacement Configuration
If Using a B&R Replacement Encoder with Blank Memory
A new B&R encoder ships with blank memory. The commutation offset must be established:
Option 1: ACOPOS Phasing Procedure (runs at every power-up)
The ACOPOS drive has a built-in phasing function (MC_Phasig / drive identification) that measures the commutation offset each time the drive starts. This is documented in Automation Studio help under “Phasing the Encoder” (einphasen).
Steps:
- In Automation Studio, enable the phasing function for the axis
- On each drive power-up, the axis will perform a phasing sequence (the motor will briefly move to find the electrical zero)
- The measured offset is stored in the
MOTOR_COMMUT_OFFSETparameter for the duration of the session - The offset is not written to the encoder memory — it is recalculated every power-up
Caveat: This means the axis will not be immediately ready after power-up. It must complete the phasing sequence before it can accept motion commands. This adds startup delay.
Option 2: Manual Third-Party Motor Configuration
Configure the motor as a generic motor in the ACOPOS parameter table (Automation Studio → Motor Parameters). Enter the commutation offset manually as a fixed parameter. This offset must be determined once through the phasing procedure, then recorded and entered permanently.
Steps:
- Run the phasing procedure once (Option 1)
- Read the resulting
MOTOR_COMMUT_OFFSETvalue from the drive parameters - Enter this value in the motor parameter table as a fixed offset
- Disable the startup phasing sequence
- The drive will use the fixed offset from the parameter table
Option 3: B&R Repair Service (recommended for critical axes)
Send the motor to B&R’s repair facility in Eggelsberg, Austria (or the regional repair center). They will:
- Run a precision phasing procedure
- Write the commutation offset to the encoder memory
- Return the motor ready to run with auto-recognition
This is the only way to restore the factory behavior where the commutation offset is stored in encoder memory and automatically read on power-up.
Writing to Encoder Memory (Advanced)
B&R provides an EPROM function block that can write data to encoder memory. However:
- B&R has removed public documentation for this functionality from newer Automation Studio help files
- The memory address offsets can change without notice between B&R firmware versions
- Using this function block requires internal B&R knowledge
- B&R does not publicly recommend this approach for field use
If you have access to the function block and documentation (e.g., through a B&R support contract), the general procedure is:
- Run the phasing procedure to measure the commutation offset
- Use the EPROM function block to write the offset to the encoder memory at the correct address
- Verify the write by power-cycling the drive and confirming it reads the correct offset
For engineers without OEM support: Do not attempt to write to encoder memory without the correct address map. Writing to the wrong address can corrupt the entire encoder memory, making the encoder permanently unusable.
Verifying Encoder Alignment Without Original Calibration Data
The Core Problem
When you have no documentation, no calibration data, and possibly a replaced encoder, you must verify that the encoder’s electrical position reading matches the motor’s actual electrical position. If these are mismatched, the drive will commutate at the wrong angle, causing:
- Excessive current draw (motor fights itself)
- Overheating (error 15236)
- Reduced torque (possibly 50% or less of rated torque)
- Vibration and acoustic noise
- Possible immediate fault on enable
Method 1: ACOPOS Phasing Procedure
This is the safest and most reliable method for establishing encoder alignment without calibration data.
- Ensure the axis is free to move (no mechanical interference, no load that could be dangerous)
- In Automation Studio, configure the axis for phasing:
- Set
MOTOR_COMMUT_OFFSETto 0 (or unknown) - Enable the phasing function (
MC_Phasingor equivalent)
- Set
- Enable the drive power stage
- The ACOPOS will: a. Energize the motor with a known current vector b. The rotor will align to a known electrical position c. The drive compares the encoder reading to the expected position d. The difference is the commutation offset
- Read the measured
MOTOR_COMMUT_OFFSETfrom the drive parameters - Record this value permanently
Important: During phasing, the motor shaft will rotate to the alignment position. Ensure this movement is safe for your application (axis not in a position where movement could cause collision or injury).
Method 2: DC Current Injection (Manual Alignment)
If you cannot use the ACOPOS phasing function (e.g., the drive firmware doesn’t support it, or the axis cannot be freed), you can perform a manual alignment:
- Disconnect the motor from the machine mechanically (if possible)
- Disconnect the encoder from the ACOPOS drive
- Apply DC current to two motor phases (e.g., U and V, with W open)
- The rotor will snap to a defined electrical position (the d-axis aligns with the applied field)
- Mark the rotor position (or record the mechanical angle)
- Reconnect the encoder and read its position at this rotor angle
- The difference between the encoder reading and the known electrical zero gives you the commutation offset
Safety warning: Applying DC current to motor phases requires a controlled current source. Use a suitable DC power supply with current limiting, or use the ACOPOS drive’s manual current injection mode if available. Never apply full DC bus voltage directly to motor windings.
Method 3: Back-EMF Measurement
For permanent magnet synchronous motors (most B&R 8LS motors):
- Rotate the motor shaft manually (or with another motor) at a known, constant speed
- Measure the back-EMF voltage on the three motor phases (U, V, W) with an oscilloscope
- The zero-crossings of the back-EMF correspond to the electrical commutation points
- Compare these zero-crossings to the encoder position readings
- The offset between back-EMF zero-crossings and encoder zero gives the commutation offset
This method requires access to the motor phases (before the drive output stage) and is most useful when the motor is disconnected from the drive.
Verification: How to Confirm Correct Alignment
After establishing a commutation offset (by any method), verify it with these checks:
| Test | Expected Result | If Wrong |
|---|---|---|
| Motor hums/vibrates when stationary (enabled, zero velocity) | Quiet, minimal vibration | Loud humming or vibration = wrong commutation angle |
| Current draw at zero speed, zero torque | Near zero (only magnetizing current) | High current draw = wrong commutation angle |
| Torque production | Smooth, full rated torque available | Reduced torque, cogging = wrong commutation angle |
| Temperature rise at rated load | Within motor spec | Rapid overheating = wrong commutation angle |
| Move 1 mechanical revolution, monitor position reading | Position changes by exactly encoder_counts / pole_pairs × electrical_ratio | Position jumps or discontinuities = encoder or commutation problem |
Common Encoder Failure Modes and Symptoms
Failure Mode 1: Cable and Connector Degradation
Symptoms:
- Intermittent error 31221 (cable disturbance)
- Errors that appear only during specific machine operations (cable flexing in carrier)
- Errors that go away when the cable is wiggled
- Gradual increase in error frequency over weeks/months
Root causes:
- Broken conductor inside the cable (especially at strain relief points)
- Corroded or oxidized connector pins
- Damaged cable shield (shield continuity broken)
- Connector not fully seated
- Cable crushed in cable carrier
Diagnosis:
- Wiggle the cable at connector points while monitoring for errors
- Measure continuity of each wire while flexing the cable
- Inspect connector pins under magnification for corrosion or bent pins
- Check cable resistance end-to-end (should be < 1 ohm for each wire)
Failure Mode 2: Bearing Wear in Encoder
Symptoms:
- Increasing position jitter at all speeds
- Noise or roughness when rotating the shaft by hand
- Lissajous pattern becomes irregular or shifts
- Error 31221 appearing more frequently
- Position errors that change with motor temperature (thermal expansion)
Root causes:
- Normal wear over operating hours
- Side loading on motor shaft (misaligned coupling)
- Vibration from adjacent equipment
- Contamination ingress through worn shaft seal
Diagnosis:
- Rotate the motor shaft slowly by hand and feel for roughness at the encoder end
- Scope the encoder signals — look for amplitude modulation that correlates with one revolution (indicates eccentricity)
- Lissajous test — bearing wear causes the circle to become an ellipse or figure-8
Important: Encoder bearing wear can appear as an encoder error, but the root cause may be motor bearing wear transferring vibration to the encoder. Check both.
Failure Mode 3: Optical Disk Contamination (Optical Encoders)
Symptoms:
- Random pulse drops (missed counts)
- Position drift in one direction
- Errors that worsen in dirty or humid environments
- No visible cable or connector problems
Root causes:
- Dust or particulate contamination on the optical disk or reading head
- Condensation inside the encoder housing
- Oil mist or coolant ingress
- Degraded shaft seal allowing contamination entry
Diagnosis:
- Look for environmental contaminants near the encoder
- Check if errors correlate with machine cleaning cycles or seasonal humidity changes
- The only definitive fix is encoder replacement with a sealed (IP67) unit
Failure Mode 4: Encoder Electronics Failure
Symptoms:
- Complete loss of encoder communication (error 31224 or 31225)
- No signals at all on the encoder lines (measured at the drive connector)
- Error persists after cable replacement
- Encoder supply voltage is correct at the drive connector
Root causes:
- Power surge or transient damaging encoder electronics
- Thermal aging of encoder ICs
- Moisture-induced corrosion on encoder PCB
- Manufacturing defect
Diagnosis:
- Measure encoder supply voltage at the drive connector (not at the encoder — if the voltage is good at the drive, the problem is in the cable or encoder)
- Disconnect the encoder at the motor end and measure the cable end-to-end
- If cable is good and supply voltage reaches the encoder connector, the encoder electronics have failed
Failure Mode 5: Resolver-Specific Failures
Symptoms:
- Signal amplitude dropping over time
- Position error that changes with temperature
- Error 31221 or 31222
Root causes:
- Resolver winding insulation degradation
- Resolver excitation signal distortion (from the drive’s resolver interface)
- Mechanical damage to resolver rotor/stator (air gap change)
Diagnosis:
- Measure resolver excitation signal at the encoder connector — should be clean sine wave at expected frequency and amplitude
- Measure sin/cos output amplitudes — should be equal and within spec
- Check resistance of resolver windings — compare to spec or to readings from a known-good motor of the same type
Failure Mode 6: Encoder Memory Corruption
Symptoms:
- Motor runs but with wrong commutation (vibration, overheating, reduced torque)
- Error 31226 (encoder data read error)
- Motor parameters are wrong after power cycle
- ACOPOS reports unexpected motor type or parameters
Root causes:
- Power interruption during encoder memory write
- EEPROM cell degradation (age-related)
- Voltage transient damaging memory cells
- Electromagnetic interference during communication
Diagnosis:
- In Automation Studio, read the motor parameters from the encoder memory and compare to the motor nameplate
- If parameters don’t match, the memory is corrupted
- Verify by reading the
MOTOR_COMMUT_OFFSET— if it has changed from the last known good value, the memory is unreliable
Resolution:
- Run the phasing procedure to establish a new commutation offset
- Configure the motor as a third-party motor with manual parameters (if memory cannot be trusted)
- Replace the encoder if memory corruption is recurrent
Quick-Reference Diagnostic Flowchart
Encoder Fault Reported (Error 3122x / 15206)
│
├── Is the error persistent or intermittent?
│ ├── PERSISTENT:
│ │ ├── Check encoder option module is seated in drive → reseated? OK
│ │ ├── Check encoder supply voltage at drive connector (5V ±0.25V for EnDat)
│ │ ├── Disconnect encoder at motor end → measure cable continuity
│ │ ├── If cable OK → encoder electronics likely failed → replace encoder
│ │ └── If cable bad → replace cable first
│ │
│ └── INTERMITTENT:
│ ├── Scope encoder signals → noise present?
│ │ ├── YES: Check cable routing, shielding, grounding → fix EMC issue
│ │ └── NO: Check for mechanical causes (bearing wear, loose coupling)
│ ├── Check connectors → reseat, clean pins
│ └── Monitor temperature correlation → thermal failure?
│
├── After fixing hardware → Error cleared?
│ ├── YES: Run motor, verify:
│ │ ├── No vibration at standstill
│ │ ├── Current draw near zero at standstill
│ │ ├── Smooth motion at all speeds
│ │ └── No overheating
│ │
│ └── NO: Check configuration:
│ ├── EncoderType parameter matches actual encoder
│ ├── Motor parameters match nameplate
│ └── Commutation offset is correct (run phasing if unsure)
│
└── If encoder was replaced → Commutation alignment needed
├── Run ACOPOS phasing procedure → record offset
├── Verify motor runs smoothly → done
└── If phasing unavailable → use manual DC injection method
Emergency Procedures
Encoder Fault During Production
- Do not force repeated reset attempts if the error recurs immediately. Each reset cycle with wrong commutation stresses the drive’s power stage.
- Isolate the axis — disable the axis in the PLC program so other axes can continue (if the machine supports partial operation).
- Check the obvious first — reseat the encoder connector at both ends (5 seconds, fixes 20% of problems).
- Swap cables — if you have a spare encoder cable of the correct type, try it.
- Swap drives — if you have a spare ACOPOS drive with the same option module, swap the drive (keep the original motor and encoder connected). If the error follows the drive, it’s a drive/option module problem, not an encoder problem.
Complete Loss of Encoder (Machine Down)
If the encoder is completely failed and you must get the machine running:
- Check if the axis is critical — can the machine operate (even in degraded mode) with this axis disabled?
- Source a replacement encoder — identify the exact encoder type and order a replacement (see encoder identification procedure above).
- While waiting for parts: install the replacement cable (if the fault is cable-related) and verify the encoder signals are dead (confirm it’s not a cable problem).
- When the replacement arrives: follow the encoder replacement procedure above, then run the phasing procedure to establish the commutation offset.
Thermal Cascade Protection
If you see error 15236 (overtemperature) combined with encoder errors:
- Stop immediately. The drive is fighting itself due to incorrect commutation. Continued operation will destroy the drive’s IGBT modules.
- Do not attempt to run the axis until the encoder problem is resolved.
- After fixing the encoder, verify DC link voltage stability before resuming operation.
- If the drive has been operating with wrong commutation for an extended period, have the drive inspected for IGBT degradation.
Preventive Maintenance for Encoder Systems
Schedule
| Interval | Action |
|---|---|
| Monthly | Visual inspection of encoder cables and connectors; check for cable carrier damage |
| Quarterly | Monitor encoder error frequency in the alarm log; trend error rates |
| Semi-annually | Scope encoder signals on critical axes; compare to baseline |
| Annually | Full cable insulation and continuity test; replace cables showing degradation |
| As needed | After any maintenance that disturbs cable routing or motor mounting |
Baseline Recording
When the machine is running correctly, record these baselines for future comparison:
- Encoder signal waveforms — scope and save screenshots for each axis
- Lissajous patterns — for Sin/Cos and resolver encoders
- Noise floor levels — with machine running and stopped
- Position reading stability — record the standard deviation of position readings with the axis stationary
- Motor current at standstill — should be near zero; record the actual value
- Encoder error count — note the error counter values in the drive parameters
Having these baselines makes it possible to detect gradual degradation before it causes a failure.
Spare Parts Strategy
Maintain these spares for encoder-related failures:
| Item | Quantity | Notes |
|---|---|---|
| Encoder cable (each type on the machine) | 1 per type | Must match the encoder interface module |
| Encoder option module (each type) | 1 per type | The module in the ACOPOS drive |
| Complete motor + encoder assembly (critical axes) | 1 per critical axis | Eliminates alignment issues — swap and run |
| Ferrite cores (cable diameter matched) | 10+ | For EMC troubleshooting |
Automated Encoder Monitoring via OPC-UA
Reading Encoder Data from the PLC Without the Project
If OPC-UA is configured on the CP1584, encoder data from ACOPOS drives is typically exposed in the motion namespace. This enables continuous monitoring without Automation Studio.
OPC-UA Encoder Variable Patterns
B&R’s mapp Motion exposes encoder data through predictable node patterns in the OPC-UA address space:
Root → Objects → [Application] → mappMotion → Axes → [AxisName] →
├── Encoder
│ ├── Position (LREAL) - Current encoder position in user units
│ ├── RawPosition (LREAL) - Raw encoder counts (before scaling)
│ ├── Velocity (LREAL) - Computed velocity in user units/s
│ ├── Acceleration (LREAL) - Computed acceleration
│ ├── Status (UINT) - Encoder status bits
│ ├── Error (UINT) - Active encoder error code (0 = OK)
│ ├── CommutOffset (REAL) - Current commutation offset value
│ ├── Resolution (UDINT) - Encoder resolution (counts/rev)
│ ├── InterfaceType (USINT) - Encoder interface type ID
│ └── Temperature (REAL) - Encoder temperature (if supported)
└── ...
The exact path depends on the OEM’s naming convention. Common axis name patterns:
gAxis1,gAxis2,gAxis3, … (sequential)gAxisSpindle,gAxisFeed,gAxisConv(functional)Axis_1,Axis_X,Axis_Y(underscore-separated)- Names matching the motor station label
Python Script for Continuous Encoder Monitoring
"""
Continuous ACOPOS encoder health monitor.
Requires: pip install opcua asyncua
Usage: python encoder_monitor.py <PLC_IP> [interval_seconds]
"""
import asyncio
import sys
import time
from datetime import datetime
from asyncua import Client
PLC_IP = sys.argv[1] if len(sys.argv) > 1 else "192.168.0.1"
INTERVAL = float(sys.argv[2]) if len(sys.argv) > 2 else 1.0
LOG_FILE = f"encoder_monitor_{datetime.now():%Y%m%d_%H%M%S}.csv"
HEADERS = [
"timestamp", "axis", "position", "velocity", "encoder_status",
"encoder_error", "cycle_time_ms"
]
async def monitor_encoders():
url = f"opc.tcp://{PLC_IP}:4840"
async with Client(url=url) as client:
root = client.get_root_node()
print(f"Connected to {url}. Scanning for encoder variables...")
axes = await find_encoder_nodes(client, root)
if not axes:
print("No encoder nodes found. Check OPC-UA configuration.")
return
print(f"Found {len(axes)} encoder axes: {list(axes.keys())}")
print(f"Logging to {LOG_FILE}")
print(",".join(HEADERS))
with open(LOG_FILE, "w") as f:
f.write(",".join(HEADERS) + "\n")
while True:
try:
for axis_name, nodes in axes.items():
row = await read_axis_data(nodes, axis_name)
print(",".join(str(v) for v in row))
with open(LOG_FILE, "a") as f:
f.write(",".join(str(v) for v in row) + "\n")
await asyncio.sleep(INTERVAL)
except KeyboardInterrupt:
print("\nMonitoring stopped.")
break
except Exception as e:
print(f"Error: {e}")
await asyncio.sleep(5)
async def find_encoder_nodes(client, root):
children = await root.get_children()
axes = {}
for child in children:
browse_name = (await child.get_browse_name()).Name
try:
sub_children = await child.get_children()
for sub in sub_children:
sub_name = (await sub.get_browse_name()).Name
sub_sub = await sub.get_children()
for axis_node in sub_sub:
axis_name = (await axis_node.get_browse_name()).Name
encoder_nodes = {}
for node in await axis_node.get_children():
node_name = (await node.get_browse_name()).Name
if any(kw in node_name.lower() for kw in
["position", "velocity", "encoder",
"status", "error", "commut"]):
encoder_nodes[node_name] = node
if encoder_nodes:
axes[axis_name] = encoder_nodes
except Exception:
continue
return axes
async def read_axis_data(nodes, axis_name):
row = [time.time(), axis_name]
for key in ["Position", "Velocity", "Encoder Status",
"Encoder Error", "CommutOffset"]:
node = nodes.get(key) or nodes.get(
next((k for k in nodes if key.lower() in k.lower()), None), None)
if node:
try:
val = await node.get_value()
row.append(val)
except Exception:
row.append("N/A")
else:
row.append("N/A")
row.append(INTERVAL * 1000)
return row
if __name__ == "__main__":
asyncio.run(monitor_encoders())
Detecting Encoder Degradation from Position Jitter
A healthy encoder produces consistent position readings when the axis is stationary. Degradation manifests as increasing jitter:
"""
Encoder jitter analysis. Record position data at rest, compute
standard deviation to quantify signal quality degradation.
"""
import asyncio, statistics
from asyncua import Client
from collections import deque
PLC_IP = "192.168.0.1"
AXIS_POSITION_NODE = "gAxis1.Position" # Adjust to match your namespace
SAMPLES = 1000
INTERVAL = 0.001 # 1 ms between samples
async def measure_jitter():
url = f"opc.tcp://{PLC_IP}:4840"
async with Client(url=url) as client:
node = client.get_node(f"ns=2;s={AXIS_POSITION_NODE}")
positions = deque(maxlen=SAMPLES)
print(f"Collecting {SAMPLES} position samples at {INTERVAL*1000:.0f}ms intervals...")
print("Ensure the axis is STATIONARY before starting.")
await asyncio.sleep(3)
for _ in range(SAMPLES):
val = await node.get_value()
positions.append(val)
await asyncio.sleep(INTERVAL)
vals = list(positions)
mean = statistics.mean(vals)
stdev = statistics.stdev(vals)
p2p = max(vals) - min(vals)
print(f"\n--- Encoder Jitter Analysis ---")
print(f"Mean position: {mean:.6f}")
print(f"Std deviation: {stdev:.6f}")
print(f"Peak-to-peak: {p2p:.6f}")
print(f"Min: {min(vals):.6f}")
print(f"Max: {max(vals):.6f}")
print(f"\nHealth assessment:")
if stdev < 0.0001:
print(" EXCELLENT - Encoder signal quality is optimal")
elif stdev < 0.001:
print(" GOOD - Within normal operating range")
elif stdev < 0.01:
print(" DEGRADED - Schedule encoder cable inspection")
else:
print(" CRITICAL - Encoder signal quality severely degraded")
print(" Action: Replace encoder cable immediately, scope signals")
asyncio.run(measure_jitter())
Reading Encoder Parameters via PVI
When OPC-UA is not available, PVI provides direct access to ACOPOS drive encoder parameters:
"""
Read ACOPOS encoder parameters via B&R PVI.
Uses Pvi.py (github.com/hilch/Pvi.py).
"""
from pvi import Pvi
PLC_IP = "192.168.0.1"
pvi = Pvi()
pvi.line_set(line_name="ANSL", ip=PLC_IP)
pvi.connect()
def read_param(axis, param):
var_name = f"acp10:{axis}.{param}"
try:
return pvi.variable_read(var_name)
except Exception as e:
return f"ERROR: {e}"
AXIS = "1"
params = {
"EncIf": "Encoder interface type",
"EncResol": "Encoder resolution (counts/rev)",
"EncStat": "Encoder status register",
"EncError": "Active encoder error code",
"MOTOR_COMMUT_OFFSET": "Commutation offset (rad)",
"EncAbsPos": "Absolute encoder position",
"EncIncPos": "Incremental encoder position",
"EncVelocity": "Encoder velocity",
"EncSupplyVolt": "Encoder supply voltage",
"MotorPolePairs": "Motor pole pairs",
"MotorRatedCurr": "Motor rated current",
}
print(f"=== ACOPOS Axis {AXIS} Encoder Parameters ===\n")
for param, desc in params.items():
val = read_param(AXIS, param)
print(f" {param:25s} = {val:>15} ({desc})")
pvi.disconnect()
See pvi-api.md for complete PVI setup instructions and python-diagnostics.md for more Python diagnostic script patterns.
Automated Phasing Procedure via PVI
Triggering Phasing Remotely
When the commutation offset is lost or needs re-measurement, you can trigger the ACOPOS phasing procedure from a Python script without Automation Studio:
"""
Trigger ACOPOS encoder phasing procedure via PVI.
WARNING: The motor shaft WILL move during phasing. Ensure safe.
"""
from pvi import Pvi
import time
PLC_IP = "192.168.0.1"
AXIS = "1"
pvi = Pvi()
pvi.line_set(line_name="ANSL", ip=PLC_IP)
pvi.connect()
print("Pre-phasing checks:")
print(f" Encoder error: {pvi.variable_read(f'acp10:{AXIS}.EncError')}")
print(f" Current offset: {pvi.variable_read(f'acp10:{AXIS}.MOTOR_COMMUT_OFFSET')}")
print(f"\nStarting phasing procedure for axis {AXIS}...")
print("WARNING: Motor will move to find electrical zero.")
pvi.variable_write(f"acp10:{AXIS}.PhasingStart", 1)
for i in range(30):
time.sleep(1)
status = pvi.variable_read(f"acp10:{AXIS}.PhasingStatus")
print(f" Phasing status: {status}")
if str(status) == "0" or str(status).lower() in ["done", "ready", "ok"]:
break
if str(status).lower() in ["error", "fault"]:
error = pvi.variable_read(f"acp10:{AXIS}.EncError")
print(f" PHASING FAILED. Encoder error: {error}")
break
new_offset = pvi.variable_read(f"acp10:{AXIS}.MOTOR_COMMUT_OFFSET")
print(f"\nPhasing complete. New commutation offset: {new_offset}")
print("Record this value for permanent configuration.")
pvi.disconnect()
Tools Required
| Tool | Purpose | Minimum Spec |
|---|---|---|
| Digital oscilloscope (portable) | Signal quality analysis | 2-channel, 100 MHz, isolated/differential probes |
| Digital multimeter | Continuity, voltage, resistance | True-RMS, 0.1 ohm resolution |
| Insulation resistance tester | Cable insulation check | 250V/500V test voltage |
| Torque screwdriver set | Encoder mounting hardware | Matches encoder mounting screw sizes |
| Dial indicator | Shaft runout check | 0.001 mm resolution |
| Cable tester | Encoder cable continuity | 4-wire minimum, can build from DMM + leads |
| Automation Studio (with SDM) | Drive parameter monitoring | Current version matching machine firmware |
| Label printer + heat-shrink labels | Cable identification | For documenting cable routing |
Key Findings
-
Encoder problems are the most common intermittent fault on ACOPOS systems. The combination of digital serial protocols, precision analog signals, and harsh industrial environments makes encoder systems the weakest link in the motion control chain.
-
B&R encoders store the commutation offset in encoder memory, not in the drive. The physical alignment between the encoder and motor is arbitrary — B&R measures the offset at the factory and stores it in the encoder’s EEPROM. There is no mechanical reference mark you can use without this data.
-
Writing to encoder memory is not publicly documented by B&R. The EPROM function block exists but its address maps are considered internal. Writing to the wrong address corrupts the encoder permanently. Do not attempt without B&R support or verified documentation.
-
The ACOPOS phasing procedure is your primary recovery tool. When the commutation offset is lost (encoder replacement, memory corruption), the drive can re-measure it at startup. This adds startup delay but allows operation without B&R repair service.
-
Error 15236 (overtemperature) following encoder errors indicates a cascading failure. Wrong commutation causes the drive to fight itself, generating excessive heat. Stop immediately — continued operation will destroy the IGBT modules.
-
80% of encoder “failures” are cable or connector problems. Always test the cable before condemning the encoder. Continuity testing, connector inspection, and scope analysis will usually identify the real problem.
-
EnDat 2.2 and Hiperface are the most common interfaces on B&R 8LS motors. Identify your encoder type from the option module part number in the drive before ordering any replacement parts.
-
Always maintain encoder signal baselines when the machine is healthy. Having waveform recordings and parameter readings from a known-good state makes it possible to detect degradation before it causes a failure, and dramatically speeds up fault diagnosis when problems occur.
Sources
- B&R ACOPOS Servo Drive Technical Manual — encoder interface specifications, fault codes, and parameter references
- B&R 8LS Three-Phase Synchronous Motor Documentation — motor and encoder option codes
- B&R Automation Studio mapp Motion Online Help — McEncoderAxis, McPhasing function block references
- B&R Community Forum (community.br-automation.com) — encoder fault discussions and troubleshooting
- EnDat 2.2 Specification (Heidenhain) — encoder protocol and signal characteristics
- Hiperface DSL Specification (SICK/Steute) — encoder protocol and diagnostic data format
- BiSS Protocol Specification — encoder communication protocol reference
- IEC 61800-5-1 — adjustable speed drive safety requirements
Related Documents
- acopos-drives.md — ACOPOS drive communication, fault codes (31220-31227, 7029-7053), parameter management, and
acp10sysconfiguration - physical-layer-sniffing.md — Oscilloscope and logic analyzer techniques for encoder signal analysis
- safe-io-diagnostics.md — SafeMOTION safety encoder monitoring (SLS, STO encoder integrity)
- grounding-emc.md — Shielding and grounding for encoder cable EMC
- analog-calibration.md — Analog signal conditioning relevant to sin/cos encoder signals
- spare-parts.md — Encoder and motor spare parts identification and sourcing
- pvi-api.md — PVI protocol for reading ACOPOS encoder parameters programmatically
- python-diagnostics.md — Python diagnostic script patterns for automated encoder monitoring
- opcua.md — OPC-UA namespace browsing for finding encoder data nodes
- cp1584-forensics.md — Network discovery and information extraction from unknown PLCs
- io-sniffing.md — Capturing POWERLINK traffic for drive/encoder communication analysis
- network-architecture.md — Network setup for diagnostic workstations
- diagnostic-workstation.md — Hardware and software setup for encoder diagnostics
- time-sync.md — Timestamp accuracy for correlating encoder error events across drives
Grounding, Shielding, and EMC Troubleshooting for B&R Installations
Grounding and electromagnetic compatibility (EMC) are the invisible infrastructure of every B&R PLC installation. When these are correct, the system “just works.” When they are wrong, symptoms manifest as phantom sensor errors, intermittent communication dropouts, and watchdog faults that look exactly like software bugs. For an automation engineer maintaining B&R CP1584 PLCs on undocumented legacy machines from defunct OEMs, EMC problems are among the most difficult to diagnose because they are intermittent, configuration-dependent, and rarely documented. This document covers systematic grounding audit procedures, shield termination techniques for B&R fieldbus cables, common EMC problems in industrial installations, and measurement techniques to identify EMC issues. Cross-references: analog-calibration.md for analog signal noise diagnosis, physical-layer-sniffing.md for physical-layer signal analysis, and io-card-hardware.md for IO card isolation and filtering.
1. Overview
B&R X20 systems are sensitive to grounding quality because the architecture relies on multiple bus systems (POWERLINK, X2X Link, CANopen) operating simultaneously in electrically noisy industrial environments. The X20 backplane communicates via the X2X Link at up to 10 Mbit/s over the DIN rail itself, making the rail’s ground integrity a critical path for both power distribution and data communication. A poor ground connection on the DIN rail can corrupt X2X packets, causing I/O module dropouts that appear as random hardware faults.
This document provides systematic procedures for auditing, diagnosing, and remediating EMC problems in B&R installations where no original documentation exists. The focus is on the X20CP1584 CPU and its associated I/O, communication, and bus systems.
1.1 How Grounding Faults Mimic Software Bugs
| Symptom | Looks Like | Often Actually Is |
|---|---|---|
| Intermittent sensor reading jumps | Scaling error in PLC program | Common-mode noise on analog input from ground loop |
| Random digital input state changes | Logic error or floating input | EMI coupling into unshielded sensor cable |
| POWERLINK node dropping out | Network configuration error | Shield not bonded at both ends, ground loop on Ethernet |
| X2X station not responding | Bus module failure | DIN rail oxidation breaking X2X ground return |
| Watchdog fault | Task class cycle time violation | EMI causing CPU cycle jitter or bus retry overhead |
| Analog input noise floor 3-5% | ADC calibration drift | Missing shield termination or cable routed with VFD power |
| CAN bus error frames | Wrong baud rate or node address | Missing termination resistor or shield not grounded |
The diagnostic challenge: all of these symptoms can also have legitimate software causes. The key differentiator is that EMC-induced problems are correlated with external events – motor starts, contactor closures, VFD operation, cell phone proximity, or time of day (when grid impedance changes).
1.2 The Legacy Machine Challenge
Defunct OEM machines typically present these grounding deficits:
- No single-line diagram or grounding plan
- PE terminals daisy-chained instead of star-point wired
- Cable shields left floating, pigtailed, or grounded at wrong points
- Signal cables routed in same tray as motor power cables
- Missing termination resistors on bus endpoints
- DIN rails not bonded to cabinet ground
- VFD output cables unshielded or improperly shielded
- No surge protection on field cables entering cabinet
- Cabinet door bonding straps removed or missing
2. B&R Grounding Fundamentals
2.1 X20 System Grounding Requirements
The B&R X20 system requires two distinct ground connections:
Protective Earth (PE) / Safety Ground
- The PE connection protects personnel from electric shock
- Required by IEC 61131-2 for all PLC equipment
- Connected via the DIN rail mounting, PE terminal blocks, and cable shields
- Minimum wire gauge: 2.5 mm², yellow-green insulation
Functional Ground / Reference Ground
- The functional ground provides a stable 0V reference for signal integrity
- B&R modules use the DIN rail as the primary functional ground path
- The X2X Link uses the rail as its ground return conductor
- Functional ground and PE are typically bonded together at the cabinet star point
2.2 Mains Network Systems and B&R Compatibility
| Network Type | Description | B&R Compatibility | Notes |
|---|---|---|---|
| TN-S | Separate neutral and PE from transformer to consumer | Best | Preferred. No neutral-to-PE currents in building wiring. Clean PE reference. |
| TN-C-S | Combined neutral/PE (PEN) from transformer, separated at consumer | Good with conditions | Requires proper separation at the main distribution board. If PEN currents flow in the building PE, noise can propagate. |
| TN-C | Combined neutral/PE throughout | Problematic | Neutral currents flow in PE, creating noise on the reference ground. Avoid for B&R installations. |
| TT | Separate earth electrodes for transformer and consumer | Good with conditions | Requires equipotential bonding between all exposed conductive parts. Earth electrode impedance must be low. |
| IT | Isolated or impedance-grounded neutral | Good | Used in medical and some industrial. No first-fault trip. Requires insulation monitoring. |
For undocumented machines, identify the network type by inspecting the main disconnect:
- TN-S: 5-wire (L1, L2, L3, N, PE) with separate N and PE bars
- TN-C-S: 4-wire at meter, split to 5-wire at distribution board with N-PE link
- TT: Earth electrode visible at building entry, separate from supply earth
2.3 Control Cabinet Grounding Hierarchy
B&R systems follow a hierarchical grounding structure. Each level must maintain low-impedance bonding to the level above it:
Building Ground (earth electrode / equipotential bonding bar)
|
| >= 16 mm² Cu or equivalent
|
Cabinet Ground (cabinet backplate / ground bus bar)
|
| >= 6 mm² Cu (preferably 16 mm²)
|
DIN Rail Ground (mounting rail with PE clip to cabinet)
|
| Via module-to-rail contact (X2X Link ground return)
|
Module Ground (bus module, electronic module, terminal block)
|
| Via PE terminal (2.5 mm² min, yellow-green)
|
Field Ground (cable shields bonded at EMC clamps)
2.4 X20 Backplane Grounding Through DIN Rail Contact
This is one of the most commonly overlooked grounding points in B&R installations.
The X2X Link bus uses the DIN rail itself as a ground return conductor. Every X20 bus module makes electrical contact with the DIN rail through its spring-loaded mounting clips. The X2X Link communication runs on two wires (DATA and GND), where GND is referenced to the DIN rail. If the DIN rail has poor connectivity to the cabinet ground bus, the X2X ground return path is compromised.
Critical requirements:
-
The DIN rail must be conductive (zinc-plated steel or aluminum). Painted or anodized rails are NOT acceptable unless the paint is removed at mounting clip contact points.
-
The DIN rail must be bonded to the cabinet ground bus with a PE clip (e.g., Phoenix Contact FT-DIN) and a minimum 6 mm² yellow-green wire.
-
Multiple DIN rails in the same cabinet must be bonded together with at least 6 mm² copper.
-
The rail must be clean – oxidation, paint, or anodizing under the module mounting clips creates intermittent contact that degrades X2X communication.
-
When using coated X20c modules, the grounding path through the module housing is unchanged; the coating does not affect the DIN rail contact.
Verification procedure:
- Measure resistance from any bus module’s DIN rail contact to the cabinet ground bus
- Target: less than 0.1 ohm (measured with 4-wire method)
- If greater than 0.5 ohm, clean rail contact points and check PE clip torque
2.5 PE Terminal Block Wiring Requirements
| Parameter | Requirement |
|---|---|
| Minimum wire gauge | 2.5 mm² (14 AWG) for individual module PE |
| Recommended wire gauge | 4 mm² or 6 mm² for PE bus runs |
| Insulation color | Yellow-green (mandatory for PE per IEC 60445) |
| Terminal type | Ring tongue or ferrule, not bare stranded wire |
| Torque | Per terminal manufacturer specification |
| PE bus bar bonding | 16 mm² minimum to cabinet ground |
For the X20CP1584 CPU, the power supply terminal block (X20TB12) includes dedicated PE connections:
- Pins 1-2: +24V CP/X2X Link supply and GND
- Pins 3-4: +24V I/O supply and GND
- The PE reference for the CPU is established through the DIN rail mounting and the X2X Link ground return
2.6 CP1584 CPU and Interface Module Grounding
The X20CP1584 provides galvanic isolation between its interfaces:
- Ethernet (IF2), POWERLINK (IF3), and X2X Link (IF6) are all isolated from each other, from other interfaces, and from the PLC core
- The I/O supply is NOT isolated from the I/O power supply
- The CPU/X2X Link supply IS isolated from the CPU/X2X Link power supply
This isolation means that each interface has its own ground reference. Cable shields must still be bonded to the cabinet ground at both ends (for Ethernet/POWERLINK) to maintain EMC integrity, but the isolation prevents ground loops from propagating between interfaces through the module itself.
Implication for interface modules: When installing X20IF2772 (CANopen) or other interface modules in the CP1584’s slot(s), those modules receive their ground reference through the X2X backplane. The module’s own cable shields must be bonded to the cabinet ground separately from the module’s signal ground.
2.7 Ground Loop Formation: Causes and Prevention
A ground loop occurs when two or more ground paths exist between equipment, creating a loop that can pick up electromagnetic interference and inject it as common-mode voltage into signal circuits.
Common causes in B&R installations:
-
Cable shield grounded at both ends with no equipotential bonding between the two ground points (creates a loop through the shield)
-
Sensor grounded at the field device and again at the B&R analog input module
-
Multiple cabinets with separate earth references connected by signal cables without proper equipotential bonding
-
24V supply negative connected to ground at more than one point
Prevention strategies:
- Ensure all cabinets and ground points are bonded to a single equipotential ground bus with impedance less than 0.1 ohm between any two points
- For analog signals from remote sensors with their own ground, use isolated analog input modules or signal isolators
- Never connect the 0V of the B&R I/O supply to PE at more than one point
- For cables between buildings or between separately grounded structures, use galvanic isolation at one end
2.8 Reference Ground vs. Safety Ground
| Property | Safety Ground (PE) | Reference Ground (0V) |
|---|---|---|
| Purpose | Personnel protection | Signal integrity |
| Color code | Yellow-green | Blue or black (0V), or per IEC 60445 |
| Current capacity | Must handle fault currents (kA range) | Signal currents only (mA range) |
| Connection | DIN rail to cabinet to building earth | Internal to module, derived from power supply |
| Test method | Earth electrode resistance test | Voltage measurement, noise floor |
| Separation | Never remove or disconnect for testing | May be isolated for measurement with caution |
3. Shield Termination for B&R Fieldbus Cables
3.1 POWERLINK (Ethernet) Cable Shield Termination
B&R POWERLINK uses standard Ethernet physical layer (100BASE-TX) with the X20CA0E61 series cables. These are shielded twisted-pair cables with RJ45 connectors.
Cable specifications (X20CA0E61 series):
- Type: Cat5e industrial, shielded, PVC jacket
- Connectors: 2 x shielded RJ45 (plug to plug)
- Available lengths: 0.2 m to 60 m (X20CA0E61.00020 through X20CA0E61.0600)
- For lengths beyond 20 m: use X20CA0E61.xxxx series (up to 60 m)
- UL recognized (E470046)
Shield termination for POWERLINK/Ethernet:
Ethernet standards (IEEE 802.3) and B&R guidelines require shielded cables to have their shields bonded at both ends. This is different from analog signal practice (which often uses single-ended grounding).
[CP1584 PLK port] ---X20CA0E61 cable--- [Remote node PLK port]
|RJ45 shield| |RJ45 shield|
| |
Cabinet PE Remote cabinet PE
| |
Building equipotential bond <-----> |
Why both-end bonding for Ethernet:
- The shield acts as a Faraday cage for the differential pairs
- High-frequency EMI requires low-impedance grounding at both ends to be effective
- The shield current from potential differences between grounds is confined to the shield by the twisted-pair’s balanced coupling
- Ethernet transformers at each end provide galvanic isolation from the shield
RC circuit in shielded RJ45 jacks:
- B&R shielded RJ45 ports (both Ethernet IF2 and POWERLINK IF3 on the CP1584) include RC circuits connecting the jack shield to chassis ground
- These circuits (typically 1 nF capacitor + 1 MOhm resistor) provide high-frequency bonding to ground while blocking low-frequency ground loop currents
- This allows both-end shield bonding without creating low-frequency ground loops through the shield
Practical notes:
- Never use unshielded (UTP) patch cables for POWERLINK in industrial environments
- Maximum segment length between two stations: 100 m (per 100BASE-TX standard)
- Cross-over wiring is used in X20CA0E61 cables (B&R uses MDI-X internally on POWERLINK ports)
3.2 X2X Bus Cable Shield Termination
The X2X Link is B&R’s proprietary backplane bus that connects the CPU to X20 I/O stations via the X2X Link bus modules. The cable carries both communication and power.
B&R recommendation (from X20 System User’s Manual):
“B&R recommends always using a grounding terminal via the top-hat rail to connect the X2X Link cable shield directly with the conductive and grounded backplane.”
For X2X cables:
- The shield should be bonded to the DIN rail (which serves as the X2X ground reference) at both ends
- Use a grounding terminal block at each end to connect the cable shield to the DIN rail
- The B&R cable shield clamp (X20AC0SG1) is designed for this purpose
Shield connection using X20AC0SG1 cable shield clamp:
- The X20AC0SG1 latches to the terminal block position on the DIN rail
- A cable lug connects the clamp to the bus module’s ground connection
- Accepts cable shields from 3 mm to 8 mm diameter
- Available in packs of 10 (X20AC0SG1.0010) or 100 (X20AC0SG1.0100)
[X2X Link port] ----[X2X cable]---- [Remote X2X station]
| |SHLD| |
Module GND X20AC0SG1 Module GND
| clamp |
DIN rail --> PE rail <------- DIN rail
3.3 CAN Bus Shield Termination
For CANopen on the X20IF2772 interface module:
Pinout of the 5-pin multipoint connector (0TB2105 terminal block):
| Pin | Function |
|---|---|
| 1 | CAN_GND (CAN ground) |
| 2 | CAN_L (CAN low) |
| 3 | SHLD (Shield) |
| 4 | CAN_H (CAN high) |
| 5 | NC (not connected) |
Termination resistors:
- The X20IF2772 has integrated terminating resistors (120 ohm each, one per CAN interface)
- Each CAN interface has a physical switch on the bottom of the module to enable/disable the termination
- LED “TERM CAN 1” or “TERM CAN 2” (yellow) indicates the resistor is active
- Per CAN specification, both ends of the bus must have 120 ohm termination (two resistors in parallel = 60 ohm on the bus, which matches the characteristic impedance of typical CAN cable)
Shield grounding for CAN bus:
- B&R provides a dedicated SHLD pin (pin 3) on the CAN connector
- For CANopen in industrial environments, the shield should be bonded to the cabinet ground at both ends
- Use an EMC cable clamp or the X20AC0SA08 shield connection clamp (accepts 3-8 mm shield diameter)
- The shield ground path is separate from CAN_GND (pin 1) – CAN_GND is the signal reference, SHLD is the EMC shield
- Bond SHLD to the cabinet equipotential ground bus, not to CAN_GND
Maximum bus parameters:
- Maximum distance: 1000 m (at lower baud rates; at 1 Mbit/s, distance is typically limited to ~40 m)
- Maximum transfer rate: 1 Mbit/s
- CAN controller: SJA 1000 (per X20IF2772 datasheet)
3.4 Serial RS485/RS232 Shield Handling
The X20CP1584 provides an RS232 interface (IF1) via the 12-pin X20TB12 terminal block. RS232 is typically used for programming/debug and is short-range (max 15 m per RS232 standard, though B&R rates it to 900 m – this likely assumes RS422/RS485 conversion equipment).
RS232 shield handling:
- RS232 cables are rarely shielded in practice, but in noisy environments a shielded cable should be used
- Shield should be grounded at the CP1584 end (cabinet ground) only – single-point grounding
- Do not ground the RS232 cable shield at the PC end, as PCs may have different ground potentials
For RS485 field connections (via interface modules):
- Use twisted-pair shielded cable
- Bond shield at both ends if both devices share the same equipotential ground
- If grounds differ significantly (e.g., remote field panel), ground shield at the B&R end only
- Use 120 ohm termination at both ends of the RS485 bus
See serial-diagnostics.md for detailed RS485 noise diagnosis.
3.5 Shield Continuity Testing Procedure
Equipment needed: Multimeter with low-ohm mode (resolution to 0.01 ohm), or preferably a 4-wire milliohmeter.
Procedure:
- Power down the cabinet and all connected field devices
- Disconnect one end of the cable under test from its module
- At the disconnected end, separate the shield from any ground connection
- Measure resistance from the shield at the near end to the shield at the far end
- For X2X Link cables: measure from the shield at the CPU end to the shield at the remote station end
Pass/fail criteria:
| Cable Type | Length (m) | Max Shield Resistance |
|---|---|---|
| POWERLINK (X20CA0E61) | 1-20 | < 1 ohm |
| POWERLINK (X20CA0E61) | 20-60 | < 3 ohm |
| X2X Link | 1-10 | < 0.5 ohm |
| CAN bus | 1-100 | < 5 ohm |
| Analog sensor | 1-50 | < 2 ohm |
If shield resistance is high:
- Check shield clamp connections at both ends
- Check for broken braid at cable entry points
- Check for shield crimped too tightly (individual strands broken)
- Replace cable if shield integrity is compromised
3.6 EMC Cable Clamps and Shield Connection Terminals
B&R-specific components:
| Part Number | Description | Shield Diameter | Notes |
|---|---|---|---|
| X20AC0SG1.0010 | Cable shield grounding clamp, 10 pcs | 3-8 mm | Latches to DIN rail terminal block position |
| X20AC0SG1.0100 | Cable shield grounding clamp, 100 pcs | 3-8 mm | Same as above, bulk pack |
| X20AC0SA08.0010 | Shield connection clamp, 10 pcs | 3-8 mm | Alternative shield connection method |
Third-party equivalents:
- Phoenix Contact SK series shield terminals
- Weidmuller KLS shield clamps
- Wago 2606 shield connection
Proper installation technique:
- Strip cable jacket back approximately 30-40 mm from the cable entry point
- Do NOT untwist or comb out the shield braid – keep it as a cylinder
- Slide the EMC clamp over the exposed shield braid
- Tighten the clamp screw to the specified torque (do not over-tighten – this breaks individual strands and increases resistance)
- Route a short ground wire from the clamp to the DIN rail PE bar or cabinet ground bus
- Ground wire: minimum 2.5 mm² yellow-green, ferrule at both ends
4. Cable Routing and Segregation
4.1 Separation of Power and Signal Cables
Minimum separation distances between power cables and signal cables:
| Voltage Level | Minimum Separation (parallel run) | Minimum Separation (crossing) |
|---|---|---|
| 24 VDC signal | 50 mm (2 in) | Contact crossing at 90 degrees is acceptable |
| 230 VAC power | 200 mm (8 in) | 50 mm with shielded signal cable |
| 400 VAC / 480 VAC power | 300 mm (12 in) | 100 mm minimum |
| VFD output (PWM) | 500 mm (20 in) | 200 mm, shielded motor cable mandatory |
4.2 B&R Recommended Cable Routing in Control Cabinets
TOP OF CABINET
+---------------------------------------------------+
| |
| [AC power distribution] [AC power out] | <- Power zone (top)
| |
|---------------------------------------------------|
| |
| [EMC filters] [Surge protection] | <- Filter zone
| |
|---------------------------------------------------|
| |
| [VFD / drives] | <- Drive zone
| |
|---------------------------------------------------|
| |
| [24V power supply] | <- Power supply zone
| |
|---------------------------------------------------|
| |
| [X20CP1584 CPU] [Interface modules] | <- PLC zone
| [X20 I/O stations on DIN rails] |
| |
|---------------------------------------------------|
| |
| [POWERLINK cables] [X2X Link cables] | <- Communication zone
| [CAN bus cables] [Field signal cables] |
| |
+---------------------------------------------------+
BOTTOM OF CABINET
Cable entry from bottom for signal/communication cables.
Cable entry from top for power cables (if possible).
4.3 Crossing Angles
When power and signal cables must cross:
- Cross at exactly 90 degrees (perpendicular)
- Never run power and signal cables parallel for any distance
- If parallel routing is unavoidable, maintain the minimum separation distance
- At crossings, maintain physical separation – do not strap cables together
4.4 Cable Tray Segregation
| Tray | Cable Types | Color Convention |
|---|---|---|
| Power tray (top) | Motor power, VFD output, AC mains | Black jacket |
| Communication tray (middle) | POWERLINK, X2X, CAN bus, Ethernet | Green (B&R POWERLINK), blue or grey |
| Signal tray (bottom) | Analog inputs, digital inputs, encoder cables | Blue or grey, individually shielded |
4.5 Ferrite Core Placement
Ferrite cores suppress high-frequency common-mode currents on cables. Place them:
On POWERLINK/Ethernet cables:
- Near the CP1584 RJ45 connector (within 50 mm of the connector)
- Near the remote node connector
- Useful when cable routes near VFDs or motor power cables
- Use ferrite clamps sized for Cat5e cables (inner diameter ~7 mm)
On CAN bus cables:
- Near each end of the bus (at the X20IF2772 and the last node)
- Prevents high-frequency emissions from the CAN bus and reduces susceptibility to external fields
- Use ferrite clamps sized for the CAN cable diameter
On X2X Link cables:
- Near the CPU end and near the remote station end
- Especially important if the X2X cable runs near VFD output cables
On analog input cables:
- Near the B&R analog input module end
- Reduces high-frequency noise coupling into the ADC
- See analog-calibration.md for analog noise floor measurement
On VFD motor cables:
- At the VFD output terminals (essential)
- Prevents conducted emissions from traveling along the motor cable
- B&R ACOPOS drives require EMC-compliant output cable installation
Ferrite core selection:
| Application | Material | Impedance at 100 MHz | Inner Diameter |
|---|---|---|---|
| Ethernet/CAN | MnZn | 50-100 ohm | 7-8 mm |
| X2X Link | NiZn | 30-60 ohm | 5-6 mm |
| Motor cable | MnZn | 100-200 ohm | 15-25 mm (snap-on) |
| Analog signal | NiZn | 30-60 ohm | 5-8 mm |
4.6 Recommended Cable Types
| Bus System | Recommended Cable Type | Notes |
|---|---|---|
| POWERLINK | B&R X20CA0E61 series (Cat5e, shielded) | Do not substitute with UTP patch cables |
| X2X Link | B&R X2X Link cable (shielded) | Shield must be bonded to DIN rail at both ends |
| CANopen | CAN bus cable per CiA DR-602 (shielded, twisted pair) | Characteristic impedance 120 ohm |
| Analog 4-20 mA | Individually shielded twisted pair | Overall shield acceptable if no power cables nearby |
| Digital inputs | Unshielded acceptable for short runs (< 5 m), shielded for longer runs | |
| RS232 | Shielded twisted pair for industrial use | |
| RS485 | Shielded twisted pair, 120 ohm characteristic impedance |
5. Common EMC Problems in B&R Installations
5.1 Intermittent Sensor Reading Errors from EMI
Symptoms: Analog sensor readings jump randomly by 1-5% of span. Digital inputs flicker on and off.
Root cause: Common-mode noise coupled into signal cables from nearby power cables, VFDs, or contactor coils.
Diagnosis:
- Observe correlation between sensor errors and motor starts/stops
- Measure common-mode voltage on analog inputs (see Section 6.4)
- Check cable routing for proximity to power cables
- Verify shield termination at both the sensor and the module
Remediation:
- Ensure sensor cable shields are properly bonded at both ends (or at the PLC end for grounded sensors)
- Re-route cables away from power cables
- Add ferrite cores near the B&R module end
- For analog signals, verify the module’s noise specifications (see analog-calibration.md)
5.2 POWERLINK Communication Dropouts from Ground Loops
Symptoms: POWERLINK S/E LED shows error states (red on, or blinking). Remote nodes drop out intermittently. Automation Studio network view shows nodes in error.
Root cause: Ground loop creating common-mode voltage on POWERLINK cable shield, exceeding the Ethernet transformer’s common-mode rejection range.
Diagnosis:
- Check S/E LED state on CP1584 (see Section 2.8 in the CP1584 datasheet for LED error codes)
- Measure voltage between the shield of the POWERLINK cable and the cabinet ground at the CP1584 end
- If voltage is present (more than ~1V AC), there is a ground loop
Remediation:
- Ensure all cabinets in the POWERLINK network are bonded to a single equipotential ground
- If cabinets cannot be bonded (e.g., different buildings), use POWERLINK fiber optic converters
- Replace unshielded Ethernet cables with B&R X20CA0E61 shielded cables
- Check that the RC circuit in the RJ45 jack shield is intact (not bypassed)
See powerlink-internals.md for POWERLINK frame error analysis.
5.3 X2X Bus Faults from VFDs and Contactor Switching
Symptoms: X2X stations (I/O modules) drop off the bus and reappear. IO module status LEDs show error. Bus module LEDs indicate communication failure.
Root cause: The X2X Link ground return is through the DIN rail. If VFD switching noise or contactor arc energy couples into the DIN rail, X2X communication is corrupted.
Diagnosis:
- Check if X2X errors correlate with VFD starts or contactor operations
- Measure noise on the DIN rail using an oscilloscope (probe between DIN rail and cabinet ground)
- Verify DIN rail-to-cabinet ground bonding (should be < 0.1 ohm)
Remediation:
- Improve DIN rail bonding to cabinet ground bus
- Separate X2X cables from VFD output cables
- Add EMC filters to VFD power inputs
- Use shielded VFD output cables with 360-degree shield bonding at both ends
- Ensure VFD motor cable shield is bonded at the VFD chassis and at the motor frame
See x2x-protocol.md for X2X bus diagnostic details.
5.4 Analog Input Noise
Symptoms: Analog input readings show excessive jitter or noise floor. Readings may drift with motor speed or process state.
Root cause: Inadequate shielding, ground loops on analog signal cables, or missing reference ground.
Diagnosis:
- Short the analog input at the terminal block and observe noise floor
- If noise persists with shorted input, the problem is internal to the module or its power supply
- If noise disappears with shorted input, the problem is on the cable/sensor side
Remediation:
- Verify shield bonding on analog cables
- Check for ground loops between sensor ground and module ground
- Consider using isolated analog input modules (B&R X20AI463x with galvanic isolation)
- Add analog input filters in software (moving average, median filter)
See analog-calibration.md for detailed analog noise analysis.
5.5 CAN Bus Error Frames from EMI
Symptoms: CAN bus error counters increment rapidly. CAN bus goes bus-off. X20IF2772 TxD LED shows constant activity even when no data should be transmitted (error frame retransmission).
Root cause: EMI on the CAN bus wiring causing bit errors, triggering error frames and retransmissions.
Diagnosis:
- Use Automation Studio or CAN analyzer to monitor error frame count and error type (bit error, stuff error, CRC error)
- Check that termination resistors are enabled at both ends of the bus (TERM CAN LED on X20IF2772)
- Verify CAN cable shield is bonded to ground at both ends via pin 3 (SHLD)
Remediation:
- Verify both-end termination (120 ohm at each end = 60 ohm measured across CAN_H/CAN_L with bus powered down)
- Re-route CAN bus cables away from power cables
- Add ferrite cores near both ends of the CAN bus
- Replace damaged CAN cable (check for crushed or kinked sections)
See if2772-canopen.md for CAN error handling specifics.
5.6 Phantom IO State Changes
Symptoms: Digital inputs change state without any physical stimulus. Outputs toggle unexpectedly.
Root cause: EMI coupling into input circuits through unshielded cables, floating inputs, or inadequate input filtering.
Diagnosis:
- Monitor input states in Automation Studio watch window while operating nearby motors/contactor
- Check if inputs are properly wired (not floating – floating inputs are noise antennas)
- For digital inputs, verify input filter time is appropriate (default is typically 3 ms, increase to 10 ms for noisy environments)
Remediation:
- Wire unused digital inputs to 0V (never leave floating)
- Use shielded cable for long digital input runs
- Increase input filter time in Automation Studio configuration
- Add pull-down resistors to inputs that receive very short signals in noisy environments
See io-card-hardware.md for IO module signal conditioning details.
5.7 Ethernet Link Dropouts on POWERLINK
Symptoms: POWERLINK PLK LED goes dark. Node disappears from the network. Link re-establishes after a variable delay.
Root cause: Physical layer signal degradation from EMI, poor cable, or marginal shield termination.
Diagnosis:
- Check PLK LED state on CP1584 and remote nodes
- Measure POWERLINK cable shield continuity
- Try a known-good X20CA0E61 cable of the same length
- Check if problem is correlated with specific activities (motor starts, welding, etc.)
Remediation:
- Replace POWERLINK cable with genuine B&R X20CA0E61
- Verify RJ45 connector seating (fully latched)
- Add ferrite core near the CP1584 POWERLINK port
- Reduce POWERLINK segment length if operating near the 100 m limit
- Check for cable damage from mechanical stress or crushing
5.8 Watchdog Faults from EMI-Induced Cycle Time Violations
Symptoms: CPU watchdog triggers. System enters FAULT state. Logbook shows cycle time exceeded configured limit.
Root cause: EMI causing X2X bus retries or POWERLINK retransmissions, which add latency to the I/O cycle, pushing the total cycle time beyond the watchdog limit.
Diagnosis:
- Check Automation Studio logbook for cycle time values near the limit
- Correlate watchdog events with communication error events
- Measure task class cycle times under normal and noisy conditions
Remediation:
- Fix the underlying EMC problem (shielding, grounding, cable routing)
- Increase the watchdog timeout in Automation Studio (if the application can tolerate it)
- Reduce the number of nodes on affected bus segments
- Optimize the task class configuration to reduce communication overhead
5.9 ADC Reading Jitter and Noise Floor
Symptoms: Analog readings fluctuate by several LSBs even with a stable physical input.
Root cause: Insufficient ADC resolution for the signal range, inadequate filtering, or noise on the reference ground.
Diagnosis:
- Apply a known stable voltage to the analog input
- Measure the peak-to-peak variation in the digital reading
- Compare to the module’s published resolution and noise specifications
Remediation:
- Ensure the analog input module’s power supply is clean and well-regulated
- Verify the module’s AGND reference is solid (check DIN rail contact)
- Apply software filtering (oversampling + averaging)
- Check for nearby noise sources (switch-mode power supplies, VFDs)
6. Systematic EMC Audit Procedure
6.1 Step 1: Visual Inspection Checklist
Perform this inspection with all power OFF and locked out/tagged out (LOTO).
Cabinet grounding:
- Cabinet bonded to building ground with visible, properly sized conductor
- Ground bus bar present and all PE wires landed on it (no daisy-chains)
- Cabinet door bonded to cabinet body with braided strap or bonding conductor
- DIN rail bonded to cabinet ground bus with PE clip and yellow-green wire
- Multiple DIN rails bonded together
DIN rail condition:
- DIN rail is conductive (not painted/anodized at module contact points)
- DIN rail is clean, no visible oxidation or corrosion
- All modules are fully seated on the rail (no gaps)
- End clamps installed at both ends of each module row
Cable shields:
- All shielded cables have shields bonded at entry points (EMC clamps present)
- No pigtail shield connections (shield wires wrapped around a screw terminal)
- Shields bonded with 360-degree contact via EMC clamps, not via flying leads
- POWERLINK cables are B&R X20CA0E61 (shielded), not UTP patch cables
- CAN bus cable shields bonded to ground at both ends
- X2X Link cable shields bonded to DIN rail at both ends
Cable routing:
- Power cables separated from signal cables per minimum distances
- No signal cables routed through power cable trays
- Power/signal cable crossings are at 90 degrees
- Cable entry points are at correct locations (power from top, signals from bottom)
- No excessive cable lengths coiled inside the cabinet
Termination and configuration:
- CAN bus termination resistors active at both ends (check X20IF2772 TERM LEDs)
- All unused digital inputs wired to 0V
- Analog input reference jumpers installed correctly
- No visible damage to cable jackets or shield braids at entry points
EMC components:
- EMC filters installed on VFD power inputs
- Surge protectors installed on field cables entering the cabinet
- Ferrite cores present on POWERLINK and CAN bus cables (if in noisy environment)
- VFD output cables are shielded with shield bonded at both ends
6.2 Step 2: Ground Impedance Measurements
4-wire (Kelvin) measurement method for ground impedance:
The 4-wire method eliminates the contribution of test lead resistance from the measurement, providing accurate low-ohm readings down to 0.01 ohm.
Current source Voltmeter
(I+) (V+)
| |
+---[R_under_test]---+---+
| |
(I-) (V-)
Current leads carry the measurement current.
Voltage leads measure the voltage drop across R.
Impedance = V_measured / I_forced
Equipment:
- Dedicated ground impedance tester (Fluke 1654B, Megger MIT430, or similar): $500-2000
- Alternative: Precision multimeter with 4-wire ohms mode (Fluke 87V does NOT have 4-wire; use Fluke 8846A or Keithley 2110): $500-1500
- Minimum resolution: 0.01 ohm
Measurement points and targets:
| Measurement Point A | Measurement Point B | Target |
|---|---|---|
| Cabinet ground bus | Building ground bar (main) | < 0.1 ohm |
| DIN rail | Cabinet ground bus | < 0.1 ohm |
| Module PE terminal | DIN rail (via module contact) | < 0.1 ohm |
| EMC clamp (any cable) | Cabinet ground bus | < 0.1 ohm |
| Remote cabinet ground bus | Local cabinet ground bus | < 0.1 ohm |
Procedure:
- Verify all power is OFF and LOTO is applied
- Select 4-wire ohms mode on the meter
- Connect current leads to the two points under test
- Connect voltage leads to the same two points (inside the current lead connections)
- Read the impedance value
- Record the measurement with date, ambient temperature, and equipment ID
With a standard 2-wire multimeter (less accurate but possible):
- Set multimeter to lowest ohms range
- Touch probes together and note the lead resistance (typically 0.1-0.5 ohm)
- Measure between the two points
- Subtract the lead resistance from the reading
- This method is only reliable for measurements above 0.5 ohm; for lower values, use a dedicated 4-wire instrument
6.3 Step 3: Shield Continuity Testing
Procedure:
- Power OFF, LOTO
- Disconnect the cable under test at one end (remove terminal block or disconnect RJ45)
- At the far end, verify the shield is disconnected from ground (or note which end is grounded)
- Measure shield resistance end-to-end using the 2-wire method (subtract lead resistance)
- Measure shield-to-conductor insulation resistance (should be > 1 Mohm at 500V DC)
Pass/fail criteria:
- Shield resistance end-to-end: proportional to length, typically < 1 ohm per 20 m
- Shield-to-core insulation: > 20 Mohm (ideally > 100 Mohm)
Common findings in legacy machines:
- Shield continuity broken at cable entry point (braid cut during cable stripping)
- Shield grounded through a pigtail (single strand of braid wrapped around a screw) – high resistance
- Shield crimped too tightly at a terminal, breaking most braid strands
- Shield not connected at all (floating)
6.4 Step 4: Cable Routing Assessment
Document the current cable routing with photographs and a sketch. Note:
- Cable types and approximate routing paths
- Proximity of signal cables to power cables (measure and record distances)
- Cable crossings: are they at 90 degrees?
- Cable entry and exit points from the cabinet
- Coiled or excess cable lengths inside the cabinet
- Whether VFD output cables are shielded
Assessment checklist:
| Item | Finding | Remediation Priority |
|---|---|---|
| POWERLINK cable routed near VFD output | Distance: ___ mm | High |
| Analog sensor cable in power tray | Yes/No | High |
| X2X cable parallel to 480V motor cable | Distance: ___ mm | Critical |
| CAN bus cable routed through cable tray with contactor wiring | Yes/No | Medium |
| Excess cable coiled inside cabinet | Length: ___ m | Low |
| Unshielded cable used for analog signal | Yes/No | High |
6.5 Step 5: Near-Field Probing for Noise Sources
This step requires the cabinet to be powered ON with the machine in operation.
Equipment:
- Near-field probe set (H-probe for magnetic field, E-probe for electric field)
- Oscilloscope (Rigol DS1054Z or similar, 100 MHz minimum bandwidth)
- BNC coaxial cable to connect probe to oscilloscope
Procedure:
- Set oscilloscope to 20 MHz bandwidth limit initially
- Set timebase to 1 us/div
- Set trigger to normal mode with threshold above noise floor
- Hold the H-probe (magnetic) near suspect noise sources:
- VFD output terminals
- Contactor coils
- Relay coils
- Switch-mode power supplies
- POWERLINK/Ethernet cables
- X2X Link cables
- Move the probe slowly along cable runs to locate the highest emission points
- Note the frequency and amplitude of the strongest emissions
- Repeat with the E-probe (electric field)
Typical noise signatures:
| Noise Source | Frequency Range | Character |
|---|---|---|
| VFD PWM switching | 1-100 kHz (fundamental), up to 20 MHz (edges) | Bursty, correlated with motor operation |
| Contactor coil release | 1-100 MHz | Single burst at contact opening |
| Switch-mode power supply | 50-500 kHz (fundamental), up to 30 MHz (harmonics) | Continuous |
| POWERLINK traffic | 10-100 MHz | Periodic packets |
| X2X Link traffic | DC-10 MHz | Continuous during operation |
6.6 Step 6: Common-Mode Voltage Measurements on I/O
Equipment: Oscilloscope with differential probe or isolated measurement capability.
WARNING: Do NOT connect an oscilloscope ground clip to any point in a live cabinet that is not at true earth potential. This can create a ground loop through the oscilloscope and damage equipment. Use a differential probe or battery-powered oscilloscope.
Measurement procedure:
- Connect differential probe across the analog input terminals (e.g., AI+ and AI-)
- Set probe to 1X or 10X as appropriate for the signal range
- Observe the signal waveform and noise superimposed on it
- Switch the probe to measure between AI- and cabinet ground (common-mode voltage)
- If common-mode voltage exceeds 1V peak, the signal quality is compromised
Acceptable levels:
| Signal Type | Max Common-Mode Voltage (peak) |
|---|---|
| Analog 4-20 mA | < 1 V |
| Analog 0-10 V | < 0.5 V |
| Digital 24 V input | < 5 V |
| RS485 | < 3 V (check module spec for exact common-mode range) |
| CAN bus | < -2V to +7V per CAN standard |
6.7 Step 7: Ground Loop Detection
Method 1: Voltage measurement between grounds
-
Power ON the system
-
Using a multimeter set to AC millivolts range, measure the voltage between:
- Cabinet ground bus and a known earth reference (building ground bar)
- DIN rail and cabinet ground bus
- The shield of any POWERLINK/Ethernet cable and the local cabinet ground
- The GND terminal of a remote field device and the cabinet ground
-
If AC voltage is detected (> 100 mV), a ground loop or ground potential difference exists
Method 2: Current measurement on ground conductors
-
Power ON the system
-
Using a clamp-on current probe (AC mA range), measure current flowing in:
- The PE conductor between cabinets
- The shield of POWERLINK cables
- The cable between cabinet ground and building ground
-
Any AC current > 10 mA on a shield or PE conductor indicates a ground loop or improper bonding
Method 3: Visual verification of ground topology
- Trace all PE connections from the cabinet ground bus
- Verify there is exactly one path from any equipment to the building ground (star topology)
- Identify any connections that create loops (e.g., two separate PE paths between two cabinets)
6.8 Step 8: Document Findings and Create Remediation Plan
Create a structured report with:
- Machine identification (location, OEM if known, B&R CPU model, Automation Studio project version)
- Photos of cabinet layout and cable routing
- All measurement results with equipment used, date, and ambient conditions
- Findings categorized by severity:
- Critical: Safety hazard or system-stopping fault
- High: Degrading performance or intermittent errors
- Medium: Non-optimal but functional
- Low: Cosmetic or best-practice improvement
- Prioritized remediation plan with estimated effort and materials
- Before/after measurements after remediation
7. Remediation Techniques
7.1 Adding Proper Ground Connections
Star-point grounding topology:
Building Ground Bar
|
| 16 mm² Cu
|
[Cabinet Ground Bus]
/ | | \
/ | | \
[Cabinet 1] | | [Cabinet 3]
| | | |
6 mm² Cu | | 6 mm² Cu
| | | |
[DIN rail 1] | | [DIN rail 3]
| | | |
[Modules] | | [Modules]
|
[Cabinet 2]
|
6 mm² Cu
|
[DIN rail 2]
|
[Modules]
Key principle: Each cabinet has exactly one path to the building ground bar. No loops. No daisy-chains of PE connections between cabinets.
Procedure for adding a ground connection:
- Identify the nearest point on the cabinet ground bus
- Determine the required wire gauge based on fault current capacity and distance
- Use a ring tongue terminal crimped to the wire
- Bond the wire to the ground bus with a washer, lock washer, and nut
- Torque to specification (typically 2-3 Nm for M6 hardware)
- Verify impedance after installation (< 0.1 ohm to building ground)
7.2 DIN Rail Grounding Upgrade
- Remove all modules from the affected rail section
- Clean the rail surface with isopropyl alcohol and a non-abrasive pad
- Install a PE bonding clip (Phoenix Contact FT-DIN or equivalent) at each end of the rail
- Run a 6 mm² yellow-green wire from the PE clip to the cabinet ground bus
- For rails longer than 1 m, add additional PE clips at 1 m intervals
- Reinstall modules and verify seating
- Measure rail-to-cabinet ground impedance: target < 0.1 ohm
7.3 Isolation Transformers for Noisy Power Feeds
When the 24V power supply receives noise from the mains or from other loads on the same circuit:
Application points:
- Between the mains supply and the 24V power supply input
- Between the mains supply and VFD input (VFDs usually have their own built-in DC bus isolation)
Specifications for industrial isolation transformer:
- Turns ratio: 1:1
- Power rating: Match or exceed the total load (e.g., 500 VA for a 10A 24V supply)
- Electrostatic shield (Faraday shield between primary and secondary): Recommended for EMC applications
- Voltage regulation: < 3%
- Insulation class: F or H
- K-factor rated if supplying nonlinear loads (switch-mode power supplies)
7.4 Ferrite Chokes on Cables
Installation procedure:
- Select ferrite core of appropriate material and size for the cable
- Pass the cable through the ferrite core
- For best high-frequency suppression, pass the cable through the core as many times as possible (each pass doubles the effective impedance)
- For common-mode suppression: pass both signal and return conductors through the core together
- For differential-mode suppression (rare): pass only one conductor through the core
- Position the ferrite as close to the susceptible device (usually the B&R module) as practical
- Secure the ferrite with cable ties or heat-shrink tubing
When ferrite is not enough:
- If noise is below 1 MHz, ferrite may not be effective
- Consider active filtering or cable re-routing instead
- For very strong noise sources, shielded enclosures may be necessary
7.5 Shielded Cable Replacement Procedure
- Identify the cable to be replaced (trace from module to field device)
- Determine the required cable type and length
- Remove the old cable:
- Disconnect at both ends
- Pull the cable from the cable tray/conduit
- Note the routing path
- Install the new cable:
- Pull the new cable through the same path (or a better path if re-routing)
- Leave 30-40 mm of jacket stripped back at each termination point for shield clamping
- Do not untwist or comb out the shield braid
- Install EMC cable clamps at both ends:
- Clamp the shield braid with a 360-degree EMC clamp
- Bond the clamp to the local ground bus
- Terminate the individual conductors at the module terminal block
- Test shield continuity before energizing
- Energize and verify correct operation
7.6 EMC Filter Installation on VFD Power Feeds
Types of EMC filters for VFDs:
| Filter Type | Location | Purpose |
|---|---|---|
| Mains EMC filter | Between mains and VFD input | Suppress conducted emissions from VFD back to mains |
| dv/dt filter | At VFD output | Reduce voltage rise time to protect motor insulation |
| Sine-wave filter | At VFD output | Convert PWM to near-sine wave, reduce EMI significantly |
| Common-mode choke | At VFD output | Reduce common-mode currents on motor cable |
Installation notes:
- Follow the VFD manufacturer’s EMC installation guide
- B&R ACOPOS drives have specific EMC installation requirements documented in their manual
- EMC filter must be installed as close to the VFD as possible
- Filter enclosure must be bonded to the cabinet ground
- Input and output cables must be kept separated (never route VFD output cable through the EMC filter area)
See acopos-drives.md for B&R ACOPOS-specific EMC requirements.
7.7 Surge Protection for B&R I/O Modules
Field cables entering the cabinet can carry surge energy from:
- Lightning strikes (direct or indirect)
- Switching of inductive loads
- Electrostatic discharge
Surge protection placement:
| Cable Type | Protection Device | Placement |
|---|---|---|
| Analog input (4-20 mA) | Surge protector for analog signals | In the field cabinet or at the B&R terminal block |
| Digital input (24 V) | Varistor or TVS diode array | At the terminal block or in a surge protection module |
| POWERLINK | Ethernet surge protector (RJ45) | At the cabinet cable entry point |
| CAN bus | CAN bus surge protector | At each cabinet entry point |
| RS485 | RS485 surge protector | At the field end and the B&R end |
Installation:
- Surge protectors must be bonded to the cabinet ground bus
- The ground connection of the surge protector is critical – use short, direct wiring to ground
- Replace surge protectors after a known surge event (most have indicator LEDs showing protection status)
7.8 Cable Relocation
Priority order for cable relocation (based on impact):
- Critical: Relocate X2X Link cables away from VFD output cables
- Critical: Relocate analog input cables out of power cable trays
- High: Separate CAN bus cables from motor power cables
- Medium: Increase separation between POWERLINK cables and 24V distribution
- Low: Reorganize cable ties and bundles for neatness
Relocation procedure:
- Verify the machine is in a safe state (stop all motion, lock out)
- Disconnect cables at both ends
- Re-route through appropriate cable tray/duct
- Re-terminate at both ends
- Test shield continuity
- Re-energize and verify operation
7.9 Adding EMC Cable Clamps to Existing Installations
- Identify cables that are missing shield termination
- At the cable entry point, strip back 30-40 mm of jacket to expose the shield braid
- Install an EMC clamp (X20AC0SG1 for DIN rail mounting, or generic clamp for cable tray mounting)
- Route a short ground wire from the clamp to the nearest ground reference
- Do NOT cut the shield braid or create a pigtail – the clamp must grip the full circumference
8. Measurement Equipment
8.1 Recommended Equipment Table
| Equipment | Recommended Model | Price Range (USD) | Use Case |
|---|---|---|---|
| Digital multimeter | Fluke 87V | $200-400 | General voltage, continuity, low-ohm measurements |
| Ground impedance tester | Fluke 1654B or Megger MIT430 | $500-2000 | 4-wire ground impedance, PE/N continuity |
| Bench oscilloscope | Rigol DS1054Z (4ch, 100 MHz) | $400-800 | Waveform analysis, noise measurement, common-mode voltage |
| Handheld oscilloscope | Fluke 120B Series | $1500-2500 | Field measurements, live cabinet probing |
| Differential probe | Rigol RP1020D (100X) or Micsig DP10013 | $50-200 | Safe measurement in live cabinets without ground reference |
| Near-field probe set | DIY (ferrite toroid + coax) or Beehive Electronics 100A/B | $50-200 | Noise source identification |
| Current probe | Clamp-on AC/DC (Fluke i400s or Uni-T UT210E) | $50-500 | Ground current measurement for ground loop detection |
| CAN bus analyzer | PCAN-USB or Kvaser Leaf | $200-500 | CAN bus traffic monitoring and error analysis |
| POWERLINK analyzer | B&R Automation Studio Ethernet capture + Wireshark | $0 (software) | POWERLINK frame analysis |
| Insulation resistance tester | Fluke 1587FC or similar | $400-800 | Cable insulation integrity testing |
8.2 DIY Near-Field Probe Construction
For budget-constrained situations, an H-field (magnetic) near-field probe can be constructed:
Coaxial cable (RG-58 or RG-316)
|
| Strip outer jacket
| Expose braid 10-15 mm
| Form braid into small loop (10-15 mm diameter)
| Solder braid to itself to form closed loop
| Center conductor is not connected
| BNC connector at other end
This probe detects magnetic fields. Sweep it along cables and modules while watching the oscilloscope to locate noise sources. Sensitivity is lower than commercial probes but sufficient for identifying major problems.
9. Quick Diagnostic Flowchart
Symptom EMC Cause First Test Remediation
-----------------------------------------------------------------------------------------------
Intermittent sensor Common-mode noise Scope on analog input Fix shield termination
readings jumping terminals Re-route cable
Add ferrite core
-----------------------------------------------------------------------------------------------
POWERLINK node Ground loop on cable Measure AC voltage Verify equipotential
dropping out shield between cable shield bonding between cabinets
Shield not bonded and cabinet ground Replace with shielded cable
at both ends Add RC filter to jack shield
-----------------------------------------------------------------------------------------------
X2X stations DIN rail ground Scope on DIN rail Clean DIN rail contacts
disappearing impedance too high (rail to cabinet GND) Improve PE clip bonding
VFD noise on DIN rail Check during VFD start Separate X2X from VFD cables
-----------------------------------------------------------------------------------------------
Analog input Ground loop or Short AI terminals Check sensor grounding
noise/jitter poor shielding and observe noise Add/relocate shield
Reference ground Use isolated AI module
unstable
-----------------------------------------------------------------------------------------------
CAN bus error Missing termination Measure 60 ohm across Enable termination at both
frames, bus-off or shield CAN_H/CAN_L ends (X20IF2772 switch)
Cable damage with bus powered down Replace damaged cable
Bond shield to ground
-----------------------------------------------------------------------------------------------
Phantom digital Floating input Wire input to 0V Wire all unused inputs
input state changes EMI on unshielded and observe Use shielded cable
cable Increase filter time
-----------------------------------------------------------------------------------------------
Watchdog fault / Bus retries from Check cycle time Fix underlying EMC issue
cycle time exceeded EMI adding latency in logbook Increase watchdog timeout
Reduce bus loading
-----------------------------------------------------------------------------------------------
Ethernet link Cable/cable shield Try known-good cable Replace POWERLINK cable
dropout problem Check RJ45 seating Add ferrite core
Verify shield continuity
-----------------------------------------------------------------------------------------------
Motor cable Unshielded VFD Near-field probe at VFD Install shielded motor cable
radiating EMI output cable output Bond shield at both ends
Install dv/dt or sine filter
10. Cross-References
| Topic | File | Relevance |
|---|---|---|
| Analog signal noise and calibration | analog-calibration.md | ADC noise floor, analog input filtering, calibration procedures |
| Physical wire-level signal analysis | physical-layer-sniffing.md | Capturing and analyzing POWERLINK, X2X, and CAN physical signals |
| IO module signal conditioning | io-card-hardware.md | Digital and analog input filter circuits, threshold behavior |
| Encoder signal quality | encoder-diagnostics.md | Encoder cable shielding, differential signal integrity |
| POWERLINK communication diagnostics | powerlink-internals.md | POWERLINK frame structure, error detection, CRC analysis |
| X2X bus diagnostics | x2x-protocol.md | X2X packet structure, error handling, bus fault recovery |
| CAN bus error handling | if2772-canopen.md | X20IF2772 configuration, CAN error counters, termination |
| RS485 noise issues | serial-diagnostics.md | RS485/RS232 signal quality, noise diagnosis |
| Drive EMC considerations | acopos-drives.md | ACOPOS drive EMC installation, motor cable shielding |
11. Key Findings
-
DIN rail ground integrity is the single most important grounding point in an X20 system. The X2X Link uses the rail as its ground return. Poor rail contact causes X2X communication failures that mimic hardware faults.
-
POWERLINK cable shields must be bonded at both ends. Ethernet/POWERLINK standards and B&R guidelines require both-end shield bonding. The RC circuits in shielded RJ45 jacks prevent low-frequency ground loops while maintaining high-frequency EMC protection.
-
Analog input noise is almost always a grounding problem, not a calibration problem. Before recalibrating any analog input, verify shield termination and check for common-mode voltage between the sensor ground and the module ground.
-
90% of EMC problems in undocumented legacy machines trace to three root causes: missing shield termination, power/signal cable proximity violations, and DIN rail-to-cabinet ground impedance above 0.1 ohm.
-
The X20IF2772 has integrated termination resistors controlled by physical switches. Check that TERM CAN 1/2 LEDs are active at both ends of the CAN bus. Missing termination is the most common CAN bus fault.
-
Never leave digital inputs floating. A floating digital input acts as an antenna for EMI, causing phantom state changes. Wire all unused inputs to 0V.
-
Ground loop detection is a voltage measurement, not a continuity measurement. Measure AC voltage between suspected ground points with the system powered ON. Any reading above 100 mV AC indicates a ground potential difference that will cause EMC problems.
-
VFD output cables are the strongest EMI source in most industrial installations. Always use shielded motor cables with 360-degree shield bonding at both the VFD and the motor. Install EMC filters on VFD inputs.
-
The X20CP1584 provides galvanic isolation between Ethernet, POWERLINK, and X2X interfaces. This isolation prevents ground loops from propagating between bus systems through the CPU, but does not eliminate the need for proper shield bonding at each interface.
-
Document everything you find during an EMC audit. Undocumented machines will be serviced by the next person who has even less context than you. Photograph the cabinet layout, record all measurements, and note what you changed.
-
Use the 4-wire (Kelvin) method for ground impedance measurements below 1 ohm. Standard 2-wire multimeter measurements include test lead resistance and are unreliable for verifying the low impedances required by B&R grounding specifications.
-
Cable crossing angle matters. When signal and power cables must cross, crossing at 90 degrees reduces capacitive and inductive coupling by orders of magnitude compared to parallel routing. Even a few centimeters of parallel run can inject measurable noise.
12. Sources
Key Findings
-
Most intermittent B&R problems are grounding-related. Phantom sensor errors, random IO dropouts, and watchdog faults that look like software bugs are frequently caused by poor grounding, improper shield termination, or cable routing violations.
-
The X2X Link uses the DIN rail as a data path. X2X communicates at up to 10 Mbit/s through the DIN rail’s metal structure. Ground integrity of the rail directly affects IO module reliability — a loose rail clamp can cause X2X communication errors.
-
Shield termination at both ends (360-degree) is mandatory for POWERLINK and CAN. Pigtail shield connections are inadequate for high-speed fieldbus. Use B&R shield grounding clamps (X20AC0SG1) for proper 360-degree termination.
-
Cable segregation prevents crosstalk. POWERLINK, CAN, analog signals, and power cables must be routed in separate conduits or with adequate separation. Parallel routing of power and signal cables is the most common EMC installation error.
-
Systematic measurement beats guessing. Use a multimeter to verify ground continuity between all panels and the main ground bar before anything else. Then use an oscilloscope to check for high-frequency noise on signal shields. These two measurements catch 80% of EMC problems.
-
Star grounding is preferred over daisy-chain. Each panel and device should have its own ground conductor back to the main ground bar. Daisy-chained grounds create ground loops and unequal potentials.
B&R Documentation
- B&R Automation, X20 System User’s Manual, document MAX20. Sections: “Shielding and earthing”, “Mechanical and electrical configuration”, “Shield connection”. Available from br-automation.com downloads.
- B&R Automation, Installation / EMC Guide, document MAEMV. Comprehensive EMC installation guidelines for B&R industrial PCs, panels, and control systems. Available from br-automation.com downloads.
- B&R Automation, X20(c)CP158x and X20(c)CP358x Data Sheet, V1.56. Technical specifications for X20CP1584 CPU including power supply, interfaces, and grounding requirements. Available from br-automation.com.
- B&R Automation, X20IF2772 Interface Module Data Sheet, V2.23. CAN bus interface specifications, pinout, termination resistor details.
- B&R Automation, X20CA0E61 POWERLINK/Ethernet Cable product page. Cable specifications and ordering information.
- B&R Automation, X20AC0SG1 Cable Shield Grounding Clamp product page. Shield clamp specifications and installation.
EMC Standards
- IEC 61000-5-2: Electromagnetic compatibility (EMC) - Installation and mitigation guidelines - Part 5-2: Earthing and cabling.
- IEC 61131-2: Programmable controllers - Equipment requirements and tests.
- IEC 60364-4-41: Low-voltage electrical installations - Protection for safety - Protection against electric shock.
- IEC 60445: Basic and safety principles for man-machine interface, marking and identification - Identification of equipment terminals, conductor terminations and conductors.
- CiA DR-602: CAN in Automation - CAN bus cable recommendation.
- IEEE 802.3: Standard for Ethernet. Physical layer and shield termination requirements for 100BASE-TX.
- IEC 61800-5-1: Adjustable speed electrical power drive systems - Safety requirements - Electrical, thermal and energy.
Industry References
- Siemens, EMC - Technical Overview, document 103704610. General EMC installation guidelines applicable to all industrial control systems.
- ABB, Technical Guide No. 3: EMC-compliant installation and wiring for drives. VFD cable shielding and grounding best practices.
- SEW-Eurodrive, Notes on cable routing and shielding. Cable segregation and shield termination guidelines.
- InCompliance Magazine, “Where to Ground Cable Shields” article. Analysis of shield grounding methods for different cable types and signal frequencies.
Community Resources
- B&R Community Forum (community.br-automation.com): Practical discussions on POWERLINK, X2X, and CAN troubleshooting.
- B&R Automation Help (built into Automation Studio): Reference for X20 system configuration, error codes, and diagnostic procedures.
Time Synchronization and Timestamp Analysis for B&R Diagnostics
Time synchronization is the single most critical prerequisite for meaningful diagnostics on any PLC system. On a B&R X20CP1584 system, every alarm, every log entry, every I/O error, and every drive fault carries a timestamp. If those timestamps are not trustworthy, the entire diagnostic chain collapses. This document covers NTP/SNTP configuration on B&R, ensuring accurate timestamps across PLC, IO cards, drives, and HMIs, how to correlate events across multiple devices using timestamps, and how to use time-based analysis to find the root cause of intermittent faults. Cross-references: alarm-logging.md for alarm timestamp formats, system-variables.md for time-related system variables, and network-architecture.md for network timing implications.
1. Overview
Why Time Sync Matters for Diagnostics
- Event correlation: When a drive faults, the PLC logs a power bus warning, and the HMI shows a communication timeout, you need to know whether these events happened within milliseconds of each other (same root cause) or minutes apart (coincidence).
- Root cause analysis: Intermittent faults often leave breadcrumbs across multiple subsystems. Without synchronized clocks, those breadcrumbs cannot be ordered into a causal chain.
- Log integrity: Regulatory and quality systems require auditable timestamps. An unsynchronized PLC clock undermines all log credibility.
- Scheduled events: Recipe changes, shift handovers, and maintenance windows all reference wall-clock time. A drifting PLC clock can trigger actions at the wrong time.
The Undocumented Machine Challenge
When you inherit a B&R system from a defunct OEM, there is no documentation describing which devices use NTP, which rely on manual time setting, and whether any time synchronization exists at all. You must assume clocks are wrong until proven otherwise. The diagnostic workflow on such a system always starts with verifying time synchronization across all devices before attempting any event analysis.
Timestamp Scope on B&R Systems
| Device | Timestamp Source | Typical Drift Without Sync |
|---|---|---|
| X20CP1584 PLC | Internal RTC | 5-30 seconds/day |
| X20 I/O modules | No RTC; use PLC time | N/A |
| ACOPOS drives | Internal clock | 10-60 seconds/day |
| Power Panel HMI | Internal RTC | 5-20 seconds/day |
| Third-party devices | Varies | Unknown |
Internal real-time clocks (RTC) are battery-backed but drift significantly. A 30-second-per-day drift means a PLC can be 15 minutes off within a month if NTP fails silently.
2. B&R NTP Client Configuration
2.1 Configuration Location
In Automation Studio:
- Double-click the CPU object in the Physical view (or the logical CPU in the Configuration view).
- Navigate to CPU Properties > Time Synchronization.
- Enable the NTP client checkbox.
- Enter the NTP server address (hostname or IP).
Configuration path:
Physical View
└── X20CP1584 (CPU)
└── Properties
└── Time Synchronization
├── ☑ Use NTP client
├── NTP server: pool.ntp.org
├── Time zone: UTC+01:00 (or local)
└── Poll interval: [default]
2.2 Required Prerequisites
NTP on B&R will fail silently if prerequisites are not met. Three conditions must all be true:
| Prerequisite | Where to Configure | Failure Symptom |
|---|---|---|
| DNS service enabled | CPU Properties > DNS | NTP hostname resolution fails, no error shown |
| DNS server address set | CPU Properties > DNS (manual) or DHCP | Same as above |
| Default gateway configured | CPU Properties > Ethernet > Gateway | PLC cannot route to external NTP server |
2.3 DNS Configuration
DNS is required because NTP server addresses like pool.ntp.org are domain names, not IP addresses. The PLC must resolve these names.
With DHCP:
- CPU Properties > Ethernet > IP Configuration: DHCP
- CPU Properties > DNS > “Get DNS from DHCP server”: ON
With Static IP:
- CPU Properties > Ethernet > IP Configuration: Static
- Set IP address, subnet mask, and default gateway
- CPU Properties > DNS > DNS server: manual entry (e.g.,
8.8.8.8or your plant DNS server) - CPU Properties > DNS > “Get DNS from DHCP server”: OFF
Static IP configuration example:
IP address: 192.168.100.10
Subnet mask: 255.255.255.0
Default gateway: 192.168.100.1
DNS server: 192.168.100.1 (plant DNS)
DNS server 2: 8.8.8.8 (Google public, fallback)
2.4 NTP Server Selection
| NTP Server | Suitability | Notes |
|---|---|---|
pool.ntp.org | Good for general use | Round-robin DNS, geographically distributed |
time.windows.com | Common on Windows-centric plants | Single source of truth if Windows servers present |
10.x.x.x or 192.168.x.x | Best for air-gapped plants | Internal NTP server, no external dependency |
| Local server IP | Best reliability | On-site NTP appliance or Linux server with chrony/ntpd |
For industrial environments, an internal NTP server is strongly preferred. It eliminates dependency on external internet connectivity and provides deterministic latency. Configure a Linux server or dedicated NTP appliance on the same VLAN as the PLCs, then point all PLCs to that server.
2.5 Time Zone Configuration
In CPU Properties > Time Synchronization:
- Set the time zone offset (e.g., UTC+01:00 for CET).
- Enable daylight saving time if applicable, with the correct transition rules.
- The PLC stores time internally as UTC and applies the offset for display and logging.
Time zone configuration:
UTC offset: +01:00:00
Daylight saving: Enabled
DST start: Last Sunday in March, 02:00
DST end: Last Sunday in October, 03:00
DST offset: +01:00:00
2.6 Verifying NTP Operation
In Automation Studio with an active online connection:
- Select the CPU in the Physical view.
- Go to Online > Info > Time.
- The dialog shows:
- Current PLC time
- NTP server address
- Time difference (offset between PLC and NTP server)
- NTP status (syncing, synchronized, error)
Expected Online > Info > Time display:
PLC time: 2026-07-10 14:32:15.234
NTP server: pool.ntp.org
Time difference: 0.002s
Status: Synchronized
A time difference under 100ms indicates good synchronization. Differences over 1 second suggest NTP is failing or the polling interval is too long. Differences measured in minutes indicate a configuration error (see Section 3.6).
2.7 NTP Polling Interval and Accuracy
B&R default NTP polling behavior follows the NTP specification:
| Parameter | Default | Typical Range | Notes |
|---|---|---|---|
| Poll interval (minimum) | 64 seconds | 16-1024 seconds | NTP protocol minpoll |
| Poll interval (maximum) | 1024 seconds | 128-36 hours | NTP protocol maxpoll |
| Expected accuracy | ±5-50ms | Depends on network | On local LAN, expect ±5ms |
| Startup sync time | 30-120 seconds | First successful poll | PLC may use RTC until first sync |
On a stable LAN with a local NTP server, expect synchronization within 30 seconds of boot. The PLC will then maintain accuracy within ±10ms indefinitely as long as NTP polls succeed.
3. NTP Troubleshooting on X20CP1584
3.1 The Silent Failure Problem
The most dangerous aspect of B&R NTP is that failures are often silent. Automation Studio may show no errors at all while the PLC clock drifts. This means you cannot rely on AS error indicators alone to detect NTP problems.
Always verify NTP status proactively using Online > Info > Time on every maintenance visit.
3.2 DNS Not Configured (Most Common Failure)
Symptoms:
- NTP server field is populated in CPU properties
- No errors visible in Automation Studio
- PLC time drifts continuously
- AR logger contains no NTP-related entries (PLC never attempted NTP because DNS resolution failed)
Diagnosis:
Step 1: Verify DNS is enabled in CPU Properties > DNS
Step 2: Verify a DNS server address is configured (not blank)
Step 3: If using DHCP, verify "Get DNS from DHCP" is ON
Step 4: If using static IP, verify DNS server is manually set
Step 5: Test from PLC: can it resolve the NTP server hostname?
Fix: Configure DNS server address. If the plant has no DNS server, use a public DNS server (8.8.8.8, 1.1.1.1) or replace the NTP hostname with a direct IP address of the NTP server.
3.3 No Default Gateway
Symptoms:
- PLC can communicate with devices on the same subnet
- NTP server is on a different subnet or the internet
- NTP polls never reach the server
- No error in AS
Diagnosis:
Step 1: Verify default gateway in CPU Properties > Ethernet
Step 2: Ping the gateway from PLC (if possible via PVI or network tools)
Step 3: If NTP server is on the same subnet, gateway may not be needed
Fix: Set the default gateway to the router address that provides access to the NTP server’s network.
3.4 Firewall Blocking NTP (UDP Port 123)
Symptoms:
- NTP configured correctly, DNS working, gateway correct
- PLC cannot sync time
- AR logger may show timeout warnings
Diagnosis:
Step 1: Verify UDP port 123 is open from PLC to NTP server
Step 2: Check plant firewall rules between PLC VLAN and NTP server
Step 3: Check Windows Firewall on the NTP server (if it's a PC)
Step 4: Use network diagnostic tools:
nmap -sU -p 123 <ntp_server_ip>
tcpdump -i eth0 udp port 123
Fix: Open UDP port 123 in all firewalls between the PLC and the NTP server. Many industrial firewalls default to blocking all unsolicited inbound traffic; NTP responses may be blocked.
3.5 NTP Server Unreachable
Symptoms:
- All configuration correct
- NTP server does not respond
- Time difference in AS shows increasing divergence
Diagnosis:
Step 1: Ping the NTP server IP from the PLC's subnet
Step 2: nslookup <ntp_server_hostname> from a PC on the same subnet
Step 3: Check if the NTP server service is running (if it's a local server)
Step 4: Check for NTP server rate limiting (pool.ntp.org limits queries)
Fix: Verify NTP server connectivity. If using pool.ntp.org and the PLC is behind a NAT with many devices, you may be rate-limited. Switch to a dedicated internal NTP server.
3.6 The 24-Minute Offset Issue
A known B&R issue where the NTP client configuration results in a time offset of exactly 24 minutes (1440 seconds). This is caused by a mismatch between the configured time zone offset and the NTP server’s interpretation of the timezone.
Root cause: The NTP protocol transmits time in UTC. The PLC applies its local timezone offset. If the timezone configuration in CPU properties is incorrect (e.g., offset is set to UTC+00:00 when it should be UTC+01:00), the displayed time will be wrong by exactly the timezone difference. A 24-minute offset specifically suggests a configuration error where seconds were interpreted differently or a legacy timezone database entry.
Diagnosis:
Step 1: Check CPU Properties > Time Synchronization > Time zone
Step 2: Compare PLC displayed time with a known reference (phone NTP-synced clock)
Step 3: Calculate the offset: is it exactly 24 minutes? Or exactly 1 hour?
Step 4: An exact-hour offset = timezone configuration error
Step 5: An exact-24-minute offset = NTP client configuration error (possibly related to
the NTP server's timezone handling or the PLC's NTP client firmware version)
Fix:
- Correct the timezone configuration in CPU Properties.
- If the issue persists, update the PLC firmware to the latest version.
- If using a custom NTP server, verify the server’s timezone configuration.
- As a workaround, use the PLC’s manual time setting to correct the offset after NTP sync.
3.7 Checking AR Logger for NTP Warnings
The AR (Automation Runtime) logger may contain NTP-related entries even when AS shows no errors. Access the AR logger:
- In Automation Studio: Online > AR Logbook (or via System > Diagnostics > AR Logbook)
- Filter for NTP-related entries
Search for these message patterns:
AR Logger NTP-related messages:
"NTP client: no response from server"
"NTP client: DNS resolution failed"
"NTP client: server not reachable"
"Time sync: offset too large, stepping clock"
"Time sync: offset correction applied"
"NTP client: authentication failed"
If no NTP entries exist in the AR logger, the NTP client may not be enabled or DNS resolution failed before the NTP client could even attempt a poll.
3.8 Network Diagnostic Steps
When NTP fails, follow this diagnostic sequence from a PC on the same subnet as the PLC:
Step 1: Verify basic connectivity
ping <PLC_IP>
ping <DNS_SERVER_IP>
ping <DEFAULT_GATEWAY_IP>
Step 2: Verify DNS resolution
nslookup pool.ntp.org <DNS_SERVER_IP>
nslookup time.windows.com <DNS_SERVER_IP>
Step 3: Verify NTP server reachability
ping <NTP_SERVER_IP>
nmap -sU -p 123 <NTP_SERVER_IP>
Step 4: Verify NTP server functionality
From a Linux PC: ntpdate -q <NTP_SERVER_IP>
From a Linux PC: chronyc tracking (if chrony is used)
Output should show server stratum, offset, and sync status
Step 5: Capture traffic from PLC perspective
tcpdump -i <interface> host <PLC_IP> and udp port 123 -nn
Look for NTP request packets from the PLC and responses from the server
Step 6: Verify PLC configuration
Connect with AS, go Online > Info > Time
Record: PLC time, NTP server, time difference, status
4. Configuring Time Sync Without Automation Studio
When you have no access to Automation Studio (no license, no project file), time synchronization must be configured through alternative interfaces.
4.1 Via PVI (Process Visualization Interface)
PVI allows programmatic access to PLC runtime variables. Using B&R’s PVI API via the pvipy Python library (install: pip install pvipy, requires Windows + PVI Development Setup):
from pvi import *
pviConnection = Connection()
line = Line(pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=192.168.100.10')
cpu.errorChanged = lambda error: print(f"Connected, error={error}")
pviConnection.start()
Important limitation: NTP configuration parameters (server address, timezone, poll interval) are project configuration parameters, not runtime variables. PVI provides access to the PLC’s variable namespace, not to its configuration metadata. Changing NTP settings requires either:
- Automation Studio with the project loaded (preferred)
- Editing configuration files on the CF card (see Section 4.3)
- brsnmp for some network-related parameters (IP, gateway, DNS — see Section 4.2)
PVI CAN read/write runtime variables (process data, setpoints, flags) but CANNOT change CPU configuration properties like NTP server or timezone settings. See pvi-api.md for full PVI capabilities.
Note: The pylogix library is for Allen-Bradley ControlLogix/CompactLogix PLCs and is NOT compatible with B&R systems. For B&R, use pvipy (Python wrapper for PVI) or the OPC-UA path via asyncua.
4.2 Via SNMP (brsnmp Tool)
B&R provides an SNMP agent (brsnmp) that can be loaded as a runtime component. Once loaded:
SNMP configuration for time sync:
1. Load brsnmp component in the PLC configuration
2. Configure SNMP community string
3. Query or set time-related OIDs
B&R SNMP OID for system time (example):
.1.3.6.1.2.1.25.1.2.0 hrSystemDate.0 (system date and time)
SNMP set example (using snmpset from net-snmp tools):
snmpset -v2c -c private <PLC_IP> \
.1.3.6.1.2.1.25.1.2.0 s "$(date +%Y%m%d)$(date +%H%M%S).00"
4.3 Via CF Card Configuration Files
B&R PLCs can load configuration from files on the CompactFlash/SD card:
CF card file structure for time configuration:
/CF/System/
├── config.ini (main configuration file)
├── dns.cfg (DNS server configuration)
├── ntp.cfg (NTP client configuration)
└── timezone.cfg (timezone and DST settings)
Example ntp.cfg:
[ntp]
Enabled=1
Server=pool.ntp.org
Server2=time.windows.com
PollInterval=64
MaxPollInterval=1024
Example dns.cfg:
[dns]
Enabled=1
Server1=8.8.8.8
Server2=8.8.4.4
SearchDomain=local
FromDHCP=0
To deploy: copy files to the CF card, insert into PLC, reboot. The PLC loads configuration files during startup.
4.4 Via OPC-UA
If the OPC-UA server is running on the PLC and time-related variables are exposed:
import asyncio
from asyncua import Client
async def configure_ntp():
url = "opc.tcp://192.168.100.10:4840"
async with Client(url=url) as client:
ns = await client.get_namespace_index("B&R Automation")
ntp_enabled = client.get_node(f"ns={ns};s=NTP.Enabled")
await ntp_enabled.write_value(True)
ntp_server = client.get_node(f"ns={ns};s=NTP.Server")
await ntp_server.write_value("10.0.0.50")
timezone = client.get_node(f"ns={ns};s=System.TimeZone")
await timezone.write_value(3600)
asyncio.run(configure_ntp())
Note: OPC-UA exposure of NTP configuration variables is not default. They must be explicitly mapped in the OPC-UA configuration of the B&R project.
4.5 Via FTP
B&R PLCs expose an FTP server (default port 21) that provides access to the file system:
FTP access to PLC configuration:
ftp 192.168.100.10
Username: admin (default)
Password: <configured password>
Remote directories:
/CF/ - CompactFlash card contents
/System/ - System configuration files
/User/ - User files and logs
/Log/ - AR logbook files
To modify time configuration:
1. Download current configuration files
2. Edit locally (dns.cfg, ntp.cfg, etc.)
3. Upload modified files back
4. Reboot PLC for changes to take effect
Warning: FTP access may be disabled on security-hardened PLCs. Check if FTP service is running by attempting connection. Modifying configuration files via FTP and rebooting is an unsupported method; use it only when no other option is available.
5. B&R as NTP Server
5.1 Configuration
The X20CP1584 can act as an NTP server, providing time to other devices on the network. This is useful when you have no external NTP server and need to synchronize HMIs, drives, secondary PLCs, or data loggers.
Configuration in Automation Studio:
- CPU Properties > Time Synchronization
- Enable “NTP server” checkbox
- Configure the PLC’s own time source (NTP client pointing to an external server, or manual time)
- Optionally restrict which subnets can query the NTP server
CPU as NTP server configuration:
Time Synchronization:
☑ Use NTP client
NTP server: 10.0.0.1 (corporate NTP server)
☑ Act as NTP server
Allowed clients: 192.168.100.0/24
5.2 Use Cases
| Use Case | Devices Synced | Configuration |
|---|---|---|
| HMI time sync | Power Panel, other HMIs | Point HMI NTP client to PLC IP |
| Secondary PLC sync | Other X20 CPUs | Point secondary PLC NTP client to primary PLC IP |
| Drive time sync | ACOPOS drives | Configure drive NTP client to PLC IP |
| Data logger sync | PC-based loggers, SCADA | Point logger NTP client to PLC IP |
| Multi-VLAN time distribution | Devices on different subnets | Router must forward UDP 123 to PLC |
5.3 Verification
To verify the PLC NTP server is functioning:
From a Linux PC on the same network:
ntpdate -q <PLC_IP>
Expected output:
server 192.168.100.10, stratum 3, offset 0.003123, delay 0.02567
10 Jul 14:32:15 ntpdate[1234]: adjust time server 192.168.100.10
offset 0.003123 sec
If the query fails:
ntpdate: no server suitable for synchronization found
-> Check UDP 123 is not blocked
-> Verify NTP server is enabled in CPU properties
-> Check PLC has a valid time source (its own NTP client must be synced)
5.4 Limitations
- The PLC NTP server is only as accurate as its own time source. If the PLC’s NTP client loses sync, all downstream devices will also drift.
- B&R NTP server is based on the SNTP (Simple NTP) protocol. It is suitable for industrial synchronization (±10-50ms) but not for applications requiring sub-millisecond accuracy.
- A PLC reboot will cause the NTP server to be unavailable for 30-120 seconds until the PLC re-establishes its own NTP sync.
6. Multi-CPU Time Synchronization
6.1 Time Sync via POWERLINK
POWERLINK is B&R’s real-time Ethernet protocol. It supports time synchronization between CPUs connected on the same POWERLINK network.
Configuration:
- In the POWERLINK configuration of the primary CPU, enable time synchronization.
- Secondary CPUs configured as POWERLINK nodes will automatically synchronize to the primary CPU’s time.
- The primary CPU must have a valid time source (NTP client or manual setting).
POWERLINK time sync hierarchy:
Primary CPU (X20CP1584)
├── NTP client → external NTP server
└── POWERLINK master
├── Secondary CPU 1 (CN node)
├── Secondary CPU 2 (CN node)
└── Secondary CPU 3 (CN node)
Time flows: NTP Server → Primary CPU → POWERLINK → Secondary CPUs
POWERLINK time synchronization accuracy: ±1-10 microseconds (depending on network topology and configuration). This is significantly better than NTP over Ethernet and is suitable for coordinating motion and process events across CPUs.
6.2 Time Sync via Ethernet
For CPUs on a standard Ethernet network (not POWERLINK), time synchronization relies on NTP:
- All CPUs configure their NTP client to point to the same NTP server.
- Alternatively, one CPU acts as NTP server (see Section 5).
- All CPUs independently sync to the NTP server.
Ethernet NTP sync:
Corporate NTP Server (10.0.0.1)
├── PLC-01 (192.168.100.10) - NTP client
├── PLC-02 (192.168.100.11) - NTP client
├── PLC-03 (192.168.100.12) - NTP client
└── PLC-04 (192.168.100.13) - NTP client
Each CPU syncs independently. Maximum inter-CPU time difference
depends on NTP polling and network conditions: typically ±50-200ms
6.3 PTP (IEEE 1588 / IEEE 802.1AS) — Precision Time Protocol
PTP support on B&R controllers is limited to newer hardware and TSN (Time-Sensitive Networking) configurations.
| Controller Series | PTP Support | Protocol | Accuracy |
|---|---|---|---|
| X20CP1584 / CP1484 | Not supported | — | NTP only (±5-50ms) |
| X20CP3xxx / CP4xxx | Not supported (standard Ethernet) | — | NTP only |
| APC2200 (with TSN) | Supported | IEEE 802.1AS (gPTP) | Sub-microsecond |
| APC910 / newer APC | Supported (with TSN switch) | IEEE 802.1AS (gPTP) | Sub-microsecond |
| X20CP3xxx (TSN variants) | Supported (with TSN hardware) | IEEE 802.1AS | Sub-microsecond |
For the CP1584 specifically: PTP is not available. The CP1584’s Ethernet interface and AR 4.x runtime do not implement IEEE 1588. Time synchronization is limited to NTP (for Ethernet) or POWERLINK internal sync (for X2X/POWERLINK bus devices). If you need sub-millisecond synchronization on a CP1584 system, use POWERLINK time sync (Section 6.1) between CPUs and accept NTP-level accuracy for non-POWERLINK devices.
B&R’s PTP implementation uses IEEE 802.1AS (gPTP), which is part of the TSN protocol suite. It requires a TSN-capable Ethernet switch as the PTP grandmaster. The switch distributes time to all connected controllers with sub-microsecond accuracy.
Source: B&R OPC UA over TSN whitepaper — “IEEE 802.1AS (gPTP) allows very accurate time synchronization. B&R controllers make it possible to synchronize.” Source: https://www.br-automation.com/en-gb/downloads/
6.4 NTP Authentication
The CP1584 NTP client does not support NTP authentication (symmetric key or autokey).
| Feature | Support on CP1584 | Notes |
|---|---|---|
| NTP symmetric key authentication | Not supported | AR 4.x NTP client has no authentication options |
| NTP autokey (public key) | Not supported | Not implemented |
| NTP broadcast/multicast mode | Not supported | Client mode only |
| NTP client restriction (allowed peers) | Not supported | Any configured server is trusted |
Security implication: Any device on the same network that responds to NTP queries on port 123 could potentially spoof time to the CP1584. For hardened environments, place the CP1584 on an isolated VLAN with only the designated NTP server reachable (see cybersecurity-hardening.md for VLAN segmentation procedures).
On newer AR 6.x controllers, B&R has added NTP authentication support — but this does not help the CP1584.
6.5 DHCP Option 42 (NTP Server Auto-Configuration)
The CP1584 does not support DHCP Option 42.
Many industrial networks use DHCP Option 42 (NTP Servers) to automatically configure NTP server addresses for devices. The CP1584’s DHCP client does not request or process Option 42 — NTP server addresses must be manually configured in the CPU properties.
| DHCP Option | Standard Purpose | CP1584 Support |
|---|---|---|
| Option 1 (Subnet Mask) | Network mask | Supported |
| Option 3 (Router) | Default gateway | Supported |
| Option 6 (DNS Server) | DNS servers | Supported |
| Option 42 (NTP Servers) | NTP server addresses | Not supported |
| Option 51 (Lease Time) | DHCP lease duration | Supported |
If your plant uses DHCP with Option 42, you will still need to manually configure the NTP server address in each CP1584. Consider using the B&R CPU as NTP server (Section 5) and configuring only the CP1584 with a static NTP server address while other devices use DHCP Option 42.
6.6 B&R Time Synchronization Function Blocks
B&R provides function blocks for explicit time management in user programs:
| Function Block | Library | Purpose |
|---|---|---|
TcGetTime | TechUnits | Get current PLC timestamp |
TcGetTimeUTC | TechUnits | Get current PLC time in UTC |
TcSetTime | TechUnits | Set PLC time programmatically |
mcTimeSync | MpCom | Check time synchronization status |
MpTime | MpBase | Managed time synchronization component |
PROGRAM _CYCLIC
VAR
fbGetTime : TcGetTime;
fbCheckSync : mcTimeSync;
currentTime : DT;
syncStatus : BOOL;
END_VAR
fbGetTime(enable := TRUE);
IF fbGetTime.ready THEN
currentTime := fbGetTime.time;
END_IF
fbCheckSync(enable := TRUE);
syncStatus := fbCheckSync.isSynchronized;
END_PROGRAM
6.7 Cross-Referencing Timestamps Across CPUs
When analyzing events across multiple CPUs:
- Record each CPU’s last known NTP sync status and time difference.
- Apply a time correction factor based on the measured offset for each CPU.
- Sort all events by corrected timestamp to build a unified timeline.
- Account for network latency between the event occurrence and the log entry timestamp.
Cross-CPU timeline correction example:
CPU-01: time_diff = +0.005s (ahead)
CPU-02: time_diff = -0.012s (behind)
CPU-03: time_diff = +0.003s (ahead)
Event on CPU-01 at 14:32:15.234 → corrected: 14:32:15.229
Event on CPU-02 at 14:32:15.198 → corrected: 14:32:15.210
Event on CPU-03 at 14:32:15.321 → corrected: 14:32:15.318
Corrected order: CPU-01 (14:32:15.229), CPU-03 (14:32:15.318), CPU-02 (14:32:15.210)
→ CPU-02 event actually happened first after correction
6.8 Strategies When CPUs Drift Apart
When NTP fails and CPUs drift apart:
-
Detect drift: Periodically log each CPU’s time relative to a reference. A simple method is to have all CPUs write their current time to a shared variable on a common data connection, then compare.
-
Controlled resync: When NTP is restored, do not let the PLC step its clock forward by a large amount during production. Use the NTP slew mode (gradual adjustment) instead of step mode to avoid triggering time-based events out of sequence.
-
Fallback strategy: If external NTP is unreliable, designate one CPU as the master time source and have others sync to it via POWERLINK or by setting time programmatically.
7. Timestamp Analysis for Diagnostics
7.1 AR Logbook Timestamps
The AR logbook is the primary diagnostic log on a B&R PLC. Every entry carries a timestamp:
AR logbook entry format:
Timestamp (DT format): 2026-07-10 14:32:15.234
Log level: WARNING
Source: Network Manager
Message: "Connection timeout to node 5 (X20BC0083)"
Additional data: Node=5, Timeout=5000ms, RetryCount=3
Raw format in exported log:
[2026-07-10 14:32:15.234] [WARNING] [Network Manager] Connection timeout
The timestamp is the PLC’s local time at the moment the log entry was created. If the PLC clock is wrong, this timestamp is wrong. There is no embedded UTC reference or NTP offset in the log entry itself.
7.2 AR Logbook Timestamp Format
B&R uses the DATE_AND_TIME (DT) data type internally:
DT type breakdown:
#2026-07-10:14:32:15.234
Year: 2026
Month: 07 (July)
Day: 10
Hour: 14 (24-hour format)
Minute: 32
Second: 15
Millisecond: 234
Total bytes: 8 (two 4-byte words: date + time_of_day)
When exporting AR logbook entries, timestamps may appear in different formats depending on the export method (AS web interface, FTP, PVI, OPC-UA). Always confirm the format and timezone of exported data.
7.3 Alarm Timestamp Format
Alarm timestamps in B&R are stored separately from the AR logbook. See alarm-logging.md for detailed alarm timestamp handling.
Key points:
- Alarm timestamps use the same DT type as the AR logbook.
- Alarm logging has its own timestamp source, which may differ from the system clock if a dedicated alarm logging component with its own time base is used.
- The
MpAlarmXcomponent stores timestamps for alarm acknowledgment, occurrence, and disappearance.
7.4 SDM Timestamp Usage
The System Diagnostics Manager (SDM) generates diagnostic events with timestamps. See diagnostics-sdm.md for SDM-specific timestamp handling.
SDM timestamps are derived from the system clock at the moment the diagnostic event is detected. SDM events include hardware diagnostics (module insertion/removal, power supply monitoring, watchdog events) and software diagnostics (task overflow, communication errors).
7.5 POWERLINK Cycle Counter vs Wall Clock Time
POWERLINK provides two time references:
| Time Reference | Resolution | Use Case |
|---|---|---|
| POWERLINK cycle counter | 1 cycle (typically 200μs or 1ms) | Motion coordination, I/O timestamping |
| Wall clock time | 1ms (DT type) | Logging, alarm correlation, external event correlation |
The POWERLINK cycle counter increments every cycle and wraps around. It is useful for measuring intervals within a single POWERLINK cycle period (up to several hours depending on cycle time). For longer periods or correlation with external events, wall clock time is required.
Conversion between POWERLINK cycle time and wall clock time:
PROGRAM PLK_Time_Calc
VAR
cycleCount : LWORD;
cycleTime : LINT; (* microseconds *)
wallTime : DT;
startTime : DT;
elapsedTime: TIME;
END_VAR
cycleCount := PLK_GetCycleCounter();
cycleTime := cycleCount * 200; (* 200us per cycle for 5kHz POWERLINK *)
elapsedTime := cycleTime / 1000; (* convert to milliseconds *)
wallTime := startTime + elapsedTime;
END_PROGRAM
7.6 Correlating PLC Events with External Equipment
To correlate PLC timestamps with events from non-B&R equipment:
-
Common NTP source: Ensure all devices (PLCs, drives, HMIs, PCs, third-party equipment) sync to the same NTP server. This is the most reliable approach.
-
GPS time reference: For facilities with no reliable network NTP, a GPS-based NTP server provides time accurate to ±1μs without network dependency.
-
Manual timestamp recording: When analyzing a specific event, record the exact time from a phone or PC (synced to NTP) at the moment the event occurs. Then search the PLC logs for entries near that time.
-
Network packet capture: Capture network traffic with
tcpdumpor Wireshark using an NTP-synced capture system. The packet timestamps in the capture file are wall-clock time, and PLC-related packets can be correlated with PLC log entries.
External event correlation workflow:
1. Motor VFD faults at 14:32:15 (verified on VFD display, time unknown)
2. Check PLC AR logbook around 14:32:15 ± 5 minutes
3. Found entries:
14:32:14.891 [INFO] Motion command completed (axis 1)
14:32:14.902 [WARN] Analog input 3 out of range
14:32:15.001 [ERROR] POWERLINK node 7 comm timeout
14:32:15.234 [WARN] Network Manager: connection lost node 7
4. Correlation: Analog input fault preceded VFD communication loss by 99ms
5. Hypothesis: Power supply issue on analog input caused VFD comm failure
7.7 Building a Timeline from Multiple Sources
When reconstructing events from multiple timestamp sources:
Timeline reconstruction template:
Time (UTC) | Device | Event
--------------- | --------- | ----------------------------------------
14:32:14.891 | PLC-01 | Motion command completed (axis 1)
14:32:14.895 | Drive-01 | Speed setpoint received
14:32:14.897 | Drive-01 | Current limit warning (logged in drive)
14:32:14.902 | PLC-01 | Analog input 3 out of range
14:32:15.001 | PLC-01 | POWERLINK node 7 comm timeout
14:32:15.100 | HMI-01 | Communication timeout alarm displayed
14:32:15.234 | PLC-01 | Network Manager: connection lost node 7
14:32:16.500 | SCADA | Data gap in historian (tag: Drive01_Speed)
Causal chain: Analog input fault → Drive protection → POWERLINK timeout → HMI alarm → SCADA data gap
Notes on timestamp corrections:
PLC-01 time_diff: +0.005s → subtract 5ms from PLC timestamps
Drive-01 time_diff: unknown (no NTP) → estimated ±500ms accuracy
HMI-01 time_diff: +0.012s → subtract 12ms from HMI timestamps
SCADA time_diff: synced to PC NTP → accurate within ±10ms
8. Practical Diagnostic Workflows
8.1 Diagnosing Intermittent Faults with Timestamps
Workflow for finding the root cause of intermittent faults:
Step 1: Verify time synchronization across all devices
- Check NTP status on every PLC (Online > Info > Time)
- Check HMI time vs PLC time
- Check drive time vs PLC time (if accessible)
- Record the time difference for each device
Step 2: Collect all log entries spanning the fault event
- Export AR logbook entries for the time window (±10 minutes around fault)
- Export alarm history for the same period
- Export SDM diagnostic events
- Collect drive fault logs (if accessible)
- Collect HMI alarm history
Step 3: Apply timestamp corrections
- Add/subtract each device's measured time difference
- Convert all timestamps to a common timezone (UTC recommended)
Step 4: Build a unified timeline
- Merge all events into a single sorted list
- Add device source to each entry
- Add severity/importance flag to each entry
Step 5: Analyze the timeline for causal patterns
- Look for the earliest event (root cause candidate)
- Look for cascading sequences (cause → effect → effect)
- Look for recurring patterns across multiple fault instances
Step 6: Validate the hypothesis
- Can the identified root cause explain all observed events?
- Are there events that don't fit the pattern? (may indicate additional issues)
- Can the fault be reproduced by triggering the root cause?
8.2 Post-Failure Timeline Reconstruction
After a machine stop or failure with no live monitoring available:
Post-failure reconstruction checklist:
[ ] Record the exact time the operator reported the failure
[ ] Check PLC AR logbook for entries ±30 minutes around reported time
[ ] Check alarm history for the same period
[ ] Check SDM diagnostics for hardware events
[ ] Export all logs with timestamps
[ ] Verify PLC time was correct (compare with external reference)
[ ] If PLC time was wrong, calculate correction offset
[ ] Apply correction to all timestamps
[ ] Build timeline in chronological order
[ ] Identify the first anomalous event
[ ] Cross-reference with maintenance records
[ ] Cross-reference with power monitoring data (if available)
[ ] Cross-reference with upstream/downstream equipment events
8.3 Correlating I/O Errors with Power Events
A common diagnostic scenario: I/O modules report errors that correlate with power events.
Correlation method:
1. In the PLC program, log power supply voltage (if monitored) with timestamps
Example: Log 24V supply voltage every 100ms to a cyclic data logger
2. In SDM diagnostics, check for power-related events:
- "Power supply voltage below threshold"
- "Power supply brownout detected"
- "Module power-on reset"
3. Cross-reference I/O error timestamps with power event timestamps
Example finding:
14:30:45.100 SDM: 24V supply voltage dropped to 19.2V
14:30:45.102 SDM: Module X20DI9371 (node 3) reset
14:30:45.234 AR: Digital input channel 4 signal loss
14:30:45.500 AR: POWERLINK node 3 communication error
14:30:46.000 SDM: 24V supply voltage restored to 23.8V
14:30:46.234 AR: POWERLINK node 3 communication restored
Conclusion: Momentary power dip caused I/O module reset and communication loss
8.4 Cross-Device Event Correlation Workflow
Cross-device correlation workflow:
1. Create a device inventory with time sync status
| Device | IP | NTP Server | Time Diff |
|--------------|---------------|---------------|------------|
| PLC-01 | 192.168.100.10| pool.ntp.org | +0.005s |
| PLC-02 | 192.168.100.11| pool.ntp.org | -0.012s |
| Drive-01 | 192.168.100.20| PLC-01 | +0.008s |
| HMI-01 | 192.168.100.30| pool.ntp.org | +0.015s |
| SCADA-PC | 192.168.100.50| time.win.com | +0.002s |
2. Export logs from all devices for the analysis period
3. Normalize all timestamps to UTC
- Subtract each device's time_diff from its timestamps
- Convert from local time to UTC using known timezone offset
4. Merge into a single chronological list
5. Apply filtering to reduce noise
- Exclude low-priority events
- Exclude expected periodic events
- Focus on events in the failure window
6. Analyze the filtered timeline for patterns
8.5 Time Drift Detection and Correction
Implementing ongoing time drift monitoring:
PROGRAM TimeDriftMonitor
VAR
fbGetTime : TcGetTime;
driftLog : ARRAY[1..100] OF DT;
driftIdx : UINT;
refTime : DT;
maxDrift : TIME := T#5S;
driftAlarm: BOOL;
END_VAR
fbGetTime(enable := TRUE);
IF fbGetTime.ready THEN
IF fbGetTime.time - refTime > maxDrift THEN
driftAlarm := TRUE;
END_IF
driftIdx := driftIdx + 1;
IF driftIdx > 100 THEN
driftIdx := 1;
END_IF;
driftLog[driftIdx] := fbGetTime.time;
END_IF
END_PROGRAM
For automated drift detection across a network:
Scheduled drift check script (run from a Linux server):
#!/bin/bash
for plc in 192.168.100.10 192.168.100.11 192.168.100.12; do
plc_time=$(snmpget -v2c -c public $plc .1.3.6.1.2.1.25.1.2.0 2>/dev/null)
echo "$(date -Iseconds) PLC=$plc SNMP_TIME=$plc_time" >> /var/log/plc_drift.log
done
9. Cross-References
| Document | Relevance to Time Synchronization |
|---|---|
| alarm-logging.md | Alarm timestamp format, storage, and retrieval via MpAlarmX component |
| diagnostics-sdm.md | SDM event timestamps, hardware diagnostic event timing |
| system-variables.md | System variables for reading/writing PLC time, NTP status variables |
| network-architecture.md | Network topology for NTP server placement, VLAN routing for time sync |
| plc-to-plc.md | POWERLINK time synchronization between CPUs, data exchange timing |
| opcua.md | OPC-UA timestamp handling, server/client time correlation |
| pvi-api.md | PVI-based programmatic time configuration and monitoring |
| ftp-web-interface.md | Accessing log files and configuration files via FTP for timestamp analysis |
| execution-model.md | Task scheduling, cycle time measurement, and its relationship to wall-clock time |
10. Key Findings
-
NTP failures on B&R PLCs are silent by default. Automation Studio shows no errors when NTP is not working. You must proactively check Online > Info > Time on every maintenance visit. A PLC that has not synced NTP for months may be drifting by minutes or hours.
-
DNS is the most common NTP failure point. The NTP client requires DNS to resolve server hostnames. If DNS is not configured in CPU properties, NTP polls never leave the PLC. This is the first thing to check when NTP is not working.
-
Default gateway is required for external NTP servers. Without a gateway configured, the PLC cannot route NTP packets to servers outside its own subnet. For internal NTP servers on the same subnet, the gateway is not required.
-
Use a local NTP server for industrial reliability. External NTP servers (pool.ntp.org) introduce dependency on internet connectivity and plant firewall configuration. A dedicated NTP server on the same VLAN eliminates these failure points.
-
The 24-minute offset is a configuration error, not a hardware fault. If the PLC time is off by exactly 24 minutes, check the timezone configuration in CPU Properties. The NTP protocol works in UTC; incorrect timezone offsets produce exact time differences.
-
Check the AR logger, not just Automation Studio, for NTP issues. The AR logbook may contain NTP-related warnings that are not surfaced as errors in the AS IDE. Search for “NTP” and “Time sync” patterns in the AR logbook.
-
Cross-device time correlation requires documented time differences. When building diagnostic timelines from multiple devices, record each device’s NTP time difference at the time of the event. Apply corrections to timestamps before merging timelines. Without corrections, events may appear out of order.
-
POWERLINK provides microsecond-accurate time sync between CPUs. For multi-CPU systems on POWERLINK, time synchronization is orders of magnitude more accurate than NTP over Ethernet. Use POWERLINK time sync for motion coordination and tight inter-CPU event correlation.
-
Time-based diagnostics are only as reliable as the clocks. Before any event correlation or root cause analysis, verify that all involved clocks are synchronized. A single device with a wrong clock can invalidate an entire diagnostic timeline. This is the first step in any diagnostic workflow on an undocumented machine.
-
Implement a time drift monitoring routine. Add a simple programmatic check in your PLC code that flags when the time difference from the NTP server exceeds a threshold. This catches silent NTP failures that would otherwise go undetected until the next manual check.
Key Findings
-
Time sync is the foundation of all diagnostic correlation. Without trustworthy timestamps across PLC, drives, IO, and HMIs, it is impossible to determine event causality or perform root cause analysis on intermittent faults.
-
The 24-minute offset is a timezone configuration error. If the PLC time is off by exactly 24 minutes, the timezone setting in CPU Properties is incorrect. NTP operates in UTC; timezone conversion errors produce exact time differences.
-
NTP over the plant network requires firewall configuration. NTP uses UDP port 123 outbound. Ensure plant firewalls allow this and that DNS resolution works for the configured NTP server.
-
POWERLINK provides microsecond-accurate time sync between CPUs. For multi-CPU systems, POWERLINK time synchronization is orders of magnitude more accurate than NTP over Ethernet. Use it for motion coordination and tight inter-CPU event correlation.
-
Silent NTP failures go undetected without monitoring. If the NTP server becomes unreachable, the PLC continues running with its local clock — which drifts. Implement a time drift monitoring routine in your PLC code to flag NTP failures.
-
Cross-device time correlation requires recording time offsets. When building diagnostic timelines from multiple devices, document each device’s NTP time difference at the time of the event and apply corrections before merging timelines.
11. Sources
- B&R Automation Studio documentation: CPU Properties > Time Synchronization configuration
- B&R Automation Runtime (AR) manual: NTP client configuration and behavior
- B&R POWERLINK specification: Time synchronization over POWERLINK networks
- B&R PVI (Programmable Vision Interface) reference: Programmatic PLC configuration access
- B&R SDM (System Diagnostics Manager) documentation: Diagnostic event timestamps
- B&R OPC-UA implementation: Timestamp handling in OPC-UA server/client
- NTP protocol specification (RFC 5905): Network Time Protocol version 4
- NTP pool project documentation: pool.ntp.org usage guidelines and rate limiting
- Industrial network security practices: Firewall rules for NTP (UDP port 123)
- Field experience: 24-minute NTP offset issue on X20CP1584, firmware-dependent configuration behavior
- B&R Knowledge Base: Silent NTP failure behavior, AR logger NTP warning messages
- Community reports: NTP configuration requirements (DNS, gateway, firewall) on B&R X20 systems
B&R Temperature and Hardware Monitoring
Target audience: Automation engineers maintaining B&R X20CP1584 PLCs from defunct OEMs with zero documentation. Scope: Temperature sensing, voltage monitoring, cabinet monitoring modules, SNMP, RTInfo, and thermal remediation.
1. Overview
Why Hardware Monitoring Matters for Aging CP1584 Systems
The X20CP1584 (Intel Atom 600MHz, fanless, released ~2010) is now well past its intended service life in many installations. When these systems start misbehaving – watchdogs tripping, intermittent communication losses, task overruns, mysterious SERVICE-mode transitions – the root cause is almost never a software bug. It is thermal degradation.
Electrolytic capacitors on the CPU module lose capacitance with age and heat. Solder joints develop microcracks under thermal cycling. Flash memory endurance is consumed faster at elevated temperatures. The CPU die itself can throttle or trigger protective shutdown. Without baseline data, you cannot distinguish a temperature-induced intermittent fault from a logic error.
How to tell thermal degradation from software bugs:
| Symptom | Likely Thermal | Likely Software |
|---|---|---|
| Intermittent, time-of-day dependent | Yes (ambient cycle) | No |
| Worsens in summer | Yes | No |
| Persists across program versions | Yes | No |
| Correlates with cabinet door being open/closed | Yes | No |
| Reproducible on command | No | Yes |
| Appears after IO module addition | Yes (load/heat) | Possible |
| Random task overrun errors | Yes (throttling) | Possible |
The diagnostic strategy is simple: instrument the temperature sensors that are already built into the hardware, establish a baseline, and trend the data. Everything documented here requires either the built-in IO mapping or a single external module costing under $200.
2. Built-in Temperature Sensors
Two Sensors, Two Readings
Every X20 CPU, including the X20CP1584, contains two independent temperature sensors:
-
CPU die temperature – measures the actual silicon junction temperature. This is the critical value. Available as
mpCPUcore0Tempin the IO mapping (typeLREAL, unit °C). -
Housing/PCB temperature – a sensor mounted inside the CPU housing near the PCB. Reads lower than the die. Available as
mpCPUpcbTempin the IO mapping (typeLREAL, unit °C).
Both sensors are automatically updated by the firmware. No configuration is required to enable them – you only need to add the variables to your IO mapping.
Temperature Thresholds
| State | CPU Die Temp | Housing Temp | Action |
|---|---|---|---|
| Normal (25°C ambient) | 40-50°C | 35-45°C | None |
| Normal (50°C cabinet) | ~70°C | ~60°C | Trending recommended |
| Warning | ~89°C (recommended) | ~75°C | Log, alert, investigate |
| Critical | 110°C (hard shutdown per Intel/B&R datasheet) | 95°C (board overtemperature shutdown) | CPU enters reset state automatically; error 9204 logged |
| Pre-shutdown | 105°C (estimated AR SERVICE mode threshold) | ~85°C | CPU may enter SERVICE mode before hard shutdown |
Ambient-to-CPU Temperature Relationship
The relationship is approximately linear. For every 10°C rise in ambient temperature, both the CPU die and housing temperature rise by approximately 10°C.
Practical baseline table (horizontal mounting, unblocked airflow):
| Ambient Temperature | Expected CPU Die | Expected Housing |
|---|---|---|
| 20°C | 35-45°C | 30-40°C |
| 25°C | 40-50°C | 35-45°C |
| 30°C | 50-60°C | 40-50°C |
| 40°C | 60-70°C | 50-60°C |
| 50°C | 70-80°C | 60-70°C |
| 60°C | 80-90°C | 70-80°C |
One community report showed a CPU die reading of 70°C at 25°C ambient with the unit lying flat on a desk – a clear demonstration that mounting orientation matters even in open air.
Mounting Orientation Impact
| Orientation | Max Ambient Rating | Notes |
|---|---|---|
| Horizontal | -25°C to +60°C | Preferred. Natural convection flows upward across PCB. |
| Vertical | -25°C to +50°C | 10°C lower rating. Convection path is restricted. |
Practical rule: If your cabinet regularly exceeds 45°C ambient, verify the CPU is horizontally mounted. Vertical mounting at 50°C cabinet ambient puts the die temperature at or above the warning threshold.
3. Reading Temperature via Software
Method 1: IO Mapping in Automation Studio
- In Automation Studio, double-click the CPU node in the Physical View.
- Navigate to Properties → IO Mapping → Temperature.
- Add the following variables to your task’s IO mapping:
Variable Name Type Description
mpCPUcore0Temp LREAL CPU die temperature in °C
mpCPUpcbTemp LREAL Housing/PCB temperature in °C
These variables are updated automatically every cycle. No function block instantiation is needed.
Method 2: Without Automation Studio (PVI)
If you do not have the original AS project, you can read temperature via PVI (Process Visualization Interface) using the CPU’s internal variable names:
import brplc
from brplc.pvi import PviConnection
cpu = PviConnection(
device_type="X20CP1584",
ip_address="192.168.1.10",
user="operator",
password=""
)
die_temp = cpu.read_variable("mpCPUcore0Temp")
housing_temp = cpu.read_variable("mpCPUpcbTemp")
print(f"CPU Die: {die_temp:.1f}°C")
print(f"Housing: {housing_temp:.1f}°C")
Method 3: OPC-UA
B&R OPC-UA server exposes system variables. If the CPU is running an OPC-UA server (mapp ServerUA or similar), temperature variables are accessible:
from opcua import Client
url = "opc.tcp://192.168.1.10:4840"
client = Client(url)
client.connect()
die_temp_ns = client.get_node("ns=2;s=gApp.mpCPUcore0Temp")
housing_temp_ns = client.get_node("ns=2;s=gApp.mpCPUpcbTemp")
print(f"CPU Die: {die_temp_ns.get_value():.1f}°C")
print(f"Housing: {housing_temp_ns.get_value():.1f}°C")
client.disconnect()
ST Code: Temperature Monitoring with Alarm Thresholds
FUNCTION_BLOCK FB_CpuTempMonitor
VAR_INPUT
rDieTemp : LREAL;
rHousingTemp : LREAL;
rWarnThreshold : LREAL := 89.0;
rCritThreshold : LREAL := 105.0;
tCycleTime : TIME := T#5S;
END_VAR
VAR_OUTPUT
bWarning : BOOL;
bCritical : BOOL;
rPeakDieTemp : LREAL;
rPeakHousingTemp: LREAL;
rAvgDieTemp : LREAL;
eStatus : eTempStatus;
dtWarningFirst : DT;
dtCriticalFirst : DT;
END_VAR
VAR
rSumDieTemp : LREAL := 0.0;
nSampleCount : DINT := 0;
tmrSample : TON;
fbLogger : FB_CsvLogger;
arLogData : ARRAY[0..3] OF LREAL;
END_VAR
TYPE eTempStatus :
(
STATUS_NORMAL,
STATUS_ELEVATED,
STATUS_WARNING,
STATUS_CRITICAL
);
END_TYPE
tmrSample(IN := TRUE, PT := tCycleTime);
IF tmrSample.Q THEN
tmrSample(IN := FALSE);
IF rDieTemp > rPeakDieTemp THEN
rPeakDieTemp := rDieTemp;
END_IF;
IF rHousingTemp > rPeakHousingTemp THEN
rPeakHousingTemp := rHousingTemp;
END_IF;
rSumDieTemp := rSumDieTemp + rDieTemp;
nSampleCount := nSampleCount + 1;
rAvgDieTemp := rSumDieTemp / nSampleCount;
IF rDieTemp >= rCritThreshold THEN
bCritical := TRUE;
bWarning := TRUE;
IF dtCriticalFirst = DT#1970-01-01-00:00:00 THEN
dtCriticalFirst := CURRENT_DATETIME;
END_IF;
eStatus := STATUS_CRITICAL;
ELSIF rDieTemp >= rWarnThreshold THEN
bWarning := TRUE;
IF dtWarningFirst = DT#1970-01-01-00:00:00 THEN
dtWarningFirst := CURRENT_DATETIME;
END_IF;
eStatus := STATUS_WARNING;
ELSIF rDieTemp >= (rWarnThreshold - 15.0) THEN
eStatus := STATUS_ELEVATED;
ELSE
eStatus := STATUS_NORMAL;
END_IF;
arLogData[0] := rDieTemp;
arLogData[1] := rHousingTemp;
arLogData[2] := LREAL#nSampleCount;
arLogData[3] := rAvgDieTemp;
fbLogger(
sFileName := '/CF1/temp_log.csv',
arValues := arLogData,
bExecute := TRUE
);
END_IF;
4. Voltage Monitoring
24V Supply Requirements
The X20CP1584 requires a 24V DC supply with the following tolerance:
| Parameter | Value |
|---|---|
| Nominal voltage | 24V DC |
| Minimum (continuous) | 20.4V (-15%) |
| Maximum (continuous) | 28.8V (+20%) |
| Voltage dip tolerance | Brief dips below 20.4V tolerated by internal capacitors |
| Hold-up time (typical) | 10-20ms at full load |
Undervoltage Detection Behavior
When the 24V supply drops below the internal threshold (approximately 18-19V):
- The CPU detects the brownout condition.
- All outputs are de-energized (safe state).
- A power-fail event is logged in the system log.
- On power recovery, the CPU performs a warm start.
- If brownout is brief (< hold-up time), the CPU may ride through without resetting.
Known Issue: Capacitor Degradation
Community reports indicate that aging electrolytic capacitors on X20CP1584 modules can cause:
- Reduced hold-up time during voltage dips
- Unexplained warm restarts
- Erratic behavior when multiple IO modules draw current simultaneously
Diagnostic: Monitor the 24V rail at the CPU terminals with an oscilloscope during startup (inrush current) and during IO module switching events. Voltage dips below 20V for more than a few milliseconds indicate capacitor degradation or undersized power supply.
External Voltage Monitoring
If you need to monitor the 24V supply externally (the CPU does not expose an internal voltage variable in the standard IO mapping), use an X20 analog input or an X20CMR cabinet monitoring module:
FUNCTION_BLOCK FB_VoltageMonitor
VAR_INPUT
r24V_Raw : LREAL;
rUndervoltage : LREAL := 20.4;
rOvervoltage : LREAL := 28.8;
rNominal : LREAL := 24.0;
END_VAR
VAR_OUTPUT
bUnderVoltage : BOOL;
bOverVoltage : BOOL;
rVoltageDevPct : LREAL;
eVoltStatus : eVoltageStatus;
END_VAR
rVoltageDevPct := ABS((r24V_Raw - rNominal) / rNominal) * 100.0;
IF r24V_Raw < rUndervoltage THEN
eVoltStatus := eVoltStatus.UNDERVOLTAGE;
bUnderVoltage := TRUE;
ELSIF r24V_Raw > rOvervoltage THEN
eVoltStatus := eVoltStatus.OVERVOLTAGE;
bOverVoltage := TRUE;
ELSE
eVoltStatus := eVoltStatus.NORMAL;
END_IF;
Power Supply Sizing
For X20CP1584 with typical IO configuration:
| Component | Current Draw (typical) |
|---|---|
| X20CP1584 CPU | 0.7A |
| X20DI9371 (16ch DI) | 0.04A |
| X20DO9322 (16ch DO) | 0.12A (worst case) |
| X20AI4632 (4ch AI) | 0.08A |
| X20AO4622 (4ch AO) | 0.12A |
| X20TB12 (terminal block) | 0.01A |
Total typical: 1.0-1.5A at 24V. Use a power supply rated for at least 2x the expected load for headroom and to handle inrush currents. Minimum recommended: 5A / 120W industrial supply with hold-up capability.
5. Fan Monitoring
X20CP1584 is Fanless
The X20CP1584 is a fully fanless design. It relies entirely on passive convection cooling through the CPU housing fins. There is no fan status to monitor, no fan to replace, and no fan-related failure mode.
X20 CPUs With Active Cooling
| Model | Cooling | Notes |
|---|---|---|
| X20CP1584 | Passive/fanless | Intel Atom 600MHz, low TDP (~3-5W) |
| X20CP1484 | Passive/fanless | Similar class |
| X20CP3484 | Active/fan | Intel Celeron, higher TDP |
| X20CP3486 | Active/fan | Intel Core i-class, higher TDP |
| X20CP4284 | Passive/fanless | ARM-based |
| X20CP0484 | Passive/fanless | Entry level |
For fan-equipped CPUs, fan status is typically available via:
mpCPUfanStatus BOOL TRUE = running, FALSE = fan failure/service needed
mpCPUfanSpeed USINT Fan speed percentage (0-100)
Fan Monitoring ST Code (for Fan-Equipped CPUs)
FUNCTION_BLOCK FB_FanMonitor
VAR_INPUT
bFanStatus : BOOL;
usFanSpeed : USINT;
usMinSpeed : USINT := 20;
END_VAR
VAR_OUTPUT
bFanFault : BOOL;
bFanSlow : BOOL;
usSpeedPct : USINT;
END_VAR
usSpeedPct := usFanSpeed;
bFanFault := NOT bFanStatus;
bFanSlow := (bFanStatus = TRUE) AND (usFanSpeed < usMinSpeed);
6. External Cabinet Monitoring Modules
Module Comparison
| Model | Temperature | Humidity | PT1000 | Digital I/O | Flash | Operating Hours | Blackout Mode |
|---|---|---|---|---|---|---|---|
| X20CMR010 | 1x internal | 1x internal | No | No | 512KB | Yes | No |
| X20CMR011 | 1x internal | No | 2x inputs | 4 DI + 4 DO | 512KB | Yes | Yes |
| X20CMR111 | Extended | Extended | 2x inputs | 4 DI + 4 DO | 512KB | Yes | Yes |
| X20CMR100 | 1x internal | No | No | 2 DI | 512KB | Yes | No |
X20CMR010 – Cabinet Monitoring (Temperature + Humidity)
This module provides a built-in temperature sensor and a built-in humidity sensor inside the X20 station housing. It also provides:
- Production data logging (512KB internal flash)
- Operating hours counter
- Event logging
IO Mapping variables (added in Automation Studio under the X20CMR010 node):
Variable Name Type Description
cmr010Temperature LREAL Cabinet temperature in °C
cmr010Humidity LREAL Relative humidity in %RH
cmr010OperatingHours ULINT Total operating hours
cmr010ProductionCounter UDINT Production piece count (user-configured trigger)
cmr010EventLogEntries UDINT Number of events in log
X20CMR011 – Cabinet Monitoring with PT1000
This module adds two PT1000 resistance thermometer inputs for remote temperature sensing, plus digital I/O and a blackout detection mode:
IO Mapping variables:
Variable Name Type Description
cmr011CabinetTemp LREAL Internal cabinet temperature °C
cmr011PT1000_1 LREAL PT1000 channel 1 temperature °C
cmr011PT1000_2 LREAL PT1000 channel 2 temperature °C
cmr011Humidity LREAL Relative humidity %RH (if available)
cmr011OperatingHours ULINT Total operating hours
cmr011BlackoutDetected BOOL TRUE if blackout condition detected
cmr011DI_1..4 BOOL Digital input channels
cmr011DO_1..4 BOOL Digital output channels
Blackout mode: When enabled, the module can detect a complete power blackout and log the timestamp. Combined with the operating hours counter, this provides an energy audit trail.
Using Cabinet Monitoring Without the Original Project
- Connect the X20CMR010 or X20CMR011 to your X20 station (any free X20 bus slot).
- The CPU will detect the module on power-up. If no IO mapping exists for it, the CPU will log an unknown module error but will not fault.
- To configure without the full project:
- Use Automation Studio’s “Device Scan” to detect the module.
- Add the module to the physical configuration.
- Map the IO variables listed above to your task.
- Download only the hardware configuration if possible (partial download).
ST Code: Cabinet Environment Monitor with X20CMR010
FUNCTION_BLOCK FB_CabinetMonitor
VAR_INPUT
rCabinetTemp : LREAL;
rHumidity : LREAL;
rTempWarnHigh : LREAL := 50.0;
rTempWarnLow : LREAL := 5.0;
rTempCritHigh : LREAL := 60.0;
rHumidHigh : LREAL := 85.0;
rHumidCrit : LREAL := 95.0;
END_VAR
VAR_OUTPUT
bTempHighWarn : BOOL;
bTempLowWarn : BOOL;
bTempHighCrit : BOOL;
bHumidWarn : BOOL;
bHumidCrit : BOOL;
eEnvStatus : eCabinetEnvStatus;
END_VAR
bTempHighWarn := (rCabinetTemp >= rTempWarnHigh) AND (rCabinetTemp < rTempCritHigh);
bTempLowWarn := rCabinetTemp <= rTempWarnLow;
bTempHighCrit := rCabinetTemp >= rTempCritHigh;
bHumidWarn := (rHumidity >= rHumidHigh) AND (rHumidity < rHumidCrit);
bHumidCrit := rHumidity >= rHumidCrit;
IF bTempHighCrit OR bHumidCrit THEN
eEnvStatus := eCabinetEnvStatus.CRITICAL;
ELSIF bTempHighWarn OR bTempLowWarn OR bHumidWarn THEN
eEnvStatus := eCabinetEnvStatus.WARNING;
ELSE
eEnvStatus := eCabinetEnvStatus.NORMAL;
END_IF;
7. System Health via SNMP
B&R SNMP Agent
B&R Automation Runtime includes an SNMP agent that can be enabled without Automation Studio by modifying configuration files on the CF card or via the web interface.
Configuration file: /CF1/System/SNMP/snmp.cfg (or via System > SNMP in the Automation Runtime web interface at http://<cpu-ip>).
brsnmp Tool
brsnmp (https://github.com/hilch/brsnmp) is a C++ Windows command-line tool that executes PVI-SNMP commands for B&R PLCs. It requires B&R PVI Development Setup (PVI 4.x or 6.5.2+) to be installed on the Windows machine. Download the pre-built binary from the GitHub releases page.
Basic usage:
brsnmp --list # List MAC addresses of all reachable B&R PLCs
brsnmp --filter=X20CP1584 --details # Get full properties (AR version, IP, serial, etc.)
brsnmp --filter=$LAST --ipAddress=192.168.1.50 # Set IP address (requires BOOT state)
Available SNMP OIDs
| OID (approximate) | Description | Type |
|---|---|---|
| 1.3.6.1.4.1.2706.1.1.4.1 | CPU model identification | STRING |
| 1.3.6.1.4.1.2706.1.1.4.2 | CPU firmware version | STRING |
| 1.3.6.1.4.1.2706.1.1.4.10 | CPU die temperature | INTEGER |
| 1.3.6.1.4.1.2706.1.1.4.11 | Housing temperature | INTEGER |
| 1.3.6.1.4.1.2706.1.1.4.20 | CPU load percentage | INTEGER |
| 1.3.6.1.4.1.2706.1.1.4.30 | Free memory (KB) | INTEGER |
| 1.3.6.1.4.1.2706.1.1.4.50 | Operating state | INTEGER |
| 1.3.6.1.4.1.2706.1.1.4.60 | Power supply status | INTEGER |
Note: Exact OIDs vary by firmware version. Use brsnmp --walk to discover available OIDs for your specific configuration.
Integration with External Monitoring
Zabbix template snippet:
UserParameter=br.cpu.temp.die,python3 /opt/brsnmp/brsnmp.py --host {$BR_IP} --community {$BR_COMMUNITY} --get cpu.temperature.die
UserParameter=br.cpu.temp.pcb,python3 /opt/brsnmp/brsnmp.py --host {$BR_IP} --community {$BR_COMMUNITY} --get cpu.temperature.pcb
UserParameter=br.cpu.load,python3 /opt/brsnmp/brsnmp.py --host {$BR_IP} --community {$BR_COMMUNITY} --get cpu.load
UserParameter=br.mem.free,python3 /opt/brsnmp/brsnmp.py --host {$BR_IP} --community {$BR_COMMUNITY} --get memory.free
Nagios check script (bash):
#!/bin/bash
CPU_IP="192.168.1.10"
COMMUNITY="public"
WARN=89
CRIT=105
DIE_TEMP=$(python3 /opt/brsnmp/brsnmp.py --host "$CPU_IP" --community "$COMMUNITY" --get cpu.temperature.die 2>/dev/null | awk '{print $NF}')
if [ -z "$DIE_TEMP" ]; then
echo "UNKNOWN - Cannot read CPU temperature"
exit 3
fi
if [ "$DIE_TEMP" -ge "$CRIT" ]; then
echo "CRITICAL - CPU die temperature ${DIE_TEMP}°C >= ${CRIT}°C"
exit 2
elif [ "$DIE_TEMP" -ge "$WARN" ]; then
echo "WARNING - CPU die temperature ${DIE_TEMP}°C >= ${WARN}°C"
exit 1
else
echo "OK - CPU die temperature ${DIE_TEMP}°C"
exit 0
fi
Prometheus exporter (Python):
from prometheus_client import start_http_server, Gauge
from prometheus_client.core import GaugeMetricFamily, REGISTRY
import time
import subprocess
CPU_TEMP_DIE = Gauge("br_cpu_temp_die_celsius", "B&R CPU die temperature")
CPU_TEMP_PCB = Gauge("br_cpu_temp_pcb_celsius", "B&R PCB temperature")
CPU_LOAD = Gauge("br_cpu_load_percent", "B&R CPU load percentage")
MEM_FREE = Gauge("br_mem_free_kb", "B&R free memory in KB")
def collect_br_metrics():
try:
result = subprocess.run(
["python3", "/opt/brsnmp/brsnmp.py",
"--host", "192.168.1.10",
"--community", "public",
"--walk", "system"],
capture_output=True, text=True
)
for line in result.stdout.strip().split("\n"):
if "cpu.temperature.die" in line:
CPU_TEMP_DIE.set(float(line.split()[-1]))
elif "cpu.temperature.pcb" in line:
CPU_TEMP_PCB.set(float(line.split()[-1]))
elif "cpu.load" in line:
CPU_LOAD.set(float(line.split()[-1]))
elif "memory.free" in line:
MEM_FREE.set(float(line.split()[-1]))
except Exception:
pass
if __name__ == "__main__":
start_http_server(9101)
while True:
collect_br_metrics()
time.sleep(15)
Enabling SNMP Without Automation Studio
- Access the CPU web interface at
http://<cpu-ip>. - Navigate to System > Settings > SNMP.
- Enable SNMP agent.
- Set community string (change from default “public”).
- Set allowed SNMP managers (IP addresses).
- Click Apply and reboot.
8. System Health via System Variables
RTInfo Function Block
RTInfo is a built-in B&R function block that provides comprehensive system runtime information. It is available in the Runtime library.
Instantiation and key variables:
VAR
fbRTInfo : RTInfo;
stRTInfo : RTInfoDataType;
END_VAR
fbRTInfo(
enable := TRUE,
pData := ADR(stRTInfo)
);
| Variable | Type | Description |
|---|---|---|
| stRTInfo.cpuLoad | UDINT | CPU load in 0.01% (5000 = 50.0%) |
| stRTInfo.memTotal | UDINT | Total memory in KB |
| stRTInfo.memFree | UDINT | Free memory in KB |
| stRTInfo.cycleTimeMin | UDINT | Minimum cycle time in microseconds |
| stRTInfo.cycleTimeMax | UDINT | Maximum cycle time in microseconds |
| stRTInfo.cycleTimeAvg | UDINT | Average cycle time in microseconds |
| stRTInfo.taskCount | UDINT | Number of active tasks |
| stRTInfo.uptime | ULINT | System uptime in seconds |
| stRTInfo.osVersion | STRING | Automation Runtime version |
LogIdleShow Function Block
LogIdleShow provides access to the system event log, including temperature warnings, power events, and watchdog triggers:
VAR
fbLogIdle : LogIdleShow;
sMessage : STRING(255);
bNewEntry : BOOL;
END_VAR
fbLogIdle(enable := TRUE);
IF fbLogIdle.newEntry THEN
sMessage := fbLogIdle.message;
bNewEntry := TRUE;
END_IF;
Comprehensive System Health ST Code
FUNCTION_BLOCK FB_SystemHealth
VAR_INPUT
fbRTInfoInst : RTInfo;
stRTInfoData : RTInfoDataType;
rCpuTemp : LREAL;
END_VAR
VAR_OUTPUT
rCpuLoadPct : LREAL;
rCycleTimeMaxUs : LREAL;
rMemFreeKB : LREAL;
rMemUsagePct : LREAL;
bCpuOverloaded : BOOL;
bMemLow : BOOL;
bCycleTimeHigh : BOOL;
bTempWarning : BOOL;
eHealthStatus : eSystemHealth;
END_VAR
VAR
rCpuLoadMax : LREAL := 80.0;
rMemLowPct : LREAL := 15.0;
rCycleMaxUs : LREAL := 0.0;
END_VAR
fbRTInfoInst(enable := TRUE, pData := ADR(stRTInfoData));
rCpuLoadPct := TO_LREAL(stRTInfoData.cpuLoad) / 100.0;
rCycleTimeMaxUs := TO_LREAL(stRTInfoData.cycleTimeMax);
rMemFreeKB := TO_LREAL(stRTInfoData.memFree);
rMemUsagePct := 100.0 - (rMemFreeKB / TO_LREAL(stRTInfoData.memTotal) * 100.0);
bCpuOverloaded := rCpuLoadPct >= rCpuLoadMax;
bMemLow := rMemFreeKB <= (TO_LREAL(stRTInfoData.memTotal) * rMemLowPct / 100.0);
bCycleTimeHigh := rCycleTimeMaxUs > rCycleMaxUs;
bTempWarning := rCpuTemp >= 89.0;
IF bCpuOverloaded OR bMemLow OR bTempWarning THEN
eHealthStatus := eSystemHealth.DEGRADED;
ELSE
eHealthStatus := eSystemHealth.HEALTHY;
END_IF;
Reading System Variables via PVI/OPC-UA
| Variable Path | Description | Type |
|---|---|---|
gApp.mpCPUcore0Temp | CPU die temperature | LREAL |
gApp.mpCPUpcbTemp | PCB temperature | LREAL |
gApp.rtInfo.cpuLoad | CPU load (via RTInfo) | UDINT |
gApp.rtInfo.memFree | Free memory (via RTInfo) | UDINT |
gApp.rtInfo.cycleTimeMax | Max cycle time (via RTInfo) | UDINT |
9. Proactive Health Monitoring Strategy
Temperature Trending and Baseline Establishment
Establish a baseline over the first 7-14 days of monitoring:
- Log CPU die temperature every 5 minutes to CSV on the CF card.
- Record ambient cabinet temperature simultaneously (X20CMR010 or separate sensor).
- Document the mounting orientation, cabinet ventilation status, and IO module configuration.
- Calculate the delta between ambient and die temperature for your specific installation.
- Set warning thresholds at baseline_peak + 15°C.
CSV Logging to CF Card
FUNCTION_BLOCK FB_CsvLogger
VAR_INPUT
sFileName : STRING;
arValues : ARRAY[0..9] OF LREAL;
bExecute : BOOL;
END_VAR
VAR
hFile : file STRING;
sLine : STRING;
i : DINT;
dtNow : DT;
sTimestamp : STRING;
END_VAR
IF bExecute THEN
bExecute := FALSE;
dtNow := CURRENT_DATETIME;
sTimestamp := DT_TO_STRING(dtNow);
sLine := sTimestamp;
FOR i := 0 TO 9 THEN
IF arValues[i] <> 0.0 THEN
sLine := CONCAT(sLine, ',');
sLine := CONCAT(sLine, LREAL_TO_STRING(arValues[i], 1));
END_IF;
END_FOR;
FileOpen(hFile, sFileName, FILE_MODE_APPEND);
FileWrite(hFile, sLine);
FileClose(hFile);
END_IF;
Anomaly Detection Approaches
| Method | Implementation | Detection Target |
|---|---|---|
| Static threshold | Simple comparison | Sudden spikes |
| Rate-of-change | (temp[n] - temp[n-1]) / interval | Fast heating (fan failure, blocked vent) |
| Rolling average deviation | temp - rolling_avg(temp, N) | Gradual drift (dust buildup, capacitor aging) |
| Daily pattern deviation | Compare current temp to same time yesterday | Seasonal change, HVAC failure |
ST Code: Rate-of-Change Temperature Detection
FUNCTION_BLOCK FB_TempRateDetector
VAR_INPUT
rCurrentTemp : LREAL;
tSampleTime : TIME := T#1M;
rMaxRate : LREAL := 5.0;
END_VAR
VAR_OUTPUT
bRapidRise : BOOL;
rRatePerMin : LREAL;
END_VAR
VAR
rPreviousTemp : LREAL;
tmrSample : TON;
END_VAR
tmrSample(IN := TRUE, PT := tSampleTime);
IF tmrSample.Q THEN
tmrSample(IN := FALSE);
rRatePerMin := (rCurrentTemp - rPreviousTemp) / 1.0;
bRapidRise := rRatePerMin > rMaxRate;
rPreviousTemp := rCurrentTemp;
END_IF;
Email/SNMP Alert Setup
For email alerts without mapp Mail (which requires licensing), use SNMP traps to an external NMS (Network Management System) that handles email dispatch:
snmptrap -v 2c -c trap_community 192.168.1.100 '' \
.1.3.6.1.4.1.2706.1.99.1 \
s "BR-CP1584" \
s "CPU temperature critical" \
i ${CPU_TEMP_DIE}
IIoT Dashboard Integration
For Grafana, Node-RED, or similar dashboards, expose CPU health data via OPC-UA or MQTT. See iiot-retrofit.md for the full IIoT retrofit architecture including:
- OPC-UA to MQTT bridge configuration
- Grafana dashboard templates for PLC health
- InfluxDB retention policies for long-term trending
- Edge gateway deployment for air-gapped networks
10. Thermal Management Remediation
Cabinet Ventilation Assessment
Quick assessment checklist:
| Check | Pass Criteria |
|---|---|
| Cabinet ventilation fans operating | All fans spinning, no unusual noise |
| Air filters clean | No visible dust accumulation, replace annually |
| Cabinet temperature within spec | <45°C at CPU location |
| Hot spots identified | Use IR thermometer at CPU, PS, VFD locations |
| Airflow path unobstructed | No cables blocking top/bottom vents |
| Cabinet door sealed | No gaps allowing hot air recirculation |
| External heat sources | No direct sunlight, furnaces, or VFDs adjacent |
Fan/Ventilation Upgrade Procedure
- Measure cabinet internal temperature with the door closed over 24 hours.
- If peak exceeds 45°C, calculate required airflow: Q = P / (1.1 * dT), where P = total heat load in watts, dT = allowable temperature rise above ambient.
- Select cabinet fans rated for the calculated CFM, with IP54 or better rating.
- Install fans to create positive pressure (push air in at bottom, exhaust at top).
- Verify after installation that cabinet temperature drops below 40°C at the CPU location.
Heat Sink Inspection
The X20CP1584 housing itself acts as the heat sink. Inspect for:
- Dust accumulation between housing fins (clean with compressed air, cabinet de-energized).
- Physical damage to fins (bent fins reduce surface area).
- Thermal interface material degradation (not user-serviceable on sealed units).
Cable Management
- Route all data cables to the sides of the cabinet, not in front of the CPU.
- Bundle power cables away from communication cables.
- Leave minimum 50mm clearance above and below the CPU module.
- Do not place IO modules that generate heat (relay outputs, analog outputs) directly adjacent to the CPU if alternatives exist.
Relocating Heat-Generating Equipment
If the cabinet contains VFDs, power supplies, or transformers, ensure they are mounted in the lower portion of the cabinet (heat rises) with a physical barrier separating them from the PLC section.
Emergency Cooling Measures
| Situation | Immediate Action |
|---|---|
| CPU >95°C, production ongoing | Open cabinet door, direct fan at CPU |
| CPU in SERVICE mode from thermal | Do not restart until ambient drops below 30°C, open cabinet |
| Repeated thermal faults | Shut down non-essential IO, reduce cycle rate, reduce IO module activity |
11. Cross-References
| Document | Relevance |
|---|---|
| system-variables.md | Complete list of B&R system variables accessible via IO mapping |
| custom-diagnostic-tools.md | Building diagnostic utilities for undocumented systems |
| pvi-api.md | PVI API reference for reading variables without AS project |
| opcua.md | OPC-UA server setup for data export |
| iiot-retrofit.md | IIoT dashboard integration for health monitoring |
| cp1584-hardware-ref.md | Detailed CP1584 hardware specifications and pinouts |
| io-card-hardware.md | X20 IO module current draws and thermal characteristics |
| execution-model.md | How cycle time relates to CPU load and thermal behavior |
12. Key Findings
-
Two sensors exist on every X20 CPU. Read both
mpCPUcore0TempandmpCPUpcbTempvia IO mapping. No extra hardware needed. This is the single most important action you can take today. -
110°C triggers hard shutdown (reset state). Per the official B&R X20CP1584 datasheet (V1.56), the CPU is switched to reset state at 110°C processor temperature or 95°C board temperature. Error 9204 (“PLC restart triggered by the PLC CPU’s temperature monitoring”) is logged. B&R may enter SERVICE mode at a lower temperature (estimated ~105°C) before the hard shutdown. If your CPU is entering SERVICE mode or resetting unexpectedly, check the die temperature first.
-
At 25°C ambient with proper mounting, expect 40-50°C die temperature. A reading of 70°C at 25°C ambient indicates a mounting or airflow problem, not a defective sensor.
-
Horizontal mounting gives you 10°C more headroom. The maximum ambient rating is 60°C horizontal vs 50°C vertical. Verify mounting orientation before adding modules.
-
Set warning threshold at 89°C. This provides 16°C of margin before the 105°C critical point, enough time for automated alerts and manual intervention.
-
The 1:10°C rule is your baseline calculator. For every 10°C increase in ambient, expect approximately 10°C increase in CPU die temperature. Use this to set ambient-aware thresholds.
-
X20CP1584 is fanless – do not add fans directly to it. Improve cabinet-level ventilation instead. The CPU housing fins are the heat sink; keep them clean.
-
Aging capacitors reduce hold-up time. If you experience unexplained warm restarts, especially during IO module switching, suspect capacitor degradation on the CPU module.
-
Use X20CMR010 for cabinet ambient monitoring. It costs under $200, requires zero programming (just IO mapping), and gives you humidity data that prevents condensation-related failures.
-
brsnmp (github.com/hilch/brsnmp) provides free SNMP integration. No B&R licensing required. Works with Zabbix, Nagios, Prometheus, or any SNMP-compatible NMS.
Key Findings
-
CPU critical temperature is 110°C, board critical temperature is 95°C. The CP1584 has two independent temperature sensors — the Intel Atom CPU die (critical at 110°C) and the PCB (critical at 95°C). The board sensor triggers first in most thermal scenarios.
-
The CP1584 is fanless and depends on cabinet ventilation. There is no internal fan. All cooling is passive through the CPU housing fins. Cabinet-level airflow is the only thermal management mechanism.
-
brsnmp provides free hardware monitoring without licensing. The community brsnmp tool reads CPU temperature, memory usage, task cycle times, and IO status via SNMP — no B&R mapp or OPC-UA licenses required.
-
Set warning thresholds at 89°C CPU / 75°C board. These provide adequate margin before critical thresholds and allow time for automated alerts and manual intervention.
-
Aging capacitors reduce power supply hold-up time. Unexplained warm restarts, especially during IO module switching, can indicate capacitor degradation on the CPU module’s power supply circuit.
-
Use X20CMR010 for cabinet ambient monitoring. This low-cost IO module provides ambient temperature and humidity readings with zero programming, preventing condensation-related failures.
13. Sources
- B&R Automation X20 System Hardware Manual (document WD102, various editions)
- B&R Automation Runtime Cyclic I/O Mapping Reference (B&R Help Center, help.br-automation.com)
- B&R X20CMR010/X20CMR011 Product Documentation (B&R Online Catalog)
- B&R RTInfo Function Block Reference (mapp Technology documentation)
- B&R Automation Runtime SNMP Configuration Guide (B&R Knowledge Base)
- hilch/brsnmp repository: https://github.com/hilch/brsnmp
- B&R Community Forum: X20 CPU temperature discussions (automation-talk.bbr.automation.com)
- Intel Atom N450/N455 Thermal Design Guide (Intel document 322960)
- IEC 61131-3 Programming Standard (IEC, various editions)
- OPC UA Specification (OPC Foundation, ua.opcfoundation.org)
- Practical user reports on X20CP1584 temperature readings in various mounting configurations (community-sourced)
- X20 Operating Conditions specifications: B&R X20 Hardware Catalog technical data tables
- B&R Power Supply Sizing Guidelines (application note AN141)
Building a Diagnostic Workstation for B&R PLC Systems
A properly equipped diagnostic workstation is the foundation for maintaining, troubleshooting, and reverse-engineering B&R CP1584 machines that have zero OEM documentation. This document specifies a complete hardware and software setup — including protocol analyzers, logic analyzers, oscilloscopes, CAN sniffers, POWERLINK sniffers, and software tools — along with a systematic diagnostic workflow checklist. The goal is to enable a single automation engineer to diagnose any problem on a legacy B&R system. Cross-references: physical-layer-sniffing.md for oscilloscope/logic analyzer techniques, cp1584-forensics.md for information extraction without project files, and first-60-minutes.md for the emergency recovery playbook.
1. Overview
1.1 The Diagnostic Workstation Concept
A diagnostic workstation is a self-contained hardware and software platform purpose-built for interrogating, monitoring, and troubleshooting B&R Automation CP1584 PLC systems that were deployed by OEMs no longer in business. Unlike ad-hoc troubleshooting where you scramble for cables, adapters, and software each time a machine goes down, a prepared workstation lets you walk up to any unknown CP1584 panel, connect in under five minutes, and begin systematic data extraction.
The core idea is separation of concerns: your diagnostic workstation is isolated from production networks, carries every adapter and tool you might need, and stores a library of captured configurations, firmware images, and protocol traces that accumulate value over time. Each new machine you diagnose adds to the knowledge base. Without a workstation, each engagement starts from zero.
1.2 Why Dedicated Tools Beat Ad-Hoc Troubleshooting
| Problem | Ad-Hoc Approach | Workstation Approach |
|---|---|---|
| Network discovery | Guess IPs, unplug production devices | Dedicated NIC, preconfigured subnet scanner |
| Protocol capture | Install Wireshark, find plugins, configure | POWERLINK profile loaded, capture filters ready |
| CAN diagnostics | Borrow adapter from another project | PCAN-USB in bag, PCAN-View configured |
| CF card work | Pull card, find reader, find imaging software | CF slot or USB reader, dd/win32diskimager ready |
| Serial console | Hunt for RS232 adapter, find terminal app | FDI cable in case, PuTTY profile saved |
| Documentation | Handwritten notes, lost in weeks | Structured templates, version-controlled in repo |
1.3 Cost Justification for a One-Man Automation Team
A fully equipped diagnostic workstation costs between $3,500 and $8,000 depending on how many optional items you include. Compare this to a single service call for an unknown machine: 8 hours at $150/hour is $1,200, and without the right tools you may need two or three visits. The workstation pays for itself after 3-4 unknown-machine engagements. Beyond payback, the accumulated protocol traces and configuration backups become an irreplaceable asset that no amount of on-site time can recreate.
Budget tiers:
| Tier | Cost Range | Coverage |
|---|---|---|
| Minimal | $1,500-2,500 | Laptop + Ethernet + Wireshark + AS eval + serial adapter + multimeter |
| Standard | $3,000-5,000 | Above + oscilloscope + CAN adapter + logic analyzer + PVI tools |
| Full | $6,000-8,000 | Above + all optional items + portable case + spares |
2. Workstation Hardware – Essential Equipment
2.1 Laptop/PC Requirements
Automation Studio (AS) is the primary constraint. AS runs exclusively on Windows (no Linux, no macOS native). B&R officially supports Windows 10 and Windows 11; Windows 7 reached end-of-support in AS 4.5+. Virtual machines work but add latency and complicate driver installation for network adapters and CAN hardware.
Minimum Specifications
| Component | Minimum | Rationale |
|---|---|---|
| CPU | Intel Core i5-8250U or equivalent | AS compiles, downloads, and cross-references large projects |
| RAM | 8 GB | AS alone consumes 2-3 GB; add Wireshark + browser and you are at 6 GB |
| Storage | 50 GB free on SSD | AS installation is 15-20 GB; CF card images are 2-8 GB each |
| OS | Windows 10 64-bit (21H2+) | AS 4.5+ requires 64-bit OS |
| Ethernet | 1x Gigabit RJ45 | PLC connection; must be separate from Wireshark capture NIC if possible |
| USB | 3x USB 3.0 ports | CAN adapter, logic analyzer, serial adapter simultaneously |
| Display | 1920x1080 minimum | AS UI requires horizontal space for multiple panels |
Recommended Specifications
| Component | Recommended | Rationale |
|---|---|---|
| CPU | Intel Core i7-11800H or i7-1370P | Faster compile times; handles VM + AS simultaneously |
| RAM | 16 GB | Comfortable headroom for AS + Wireshark + OPC-UA client + browser |
| Storage | 512 GB NVMe SSD | Fast CF card imaging; room for 50+ card images and protocol captures |
| Ethernet | 2x Gigabit RJ45 (Intel I210 or I225) | One port for PLC connection, one for Wireshark capture |
| USB | 1x USB-C with PD + 3x USB-A | Flexibility for modern adapters |
| Display | 15.6“ 1920x1080 IPS or 17.3“ | Larger screen reduces window management overhead |
Recommended Laptop Models
| Model | Approx. Cost | Notes |
|---|---|---|
| Lenovo ThinkPad T14 Gen 4 (i7, 16GB, 512GB) | $1,200-1,600 | Intel I219-V NIC, excellent Linux compatibility for dual-boot |
| Dell Latitude 5540 (i7, 16GB, 512GB) | $1,100-1,500 | Good port selection, Intel I225-V NIC |
| Panasonic Toughbook 55 (semi-rugged) | $2,500-3,500 | For harsh environments; costs more but survives drops |
These models were current as of mid-2026. For newer purchases, prioritize: Intel I210 or I225-V NIC, minimum 16 GB RAM, Windows 11 64-bit, and at least two USB 3.0 ports.
Automation Studio Version Strategy
B&R ties Automation Studio versions to Automation Runtime (AR) versions. A CP1584 may run AR 4.x. You need AS compatibility:
| Target AR Version | Required AS Version | Notes |
|---|---|---|
| AR 4.10-4.14 | AS 4.10+ | Current generation |
| AR 4.70-4.90 | AS 4.7-4.9 | Common on CP1584 units from 2018-2022 |
| AR 4.50-4.66 | AS 4.5-4.6 | Older CP1584 deployments |
| AR 4.10-4.40 | AS 4.1-4.4 | Legacy; may need older AS installation |
Strategy: Install the newest AS version you can license. It has backward compatibility to open older projects. If you encounter a project that requires an older AS version, install that version in a VM. Maintain at least two AS versions on the workstation.
Virtual Machine Considerations
If you need to run an older AS version or want a Linux side for Wireshark/Sigrok/SocketCAN:
- VMware Workstation Player (free for non-commercial) or VirtualBox (free)
- Allocate 4 CPU cores, 8 GB RAM, 80 GB disk to the VM
- Pass through USB devices (CAN adapter, logic analyzer) to the VM
- Network bridging for PLC access from VM
- Snapshot the VM after AS installation so you can revert cleanly
Hard Drive Imaging Strategy for CF Card Work
CF cards in B&R systems use a custom partition layout. You will need to:
- Read CF cards with industrial-grade readers (not cheap camera readers)
- Create full binary images with dd, Win32 Disk Imager, or Clonezilla
- Store images with metadata: machine ID, date, firmware version, AR version
- Maintain a library of known-good images for common configurations
- Write images back to replacement CF cards for recovery
Recommended CF card reader: Transcend TS-RDF8K (USB 3.0, supports CF, SD, microSD) or a dedicated PCMCIA/CF adapter for direct slot access.
2.2 Network Tools
Dedicated Ethernet NIC for PLC Connection
The Intel I210 and I225-V are the gold standard for industrial Ethernet work. They have reliable driver support, work with Wireshark in promiscuous mode, and handle the precise timing required for POWERLINK analysis.
| Adapter | Interface | Cost | Notes |
|---|---|---|---|
| Intel I219-V (integrated on most business laptops) | RJ45 | Included | Adequate for basic PLC connection |
| StarTech USB3.0 to Gigabit Ethernet (ST3300GU3) | USB 3.0 | $35 | Good backup; uses ASIX or Realtek chipset |
| Intel I210-T1 (PCIe or USB3 enclosure) | RJ45 | $40-70 | Best choice for Wireshark capture NIC |
| TP-Link USB 3.0 to Gigabit Ethernet (UE300) | USB 3.0 | $20 | Budget option; Realtek RTL8153 chipset |
For POWERLINK sniffing, you need a NIC that supports promiscuous mode reliably. Intel chipsets are the safest bet. Realtek chipsets sometimes drop packets under high POWERLINK traffic loads.
Network Switch Requirements
| Feature | Requirement | Reason |
|---|---|---|
| Speed | 100 Mbps minimum | POWERLINK operates at 100 Mbps; Gigabit switches must auto-negotiate correctly |
| Ports | 5-8 ports unmanaged or 8-16 managed | Enough for PLC, workstation, and tap points |
| Mirroring | Port mirroring (managed switch) | Essential for Wireshark POWERLINK capture without inline tap |
| Power | PoE optional | Not needed for PLC connection but useful for IP cameras |
Recommended switch: Netgear GS105E (5-port, managed, $45) or Cisco SG250-08 (8-port, fully managed, $150). The managed switch with port mirroring is strongly recommended for POWERLINK diagnostics.
Ethernet Cables and Adapters
| Item | Spec | Cost | Qty |
|---|---|---|---|
| Cat5e patch cables (assorted lengths) | 1m, 3m, 5m, 10m | $3-8 each | 8 |
| Cat5e crossover cable | MDI-X crossover | $5 | 2 |
| RJ45 coupler (female-female) | Cat5e rated | $2 | 4 |
| USB-C to Ethernet adapter | Gigabit | $15-25 | 1 |
| Ethernet loopback plug | RJ45 | $5 | 1 |
2.3 Oscilloscope
Why an Oscilloscope for PLC Diagnostics
An oscilloscope is indispensable for diagnosing analog signal problems (0-10V, 4-20mA sensors), verifying encoder signals (A/B quadrature), checking POWERLINK physical layer integrity, analyzing CAN bus signal quality, and debugging X2X bus timing issues. Without one, you are guessing at electrical problems.
Recommended Oscilloscope Models
| Model | Channels | Bandwidth | Sample Rate | Cost | Notes |
|---|---|---|---|---|---|
| Rigol DS1054Z | 4 | 100 MHz | 1 GSa/s | $400-600 | Best value; hackable to DS1104Z; LAN + USB |
| Siglent SDS1104X-E | 4 | 100 MHz | 1 GSa/s | $450-650 | Similar to Rigol; 16 digital channels optional |
| Rigol DS1054Z Plus | 4 | 100 MHz | 1 GSa/s | $500-700 | Newer firmware; better UI |
| Keysight DSOX1102G | 2 | 100 MHz | 1 GSa/s | $650-900 | 2-channel; Keysight quality; LAN |
| Rigol DS1204Z-E | 4 | 200 MHz | 1 GSa/s | $700-900 | Higher bandwidth for fast edge analysis |
The Rigol DS1054Z is the consensus recommendation for automation diagnostics. Four channels let you monitor two differential signals simultaneously (e.g., CAN-H and CAN-L plus a trigger signal). The 100 MHz bandwidth covers all signals you will encounter on a B&R system.
High-End Option
For teams that need deeper analysis (power electronics, high-frequency EMC, motor drive waveforms):
| Model | Channels | Bandwidth | Cost | Notes |
|---|---|---|---|---|
| Keysight DSOX3014T | 4 | 200 MHz | $3,500-5,000 | Touchscreen, protocol decode, built-in LAN |
| Tektronix MDO34 | 4 analog + 16 digital | 200 MHz | $5,000-8,000 | Mixed signal; integrated spectrum analyzer |
Probe Requirements
| Probe Type | Specification | Cost | Use Case |
|---|---|---|---|
| 10x passive probe | 100 MHz, 10 MOhm | Included with scope | General purpose signal measurement |
| Differential probe | 100 MHz, CAT III | $200-400 | CAN bus (CAN-H vs CAN-L), X2X differential signals |
| Current probe | AC/DC clamp, 100A | $150-300 | Motor current, power supply draw |
| BNC to alligator clip adapter | Generic | $5 | Quick connections to terminal blocks |
A differential probe is the single most important accessory beyond the included passive probes. It lets you safely measure CAN-H and CAN-L relative to each other without ground-reference problems that plague single-ended measurements on differential buses.
Oscilloscope Use Cases for B&R Diagnostics
- POWERLINK physical layer: Verify 100BASE-TX signal quality at the PLC RJ45 port. Look for jitter, amplitude droop, and retransmissions.
- CAN bus signal integrity: Check CAN-H and CAN-L differential voltage (should be 1.5-2.5V differential in dominant state). Identify reflections from improper termination.
- Analog sensor verification: Confirm 4-20mA loop current, 0-10V sensor output, and identify noise sources.
- Encoder signal analysis: Verify A/B quadrature timing, index pulse, and count accuracy.
- X2X bus timing: Measure clock, data, and enable signal relationships on the X2X flat cable bus.
- Power supply ripple: Check 24V supply stability, measure ripple under load.
2.4 Logic Analyzer
Why a Logic Analyzer
Logic analyzers capture digital signals with high channel count and precise timing. For B&R diagnostics, the primary use case is X2X protocol analysis (8-16 digital lines) and SPI/I2C bus debugging on IO modules. They complement oscilloscopes: the scope gives you analog detail on a few channels, the logic analyzer gives you digital timing on many channels.
Recommended Logic Analyzer Models
| Model | Channels | Sample Rate | Max Voltage | Cost | Notes |
|---|---|---|---|---|---|
| Saleae Logic 8 | 8 | 100 MSa/s | 5V | $500 | Excellent software; protocol decode library |
| Saleae Logic Pro 16 | 16 | 500 MSa/s | 5V | $1,500 | 16 channels essential for X2X analysis |
| Sigrok/PulseView + generic 8CH LA | 8 | 24 MSa/s | 5V | $10-30 | Budget option; open source software |
| Sigrok/PulseView + DreamSourceLab DSLogic | 16 | 400 MSa/s | 5V | $100-200 | Open hardware + software; good value |
Channel Count Requirements
| Protocol | Minimum Channels | Recommended Channels |
|---|---|---|
| X2X (B&R proprietary) | 8 (data + clock + frame) | 16 (full bus decode) |
| SPI | 4 (MOSI, MISO, SCLK, CS) | 4 |
| I2C | 2 (SDA, SCL) | 2 (+ additional CS lines) |
| UART | 1 (TX or RX) | 2 (TX + RX) |
| CAN (digital) | 1 (CAN-H or CAN-L) | 2 (CAN-H + CAN-L) |
| Parallel IO | 8 | 16+ |
For X2X analysis, 16 channels is strongly recommended. The X2X bus uses a flat cable with up to 16 data lines plus clock and frame signals. With only 8 channels you cannot capture the full bus transaction.
Protocol Decoding Support
| Protocol | Saleae Software | Sigrok/PulseView |
|---|---|---|
| SPI | Yes | Yes |
| I2C | Yes | Yes |
| UART/RS232 | Yes | Yes |
| CAN | Yes (with CAN analyzer input) | Yes (via GPIO) |
| 1-Wire | Yes | Yes |
| Custom/async | Yes (async analyzer) | Yes |
For X2X protocol, neither Saleae nor Sigrok has a built-in decoder. You will need to define a custom protocol or export raw captures and decode with Python. See x2x-protocol.md for X2X frame format details.
Use Cases
- X2X bus sniffer: Connect to the flat cable header on a B&R IO module, capture bus traffic, decode frame structure.
- SPI flash reading: Read configuration data from SPI flash chips on IO modules or interface boards.
- Digital IO timing: Verify sensor response times, output switching delays, and watchdog timeout behavior.
- Custom protocol reverse engineering: Capture undocumented serial protocols between PLC and proprietary peripherals.
2.5 CAN Bus Tools
Why CAN Tools
B&R systems use CANopen extensively through modules like the IF2772 (CANopen interface module). Many OEM machines also have CAN buses for auxiliary devices (drives, sensors, HMIs). Without a CAN adapter, you are blind to this communication layer.
Recommended CAN Adapters
| Adapter | Interface | Channels | Cost | Software |
|---|---|---|---|---|
| PEAK PCAN-USB | USB 2.0 | 1 | $150-200 | PCAN-View (free), PCAN-Basic API |
| PEAK PCAN-USB FD | USB 2.0 | 1 CAN-FD | $300-400 | Same as above + CAN-FD support |
| PEAK PCAN-USB Pro FD | USB 2.0 | 2 CAN-FD | $500-600 | Dual channel for gateway sniffing |
| Kvaser Leaf Light HS v2 | USB | 1 | $300-350 | Kvaser CANlib |
| Kvaser Memorator Pro 5xHS | USB | 5 | $1,500+ | Logging + real-time |
The PEAK PCAN-USB is the recommended starting point. It is affordable, well-supported on Windows, and PCAN-View provides immediate CAN bus monitoring without additional software cost.
Professional CAN Software
| Software | Cost | Platform | Notes |
|---|---|---|---|
| PCAN-View | Free with PEAK adapter | Windows | Basic TX/RX, trace, signal decode |
| CANalyzer (Vector) | $3,000-8,000 | Windows | Industry standard; database import, scripting |
| CANoe (Vector) | $5,000-15,000 | Windows | Full simulation + analysis; overkill for most diagnostics |
| CANtrace (CSS Electronics) | $200-500 | Windows | Mid-range; good trace analysis |
For diagnostic work, PCAN-View is usually sufficient. If you need to simulate CAN nodes or build automated test sequences, CANalyzer becomes justified.
Linux Alternative: SocketCAN
For Linux-based workstations or Raspberry Pi field tools:
sudo apt install can-utils
sudo ip link set can0 up type can bitrate 500000
candump can0
cansend can0 123#1122334455667788
canplayer -I can0_log
PEAK PCAN adapters have Linux kernel support (peak-linux-driver). Kvaser also provides Linux drivers.
CAN Physical Layer Components
| Item | Specification | Cost | Qty |
|---|---|---|---|
| CAN DB9 to DB9 cable | 2m, 120-ohm terminated | $15 | 2 |
| DB9 T-connector with termination | 120-ohm | $10 | 4 |
| DB9 to open-wire adapter | Screw terminals | $8 | 4 |
| 120-ohm terminating resistor | DIP or solder | $2 | 6 |
| CAN-H/CAN-L breakout board | Indicator LEDs | $5 | 2 |
2.6 POWERLINK Sniffing Setup
Why POWERLINK Sniffing
Ethernet POWERLINK (EPL) is B&R’s real-time Ethernet protocol used for communication between CP1584 PLCs, IO modules, drives, and HMIs. The protocol runs on standard Ethernet hardware but uses a managed cycle. Without sniffing capability, you cannot diagnose communication errors, timing problems, or identify the nodes on the network.
Wireshark + POWERLINK Plugin
Wireshark is the primary tool for POWERLINK capture. The POWERLINK dissector plugin is maintained by the openPOWERLINK community.
Setup procedure:
- Install Wireshark 3.x or 4.x (latest stable)
- Download the openPOWERLINK Wireshark dissector from the openPOWERLINK project on SourceForge or GitHub
- Place the dissector DLL (on Windows:
powerlink.dll) in the Wireshark plugins directory:C:\Program Files\Wireshark\plugins\4.x\(adjust for your version)
- Restart Wireshark
- Verify: open Edit > Preferences > Protocols, search for “POWERLINK”
The dissector decodes:
- Start of Cycle (SoC) frames
- Poll Request / Poll Response pairs
- Node-to-node communication
- ASnd (asynchronous send) frames
- Error frames and timeout indicators
Capture Hardware Requirements
POWERLINK operates at 100 Mbps with precise timing. Reliable capture requires:
- A dedicated Ethernet NIC not used for any other traffic
- Promiscuous mode support
- No offloading features (disable checksum offload, TCP segmentation offload)
- A managed switch with port mirroring OR a network tap
| Method | Equipment | Pros | Cons |
|---|---|---|---|
| Port mirroring | Managed switch ($45-150) | Non-invasive, no packet loss | Some switches modify timestamps or reorder packets |
| Network tap | Ethernet tap ($30-80) | Guaranteed no modification | Requires inline placement; extra cables |
| Promiscuous on same NIC | Single NIC | No extra hardware | Misses traffic while workstation sends; no full-duplex capture |
| Dual NIC (one capture, one control) | Two NICs or USB-Ethernet | Full-duplex capture | More hardware; driver complexity |
Recommended approach: managed switch with port mirroring. Mirror the PLC port to the capture NIC. This is non-invasive and captures all traffic including broadcasts.
NIC Configuration for Capture
On the capture NIC, disable all offloading features to prevent packet manipulation:
Windows (via Device Manager > Advanced):
- Disable “Checksum Offload”
- Disable “Large Send Offload”
- Disable “TCP Checksum Offload”
- Disable “UDP Checksum Offload”
- Disable “Interrupt Moderation”
Linux (via ethtool):
sudo ethtool -K eth0 rx off tx off gso off gro off tso off
sudo ethtool -C eth0 rx-usecs 0 rx-frames 0
See powerlink-internals.md for POWERLINK frame structure details.
2.7 Serial Communication Tools
Why Serial Tools
B&R PLCs have serial ports (RS232 on the CP1584 front panel, RS485 on some IO modules) used for Modbus communication, printer output, legacy device connections, and sometimes the system console. Many OEM machines use serial protocols that are undocumented.
RS232/RS485 USB Adapters
| Adapter | Chipset | Interface | Cost | Notes |
|---|---|---|---|---|
| FTDI FT232RL cable | FTDI FT232RL | USB-RS232 | $12-20 | Gold standard; most reliable driver support |
| FTDI FT234XD breakout | FTDI FT234XD | USB-TTL | $10-15 | For direct TTL-level connections (3.3V/5V) |
| FTDI USB-RS485-WE | FTDI FT232R + RS485 transceiver | USB-RS485 | $25-35 | Integrated 120-ohm termination |
| Prolific PL2303-based | Prolific | USB-RS232 | $5-10 | Avoid; driver issues on Windows 10/11 |
| CH340-based | CH340 | USB-RS232 | $4-8 | Works but marginal; no galvanic isolation |
Always buy FTDI chipset adapters. Prolific and CH340 have driver instability problems that will waste your time during diagnostics.
RS485 Non-Invasive Tapping
To monitor an existing RS485 bus without disrupting it:
| Method | Equipment | Cost | Notes |
|---|---|---|---|
| RS485 Y-cable tap | Custom Y-cable with 3 connectors | $15-25 | One male, two female DB9 |
| RS485 breakout board with tap | Screw terminal breakout | $10-15 | Solder wires in parallel to D+ and D- |
| Industrial RS485 tap | ProfiTap or similar | $50-100 | Galvanically isolated; safest option |
The Y-cable approach works but is invasive (requires unplugging). The breakout board soldered in parallel is the practical approach for one-man teams. See serial-diagnostics.md for detailed procedures.
RS232 Monitoring Y-Cable
For RS232 TX/RX monitoring without disrupting communication, build a Y-cable:
Device TX ---[1k resistor]---+--- Monitor RX
|
Device RX ---------------+--- Monitor TX
|
Ground ------------------+
The 1k resistor on the TX tap prevents the monitor from loading the TX line. This lets you passively sniff RS232 communication.
2.8 Multimeter and Hand Tools
Recommended Multimeter
| Model | Cost | Key Features |
|---|---|---|
| Fluke 87V | $350-450 | True-RMS, 1000V CAT IV, data logging, temperature |
| Fluke 117 | $200-280 | Non-contact voltage detection, CAT III 600V |
| Keysight U1242C | $250-350 | Handheld, data logging, IR temperature |
The Fluke 87V is the industrial standard. Its data logging mode (records up to 10,000 readings) is useful for recording voltage trends over time during machine operation. The temperature probe accessory measures ambient and surface temperatures for thermal diagnostics.
Additional Electrical Test Equipment
| Item | Specification | Cost | Use Case |
|---|---|---|---|
| Insulation resistance tester (megger) | 250V/500V/1000V test voltages | $200-400 | Ground insulation testing; verify PE conductor integrity |
| Clamp meter (AC/DC current) | DC + AC, 400A range | $150-300 | Measure ground currents, motor current, supply loading |
| Ground bond tester | 25A/30A continuity test | $300-600 | Verify protective earth connections |
| Loop resistance tester | 4-wire Kelvin measurement | $200-400 | Measure contact resistance in terminals and connectors |
Ground current measurement with a clamp meter is critical for diagnosing EMC problems. See grounding-emc.md for procedures.
Hand Tools
| Item | Specification | Cost |
|---|---|---|
| Terminal screwdriver set | Wera 050 or Wiha slim | $40-60 |
| Wire crimper (Ferrules) | 0.5-16mm2 ferrule crimper | $30-50 |
| Wire strippers | Knipex 12 16 185 | $25-35 |
| Insulation displacement tool (IDC) | For B&R X2X flat cable | $15-25 |
| CF card reader | USB 3.0, CF Type I/II | $20-40 |
| USB-TTL serial adapter | FTDI FT232RL 3.3V | $10-15 |
| Label maker | Brother P-Touch | $50-80 |
| Fiber optic cleaning kit | LC/SC cleaning | $30-50 |
2.9 Physical Layer Tools
CAN Physical Layer
| Item | Specification | Cost | Qty |
|---|---|---|---|
| DB9 T-connector with 120-ohm termination | CAN standard | $10 | 4 |
| DB9 pass-through terminator | Switchable 120-ohm | $15 | 2 |
| DB9 to flying leads adapter | Screw terminals | $8 | 4 |
| CAN bus oscilloscope test points | BNC adapters | $5 | 2 |
Ethernet Testing
| Item | Specification | Cost | Qty |
|---|---|---|---|
| Ethernet cable tester | RJ45 continuity + wiring | $15-25 | 1 |
| Network cable certifier (optional) | Fluke MicroScanner or equivalent | $400-800 | 1 |
| RJ45 crimper + connectors | Cat5e RJ45, strain relief boots | $30-50 | 1 set |
EMC Investigation Tools
| Item | Specification | Cost | Notes |
|---|---|---|---|
| DIY near-field probe | Ferrite core + coax cable | $5-10 | Detect radiated emissions from cables and modules |
| Current probe (HF) | 100 kHz-1 GHz | $200-400 | Measure common-mode currents on cables |
| PMR radio (walkie-talkie) | 446 MHz | $30-60 | Quick EMC proximity test; crackling indicates poor shielding |
The DIY near-field probe is made from a small ferrite bead (Material 43 or similar) with a short length of coax cable:
Cut coax to 10cm. Strip one end, wrap 3-4 turns around ferrite bead.
Connect other end to BNC. Use with spectrum analyzer or scope
set to 1 MOhm input, 20 MHz bandwidth.
See physical-layer-sniffing.md for detailed EMC measurement procedures.
3. Software Tool Suite
3.1 Automation Studio
Version Selection
Install the version that covers the widest range of AR versions you expect to encounter. For CP1584 systems, AS 4.7+ covers most deployments from 2016 onward.
| Deployment Era | Typical AR Version | AS Version Needed |
|---|---|---|
| 2013-2015 | AR 4.10-4.20 | AS 4.2-4.3 |
| 2016-2018 | AR 4.30-4.50 | AS 4.4-4.5 |
| 2018-2020 | AR 4.60-4.80 | AS 4.7-4.8 |
| 2020-2023 | AR 4.80-4.14 | AS 4.8-4.10 |
| 2023+ | AR 4.14+ | AS 4.10+ |
Strategy: Install AS 4.10 as primary (covers AR 4.10+). Keep AS 4.5 in a VM for legacy systems.
Service Contract and Licensing
- B&R Automation Studio requires a service contract for updates and full features
- Without a service contract, you can use the last version released before your contract expired
- Evaluation licenses are available (30 days, extendable by request) for initial assessment
- For a diagnostic workstation, consider a shared license pool if your organization has multiple B&R users
Installation on Diagnostic Workstation
- Install Windows 10/11 clean install (avoid bloatware)
- Install Automation Studio (run installer as Administrator)
- Install target AR versions via the AS Update Manager
- Install mapp Technology packages if needed
- Configure AS network settings for the dedicated PLC NIC
- Create a default project template for new machine diagnostics
- Set AS default directory to a dedicated work folder (not My Documents)
3.2 Wireshark
POWERLINK Dissector Installation
Detailed in Section 2.6. Key configuration steps:
- Install Wireshark from wireshark.org (not Microsoft Store version)
- Install Npcap when prompted (packet capture driver)
- Download openPOWERLINK dissector from openPOWERLINK GitHub releases
- Copy
powerlink.dlltoC:\Program Files\Wireshark\plugins\<version>\ - Verify dissector loads: Wireshark > About > Plugins, search for POWERLINK
Capture Filter Profiles for B&R Protocols
Create custom capture profiles for common scenarios:
POWERLINK capture filter:
ether proto 0x88ab
This filters for the POWERLINK ethertype (0x88AB).
CAN bus capture (via PCAN or SocketCAN):
(no display filter needed; CAN frames are already isolated by interface)
Modbus TCP capture filter:
tcp port 502
OPC-UA capture filter:
tcp port 4840
FTP capture filter (for CF card access):
tcp port 21 or tcp port 20
SDM (Service and Diagnosis Manager) capture filter:
tcp port 11159
Display Filters
POWERLINK node filter:
powerlink.node_id == 0x01
POWERLINK error frames:
powerlink.type == error
Modbus exceptions:
modbus.exception_code > 0
3.3 OPC-UA Clients
UaExpert (Free)
UaExpert by Unified Automation is the most capable free OPC-UA client:
- Browse server address space
- Read/write variables
- Subscribe to monitored items
- Call methods
- Historical data access
- Export node definitions
Connection to B&R OPC-UA server:
- In Automation Studio, enable OPC-UA server in the PLC configuration
- Set the endpoint URL (typically
opc.tcp://<PLC-IP>:4840) - Configure security policy (None for diagnostics, or Basic256Sha256 for production)
- In UaExpert, add server endpoint, connect, browse namespace
Python asyncua
import asyncio
from asyncua import Client
async def main():
url = "opc.tcp://192.168.1.10:4840"
async with Client(url=url) as client:
root = client.nodes.root
children = await root.get_children()
for child in children:
print(f" {child.browse_name}: {await child.get_display_name()}")
var = client.get_node("ns=2;s=SystemVariables.MachineStatus")
value = await var.read_value()
print(f"Machine status: {value}")
asyncio.run(main())
See opcua.md for detailed OPC-UA configuration and advanced patterns.
Node-RED OPC-UA Nodes
Node-RED provides a visual programming environment with OPC-UA nodes:
- Install Node-RED:
npm install -g node-red - Install OPC-UA package:
cd ~/.node-red && npm install node-red-contrib-opcua - Configure OPC-UA server endpoint in the node
- Build flow: Read variable -> Transform -> Display/Log/Alert
3.4 PVI Tools
PVI Development Setup
PVI (Process Visualization Interface) is B&R’s proprietary communication protocol. The PVI Development Setup provides:
- PVI Manager (connection configuration)
- PVI Transfer (data transfer with PLC)
- PVI API (C/C++ library for custom applications)
Download from B&R website (requires service contract or registration). Install on the diagnostic workstation alongside Automation Studio.
brsnmp
brsnmp (github.com/hilch/brsnmp) is an open-source C++ Windows command-line tool for executing PVI-SNMP commands against B&R PLCs. It requires B&R PVI Development Setup (PVI 4.x or 6.5.2+) to be installed. Download the binary from the GitHub releases page.
brsnmp --list # List all B&R PLCs on the network
brsnmp --filter=X20CP1584 --details # Get detailed info for specific model
brsnmp --filter=$LAST --ipAddress=192.168.1.50 # Set IP (use $LAST to reuse previous filter)
This is invaluable for quick system information extraction when you do not have Automation Studio available.
Python PVI Wrapper (Pvi.py)
Community Python wrapper around the PVI COM interface:
from pvi import PviConnection, PviVariable
conn = PviConnection('192.168.1.10')
var = PviVariable(conn, 'MainProgram.Status')
value = var.read()
print(f"Status: {value}")
See pvi-api.md for complete PVI configuration and Python wrapper documentation.
3.5 Serial Communication Software
| Software | Platform | Cost | Key Features |
|---|---|---|---|
| PuTTY | Windows/Linux/Mac | Free | SSH, Telnet, serial; scriptable |
| Tera Term | Windows | Free | Serial with macro scripting; log capture |
| RealTerm | Windows | Free | Hex display, bridge mode, embedded scripting |
| Docklight | Windows | $100-200 | Protocol-level analysis, scripting, responses |
| HTerm | Windows | Free | Similar to RealTerm; clean interface |
| Saleae Logic Software | Windows/Mac/Linux | Free with hardware | Protocol decode for serial captured via logic analyzer |
Recommended: Tera Term for interactive serial communication (macro scripting lets you automate common queries). RealTerm for binary/hex analysis. Saleae Logic for capturing and decoding serial protocols electrically.
Tera Term serial configuration for B&R default settings:
Baud rate: 9600 or 19200 (check PLC configuration)
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None
Terminal: VT or ANSI
See serial-diagnostics.md for comprehensive serial diagnostic procedures.
3.6 Python Environment
Installation
Use Python 3.8+ (3.10 or 3.11 recommended for best library compatibility). Install via python.org or conda.
Key Packages
| Package | Purpose | Install Command |
|---|---|---|
| asyncua | OPC-UA client/server | pip install asyncua |
| pymodbus | Modbus TCP/RTU client/server | pip install pymodbus |
| pyserial | Serial port communication | pip install pyserial |
| paho-mqtt | MQTT client | pip install paho-mqtt |
| scapy | Packet manipulation and capture | pip install scapy |
| numpy | Numerical analysis | pip install numpy |
| pandas | Data analysis and CSV handling | pip install pandas |
| matplotlib | Plotting and visualization | pip install matplotlib |
| jupyter | Interactive notebooks | pip install jupyter |
| can | CAN bus (SocketCAN, PCAN, etc.) | pip install python-can |
Virtual Environment Setup
python -m venv C:\br-diagnostics\venv
C:\br-diagnostics\venv\Scripts\activate
pip install -r requirements.txt
Create a requirements.txt file listing all packages. Pin versions for reproducibility.
Jupyter Notebooks
Jupyter notebooks are ideal for interactive protocol analysis. Example workflow:
- Capture protocol data (Wireshark export to CSV/JSON)
- Load into Jupyter notebook
- Parse and visualize using pandas/matplotlib
- Extract patterns, identify anomalies
- Document findings inline with code
See python-diagnostics.md for complete Python diagnostic tool library.
3.7 Network Utilities
| Tool | Platform | Purpose | Cost |
|---|---|---|---|
| nmap | Windows/Linux/Mac | Network discovery, port scanning | Free |
| Advanced IP Scanner | Windows | Network device discovery | Free |
| Wireshark | Windows/Linux/Mac | Protocol capture and analysis | Free |
| PCAN-View | Windows | CAN bus monitoring | Free with PEAK adapter |
| arp-scan | Linux | ARP-based device discovery | Free |
| Angry IP Scanner | Windows/Linux/Mac | Fast IP range scanner | Free |
| Fiddler | Windows | HTTP/HTTPS debugging | Free |
| Putty | Windows | SSH/Serial/Telnet | Free |
nmap Quick Reference for B&R Discovery
Discover B&R PLCs on a network:
nmap -sn 192.168.1.0/24
nmap -p 21,80,11159,4840,502 192.168.1.0/24
nmap -O 192.168.1.0/24
Port signatures for B&R systems:
| Port | Service | Protocol |
|---|---|---|
| 21 | FTP | CF card access |
| 80 | HTTP | Web interface |
| 443 | HTTPS | Secure web interface |
| 11159 | SDM | Service and Diagnosis Manager |
| 4840 | OPC-UA | OPC Unified Architecture |
| 502 | Modbus TCP | Modbus gateway (if configured) |
| 161/162 | SNMP | System monitoring |
| 6969 | B&R specific | Configuration transfer |
4. Complete Equipment List with Costs
4.1 Essential Equipment
| Category | Item | Model/Brand | Est. Cost (USD) | Priority |
|---|---|---|---|---|
| Computing | Laptop | Lenovo ThinkPad T14 (i7, 16GB, 512GB) | $1,300 | Essential |
| Network | USB Ethernet adapter | Intel I210-based (StarTech or similar) | $45 | Essential |
| Network | Cat5e patch cables (assorted) | Various | $30 | Essential |
| Network | Managed switch (port mirroring) | Netgear GS105E | $45 | Essential |
| Oscilloscope | 4-channel DSO | Rigol DS1054Z | $500 | Essential |
| Oscilloscope | Differential probe | Rigol or Micsig | $250 | Essential |
| Multimeter | Industrial true-RMS | Fluke 87V | $400 | Essential |
| Serial | RS232 USB adapter (FTDI) | FTDI FT232RL cable | $15 | Essential |
| Serial | RS485 USB adapter (FTDI) | FTDI USB-RS485-WE | $30 | Essential |
| Serial | TTL serial adapter | FTDI FT232RL 3.3V breakout | $10 | Essential |
| Software | Automation Studio | B&R AS 4.10 | License-dependent | Essential |
| Software | Wireshark + Npcap | Wireshark.org | Free | Essential |
| Storage | CF card reader | Transcend TS-RDF8K | $25 | Essential |
| Hand tools | Terminal screwdriver set | Wera 050 | $50 | Essential |
| Hand tools | Wire crimper/stripper | Knipex | $60 | Essential |
| Hand tools | Label maker | Brother P-Touch | $60 | Essential |
Essential subtotal: $2,850 (excluding AS license)
4.2 Recommended Equipment
| Category | Item | Model/Brand | Est. Cost (USD) | Priority |
|---|---|---|---|---|
| CAN Bus | CAN USB adapter | PEAK PCAN-USB | $170 | Recommended |
| Logic Analyzer | 8-channel LA | Saleae Logic 8 | $500 | Recommended |
| Logic Analyzer | 16-channel LA | Saleae Logic Pro 16 | $1,500 | Recommended |
| Network | Ethernet crossover cable | Cat5e MDI-X | $5 | Recommended |
| Network | Ethernet cable tester | Fluke MicroScanner or generic | $25 | Recommended |
| CAN Bus | CAN breakout + terminators | Various | $40 | Recommended |
| Software | UaExpert OPC-UA client | Unified Automation | Free | Recommended |
| Software | PCAN-View | PEAK | Free with adapter | Recommended |
| Software | Tera Term + RealTerm | Free software | Free | Recommended |
| Serial | RS485 breakout board | Screw terminal type | $10 | Recommended |
| Python | Python 3.10 + packages | Python.org | Free | Recommended |
| Electrical | Clamp meter (AC/DC) | Fluke i400 or similar | $250 | Recommended |
| Electrical | Insulation tester (megger) | Fluke 1587 or similar | $350 | Recommended |
| Physical | BNC adapters and cables | Various | $50 | Recommended |
| Physical | EMC near-field probe (DIY) | Ferrite + coax | $10 | Recommended |
Recommended subtotal: $2,970 (choosing Saleae Logic 8 over Pro 16)
4.3 Optional Equipment
| Category | Item | Model/Brand | Est. Cost (USD) | Priority |
|---|---|---|---|---|
| Oscilloscope | High-end DSO | Keysight DSOX3014T | $4,000 | Optional |
| CAN Bus | CAN analyzer software | Vector CANalyzer | $4,000 | Optional |
| Network | Network cable certifier | Fluke DSX-5000 | $3,500 | Optional |
| Electrical | Ground bond tester | Megger MIT430 | $500 | Optional |
| Electrical | HF current probe | Fischer CT-2 or similar | $400 | Optional |
| Computing | Second laptop (Linux) | Any i5, 8GB | $500 | Optional |
| Portable | Pelican case (rolling) | Pelican 1510 | $280 | Optional |
| Portable | Portable monitor | GeChic 15.6“ USB-C | $250 | Optional |
| Storage | External SSD (1TB) | Samsung T7 | $100 | Optional |
| Logic Analyzer | Sigrok + DreamSourceLab | DSLogic Pro16 | $150 | Optional |
| Spare parts | CF cards (8GB, industrial) | Transcend 800x | $40 | Optional |
| Spare parts | Ethernet cables (spool) | Cat5e 305m box | $50 | Optional |
| CAN Bus | PCAN-USB FD (CAN-FD) | PEAK | $350 | Optional |
| Software | Node-RED + OPC-UA | Open source | Free | Optional |
Optional subtotal: $14,120 (selecting items as needed)
5. Workstation Setup Procedures
5.1 Network Configuration
Dedicated PLC Network Interface Setup
- Identify the Intel I210 (or primary) NIC in Windows Device Manager
- Rename the adapter: “PLC Network”
- Configure a static IP in the B&R default range:
- IP: 192.168.1.100 (workstation)
- Subnet: 255.255.255.0
- Gateway: Leave blank
- DNS: Leave blank
- Disable all power management on this adapter (Device Manager > Power Management)
- Set adapter metric to 1 (highest priority) to ensure PLC traffic uses this interface
If the PLC uses a different subnet (determined during discovery), change accordingly. Keep notes on which subnets each machine uses.
Wireshark Capture NIC Configuration
If using a second NIC for Wireshark capture:
- Rename the second adapter: “Capture NIC”
- Configure static IP on a different subnet (or leave unconfigured)
- Disable all offloading features (see Section 2.6)
- In Wireshark, select only this adapter for capture
- Set Wireshark capture buffer to maximum (128 MB or more)
POWERLINK-Compatible Network Setup
POWERLINK requires 100 Mbps full-duplex links. Configure the switch port and NIC:
- Set switch port connected to PLC to 100 Mbps full-duplex (disable auto-negotiation if problems occur)
- Set capture NIC to 100 Mbps full-duplex
- Verify link lights on both switch port and NIC
- Test with a ping to the PLC IP before attempting capture
DNS Configuration
For most diagnostic work, you do not need DNS. Use host files if needed:
# C:\Windows\System32\drivers\etc\hosts
192.168.1.10 cp1584-machine-a
192.168.1.11 cp1584-machine-b
5.2 Physical Connections
First Contact Procedure for Unknown B&R System
Before connecting anything to an unknown machine:
Step 1: Safety Assessment
- Verify LOTO (Lock-Out/Tag-Out) procedures with the plant
- Confirm machine is in a safe state (E-stop engaged, drives disabled)
- Identify all power sources: 24V DC, 230V AC, 400V AC (3-phase), pneumatic
- Verify ground connections are intact
- Check for stored energy (capacitors, pressurized systems, suspended loads)
Step 2: Visual Inspection
- Locate the CP1584 PLC (look for the B&R logo and model number on the front panel)
- Note the IP address label (often handwritten on a sticker)
- Identify all connected cables (Ethernet, CAN bus, X2X, serial, power)
- Photograph all cable connections and panel layouts
- Note LED status on CP1584 (PWR, RUN, ERR, BF, MS)
- Check for obvious damage (burnt components, water ingress, loose connectors)
Step 3: Physical Connection
- Connect workstation Ethernet cable to the PLC Ethernet port (labeled ETH0 or ETHERNET)
- Connect serial cable if available (RS232 on front panel, COM1)
- Connect CAN adapter if CAN bus access is needed (locate the CAN bus junction point)
- Do NOT connect power measurement tools to live circuits until safety is confirmed
- Verify all connections are secure and not stressing any connectors
Step 4: Initial Power Monitoring
- Measure 24V supply at the PLC power terminals with the multimeter
- Verify voltage is within range (20.4-28.8V for 24V nominal)
- Check for ripple or noise on the 24V supply using the oscilloscope
- Measure ground reference voltage (should be < 1V between PE and PLC GND)
5.3 Software Configuration
Automation Studio Project Creation
- Open Automation Studio
- Create a new project: File > New > Project
- Set Target: B&R Automation Runtime > CP1584
- Set AR version to match the PLC (or highest available for forward compatibility)
- Configure the physical hardware: Add the CP1584 CPU, IO modules, and interface modules found during inspection
- Create an Ethernet connection to the PLC IP address
- Set transfer mode: “Transfer to Target” or “Change in Target” as needed
OPC-UA Connection Setup
- In UaExpert, double-click to add a new server
- Enter endpoint URL:
opc.tcp://<PLC-IP>:4840 - Select security policy: None (for initial diagnostics)
- Connect and browse the address space
- Bookmark important variables (machine state, alarms, process data)
- Export the address space for offline analysis
Wireshark Capture Profiles
Create named capture profiles:
| Profile Name | Interface | Filter | Notes |
|---|---|---|---|
| POWERLINK | Capture NIC | ether proto 0x88ab | Captures only POWERLINK frames |
| Modbus TCP | Capture NIC | tcp port 502 | Modbus gateway traffic |
| OPC-UA | Capture NIC | tcp port 4840 | OPC-UA communication |
| Full Capture | Capture NIC | (none) | Everything on the PLC network |
| SDM | Capture NIC | tcp port 11159 | SDM diagnostic traffic |
PVI Connection Configuration
In PVI Manager:
- Create a new connection
- Set transport: TCP/IP
- Set device:
CP1584 - Set IP address to PLC IP
- Set CPU slot (usually 1)
- Test connection
CAN Adapter Setup with PCAN-View
- Connect PCAN-USB to the CAN bus (DB9 connector)
- Open PCAN-View
- Set baud rate to match the CAN bus (common: 250 kbps, 500 kbps, 1 Mbps)
- Set CAN identifier format (11-bit standard or 29-bit extended)
- Start reception
- If no traffic is observed, try different baud rates
- Once traffic is visible, start logging
See if2772-canopen.md for CANopen-specific configuration details.
6. Diagnostic Workflow Checklist
6.1 Pre-Arrival Preparation
- Charge laptop battery (minimum 80%)
- Pack all adapters, cables, and tools
- Verify Wireshark POWERLINK dissector is installed and working
- Verify Automation Studio opens without errors
- Verify PCAN-View detects the CAN adapter
- Verify serial adapter appears in Device Manager
- Check that external SSD has space for new captures
- Bring spare Ethernet cables and adapters
- Bring printed copy of IP range scan results if available
- Review any prior documentation for this machine
6.2 On-Site Diagnostic Procedure
Phase 1: Safety and Assessment (15-30 minutes)
- LOTO confirmed with plant safety
- Power sources identified and verified
- Machine visual inspection completed
- All cable connections documented (photo + written)
- CP1584 front panel LED status noted
- PLC IP address identified (label, DHCP lease table, or ARP scan)
Phase 2: Network Discovery (15-30 minutes)
- Connect workstation to PLC network
- Run ARP scan:
arp -aorarp-scan -l - Run nmap scan:
nmap -sn 192.168.1.0/24(adjust subnet) - Run port scan on discovered PLC IP:
nmap -p 21,80,11159,4840,502 <PLC-IP> - Document all discovered devices and their roles
- Verify FTP access to CF card (anonymous or configured credentials)
Phase 3: PLC Connection and Backup (30-60 minutes)
- Connect via Automation Studio (transfer mode)
- Upload PLC program and hardware configuration
- Download CF card image via FTP (binary mode)
- Save CF card image to external storage with metadata
- Connect via SDM:
http://<PLC-IP>:11159(check if accessible) - Connect via OPC-UA:
opc.tcp://<PLC-IP>:4840(check if accessible) - Read system variables via brsnmp or PVI
- Note AR version, firmware version, project name, build date
Phase 4: Active Diagnostics (1-4 hours)
- Start Wireshark capture on dedicated NIC
- Start CAN bus capture if CAN bus is present
- Connect serial monitor if serial devices are present
- Read all system variables via OPC-UA or PVI
- Map IO configuration (digital inputs, outputs, analog channels)
- Identify communication partners (drives, HMIs, remote IO)
- Check task cycle times and watchdog settings
- Review alarm history and error logs
- Capture representative POWERLINK traffic (at least 10 seconds)
- Note any communication errors or timeouts in traffic
Phase 5: Hardware Health Check (30-60 minutes)
- Measure 24V supply voltage and ripple at PLC terminals
- Check POWERLINK Ethernet signal quality (if problems suspected)
- Measure CAN bus differential voltage (if CAN bus present)
- Check ground connections: PE to PLC GND voltage (< 1V)
- Measure ground currents with clamp meter
- Check ambient temperature and ventilation
- Inspect IO modules for damage or loose connections
- Verify all terminators are present (CAN bus, X2X bus)
Phase 6: Documentation (30-60 minutes)
- Compile findings into diagnostic report template
- Include CF card image location and metadata
- Include Wireshark capture file location
- Include CAN capture log location
- Document all discovered IP addresses and device roles
- Document all IO mappings extracted
- Document any problems found and recommended actions
- Create or update machine documentation file
- Back up all captures and documentation to external storage
- Store documentation in version control (git)
7. Portable vs Bench-Top Configuration
7.1 Portable Setup (Pelican Case)
A portable workstation in a rolling Pelican case is ideal for field service. You carry everything to the machine and set up on a nearby cart or table.
| Component | Storage | Notes |
|---|---|---|
| Laptop | In case, padded compartment | Use laptop sleeve for extra protection |
| Oscilloscope + probes | In case, custom foam cutout | Rigol DS1054Z fits in Pelican 1510 |
| CAN adapter | Small pouch | PCAN-USB + DB9 cables |
| Logic analyzer | Small pouch | Saleae Logic + grabber clips |
| Serial adapters | Small pouch | FTDI RS232 + RS485 + TTL |
| Ethernet cables + switch | Mesh pouch | GS105E switch + 4 cables |
| Multimeter | Side pocket | Fluke 87V with probes |
| Hand tools | Rolled pouch or small box | Wera screwdrivers, strippers, crimpers |
| CF card reader | Small box | Transcend TS-RDF8K |
| Label maker | Side pocket | Brother P-Touch |
| External SSD | Side pocket | Samsung T7 for captures |
| Power strip + extension cord | External | Bring your own; industrial sites may not have accessible outlets |
Recommended case: Pelican 1510 (rolling, $280) with custom foam. The 1510 fits airline carry-on requirements (though weight may be an issue at ~35 lbs loaded).
Portable Case Packing List
Pelican 1510 contents:
Top layer (foam):
- Laptop (center)
- Multimeter (right)
- Power supply + cables (left)
- CF card reader, adapters (pockets)
Bottom layer (foam):
- Oscilloscope (center)
- Probes (in scope bag, right)
- Managed switch (front left)
- Ethernet cables (front right)
- CAN adapter + cables (rear left)
- Logic analyzer + clips (rear right)
External:
- Hand tool pouch (carried separately or strapped)
- External SSD (side pocket)
- Label maker (side pocket)
7.2 Bench-Top Setup
For your workshop or permanent diagnostic bench, you can leave equipment connected and ready. This is more efficient for analyzing captures and programming CF cards after field visits.
| Component | Setup | Notes |
|---|---|---|
| Desktop PC or laptop on dock | Permanently on bench | Dual monitors recommended |
| Oscilloscope | Permanently connected via USB | USB connection for screen capture |
| Logic analyzer | Permanently connected via USB | Dedicated USB port |
| CAN adapter | Connected when needed | Keep cable routed to bench edge |
| Ethernet switch | 8-port on bench | PLC network + capture NIC |
| Multimeter | On bench stand | Always accessible |
| Soldering iron | On bench | For probe adapters, custom cables |
| Bench power supply | Programmable, 0-30V | For powering IO modules off-machine |
| USB hub | Powered, 7+ ports | Central cable management |
| External storage array | 2+ TB | Archive of all CF images and captures |
| Label printer | Networked or USB | Persistent label production |
7.3 Hybrid Approach
The most practical setup for a one-man team is hybrid: a portable Pelican case for field work plus a bench-top station for analysis. The laptop travels between both. Shared equipment (oscilloscope, logic analyzer) may live on the bench with a second, cheaper unit in the portable case.
Cost comparison:
| Configuration | Equipment Cost | Notes |
|---|---|---|
| Portable only | $3,000-5,000 | Everything in one case; limited bench capability |
| Bench-top only | $4,000-6,000 | Best analysis capability; requires on-site equipment transport each time |
| Hybrid (recommended) | $5,000-8,000 | Portable case + bench station; shared laptop; best of both |
8. Cross-References
This document is part of a comprehensive B&R diagnostic reference library. Related documents:
- cp1584-forensics.md – Step-by-step forensic analysis of unknown CP1584 systems; what to extract first, how to read configuration files, and how to reconstruct IO mappings from a blank machine.
- io-sniffing.md – Techniques for monitoring and identifying digital and analog IO signals without existing documentation. Covers signal tracing, force table usage, and IO mapping extraction.
- physical-layer-sniffing.md – Physical layer measurement techniques for Ethernet POWERLINK, CAN, X2X, and serial buses. Covers signal quality analysis and EMC diagnostics.
- powerlink-internals.md – Detailed POWERLINK protocol analysis including frame structure, node addressing, cycle timing, and error handling. Essential reference for Wireshark capture interpretation.
- x2x-protocol.md – B&R X2X backplane bus protocol analysis. Frame format, timing, and how to capture and decode X2X traffic with a logic analyzer.
- if2772-canopen.md – CANopen diagnostics for the B&R IF2772 interface module. CANopen object dictionary, SDO/CDC communication, and error handling.
- pvi-api.md – B&R PVI (Process Visualization Interface) API reference. Connection configuration, data transfer, and Python wrapper usage for automated diagnostics.
- opcua.md – OPC-UA configuration on B&R PLCs. Server setup, security configuration, address space structure, and client connection patterns.
- python-diagnostics.md – Python diagnostic tool library. Complete code examples for OPC-UA, PVI, Modbus, CAN, serial, and file-based diagnostics.
- serial-diagnostics.md – Serial protocol diagnostics for RS232/RS485 connections. Baud rate detection, protocol analysis, and non-invasive bus tapping techniques.
- grounding-emc.md – Grounding best practices and EMC diagnostic procedures for industrial installations. Ground current measurement, shield termination, and common-mode noise reduction.
- analog-calibration.md – Analog IO calibration procedures for 4-20mA, 0-10V, and thermocouple inputs. Calibration techniques, verification procedures, and documentation templates.
9. Key Findings
-
Build incrementally. Start with the essential tier ($2,850 excluding AS license) covering laptop, Ethernet tools, oscilloscope, multimeter, serial adapters, and Wireshark. Add CAN and logic analyzer capabilities as you encounter machines that need them. Do not buy everything at once.
-
Dedicated NIC for Wireshark capture is mandatory. Using the same NIC for PLC communication and Wireshark capture causes packet loss, missed frames, and unreliable POWERLINK analysis. A $45 Intel I210-based USB adapter solves this completely.
-
Managed switch with port mirroring is the most reliable POWERLINK capture method. Network taps work but are awkward. Port mirroring on a $45 Netgear GS105E gives you non-invasive, full-duplex capture with zero impact on PLC communication.
-
FTDI-only serial adapters. Prolific and CH340 chipsets have driver instability on modern Windows. The $15 FTDI FT232RL cable saves hours of troubleshooting time. Buy 3: one for RS232, one for RS485, one for TTL.
-
Rigol DS1054Z with differential probe is the oscilloscope sweet spot. Four channels cover CAN differential measurement plus trigger. The differential probe ($250) is the accessory that matters most – single-ended CAN measurements are unreliable and misleading.
-
CF card backup is the first action on any unknown machine. Before you do anything else, FTP into the PLC and download the CF card contents. Use binary FTP mode. Store with machine ID, date, and AR version metadata. This backup is your insurance policy.
-
Saleae Logic 8 ($500) covers most diagnostic needs. The Logic Pro 16 ($1,500) is only needed if you routinely analyze X2X bus traffic (16 data lines). For CAN, SPI, I2C, and serial analysis, 8 channels is sufficient.
-
PCAN-USB ($170) plus PCAN-View (free) is the CAN diagnostic baseline. CANalyzer is professional-grade but at $3,000+ it is difficult to justify for a one-man team. PCAN-View provides real-time monitoring, trace logging, and signal decode at zero additional cost.
-
Python with asyncua + pymodbus + pyserial replaces most proprietary software. For a diagnostic workstation focused on data extraction, Python scripts can read OPC-UA variables, poll Modbus registers, capture serial data, and log everything to structured files. This is faster and more repeatable than manual clicking through proprietary GUIs.
-
Use a template for every diagnostic engagement. Create a directory structure and checklist for each machine:
/machines/<machine-id>/<date>/containing CF card images, Wireshark captures, CAN logs, OPC-UA variable dumps, serial captures, and a diagnostic report. This structure accumulates into a searchable knowledge base over time. -
The hybrid portable + bench-top configuration is the right architecture. A portable Pelican case for field work and a permanent bench for analysis. The laptop shuttles between both. Shared equipment (oscilloscope, logic analyzer) can be duplicated cheaply (Sigrok-based logic analyzer for the field, Saleae for the bench).
-
brsnmp is the quickest way to identify an unknown PLC. Before opening Automation Studio or attempting a full program upload, run brsnmp to read the AR version, project name, and system variables. This 30-second check tells you what you are dealing with and which AS version you need.
Key Findings
-
A prepared workstation cuts diagnostic time from hours to minutes. Having every adapter, cable, and tool pre-configured and tested means you can connect to any unknown CP1584 in under five minutes and begin systematic data extraction.
-
brsnmp is the fastest first step for any unknown PLC. Running brsnmp against a CP1584 reveals the AR version, project name, system variables, and hardware inventory in seconds — no Automation Studio required.
-
Protocol sniffing is essential for intermittent problems. Problems that can’t be reproduced reliably require passive monitoring. A properly configured protocol sniffer (Wireshark + POWERLINK plugin, PCAN for CAN, logic analyzer for X2X) captures the evidence that logging alone misses.
-
Separate the diagnostic workstation from production networks. Your diagnostic laptop should never be on the plant network. Use a dedicated VLAN or direct connection to avoid introducing security risks or network interference.
-
Build a knowledge base that accumulates value. Every machine you diagnose adds captured configurations, firmware images, protocol traces, and documented procedures to your workstation. Over time, this library becomes your most valuable resource.
10. Sources
- B&R Automation. Automation Studio 4.x Documentation. B&R Industrial Automation, 2018-2024. https://www.br-automation.com
- B&R Automation. CP1584 Hardware Manual. B&R Industrial Automation. Document ID: DOC-00000.
- Rigol Technologies. DS1054Z User’s Guide. https://www.rigol.com
- PEAK-System Technik. PCAN-USB Product Page and Documentation. https://www.peak-system.com
- Saleae. Logic Analyzer Documentation and Protocol Decoders. https://www.saleae.com
- Wireshark Foundation. Wireshark User’s Guide. https://www.wireshark.org
- openPOWERLINK Project. POWERLINK Wireshark Dissector. SourceForge / GitHub. https://sourceforge.net/projects/openpowerlink/
- Unified Automation. UaExpert OPC-UA Client Documentation. https://www.unified-automation.com
- hilch. brsnmp – B&R SNMP Tool. GitHub. https://github.com/hilch/brsnmp
- CAN in Automation (CiA). CANopen Protocol Specification (CiA 301). https://www.can-cia.org
- Fluke Corporation. Fluke 87V Industrial True-RMS Multimeter User Manual. https://www.fluke.com
- Intel Corporation. I210 Ethernet Controller Datasheet. https://www.intel.com
- Python Software Foundation. asyncua Library Documentation. https://github.com/FreeOpcUa/opcua-asyncio
- python-can Project. CAN Bus Interface Documentation. https://python-can.readthedocs.io
- Sigrok Project. PulseView Logic Analyzer Software. https://sigrok.org
- IEC 61158-4-6. POWERLINK Real-Time Ethernet Protocol. International Electrotechnical Commission.
- IEC 61158-4-4. CANopen Communication Profile. International Electrotechnical Commission.
- IEC 62591. WIRELESSHART Communication Protocol (reference for industrial wireless diagnostics). IEC.
- NMAP Project. Nmap Network Scanning Documentation. https://nmap.org
- Netgear. GS105E Managed Switch Documentation. https://www.netgear.com
- Pelican Products. 1510 Case Specifications. https://www.pelican.com
B&R User Role and Access Control Recovery for CP1584
Overview
When you inherit a B&R machine from a defunct OEM, one of the first barriers you may hit is password protection. The OEM may have configured user accounts, OPC-UA authentication, VNC passwords, FTP access controls, or Automation Studio online login credentials — and none of them were documented. This guide covers every known access recovery pathway for the X20CP1584 and related B&R controllers.
Critical context: B&R controllers do not have any built-in default administrator accounts or system-integrated credentials. All user management is entirely application-defined. This was confirmed by B&R staff on the community forum. The passwords, roles, and accounts that exist on any given CP1584 were created by the OEM programmer during project development.
1. Understanding B&R Access Control Layers
B&R access control is not a single mechanism. There are multiple independent layers, each protecting different interfaces:
| Layer | What It Protects | Configured In | Default State |
|---|---|---|---|
| Automation Studio Online Login | Download/upload/online monitoring from AS | Project options in AS | No password by default |
| VNC Server | Remote HMI viewing and control | Ethernet interface settings, VNC Servers section | Password optional; defaults to no auth |
| FTP Server | CF card file access | System configuration, System.par | Username br, password br (traditional default); can be changed |
| OPC-UA Server | Variable access via OPC-UA | OPC-UA configuration, user role system | Anonymous access or configured roles |
| User Role System (mapp) | Application-level login for operators | mapp UserX, AsUserMG library in the PLC program | Defined by OEM programmer |
| SDM Web Interface | Browser-based diagnostics at /sdm | System configuration | No authentication by default |
| Ethernet Station Address / DIP Switch | INA2000 station number | Physical DIP switches on the CPU | Set by hardware |
Key Insight: The OEM Program Controls Everything
Unlike some PLC brands (Siemens, Rockwell) that have factory-level passwords for firmware access, B&R’s security model is:
- No factory passwords exist. B&R confirmed there are “no standard / system integrated administrator accounts / credentials.”
- All credentials are application-specific. The user roles, passwords, and access levels are created by whoever programmed the PLC.
- Credentials are stored in the application project, compiled into the binary, and loaded from the CF card at boot.
- Some credentials are stored on the CF card’s secure partition in a dynamically-named file with SHA256-encrypted password values.
See also: firmware.md, cf-card-boot.md, config-file-formats.md
2. Automation Studio Online Access
2.1 What Is Protected
When you connect to a CP1584 from Automation Studio (Online > Settings > Auto Search or manual IP entry), the controller may require an online password. This is configured per-project in:
Automation Studio > Options > Settings > Online > Login
The online login can have multiple user levels:
| Level | Description |
|---|---|
| Operator | Limited access; can view but not modify |
| Service | Can read/write variables, force I/O, make online changes |
| Administrator | Full access; can download/upload programs, change configuration |
| Default | If no login is configured, anyone with AS can connect with full access |
2.2 Recovery When the AS Password Is Unknown
There are several approaches:
Approach A: Direct CF Card Access
If you can physically access the CF card:
- Power down the PLC
- Remove the CF card
- Image the CF card to your PC (see cf-card-boot.md for imaging procedure)
- The online login configuration is stored in the compiled project on the CF card
- You can search the CF card’s user partition files for configuration data
- In many cases, simply creating a new project with no login protection and downloading it will overwrite the existing password
Approach B: Boot Mode Access
The CP1584 has a physical operating mode switch on the CPU housing:
| Switch Position | Mode | Description |
|---|---|---|
| RUN | Normal operation | Application runs normally |
| BOOT | Boot mode | Boot AR starts; system can be installed via online interface |
| DIAG | Diagnostic mode | CPU boots with diagnostics; programs are not initialized |
In BOOT mode, the controller runs the Boot AR firmware, not the user application. This means:
- No application-level security is active
- You can connect from Automation Studio and install a new project
- The user application is not running (outputs are zeroed)
Procedure:
- Power down the PLC
- Set the operating mode switch to BOOT
- Power up the PLC
- The STATUS LED will show the PLC is in BOOT mode (R/E red on, RDY/F yellow on)
- In Automation Studio, use Online > Settings > Auto Search to find the PLC (it will appear with its hardware address, typically via DHCP)
- Connect and install a new project — or if you have the original
.apjfile with known passwords, install it
Approach C: Reset Button
The CP1584 has a reset button located below the USB interfaces on the bottom of the housing:
Procedure:
1. Press the reset button with a small pointed object (e.g., paper clip)
2. All application programs are stopped immediately
3. All outputs are set to zero
4. The PLC starts up in SERVICE mode by default
5. The startup mode after reset can be configured in Automation Studio
In SERVICE mode, the application is not running normally, but you may still need credentials to connect via Automation Studio. The reset button alone does not clear passwords — it only stops the application.
Approach D: Network Reset (DHCP Recovery)
If you don’t know the PLC’s IP address:
- Connect your PC directly to the PLC’s Ethernet port
- Set your PC to DHCP
- Switch the PLC to BOOT mode
- If a DHCP server is available, the PLC will obtain an IP via DHCP
- Use Automation Studio’s auto-search to find it
Without a DHCP server, the PLC in BOOT mode may use its hardware-based INA2000 address (set by the DIP switches on the CPU).
3. FTP Access Recovery
SECURITY WARNING — CVE-2024-0323 (CVSS 9.8 Critical): The FTP server on B&R Automation Runtime supports insecure encryption mechanisms (SSLv3, TLSv1.0, TLSv1.1). An attacker on the network can perform man-in-the-middle attacks to decrypt FTP communications, including CF card backups that may contain the entire project, credentials, and configuration. Do not use FTP over untrusted networks. See ar-rtos.md Section 14.8 for details.
3.1 Default FTP Credentials
B&R FTP access traditionally defaults to:
Username: br
Password: br
However, the OEM may have changed these. FTP credentials are stored in the controller’s system configuration, not in the user application.
3.2 FTP Without Credentials (ANSL-era Behavior)
On older B&R systems, FTP would accept any username/password combination (literally any string for both fields). This was possible because FTP authentication was not rigorously enforced. On modern AR versions (4.x+), this behavior depends on the system configuration.
3.3 Testing FTP Access
## Attempt FTP connection
ftp <PLC_IP>
## Or using curl for testing
curl -v ftp://<PLC_IP>/
## Try default credentials
curl -v ftp://br:br@<PLC_IP>/
If FTP access works, you can browse the CF card partitions:
ftp> ls
Volume: A:
Volume: C:
Volume: F: (user partition - contains user files)
Volume: System (system partition - contains AR firmware)
Volume: CONFIG (configuration)
3.4 FTP Access Controls
B&R offers password-protected FTP as of AR 4.33+. The configuration for FTP access is stored in the system configuration on the CF card. If the OEM changed the default credentials:
- If you can physically access the CF card, you may be able to modify the system configuration
- Boot mode + new project installation is the most reliable path
See also: ftp-web-interface.md, config-file-formats.md
4. VNC Access Recovery
4.1 VNC Configuration
The VNC server on B&R PLCs is configured in the Ethernet interface settings within the Automation Studio project, under the “VNC Servers” section. The OEM configures:
- View-only password (typically a single character like
v) - View and control password (typically a single character like
c) - Port number (default: 5900, or offset from 5900 for multiple VNC servers)
4.2 VNC Default Passwords
Common B&R VNC defaults observed in the field:
| Mode | Common Default Password |
|---|---|
| View only | v |
| View and control | c |
These defaults come from B&R training examples and the VC4 visualization tutorials. However, the OEM may have set custom passwords or disabled VNC entirely.
CRITICAL SECURITY WARNING — CVE-2023-1617 (CVSS 9.8 Critical): The B&R VC4 VNC server has an authentication bypass vulnerability affecting VC4 versions 3.x through 4.45.3 and 4.7.x through 4.72.9. An unauthenticated network attacker can bypass all VNC authentication entirely, gaining full view and control of the HMI without any credentials. This means even if the OEM set a custom VNC password, it provides no protection on unpatched systems.
Mitigation:
- Update VC4 to version 4.45.1+ or 4.72.9+ (requires Automation Studio with matching VC4 component)
- Block VNC ports (5900, 5800) at the network firewall if VNC is not needed
- On patched systems, change VNC passwords from defaults — single-character passwords are trivially guessable
- Never expose VNC ports to untrusted networks
See ar-rtos.md Section 14.10 for full CVE details and network-architecture.md for firewall configuration.
4.3 Connecting to VNC
## Using standard VNC client
vncviewer <PLC_IP>:5900
## Using B&R VNC Viewer (included with Automation Studio)
## Launch from: C:\Program Files\B&R\Automation Studio\<version>\Automation\Tools\VNC
4.4 VNC Not Configured
If the OEM did not configure a VNC server, you will not be able to connect. VNC is an application-level service — it must be explicitly configured in the Automation Studio project. Without the project or the ability to download a new configuration, VNC access is not available.
To enable VNC:
- You need to download a project to the PLC that includes VNC server configuration
- This can be done in BOOT mode from Automation Studio
See also: hmi-integration.md
5. OPC-UA Access Recovery
5.1 OPC-UA Security Model
B&R’s OPC-UA implementation supports:
- Anonymous access (no authentication)
- Username/password authentication (application-defined)
- Certificate-based authentication (X.509)
- Role-based access control (per-node permissions)
5.2 The User Role System
Starting with Automation Studio supporting OPC-UA, B&R introduced a user role system:
- Any number of roles can be defined
- Each role gets individual access rights per node (read, write, browse)
- Nodes can be completely hidden from specific roles
- Rights can be inherited from parent nodes to children
- Users are assigned one or more roles
- Passwords are SHA256-encrypted
5.3 Where Credentials Are Stored
OPC-UA user credentials are stored in:
- The compiled application on the CF card (User ROM / user partition)
- A dynamically-named file on the CF card’s secure partition with content like:
Property ID="Password" Value="bL3DNQOpeohgnWO6/XrO3/WjxEdDmtVI5eN8bg9oxj1gcJSr5ng=" DataType="STRING"
B&R has confirmed that:
- The filename is dynamically created and varies based on the total number of files
- The password value is SHA256 encrypted
- B&R does not disclose the full encryption details for security reasons
5.4 Testing OPC-UA Access Without Credentials
If anonymous access is enabled (which is common on machines where the OEM didn’t configure strict security):
import asyncio
from asyncua import Client
async def test_opcua_access(plc_ip):
url = f"opc.tcp://{plc_ip}:4840"
async with Client(url=url) as client:
root = client.get_root_node()
print(f"Connected to {url} - anonymous access enabled")
print(root)
children = await root.get_children()
for child in children:
print(f" {await child.get_browse_name()}")
asyncio.run(test_opcua_access("<PLC_IP>"))
5.5 Recovering When Authentication Is Required
If OPC-UA requires authentication:
- Try common defaults:
admin,operator,service,br(empty password orbr) - FTP into the CF card and search for configuration files that might contain credential hints
- Boot mode → new project with known credentials
- Check the CF card user partition for configuration files that may contain user role definitions
See also: opcua.md, pvi-api.md
6. mapp UserX / Application-Level User Management
6.1 What Is mapp UserX?
mapp UserX is B&R’s pre-built user management component. If the OEM used mapp UserX, the following applies:
- Users are created and managed through the
MpUserXManagerfunction block - User levels are hierarchical: administrators can create users at their level or below
- Password rules are configurable (minimum length, complexity, expiration)
- User data is stored in the mapp UserX configuration on the CF card
6.2 Typical mapp UserX Role Hierarchy
A common OEM configuration:
| Role Level | Role Name | Capabilities |
|---|---|---|
| 10 | Developer | Full access; create/edit all users |
| 7 | Service | Create/edit operators and below |
| 5 | ShiftLeader | Create/edit operators |
| 3 | Operator | Basic machine operation |
| 1 | Visitor | View-only |
6.3 Admin Rights and User Management
Administrator rights in mapp UserX are used only for user management:
- Create new users
- Unlock locked users
- Reset passwords
- Edit user properties
Administrator rights do not affect other access like OPC-UA or other mapp components — those have their own role-based access controls.
6.4 Recovering mapp UserX Access
If the OEM used mapp UserX and you don’t have any credentials:
- The CF card is your path. mapp UserX stores its configuration in files on the CF card user partition
- FTP access may allow you to browse and identify mapp UserX configuration files
- Creating a new project without mapp UserX (or with a default admin account) and downloading it will replace the existing user management
- If you need to preserve the existing program while resetting access, you must first upload the existing project from the PLC (which may require credentials), then modify the user management, then download it back
6.5 Using the User Role System Programmatically
B&R provides function blocks for managing users at runtime:
MpUserXManager - Core user management function block
MpUserXManagerUI - User management with UI confirmation dialogs
The user role system can be updated during operation — you can assign a username and password to a new system operator from within the application program using these function blocks. If you have access to modify the PLC program (via online changes or a new download), you can inject code to create a new admin account.
See also: online-changes.md, custom-diagnostic-tools.md
7. SDM (System Diagnostics Manager) Access
7.1 SDM Is Typically Unauthenticated
The SDM web interface at http://<PLC_IP>/sdm is typically accessible without authentication. This is one of your most valuable diagnostic entry points when you have no credentials.
If SDM is enabled (it is by default on most configurations):
- Open a web browser and navigate to
http://<PLC_IP>/sdm - You can view CPU status, I/O module states, error logs, alarm history, network diagnostics
- No login is required for read-only access
7.2 If SDM Is Disabled
SDM can be disabled in the project configuration to save CPU memory (about 200-400 kB of DRAM). If it’s disabled, you’ll get a 404 or connection refused on port 80.
To re-enable SDM, you need to download a new project configuration — which requires BOOT mode or existing Automation Studio access.
See also: diagnostics-sdm.md
8. Factory Reset / Full Wipe Procedures
8.1 Method 1: CF Card Format (HDD/CF Utility)
Prerequisites: Automation Studio installed on a Windows PC, PLC accessible via network or serial.
Automation Studio > Online > Settings > [select your PLC] > right-click > HDD/CF Utility
The HDD/CF utility allows you to:
- Format the CF card (destroying all user data including credentials)
- Repartition the CF card
- Initialize the CF card for a fresh installation
After formatting:
- All user programs are gone
- All user accounts and passwords are gone
- The PLC boots into BOOT mode
- You can install a new, clean project
8.2 Method 2: Runtime Utility Center
Runtime Utility Center (RUC) can execute the HDD/CF utility without requiring a full Automation Studio installation. This is useful if you don’t have AS installed.
- Install Runtime Utility Center from B&R’s website
- Connect to the PLC (requires knowing its IP address or using auto-discovery)
- Execute the HDD/CF utility
Limitation: RUC has less capability than AS for browsing/set IP address. In BOOT mode, the PLC needs DHCP to get an IP, which may be impractical.
8.3 Method 3: Physical CF Card Replacement
The most brute-force approach:
- Power down the PLC
- Remove the existing CF card
- Insert a new, blank B&R-certified CF card
- Power up — the PLC will go to BOOT mode (no system ROM on the blank card)
- Connect via Automation Studio and install a fresh system + your project
This preserves the original CF card as a backup in case you need to recover anything later.
8.4 Method 4: USB Flash Drive Installation
If you have a prepared USB installation package (a .zp2 or .zp3 file created by Automation Studio):
- Copy the installation package to a FAT32-formatted USB stick
- Set the PLC to BOOT mode
- Insert the USB stick
- The PLC will detect and install the package automatically
- This performs an initial installation that wipes the previous configuration
8.5 Hardware Reset Button Procedure
Step 1: Locate the reset button (below USB interfaces, on the bottom of the CPU housing)
Step 2: Press and hold with a pointed object
Step 3: The STATUS LED will flash orange after ~10 seconds
Step 4: Release the button
Step 5: The CPU returns to factory defaults (DHCP enabled, no application)
Note: This procedure resets network settings and clears the running application, but it does not format the CF card. Any passwords stored on the CF card persist.
See also: bootloader-recovery.md, cf-card-boot.md, firmware-version-mgmt.md
9. Serial Console Access
9.1 RS232 Interface
The CP1584 has an RS232 interface (IF1) on the 12-pin terminal block. This interface can be used as an online programming interface.
Pinout (X20TB12 terminal block):
| Pin | Signal |
|---|---|
| 1 | RX |
| 2 | TX |
| 3 | GND |
Connection parameters: 57600 baud (factory default), 8-N-1, no flow control. If the default doesn’t work, the baud rate may have been reconfigured in the original project — try 9600, 19200, 38400, or 115200.
9.2 Serial Access Limitations
The RS232 interface on the CP1584 is primarily designed for:
- Automation Studio serial connection (legacy)
- Serial communication with external devices (configured in the application)
- Boot loader serial console (for firmware recovery)
It does not provide a shell or command-line interface to the VxWorks-based operating system. You cannot log in via serial and reset passwords. However, it can be used for:
- BOOT mode communication (see bootloader-recovery.md)
- Firmware recovery via serial/TFTP
See also: serial-diagnostics.md
10. Network-Level Access When All Else Fails
10.1 What You Can Always Access (If Configured)
Even without any passwords, these interfaces are typically open by default:
| Interface | Port | Access |
|---|---|---|
| SDM web interface | 80 | No auth (read-only) |
| ANSL discovery | 30303/11169 UDP | No auth (read-only broadcast) |
| OPC-UA | 4840 | May allow anonymous |
| FTP | 21 | Default br:br |
| VNC | 5900 | May be unconfigured |
10.2 The “Nuclear Option” Workflow
When you have absolutely no credentials and need full access:
1. BACK UP THE CF CARD FIRST
- Power down, remove CF card, image it to your PC
- See cf-card-boot.md for imaging procedure
- Store the image safely
2. SET PLC TO BOOT MODE
- Switch the operating mode switch to BOOT
- Power up
- PLC is now in Boot AR, no application running
3. CONNECT VIA AUTOMATION STUDIO
- Auto-search should find the PLC (DHCP or hardware address)
- No application-level passwords are active in BOOT mode
4. CHOOSE YOUR PATH:
Option A: Create a minimal new project, download it
Option B: If you have a .apj backup with known passwords, download that
Option C: Use HDD/CF utility to completely wipe and start fresh
5. RESTORE FROM YOUR ANALYSIS
- Use the forensic data from cp1584-forensics.md to reconstruct functionality
- See project-reconstruction.md for the full reconstruction methodology
10.3 Preserving the Running Application
If you need to keep the machine running while regaining access:
- FTP into the CF card and back up all files
- OPC-UA browse (if anonymous) to document the variable namespace
- SDM to capture all diagnostic data
- Network sniff POWERLINK traffic to document I/O mapping (see io-sniffing.md)
- Schedule a planned shutdown for the CF card swap
11. Security Implications of Having Full Access
11.1 What Full Access Means
Once you have full access to the CP1584:
- You can read/write any PLC variable
- You can modify the running program
- You can change I/O mapping
- You can modify safety system parameters (if safe I/O is configured)
- You can change network configuration
- You can enable/disable any service (OPC-UA, FTP, VNC, SDM, web server)
- You can install new firmware
11.2 Safety System Considerations
If the machine has B&R Safe I/O modules (SafeLOGIC, Safe I/O):
- Safety programs are separate from standard programs
- Safety parameters have their own protection mechanism
- Modifying safety parameters without proper validation can create dangerous conditions
- Always validate safety-related changes through proper procedures
11.3 Securing the System After Recovery
After gaining access and reconstructing functionality:
- Set a new Automation Studio online login with proper user levels
- Configure OPC-UA user roles if exposing the PLC to a SCADA/MES system
- Change FTP credentials from defaults
- Set VNC passwords if VNC is enabled
- Document all credentials in your maintenance manual
- Consider disabling unused services (FTP, web server) to reduce attack surface
- Enable OPC-UA certificates for production environments
See also: safe-io-diagnostics.md, documentation-reconstruction.md
12. brwatch: External Service Tool for Variable Access Without Project
12.1 What Is brwatch?
brwatch (https://github.com/hilch/brwatch) is a free Windows service tool for B&R PLCs that provides variable watch, change, logging, IP configuration, and CPU reboot capabilities without requiring Automation Studio or the original project. This is one of the most valuable community tools for engineers working with undocumented B&R systems.
12.2 Capabilities
| Feature | Description |
|---|---|
| Watch variables | Monitor live variable values from any connected B&R PLC |
| Change variables | Write values to PLC variables (setpoints, flags, parameters) at runtime |
| Log variables | Record variable values over time to a log file for trending |
| Search variables | Browse and search the variable namespace of a connected PLC |
| Set IP addresses | Change PLC network configuration (IP, subnet, gateway) |
| Reboot CPUs | Remotely restart connected PLCs |
| List PLCs | Discover all B&R PLCs on the network |
12.3 Installation and Setup
# Download the latest release from GitHub
# https://github.com/hilch/brwatch/releases
# Run the installer (Windows)
# brwatch installs as a Windows service
# Configure the target PLC IP address in brwatch settings
12.4 Using brwatch Without Project Files
brwatch connects to the PLC via PVI and can enumerate variables that are visible in the runtime — even without the original project. This makes it valuable for:
- Checking which variables are accessible before investing in PVI/OPC-UA setup
- Making quick parameter changes on the running machine (setpoints, flags)
- Logging variable trends to diagnose intermittent issues
- Discovering the variable namespace as input for project reconstruction
12.5 Relationship to PVI
brwatch uses the B&R PVI infrastructure internally (PVI Manager). It requires either PVI 4.x or PVI 6.x installed on the workstation. On AS6, only ANSL lines are supported (INA2000 is removed). See pvi-api.md for PVI configuration details.
12.6 Comparison: brwatch vs Automation Studio vs PVI/OPC-UA
| Capability | brwatch | Automation Studio | OPC-UA Client | PVI API |
|---|---|---|---|---|
| Watch variables | Yes | Yes (with connection) | Yes (subscribe) | Yes (poll) |
| Change variables | Yes | Yes (with connection) | Yes (write) | Yes (write) |
| Log to file | Yes | Limited (Trace) | Via external | Via script |
| Set IP address | Yes | Yes | No | No |
| Reboot PLC | Yes | Yes | No | No |
| Requires project | No | Yes | No | No |
| Requires AS license | No | Yes | No | No |
| Free | Yes | No (requires license) | Yes (UaExpert) | No (PVI SDK) |
brwatch is the recommended first tool for quick assessment of an undocumented PLC. See also: pvi-api.md, python-diagnostics.md.
13. Pvi.py: Python Access Without Automation Studio
13.1 What Is Pvi.py?
Pvi.py (https://github.com/hilch/Pvi.py) is a Python wrapper for B&R PVI that enables programmatic access to PLC variables from Python scripts without Automation Studio. This is the foundation for building automated diagnostic tools.
13.2 Quick Start
## pip install pvi (or clone from GitHub)
from pvi import Pvi
plc = Pvi()
## Connect to PLC using ANSL line
plc.line_set(
line_name="ANSL",
ip="192.168.0.14",
)
plc.connect()
## Read a variable
value = plc.variable_read("MachineData.Temperature")
print(f"Temperature: {value}")
## Write a variable
plc.variable_write("MachineData.TargetRPM", 1500)
13.3 When Pvi.py Is Useful
- Automated diagnostic scripts that poll PLC variables
- Building custom monitoring dashboards without AS
- Automated setpoint changes based on external logic
- Batch variable extraction for documentation purposes
See python-diagnostics.md for comprehensive Python diagnostic script examples.
14. BOOT Mode: Service State Recovery
14.1 The Problem
A CP1584 can become stuck in “BOOT mode: Service” — a state where the Boot AR firmware is running but the controller cannot proceed to RUN or SERVICE mode. This typically indicates corrupted firmware or missing system files on the CF card.
14.2 Recovery Procedure
Based on B&R community discussions (https://community.br-automation.com/t/plc-module-stuck-in-boot-mode-service/8634):
- Verify the operating mode switch is set to BOOT (not RUN or DIAG)
- Check if Automation Studio can find the PLC via Auto Search (it should appear if Boot AR is running)
- Connect and check the error in Automation Studio’s connection dialog — the error message indicates what’s corrupted
- Try installing a fresh system runtime via Automation Studio transfer (Application > Transfer to Target)
- If transfer fails, try formatting the CF card via HDD/CF Utility and performing a fresh installation
- If the CF card itself is corrupted, image the card and restore from backup or use a new CF card
14.3 Serial Recovery
If network access is impossible:
- Connect RS232 serial cable to IF1 (12-pin terminal block, pins 1=RX, 2=TX, 3=GND)
- Set baud to 57600 (or try 9600, 19200, 38400, 115200)
- Some B&R controllers accept TFTP boot commands via serial — see bootloader-recovery.md
See also: bootloader-recovery.md, cf-card-boot.md
15. BrSecurity Library: Password/Encrypt/Decrypt
The BrSecurity library (https://github.com/br-automation-community/awesome-B-R) is a community library providing security functions for B&R Automation Studio projects:
- Password hashing and verification
- String encryption/decryption
- Secure data storage
If the original project used BrSecurity for credential management, the password verification algorithm is embedded in the compiled code. Understanding this library may help when:
- You can extract the compiled binary and identify BrSecurity usage
- You need to replicate the same password scheme in a new project
- You’re trying to verify if a guessed password matches
Note: This library is community-developed, not an official B&R product.
Key Findings
- B&R has no factory default administrator accounts. All credentials are OEM-defined and application-specific.
- BOOT mode bypasses all application security. Setting the physical switch to BOOT and downloading a new project is the most reliable recovery path.
- The CF card holds all secrets. User credentials are stored in compiled application data and/or the CF card’s secure partition with SHA256 encryption.
- SDM is typically unauthenticated. The web diagnostic interface is your primary entry point for assessing an unknown PLC.
- FTP defaults are
br:br. This is the most commonly unchanged credential on B&R systems. - VNC defaults are typically
v(view) andc(control). But VNC must be configured in the project — it may not be enabled at all. - The nuclear option (CF card format + fresh install) is always available but requires Automation Studio and results in complete loss of the existing application.
- Always image the CF card before making changes. The original application and configuration are your only reference for reconstruction.
- brwatch is the fastest way to gain access to an undocumented PLC’s variables — it requires no AS project, no AS license, and can enumerate, watch, and change variables from a Windows PC.
- Pvi.py enables automated Python access for building diagnostic scripts, monitoring dashboards, and batch documentation tools without Automation Studio.
Sources
B&R Documentation
- B&R Automation Studio Online Help — CPU Properties > User Administration
- B&R Automation Runtime Manual — Service Mode and Diagnostic Mode specifications
- B&R X20 System User’s Manual — operating mode switch, LED indicators, and recovery procedures
- B&R CF Card Handling Guide — backup and restore procedures
B&R Community Forum
- community.br-automation.com — discussions on password recovery, BOOT mode, FTP defaults, and VNC configuration
Related Documents
- cp1584-forensics.md — Forensic information extraction from a CP1584 without project files
- ftp-web-interface.md — FTP server access for remote recovery
- diagnostics-sdm.md — SDM web interface for initial assessment
- cf-card-boot.md — CF card structure and backup procedures
- safe-io-diagnostics.md — Safety system access considerations
- documentation-reconstruction.md — Documenting the system after access recovery
B&R License Management When the OEM is Gone
A practical reference for automation engineers maintaining B&R CP1584 PLCs inherited from defunct OEMs with zero documentation.
1. Overview
The Licensing Challenge
When you inherit a B&R machine from a defunct or unreachable OEM, you face a unique licensing problem. B&R Automation’s licensing model is built around a system called Technology Guarding (TG), which ties software and runtime licenses to physical hardware containers (USB dongles) or software containers. Unlike Siemens TIA Portal licenses that can sometimes be recovered through factory support portals, B&R licenses are tightly coupled to the original purchasing entity’s account and the physical dongle they shipped on.
The core problems you face:
- No B&R portal access – the OEM owned the account; you cannot log in to manage licenses.
- Dongle custody – the TG USB dongle may be missing, damaged, or stuck with expiring licenses.
- Unknown license inventory – you do not know which licenses (AS, AR, mapp components) were purchased.
- Perpetual vs. time-limited confusion – mixing AS (annual) and AR (perpetual) licenses on one dongle creates transfer deadlocks.
- No documentation – no license keys, no purchase records, no activation records.
What Licenses Are Typically Needed
| License Category | Purpose | Type | Typical Duration |
|---|---|---|---|
| Automation Studio (AS) | IDE for programming, configuration, diagnostics | Time-limited (AS) | 1 year, auto-renews with service |
| Automation Runtime (AR) | Runtime execution on PLC (CP1584) | Perpetual (AR) | No expiration |
| mapp View | HMI/web visualization framework | TG-licensed | Perpetual or time-limited |
| mapp AlarmX | Alarm management | TG-licensed | Perpetual |
| mapp IO | I/O mapping and diagnostics | TG-licensed | Perpetual |
| mapp User | User management and authentication | TG-licensed | Perpetual |
| mapp Safety | Safety function blocks (requires Safety Designer) | TG-licensed | Perpetual (safety-critical) |
| Safety Designer | Configuration of safety functions | TG-licensed | Perpetual |
| OPC UA (mapp) | OPC UA server/client | TG-licensed | Perpetual |
| Motion / CNC | Motion control, CNC functionality | TG-licensed | Perpetual |
Technology Guarding Ecosystem Overview
B&R License Server
(license.br-automation.com)
|
TLS 1.2 / HTTPS
|
+-----------------------+-----------------------+
| |
Technology Guarding CodeMeter Runtime
Desktop Application Service (Windows Service)
| |
License Management UI Container Detection & Decryption
(Activate / Deactivate) |
| +--------+--------+
+-------+-------+-------+ | |
| | | USB Dongle Software
Dongle X20CMR Software (0TG1000.02) Container
(USB) Modules Container (VM-bound)
2. Technology Guarding Architecture
CodeMeter by Wibu-Systems
Technology Guarding is B&R’s branding of the Wibu-Systems CodeMeter digital rights management (DRM) platform. CodeMeter is a widely-used licensing framework in industrial automation (also used by Lenze, Bosch Rexroth, and others). Understanding this helps because:
- The CodeMeter Runtime Service is a Windows service that must be running for AS to function.
- The CodeMeter Control Center (separate from TG) can inspect dongles and software containers.
- Error codes beginning with WB (e.g., WB47, WB67) originate from CodeMeter, not B&R’s TG layer.
- Firmware updates to the dongle are actually CodeMeter firmware operations.
License Container Types
| Container | Part Number | Description | Binding Mechanism |
|---|---|---|---|
| USB Dongle | 0TG1000.02 | Physical USB stick, most common | Hardware-bound (portable) |
| USB Dongle (CmStick) | 0TG1000.02 | Same as above, Wibu nomenclature | Hardware-bound |
| Software Container | — | Licensed to a specific PC | Bound to hardware fingerprint (CPU, motherboard, MAC) |
| X20CMR Module | X20CMR0190 (and others) | Built-in TG in X20 bus module | Hardware-bound to module |
| Network Dongle | — | Dongle on network share | Hardware-bound (remote) |
USB Dongle (0TG1000.02)
- The primary license container shipped by B&R.
- Can hold multiple licenses (AS + AR + multiple mapp components).
- Plugs into PC for AS licensing, or into PLC for AR licensing.
- Portable between machines (by design).
- Fragile: physical damage or firmware corruption renders all licenses on it inaccessible.
Software Container
- A license bound to a specific PC’s hardware fingerprint.
- Created during “Activate on this PC” operations in TG.
- Critically: invalidated by any hardware change – VM migration, snapshot revert, hardware upgrade, motherboard replacement.
- NOT recommended for production environments.
- Suitable only for development PCs that never change hardware.
X20CMR Modules
- Select X20 system modules have a built-in Technology Guard element.
- Allows AR license activation directly on the PLC hardware (no dongle needed for AR).
- The module’s TG element is treated as a license container, similar to a dongle.
- Useful for machines where the PLC itself should hold the runtime license permanently.
License Types
AS Licenses (Time-Limited)
- Duration: 1 year from activation.
- Auto-renew: renews automatically when a valid B&R service contract exists and the license can reach the B&R server.
- Stops auto-renewing if the service contract lapses or the OEM goes bankrupt.
- Cannot be returned to the B&R server after expiration (by design).
- Key risk: if an expired AS license sits on the same dongle as perpetual AR licenses, the AR licenses become trapped because returning any license from the dongle requires all licenses to be in a valid state.
AR Licenses (Perpetual)
- No expiration date.
- Tied to the PLC hardware or a dongle.
- Not affected by service contract status.
- Stored separately from AS licenses in most deployment scenarios (AR on PLC, AS on PC dongle).
- Can be activated via PLC network connection or by plugging the dongle into the PLC.
mapp Component Licenses
- Most mapp components are perpetual licenses.
- Stored on the same TG container as AS licenses (typically the USB dongle).
- Required at download time (AS verifies mapp licenses before downloading to PLC).
- Some mapp components have different licensing models; verify individually.
Server-Activated vs. Offline Licensing
| Mode | Description | Use Case |
|---|---|---|
| Online Activation | License key validated against B&R server in real time | Normal operation, internet-connected |
| Offline Licensing | Request file generated offline, imported into TG | Air-gapped machines, no internet access |
Online activation requires:
- TLS 1.2 support (mandatory since March 2024).
- TG software version >= 1.4.
- CodeMeter Runtime >= 6.70.
License Key Format
B&R license keys follow this pattern:
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
25 characters total (5 groups of 5), alphanumeric. This key is your primary asset – treat it like a serial number. It is NOT the dongle serial number. The key is what you activate on the dongle; the dongle is the storage medium.
3. Identifying What Licenses You Have
Step 1: Locate the Physical TG Dongle
Physically inspect the machine and control cabinet:
- Check the engineering PC USB ports.
- Check the PLC panel – some machines have the dongle permanently plugged into the PLC.
- Check spare parts boxes and documentation folders.
- Check the CF card (CompactFlash) in the PLC – license documentation is sometimes stored there.
- The dongle is a small USB stick, typically green/blue, branded “CodeMeter” or “B&R.”
Step 2: Inspect the Dongle with Technology Guarding Software
- Install TG software (see Section 4).
- Plug the dongle into your PC.
- Launch Technology Guarding (BR.AS.License.UI.exe).
- The UI will show all licenses on the connected dongle.
Alternative: CodeMeter Control Center
- Install CodeMeter Runtime (included with TG installation).
- Launch CodeMeter Control Center from Start Menu.
- Navigate to the dongle under “Devices.”
- Select “License” tab to see individual license entries.
Step 3: Check PLC for AR Licenses
AR licenses stored on the PLC can be checked via:
Method A: SDM (Service & Diagnostics Manager)
- Connect to PLC via Ethernet.
- Open SDM in Automation Studio.
- Navigate to PLC > Diagnostics > License.
Method B: OPC-UA
- Connect to PLC OPC-UA server.
- Browse to
Automation.Components.AR.Licensenamespace. - Read license status nodes.
Method C: PLC Web Interface
- Open PLC IP in browser.
- Navigate to System > License (on supported firmware versions).
Step 4: Find License Documentation on the CF Card
B&R PLCs use CompactFlash (or CFast) cards. Remove the card and check:
/System/License/
/System/Documentation/
/License/
/Config/
Look for files named:
LicenseKey*.txtLicense.txtActivationLog*.xml- Any .txt or .pdf files with “license” in the name
Step 5: Check AS for Installed mapp Components
- Open the existing AS project (if available).
- In Solution Explorer, expand
Logical View > mapp. - Each mapp component with a lock icon requires a license.
- Check
Project > Properties > mappfor a summary. - If AS is running with the dongle, open
Tools > Technology Guardingto see what mapp licenses are detected.
Step 6: Determine Active vs. Installed Licenses
A license being “present” on the dongle does not mean it is “in use.” To determine active usage:
- AR licenses: always in use if the PLC is running.
- AS licenses: in use if AS is open on a PC with the dongle.
- mapp licenses: in use if mapp function blocks are instantiated in the running project and the PLC is executing them.
- Check PLC runtime: if the PLC is running, AR and active mapp licenses are in use. A PLC in stop state still “holds” its AR license but may not require mapp licenses.
4. Technology Guarding Software Setup
Download
TG software is available from B&R’s website. It is included in the PVI Development Setup download package.
Direct download path on B&R website:
- Navigate to
www.br-automation.com - Downloads > Software > Automation Studio > PVI Development Setup
- Download the version matching your AS version.
The TG component within the installer is: USB: 1TG0500.02 (Technology Guarding).
Installation
- Run the PVI Development Setup installer.
- When prompted for components, select only:
USB: 1TG0500.02(Technology Guarding)PVI Runtime(if not already installed)
- Complete the installation.
The installer places:
- TG application:
C:\Program Files\BR\TechnologyGuarding\BR.AS.License.UI.exe - State file:
C:\ProgramData\BR\TechnologyGuarding\BR.AS.License.UI.state - CodeMeter Runtime service (installed as Windows service)
Version Requirements
| Component | Minimum Version | Why |
|---|---|---|
| TG Software | >= 1.4 | TLS 1.2 support for B&R server communication |
| CodeMeter Runtime | >= 6.70 | Required for AS operation and modern crypto |
| .NET Framework | >= 4.6 | TLS 1.2 API availability |
| Windows | 7 SP1 / 10 / 11 / Server 2012 R2+ | OS compatibility |
Critical: Since March 2024, B&R’s license server requires TLS 1.2. AS versions below 4.6 cannot license from within AS itself. Use TG standalone >= v1.4 instead.
CodeMeter Runtime Service
- Must be running for AS to detect the dongle and validate licenses.
- Service name:
CodeMeter Runtime Server(or localized equivalent on non-English systems). - Start manually: Services MMC, or:
net start "CodeMeter Runtime Server" - Set to Automatic startup for production PCs.
Server Configuration
When first launching TG standalone:
- TG will prompt for server credentials.
- If you do not have the OEM’s B&R portal credentials, you can leave the username/password blank or fill with placeholder text.
- For activation with a known license key, the server communication is minimal – the key is validated, not authenticated against a user account.
- The TG standalone tool can activate a license with just the key string, even without a valid portal login.
Offline Licensing Mode
For air-gapped systems (no internet at the PLC or engineering PC):
- On an internet-connected PC with TG installed, start the offline activation process.
- TG generates a request file (XML/encrypted) containing the license key and container ID.
- Transfer the request file to the B&R license server manually (e.g., via email from a different PC).
- The server returns an activation file.
- Transfer the activation file back to the air-gapped PC.
- Import the activation file into TG.
Alternatively, B&R support can process offline activations via email if you provide the dongle serial number and license key.
5. License Transfer Between Hardware Units
Moving Licenses from Old Dongle to New Dongle
Prerequisites:
- Both dongles must be functional (not stuck in firmware update mode).
- Licenses to be transferred must NOT be expired (expired licenses cannot be returned).
Method A: Via PLC (Network Transfer)
- Plug the source dongle (old) into the target PLC’s USB port.
- Connect to the PLC from AS (or SDM).
- Activate the new licenses on the PLC’s TG element (or a dongle already on the PLC).
- Once the PLC has the licenses, the source dongle’s licenses are consumed (transferred).
- Remove the old dongle.
Method B: Direct Transfer (PC-Based)
- Plug the source dongle (old) into the PC.
- Plug the target dongle (new) into the PC.
- Open TG software.
- Select the source dongle, choose “Deactivate” or “Return” for specific licenses.
- If return succeeds, activate those licenses on the target dongle.
Critical Limitation: If the source dongle has ANY expired license, the return operation may be blocked for ALL licenses on that dongle. See Section 7 for the workaround.
Software Container Migration
Do NOT use software containers on VMs. Software containers are bound to hardware fingerprints. Any of the following will invalidate the container:
- VM migration (moving to different host hardware).
- VM snapshot revert (restores old hardware fingerprint data).
- VM clone/copy.
- Virtual hardware upgrade (changing vCPU count, RAM, NIC MAC).
- Hypervisor host change.
If you must use a software container:
- Use it only on a physical PC.
- Do not upgrade the PC’s hardware.
- Back up the container activation files (from
C:\ProgramData\BR\TechnologyGuarding\).
6. Activating Licenses Without Original B&R Portal Account
Using TG Standalone with License Key Only
This is the most common scenario when the OEM is gone:
- Install TG software (Section 4).
- Plug in a functional TG dongle (new or existing).
- Launch TG (BR.AS.License.UI.exe).
- When prompted for credentials, enter any placeholder text for username and password (e.g., “user” / “user”). The TG standalone tool does not strictly validate these for license key activation.
- Select “Activate license online”.
- Enter the 25-character license key:
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx. - Select the target container (dongle) from the dropdown.
- Click Activate.
If the license key is valid and has activations remaining, the activation will succeed without OEM portal credentials.
If Online Activation Fails
Possible causes:
- License key already fully activated on other dongles (max activations reached).
- B&R server rejects activation for keys tied to accounts in bad standing (bankrupt OEM).
- Network/firewall blocking TLS 1.2 to B&R server.
Escalation path:
- Contact B&R support (
[email protected]). - Provide the license key and dongle serial number.
- Explain the situation (OEM defunct, you are the new machine owner/maintainer).
- B&R can:
- Reset activation counts on the server.
- Reassign licenses to a new account.
- Issue replacement license keys in extreme cases.
Getting Help from B&R Support
When contacting B&R support as a non-original customer:
- Have ready: license keys, dongle serial number(s), PLC serial number, machine location.
- Explain clearly: “The OEM (name) is no longer in business. We maintain this machine and need to manage the B&R licenses.”
- B&R support is generally helpful in these situations, but response times vary.
- For safety-related licenses (mapp Safety, Safety Designer), B&R may require additional verification.
- Create a new B&R portal account in your company’s name before calling – they may reassign licenses to your account.
7. Common License Problems and Solutions
Problem: TG Dongle Stuck in Firmware Update Mode (WB47 / WB67)
Symptoms:
- TG software detects the dongle but shows it as “updating” indefinitely.
- Error code WB47 or WB67 in CodeMeter / TG.
- AS cannot detect the dongle.
- Dongle LED may flash continuously or stay off.
Cause: The dongle’s CodeMeter firmware became corrupted during an update attempt, or the update was interrupted (USB disconnect, power loss, AS crash).
Solution:
- There is no user-serviceable fix. The dongle must be returned to B&R for repair/replacement.
- Contact B&R support with the dongle serial number.
- B&R will typically re-flash the dongle and restore licenses from their server records (if licenses were properly activated and recorded).
- If the dongle is out of warranty, there may be a cost for this service.
- Do NOT attempt to flash the dongle firmware yourself using third-party CodeMeter tools.
Prevention:
- Never disconnect the dongle while TG or AS is running.
- Never unplug during a license activation/deactivation operation.
- Use a USB port with stable power (not a hub, not a front-panel port on a flaky PC).
Problem: AS License Expired Before 1 Year
Symptoms: AS shows “license expired” despite being activated less than a year ago.
Cause: The TG system time on the dongle was reset or corrupted. If the dongle’s internal clock was not properly synchronized, the expiration calculation can be wrong.
Solution:
- Ensure the PC’s system time is correct.
- Plug the dongle in and open TG software.
- TG should re-synchronize the dongle’s internal time with the PC.
- If the dongle time is severely off, the license may appear expired permanently.
- Contact B&R support for a license key reset in this case.
Problem: TLS 1.2 Blocking
Symptoms: TG cannot connect to B&R license server. Error about SSL/TLS or connection refused.
Cause: Since March 2024, B&R requires TLS 1.2. Older TG versions or .NET configurations default to TLS 1.0/1.1.
Solution: Force TLS 1.2 in .NET via Windows Registry:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001
"SystemDefaultTlsVersions"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001
"SystemDefaultTlsVersions"=dword:00000001
After applying, restart the PC and retry.
Alternative: Upgrade TG to >= 1.4 and CodeMeter Runtime to >= 6.70.
Problem: CodeMeter Runtime Service Not Running
Symptoms: AS shows “no dongle found” or “license system unavailable.” TG software shows no containers.
Solution:
net start "CodeMeter Runtime Server"
If the service fails to start:
- Check Windows Event Viewer for errors.
- Reinstall CodeMeter Runtime from the TG installer.
- Ensure no other CodeMeter instances from other software (Lenze, Bosch) are conflicting.
- Restart the PC.
Prevention: Set the service to Automatic startup type.
Problem: “Maximum Number of Activations Reached”
Symptoms: TG reports that the license key cannot be activated because all activations are used.
Cause A: Genuine over-activation. The license was activated on multiple dongles/PCs by the OEM.
Cause B: File permission issue. TG cannot write its state file.
Check file permissions:
The TG state file must be writable:
C:\ProgramData\BR\TechnologyGuarding\BR.AS.License.UI.state
- Open Properties > Security on this file.
- Ensure the current user has Full Control.
- Ensure the folder
C:\ProgramData\BR\TechnologyGuarding\is also writable. - If permissions are correct and activations are genuinely exhausted, contact B&R support for a reset.
Problem: License Activated on Wrong Dongle (Third-Party Dongle)
Symptoms: A license appears on a dongle that is not the B&R TG dongle. CodeMeter Control Center shows the license under a different manufacturer’s container.
Cause: If the PC has CodeMeter drivers from another vendor (e.g., Lenze, Bosch Rexroth), the TG activation may target the wrong container.
Solution:
- Disconnect all non-B&R CodeMeter dongles.
- Open CodeMeter Control Center.
- Identify the B&R dongle by its serial number.
- In TG, explicitly select the correct dongle/container before activating.
- If already activated on the wrong container, return it from the wrong container first, then activate on the correct one.
Problem: Software Container Invalidation in VMs
Symptoms: After VM migration or snapshot, all TG licenses show as invalid or missing.
Cause: Software containers are hardware-fingerprint-bound. VM changes invalidate the fingerprint.
Solution:
- Do not use software containers on VMs (preventive measure).
- If already in this state: return the invalid container activation (may not work if fingerprint is completely changed).
- Re-activate licenses on a USB dongle instead.
- If no dongle is available, contact B&R support.
Error Code Reference Table
| Error Code | Source | Description | Severity | Resolution |
|---|---|---|---|---|
| WB47 | CodeMeter | Dongle firmware update failed / stuck | Critical | Return dongle to B&R |
| WB67 | CodeMeter | Dongle communication error / firmware issue | Critical | Return dongle to B&R |
| 10080 | TG / .NET | Network timeout connecting to B&R server | Medium | Check firewall, TLS 1.2 |
| 262 | CodeMeter | License not found on container | Medium | Check license key, container ID |
| 71 | CodeMeter | Container access denied / permission issue | Medium | Check file permissions on state file |
| 280 | TG | Maximum activations reached | Medium | Return unused activations or contact B&R |
| 281 | TG | License expired | Medium | Renew or use evaluation |
| 282 | TG | License not yet valid (date issue) | Low | Check system time |
| 283 | TG | License returned successfully | Info | Normal operation |
| 501 | CodeMeter | Dongle removed during operation | Medium | Reinsert dongle, retry |
| 502 | CodeMeter | Dongle hardware failure | Critical | Replace dongle |
| 600 | CodeMeter | Software container fingerprint mismatch | Critical | Reactivate on new container |
| 601 | CodeMeter | Software container corrupted | Critical | Return and reactivate |
| 700 | TG | Server communication failed | Medium | Check internet, TLS 1.2 |
| 701 | TG | Invalid license key format | Low | Check key: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx |
| 702 | TG | License key not found in B&R database | Medium | Verify key with B&R support |
| 703 | TG | Account / credential validation failed | Medium | Use placeholder credentials with standalone TG |
8. Evaluation Licenses
Using AS Evaluation Licenses as a Stopgap
When you have no valid AS license and need immediate access to the IDE for diagnostics or minor changes:
- Download Automation Studio from B&R website (full installation).
- During installation, select “Evaluation” mode.
- AS will run in evaluation mode for 30 days (typical; may vary by version).
What evaluation mode provides:
- Full AS IDE functionality.
- Ability to connect to PLCs, upload/download projects.
- Ability to go online and diagnose.
- Ability to edit logic and download changes.
What evaluation mode restricts:
- Time-limited (30 days typically).
- May have watermarks or “Evaluation Mode” indicators.
- Not suitable for safety-related work (mapp Safety changes).
- Cannot be used for production deployment in a commercial setting.
When Evaluation Licenses Are Sufficient
Evaluation AS licenses are appropriate for:
- Initial forensics on an inherited machine (reading the project, understanding logic).
- Diagnostics and troubleshooting (going online, monitoring variables).
- One-time code changes (quick fixes, parameter adjustments).
- Emergency recovery situations where you need AS access immediately.
Evaluation AS licenses are NOT appropriate for:
- Ongoing development (they expire).
- Safety-related modifications (mapp Safety requires proper licensing).
- Any work that needs to be audited or documented for regulatory compliance.
Important: Evaluation + Existing Dongle
You can run AS in evaluation mode while keeping the TG dongle plugged in for AR and mapp licenses. The evaluation license covers AS IDE access; the dongle covers the runtime and mapp component licensing. This is a practical workaround when the AS license on the dongle is expired but the AR/mapp licenses are still valid and you cannot return them.
9. mapp Component Licenses
Common mapp Components
| mapp Component | Function | License Type | Notes |
|---|---|---|---|
| mapp View | HMI visualization, web-based | Perpetual | Required for any HMI development |
| mapp AlarmX | Alarm management, logging | Perpetual | Handles alarm configuration and display |
| mapp IO | I/O configuration and diagnostics | Perpetual | Auto-discovery of I/O modules |
| mapp User | User authentication and roles | Perpetual | Login/logout, role-based access |
| mapp Safety | Safety function blocks | Perpetual | Requires Safety Designer license separately |
| Safety Designer | Safety function configuration | Perpetual | Part of mapp Safety ecosystem |
| mapp Motion | Motion control | Perpetual | Axis configuration, camming, gearing |
| mapp CNC | CNC functionality | Perpetual | G-code support, CNC machining |
| mapp OPC UA | OPC UA server and client | Perpetual | Industry-standard communication |
| mapp Database | Database connectivity | Perpetual | SQL/NoSQL database access |
| mapp Audit | Audit trail logging | Perpetual | Traceability and compliance |
| mapp Energy | Energy monitoring | Perpetual | Power consumption tracking |
Determining Which mapp Components Are Licensed
Method 1: TG Software
- Open TG with dongle connected.
- Browse the license list on the container.
- Each mapp license appears as a separate entry (e.g., “mappView,” “mappAlarmX”).
Method 2: CodeMeter Control Center
- Open CodeMeter Control Center.
- Select the dongle.
- View Product Items – each mapp component has a distinct product code.
Method 3: AS Project
- Open the AS project.
- Expand
Logical View > mappin Solution Explorer. - Each mapp component folder present indicates that component is used in the project.
- Cross-reference with TG to confirm licensing.
What Happens When a mapp License Expires
- AS behavior: AS will show a warning when opening the project. You can still view the code but may not be able to download to PLC.
- PLC behavior: The PLC continues to run the existing code. mapp components already loaded and executing on the PLC do not stop when the license expires on the dongle/PC.
- Download restriction: You cannot download a project to PLC if required mapp licenses are missing/expired on the TG container used by AS.
- Runtime implications: For mapp components that check licenses at runtime (rare), functionality may degrade.
mapp Safety Specific Considerations
mapp Safety licensing has additional constraints:
- Safety Designer requires its own TG license (separate from mapp Safety runtime).
- Safety-related function blocks will not compile/download without valid Safety Designer and mapp Safety licenses.
- Do not attempt to modify safety logic without proper licensing. If safety logic needs changes and no safety license is available, contact B&R support immediately – this is a safety-critical gap.
- Safety licenses may have additional transfer restrictions compared to standard mapp licenses.
10. Automation Runtime Licenses
AR License Types
| License Type | Description | Container | Duration |
|---|---|---|---|
| AR Standard | Standard Automation Runtime | PLC or Dongle | Perpetual |
| AR Safety | AR with Safety functionality | PLC or Dongle | Perpetual |
| AR Fieldbus | AR with Fieldbus support | PLC or Dongle | Perpetual |
| AR Service | Service contract license (enables updates) | PLC | Perpetual (valid while service active) |
AR License Storage Locations
AR licenses can be stored on:
- The PLC itself (via X20CMR module or built-in TG element).
- A USB dongle plugged into the PLC.
- A software container on the PC running AS (for download-time validation only – the AR license itself must be on the PLC or its dongle).
Best practice: AR licenses should be on the PLC or a dongle permanently attached to the PLC, not on a portable dongle shared with AS.
AR License Activation via PLC
If the PLC has a TG-capable element (X20CMR module):
- Connect the PLC to the network with internet access.
- In TG, select the PLC’s TG element as the target container.
- Activate the AR license key on the PLC’s TG element directly.
- No dongle required.
If using a dongle:
- Plug the TG dongle into the PLC’s USB port.
- From a network-connected PC, use TG or SDM to activate the AR license on the dongle while it’s on the PLC.
- Alternatively, plug the dongle into a PC, activate the AR license, then move the dongle to the PLC.
Checking AR License Status Without AS
If AS is unavailable (no license, no installation):
- SDM (Service & Diagnostics Manager) can connect to the PLC independently and show license status.
- PLC Web Interface: Open the PLC’s IP address in a browser. Navigate to System > License (if available on your firmware version).
- OPC-UA: Connect to the PLC’s OPC-UA server and read the license status nodes under
Automation.Components.AR.License. - Physical inspection: Check if an X20CMR module is installed in the X20 bus. Its LED indicators can show TG status.
- FTP/SFTP: Connect to the PLC via FTP and check
/System/License/directory for license files.
AR Service License
The AR service license is a separate concept from the AS service contract:
- It enables the PLC to receive firmware updates.
- Without it, the PLC still runs but cannot be updated.
- It is perpetual but may have a validity period linked to the service contract.
- If the OEM’s service contract has lapsed, the AR service license may show as expired, but the PLC continues to run its current firmware.
11. License Recovery Scenarios
Scenario A: OEM Went Bankrupt
What happens to licenses:
- Perpetual licenses (AR, mapp) remain valid on their containers indefinitely.
- AS licenses will stop auto-renewing after the current period expires (typically 1 year from last renewal).
- License keys remain valid on B&R’s servers unless explicitly revoked (which B&R does not typically do).
Your position:
- You own the physical dongle(s) and PLC(s) – you have physical possession of the licensed hardware.
- B&R’s general policy: licenses follow the hardware, not the account. If you have the dongle and PLC, you can use the licenses.
- AS auto-renewal stopping means you must find an alternative (evaluation, purchasing new AS license, or contacting B&R to transfer the license to your account).
Action items:
- Inventory all dongles, PLCs, and license keys immediately.
- Document everything (serial numbers, key strings, dongle serials).
- Contact B&R support to open a support case in your company’s name.
- Request license transfer to your account.
- Negotiate a new service contract with B&R if continued AS licensing is needed.
Scenario B: Lost TG Dongle
Impact:
- All licenses stored on that dongle are inaccessible.
- AS will not function (no AS license).
- mapp component licenses for download are unavailable.
- If the dongle was on the PLC, AR licenses may also be lost.
Recovery options:
- Check if B&R’s server has records of the licenses on the lost dongle (provide dongle serial number to support).
- B&R may be able to deactivate the lost dongle on their server and re-issue licenses on a new dongle.
- This process requires proof of ownership (PLC serial number, original purchase records if available).
- If B&R cannot verify the licenses, you may need to purchase replacement licenses.
Prevention:
- Keep the dongle permanently installed in the PLC cabinet (not carried around).
- Document the dongle serial number and keep it in multiple locations.
- Back up the contents of the CF card, which may contain license records.
Scenario C: Damaged Dongle
If the dongle is physically damaged but still detected by the PC:
- Try to return all licenses to the B&R server immediately.
- If some licenses cannot be returned (expired), contact B&R support.
- Once all returnable licenses are recovered, B&R can issue a replacement dongle with the returned licenses.
If the dongle is completely dead (not detected):
- Same as lost dongle (Scenario B).
- B&R may need the physical dongle for forensics. Send it to them if they request it.
Warranty:
- TG dongles have a limited warranty (typically 2 years).
- If under warranty, B&R will replace the dongle and restore licenses free of charge.
- If out of warranty, there may be a replacement cost plus a fee for license restoration.
Scenario D: Dongle with Stuck Licenses (Cannot Return Any)
The “sticky dongle” problem:
This occurs when:
- One license on the dongle has expired.
- You try to return other (still-valid) licenses from the dongle.
- The return operation fails because the dongle contains at least one expired license.
Root cause: B&R’s design intentionally prevents returning licenses from a container that contains expired licenses, to prevent license farming / abuse.
Workaround: Use Evaluation AS + Keep Dongle on PLC
- Install AS in evaluation mode (30 days, renewable by reinstalling).
- Keep the TG dongle plugged into the PLC (not the PC).
- The dongle’s AR and mapp licenses continue to serve the PLC.
- Use evaluation AS for IDE access (diagnostics, minor changes).
- The expired AS license on the dongle does not affect PLC operation – only AS IDE access.
Escalation:
- Contact B&R support.
- Explain that an expired license on the dongle is blocking return of other licenses.
- B&R support may be able to:
- Manually invalidate the expired license on their server.
- Enable a special return operation.
- Issue replacement license keys for the trapped perpetual licenses.
- This escalation may take days to weeks. Plan accordingly.
Scenario E: Buying Used Equipment
When purchasing a used B&R machine:
- Verify that TG dongles are included with the machine.
- Document all dongle serial numbers and note which licenses are on them.
- Request license transfer documentation from the seller.
- Contact B&R to confirm the licenses can be transferred to your account.
- Be aware that AS licenses from a defunct seller will eventually expire and cannot be renewed without a service contract in your name.
Buying from an auction / liquidation:
- Same as above, but seller documentation may be unavailable.
- B&R may require proof that the seller had legitimate ownership before transferring licenses.
- In some cases, licenses may not be transferable if the original account is in bad standing.
Scenario F: Upgrading to Automation Studio 6 (License Implications)
AS6 introduces a new licensing model called shared upgrades that differs from AS4’s perpetual dongle model. If you are migrating from CP1584 to a modern controller, you will need AS6 and its licensing affects your planning:
| Aspect | AS4 (Current) | AS6 (New) |
|---|---|---|
| AS license delivery | TG dongle (USB) | Shared upgrades + TG or software container |
| AS license type | Perpetual or annual | Subscription-based upgrades |
| AR license | Perpetual on PLC | Perpetual on PLC (unchanged) |
| mapp components | TG-licensed, perpetual | mapp 6 with updated licensing model |
| CodeMeter requirement | Yes | Yes (updated version) |
Key implications for the OEM-unavailable scenario:
- Existing AS4 perpetual licenses do not automatically carry to AS6. You need a new AS6 license or service contract.
- AR licenses (perpetual) on the PLC are unaffected by the AS version — the runtime doesn’t change.
- If you plan to use evaluation AS6 for migration work, note that evaluation periods are shorter and may not support all mapp 6 components.
- Contact B&R support early to discuss a migration license package — they may offer discounted upgrades for existing hardware owners.
- Community migration tools at
github.com/br-automation-community/as6-migration-toolscan help identify license implications in your project.
See firmware-version-mgmt.md §5.3.1 for the full AS4→AS6 migration guide.
12. Key Findings
-
Inventory immediately. Document every dongle serial number, license key string, PLC serial number, and X20CMR module before anything else is lost. Store copies off-site.
-
Do not let AS licenses expire on a shared dongle. An expired AS license on the same dongle as perpetual AR/mapp licenses traps all licenses and prevents returns. Monitor AS license expiration dates via TG software.
-
Keep the dongle on the PLC. For production machines, the TG dongle should live in the PLC cabinet, not on the engineering PC. This isolates AR/mapp licenses from PC-side AS license issues.
-
Use TG standalone >= v1.4 for licensing operations. Do not rely on AS < 4.6 for license management – it lacks TLS 1.2 support and cannot communicate with B&R’s license server after March 2024.
-
Never use software containers on VMs. Any VM migration, snapshot, or hardware change invalidates the container. Use physical USB dongles exclusively for production.
-
Force TLS 1.2 in Windows Registry. If TG or AS cannot connect to the B&R license server, apply the .NET SchUseStrongCrypto registry keys before spending time on network troubleshooting.
-
CodeMeter Runtime Service must run. If AS shows “no dongle” and the dongle is physically present, check that the CodeMeter Runtime Server Windows service is running before assuming the dongle is broken.
-
Evaluation AS licenses are a viable stopgap. Run AS in 30-day evaluation mode while keeping the dongle on the PLC for AR/mapp licensing. This sidesteps the expired-AS-on-shared-dongle problem.
-
TG standalone does not strictly validate portal credentials. When activating a license key on a dongle, placeholder credentials work. You do not need the OEM’s B&R portal account.
-
A stuck dongle (WB47/WB67) is a hardware problem. Do not waste time trying software fixes. Return the dongle to B&R repair immediately and use evaluation AS in the interim.
-
Expired licenses don’t stop running programs immediately. Most mapp technology components continue to function with expired licenses but display warnings. However, some features may be disabled after a grace period.
-
Offline licensing is possible for air-gapped systems. B&R provides an offline activation procedure using challenge/response codes for systems without internet connectivity.
13. Cross-References
| Related Document | Relevance |
|---|---|
| firmware.md | Firmware architecture — where license validation fits in the AR boot sequence |
| firmware-version-mgmt.md | Version identification — matching firmware versions to valid license files |
| cf-card-boot.md | CF card storage — license files reside on the CF card system partition |
| config-file-formats.md | Configuration files — where license configuration and TG settings are stored |
| ftp-web-interface.md | FTP access — reading license files from the CF card remotely |
| access-recovery.md | Credential recovery — regaining access when license management requires authentication |
| cp1584-forensics.md | Forensic extraction — pulling license information from an undocumented system |
| bootloader-recovery.md | Recovery procedures — what happens to licenses when the system is reinstalled from scratch |
| online-changes.md | Runtime changes — how mapp technology license checks behave during online modifications |
| cybersecurity-hardening.md | Security hardening — protecting license dongles and TG communication from interception |
| remanufacturing.md | Migration — transferring licenses to replacement hardware during system replacement |
| ar-rtos.md | AR OS internals — CVE table includes vulnerabilities affecting TG and licensing infrastructure |
| project-reconstruction.md | Project reconstruction — determining what licenses are needed when reconstructing an AS project |
14. Sources
- B&R Automation Studio documentation, Automation Runtime documentation – BrAutomation.com downloads section.
- B&R Technology Guarding product page and knowledge base articles.
- Wibu-Systems CodeMeter documentation – CodeMeter.com.
- B&R Knowledge Base article: “Technology Guarding – TLS 1.2 requirement since March 2024.”
- B&R Knowledge Base article: “License activation with Technology Guarding standalone.”
- B&R Knowledge Base article: “What to do when your TG dongle is stuck in firmware update mode.”
- B&R Knowledge Base article: “AS license expiration and auto-renewal behavior.”
- B&R Knowledge Base article: “Returning licenses from a container with expired licenses.”
- B&R Technical Note: “Offline licensing procedure for air-gapped systems.”
- Wibu-Systems CodeMeter error code reference (WB47, WB67, etc.).
- Community forum reports from automation engineers maintaining inherited B&R equipment.
- Practical field experience with CP1584 PLCs from defunct OEMs.
Python Diagnostic Scripts for B&R CP1584: PVI and OPC-UA
Overview
This document covers building automated diagnostic, monitoring, and regression scripts for B&R CP1584 PLCs using Python. Two primary communication paths exist: OPC-UA (runs directly on the controller, no Windows middleware needed) and PVI (requires B&R PVI Manager on Windows). For a one-man automation engineer maintaining undocumented machines, Python scripts are force multipliers — they automate repetitive diagnostic tasks, capture trends, and generate reports.
See also: pvi-api.md, opcua.md, cp1584-forensics.md
1. Communication Path Comparison
| Feature | OPC-UA (asyncua) | PVI (pvipy) |
|---|---|---|
| Requires Windows? | No — runs from Linux, macOS, Windows | Yes — requires PVI Manager (Windows service) |
| Requires B&R license? | No (OPC-UA server is part of AR) | Yes (PVI Development Setup + license) |
| Install to PLC? | Must be configured in AS project | Must be configured in AS project |
| Anonymous access | Possible if OEM configured it | Uses ANSL line — no user auth on PVI itself |
| Variable browsing | Full namespace browsing | Full variable namespace access |
| Write/force variables | Yes (if access level permits) | Yes |
| Subscription/monitoring | Yes — native OPC-UA subscriptions | Yes — PVI callbacks |
| Python library | asyncua (pip install asyncua) | pvipy (pip install pvipy) |
| Latency | Network round-trip (~1-5 ms on LAN) | Slightly higher (PVI Manager overhead) |
| Best for | Linux-based diagnostics, remote monitoring | Windows-based engineering workstation |
Recommendation: If the OPC-UA server is enabled on the CP1584 (check port 4840 with nmap), use OPC-UA via asyncua. It requires no Windows middleware and no B&R PVI license. If OPC-UA is not enabled, use PVI from a Windows machine.
⚠️ PVI 6.x Breaking Change: INA2000 Removed
If your engineering workstation runs Automation Studio 6 (PVI 6.x), the legacy INA2000 protocol is completely removed — only ANSL and SNMP lines are supported. Any existing PVI-based scripts using
pvipywith INA2000 connections will fail with missing DLL errors. You must update all connections to use ANSL (TCP port 1212, backward-compatible with all AR ≥ V4.08 including CP1584). See pvi-api.md §2 for the full migration checklist.
2. Prerequisites and Environment Setup
2.1 OPC-UA Path (Recommended)
pip install asyncua
## For data logging to CSV and reporting
pip install pandas matplotlib
## For scheduling automated scripts
pip install schedule
Verify OPC-UA is enabled on the PLC:
nmap -p 4840 <PLC_IP>
# PORT STATE SERVICE
# 4840/tcp open http-alt
If port 4840 is open, OPC-UA is running. Test anonymous access:
import asyncio
from asyncua import Client
async def test_connection():
url = "opc.tcp://<PLC_IP>:4840"
async with Client(url=url, timeout=5) as client:
root = client.get_root_node()
print(f"Connected! Root node: {root}")
children = await root.get_children()
print(f"Root has {len(children)} children")
asyncio.run(test_connection())
2.2 PVI Path (Windows Only)
Install B&R PVI Development Setup:
- Download PVI Development Setup from B&R’s website (requires a B&R portal account)
- Install PVI Development Setup on your Windows machine
- Without a PVI license, PVI runs in trial mode (2-hour limit, then PVI Manager must be restarted)
PVI License: Order code 1TG0500.02 (+ TG Guard 0TG1000.02). Without it, the 2-hour trial cycle is a significant limitation for long-running monitoring scripts.
pip install pvipy
PVI Manager (PviMan.exe) must be running as a Windows service or process. It acts as the middleware between your Python code and the PLC.
See also: pvi-api.md for full PVI architecture details
3. OPC-UA: Browsing the Variable Namespace
When you have an undocumented CP1584, the first step is discovering what variables are available via OPC-UA.
3.1 Recursive Namespace Browser
import asyncio
from asyncua import Client
PLC_URL = "opc.tcp://192.168.1.100:4840"
async def browse_namespace(node, indent=0):
children = await node.get_children()
for child in children:
name = await child.get_browse_name()
nodeid = child.nodeid
display = await child.get_display_name()
dtype = await child.get_data_type()
accessible = await child.read_attribute(0x1f) # AccessLevel
print(f"{' ' * indent}{name.Name} [{nodeid}] - {display.Text}")
if len(children) < 50:
await browse_namespace(child, indent + 1)
async def main():
async with Client(url=PLC_URL, timeout=10) as client:
print("=== B&R OPC-UA Namespace Browser ===")
root = client.get_root_node()
print(f"Root: {await root.get_browse_name().Name}")
objects = client.nodes.objects
print(f"\nObjects node children:")
await browse_namespace(objects)
asyncio.run(main())
3.2 Extract All Variable Names to CSV
For documentation purposes, dump the entire variable namespace to a CSV:
import asyncio
import csv
from asyncua import Client
from datetime import datetime
PLC_URL = "opc.tcp://<PLC_IP>:4840"
OUTPUT_FILE = "br_namespace_dump.csv"
async def scan_node(node, writer, depth=0, max_depth=6):
if depth > max_depth:
return
try:
children = await node.get_children()
except Exception:
return
for child in children:
try:
browse_name = await child.get_browse_name()
display_name = await child.get_display_name()
node_class = await child.read_node_class()
row = {
"timestamp": datetime.now().isoformat(),
"nodeid": str(child.nodeid),
"browse_name": browse_name.Name,
"display_name": display_name.Text,
"node_class": str(node_class),
"depth": depth,
}
if node_class.name == "Variable":
try:
val = await child.get_value()
row["value"] = str(val)
except Exception:
row["value"] = "N/A"
try:
dtype = await child.get_data_type()
row["data_type"] = str(dtype)
except Exception:
row["data_type"] = "Unknown"
writer.writerow(row)
await scan_node(child, writer, depth + 1, max_depth)
except Exception as e:
pass
async def main():
async with Client(url=PLC_URL, timeout=10) as client:
objects = client.nodes.objects
with open(OUTPUT_FILE, "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=[
"timestamp", "nodeid", "browse_name", "display_name",
"node_class", "depth", "value", "data_type"
])
writer.writeheader()
await scan_node(objects, writer)
asyncio.run(main())
print(f"Namespace dumped to {OUTPUT_FILE}")
3.3 B&R Variable Naming Conventions
B&R OPC-UA variable names follow these patterns:
| Pattern | Meaning | Example |
|---|---|---|
::ProgramName:VariableName | Global variable in program | ::MainProgram:StartButton |
::ProgramName:FunctionBlockInstance.Output | FB instance output | ::MainProgram:MotorControl.RunFlag |
ns=2;s=::AsGlobalPV:VariableName | Global persistent variable | ::AsGlobalPV:MachineSpeed |
ns=6;s=... | Namespace 6 — typically B&R system vars | ns=6;s=::AsGlobalPV:... |
Channel1.AI[0] | I/O mapping reference | ::MainProgram:Axis1.Status |
The namespace index (ns=X;) varies depending on the OPC-UA configuration. Common indices:
ns=0— OPC-UA standardns=1orns=2— B&R default for application variables- Higher indices for specific OPC-UA views or mapp components
4. OPC-UA: Reading and Writing Variables
4.1 Read Single Variable
import asyncio
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
async def read_variable(node_id):
async with Client(url=PLC_URL, timeout=5) as client:
node = client.get_node(node_id)
value = await node.get_value()
name = await node.get_browse_name()
print(f"{name.Name} = {value} (type: {type(value).__name__})")
return value
asyncio.run(read_variable("ns=2;s=::AsGlobalPV:MachineSpeed"))
4.2 Read Multiple Variables (Batch)
import asyncio
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
VARIABLES = {
"MachineSpeed": "ns=2;s=::AsGlobalPV:MachineSpeed",
"EmergencyStop": "ns=2;s=::MainProgram:EmergencyStop",
"MotorRunning": "ns=2;s=::MainProgram:MotorControl.RunFlag",
"CycleTime_ms": "ns=2;s=::MainProgram:CycleTime",
"PartCount": "ns=2;s=::AsGlobalPV:PartCounter",
}
async def read_all():
async with Client(url=PLC_URL, timeout=5) as client:
print(f"{'Variable':<25} {'Value':<20} {'Type'}")
print("-" * 60)
for name, node_id in VARIABLES.items():
try:
node = client.get_node(node_id)
value = await node.get_value()
print(f"{name:<25} {str(value):<20} {type(value).__name__}")
except Exception as e:
print(f"{name:<25} ERROR: {e}")
asyncio.run(read_all())
4.3 Write Variable (B&R-Specific Method)
B&R OPC-UA servers require a specific write pattern. The standard node.write_value() may return BadWriteNotSupported even when the variable is writable in UAExpert. Use this workaround:
import asyncio
from asyncua import Client, ua
from asyncua import Node
PLC_URL = "opc.tcp://<PLC_IP>:4840"
async def write_br_variable(node_id, value):
async with Client(url=PLC_URL, timeout=5) as client:
node = client.get_node(node_id)
attr = ua.WriteValue()
attr.NodeId = node.nodeid
attr.AttributeId = ua.AttributeIds.Value
attr.Value = ua.DataValue(value)
params = ua.WriteParameters()
params.NodesToWrite = [attr]
result = await node.write_params(params)
if result[0].is_good():
print(f"Write successful: {value}")
else:
print(f"Write failed: {result[0]}")
asyncio.run(write_br_variable("ns=2;s=::AsGlobalPV:ManualOverride", True))
Common B&R OPC-UA write errors:
| Error | Cause | Solution |
|---|---|---|
BadWriteNotSupported | Standard write method blocked | Use the write_params() method above |
BadUserAccessDenied | OPC-UA role doesn’t allow write | Check user role permissions in AS project |
BadNotWritable | Variable is read-only (input, constant) | Cannot write to I/O inputs or constants |
BadTypeMismatch | Wrong data type for the variable | Cast to correct type before writing |
4.4 Force Outputs via OPC-UA
Forcing outputs lets you override physical I/O for diagnostic purposes:
import asyncio
from asyncua import Client, ua
PLC_URL = "opc.tcp://<PLC_IP>:4840"
async def force_output(node_id, value):
async with Client(url=PLC_URL, timeout=5) as client:
node = client.get_node(node_id)
attr = ua.WriteValue()
attr.NodeId = node.nodeid
attr.AttributeId = ua.AttributeIds.Value
attr.Value = ua.DataValue(value)
params = ua.WriteParameters()
params.NodesToWrite = [attr]
result = await node.write_params(params)
print(f"Force {node_id} = {value}: {'OK' if result[0].is_good() else str(result[0])}")
asyncio.run(force_output("ns=2;s=::MainProgram:Output1", True))
See also: online-changes.md, io-sniffing.md
5. OPC-UA: Subscription-Based Monitoring
Subscriptions are the OPC-UA mechanism for real-time variable monitoring. The server pushes data changes to the client instead of the client polling.
5.1 Basic Subscription
import asyncio
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
async def monitor_variables():
async with Client(url=PLC_URL, timeout=10) as client:
idx = await client.get_namespace_index("http://br-automation.com")
print(f"B&R namespace index: {idx}")
sub = await client.create_subscription(500, None)
variables = [
"ns=2;s=::AsGlobalPV:MachineSpeed",
"ns=2;s=::MainProgram:CycleTime",
"ns=2;s=::MainProgram:EmergencyStop",
]
handlers = []
for var_path in variables:
node = client.get_node(var_path)
name = await node.get_browse_name()
def make_callback(n=name.Name):
def datachange_notification(node, val, data):
print(f"[{asyncio.get_event_loop().time():.2f}] {n} = {val}")
return datachange_notification
handle = await sub.subscribe_data_change(
var_path, make_callback()
)
handlers.append(handle)
print("Monitoring... Press Ctrl+C to stop")
try:
while True:
await asyncio.sleep(1)
except KeyboardInterrupt:
print("\nStopping...")
await sub.delete()
asyncio.run(monitor_variables())
5.2 Subscription with Data Logging to CSV
import asyncio
import csv
from datetime import datetime
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
CSV_FILE = "plc_trend_log.csv"
VARIABLES = {
"MachineSpeed": "ns=2;s=::AsGlobalPV:MachineSpeed",
"MotorTemp": "ns=2;s=::MainProgram:MotorTemp",
"CycleTime": "ns=2;s=::MainProgram:CycleTime",
"PartCount": "ns=2;s=::AsGlobalPV:PartCounter",
}
async def trend_logger():
async with Client(url=PLC_URL, timeout=10) as client:
sub = await client.create_subscription(200, None)
with open(CSV_FILE, "w", newline="") as f:
writer = csv.writer(f)
writer.writerow(["timestamp", "variable", "value"])
buffer = []
flush_interval = 60 # seconds
def make_callback(var_name):
def callback(node, val, data):
ts = datetime.now().isoformat()
buffer.append([ts, var_name, str(val)])
return callback
handles = []
for name, node_id in VARIABLES.items():
handle = await sub.subscribe_data_change(
node_id, make_callback(name)
)
handles.append(handle)
print(f"Logging {len(VARIABLES)} variables to {CSV_FILE}")
try:
while True:
await asyncio.sleep(flush_interval)
if buffer:
writer.writerows(buffer)
f.flush()
print(f"Flushed {len(buffer)} entries")
buffer.clear()
except KeyboardInterrupt:
if buffer:
writer.writerows(buffer)
f.flush()
print(f"\nStopped. Total entries written to {CSV_FILE}")
await sub.delete()
asyncio.run(trend_logger())
6. PVI: Python Access via pvipy
6.1 Installation
pip install pvipy
Pvipy requires the B&R PVI Development Setup to be installed on the Windows machine. The PVI Manager service must be running.
6.2 Connecting to a CP1584
from pvi import *
pviConnection = Connection()
line = Line(pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=<PLC_IP>')
def cpuErrorChanged(error: int):
if error == 11020:
print("Unable to establish connection")
pviConnection.stop()
elif error != 0:
raise PviError(error)
else:
print("Connected to CP1584 via PVI/ANSL")
cpu.errorChanged = cpuErrorChanged
pviConnection.start()
6.3 Reading Variables
variables = ["MainProgram.StartButton", "MainProgram.CycleCounter", "AsGlobalPV:MachineSpeed"]
for var_name in variables:
var = cpu.create_variable(var_name, var_name)
value = var.read()
print(f"{var_name} = {value}")
6.4 Browsing Variables Without Project Files
PVI can discover variables on the controller even without a project file:
from pvi import *
pviConnection = Connection()
line = Line(pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device(line, 'TCP', CD='/IF=TcpIp')
cpu = Cpu(device, 'CP1584', CD='/IP=<PLC_IP>')
def cpuErrorChanged(error: int):
if error == 0:
variables = cpu.list_variables()
print(f"Found {len(variables)} variables:")
for var in sorted(variables):
print(f" {var}")
pviConnection.stop()
cpu.errorChanged = cpuErrorChanged
pviConnection.start()
6.5 Writing Variables
var = cpu.create_variable("AsGlobalPV:ManualOverride", "AsGlobalPV:ManualOverride")
var.write(True)
print("ManualOverride set to True")
6.6 SNMP Line — Network Configuration
PVI’s SNMP line can read and modify the PLC’s network settings:
from pvi import *
pviConnection = Connection()
line = Line(pviConnection.root, 'LNSNMP', CD='LNSNMP')
device = Device(line, 'SNMP', CD='/IP=<PLC_IP>')
cpu = Cpu(device, 'CP1584')
cpu.errorChanged = lambda error: print(f"SNMP connected, error={error}")
pviConnection.start()
7. Diagnostic Scripts: Practical Examples
7.1 All-Digital-IO Snapshot
import asyncio
from asyncua import Client
import json
from datetime import datetime
PLC_URL = "opc.tcp://<PLC_IP>:4840"
DIGITAL_INPUTS = [
"ns=2;s=::MainProgram:DI[0]", "ns=2;s=::MainProgram:DI[1]",
"ns=2;s=::MainProgram:DI[2]", "ns=2;s=::MainProgram:DI[3]",
"ns=2;s=::MainProgram:DI[4]", "ns=2;s=::MainProgram:DI[5]",
"ns=2;s=::MainProgram:DI[6]", "ns=2;s=::MainProgram:DI[7]",
]
DIGITAL_OUTPUTS = [
"ns=2;s=::MainProgram:DO[0]", "ns=2;s=::MainProgram:DO[1]",
"ns=2;s=::MainProgram:DO[2]", "ns=2;s=::MainProgram:DO[3]",
"ns=2;s=::MainProgram:DO[4]", "ns=2;s=::MainProgram:DO[5]",
"ns=2;s=::MainProgram:DO[6]", "ns=2;s=::MainProgram:DO[7]",
]
async def io_snapshot():
async with Client(url=PLC_URL, timeout=5) as client:
result = {
"timestamp": datetime.now().isoformat(),
"inputs": {},
"outputs": {},
}
for i, node_id in enumerate(DIGITAL_INPUTS):
try:
val = await client.get_node(node_id).get_value()
result["inputs"][f"DI[{i}]"] = bool(val)
except Exception:
result["inputs"][f"DI[{i}]"] = None
for i, node_id in enumerate(DIGITAL_OUTPUTS):
try:
val = await client.get_node(node_id).get_value()
result["outputs"][f"DO[{i}]"] = bool(val)
except Exception:
result["outputs"][f"DO[{i}]"] = None
print(json.dumps(result, indent=2))
return result
asyncio.run(io_snapshot())
7.2 Watchdog and Cycle Time Monitor
import asyncio
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
async def monitor_cycle_times():
async with Client(url=PLC_URL, timeout=10) as client:
sub = await client.create_subscription(1000, None)
cycle_vars = [
("Cyclic1_ms", "ns=2;s=::System:TaskClass1.CycleTime"),
("Cyclic2_ms", "ns=2;s=::System:TaskClass2.CycleTime"),
("Watchdog", "ns=2;s=::System:WatchdogStatus"),
]
for name, node_id in cycle_vars:
try:
def cb(n=name):
def handler(node, val, data):
if "Watchdog" in n:
print(f"*** WATCHDOG: {val} ***")
else:
if val > 50:
print(f"*** WARNING: {n} = {val} ms (HIGH) ***")
else:
print(f"{n} = {val} ms")
return handler
await sub.subscribe_data_change(node_id, cb())
except Exception as e:
print(f"Cannot subscribe to {name}: {e}")
print("Monitoring cycle times... (Ctrl+C to stop)")
try:
while True:
await asyncio.sleep(1)
except KeyboardInterrupt:
await sub.delete()
asyncio.run(monitor_cycle_times())
7.3 Automated IO Stress Test
import asyncio
import time
from asyncua import Client, ua
PLC_URL = "opc.tcp://<PLC_IP>:4840"
OUTPUT_NODES = [
"ns=2;s=::MainProgram:DO[0]",
"ns=2;s=::MainProgram:DO[1]",
"ns=2;s=::MainProgram:DO[2]",
"ns=2;s=::MainProgram:DO[3]",
]
async def stress_test():
async with Client(url=PLC_URL, timeout=5) as client:
print("IO Stress Test — toggling all outputs at 1 Hz for 60 seconds")
for i, node_id in enumerate(OUTPUT_NODES):
node = client.get_node(node_id)
attr = ua.WriteValue()
attr.NodeId = node.nodeid
attr.AttributeId = ua.AttributeIds.Value
attr.Value = ua.DataValue(True)
params = ua.WriteParameters()
params.NodesToWrite = [attr]
await node.write_params(params)
time.sleep(0.5)
cycles = 0
start = time.time()
while time.time() - start < 60:
state = cycles % 2 == 0
for node_id in OUTPUT_NODES:
node = client.get_node(node_id)
attr = ua.WriteValue()
attr.NodeId = node.nodeid
attr.AttributeId = ua.AttributeIds.Value
attr.Value = ua.DataValue(state)
params = ua.WriteParameters()
params.NodesToWrite = [attr]
await node.write_params(params)
cycles += 1
await asyncio.sleep(0.5)
for node_id in OUTPUT_NODES:
node = client.get_node(node_id)
attr = ua.WriteValue()
attr.NodeId = node.nodeid
attr.AttributeId = ua.AttributeIds.Value
attr.Value = ua.DataValue(False)
params = ua.WriteParameters()
params.NodesToWrite = [attr]
await node.write_params(params)
print(f"Completed {cycles} toggle cycles in 60 seconds")
asyncio.run(stress_test())
8. Automated Regression and Diagnostic Framework
8.1 Expected vs Actual Comparison
import asyncio
from asyncua import Client
import json
from datetime import datetime
PLC_URL = "opc.tcp://<PLC_IP>:4840"
EXPECTED_STATES = {
"ns=2;s=::MainProgram:EmergencyStop": False,
"ns=2;s=::MainProgram:DoorInterlock": True,
"ns=2;s=::MainProgram:MainSwitch": True,
"ns=2;s=::MainProgram:LightCurtain": False,
"ns=2;s=::MainProgram:OvertempAlarm": False,
}
async def regression_check():
async with Client(url=PLC_URL, timeout=5) as client:
report = {
"timestamp": datetime.now().isoformat(),
"total": len(EXPECTED_STATES),
"passed": 0,
"failed": 0,
"errors": 0,
"details": [],
}
for node_id, expected in EXPECTED_STATES.items():
try:
actual = await client.get_node(node_id).get_value()
passed = (actual == expected)
if passed:
report["passed"] += 1
else:
report["failed"] += 1
report["details"].append({
"node": node_id,
"expected": expected,
"actual": actual,
"passed": passed,
})
status = "PASS" if passed else "FAIL"
print(f" [{status}] {node_id}: expected={expected}, actual={actual}")
except Exception as e:
report["errors"] += 1
report["details"].append({
"node": node_id,
"expected": expected,
"actual": f"ERROR: {e}",
"passed": False,
})
print(f" [ERROR] {node_id}: {e}")
print(f"\nResults: {report['passed']}/{report['total']} passed, "
f"{report['failed']} failed, {report['errors']} errors")
return report
asyncio.run(regression_check())
8.2 Scheduled Diagnostic Runner
import asyncio
import schedule
import time
import json
from datetime import datetime
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
LOG_FILE = "regression_log.jsonl"
async def run_check():
async with Client(url=PLC_URL, timeout=10) as client:
result = {
"timestamp": datetime.now().isoformat(),
"status": "unknown",
"errors": [],
}
try:
estop = await client.get_node("ns=2;s=::MainProgram:EmergencyStop").get_value()
result["estop"] = estop
try:
speed = await client.get_node("ns=2;s=::AsGlobalPV:MachineSpeed").get_value()
result["speed"] = speed
except Exception:
pass
result["status"] = "ok" if not estop else "estop_active"
except Exception as e:
result["status"] = "connection_error"
result["errors"].append(str(e))
with open(LOG_FILE, "a") as f:
f.write(json.dumps(result) + "\n")
print(f"[{result['timestamp']}] Status: {result['status']}")
return result
def sync_wrapper():
asyncio.run(run_check())
schedule.every(5).minutes.do(sync_wrapper)
schedule.every().hour.do(lambda: print("--- Hourly summary ---"))
if __name__ == "__main__":
print("Starting scheduled diagnostics...")
asyncio.run(run_check()) # Immediate first run
while True:
schedule.run_pending()
time.sleep(1)
8.3 Diagnostic Report Generator
import asyncio
import json
from datetime import datetime
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
REPORT_FILE = "diagnostic_report.html"
async def generate_report():
report_data = {
"timestamp": datetime.now().isoformat(),
"connection": "unknown",
"variables": [],
"errors": [],
}
try:
async with Client(url=PLC_URL, timeout=10) as client:
report_data["connection"] = "ok"
objects = client.nodes.objects
children = await objects.get_children()
report_data["root_children"] = len(children)
sample_vars = [
("MachineSpeed", "ns=2;s=::AsGlobalPV:MachineSpeed"),
("PartCounter", "ns=2;s=::AsGlobalPV:PartCounter"),
("CycleTime", "ns=2;s=::MainProgram:CycleTime"),
]
for name, node_id in sample_vars:
try:
val = await client.get_node(node_id).get_value()
report_data["variables"].append({
"name": name,
"value": str(val),
"type": type(val).__name__,
})
except Exception as e:
report_data["errors"].append(f"{name}: {e}")
except Exception as e:
report_data["connection"] = f"failed: {e}"
html = f"""<!DOCTYPE html>
<html><head><title>CP1584 Diagnostic Report</title></head>
<body>
<h1>CP1584 Diagnostic Report</h1>
<p>Generated: {report_data['timestamp']}</p>
<p>Connection: {report_data['connection']}</p>
<h2>Variable Status</h2>
<table border="1">
<tr><th>Variable</th><th>Value</th><th>Type</th></tr>"""
for v in report_data["variables"]:
html += f"""<tr><td>{v['name']}</td><td>{v['value']}</td><td>{v['type']}</td></tr>"""
html += "</table>"
if report_data["errors"]:
html += "<h2>Errors</h2><ul>"
for e in report_data["errors"]:
html += f"<li>{e}</li>"
html += "</ul>"
html += "</body></html>"
with open(REPORT_FILE, "w") as f:
f.write(html)
print(f"Report saved to {REPORT_FILE}")
asyncio.run(generate_report())
9. Integrating with IIoT and Monitoring Systems
9.1 OPC-UA to MQTT Bridge
For forwarding PLC data to MQTT-based monitoring (Grafana, Node-RED, Home Assistant):
import asyncio
from asyncua import Client
import paho.mqtt.client as mqtt
PLC_URL = "opc.tcp://<PLC_IP>:4840"
MQTT_BROKER = "localhost"
MQTT_PORT = 1883
MQTT_TOPIC = "br/plc/"
variables_map = {
"ns=2;s=::AsGlobalPV:MachineSpeed": "machine/speed",
"ns=2;s=::MainProgram:CycleTime": "machine/cycle_time",
"ns=2;s=::MainProgram:EmergencyStop": "machine/estop",
}
mqtt_client = mqtt.Client()
mqtt_client.connect(MQTT_BROKER, MQTT_PORT)
async def opcua_to_mqtt():
async with Client(url=PLC_URL, timeout=10) as client:
sub = await client.create_subscription(500, None)
for node_id, mqtt_path in variables_map.items():
def cb(topic=f"{MQTT_TOPIC}{mqtt_path}"):
def handler(node, val, data):
mqtt_client.publish(topic, str(val))
return handler
await sub.subscribe_data_change(node_id, cb())
print("OPC-UA to MQTT bridge running...")
try:
while True:
await asyncio.sleep(1)
mqtt_client.loop(0.01)
except KeyboardInterrupt:
await sub.delete()
asyncio.run(opcua_to_mqtt())
9.2 Prometheus Exporter
For integration with Grafana/Prometheus:
import asyncio
from aiohttp import web
from asyncua import Client
PLC_URL = "opc.tcp://<PLC_IP>:4840"
PORT = 8000
latest_values = {}
VARIABLES = {
"br_machine_speed": "ns=2;s=::AsGlobalPV:MachineSpeed",
"br_cycle_time_ms": "ns=2;s=::MainProgram:CycleTime",
"br_part_count": "ns=2;s=::AsGlobalPV:PartCounter",
}
async def update_values():
while True:
try:
async with Client(url=PLC_URL, timeout=5) as client:
for metric, node_id in VARIABLES.items():
try:
val = await client.get_node(node_id).get_value()
latest_values[metric] = val
except Exception:
pass
except Exception:
pass
await asyncio.sleep(2)
async def metrics_handler(request):
output = ""
for metric, value in latest_values.items():
if isinstance(value, (int, float)):
output += f"{metric} {value}\n"
return web.Response(text=output, content_type="text/plain")
async def main():
app = web.Application()
app.router.add_get("/metrics", metrics_handler)
runner = web.AppRunner(app)
await runner.setup()
site = web.TCPSite(runner, "0.0.0.0", PORT)
await site.start()
asyncio.create_task(update_values())
print(f"Prometheus exporter on :{PORT}/metrics")
while True:
await asyncio.sleep(3600)
asyncio.run(main())
See also: iiot-retrofit.md
10. Common Pitfalls and Gotchas
10.1 B&R OPC-UA Write Issue
The standard asyncua node.write_value() method often returns BadWriteNotSupported on B&R OPC-UA servers, even when the variable is writable in UAExpert. Always use the write_params() method documented in Section 4.3.
10.2 Namespace Discovery
B&R OPC-UA namespaces are not always predictable. The namespace index for application variables depends on how the OPC-UA configuration was set up in Automation Studio. Always browse the namespace first rather than hardcoding ns=2 or ns=6.
10.3 PVI Trial License Limitation
Without a PVI license, PVI Manager runs for 2 hours before stopping all PVI-based programs. This is disruptive for long-running monitoring scripts. If you need continuous monitoring, use the OPC-UA path instead.
10.4 Variable Not Found
If a variable is not accessible via OPC-UA:
- The variable may not be mapped to the OPC-UA namespace (the OEM must explicitly export it)
- Try PVI, which has access to all variables in the PLC’s variable table
- Check if the variable is in a different namespace or has been renamed
10.5 Connection Timeout
B&R OPC-UA server startup can take several seconds after PLC boot. Add retry logic:
import asyncio
from asyncua import Client
async def connect_with_retry(url, max_retries=10, delay=3):
for attempt in range(max_retries):
try:
client = Client(url=url, timeout=5)
await client.connect()
print(f"Connected on attempt {attempt + 1}")
return client
except Exception as e:
print(f"Attempt {attempt + 1} failed: {e}")
if attempt < max_retries - 1:
await asyncio.sleep(delay)
raise ConnectionError(f"Failed to connect after {max_retries} retries")
async def main():
client = await connect_with_retry("opc.tcp://<PLC_IP>:4840")
try:
# ... work with client ...
pass
finally:
await client.disconnect()
asyncio.run(main())
Community Tools for Python-Based Diagnostics
Beyond the core asyncua and pvipy libraries, several community tools extend Python-based diagnostics for B&R systems:
brwatch (Windows Service + Command Line)
brwatch is a Windows service tool for variable watch, change, logging, IP configuration, and CPU reboot — without requiring Automation Studio or the project file. While not Python-native, it integrates with Python workflows:
- CSV logging: brwatch can log variable values to CSV files that Python scripts then ingest for analysis
- Variable discovery: Use brwatch to enumerate all visible variables, then build Python monitoring scripts targeting specific variables
- IP configuration: Automate initial PLC network setup from the command line before any Python connectivity
import pandas as pd
import glob
latest_csv = sorted(glob.glob("brwatch_log_*.csv"))[-1]
df = pd.read_csv(latest_csv)
print(f"Loaded {len(df)} samples from {latest_csv}")
print(df.describe())
See access-recovery.md §12 for the complete brwatch guide.
Pvi.py (Python PVI Wrapper)
Pvi.py is a Python wrapper for B&R PVI that provides a cleaner API than pvipy for common operations:
from pvi import Pvi
pvi = Pvi()
plc = pvi.line("ANSL", "TCP", "<PLC_IP>").device("CP1584")
var = plc.variable("gMachineData.nTemperature")
print(f"Current temperature: {var.read()}")
var.write(25.0)
plc.restart()
Comparison: Pvi.py vs pvipy:
| Feature | Pvi.py | pvipy |
|---|---|---|
| API style | High-level, Pythonic | Lower-level, closer to PVI C API |
| Error handling | Python exceptions | Error codes |
| Async support | Limited | Supports callbacks |
| Documentation | GitHub README + examples | pip package docs |
| Active maintenance | Yes (hilch) | Yes |
| Installation | pip install Pvi.py | pip install pvipy |
systemdump.py (CLI Dump Analyzer)
systemdump.py parses B&R SystemDump.xml files from the command line:
pip install systemdump.py
systemdump --input SystemDump.xml --summary
systemdump --input SystemDump.xml --logger --filter ERROR
systemdump --input SystemDump.xml --tasks --format json > task_stats.json
Combined with Python:
import subprocess, json
result = subprocess.run(
["systemdump", "--input", "SystemDump.xml", "--tasks", "--format", "json"],
capture_output=True, text=True
)
task_data = json.loads(result.stdout)
for task in task_data.get("tasks", []):
print(f"{task['name']}: cycle={task['cycle_ms']}ms, max={task['max_cycle_ms']}ms")
See ebpf-telemetry.md for post-mortem analysis workflows and diagnostics-sdm.md for system dump download procedures.
awesome-B-R Curated Tool List
The awesome-B-R repository maintains a comprehensive catalog of all community tools, libraries, and resources for B&R automation. Key entries relevant to Python diagnostics:
| Tool | Purpose | URL |
|---|---|---|
demo-br-asyncua | OPC-UA demo for B&R PLCs | github.com/br-automation-community/demo-br-asyncua |
brwatch | Variable watch/change/log service | github.com/hilch/brwatch |
Pvi.py | Python PVI wrapper | github.com/hilch/Pvi.py |
systemdump.py | System dump parser | github.com/hilch/systemdump.py |
brsnmp | PVI-SNMP tool for PLC discovery | github.com/hilch/brsnmp |
paho.mqtt.c-ar | MQTT client for AR | github.com/br-automation-community/paho.mqtt.c-ar |
Key Findings
- OPC-UA via
asyncuais the recommended path for Python diagnostics on B&R CP1584 — no Windows middleware, no PVI license required, works from any OS. - B&R OPC-UA requires
write_params()instead ofwrite_value()for writing variables — a documented gotcha in the community. - The
pvipylibrary provides clean Python access via PVI but requires Windows + PVI Development Setup + license. - Variable namespace must be discovered — B&R namespace indices are project-specific, not standardized.
- Subscriptions enable real-time monitoring with CSV logging, Prometheus export, or MQTT bridging for IIoT integration.
- Regression testing (expected vs actual) is practical for documenting and verifying machine behavior on undocumented systems.
- Community tools extend Python diagnostics significantly — brwatch for no-project variable access and CSV logging, Pvi.py for a Pythonic PVI API, systemdump.py for automated dump analysis, and brsnmp for PLC discovery without Automation Studio. See awesome-B-R for the full catalog.
Sources
- B&R PVI (Process Visualization Interface) API documentation — C/C++ and .NET SDK references
- B&R OPC-UA Server Configuration Guide — namespace and endpoint configuration
- Python OPC-UA library (asyncua) documentation — https://github.com/FreeOpcUa/opcua-asyncio
- Python Modbus library (pymodbus) documentation — https://pymodbus.readthedocs.io
- Python PVI library (pvi.py) by hilch — https://github.com/hilch/Pvi.py
- B&R Community Forum (community.br-automation.com) — PVI and OPC-UA scripting discussions
- awesome-B-R GitHub repository — community tool listing for B&R automation
Related Documents
- pvi-api.md — PVI API reference for programmatic PLC access
- opcua.md — OPC-UA server configuration and namespace structure
- modbus-gateway.md — Modbus gateway configuration as alternative data source
- cp1584-forensics.md — Initial information extraction methodology
- iiot-retrofit.md — MQTT, SNMP, and dashboard integration from Python data
- diagnostics-sdm.md — SDM web interface for baseline diagnostic data
- custom-diagnostic-tools.md — Building diagnostic tools that run ON the PLC
- ebpf-telemetry.md — Alternative telemetry and monitoring approaches
Remanufacturing and Modernizing B&R Control Systems
A practical guide for automation engineers maintaining B&R X20CP1584 PLCs and related hardware from defunct OEMs with zero documentation. Covers repair, in-family migration, cross-platform migration, project planning, and cost analysis.
Table of Contents
- Overview
- CP1584 Repair vs Replace Decision Matrix
- B&R In-Family Migration (Recommended Path)
- X20 to X67 Migration (Form Factor Change)
- B&R to CODESYS Migration
- B&R to Siemens Migration
- B&R to Beckhoff Migration
- Migration Project Planning
- Minimizing Downtime During Migration
- Cost/Benefit Analysis Framework
- Legacy B&R Specific Considerations
- Cross-References
- Key Findings
- Sources
1. Overview
Modernizing a B&R control system falls on a spectrum with five distinct zones. The correct choice depends on hardware health, spare parts availability, downtime risk tolerance, budget, and long-term support requirements.
The Modernization Spectrum
Zone 1 Zone 2 Zone 3 Zone 4 Zone 5
REPAIR | COMPONENT UPGRADE | IN-FAMILY | CROSS-PLATFORM | FULL REDESIGN
| | CPU SWAP | MIGRATION |
| | | |
Cost: | $10 - $500 | $1,500 - $5,000| $5,000 - $25,000| $25,000+
Risk: | Low | Low-Medium | Medium-High | High
Downtime: | Hours | 1-2 days | 1-4 weeks | 2-12 weeks
Disruption:| None | Minimal | Moderate | Complete
| | | |
Example: | Replace caps, | X20CP1584 | X20CP3484 or | New PLC + new
| new CF card, | -> X20CP1485 | CODESYS/Wago | HMI + new IO
| new battery | | | + reprogram
Assessment Framework
Use this questionnaire to determine which zone applies:
| Factor | Zone 1-2 (Repair/Upgrade) | Zone 3 (In-Family) | Zone 4-5 (Migrate/Redesign) |
|---|---|---|---|
| CPU failure mode | Repairable (caps, PSU, CF) | Intermittent / slow | Unrepairable / end of life |
| IO health | All OK | Mostly OK | Degraded or missing modules |
| Software | Have project file | Have project file | No project file |
| Original OEM | Available for support | Gone but docs exist | Gone, no docs |
| Remaining machine life | < 3 years | 3-7 years | 7+ years |
| Safety system | No safety or simple E-stop | SafeLOGIC present | Complex safety rated to SIL 2+ |
| Budget | < $500 | $1,500-$5,000 | $5,000-$50,000+ |
| Downtime window | < 4 hours | 1-2 planned days | 1-4 weeks planned |
Critical First Step: Documentation
Before making any decision, reconstruct documentation. See documentation-reconstruction.md and program-reverse-engineering.md for procedures.
Without the Automation Studio project file, software migration effort multiplies by 3-5x. Without IO wiring documentation, hardware swap downtime multiplies by 2-4x. Prioritize recovering both before committing to any migration path.
AS4 to AS6 Migration Tools (Critical for Software Recovery)
When migrating from the CP1584 to a modern replacement (e.g., CP3484), you will likely need to move from Automation Studio 4 to Automation Studio 6. This is not a simple upgrade — AS6 has breaking changes in project format, PVI version (6.x drops INA2000 support entirely), and mapp Framework. The B&R community maintains free tools to assist:
| Tool | Repository / Source | Purpose |
|---|---|---|
| as6-migration-tools | github.com/br-automation-community/as6-migration-tools | Automated project conversion scripts, syntax migration helpers |
| BRLibToHelp | github.com/br-automation-community/BRLibToHelp | Extracts help documentation from B&R library files |
| SBOM Generator | github.com/br-automation-community/sbom-generator | Generate Software Bill of Materials for AS projects |
Migration path: CP1584 → CP3484 (or newer):
- Recover the AS4 project using techniques in program-reverse-engineering.md
- Open the project in AS4 and ensure it compiles cleanly
- Run the community migration tools to identify breaking changes
- Upgrade mapp components to their mapp 6 equivalents
- Replace all INA2000 PVI references with ANSL (see pvi-api.md)
- Re-target the hardware configuration to the new controller
- Test on the bench before deploying to the machine
AS 6.5 benefits for migration (December 2025): AS 6.5 introduces ST-OOP with full inheritance, polymorphism, access specifiers (PUBLIC/PRIVATE/PROTECTED), abstract methods, and method overriding — enabling modern object-oriented IEC 61131-3 programming that significantly improves code maintainability. Other AS 6.5 features relevant to migration: hard real-time multicore task scheduling (assign cyclic tasks to specific CPU cores), FTP RBAC, expanded ManagedCertificateStore (ANSL/FTP/HTTP/SMTP), TFTP disabled by default (security improvement), self-signed certificate handling, CLI library exporter (BR.AS.LibraryExporter.exe), and SNI support in AsHttp. See firmware-version-mgmt.md §3.2 for the complete AS 6.x release history.
Warning: The original AS4 TG dongle licenses may not carry forward to AS6. See license-mgmt.md for license recovery strategies.
See firmware-version-mgmt.md §5.3.1 for detailed AS4→AS6 breaking changes.
AR 6.5 Multicore Task Scheduling — Migration Impact
AS 6.5 with AR 6.5 introduces hard real-time multicore support that is a significant selling point for migrating to newer B&R hardware. Understanding this feature is important for migration planning because it changes how task scheduling works on the target hardware.
What changes in AR 6.5 multicore:
| Feature | AR 4.x (CP1584) | AR 6.5 (multicore hardware) |
|---|---|---|
| Task scheduling | Single-core preemptive | Tasks assignable to specific cores |
| Cyclic #1–#8 | All on one core | Distribute across cores |
| ANSL communication | Shares core with cyclic tasks | Dedicated core for ANSL tasks |
| Motion control | Competes with logic for CPU | Isolate motion on dedicated core |
| I/O processing | Shares CPU with user tasks | Background I/O processor still independent |
Practical benefit for migrated machines:
- Motion control (Cyclic #1) can run on Core 0, while logic (Cyclic #2–#4) runs on Core 1
- ANSL/OPC-UA communication no longer competes with real-time tasks for CPU time
- Higher total throughput without reducing individual cycle times
- Reduced cycle time violations (Exception 144) on complex machines
Hardware requirements:
- Multicore requires AR 6.5 AND a multicore CPU (X20CP3xxx, X20EM, APC industrial PCs)
- The X20CP1684 (single-slot successor to CP1584) does NOT support multicore — it has a single-core processor
- For multicore, you need at minimum a X20CP3xxx (3-slot, dual-core) or X20EM (ARM multi-core)
Migration implication: If your CP1584 machine has complex motion + logic that frequently hits cycle time violations, migrating to a multicore platform (X20CP3xxx or X20EM with AR 6.5) may eliminate those issues entirely by distributing task load across cores. This is a stronger justification for migration than just security compliance.
Source: B&R Community — “RELEASE 2025: Automation Studio 6.5 - Complete overview” (community.br-automation.com/t/release-2025-automation-studio-6-5-complete-overview/9439), “Innovation 2025: Multicore Processing in Automation Software 6” (community.br-automation.com/t/innovation-2025-multicore-processing-in-automation-software-6/8477)
ST-OOP in AS 6.5 — Modern IEC 61131-3 for Refactored Projects
AS 6.5 adds full Structured Text Object-Oriented Programming (ST-OOP) to the IEC 61131-3 language set. This is relevant for migration because when refactoring recovered AS4 code, you have the option to restructure it using modern OOP patterns:
| Feature | Syntax | Use Case |
|---|---|---|
| Inheritance | FUNCTION_BLOCK Child EXTENDS Parent | Reuse common axis/motor logic across multiple axes |
| Polymorphism | Dynamic method dispatch via OVERRIDE | Generic state machine framework with specialized behaviors |
| Access specifiers | VAR PUBLIC, VAR PRIVATE, VAR PROTECTED | Protect calibration data from accidental modification |
| Abstract methods | ABSTRACT METHOD | Define interface contracts for device drivers |
| Classes | CLASS, END_CLASS | Value-type objects (not reference-type like function blocks) |
When to use ST-OOP in migration:
- When the recovered AS4 project uses copy-paste patterns across multiple axes/stations
- When refactoring for maintainability by a one-man team (reduces code duplication)
- When building new functionality on top of the migrated base
When NOT to use ST-OOP:
- When doing a literal migration (keep existing code structure unchanged)
- When the target is AS 4.x compatibility (ST-OOP requires AS 6.x)
- When team members are not familiar with OOP concepts
2. CP1584 Repair vs Replace Decision Matrix
X20CP1584 Hardware Architecture
| Component | Specification | Failure Mode | Repairability |
|---|---|---|---|
| CPU | Intel Atom E620T 600MHz | Overheating (thermal paste), clock degradation | Low - not practical |
| RAM | 256MB DDR2 SDRAM (soldered) | Memory errors, bit flips | Not repairable |
| Flash/Boot | CompactFlash Type I slot | Card failure, corruption, connector wear | High - swap CF card |
| Battery | CR2477N 3V/950mAh (retentive data + RTC) | Dead battery, data loss | Trivial - swap battery |
| PSU | External 24VDC via X20 bus | Capacitor failure, voltage regulation | Moderate |
| Base | X20 base module | Pin corrosion, connector damage | Low-Moderate |
| Ethernet | 1x GbE + 1x POWERLINK (RJ45) | ESD damage, connector wear | Low |
| USB | 2x USB (Type A) | Physical damage | Low |
| POWERLINK | X20 bus interface | FPGA failure | Not repairable |
| Display interface | None (headless) | N/A | N/A |
| Power supply input | 24VDC via X20 bus | Voltage spikes, reverse polarity | Fuse + buffer cap |
Common Failure Modes and Repair Costs
| Failure Symptom | Likely Cause | Repair Cost | Time | Difficulty |
|---|---|---|---|---|
| Will not boot, no LED activity | CF card corruption or failure | $20-80 (CF card) | 30 min | Low |
| Will not boot, LED on but no Ethernet | Corrupt firmware image on CF | $0 (re-flash from backup) | 1-2 hrs | Medium |
| Intermittent reboots, watchdog trips | Capacitor degradation on PSU | $10-50 (capacitors) | 1-2 hrs | Medium |
| CMOS reset on power cycle, wrong date / retentive data lost | Dead CR2477N battery | $5-15 | 5 min | Trivial |
| No Ethernet link | ESD damage to PHY / connector | $50-150 (module swap) | 1 hr | Medium |
| POWERLINK bus faults | FPGA communication error | Not repairable - replace CPU | N/A | N/A |
| Memory errors, blue screen | DDR2 failure (soldered) | Not repairable - replace CPU | N/A | N/A |
| Overheating, thermal shutdown | Thermal paste degradation, fanless clog | $5-20 (paste + cleaning) | 30 min | Low |
| USB port not working | Physical damage | Not practical to repair | N/A | N/A |
| Complete no-power | External PSU failure or base module | $50-200 (PSU) or $200-400 (base) | 1 hr | Low-Medium |
Decision Flowchart
CP1584 FAILURE REPORTED
|
Does it power on?
/ \
YES NO
| |
Does it boot to Check external PSU.
AR runtime? Replace PSU ($50-200).
/ \ Does it power on now?
YES NO / \
| | YES NO
Machine CF card likely Fixed. Base module or
is running corrupt. Monitor. CPU failure.
but degraded. Replace CF |
Monitor. ($20-80) + CPU hardware
| re-flash. failure. Replace.
| | ($1,500-$5,000
Which Is project for in-family
component file backed upgrade)
is failing? up?
/ \ / \
SAFE NON-SAFE YES NO
LOGIC FAULT Recover Recover project
| | from CF first, then
| | or backup. re-flash.
| | |
| | Can you
| | recover it?
| | / \
| | YES NO
| | | |
| | Re-flash Must reverse-
| | and test. engineer or
| | recreate.
| | (See program-
| | reverse-
| | engineering.md)
| |
| |
Safety Is failure
hardware recurring?
issue. / \
Requires YES NO
certified | |
repair Track Repair
or frequency. complete.
module If >2x/year, Return to
replace. plan service.
| upgrade.
| |
| Is machine
| >3 years from
| planned end of
| life?
| / \
| YES NO
| | |
| Consider Repair and
| in-family monitor.
| upgrade.
|
SafeLOGIC
module
failure:
- Check
X20 safe
bus cables
- Check
configuration
- Replace safe
module
($500-2000)
- Recertification
may be required
When Repair Makes Sense
- Machine expected remaining life under 3 years
- Failure is a known single-component issue (CF card, battery, capacitors)
- Spare CPU is already in inventory (common: OEM bought 2-3 spares)
- Downtime budget is under 4 hours
- No safety system involved or safety system unaffected
- Software is stable and well-documented
- Budget is constrained to under $500
When Replacement Is the Only Option
- CPU itself has failed (Atom processor, DDR2, FPGA)
- POWERLINK bus interface is unreliable
- Multiple recurring failures indicating board-level degradation
- No spare CPU available and none on the secondary market
- Machine life extension justifies capital expenditure
- Need for additional IO capacity, memory, or communication interfaces
- Safety system requires upgrade for compliance
CP1584 on the Secondary Market
| Source | Typical Price | Condition | Risk |
|---|---|---|---|
| Surplus brokers (eBay, surplus.net) | $400-$1,200 | Used, unknown runtime | Firmware mismatch, age |
| Industrial parts brokers (PLC Center, Radwell) | $800-$2,000 | Tested, warranty | 30-90 day warranty |
| B&R direct (if still stocked) | $2,000-$4,000 | New, full warranty | May not be available |
| Refurbished by specialist | $600-$1,500 | Refurbished, tested | 90-day to 1-year warranty |
| Machine graveyard (same OEM) | $0-$300 | Untested, as-is | Firmware, age, unknown |
Important: When buying a replacement CP1584, match the firmware version exactly if possible. See firmware-version-mgmt.md. A firmware version mismatch may require recompiling the project in Automation Studio, which requires the project file.
3. B&R In-Family Migration (Recommended Path)
Migration Within X20 Platform
CP1584 Discontinuation Notice (SN 2022/54): B&R issued discontinuation notice SN 2022/54 for the X20CPx58x series (CP1584, CP1585, CP3584, CP3585) due to component discontinuation. Last-Time-Buy (LTB) deadline was February 28, 2023. The CP1584 is now in the Obsolete phase of B&R’s lifecycle — no new units are available from B&R, and repair service is available only for a limited time after obsolescence. This makes spare parts sourcing from the secondary market (eBay, surplus brokers, classicautomation.com, all4sps.com) critical. Always verify firmware compatibility and burn-test used CPUs before deploying as production spares. See spare-parts.md for sourcing strategies.
The X20 system celebrated its 20th anniversary in 2024 and is actively sold and supported by B&R with no end-of-life announced. Product Manager Andreas Hager confirmed: “The X20 is twenty years old and still going strong.” The three-part module design (bus module + electronic module + terminal block) has remained consistent since 2004, ensuring backward compatibility for IO modules. Migration within X20 is the lowest-risk upgrade path because the programming environment (Automation Studio), the runtime (Automation Runtime / AR), the IO bus (POWERLINK + X2X), and the IO modules remain the same or are backward compatible.
Source: B&R Press Release, October 2024
B&R Product Lifecycle Phases
B&R uses a four-phase lifecycle model for all products. Understanding this is critical when planning spare parts and migrations:
| Phase | Status | Customer Action |
|---|---|---|
| Active | Full production, available unconditionally | Use for new projects |
| Classic | Still in production, but beginning phase-out | B&R notifies customers 3 years before phase-out; do not use for new projects |
| Limited | Only Last-Time-Buy (LTB) orders fulfilled | Must have placed binding LTB order during Classic phase; no new orders |
| Obsolete | No longer available | B&R repair service available for 3 years after obsolescence |
The current lifecycle status of any B&R product is visible at www.br-automation.com and in B&R’s online offers system. Check before committing to a migration path.
Source: B&R Lifecycle Policy
Target CPU Comparison
| Parameter | X20CP1584 (Current) | X20CP1585 | X20CP1684 | X20CP1484 | X20CP1485 | X20CP3484 | X20CP3485 |
|---|---|---|---|---|---|---|---|
| Processor | Intel Atom E620T 600MHz | Intel Atom E640T 1.0GHz | Intel Atom E680T 1.0GHz | Intel Atom E3825 1.33GHz | Intel Atom E3845 1.91GHz | Intel Celeron J1900 2.0GHz | Intel Celeron J3455 1.5GHz |
| Cores | 1 | 1 | 1 | 2 | 4 | 4 | 4 |
| RAM | 256 MB DDR2 | 256 MB DDR2 | 256 MB DDR2 | 1 GB DDR3L | 2 GB DDR3L | 4 GB DDR3L | 4 GB DDR4 |
| User SRAM | 1 MB | 1 MB | 1 MB | 1 MB | 1 MB | 1 MB | 1 MB |
| Storage | CompactFlash | CompactFlash | CompactFlash | SD card | SD card | SD card | SD card |
| Ethernet | 1xGbE + 1xPOWERLINK | 1xGbE + 1xPOWERLINK | 1xGbE + 1xPOWERLINK | 2x 10/100 | 2x 10/100/1000 | 3x 10/100/1000 | 2x 10/100/1000 |
| Interface slots | 1 | 1 | 1 | 1 | 1 | 3 | 2 |
| POWERLINK | V1/V2 (MN/CN) | V1/V2 (MN/CN) | V1/V2 (MN/CN) | 1x via bus | 1x via bus | 2x via bus | 2x via bus |
| USB | 2x USB 1.1/2.0 | 2x USB 1.1/2.0 | 2x USB 1.1/2.0 | 2x Type A | 2x Type A | 2x Type A | 2x Type A |
| Battery | CR2477N (950mAh) | CR2477N (950mAh) | CR2477N (950mAh) | CR2032 | CR2032 | CR2032 | CR2032 |
| Min cycle time | 400 us | 200 us | 200 us | 1 ms | 500 us | 200 us | 100 us |
| Power consumption | 8.6 W | 3 W | N/A | N/A | N/A | N/A | N/A |
| Display | None | None | None | None | None | DVI-I | DVI-I |
| Approx. price | Discontinued | $2,500-$3,500 | $2,000-$3,000 | $1,500-$2,500 | $2,000-$3,500 | $3,000-$5,000 | $3,500-$5,500 |
| AR compatibility | AR 4.x | AR 4.x (AS 4.3+) | AR 4.x (AS 4.7+) | AR 4.x | AR 4.x | AR 4.x | AR 4.x |
| Recommended for | (Legacy) | Best drop-in upgrade | Drop-in upgrade | Budget upgrade | Standard upgrade | Performance upgrade | Performance upgrade |
X20CP1585 is the best direct drop-in replacement for CP1584: Same Atom family processor at higher clock (1.0 GHz vs 0.6 GHz), same CompactFlash storage (no media migration), same RAM (256 MB DDR2), same interface slots, same form factor, and same X2X/POWERLINK bus architecture. The faster CPU halves the minimum task class cycle time (200 us vs 400 us) and dramatically reduces power consumption (3 W vs 8.6 W). Supports OPC-UA. Available from industrial parts suppliers (~$2,500-$3,500 new, ~$1,000-$2,000 surplus). Confirmed as a valid upgrade path by B&R Community: see community.br-automation.com/t/x20cp1585-controller-upgrade/8885.
X20CP1684 is an alternative direct replacement: Same CompactFlash storage and same RAM. Identical performance profile to CP1585 (1.0 GHz, 200 us minimum cycle). Requires Automation Studio 4.7 or later. See community.br-automation.com/t/upgrading-x20cp1584-with-x20cp1684/5727.
X20CP3484 is the performance upgrade path: Switches from CompactFlash to SD card (requires media migration), adds more interface slots and faster POWERLINK. The DDR4 variant provides even better memory performance.
Important: Board-level exchange between CP1484 and CP1584 is NOT possible — the processor types are different and the boards are incompatible. See community.br-automation.com/t/exchange-electronic-boards-between-cpu-x20cp1484-and-x20cp1584/5343.
New Generation X20 Controllers (AR 6.x Targets)
B&R announced a new generation of X20 controllers with Intel Apollo Lake I processors, significantly higher performance, additional RAM, integrated onboard flash memory, and OPC UA over TSN support. These controllers target AR 6.x and Automation Studio 6.x and represent the forward-looking migration path from the CP1584:
| Parameter | X20 New Gen (Apollo Lake I) | X20CP3687X | X20CP0484-1 (Compact-S extended) | Key Difference from CP1584 |
|---|---|---|---|---|
| Processor | Intel Apollo Lake I | Intel (PC-class performance) | Intel | Modern multi-core architecture |
| RAM | 512 MB+ DDR3L/DDR4 | High (PC-class) | 512 MB DDR3L, 2 GB internal flash | 2-4x CP1584 |
| Storage | SD card + onboard flash | SD + onboard flash | SD card + 2 GB onboard flash | No CF card dependency |
| Ethernet | Multiple GbE ports | Multiple GbE | 1x or 2x GbE | More connectivity options |
| Interface slots | 1-3 | 3 | 1 | Depends on model |
| POWERLINK | V2 via bus modules | Via bus modules | Via bus module | Same protocol family |
| OPC UA over TSN | Yes | Yes | Via bus module | Major new capability — deterministic OPC UA at field level |
| Field-level master | Yes | Yes | Configurable | Can serve as TSN/OPC UA field master |
| AR compatibility | AR 6.x only | AR 6.x | AR 6.x | Not backward compatible with AR 4.x |
| AS requirement | AS 6.x | AS 6.x | AS 6.x | Separate product line from AS 4.x |
X20CP3687X — “The power of a PC” in a compact X20 controller. B&R positions this as the highest-performance X20 controller, combining industrial PC performance with the compact X20 form factor. Ideal for machines that need advanced motion control, vision processing, or IIoT gateways alongside PLC control.
X20CP0484-1 — Extended Compact-S series controller with 512 MB RAM and 2 GB internal flash. This is the budget-friendly AR 6.x entry point, suitable for machines that don’t need the full performance of the Apollo Lake I generation but still want patchable AR 6.x firmware.
Sources: B&R “Expanded X20 PLC generation” product page (br-automation.com/en/products/plc-systems/innovations/)
Critical migration implications:
- AS 6 is a separate product — it does not replace AS 4.x. It requires its own license and installation. Projects from AS 4.x cannot be opened directly in AS 6.x; they must be ported using the community migration tools.
- AR 6 drops VxWorks 5.5 — the underlying RTOS migrates to VxWorks 6.x/7.x. Binary-incompatible. All
.brmodules must be recompiled for AR 6 targets. - INA2000 protocol is deprecated in AR 6.x. PVI 6.x uses only ANSL. See pvi-api.md for the implications.
- CF cards are being phased out in favor of SD cards and onboard flash. The CP1584’s dependency on B&R-certified CF cards goes away.
- exOS (Linux alongside AR) is available on multi-core AR 6 controllers, enabling IIoT capabilities without a separate PC. See ar-rtos.md §1.3 and iiot-retrofit.md for exOS details.
Development Tools Update (2025-2026)
New community tools and official B&R tools have emerged that simplify B&R development and migration:
| Tool | Source | Purpose |
|---|---|---|
| Automation Studio Code | B&R (bundled with AS 6.3+) | VS Code-based editor with modern ST/C++ editing, syntax highlighting, minimap, Git integration, and AS Copilot AI assistant. Open beta since June 2025. Fully compatible with AS 6 projects. |
| AS Copilot | B&R (cloud service) | AI assistant integrated into AS Code for ST code generation and commenting. Free until end of 2025 (rate limited). Requires Copilot account. C/C++ support planned. |
| VS Code B&R Automation Tools | github.com/br-automation-com/vscode-brautomationtools | Edit, build, and transfer AS projects from VS Code. Provides IntelliSense for C/C++ programs, build tasks via BR.AS.Build.exe, and transfer tasks via PVITransfer.exe. Requires AS and PVI installed on the system. Not a B&R product — community-maintained. |
| Structured Text VS Code extension | marketplace.visualstudio.com/items?itemName=Serhioromano.vscode-st | Syntax highlighting for IEC 61131-3 ST in VS Code. Can be configured for .fun, .var, .typ B&R file extensions. |
| Loupe Package Manager (LPM) | loupeteam.github.io/LoupeDocs/tools/lpm.html | CLI for managing Loupe packages in AS and Loupe UX ecosystems. Install, update, and remove packages from the command line. |
| as6-migration-tools | github.com/br-automation-community/as6-migration-tools | Automated AS4→AS6 project conversion (existing entry — still the primary migration tool) |
| OMJSON / OMBSON | github.com/loupeteam/OMJSON, OMBSON | JSON/BSON communication libraries for B&R PLCs. Enables modern JSON-based IIoT communication directly from PLC code. |
| TCPComm / UDPComm | github.com/loupeteam/TCPComm, UDPComm | Simplified wrappers around AsTCP/AsUDP system libraries for easier TCP/UDP communication in PLC programs. |
| AxisLib | github.com/loupeteam/AxisLib | Control B&R Mapp Motion and ACP10 servo axes from a higher-level API. |
Note: The awesome-B-R community repository was archived on April 30, 2025 (made read-only). The curated list of tools is now frozen but remains a valuable reference. Active tool development continues in individual repositories. The archive is at github.com/archive-br-automation-com/awesome-B-R.
AS Code vs VS Code B&R Tools — Which to Use?
| Feature | AS Code (B&R official) | VS Code B&R Tools (community) |
|---|---|---|
| ST editing | Full IntelliSense, syntax highlighting | Syntax highlighting only (via separate extension) |
| C/C++ editing | Full IntelliSense, syntax highlighting | IntelliSense via community extension |
| Build/Transfer | Integrated via AS 6.3 | Build via BR.AS.Build.exe, Transfer via PVITransfer.exe |
| AI assistance | AS Copilot (cloud) | None |
| Git integration | Native | Native (VS Code built-in) |
| AS 4.x compatibility | No — AS 6.x only | Yes — works with AS 4.x projects |
| Debugging | Integrated | Via PVI |
| Cost | Requires AS 6 license (no extra cost) | Free |
What Changes with In-Family Migration
| Aspect | Impact | Action Required |
|---|---|---|
| CPU speed | Faster cycle times | May need to adjust task timing |
| RAM | More program/data space | No action required, benefits automatic |
| Storage (CF to SD) | Different media type | Clone CF to SD card before swap |
| Ethernet speed | 10/100 to 10/100/1000 on some | Recheck auto-negotiation on switches |
| POWERLINK | Same protocol, same timing | No action for single node; verify bus config for multi-node |
| IO modules | Backward compatible | Plug-and-play, verify bus addresses |
| Software project | Same AR, same programming | Open in AS 4.x, recompile, download |
| mapp components | Version differences possible | Verify mapp version compatibility |
| Safety configuration | SafeLOGIC modules compatible | Re-verify safety parameters after download |
| Firmware version | Must match AR version | See firmware-version-mgmt.md |
Migration Steps in Automation Studio
Prerequisites:
- Automation Studio 4.x installed (AS 4.x is current)
- Original project file (.apj) recovered or reconstructed
- Target CPU firmware installed in Automation Studio
- CF card backed up using SD card or USB transfer
Step-by-Step Procedure:
-
Backup existing system
- Create full CF card image:
dd if=/dev/sdX of=cp1584_backup.img bs=4M - Backup Automation Studio project file
- Export IO configuration and hardware tree
- Document all parameter values (see config-file-formats.md)
- Record POWERLINK node addresses and bus timing
- Create full CF card image:
-
Open project in Automation Studio 4.x
- If project was created in AS 3.x, AS 4.x will prompt for migration
- Accept migration. Review migration log for warnings.
- Common migration warnings: deprecated function blocks, renamed libraries
- Resolve all warnings before proceeding
-
Change hardware configuration
- In the Hardware Catalog, locate the target CPU
- Right-click existing CPU in the hardware tree -> Replace Hardware
- Select the new CPU model
- Verify all IO modules are still recognized
- Check for any address conflicts after replacement
-
Verify and resolve library compatibility
- Check Library Repository for all used libraries
- Update any libraries flagged as incompatible
- Pay special attention to mapp component versions
- Rebuild project: Project -> Rebuild All
-
Adjust timing parameters
- Open Task Configuration
- Review cycle times against new CPU performance
- If cycle times were tight on old CPU, they will be fine on new CPU
- If software used timing-dependent code (WAIT ms, hardware counters), verify
- Adjust POWERLINK cycle time if required (usually no change needed)
-
Prepare new CPU
- Insert SD card in new CPU
- Power on new CPU, connect Ethernet
- Update firmware via Automation Studio if needed: Tools -> Update Firmware
- Verify firmware version matches project requirements
- Set IP address to match original CPU configuration
-
Download and test
- Download project to new CPU: CPU -> Download
- Verify all IO modules are detected on bus
- Run I/O check: manually activate each input, verify each output
- Run Auto Configuration to let IO modules self-initialize
- Run machine through manual cycle if possible
-
Safety system verification
- If SafeLOGIC is present: re-verify all safety parameters
- Check safe inputs, safe outputs, safe analog values
- Confirm safe bus communication
- Document safety verification for compliance records
-
Commission and monitor
- Run machine in automatic mode
- Monitor for 4-8 hours minimum
- Check for any unexpected behavior in timing-sensitive sequences
- Archive project with new hardware configuration
Hardware Replacement Procedure
PRE-SWAP CHECKLIST
==================
[ ] Machine powered down and locked out (LOTO)
[ ] Original CPU CF card backed up (dd image)
[ ] New CPU firmware version verified
[ ] New CPU IP address configured
[ ] Ethernet cables labeled
[ ] POWERLINK bus cables labeled
[ ] X20 base module connectors labeled
[ ] IO module positions documented with photos
[ ] Project compiled and ready for download
[ ] Test plan prepared
SWAP PROCEDURE
=============
1. Disconnect Ethernet cables from old CPU
2. Disconnect POWERLINK bus cables from old CPU (note: may be daisy-chain)
3. Remove old CPU from X20 base module (slide latch)
4. Mount new CPU on X20 base module
5. Reconnect POWERLINK bus cables (same positions)
6. Reconnect Ethernet cables (same positions)
7. Power on machine
8. Connect laptop to CPU via Ethernet
9. Ping CPU IP address - confirm connectivity
10. Open Automation Studio, connect to CPU
11. Download project
12. Verify IO configuration matches
13. Run I/O check
14. Start machine, monitor
POST-SWAP
=========
[ ] All IO modules detected on bus
[ ] IO check passed (all inputs/outputs verified)
[ ] Machine runs through full automatic cycle
[ ] No error flags in diagnostics
[ ] Backup of new configuration saved
[ ] Old CPU archived as spare (if functional)
[ ] Maintenance log updated
IO Module Backward Compatibility
X20 IO modules are generally backward compatible across CPU generations. Specific notes:
- X20 digital and analog IO modules: fully compatible, plug-and-play
- X20 safe IO modules: compatible, but safety parameters must be re-verified
- X20 communication modules (PROFINET, EtherNet/IP, Modbus): compatible
- X20 bus couplers: compatible
- X20 power supply modules: compatible
- X20 interface modules (X2X, POWERLINK): compatible
Exception: Some very early X20 modules (pre-2010) may need firmware updates to work with AR 4.x. Check the module firmware version in Automation Studio’s Hardware Catalog.
4. X20 to X67 Migration (Form Factor Change)
X67 System Overview
B&R X67 is the IP67-rated compact variant of the X20 system. It uses the same Automation Runtime, the same POWERLINK protocol, and the same programming model (Automation Studio). The difference is physical: X67 modules are designed for mounting directly on the machine without a control cabinet.
X20 vs X67 Comparison
| Aspect | X20 | X67 |
|---|---|---|
| IP rating | IP20 (cabinet mount) | IP67 (direct machine mount) |
| Form factor | 15mm wide modules, DIN rail | Compact blocks, M12 connectors |
| Wiring | Screw terminals | M12 connectors (pre-wired cables) |
| IO density | Higher per module | Lower per module (distributed) |
| Cost per point | Lower | Higher (connector cost) |
| Deployment | Centralized cabinet | Distributed on machine |
| Suitability | New builds, cabinet retrofits | Retrofit without cabinet expansion |
| CPU | Full range (CP1584, CP1484, etc.) | X67C CPU variants |
| IO bus | POWERLINK + X2X | POWERLINK + X2X (same) |
| Programming | Automation Studio | Automation Studio (same) |
| Safety | SafeLOGIC via X20 safe bus | SafeLOGIC via X67 safe bus |
| Diagnostic | LED + web interface | LED + web interface |
When X67 Makes Sense
- Machine has no room for additional cabinet space
- Need to distribute IO across multiple machine zones
- IP67 environment requirement (washdown, dusty, outdoor)
- Simplified installation (M12 connectors vs screw terminals)
- Retrofit where pulling new cables to cabinet is impractical
When X20 Remains Better
- Existing X20 IO modules are healthy and compatible
- Cabinet space is available
- Cost sensitivity (X67 modules cost more per IO point)
- Centralized control architecture preferred
- Complex safety system (more options in X20)
X20 to X67 Migration Considerations
| Concern | Detail |
|---|---|
| Project portability | Same AR, same AS project structure. Minor hardware tree changes only. |
| IO wiring | X67 uses M12 connectors. Requires complete rewiring of field devices. |
| Bus wiring | POWERLINK topology unchanged. Physical cable type may differ (IP67 rated). |
| CPU selection | Use X67C-series CPU. Performance comparable to X20CP1484/1485. |
| Safety migration | SafeLOGIC configuration portable but safe IO modules change. |
| Physical installation | X67 modules mount with brackets or adhesive. No DIN rail needed. |
| Cost | Higher per-point IO cost offset by reduced cabinet and wiring cost. |
X67C CPU Models for Migration
When migrating from a CP1584, the most appropriate X67C CPU replacements are:
| Model | Processor | RAM | POWERLINK | Ethernet | Notes |
|---|---|---|---|---|---|
| X67BC8321 | Intel Atom (1.6 GHz) | 1 GB DDR3 | 2x POWERLINK | 2x GbE | Direct upgrade path, far exceeds CP1584 |
| X67BC8322 | Intel Atom (1.6 GHz) | 1 GB DDR3 | 2x POWERLINK | 2x GbE | With 2x USB, RS232 |
| X67BC8323 | Intel Atom (1.6 GHz) | 1 GB DDR3 | 2x POWERLINK | 2x GbE | With interface slots (serial, CAN) |
| X67DC832A | Intel Atom (1.6 GHz) | 512 MB DDR3 | 1x POWERLINK | 2x GbE | DIP switch for station number |
Note: X67C CPUs use Intel Atom processors significantly faster than the CP1584’s E620T. All X67C models support AR 6.x, which provides substantially more features than the CP1584’s AR 4.x. The migration from AR 4.x to AR 6.x requires Automation Studio 6 and careful project conversion (see Section 3).
X67 M12 Connector Wiring
X67 modules use industry-standard M12 connectors (A-coded for power/signal, D-coded for Ethernet/POWERLINK):
| Connector Type | Application | Pin Configuration |
|---|---|---|
| M12 A-coded 5-pin | Digital IO, analog IO | Pin 1: +24V, Pin 2: Signal, Pin 3: Ground, Pin 4: NC, Pin 5: Shield |
| M12 A-coded 8-pin | Analog IO (differential) | Pin 1: +24V, Pin 2: Signal+, Pin 3: Ground, Pin 4: Signal-, Pin 5: NC/Supply- |
| M12 D-coded 4-pin | Ethernet, POWERLINK | Standard IEEE 802.3af: Pin 1: TX+, Pin 2: TX-, Pin 3: RX+, Pin 4: RX- |
| M12 A-coded 12-pin | Multi-channel digital | Two channels per connector |
X67 Safe IO Migration Notes
When migrating safety systems from X20 to X67:
| X20 Safe Module | X67 Equivalent | Key Differences |
|---|---|---|
| X20SI4340 (safe digital input, 4-ch) | X67SI4340 (safe digital input, 4-ch) | Same function block interface, M12 instead of terminal |
| X20SO4120 (safe digital output, 4-ch) | X67SO4120 (safe digital output, 4-ch) | Same function block interface, M12 instead of terminal |
| X20SA4430 (safe analog input) | X67SA4430 (safe analog input) | Same function block interface |
SafeLOGIC configurations are fully portable — the safety program runs identically on X20 and X67 safety modules. The hardware configuration tree must be updated with the correct X67 module order codes, but no safety logic changes are needed. Safety recertification (SIL verification) should be performed after any hardware change per IEC 61508 requirements.
5. B&R to CODESYS Migration
Overview
CODESYS V3 is the dominant IEC 61131-3 development environment that runs on hardware from multiple vendors. Migrating from B&R to CODESYS means choosing a new hardware platform (Wago, Beckhoff, ifm, etc.) while porting the software to CODESYS.
Target Hardware Platforms
| Platform | CPU Example | Price Range | EtherCAT | PROFINET | CODESYS Support |
|---|---|---|---|---|---|
| Wago PFC200 | Wago PFC200 (ARM Cortex A8) | $500-$2,000 | Yes (via CODESYS EtherCAT) | Yes | CODESYS V3.5 |
| Wago Edge Controller | Wago PFC100/200 V3 | $800-$3,000 | Yes | Yes | CODESYS V3.5 |
| Beckhoff CX | Beckhoff CX9020 (Intel) | $1,000-$3,000 | Yes (native) | Yes | CODESYS V3.5 (via TwinCAT) |
| ifm CR | ifm CR7000/CR8000 | $800-$2,500 | Yes | Yes | CODESYS V3.5 |
| Any CODESYS V3 controller | Various ARM/x86 | $500-$5,000 | Varies | Varies | CODESYS V3.5 |
| Raspberry Pi + CODESYS | RPi 3/4 + CODESYS RTE | $100-$300 | No | No | CODESYS V3.5 (limited) |
What Is Portable from B&R to CODESYS
| Element | Portability | Notes |
|---|---|---|
| IEC 61131-3 languages (ST, LD, FBD, SFC, IL) | High | ST is most portable. IL is deprecated in CODESYS. |
| Standard function blocks (TON, TOF, CTU) | High | Syntax identical. Confirm timing behavior. |
| User-defined function blocks | Medium-High | Rewrite using CODESYS FB structure. Logic is portable, B&R-specific calls are not. |
| Data types (STRUCT, ARRAY, ENUM) | High | Mostly identical syntax. |
| Task configuration | Medium | Different task model. Map B&R tasks to CODESYS tasks. |
| POWERLINK configuration | Low | POWERLINK supported via EPSG CODESYS EtherCAT stack but configuration differs entirely. |
| mapp components | None | No equivalent. Must implement functionality from scratch. |
| B&R library functions (mc, as, sys) | None | Must find or write equivalents. |
| Visualization (mapp View / Panel) | None | Must rebuild in CODESYS WebVisu or third-party HMI. |
| OPC-UA communication | High | Both support OPC-UA, but configuration is different. |
| Modbus communication | Medium | Both support Modbus, but implementation differs. |
| File system operations | Low | B&R FileIO library has no CODESYS equivalent. Use SysFile library. |
What Is NOT Portable (Must Be Rewritten)
- All B&R-specific libraries (mapp, mc, as, sys, FileIO, Timer, etc.)
- All mapp components (mapp Motion, mamp View, mapp Alarm, etc.)
- B&R visualization pages
- B&R configuration objects (Axis, CAM, etc.)
- B&R-safe function blocks (SafeLOGIC programs)
- B&R PVI communication
- B&R-specific task triggers (hardware interrupt, POWERLINK event)
POWERLINK on CODESYS
POWERLINK (Ethernet POWERLINK) is standardized through EPSG (Ethernet POWERLINK Standardisation Group). CODESYS supports POWERLINK through the CODESYS EtherCAT stack, but this is not a direct drop-in replacement.
Reality check: Most CODESYS hardware platforms use EtherCAT, not POWERLINK. If you need to keep existing POWERLINK IO, your options are limited:
- Use a B&R X20 bus coupler as a POWERLINK-to-EtherCAT gateway (complex)
- Replace IO with EtherCAT-compatible IO (requires rewiring)
- Use CODESYS on B&R hardware (possible but defeats migration purpose)
Recommendation: If IO must be replaced anyway (due to degradation), migrate to EtherCAT IO simultaneously. If IO is healthy, stay within B&R ecosystem.
Safety System Migration: B&R SafeLOGIC to CODESYS Safe SIL
This is the most critical and costly aspect of any cross-platform migration.
| Aspect | B&R SafeLOGIC | CODESYS Safe SIL |
|---|---|---|
| Programming | B&R AS safe editor | CODESYS Safe editor (separate SIL2/3 environment) |
| Certification | TUV-certified for B&R hardware | TUV-certified for specific CODESYS controller |
| IO | X20 safe IO modules | Platform-specific safe IO (EtherCAT FSoE) |
| Validation | B&R validation toolchain | CODESYS Safety SIL validation toolchain |
| Recertification | Required when changing hardware | Required (new platform = new certification) |
| Effort | N/A for same platform | 2-6 weeks for safety system alone |
| Cost | Included with SafeLOGIC modules | Controller + safe IO + engineering + certification |
Safety migration is not a software port. It requires:
- New SIL assessment for the target platform
- Rewriting all safety logic in CODESYS Safe SIL
- New hardware safety validation (FSoE communication tests)
- Third-party validation and certification
- Updated safety documentation (SRS, SIS, test records)
Estimated cost for safety migration alone: $5,000 - $25,000 depending on complexity.
Estimated CODESYS Migration Effort
| Component | Effort (person-days) | Prerequisites |
|---|---|---|
| Hardware selection and procurement | 3-5 | IO requirements documented |
| Control logic porting (per 1000 IEC lines) | 5-15 | Original program understood |
| B&R-specific library replacement | 10-30 | Depends on library usage |
| Motion control reimplementation | 15-40 | If motion is used |
| HMI/visualization rebuild | 10-30 | If visualization is used |
| Communication (OPC-UA, Modbus, custom) | 5-15 | Protocol requirements |
| Safety system (if applicable) | 20-40 | SIL certification required |
| Testing and commissioning | 10-20 | Full system test |
| Total (simple, no motion, no safety) | 40-100 | 8-20 weeks |
| Total (complex, with motion + safety) | 100-200+ | 20-40+ weeks |
6. B&R to Siemens Migration
Siemens Platform Overview
Siemens S7-1500 is the flagship PLC platform within the TIA Portal ecosystem. Migration from B&R to Siemens is a complete platform change: different hardware, different software (TIA Portal vs Automation Studio), different IO, different communication protocols.
Hardware Comparison
| Aspect | B&R X20CP1584 | Siemens S7-1500 (e.g., CPU 1515-2 PN) |
|---|---|---|
| Processor | Intel Atom E620T 600MHz | Siemens industrial processor |
| RAM | 256MB DDR2 | 256KB work memory, 1.5MB load memory |
| Storage | CompactFlash | SIMATIC Memory Card |
| Ethernet | 2x 10/100 + POWERLINK | 2x PROFINET (10/100/1000) |
| IO | X20 via POWERLINK/X2X | ET 200 via PROFINET |
| Programming | Automation Studio 4.x | TIA Portal (STEP 7) |
| Languages | IEC 61131-3 (ST, LD, FBD, SFC, IL) | IEC 61131-3 (ST, LD, FBD, SFC) + Graph, CFC |
| Safety | SafeLOGIC | F-CPU (Failsafe CPU) |
| Motion | Integrated (mapp Motion) | Integrated (Technology Objects) |
| Diagnostics | Web-based, LED | Web-based, LED, TIA Portal integrated |
Software Migration Challenges
| B&R Concept | Siemens Equivalent | Migration Complexity |
|---|---|---|
| Automation Studio project | TIA Portal project | Complete recreation |
| IEC 61131-3 ST code | STEP 7 ST code | Medium - syntax differences |
| B&R Function Blocks (mapp, mc) | Siemens FC/FB + Technology Objects | High - rewrite required |
| POWERLINK bus | PROFINET | Complete IO reconfiguration |
| X20 IO modules | ET 200SP / ET 200MP | Complete rewiring |
| mapp View visualization | WinCC Advanced/Comfort | Complete recreation |
| OPC-UA | OPC-UA (Siemens) | Medium - different API |
| SafeLOGIC | F-CPU + F-I/O | Complete safety system rewrite |
| Task configuration | Cycle OB, time OB | Medium - different model |
| Data logging | Siemens Data Logging | Medium |
| Alarm management | Siemens Alarm Management | Medium |
IEC 61131-3 Dialect Differences (B&R ST vs Siemens ST)
B&R Automation Studio ST: | Siemens TIA Portal ST:
-----------------------------------+----------------------------------
x := y + z; | x := y + z;
IF a THEN | IF a THEN
b := TRUE; | b := TRUE;
END_IF; | END_IF;
// B&R uses: | // Siemens uses:
fbInst(input := 10); | fbInst(input := 10);
| // or:
| fbInst.Input := 10;
// B&R timer: | // Siemens IEC timer:
TON_inst(IN := TRUE, PT := T#5s); | TON_Instance(IN := TRUE, PT := T#5S);
// B&R string: | // Siemens string:
s := 'Hello'; | s := 'Hello';
| // STRING[254] type declaration
| // differs from B&R STRING type
// B&R array access: | // Siemens array access:
a[5] := 10; | a[5] := 10;
| // Array bounds checking differs
// B&R pointer (rare): | // Siemens pointer:
p := ADR(variable); | p := %MW100; // absolute addressing
Communication Migration: POWERLINK to PROFINET
This is one of the most impactful changes. POWERLINK and PROFINET are fundamentally different protocols:
| Aspect | POWERLINK (B&R) | PROFINET (Siemens) |
|---|---|---|
| Standard | Open (EPSG) | Siemens + PI |
| Topology | Tree, star, daisy-chain | Star, tree (switched) |
| Timing | Deterministic (isochronous) | Deterministic (IRT, RT) |
| Configuration | B&R AS or openCONFIGURATOR | TIA Portal |
| IO devices | X20 modules | ET 200SP, ET 200MP, third-party |
| Cables | Standard Ethernet | Standard Ethernet |
| Switches | Standard or managed | Siemens SCALANCE or standard |
Impact: All IO must be replaced. All field wiring to IO terminals must be re-punched or re-connected. IO addresses will change. All IO references in program code must be updated.
Safety Migration: B&R SafeLOGIC to Siemens F-CPU
| Aspect | B&R SafeLOGIC | Siemens F-CPU |
|---|---|---|
| Safety CPU | Separate SafeLOGIC module or integrated | Integrated F-CPU (same CPU with safety) |
| Safety IO | X20 safe IO modules | F-I/O modules (ET 200F, ET 200SP F) |
| Programming | SafeLOGIC in Automation Studio | F-CPU programming in TIA Portal |
| Certification | SIL 2/3 | SIL 1-3 (depends on F-CPU variant) |
| Validation | B&R tools | Siemens tools + TUV |
| Safety communication | Safe bus (B&R proprietary) | PROFIsafe |
| Effort to migrate | N/A | 3-8 weeks |
Cost Comparison: In-Family vs Siemens Migration
| Cost Item | B&R In-Family (X20CP1584 -> X20CP3484) | Siemens S7-1500 Migration |
|---|---|---|
| New CPU | $3,000-$5,000 | $2,000-$6,000 |
| New IO modules | $0 (reuse X20) | $5,000-$20,000 (ET 200) |
| Software (AS 4.x) | $0 (already have) | $2,000-$5,000 (TIA Portal license) |
| Engineering labor | 2-5 days | 20-60 days |
| Safety recertification | Minimal (same platform) | $5,000-$25,000 |
| Wiring changes | Minimal | Complete rewiring |
| Commissioning downtime | 1-2 days | 1-4 weeks |
| Training | Minimal (same tools) | 2-4 weeks for engineers |
| Total estimated cost | $4,000-$8,000 | $25,000-$80,000+ |
7. B&R to Beckhoff Migration
Beckhoff Platform Overview
Beckhoff’s TwinCAT 3 environment runs on standard PC hardware (CX series industrial PCs or standard IPCs) and provides IEC 61131-3 programming. It is architecturally similar to B&R in several ways, making it a relatively more natural migration target than Siemens.
B&R vs Beckhoff: Architectural Similarities
| Aspect | B&R X20 | Beckhoff TwinCAT 3 |
|---|---|---|
| CPU | Intel Atom on embedded module | Intel Celeron/i-series on CX or standard IPC |
| Bus | POWERLINK (Ethernet POWERLINK) | EtherCAT |
| IO | X20 modules (DIN rail, IP20) | EtherCAT Terminals (DIN rail, IP20) |
| Programming | Automation Studio | TwinCAT 3 (CODESYS-based) |
| Languages | IEC 61131-3 | IEC 61131-3 + Python + C++ |
| Safety | SafeLOGIC (SIL 2/3) | TwinCAT Safety (SIL 2/3) via FSoE |
| HMI | Power Panel / mapp View | TwinCAT HMI / CX Touch panels |
| Motion | Integrated (mapp Motion) | Integrated (TwinCAT NC PTP/NC I) |
| Configuration | AS hardware tree | TwinCAT System Manager |
| Cost model | Higher CPU, lower per-point IO | Lower CPU, moderate per-point IO |
Key Differences
| Difference | Impact on Migration |
|---|---|
| POWERLINK vs EtherCAT | IO bus change. Must replace all IO modules and field wiring. |
| Automation Studio vs TwinCAT | Different IDE. Project structure differs. |
| B&R mapp components | No Beckhoff equivalent. Must implement functionality directly. |
| X20 module vs EtherCAT terminals | Different physical form factor, different wiring (screw terminals vs spring-clamp). |
| B&R-specific libraries | Must rewrite for TwinCAT. TwinCAT has its own library ecosystem. |
| Configuration objects | B&R Axis/CAM objects -> TwinCAT NC PTP/NC I configuration. |
Library Migration: B&R to TwinCAT
| B&R Library/Function | TwinCAT Equivalent | Notes |
|---|---|---|
mapp Motion (mcAXIS, mcPower) | Tc2_MC_Power, Tc2_MC_Base | Axis configuration changes; FB interface differs but concepts similar |
mapp AlarmX | Tc2_Alarm | Beckhoff alarm management uses different trigger model |
mapp View (HMI) | Tc3_HMI or Tc3_WebUI | Completely different HMI paradigm; web-based in TwinCAT |
FileIO | Tc2_System SysFile* | File operations; similar API surface |
AsTCP / AsUDP | Tc2_Socket | Socket API; similar but different function block naming |
AsBrStr | Tc2_Standard | String operations |
AsMath | Tc2_Standard F_MATH | Math functions |
AsTimer | TON/TOF/TP (IEC standard) | Timer function blocks |
McParam (drive params) | EtherCAT drive configuration | Via ESI (EtherCAT Slave Information) XML files |
PVI (PLC access) | ADS/AMS protocol | Beckhoff’s native communication protocol |
Powerlink | EtherCAT master (built into TwinCAT) | Configure in System Manager, scan bus |
Beckhoff Hardware Selection for Migration from CP1584
| B&R Component | Beckhoff Replacement | Model Suggestion | Notes |
|---|---|---|---|
| X20CP1584 (CPU) | CX9020 or C6920 | Intel Celeron N3160 (CX9020) or Core i (C6920) | Far exceeds CP1584 performance |
| X20 base module | CX bus coupler terminals | BK1120 (EtherCAT coupler) | First terminal in each EtherCAT segment |
| X20 digital input (e.g., X20DI9371) | EL1002, EL1004, EL1008 | 2/4/8-ch 24V DC digital input | Spring-clamp terminals |
| X20 digital output (e.g., X20DO9321) | EL2002, EL2004, EL2008 | 2/4/8-ch 24V DC digital output | Spring-clamp terminals |
| X20 analog input (e.g., X20AI4622) | EL3122, EL3152, EL3162 | 2-ch ±10V/4-20mA, 14-16-bit | Per-channel configurable on some models |
| X20 analog output (e.g., X20AO4622) | EL4002, EL4032 | 2-ch analog output | |
| X20 POWERLINK interface | Integrated EtherCAT on CX | N/A | No separate bus module needed |
| X20 RS232 (IF1) | EL6021 | 1-ch serial RS232 terminal | |
| ACOPOS drive | AM8000/AM3000 servo | EtherCAT-compatible | FSoE safe terminals for safety |
EtherCAT Configuration in TwinCAT (from B&R POWERLINK)
The EtherCAT configuration replaces POWERLINK entirely. Configuration steps:
- Install TwinCAT 3 XAE on development PC
- Create new TwinCAT project (TwinCAT XAE project type)
- Add target device — configure CX9020 IP address
- Scan EtherCAT bus — TwinCAT System Manager auto-discovers connected terminals
- Import ESI XML files — for any non-Beckhoff EtherCAT slaves (drives, gateways)
- Map process data — link EtherCAT terminal I/O to PLC variables in the “I/O” mapping view
- Configure drive axes — TwinCAT NC PTP for point-to-point, NC I for interpolated motion
- Safety configuration — add TwinCAT Safety project, map safe I/O, write safety PLC program
openCONFIGURATOR: If migrating to a non-Beckhoff EtherCAT platform (CODESYS, Wago), use the open-source openCONFIGURATOR tool from the EtherCAT Technology Group (https://www.ethercat.org) instead of TwinCAT System Manager for bus configuration. openCONFIGURATOR provides similar EtherCAT network scanning and process data mapping capabilities.
Migration Path
-
Hardware: Replace B&R X20 CPU with Beckhoff CX9020 (or similar). Replace all X20 IO with EtherCAT terminals. Replace power supplies if needed.
-
Software:
- Create new TwinCAT 3 project
- Port IEC 61131-3 logic (ST code is most portable)
- Configure EtherCAT IO in TwinCAT System Manager
- Replace B&R library calls with TwinCAT library equivalents (see table above)
- Configure motion control in TwinCAT NC PTP or NC I
- Build HMI in TwinCAT HMI or web-based
-
Safety:
- Replace B&R SafeLOGIC with TwinCAT Safety
- Use EtherCAT FSoE safe terminals (EL6900, etc.)
- Rewrite safety logic in TwinCAT Safe editor
- Recertify (SIL assessment on new platform)
-
HMI replacement:
- mapp View → TwinCAT HMI (Tc3_HMI) for PC-based visualization
- Or use TwinCAT TF2000 (web-based HMI) for browser access
- mapp View widget library has no TwinCAT equivalent; rebuild all screens
- Consider third-party web HMI solutions if TwinCAT HMI is insufficient
Beckhoff vs Siemens vs B&R Stay: Decision Matrix
| Criteria | Stay with B&R | Migrate to Beckhoff | Migrate to Siemens |
|---|---|---|---|
| Lowest migration effort | Yes | Medium | High |
| Lowest total cost | Yes (if in-family) | Medium | High |
| Best long-term support | Good (B&R active) | Excellent (Beckhoff large) | Excellent (Siemens dominant) |
| Widest talent pool | Small (B&R niche) | Medium | Large (Siemens standard) |
| Open standards support | Good (POWERLINK open) | Excellent (EtherCAT open) | Mixed (PROFINET proprietary) |
| Motion control sophistication | High | High | High |
| Safety certification | Good | Good | Good |
| Best for new features | Medium | High | High |
| Risk level | Low | Medium | High |
8. Migration Project Planning
Phase Overview
Phase 1: Document Existing System Week 1-2
Phase 2: Functional Requirements Spec Week 2-3
Phase 3: Hardware Selection Week 3-4
Phase 4: Software Development Week 4-12
Phase 5: Factory Acceptance Test Week 12-13
Phase 6: Commissioning Week 13-14
Phase 7: Parallel Operation Week 14-18
Phase 8: Decommissioning Old System Week 18
Phase 1: Document Existing System
Duration: 1-2 weeks
See documentation-reconstruction.md for detailed procedures. Key deliverables:
- Hardware inventory with module types, positions, and firmware versions
- IO wiring diagrams (input/output mapping)
- Network configuration (IP addresses, POWERLINK topology)
- Software version information (AR version, AS project version)
- Safety system documentation (if applicable)
- Photographs of all wiring, module positions, and label plates
- Export of current PLC program (if accessible)
Critical deliverable for cross-platform migration: A functional requirements document that describes what the machine does, not how it does it. This separates the machine’s behavior from the specific implementation.
Phase 2: Functional Requirements Specification
Duration: 1 week
Document what the control system must do in platform-independent terms:
- Process flow: Step-by-step description of machine operation
- IO list: Every input, output, analog value, and its function
- Interlocks: All safety and operational interlocks
- Sequences: All automatic sequences (start-up, normal operation, shutdown, emergency stop)
- Alarms: All alarm conditions and responses
- Setpoints: All operator-adjustable parameters
- Communication: All external interfaces (HMIs, SCADA, MES, other PLCs)
- Motion: All axes, speeds, positions, cam profiles
- Safety: All safety functions and their SIL requirements
This document becomes the acceptance criterion for the new system. It also serves as the primary input if you need to recreate the program from scratch.
Phase 3: Hardware Selection
Duration: 1 week
Based on functional requirements, select target platform:
| Decision Factor | Weight | B&R In-Family | CODESYS/Wago | Siemens S7-1500 | Beckhoff CX |
|---|---|---|---|---|---|
| Migration effort | 30% | 10/10 | 5/10 | 3/10 | 6/10 |
| Total cost | 25% | 9/10 | 7/10 | 4/10 | 7/10 |
| IO compatibility | 15% | 10/10 | 3/10 | 2/10 | 3/10 |
| Safety portability | 15% | 9/10 | 5/10 | 5/10 | 6/10 |
| Long-term support | 10% | 8/10 | 7/10 | 9/10 | 9/10 |
| Talent availability | 5% | 4/10 | 6/10 | 9/10 | 6/10 |
Score each option on a 1-10 scale, multiply by weight, sum.
Phase 4: Software Development
Duration: 4-8 weeks (varies with complexity)
For in-family migration: 2-5 days (mostly recompile and verify) For cross-platform migration: 4-12+ weeks
Milestones:
- Development environment configured
- IO mapping table completed (old addresses to new addresses)
- Core control logic ported
- All sequences implemented
- All alarms implemented
- Motion control configured (if applicable)
- HMI screens created
- Communication interfaces tested
- Safety logic implemented (if applicable)
- Unit testing complete
Phase 5: Factory Acceptance Test
Duration: 1 week
Conduct FAT with machine or IO simulation:
- Verify all IO points against requirements document
- Test all sequences manually and in automatic
- Verify alarm behavior
- Test communication interfaces
- Verify safety system (if applicable)
- Document any deviations from requirements
- Obtain sign-off from stakeholders
Phase 6: Commissioning
Duration: 1 week
- Install new hardware during planned downtime
- Wire IO (or verify preserved wiring for in-family swap)
- Download software
- Verify IO point-by-point
- Test sequences with machine
- Adjust timing and parameters
- Document all changes from FAT
Phase 7: Parallel Operation
Duration: 2-4 weeks
- Run new system in parallel with old (if architecture allows)
- Or: run new system with old system on standby
- Monitor for anomalies
- Train operators on any HMI changes
- Tune performance parameters
Phase 8: Decommissioning Old System
Duration: 1 day
- Remove old hardware
- Archive old CF card and project file
- Update maintenance documentation
- Return old hardware to spare parts pool (if functional) or dispose
- Update asset register
Resource Estimation
| Migration Type | Total Duration | Engineering Effort | Commissioning Duration | Downtime Required |
|---|---|---|---|---|
| In-family CPU swap | 2-4 weeks | 2-5 person-days | 1-2 days | 4-8 hours |
| X20 to X67 | 4-8 weeks | 10-20 person-days | 3-5 days | 1-3 days |
| B&R to CODESYS (simple) | 8-16 weeks | 40-80 person-days | 1-2 weeks | 1-2 weeks |
| B&R to CODESYS (complex) | 16-40 weeks | 100-200 person-days | 2-4 weeks | 2-4 weeks |
| B&R to Siemens | 16-40 weeks | 80-200 person-days | 2-4 weeks | 2-4 weeks |
| B&R to Beckhoff | 12-30 weeks | 60-150 person-days | 1-3 weeks | 1-3 weeks |
9. Minimizing Downtime During Migration
Strategy 1: Pre-Commissioning on Bench
Before the shutdown, build a replica of the new system on a workbench:
- Mount new CPU and IO modules on DIN rail
- Wire test inputs (switches, buttons) and test outputs (LEDs, relays)
- Download software and verify basic operation
- Simulate IO states using manual switches or test software
- Test all sequences, alarms, and safety logic
- Resolve all software issues before the production shutdown
Benefit: Reduces commissioning downtime by 50-75%.
Strategy 2: Staged Migration
For complex systems, migrate in stages over multiple short shutdowns:
Stage 1 (Shutdown 1, 4-8 hours):
- Install new CPU alongside old CPU
- Wire new CPU to existing IO (parallel wiring)
- Pre-position all cables
Stage 2 (Shutdown 2, 4-8 hours):
- Switch IO connections from old to new CPU
- Verify IO point-by-point
- Run machine on new CPU
Stage 3 (Shutdown 3, 2-4 hours):
- Remove old CPU and wiring
- Final cleanup and documentation
Strategy 3: IO Mapping Preservation
When migrating within B&R (X20 to X20), preserve IO addresses:
- Document all IO addresses in old system
- In new system, manually set IO addresses to match old system
- Program references remain unchanged
- Only hardware configuration changes, not software logic
This technique reduces software modification to near zero for in-family swaps.
Strategy 4: Temporary Bridge PLC
For cross-platform migrations where downtime must be minimized:
- Install a small, inexpensive PLC (e.g., Wago 750-8206) as a temporary controller
- Program it with minimal logic to keep the machine running (manual mode only)
- This frees the original B&R hardware for reference during migration
- Or: this allows the original hardware to be decommissioned safely
Strategy 5: Rollback Plan
Always have a rollback plan:
Rollback Checklist (before starting migration):
[ ] Old CPU CF card fully backed up (dd image)
[ ] Old CPU stored in anti-static bag, labeled
[ ] IO wiring diagram documented (with photos)
[ ] All IO connections can be restored to old configuration within 2 hours
[ ] Backup of all new software and configurations
[ ] Test procedure for verifying rollback success
[ ] Decision criteria: when to abort migration and rollback
[ ] Rollback decision authority identified (who makes the call)
Downtime Estimation by Strategy
| Strategy | Planned Downtime | Risk of Overtime | Preparation Effort |
|---|---|---|---|
| Direct swap (no prep) | 1-4 weeks | High | Minimal |
| Pre-commissioned on bench | 1-3 days | Low-Medium | 2-4 weeks |
| Staged migration (3 stages) | 3x 4-8 hours | Low | 4-6 weeks |
| Temporary bridge PLC | 4-8 hours (final) | Low | 3-5 weeks |
| Parallel operation | 2-4 hours (cutover) | Very Low | 6-8 weeks |
10. Cost/Benefit Analysis Framework
Repair Cost Model
Total Repair Cost = Parts Cost + Labor Cost + Downtime Cost + Risk Cost
Parts Cost:
CF card: $20 - $80
Battery (CR2032): $5 - $15
Capacitors: $10 - $50
PSU replacement: $50 - $200
Base module: $200 - $400
Labor Cost:
Diagnosis: 1-4 hours x hourly rate
Repair: 0.5-4 hours x hourly rate
Testing: 1-4 hours x hourly rate
Downtime Cost:
Production loss per hour x estimated downtime hours
(typically 1-8 hours for repair scenarios)
Risk Cost (probability-weighted):
P(failure within 6 months) x (replacement cost + downtime cost)
Example: 30% chance of failure within 6 months
x $5,000 replacement cost
= $1,500 risk cost
Example Repair Calculation:
Parts (CF card): $40
Labor (4 hours): 4 x $100/hr = $400
Downtime (4 hours): 4 x $500/hr = $2,000
Risk (30% x $5000): $1,500
TOTAL: $3,940
In-Family Upgrade Cost Model
Total Upgrade Cost = Hardware Cost + Software Cost + Labor Cost +
Downtime Cost + Commissioning Cost
Hardware Cost:
New CPU (X20CP1485): $2,000 - $3,500
SD card (if not included): $20 - $60
New firmware license (if needed): $0 - $500
Mounting hardware (if needed): $0 - $50
Software Cost:
Automation Studio license: $0 (already have)
Library updates: $0 - $200
Labor Cost:
Preparation and planning: 8-16 hours x hourly rate
Hardware swap: 4-8 hours x hourly rate
Software migration: 4-16 hours x hourly rate
Testing: 8-16 hours x hourly rate
Downtime Cost:
Production loss per hour x estimated downtime hours
(typically 4-16 hours for in-family swap)
Commissioning Cost:
IO verification: 4-8 hours x hourly rate
Safety verification: 4-8 hours x hourly rate
Run-in monitoring: 8-16 hours x hourly rate
Example In-Family Upgrade Calculation:
Hardware (CPU): $2,500
Software: $100
Labor (40 hours): 40 x $100/hr = $4,000
Downtime (8 hours): 8 x $500/hr = $4,000
Commissioning (16 hours): 16 x $100/hr = $1,600
TOTAL: $12,200
Platform Migration Cost Model
Total Migration Cost = Hardware Cost + Software/License Cost +
Engineering Cost + Downtime Cost +
Commissioning Cost + Safety Cost +
Training Cost + Risk Contingency
Hardware Cost:
New PLC CPU: $1,000 - $6,000
IO modules (all replaced): $5,000 - $25,000
Networking equipment: $500 - $3,000
Power supplies: $200 - $1,000
Cabinets/enclosures: $500 - $3,000
Cabling/wiring: $1,000 - $5,000
Software/License Cost:
Programming software: $1,000 - $5,000
Communication drivers: $200 - $2,000
HMI software: $500 - $3,000
Safety software (if needed): $500 - $2,000
Engineering Cost:
Documentation: 40-80 hours x hourly rate
Software development: 200-800 hours x hourly rate
Testing and simulation: 40-80 hours x hourly rate
HMI development: 40-120 hours x hourly rate
Downtime Cost:
Production loss per hour x estimated downtime hours
(typically 40-160 hours for full migration)
Commissioning Cost:
Installation: 40-80 hours x hourly rate
IO verification: 16-40 hours x hourly rate
Sequence testing: 40-80 hours x hourly rate
Safety validation: 40-80 hours x hourly rate
Performance tuning: 16-40 hours x hourly rate
Safety Cost (if applicable):
Safety engineering: $5,000 - $15,000
SIL assessment: $3,000 - $10,000
Third-party validation: $2,000 - $8,000
F-I/O modules: $2,000 - $8,000
Training Cost:
Engineering team: $2,000 - $8,000
Maintenance team: $500 - $2,000
Operators: $500 - $2,000
Risk Contingency:
20-30% of total above (unforeseen issues)
Example Platform Migration (B&R to Siemens, moderate complexity):
Hardware: $18,000
Software/Licenses: $5,500
Engineering (500 hours): 500 x $100/hr = $50,000
Downtime (80 hours): 80 x $500/hr = $40,000
Commissioning (200 hours): 200 x $100/hr = $20,000
Safety: $15,000
Training: $6,000
Contingency (25%): $38,625
TOTAL: $193,125
Ongoing Maintenance Cost Comparison (Annual)
| Cost Item | B&R In-Family | CODESYS Platform | Siemens Platform | Beckhoff Platform |
|---|---|---|---|---|
| Spare parts inventory | $1,000-$3,000 | $500-$2,000 | $500-$2,000 | $500-$2,000 |
| Software maintenance | $500-$1,000/yr | $300-$800/yr | $500-$1,500/yr | $300-$800/yr |
| Engineering support (hrs/yr) | 10-20 | 15-30 | 10-20 | 15-25 |
| Failure probability (annual) | 2-5% | 2-5% | 2-4% | 2-5% |
| Mean repair cost per failure | $500-$2,000 | $300-$1,500 | $300-$1,500 | $300-$1,500 |
| Expected annual repair cost | $50-$200 | $30-$150 | $30-$120 | $30-$150 |
| Training refresh (annual) | $500 | $500 | $1,000 | $500 |
| Total annual | $2,550-$5,700 | $2,130-$5,050 | $2,530-$5,620 | $2,080-$4,950 |
ROI Calculation
ROI = (Annual Savings - Annual Cost) / Migration Investment x 100%
Annual Savings = Old annual maintenance - New annual maintenance
+ Reduced downtime value
+ Reduced failure probability value
Annual Cost = New annual maintenance
+ License fees
+ Support contracts
Example (B&R in-family upgrade):
Migration investment: $12,200
Old annual maintenance: $5,000
New annual maintenance: $3,000
Reduced downtime: 4 hours/year x $500/hr = $2,000
Reduced failure probability: $200/year saved
Annual savings: $5,000 - $3,000 + $2,000 + $200 = $4,200
Annual net benefit: $4,200 - $3,000 = $1,200
ROI: $1,200 / $12,200 x 100% = 9.8%
Payback period: $12,200 / $1,200 = 10.2 years
Example (B&R to Siemens, with 7-year machine life remaining):
Migration investment: $193,125
Old annual maintenance: $5,000
New annual maintenance: $3,000
Reduced downtime: 16 hours/year x $500/hr = $8,000
Reduced failure probability: $200/year saved
Annual savings: $5,000 - $3,000 + $8,000 + $200 = $10,200
Annual net benefit: $10,200 - $3,000 = $7,200
ROI: $7,200 / $193,125 x 100% = 3.7%
Payback period: $193,125 / $7,200 = 26.8 years
This migration would NOT pay for itself within the machine's remaining life.
In-family upgrade is the correct choice.
Decision Rule Summary
IF machine remaining life < 3 years AND system is repairable:
-> REPAIR (Zone 1-2)
Budget: $10 - $500
Risk: Low
ELIF machine remaining life 3-7 years AND project file available:
-> IN-FAMILY UPGRADE (Zone 3)
Budget: $1,500 - $8,000
Risk: Low-Medium
ELIF machine remaining life > 7 years AND OEM standardization needed:
-> CROSS-PLATFORM MIGRATION (Zone 4)
Budget: $15,000 - $80,000
Risk: Medium-High
ELIF full redesign of machine control required:
-> FULL REDESIGN (Zone 5)
Budget: $25,000 - $200,000+
Risk: High
ELIF no project file AND no documentation:
-> DOCUMENTATION FIRST
See documentation-reconstruction.md
Then reassess.
11. Legacy B&R Specific Considerations
B&R 2003 / B&R 2005 Systems
B&R’s predecessor system (2003/2005 series) uses different hardware, different programming (AS V2.x or earlier), and different IO. Migration from 2003/2005 to X20 is effectively a platform migration:
| Aspect | B&R 2003/2005 | B&R X20 |
|---|---|---|
| Programming | Automation Studio 2.x | Automation Studio 4.x |
| Runtime | AR 2.x | AR 4.x |
| IO bus | CAN bus | POWERLINK / X2X |
| IO modules | 2003/2005 series | X20 series |
| CPU modules | 2003 CPU (e.g., CP570) | X20CP series |
| Language support | AWL (B&R-specific), ST, LD | IEC 61131-3 standard |
| Project format | .apj (AS 2.x) | .apj (AS 4.x, different internal format) |
Migration path: AS 2.x projects can sometimes be imported into AS 4.x, but this is not guaranteed. AWL (Anweisungsliste) is B&R’s proprietary instruction list language that has no direct equivalent in IEC 61131-3 IL. AWL programs must be manually rewritten in ST.
B&R Power Panel Migration
B&R Power Panel devices combine HMI and PLC functionality. Migration options:
| From | To | Effort |
|---|---|---|
| Power Panel 400 | Power Panel 500 | Low-Medium (same AR, new hardware) |
| Power Panel 400 | X20 CPU + separate HMI | Medium |
| Power Panel 400 | Industrial PC + Control Runtime | Medium-High |
B&R APROL (DCS) Migration
APROL is B&R’s process automation / DCS platform. Migration from older APROL versions:
- In-place upgrade: APROL V3.x to APROL V4.x (supported by B&R migration tools)
- APROL to X20-based control (if process control complexity justifies DCS)
- APROL to alternative DCS (Siemens PCS 7, ABB 800xA, Emerson DeltaV)
APROL migration is beyond the scope of this guide due to its process-industry-specific complexity.
Safety System Recertification Requirements
When any safety-related hardware or software changes, recertification may be required:
| Change Type | Recertification Required? | Notes |
|---|---|---|
| Same SafeLOGIC module, software unchanged | No | Hardware repair only |
| Same SafeLOGIC module, software update | Possibly | If safety parameters changed |
| New SafeLOGIC module, same program | Yes | Module validation required |
| Different SafeLOGIC module generation | Yes | Full safety validation |
| SafeLOGIC to different platform | Yes | Full SIL assessment + validation |
Recertification process:
- Update Safety Requirements Specification (SRS)
- Update Safety Validation Report
- Perform functional safety testing on new hardware
- Document all changes and their safety impact
- Have independent assessor review (for SIL 2+)
- File updated documentation
Estimated recertification effort: 1-4 weeks for in-family, 2-8 weeks for cross-platform.
Adaptive Manufacturing and the ACOPOS D1 (2026 Context)
B&R’s 2026 Innovation Days theme is adaptive automation — moving from rigid production lines to flexible, modular manufacturing systems. As part of this strategy, B&R launched the ACOPOS D1 servo drive in Pune, India (March 2026), targeting compact cabinet footprint, scalable multi-axis motion, and built-in edge intelligence for predictive maintenance.
Implications for CP1584 machine remanufacturing:
- If you are extending the life of a CP1584-based machine by 7+ years, the D1 (and likely AR 6.x controllers) represents the forward-looking migration target
- The D1’s edge intelligence for predictive uptime aligns with modern IIoT strategies (see iiot-retrofit.md)
- Adaptive manufacturing principles (modular machine design, software-configurable production) may influence how you architect control systems during remanufacturing
- B&R’s India-first launch of the D1 signals growing investment in the India/Asia-Pacific market, which may improve spare parts availability and local support for B&R systems in those regions
Note: As of mid-2026, the ACOPOS D1 has not been fully specified publicly. When technical specifications become available, evaluate it as a potential replacement for aging ACOPOS 8V1 drives. See acopos-drives.md for the D1 section and the complete ACOPOS family reference.
Automation Studio 4 to Studio 6 Migration (AS4 → AS6)
As of 2024-2026, B&R has released Automation Studio 6 (AS6) as the successor to the long-standing AS 4.x line. This migration is increasingly relevant for engineers maintaining CP1584 machines because:
- EU Cyber Resilience Act (CRA) compliance — CRA requirements apply from December 2027 and mandate security-by-design for connected products. Machines placed on the EU market after this date must comply. AS6 incorporates IEC 62443-4-1 compliant security features that AS4 cannot provide.
- AS4 end-of-life timeline — While B&R has not announced a hard EOL for AS4, the CRA effectively forces migration for any machine that must remain in production or be sold in the EU after 2027.
- New CPU hardware requires AS6 — The X20CP1684 (successor to CP1584) requires Automation Studio 4.7 minimum or preferably AS 6.0+.
Key Differences Between AS4 and AS6
| Aspect | AS 4.12 | AS 6.x |
|---|---|---|
| Project format | .apj (AS4 binary) | .apj (AS6 format, different structure) |
| Runtime | AR 4.x (B04.xx) | AR 5.x/6.x (G05.xx / I06.xx) |
| IEC 61131-3 editor | Built-in (proprietary) | AS Code (VS Code-based, beta in 2025) |
| OPC UA stack | OPC UA 1.01/1.03 | OPC UA 1.04+, enhanced security profiles |
| mapp components | mapp 4.x | mapp 6.x (restructured hierarchy) |
| Security model | Basic user/password | IEC 62443-4-1 role-based access, certificate management |
| Compiler | AS4 native compiler | AS6 compiler with improved optimization and diagnostics |
| License model | Per-target licenses | Updated licensing with mapp technology licenses |
Community Migration Tools (Free)
The B&R Community maintains an open-source tool specifically for AS4→AS6 migration analysis:
as6-migration-tools — https://github.com/br-automation-community/as6-migration-tools
This tool scans AS 4.12 project files and generates a migration report identifying:
- Deprecated libraries and function blocks
- Unsupported hardware references
- OPC UA structural changes needed
- mappMotion API changes
- AsMath and AsString function replacements
- Missing mapp technology licenses
- Common migration pitfalls
Installation and usage:
## Option 1: Download Windows EXE from GitHub Releases
## https://github.com/br-automation-community/as6-migration-tools/releases/latest
## Unzip and run as6-migration-tools.exe
## Option 2: From source
git clone https://github.com/br-automation-community/as6-migration-tools.git
cd as6-migration-tools
pip install -r requirements.txt
python gui_launcher.py
## Or for CLI:
python as4_to_as6_analyzer.py "C:\Projects\MyAS4Project"
Helper scripts included:
| Script | Purpose |
|---|---|
helpers/asmath_to_asbrmath.py | Replaces deprecated AsMath functions with AsBrMath equivalents |
helpers/asstring_to_asbrstr.py | Replaces deprecated AsString functions with AsBrStr equivalents |
helpers/asopcua_update.py | Updates OPC UA client code for AR 6 compatibility |
helpers/mappmotion_update.py | Updates mappMotion code for mappMotion 6 API |
helpers/license_checker.py | Scans for required mapp technology licenses |
The tool is non-destructive by default — it analyzes and reports before making changes. Run the analyzer first, review the report, then apply helper scripts selectively.
Important limitations:
- The tool does NOT perform a fully automatic migration. It provides analysis and recommendations.
- Helper scripts make best-effort changes based on known patterns but do not cover all edge cases.
- Manual review and validation is always required after running any helper script.
- Requires Python 3.12 (tested).
Official B&R Migration Resources
B&R provides a free online course for the migration:
- ENG:
https://share.articulate.com/5PakLoeB_I2sjJxoopM5t(Migration to AS 6 – Step-by-Step Checklist) - GER:
https://share.articulate.com/4ma0vcvpVY_WxgVuoMDCu(Migration auf Automation Studio 6) - Requires one-time registration on B&R’s learning platform.
B&R also offers paid migration services:
- Dedicated engineering service — B&R engineers perform the full migration
- Migration consulting — B&R analyzes your project and provides an optimization strategy
AS4→AS6 Migration Procedure for CP1584 Machines
Prerequisites:
- Recovered AS4 project file (.apj + all source files) — see project-reconstruction.md
- Automation Studio 6 installed on a PC (available from B&R downloads with active service contract, or via B&R Value Provider)
- Access to the CP1584 target hardware for testing
Step-by-step migration:
-
Analyze the AS4 project with as6-migration-tools:
python as4_to_as6_analyzer.py "C:\Projects\Recovered_AS4_Project"Review the generated report. Address all CRITICAL and HIGH severity items.
-
Open the project in AS6. AS6 can open AS 4.12 projects with an automatic migration wizard. The wizard will:
- Convert project file format
- Update library references to newer versions
- Flag deprecated function blocks and renamed libraries
- Identify hardware that is no longer supported
-
Resolve deprecated libraries. Common replacements:
AS4 Library AS6 Equivalent Notes AsMathAsBrMathRun helper script asmath_to_asbrmath.pyAsStringAsBrStrRun helper script asstring_to_asbrstr.pymappMotion 4.xmappMotion 6Run helper script mappmotion_update.pyLegacy OPC UA components mappService OPC UA Restructured OPC UA configuration -
Update OPC UA configuration. AS6 uses a restructured OPC UA information model. Run
helpers/asopcua_update.pyand manually review the changes. Test with an OPC UA client (UaExpert, Prosys). -
Update hardware configuration. If migrating to a newer CPU (e.g., X20CP1684), update the hardware tree in AS6. See spare-parts.md Section 3.2 for CPU upgrade paths and firmware-version-mgmt.md for firmware compatibility.
-
Compile and resolve errors. The AS6 compiler provides improved diagnostics compared to AS4. Address all compilation errors and warnings.
-
Test on a bench. Before deploying to the production machine:
- Build the new target hardware (or use the existing CP1584 if hardware is unchanged)
- Download the AS6-compiled program
- Run IO point-by-point verification (see documentation-reconstruction.md Section 6.3)
- Verify all machine sequences and safety systems
-
Deploy during a planned shutdown. The production deployment follows the same procedure as any firmware upgrade. See firmware-version-mgmt.md for the production deployment checklist.
Estimated migration effort:
| Project Size | AS4 Project Lines | Estimated Effort | Notes |
|---|---|---|---|
| Small | < 5,000 | 2-5 days | Simple IO, no motion, no mapp |
| Medium | 5,000-20,000 | 1-2 weeks | Some mapp, basic motion |
| Large | 20,000-100,000 | 2-6 weeks | Complex mapp, motion, safety |
| Very Large | 100,000+ | 4-12 weeks | Full mapp suite, safety, multi-axis motion |
Critical gotchas:
- mapp components are restructured in AS6. mappService, mappMotion, mappView, and other mapp components have been reorganized with new hierarchies. This is the single largest manual effort in most migrations.
- Safety programs require special handling. SafeLOGIC programs must be migrated using SafeDESIGNER (AS6 version). Do not attempt to manually convert safety logic — use the official migration path.
- AR 6.x firmware requires the matching AS6 compiler. You cannot compile AR 6.x programs with AS 4.x, and vice versa.
- CF card format changes. AR 6.x may use a different CF card partition layout than AR 4.x. The CF card must be regenerated using AS6’s
Generate CF/SD Cardfunction. - OPC UA certificates must be regenerated. AS6 uses a different OPC UA certificate management system. Existing certificates from AS4 will not work.
- ANSL/PVI protocol changes. External PVI connections may need updated client libraries for AR 6.x compatibility. See pvi-api.md for PVI version requirements.
X20CP1684 — The CP1584 Successor
B&R has released the X20CP1684 as the direct successor to the CP1584. This is relevant when remanufacturing a CP1584 machine and deciding whether to upgrade the CPU.
| Parameter | X20CP1584 | X20CP1684 |
|---|---|---|
| Processor | Intel Atom E640T @ 600 MHz | Intel Atom (400 MHz, newer architecture) |
| RAM | 256 MB DDR2 | 512 MB LPDDR4 |
| Flash | CompactFlash (removable) | 1 GB internal flash |
| Ethernet | 10/100/1000 Mbps (1 port) | Gigabit Ethernet |
| Interface slots | 1 | 1 |
| Minimum AS | AS 3.0.90.20 | AS 4.7 (recommended: AS 6.0+) |
| Minimum AR | AR 4.x | AR 5.x+ |
| Fanless | Yes | Yes |
| CF card required | Yes | No (internal flash) |
Key differences for migration:
- The CP1684 uses internal flash instead of CompactFlash — no more CF card failures, but also no removable media for backup. Use FTP or Automation Studio transfer instead.
- The LPDDR4 memory is twice the capacity and significantly faster than DDR2.
- Automation Studio 6 is the recommended development environment for CP1684.
- X20 IO modules, bus modules, and interface modules are fully compatible between CP1584 and CP1684 (same X2X bus, same POWERLINK).
Migration path CP1584 → CP1684:
- Recover the AS4 project (see project-reconstruction.md)
- Migrate project to AS6 (see above procedure)
- Update hardware tree: replace X20CP1584 with X20CP1684
- Compile, test on bench, deploy during planned shutdown
- No IO module changes needed — all X20 modules are compatible
See cp1584-hardware-ref.md for the complete CP1584 hardware reference and spare-parts.md for ordering information.
12. Cross-References
| Document | Purpose |
|---|---|
| documentation-reconstruction.md | Procedures for documenting undocumented B&R systems |
| project-reconstruction.md | Reconstructing lost Automation Studio projects from PLC and CF card |
| program-reverse-engineering.md | Reverse-engineering B&R PLC programs from compiled binaries |
| spare-parts.md | Sourcing B&R spare parts from brokers, surplus, and used market |
| firmware-version-mgmt.md | Managing firmware versions for B&R CPUs and IO modules |
| cp1584-hardware-ref.md | Detailed hardware reference for X20CP1584 |
| safe-io-diagnostics.md | Diagnosing SafeLOGIC and safe IO module issues |
| config-file-formats.md | B&R configuration file formats and structures |
| cf-card-boot.md | CF card boot process, recovery, and cloning procedures |
13. Key Findings
-
B&R X20 is not obsolete. The X20 platform is actively sold and supported by B&R. In-family migration is always the lowest-risk path when the project file is available.
-
Recovery of the Automation Studio project file is the single most important prerequisite. Without it, migration effort multiplies 3-5x. Prioritize CF card backup and project file recovery before any other action. See project-reconstruction.md and cf-card-boot.md.
-
CP1584 is repairable for most common failure modes. CF card failure ($20-80), battery replacement ($5-15), and capacitor replacement ($10-50) address the majority of failures. Only CPU-level failures (processor, FPGA, DDR2) require replacement.
-
In-family CPU swap costs $3,000-$8,000 total. Cross-platform migration costs $25,000-$200,000+. The cost difference is almost always decisive for machines with remaining life under 7 years.
-
POWERLINK and FPGA-based X20 bus communication are not portable to other platforms. Any migration away from B&R requires complete IO replacement. This is the single largest cost driver in cross-platform migration ($5,000-$25,000 for IO alone).
-
Safety system migration is the most complex and risky aspect of any platform change. SafeLOGIC to a different safety platform requires full SIL recertification, complete logic rewrite, and 2-8 weeks of safety engineering. Budget $5,000-$25,000 for safety migration alone.
-
Pre-commissioning on a workbench reduces production downtime by 50-75%. Build the new system on a bench, test all logic and IO, and resolve software issues before the production shutdown.
-
IO mapping preservation is key for in-family swaps. By manually setting new IO addresses to match old addresses, the program requires zero modification for IO references. This reduces in-family swap downtime to 4-8 hours.
-
Secondary market CP1584 units are available ($400-$2,000) but carry risk. Match firmware versions. Test thoroughly before deploying as a spare. Budget for potential software incompatibilities.
-
Automation Studio 4.x can open AS 3.x projects with migration steps. The migration is mostly automatic but may flag deprecated function blocks and renamed libraries. Resolve all migration warnings before deploying.
-
CODESYS V3 is the most practical cross-platform target if leaving B&R is necessary, because it uses standard IEC 61131-3 and runs on hardware from multiple vendors. However, B&R-specific libraries and mapp components have no CODESYS equivalent and must be rewritten from scratch.
-
The “repair vs replace” decision is primarily a function of machine remaining life and failure type. Use the decision framework in Section 2. Repair for machines with less than 3 years of remaining life. Upgrade in-family for 3-7 years. Consider cross-platform migration only for 7+ years remaining life.
-
AS4→AS6 migration is necessary for CRA compliance. The EU Cyber Resilience Act requires connected products placed on the EU market after December 2027 to meet IEC 62443-4-1 security requirements. AS6 is B&R’s CRA-compliant platform. The community-maintained
as6-migration-tools(github.com/br-automation-community/as6-migration-tools) provides free automated analysis and helper scripts for the migration. -
X20CP1684 replaces CP1584 as the current-generation 1-slot X20 CPU. The CP1684 uses internal flash (no CF card), 512 MB LPDDR4 RAM, and requires AS 4.7+ (recommended AS 6.0+). All X20 IO modules and interface modules are fully compatible, making in-family CPU upgrade straightforward when the AS4 project is available.
-
New X20 generation (Apollo Lake I) with OPC UA over TSN is the future-proof path. B&R’s newest X20 controllers add OPC UA over TSN support and field-level master capability. Combined with AR 6.5’s hard real-time multicore task scheduling (assign task classes to specific CPU cores), these controllers deliver deterministic control and modern networking in the same compact form factor. The X20CP0484-1 (512 MB RAM, 2 GB flash) is the budget AR 6.x entry point. The X20CP3687X delivers PC-class performance in a compact X20 package.
-
AS 6.5 (December 2025) is the current latest release. Key features: ST-OOP (inheritance, polymorphism, abstract classes), ManagedCertificateStore extended to ANSL/FTP/HTTP/SMTP, FTP RBAC, SMB 1.0 permanently disabled, SNI support in AsHttp, certificate signing requests (CSR) via ArCert, self-signed certificate validation warnings, and TFTP disabled by default. AR 6.5 adds multicore hard real-time, FTP RBAC, and hypervisor repair boot. See firmware-version-mgmt.md §3.2 for the complete release history.
14. Sources
- B&R Industrial Automation. “X20 System Overview and Catalog.” br-automation.com. Active product line documentation.
- B&R Industrial Automation. “Automation Studio 4 Migration Guide.” Technical documentation for upgrading from AS 3.x to AS 4.x.
- B&R Industrial Automation. “X20CP1584 Technical Data Sheet.” Hardware reference.
- B&R Industrial Automation. “POWERLINK - Ethernet POWERLINK Standardisation Group (EPSG).” openPOWERLINK.org.
- B&R Industrial Automation. “SafeLOGIC Safety System Technical Manual.” SIL 2/3 safety controller documentation.
- CODESYS Group. “CODESYS V3.5 Programming Guide.” codesys.com.
- CODESYS Group. “CODESYS EtherCAT and POWERLINK Support Documentation.”
- Siemens AG. “SIMATIC S7-1500 System Manual.” Siemens documentation portal.
- Siemens AG. “TIA Portal Migration Guide.”
- Beckhoff Automation. “TwinCAT 3 System Documentation.” beckhoff.com.
- EPSG (Ethernet POWERLINK Standardisation Group). “POWERLINK Communication Profile Specification.” ethernet-powerlink.org.
- IEC 61131-3:2013. “Programmable Controllers - Part 3: Programming Languages.” International Electrotechnical Commission.
- IEC 61508. “Functional Safety of Electrical/Electronic/Programmable Electronic Safety-related Systems.” International Electrotechnical Commission.
- ISA-TR84.00.04. “Guidelines for the Implementation of ANSI/ISA-84.00.01-2004.”
- Pilz GmbH. “Safety Migration Planning Guidelines.” Industry technical paper.
- Various industrial automation broker and surplus listings (PLC Center, Radwell, surplus.net). Pricing data for spare parts and used equipment as of 2024-2025.
- Practical field experience with B&R X20CP1584 systems in manufacturing environments.
- Industry standard lifecycle management practices for industrial control systems (ISA-95, IEC 62443 for cybersecurity considerations during migration).
- B&R Community Forum. “AS4->AS6: Migration Made Simple: Tools, Community & Free Courses.”
https://community.br-automation.com/t/as4-as6-migration-made-simple-tools-community-free-courses/8553 - br-automation-community/as6-migration-tools. GitHub repository.
https://github.com/br-automation-community/as6-migration-tools - B&R Industrial Automation. “X20CP1684 Product Page.” br-automation.com.
https://www.br-automation.com/en-us/products/plc-systems/x20-system/x20-plc/x20cp1684/ - B&R Industrial Automation. “Automation Studio 6 Features.” B&R Community.
https://community.br-automation.com/t/b-r-automation-studio-6-features/2979 - B&R Community Forum. “Project Migration from Automation Studio 4.12 to 6.1.”
https://community.br-automation.com/t/project-migration-from-automation-studio-4-12-to-6-1/7309 - EU Cyber Resilience Act.
https://digital-strategy.ec.europa.eu/en/policies/cyber-resilience-act - B&R Industrial Automation. “TÜV Rheinland confirms B&R’s CRA Guide for POWERLINK.”
https://www.br-automation.com/en/about-us/press-room/tuev-rheinland-confirms-brs-cra-guide-for-powerlink-31-03-2026/ - B&R Community Forum. “Why on earth is B&R discontinuing software that works?”
https://community.br-automation.com/t/why-on-earth-is-b-r-discontinuing-software-that-works/11332
B&R X20CP1584 Complete Hardware Reference
Overview
The B&R X20CP1584 is a mid-range PLC CPU module in the X20 system family, based on the Intel Atom E640T processor. It is a headless controller (no integrated display) designed for industrial automation applications requiring POWERLINK real-time networking, Gigabit Ethernet, and modular I/O expansion via the X2X Link bus. This document consolidates all hardware specifications, physical details, and practical information needed for physical inspection, spare parts procurement, and hardware configuration of a CP1584 in the field.
Key identifiers:
- Order number:
X20CP1584 - Coated variant:
X20cCP1584(identical electronics, conformal coating for harsh environments) - B&R ID code:
0xC370
CPU Specifications
| Parameter | Value |
|---|---|
| Processor | Intel Atom E640T |
| Clock frequency | 600 MHz (0.6 GHz) |
| L1 instruction cache | 32 kB |
| L1 data cache | 24 kB |
| L2 cache | 512 kB |
| Floating point unit | Yes (hardware FPU) |
| Integrated I/O processor | Yes (processes I/O data points in background) |
| Typical instruction cycle time | 0.0075 us |
| Shortest task class cycle time | 400 us |
| Cooling | Fanless |
Memory Architecture
| Memory Type | Size | Description |
|---|---|---|
| DDR2 SDRAM (main RAM) | 256 MB | Runtime memory for AR OS, tasks, libraries |
| SRAM (user RAM) | 1 MB total | Battery-backed; split between retentive vars and user data |
| Remanent variables max | 256 kB | Configurable in Automation Studio; deducted from SRAM |
| CompactFlash slot | 1 | Application memory (ordered separately) |
| Real-time clock | Nonvolatile | Resolution 1 s, -10 to +10 ppm accuracy at 25 C |
The SRAM is backed by a lithium battery (Renata CR2477N, 3V/950mAh). Actual usable user RAM = 1 MB minus configured remanent variable space. See retentive-data.md for battery management and data retention procedures.
Interfaces
IF1 - RS232 (Serial)
| Parameter | Value |
|---|---|
| Signal | RS232 (non-galvanically isolated) |
| Connector | 12-pin terminal block X20TB12 |
| Max distance | 900 m |
| Max transfer rate | 115.2 kbit/s |
| Default baud rate | 57600 bps (factory default) |
The RS232 interface shares the X20TB12 terminal block with the CPU/I/O power supply. The RS232 pins are on the bottom row (pins 7-12 area):
| Terminal | Function |
|---|---|
| I_r | I/O power supply input (shared) |
| S | I/O power supply input (shared) |
| TX | RS232 transmit data (output from PLC) |
| RX | RS232 receive data (input to PLC) |
| GND | RS232 signal ground |
Wiring for serial console (DB9 null-modem cable to PC):
- PLC TX → PC RX (pin 2 on DB9)
- PLC RX → PC TX (pin 3 on DB9)
- PLC GND → PC GND (pin 5 on DB9)
Note on “900 m max distance”: B&R rates the RS232 interface at 900 m. This exceeds the TIA-232 standard maximum of ~15 m at 115.2 kbit/s. B&R’s rating likely assumes RS422/RS485 line driver/receiver equipment is used at the far end. For standard RS232 point-to-point wiring, observe the standard limits. See grounding-emc.md for serial cable EMC considerations.
Important: The factory default baud rate is 57600 bps. While rates up to 115.2 kbit/s are supported, the default must be assumed when connecting to an unknown PLC. See bootloader-recovery.md for serial console usage.
IF2 - Ethernet (Gigabit)
| Parameter | Value |
|---|---|
| Physical layer | 10BASE-T / 100BASE-TX / 1000BASE-T |
| Connector | 1x RJ45 shielded |
| Max segment length | 100 m between 2 stations |
| Transfer rate | 10/100/1000 Mbit/s |
| Auto-negotiation | Yes |
| Auto-MDI/MDIX | Yes |
| Half-duplex | Yes |
| Full-duplex | Yes |
This is the primary interface for:
- Automation Studio online connection (ANSL/PVI)
- OPC-UA server
- FTP server
- Web server (SDM)
- SNMP
- General TCP/IP communication
The INA2000 station number is set using the two hex switches on the front panel.
IF3 - POWERLINK (Real-Time Ethernet)
| Parameter | Value |
|---|---|
| Physical layer | 100BASE-TX |
| Connector | 1x RJ45 shielded |
| Max segment length | 100 m between 2 stations |
| Transfer rate | 100 Mbit/s |
| Protocol | ETHERNET Powerlink V1/V2 |
| Role | Managing Node (MN) or Controlled Node (CN) |
| MN node number (V1) | Fixed 0x00 |
| MN node number (V2) | Fixed 0xF0 |
| CN node number range (V1) | 0x01 - 0xFD |
| CN node number range (V2) | 0x01 - 0xEF |
| Half-duplex | Yes (POWERLINK mode) |
| Full-duplex | No (POWERLINK mode) / Yes (Ethernet mode) |
Important: POWERLINK mode only operates in half-duplex. The interface cannot be used for POWERLINK and standard Ethernet simultaneously. When POWERLINK is active, IF2 (Ethernet) must not use an IP address in the POWERLINK address range (192.168.100.x). See powerlink-internals.md for protocol details.
IF4 and IF5 - USB
| Parameter | Value |
|---|---|
| Type | USB 1.1 / 2.0 |
| Connector | Type A |
| Max output current | 0.5 A per port |
| Galvanic isolation | No |
Critical limitations:
- USB interfaces CANNOT be used for online communication (no ANSL/PVI over USB)
- Only ground-isolated USB devices are permitted
- B&R only guarantees functionality of B&R-branded USB devices
IF6 - X2X Link (I/O Bus)
| Parameter | Value |
|---|---|
| Fieldbus | X2X Link (master) |
| Galvanic isolation | Yes (isolated from Ethernet, POWERLINK, and other interfaces) |
The X2X Link connects to X20 bus couplers and base modules for I/O expansion. See x2x-protocol.md for protocol details.
Electrical Isolation
All three network interfaces are galvanically isolated from each other and from the PLC:
- Ethernet (IF2) - isolated
- POWERLINK (IF3) - isolated
- X2X Link (IF6) - isolated
RS232 (IF1) and USB (IF4/IF5) are NOT galvanically isolated.
Power Supply
CPU and X2X Link Power Supply
| Parameter | Value |
|---|---|
| Input voltage | 24 VDC -15% / +20% (20.4 - 28.8 VDC) |
| Input current | Max. 1.5 A |
| Fuse | Integrated, non-replaceable |
| Reverse polarity protection | Yes |
| Power consumption (no interface/USB) | 8.6 W |
X2X Link Power Output
| Parameter | Value |
|---|---|
| Nominal output power | 7 W (derated to 5 W above 55 C) |
| Parallel connection | Yes (75% of nominal power per supply) |
| Redundant operation | Yes |
I/O Power Supply
| Parameter | Value |
|---|---|
| Input voltage | 24 VDC -15% / +20% |
| Required line fuse | Max. 10 A, slow-blow |
| Nominal output voltage | 24 VDC |
| Permissible contact load | 10 A |
Terminal Block Pinout (X20TB12)
The 12-pin terminal block provides power connections and RS232:
| Pin | Function |
|---|---|
| 1 | RS232 RXD |
| 2 | RS232 TXD |
| 3 | RS232 GND |
| 4-6 | Reserved |
| 7 | +24V I/O supply |
| 8 | GND I/O supply |
| 9 | +24V I/O supply (output) |
| 10 | GND I/O supply |
| 11 | +24V CPU/X2X Link supply |
| 12 | GND CPU/X2X Link supply |
Wiring specifications:
- Wire type: copper only (no aluminum)
- Solid wire: 0.08 - 2.50 mm2 (28-14 AWG)
- Stranded wire: 0.25 - 2.50 mm2 (24-14 AWG)
- Strip length: 7-9 mm
Physical Specifications
| Parameter | Value |
|---|---|
| Width | 150 mm |
| Height | 99 mm |
| Depth | 85 mm |
| Weight | 750 g |
| IP rating | IP20 |
| Mounting | 35 mm DIN rail (top-hat rail) |
| Mounting orientation | Horizontal or vertical |
Operating Conditions
| Condition | Range |
|---|---|
| Operating temperature (horizontal) | -25 to 60 C |
| Operating temperature (vertical) | -25 to 50 C |
| Storage/transport temperature | -40 to 85 C |
| Relative humidity | 5-95%, non-condensing |
| Max altitude (no derating) | 2000 m |
| Above 2000 m | Derate 0.5 C per 100 m |
Overtemperature Shutdown
| Condition | Temperature | Result |
|---|---|---|
| Processor overtemperature | 110 C | PLC enters reset state |
| Board overtemperature | 95 C | PLC enters reset state |
Logbook errors:
- Error 9204: PLC restart triggered by CPU temperature monitoring
- Error 9210: Warning: Halt/Service after watchdog or manual reset
Certifications
- CE, UKCA
- ATEX Zone 2 (II 3G Ex nA nC IIA T5 Gc IP20)
- UL/cULus E115267 (Industrial control equipment)
- HazLoc cCSAus 244665 (Class I, Div 2, Groups ABCD, T5)
- DNV (maritime: Temperature B, Humidity B, Vibration 4g, EMC B)
- ABS, BV, CCS, KR, EAC
Front Panel Layout
[1] [2] [3] [4]
| | | |
| Top-hat rail latch
| Select application memory (CF card select switch)
| Slot for CompactFlash
| LED status indicators (R/E, RDY/F, S/E, PLK, ETH, CF, DC)
|
[5] [6] [7]
| | |
| IF6 - X2X Link
| IF1 - RS232 (via terminal block)
| Slot for interface module (1 slot on CP1584)
|
[8] [9] [10] [11] [12]
| | | | |
| Terminal block (power + RS232)
| IF5 - USB
| IF4 - USB
| Reset button
| Battery compartment
|
[13] [14]
| |
| IF3 - POWERLINK (RJ45)
| IF2 - Ethernet (RJ45)
|
[15]
|
Ethernet station address (hex switches)
LED Status Indicators
CPU Status LEDs
| LED | Color | State | Meaning |
|---|---|---|---|
| R/E | Green | On | Application running |
| R/E | Green | Blinking | System startup (initializing app, bus systems, I/O) |
| R/E | Green | Double flash | System startup during firmware update |
| R/E | Red | On | Mode SERVICE or BOOT |
| R/E | Red | Blinking | License violation (when RDY/F also blinks yellow) |
| R/E | Red | Double flash | Installation error (AR 4.93+: USB install aborted) |
| RDY/F | Yellow | On | Mode SERVICE or BOOT |
| RDY/F | Yellow | Blinking | License violation (when R/E also blinks red) |
| S/E | Green/Red | Dual | POWERLINK interface status (see below) |
| PLK | Green | On | POWERLINK link established |
| PLK | Green | Blinking | POWERLINK link active with Ethernet traffic |
| ETH | Green | On | Ethernet link established |
| ETH | Green | Blinking | Ethernet link active with traffic |
| CF | Green | On | CompactFlash inserted and detected |
| CF | Yellow | On | CompactFlash read/write access |
| DC | Green | On | CPU power supply OK |
| DC | Red | On | Backup battery empty |
S/E LED - POWERLINK Interface States
Ethernet mode:
| Green | Red | Meaning |
|---|---|---|
| On | Off | Interface operated as Ethernet |
POWERLINK V1 mode:
| Green | Red | Meaning |
|---|---|---|
| On | Off | Node running, no errors |
| Off | On | System error (check PLC logbook) |
| Blinking alt. | - | MN has failed (CN only) |
| Off | Blinking | System stop with error code |
| Off | Off | Not active / startup / misconfigured / defective |
POWERLINK V2 mode - Blink patterns:
| Pattern | Green | Red | State |
|---|---|---|---|
| Flicker (~10 Hz) | Off | - | BASIC_ETHERNET (timeout expired before EPL detected) |
| Single flash (~1 Hz) | On | Off | PRE_OPERATIONAL_1 (CN: waiting for SoC from MN) |
| Single flash (~1 Hz) | On | On | PRE_OPERATIONAL_1 with MN failure (CN only) |
| Double flash (~1 Hz) | On | Off | PRE_OPERATIONAL_2 (CN: configured, waiting for READY_TO_OPERATE command) |
| Double flash (~1 Hz) | On | On | PRE_OPERATIONAL_2 with MN failure (CN only) |
| Triple flash (~1 Hz) | On | Off | READY_TO_OPERATE (CN: cyclic + async comm, PDO data not yet evaluated) |
| Triple flash (~1 Hz) | On | On | READY_TO_OPERATE with MN failure (CN only) |
| Blinking (~2.5 Hz) | On | Off | OPERATIONAL (full cyclic data exchange, PDO mapping active) |
| Off | On | - | Error mode (failed Ethernet frames, collisions, etc.) |
| Off | - | Off | NOT_ACTIVE (off, startup, misconfigured, or defective) |
POWERLINK V2 state transition for CN (controlled node):
BASIC_ETHERNET ──(EPL detected)──→ PRE_OPERATIONAL_1 ──(SoC received)──→
PRE_OPERATIONAL_2 ──(command)──→ READY_TO_OPERATE ──(command)──→
OPERATIONAL
Key diagnostic note: If the S/E LED is off with no green or red, and the R/E LED shows green (application running), the POWERLINK interface may be configured as Ethernet-only (not POWERLINK) in Automation Studio. Check the interface module configuration or the CPU’s IF3 settings.
Power Supply LEDs
| LED | Color | State | Meaning |
|---|---|---|---|
| r (green) | Green | On | Mode RUN |
| r (green) | Green | Blinking | Mode PREOPERATIONAL |
| r (green) | Green | Single flash | Mode RESET |
| e (red) | Red | On | Module not supplied or everything OK |
| e (red) | Red | Double flash | X2X Link overloaded / I/O power too low |
| e (red) | Red | Solid + green flash | Invalid firmware |
| S (yellow) | Yellow | On | RS232 data transfer active |
| l (red) | Red | On | X2X Link power supply overloaded |
System Stop Error Codes
When S/E blinks red, the error code is a sequence of 4 phases (150 ms = short, 600 ms = long), repeated every 2 seconds:
| Code (phases) | Error |
|---|---|
| Short Short Short Long | RAM error - device defective, replace |
| Short Short Long Long | Hardware error - device or component defective, replace |
Operating Mode Switch
The CP1584 has a three-position operating mode switch:
| Position | Mode | Description |
|---|---|---|
| BOOT | BOOT | Starts Boot AR; runtime installable via online interface (AS). User flash erased only when download begins. |
| RUN | RUN | Normal runtime operation |
| DIAG | DIAGNOSE | CPU boots in diagnostic mode. Program sections in User RAM and Flash are NOT initialized. Always warm restart after DIAG mode. |
Important: Any switch position other than the three listed is not permitted.
Reset Button
The reset button is located below the USB interfaces on the bottom of the housing. It can be pressed with a small pointed object (paper clip, etc.).
Pressing the reset button causes a hardware reset:
- All application programs are stopped
- All outputs are set to zero
- The PLC starts up in SERVICE mode by default (configurable in AS)
Ethernet Station Address (Hex Switches)
Two hex rotary switches set the INA2000 station number for Ethernet (IF2) and optionally the POWERLINK node number (IF3).
| Switch Range | Usage |
|---|---|
| 0x00 | Reserved (not permitted) |
| 0x01 - 0xEF | POWERLINK controlled node (CN) |
| 0xF0 | POWERLINK managing node (MN) |
| 0xF1 - 0xFF | Reserved (not permitted) |
When used for Ethernet (IF2), the station number maps to the default IP address formula: 192.168.1.<station_number> in some configurations. For POWERLINK, the switch directly sets the node number.
CompactFlash Card
The CF card slot accepts industrial-grade CompactFlash cards. CF cards are ordered separately and are not included with the CPU.
Supported CF Cards (B&R part numbers)
| Order Number | Capacity |
|---|---|
| 0CFCRD.0512E.02 | 512 MB |
| 0CFCRD.1024E.02 | 1 GB |
| 0CFCRD.2048E.02 | 2 GB |
| 0CFCRD.4096E.02 | 4 GB |
| 0CFCRD.8192E.02 | 8 GB |
| 0CFCRD.016GE.02 | 16 GB |
All cards are extended temperature rated. Only B&R-approved CF cards should be used; consumer CF cards may fail in industrial conditions.
See cf-card-boot.md for CF card contents, boot sequence, and imaging procedures.
Battery
| Parameter | Value |
|---|---|
| Type | Lithium (Renata CR2477N, button cell) |
| Voltage | 3 V |
| Capacity | 950 mAh |
| B&R order number (single) | 4A0006.00-000 |
| B&R order number (4-pack) | 0AC201.91 |
| Storage temperature | -40 to 85 C |
| Max storage time | 3 years at 30 C |
| Recommended replacement interval | Every 4 years |
| Min. runtime at 23 C | 2 years |
The battery buffers:
- Remanent variables
- User RAM
- System RAM
- Real-time clock
Battery replacement:
- Discharge ESD at top-hat rail or ground (do not touch power supply)
- Slide battery cover down and away
- Push empty battery out of holder
- Insert new battery “+” side up on right part of holder
- Press battery into holder (use plastic tweezers, never metal)
- Replace cover
- Must complete within 1 minute if PLC is voltage-free
Warning: Only Renata CR2477N batteries are permitted. Other batteries may present fire or explosion hazard. See retentive-data.md for full procedures.
Interface Module Slot
The X20CP1584 has 1 slot for modular X20 interface modules. This allows adding:
- Additional fieldbus interfaces (Modbus TCP/RTU, PROFINET, EtherCAT, CANopen)
- Serial interfaces (RS485, additional RS232)
- Other communication modules
Compatible Interface Modules (selected)
| Order Number | Description | Min HW Rev | Min Upgrade Version |
|---|---|---|---|
| X20IF1020 | Ethernet interface | H0 | 1.1.5.1 |
| X20IF1030 | Ethernet switch | I0 | 1.1.5.1 |
| X20IF1041-1 | 2x RS485 | - | - |
| X20IF1043-1 | 2x RS485 | - | - |
| X20IF1051-1 | RS485/RS422 | - | - |
| X20IF1053-1 | RS485/RS422 | - | - |
| X20IF1061 | CAN bus | E0 | - |
| X20IF1063 | CAN bus (X2X + CAN hybrid) | - | 1.1.5.0 |
| X20IF1072 | PROFIBUS DP | - | 1.0.5.1 |
| X20IF1082 | Modbus TCP/RTU | - | 1.2.2.0 |
| X20IF1086-2 | Modbus TCP/RTU | - | 1.1.1.0 |
| X20IF1091 | EtherCAT | - | 1.0.5.1 |
| X20IF2772 | CANopen (CiA 301) | - | 1.0.6.1 |
| X20IF2792 | DeviceNet | - | 1.0.5.1 |
| X20IF10E1-1 | PROFINET RT | - | - |
| X20IF10E3-1 | PROFINET RT | - | - |
| X20IF10G3-1 | CC-Link IE | - | - |
Important: Some interface modules require a hardware upgrade when migrating from X20CPx48x to X20CPx58x CPUs. Check the minimum hardware revision column above. See firmware-version-mgmt.md Section 4.4 for the complete migration compatibility table.
Interface Module Upgrade Requirements (CPx48x to CPx58x)
When upgrading from X20CP1484 to X20CP1584 (or from CPx48x to CPx58x generation), these interface modules require specific firmware or hardware revisions:
| Interface Module | Min Upgrade Version | Min HW Revision | Notes |
|---|---|---|---|
| X20IF1020 (Ethernet) | 1.1.5.1 | H0 | Required |
| X20IF1030 (Ethernet Switch) | 1.1.5.1 | I0 | Required |
| X20IF1041-1 (2x RS485) | – | – | Compatible as-is |
| X20IF1043-1 (2x RS485) | – | – | Compatible as-is |
| X20IF1051-1 (RS485/422) | – | – | Compatible as-is |
| X20IF1053-1 (RS485/422) | – | – | Compatible as-is |
| X20IF1061 (CAN) | – | E0 | HW revision required |
| X20IF1063 (CAN+X2X) | 1.1.5.0 | – | Upgrade required |
| X20IF1072 (PROFIBUS DP) | 1.0.5.1 | – | Upgrade required |
| X20IF1082 (Modbus TCP/RTU) | 1.2.2.0 | – | Upgrade required |
| X20IF1091 (EtherCAT) | 1.0.5.1 | – | Upgrade required |
| X20IF2772 (CANopen) | 1.0.6.1 | – | Upgrade required |
| X20IF2792 (DeviceNet) | 1.0.5.1 | – | Upgrade required |
Modules not listed are compatible as-is without any upgrade. Requires Automation Studio V3.0.90.20 minimum. See spare-parts.md Section 10 for the full migration checklist.
See if2772-canopen.md for CANopen details and modbus-gateway.md for Modbus configuration.
X2X Link and I/O Station Architecture
X2X Link Bus Interface (IF6)
The X2X Link is B&R’s proprietary deterministic I/O bus connecting the CPU to I/O stations. On the CP1584, the X2X interface uses a dedicated connector on the bottom of the housing.
| Parameter | Value |
|---|---|
| Protocol | X2X Link (B&R proprietary) |
| Physical layer | Differential signaling (LVDS-like) |
| Topology | Multi-drop daisy chain |
| Maximum nodes per segment | 253 |
| Cable type | B&R X2X bus cable (shielded, proprietary connector) |
| Baud rate | 12 Mbit/s (fixed) |
| Cycle time | 200 us (typical for full I/O update) |
| Galvanic isolation | Yes (isolated from all other interfaces) |
| Power over bus | Yes (7 W max for station power) |
X2X Link Connector Details
The X2X Link connectors on the X20 system use a proprietary push-pull connector with two ports per module (IN and OUT) for daisy chaining. The connectors are keyed to prevent incorrect insertion.
X2X cable pin assignments:
| Signal | Description |
|---|---|
| X2X_DATA+ | Differential data positive |
| X2X_DATA- | Differential data negative |
| X2X_CLK+ | Differential clock positive |
| X2X_CLK- | Differential clock negative |
| X2X_GND | Ground reference |
| Power +24V | Bus power input (supplied by CPU or upstream module) |
| Shield | Cable shield (connected to module ground) |
The X2X bus uses synchronous communication with a dedicated clock line. Each I/O module receives timing from the upstream module and re-transmits to the downstream module. This creates a deterministic timing chain where all modules in a station sample inputs and update outputs synchronously.
X2X Bus Timing and Configuration
| Parameter | Default | Configurable Range | Notes |
|---|---|---|---|
| Bus cycle time | 200 us | 100-1000 us | Must be a multiple of the system tick |
| Station response time | < 100 us | Determined by module count | More modules = longer response |
| Cable length per segment | Up to 100 m | Total bus length | Longer cables increase propagation delay |
| Baud rate | 12 Mbit/s | Fixed | Not user-configurable |
Practical impact on machine performance: The X2X cycle time directly affects I/O response time. A 200 us X2X cycle means a minimum of 200 us between an input changing and the CPU seeing that change. For high-speed applications, reduce the X2X cycle time, but be aware that shorter cycles increase CPU interrupt load.
See x2x-protocol.md for wire-level frame format and io-sniffing.md for sniffing techniques.
X2X Bus Couplers and Base Modules
The CPU connects to X20 I/O stations via X2X Link through bus couplers:
| Order Number | Description |
|---|---|
| X20BC0083 | X20 bus controller, CP1583 compatible |
| X20BC0087 | X20 Modbus TCP/UDP bus controller (standalone gateway) |
| X20BC0088 | X20 POWERLINK V2 bus controller |
| X20BB82 | X20 bus base, 2 expansion slots |
| X20BB88 | X20 bus base, 8 expansion slots |
| X20BM01 | Bus module, 24 VDC, single-width (standard) |
| X20BM11 | Bus module, 24 VDC, single-width (updated) |
| X20BM31 | Bus module, 24 VDC, double-width |
| X20BM12 | Bus module, 240 VAC |
Station Structure
A typical X20 I/O station consists of:
- Bus coupler/base module (X20BC or X20BB series) - connects to CPU via X2X Link
- Power supply module (X20PS series) - provides I/O power
- I/O modules (X20DI, X20DO, X20AI, X20AO, X20AT, X20PT series) - signal processing
Each station is a daisy chain on the X2X Link bus. See network-architecture.md for topology details and x2x-protocol.md for bus protocol internals.
Three-Part Module Architecture
Every X20 I/O slot is actually three separate physical components stacked together:
+-------------------+
| Terminal Block | <- X20TB06 or X20TB12 (field wiring)
| (removable) |
+-------------------+
| Electronic Module | <- X20DI9371, X20AO4622, etc.
| (hot-swappable) | The "smart" part with FPGA/MCU
+-------------------+
| Bus Module | <- X20BM01, X20BM31
| (fixed to rail) | Backplane connector
+-------------------+
Key practical points:
- Terminal blocks are universal within their pin-count class (all X20TB06 work with all 6-pin modules)
- Bus modules must match the voltage class (24V vs 240V)
- Electronic modules are independent of bus/terminal – any module plugs into any matching-width slot
- The controller identifies modules via the B&R ID code (0x hex) automatically
- Electronic modules are hot-swappable in most configurations
Maximum I/O Capacity
The X20CP1584 supports:
- Multiple X2X stations per controller
- Up to 253 X2X nodes per link segment
- Power budget: 7 W X2X Link output (derated to 5 W above 55 C)
- I/O power: separate supply via terminal block (10 A max)
- Total I/O points: limited by X2X cycle time and CPU memory, not a hard count
The practical limit depends on the number of I/O modules, their power consumption, and X2X Link timing. See io-card-hardware.md for module power specifications.
Interface Module Slot Details
The X20CP1584 has 1 slot for modular X20 interface modules. This slot is located on the right side of the CPU housing and accepts any single-width X20 interface module.
Slot mechanics:
- The interface module slides into a guide rail on the CPU housing
- A latch mechanism secures the module
- The module connects to the CPU’s internal PCI Express or local bus
- Hot-swap is NOT supported for interface modules – power cycle required
Electrical isolation: The interface module slot is galvanically isolated from the CPU core and from the X2X Link. This means faults on the fieldbus side of an interface module cannot propagate to the CPU logic.
X20CP158x Family Comparison
| Feature | X20CP1583 | X20CP1584 | X20CP1585 | X20CP1586 |
|---|---|---|---|---|
| Processor | Atom E620T (333 MHz compat) | Atom E640T (600 MHz) | Atom E680T (1 GHz) | Atom E680T (1.6 GHz) |
| RAM | 128 MB DDR2 | 256 MB DDR2 | 256 MB DDR2 | 512 MB DDR2 |
| SRAM | 1 MB | 1 MB | 1 MB | 1 MB |
| Max retentive | 64 kB | 256 kB | 256 kB | 1 MB |
| Min cycle time | 800 us | 400 us | 200 us | 100 us |
| L2 cache | - | 512 kB | 512 kB | 512 kB |
| Interface slots | 1 | 1 | 1 | 1 |
| B&R ID | 0xD45B | 0xC370 | 0xC3AE | 0xC3B0 |
| Power consumption | 8.2 W | 8.6 W | 8.8 W | 9.7 W |
The X20CP358x series is identical but has 3 interface module slots instead of 1.
Firmware and Software Compatibility
Supported Software Versions
| Software | Minimum Version | Maximum Version | Notes |
|---|---|---|---|
| Automation Studio | 3.0.90.20 | 4.12.x | AS 6.x does NOT target CP1584 hardware |
| Automation Runtime | 3.x | 4.93 (final AR 4.x) | AR 6.x does NOT run on CP1584 |
| OPC-UA Server | AR 4.0+ | AR 4.93 | Requires OPC-UA license on target |
| POWERLINK MN | AR 3.x+ | AR 4.93 | POWERLINK V1 and V2 supported |
| SDM Web Interface | AR 3.08+ | AR 4.93 | SDM enabled by default in AR 4.x |
| FTP Server | AR 3.x+ | AR 4.93 | FTPS available in AR 4.x |
| mappView HMI | AR 4.x | AR 4.93 | HTML5 HMI in browser; NOT supported in AR 6.x on this hardware |
Automation Studio Version Requirements by Feature
| Feature | Min AS Version | Notes |
|---|---|---|
| CP1584 hardware support | 3.0.90.20 | First AS version to recognize CP1584 |
| AR 4.x runtime targeting | 4.0 | Cannot use AS 3.x to target AR 4.x |
| AR 4.93 (latest) | 4.3.5+ SP | Use AS 4.12 for best compatibility |
| OPC-UA configuration | 4.0+ | Built-in OPC-UA server configuration |
| POWERLINK V2 (EPL V2) | 3.0.90.20 | POWERLINK V2 requires compatible bus controller |
| PVI Transfer Tool | Any 4.x | For transferring projects without full AS IDE |
| Hardware migration from CP1484 | 3.0.90.20 | HW upgrade required; see spare-parts.md |
| mapp Framework components | 4.x | mapp not available in AS 3.x |
| Profiler (Long Profiler) | Any 4.x | Works without project source code |
Interface Module Compatibility by AR Version
Not all interface modules work with all AR versions on the CP1584. The table below shows minimum requirements for common modules:
| Interface Module | Min AR Version | Min HW Revision | Notes |
|---|---|---|---|
| X20BC0088 (POWERLINK V2) | 3.x | Any | Most common bus controller |
| X20IF1063 (Modbus TCP) | 3.x | Any | Firmware 1.2.2.0+ for CP1584 |
| X20IF1020 (POWERLINK) | 3.x | H0 | Firmware 1.1.5.1+ for CP1584 |
| X20IF2772 (CANopen) | 3.x | Any | Firmware 1.0.6.1+ for CP1584 |
| X20IF1082 (EtherCAT) | 4.x | Any | Not available on older AR |
| X20IF1082-2 (EtherNET/IP) | 4.x | Any | Firmware 1.2.1.0+ for CP1584 |
| X20IF1091 (PROFINET) | 4.x | Any | Firmware 1.0.5.1+ for CP1584 |
| X20IF1072 (VARAN) | 4.x | Any | Firmware 1.0.5.1+ for CP1584 |
Key point: If you add an interface module to a CP1584 running older firmware, and the module requires a newer minimum AR version, you may need to upgrade the AR before the module will be recognized. This is a chicken-and-egg problem if you only have one CPU and no spare — always upgrade AR first, then add new modules.
CP1584 Upgrade Paths to Newer Hardware
| From | To | Required AS Version | Migration Complexity |
|---|---|---|---|
| X20CP1584 (AR 4.93) | X20CP1684 (AR 4.x/6.x) | AS 4.7+ or AS 6.0+ | Medium — same form factor, different CPU core |
| X20CP1584 (AR 4.93) | X20CP3484 (AR 4.x) | AS 4.x | Medium — different form factor, 3 slots |
| X20CP1584 (AR 4.93) | X20CP3586 (AR 4.x/6.x) | AS 4.x or AS 6.0+ | Medium — different form factor, 3 slots, faster |
| X20CP1584 (AR 4.93) | X20EM (ARM-based) | AS 6.x only | High — different CPU architecture entirely |
X20CP1684 specific note (from B&R Community): The X20CP1684 requires Automation Studio 4.7 minimum (or AS 6.0). It is NOT yet supported in AS 4.3. When upgrading from CP1584 to CP1684, the new CPU must appear in the Hardware Catalog under Tool_Box before you can configure it. See remanufacturing.md for the full migration workflow.
See firmware.md and firmware-version-mgmt.md for detailed firmware download and installation procedures.
Practical Inspection Checklist
When encountering an unknown X20CP1584 in the field:
- Verify the model: Read the label on the side of the module. Order number should be
X20CP1584orX20cCP1584. - Check battery LED (DC): Red = battery depleted. Replace immediately before power loss.
- Check CF card: Green LED = card present. No CF card = PLC will not boot to RUN.
- Check mode switch: Should be in RUN position for normal operation.
- Note hex switch settings: Record the station address values for network documentation.
- Check interface module: Identify any module in the expansion slot (look up order code).
- Note LED states: All status LEDs provide diagnostic information (see tables above).
- Check X2X link: Verify daisy chain connections to I/O stations.
- Check power wiring: Verify 24 VDC on both CPU/X2X and I/O supply terminals.
- Record serial numbers: Found on the module label, useful for license tracking and spare parts.
Common Replacement Scenarios
Replacing a Failed CP1584
- Record all settings (hex switches, mode switch, battery date)
- Image the CF card before removal:
dd if=/dev/sdX of=cp1584-backup.img bs=4M - Replace CPU on DIN rail
- Insert CF card
- Set hex switches and mode switch to match original
- Apply power and verify boot sequence
- See project-reconstruction.md if configuration is unknown
Upgrading from X20CP1484
The CP1584 is the direct upgrade path from the older X20CP1484 (Celeron-based). Migration requires:
- Automation Studio 3.0.90.20 or later
- Hardware upgrade for some interface modules (see compatibility table above)
- CF card with compatible AR version
- Project reconfiguration for the new CPU target
Key Findings
- The X20CP1584 is headless - no integrated display, no panel functionality. It is purely a CPU controller.
- The RS232 interface runs at 57600 bps factory default, not 115200 bps. Always try 57600 first.
- Only 1 interface module slot (not 3 like the CP3584). Plan fieldbus needs accordingly.
- The hex switches serve dual purpose: Ethernet INA2000 station number AND POWERLINK node number.
- POWERLINK is half-duplex only on IF3. Ethernet mode on IF3 supports full-duplex.
- Battery must be replaced within 1 minute of power loss to prevent SRAM data loss.
- Integrated fuse is non-replaceable - if the fuse blows, the entire CPU must be replaced.
- B&R ID code 0xC370 is useful for SNMP discovery and software identification.
- The CP1584 supports both POWERLINK V1 (node 0x00 = MN) and V2 (node 0xF0 = MN) with different node ranges.
- Operating temperature derating above 55 C reduces X2X Link power output from 7 W to 5 W.
- Fanless design with overtemperature protection at 110 C (CPU) and 95 C (board) — the PLC enters reset state, not a graceful shutdown. Logbook error 9204 indicates temperature-triggered restart.
- 256 MB DDR2 SDRAM is split between AR OS, task execution, and libraries. If memory usage approaches capacity, task cycle times will degrade. Monitor via system-variables.md and hardware-monitoring.md.
- Shortest achievable task class cycle time is 400 µs (CP1584 with Atom E640T at 0.6 GHz). For comparison: CP1583 = 800 µs, CP1585 = 200 µs, CP1586 = 100 µs. This determines the minimum POWERLINK cycle time the CP1584 can sustain as MN. Typical instruction cycle time is 0.0075 µs per the official datasheet. The integrated I/O processor handles I/O data point processing in the background, offloading this from the main CPU.
- Overtemperature shutdown thresholds are 110°C (processor) and 95°C (board) — the CPU enters reset state (not graceful). Logbook errors 9204 (temperature restart) and 9210 (halt/service after watchdog) indicate thermal events. No fan is present — rely on cabinet ventilation and ambient temperature control. See hardware-monitoring.md for temperature monitoring procedures.
Practical Hardware Diagnostic Commands
Via FTP (if enabled)
# Connect to the CP1584 FTP server
ftp 192.168.10.1
# Username: (varies, may be anonymous or empty)
# Password: (varies, may be empty or set by OEM)
# Useful directories:
# /System/ - AR system files, firmware, logs
# /Card/ - CF card contents (user application)
# /Temp/ - Temporary files
# /Log/ - Logbook and diagnostic files
# Download the AR logbook for error analysis
get /System/Log/Logbook.txt
Via SNMP (if enabled)
# Query the CP1584 via SNMP for hardware health
snmpwalk -v2c -c public 192.168.10.1 1.3.6.1.2.1.1
# B&R enterprise OID for hardware-specific data
snmpwalk -v2c -c public 192.168.10.1 1.3.6.1.4.1.28639
# Check interface status (IF2 Ethernet)
snmpget -v2c -c public 192.168.10.1 ifDescr.2 ifOperStatus.2
Via OPC-UA (if configured)
# Connect to OPC-UA server on the CP1584 to read system variables
# See [opcua.md](opcua.md) and [system-variables.md](system-variables.md)
# for the full variable list and connection details
Via Serial Console (Bootloader)
# Serial console settings for bootloader mode:
# Baud: 57600 (factory default)
# Data: 8 bits
# Parity: None
# Stop: 1 bit
# Flow: None
# Connect with minicom or picocom:
picocom -b 57600 /dev/ttyUSB0
# After connecting, press Enter to get the bootloader prompt
# Available commands depend on AR version:
# help - list available commands
# dir - list files
# mem - memory dump
# info - hardware info
# See [bootloader-recovery.md](bootloader-recovery.md) for full procedure
Physical Inspection Quick-Reference Card
When walking up to an unknown CP1584 in a cabinet:
[ ] Label side: read order number (X20CP1584 or X20cCP1584)
[ ] Coated variant? X20cCP1584 = conformal coating for harsh environments
[ ] Read serial number from label (for spare parts and license tracking)
[ ] Read B&R ID code (0xC370) if visible
[ ] Check DC LED: green = power OK, red = battery depleted
[ ] Check CF LED: green = card present, yellow = card access
[ ] Check R/E LED: green solid = running, red = BOOT/SERVICE
[ ] Check ETH LED: green = Ethernet link active
[ ] Check PLK LED: green = POWERLINK link active
[ ] Check mode switch: should be RUN for normal operation
[ ] Record hex switch positions (station address for network documentation)
[ ] Identify interface module in expansion slot (read its order code)
[ ] Count X2X stations connected (daisy chain physical trace)
[ ] Verify 24 VDC on both CPU/X2X (pin 11-12) and I/O (pin 7-8) power terminals
[ ] Check battery compartment: is battery present? date code?
[ ] Check for corrosion or physical damage on terminals
References
- B&R X20CP1584 Product Page: https://www.br-automation.com/en-us/products/plc-systems/x20-system/x20-plc/x20cp1584/
- X20CP158x Data Sheet V1.56: https://www.multiwaycontrol.com/multiway/X20CPx58x-en_V1.56.pdf
- X20(c)CP158x and X20(c)CP358x Technical Manual: https://www.all4sps.com/mediafiles/Sonstiges/X20CP1586.pdf
- X20TB12 Terminal Block Data Sheet: https://www.nexinstrument.com/assets/images/pdf/X20TB06__X20TB12-ENG_V266.pdf
- X20 System User’s Manual: https://www.br-automation.com/en-us/downloads/control-and-io-systems/x20-system/x20-system-users-manual/
- B&R Community Forum: https://community.br-automation.com/
- B&R X20CP1684 Product Page: https://www.br-automation.com/en-us/products/plc-systems/x20-system/x20-plc/x20cp1684/
Successor: X20CP1684
B&R has released the X20CP1684 as the direct in-family successor to the CP1584. This is a drop-in compatible replacement with significant hardware improvements:
| Parameter | X20CP1584 | X20CP1684 |
|---|---|---|
| Processor | Intel Atom E640T @ 600 MHz | Intel Atom @ 400 MHz (newer architecture) |
| RAM | 256 MB DDR2 | 512 MB LPDDR4 |
| User RAM (SRAM) | 1 MB (battery-backed) | 1 MB (battery-backed) |
| Storage | CompactFlash (removable) | 1 GB internal flash |
| Ethernet | 10/100/1000 Mbps (1 port) | Gigabit Ethernet |
| Interface slots | 1 (X20) | 1 (X20) |
| Min Automation Studio | 3.0.90.20 | 4.7 (recommended: 6.0+) |
| Min AR version | 4.x (B04.xx) | 5.x+ (G05.xx) |
| Cooling | Fanless | Fanless |
| Power consumption | 8.6 W | ~8 W |
| B&R ID code | 0xC370 | (varies by revision) |
| CF card required | Yes (5CFCRD series) | No (internal flash) |
Key migration notes for CP1584 to CP1684:
-
All X20 IO modules, bus modules, and terminal blocks are fully compatible. The X2X bus, POWERLINK, and interface module slot are identical. No IO hardware changes needed.
-
No more CompactFlash. The CP1684 uses 1 GB internal flash instead of removable CF cards. This eliminates CF card failures (the most common failure mode on CP1584) but means backup must be done via FTP, Automation Studio transfer, or mapp Backup. See ftp-web-interface.md for FTP backup procedures.
-
Minimum AS version is 4.7. B&R recommends Automation Studio 6.0+ for the CP1684. If you have an AS4 project, you may need to open it in AS4.7 first, verify it compiles, then optionally migrate to AS6 for CRA compliance. See remanufacturing.md for the full AS4→AS6 migration guide.
-
AR 5.x/6.x runtime. The CP1684 runs AR 5.x or later. Some AS4-era libraries may need updates for AR 5+ compatibility. Use the community
as6-migration-toolsto check your project. -
Hardware tree update only. In Automation Studio, the migration is straightforward: replace the CPU module in the hardware tree from X20CP1584 to X20CP1684, re-address if needed (usually automatic), recompile, and download. The IO mapping remains unchanged.
-
Production deployment: See firmware-version-mgmt.md for the production deployment checklist when changing CPU hardware. Estimated downtime: 4-8 hours for a direct CPU swap with the same IO configuration.
Order code: X20CP1684 (standard), X20cCP1684 (conformal-coated variant for harsh environments).
Beyond CP1684: X20EM ARM Edge Controllers
B&R has introduced the X20EM series as the next-generation X20 controller platform. These use ARM-based processors instead of Intel Atom, and represent B&R’s long-term direction for the X20 ecosystem. The X20EM is relevant for CP1584 maintainers planning long-term migration.
What we know about X20EM:
| Aspect | X20CP1584 (current) | X20CP1684 (successor) | X20EM (next gen) |
|---|---|---|---|
| CPU architecture | Intel Atom E640T (x86) | Intel Atom (x86) | ARM / RISC-V |
| Automation Studio | AS 3.x–4.x | AS 4.7+ (recommended AS 6.0+) | AS 6.x only |
| Automation Runtime | AR 4.x only | AR 5.x/6.x | AR 6.x only |
| Multicore support | No | No | Yes |
| X20 IO compatible | Yes | Yes | Yes |
| Form factor | 1-slot X20 | 1-slot X20 | X20 slice (details vary) |
| Storage | CompactFlash | Internal flash | Internal flash |
| Release timeline | Discontinued (SN 2022/54) | Current production | Available (as of 2025) |
Migration implications for CP1584 maintainers:
-
X20EM requires AS 6.x exclusively — if you migrate to X20EM, you MUST also migrate the project to AS 6. There is no AS 4.x support for ARM targets.
-
X20 IO modules are compatible — the X2X bus is unchanged, so all your existing IO modules, bus modules, terminal blocks, and interface modules work with X20EM.
-
Compiled code is architecture-specific —
.BRfiles compiled for Intel x86 will NOT run on ARM. You must recompile the entire project from source. If you only have compiled code (no project file), X20EM migration requires full project reconstruction first (see project-reconstruction.md). -
Multicore is a significant advantage — AR 6.5 on X20EM allows assigning cyclic task classes to specific CPU cores, eliminating cycle time contention between motion control and logic processing.
-
Not a direct drop-in replacement — unlike CP1684, the X20EM has a different CPU architecture and requires a complete software rebuild. Plan for full bench testing before production deployment.
-
When to consider X20EM over CP1684: When the machine has complex multi-axis motion that hits cycle time limits, when you need OPC UA over TSN, or when CRA compliance requires AR 6.x with multicore isolation for security domains.
Status: X20EM specifications are evolving. Check B&R’s product page at https://www.br-automation.com/en-us/products/plc-systems/x20-system/ for the latest models and specifications. The X20 system user’s manual (January 2025 revision) covers System Generation 4 controllers including ARM-based options.
New Apollo Lake I Generation (2025)
B&R has expanded the X20 PLC family with new controllers based on Intel Apollo Lake I processors. These controllers add OPC UA over TSN support and can function as field-level masters in TSN networks — a capability the CP1584 cannot provide.
| Model | Key Feature | Relevance to CP1584 Migration |
|---|---|---|
| X20CP3687X | “Power of a PC” in X20 form factor | High-performance AR 6.x target for complex machines |
| X20CP0484-1 | 512 MB RAM, 2 GB internal flash | Budget-friendly AR 6.x entry point |
Why this matters for CP1584 maintainers: If you are planning a migration to meet CRA 2027 compliance (see cybersecurity-hardening.md §9.3), these new controllers provide a modern, patchable AR 6.x platform with TSN capabilities — while maintaining X20 IO bus compatibility.
Source: B&R “Expanded X20 PLC generation” — https://www.br-automation.com/en/products/plc-systems/innovations/
Related Documents
- ar-rtos.md — Automation Runtime (VxWorks-based) that runs on this CPU
- memory-map.md — CPU memory layout including SRAM, DDR2, and IO mapping
- firmware.md — AR firmware architecture and boot process
- firmware-version-mgmt.md — Firmware versions, downgrade paths, compatibility
- cf-card-boot.md — CF card contents and boot sequence details
- retentive-data.md — Battery-backed SRAM management and data retention
- x2x-protocol.md — X2X Link wire-level protocol details
- powerlink-internals.md — POWERLINK protocol on IF3
- if2772-canopen.md — CANopen via X20IF2772 interface module
- modbus-gateway.md — Modbus TCP/RTU via X20IF1082 interface module
- io-card-hardware.md — X20 I/O module signal processing and diagnostics
- network-architecture.md — Network topology and device enumeration
- spare-parts.md — Replacement hardware identification and ordering
- bootloader-recovery.md — Serial console bootloader and firmware recovery
- access-recovery.md — Password recovery and admin access restoration
- system-variables.md — AR system variables for runtime monitoring
- hardware-monitoring.md — Temperature, voltage, and hardware health monitoring
- grounding-emc.md — Grounding and EMC considerations for installation
- ftp-web-interface.md — Remote file access via FTP and web server
- diagnostic-workstation.md — Building a diagnostic workstation for CP1584 systems
- remanufacturing.md — Repair vs. replace evaluation and migration paths
- license-mgmt.md — License management tied to this hardware’s B&R ID code
First 60 Minutes: Recovery Playbook for an Undocumented B&R CP1584
Scenario: You just walked up to a machine with a B&R X20CP1584 PLC. The OEM is gone. There are no project files, no documentation, and the previous engineer left no notes. The machine is down (or behaving erratically). This is your step-by-step guide for the first hour.
Audience: An automation engineer who has never worked with B&R before but needs to get this machine running — or at least diagnosed — fast.
Phase 1: Visual Assessment (0-5 minutes)
1.1 Read the CPU Label
Locate the physical label on the X20CP1584. You need:
| What to Record | Where to Find It | Why It Matters |
|---|---|---|
Order number (e.g., X20CP1584) | Label on CPU housing | Confirms CPU model and capabilities |
| Serial number | Label on CPU | Unique identifier for B&R support, spare parts tracking |
Hardware revision (e.g., J0) | Label on CPU | Determines firmware compatibility |
B&R ID code (0xC370 for CP1584) | Not on label — from SDM or software | Used in network protocols |
See cp1584-hardware-ref.md for full hardware specifications.
1.2 Read the LED States
The CPU has 5 status LEDs on the front panel. Document what you see before touching anything:
| LED | Location | What to Note |
|---|---|---|
| R/E (Run/Error) | CPU function LED | Green=running, Red=BOOT/SERVICE, blinking patterns indicate startup/error |
| RDY/F (Ready/Fault) | CPU function LED | Yellow=license violation (when R/E blinks red) |
| S/E (Status/Error) | POWERLINK interface | Green=PLK active, Red=error, blinking patterns indicate PLK state |
| PLK | POWERLINK link | Green=link established, blinking=activity |
| ETH | Ethernet link | Green=link established, blinking=activity |
| CF | CompactFlash | Green=card detected, Yellow=read/write access |
| DC | Battery status | Red=battery empty |
Quick LED decode for common states:
| What You See | What It Means | Immediate Action |
|---|---|---|
| R/E green steady, ETH green, CF green | Normal running — machine has other issues | Proceed to Phase 3 |
| R/E red steady | BOOT or SERVICE mode — program not running | See Phase 2 |
| R/E red blink + RDY/F yellow blink | License violation | See license-mgmt.md |
| R/E off, CF blinking, DC blinking | Intermittent hardware failure — possibly dying CPU | May need hardware replacement (see spare-parts.md) |
| All IO modules: ‘r’ blinking | X2X bus lost | Check X2X cables, terminator, CPU state |
| DC red | Battery dead | Replace CR2477N within 1 minute if power off (see retentive-data.md) |
| S/E red blinking (pattern) | POWERLINK error code | Count blinks, decode per cp1584-hardware-ref.md |
See troubleshooting-index.md Scenario 15 for the complete LED decode table.
1.3 Read the Mode Switch
The operating mode switch has 3 positions:
| Position | Mode | Meaning |
|---|---|---|
| BOOT | Boot mode | CPU runs Boot AR — used for initial programming/firmware update |
| RUN | Run mode | Normal operation — loads and runs the application from CF card |
| DIAG | Diagnose | Diagnostic mode — boots without initializing program memory |
If the switch is in BOOT, the PLC will NOT run the application. Switch to RUN and power-cycle. If it was intentionally left in BOOT (e.g., by a service technician), someone may have been working on it.
Phase 2: Get Connected (5-20 minutes)
2.1 Find the PLC’s IP Address
Try these methods in order of speed:
Method A: Default IP from DIP switches
The two hex rotary switches on the front panel set the INA2000 station number. The default IP for CP1584 is derived from this:
- INA station 1 →
192.168.1.1 - INA station 2 →
192.168.1.2 - etc.
Set your PC to the same subnet (e.g., 192.168.1.x) and try pinging.
Method B: BOOT mode default IP
If the mode switch is in BOOT position, the default IP is:
192.168.1.250(common BOOT mode default)
Method C: Network scan with brsnmp
python -m brsnmp scan 192.168.1.0/24
Install from github.com/hilch/brsnmp. This uses SNMP to discover B&R devices.
Method D: Serial console
Connect to IF1 (RS232) with a null-modem cable:
- Baud: 57600 (factory default)
- Parity: Even
- Data bits: 8
- Stop bits: 1
- Flow control: None
The serial console shows boot messages including the IP address.
Pinout on X20TB12 terminal block:
- TX (PLC transmit) → PC RX
- RX (PLC receive) → PC TX
- GND → PC GND
See access-recovery.md for complete network discovery procedures.
2.2 Open SDM (System Diagnostics Manager)
Once you have the IP, open a browser and navigate to:
http://<PLC_IP>/sdm
SDM requires no authentication on AR 4.x. It provides:
- Hardware tree — all connected modules, their status, firmware versions, serial numbers
- CPU information — AR version, CPU temperature, memory usage, battery status
- Logger — recent error messages and events
- Diagnostic buffer — last errors with timestamps
Screenshot every SDM page immediately. This is your baseline.
Security warning: SDM on AR 4.x has unpatchable vulnerabilities (CVE-2025-3450, CVE-2025-3449). Do not leave SDM accessible on the network long-term. See cybersecurity-hardening.md.
2.3 Establish Automation Studio Connection (If Available)
If you have Automation Studio installed:
- Open AS → Online → Settings
- Enter the PLC’s IP address
- Browse for target — the PLC should appear
- Right-click → Connect
- Do NOT download anything yet — you might overwrite the running program
If you do NOT have Automation Studio, use these alternatives:
- brwatch (github.com/hilch/brwatch) — GUI tool for watching/changing variables (Windows, requires PVI)
- Pvi.py (github.com/hilch/Pvi.py) — Python wrapper for PVI API
- UaExpert (free from Unified Automation) — OPC-UA client for browsing variables
2.4 Quick-Start: Browse Variables via OPC-UA (No AS Required)
If the PLC has OPC-UA enabled (common on AR >= 4.50), you can browse the entire variable namespace without Automation Studio:
- Download and install UaExpert from unified-automation.com (free)
- Add a server:
opc.tcp://<PLC_IP>:4840 - If the PLC uses a self-signed certificate (AR 4.x default), UaExpert will warn — click “Continue” to connect
- In the Address Space panel, expand the nodes:
Objects→Server→ browse for system variables- Look for a node named after the project or application (e.g.,
MyMachine) — this contains all global variables
- You can now read any variable by double-clicking it, and write values by selecting a variable and using the Data Access View
What this gives you: The complete variable list (names + data types), current values, and the namespace structure. This is critical intelligence for project-reconstruction.md.
See opcua.md for full OPC-UA details and cybersecurity-hardening.md for certificate management.
2.5 Quick-Start: Connect via PVI.py (No AS Required)
PVI (Process Visualization Interface) is B&R’s native protocol for variable access. Using the Python wrapper:
pip install Pvi
from pvi import *
with PviConnection() as plc:
plc.login("192.168.1.10")
# List all variables
vars = plc.list_variables()
for v in vars:
print(f"{v.name}: {v.type} = {v.value}")
# Read a specific variable
speed_setpoint = plc.read_variable("gMainApp.nSpeedSetpoint")
print(f"Speed setpoint: {speed_setpoint}")
# Write a variable (to change a setpoint or force an output)
plc.write_variable("gMainApp.nSpeedSetpoint", 1500)
Prerequisites: PVI.py requires the B&R PVI Development Setup (or at minimum the PVI DLLs) on the connecting PC. See pvi-api.md for installation and advanced usage.
2.6 Quick-Start: brsnmp Network Discovery
If you don’t know the PLC’s IP address, scan the subnet:
pip install brsnmp
brsnmp scan 192.168.1.0/24
This uses SNMP (port 161) to discover all B&R devices. Returns target type, serial number, AR version, and IP address. Works on any machine on the network without Automation Studio.
Phase 3: Diagnose the Problem (20-45 minutes)
3.1 Check the Logger
In SDM or Automation Studio, open the Logger (check ALL boxes). Look for:
Critical errors that stop the program:
| Error ID | Name | What It Means | Immediate Action |
|---|---|---|---|
| 25314 | EXCEPTION Page fault | CPU tried to access invalid/protected memory. Caused by null pointers, corrupted string buffers, or shifted memory after online change | Read the Logger entry for the task name and address. If after an online change, cold restart. If recurring, investigate pointer logic |
| 9204 | Temperature shutdown | CPU die exceeded 110°C (board: 95°C) | Check cabinet ventilation, fans, ambient temperature. Do not restart until cooled |
| 9210 | Watchdog | Task cycle time exceeded watchdog limit | Check for infinite loop, blocked IO, or network timeout in the named task. Temporary: increase cycle time |
| 6803 | Stack underflow | Task stack corrupted — usually from recursion or corrupted stack pointer | Cold restart. If recurring, check for recursive function calls or stack-heavy operations |
| 3039 | AVT reference not available | nc154man (motion) library missing or internal reference table corrupted | Re-transfer the project. Check if ACOPOS drive configuration is intact |
| 8234 | IO module not found | Hardware mismatch — expected IO module not detected on X2X bus | Check X2X cables, module seating, power supply. Compare hardware tree to physical modules |
Warning-level errors (program may still run):
| Error ID | Name | What It Means |
|---|---|---|
| 25313 | Warning (non-critical) | Non-fatal warning — check context for details |
| 41216 | Motion error | ACOPOS/stepper drive reported a fault — check drive fault code |
| -1070584042 | OPC UA connection failed | OPC UA server lost connection to a client or had a cert issue |
Tip: In SDM, check the Diagnostic Buffer tab in addition to the Logger. The Diagnostic Buffer shows the last N errors with timestamps, task context, and the full error description — more readable than the raw Logger output.
See diagnostics-sdm.md for detailed SDM usage and ar-rtos.md for AR error internals.
3.2 Check the CF Card via FTP
ftp <PLC_IP>
Username: (try empty, "br", "admin")
Password: (try empty, "br", "admin")
Key directories on the CF card:
C:\— System partition (AR OS files, do not modify)F:\— User partition (your program, configuration, logs)F:\AS\— Automation Studio project filesF:\AS\System\— System configurationF:\Log\— Log files (AR log, alarm history)C:\System\Log\— Boot logs
Backup the entire CF card via FTP before changing anything:
wget -r ftp://<PLC_IP>/ --mirror
See cf-card-boot.md for complete CF card file layout and ftp-web-interface.md for FTP access details.
3.3 Common Failure Patterns
| Symptoms | Most Likely Cause | Quick Test | Fix |
|---|---|---|---|
| PLC in SERVICE mode after power-up | Dead battery, corrupted memory, program error | Check DC LED; read Logger error | Replace battery (see retentive-data.md); warm restart |
| PLC in BOOT mode, won’t go to RUN | CF card not recognized, missing/invalid program | Check CF LED; try different CF card | Reseat CF card; re-image from backup (see cf-card-boot.md) |
| Machine runs but outputs wrong | IO module failure, wiring issue, program logic error | Force outputs from AS or PVI; check IO module LEDs | See io-card-hardware.md, io-sniffing.md |
| Intermittent communication drops | POWERLINK timing, cable/connector issues, EMI | Check S/E LED pattern; capture EPL traffic with Wireshark | See powerlink-internals.md, grounding-emc.md |
| Servo drives faulting | Encoder issue, drive parameter, POWERLINK CN lost | Check drive LED fault code; monitor drive status via PVI/OPC-UA | See acopos-drives.md, encoder-diagnostics.md |
| All IO modules showing errors | X2X bus failure, CPU not in RUN, power supply issue | Check CPU R/E LED; check power supply module LEDs | See x2x-protocol.md, io-card-hardware.md |
| HMI not communicating | POWERLINK/OPC-UA connection lost, VNC session dropped | Ping HMI panel IP; check VNC port 5900 | See hmi-integration.md, network-architecture.md |
| Temperature-related shutdowns | Cabinet ventilation failed, fan dead, thermal degradation | Read CPU temperature via SDM; check cabinet airflow | See hardware-monitoring.md |
Phase 4: Get It Running (45-60 minutes)
4.1 If PLC Is in SERVICE Mode
- Read the error from the Logger
- If the error is transient (e.g., watchdog timeout from a one-time condition):
- In AS: Online → Cold Start
- Or via brwatch: CPU → Coldstart
- If the error is persistent (e.g., hardware mismatch, missing module):
- Check the Hardware tree in SDM for missing/faulty modules
- If a module was replaced, its firmware may need updating (see firmware-version-mgmt.md)
- If the error is a program error (e.g., divide by zero):
- Use brwatch or PVI to find the offending variable
- Change the variable via brwatch’s watch window or Pvi.py
- Warm restart
4.2 If PLC Is Stuck in BOOT Mode
- Verify the mode switch is in RUN
- Check CF card is inserted and detected (CF LED should be green)
- If CF card is not detected:
- Remove and reinsert the CF card
- Try a known-good CF card with a basic AS project
- See bootloader-recovery.md for full recovery
- If CF card is detected but still in BOOT:
- The program on the card may be invalid
- Connect via AS in BOOT mode and download a new project
- See cf-card-boot.md for CF card file requirements
4.3 If No CF Card Exists
You need to create a minimal CF card to get the PLC to RUN mode:
- Obtain a compatible CompactFlash card (B&R extended temperature recommended, see spare-parts.md)
- In Automation Studio:
- Create a new project with the X20CP1584 hardware
- Configure the IP address
- Create a minimal program (even just a single empty task)
- Build the project
- Use Tools → Runtime Utility Center to create the CF card (Offline Installation)
- Insert the CF card and switch to RUN
- The PLC should boot into RUN mode with your minimal program
- See project-reconstruction.md for rebuilding the full application
4.4 If the CPU Is Physically Dead
Symptoms: No LEDs, no response to serial, no network discovery.
- Verify 24V power supply to the CPU (check terminal block: +24V on pins 5-6, GND on pins 1, 4)
- Check the integrated fuse (non-replaceable — if blown, the CPU module must be replaced)
- If power is good and still no LEDs, the CPU is likely dead
- Do not attempt to repair the CPU module — it is not field-repairable
- Source a replacement (see spare-parts.md for part numbers and compatible replacements)
- The CF card from the dead CPU will work in a replacement CPU (same model), preserving the program
- See remanufacturing.md for upgrade options
Emergency Quick Reference Card
Print this and tape it inside the cabinet door:
B&R X20CP1584 EMERGENCY REFERENCE
====================================
MODE SWITCH: BOOT / RUN / DIAG
DEFAULT IP: 192.168.1.<INA station#>
BOOT IP: 192.168.1.250
SERIAL: 57600, 8, E, 1
SDM URL: http://<IP>/sdm
FTP: ftp://<IP> (user: br, pass: br)
BATTERY: CR2477N, 3V/950mAh (Renata only!)
REPLACE IN: 1 minute (power off) or hot-swap
CPU TEMP: Shutdown at 110C / board 95C
LED R/E RED: BOOT/SERVICE mode
LED DC RED: Battery dead
LED CF: Green=OK, Yellow=accessing
LED S/E: PLK state (blink pattern)
====================================
DO NOT:
- Remove CF card while running
- Use non-Renata battery (fire risk!)
- Connect to internet without VPN/firewall
- Leave SDM/FTP open on production network
====================================
TOOLS:
brwatch - github.com/hilch/brwatch (watch/force vars)
brsnmp - github.com/hilch/brsnmp (network discovery)
Pvi.py - github.com/hilch/Pvi.py (Python PVI)
systemdump.py- github.com/hilch/systemdump.py (system dumps)
UaExpert - OPC-UA client (free from Unified Automation)
Wireshark - Network capture (install POWERLINK dissector)
====================================
Key Findings
- The first 5 minutes are LED and label reading. Do not touch anything until you have documented the current state. The LEDs tell you 80% of what you need to know.
- SDM is your best friend when you have no project files. It requires no authentication (AR 4.x) and gives you hardware tree, CPU info, temperature, memory, battery status, and error logs.
- FTP gives you access to the CF card contents without removing the card. Back up everything via FTP before making any changes.
- The mode switch matters. If it is in BOOT, the PLC will never run the application. Switch to RUN.
- Battery death causes retentive data loss. If the DC LED is red, replace the CR2477N battery within 1 minute (power off) or hot-swap it.
- The CP1584 overtemperature threshold is 110°C (CPU) / 95°C (board) per the official B&R datasheet. The CPU enters reset state at these temperatures.
- brwatch is a GUI-only Windows tool. It cannot be pip-installed and has no CLI/JSON output mode. It requires PVI Development Setup to be installed.
- If the CPU is physically dead (no LEDs, no serial response), the module must be replaced. It is not field-repairable. The CF card is transferable to a replacement CPU of the same model.
- OPC-UA browsing (UaExpert) and PVI (Pvi.py) can replace most Automation Studio functions for diagnostic purposes — variable reading/writing, namespace browsing, and monitoring.
- The Logger error 25314 (page fault) is the most common cause of SERVICE mode. It indicates the program tried to access invalid memory. A cold restart often clears it if the cause was transient (e.g., after an online change). If it recurs immediately, there is a deeper program logic issue.
Phase 5: What to Document Before You Leave
Even if the machine is running again, spend 10 minutes documenting what you found. Future-you (or the next engineer) will thank you.
5.1 Minimum Documentation Checklist
| Item | How to Capture | Store In |
|---|---|---|
| CPU order number, serial number, hardware revision | Photograph label | Maintenance log |
| AR firmware version | SDM → CPU Information or serial console | Maintenance log |
| IP address, subnet, gateway | SDM or serial console | Network diagram |
| INA station number (DIP switch position) | Read rotary switches | Maintenance log |
| Battery status | DC LED + SDM | Maintenance log (replace by date) |
| CF card contents listing | ls -R via FTP, or wget -r --spider ftp://IP/ | Backup + text file |
| Hardware tree (all modules in X2X chain) | SDM → Hardware tree (screenshot every page) | Backup + folder |
| Logger output (last 50 errors) | SDM → Logger (screenshot) | Backup + folder |
| Task configuration (names, cycle times) | SDM → Task Monitor or AS → Online → Task Configuration | Backup + folder |
| Network topology (all IPs) | brsnmp scan output, or SDM for each device | Network diagram |
| OPC-UA namespace structure (if enabled) | UaExpert → File → Export Address Space | Backup + XML |
| Variable list with types and current values | UaExpert Data Access View, or Pvi.py script | CSV file |
5.2 Critical Backups to Take
- Full CF card image via FTP:
wget -r ftp://<PLC_IP>/ --mirror -o backup.log - System dump (if AS is available): AS → Online → Create System Dump → saves
.sysfile - SDM screenshots of every page
- Serial console boot log: Connect serial console, power-cycle the PLC, capture all boot output
See documentation-reconstruction.md for the full documentation methodology and cf-card-boot.md for CF card imaging best practices.
Cross-References
- cp1584-hardware-ref.md — Complete hardware specifications, LED decode tables, pinouts
- troubleshooting-index.md — Scenario-based troubleshooting index
- access-recovery.md — Network discovery, credential recovery
- bootloader-recovery.md — Full recovery from corrupted/missing CF card
- cf-card-boot.md — CF card file layout and boot sequence
- diagnostics-sdm.md — SDM detailed usage and diagnostic buffer interpretation
- retentive-data.md — Battery replacement and data recovery
- firmware-version-mgmt.md — Firmware identification and updates
- ftp-web-interface.md — FTP and web server access
- cybersecurity-hardening.md — Security hardening for production
- spare-parts.md — Part number identification and sourcing
- remanufacturing.md — CPU replacement and migration options
- documentation-reconstruction.md — Systematic documentation methodology
- opcua.md — OPC-UA server configuration and certificate management
- pvi-api.md — PVI API for programmatic variable access
- ar-rtos.md — AR OS internals and error code interpretation
- execution-model.md — Task classes, cycle times, and watchdog behavior
- io-card-hardware.md — IO module LED codes and signal troubleshooting
- io-sniffing.md — Fieldbus traffic analysis for sensor diagnostics
- project-reconstruction.md — Rebuilding an AS project from an undocumented system
Cybersecurity Hardening for Legacy B&R CP1584 Systems
Overview
This guide provides actionable, step-by-step procedures for hardening a B&R X20CP1584 PLC system when you have no OEM support, no original project documentation, and a controller that cannot be fully patched. The CP1584 runs Automation Runtime (AR) 4.x on a VxWorks kernel — it maxes out at AR R4.93, which leaves 17+ known CVEs permanently unpatchable. Network isolation and defense-in-depth are not optional best practices — they are survival requirements.
Audience: An automation engineer maintaining one or more CP1584-based machines from defunct OEMs, who needs to secure the system without vendor support, formal IEC 62443 certification budgets, or a dedicated OT security team.
Threat model: The CP1584 was not designed with modern cybersecurity in mind. It lacks signed firmware verification (on AR 4.x), has no built-in firewall, ships with multiple open network services by default, and its underlying VxWorks kernel has known unpatched vulnerabilities. An attacker on the same network segment can crash the PLC (CVE-2025-3450, CVE-2021-22275), intercept communications (CVE-2024-5800, CVE-2024-8603), or bypass authentication (CVE-2023-1617, CVE-2025-3449).
Related Documents
| Document | Relevance |
|---|---|
| ar-rtos.md | Complete CVE table (50+ entries), AR OS internals, firewall rules |
| access-recovery.md | Password/credential recovery, access control layers |
| network-architecture.md | Network topology, device discovery, VLAN segmentation |
| firmware.md | Firmware architecture, update to AR R4.93 |
| firmware-version-mgmt.md | Version identification, upgrade procedures |
| diagnostics-sdm.md | SDM vulnerabilities and mitigation |
| ftp-web-interface.md | FTP and web server security |
| opcua.md | OPC-UA certificate management and security |
| pvi-api.md | PVI credential leak (CVE-2026-0936) |
| remanufacturing.md | Migration to patchable hardware |
1. The Hardening Problem: Why CP1584 Is Different
1.1 Unpatchable by Design
The CP1584 is an end-of-life CPU limited to AR 4.x. AR R4.93 is the final release. No further security patches will be produced for this platform. The following categories of vulnerabilities are permanently unpatchable:
| Category | CVEs / Advisories | Why Unpatchable on CP1584 |
|---|---|---|
| SDM session management | CVE-2025-3449, CVE-2025-3448, CVE-2025-11498 | Require AR >= 6.4 |
| SDM multiple vulns | SA2025P003 (multiple SDM CVEs, Oct 2025) | Require AR >= 6.5 |
| SDM DoS (resource lock) | CVE-2025-3450 (SA25P002) | Patched in R4.93 |
| SDM web XSS | CVE-2023-3242 (SA23P018), CVE-2022-4286 (SA22P024) | Patched in R4.93 |
| SDM portmapper SYN flood | CVE-2023-3242 (SA23P013) | Patched in R4.93 |
| SSL/TLS cryptography | CVE-2024-5800, CVE-2024-8603, CVE-2024-0323 | Require AR >= 6.1 |
| Webserver overflow | CVE-2021-22275 | No patch for AR 4.x |
| VNC authentication | CVE-2023-1617 (SA22P011) | Patchable only via VC4 update (may not be available) |
| ANSL DoS (flooding) | CVE-2025-11044 (SA25P005, CVSS v4.0 8.9 / v3.1 6.8) | Patched in R4.93 |
| ANSL rate limiting | CVE-2025-11044 variant | Patched in R4.93 |
| AR multiple vulns | SA24P011 (Aug 2024, multiple AR CVEs) | Require AR >= 6.4 |
| mapp auth bypass | SA22P014 (Nov 2024, multiple mapp components) | Require AR >= 6.1 |
| Self-signed cert algo | SA25P001 (Jan 2025, insecure algorithm) | Require AR >= 6.4 |
| FTP weak encryption | CVE-2024-5800 (SA23P004, FTP TLS) | Require AR >= 6.1 |
| AS insufficient encryption | SA23P019 (Feb 2024, AS communication) | AS-only fix; no AR patch |
| Evil PLC Attack | SA 01/2022 (RCE via project upload from target) | AS-side fix; no AR patch; always validate PLC connections |
| Insecure code loading | SA24P005 (May 2024, DLL/code injection) | Require AR >= 6.5 |
| PVI credential leak | CVE-2026-0936 (SA26P001, Jan 2026) | PVI client-side; fixed in PVI 6.5 |
| AS cert validation | SA25P004 (Jan 2026, insufficient server cert validation) | AS-side; fixed in AS 6.5 |
| PixieFail (UEFI) | SA24P003 (Jan 2026 update, network boot vuln) | UEFI firmware; affects Industrial PCs, may affect CP1584 boot path |
| PPT30 OPC-UA DoS | CVE-2025-11482 (SA25P006, May 2026, CVSS v4.0 8.7) | PPT30 HMI only; fixed in PPT30 OS 1.8.0; OPC-UA off by default |
Bottom line: 20+ CVEs remain open on AR 4.x (even at R4.93). The only defense is network isolation. See ar-rtos.md for the complete CVE table.
2026 Advisory Wave (Jan 2026): Three new advisories were published in January 2026: SA26P001 (PVI credential leak into logfile), SA25P004 (AS insufficient server certificate validation), and SA25P005 (ANSL server flooding DoS — already patched in R4.93). SA26P001 is notable because it affects the PVI client on the engineering PC, not the PLC itself — an authenticated attacker can cause PVI to log sensitive data (including connection credentials) to the PVI log file. Upgrade PVI to 6.5 (shipped with AS 6.5) to remediate.
1.2 Service Surface Attack Map
Every network service on the CP1584 is an attack surface. Map them before hardening:
| Port | Protocol | Service | Default State | Risk if Exposed |
|---|---|---|---|---|
| 21 | TCP | FTP Server | Enabled, weak auth | Credential theft, data exfiltration, weak TLS |
| 80 | TCP | HTTP / SDM | Enabled, no auth | DoS (CVE-2021-22275, CVE-2025-3450), XSS, session takeover |
| 443 | TCP | HTTPS | Configurable | Same as 80 if enabled |
| 11169 | TCP | ANSL / PVI | Enabled | DoS (CVE-2025-11044 if pre-4.93), variable access |
| 11160 | TCP | INA2000 (legacy) | May be enabled | Legacy PVI access, no modern security |
| 4840 | TCP | OPC-UA | If configured by OEM | Variable read/write if auth weak |
| 5900 | TCP | VNC (VC4) | If configured | Auth bypass (CVE-2023-1617), HMI exposure |
| 5800 | TCP | VNC HTTP | If configured | Same as 5900 |
| 123 | UDP | NTP/SNTP | If configured | Time manipulation (lower risk) |
| 161 | UDP | SNMP | Configurable | Information disclosure, community string brute-force |
| 162 | UDP | SNMP Trap | Configurable | Lower risk |
| 30303 | UDP | ANSL Discovery | Enabled | Network reconnaissance, device fingerprinting |
| 11169 | UDP | ANSL Discovery | Enabled | Same as 30303 |
1.3 IEC 62443 Context
IEC 62443 is the international standard for industrial automation cybersecurity. While full certification is unrealistic for legacy equipment, the standard’s core concepts — zones and conduits — provide the right architectural framework:
- Zone: A group of assets that share the same security requirements. The CP1584 and its directly connected I/O form one zone.
- Conduit: A controlled communication path between zones (a firewall rule, a VPN tunnel, a one-way diode).
Even without formal certification, applying IEC 62443 zone/conduit thinking to a legacy CP1584 system dramatically improves its security posture.
2. Hardening Checklist (By Priority)
Use this checklist in order. Each step builds on the previous.
Phase 1: Immediate Actions (Do Today)
- 2.1 Update firmware to AR R4.93 (patches the worst CVEs)
- 2.2 Identify and document all open ports on the CP1584
- 2.3 Disable unnecessary services
- 2.4 Change all default/known credentials
- 2.5 Block PLC from all networks except the control VLAN
Phase 2: Network Isolation (Do This Week)
- 2.6 Implement zone/conduit network architecture
- 2.7 Configure firewall rules per Section 4
- 2.8 Set up a dedicated maintenance VLAN
- 2.9 Disable ANSL discovery broadcasts on production networks
Phase 3: Service Hardening (Do This Month)
- 2.10 Secure OPC-UA with certificates and strong policies
- 2.11 Disable or restrict SDM to maintenance windows only
- 2.12 Disable FTP; use SCP/SFTP for file transfers
- 2.13 Update VC4 if VNC is used
- 2.14 Secure SNMP or disable it
- 2.15 Secure NTP source
Phase 4: Monitoring and Maintenance (Ongoing)
- 2.16 Set up network monitoring for anomalous traffic to/from the PLC
- 2.17 Subscribe to B&R security advisories
- 2.18 Document and periodically audit all changes
- 2.19 Plan migration timeline to patchable hardware
3. Step-by-Step Hardening Procedures
3.1 Update Firmware to AR R4.93
This is the single most important hardening step. AR R4.93 patches:
- CVE-2025-11044 (ANSL DoS — can permanently crash the PLC via network packets)
- CVE-2025-3450 (SDM DoS — crashes the PLC via crafted SDM request)
- CVE-2022-4286 (SDM reflected XSS)
- CVE-2023-3242 (portmapper DoS)
Procedure:
-
Verify current AR version:
- Connect to serial console (IF1, 115200 baud) and watch boot screen - OR: check via SDM web interface at http://<PLC_IP>/sdm - OR: use Automation Studio: Online > Device Information - OR: FTP to C:\ and examine SysDir\*.cfg files for version strings -
Obtain AR R4.93 upgrade:
- Install Automation Studio 4.12 (latest AS4 — see firmware-version-mgmt.md)
- Download AR R4.93 upgrade via
Tools > Upgradesin AS - If no AS license: use the 90-day evaluation license. The runtime transfer does not require a permanent license on the engineering PC
-
Backup the current system:
- Image the CF card: dd if=/dev/sdX of=cp1584_backup_$(date +%Y%m%d).img bs=4M - FTP backup of user partition (F:\) - Screenshot all SDM pages - Export any retentive data (see [retentive-data.md](retentive-data.md)) -
Perform the upgrade:
- Follow the firmware update procedure in firmware.md
- The upgrade replaces the AR OS files on the CF card while preserving user partition data
- Plan for 15-30 minutes of downtime
- Verify the PLC boots to RUN state with AR 4.93 after update
-
Post-upgrade verification:
- Confirm AR version in SDM
- Verify all cyclic tasks are running
- Check for any new warnings or errors in the AR log
- Re-test machine operation
Warning: Never skip the CF card backup. If the upgrade fails, the backup image is your only recovery path. See bootloader-recovery.md for recovery procedures.
3.2 Identify Open Ports and Services
Scan the CP1584 from a workstation on the same subnet:
nmap -sV -p- --open -T4 <PLC_IP>
Expected results for a default AR R4.93 installation:
PORT STATE SERVICE VERSION
21/tcp open ftp B&R Automation FTP (AR 4.93)
80/tcp open http B&R Automation WebServer / SDM
11169/tcp open unknown B&R ANSL / PVI Manager
30303/udp open unknown B&R ANSL Discovery
123/udp open ntp (if NTP configured)
Document every port you find. Compare against the service surface map in Section 1.2. Any port not in that table is unexpected and requires investigation.
3.3 Disable Unnecessary Services
FTP Server — Disable or Restrict:
The FTP server uses weak TLS (CVE-2024-5800, CVE-2024-8603). Even with TLS enabled, communications may be decryptable.
- Best: Block port 21 at the firewall entirely. Use FTP only during maintenance windows with firewall rules temporarily opened.
- Alternative: Change FTP credentials from defaults (
br/br) to strong credentials. Restrict FTP access to the maintenance VLAN only.
SDM Web Server — Restrict to Maintenance Windows:
SDM has multiple unpatchable vulnerabilities on AR 4.x (session takeover, XSS, CSV injection from SA25P003). SA2025P003 (Oct 2025) documents additional SDM CVEs requiring AR >= 6.5. Even after updating to R4.93, the SDM web interface should be treated as hostile if exposed to any network beyond the control VLAN.
- Block port 80/443 at the firewall during normal operation
- Temporarily allow access during scheduled maintenance windows
- Never expose SDM to the office network or internet
ANSL Discovery (UDP 30303) — Cannot Be Disabled:
The ANSL discovery broadcast cannot be disabled in AR 4.x. It reveals the PLC’s IP address, serial number, firmware version, and device name to anyone on the network segment. Network segmentation is the only mitigation — put the PLC on a dedicated VLAN that engineering and HMI devices share, but no other network segment can reach.
INA2000 (TCP 11160) — Disable if Possible:
INA2000 is a legacy protocol. PVI 6.x (AS 6.x) dropped support for it. If no legacy tools require INA2000:
- In Automation Studio, the INA2000 transport is configured per connection in the PVI Manager setup
- On the PLC side, the INA2000 port is always open if the AR version supports it
- Firewall block on port 11160 is the mitigation
VNC (TCP 5900/5800) — Disable if Not Needed:
- VNC is only needed for remote HMI viewing
- CVE-2023-1617 allows authentication bypass on older VC4 versions
- If VNC is not needed for daily operation, block port 5900/5800 at the firewall
- If VNC is required, update VC4 to the latest version and restrict access to HMI subnets only
SNMP — Disable if Not Used:
- SNMP on AR 4.x often uses default community strings (
public,private) - SNMP exposes CPU temperature, memory usage, module status — useful for attackers planning attacks
- If not used for monitoring, block UDP 161/162 at the firewall
- If used, change community strings to strong values and restrict to monitoring server IPs
3.4 Change All Default Credentials
B&R controllers have no factory-level passwords — all credentials are application-defined (see access-recovery.md). However, common defaults exist in the field:
| Service | Common Defaults | Action |
|---|---|---|
| FTP | br / br, admin / admin, empty credentials | Change to strong credentials (16+ chars, no dictionary words) |
| SDM | No authentication | Cannot add authentication on AR 4.x — firewall is the only control |
| OPC-UA | Anonymous access | Configure user roles if possible (requires AS project modification) |
| VNC | No password or simple password | Set strong VNC password in VC4 settings |
| AS Online Login | No password | Set strong password (requires AS project modification) |
| SNMP | public / private | Change to strong community string or disable entirely |
| mapp User roles | OEM-defined | If recoverable, change via access-recovery.md procedures |
Credential management without AS project:
Most credentials are baked into the AS project configuration. If you do not have the original project, you cannot change AS Online Login, OPC-UA user roles, or mapp User passwords without rebuilding the project. For these, network isolation is your primary defense.
FTP credentials and SNMP community strings can sometimes be changed via the CF card configuration files without the full AS project — see config-file-formats.md.
3.5 Implement Zone/Conduit Network Architecture
Apply IEC 62443 zone/conduit thinking to create a network architecture that isolates the CP1584 from threats.
Recommended Three-Zone Architecture:
+---------------------+ Firewall +--------------------+ Firewall +------------------+
| OFFICE / IT ZONE |================== | INDUSTRIAL DMZ | ================ | CONTROL ZONE |
| | (Block ALL PLC | (SCADA server, | (Allow only | (CP1584, I/O, |
| - Workstations | traffic FROM | historian, | protocol- | HMI panels, |
| - Internet | this zone) | engineering PC) | specific traffic| drives, |
| - Guest WiFi | | | FROM DMZ only) | field devices) |
+---------------------+ +--------------------+ +------------------+
|
Firewall blocks ALL
traffic from Office
and Internet zones
Zone Definitions:
| Zone | Devices | Security Level | Access to Control Zone |
|---|---|---|---|
| Control Zone | CP1584, X20 I/O bus, ACOPOS drives, HMI panels, X2X bus | Highest (SL-3 equivalent) | Direct access, all required protocols |
| Industrial DMZ | SCADA/HMI server, OPC-UA gateway, engineering workstation, historian | Medium (SL-2 equivalent) | Limited: OPC-UA, PVI, NTP only |
| Office/IT Zone | Workstations, internet, guest networks | Lowest | Blocked — no direct access to PLC |
Conduit Rules (Control Zone Inbound):
| Source | Destination | Protocol | Port | Purpose |
|---|---|---|---|---|
| DMZ SCADA Server | CP1584 | TCP | 4840 | OPC-UA data acquisition |
| DMZ Engineering PC | CP1584 | TCP | 11169 | ANSL (AS online, PVI) |
| NTP Server | CP1584 | UDP | 123 | Time synchronization |
| DMZ Maintenance | CP1584 | TCP | 80 | SDM (maintenance windows only) |
| DMZ Maintenance | CP1584 | TCP | 21 | FTP (maintenance windows only) |
| ALL | CP1584 | ALL | ALL | Block by default |
Conduit Rules (Control Zone Outbound):
| Source | Destination | Protocol | Port | Purpose |
|---|---|---|---|---|
| CP1584 | NTP Server | UDP | 123 | Time sync |
| CP1584 | PVI Manager | TCP | 11160 | PVI callbacks (if used) |
| CP1584 | ALL | ALL | ALL | Block all other outbound |
3.6 Firewall Implementation
Option A: Managed Industrial Switch with ACLs
Most industrial environments have managed switches (Cisco, Hirschmann, Moxa, B&R X20SW). Configure VLANs and ACLs:
# Example VLAN configuration (Hirschmann/Phoenix Contact syntax)
# Control Zone VLAN
vlan 10
name "CONTROL_ZONE"
untagged 1-12
tagged 25
# Industrial DMZ VLAN
vlan 20
name "INDUSTRIAL_DMZ"
untagged 13-20
tagged 25
# Inter-VLAN ACL: DMZ -> Control Zone
access-list DMZ_TO_CONTROL
permit tcp any any eq 4840 # OPC-UA
permit tcp any any eq 11169 # ANSL
permit udp any any eq 123 # NTP
deny ip any any # Block everything else
# Apply ACL to VLAN 20 interface
interface vlan 20
ip access-group DMZ_TO_CONTROL in
# Port 21 (FTP) and 80 (SDM/HTTP) are BLOCKED by default
# Temporarily permit during maintenance:
# permit tcp <maintenance_ip> any eq 80
# permit tcp <maintenance_ip> any eq 21
Option B: Dedicated Industrial Firewall
If a dedicated firewall appliance is available (Fortinet FortiGate, Cisco ISA, Claroty, Nozomi):
# Control Zone -> DMZ firewall policy
policy CONTROL_TO_DMZ
source-zone: CONTROL
dest-zone: DMZ
service: NTP, PVI-Callback
action: ALLOW
logging: all
# DMZ -> Control Zone firewall policy
policy DMZ_TO_CONTROL
source-zone: DMZ
dest-zone: CONTROL
service: OPC-UA, ANSL, NTP
source-address: [SCADA_Server_IP, Engineering_PC_IP, NTP_Server_IP]
action: ALLOW
logging: all
# Maintenance window policy (disabled by default)
policy MAINTENANCE_DMZ_TO_CONTROL
source-zone: DMZ
dest-zone: CONTROL
service: HTTP, FTP
source-address: [Engineering_PC_IP]
schedule: maintenance_window
action: ALLOW
logging: all
enable: false # Enable only during scheduled maintenance
Option C: PC-Based Firewall (Minimal Budget)
If no managed switch or firewall appliance exists, use a Linux-based firewall between the office and control networks:
# Install on a dual-NIC Linux box (one NIC to office, one to control network)
apt install nftables
# /etc/nftables.conf
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
# Control Zone interface (facing PLCs)
chain input_control {
type filter hook input priority 0; policy drop;
# Allow established/related connections
ct state established,related accept
# Allow NTP
udp dport 123 accept
# Allow ICMP for diagnostics
ip protocol icmp accept
# Drop everything else
drop
}
# DMZ interface (facing engineering workstations)
chain input_dmz {
type filter hook input priority 0; policy drop;
ct state established,related accept
# Allow SSH to firewall itself for management
tcp dport 22 accept
drop
}
# Forward from DMZ to Control Zone
chain forward {
type filter hook forward priority 0; policy drop;
# Allow DMZ -> Control: OPC-UA
iifname "eth1" oifname "eth0" tcp dport 4840 accept
# Allow DMZ -> Control: ANSL
iifname "eth1" oifname "eth0" tcp dport 11169 accept
# Allow DMZ -> Control: NTP
iifname "eth1" oifname "eth0" udp dport 123 accept
# Allow Control -> DMZ: NTP outbound
iifname "eth0" oifname "eth1" udp sport 123 accept
# Allow Control -> DMZ: PVI callback
iifname "eth0" oifname "eth1" tcp sport 11160 accept
# Block everything else
drop
}
}
3.7 Secure OPC-UA Configuration
OPC-UA is the primary data exchange protocol for B&R systems. If the OPC-UA server is enabled on the CP1584, secure it:
Certificate Management:
- Generate a self-signed certificate for the PLC (if one doesn’t exist — check via SDM or FTP to
F:\orC:\AS\) - Copy the PLC’s certificate to all OPC-UA clients
- Generate client certificates and trust them on the PLC side (requires AS project modification — see opcua.md)
Security Policy Selection (if modifiable):
| Policy | Security Level | CP1584 AR 4.x Support |
|---|---|---|
| None | No security | Default, insecure |
| Basic128Rsa15 | Signing + encryption | Supported but weak algorithms |
| Basic256 | Signing + encryption | Supported but weak algorithms |
| Basic256Sha256 | Stronger encryption | Supported, recommended minimum |
| Aes128-Sha256-RsaOaep | Strongest available | May not be available on AR 4.x |
If you cannot modify the OPC-UA configuration (no AS project), enforce security at the network level:
- Allow OPC-UA (port 4840) only from trusted SCADA/HMI servers
- Block OPC-UA from all other networks
- Monitor OPC-UA traffic for unexpected connections using network monitoring tools
3.8 SDM Hardening (Mitigate, Don’t Patch)
Since SDM vulnerabilities cannot be fully patched on AR 4.x:
- Block SDM at the firewall during normal production. Port 80/443 to the CP1584 should be blocked by default.
- When SDM access is needed for diagnostics, use a temporary firewall rule that allows HTTP/HTTPS only from a specific maintenance workstation IP, and close the rule immediately after the maintenance window.
- Never access SDM from the office network or over WiFi. Always use a wired connection on the DMZ or a maintenance VLAN.
- Clear browser session after SDM access — CVE-2025-3449 (predictable session ID) means an attacker who can guess the session ID could hijack your SDM session.
- Do not click links to SDM — CVE-2025-3448 (reflected XSS) could execute JavaScript in your browser if you follow a crafted link.
3.9 FTP Alternatives
FTP on AR 4.x uses weak TLS that may be decryptable. Alternatives:
For File Backup (Pull from PLC):
- Use FTP only from the maintenance VLAN with firewall temporarily opened
- Accept that the transfer may be observable on the network
- Transfer only configuration files, not sensitive production data
For File Push (To PLC):
- If modifying CF card contents is necessary, consider:
- Physical CF card swap (most secure — remove card, write on isolated workstation, reinsert)
- FTP during maintenance window with firewall rules temporarily opened
- Automation Studio file transfer over ANSL (encrypted within the PVI protocol layer)
SCP/SFTP Alternative:
- AR 4.x does not natively support SSH/SCP/SFTP
- If secure file transfer is critical, consider building a small ARM/Linux gateway box that runs an SSH server and relays files to the PLC via FTP (accepting the FTP weakness only on the local control network segment)
3.10 NTP Hardening
Use a trusted internal NTP server, not internet NTP pools:
- Designate an internal server (in the DMZ) as the NTP source for all control zone devices
- That server synchronizes with upstream internet NTP servers
- The CP1584 synchronizes only with the internal server
- Firewall: allow UDP 123 only from the internal NTP server to the CP1584
Why: An attacker who can spoof NTP responses could shift the PLC’s clock, causing time-based logic to malfunction, corrupting timestamp-based alarm analysis, or invalidating certificate validity periods.
3.11 Engineering Workstation Hardening
The engineering workstation running Automation Studio and PVI is a high-value target:
CVE-2025-11043 (AS Certificate Validation Bypass): Automation Studio does not properly validate TLS certificates. An attacker on the network could impersonate the PLC during AS online operations.
CVE-2026-0936 (PVI Logfile Credential Leak): PVI logs credentials in plaintext log files.
Mitigations:
- Upgrade Automation Studio to the latest version — AS 4.12.9+ includes the latest patches for AS-side vulnerabilities
- Run AS only on the DMZ network — never on the office network or WiFi
- PVI logfile security:
- Locate PVI log files on the engineering workstation (typically in
%APPDATA%\BR\Automation\or similar) - Set filesystem permissions so only the engineering user account can read them
- Periodically clean log files that contain credentials
- If possible, disable PVI logging or set it to minimal level
- Locate PVI log files on the engineering workstation (typically in
- AS certificate validation: Until B&R fully patches CVE-2025-11043, be aware that AS may accept fraudulent certificates during online operations. Only connect to PLCs on the isolated control network where man-in-the-middle attacks are not feasible.
4. Complete Firewall Rule Reference
This is the authoritative firewall rule set for a hardened CP1584 (AR R4.93) installation. Adapt IP addresses and VLANs to your network.
4.1 Inbound Rules to CP1584
# REQUIRED (Production)
ALLOW TCP 11169 from [SCADA/HMI subnet] # ANSL - OPC-UA FX, AS online
ALLOW TCP 4840 from [SCADA/HMI subnet] # OPC-UA - if server enabled
ALLOW UDP 123 from [NTP server IP] # NTP time sync
ALLOW ICMP from [DMZ subnet] # Ping for diagnostics
# OPTIONAL (With Restrictions)
ALLOW TCP 80 from [Maintenance IP] # SDM - maintenance windows only
ALLOW TCP 443 from [Maintenance IP] # SDM HTTPS - maintenance windows only
ALLOW TCP 21 from [Maintenance IP] # FTP - maintenance windows only
ALLOW TCP 5900 from [HMI panel IPs] # VNC - only from authorized panels
ALLOW UDP 161 from [Monitoring server IP] # SNMP - only from authorized collector
# BLOCK (Always)
BLOCK TCP 21 from ALL (except maintenance) # FTP insecure
BLOCK TCP 5900 from ALL (except HMI panels) # VNC insecure
BLOCK UDP 30303 from ALL (external zones) # ANSL discovery - control zone only
BLOCK ALL from [Office/IT/Guest] # Zero trust for non-control networks
BLOCK ALL from ANY (external/Internet) # Never expose PLC to internet
4.2 Outbound Rules from CP1584
# ALLOW
ALLOW UDP 123 to [NTP server IP] # NTP time sync
ALLOW TCP 11160 to [PVI Manager IP] # PVI callbacks (if used)
# BLOCK
BLOCK ALL to ANY # PLC should not initiate external connections
4.3 Inter-VLAN Rules (If Using VLANs)
# Office VLAN -> Control Zone VLAN
BLOCK ALL
# Industrial DMZ VLAN -> Control Zone VLAN
ALLOW TCP 4840 (OPC-UA)
ALLOW TCP 11169 (ANSL)
ALLOW UDP 123 (NTP)
BLOCK ALL
# Control Zone VLAN -> Industrial DMZ VLAN
ALLOW UDP 123 (NTP responses)
ALLOW TCP 11160 (PVI callback)
BLOCK ALL
5. Network Monitoring for Anomaly Detection
Even with firewall rules in place, monitoring provides detection for when (not if) something goes wrong.
5.1 What to Monitor
| Indicator | Normal Behavior | Anomaly Alert |
|---|---|---|
| TCP connections to port 80 (SDM) | Zero (blocked by firewall) | Any connection attempt = someone bypassed firewall |
| TCP connections to port 21 (FTP) | Zero (blocked by firewall) | Any connection attempt |
| UDP 30303 (ANSL discovery) broadcasts | Periodic from CP1584 | Discovery from non-control-zone IPs = reconnaissance |
| TCP 4840 (OPC-UA) connections | From known SCADA/HMI servers only | From unknown IPs = unauthorized access attempt |
| TCP 11169 (ANSL) connections | From known engineering PCs only | From unknown IPs |
| Traffic volume to/from CP1584 | Low (a few KB/s for cyclic comms) | Spikes = possible data exfiltration or DoS attempt |
| New devices on control VLAN | Static set of known MAC addresses | New MAC = unauthorized device |
5.2 Monitoring Tools
Passive (Recommended for Legacy Systems):
# Simple port scan detection using tcpdump
# Run on the DMZ firewall or a SPAN port
tcpdump -i eth0 -n 'host <PLC_IP> and not (udp port 123 or tcp port 4840 or tcp port 11169)'
# Alerts on any traffic to PLC that isn't OPC-UA, ANSL, or NTP
# Log ANSL discovery probes (watch for scanning)
tcpdump -i eth0 -n 'udp port 30303 or udp port 11169'
Active (If Budget Allows):
- Open-source: Zeek (formerly Bro) network security monitor
- Industrial-specific: Wireshark with OPC-UA and POWERLINK dissectors
- Commercial: Claroty, Nozomi Networks, Dragos (if budget allows)
- For Python-based custom monitoring: see python-diagnostics.md
5.3 Automated Alerting Script
#!/usr/bin/env python3
"""
cp1584_network_monitor.py - Monitors network traffic to/from a B&R CP1584
for anomalous connections. Run on a SPAN port or firewall log collector.
"""
import subprocess
import time
import logging
from datetime import datetime
logging.basicConfig(
filename='/var/log/cp1584_monitor.log',
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
PLC_IP = '192.168.10.5'
KNOWN_SOURCES = {
'192.168.20.10': 'SCADA-Server',
'192.168.20.11': 'Engineering-PC',
'192.168.20.20': 'NTP-Server',
'192.168.10.100': 'HMI-Panel-1',
}
ALLOWED_PORTS = {4840, 11169, 123} # OPC-UA, ANSL, NTP
ALERT_COOLDOWN = 300 # seconds between repeated alerts
last_alert = {}
def check_connections():
try:
result = subprocess.run(
['ss', '-tn', f'dest', PLC_IP],
capture_output=True, text=True, timeout=10
)
for line in result.stdout.splitlines()[1:]: # Skip header
parts = line.split()
if len(parts) < 4:
continue
source = parts[4].rsplit(':', 1)[0]
dest_port = parts[3].rsplit(':', 1)[1]
state = parts[1]
if dest_port.isdigit() and int(dest_port) not in ALLOWED_PORTS:
hostname = KNOWN_SOURCES.get(source, 'UNKNOWN')
if hostname == 'UNKNOWN' or state != 'ESTAB':
alert_key = f"{source}:{dest_port}"
now = time.time()
if alert_key not in last_alert or (now - last_alert[alert_key]) > ALERT_COOLDOWN:
msg = f"SUSPICIOUS: {source} ({hostname}) -> {PLC_IP}:{dest_port} [{state}]"
logging.warning(msg)
print(msg)
last_alert[alert_key] = now
except Exception as e:
logging.error(f"Monitoring error: {e}")
if __name__ == '__main__':
logging.info(f"CP1584 network monitor started for {PLC_IP}")
while True:
check_connections()
time.sleep(60)
6. Physical Security Checklist
Network security is meaningless if someone can walk up to the PLC with a laptop:
- Control cabinet locked with key access limited to authorized personnel
- CF card not easily removable without opening the cabinet (it should be behind the cabinet door)
- Serial console port (IF1) not accessible from outside the cabinet
- DIP switches not accessible without opening the cabinet
- USB port — CP1584 has a USB port on the front. Consider physically blocking or disabling it if not needed (some firmware versions allow USB disable)
- Network cables secured — label all cables; verify no unauthorized taps or switches are inserted
- Cabinet grounding and bonding verified — see grounding-emc.md for procedures
7. Secure Remote Access
If remote maintenance access to the CP1584 is required (e.g., you need to connect from off-site):
7.1 Recommended Architecture
Remote Engineer (Home/Office)
|
| VPN Tunnel (WireGuard / OpenVPN / IPsec)
v
[Industrial DMZ - Jump Host / Bastion]
|
| Direct connection on control VLAN
v
CP1584
Critical rules:
- Never expose the CP1584 directly to the internet. No port forwarding, no dynamic DNS to PLC ports.
- VPN is mandatory. All remote access goes through a VPN concentrator in the DMZ.
- Jump host / bastion. Remote engineers connect to a bastion host in the DMZ, then from there to the PLC. The bastion should log all sessions.
- MFA on VPN. Require multi-factor authentication for VPN connections.
- Session timeout. VPN sessions should time out after a configurable period of inactivity.
- Maintenance window enforcement. Remote access should only be possible during scheduled maintenance windows.
7.2 VPN Implementation (WireGuard Example)
# On the DMZ bastion/gateway
apt install wireguard
# /etc/wireguard/wg0.conf
[Interface]
Address = 10.10.99.1/24
ListenPort = 51820
PrivateKey = <gateway_private_key>
[Peer]
# Remote engineer
PublicKey = <engineer_public_key>
AllowedIPs = 10.10.99.2/32
[Peer]
# Additional engineer
PublicKey = <engineer2_public_key>
AllowedIPs = 10.10.99.3/32
# On the remote engineer's laptop
# /etc/wireguard/wg0.conf
[Interface]
Address = 10.10.99.2/24
PrivateKey = <engineer_private_key>
DNS = 10.10.20.1 # Internal DNS
[Peer]
PublicKey = <gateway_public_key>
Endpoint = <dmz_gateway_public_ip>:51820
AllowedIPs = 10.10.20.0/24, 10.10.10.0/24 # DMZ and Control subnets
PersistentKeepalive = 25
The engineer then connects to the CP1584 via its control zone IP (e.g., 10.10.10.5) through the VPN tunnel. The gateway firewall already permits DMZ -> Control Zone traffic for ANSL, OPC-UA, and NTP.
8. Incident Response for CP1584
8.1 Signs of Compromise
| Symptom | Possible Attack | Immediate Action |
|---|---|---|
| PLC unresponsive (crashed) | DoS attack (CVE-2025-3450, CVE-2021-22275) | Block all inbound traffic, reboot from CF card backup |
| Unexpected program changes | Unauthorized AS upload or online modification | Compare CF card contents to known-good backup, see program-reverse-engineering.md |
| Unknown HMI screens appearing | VNC hijack or SDM session takeover | Block VNC and SDM ports, check VNC connections |
| Network traffic spikes from PLC | Data exfiltration or malicious scanning | Block all outbound from PLC, investigate with packet capture |
| Alarm floods from safety system | Tampering with safety I/O | Emergency stop, investigate safe I/O (see safe-io-diagnostics.md) |
| New devices on control VLAN | Unauthorized device insertion | Investigate, remove, audit physical security |
8.2 Recovery Procedure
- Isolate: Block all network traffic to/from the CP1584 at the nearest switch or firewall
- Preserve: Capture any available network logs, SDM snapshots, AR logs before rebooting
- Recover: Restore the CF card from the known-good backup image (
ddbackup) - Verify: After boot, compare all files on the restored CF card against the backup checksums
- Analyze: Determine the attack vector before reconnecting to the network
- Harden: Apply any additional firewall rules or service restrictions identified during analysis
- Report: If the attack caused safety concerns, document thoroughly for compliance
8.3 CF Card Backup Integrity Verification
# Create checksums of CF card backup
sha256sum cp1584_backup_20260710.img > cp1584_backup_20260710.sha256
# Verify backup integrity before restore
sha256sum -c cp1584_backup_20260710.sha256
# Verify restored card matches backup
dd if=/dev/sdX bs=4M | sha256sum
# Compare to: sha256sum cp1584_backup_20260710.img
9. B&R Security Advisory Monitoring
9.1 Subscription Sources
| Source | URL | What You Get |
|---|---|---|
| B&R Security Advisories | https://www.br-automation.com/en-us/service/cyber-security/cyber-security-advisories-and-notices/ | All B&R security advisories (SA- prefixed) |
| ABB PSIRT RSS Feed | https://psirt.abb.com/rss/abbrssfeed.xml | Machine-readable RSS feed of all B&R (ABB) security advisories |
| ABB CSAF Feed | https://psirt.abb.com/csaf/abb-csaf-feed-tlp-white.json | Machine-readable CSAF/ROLIE feed for automated vulnerability management tooling |
| CISA ICS-CERT Advisories | https://www.cisa.gov/news-events/ics-advisories | US government advisories for industrial control systems, including B&R |
| NVD CVE Database | https://nvd.nist.gov/vuln/search/results?query=br-automation | All published CVEs for B&R products |
| OpenCVE B&R Feed | https://app.opencve.io/cve/?vendor=br-automation | Aggregated B&R CVE feed |
| awesome-B&R (GitHub) | https://github.com/br-automation-community/awesome-B-R | Curated list of B&R community tools, libraries, and resources |
| BrSecurity (GitHub) | https://hilch.github.io/BrSecurity | AS library with Password/Encrypt/Decrypt security functions |
| B&R Community Forum | https://community.br-automation.com/t/cyber-security-faq-for-b-r-automation-users/10006 | Cyber Security FAQ for B&R users |
9.2 Security Advisory Timeline (2024-2026)
This timeline tracks all B&R security advisories that affect CP1584 / AR 4.x systems. Advisories marked “Patched in R4.93” are addressed by updating to the latest AR 4.x. All others remain permanently open.
| Date | Advisory | Description | CP1584 Impact | Mitigation |
|---|---|---|---|---|
| 2026-07-06 | SA26P011 | APROL R 4.4-01P5 security fixes (CVE-2026-6900 cert validation, CVE-2026-6901 search path, 4 Apache Tomcat CVEs) | APROL only (SCADA, not PLC) | N/A for CP1584 |
| 2026-06-11 | SA26P010 | Linux Kernel vulnerabilities impact | BX/BP Linux-based controllers only | N/A for CP1584 (VxWorks kernel) |
| 2026-06-10 | SA26P009 | XZ Utils backdoor vulnerability | BX/BP Linux-based controllers only | N/A for CP1584 (VxWorks kernel) |
| 2026-05-26 | SA25P006 | PPT30 OPC-UA Server DoS (CVE-2025-11482, CVSS v4.0 8.7 / v3.1 7.5); resource exhaustion via concurrent connections; permanent unresponsiveness; reboot required; CISA ICSA-26-155-03 republished 2026-06-04 | PPT30 HMI panels only (OPC-UA off by default) | Update PPT30 OS to 1.8.0; see opcua.md; firewall OPC-UA if not needed |
| 2026-02-18 | SA25P007 | SQLite version update in Automation Studio | AS-side only | Update AS to 6.5+ |
| 2026-01-29 | SA26P001 | PVI logfile credential leak (CVE-2026-0936) | Engineering PC; PVI logs sensitive connection data | Update PVI to 6.5 (AS 6.5); secure PVI log files; see pvi-api.md |
| 2026-01-29 | SA24P003 (update) | PixieFail network boot vulnerability | May affect boot path | Network boot not used on CP1584; verify no PXE boot in BIOS |
| 2026-01-19 | SA25P004 | AS insufficient server certificate validation | Engineering PC; AS-side | Update AS to 6.5; AS 6.5 warns on self-signed certs |
| 2026-01-19 | SA25P005 | ANSL Server flooding DoS (CVE-2025-11044); CISA ICSA-26-125-03 republished 2026-07 | CVSS v4.0 8.9 | Patched in R4.93 |
| 2025-10-14 | SA2025P003 | Multiple SDM vulnerabilities (CVE-2025-3449 session identifier prediction, CVE-2025-3448 reflected XSS, CVE-2025-11498 CSV formula injection); CISA republished 2026-05-21 | Open on AR 4.x (fix requires AR >= 6.4) | Block SDM at firewall; network isolation; see diagnostics-sdm.md |
| 2025-10-07 | SA25P002 | SDM DoS via improper resource locking (CVE-2025-3450) | Patched in R4.93 | Update to R4.93 |
| 2025-03-24 | SA24P015 | APROL privilege escalation / info disclosure | APROL only (SCADA, not PLC) | N/A for CP1584 |
| 2025-01-16 | SA25P001 | Insecure algorithm for self-signed certs | Open on AR 4.x | Replace self-signed certs with CA-signed; see opcua.md |
| 2024-11-27 | SA22P014 | Auth bypass in mapp components | Open on AR 4.x | Block OPC-UA/mapp at firewall; restrict access |
| 2024-08-30 | SA24P011 | Multiple AR vulnerabilities | Open on AR 4.x | Network isolation; update to R4.93 for partial fixes |
| 2024-05-14 | SA24P005 | Insecure loading of code | Open on AR 4.x | Block unauthorized project uploads; see “Evil PLC Attack” below |
| 2024-04-12 | SA24P002 | LogoFail UEFI boot vulnerability | May affect boot path | CP1584 uses custom bootloader; verify boot chain integrity |
| 2024-02-27 | SA23P019 | AS insufficient communication encryption | Engineering PC; AS-side | Use VPN tunnels for all AS-to-PLC connections |
| 2024-02-14 | SA24P004 | SSH Terrapin attack | SSH not exposed by default on AR 4.x | Block port 22 at firewall |
| 2024-02-05 | SA23P018 | SDM web XSS (CVE-2023-3242) | Patched in R4.93 | Update to R4.93 |
| 2024-02-05 | SA23P004 | FTP weak TLS (CVE-2024-5800) | Open on AR 4.x | Block FTP at firewall; use maintenance VLAN only |
| 2023-07-26 | SA23P013 | Portmapper SYN flooding | Patched in R4.93 | Update to R4.93 |
| 2023-02-14 | SA22P024 | SDM reflected XSS (CVE-2022-4286) | Patched in R4.93 | Update to R4.93 |
| 2022-02 | SA 01/2022 | Evil PLC Attack (RCE via project upload from target) | AS-side; no AR fix | Never connect AS to unknown PLCs without validation; verify PLC identity before uploading |
| 2021-15 | SA 08/2021 | Webserver DoS (CVE-2021-22275) | Open on AR 4.x | Block port 80/443 at firewall |
9.3 CRA 2027 Compliance Assessment
The EU Cyber Resilience Act (CRA) takes full effect December 2027. Products with digital elements placed on the EU market must meet cybersecurity requirements including vulnerability handling, security updates, and incident reporting.
CP1584 CRA Assessment:
| CRA Requirement | CP1584 Status | Gap |
|---|---|---|
| Vulnerability handling process | B&R has a formal process (IEC 62443-4-1 aligned) | Process exists but CP1584 cannot receive patches |
| Security updates for known vulns | 20+ CVEs permanently unpatchable | FAIL |
| Coordinated disclosure (180 days) | B&R publishes advisories promptly | Process works but CP1584 cannot benefit |
| SBOM / software bill of materials | Not provided for AR 4.x components | GAP |
| Default secure configuration | Multiple services enabled by default with weak auth | FAIL |
Implication: Machines containing CP1584 controllers cannot meet CRA requirements as-is. The only path to CRA compliance is migration to patchable B&R hardware (AR 6.x) or a non-B&R platform. See remanufacturing.md for migration planning. The EU Machinery Regulation (MR) also takes effect January 2027, compounding the compliance urgency.
Key Findings
-
CP1584 on AR 4.x is permanently unpatchable. B&R has ended-of-life for AR 4.x and the CP1584 cannot run AR 5.x or 6.x. All 20+ known CVEs will remain open for the lifetime of these controllers.
-
The attack surface is broad. Default-enabled services include FTP (unencrypted), HTTP/SDM web server, OPC-UA, SNMP, POWERLINK, ANSL, and the PVI portmapper. Many use weak or default authentication.
-
Network isolation is the most effective defense. Since patching is impossible, placing the CP1584 on an isolated VLAN with a firewall blocking all inbound traffic except necessary protocols is the single highest-impact hardening step.
-
OPC-UA certificate management is critical but often neglected. The default self-signed certificates expire and are not trusted by clients. Implementing proper certificate lifecycle management significantly reduces man-in-the-middle risk.
-
CRA 2027 compliance is impossible without migration. The EU Cyber Resilience Act (effective January 2027) requires active vulnerability management and SBOM disclosure — neither of which a CP1584 can provide. Migration to AR 6.x hardware or an alternative platform is the only compliance path.
-
PVI credential leak (CVE-2026-0936) is the most immediately exploitable vulnerability. PVI logs usernames and passwords in plaintext on any PC running Automation Studio or PVI-based tools, creating a credential harvesting vector.
-
SA2025P003 SDM CVEs are the most dangerous unpatched SDM vulnerabilities. CVE-2025-3449 (session identifier prediction), CVE-2025-3448 (reflected XSS), and CVE-2025-11498 (CSV formula injection) all remain open on AR 4.x. CISA republished the advisory in May 2026 (ICSA-26-155-03 companion). CSV injection is particularly insidious — exported diagnostic CSV files can execute formulas when opened in Excel, potentially compromising the engineer’s workstation.
-
PPT30 OPC-UA DoS (CVE-2025-11482) affects HMI panels paired with CP1584 systems. CVSS v4.0 8.7 — an unauthenticated attacker can permanently crash the OPC-UA server on PPT30 panels by sending malformed concurrent connection requests, requiring a reboot. If your CP1584 uses a PPT30 HMI panel with OPC-UA enabled, update to PPT30 OS 1.8.0 or firewall the OPC-UA port (4840/TCP).
Cross-References
- ar-rtos.md — Complete CVE table, AR OS internals, VxWorks base
- access-recovery.md — Credential recovery, access control layers
- network-architecture.md — Network topology, device discovery
- firmware.md — Firmware architecture, AR R4.93 update
- firmware-version-mgmt.md — Version identification, upgrade procedures
- diagnostics-sdm.md — SDM vulnerabilities and configuration
- ftp-web-interface.md — FTP and web server interface details
- opcua.md — OPC-UA server security, certificates, policies
- pvi-api.md — PVI API, CVE-2026-0936 credential leak
- hmi-integration.md — HMI/VNC security considerations
- grounding-emc.md — Physical security, grounding, EMC
- safe-io-diagnostics.md — Safety system incident response
- program-reverse-engineering.md — Detecting unauthorized program changes
- python-diagnostics.md — Python-based monitoring scripts
- remanufacturing.md — Migration to patchable hardware
- cf-card-boot.md — CF card backup and imaging procedures
- troubleshooting-index.md — Security-related troubleshooting scenarios
B&R CP1584 Master Troubleshooting Index
A scenario-based index mapping common B&R CP1584 diagnostic problems to the research documents that solve them. For an engineer who has inherited an undocumented B&R machine and needs to diagnose a specific problem, start here.
How to Use This Index
- Identify your symptom from the categories below
- Follow the linked document(s) for step-by-step diagnostic procedures
- Cross-reference the “See Also” links for related diagnostic paths
Scenario 1: Machine Won’t Boot / PLC Won’t Start
| Symptom | Primary Document | Secondary |
|---|---|---|
| PLC shows no LEDs after power-on | cp1584-hardware-ref.md — power supply and hardware checks | grounding-emc.md |
| STATUS LED flashing red/yellow pattern | cp1584-hardware-ref.md — LED decode table | diagnostics-sdm.md |
| PLC stuck in BOOT mode | bootloader-recovery.md — full recovery procedures | access-recovery.md |
| PLC enters SERVICE mode after startup | bootloader-recovery.md — SERVICE mode causes | ar-rtos.md — crash/exception handling |
| CF card not detected / CF LED error | cf-card-boot.md — CF card contents and diagnostics | firmware.md |
| Battery dead, PLC loses settings | retentive-data.md — battery replacement procedure | cp1584-hardware-ref.md |
| firmware corrupted / unknown version | firmware-version-mgmt.md — version identification and update | bootloader-recovery.md |
| CP1584 completely unresponsive (brick) | bootloader-recovery.md — unbrick procedures | cp1584-hardware-ref.md |
| Error 25314 (page fault) on startup | ar-rtos.md — exception handling and backtrace | program-reverse-engineering.md |
Scenario 2: Can’t Connect to the PLC from Automation Studio
| Symptom | Primary Document | Secondary |
|---|---|---|
| Don’t know the PLC’s IP address | access-recovery.md — network discovery via BOOT mode | cp1584-forensics.md |
| AS password required / unknown | access-recovery.md — all credential recovery methods | bootloader-recovery.md |
| PLC not found in Auto Search | network-architecture.md — network discovery | access-recovery.md |
| “PLC module stuck in BOOT mode: Service” | bootloader-recovery.md — BOOT:Service recovery | access-recovery.md |
| Connection drops intermittently | network-architecture.md — network diagnostics | grounding-emc.md |
| ANSL port (11169) not responding | pvi-api.md — PVI line configuration | network-architecture.md |
| Migrating from AS4 to AS6, PVI broken | remanufacturing.md — AS4→AS6 migration tools | pvi-api.md |
Scenario 3: Program Running But Machine Behaving Wrong
| Symptom | Primary Document | Secondary |
|---|---|---|
| Outputs not turning on/off correctly | io-card-hardware.md — IO module diagnostics | memory-map.md — verify addressing |
| Analog readings wrong / drifting | analog-calibration.md — calibration procedures | io-card-hardware.md |
| Cycle time violations / watchdog errors | execution-model.md — task scheduling analysis | ar-rtos.md — scheduler internals |
| Intermittent sensor glitches | io-sniffing.md — fieldbus traffic capture | grounding-emc.md |
| POWERLINK communication errors | powerlink-internals.md — EPL diagnostics | io-sniffing.md |
| X2X bus errors / IO module diagnostics | x2x-protocol.md — X2X protocol analysis | io-card-hardware.md |
| CAN bus communication failures | if2772-canopen.md — CANopen diagnostics | io-sniffing.md |
| Servo drive / motor problems | acopos-drives.md — drive diagnostics | encoder-diagnostics.md |
| Encoder faults on motion axis | encoder-diagnostics.md — full encoder diagnostics | acopos-drives.md |
Scenario 4: Need to Understand What the PLC Program Does (No Project Files)
| Goal | Primary Document | Secondary |
|---|---|---|
| Extract variables from running PLC | pvi-api.md — PVI variable enumeration | opcua.md — OPC-UA browsing |
| Browse all IO mapping | cp1584-forensics.md — forensic analysis | memory-map.md |
| Read the CF card contents | cf-card-boot.md — CF card file layout | ftp-web-interface.md |
| Reverse-engineer compiled code | program-reverse-engineering.md — binary analysis | memory-map.md |
| Reconstruct a functional AS project | project-reconstruction.md — full methodology | cp1584-forensics.md |
| Understand task structure | execution-model.md — task classes and scheduling | ar-rtos.md |
| Read alarm/event history | alarm-logging.md — alarm log analysis | diagnostics-sdm.md |
Scenario 5: Need to Make Changes Without Stopping the Machine
| Goal | Primary Document | Secondary |
|---|---|---|
| Change a setpoint or parameter | online-changes.md — runtime modification | pvi-api.md |
| Force an output on/off | online-changes.md — force/override techniques | memory-map.md |
| Modify running program logic | online-changes.md — online download | execution-model.md |
| Save changes persistently | online-changes.md — save to CF card | cf-card-boot.md |
| Change via OPC-UA from external system | opcua.md — variable write via OPC-UA | python-diagnostics.md |
| Change via PVI from Python | pvi-api.md — PVI Python access | python-diagnostics.md |
| Rollback a bad online change | online-changes.md — rollback procedures | cf-card-boot.md |
Scenario 6: Adding Monitoring / Remote Visibility
| Goal | Primary Document | Secondary |
|---|---|---|
| Add SNMP monitoring | iiot-retrofit.md — SNMP setup | ebpf-telemetry.md |
| Add OPC-UA data export | opcua.md — server configuration | iiot-retrofit.md |
| Add MQTT data pipeline | iiot-retrofit.md — full MQTT setup | custom-diagnostic-tools.md |
| Build Grafana dashboard | iiot-retrofit.md — dashboard stack | python-diagnostics.md |
| Trend variables over time | system-variables.md — system variable monitoring | python-diagnostics.md |
| Send email/SMS alerts | alarm-logging.md — alarm notification | iiot-retrofit.md |
Scenario 7: Safety System Problems
| Symptom | Primary Document | Secondary |
|---|---|---|
| Safe IO module fault | safe-io-diagnostics.md — safe IO diagnostics | io-card-hardware.md |
| SafeLOGIC program fault | safe-io-diagnostics.md — safe program analysis | execution-model.md |
| SIL rating verification | safe-io-diagnostics.md — SIL assessment | access-recovery.md |
| Safety parameter backup | safe-io-diagnostics.md — parameter backup | retentive-data.md |
| E-stop circuit issues | io-card-hardware.md — digital input diagnostics | grounding-emc.md |
Scenario 8: Physical Layer / Signal Quality Problems
| Symptom | Primary Document | Secondary |
|---|---|---|
| Intermittent errors from EMI | grounding-emc.md — EMC troubleshooting | physical-layer-sniffing.md |
| Cable/connector problems | physical-layer-sniffing.md — wire-level diagnostics | io-card-hardware.md |
| Shield/ground problems | grounding-emc.md — grounding audit | physical-layer-sniffing.md |
| Oscilloscope signal analysis | physical-layer-sniffing.md — scope techniques | analog-calibration.md |
| Encoder signal quality | encoder-diagnostics.md — encoder signal analysis | physical-layer-sniffing.md |
| Analog signal noise | analog-calibration.md — analog signal conditioning | grounding-emc.md |
Scenario 9: Networking Problems
| Symptom | Primary Document | Secondary |
|---|---|---|
| Can’t reach PLC on network | network-architecture.md — network discovery | access-recovery.md |
| VLAN/firewall blocking PLC | network-architecture.md — network architecture | ar-rtos.md — security posture |
| POWERLINK timing violations | powerlink-internals.md — cycle timing analysis | execution-model.md |
| Modbus communication failures | modbus-gateway.md — Modbus diagnostics | serial-diagnostics.md |
| PLC-to-PLC communication issues | plc-to-plc.md — inter-PLC diagnostics | powerlink-internals.md |
| Time sync / timestamp problems | time-sync.md — NTP/SNTP configuration | diagnostics-sdm.md |
| Serial port (RS232/RS485) problems | serial-diagnostics.md — serial diagnostics | config-file-formats.md |
Scenario 10: Hardware Degradation / Aging System
| Symptom | Primary Document | Secondary |
|---|---|---|
| CPU running hot / thermal throttling | hardware-monitoring.md — temperature monitoring | cp1584-hardware-ref.md |
| Fan failure | hardware-monitoring.md — fan monitoring | cp1584-hardware-ref.md |
| Memory (RAM/CF) degradation | hardware-monitoring.md — memory health | cf-card-boot.md |
| Deciding: repair vs replace | remanufacturing.md — decision matrix | spare-parts.md |
| Direct drop-in CPU upgrade (CF-compatible) | remanufacturing.md — X20CP1585/CP1684 upgrade path | firmware-version-mgmt.md |
| Next-gen ARM migration (X20EM, multicore) | cp1584-hardware-ref.md — X20EM ARM platform | remanufacturing.md — AS 6.5 multicore |
| Spare parts identification | spare-parts.md — part number decoding | cp1584-hardware-ref.md |
| Migration to newer B&R hardware | remanufacturing.md — migration paths (includes AS 6.5 multicore + ST-OOP benefits) | project-reconstruction.md |
| Migration to non-B&R platform | remanufacturing.md — CODESYS/Siemens/Beckhoff | program-reverse-engineering.md |
| License issues | license-mgmt.md — license recovery | access-recovery.md |
Scenario 11: No OEM Support — Complete Documentation Reconstruction
| Goal | Primary Document | Secondary |
|---|---|---|
| Systematic documentation approach | documentation-reconstruction.md — methodology | cp1584-forensics.md |
| IO mapping from scratch | documentation-reconstruction.md — IO documentation | memory-map.md |
| Wiring diagram from inspection | documentation-reconstruction.md — wiring docs | physical-layer-sniffing.md |
| Program logic documentation | project-reconstruction.md — logic reconstruction | program-reverse-engineering.md |
| Maintenance manual creation | documentation-reconstruction.md — manual creation | spare-parts.md |
| Building a diagnostic workstation | diagnostic-workstation.md — workstation setup | documentation-reconstruction.md |
Scenario 12: Security Vulnerability Assessment
| Concern | Primary Document | Secondary |
|---|---|---|
| Check all known CVEs for CP1584 | ar-rtos.md §14 — complete CVE table with 50+ entries | firmware.md — AR version landscape |
| ANSL DoS (CVE-2025-11044, CVSS v4.0 8.9) | ar-rtos.md §14.9 — ANSL flooding vulnerability (race condition; shorter cycle times increase exploitability) | network-architecture.md |
| SDM data deletion (CVE-2025-3450, CVSS 7.5) | ar-rtos.md §14.22 — critical SDM vulnerability | diagnostics-sdm.md |
| SDM XSS/session takeover (SA25P003) | ar-rtos.md §14.15-14.17 — SDM web vulnerabilities | ftp-web-interface.md |
| FTP weak TLS (CVE-2024-5800) | ar-rtos.md §14.23 — weak DH groups in AR 4.x | ftp-web-interface.md |
| SSL/TLS broken crypto (CVE-2024-8603) | ar-rtos.md §14.21 — broken cryptographic algorithm | ftp-web-interface.md |
| AS certificate bypass (CVE-2025-11043) | ar-rtos.md §14.19 — AS TLS validation | access-recovery.md |
| PVI credential logging (CVE-2026-0936) | ar-rtos.md §14.18 — PVI logfile leak | pvi-api.md |
| Configure firewall rules for PLC | ar-rtos.md §14.25 — recommended firewall rules | network-architecture.md |
| CRA (Cyber Resilience Act) compliance | ar-rtos.md §14.24 — CP1584 marked CRA non-compliant | access-recovery.md |
| SA26P009/010 (XZ Utils, Linux kernel) | ar-rtos.md §14.25-14.26 — NOT affected (VxWorks-based) | remanufacturing.md |
| Network isolation strategy | network-architecture.md — VLAN design | ar-rtos.md — security posture summary |
| Full system hardening plan | cybersecurity-hardening.md — complete hardening guide | ar-rtos.md — CVE table |
| Firewall rules for CP1584 | cybersecurity-hardening.md §4 — complete firewall reference | ar-rtos.md §14.27 |
| Secure remote access setup | cybersecurity-hardening.md §7 — VPN + bastion architecture | network-architecture.md |
| Security incident response | cybersecurity-hardening.md §8 — detection and recovery | safe-io-diagnostics.md |
| OPC-UA security configuration | opcua.md — certificates, encryption, access control | access-recovery.md |
| PPT30 OPC-UA DoS (SA25P006, CVE-2025-11482) | opcua.md — concurrent connection handling limits | cybersecurity-hardening.md — firewall rules for OPC-UA |
| XZ Utils impact on B&R (SA26P009) — CP1584 NOT affected | ar-rtos.md §14.25 — confirms VxWorks-based PLCs unaffected | cybersecurity-hardening.md |
| Linux kernel vulns (SA26P010) — CP1584 NOT affected | ar-rtos.md §14.26 — confirms VxWorks-based PLCs unaffected | remanufacturing.md — Linux PCs need patching |
| AS cert validation bypass (SA25P004, Jan 2026) | cybersecurity-hardening.md §9.2 — update AS to 6.5 | firmware-version-mgmt.md — AS 6.5 details |
| ANSL flooding DoS (SA25P005, CVE-2025-11044) | cybersecurity-hardening.md §1.1 — patched in R4.93 | network-architecture.md — ANSL firewall rules |
| mapp auth bypass (SA22P014) | cybersecurity-hardening.md §9.2 — open on AR 4.x | opcua.md — restrict OPC-UA access |
| SDM multiple new CVEs (SA2025P003) | cybersecurity-hardening.md §3.3 — block SDM at firewall | diagnostics-sdm.md |
Scenario 13: Machine Just Powered On After Long Storage / Downtime
| Symptom | Primary Document | Secondary |
|---|---|---|
| Battery dead, retentive data lost | retentive-data.md — battery replacement and data recovery | cp1584-hardware-ref.md |
| CF card not detected or read errors | cf-card-boot.md — CF card diagnostics and replacement | bootloader-recovery.md |
| PLC boots to SERVICE mode after long idle | bootloader-recovery.md — SERVICE mode causes | ar-rtos.md — crash analysis |
| Network settings lost (battery died) | access-recovery.md — BOOT mode network config | network-architecture.md |
| IP address unknown, can’t connect | access-recovery.md — DIP switch default IP | cp1584-forensics.md |
| Motion axes don’t move (encoder lost) | encoder-diagnostics.md — encoder realignment | acopos-drives.md |
| Calibration drift on analog sensors | analog-calibration.md — recalibration procedures | io-card-hardware.md |
| OPC-UA certificates expired | opcua.md — certificate renewal | license-mgmt.md |
| Safety system fault after startup | safe-io-diagnostics.md — safety reset procedure | io-card-hardware.md |
| Need full backup before running machine | ftp-web-interface.md — CF card backup | cf-card-boot.md |
| Firmware version check before production | firmware-version-mgmt.md — version audit | ar-rtos.md §14 — CVE check |
External Tools Quick Reference
| Tool | Purpose | Used In |
|---|---|---|
| brwatch (github.com/hilch/brwatch) | Watch, change, log variables; set IP; reboot | pvi-api.md, access-recovery.md |
| brsnmp (github.com/hilch/brsnmp) | SNMP discovery, IP config, inventory | iiot-retrofit.md, access-recovery.md |
| systemdump.py (github.com/hilch/systemdump.py) | Create/load system dumps from CLI | ebpf-telemetry.md, diagnostics-sdm.md |
| Pvi.py (github.com/hilch/Pvi.py) | Python wrapper for B&R PVI | pvi-api.md, python-diagnostics.md |
| UaExpert (free from Unified Automation) | OPC-UA client for browsing PLC variables | opcua.md, project-reconstruction.md |
| Wireshark with POWERLINK dissector | Capture and analyze EPL traffic | powerlink-internals.md, io-sniffing.md |
| as6-migration-tools (github.com/br-automation-community) | AS4 to AS6 project migration scripts | remanufacturing.md, firmware-version-mgmt.md |
| paho.mqtt.c-ar (github.com/br-automation-community) | MQTT client library for B&R AR | iiot-retrofit.md, custom-diagnostic-tools.md |
| SystemDumpViewer | GUI viewer for SystemDump.xml files | diagnostics-sdm.md |
| systemdump.py (github.com/hilch/systemdump.py) | CLI: create, upload, delete, inventory system dumps without browser | diagnostics-sdm.md, cp1584-forensics.md |
| Automation Studio Profiler | Task timing and CPU profiling | execution-model.md, ar-rtos.md |
SDM (built-in web UI at /sdm) | Browser-based hardware diagnostics | diagnostics-sdm.md, system-variables.md |
| B&R VS Code Tools (github.com/br-automation-com/vscode-brautomationtools) | Edit, build, transfer AS projects from VS Code (AS 4.x compatible) | remanufacturing.md, custom-diagnostic-tools.md |
| Automation Studio Code (bundled with AS 6.3+) | Official B&R VS Code-based editor with AS Copilot AI (AS 6.x only) | remanufacturing.md, firmware-version-mgmt.md |
| AS Copilot (B&R, cloud service) | AI assistant for ST code generation within AS Code (free until end 2025) | remanufacturing.md |
| BR.AS.LibraryExporter.exe (bundled with AS 6.5+) | CLI tool for exporting libraries from AS projects (-P -n -o -c syntax) | remanufacturing.md |
| ST VS Code extension (Serhioromano.vscode-st) | IEC 61131-3 syntax highlighting in VS Code | remanufacturing.md |
| Loupe Package Manager (loupeteam.github.io) | CLI for managing Loupe packages in AS | remanufacturing.md |
| SafeDODiag (github.com/br-automation-community/SafeDODiag) | AS library: diagnoses why safe digital outputs are not enabled (mapp Safety, Safety Release, X20SO21x0/X20SO41x0) | safe-io-diagnostics.md |
| openSAFETYLogbrowser (github.com/banickn/openSAFETY-logbrowser) | Electron app: log browser for openSAFETY protocol | safe-io-diagnostics.md |
| acopos-cheat-sheet (github.com/hilch/bar-acopos-cheat-sheet) | Quick reference for ACOPOS servo drive parameters and commands | acopos-drives.md |
| TrakDiag (github.com/hilch/TrakDiag) | AS library: ACOPOStrak linear motor system diagnosis | acopos-drives.md |
| BrSecurity (hilch.github.io/BrSecurity) | AS library: Password, Encrypt, Decrypt functions | access-recovery.md, cybersecurity-hardening.md |
| OMJSON (github.com/loupeteam/OMJSON) | AS library: WebSocket + JSON communication from PLC | iiot-retrofit.md, custom-diagnostic-tools.md |
| OMSQL (github.com/loupeteam/OMSQL) | AS library: SQL database communication from PLC | iiot-retrofit.md |
| TCPComm / UDPComm (github.com/loupeteam) | AS libraries: Simplified wrappers for AsTCP/AsUDP | custom-diagnostic-tools.md |
| PLC-data-trace (github.com/hilch/PLC-data-trace) | AS project: Records PLC variables in high-priority task, saves to CSV | custom-diagnostic-tools.md, python-diagnostics.md |
| mappRemoteShell (github.com/br-automation-community/mappRemoteShell) | Sample project: Execute shell commands on remote PC via OPC-UA + Python | custom-diagnostic-tools.md |
| ListAllBurPLCs (github.com/Chihing/ListAllBurPLCs) | Lists all B&R PLCs on the network | network-architecture.md, access-recovery.md |
| demo-br-asyncua (github.com/hilch/demo-br-asyncua) | Python example: Access B&R PLC with asyncua (asyncio OPC-UA) | opcua.md, python-diagnostics.md |
| OpcUaSamples (github.com/br-automation-community/OpcUaSamples-sample-AS) | OPC-UA configuration and coding samples from AS4.1 to newest AS | opcua.md |
| easyuaclient-as-project (github.com/br-automation-community/easyuaclient-as-project-dev) | Easy OPC-UA client wrapper library for AS | opcua.md |
| canopen-message-interpreter (github.com/hilch/canopen-message-interpreter) | Python script: Interpret CAN traces as CANopen (CiA DS301) | if2772-canopen.md |
| Persist (github.com/loupeteam/Persist) | AS library: Store any variable type to permanent memory | retentive-data.md |
| CSVFileLib (github.com/loupeteam/CSVFileLib) | AS library: Read/write variable values to CSV files | custom-diagnostic-tools.md |
| mappPanel (github.com/br-automation-community/mappPanel) | Sample: PLC to T-Panel communication over OPC-UA | hmi-integration.md |
| B&R DevOps Package (github.com/br-automation-community/BnR-DevOps-Package) | DevOps practices for AS project development | documentation-reconstruction.md |
| BuildVersion (github.com/br-na-pm/BuildVersion) | Git commit + AS build info captured in variable declarations | documentation-reconstruction.md |
| FindUsbStickOnBAndRPlc (github.com/hilch/FindUsbStickOnBAndRPlc) | AS library: Find and use USB sticks on PLC for file I/O | custom-diagnostic-tools.md, cf-card-boot.md |
| mappCleanUp (github.com/br-automation-community/mappCleanUp) | AS sample: Delete old files from PLC directory by criteria | cf-card-boot.md |
| UserLog (github.com/tmatijevich/UserLog) | AS library: Synchronous user logbook writing | alarm-logging.md |
| LogThat (github.com/loupeteam/LogThat) | AS library: Easy diagnostic info into CPU Logger | diagnostics-sdm.md |
| MyDiag (github.com/hilch/MyDiag) | AS library: Wrapper around ArEventLog and AsArSdm for CPU logger | diagnostics-sdm.md |
The “I Just Inherited This Machine” Checklist
NEW: For a complete step-by-step first-hour playbook, see first-60-minutes.md.
For an engineer walking up to a B&R CP1584 machine with zero documentation:
- Physical: Read CPU label → cp1584-hardware-ref.md
- Network: Discover PLC on network → access-recovery.md, network-architecture.md
- Diagnostics: Open SDM in browser → diagnostics-sdm.md
- Variables: Browse via OPC-UA or PVI → opcua.md, pvi-api.md
- Config: Read CF card via FTP → ftp-web-interface.md, cf-card-boot.md
- Program: Understand running logic → project-reconstruction.md
- Safety: Assess safety system → safe-io-diagnostics.md
- Document: Build maintenance manual → documentation-reconstruction.md
- Secure: Review access controls AND check firmware version against CVE table → access-recovery.md, ar-rtos.md §14
- Monitor: Set up remote visibility → iiot-retrofit.md, python-diagnostics.md
Scenario 14: Migrating from Automation Studio 4 to AS 6
| Goal | Primary Document | Secondary |
|---|---|---|
| Analyze AS4 project for AS6 compatibility | remanufacturing.md §5 — migration analysis | firmware-version-mgmt.md |
| Run automated migration analysis | Use as6-migration-tools (github.com/br-automation-community/as6-migration-tools) — detects deprecated libs, unsupported hardware, breaking changes | remanufacturing.md §5.3 |
| Handle deprecated INA2000 in PVI code | pvi-api.md §2 — PVI 6.x drops INA2000, ANSL migration | python-diagnostics.md |
| Update OPC-UA client code for AR 6 | opcua.md — AR 6.x OPC-UA changes | remanufacturing.md |
| Hardware upgrade with AS6 support | remanufacturing.md — target CPU comparison table | cp1584-hardware-ref.md |
| CP1584 is obsolete (SN 2022/54, LTB Feb 2023) | remanufacturing.md — discontinuation notice and spare parts strategy | spare-parts.md |
| Migrate mappMotion code to mappMotion 6 | remanufacturing.md — mappMotion update helper | acopos-drives.md |
| Check mapp technology license requirements | license-mgmt.md — license checker tool | remanufacturing.md |
| AS 6.5 multicore + ST-OOP benefits | remanufacturing.md — AR 6.5 features | execution-model.md |
Document Cross-Reference Map
cp1584-hardware-ref.md ──── cp1584-forensics.md ──── cf-card-boot.md
│ │ │
├── firmware.md ────────├── config-file-formats.md ──┘
├── hardware-monitoring.md │ │
├── grounding-emc.md │ ├── bootloader-recovery.md
│ │ │
└── io-card-hardware.md ───┘ └── access-recovery.md
│
ar-rtos.md ──── execution-model.md ───── memory-map.md ────────┘
│ │
├── diagnostics-sdm.md ──── system-variables.md
│
└── ebpf-telemetry.md ────── custom-diagnostic-tools.md
│
network-architecture.md ──── powerlink-internals.md ── io-sniffing.md
│ │ │
├── plc-to-plc.md ──────────────────┘ │
│ │
├── if2772-canopen.md ────────────────────────────────┘
│
├── modbus-gateway.md
│
└── serial-diagnostics.md
pvi-api.md ──── python-diagnostics.md ─── opcua.md ── iiot-retrofit.md
│
├── ftp-web-interface.md
│
time-sync.md ──── alarm-logging.md ──────── safe-io-diagnostics.md
│
└── hmi-integration.md
cybersecurity-hardening.md ── ar-rtos.md ── network-architecture.md
│ │
├── access-recovery.md ├── firmware-version-mgmt.md
│ │
└── diagnostics-sdm.md ── ftp-web-interface.md
program-reverse-engineering.md ── project-reconstruction.md
│
acopos-drives.md ── encoder-diagnostics.md ──── analog-calibration.md
│
└── x2x-protocol.md
online-changes.md ── retentive-data.md ──── license-mgmt.md
│
└── firmware-version-mgmt.md
remanufacturing.md ── spare-parts.md ──── remanufacturing.md
│
└── cp1584-hardware-ref.md
access-recovery.md ── documentation-reconstruction.md ── diagnostic-workstation.md
Scenario 15: IO Module LED Patterns — Quick Decode
| LED Pattern | Meaning | Primary Document | Action |
|---|---|---|---|
| All modules: ‘r’ blinking continuously | X2X bus communication lost | x2x-protocol.md — X2X diagnostics | Check X2X cable, terminator, CPU RUN state |
| Single module: ‘e’ blinking, ‘r’ steady green | I/O power supply missing to that module | io-card-hardware.md — power supply diagnostics | Check PS module terminal 1-5, verify jumpers |
| Single module: ‘e’ double flash | X2X power overloaded or I/O power too low | io-card-hardware.md — LED decode | Check total station current, reduce load |
| ‘e’ steady red + green flash | Invalid firmware on module | firmware-version-mgmt.md | Update module firmware |
| PS module: ‘l’ red steady | X2X Link power supply overloaded | io-card-hardware.md — power budget | Reduce number of modules or add PS |
| PS module: ‘r’ single flash | Module in RESET mode | io-card-hardware.md | Check reset trigger, re-initialize |
| ACOPOS: Green steady | Drive running normally | acopos-drives.md — LED reference | None |
| ACOPOS: Green blink | Drive can’t enable | acopos-drives.md — enable diagnostics | Check X2.6 enable, 3-phase power |
| ACOPOS: Red steady | Active fault — note code | acopos-drives.md — fault code tables | Look up code, fix cause, reset |
| ACOPOS: Red/Green alternating | Bootloader mode | acopos-drives.md — firmware update | Do NOT power off during update |
| ACOPOS: All LEDs off | No 24V DC control power | acopos-drives.md — power diagnostics | Check 24V supply, fuse, wiring |
| CPU: R/E green steady | Application running | cp1584-hardware-ref.md — CPU LED tables | None |
| CPU: R/E red steady | BOOT or SERVICE mode | cp1584-hardware-ref.md — mode switch | Check mode switch, logbook |
| CPU: R/E red blink + RDY/F yellow blink | License violation | license-mgmt.md — license check | Check TG dongle/container |
| CPU: S/E off/off (POWERLINK) | Interface not active or misconfigured | cp1584-hardware-ref.md — PLK states | Check AS config, cable |
| CPU: S/E off, red blinking | System stop with error code | cp1584-hardware-ref.md — stop error codes | Count blink pattern (RAM or HW error) |
| CPU: DC red | Backup battery empty | retentive-data.md — battery replacement | Replace Renata CR2477N within 1 min |
Key Findings
-
This index is the fastest way to find the right document for any CP1584 problem. Organized by symptom and diagnostic scenario, it maps common problems to the specific research documents that contain the solution procedures.
-
Start with the LED and error code tables. For any hardware fault, the LED pattern on the CPU, IO modules, or ACOPOS drives points directly to the relevant diagnostic document and the likely root cause.
-
Most intermittent problems require protocol-level diagnostics. If a problem can’t be reproduced consistently, check the “Intermittent Problems” scenarios for protocol sniffing approaches that capture evidence without disturbing the running system.
-
Security scenarios are critical for network-connected CP1584 systems. With 20+ unpatchable CVEs on AR 4.x, any CP1584 on a network should be hardened according to cybersecurity-hardening.md.
-
The first-60-minutes.md playbook covers emergency response. For a machine that just went down with no documentation, start with first-60-minutes.md for the immediate recovery workflow, then use this index for deeper investigation.
Scenario 16: Engineering Workstation Security — AS and PVI Vulnerabilities
| Concern | Primary Document | Secondary |
|---|---|---|
| AS certificate bypass (CVE-2025-11043, SA25P004) | cybersecurity-hardening.md §9.4 — AS accepts invalid certs, MitM risk | access-recovery.md |
| AS SQLite critical vulns (25 CVEs, CVSS 9.8, SA25P007) | cybersecurity-hardening.md §9.4 — code execution via crafted project files | firmware-version-mgmt.md §11.2 |
| PVI credential logging (CVE-2026-0936, SA26P001) | pvi-api.md §16 — credentials in plaintext log files | cybersecurity-hardening.md §9.4 |
| Isolating the engineering workstation | cybersecurity-hardening.md §7 — VPN + bastion architecture | network-architecture.md |
| PVI log files as credential source for recovery | pvi-api.md §16.5 — search workstations for PVI logs | access-recovery.md |
Scenario 17: HMI Panel and OPC-UA Server Security
| Concern | Primary Document | Secondary |
|---|---|---|
| PPT30 OPC-UA DoS (CVE-2025-11482, CVSS v4.0 8.7, SA25P006) | opcua.md §13 — permanent OPC-UA crash via resource exhaustion | cybersecurity-hardening.md §9.2 |
| OPC-UA anonymous access left enabled | opcua.md §13 — hardening checklist | access-recovery.md |
| OPC-UA self-signed cert expired | opcua.md §6 — certificate regeneration | cybersecurity-hardening.md §5 |
| HMI panel OS version unknown | hmi-integration.md — panel identification | spare-parts.md |
| SDM web interface XSS (CVE-2025-3448, CVE-2025-11498) | diagnostics-sdm.md §15 — SDM security | cybersecurity-hardening.md §9.2 |
Last updated: July 2026 (added Scenario 17: HMI/OPC-UA security; added SA25P006 CVE-2025-11482 and SA2025P003 CVE details to cybersecurity-hardening.md and opcua.md; added CISA republication dates for ICSA-26-125-03 and ICSA-26-141-04)