Comments (5)
you need to do a bit more asyncio training. you cannot use asyncio.run that way
from opcua-asyncio.
Hello, could you give me some tip?
Thank you
from opcua-asyncio.
- First dont post screenshoots, always add code as text. Also log outputs. It's hard to read and understand screenshoots.
- read about asyncio
- Here a incomplete example to use asyncio for your code:
Remove asyncio.run(create_client()) from My_OPC_UA_Client init
async def run_client():
client = My_OPC_UA_Client():
await client.create_client()
await client.get_node_ide("id")
if __name__ == "__main__":
asyncio.run(run_client())
from opcua-asyncio.
Sorry for the screenshots.
I have read about that, the option mentioned only works if i want to run the script as the initial program entry point which doesn't happen.
I think the flow of my code, finishes the first asyncio.run() (when the object is created), i.e. the first event loop is closed, and after goes to the second asyncio.run() to execute the async function "getNodeId". I am not understanding the error.
from opcua-asyncio.
you need to have only one asyncio loop for the entire session (roughly). in a big application the the loop should be running already. Sounds like you in reality want to write sync code. Use the sync wrapper then
from opcua-asyncio.
Related Issues (20)
- When copy_node is used, BrowseName is not updated
- Exception in subscription loop: struct.error: required argument is not an integer HOT 4
- Migration freeOpcua to opcua-asyncio subscribe_data_change SubHandler method not called after subscription HOT 8
- py.typed marker missing
- Disconnect sometimes HOT 1
- Statuscodes/uaerrors should be regenerated from latest schema
- VariantType and SecurityPolicyType should be IntEnum
- BadIdentityTokenInvalid when connecting to open62541 based server HOT 3
- Infinite Read Requests? HOT 10
- Issue with Migrating from opcua to asyncua.sync: AttributeError when accessing get_objects_node HOT 1
- Bulk reading node attributes causes disconnect
- Subscription tasks not closed properly on OPCUA server shutdown HOT 2
- `call_method` and `uamethod` unpack tuple type HOT 4
- How to properly handle connection issues and reconnecting? (request for comments) HOT 9
- How to use browsepath to get the value of node id. HOT 8
- Possible inconsisent handling of custom datatypes on multiple servers using load_data_type_definitions() HOT 2
- Relax some constraints on dependencies
- Is there a Client Discover Example?
- Received DataChangeNotification without Value has changed HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opcua-asyncio.