If you are not including a user interface, then you most likely won't be running RunUserInterface() in your code which starts event processing. In this case you need to be manually calling the function ProcessSystemEvents() over and over in a loop to be checking for events that occur.
Best Regards,
Chris Matthews
National Instruments