Weird behavior of multiple monitored items in a subscription|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Weird behavior of multiple monitored items in a subscription
Avatar
Pham Ngoc Song Ha
Member
Members
Forum Posts: 21
Member Since:
11/15/2021
sp_UserOfflineSmall Offline
1
11/15/2021 - 03:56
sp_Permalink sp_Print

Hi,

I let one subscription monitor 5 integer variables (A, B, C, D and E) in a Siemens PLC. At the beginning, they are all 0. When A changes to 1, the notification data I receive should be for the A. The notifications for B, C, D and E contain theoretically only live signals. But in some sessions I get data for all of the monitored items and they are the same (1 for all A, B, C, D and E). This issue happens quite random and it is hard for me to reproduce it. Does anyone face the same problem like me? I am glad that you can help.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
11/15/2021 - 04:21
sp_Permalink sp_Print sp_EditHistory

Can you use wire shark to determine if the server is sending all 5 values (with 4 incorrect ones)?

The reason I ask is it could be a glitch in the client library rather than the server.

Avatar
Pham Ngoc Song Ha
Member
Members
Forum Posts: 21
Member Since:
11/15/2021
sp_UserOfflineSmall Offline
3
11/15/2021 - 10:14
sp_Permalink sp_Print

Thank for your response,

the problem is very hard to reproduce because it is quite random. But I have figured out the circumstance that can let it happen. When the initial value of one monitored item is 1 (the rest is 0), the notification data might also be 1 for some of other items in the same subscription. I have tried to used sniffer to view the packets. But the strings are incomprehensible for me, I cannot conclude if the glitch is from the client library or from the SPS.

I am looking forward to hearing from you.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
11/15/2021 - 21:29
sp_Permalink sp_Print

Wireshark has a OpcUa plug in that can decode the OpcUa messages.

You should be able clear the see the publish response message.

If you are absolute sure the other values are not changing then this is a s/w bug.

Avatar
Pham Ngoc Song Ha
Member
Members
Forum Posts: 21
Member Since:
11/15/2021
sp_UserOfflineSmall Offline
5
11/16/2021 - 02:53
sp_Permalink sp_Print sp_EditHistory

Hi,

yes, you are right. That was software glitch and after many experiments I have figured it out. When the publish response is an array for 2 or 3 monitored items, the event handler gives for each of them the same array as EventArgs but the caller is different. Since my software use properties monitoredItem.displayname of caller to detect the items, it loops the values of the array to the variable in PC each time and at the result every variable has the same number.

So from there, I am looking the way to set the notification value only for 1 monitored item each time. Is there any command for that?

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
6
11/17/2021 - 04:48
sp_Permalink sp_Print

Limiting the items per response is hack that impacts performance.

Can't you fix the logic in your client?

Avatar
Pham Ngoc Song Ha
Member
Members
Forum Posts: 21
Member Since:
11/15/2021
sp_UserOfflineSmall Offline
7
11/17/2021 - 07:24
sp_Permalink sp_Print

Thank for your advice, I will try to fix the logic in my client.
I did find the property subscription.maxNotificationsPerPublish and set it to 1. Do you think this will impact the performance badly?

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
8
11/17/2021 - 10:39
sp_Permalink sp_Print

I did find the property subscription.maxNotificationsPerPublish and set it to 1. Do you think this will impact the performance badly?

Yes. It means you are using an entire publish request for a single value. If 10 values change you need to do 10 round trips to get them all. Not a good idea.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 31
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855