LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI program executes very slowly when calling a DLL built with debug support

My CVI executable has a 50hz loop (in a separate thread) that has four calls to a DLL each loop. The DLL is also built with CVI and has debug support enabled. Everything works (debugging, singlestepping into the DLL etc), but when trying to run at full speed, the executable runs VERY slowly because of the DLL being built to enable debugging. The CPU load has at most a load of 15% when it should be 100% as the program now runs at full debug speed.

- If I build the DLL for release and run at full speed, CPU is 100% as it should.
- If I build the DLL for debug and change the "CVI environment sleep policy" to "no not sleep", I also got 100% CPU load, but also 100% CPU load when editing code in CVI causing the PC to start spinning the fans loudly after a while.

I have tried to use the function call "SetSleepPolicy()", but it does not have any effect at all.

Question is, how can I have the debuggable program running at full speed (100%), without having to change the "CVI environment sleep policy" back and forth?

I have reproduced the problem by modifying a NI sample shipping with CVI.
Please, build the DLL for yourselfs in both debug and release and watch the speed of the program counter and the cpu load in the task manager. The program has to be stopped by pushing the CVI "stop" button.

Surely, there must be a better solution than to set the "CVI environment sleep policy" to "no dot sleep" and have the CVI environment using 100% when editing code?

/ Roine Stenberg
0 Kudos
Message 1 of 3
(3,377 Views)
Sorry, forgot to attach the example project file.
0 Kudos
Message 2 of 3
(3,374 Views)

*bump*

 

0 Kudos
Message 3 of 3
(3,327 Views)