Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Meaning of MonitoredItemId
November 23, 2020
13:07, EET
Avatar
rocket science
Member
Members
Forum Posts: 77
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi all,

during analysis of an issue I found following in my logs which confused me a little bit. I wonder what is the root cause of the following difference.

I have two subscriptions (Subscription 1 and Subscription 2) with a list of monitored data items. I logged the content of the monitored data items properties after they were added to the subscription to see the MonitoredItemId and the revised sampling interval & queue size.

On Subscription 1, I can see the multiple different MonitoredDataItems have the MonitoredItemId 1 and 2

Subscription 1:
MonitoredDataItem: ClientHandle=1, MonitoredItemId=1, NodeId=ns=2;s=Trigger1, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=2, MonitoredItemId=2, NodeId=ns=2;s=Trigger2, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=3, MonitoredItemId=1, NodeId=ns=2;s=Pos1, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=4, MonitoredItemId=1, NodeId=ns=2;s=Pos2, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=5, MonitoredItemId=1, NodeId=ns=2;s=Recipe, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=6, MonitoredItemId=1, NodeId=ns=2;s=Trigger3, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=7, MonitoredItemId=2, NodeId=ns=2;s=Trigger4, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1

On Subscription 2, the MonitoredItemId counts from 1 to 8 for each new MonitoredDataItem

Subscription 2
MonitoredDataItem: ClientHandle=9, MonitoredItemId=1, NodeId=ns=2;s=TriggerA, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=10, MonitoredItemId=2, NodeId=ns=2;s=TriggerB, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=11, MonitoredItemId=3, NodeId=ns=2;s=TriggerC, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=12, MonitoredItemId=4, NodeId=ns=2;s=TriggerD, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=13, MonitoredItemId=5, NodeId=ns=2;s=TriggerE, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=14, MonitoredItemId=6, NodeId=ns=2;s=TriggerF, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=15, MonitoredItemId=7, NodeId=ns=2;s=TriggerG, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1
MonitoredDataItem: ClientHandle=16, MonitoredItemId=8, NodeId=ns=2;s=TriggerH, AttributeId=Value revised: SamplingInterval=1000.0, QueueSize=1

Any idea why I have for Subscription 1 only MonitoredItemId 1 and 2 for 7 different MonitoredDataItems ?

Thanks !

November 23, 2020
14:29, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

MonitoredItemIds are identifiers used to identify MonitoredItems when modifying or deleting them. According to the specification, MonitoredItemIds are assigned by the Server and they should be unique within a Subscription (https://reference.opcfoundation.org/v104/Core/docs/Part4/5.12.2/). If the same MonitoredItemId is used for multiple MonitoredItems in a Subscription, the Server won’t be able to modify or delete the correct MonitoredItem.

Does each of these Subscriptions use a different Server? That would explain why MonitoredItemIds are assigned differently in each Subscription, though it would also mean that the Server used by Subscription 1 is misbehaving.

You could also use Wireshark to capture traffic between the applications and look for CreateMonitoredItemRequests and CreateMonitoredItemResponses to see exactly how the Server (or Servers) assigns MonitoredItemIds. See https://www.prosysopc.com/blog/opc-ua-wireshark/ for instruction on how to capture OPC UA communication with Wireshark. If you’re running the applications on the same host, remember to select “Support loopback traffic” option when installing Wireshark.

November 23, 2020
14:44, EET
Avatar
rocket science
Member
Members
Forum Posts: 77
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi,
thanks! Both subscriptions used the same server. But I also think it was some server issue, because when the reason why I checked the logs was, that some or all of the items of Subscrition 1 did not get published on data changes. After a server restart it seemed that the MonitoredItemId are now unique again within a subscription.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1