Passed
Pull Request — master (#372)
by
unknown
02:19
created

client-file.read_file()   A

Complexity

Conditions 2

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 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