Jump to content

LabVIEW Python node - share non-serializable object


Recommended Posts

I'm using LabVIEW python nodes to call a python script, which creates an instance of OPC Server class. 

def initServer(url):
    server = Server()
    server.set_endpoint(url) 
    ...

The Server object cannot be serialized to JSON as well as cannot be pickled (TypeError: cannot pickle '_thread.RLock' object), so I can hardly see the way how to transfer Server object to LabVIEW.

In that case I managed to store Server as a global variable in python script. This solutions works - I can call functions (ex. start/stop running) that simply use a global Server object.

However, this solution is not secure - because if I lost the python session (due to the LabVIEW issue), I have no access to my Server. That leads to the question:

Is there any more secure way to handle that?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.