From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Crashes When Calling DLL

hi team;

            I am facing issue when i am calling a dll LabVIEW crashes. In my dll the functions i am calling it have many supported dlls. I tried with shared library node and tools>import>shared library(.dll) in both LabVIEW crashing. My dll file is in c++, and the functions i am exporting in visual studio, I am getting in lab-view. But after the parameter configuration, When i click OK. LabVIEW   not responding and crash without any error message. 

I am using visual studio 2019 And LabVIEW 2019.

Here i am attaching VS function calling code and export function code.

And i am placing all supported dlls in the same directory, Where the dll i am created using VS.

0 Kudos
Message 1 of 9
(2,199 Views)

@Neeraj9001 wrote:

But after the parameter configuration, When i click OK. LabVIEW   not responding and crash without any error message. 

 


So it crashes when you click OK in the configuration?

 

Your screenshot seems to show the VI is running.

 

This is quite important... Please be precise and accurate.

0 Kudos
Message 2 of 9
(2,192 Views)

If it hangs when you run the VI, I can only assume getDeviceSerialNumber() is hanging in the dll. Or instantiating Cam.

 

I don't see how functions that have no input parameters would fail, there's nothing wrong to configure.

 

Start with a function that doesn't do anything. Or maybe a MessageBox. If those work, the problem is in the DLL (or in the DLL when called from LabVIEW).

0 Kudos
Message 3 of 9
(2,182 Views)

In the same dll, I tried with simple addition function it working fine.But it is not working for getdeviceserial number.

0 Kudos
Message 4 of 9
(2,169 Views)

Hi sir;

 

           We are working on two systems, In one systems LabVIEW getting not responding when we click ok button. Another system when we run the vi LabVIEW not responding.

0 Kudos
Message 5 of 9
(2,161 Views)

@Neeraj9001 wrote:

Hi sir;

 

           We are working on two systems, In one systems LabVIEW getting not responding when we click ok button. Another system when we run the vi LabVIEW not responding.


Not responding? Of a broken run arrow?

 

It's still not clear at all. You're showing a broken VI. That's not 'not responding', it's a pretty clear response.

 

If you can't run the VI a resource it missing or borken. It could be a 64 bit dll and 32 bit LabVIEW, or vice versa. Or the dll is missing a resource\dependency and can't be loaded. Or the function is missing.

 

If you can run the VI, and it hangs, something is wrong with the dll. As you have 0 parameters in, I think the problem is in the dll.

 

I never have seen LabVIEW hang when pressing OK in the configuration window, so I can't help you there. I guess it can happen if the dll uses DLL_PROCESS_ATTACH, DLL_THREAD_ATTACH, DLL_THREAD_DETACH, DLL_PROCESS_DETACH to call something it shouldn't.

0 Kudos
Message 6 of 9
(2,128 Views)

I got the solution.

0 Kudos
Message 7 of 9
(2,118 Views)

If you post it, you might help someone...

0 Kudos
Message 8 of 9
(2,115 Views)

Solution.PNG

Message 9 of 9
(2,093 Views)