LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application builder with MATLAB script calling user-defined .m files not working

Hello

I have developed an application using LabVIEW which uses MATLAB script. So, it uses several user defined .m files. When I used Application Builder to prepare Application (Executable), it does not work properly. How to add required .m files during the Application Build process? Please see attached error message.

Any help is highly appreciated.

Thank you

0 Kudos
Message 1 of 12
(3,908 Views)

That doesn't look like it has anything to do with .m files. It says that a VI is broken. This can happen even if the broken VI isn't actually being called in your code but simply exists in the project.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 2 of 12
(3,894 Views)

Thank you for the reply. Let me describe my application. On Root Folder, there is one VI that calls .m files from a sub-directory named "script". The data is saved in files further placed in another subfolder "Historian". The VI has Report generation which uses Excel template placed in sub-folder "Report". I am confused where and how should I put these required folders in the "My Application Properties" in Application Builder. I have attached the snaps of my configuration of this project in Application Builder. After these configurations, when I pressed Preview, I got the broken VI message, that I posted first.

 

0 Kudos
Message 3 of 12
(3,885 Views)

My Configuration in the Application Builder

Download All
0 Kudos
Message 4 of 12
(3,884 Views)

The first point to concentrate on is the broken VI that is being flagged. Is it one that youe wrote? Is it indeed broken?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 5 of 12
(3,876 Views)

Yes, you are correct. These is some problem with  the Sample Report (Excel).vi. I removed the Report folder and related code, and the Application builder successfully built the executable application. But, when I run the application, I observe no dynamics on the graphs (i.e., the plant simulation coded in Matlab files) does not work. Intrestingly, when I Run the original VI program, the plant simulation (from graphs) in executable application start appearing. What is the reason? I am unable to catch the problem except feedling that some related dll is not loaded with EXE file. When I run the original VI, it comes into play? or there is some probelm with path?

Your help is highly appreciated.

Thank you

Sabih

0 Kudos
Message 6 of 12
(3,866 Views)
How are you locating the .m files? Are the paths hardcoded? After the build do the .m files show up in the proper location for the executable?

If you derive relative paths you need to remember that a VI's path changes when it is built into an executable.

Also, you can debug an executable in much the same way as you would your development code.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 7 of 12
(3,863 Views)

Attached are two files. One for the path, other shows the error I receive when lauch original VI. Even I stopped the VI after the Error, the graph dynamics in the application-exe start working. Regarding Path: I am using Current VI's Path, Strip the Path, then Build Path with the subfolder name. In the subfolder, I am using the m files. This is working fine in VI format, but in EXE, it has trouble. Also, please put some light on how to use more than one sub-folders.

Thank you 

Download All
0 Kudos
Message 8 of 12
(3,858 Views)

After the build the .m files show up in the proper location because I change the Destination name of Support-Directory appropriately to "script". Note: the sub-folder "script" contains the m files.

" If you derive relative paths you need to remember that a VI's path changes when it is built into an executable".... HOW?

"" can debug an executable in much the same way as you would your development code." ... HOW?

Thank you Please

0 Kudos
Message 9 of 12
(3,855 Views)
Base relative paths off the output of the Application Directory function. In the development environment it points to the directory where the project file is located, In the runtime it points to where the executable is located.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 10 of 12
(3,852 Views)