Alert event based on comparison of times

I have a request to send an email to management any time the equipment is below a certain speed for more than 30 minutes.

A = equipment A RPM
B = equipment B RPM

If (A is less than 20) and (B is less than 20) for more than 30 minutes then send email

These are the action items setup so far
ExtA_On Expression, If({ExtA_RPM}>20,1,0)
ExtB_On Expression, If({ExtB_RPM}>20,1,0)
LineDown Expression, If(!{ExtA_ON}&!{ExtB_ON},1,0) Alert is configured to send an email

How do I handle the time of the initial event and the comparison?

FactorySQL alerting doesn’t have a “only send the notification if the alert has been active for more than…” ability.

You could try something like this:
If you can move the logic of the LineDown expression into a PLC tag, you can use an hour meter item and an action item to alert on when the hour meter item is > 30 minutes.

It might be even easier to move all of the logic into a PLC timer, and just alert off of that.

Hope this helps,


You could use action items, but it would become more convoluted. You would need a few:

  1. get the stored variable
  2. get the current time
  3. see if the current time is > 20 minutes since the stored variable (this is the group trigger)
  4. if the trigger was 0 (the group didn’t run), set the stored variable to now

Because the GetVariable function is first, you are getting the one from the last time the group ran. example: (make sure you put these groups in this order)[code]1)name: last_time

  1. name: current_time

  2. name: trigger

  3. name: store_time
    if({trigger},0,StoreVariable(“time”, {current_time}))[/code]

I have to warn you though, this way is more prone to errors. You are better off doing what Carl suggested, but if you are set on doing it in FactorySQL, this is how you would.