13:07, EET
March 16, 2017
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 !
14:29, EET
Moderators
February 11, 2020
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.
14:44, EET
March 16, 2017
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.
Most Users Ever Online: 1919
Currently Online:
22 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 735
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1