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 post
Share on other sites

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 post
Share on other sites

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.

Link to post
Share on other sites
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 post
Share on other sites

The tree is just an xnode if I remember correctly. I know I pulled it out for a similar purpose and it worked fine -- one small issue i think related to empty variants, or variants of variants, something like that, but otherwise great.

Link to post
Share on other sites

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 post
Share on other sites
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 post
Share on other sites
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 post
Share on other sites
  • 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 post
Share on other sites

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.

  • Similar Content

    • By flarn2006
      LabVIEW's built-in XNode editing tools are enabled using a license file, rather than a simple INI toggle. Presumably they do this for stronger discouragement from unofficial use, as hacking one's way past that feels a lot more "shady" than just adding a line to a config file.
      But what about the Linux and Mac versions? They don't have a license manager, so how is XNode development enabled there? One might guess that those features simply aren't compiled into the released builds of those versions, but there is actually precedent to suggest otherwise. VI Scripting used to be similarly restricted using a license, but then they made it public. At the time, LabVIEW didn't have a toggle in the Options for it. But they didn't need to release a patch to add one. Instead, they simply published their formerly-internal license file, and set their activation server to accept requests to activate it. And yet, Linux/Mac users weren't out of luck: it turned out that for them, it actually was just a configuration key.
      The VI Scripting license had the internal name "LabVIEW_Scripting(_PKG)". The Linux/Mac configuration key was "Scripting_LabVIEWInternalTag".
      At 17:48 in this video, several XNode-related configuration keys are shown, likely found in strings in the EXE or resource files. One of them is called "XNodeDevelopment_LabVIEWInternalTag". Guess what the internal name of the XNode Development license is.
      I don't have the Linux/Mac version to test with, but I know a pattern when I see one. The following command was given in the readme for the VI Scripting package for Linux:
      echo -e "labview.Scripting_LabVIEWInternalTag:\tTrue" >> ~/.labviewrc Here are the Mac instructions:

      If you have either of those versions, it's probably worth a try: follow those instructions, but replace "Scripting" with "XNodeDevelopment", and see if you can open an XNode in the IDE, or create one from File->New. (Also, in the case of Mac, replace 8.6 with your actual LabVIEW version if necessary.)
      (Here's where I got my information about enabling scripting: https://forums.ni.com/t5/LabVIEW-APIs-Documents/LabVIEW-Scripting/ta-p/3535340?profile.language=en)
    • By hooovahh
      View File XNode Editor
      8 Years ago the first version of the XNode Manager was posted to the code repository in an attempt to allow the editing of XNodes.  Being a fan of XNodes, but knowing that the XNode Manager is pretty limiting because of its age, I set out to make a new version with similar functionality.
      The XNode Manager had a blank XNode, and blank Abilities that it just made copies of.  This is fine but then the abilities and XNode are quite old.  There were many new Abilities added since version 8.2 and you can't add them using the XNode Manager.  My XNode Editor reads your LabVIEW resource and populates the list of abilities to create from the ones that are possible to create.  Then VI server is used to create the XNode, State control, and Abilities.  This sets up the connector pane like it should and should work with all future versions of LabVIEW, until NI changes something that breaks it.  It also reads in the XNode Ability descriptions to help understand how to use the new ability VIs.
      In addition to being able to create and edit XNodes, you also can edit the XNode icon, and description, along with adding any new abilities.
      Be aware this uses several private functions, and several undocumented features that could be potentially bad.  I did a decent test to make sure memory leaks weren't a problem and I made several XNodes and Abilities and it seems stable.  But at the end of the day if it blows up and crashes, don't be surprised, you've been warned.  The original thread with discussion and progress on this tool was started here.

      Submitter hooovahh Submitted 03/15/2017 Category XNodes LabVIEW Version  
    • By Taylorh140
      After working on the set cluster element by name xnode, it made me realize i could use the same concept to convert a variant array to a cluster. The technique is actually pretty simple, the xnode generates a case structure for each element in a cluster in cluster order, wherein a bundle by name is used to set the value and an unbundle by name is used to get the type, a variant to data is used to convert the data. This has some benefits over some methods, you are not limited to 255 elements, although that is not usually the case some of us are paranoid that clusterosaurus giganticous will be larger than expected. It also has a draw back  that is that when converting from a variant array all the elements must have unique, non-blank names, and this is usually the case. 

      I think this technique (though very brute-force) might be useful for some other things let me know what you guys think.

      VariantArrayToCluster.zip
    • By Taylorh140
      This Xnode allows setting a cluster element by label string without using references. I pulled a great deal of inspiration from Hooovahhs Variant Array to cluster xnode, which i suppose this could be used for, another benefit is its not limited to 255 elements. Its mostly experimental because I haven't used it much. 
       
      SetClusterElement.zip

      SetClusterElementLV2013.zip
    • By UnlikelyNomad
      I've been working a lot lately with by-reference architectures that still cooperate completely with LabVIEW's implementation of OOP and polymorphism. I've also recently taken an interest in trying to speed up development with secondary providers (similar to GOOP) to enable automatic creation of accessor VIs hidden behind the DVR, automatic creation of the private data type and constructor/destructor, etc. within the project window. I'm generally not a fan of the extra stuff that goop adds in to classes, I'd prefer to keep the source code looking as close to a normal class as possible.
      That said, I've started on my first ever XNode and it's a cross between an unbundle by name node and the -> operator in C. It functions just like a normal UBN, however it was also pull items out of DVRs. Having to plop down a UBN to pull out the reference from the class, an in place node to dereference, and then another UBN to pull the data out gets tiresome after about the 100th property VI gets written.
      So far I've gotten the node drawing completed (except for data type coloring of the labels), the type inferencing from the input wire, and the popup menu for selecting an item. Next up will be the menu selection code so that the names will finally show up in the terminals! Then I get the daunting task of scripting up the GenerateCode ability >_>
      Anyone interested in something like this? Following this will be a match to the Bundle by Name node that serves the same purpose except to write the items.



×
×
  • Create New...

Important Information

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