LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically find duplicated VI names?

I am working on a project that involves many others. Sometimes I run my teststand sequence and a someone else's VI gets loaded because the VI happen to have the same name as my original one. I can get around this by setting search path for myself or use absolute path. But, I am more gearing toward developing a VI that will search for duplicate VI names in before I load the sequence and gives me a warning if there exist one. I was wondering if someone else out there whos already has a working VI that will do the same job.
0 Kudos
Message 1 of 5
(3,330 Views)
Hi,

The attached VI doesn't compare any names/ The VI returns all files
(extension is optional) in the directory and it's sub directories. It also
searches libraries.

It returns a list of file paths and directory paths, so this sould be easy
to compare. You could modify the vi to return the names and paths
seperatelly, to ease the comparation.

Regards,

Wiebe.

"LegalEngineer" wrote in message
news:506500000008000000A4C10000-1077587809000@exchange.ni.com...
> I am working on a project that involves many others. Sometimes I run
> my teststand sequence and a someone else's VI gets loaded because the
> VI happen to have the same name as my original one. I can get around
> this by setting search path for myself or use absolute path. But, I am
>
more gearing toward developing a VI that will search for duplicate VI
> names in before I load the sequence and gives me a warning if there
> exist one. I was wondering if someone else out there whos already has
> a working VI that will do the same job.



[Attachment Recursive File Search.vi, see below]
0 Kudos
Message 2 of 5
(3,330 Views)
Hello LegalEngineer,

Thank you for your inquiry regarding VI instances with the same name. It sounds like the wrong VIs are getting loaded into Testand because they have the same file name. There are several Windows Utility VIs available that could help in this case. One of the Utility VIs is called Get Window Refnum and should return any instances of a window. The following links are great resources when dealing with this issue.

http://digital.ni.com/public.nsf/websearch/136F6B1F34CBB76E852563FC007AEFC7?OpenDocument

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EF4556A4E034080020E74861&p_node=DZ53008&p_submitted=&p_rank=&p_answer=&p_source=External

These should help you get started in finding instances of VIs with the same nam
e. After this is implemented it shouldn�t be hard to use a dialog box to notify the user that some of the instance names match and there could be a problem loading the correct VI into Testand.

Other responses similar to these can be found on the ni.com website by clicking the support tab at the top of the home page. Then search for �refnum instances� from Technical Resources at the top of the page or topics similar to this. I hope these resources help. Let me know if I can further assist you.

Shea C.
Applications Engineering
0 Kudos
Message 3 of 5
(3,330 Views)
Shea C,
Thank you for your help, but I am not sure how this utilities can help me in this case. I want to avoid loading a wrong VI that has the same name as the vi I want to call. This utility can return a refnum for a VI that is currently being loaded. How do I know whether the returned refnum is referencing the right VI or wrong VI? Are there two designated refnums for two particular VIs? Is the returned refnum always the same for each VI? What can I do if I find out that the loaded VI is not what I wanted to load?
0 Kudos
Message 4 of 5
(3,330 Views)
LegalEngineer,

Thanks for getting back to me. I apologize, I didn't completely understand your question. Attached is a VI that will search a start path for a specified file and will return the number of files matching the filename and their path after searching directories and LabVIEW libraries. It's a pretty neat VI and could be very useful with some modifications. Other example code can be found on the Support page of the ni.com homepage. Scroll down to "Example Code" towards the bottom of the support page. Click on this and then search for documents relating to the code that you would like to find. The link below gives a little more detail about the operation of the Find File VI.

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD
4?p_guid=B123AE0CBC80111EE034080020E74861&p_node=DZ52027&p_submitted=N&p_rank=&p_answer=&p_source=External

Let me know if this works for you!

Shea C.
Applications Engineering
0 Kudos
Message 5 of 5
(3,330 Views)