brwatch
brwatch ist a small and portable service tool for B&R automation controls (PLC). It runs on Microsoft Windows (64 bit) and enables you to list, watch and change process variables, start and stop task, search and reboot CPUs, change IP-settings. Additionaly it logs PV values to CSV- Files.
It makes heavy use of PVI (‘process visualisation interface’) package from B&R.

Disclaimer
brwatch comes „as is“, e.g. without support and warranty. You can freely copy it but use it at your own risk. brwatch is made available free of charge.
PVI
brwatch needs a previously installed PVI Development Setup to run. You need to select V6.x versions.
-
INA/ANSL
since PVI 6.x the obsolete INA2000 protocol was removed so brwatch >= 2.x is not able to handle INA anymore. If you still have CPUs requiring INA2000 (or you Windows is a 32 bit version) use brwatch versions 1.x. (INA2000 is required for Automation Runtime <= 3.x> and CPUs with serial interfaces only).
-
PVI License
Without a PVI license 1TG0500.02 (+ TG Guard e.g. 0TG1000.02) PVI will run for two hours. After this period brwatch will stop working and PVI-Manager must be stopped and restarted again. Do not blame brwatch for that and contact your local B&R office to buy a valid license.
Usage
- Download the executable or, preferably, build it yourself from source.
- see brief manual
(for brwatch V1.x see brief manual)
Development
The application is written in C++14 and uses plain Win32 API for UI. Bundled zlib sources remain C. Find compiled EXE in releases.
The application-wide CSV logger is encapsulated by Logger in
logger.h. Its static members Toggle(), IsRunning() and
DataChanged() control logging; ConfigDlgProc() is the Win32 configuration
dialog callback. Both cyclic and write-on-change logging retain shared state.
Build from Source
Prerequisites
- MSYS2 with the mingw64 (x86-64) C and C++ compilers
- PVI development headers and the 64-bit import library (
libraries/PviCom64.lib) from B&R - The matching 64-bit PVI runtime to run the application
- Resource compiler (windres)
- make utility
Setup MSYS2 mingw64
- Install MSYS2 following the official guide
- Install required packages:
pacman -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-binutils mingw-w64-x86_64-make mingw-w64-x86_64-winpthreads
For VS Code debugging, install GDB as well:
pacman -S --needed mingw-w64-x86_64-gdb
Build Instructions
Using PowerShell Script:
.\build.ps1 # Standard build
.\build.ps1 -Clean # Clean and rebuild
.\build.ps1 -Verbose # Show all compiler output
Using Makefile:
mingw32-make.exe -f Makefile SHELL=cmd clean all
Using make in the MSYS2 MinGW 64-bit shell:
cd /c/path/to/brwatch
mingw32-make.exe -f Makefile SHELL=cmd clean all
The 64-bit executable will be generated as build/brwatch.exe. Run a clean build
when switching from the previous 32-bit build to discard incompatible object files.
The VS Code debug build tasks define __DEBUG__ and enable a console. Debug
launch configurations open a separate console window (not the Debug Console).
When an Ethernet CPU search starts, debug builds print the adapter count and
each adapter’s description (name), IP address, and subnet mask before SNMP
discovery begins. Release builds omit this output and the console.
Use the clean build tasks when switching between debug and release builds.
Every build checks Git metadata and updates the About dialog’s commit hash and
the tag pointing at the current commit. Commits without a tag show untagged.
Builds without Git or repository metadata show unknown for the hash.