From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control (Enable/disable) Image Caching in VA?

Hey! 🙂

 

If I right click on a VA I can enable or disable Image Caching. A new feature presented in August 2010. Good. But 🙂 Is there a chance to control this ability when the program is running? I don't want to go into details of my application but most of the time I want to disable Image Caching, but sometimes I want to enable it - depends on what the user is doing in a program. 

 

Thnx!

0 Kudos
Message 1 of 4
(2,833 Views)

Hi Mate47,

 

I started to investigate your issue.

I converted an already set up Vision Assistant Express VI to a regular subVI with image caching enabled and and to another with image caching disabled. After that I compared the two subVIs with the built-in compare function. The only difference I've found in the code is the value of the "backup copy" boolean constant near the leftmost case structure (image caching enabled - TRUE constant, image caching disabled - FALSE constant). It stands to reason that this constant is responsible for the enabled/disabled state of the image caching.

So I propose that you convert your Vision Assistant Express VI to a regular subVI and add an additional terminal for this value.

 

If you have any further questions, feel free to ask!

 

Daniel

Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
0 Kudos
Message 2 of 4
(2,823 Views)

Hey!

 

I created a VA, converted it to subVI and timed how long it takes to analize the picture. When this boolean constant is set to TRUE it takes about  480-510 ms and when its set to FALSE it takes about  460-480ms. the diference is actually very small so I am still not sure...

 

Matej

0 Kudos
Message 3 of 4
(2,798 Views)

The purpose of Image Caching is to make a backup copy of the image, before the VI is processed, so that the next time you edit the Express VI, we can open Vision Assistant with that image. This feature is useful when you work on your diagram and need to edit the Express VI multiple times.

Once you're happy with the vision algorithm you designed in the Express VI, and don't need to configure it anymore, you should turn image caching off.

As you mentioned when image caching is enabled, you will get very little runtime overhead (in terms of execution time), but it will make an unnecessary copy of the image. The overhead in memory footprint can be a problem if

1) you need to run the VI on a real-time target with not a lot of memory.

2) you're dealing with big images.

3) you have multiple Vision Assistant Express VIs, as each of them will keep their own backup copy if you don't disable it.

 

You don't need that feature at runtime. You should not need to turn it on or off. If you really want to do it. Daniel pointed out the way to do it.

 

Hope this clarifies the use of this feature.

 

Best regards,

 

-Christophe

0 Kudos
Message 4 of 4
(2,793 Views)