LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Managing LabVIEW Project Assets

Solved!
Go to solution

Hello,

I have a fairly large LabVIEW project which I have organized into various folders and sub-folders on disk as seen in the following screenshot.image.png

 

 

I am following the design guide for building an effective hardware abstraction layer so I have parent interface classes in the HAL folder (grouped by the type of hardware) and the actual implementations in the DSSP folder (again grouped by the type).  On of the member VI methods I want to have for every piece of hardware is one which returns an image for the hardware called Get Image.vi.  This will be overridden from the GenericHALObject by the actual hardware objects and dynamic dispatching will call the correct VI.

 

My question is how to organize these images in the source code and final built application.  Right now I am storing the images for each DSSP in the folder with the LabVIEW class and am having the Get Image method use the path of the current VI to find the image.  However, I know this will not work when calling the GenericHALObject method nor when I build the final application into an executable.  Ideally the images (and any other files I need) would either be embedded in the final executable or better yet with a DLL or something similar) that contains the DSSP or alternatively the actual file gets placed with the EXE.  I also need this to be able to work when debugging the application within the development environment.

 

Any suggestions as to the best way to do this?

Thanks!

0 Kudos
Message 1 of 3
(2,027 Views)
Solution
Accepted by topic author patrick.wright

One option is to store the images in the VIs themselves as the default data in the image indicator.  Then you no longer have external image files to maintain.

 

The next option I would go with would be to put the images in an "images" folder next to the project file.  Then you can use relative paths using the Application Directory.  This function gives you the path of the folder containing the project file (in the IDE) or the executable (in the RunTime Engine).  Just put the images in an "images" folder next the the executable and nothing in your code needs to change between the IDE and exe.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(2,005 Views)

I didn't realize the default value for a picture is actually stored in the VI itself.  That solution works perfectly!  Thanks!

0 Kudos
Message 3 of 3
(1,997 Views)