
| Current Path : /proc/thread-self/root/home/ift/52_procpy/dataninja/test/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/home/ift/52_procpy/dataninja/test/opcua_server.py |
from opcua import ua, Server
import time
server = Server()
server.set_endpoint("opc.tcp://localhost:4842/tss/regler/")
tss_space = server.nodes.objects.add_object(0,"regler")
server.start()
tss_space.add_variable(0,"soll", 8.1111).set_writable()
tss_space.add_variable(0,"ist", 7 ).set_writable()
tss_space.add_variable(0,"diff", 0 ).set_writable()
tss_space.add_variable(0,"rt", 0 ).set_writable()
tss_space.add_variable(0,"spannung",0 ).set_writable()
tss_space.add_variable(0,"drehzahl",0 ).set_writable()
motoren = tss_space.add_object(0,"motoren")
motoren.add_variable(0,"a",6)
motoren.add_variable(0,"b",7)
zaehler = 33
while (0 == 0):
zaehler = zaehler + 1
root = server.get_root_node()
a = root.get_child(["0:Objects","0:regler","0:motoren","0:a"])
a.set_value(zaehler)
time.sleep(0.1)