Type Property
Runtime only
Applies To
Vision Objects: All Objects
Description
Returns the type of a vision object.
Usage
VGet Sequence.Object.Type, var
- Sequence
- Name of a sequence or string variable containing a sequence name.
- Object
- Name of an object or string variable containing an object name. The object must exist in the specified sequence.
- var
- Integer variable that will contain the value of the property.
Values
The returned values are shown in the following table:
Object Type | Constant | Values |
---|---|---|
Correlation | VISION_OBJTYPE_CORRELATION | 1 |
Blob | VISION_OBJTYPE_BLOB | 2 |
Edge | VISION_OBJTYPE_EDGE | 3 |
Polar | VISION_OBJTYPE_POLAR | 4 |
Line | VISION_OBJTYPE_LINE | 5 |
Point | VISION_OBJTYPE_POINT | 6 |
Frame | VISION_OBJTYPE_FRAME | 7 |
ImageOp | VISION_OBJTYPE_IMAGEOP | 8 |
Ocr | VISION_OBJTYPE_OCR | 9 |
CodeReader | VISION_OBJTYPE_CODEREADER | 10 |
Geometric | VISION_OBJTYPE_GEOMETRIC | 11 |
ColorMatch | VISION_OBJTYPE_COLORMATCH | 14 |
LineFinder | VISION_OBJTYPE_LINEFINDER | 15 |
ArcFinder | VISION_OBJTYPE_ARCFINDER | 16 |
DefectFinder | VISION_OBJTYPE_DEFECTFINDER | 17 |
LineInspector | VISION_OBJTYPE_LINEINSPECTOR | 18 |
ArcInspector | VISION_OBJTYPE_ARCINSPECTOR | 19 |
BoxFinder | VISION_OBJTYPE_BOXFINDER | 20 |
CornerFinder | VISION_OBJTYPE_CORNERFINDER | 21 |
Contour | VISION_OBJTYPE_CONTOUR | 22 |
Text | VISION_OBJTYPE_TEXT | 23 |
Remarks
Use the Type property to determine the type of an object at runtime. This is useful for generic functions such as for data logging that need the object type in order to know which properties and / or results to access.
Example
Integer i, count, objType, score
Real area
VGet seq1.Objects.Count, count
For i = 1 To count
VGet seq1.Objects(i).Type, objType
Select objType
Case VISION_OBJTYPE_CORRELATION
VGet seq1.Objects(i).Score, score
' log some data here
Case VISION_OBJTYPE_BLOB
VGet seq1.Objects(i).Area, area
' log some data here
Send
Next i
See Also
Objects Property