From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to build a stanalone program with supporting files embedded in the program?

Solved!
Go to solution

Hi,

 

    I have picture files need to be used by a LabVIEW program. When building a standalone program these picture fies can be includded in a support directory. I wonder is it possible for these files to be part of the labview standalone program so I only need to distribue one program instead of a program with support directories? Thanks!

 

   Regards,

 

   Tom

0 Kudos
Message 1 of 15
(2,621 Views)

 What the purpose of these images? Can u explain more a bit?

0 Kudos
Message 2 of 15
(2,616 Views)

Technically the answer is no, BUT depending on the size of the image, it might be possible to fudge it.

 

If the file isn't huge, read the file in and store is as a binary array in a constant that is on the block diagram of a VI that can be loaded dynamically.

 

Now, when your program launches, have it first check to see if the image file exists. If it does not, the program loads the dynamic file, and writes the contents of the constant to a file with the correct name and extension.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 15
(2,599 Views)

They are pictures to show some instrument diagram. The purpose is mainly for GUI.

0 Kudos
Message 4 of 15
(2,576 Views)

Hi Mike,

 

    Thanks for your reply. It is sure a solution to solve the problem although I expect there could be a easier way offerred by the applcation builder.

 

    Tom

0 Kudos
Message 5 of 15
(2,575 Views)

Using a project library would be the answer, methinks.

---
CLA
0 Kudos
Message 6 of 15
(2,571 Views)
Solution
Accepted by tom_z

I just created the same thing (a test interface with pics of the wiring setup).  Just open your picture in any picture control, right-click > Data Operations > Copy, then paste it into a picture control constant in your VI.  I created an array of them so that the operator can step through the pics as he works.  Of course your executable will grow with every JPG you add to it.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 7 of 15
(2,561 Views)

The problem is that the application builder can't include non-LV file in the exe. It can include such files as part of the build - as you have already noticed. In addition, when you create an installer, the installer bundles up everything associated with the application into a single installation executable that puts all the files where they need to be on the target machine. Perhaps that is what you are wanting to do?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 8 of 15
(2,547 Views)

The problem with JPGs is that they can produce artifacts (visual noise) dure to the compression that it uses. Depending on the image, PNGs can be just as small (or smaller) with far better clarity.

 

Also, if you are planning to put graphics on the front panel -- which is also a good idea -- be sure that the images don't overlap each other. Overlapping control can have a large negative impact on performance.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 9 of 15
(2,544 Views)

Thanks! I will try it.

0 Kudos
Message 10 of 15
(2,542 Views)