Alerting trouble

I am trying to setup an alert so I can query the FSQL_Alert_Status table. The device has a tag called status which is 0 when it is off and 1 when it is on. I setup an alert that has an expression command of the status tag. the alert is then setup to be digital and to alert if the value is equal to 0. When I query the FSQL_Alert_Status table the current_state_id is 1 when the status tag is 1. Why is this? shouldn’t the current_state_id be 1 when it is alerting status=0 and be 0 when not alerting status=1?



Hmm, my best guess is that it’s a problem routing it through the action item with an “unspecified” data type. Ultimately, why not just set the alert up on “MillStatus” directly?

If you intend to make it a more complex expression, try setting the data type to int or boolean. If it still doesn’t work, we can look into it a bit deeper. Given that alerts are used so much, it should be just something small that we’re missing in the setup instead of a real problem.

Regards,

Maybe I am going about this the wrong way. The FactorySQL group is setup on a trigger to only insert into the database when MillStatus is equal to 1. So if I setup the alert directly on the item it never becomes 0. This causes the alert status to always be 1. So I setup an action item to try and solve the problem. How would you go about being able to tell when the MillStatus tag is 0 and when it is 1?