Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reload templates in VA?

Solved!
Go to solution

Hey!

 

 

I have one VI with one case structure with two cases. In first one I make an inspection. I use many Vision Assistant in that case. These VA's use templates located somewhere on a local disk. In the other case I make the templates that are later on used in the first case. The user presses a button when he wants to make new templates. New templates are made automatically and they rewrite the old ones, so the template paths stay the same.

 

The problem is, that VA's use the old templates, because when you run a VA the template picture is stored in RAM so that is works faster. If you don't restart the

program VA's will not actually use the new templates. Is there a way to reload the templates after the new ones are made, without restarting the program? 

 

 

Matej

0 Kudos
Message 1 of 9
(4,450 Views)

Any idea?

0 Kudos
Message 2 of 9
(4,438 Views)

We fixed that problem in Vision Assistant 2010 SP1.

In the Vision Assistant express VI, pattern matching, color pattern matching, geometric matching, shape matching and calibration steps do not use the current template file path value when the path is updated dynamically.

If you can, please give this version a try.

 

-Christophe

0 Kudos
Message 3 of 9
(4,433 Views)

Where can I get VA 2010 SP1? 

 

I have a licenced product LV 2010 with vision development module and we bought it last year.

0 Kudos
Message 4 of 9
(4,427 Views)

OK I found SP1 and instaled it, but the problem stays. I also selected Input path as a control for VA, but the problem stays.

0 Kudos
Message 5 of 9
(4,424 Views)

Is there a way to restart the program programaticaly, using some VI's? I found start and exit labiview VI's, but no restart or start. If there is a posibility to restart the program that might help me. 

0 Kudos
Message 6 of 9
(4,423 Views)
Solution
Accepted by topic author mate47

What has been fixed in 2010 SP1 is the reloading of the template if the path changes for the functions that I mentioned above.

That could be one workaround (saving the new template as a different file name). For optimization reasons, we did not want to load the template at each iteration (each time the VI is called). We added code in 2010 SP1 to reload the template if the path passed to the Express VI is different (i.e. you select a different template).

If this is not an acceptable solution, what you can do is convert the Express VI to a regular sub-VI and modify the code to reload when a flag is set, or if performance is not an issue in your application, even load the template each time the VI is called.

Is any of the solutions I am suggesting acceptable?


Christophe

0 Kudos
Message 7 of 9
(4,404 Views)

Thank you Christophe.

 

Well the performance is an issue so I can't afford to load the templates from disk every iteration. We decided that after the case where templates are made is finished a message window appears saying:" the program created new templates and need to restart. Than exit is made and the user runs the program again. It's not the best solution, but it works.

 

I like the idea of converting the VA's to VI and changing it to our needs, but what if I have to change something in the future. Using VA its so simple 🙂

 

Thank you though 🙂

0 Kudos
Message 8 of 9
(4,399 Views)

Hey!

 

I accepted Christopher answer some time ago as a solution, but I just noticed that this is not true for golden template. It doesn't reload the template if the path changes. Is there any other solution for that?

 

Cheers,

 

Matej

0 Kudos
Message 9 of 9
(4,256 Views)