| Total Complexity | 2 | 
| Total Lines | 19 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | import asyncio  | 
            ||
| 2 | from asyncua import Client  | 
            ||
| 3 | |||
| 4 | async def read_file():  | 
            ||
| 5 | """ read file examples """  | 
            ||
| 6 | |||
| 7 | url = "opc.tcp://10.0.0.199:4840"  | 
            ||
| 8 | async with Client(url=url) as client:  | 
            ||
| 9 | # option 1  | 
            ||
| 10 | contents = await client.read_file(index=2, name_of_node="NameOfNode")  | 
            ||
| 11 | print(contents)  | 
            ||
| 12 | |||
| 13 | # option 2  | 
            ||
| 14 |         node = client.get_node("ns=2;s=NameOfNode") | 
            ||
| 15 | contents = await client.read_file(node=node)  | 
            ||
| 16 | print(contents)  | 
            ||
| 17 | |||
| 18 | asyncio.run(read_file())  | 
            ||
| 19 |