Vision Classes Summary

The following pages provide detailed information on the properties and methods for the classes that implement the interface to the PreciseVision machine vision system.

This interface includes two classes:  the Vision Class that manages communications between GPL and PreciseVision and the VisResult Class that stores a single set of results from a single vision tool. As a convenience, there is no explicit method for connecting to PreciseVision.  Whenever the Vision methods Process, Result or ResultCount are executed, GPL automatically establishes a connection to the vision system. Table 23-108 and Table 23-109 summarize the properties and methods for each Class, which are described in greater detail in the following sections.

Table 23-108: Vision Classes Member

Vision Class Member Type Description

New Vision

Constructor Method

Creates an empty Vision object. Does not communicate with PreciseVision.

vision_obj.Disconnect

Method

Closes any open connection associated with a vision object.

vision_obj.ErrorCode

Property

Returns the numeric error code for the last executed vision process. A value of 0 indicates success; a negative value indicates an error.

vision_obj.Instance

Property

Sets and gets the number of the PreciseVision instance that is associated with a vision object.

vision_obj.IPAddress

Property

Sets and gets the IP address of the PC that is running the PreciseVision application software associated with a vision object.

vision_obj.Process

Method

Requests that PreciseVision execute a vision process and waits for it to complete. Connects to PreciseVision if there is currently no connection.

vision_obj.Result

Method

Returns a VisResult object that contains a single set of results from a previously executed vision tool.  Connects to PreciseVision if there is currently no connection.

vision_obj.ResultCount

Method

Returns the number of sets of vision results created by a vision tool the last time it was executed.  Connects to PreciseVision if there is currently no connection.

vision_obj.Status

Property

Returns a numeric value indicating the status of a vision process:

0 = No vision process for this object,
1 = Process is running,
2 = Process complete but with error,
3 = Process complete with success.

vision_obj.ToolProperty

Property

Sets or gets a property value of a PreciseVision tool or a general "system" property for the vision server connected to a vision object.

 

Table 23-109: VisResult Class Member

VisResult Class Member Type Description

New VisResult

Constructor Method

Creates an empty VisResult object. Not useful since VisResult objects are normally created by the vision_object.Result method.

visresult_obj.ErrorCode

Property

Returns the numeric error code for this result. A value of 0 indicates success; a negative value indicates an error. A positive value indicates success with a warning.

visresult_obj.Info

Property

Returns the nth numeric information field contained in this set of results.

visresult_obj.InfoCount

Property

Returns the number of numeric information items in this set of results.

visresult_obj.InfoString

Property

Returns a String value if the set of vision results includes text information.

visresult_obj.InspectActual

Property

Returns the value of the tool property that was tested in the vision inspection process.

visresult_obj.InspectPassed

Property

Returns True if a property of the vision results satisfied the tool's vision inspection criteria.

visresult_obj.Loc

Property

Returns the position and orientation from a set of results as a Cartesian Location object.

visresult_obj.ProcessID

Property

Returns the ID of the vision process that generated the result.

visresult_obj.Type

Property

Returns the type of this set of results. Currently always zero.