If I correctly understood your question, you need to create a user event.
The event can be raised everywhere in your code, triggering the execution of custom code in an event structure.
Check the documentation for User Events, Event-Driven Programming and so on.
As for the pdf, you can open it for viewing with System Exec.vi, with a command line like:
...Acrobat Reader path..\Acrord32 ...file path...\filename.pdf
Hope this helps
Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021