Paul,
I am trying to see whether I am having a particular alarm too frequently. Have I had too many of a particular alarm in the last 24 hours (or less)? If I have my quota in 5 minutes, I want to stop right there. This was my general idea: When I get one of these alarms, I want to copy the current time into the "Start time". The next time I get the same alarm, I want to subtract the "Start time" from the current time. If it is more than 24 hours, I want to copy the current time into the "Start time", set the count to 1 and allow the operator to reset the alarm. If it has been less than 24 hours, I want to add 1 to the count. If the count is less than 3, I want to let the operator reset the alarm and keep the original "Start time". If the count was 3 or more, I want to lock the operator out. I don't want to check this every scan, only when I have the alarm. The alarm could occur several times in 24 hours or not for several years. I have to be able to deal with it either way.
Widelto,
You can get the wall clock as an array of DINTs as you described, or you can get it as a single LINT containing the number of microseconds since some time in the 1970s (depending on your firmware version). If I can find a way to subtract 2 LINTs, that would be simpler than trying to deal with the different number of days in a month, leap year etc.
~Don