LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delayed SMS

Dear all, if any body can help me.
         i was looking on how to send SMS in this program  every 1 minute without  delaying the operation of the whole program
0 Kudos
Message 1 of 9
(2,889 Views)
Get time and check time past each iteration until the minute has past then take a new time a do it all over.
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 9
(2,868 Views)
Dear andre,
                   i didn't understand your idea.please show me how to do this operation.
0 Kudos
Message 3 of 9
(2,849 Views)


Message Edited by andre.buurman@carya on 06-02-2008 12:31 PM
Regards,
André (CLA, CLED)
0 Kudos
Message 4 of 9
(2,834 Views)
Dear Andre, thanks for your help.the software is working but i don't understand the theory of operation of this design.
0 Kudos
Message 5 of 9
(2,821 Views)
Hi El genn,

The idea behind the loop is to periodically check to see if the time elapsed is 60 seconds. This is achieved through the timestamps. An initial time stamp is loaded into the shift register, and then the loop runs a number of times, taking another time stamp and comparing the two each time. If the time between the two stamps is 60 seconds (thus the "60" constant, since time stamps have units of seconds) the code for your SMS is run and the current time stamp becomes the comparison stamp (since this stamp is now looked at as the beginning of another 60 second wait) by shifting it into the shift register and replacing the initial stamp. The process is then repeated until the loop is stopped. When the time between the two stamps is not 60 seconds (which happens around 6 times in a row,) the initial time stamp outside the loop (or the time stamp from the last run of the SMS code,) is retained in the shift register for the next loop comparison. The 10 second time delay ensures that the processor is freed up to run other threads.

I hope this clarifies what is happening in the above code. There are a number of ways to achieve what you want, so you are welcome to explore other solutions.
Asa Kirby
CompactRIO Product Marketing Manager
________________
Sail Fast!
0 Kudos
Message 6 of 9
(2,787 Views)
Thanks for the explaination, but the timer is a millisecond timer.Smiley Wink

This scheme doesn't make sure that it executes exactly every minute, there is always an error of about 10 milliseconds, but is steady.

Another possibility is:
Use the initial timestamp and substract it from the current timestamp and take mod 60. If that is zero you should execute your SMS code. In this case you remove the shift register for the timestamp.
Regards,
André (CLA, CLED)
0 Kudos
Message 7 of 9
(2,781 Views)

If you use an event structure, or a timed loop, you will have zero processor operation for 60 sec.

0 Kudos
Message 8 of 9
(2,760 Views)
Andre,

Yea, sorry about that. Its always a good challenge of your understanding to describe someone elses code. Smiley Sad

Don't know how I missed something as important and basic as the timer units though! Doh!

Oh well, the concept is roughly the same at any time interval. Great example by the way. (*Hats Off*)
Asa Kirby
CompactRIO Product Marketing Manager
________________
Sail Fast!
0 Kudos
Message 9 of 9
(2,748 Views)