LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is an insufficient memory allocation error?

I am getting an insufficient memory allocation error at the Visa Read in this VI. I dont know whats going on because this Vi worked fine at one point and I havent changed anything. I attached it, so if anyone could help, it would be apprciated.
0 Kudos
Message 1 of 14
(4,843 Views)

I don't see anything obvious and I cannot run because I don't have certain subVIs. You read 101000 characters at one point. How big is the array?

 

There are several VISA read. Can you tell which one throws the error?

 

There are a couple of silly code constructs, but they should not cause any memory errors:

 

  • The small CPU burner loop on the upper left needs a small wait. It is sufficient to spin it every 10 ms or slower and not millions of times per second, as fast as the CPU allows, consuming 100% of the CPU.
  • Why are you converting the cast array to EXT??? DBL is perfectly fine for this.
  • Why do you convert the 2D array to dynamic data? Just wire the 2D array directly to the graph. (transpose if needed).
  • You have a couple of coercions, meaning some diagram constants have the wrong representation. Fix this, it's sloppy.

 

0 Kudos
Message 2 of 14
(4,835 Views)

That indicates that it was unable to allocate the requested amount of memory. Perhaps you have a memory leak somewhere else, or you've got too much stuff running on your machine?

 

Code comments:

  • Your sequence frame is completely unnecessary. Remove it, and the code will run exactly the same.  
  • Your case structure has cases in which the code is exactly the same. Instead of duplicating code, set the case to handle more than one case by entering multiple items in the case selector. 
  • I'm not quite sure why you have the Type Cast set to convert 4.x data. You're running in LabVIEW 8.x, and you're not reading data from a file that was written in 4.x.
  • Why are you converting to EXT? DBL would seem to be adequate, at half the memory.
  • You do not need to use Convert to Dynamic Data to send the data to the graph. Just wire the 2D array directly to the graph terminal.


EDIT: Posted at same time as altenbach. Disregard duplicate comments.
Message Edited by smercurio_fc on 07-22-2009 10:31 AM
0 Kudos
Message 3 of 14
(4,833 Views)

Wow! It took you less than 60second to copy some of my comments! LOL 😄

 

(I suspect that the 4.0 typecast is a leftover from some very old code that was originally written in 4.0 or earlier. Since we are not dealing with boolean arrays, it does not make a difference.)

Message Edited by altenbach on 07-22-2009 08:37 AM
0 Kudos
Message 4 of 14
(4,824 Views)

In your second frame, you have a constant wired up to the VISA read with a value of 101,000.  It is actually rather odd because it is set for scientific notation format.  I really doubt that your VISA port can handle that many bytes at once.

 

Try setting that to a smaller number.  Also, set the representation of the constant to U32 instead of I32 to get rid of the coercion dot.

0 Kudos
Message 5 of 14
(4,823 Views)
It happens at the VISA Read right before the case structure. The first, and I think only VISA Read in the VI.
0 Kudos
Message 6 of 14
(4,821 Views)

Check you data going to the type cast. If you try to type cast the wrong data, LV will attempt the conversion trusting that you know what you are doing. You can check the offset of teh search to determine if it found what you wanted.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 14
(4,816 Views)
What value should i set it too?
0 Kudos
Message 8 of 14
(4,812 Views)
How many bytes do you expect the instrument to return?  Are you using any termination characters?
0 Kudos
Message 9 of 14
(4,808 Views)
Ok I started building this VI by adding to a Readwaveform VI i got through the tds5xx driver. None of what I added is causing this error because 1) it worked before and 2) the original VI is putting up the same error. Here is the original VI. Maybe seeing this will help simplify things. And also, I dont know how to answer your question because I am very new to labview and I didnt change that constant value. That is what has always been there.
0 Kudos
Message 10 of 14
(4,802 Views)