LabVIEW Shortcut Menu Plug-Ins

cancel
Showing results for 
Search instead for 
Did you mean: 

LVClass Field Find All Uses.llb

Author: Aristos Queue (NI)

 

Right-click on a field of a private data control of a class and select "Find All Uses..." to discover all the places where the field is bundled or unbundled. This plug-in will find

  • all unnamed Bundle and Unbundle nodes (because those always access all fields)
  • any Bundle By Name or Unbundle By Name that references the selected field
  • any IPE Unbundle/Bundle pair that references the selected field.

The tool works for dotted fields inside nested clusters.

 

Before:

AristosQueue_3-1620317046539.png

After:

AristosQueue_4-1620317176215.png
(Added a "Copy to Clipboard" button to the dialog in later version.)
Attachment is saved in LabVIEW 2019. For install instructions, go here.

 


 

Comments
CL_eisenwr
Active Participant
Active Participant
on

It would be nice if we could export the list of VIs added to this

__________________________________
Bill Eisenhower
Certified LabVIEW & TestStand Developer
wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

For the unnamed (un)bundler you could check if the element is wired?

 

"Give them a finger, and they’ll take the whole hand" 😊

 

EDIT: It depends a bit on what you want to know. If you want to know if it's save to delete the item, the unnamed (un)bundlers are relevant. If you want to know where the value is used or set, the element has to be wired.

 

EDIT 2: I guess it would be useful to have a "Find all reads" and "Find all writes" as well?

AristosQueue (NI)
NI Employee (retired)
on

The items are labeled in the dialog, so skip the ones that aren't of interest to you.

AristosQueue (NI)
NI Employee (retired)
on

Rev 2.

  • Dialog now just goes to the item when only one item is found.
  • Selection highlighting is better.
  • It is more clear on zero items that nothing was found.
  • @CL_eisenwr -- copy button now included in the dialog.

 

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

I still like this one a lot.

 

+1 for adding it at installation.

 

Could the menu be added to the (named) (un)bundlers of class data in a diagram*? As it is it's very useful, but I'm often in the diagram when I want to know if\where the item is also used elsewhere. I now have to locate the class's private data first.

 

* I know it can, technically, but are there reasons not to do it?

AristosQueue (NI)
NI Employee (retired)
on

> * I know it can, technically, but are there reasons not to do it?

 

That's a good idea. I might have time in the not too distant future to return to this project. I'll consider it.

felipefoz
Member Member
Member
on

Hey,

Is there any limitation on the VIs to run this plugin on LV2017?

Regards,

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

Felipe, I have saved it back to LV18, and it worked without problems.

 

I did save it back to LV16 for you, only to find I can't attach anything here...

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

BTW. In the spirit of 'always one more bug'...

 

There does seem to be a problem with clusters as private data. (Glad I don't have too many of them.)

 

It seems that access to individual cluster elements are not found.

 

GOOD: A 'find all uses' on a cluster or it's element returns access to the cluster.

BAD: A 'find all uses' on cluster or it's element does not return access to an individual element.

 

Find All Uses.png

felipefoz
Member Member
Member
on

 


@  wrote:
 

Felipe, I have saved it back to LV18, and it worked without problems.

 

I did save it back to LV16 for you, only to find I can't attach anything here...


Thank you Wiebe. Don't bother. I am going to test here using a LV2020 install to save it back. I will let you know. 

Apparently this post format is different. I haven't seen a place to attach either, nor reply.

AristosQueue (NI)
NI Employee (retired)
on

The inability to attach is deliberate. These plug in directly into an editor. I do not want malicious persons uploading "improved versions" of plugins. People should always vet code uploaded to the Internet before running it on their machines, but these are particularly a threat vector, so I created a forum with the properties set that only allow the original post to host attachments. I also lock edits to only the original author.

AristosQueue (NI)
NI Employee (retired)
on

Thanks for the bug report. I'd like to get time to work on this, but it hasn't happened lately. 🙂

felipefoz
Member Member
Member
on


@  wrote:
 

Felipe, I have saved it back to LV18, and it worked without problems.

 

I did save it back to LV16 for you, only to find I can't attach anything here...


 

It works in LV2017SP1.

Mehran_Moss
Member
Member
on

Where do I install this llb in LabVIEW 2021 so all users can access?

I had this instruction in here 

If you want a plug-in to only appear for a specific version of LabVIEW, you can add it to

  • <labview install directory>\resource\plugins\PopupMenus\<choose subdirectory>

or actually : C:\Program Files (x86)\National Instruments\LabVIEW 2021\resource\plugins\PopupMenus\edit time panel and diagram

 

but it did not work for my LabVIEW 32bit version.

 

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

I guess somehow I expected this feature to end up in LabVIEW automatically.

 

Here's an idea to add it:

"Find Callers" for Class Data - NI Community

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

For the record, another (tiny corner case) bug...

 

If the private data item ends with a space (which it probably never should), the (un)bundles aren't found at all.

 

Apparently, LV does us a favor by removing the space, so the name strings don't match. 

 

Sure was nasty to figure out what was happening, or rather not happening. I hope the fix is just to use a reg.ex. instead of an equal...

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

I'm working on (testing) my 'pimped' version of this plug-in.

 

I'm taking the leap because this is pretty much the only plugin I use, and I use it all the time working on, sometimes shocking, inherited code. But even on my own messes it's very useful.

 

TL;DR Details:

Spoiler

I think (still testing) the following new features will be really useful:

 

DONE (un)bundlers are identified by element position, to avoid false positives of (un)bundlers with the same name*.

DONE support for nested values (e.g. search for a value in a cluster finding (un)bundling the cluster; search for a cluster, finding items too).

DONE allow searching for a selection of values.

DONE searching (un)bundlers of type def clusters (not just classes!).

DONE starting a search from a type def control(s) or constant(s).

DONE Finding unnamed (un)bundlers (iff wired).

TODO starting a search from one or more (un)bundlers.

TODO presenting (all?) the results. Found items can now match more than 1 searched item...

DONE Tests to allow development without manually using the plug-in
TODO  Formal tests (probably Caraya).

This has been a hell of a job... Adding the type def search has a lot of implications. It's been 95% of the work turning this into week(s), not hours, of work.


* Identifying elements uniquely still needs to be done for IPEs, that sadly miss a way the 'index' property that allow getting this info unambiguously. Only names are available, but they don't uniquely identify the element. They also don't account for "." in items, while "." is used as separator... *sigh* I fear I have to use the Wire.Data Offset property, unless someone else has a better idea.

But:

+ Where to put this plugin? (Online I mean, a new site, or here?)

+ The code incl. tests, etc., will (at some point) be in Git (lab or hub). Should the plugin download be there too?

+ Should it add the same menu?

+ Is there a way for this plugin to detect the other one, and adjust it's name? (Pretty sure there's no failsafe way).

 

