LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application built from Vision Builder compiles but doesn't work correctly.

Solved!
Go to solution

Hello,

 

I have this problem:
1) I make an inspection in Vison Builder (2010) - it works
2) Migrate it to LabView (2011) - it works (no errors)
3) Build application from migrated VI - it works (no errors)
But when I run this application, it doesn't behave like it should, there are no ROIs and every part is resulted as "PASS" even the bad ones. This error appears only in this exe file, in LabView it works perfectly.
If anybody could help, I added the simplified program with two example images (1 should pass and 1 should fail).


Thanks in advance for any help.

 

Download All
0 Kudos
Message 1 of 6
(3,638 Views)

Hello MarekH,

 

I managed to debug your application.

The problem is that the generated code is looking for the support files (Configuration files subfolder of the folder you selected when you migrated the VBAI project to LabVIEW) on a path that can't even be created. This behavior produces an internal error but the generated code has no error handling in it, so you will observe just the incorrect behavior but no error messages when running the EXE.

 

I attached the corrected IVB Build Template Path (CodeGen).vi. Put it into your project, rebuild the application. Copy the Configuration files folder from your project folder to the folder of the EXE file. After that run the EXE, it should work properly.

 

Regards,

Daniel

Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
Message 2 of 6
(3,559 Views)

Hello Daniel,

 

thanks for your help, at the moment I'm on holiday,

I will take a look at the end of the month.

 

Kind regards,

Marek.

 

0 Kudos
Message 3 of 6
(3,545 Views)

Daniel,

 

thanks for your help, I did the steps you described, but result is still the same. I've tried different combinations of directories etc. And I still don't know how/when this error is created, because there are no options when migrating project to LabView. What do you mean by "path that can't even be created" ?

 

Thank you,

Marek.

0 Kudos
Message 4 of 6
(3,496 Views)
Solution
Accepted by topic author MarekH

Hello Marek,

 

I will try to describe the nature of the problem briefly.

The purpose of the IVB Build Template Path (CodeGen).VI is to assemble a path to some support files used in the image processing. It begins building the path with the Current VI's Path function. The behavior of the Current VI's Path function is different between running in the LabVIEW environment and the compiled EXE. You can observe this if you display the path generated by the VI by for example wiring a Path To String and a One Button Dialog to the output. You will find that when running in the LabVIEW environment the VI builds a path to:

"[Project Directory]\Configuration Files\*.png".

 

However, when running the EXE compiled from this project you will see that the path built points to:

"[Application Directory]\[Directory with the name of your EXE (this can't be created in NTFS)]\Configuration Files\*.png".

 

My proposed solution is to wire one more Strip Path VI after the two that's already there in the Conditional Case Structure, to the path will point to "[Application Directory]\Configuration Files", but if you do only this, it will break the project when running from LabVIEW. The complete solution is to create a separate case for the Conditional Case Structure that only runs when running as a compiled application.

To do this first you will have to modify the existing TARGET_TYPE==Windows case to include the RUN_TIME_ENGINE==False condition as well and create the new case with the Current VI's path and 3 Strip Path VIs with a condition TARGET_TYPE==Windows and RUN_TIME_ENGINE==True.

 

I hope that everything is clear, but feel free to ask any further questions!

 

Regards,

Daniel

Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
Message 5 of 6
(3,477 Views)

Thanks for being patient with me, Daniel.

Problem solved.

 

Have a nice day,

Marek.

 

0 Kudos
Message 6 of 6
(3,460 Views)