MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / mymain

Function mymain

examples/test_perf.py:12–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def mymain():
13
14 # setup our server
15 server = Server()
16 server.set_endpoint("opc.tcp://0.0.0.0:4840/freeopcua/server/")
17
18 # setup our own namespace, not really necessary but should as spec
19 uri = "http://examples.freeopcua.github.io"
20 idx = server.register_namespace(uri)
21
22 # get Objects node, this is where we should put our nodes
23 objects = server.get_objects_node()
24
25 # populating our address space
26 myobj = objects.add_object(idx, "MyObject")
27 myvar = myobj.add_variable(idx, "MyVariable", 6.7)
28 myvar.set_writable() # Set MyVariable to be writable by clients
29
30 # starting!
31 server.start()
32 server.stop()
33
34
35if __name__ == "__main__":

Callers

nothing calls this directly

Calls 9

set_endpointMethod · 0.95
register_namespaceMethod · 0.95
get_objects_nodeMethod · 0.95
startMethod · 0.95
stopMethod · 0.95
ServerClass · 0.90
set_writableMethod · 0.80
add_objectMethod · 0.45
add_variableMethod · 0.45

Tested by

no test coverage detected