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+.