execute code every set time 
Author Message
 execute code every set time

I know this is a fairly basic topic that has been discussed here
before and I appologize for that in advance.  I need to a chunk of
code to begin execution every set time interval regardless of how long
the code takes to execute.  I understand the wait function inserts
some amount of time BETWEEN the executions (ie from the the end of one
iteration to the beginning of the next) and the wait for next
millisecond multiple is like starting at the top of every hour on the
hour (or however long) regardless of how long the execution takes on
any given iteration.  This is what I need since my code execution time
varies greatly from one iteration to the next but I need it to begin
execution every minute regardless of whether it took the whole minute
the last time or only a few seconds.  The problem is that I want it to
begin the first execution at the time I hit the button and go minutely
from there and not wait for the top of the next minute like I
understand the wait for next millisecond multiple function would.
  What then, is the best way to do this.  I could use the timer
funtion and time how long the code takes to execute, then subtract
that from the time I want between executions and then "wait" the
remaining time.  Is there a better way to do what I want than this?

Thanks.



Wed, 13 Apr 2005 00:53:16 GMT  
 execute code every set time
It should work. I just never use sequences.


Wed, 13 Apr 2005 03:24:36 GMT  
 execute code every set time

Quote:
>   What then, is the best way to do this.  I could use the timer
> funtion and time how long the code takes to execute, then subtract
> that from the time I want between executions and then "wait" the
> remaining time.  Is there a better way to do what I want than this?

Do what you describe.  You have a particular time, when the button was
pressed, that you want to make all delay delta relative to.  Since you
can measure what that is, and the other LV primitives don't know what it
is, just make it as you describe.

Greg McKaskle



Wed, 13 Apr 2005 09:34:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Execute code after every tcl command?

2. Executing Fortran Code One Line at a Time

3. dynamic memory allocated fortran code takes more time to execute

4. every so-many seconds execute?

5. Executing Instruction once every second

6. Strange link error every 2. time

7. Processing every time a record is read.

8. GPF in Clarion every time i do this

9. Clarion Rewrites CLW file Every time I load it

10. How do I acquire 1 image every time an external trigger fires

11. VI that gets bigger every time it runs

12. random_seed() gives same seed every time

 

 
Powered by phpBB® Forum Software