if(I >= smart, great, not so good)

:slight_smile: Hey guys. I’m trying to figure out how to create an expression on an action item. Basically, I need the action item (lets call it “log trigger” to go to 1, if the tag it is pointing at (say “scale_input”) is greater than 0 for more than 5 seconds.

Any help would be great!

Well, I think I can get you half way there (actually, all the way there, unless you’re trying to do some fancy triggering…)

Take your input tag (which has to be an opc tag in this case…) and put it in your group, make it read-only if so desired, and turn on “hour meter”. This will cause its value to actually be a counter of how long it’s 1. By NOT using “retentive”, it will reset to 0 when the input goes back to 0.

Now create an action item. You just need a simple expression:

That should be it. I’d run the group at 1 second or so. The only other thing to know about hourmeters is that while the item’s internal value is the counter, the raw PLC value is what is shown in “value” column in factorysql, so don’t freak out if it doesn’t seem to be working there.

Hope that helps,