Jump to content

[CR] Variant Repository


Recommended Posts

I thought it might be (I do have it installed), but it behaves much nicer than any XControl I have come across (no usual edit time strangeness I am used to with XControls), and is that not a Probe?

OK, done some digging, seems like it definitely this. Thanks James (and Ton and Brian)

Edited by Neil Pate
Link to comment

I try to never miss out on an opportunity to toot Ton's horn when it comes to that XControl.  Yes as already mentioned the Variant Repository that is available for download here is a VIPC, which contains the Variant Repository, and the Variant Probe.  I included it because I felt that XControl really is a simple way to view variant data and it's structure, which is why it was included as an example showing how Variant Repositories work.  When I give my XNode presentation, I start by explaining how they are related to XControls, and I use the Variant Probe as the example XControl.  It's a perfect XControl, it's use cases are relatively small, you don't have lots of weird user interactions to worry about, and it displays data in a way on the UI that is more clear than any other native control.

But do be aware that there is a bug with the Variant Probe, and updating it often in a loop will cause a very slow memory leak which will cause LabVIEW to take a longer than expected time to close.  I reported the bug here but no new package has been made, so I just posted an update with the fix in the package.

  • Like 1
Link to comment
6 minutes ago, Neil Pate said:

Thanks, I am now experimenting with using a variant to store quite all of my global system data, and this tree is a really neat way to show everything (for debug/dev purposes).

I would have had exactly the same bug, so I have updated my package with your fix.

Is the Variant Tree indicator available in the Dev environment?  Not sure I remember correctly, but I thought after looking into using it in a program I found the primitive only ran if it was a probe.

Link to comment

I've used the Variant Probe as a probe (in the development environment) but also used it on the front panel of a VI, and in a VI that is built into an EXE without any issues.  I used it in debugging messaging data between parallel actors in the EXE, so I could see a history of the messages that were send and received, and the data in the messages.  It wasn't used too often, but made it possible to get an understanding of what the individual actors were sending, and thereby what they were doing without a full development environment.

Link to comment
6 hours ago, bbean said:

Is the Variant Tree indicator available in the Dev environment?  Not sure I remember correctly, but I thought after looking into using it in a program I found the primitive only ran if it was a probe.

Ditto to what the others have said. I have not yet tried building my application but just dropping the XControl down on the FP works almost as expected. One minor thing which I have not investigated the reason for yet is that you cannot resize the tree column widths.

I am probably going to modify it a bit as I want to actually use it as a GUI component and I don't want it displaying the text "Attributes" and a few other things.

Link to comment
1 hour ago, Neil Pate said:

One minor thing which I have not investigated the reason for yet is that you cannot resize the tree column widths.

XControls don’t automatically save display properties of their contained controls; one has to explicitly save/load in special methods of the XControl.  A big pain, given the large number of properties.

Link to comment
  • 4 years later...

I've recently released the Variant Repository code as a package on VIPM.IO as VIMs.  Some of the magic is lost going from a series of XNodes to VIMs, and even more wind is taken out of my sail by the fact that Sets and Maps can do what VRs did in a more native way.  However I have some code I'd like to share that relies on Variant Repositories, so I cleaned it up for a release.  And replacing those functions with Sets and Maps would mean my code could only be used by 2019 and newer.  In the future when 2019 doesn't seem so new I'll probably remove the VR dependency.  Or maybe I'm being lazy I can't tell.

  • Like 1
Link to comment
  • 3 weeks later...

Cloneable VI: Should work just fine.  NI did a pretty decent job with VIMs, and has seemed to fix a few edge cases and bugs with them in recent versions.  Should work just fine.

Examples: Yeah I was lazy.  A few of the older examples were intended to show special features of XNodes.  But VIMs don't have all those special features.  So instead of re-writing examples for VIMs and putting it in the package, I just didn't include any.  I should have but wanted to get it out there and I was losing motivation.

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.