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 _UDT_Counters_8; [UANode(BrowsePath = ".ArrUDT_Counters.8")] public UDT_Counters UDT_Counters_8 { get { if (UDT_Counters_8 == null) { _UDT_Counters_8 = new UDT_Counters(); } return _UDT_Counters_8; } set { _UDT_Counters_8 = value; this.OnPropertyChanged(); } } } [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; } } }