0_o Posted August 23, 2012 Report Share Posted August 23, 2012 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? Quote Link to comment
Mr Mike Posted August 23, 2012 Report Share Posted August 23, 2012 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. Quote Link to comment
Darren Posted August 23, 2012 Report Share Posted August 23, 2012 To my knowledge, there is no way to call the functionality in the Find Dialog in a VI. Quote Link to comment
Aristos Queue Posted August 23, 2012 Report Share Posted August 23, 2012 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. Quote Link to comment
asbo Posted August 24, 2012 Report Share Posted August 24, 2012 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? 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.