07-26-2007 09:04 AM
@Ben wrote:
The initialize array stalls while allocating memory.
I seriously doubt that! 😄
A 32x32 fixed array is peanuts. Since the array size is defined with diagram constants, the entire thing will be allocated at compile tme anyway, and no initialization is ever needed at runtime.
07-26-2007 09:08 AM
07-26-2007 09:12 AM
07-26-2007 09:16 AM
07-26-2007 09:17 AM
07-26-2007 09:26 AM
Ben wrote:But the contents of the buffer are defined from a control.
I wasn't saying that the array gets folded into a constant, just that the memory footprint for it can be preallocated because it will never change at runtime. 🙂
07-26-2007 09:31 AM
I agree Christian.
I remember taking a performance hit in the Prime Factor challenge due to an initialize array. I filled it away as due to memory allocation. Small or large the call to the OS was still required (I believe).
Ben
07-26-2007 11:15 AM - edited 07-26-2007 11:15 AM
Don't know if you're still wathcing this, but I've duplicated your origianl code and added some timing code and it runs in about 20 mS for me with Snapshot disabled. If I enable Snapshot mode, the code still runs in about 20 mS, but there is indeed a delay in updating the front panel. I also see the delay go away without the init array function in there.

My best guess would be that not passing an array into the IMAQ VI is the difference. I can vary the delay by changing the size of the array to initialize. The larger the array, the longer the delay. It seems the data that it needs to process, the longer it takes to update the front panel.
Maybe the IMAQ experts will have better insite as tho what's going on and how to handle it.
This is on LV 8.2.1, IMAQ 3.7.0 running on Win XP SP2 on 2 GHz Centrino Dell laptop.
Ed
Message Edited by Ed Dickens on 07-26-2007 11:16 AM

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.07-26-2007 12:35 PM
07-26-2007 12:56 PM
Thanks for the update re:the solution!
Without it, Christian and myself would have to arm wrestle to settle this mystery. ![]()
Ben