Issue with calling OPCUA method that returns None #1547
Unanswered
wizoneyena
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there!
I'm rather new to the whole OPCUA thing and dont really know if I am the one messing things up or misunderstood the documentation.
I am trying to call an OPCUA method that takes no input arguments and returns 3 Output arguments:
One of these ByteString arguments returns None (as intended) from the OPCUA server and that is causing issues in my code.
Here is the simple implementation for calling the method:
This one runs into the following exceptions: asyncua.ua.uaerrors._base.UaError: Non array Variant of type VariantType.ByteString cannot have value None
I've done some digging and figured I would try editing the uatypes.py file where the exception originates from.
Adding
VariantType.ByteString
to line 954 in the 'if' statement completely fixes this issue and I receive my result without an issue.Since this if statement checks if my return value is None and not an array, it then checks if the VariantType is in said list, but for some reason ByteString is not one of them by default.
Any ideas how I can fix it / call the method with a different approach so I dont have to edit the lib itself?
Beta Was this translation helpful? Give feedback.
All reactions