Page 1 of 1

Clarification on OPC UA Read for Registered Nodes

Posted: 03 Jun 2020, 09:39
by Antoni Raj
Hi Support Team,
We are using Unified Automation UA SDK C++ Server Professional 1.6.3 in our OPC UA server. We use visual studio 2015 for our development.
We are following sample server “server_com_da_migration” for our OPC server development.
We have our own NodeManager implementation.

Below is code snippet in the executeRead() method. We want to perform OPV UA read for registered nodes using UaExpert performance view.

void OPCUAIOManagerJob::executeRead()
{

UaDataValue dataValue;
------
-----
----

dataValue.setServerTimestamp(UaDateTime::now());
m_pTransactionContext->m_pCallback->finishRead(
m_pTransactionContext->m_hTransaction,
m_pTransactionContext->m_arrCallbackHandles,
dataValue,
OpcUa_True,
OpcUa_True);

VariantClear(&pValues);

-----
-----
}

Question:
1. We understand that the executeMonitorStop() has the RemoveItems() call

hr = m_availableGroups[groupIndex].m_pGroup->RemoveItems(
count,
pServerHandles,
&pErrors);

I think we need do the same for read and write also. But the executeRead() from “server_com_da_migration” sample server does not call RemoveItems() method.
How this is handled in SDK?


Please help us on this.Thanks in advance for the help.

Thanks
Antoni

Re: Clarification on OPC UA Read for Registered Nodes

Posted: 05 Jun 2020, 16:23
by Antoni Raj
Hi Team,
Do we have any update on this?


Thanks
Antoni

Re: Clarification on OPC UA Read for Registered Nodes

Posted: 27 Jul 2020, 07:48
by Support Team
Hello Antoni,

yes you are right - for each call to AddItems there should be a corresponding call to RemoveItems. For monitoring this concept is clear.
When StartMonitoring is called --> add the item.
When StopMonitoring is called --> remove the item.

For Read and write there are 2 possible strategies:
1. Whenever Read / Write is called Add the item, execute the operation, remove the item. This is easy to implement but the overhead to add and remove will have some impact on the performance.
2. Add the Item on first access and keep it. Just execute Read / Write with the item that is already there.

The example server_com_da_migration is supposed to use approach 2 - however I must confess that the logic to reuse and delete the item is not complete here.

Re: Clarification on OPC UA Read and Write for Registered Nodes

Posted: 04 Sep 2020, 16:45
by Antoni Raj
Dear Support Team
Thank you for the reply .

Yes. Agreed . we will use option 2 to implement the OPC UA Read/write as per your suggestion . Thank you.





Thanks
Antoni