The function() is called in one place only in the QSpice C++ module. And there is no loop inside function() so it should print info only once per call.
I wonder what could trigger this behaviour? It’s the most weird one I can’t understand and no idea how to debug. Not sure if there’s mechanism in QSpice that may cause this?
I’m guessing that you have a Trunc() function in your code. By default, Trunc() calls the evaluation function for hypothetical evaluations. Display() suppresses output during those hypothetical evaluations. printf() does not. Change printf() to Display() or remove Trunc() if not needed.
You are my savior! After commenting out Trunc() function it works immediately. I happend to find your great github QSpice repo that you mentioned the interpretation of Trunc function in the CBlock_Doc. I’ll give it a good read. Thank you sir.
If you include Trunc() and use fprintf() or printf(), here is a reference for you. Just as @RDunn replied, use Display() instead if you just need a return in the output window.