Hello,
I hoped to save some code lines by creating an object for both, read and write. I need to write but also to read the same variable(s) on the S7-300. As you said, Read and Write with the same node.
For example (My code now):
Write object:
Dim Write_Anfangswert_1: Set Write_Anfangswert_1 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAWriteArguments")
Write_Anfangswert_1.EndpointDescriptor.UrlString = server
Write_Anfangswert_1.NodeDescriptor.NodeId.ExpandedText = node_id_prefix & Schritt_x & "Anfangswert"
...
...
Read object:
Dim Read_Anfangswert_1: Set Read_Anfangswert_1 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
Read_Anfangswert_1.EndpointDescriptor.UrlString = server
Read_Anfangswert_1.NodeDescriptor.NodeId.ExpandedText = node_id_prefix & Schritt_x & "Anfangswert"
...
...
Set parameters_write(0) = Write_Anfangswert_1
Set parameters_read (0) = Read_Anfangswert_1
...
...
So I am going to change the code to this (to save code lines):
Dim Write_Anfangswert_1: Set Write_Anfangswert_1 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAWriteArguments")
Dim Read_Anfangswert_1: Set Read_Anfangswert_1 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
...
...
Set parameters_write(0) = Write_Anfangswert_1
Set parameters_read (0) = Read_Anfangswert_1
...
...
For i = 0 To UBound(parameters_write)
parameters_write(i).EndpointDescriptor.UrlString = server
parameters_write(i).NodeDescriptor.NodeId.ExpandedText = node_id_prefix & Schritt_x & "Anfangswert"
parameters_read(i).EndpointDescriptor.UrlString = server
parameters_read(i).NodeDescriptor.NodeId.ExpandedText = node_id_prefix & Schritt_x & "Anfangswert"
Next
Hope that works
best regards
Kevin