17 lines
436 B
Python
17 lines
436 B
Python
import asyncio
|
|
from asyncua import Client
|
|
|
|
|
|
|
|
async def test():
|
|
client = Client(url='opc.tcp://192.168.254.5:4863', timeout=10.0)
|
|
# await client.set_security_string('')
|
|
async with client:
|
|
node = client.get_node('ns=1;s=A201CD124/MOT_01.AV_Out#Value')
|
|
value = await node.read_value()
|
|
displayName = (await node.read_display_name()).Text
|
|
print(f"{displayName=} = {value=}")
|
|
|
|
asyncio.run(test())
|
|
|