FreeOpcUa / python-opcua

LGPL Pure Python OPC-UA Client and Server
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
1.35k stars 659 forks source link

get_value method is not returning value of the node #751

Open luis-kim opened 5 years ago

luis-kim commented 5 years ago

url = "opc.tcp://192.168.0.32:4840" client = Client(url) print("Client connected") while True: AduinoSerial = client.get_node("ns=2;i=2") data = AduinoSerial.get_value() print(data)

Output received: Client connected Traceback (most recent call last): File "/home/pi/python-opcua/client.py", line 15, in data = AduinoSerial.get_value() File "/home/pi/python-opcua/opcua/common/node.py", line 149, in get_value result = self.get_data_value() File "/home/pi/python-opcua/opcua/common/node.py", line 158, in get_data_value return self.get_attribute(ua.AttributeIds.Value) File "/home/pi/python-opcua/opcua/common/node.py", line 269, in get_attribute result = self.server.read(params) File "/home/pi/python-opcua/opcua/client/ua_client.py", line 305, in read data = self._uasocket.send_request(request) AttributeError: 'NoneType' object has no attribute 'send_request'

oroulet commented 5 years ago

You did not call connect

luis-kim commented 5 years ago

Thank you for comment Can you tell me details?

How can i call connect?

2018년 11월 23일 (금) 오후 8:25, oroulet notifications@github.com님이 작성:

You did not call connect

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FreeOpcUa/python-opcua/issues/751#issuecomment-441216974, or mute the thread https://github.com/notifications/unsubscribe-auth/ArLZxEn5Omxs9otDAXMxEQpFCXHBaV7Aks5ux9sfgaJpZM4Yv_rT .

--

luis-kim commented 5 years ago

Thank you. i figure out