Classes and Methods

The network communication interface between the Precise controller and the PreciseVision system is implemented by a Vision class and its associated objects. Its methods and properties allow a GPL procedure to establish a connection with PreciseVision, run a vision process, and obtain the results from that process.

The VisResult class defines objects that each store a single set of results from a vision tool. These objects may contain pass/fail information, location data, or general numeric data, depending on the vision tool.

Table 19-39 and Table 19-40 summarize the available members for the vision classes.  For additional details on individual vision methods and properties, please see the "GPL Dictionary."

Table 19-39: Vision Class Definitions

Vision Class Member Type Description

New Vision    

Constructor Method

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

vision_object.Disconnect

Method

Closes any open connection associated with a vision object.

vision_object.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_object.Instance

Property

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

vision_object.IPAddress

Property

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

vision_object.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_object.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_object.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_object.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_object.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 19-40: VisResult Class Definitions

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_object.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 a non-critical error occurred.

visresult_object.Info

Property

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

visresult_object.InfoCount

Property

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

visresult_object.InfoString

Property

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

visresult_object.InspectActual

Property

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

visresult_object.InspectPassed

Property

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

visresult_object.Loc

Property

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

visresult_object.ProcessID

Property

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

visresult_object.Type

Property

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