| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import asyncio |
||
| 2 | from asyncua.client import Client |
||
| 3 | from asyncua.client.ua_file import UaFile |
||
| 4 | |||
| 5 | async def read_file(): |
||
| 6 | """ read file example """ |
||
| 7 | |||
| 8 | url = "opc.tcp://10.0.0.199:4840" |
||
| 9 | async with Client(url=url) as client: |
||
| 10 | file_node = client.get_node("ns=2;s=NameOfNode") |
||
| 11 | ua_file_client = UaFile(file_node) |
||
| 12 | contents = await ua_file_client.read_file() |
||
| 13 | print(contents) |
||
| 14 | |||
| 15 | asyncio.run(read_file()) |
||
| 16 |