LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building and running an LV .exe that contains multiple Open vi References

Solved!
Go to solution

Hello,

I apologize for the "list" method of explaining the issue. 

I have a main .vi that will be built into an .EXE application for distribution (taking to other computer only running LV RTE).

Within this main .vi are 18 other .vi files each with their own front panel user interface and data input/output which is passed back to the main .vi.

These various vis are opened as a "Open VI Reference" with a file path and display their respective front panels within a subpanel on the main vi for the user to enter data before it is passed back to the main vi.

The file paths are read in from a .txt file (filepaths.txt) as soon as the main vi starts as to easily change file paths to match another computer system. The file path to the .txt is set by the user in the main vi upon startup.

When I execute the .exe of the main vi on my development system, everything runs fine, but when transferring over to the other computer system, the references don't appear to be loading into the the main exe.

 

All the 18 additional vi files have been built with the application as an "always include" as well as copied to the secondary system to the respective folder which the filepaths.txt points to.

 

My questions: Has anyone done this effectively? Is there a better method for implementing this sort of interface? Is this an issue with LV RTE?

Currently using LV 2020 Professional and the other system has both RTE 2020 and RTE 2020 SP1.

0 Kudos
Message 1 of 3
(975 Views)
Solution
Accepted by topic author Matthias9265

@Matthias9265 wrote:

 

The file paths are read in from a .txt file ... to easily change file paths to match another computer system.


While this isn't your actual problem, I would expect that not doing this would help solve your problem. What you probably want to do is use relative paths rather than absolute paths. This should allow you to use the same code on multiple computers even if it's located in different places, as long as the relative locations are the same.

 

As for what your actual problem is, you didn't include enough details, but here are some relevant points:

  1. Setting a VI to be always included means that it will be part of the result of the build, but it could be in different places. If you look at the Source File Settings page of the build settings, you can set different destinations there for different items and by default, things will go inside the EXE, and inside the EXE, you will have the same hierarchy you had as loose code. That doesn't mean the VI will be loaded from there, since if it's not statically linked to another loaded VI, what will determine that is the the path you use to open it.
  2. I believe that by default, current versions of LV separate the compiled code from all VIs. This isn't an issue when you're running in LV, which can recompile the code, but an EXE will need to have either a VI with the compiled code included, or have the relevant compiled code cache where it can find that code. That second method is trickier and would be a problem if you're just copying VIs which have their compiled code separated. This may well be the issue you're running into.
  3. If you really did need the VIs as a block outside the EXE (for example, if you have some kind of plugin architecture), then the better way to handle it would be to have a separate build just for building those plugins in a way that includes the compiled source with them (for example, as a DLL or an LLB or a packed library).
  4. In general, when you have an issue like this, I would suggest some error handling to see what the problem actually is. I would also suggest testing the basic concept using a much simplified example, which makes it easier to see where the problem is. If you still have issues and you think you need this, I would suggest uploading that example so people can see what you're talking about.

 

You didn't give any details about why you think you need to have different locations for different computers, so I can't comment on that, but I'm going to assume you don't actually need what you're doing and that you can actually simply have all of the VIs inside the EXE (mainly because that's what most people need).

 

For something like that, I would suggest that you try using static VI references which will always point to the correct VIs. Depending on your usage, you can either use that reference directly and run the VI as a regular VI, or you can use the reference to get the VI name/path and feed that into the open function.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(749 Views)

You need not only the EXE, but an installer. Create an installer from the EXE and it will automatically populate for you with most of the default options that it finds the EXE should need to run. LabVIEW exes don't run with the all the correct RTE components and the safest way to ensure these are included is to generate the installer yourself. I suspect you've missed something basic from the RTE installation on the other PC.

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 3
(741 Views)