VGet Statement
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.
'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
182 Vision Guide 5.0 Reference (Ver.5.3) Rev.1