CVT Instance Named

V+ discussions, tips and tricks, sample code, Q & A

CVT Instance Named

Postby icerany » Thu Mar 31, 2016 6:08 pm

Hi All,

Is it posible to get vision result instance's "Name" value with V+?

In CVT, we can set "Name" property to show on CVT result column

Instance Named.png
Instance Named
Instance Named.png (19.87 KiB) Viewed 7488 times


We found it can get name value with Process Manager and its tool.
Can V+ do same things ?
icerany
 
Posts: 54
Joined: Wed Jun 26, 2013 5:52 am

Re: CVT Instance Named

Postby Guenter Grass » Tue Apr 05, 2016 12:46 am

Icerany,

there are 3 V+ AdeptSight functions to pull data from the PC running AdeptSight.
VRESULT -> gets a real value
VLOCATION -> gets a transformation (location) value
VPARAMETER -> gets a real value
There is no string function.

Nevertheless if you are using a Custom Vision Tool you could create/access a V+ string array and put the names of the results in the array whenever writing your results into the result list.

Code: Select all
namespace Ace.Custom {

   public class Program {

      public AceServer ace;

      public VisionTransform[] Main () {
         IAdeptController adeptController = (IAdeptController) ace["/SmartController 1/SmartController 1"];
         
         ILocatorTool locatorTool = (ILocatorTool) ace["/Locator"];
         locatorTool.Execute();
         
         List<VisionTransform> results = new List<VisionTransform>();
         int i=1;
         foreach (LocatorInstance locResults in locatorTool.Results)
         {
            results.Add(locResults.Position);
            adeptController.Link.SetS("$modelname["+i.ToString()+"]",locResults.ModelName);
            i++;
         }
               
         return results.ToArray();
      }
   }
}


Note that the time to run the CVT will increase by this.

Best Regards
Günter
Guenter Grass
 
Posts: 189
Joined: Thu Oct 16, 2008 4:34 am

Re: CVT Instance Named

Postby icerany » Tue Apr 05, 2016 6:38 am

Guenter Grass wrote:Icerany,

there are 3 V+ AdeptSight functions to pull data from the PC running AdeptSight.
VRESULT -> gets a real value
VLOCATION -> gets a transformation (location) value
VPARAMETER -> gets a real value
There is no string function.


OK, we got it !!

May you add this function to V+?
It would be more extensible for it. :D

Ha ha, it just my hope.

We will using another methods to do same thing, thanks a lot. ^_^
icerany
 
Posts: 54
Joined: Wed Jun 26, 2013 5:52 am


Return to V+

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron