LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Array initialization takes very long in LabWindows 5.5

My project has a number of 2 dimension arrays. I use nested loops to initialize them. In LabWindows 5.0, running in debug mode, my project would initailize in a few seconds. In 5.5, initializing just 1 array takes 30 seconds, and I have over a dozen. Is there any way to speed this up?

More info: The arrays are 640 x 480. I use them to detect if the mouse is over a control. I initialize them to 0, then fill in at controls xy coordinates with the control's handle. At the time i started this project, I couldnt find any other way to do that in 5.0.
0 Kudos
Message 1 of 7
(3,932 Views)
In order to speed the initialization turn off the debug mode. For the control of the mouse position over your control, use a timer events control and select the appropriate delay for the call of the function attached to it. The function you have to
call with the timer is GetRelativeMouseState with 0 for the controlID argument to refer the position to your panel. This function will return the position of the mouse. You have to test if the position is in rectangles defined for all your control (use
RectContainsPoint for the check)
if you have problems to undersatnd my english
(I'm french...) send me a mail at arnaud_susset@hotmail.com

Good Luck

ArnO
0 Kudos
Message 2 of 7
(3,931 Views)
I use a number of arrays for video capture (640x480) and have not noticed any great slow down with CVI 5.5.
As noted try turning off the debug and see if that helps. If it does help then check what is in your WATCH window. If your array is being watched then CVI (in debug) has to update the watch for each time through your loop.
0 Kudos
Message 3 of 7
(3,931 Views)
Maybe I should have stated this: I need to run this in debug mode, so I can set breakpoints, check variables, etc.
0 Kudos
Message 4 of 7
(3,931 Views)
I just fixed it, I removed all the variables from the watch window, it now runs very quickly. Thanks for the help!
0 Kudos
Message 5 of 7
(3,931 Views)
Hello,
 
I see a similar problem. I have a "for" loop, which I use to bulid a tree and it only loops a few times but, it takes about 7 seconds when "no" break point is added. It runs faster with a break point?!?! It seems to me that the 7 second time is consistent with the time delay that other people have seen with this problem! Could this be a bug?!
 
I have used "SetSleepPolicy" to set the sleep to "None" before I enter the loop but, that did not help either. There are no items in the watch window but, I do need to run the application in debug mode so "Release" is not an option (It does help though).
0 Kudos
Message 6 of 7
(3,858 Views)
Nastaran informed me that she was able to solve this problem by creating a new project, readding all the support files and rebuilding the project.

Doug M
Applications Engineering
National Instruments

Message Edited by Doug M on 08-25-2005 04:11 PM

Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 7 of 7
(3,848 Views)