I'm a bit torn, because I probably want to keep both plugins for a while, but eventually keep one.

Darren
Proven Zealot
Proven Zealot
on

>  Where to put this plugin?

 

I suggest creating a github/gitlab/whatever repo for all the source code, and also creating a VI Package for the plugin and publishing to vipm.io. Their process for creating a page for your add-on is super simple and quick. Here's one that I did, note that it includes a link to the github repo for the source:

 

NI Advanced HTTP Client API Toolkit for LabVIEW - Download - VIPM by JKI

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

Thanks. I avoided VIPM\packages\etc.. Not my cup of thee (actually prefer coffee).

 

As a developer, the first time I tried it and lost several days trying, not succeeding, to figure it out. That was an entire toolkit though, palettes etc. and a decade ago.

 

As a user, I find it only makes thinks more complex. For starters, I now need an account... I also want things in my project, not in vi.lib, but this situation is different.

 

Would a vipm give the user a choice where to install (all LV versions\per LV version)?

 

I'll reconsider...

Darren
Proven Zealot
Proven Zealot
on

> Would a vipm give the user a choice where to install (all LV versions\per LV version)?

 

VIPM lets you pick which LabVIEW you want to install a package to.

If you create the github/gitlab repo and give me access, I can help create a VI Package build and publish to vipm.io, if you want. It's really the best way (in my opinion) to publish LabVIEW re-use code and IDE tools.

Petru_Tarabuta
Active Participant
Active Participant
on

I fully agree with Darren's opinion that VIPM packages are the best way to publish LabVIEW IDE tools. Publishing tools such as this one to VIPM has the following advantages:

  • The VIP file is versioned, so it's crystal clear what version of the tool is installed on the machine.
  • VIPM makes it easy to see when an update is available.
  • The VIP file can be added to people's VIPC files (VI Package Configuration) files. This is a huge benefit. This means that once a tool is deemed useful it can be made part of a team's standard set of tools (the team's VIPC file constitutes the standard set of tools).
    • This is especially beneficial for newer programmers who find it confusing to perform any sort of manual installation (manually copying files to various locations in vi.lib). I've seen this happen even when the "manual install" instructions are crystal clear, as is the case with the Shortcut Menu Plug-ins installation instructions.

 

One thing VIPM can't do out of the box is to install files in someone's project. It's great at installing files in vi.lib, user.lib, or any other standard LabVIEW folder. But by default it can't install files in say C:\MyProject\Source Code. But fortunately this tool doesn't need that installation behaviour. And, even if the behaviour is needed, it could be achieved by running a post-install VI, something that VIPM supports.

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

OK, so I'll reconsider VIPM more seriously 😉.

 

I can simply offer a download of the .llb (or zipped folder named .llb) somewhere on this forum and a VIPM... Thanks for offering to make VIPM happen...

 

One step at the time though.

 

  1. I first have to get it working. Mostly icing the cake atm.
  2. Then test it a bit more.
  3. Then put it in an online git.
  4. Then I can share it...
  5. Then, in parallel:
    1. VIPM can be added.
    2. More tests should be added.
    3. User documentation...
    4. Developer documentation...

 

Of course, there'll be overlap. No need to gold plate a step before proceeding.

 

Going from 1&2 (the exiting part) to 3 (the boring part) is a big effort...

wiebe@CARYA
Knight of NI Knight of NI
Knight of NI
on

>VIPM lets you pick which LabVIEW you want to install a package to.

 

Yes, but plugins can also be installed for all LabVIEW versions, by putting it in "%User%\Documents\LabVIEW Data\PopupMenus\edit time panel and diagram"...

 

That's where I put the plugins manually... They will be used by all LV versions supporting the code version. That will be 19 and up for this plugin (maps & sets).

Darren
Proven Zealot
Proven Zealot
on

That's true. You can install files to the [LabVIEW Data] folder with a VIPM package.

Contributors