VGet Statement

Applies To

  • Vision Objects: All
  • Vision Calibration
  • Vision Objects: All

Description
VGet is used to get the values of properties and results in SPEL+ and RC+ API.

Usage

VGet  Sequence .Property, var
VGet  Calibration .Property, var
VGet  Sequence .Object.Property, var
VGet  Sequence .Object.Result[(resultIndex)] , var
Sequence
Name of a sequence or string variable containing a sequence name.
Calibration
Name of a calibration or string variable containing a calibration name.
Object
Name of an object or string variable containing an object name. The object must exist in the specified sequence. Omit Object if you are retrieving a sequence or calibration property or result.
Property
Name of the property to set or return the value of.
Result
Name of the result to get the value of. You can optionally specify a resultIndex for objects that can return more than one set of result data, such as Blob and Correlation. This allows you to obtain a particular result without setting the CurrentResult property. A resultIndex can be omitted.
var
Variable(s) that will contain the value(s) returned.

Remarks
VGet is a powerful part of the Vision Guide structure. It provides the core mechanism to get the property and result values from the vision objects that are run from vision sequences.

VGet can be used to get property values before running a vision sequence so that you can check the value of a specific property or even check and set it by using the VGet statement and then the VSet statement. VGet can also be used to get property values after running a vision sequence

The most common use for VGet is to get the result values from vision objects after they have been run in a sequence. This allows you to use the results to make decisions, perform calculations, define point positions and a whole host of other things. In order to use VGet with results, you must first VRun the sequence which contains the vision object for which you want to get a result from. For example, assume you created a vision sequence which uses a Blob object to find how many holes are present in a specific part. This means you will want to VGet the value of the Holes result for the Blob object. The following SPEL+ program shows how VGet would be used in this instance.

Function test
'It is assumed that a sequence called FindHoles has already been created
'prior to running this program. FindHoles contains a Blob object called Part
'which is configured to find how many holes are in the search window.we
'In this example, we will run the sequence and then display the number
'of holes which were found.

	Integer count

	VRun FindHoles                    'Run the vision sequence
	VGet FindHoles.Part.Holes, count  'Get the # of holes found

	Print count, "holes found"
Fend

See Also
VRun, VSet, Vision Sequences