LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DllMain endless loop with serveral Dll files

Actually i am developing a Teststand project, which loads 3 dll files, compiled in LabWindows CVI.

Each dll ows a "DLLMain" function as an entry point and all 3 dlls are loaded during execution in TestStand.

 

Since 2 days i get a very strange behaviour of its execution:

In some functions it appears that my source code runs finde for some instructions, but suddenly the DLLMain entry point is called again.

Further the executions doesn't run onward again, but then the DLLMain functions of my other dlls are called.

This is done as loop, and no "normal" code is executed anymore, it loops in DllMain on dll A, then DllMain on dll B, then A again, then C... very randomly.

Some days ago my project run fine without issues, but i have no idea what causes this now.

 

I use the gerneated DLLMain and DLLEntryPoint by LabWindows, so i haven't done any changes to those.

By the way, the DllMain function will be called with DLL_THREAD_ATTACH and DLL_THREAD_DEATTACH in those loops, in each dll.

 

 

I am very new in Dll programming, for sure it is something i don't notice.

0 Kudos
Message 1 of 3
(4,845 Views)

After some debugging i realize, that this happens only, if COM Port operations are executed in my code, like open, close, or ComWrtByte and so on...

If i skip those lines, my sourcecode executes without any problem. Very strange...

0 Kudos
Message 2 of 3
(4,828 Views)

We use CVI8.1 and found that the output queue option is extremely buggy, causing program crashes, etc. The only way to get comports to work was to disable the output queue length by setting to -1 when you open a com.

0 Kudos
Message 3 of 3
(4,744 Views)