Is there a more detailed description of how OPC-UA works?

This is assuming the default configuration. My boss asked me how tags are read from our CompactLogix PLC. I wasn’t really able to provide information other than the fact that the application is configured to poll the SQLTag provider at a given rate (250ms by default IIRC).

I also know there is the ability to add scan classes, but we haven’t found the need to implement individual ones just yet. I’m more curious about how the out-of-the box communication works. Are the tags always read every 250ms? Does the OPC-UA server only read the tags when they change?

I apologize if I missed this in the documentation!

Roughly what happens is:

You have tags inside a scanclass at rate X.
For OPC-UA tags in that scanclass a subscription is made on the server at rate X.
The tags in that subscription request to be sampled at rate X.

At this point it depends what UA server, driver implementation, etc… you’re talking to. Our UA server/drivers will then poll the devices for tags at whatever rate the tags have been asked to sample at.

I am still confused about the term:

“subscribed at rate X”

Isn’t this polling?

My understanding of subscription is as follows:

A (subscribes to)-> B
whenever B changes, A is notified of this change and action is taken

So what is the rate for? For me subscription and rate are two incompatible terms. I might be misunderstanding something of course.

I would really like to understand the relation between UA Nodes, OPC Tags, Driver Tags, …

[quote=“mik977”]I am still confused about the term:

“subscribed at rate X”

Isn’t this polling?

My understanding of subscription is as follows:

A (subscribes to)-> B
whenever B changes, A is notified of this change and action is taken

So what is the rate for? For me subscription and rate are two incompatible terms. I might be misunderstanding something of course.

I would really like to understand the relation between UA Nodes, OPC Tags, Driver Tags, …[/quote]

Yes… it’s a bit misleading I guess. When you’re talking about OPC-UA there are really two rates at play:

  1. the subscription’s publishing interval
  2. the sampling interval for each monitored item

The publishing interval dictates how frequently the server sends data to the client, assuming new data to send is waiting. If there’s no new data a keep-alive is sent periodically based on some calculation using the publishing interval.

The sampling interval is the rate at which the client is requesting the server sample the underlying data source. This is polling obviously.

Ignition currently uses the rate of the scan class as the interval for both of these. I understand your assertion that a subscription and a rate are incompatible, but now you can see that it’s both limiting the rate at which new information is published (subscriptions) as well as defining the polling interval for monitored items.

Does that mean that if I have 10k OPC tags (monitorred items) in the Default scanclass, then each second 10k items will be scanned (polled) for a value change?

So, basically a 10k loop every second?

[quote=“mik977”]Does that mean that if I have 10k OPC tags (monitorred items) in the Default scanclass, then each second 10k items will be scanned (polled) for a value change?

So, basically a 10k loop every second?[/quote]

This depends on the source of the item, which is usually a driver, and yes most drivers are strictly polling based and don’t report unsolicited or by exception.

So if (for example) a driver was totally report by exception, the scanclass should be configured as subscription and the number would be ignored.

But if the driver was totally polling based and the scanclass was configured as subscription at 100ms, then the driver would be polled at 100ms and the subscription part would by ignored.

Did I get that right?

[quote=“Robert”]So if (for example) a driver was totally report by exception, the scanclass should be configured as subscription and the number would be ignored.

But if the driver was totally polling based and the scanclass was configured as subscription at 100ms, then the driver would be polled at 100ms and the subscription part would by ignored.

Did I get that right?[/quote]

In both cases the rate would be used by however SQLTags uses scan class rates, and by the UA subscription as an indication of how often to report changes (if available).

If a driver implementation was report-by-exception then it would likely ignore the requested rate. If it were polling-based it would use (best effort) that rate to sample at.