06-03-2011 05:31 AM
Hey 🙂
We have a very complex program that I am not allowed to show. I created a smaller project just to clear the problem. I attached the project so we can discus it. Before doing anything please read the text and follow the procedure below.
The main.vi is the basic program. In the VA a pattern matching and golden template is used. They both use their own template located in \rastart\templates. Our program has the ability to create new templates if you press Templates button on front panel of main.vi. If you want to use the new created templates in the VA either the path needs to be changed or the program needs to be restarted (see http://forums.ni.com/t5/Machine-Vision/How-to-reload-templates-in-VA/m-p/1560528#M32117). To make a restart without closing the Labview we used this solution --> to run another VI (restart.vi) and stop the program (abort actually), the restart.vi waits for 200ms than it runs the main VI again. This works fine and the new templates are actually used in VA. No problem here. But the problem appears if we make a dispose all images just before we run the restart we. I don't know what happens, but the newly created templates are not used the second time the main.vi is running.
To correctly run the program I suggest the following procedure:
- download rar file by clicking: http://dl.dropbox.com/u/2051018/rastart.rar
- extract it to your disc
- open the project
- open main.vi
- correct all the paths so the images and templates will be found (in both VAq's, inside VA - pattern matching template path and golden template path, inside Lear vision info sub vi, and other paths in main) - be careful to set all the path correctly according to where your project is located on your disc.
- open druga folder
- open 7.jpg with windows paint
- draw something with black marker and save it - this is the mask that is going to be used on the templates.
- run main.vi and observe the Image out 2 - old template is used
- click Templates button on front panel of main.vi - new templates are created (takes some time, be patient) and restart is done
- the new templates are used now - you can see the extra drawing on Image out 2 that you draw
So everything was OK, the new templates were created and they were used in the VA. Now lets use Imaq dispose just before the restart.vi is started. I created a extra frame there, just put Imaq dispose inside and set the dispose all images to true. Now do the above procedure once again and you will see that the templates are not used now. I don' t know what happened. Can someone explain?!
Cheers,
Matej
09-12-2011 01:44 AM
Hi mate47,
I've just found this thread, still no answers after 3 months. Were you able to solve this issue?
Best regards,
Daniel
09-15-2011 03:32 AM
Not really..