LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering the test using system time

Hi,
 
I am trying to run/ trigger a test using the computer/sytem clock. For example, I want to be able to run a test at 9:00 p.m. every night without physically being present to push the start button. Is there anyway I can do that?
 
Thank you.
0 Kudos
Message 1 of 5
(3,519 Views)
Take a look at this discussion. Native CVI timer are perhaps the easiest way to obtain this; keep in mind that the timer callback should be as simple and short as possible, so it's godd to test date and time at every execution, but perhaps your code should not go in the timer callback: you can use PostDeferredCall to queue a function to be executed after the timer callback has finished; additionally, you might consider to disable the timer while the triggered code is executed and enable it at code completion, to ensure these two functions do not interfere one to each other.


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,517 Views)
Thank you Roberto for your prompt reply. Is there anyway of running the LabWin Code using crontab?
0 Kudos
Message 3 of 5
(3,514 Views)

I'm not familiar with crontab: I looked over the internet and it seems a unix utility to run tasks at fixed hours but I don't know if crontab can launch an executable or not. If it can, it should not be difficult to insert the cvi app inside the list of crontab tasks.

A similar behaviour in windows environment could be obtained with "scheduled tasks" (look in control panel) but I don't know the time precision of this program



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 4 of 5
(3,503 Views)
Thanks a lot Roberto for your help.
0 Kudos
Message 5 of 5
(3,486 Views)