Opc.Ua.Server.MonitoredNode2.OnMonitoredNodeChanged C# (CSharp) Method

OnMonitoredNodeChanged() public method

Called when the state of a Node changes.
public OnMonitoredNodeChanged ( ISystemContext context, NodeState node, NodeStateChangeMasks changes ) : void
context ISystemContext The system context.
node NodeState The affected node.
changes NodeStateChangeMasks The mask indicating what changes have occurred.
return void
        public void OnMonitoredNodeChanged(ISystemContext context, NodeState node, NodeStateChangeMasks changes)
        {
            lock (NodeManager.Lock)
            {
                if (DataChangeMonitoredItems == null)
                {
                    return;
                }

                for (int ii = 0; ii < DataChangeMonitoredItems.Count; ii++)
                {
                    MonitoredItem monitoredItem = DataChangeMonitoredItems[ii];

                    if (monitoredItem.AttributeId == Attributes.Value && (changes & NodeStateChangeMasks.Value) != 0)
                    {
                        QueueValue(context, node, monitoredItem);
                        continue;
                    }

                    if (monitoredItem.AttributeId != Attributes.Value && (changes & NodeStateChangeMasks.NonValue) != 0)
                    {
                        QueueValue(context, node, monitoredItem);
                        continue;
                    }
                }
            }
        }