Replies: 10 comments
-
you cannot. |
Beta Was this translation helpful? Give feedback.
-
I think there might be a misunderstanding. |
Beta Was this translation helpful? Give feedback.
-
Ok. I understand. What is the issue of having two callbacks? Usually you want to map UA methods to some internal methods which are different anyway. |
Beta Was this translation helpful? Give feedback.
-
And yes the only think getting passed to the method is the parent. No ideas why it is passed. I have never used it |
Beta Was this translation helpful? Give feedback.
-
spec. wants it... its part of "Call Service Parameters"
|
Beta Was this translation helpful? Give feedback.
-
Is it possible to access the methodId, too? That would be exactly what I'm referring to. The reason I'm asking is that I'll have about 8'000 methods, all performing similar tasks. For each object there's usually two methods that do different things, but the objects are all very similar. The callbacks in question would therefore be identical, except for the target they mutate. Ideally, it would come down to a Now, for me it's not really an issue since I'm passing my own GUIDs to the method. In my case I can just wrap the callback in a partial and pass the GUID to which I already have access. I'm just wondering what I should do if I didn't have those IDs handy already. The fact that the parent nodeId is given just confused me since either a) you're expected to pass your own parameters in a partial, anyway, and since you're creating a node you have a reference to b) wrapping in a partial is NOT the intended usage, in which case the method nodeId would need to be accessible somehow (which apparently according to the spec it should be), c) I'm misunderstanding something else, in which case it'll probably bite me later on in my own application. (Am I making sense?) As a tangent: the objectId gives me a folder node since the direct parent of the methods in question are folders. All methods are grandchildren of objects, but not (yet) linked to the object in any datatype kind of way. Maybe returning the direct parent is not sufficient. Also, if a method does not necessarily need to be descendant of an object, that objectId may possibly even be None. Regarding the |
Beta Was this translation helpful? Give feedback.
-
pew... need to read it twice🤔 |
Beta Was this translation helpful? Give feedback.
-
Okay, what I understand now is:
What I found out (please correct me if I'm wrong, my brain is melting at the moment), there is an EventType Edit: AuditUpdateMethodEventType is a subtype from AuditEventType. |
Beta Was this translation helpful? Give feedback.
-
Sorry if it's all over the place. I'll try to unmelt your brain. There was three things going on in my last comment.
1 is the main question. 2 is a consequence of the last point in 1. As oroulet states he doesn't know where the parameter comes from and AndreasHeine is equating it to the objectId parameter in the spec, I'm thinking passing the direct parent of a method regardless of its type is wrong. 3 is pretty much clear now. I can use Thank you swamper123 for your suggestion. I don't know if that would get me where I want to be, but I also don't intend to try (also I can't even begin to understand where these EventTypes even come into play :D) since I have a workaround in mind already. I can call a common python function that requires the method node ID by calling it in a function partial/lambda function that itself uses the predefined GUID I'm using to create the method. After this I'm gathering that
This basically summarizes my thoughts so far. Are my conclusions correct? |
Beta Was this translation helpful? Give feedback.
-
https://github.com/FreeOpcUa/opcua-asyncio/blob/master/asyncua/common/methods.py did not found any hint in the specs... but it should be possible to pass the methodid together with the parent on all "call_method" methods! otherwise i dont see a chance to get the methodid itself from parent because you said that all have the same parent... |
Beta Was this translation helpful? Give feedback.
-
Hello!
As the title says, I'm trying to identify where a callback came from. I see from the source code that the arguments to the callback are the PARENT and the argument values. Project guidelines dictate several methods in one folder, so all methods would return the same parent ID.
Are you supposed to use a partial/lambda and supply a flag or are there other mechanisms to get the ID of the actual method node?
Or am I just misunderstanding OPC UA methods? :)
Also, is it possible to add/override the callback after node generation? I'd use
server.add_method_callback
again, is that safe?Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions