In some cases we may have functions called from DLLs, which cannot be not terminated in "normal" way due to some reasons.
When source code for DLL is available, then this is not a problem, but for third-party DLLs this may be terrible.
All what we needed is Timeout for External Code Call.
Let me explain. For example, we have code like this:
when such external code called from VI, then this VI cannot be stopped
Suggestion:
add Timeout option to the following dialog:
When enabled, then the following input will be shown:
And timeout can be programmatically defined on the block-diagram:
by default -1, of course.
I fully understand, this is dangerous thing, but in some cases we needed this. Suggested is something like TerminateThread function.
Back to the code above, when this code should be terminated, then we needed wrapper something like this:
Then this function can be called in separate thread:
And now we can terminate execution with TerminateThread function:
Then in LabVIEW it looks something like this:
Now we can "Abort" our infinite DLL call without any dialogs like "Resetting VI", etc.
Again, this is dangerous feature (but not more dangerous as TerminateThread itself), and may be is necessary in the most extreme cases, otherwise the only way to stop the application is taskkill.