LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1097 - Only in Executable call

Solved!
Go to solution

Hello,

 

I have a vi which uses dll calls to interact with our instrument which works perfectly until I build it as an application, where it will give error 1097.

 

I have gone through debugging and it fails on the first call of the dll, so I am pretty sure it is an issue with the way that I am calling the dll. But I have tried including the required dll in every single place that I can imagine the function searching, this includes the;Dependancies section of the project, top level vi's exe path, subvi's path,  data folder, SysWOW64&System32, inside of the lvlib files which are used.... basically anywhere that I was allowed to paste the dlls.

 

I have other dll's made by the same company which I am calling in a different section of the code and they execute perfectly while just being included as usual dependants in the app builder (and stored in the data folder as seems normal)

 

I am using the same machine for development and deployment.

 

I built all of the subVI's which call the library functions through Tools->Import->Shared Library(.dll)

 

This is the (sub)subVI [Init] which gives the error. I have not included an image of the toplevel VI as it is a very standard call of this subVI

 

Untitled.png

I'm not sure what else I can do.

 

Any help would be greatly appreciated

 

I am running Labview 2014 SP1 (32-bit) on a Windows 7 64 bit OS (as a workaround to solve a unrelated driver issue)

 

Thanks!

0 Kudos
Message 1 of 7
(4,349 Views)

Do you use a proper project tree? You should have a project, where you include your main VI, and all other subVIs, controls, lvlibs, etc. When you build your exe from your project, I think it should automatically include the used dlls...? At least this is the way I always go.

Message 2 of 7
(4,320 Views)

I do indeed have my project with all of the vi's etc & yes it automatically includes the dlls

 

This is what it looks like:

 

tree.png

 

And this is the VI hierarchy which may make it clearer:

 

vi_heierarchy.png

0 Kudos
Message 3 of 7
(4,299 Views)

Is the device attached when this error occurs?

 

Error 1097 typically comes from unhandled exceptions, so probably improper error handling on the part of the DLL being called. Since this is a device initialization DLL, there's a good chance something is going wrong with the initialization (like the device not being present), that error is not being handled correctly, and when that comes back to the Call Function node, you get your Error 1097. Unfortunately, MT is likely to have more information than NI would as to how their VI works and what errors it might be throwing.

 

Regards,

 

GiantDeathRobot

William R.
Message 4 of 7
(4,256 Views)

The device is attached.

 

I can run the development VI without issue on the same computer and I get the expected response from the dll... it only breaks when it's made into an executable and unfortunately I cant see where it's attempting to call the dll from in executable debug mode.

 

Yeah the 1097 error is quite annoying since its very non-descript. And this isnt a MT vi, but a VI set made from their dll, so I thought NI would have more information on how their VI creation tool deals the dll's imported functions.

 

Thanks,

tokiyoshi

0 Kudos
Message 5 of 7
(4,252 Views)
Solution
Accepted by topic author tokiyoshi

There are other DLLs in the instrument driver library. Most likely they are used indirectly by the DLL you are accessing from Call Library Node. They need to be present in the same directory as your executable. When you run the VI in the development environment LabVIEW adds the project directory and maybe the lvlib directory to the search path Windows should search for secondary DLLs but in an executable this doesn't apply.

Rolf Kalbermatter
My Blog
Message 6 of 7
(4,228 Views)

Thank you Rolf, I had copied them into the folder before, but I had used old versions of these dlls.

 

Your response got me to recheck & I noticed they were old.

 

Thank You

0 Kudos
Message 7 of 7
(4,190 Views)