In paintbar or scan's Advanced mode you can use a LogString function that will write out a string to a general log.
The log can be then monitored using Microsoft's DebugView utility - see https://docs.microsoft.com/en-us/sysinternals/downloads/debugview - and having DebugView filter the log by the "PAINTBAR:" or "PB=" prefix.
It is also possible to show some values on the chart using the SetLine function with text that would help your debugging.