Jump to content

how is the "find text" implemented?


0_o

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?

Link to comment

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.

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.