LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW & MVTec Halcon

Solved!
Go to solution

In your code I see that you have placed set_system('thread_pool', 'false') after return, so your function returns to LabVIEW after the execution and never reaches last command. You could place set_system('thread_pool', 'false') before return and that likely should solve the problem. Or you could write additional function, say "ShutDown" or something similar, and call it when you have finished all the work with Halcon in LabVIEW. Place set_system('thread_pool', 'false') as the last operator inside this func and try.

 

P.S.: I assume you know that for true parallelization and faster image processing (especially on multicore machines inside 64-bit OS'es) you should have thread pool set to true, so set it to false only when you don't need Halcon anymore.

0 Kudos
Message 21 of 63
(6,091 Views)

I tried all the things whatever you told me but still same problem hanging issue not solved

0 Kudos
Message 22 of 63
(6,087 Views)

MTrivedi

Unfortunately I don't have PC with LabVIEW, Halcon and Visual Studio at the moment, but I could check your code later (somewhere in a week or so). Right now try to comment ClearObj statement in the end of the code.


HALCON Programmer's Guide:

All of HALCON’s classes, i.e., not only HImage, HRegion, HTuple, HFramegrabber etc., but also the class HObject used when calling operators in the procedural approach, release their allocated resources automatically in their destructor (see also section 5.2.4 on page 49). Furthermore, when constructing instances anew, e.g., by calling CreateBarCodeModel via an already initialized instance as mentioned in section 5.2.3 on page 48, the already allocated memory is automatically released before reusing the instance. Thus, there is no need to call the operator ClearObj in HALCON/C++; what is more, if you do use it HALCON will complain about already released memory. To explicitly release the resources before the instance gets out of scope, you can call the method Clear() of the instance.


0 Kudos
Message 23 of 63
(6,080 Views)

I tried as per you told me. Now hanging issue not occurred but this error popup.

0 Kudos
Message 24 of 63
(6,072 Views)

Thread pool still should be set to false in the end. And your CLFN should be configured as running in any thread (yellow color). Could you post all your code here? And what about LV code? Is it just a single CLFN or something more complex?

0 Kudos
Message 25 of 63
(6,058 Views)

It is just single CLFN. Nothing else. 

0 Kudos
Message 26 of 63
(6,026 Views)

MTrivedi

Have you done what I suggested in the last post?


@dadreamer wrote:

Thread pool still should be set to false in the end. And your CLFN should be configured as running in any thread (yellow color). 


0 Kudos
Message 27 of 63
(6,003 Views)

Yes I tried this also 

0 Kudos
Message 28 of 63
(5,996 Views)

But still same problem is occurred

 

0 Kudos
Message 29 of 63
(5,988 Views)

This is what i have done as per you suggest. But still hanging issue occurs

0 Kudos
Message 30 of 63
(5,969 Views)