Skip to content

Write to user logbooks synchronously

License

Notifications You must be signed in to change notification settings

tmatijevich/UserLog

Repository files navigation

UserLog

Made for B&R GitHub License GitHub Downloads (all assets, all releases) GitHub issues

UserLog is an Automation Studio library for writing to user logbooks synchronously.
UserLog's simple one-line functions provide an essential diagnostic tool for software development.

NOTE: This is not an official library and is supported through the community. UserLog is provided as-is under the MIT License agreement. Source code, documentation, and issues are managed through GitHub.

2023-11-17_15-06-35

Features

  • 🔁 Write to logbooks synchronously
  • ✏️ Fully customizable with message, code, and runtime data parameters
  • ⚠️ Suppress messages with adjustable severity level
  • 📙 Create custom logbooks
  • 📋 Compatible with text system
Function Description
UserLogBasic Write to the User logbook synchronously
UserLogAdvanced Write to the User logbook with runtime data
UserLogCustom Write to any user logbook synchronously
UserLogEventText Write to any user logbook through binary-encoded data and event texts
UserLogCreate Create a custom logbook in an Init subroutine
UserLogSetSeverityLevel Suppress messages below the input level and return previous level
UserLogGetSeverity Get ArEventLog severity from an event ID
UserLogGetFacility Get ArEventLog facility from an event ID
UserLogGetCode Get ArEventLog code from an event ID

Install

  1. Download the binaries and extract the archive
  2. Add to the project as existing library from the toolbox in logical view

Build

  • Clone or download source files
  • Add to the project as existing library
    • Option to add as reference

Alternatively, add as submodule to an existing project repository.

cd <repository>
git submodule add https://github.com/tmatijevich/UserLog.git <project>/Logical/Libraries/UserLog

Then add to project as existing library.

Users must add the following additional build options under the UserLog object's compiler properties in the software configuration.

-D IECSTRING_HEADER_EXPLICIT -D IECSTRING_FORMAT_TYPE_EXTERNAL

Unit Tests

See the UserLogProject for unit tests of all functions.

Documentation

Once installed, the help file can be viewed using the F1 function key.

See the UserLogHelp for the documentation source code.

Dependencies

Authors