I had the same problem. I don't use the timers because I needed complete control the processing time. This is how I set up my code to get around using the timers. I cut pieces of my code to show you so it might not be exact but it will give you the ideal.
int main (int argc, char *argv[])
{
int error;
int wasOtherInstance;
// initial program load panel ect.
MainLoop();
// cleanup code close things
return 0;
}
void MainLoop(void)
{
while (ProgramRunning)
{
ProcessSystemEvents();
// main body of code
// this runs until the exit button is pressed
// I usaully call a function here that contains the main code
Process();
}
}
int Process(void)
{
int Value;
int Start;
int IgnOk
;
CurrentTime = clock();
CurrentTime = CurrentTime / CLOCKS_PER_SEC;
return 0;
}
void CVICALLBACK MenuExitCallback(int menubar, int menuItem, void *callbackData, int panel)
{
int Value;
switch (menuItem)
{
case MENU_EXIT_QUIT :
{
ProgramRunning =0;
}
}
}