08-29-2011 07:15 AM
Hello,
i was trying to run the code below but always i get error " Not Enought memory to perform"
I dont know why is so?? Its to simple operation i am trying to do...
Thanks so much...
Solved! Go to Solution.
08-29-2011 07:23 AM
Your VI has some major flaws. In addition to this, i cannot see what you are trying to accomplish with it.
a) You are creating an "evergrowing" 2D array. Your computation will never result into an equal for stopping the loop. This must blow memory.
b) Comparing floating point numbers to floating point numbers is always a bad idea.
c) Please try to make the code more readable by simplifying it (remove unnecessary computations) and try to keep wires free of bends.
hope this helps,
Norbert
08-29-2011 07:32 AM
2170E+6 is the start freq and with 1 MHZ step size i hv to gather all freq till 12750E+6 with step size of 1 Mhz...
So now i guess i am bit clear...
thanks
08-29-2011 07:37 AM
No, it is not clear. What do you want to have as a result of this VI? What should be the content of the array?
Norbert
08-29-2011 07:40 AM
Hi,
All The number from 2255E+6 till 12750E+6 with step size of 1E+6
thanks a lot
08-29-2011 08:02 AM
This is what you need:
Note that you are possibly discarding/adding "steps" caused by the type cast from double to integer.
Another note: given your start and stop value and Delta_f, you will get 10495 steps. This seems rather high. Intended?
Norbert
08-29-2011 08:06 AM - edited 08-29-2011 08:08 AM
Wouldn't this do the same thing:
08-29-2011 09:41 AM
pals wrote:i was trying to run the code below but always i get error " Not Enought memory to perform"
I dont know why is so?? Its to simple operation i am trying to do...
You already got good solutions, but here's a quick analysis of your original program:
You are building a 2D array that grows with every iteration of the loop, because each new row is one element larger than the previous. This leads to incredible memory thrashing. The final content of the output tunnel is a 2D array with about 110 million DBL elements, taking about 900MB for a single copy in memory. This will not fit because arrays need to be contiguous in memory.
Obviously, you don't understand the "initialize array" primitive. Make sure you become familiar with basic array operations.
On an infinitely larger and more powerful computer in the far future, your loop would come to a stop just fine. Comparing DBLs is safe if there are no fraction involved (and you are not exceeding the resolution of the mantissa) as in this case. Still, if you make a mistake with inputs, it is possible that the stop condition is not matched because it could be between elements. It is always safer to do a "larger or equal" instead of an equal in such a case.