Looking for a time duration of an event

I have not done a lot of work on the FSQL side of things and should know how to do this, but I find I am having trouble getting it to work, so I figured I would get some expert advise.

I have a tag, that I am alerting on in Digital mode. It is when the machine is in automatic mode. I have it set to Any Change with the Ack Mode set to Auto. I see each event in the alert log, but the Active_time, Clear_time and Ack_time are all the same. The tag value is zero when not in automatic and 65535 when it is. How do set it so the Clear or Ack times are actually set to when the even changes back to zero from 65535 or back to 65535 from Zero?

My goal is then to be able to collect minutes from Clear_time - Active_time in my SQL query.

One thing you could do would be to change it to an analog alert, with two states: one with low and high bounds set to 0, and one for 65535.

That way, there will actually be distinct active and clear states, unlike with “any change” that has no concept of clear.

Hope this helps,

Thanks Colby. That looks like it is going to work just fine.

I have done this successfully using multiple FSQL groups. I used the Hour Meter to accumulate the time in one group and then reset the discrete tag trigger using another group.

I can give further info if you wish.