LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The Vi is not executable using .NET constructor

Hello everyone, I'm using STS-VIS Spectrometer from ocean optics in my LabView. Instead of using the VI wrapper, I'm using .NET constructor to load the NETOmniDriver-NET20.dll. Everything was working well and I got the output of the Spectrometer in the front panel. But when I tried to make an executable file, it gives an error as "The vi is not executable. The full development version of LabView is required to fix the errors.". I already add the dll into the "Always Include" file when creating the exe, and the system also created a build folder automatically including the dll inside. Can anyone help me and give me suggestions on what I can do about it? I attached the Vi file together with this thread. Thank you.

0 Kudos
Message 1 of 5
(2,615 Views)

You likely need to make sure that the actual .Net assemby DLL as well as any dependencies of that DLL are copied into the root folder of your application to let the application find them and load the VIs correctly when starting up.

 

Always include may not be enough. By default LabVIEW adds such dependencies into the data subfolder of your executable. That is not where .Net searches for assemblies. Move the location explicitly into the same directory where your exe is, and if that is not enough make sure to include any other DLL you can find in the oridiginal Ocean Optics (which they call themselves now Ocean Insight) directory with the main .Net assembly that you now use..

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 5
(2,588 Views)

Which folders do you mean? All the "Ocean Optics" folder (mine still ocean optics and not ocean insight). Or only all the DLL files inside the specific folder? (Please see the attached screenshot). I tried both methods but still failed. Or should i copy all the DLL first, then create the exe file?

0 Kudos
Message 3 of 5
(2,571 Views)

In the end, instead of using DLL with .NET constructor, I changed using the ocean optics Vis for each function. I successfully run the program in the front panel. However, when I create the exe file again, it force closed the application and create a log file saying error about "Deadlock in safepoint code. Should have called back to the VM before blocking."

 

Does anyone know what i did wrong in the program?

Download All
0 Kudos
Message 4 of 5
(2,557 Views)

That definitely sounds like something inside the .Net assembly itself. None of that terminology is anything that I would recognize as LabVIEW specific. As we do not have the source code of that .Net assembly to look at, we can not really start to even guess what is wrong.

 

One wild guess could be that it is not enough to make sure that the .Net assembly that you reference from your VIs is locate in the application directory alongside the exe file, but that this assembly has other dependencies that it needs to be present in that folder too, in order to work properly.

 

I believe to remember from other Ocean Optics/Ocean Insight topics here on this forum, that their .Net drivers tend to be indeed a collection of DLLs that all need to be findable by the Windows .Net loader in order to work properly. Ocean Optics, just as many other instrument manufacturers, may develop very interesting hardware but are far from real software developer houses, and seldom go much further than touting their own software they ship with or sell in addition to their hardware. Often they don't even have the knowledge to technically support their own software, since it was not developed in house or the original developer has long ago moved on to other work. Support for other programming languages like LabVIEW is mostly an afterthought, and more often than not based on customer donated drivers, with no knowledge about it from their own support people.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 5
(2,534 Views)