Email: Contact me in PM, if needed
I'm living in Hungary, and there are no user groups here, so I choose this one:
Location: | National Instruments 11500 N. Mopac Expwy Austin, TX 78759 |
Contact: | Travis Ferguson 512.683.5701 |
Meeting Details: | Quarterly meetings, Public, usually on Wed./Thurs., 11:30 - 1:00 |
User Group Website: | http://decibel.ni.com/content/groups/austin-labview-user-community |
I found an lvlib in the LV install folder, specifically <vi.lib>\UserTags\UserTags.lvlib. I never have seen it on any of the LV palettes, and after googling a bit, I came up with nothing. It seemed to be of interest to me, so I started to use it.
With the help of these tools, it is possible to add any custom user data (tags), which is stored in a key-value form to any VIs or objects within them (controls and indicators).
The tags can be added during runtime, but after saving the modified VI, they are saved to disk, so you can add them permanently.
This way it is possible to store data which are specific to individual objects, or related to the VI in question. Using this method the use of hidden controls and indicators (with which I think everybody is familiar) may be avoided.
One can use this method as a sort of IPC (Inter-Process Communication).
It is also possible to use this in place of data passing through control value set methods.
Suitable for metadata storage in VIs, and a new possible IPC method.
For the 1st example:
Open and run Read_tag_from_VI_on_disk.vi
For 2nd example:
For more detailed description, please see the video below:
Main Front Panels (IPC demonstration, that's why there are 2 VIs):
Main Block Diagram (of the data provider):
Add (or set) User tag to VI and save it:
Read User tag from VI:
Edit: I added a project (UserTags_v9.zip) that is saved to LV 2009.
Nice code! What would be the benefit of using this instead of an ini file? Do you see any downside to using this method of retaining values?
Thanks. It's easier to use than .ini files. There are no sections here. You can add tags to specific elements (not only to VIs) and they can be permanently stored inside the VI file, so they remain hidden from the user.
This means they can't change the "settings" you want to set.
You can also use this method during runtime only, so your tags do not have to be made permanent. This way you can pass different metadata eg. to each instance of a reentrant VI.
You have locked/password protected VIs in your submission. I won't run the code with private VIs.
~Jon
Jon,
Which VIs are locked?
Peter,
Can you please unlock all VIs that you submit so that the community can learn from your approach overall and there are no black boxes. Thanks!
Ack, That is my error. The VI tags is included with LV2010. It is not original code, it is provided by NI.
~Jon
Grant, the VIs I made are not locked nor password protected.
Jon, it is written in the summary, that the user tag VIs are from NI. I just found them and made examples to show how to use them, so I cannot give the password, however I'm pretty sure thye use some dll or something similar - I mean something you cannot duplicate in LV. They are placed in LV's install dir at vi.lib\UserTags\UserTags.lvlib. The project only references this library, it is not even part of the zip file.
I made the VIs in LV2010, however I looked at LV2009, and UserTag is included in that version too. I don't have any earlier versions installed currently, so I can't tell if this is available in earlier versions as well.
P.S. Or did you try to use the code via the VI snippets? I'm not sure if that will work, as the User Tag VIs might not be recognized, because they are not in-built LV functions.
Tags have been around for a long time (since at least 7.0 and probably earlier), but the functionality has been marked as private. In 8.6 NI added these VIs, which hide the private functionality, so this will work on any installation of LV and as long as you don't want to save the VIs, will work in built executables as well.
You can see more about this here - http://forums.ni.com/t5/LabVIEW/Darren-s-Weekly-Nugget-04-13-2009/m-p/888538#M401396
Hi!
I did not know about this functionality earlier, but as I wrote in the document, I googled for it. It did not gave any useable results.
I looked at the post you referenced now, and followed the discussion to your demo code, which is on resizing controls.
Your code is however a lot different, as it uses scripting. It is not using the library from vi.lib. It does not even document this functionality as that was not your goal with the demo, I think.
Even though I don't think it is a very popular or well known functionality, as there were some interest here in it as I see, and it was even posted on VIShots's twitter.
My goal was to show this functionality to the public, for people to know about it, and show it's usage, which I think I have accomplished.
Of course if the NI representatives think this code is not original or does not suit with the challenge's regulation, I accept their decision.
I wasn't saying that there's any problem with your code, because there isn't - it's fine and perfectly acceptable as an entry. I was just pointing out more details on those VIs.
Hi!
That's a really interesting functionality! Code looks really nice and commented too.
I'm sure I will find some use of it in upcoming projects.
Thanks,
Monica
Sorry, I thought you tried to say, that this is not a "new functionality / original example", as it was around for years. By the way following your link is worth it, as it shows some more possible usages (via scripting).
Peter
Thanks, I'm happy you like it, and you are going to use it as well.
PS: If you really liked this code, please vote for it too. Thanks.