Alerts based on multiple inputs

Hi all: One of our processes has a number of substeps that are represented by a status bit. It can take any value between 1 and 8. When status=1, I would like to generate alerts based on another value falling below 120, for example. When status=2, I would like to generate an alert if the value is below 150, etc. Is such a thing possible? TIA D. Lewis

There actually is a way to accomplish this, more or less, using the fact that alert states can reference other items for their setpoints.

Your mileage on this may depend on the version of FSQL you’re using, but you could try the following:

  1. Add your status bit as an opc item, along with the value you’ll be alerting on.
  2. Add an action item, set to Expression, which utilizes the switch function to convert your status bit to the corresponding trigger point- so something like: switch({CurrentState},0,1,120,150)
    Remember: you can reference items and grab functions by right-clicking or hitting CTRL-Space.
  3. Create a second action item that will be the alerted item. That is, its body is simply a reference to the value to alert on. This is necessary because of how action items get evaluated. Now, set up your alert on this item, and in your trigger state, refer to the other action item (with ctrl-space) for the analog setpoint.

With the setpoint of the alert being driven by the switch based AI, alerts can be dictated by the current state.

Let me know if this isn’t clear, or if there are any questions.


Hi Colby: Thanks for the explanation. I’ll try that one soon, but first I’d like to set up the following, which I think is an analogous situation, but just to be sure:

If I have two opc items, one recording a temperature setpoint, the other the actual temperature, and I’d like an alert if the actual is the setpoint +/- 3 degrees, could it be done with a version of what you described in your comment below?

  1. set up an action item (is this a ‘calculated field’? why is it called an action item?) that is something like absolute value of the difference of ((setpoint-actual)-3). If this is greater than 0, I’d like an alert to be logged.
    2)create a second action item on value. In this case it is temperature_actual.
    3)create an alert. This triggers on ?? action item #1 or #2 above?

If the above is the correct application of your approach below, 1) what is the purpose of the second action item? 2) I don’t understand the creation of a trigger referring to one of those action items (with ctrl-space???).

Hope these questions are clear. thx. David

Hi David,

I think what you’re proposing is a simpler, but still valid, way of going about it. Essentially, I was talking about using analog alerts to create various states, and driving those states dynamically, whereas what you’re describing is the more often used technique of boiling the situation down to a digital alert.

Cleaning up what you described:

  1. Create an action item (yes, it can be considered a ‘calculated field’, but they can do more than that, so they get a special name :laughing: ), that basically returns whether or not the value is out of range:

Since action item expressions all evaluate down to a final result, this expression will return a boolean TRUE or FALSE, equivalent to 1 or 0.
2) On the same item, set up a digital alert for your out of range condition. If the value is >0, it’s out of range, otherwise it’s not.

And that’s it. No need for any other items. Obviously much simpler than the original situation, but it’s also a bit of a different problem. However, you could probably solve the other problem in a similar way as well.

Let me know if this is clear,

Thanks Colby. We’re up and running. I’ll get back later with more questions on how to use action items. Thx.