Exemplo n.º 1
0
async def main():
    client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
    client.set_security_string(
        "Basic256Sha256,Sign,certificate-example.der,private-key-example.pem")
    client.session_timeout = 2000
    async with client:
        root = client.nodes.root
        objects = client.nodes.objects
        while True:
            print("childs og objects are: ", await objects.get_children())
            await asyncio.sleep(1)
Exemplo n.º 2
0
def FINISH_test_connect_basic256(self):
    c = Client(URL)
    c.set_security_string("basic256,sign,XXXX")
    c.connect()
    c.disconnect()
Exemplo n.º 3
0
import sys

sys.path.insert(0, "..")
import logging

from IPython import embed

from asyncua import Client

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
    client.set_security_string(
        "Basic256Sha256,Sign,certificate-example.der,private-key-example.pem")
    try:
        client.connect()
        root = client.nodes.root
        objects = client.nodes.objects
        print("childs og objects are: ", objects.get_children())

        embed()
    finally:
        client.disconnect()