silmaril Posted August 6, 2009 Report Share Posted August 6, 2009 The Get/Set Tag methods provide very interesting possibilities of saving and retrieving additional information with controls, panels... This looks very similar to the Get/Set Variant Attribute functions. There is just one function I am missing: Is there any way to get all the tag names associated to a scripting object? Quote Link to comment
Francois Normandin Posted August 6, 2009 Report Share Posted August 6, 2009 The Get/Set Tag methods provide very interesting possibilities of saving and retrieving additional information with controls, panels... This looks very similar to the Get/Set Variant Attribute functions. There is just one function I am missing: Is there any way to get all the tag names associated to a scripting object? Hi Silmaril, there is a method (invoke node) to retrieve all tags from a library all at once: Tag.GetNames. It's not something that exists for controls. Just a side note, you can "set" tags only is Edit Mode. But it is still a good way to store information that will not be displayed in the "description" of the terminal, especially using scripting. If you want to have a method that retrieve all Tag Names for Controls, ask for it on the LabVIEW API page. You *might* see it in the next release. Quote Link to comment
silmaril Posted August 7, 2009 Author Report Share Posted August 7, 2009 If you want to have a method that retrieve all Tag Names for Controls, ask for it on the LabVIEW API page. You *might* see it in the next release. You are right. I just posted this request there. Now it's waiting for Christmas to see which items from the wish list will be inside all those colorfull boxes Quote Link to comment
Francois Normandin Posted August 7, 2009 Report Share Posted August 7, 2009 You are right. I just posted this request there. Now it's waiting for Christmas to see which items from the wish list will be inside all those colorfull boxes Maybe you'll get Xmas before you know it... I found a way to retrieve all tags from a VI. I basically scan the VI file and get an index to the position of tags in the file. I then extract the tag names. Since I don't know to which objects it is related, I have to scan all objects on FP and BD to associate them properly. Once done, you get a list of refnums and variants for the Object's references and a list of tags to which it is associated. I also included an example of code to write a tag to the Block Diagram. Use the same template to write to FP or any objects. Open the project and launch "Get All Tags from VI". Browse the path to the example file "Tagged Test VI" and that's it. Saved in 8.6 but will work in 9.0 (2009) as well. Note that the versioning is important as tags are seen only through scripting and NI can change the way it is saved from one version to the other. Retrieve Tags 8.6.zip 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.