Replies: 3 comments 6 replies
-
this is more difficult then it sounds... from spec. a opc ua server can change its model while runtime! |
Beta Was this translation helpful? Give feedback.
-
We could expaned the load_data_type_definitions or a extended function to return all source code generated for exec. You could save that code and we could make a function like restore_data_type_definitions, that runs that code again. |
Beta Was this translation helpful? Give feedback.
-
In fact, exporting as code was a feature earlier, but removed during some refactoring |
Beta Was this translation helpful? Give feedback.
-
Following this example, from a client I need to be able to use custom data structures defined in the remote server. Loading these definitions is a slow process (approx. 10 seconds for a relatively small amount of custom types) so I was looking at a way of making this process faster.
Ideally the first time connecting to a known server I could save the custom data structures to a local file, and the next connections could directly load the local file without having to request the information from the server. I've attempted to persist the dictionary of objects returned by
load_data_type_definitions()
to a local binary file using thepickle
ordill
module, but since the python classes for the custom structs are loaded on the fly, it doesn't play well with the serialization.Is there an easier way to do this? I had a look at the xmlexporter/ xmlimporter modules, but if I'm not mistaken they are geared towards setting up the objects on a server instance (either directly or through a client connected to it).
Beta Was this translation helpful? Give feedback.
All reactions