Total Complexity | 2 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import asyncio |
||
2 | import logging |
||
3 | import sys |
||
4 | sys.path.insert(0, "..") |
||
5 | from IPython import embed |
||
6 | |||
7 | |||
8 | |||
9 | from asyncua import ua, uamethod, Server |
||
10 | |||
11 | |||
12 | |||
13 | async def main(): |
||
14 | logging.basicConfig(level=logging.INFO) |
||
15 | server = Server() |
||
16 | await server.init() |
||
17 | # import some nodes from xml |
||
18 | await server.import_xml("../schemas/UA-Nodeset/DI/Opc.Ua.Di.NodeSet2.xml") |
||
19 | await server.import_xml("../schemas/UA-Nodeset/Robotics/Opc.Ua.Robotics.NodeSet2.xml") |
||
20 | |||
21 | # starting! |
||
22 | async with server: |
||
23 | embed() |
||
24 | |||
25 | |||
26 | if __name__ == "__main__": |
||
27 | asyncio.run(main()) |
||
28 |