Stan West Posted September 7, 2006 Report Share Posted September 7, 2006 The attached VI contains a MathScript node that creates a range with an empty matrix as the start index. Rather than raising an error in an error cluster, MC_Range tries to initialize an array of size 2147483647; LabVIEW then halts VI execution and raises a dialog box that reads, "LabVIEW: Memory is full. VI 'MC_Range Test.vi' was stopped at Initialize Array 0x430C of subVI 'MC_Range.vi'." The same problem occurs if the step or end of the range are empty. Download File:post-4854-1157639128.vi Quote Link to comment
Ton Plomp Posted September 8, 2006 Report Share Posted September 8, 2006 array of size 2147483647 Hi Stan, your VI doesn't open well on my machine but I think this is totally normal, you are creating an array of 2 G datapoints. With just normal U16 datatype you need a memory of 4 GB, for standard floating points (DBL) you need 16 GB memoryspace (timestamp 32 GB). The reason LV stops and not creates a 'normal' error is because the memory managemend is violated, it could be that LV just executes and want to allocate the memory, your OS is handling that (and can create extra memory on disk. What if LV continued and you didn't check for an error (even more the standard way to initiliaze an array has no error output then the function of your program was totally unreliable. Ton Quote Link to comment
Stan West Posted September 12, 2006 Author Report Share Posted September 12, 2006 Ton, I agree that the memory error makes sense when such a large array is being initialized. However, my concern was not with that error itself but rather that such a situation (and a terminal error) would arise simply because one parameter of the start:step:end range operation is an empty matrix. Now I created such a situation accidentally, due to an error in my prior code, and having an empty matrix in a range doesn't seem useful, so this specific condition may be uninteresting in practice. Nevertheless, I would rather see MC_Range.vi behave better for odd inputs. For comparison, the behavior of Matlab 7.0 is as follows: >> range=[]:1 Warning: Colon operands must be real scalars. range = Empty matrix: 1-by-0 Apparently, it prints a warning to the console but otherwise continues execution with a type of empty matrix as the range result. Quote Link to comment
Ton Plomp Posted September 15, 2006 Report Share Posted September 15, 2006 >> range=[]:1 Warning: Colon operands must be real scalars. range = Empty matrix: 1-by-0 Apparently, it prints a warning to the console but otherwise continues execution with a type of empty matrix as the range result. I'm not sure if that is the result I want (a bug being ignored). But I think NI will improve the mathscript node step by step and eventually will cover these things. Ton Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.