Jump to content

Convert LVOOP Class to Cluster


Recommended Posts

QUOTE (Eugen Graf @ Jan 5 2009, 05:25 PM)

Is it possible? I need it to work with other programming languages over TCP/IP. I mean C++ don't really know how a LVOOP Class is flattened (to a binary string), so I want to convert it to a binary data string (Cast).

Thank you, Eugen

You can have a Public Method to read the LVClass Data and output a cluster of your choice.

Link to comment

Everyone that's replied so far in this thread is right, but here's a little clarificaiton: you're not converting a class to a cluster, you're returning the data of an object as a cluster (it's an important distinction). Also, one of the great powers of OOP is encapsulation - you're protecting your object data from public access, and exposing all of the data of an object to the public is usually considered bad form - unless you really have a reason to do it.

Link to comment

We have been applying the convert-object-to-XML functionality quite successfully. This allows us to:

1) send LabVIEW objects over the network. (This requires that the class definitions are accessible in the applications on the communicating computers. One can accomplish this by putting the class definitions in a networked code repository, for example.) (Note that we can also use Flatten To String and Unflatten To String instead of XML just to send the object data. In either case no parser is necessary, just a type-cast! Quite clean and easy to maintain!)

2) have LabVIEW object data in a format (XML) such that we should be able to convert LabVIEW objects to and from objects in another development environment. (Note that we haven't implemented such an XML-based language converter yet, but I expect it should be fairly straightforward to do. Suggestions on this are most welcome!)

Note that there is a minor bug in 8.6 such that Enums in LabVIEW classes sometimes result in errors with the XML conversions. I reported this to NI and I'm confident that NI will fix it promptly.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.