Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW hangs on IMAQ call


@mawodorfer2 wrote:

Lately, I have the same Problem with hanging IMAQ Copy.vi. Any suggestions?


Well, IMAQ Copy contains thread-safe call, but access to the pixels is critical section and internally locked with semaphore.

I can show it with pretty simple example:

Screenshot 2021-05-04 13.36.31.png

In the upper while-loop I will perform IMAQ Copy, as fast as I can, without any sleeps. In the second cycle I will perform Median filtering with huge kernel (31x31). This take roughly 600-700 ms for 2048x2048 image (on my PC) and you will see that the execution of the IMAQ Copy is paused as long as I staying inside of IMAQ NthOrder. This is expected result:

 

Screenshot 2021-05-04 13.43.25.png

 

So, may be you have somewhere in your application another thread, which perform similar "locking". It could be also acquisition loop, which will wait image from the camera and will perform lock of the image for whole time.

 

Try to strip down your application until you will get well reproducible issue. Theoretically it could be also interference with other functions (because I don't know deep details how the blocking is implemented internally).

0 Kudos
Message 11 of 24
(2,043 Views)

Blocking while waiting for an image from the camera does not hold any lock on the image itself, until the point the image is ready to be copied into.

0 Kudos
Message 12 of 24
(2,029 Views)

If you can attach a mini dump of the LabVIEW process when it is in a hung state, someone can take a look at what is blocked.

0 Kudos
Message 13 of 24
(2,028 Views)

It seems that there is a more serious problem with the LV Dev System.

 

I recompiled module by module and did a mass compile for all my base packages in LV2020x64. LV hangs randomly during the mass-compile. I have to kill the process and start over. No clues are shown, what the problem might be.

 

Note: all this code worked pretty well for the last time and there where never problems like that. So the problem might be with Labview or maybe a Windows update?

 

Is there a way to change some settings for mass compiling, so that I might be able to narrow down some possible error?

0 Kudos
Message 14 of 24
(2,017 Views)

@mawodorfer2 wrote:

LV hangs randomly during the mass-compile.

 

Is there a way to change some settings for mass compiling, so that I might be able to narrow down some possible error?


There are not so much options. You can enable logging, then probably can get feeling which VI caused this problem (at least last successfully compiled VI from the log). You can also try to disable caching (will be much slower, but probably better). Personally I would to recommend to perform clean Windows Install (out of the box, without updates), then LabVIEW install, then check if the problem still present or not. Good idea to use Virtual Machine like VMWare or VirtualBox - then you can make snapshots of the last successful config.

0 Kudos
Message 15 of 24
(2,006 Views)

I was setting up a clean Windows 10 in a VMWare and installed LV2020x64 SP1 with NI Vision SP1.

 

And I got the same behaviour than before. Randomly, IMAQ function calls hanged. Sometimes at startup, sometimes during operation, sometimes at cleanup.

 

As far, I protocolled freezes in "copyImage.vi", "getImageSize" and a few more.

0 Kudos
Message 16 of 24
(1,992 Views)

Update:

I re-compiled my LV2020x64 project already many times - no improvements. The project randomly hangs in IMAQ calls.

 

When I saved my project to LV2018x32 everything worked fine again. Unfortunately I can not use 32 bit version of Labview (due to memory limit) and the 64 bit version of LV2018 does not support a needed toolkit.

 

After getting the working 2018 version of my project, I upgraded it again to LV2020x64 (including re-compiles). On first mass compile, I got some insane object errors. On second mass compile I got only one persisting insane object error. On third mass-compile, the comilation hanged itself up.

No improvements, when I re-worked the insane objects that where reported (by the way).

 

I tried to find out, if there where any changes between 2018 and 2020, that might affect my code, but did not find any clue (only, that there might have been changes in type descriptions somehow ...)

 

There is one class (managing my images), where I use a typedef to generate a DVR (I use this to generate a call-by-reference class). This class is instanciated several times. The interesting thing is, that from LV2018 to LV2020 a coercion dot appears when setting the DVR reference to the Labview class data. I have no idea why...

If I remove and re-insert the typedef in the DVR in LV2020, the coercion dot disappears. But the problem with hanging in IMAQ calls persist.

 

Any further suggestions?? I am running out of options and ideas ...

0 Kudos
Message 17 of 24
(1,904 Views)

Can you create a dump file of the LabVIEW.exe process when it is hung? You can right click on the process in Task Manager and select Create Dump File.

0 Kudos
Message 18 of 24
(1,891 Views)

I do not know if a dump file will help since Labview does not entirely hangs.

I still can work my way through the VIs to find those, with the hanging IMAQ call (see some screenshots attached)

0 Kudos
Message 19 of 24
(1,886 Views)

If you create a dump file, it will allow NI to see where in the Vision library it is hung.

0 Kudos
Message 20 of 24
(1,884 Views)