Jump to content
0_o

how is the "find text" implemented?

Recommended Posts

A script that I wrote runs recursively over all the vis in a project and searches a string in the label/description etc.

It works just fine but the script opens each vi while accessing its reference and thus running over >1000 big vis takes ages.

However, the built in find option in LV searches text in an application and it only takes seconds thus I guess it searches the serialized vis and somehow knows how to highlight the relevant control.

Besides looking at the flattened code from time to time I never tried anything like that.

Is the search function open source and I just need to find it or is it a LV secret?

Share this post


Link to post
Share on other sites

Scripting can be slow. In the LabVIEW source code we search each object for the text we're searching for. If the text is found we add the object to a list and traverse the objects within it (i.e. search inside a structure). Each object knows which attributes are searchable. When we search, we search all loaded block diagrams, which is (almost always) all loaded VIs. I bet the slowdown is in scripting.

There may be a way to call the search method, since it is called from a LabVIEW dialog, and many LabVIEW dialogs are backed by LabVIEW code, but it's not public. You may want to contact Darren Nattinger and ask him if he knows of a method to call and possible make it public in future releases.

Share this post


Link to post
Share on other sites

To my knowledge, there is no way to call the functionality in the Find Dialog in a VI.

Share this post


Link to post
Share on other sites

There isn't. It's all closed C++ code traversing the direct object hierarchy. No hooks have ever been written for G code to plug in.

Share this post


Link to post
Share on other sites

That's a shame :( On more that one occasion, I've wanted to search programmatically, but didn't have the time to try implementing a pure-G solution. Can anyone comment on how difficult it would be to add hooks in the future?

Share this post


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.


×
×
  • Create New...

Important Information

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