Receiving "Another VI with the Same Name in Memory" Error When Loading LabVIEW VIs

Updated Dec 13, 2023

Reported In

Software

  • LabVIEW

Issue Details

  • If I try loading two VIs that call two distinct subVIs with the same filename, I get bad linkage errors or erratic behavior. 
  • When I open up my main VI, I get an error that states that another VI has the same name in memory.

Solution

 

For LabVIEW 8.0 and Later

  • Use a project library. When a VI is part of a project library, its qualified filename includes the filename and the owning project library filename. This ensures that two VIs with the same name in different project libraries will be in different namespaces, thus eliminating cross-linking problems.
  • Delete the original conflicting subVI from the block diagram and re-add the desired subVI to prevent LabVIEW from confusing which subVI to call. Do not use the replace function.

Additional Information

LabVIEW 7.1 and Earlier

LabVIEW uses the name of a VI to provide memory for that VI, so when attempting to load two VIs with the same name LabVIEW will be unable to differentiate between the two.

For example, suppose you have two VIs which are named main1.vi and main2.vi. Each of these call distinct SubVIs which are both named SubVI.vi. This is what would occur when you open the two main VIs:

When main1.vi is opened, it is loaded into memory and its subVIs, including SubVI.vi.
When main2.vi is opened, it is loaded into memory as well as its subVIs. When the linker information signals LabVIEW to load SubVI.vi it recognizes it already has SubVI.vi loaded into memory and tries to link main2.vi with the previously loaded VI also named SubVI.vi. If the connector pane is exactly the same, it may load with no errors, but the behavior would be unexpected. If the connector pane is different, you receive a bad linkage error.

For this reason, you should always give subVIs unique names.