LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to use Timer-Interrupt at Labwindows/CVI. Which function should I use for it?

Solved!
Go to solution

I want to make a program which sends signal once for each 16.6ms regulary. I think I need to use timer intterupt for this.

I know that MFC or embedded system has function for it, but so I think CVI has one too, but I cannot it for CVI.

so let me know which function I should use for the timer-intterrupt, and thanks if I can see some sample source for it.

====================================================================================================

다른 PC에 데이터를 16.6ms마다 일정하게 보내기 위해서 한 루브가 돌면 while(1)으로 대기하다가 타이머인터럽트가 발생할 때마다 goto를 사용하여 루프의 초기위치로 반복되는 식의 프로그램을 만들고싶은데요. MFC같은 경우는 TimerSet기능을 사용하고 임베디드디스템으로는 하드웨어적으로 지원을 하는 것으로 알고있습니다. CVI에도 이러한 기능이 있을 것이라고 생각이 되는데 찾지를 못하겠네요. 어떠한 함수를 사용해야하는지 알고싶고 가능하다면 사용예제도 보여주세요.

====================================================================================================

0 Kudos
Message 1 of 2
(3,998 Views)
Solution
Accepted by Kaliningrad

There are a couple of alternatives to address your problem, the simplest of all being the use of a UI timer control; it is to be said, though, that achieving and maintaining such a resolution on Windows systems is not so easy, as there can be several running OS tasks that can interfere with timer pacing.

 

One possible alternative is the use of Asynchronous timers, a special instrument that creates a timer based on multimedia timers and running in its own thread; the instrument can be located in \toolslib\toolbox folder. Programming with asynchronous timers is made easier by the fact that they accept the callback of UI timers, so once you have created and tested your code using a UI timer you can then easily switch to an async timer simply discarding the timer control and creating the new timer with that callback. Async timers are quite more regular than UI timers, even though they can still be affected someway by OS activity.

 

The last, more complex alternative before using a real time OS is a regular multithreading application. There are several documents on multithreading that you can find on your disk or on this site so if you want to go that way I suggest to start reading Creating Multithreaded Applications chapter in the Programmer's Reference in the help.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(3,989 Views)