private DT_DATA _PLC; [UANode(BrowsePath = "/DATA")] public DT_DATA PLC { get { return this._PLC ?? (this._PLC = new DT_DATA()); } set { if (value == this._PLC) return; this._PLC = value; this.OnPropertyChanged(); } } private UAClientMapper _Mapper; public UAClientMapper Mapper { get { return this._Mapper ?? (this._Mapper = new UAClientMapper()); } set { if (value == this._Mapper) return; this._Mapper = value; } } public void Subscribing(bool active) { _Mapper.Subscribe(active); } public void AddToMapping() { var parse = UABrowsePath.Parse("[ObjectsFolder]/PLC_OPC_UA.DataBlocksGlobal", "http://www.siemens.com/simatic-s7-opcua"); Mapper.Map(PLC, new UAMappingContext() { EndpointDescriptor = "opc.tcp://10.10.31.228:4840", // the OPC server NodeDescriptor = new UANodeDescriptor { BrowsePath = parse }, MonitoringParameters = 100, // requested sampling interval (for subscriptions) }); Subscribing(true); var count = Mapper.SubscribedMonitoredItemCount; } [UANamespace("http://www.siemens.com/simatic-s7-opcua")] [UAType] public class DT_DATA : DisplayData { private UDT_Counters m_UDT_Counters; [UANode(BrowsePath = ".UDT_Counters")] public UDT_Counters udt_Counters { get { if (m_UDT_Counters == null) { m_UDT_Counters = new UDT_Counters(); } return m_UDT_Counters; } set { m_UDT_Counters = value; } } private ArrUDT_Counters_ARRAY m_ArrUDT_Counters; [UANode(BrowsePath = ".[nsu=http://www.siemens.com/simatic-s7-opcua;s=ArrUDT_Counters]")] public virtual ArrUDT_Counters_ARRAY ArrUDT_Counters { get { if (m_ArrUDT_Counters == null) { this.m_ArrUDT_Counters = new ArrUDT_Counters_ARRAY(); } return this.m_ArrUDT_Counters; } set { this.m_ArrUDT_Counters = value; } } [UAType()] [UANamespace("http://www.siemens.com/simatic-s7-opcua")] public class ArrUDT_Counters_ARRAY { private UDT_Counters m_Index_8; [UANode(BrowsePath = ".&8")] public virtual UDT_Counters Index_8 { get { if (m_Index_8 == null) { this.m_Index_8 = new UDT_Counters(); } return this.m_Index_8; } set { this.m_Index_8 = value; } } } } [UANamespace("http://www.siemens.com/simatic-s7-opcua")] [UAType] public class UDT_Counters : DisplayData { private Int64 _AsDWord; // Specifying BrowsePath-s here only because we have named the class members differently from OPC node names. [UANode(BrowsePath = ".AsDWord")] public Int64 AsDWord { get { if (_AsDWord == null) { _AsDWord = new Int64(); } return _AsDWord; } set { _AsDWord = value; } } private Int64 m_AsInt; [UANode(BrowsePath = ".AsInt")] public virtual Int64 AsInt { get { if (m_AsInt == null) { m_AsInt = new Int64(); } return this.m_AsInt; } set { this.m_AsInt = value; } } private string m_AsString; [UANode(BrowsePath = ".AsString")] public virtual string AsString { get { if (m_AsString == null) { m_AsString = ""; } return this.m_AsString; } set { this.m_AsString = value; } } }