LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

polling in CVI

I am trying to understand how to poll in LabWindows? My application does not require user interface, it will be separate application. If the application had user interface I was creating a new thread and use timer control. Timer control callback would then call the funciton that needs to be polled after specified time.

Are there any samples or suggestion to poll when the application has no user interface?

*************************************************
CLD
*************************************************
0 Kudos
Message 1 of 5
(3,029 Views)

An equivalent of standard timers are asyncronous timers, which do not make use of a user interface control to work.

 

Or you could simply loop into the man and take care of time passing by either confronting Timer () value and doing someting at regular intervals or using SyncWait ().



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?
0 Kudos
Message 2 of 5
(3,023 Views)

Hi,

 

You can still have threads even if you don't have a user interface.

There is no restriction about that.

In your thread, you can create a timed loop using functions like SyncWait.

See its help before using it.

 

Second, you can also create a UIR panel and put a timer control on it.

At runtime, load the panel but dont display it.

Your time should still run.

 

Third, you can use asyncronous timer. Its an instrument installed by default.

Search for the file "asynctmr.fp" in your CVI folder and add it to your project.

Read the related help documentation.

It is a much reliable timer than UI timer control.

 

Hope this helps,

S. Eren BALCI
IMESTEK
0 Kudos
Message 3 of 5
(3,022 Views)

I think SyncWait() would work. Is it recomended to create a new thread for the function or only for syncWait() function? Are there any in built examples to consider as starting point.

TIA.

*************************************************
CLD
*************************************************
0 Kudos
Message 4 of 5
(3,006 Views)

Creating a thread is necessary only if you need to run some other operation parallel to your polling loop.

 

SyncWait function help gives enough tips on its usage.

There are also multiple examples in CVI installation about multithreading.

 

People may be of more help if you specify your application a little more.

S. Eren BALCI
IMESTEK
0 Kudos
Message 5 of 5
(2,999 Views)