On demand tag reading

I know there is such a thing as a leased scanclass, and that seems to work if you have direct tag bindings on objects on a window. But I don’t have that. I have thousands of tags I need to scan, but don’t want them to be scanning when nobody’s looking at the drilldown screen that these tags populate.

So now it sounds like a driven scanclass right? Well no, I can’t do that because the clients are on the corporate side of a DMZ architecture, all read-only, so they can only write to local-scoped client tags. But a client tag is out of scope on the gateway server to therefore cannot be used as a driven scan class’s trigger. Anyone have a suggestion how I can have these thousands of tags update only on demand from a read-only client?

Could you use a shared script which can be called from a client to toggle a memory tag that is used as the driven class’s trigger?

I tried that, but it fails to write to the server-side memory tag. I’m sure it’s because the client is connecting to a gateway that is a read-only gateway… nothing that authenticates from that side is able to write to any gateway-scoped tag. Not even a script fired from something.

From the gateway, I can’t see any client tag values from attached clients… at least there’s no way I’m aware of.

Wouldn’t a script calling a system.tag.readAll([TagList]) do it?

No because that only reads the current values held for those tags in the gateway, it doesn’t cause an update of the tag from the underlying device. I’m looking to cause the thousands of tags to not scan, or scan at a ridiculously slow rate. Unless someone is viewing a drilldown screen that requires that information, then I want the subscriptions to occur at a faster rate (once per 5s or similar).

On a test server, I accomplished this using a driven scanclass with a trigger tag and it worked, because my test server isn’t a readonly solution and therefore I was able to write to a tag used as the trigger.

Have you tried system.tag.scan().

I haven’t tried this one but when I look at it, it looks like it should do what you need.

I think system.tag.scan() would have the same problem as system.tag.readAll unless the scan class was in OPC Read Mode.

I didn’t notice system.tag.scan() – that should do the trick as long as it can execute from the client. However, if a client initiates that, then if five or six people are all opening the same drilldown, the PLC isn’t going to like all the forced reads of those thousands of tags so many times consecutively. Hrm. Thanks – I’ll look into this option!!

Could you use the driven scanclass with a gateway message handler script setting the driving tag and then have clients send messages to gateway? Or would that hit the same wall?

If the above works, I imagine setting it up with a timeout that clears the driving tag if a message asking for it hasn’t been received in a while.