LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ciclos de tiempo cvi

hola  me gustaria saber como puedo crear ciclos de tiempo mmm por ejemplo que produzca una accion cada 15 minutos  muchas gracias de ante mano  estoy usando labwindows

0 Kudos
Message 1 of 4
(3,202 Views)

Please excuse my reply in English. 

 

CVI has a timer control you can add to your UIR (it's not visible at run time).  You can set the timer interval, and create a timer callback where you can perform the tasks you need periodically.

 

Look at the timer example that ships with CVI.

 

0 Kudos
Message 2 of 4
(3,188 Views)

if I understand but my problem is that I want these cycles emit when for instance 16:30 16:15 16:45 but the time may vary does not change what are the minutes then they are always 15 minutes of any time there is cutting cycle and if I run the program at 16:25 minutes as cutting cycle at 16
means?


Al S escribió:

Please excuse my reply in English. 

 

CVI has a timer control you can add to your UIR (it's not visible at run time).  You can set the timer interval, and create a timer callback where you can perform the tasks you need periodically.

 

Look at the timer example that ships with CVI.

 


0 Kudos
Message 3 of 4
(3,186 Views)

Marck:

 

If you want to sync your timer to the hour change, you need to know the time when the timer started, and set the first timer interval to get you onto a multiple of the interval you want to keep after that.

 

For example, if you start a 15 minute timer at 6:07 and you want to sync the timer to the hour change, your first timer interval will be 8 minutes, and then you'll change the interval to 15 minutes.  That way your timer started at 6:07 will fire at 6:15, 6:30, and 6:45, etc.

 

If you don't want your timer to sync to the hour change, just set the interval to 15 minutes.  Then your timer, started at 6:07, will fire at 6:22, 6:37, 6:52, etc.

 

I have attached a sample program that demonstrates this.  From the UIR with the program running, you can specify the timer interval and select whether or not you want to sync to the hour change.  For demonstration purposes, the timer interval is set to 2 minutes, sync'ed to the hour change.  Change the timer interval and whether or not it's sync'ed to the hour change to see its effects.

 

I did not put in any error detection for the case where you specify an interval that won't stay sync'ed to the hour change.  For example, if your interval is 15 minutes, you'll stay sync'ed with the hour change for as long as the program runs.  But if your interval is 7 minutes, you'll be sync'ed to the previous hour change, but not to the next one.

0 Kudos
Message 4 of 4
(3,174 Views)