Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
WaitTime Timer Macro
WaitTime is a Timer Macro that waits until the specified time and/or date before proceeding. Alternatively, it can wait until a specified day of the week, or list of days, for tasks that recur on regular weekly schedules. Or you can specify only the day of the month for tasks that recur monthly, or only the time of day for those that recur daily.
Special options allow you to specify the timing of tasks that recur each hour, minute, or second. (See WaitCyclic Timer Macros for other recurring timers.)
Specified times can be local or UTC.
Note that dates are always specified in D/M/Y format, regardless of the date format chosen in the Date/Time Preferences menu. This allows macro timers to work the same way on any system, so you can exchange macro files with Daqarta users anywhere in the world.
Month and year may be omitted if the date is in the current month. Year may be omitted if the date is in the current year. If you specify a year value of 99 or less, it will have 2000 added to it.
Times are in H:M:S format and must always be preceded by '@'. 24-hour time is assumed, but you can add a 'P' after the time to specify PM. You can specify fractional seconds, but as with WaitSecs the resolution is limited by your system. (But see the comparison of WaitTime with WaitCyclic under WaitCyclic Timer Macros.)
WaitTime=15/3/2020@10:30 specifies 15 Mar 2020 at 10:30 AM local time.
Note that WaitTime will awaken your system from Standby, Sleep, or Hibernation, if needed (and if your system supports these modes). However, the wake-up process begins at the time specified in WaitTime; depending on how long your system takes to get ready, actual macro processing may not resume for a minute or more. If it is critical that your test run at a specified time, you should use back-to-back WaitTime macros, with the first one set for (say) five minutes before the actual test start time in order to insure the system is ready.
To schedule tasks that recur monthly, daily, hourly, or each minute or second, you can omit larger units of time. For example, you can omit the year and month to schedule a task that recurs each month. (You can't schedule annual tasks by omitting only the year, however.)
WaitTime=U15@1:00P specifies the 15th of the month at 1:00 PM UTC time. If that is already past for this month, the timer will wait until that time and date next month.
WaitTime=31@8:00 specifies the 31st of the month at 8:00 AM local time. If the current month has less than 31 days, this command uses the last day of the month. If the specified time is already past for this month, the timer will wait until the last day of the next month.
WaitTime=@0:10 specifies 10 minutes after midnight, local time, regardless of date. If that time is past for the current day, it will wait until the next day.
WaitTime=@H:15 specifies 15 minutes after the hour. If that time is past for the current hour, it will wait until the next hour.
WaitTime=@H:M:00 specifies the next minute.
WaitTime=@H:M:S: specifies the next second. Note that a colon is required after S, and that, unlike the next day, hour, or minute options above, no fractional seconds are allowed.
Note that you can not use M: without H:, or S: without H:M:.
WaitTime=Mo@12:00 specifies Monday at noon, local time. Days of the week are entered as:
Su = Sunday Mo = Monday Tu = Tuesday We = Wednesday Th = Thursday Fr = Friday Sa = Saturday
WaitTime=Mo/We/Fr@10:00 specifies Monday, Wednesday, or Friday at 10:00 AM local time, whichever comes next.
To use the above command to activate a recurring task, put it at the start of a master macro that performs the entire task or series of tasks. For example, suppose it is called _DoTasksMWF and performs _Task1 and _Task2:
WaitTime=Mo/We/Fr@10:00 @_Task1 @_Task2
Now invoke _DoTasksMWF in a loop, typically from the '!' auto-run macro:
5G is an easy way to enter the biggest possible value. Daqarta will limit it to 2^32 - 1 or 4294967295, which at 3 times a week will run for 27.5 million years.
You can use multiple WaitTime commands to run different tests at different times on the same day. In the above example, _Test1 will run at 10:00 AM. If you want _Test2 to run at 1:00 PM you would precede it with WaitTime=@1:00P. This will run at the next 1:00 PM after it is called, so you must make sure Test1 has completed before that time, or Test2 will run at 1:00 PM on the following day. This principle applies to all such recurring times; for example, WaitTime=@H:M:S: requires that the preceding task take well under one second.
Suppose you want _Task1 to run as above at 10:00 AM on Monday, Wednesday, and Friday, and _Task2 at 1 PM on Tuesday and Thursday. As a first attempt, you might be inclined to try:
WaitTime=Mo/We/Fr@10:00 @_Task1 WaitTime=Tu/Th@1:00P @_Task2
This will work fine until Friday; after _Task1 finishes, the next day that WaitTime=Tu/Th@1:00P will run is the following Tuesday, and by then Monday's _Task1 will have been skipped. One way to avoid this problem is:
WaitTime=Mo@10:00 @_Task1 WaitTime=Tu@1:00P @_Task2 WaitTime=We@10:00 @_Task1 WaitTime=Th@1:00P @_Task2 WaitTime=Fr@1:00P @_Task1
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2023 by Interstellar Research
All rights reserved