Calling add_object takes a long time within a for loop #1538
Unanswered
mrmouldflo
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
-
Hello,
I am trying to add an object to an existing node in a for loop. But when i time it, for each iteration of add_object, it takes around a second to execute. Is there something wrong in the way i call the API:
Sample Code:
#Add External channels
extchannels = devSet.get_child(['%s:TCD_Mouldflo_%s' % (0,nodeID),'2:DeviceZone','2:ExternalChannels'])
external_channels = ua.NodeId.from_string('ns=%d;i=5005' % idx)
for num in range(1, channeldata + 1, 1):
myobj1 = extchannels.add_object(ua.NodeId(namespaceidx=ns),'2:ExternalChannel_%s' % num,external_channels)
I want to improve the performance of add_object method.
Any suggestions would be helpful.
Kindly advice.
Thank you.
Best regards,
Murali
Beta Was this translation helpful? Give feedback.
All reactions