LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build array out of memory


@brian19876 wrote:

if my que status never goes above 0 what else could be causing me to get memory full message


That would imply that you are not putting anything into your queue at all.  Where are you reading the queue status?

 

Based purely on your example, the only thing that would cause memory to grow is that queue.  You will need a not-so-simplified code set for us to diagnose your problem any more.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 28
(1,880 Views)

here is a copy of my code im having memory problems with i know it is messy this was one of the first things I did in labview about 2 months ago

0 Kudos
Message 12 of 28
(1,876 Views)
  • What is happening in the subVI you have not attached?
  • Why don't you use a culster input in the subVI instread of all thse boolean connectors? Use an array of readings as output.
  • So you are running this every 10ms. Can you measure the actual loop rate? Maybe the subVIs get slower and slower due to memory issues? Is the subVI reentrant?
  • Can you show us the subVI code?
  • You really need to use lowlevel file IO as already explained.
  • What's up with all these coercion dots? Why are some wires SGL and some DBL?
  • Why is there so much duplicate code?
0 Kudos
Message 13 of 28
(1,865 Views)

here is my subvi

a cluster would be better you are right

read time frome devices are aroun 2 seconds

sub vi is reentrant

Have to look into to coercion dots

dup code was trying to read from all 10 device as fast as i can

0 Kudos
Message 14 of 28
(1,855 Views)

Actually, use an array for all of the booleans going into the subVI.  You can replace most of your code in the subVI with a FOR loop.  Why?  Notice that all of your case structures that are strung together are exactly the same, just slightly different inputs to look at.  Using an array of booleans, you can autoindex and run as many iterations as you need without any extra code.  I would also then change your numeric outputs to be an array as well (autoindex output tunnel on the FOR loop).

 

Duplicate code = subVI (make it reentrant if needed).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 15 of 28
(1,843 Views)

Do you see anything in my code that might be causing a memory leak

0 Kudos
Message 16 of 28
(1,836 Views)

As crossrulz said, arrays will simplify your code considerably. Also you seem to have an aversion to straight wires (although that may be due in part to the stupid autowiring tool).

 

Lynn

 

 gas cleaned up.png

0 Kudos
Message 17 of 28
(1,827 Views)

Your subVI contains missing subVIs. Why is there a coercion at the visa resource going into them?

0 Kudos
Message 18 of 28
(1,821 Views)

I wanted to subscribe to this thread, just in case it gets interesting Smiley Wink.

 

But I do have a question.

[crossrulz said:]
> since you probably don't want to be losing data. do NOT stop the consumer loop with the error by releasing
>the queue once the producer loop is complete.

If the producer loop is complete (and therefore no longer producing data), how can data be lost?


steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 19 of 28
(1,803 Views)

Looks alot better and more simple than my layout but if i run this program i sent you after a hour i will use 250mb more ram and after 6-8 will get out of memory that why i was asking if you seen any where there could be a memory leak. Its driving me crazy

0 Kudos
Message 20 of 28
(1,796 Views)