LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a timer only with code?

Good morning,

I'm student in traing periode and my tutor asked me to find a solution to his problem. He wants to create a timer only with code (without *.uir file) and without create an other thread in his application.

I've read a lot of documentation (Labwindows help, NI forum...) and I understood that there are 3 solutions to create a timer with labwindows/CVI :

1°) To put a timer on the *.uir file and write the assiciated code in a *.c file (but it's not possible for his case...)
2°) To use a multithread timer, with the use of the NewAsyncTimer function (it can correspond to his problem, but he would prefer a function which doesn't create a thread...)
3°) To use the Windows SDK Timers (but he doesn't want because the precision of these timers is not as well guaranted as the precision of the asynchronous timers...)

I say him these solutions and he seem to ben interessed by the 2nd, but he asked me to post a message to know if somebody else would have an other solution

Best regards
0 Kudos
Message 1 of 3
(3,418 Views)
int NewCtrl (int panelHandle, int controlStyle, char controlLabel[ ], int controlTop, int controlLeft);

controlStyle will be set to CTRL_TIMER.
0 Kudos
Message 2 of 3
(3,406 Views)
Hi scomak,

Thanks for your answer, I've created a timer with the NewCtrl function and I use it with the InstallCtrlCallback function and the EVENT_TIMER_TICK event and it works perfectly.

Best regards
0 Kudos
Message 3 of 3
(3,374 Views)