Attaching Callback method to method node

10 views
Skip to first unread message

Mohammad Rahil

unread,
Jul 30, 2025, 6:25:09 AMJul 30
to open62541
Hi All,
Consider two scenario:
Scenario 1:
Suppose object "lock" is defined in DI namespace , in your own namespace you are creating an instance of lock for Ex Lock_A, Lock_B , Now lock object have mandatory method "init_lock", once you create an instance of lock as Lock_A , Lock_B:
   1. node for init_lock is automatically created by model compiler lets say for Lock_A its node id is 4.
    2. node for init_lock is also created for Lock_B , its node id is 5.

Now i have written a generic callback for init_lock with name as  init_lock_callback, so every time do i need to attach this callback manually with help of function "UA_Server_setMethodNodeCallback" (its not scalable) or can it be automated or achieved differently ? 
if yes then what is the correct way of implementation.

Scenario:
Suppose object "functional entity" defined in UAFX namespace, now i have optional method node as "verify". Again i created two instance of it in my name space with name FE_A and FE_B.
since it optional it nodes for verify method won't be created automatically by model compiler , in this case i need to created method node by my own.
even in above case how should i proceed with the attaching the callback method such that it should be scalable. even if there are 1000 such instance i should not be doing it manually.

Can someone please provide answer to the above two different scenario's , it would be really helpful.

Thanks,
Regards,
Rahil
Reply all
Reply to author
Forward
0 new messages