python-opcua
python-opcua copied to clipboard
improve export of values, support list and extension objects
I am looking at that
I don't have time to work on the exporter for a while. Too much work for my employer at the moment. If I get time I'll check for PRs before starting.
Question on ExtensionObject:
I need to access/use GetData Method and SetData Method. Just wonder how to phrase input and out arguments for particular method call. Appreciated if you could send some example code with these methods.
Another question is on Extension object. When I executed below command print(client.get_node(ua.NodeId(5069,2)).call_method(ua.NodeId(7073,2)))
It prints a Extension object ExtensionObject(TypeId:FourByteNodeId(ns=2;i=5079), Encoding:1, 160 bytes)
When I use get_value() method on above object it thrown an error. Just wonder how to access the data of 160Bytes information from above extension object.
https://github.com/FreeOpcUa/python-opcua/blob/master/examples/client_read-custom_structures.py
and please do not post the same question everywhere
I am sorry I was accidently done …thanks
From: oroulet [mailto:[email protected]] Sent: Wednesday, July 12, 2017 6:10 PM To: FreeOpcUa/python-opcua [email protected] Cc: Bachhu, Seetaiah (GE Power) [email protected]; Comment [email protected] Subject: EXT: Re: [FreeOpcUa/python-opcua] improve export of values, support list and extension objects (#292)
and please do not post the same question everywhere
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/FreeOpcUa/python-opcua/issues/292#issuecomment-314756782, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AUV78P__3PrVc7kk8NlvPGH0AZR_489Gks5sNL6bgaJpZM4JqI_B.
hi orulet,
when i used they presented way https://github.com/FreeOpcUa/python-opcua/blob/master/examples/client_read-custom_structures.py
the following error message displayed.
registring new extension object: Amps FourByteNodeId(ns=2;i=5029) <class 'structures_Elvs.Amps'>
registring new extension object: BasicMetering FourByteNodeId(ns=2;i=5086) <class 'structures_Elvs.BasicMetering'>
registring new extension object: BreakerSettings FourByteNodeId(ns=2;i=5079) <class 'structures_Elvs.BreakerSettings'>
registring new extension object: OCSettings FourByteNodeId(ns=2;i=5058) <class 'structures_Elvs.OCSettings'>
registring new extension object: PkUp_Delay FourByteNodeId(ns=2;i=5050) <class 'structures_Elvs.PkUp_Delay'>
registring new extension object: Rating FourByteNodeId(ns=2;i=5041) <class 'structures_Elvs.Rating'>
registring new extension object: RelaySettings FourByteNodeId(ns=2;i=5025) <class 'structures_Elvs.RelaySettings'>
registring new extension object: Volts FourByteNodeId(ns=2;i=5031) <class 'structures_Elvs.Volts'>
Traceback (most recent call last):
File "C:/Projects/2017/Entellisys6.0_CPU_Testing/Functions_Library/CPU_Functions/OPC_Functions.py", line 47, in
Appreciated if you could share some examples to call extension object retrieve information like body etc..from it.
Post your code and example of extensionobject (and encoding).
Here is the my code:
[cid:[email protected]] [cid:[email protected]] [cid:[email protected]] Node structure Output Argument Attributes for get Data SetData Input Argument
Above is the my server node structure pulled from UaExpert.
I need to access/use GetData Method and SetData Method. Just wonder how to phrase input and out arguments for particular method call. Appreciated if you could send some example code with these methods.
Another question is on Extension object.
When I executed below command print(client.get_node(ua.NodeId(5069,2)).call_method(ua.NodeId(7073,2)))
It prints a Extension object ExtensionObject(TypeId:FourByteNodeId(ns=2;i=5079), Encoding:1, 160 bytes)
When I use get_value() method on above object it thrown an error. Just wonder how to access the data of 160Bytes information from above extension object.
Appreciated your help
From: Andrew [mailto:[email protected]] Sent: Thursday, July 13, 2017 5:25 PM To: FreeOpcUa/python-opcua [email protected] Cc: Bachhu, Seetaiah (GE Power) [email protected]; Comment [email protected] Subject: EXT: Re: [FreeOpcUa/python-opcua] improve export of values, support list and extension objects (#292)
Post your code and example of extensionobject (and encoding).
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/FreeOpcUa/python-opcua/issues/292#issuecomment-315056403, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AUV78B1PDbsmMVrCYxmYk2IDciKYkQpzks5sNgWJgaJpZM4JqI_B.
I get this following error:
opcua.ua.uaerrors._auto.BadAttributeIdInvalid: "The attribute is not supported for the specified Node."(BadAttributeIdInvalid)
Any one knows what it says and how to fix it?
I want to read the complete structure of a node and I want to export all its node IDs and store it into a CSV file, so that it would be easy to import it in Nodered!
This is the code I used:
`import sys
sys.path.insert(0, "..")
import time
import logging
from IPython import embed
from opcua import Client
from opcua import ua
if __name__ == "__main__":
logging.basicConfig(level=logging.WARN)
client = Client("opc.tcp://192.168.64.194:4840")
try:
client.connect()
root = client.get_root_node()
objects = client.get_objects_node()
struct = client.get_node("ns=2;i=5001")
struct_array = client.get_node('"ns=3;s="Control"')
before = struct.get_value()
before_array = struct_array.get_value()
client.load_type_definitions() # scan server for custom structures and import them
after = struct.get_value()
after_array = struct_array.get_value()
embed()
finally:
client.disconnect()`