05-20-2005 01:40 PM
05-23-2005 12:53 PM
02-04-2025 03:21 PM
since this last reply in 2005, has LabVIEW improved / expanded support for this situation?
02-05-2025 01:21 AM
Hi fan,
@shuttlefan wrote:
since this last reply in 2005, has LabVIEW improved / expanded support for this situation?
How should LabVIEW improve on catching errors in external code (like DLLs)?
When the code in the DLL crashes, then the whole task (including LabVIEW) crashes…
02-05-2025 01:25 AM
@GerdW wrote:
Hi fan,
@shuttlefan wrote:
since this last reply in 2005, has LabVIEW improved / expanded support for this situation?
How should LabVIEW improve on catching errors in external code (like DLLs)?
When the code in the DLL crashes, then the whole task (including LabVIEW) crashes…
Well, I've hit a case where it doesn't crash. Just part of the code is locked or prevented from responding.
https://forums.ni.com/t5/DQMH-Consortium-Toolkits/random-EHL-MHL-transition-failure/td-p/4421173
02-05-2025 01:29 AM
02-05-2025 01:43 AM
@GerdW wrote:
Hi fan,
so you don't call DLLs, but some DQMH modules?
How is this related to this old thread?
no, I am calling a dll, that's what is causing the socket errors.
So somehow, that is causing the module to be like a zombie.
How it relates to this thread is I'm trying to see how to use the DLL call with crash error handling
02-05-2025 01:53 AM
Hi fan,
@shuttlefan wrote:I'm trying to see how to use the DLL call with crash error handling
You need to avoid any crashes in that external code!
Instead of doing this in a larger DQMH environment I would test that in a small dedicated "test VI"…
02-05-2025 04:29 AM
It depends what your DLL does wrong. And it is ONLY solvable by writing your own intermediate DLL that is exactly tailored to the problems your DLL can cause.
Basically your DLL can throw C++ exceptions, which you can only catch with other C++ code written in the same C++ compiler and in some cases the same compiler version than what was used in your DLL that exposes that bad behavior.
Or it could cause Windows exceptions which you only can catch with the according Windows API functions.
Possible reads: https://learn.microsoft.com/en-us/answers/questions/2110867/exception-handling-in-windows
LabVIEW actually does this to a large extend if you set the Error Handling in the Call Library Node configuration to maximum, and for some things it can attempt to do a recovery. However, for most things such as illegal address access etc. there is simply nothing LabVIEW can do other than trying to do a crash log and let the process die anyhow. Anything else would need very detailed knowledge of what exactly was done wrong in the called code, to be even remotely able to try to recover from the error.
Generally, it is always a million times easier to debug the code that causes the crash or hangup and fix that, than trying to work around the bug after the fact. It's an enormous effort, with a very high chance to still go wrong sometimes or even most of the times, depending on the moon phase or the health of the dog of the operator! 😁
That's why LabVIEW even after 25 years hasn't really been able to "fix" such errors!