LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView file size increases dramatically upon adding producer consumer loop.

Hi All,

 

I am trying to write a code for recording from a Gige camera using NI-IMAQdx (LabView 2018). I am having a trouble loading my labview file as it became huge once I added a producer-consumer loop (at least that is what I think...). I am attaching images of the relevant portion that changed between two VIs that changed the file size from 109 kb (attached) to 75 mb (too big to be attached). Can some one please explain what is going on and how to fix it?   

VI-1 File size 109kb.PNG

VI-2 File size 74932kb.PNG

  

0 Kudos
Message 1 of 6
(1,748 Views)

Does e.g. the image (or other indicators) contain huge amounts of default data? Are you separating compiled code?

If you look at "vi properties...memory usage", where is most of it used?

0 Kudos
Message 2 of 6
(1,726 Views)

Your attached code looks quite flawed and has some weird circular logic. Whenever "shutdown" is enqueued, the upper loop (containing the event structure) completes, so why would you send a value signaling to the "StopVI" boolean in the shutdown state? That event can never fire because the event structure is no longer in the execution path. Also a "switch until released" mechanical action is somewhat unusual, again because it creates two events (one on press, one on release) and the second one is again guaranteed to be missed. You could use plain latch action since you don't need the property anyway.

 

I sort of see what you are trying to do with the error detector in the lower loop, but I am sure there are better ways....

0 Kudos
Message 3 of 6
(1,720 Views)

Without being able to see the VI, or even inside other frames of what you took the screenshot of, it is very difficult to make a guess.

 

However, within the very limited view given, I'd start by deleting this constant and see how much disk space that saves when it's gone.

 

Kyle97330_0-1605816089535.png

 

It might make your VI un-runnable, so make sure you can revert to a backup version if it breaks anything.

Message 4 of 6
(1,697 Views)

Thanks Kyle. This fixed the issue. I just ran a for loop to generate the array instead of setting it as a constant and that reduce the file size to 125 kb !!

0 Kudos
Message 5 of 6
(1,647 Views)

Hi altenbach,

 

The way I thought about it is, what if there is some error in the consumer loop that generates a shutdown state (not incorporated yet). for example, camera initiation did not work and the code needs to shutdown. So there wont be any user event of clicking the stopVI button. So I need something to stop the producer loop. That is why I created short of a virtual click event. 

Having said that, I am fairly new to labview and any suggestion to streamline the code are welcome. I am attaching the new code that is now much smaller in size after the array constant is replaced.

0 Kudos
Message 6 of 6
(1,642 Views)