2

I want to create cache file for opcua server using opcua-asyncio, I have looked at opcua-asyncio github repository , but I did not understand enough, it was mentioned that cache can be created but nobody mentioned how can be cache created. so I am wondering how can I create cache file for optimize the performance of my python file. here is the code I am using :

import asyncio

import logging import sys from asyncua.common.ua_utils import value_to_datavalue

sys.path.insert(0, "..")

from asyncua import Server

async def main(): logging.basicConfig(level=logging.INFO) server = Server()

await server.init()


server.set_endpoint("opc.tcp://localho:4140")

await server.import_xml("Opc.Ua.Di.Nodeset2.xml")
await server.import_xml("Opc.Ua.Machinery.Nodeset2.xml")
await server.import_xml("Opc.Ua.Pumps.Nodeset2.xml")
await server.import_xml("custom.Nodeset.xml")


#starting!
async with server:
    while True:
        await asyncio.sleep(1)

if name == "main":

asyncio.run(main())

Could someone please provide a solution? What is the easiest way to create a cache file?

FYI I want to run this file into raspberry pi!

I tried several ways but unfortunately, neither of them worked.

your advice and solutions would be appreciated.

Victor Pieper
  • 540
  • 2
  • 17

1 Answers1

1

I think the feature was removed because of safety concerns or just got lost in the port to asyncio. So currently this feature doesn't exist.

Schroeder
  • 749
  • 4
  • 10