LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Reentrant and dll file, Fatal Internal Error MemoryManager.cpp

Solved!
Go to solution

Hi there,

 

I have a vi that calls 4 instances of one subvi.  I've made that subvi and all its subvis reentrant.  In a subvi is code that accesses a dll file.  When I run the vi, the program will run fine for about 30 seconds.  Then I get the Fatal Internal Error: "MessageManager" line 437.

 

When I go into the code and comment out the dll stuff, the program works fine, so I'm pretty sure that the problem is there.  Is there something I need to do to make dll file use reentrant-friendly?

 

Thanks,

Jing

0 Kudos
Message 1 of 4
(3,520 Views)
Solution
Accepted by topic author jinglebells
Jinglebells-

You can set your Call Library Function Node to call the DLL in separate memory space.  You can do this by opening the Call Library Function Node>>Function Tab>> Select “Run in any thread”.  For additional information on this, please take a look at the Help (button next to OK and Cancel).  It provides further detail on the different selections available within the Call Library Function Node.
Regards,

Mike S
NI AE
0 Kudos
Message 2 of 4
(3,484 Views)

jinglebells wrote:

Hi there,

 

I have a vi that calls 4 instances of one subvi.  I've made that subvi and all its subvis reentrant.  In a subvi is code that accesses a dll file.  When I run the vi, the program will run fine for about 30 seconds.  Then I get the Fatal Internal Error: "MessageManager" line 437.

 

When I go into the code and comment out the dll stuff, the program works fine, so I'm pretty sure that the problem is there.  Is there something I need to do to make dll file use reentrant-friendly?

 

Thanks,

Jing


Sounds either like your DLL is messing up something (say bug here!) or is not multi-threading safe or something. Did you configure the Call Library Node to run in any thread already as Mike S kidly suggested. If you did and the error occurs, I would say your DLL has some serious multi-threading issues and is not able to cope with being called from different thread contexts or being called simultanously from more than one place. Setting the Call Library to Run in UI thread should remedy that, but will of course prevent reentrant calls to your DLL. But if it can't handle reentrant calls then you shouldn't try to call it that way.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 4
(3,467 Views)
Thanks for the help!  i didn't notice the Run in any thread option.  It works great now.
0 Kudos
Message 4 of 4
(3,434 Views)