LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i get an alert every week at the same time

Dear All,
I want my vi to run continuously and alert me a specific day and time of the week.If i stop it and run it again i want it to alert me at the same day and time and not just one week after the start of the new run.Does anyone have any ideas?
thanks,
theo
0 Kudos
Message 1 of 10
(3,502 Views)
Hi theo,

there's a function "seconds to date/time" to convert a timestamp to a cluster containing the informations you need! Just compare those values to your alarm settings...

You should compare the values hour, min, (seconds if needed) and day of week to your alarm settings. Do this in a loop at a decent rate - once a minute should be ok when "second"-value is unimportant...


Message Edited by GerdW on 11-29-2007 11:18 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(3,499 Views)
thanks for the quick reply,
i am using the "elapsed time" function and i use the "Time Target" as a counter.how can i input the desired value from the "seconds to date/time" to the "time target"?
sorry if the question is obvious,
thanks again
0 Kudos
Message 3 of 10
(3,492 Views)
Hi,

time target awaits a number of seconds to wait for. You have two options:
1) Calculate the numebr of second to wait each time your vi starts (or after an alarm has been processed) and feed this value to your "elapsed time" function.
2) Use the attached vi to check for an alarm without using "elapsed time" Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,489 Views)

General comment regarding "Same Time Next Week".

If you are in the US make sure you check the code for proper opeartion when switching from DST and back. There are two days in the year that do NOT have 24 hours. One has 23 and the other has 25. This must be taken into acount when you are generating the next "trigger time".

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 10
(3,471 Views)

generally i do it like that so the wait is iterative.

Ben could you expand on DST. how do i know in advance in which day it occurs? this is also probably very different between countries...



Message Edited by Gabi1 on 11-29-2007 03:20 PM
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 6 of 10
(3,458 Views)
"... DST. how do i know in advance in which day it occurs? "
 
You can't!
 
As illustrated this past year, the date and time of the change is subject to the law. In the US the Congress changed the dates. (Talk about "seeking to change times and ways").
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(3,454 Views)
thanks this seems to work perfectly.
i have run your vi and works fine,
but i will give you the final feedback when i put it to my vi
in case i have any problems.
thanks again
theo
0 Kudos
Message 8 of 10
(3,452 Views)
Gabi1,

Is this just an illustration, because exitting the application would take until the timer has elapsed?
Regards,
André (CLA, CLED)
0 Kudos
Message 9 of 10
(3,420 Views)

just a very fast patch to show the idea :). you can add a stop button, and save the alarm time using a wrapper vi.

i made it this way in a temperauture PID controler using a triac, some 10 years ago. had 10ms seconds between new pules, and once in a while i was checking the status of the DAQ counter. to impose minimum constrains on it (had lots of cacls runing in the mean time, and this was on a pentium), used this tric of iterative wait, in an unrelated subvi.

 

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 10 of 10
(3,414 Views)