LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to build an EXE when using measurement drivers from other manufacturers

Solved!
Go to solution

Hi, it's nice to meet you.

 

I have a problem and would be grateful if you could help me. 

 

I am currently measuring and logging from a Keyence logger, NR-X100, using the driver provided by Keyence.

When I build to EXE and run it, I get an error code 7, file not found, and when I create a project with only the Keyence sample VI and run it as EXE, the same error occurs.

 

I would be most grateful if you could tell me how to solve this problem, but in general, what should I do and what precautions should I take when EXE-ing a product that uses the driver in instr.lib?

I would be grateful if you could tell us how you do it with other companies' products.

 

Thank you for your interest.

Download All
0 Kudos
Message 1 of 11
(1,450 Views)

Did you include their driver in source files, when building the exe?

0 Kudos
Message 2 of 11
(1,412 Views)

In initialize.vi, there is probably a configuration file it tries to open. The path is probably a relative path, relative to the path of initialize.vi. In the exe, the path will be relative to the exe path, which doesn't have the file. You should handle the file path differentely when using an exe.

 

Just a guess. Can you attach initialize.vi in LabVIEW 2018 or lower?

0 Kudos
Message 3 of 11
(1,396 Views)

Hello,

 

I have tried various patterns to include the files in the source files, which are included in the driver folder provided by the equipment manufacturer, but so far I have not been able to improve the situation.

 

I am not sure what policy should be used to include the source files.

 

For your reference, I attach images showing the structure of the driver folder.

Download All
0 Kudos
Message 4 of 11
(1,393 Views)

First you need to add all the drivers into the project. Then, under build specifications you have a category "Source Files". There you have a window with project files on the left and two windows on the right, "startup VIs" and "always included".

Add your drivers to the "always included" window.

When your exe is built now, you get a folder called data, which includes these driver files.

 

0 Kudos
Message 5 of 11
(1,381 Views)

Hello Basjong53.

 

Indeed, a configuration file for this device has to be specified, but another error is reported when that file is missing.

 

0x84002 Failed to open a file.


The initialize.vi is attached.

This driver is said to be saved in LabVIEW 8.6 format.

Download All
0 Kudos
Message 6 of 11
(1,376 Views)
Solution
Accepted by topic author n_kusumoto

Please save your vi for a previous version like this:

Basjong53_0-1687941991255.png

 

You have to specify your file path differently for the Development and Runtime environments like so:

File Test.png

                  Basjong53_2-1687942054675.png

 

Also be sure to include your file in the correct directory. It is easiest to add the file in the Always Include section of the executable builder.

Message 7 of 11
(1,369 Views)

Hello AeroSoul.

 

In this case, what exactly do you think should be done to include all drivers?

 

(driverDir1.png)

 

If I include the entire driver folder in the source file, I get a message that the build cannot be completed because the Vi Tree.vi is corrupt.

 

Should I remove the Ti Tree.vi from the folder, which is provided for illustrative purposes?

 

0 Kudos
Message 8 of 11
(1,360 Views)

Basjong53,

 

 

I saved the file in 2018 format.
I hope I have done well.

 

 

Download All
0 Kudos
Message 9 of 11
(1,355 Views)

These seem mostly .Net files. They need to be included in your project build and added to the Support folder, which defaults to a data directory inside your exe folder. That works for DLLs and assemblies that LabVIEW itself calls as it adjusts the path in the compiled exe to load them from inside the data folder, but won’t work for dependencies as they will be normally referenced by name only and then Windows search rules kick in.

 

The only directory that Windows will search for both .Net assemblies and DLLs for such dependencies is the application folder. Change the target location for your Support folder in the Build Specification to be empty and the target for all these DLLs to the Support target. This will copy all DLLs alongside your exe file and clutter that folder but that is how Windows wants to have .Net assemblies and DLLs that are not properly installed in the system. 

 

 

Rolf Kalbermatter
My Blog
Message 10 of 11
(1,331 Views)