- HMI Model: 2078x
- EasyBuilder Pro Version: V6.10.01.359
We would like to set calendar reminders for our PM schedules, however, we are only finding daily or weekly options in the Scheduler or Calendar features. Any suggestions?
Thanks,
Pat
We would like to set calendar reminders for our PM schedules, however, we are only finding daily or weekly options in the Scheduler or Calendar features. Any suggestions?
Thanks,
Pat
@psimm ,
Hi Pat,
My recommendation would be to to use a periodic macro that reads the HMI’s system date (month/day) and triggers a reminder when it matches your desired PM schedule (for example, quarterly or yearly dates). This avoids the need to rely on the Scheduler and gives you more flexibility for custom intervals.
From there, the macro can pulse a bit to drive an alarm, popup, or notification on the HMI.
Here is a simple example of a macro that triggers LB-10 quarterly on: Jan 1, Apr 1, Jul 1 and Oct 1:
macro_command main()
// Quarterly trigger for LB-10 on: Jan 1, Apr 1, Jul 1, Oct 1
short year
short month
short daybool quarter_match
bool already_done
bool pulse_on
bool pulse_offGetData(year, “Local HMI”, LW, 2022, 1)
GetData(month, “Local HMI”, LW, 2021, 1)
GetData(day, “Local HMI”, LW, 9013, 1)// Use one internal lock bit so LB-10 only triggers once on the target day.
// Change LB-100 if you want a different internal flag.
GetData(already_done, “Local HMI”, LB, 100, 1)quarter_match = false
pulse_on = true
pulse_off = false// Check quarter-start dates
if day == 1 then
if month == 1 then
quarter_match = true
else if month == 4 then
quarter_match = true
else if month == 7 then
quarter_match = true
else if month == 10 then
quarter_match = true
end if
end if// Fire once on the matching day
if quarter_match == true then
if already_done == false then
// Turn ON the quarterly trigger bit
SetData(pulse_on, “Local HMI”, LB, 10, 1)// Done flag so it won’t trigger all day
SetData(pulse_on, “Local HMI”, LB, 100, 1)
end if
else
// Reset trigger bit when not on a quarter boundary
SetData(pulse_off, “Local HMI”, LB, 10, 1)// Clear done flag after the day passes
SetData(pulse_off, “Local HMI”, LB, 100, 1)
end ifend macro_command
Thank you for your assistance, Daniel. I’ll give that a try.
Pat