01-20-2010 04:38 AM
Hi,
I am actually trying to migrate all my programs from Labview 8.6 to 2009 and to validate at the same time Labview 2009 for our company.
I have without a problem mass compiled all my sources, application generated and distributed my exe on other computers without changing anything in my sources.
But after some tests, I have found that the new exe is quite slowly when calling one of our DLL.
This DLL is used to communicate with one of our product.
Example of DLL windows when updating the firwmare of the device which is slow:
Then I have tried to reproduce the phenomenon on my computer direct with Labview and I can reproduce it.
When I load and run only the VI where the DLL is called. I observe no problem.
But when I load my main VI at the same time (without runnng it) and only run the VI which calls the dll, the dll window is slowly updated.
When I strike the keyboard or move the mouse, the window (see example) is normally updated each time I strike or move.
I have tried in changing the VI priority to high but it changes nothing.
I have checked the memory and processor:
available on my computer 1GB Ram
used in Taskmanager 800MB
processor 25% when calling the DLL which is quite normal for me
With 8.6 Version memory and processor using are quite the same.
I have used this DLL with Labview version 7.1, 8.0, 8.5, 8.6 without any problem.
The DLL calls are configured with C calling convention and used UI Thread.
Q1: Someone has already observed this phenomenon?
Q2: Are there any big differences betwenn LV2009 and LV8.6 calling DLL function?
Q3: Are there any big differences betwenn LV2009 and LV8.6 managing UI Thread ?
Thanks for the help!
Yoann
01-21-2010 05:05 AM
Hi Yoann,
I have a few questions to help you out with this problem and to be sure that this problem has not been seen before.
First, when you say that the new exe is quite slow when calling a DLL, how slow is it ? Can you measure it ?
Can you post your DLL and the VI calling this DLL, so that I can try to reproduce the problem and see exactly what is going on?
Many thanks in advance,
Charlotte F. | CLAD
National Instruments France
01-22-2010 03:01 AM - edited 01-22-2010 03:02 AM
Hi,
I think it will be difficult to reproduce it because you will need one of our device.
Because of intern policy I do not think that I can send you the dll (I know without it it is quite difficult to reproduce it).
But one of my colleague has tried to solve the problem. He has changed the calling convention of the dll function with "Run in any thread" and it works correctly.
He thinks it comes from thread management between windows and Labview. I am not sure that it is really a solution (best: call dll in UI thread)
About the speed, depending of the function called form the dll, the function can be simply stopped (I have to move the mouse or strike the keyboard to go further) or it is during more than 2 times of the normal time.
Regards,
Yoann
01-25-2010 02:18 AM
Hi,
Your colleague has found the right solution. Indeed, when using run in UI thread, Labview might hang as explained here (under Thread). The solution is to use "Run in any thread" as you did!
Regards,
Charlotte F. | CLAD
National Instruments France