Commit a48d76c0 authored by Ivan Tyagov's avatar Ivan Tyagov

Add skeleton for testing.

parent 55b96500
"""
OPC-UA test agent used for testing of PLC program here: https://lab.nexedi.com/nexedi/osie/tree/master/Beremiz/beremiz_test_opc_ua
XXX:
- add asserts
"""
from opcua import Client from opcua import Client
import time
client = Client("opc.tcp://k2-osie:4840/") client = Client("opc.tcp://k2-osie:4840/")
...@@ -8,9 +14,13 @@ try: ...@@ -8,9 +14,13 @@ try:
# Client has a few methods to get proxy to UA nodes that should always be in address space such as Root or Objects # Client has a few methods to get proxy to UA nodes that should always be in address space such as Root or Objects
root = client.get_root_node() root = client.get_root_node()
children_list = root.get_children() children_list = root.get_children()
for i in range (0,10):
var = client.get_node("ns=1;s=i2c0.relay0") var = client.get_node("ns=1;s=i2c0.relay0")
i2c0_relay0 = var.get_value() i2c0_relay0 = var.get_value()
print i2c0_relay0 # XXX: do asserts here
print i2c0_relay0
print "sleep"
time.sleep(5)
finally: finally:
client.disconnect() client.disconnect()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment