Hello guys, im doing a code to read data from my OPC-UA server in the s7 1500.
The problems is not subscribing to a variable, the problem is subscribing to an structure of variables in the OPC-Server. The structure is similar to this:
1.-A group: Registros procesados
Inside of it we find 4 groups:
2.-Registros_ATV_izq, Registros_ATV_drch, Registros_PM1 and Registros_PM1
Then inside the ATV_izq we can find 40 variables
3.-40 variables
So to be clear, for example the structure to read the data from one variable in the Registros procesados ATV Izq is like this: "ns=3;s=""Registros_procesados"".""Registros_ATV_Izda"".""Counter encoder value"""
So now, i have done a part of code to subscribe to the group instead variable by variable cause this maybe gets some time so i have done this code but right now is not working, any help?
Dim EndPoint As UAEndpointDescriptor = "opc.tcp://10.1.0.128:4840" 'Conexión con el servidor OPC-UA
Dim Client_OPC = New EasyUAClient() 'Creación del objeto cliente y su conexión
Dim Attribute_Data As UAAttributeData
Dim Timestamp As String
Dim Node_Descriptor As UANodeDescriptor = "ns=3;s=""Registros_procesados"".""Registros_ATV_Izda"""
Dim NodeElementCollection As UANodeElementCollection
AddHandler Client_OPC.DataChangeNotification, AddressOf Client_OPC_DataChangeNotification
NodeElementCollection = Client_OPC.BrowseDataVariables(endpointDescriptor:=EndPoint, nodeDescriptor:="ns=3;s=""Registros_originales"".""valores_ATV_Izda""")
[b]Console.WriteLine(NodeElementCollection)[/b]
Dim MonitoredItemArgumentsArray() As EasyUAMonitoredItemArguments = NodeElementCollection.Select(Function(element) New EasyUAMonitoredItemArguments(Nothing, endpointDescriptor:=EndPoint, element)).ToArray()
Client_OPC.SubscribeMultipleMonitoredItems(MonitoredItemArgumentsArray)
The part in bold gave me back info about the nodes inside the group but the next part gave me error and even cant compill.
Can you help me?
Pd: also i want to ask how can i set that the publish interval is enable? i know is by defaul enable but any command to set enable or unenable?
Thanks