B&R UserLog: Configuring Application Event Logging

Jason IP2 min read
B&R AutomationBest PracticesOther Topic
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

What UserLog Adds to B&R Applications

UserLog provides programmers with a written narrative of application execution when HMI alarms and diagnostic screens do not expose enough code-level context. It bundles ArEventLog function blocks into single-call functions and records application events alongside B&R product events in the Automation Studio logger.

Capability Engineering use
Single-call logging functions Reduce repeated ArEventLog function-block handling.
Calls inside FOR loops and nested conditions Record decisions at the point where the application makes them.
Inline formatting for multiple data types Include relevant runtime values in the event narrative.
Logging verbosity control Adjust event detail to suit commissioning or normal operation.
Built-in User logbook Keep user-generated events available through the supplied logbook.

Instrument the Execution Path

  1. Identify branches, loops, and state transitions that an HMI alarm cannot explain.
  2. Place UserLog calls directly in the relevant FOR loops or nested conditional statements.
  3. Format runtime values into each message when they are necessary to explain the decision.
  4. Set logging verbosity to retain useful detail without recording unnecessary messages.
  5. Run the application and confirm that its events appear with B&R product events in the Automation Studio logger and in the User logbook.

Write Messages That Support Diagnosis

Each message should state what the application decided and include the value that caused the decision when inline formatting supports that data type. Place the call at the decision point so the event order reflects actual execution rather than an HMI interpretation of the result.

Use verbosity as an operating control: retain detailed narratives while commissioning or isolating a fault, then reduce detail after verification. The evidence does not define specific verbosity levels or configuration identifiers, so select and validate them from the library documentation rather than assuming names or numeric settings.

Review Support and License Constraints

UserLog is not an official B&R library. Its source code, documentation, and issue handling are maintained through GitHub, so assess that support model before using it in a production control system.

The supplied evidence reports a GPL3 license and raises compatibility concerns for closed-source applications, but it does not establish the obligations for a specific project. Before linking or distributing the library, verify the actual license in the downloaded package and obtain a qualified license review. Do not assume that an MIT-licensed edition exists merely because MIT was suggested as a more permissive alternative.

FAQ

What does the B&R UserLog library record?

It records a programmer-defined narrative of application execution and places those events alongside B&R product events in the Automation Studio logger.

Can UserLog calls be used inside FOR loops and nested conditions?

Yes. The library is explicitly described as supporting direct calls inside FOR loops and nested conditional statements.

Is UserLog an official B&R library?

No. Verify its GitHub-hosted source, documentation, support path, and reported GPL3 license before adopting it in a production or closed-source project.

Back to blog