Jump to content

How to get all Tags of an Object


Recommended Posts

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?

Link to comment

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.

Link to comment

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 ;)

Link to comment

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... :cool:

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

  • Like 1
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.