Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

call template editor

Solved!
Go to solution

Hi all!

I have been using NI Template Editor for a long time. It is a very very useful program, and it can be called form VA / VBA. Thats the reason why it is so useful. I would like to know how should I use this function/program from my own code. ( call parametrized Template Editor  e.g. form my pattern matcher program like in VBA/VA - for current Image.) 
I used system execute vi- which run standard *.exe files , but in this case, image file must be selected.

I would like to know how should I use T.E. in my own program, as flexible as possible like, VA/VBA - for current image!

Thank you very much!!!

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 1 of 24
(7,089 Views)
Solution
Accepted by topic author D60

Hi Durnek,

 

As far as I understand, you want to develop an application in LV which does Pattern Matching.

For this, you need a Template which you define in Template Editor.

In delopyed applications, the templates are predefined, in which case Template Editor is a great tool, but does not need to be called with every run.

 

Still, We have encountered similar requests, and we also have a product suggestion to embedd Template Editor in LV, just like VA.

We are hoping this feature will be available in the future.

 

Until then here are some parameters that could be called 🙂

 

 /new:path -pm -gpm -gpm2 -d
launches the editor and opens the image located at the specified path.

The parameters -pm -gpm -gpm2 and -d are optional and allow to create a template of type pattern matching, geometric matching (legacy), new geometric matching and defect inspection respectively.
You can combine those parameters to create a template of the desired type. Only the specified tabs will be enabled. If you don't specify any optional parameters, all tabs are available.


/edit:path
edits the template located at the specified path.

This is the responsibility of the user to save the template manually within the interface, since the training interface is called by command line and there is no way for the calling application to know if the user OKs or cancels the editor.

One important point regarding calling the template using a command line: if the path contains a space, you need to use quotes, so that the exec knows that this is only one parameter.
For instance:

"Path to template Editor\NI Vision Template Editor.exe" "/new:D:\Images\8 bit\image.tif" -pm -gpm -d

 

Please reply if this fits your application needs 

 

Best regards,

Mircea

 

0 Kudos
Message 2 of 24
(7,065 Views)

Except for the first smiley, ignore all the rest and replace them with  :   😛  = : p

                                

0 Kudos
Message 3 of 24
(7,063 Views)
Hi Master! 🙂

Thank you for your reply! I will try it soon!!! 

You are great! 🙂
---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 4 of 24
(7,061 Views)
Hi! I have tried it, and works perfectly!!!!! Thank you very very much!!!!
---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 5 of 24
(7,015 Views)

I am glad I could help.

 

Have fun with your application 🙂

 

Emil

0 Kudos
Message 6 of 24
(7,003 Views)
Hello!

Let me ask you, do you know any useful parameters else? 🙂
---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 7 of 24
(6,968 Views)

Hello,

 

Unfortunately this is the only data that was documented internally by R&D.

It will be released public in future versions of Vision, probably Template Editor will be available as an Express VI in LV.

As an idea, what other parameters would you be interested in?

 

Thank you,

Emil

0 Kudos
Message 8 of 24
(6,966 Views)
For example, when I save a template and close TE., I would like to know where was it saved.... 
---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 9 of 24
(6,965 Views)

I would go for :

 

/edit : path
edits the template located at the specified path.

This is the responsibility of the user to save the template manually within the interface, since the training interface is called by command line and there is no way for the calling application to know if the user OKs or cancels the editor.

One important point regarding calling the template using a command line: if the path contains a space, you need to use quotes, so that the exec knows that this is only one parameter.
For instance:

"Path to template Editor\NI Vision Template Editor.exe" "/new:smileyvery-happy::\Images\8 bit\image.tif" -pm -gpm -d

 

Organize a small file structure of your application, having a dedicated folder for  templates.

 

🙂 Hope it will be useful,

Emil

0 Kudos
Message 10 of 24
(6,963 Views)