Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

× If you are developing in .NET, but are using the OPC-UA (OPC Unified Architecture), please post in the QuickOPC-UA category instead.

Can I get info reg. the subscription cycle while subscribing to OPC DA items?

More
09 Feb 2024 07:25 #12545 by support
Hello.
I am not sure if I fully understand the question. But I will try to throw in some thoughts, hopefully that would help, or lead to refining the issue.

First of all, drawing charts based on data received from OPC subscriptions can and should be done based strictly on their values and timestamps, individually for each item. No artificial grouping is necessary, and in fact, in general case I would consider it harmful, because such *is* the nature of the data received - the received values do not really "belong" together in semantical sense. The grouping made on the OPC level (by the client putting items into OPC-groups, which form basis for subscriptions; and the by the server, taking subset of these and sending them over to the client at some point) is strictly for implementation purposes, in order to make the physical transport of the data convenient and efficient. For the meaning of the data, it bears no significance how they were "bundled" for transfer.

I am not sure what you mean by "subscription cycle", but let's assume you mean the callback that the OPC server makes and which informs the OPC client about the items whose values have changed. Internally, of course, we have an information about which items have come together. But this information is not made available through API to consumers, and that is very intentional design decision - precisely because attempting it to interpret this "grouping" in any way would be wrong. The server may, for example, split the callback into two parts, because it cannot send so many items at the same time. And you would then think they came from different "cycles" in the device - but they have not.

OPC DA has no way to force the kind of subscription updates you asked for (getting all values every time). I know this is a common issue with historians and similar software, that are basically forced to draw a straight line from the last timestamp until the values changes, although the device itself might have collected new data and therefore *knows* that the data has new timestamp but same value. Unfortunately that's how OPC DA spec works. In the newer OPC UA, you can specify that you get a value through subscription, even if it was just the timestamp that has changed.

It is possible to overcome this OPC DA limitation by doing repeated OPC reads "from device" instead of subscriptions. But at the same time, the spec will tell you that it is a discouraged practice (for efficiency reasons). But that's the way it is.

Best regards

Please Log in or Create an account to join the conversation.

More
09 Feb 2024 06:29 #12544 by mut9bu
Hello

I am subscribing to multiple items with code below. When I use the item values just for showing on my apps screen there is no much problem. But in some cases I need to draw some curve with the data. As I know the OPC DA server is checking every X ms's (in my case 100ms) the value of the related item and sends the data just when it has changed. When I have multiple items then it is often the case that I get totaly different amount of items after the total subscription period (let's say 60 seconds). In this case I have to take programaticaly measures to detect when exactly , which item has not changed (by checking the timestamps)

I have following question regarding that point:

1) Is it not possible to get in the defined subsription cyle (100ms) everytime the data, whether it has changed or not. Is such a subscription possible?
2) If 1) is not possible: Is it possible to get an information of the subscription cycle? I mean when I get a lot of data from multiple items, I can pair them just reg. their timestamps. Does the OPC DA server has also an information in which subscription cycle the data was send? (let's say in the first 1.cycle,2.cyle,3.cycle....) In this case I could monitor the cycles, and when an item value is not included in that cycle, I would say, OK it has not changed.


client.SubscribeMultipleItems(
new[] {
new DAItemGroupArguments(ip, "OPC.IwSCP.1", item_array[0], 100, null),
new DAItemGroupArguments(ip, "OPC.IwSCP.1", item_array[1], 100, null),
new DAItemGroupArguments(ip, "OPC.IwSCP.1", item_array[2], 100, null),
new DAItemGroupArguments(ip, "OPC.IwSCP.1", item_array[3], 100, null)
});

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.055 seconds