Using Sequence Results in SPEL+

After running a sequence with the VRun command, there are several results that can be used in your SPEL+ program. The VGet command is used to read results and properties. One of the most common results to use for robot guidance is the RobotXYU result. For example:

Function getPart  
  #define PICKZ -100.0  
  Boolean found  
  Real x, y, u  
  
  VRun findPart  
  VGet findPart.corr01.RobotXYU, found, x, y, u  
  If found Then  
    pick = XY(x, y, PICKZ, 0)  
    Jump pick  
  EndIf  
Fend  

Notice in the example above that the found status is checked before moving the robot to the position found by the vision system. It is important to verify that a vision object was found before using its results to move the robot.