LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues in MultiThreading With Thirdparty Tools

Greetings,
I have an issue with running parallel loops for various kinds of data .
Each loop performs a specific R/W function such as from
various DAQ devices and Third party DLL files from Unit under test.
The problem I have is that when expecting data from UUT through the DLL
if the UUT happens to crash , the DLL Loops fails and freezes the complete
application and the PC as well. So the only way to get relieved is to kill LV.
And to mention there is no option for time out in DLL funtion call.
Need suggestions to fix this problem.
 
Regards,
Sundar.
 
0 Kudos
Message 1 of 5
(2,820 Views)
Hi Sundar,

sorry to disappoint you, but the problem seems to be related to the 3rd party DLL. So you should ask the vendor of this DLL to update it with a "better" version...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,807 Views)
The reason LabVIEW hangs is probably that the dll is running in the user
interface thread. So if it hangs, all the user interfacing hangs. If you
only have one instance of the dll in your program you can make it reentrant.

The dll will still hang, but at least you can save all your code.

The only way around this problem I can think of, is to make an executable
(in LabVIEW or C) that calls the dll. When the executable hangs, you can
kill the process :

http://forums.ni.com/ni/board/message?board.id=170&message.id=94159&query.id=114041#M94159

Or search the forum for "kill process". There seems to be a way using the
system exec.

Regards,

Wiebe.


Message 3 of 5
(2,804 Views)

Thanks for the reply,

But is there any way wherein I can only stop that particular loop (running amongst

the multiple other loops) when there is no response from it .

Regards,

Sundar.

0 Kudos
Message 4 of 5
(2,779 Views)
You mean starting several loops, and killing only the one that is hanging?

Killing one of several processes (leaving the others running) is not the
problem. Deciding which one to kill is a problem...

If it fits your application, you can monitor which one is running to long.
E.g. start them all. If one is still running while it shouldn't, kill it. If
all processes are started at random, you could try to get all process ID's
at time 1, and see which are still running at time 2. Kill those processes.

However, if normally running processes take a long time, that might not work
either. You then need some benchmark to decide which one is the problem. The
close process VI reads the windows process handle. Perhaps windows can get
some information form the process handle that your program could use to see
which process is running correctly. Perhaps GetProcessMemoryInfo? If not,
I'm not sure... How do you determine which one is hanging?

Regards,

Wiebe.


Message 5 of 5
(2,764 Views)