Vision_Object.ResultCount Method

Gets the number of results generated by a vision tool in the last executed vision process.

...vision_object.ResultCount( vision_tool_name )

Prerequisites

A Process method must have been executed using the vision_object and the execution must be completed.

Parameters

vision_tool_name

An optional String expression that specifies the name of a specific PreciseVision tool that was executed in the vision process associated with vision_object. The tool name must match one of those listed in the PreciseVision "Process Manager" window for the executed process.  If a tool name is specified, the number of sets of results generated by that tool will be returned.  If omitted, the number of sets of results for the final tool in the vision process is returned.

Remarks

This property returns the number of sets of results generated by a vision tool. This is the same value as the PreciseVision ResultCount tool property. 

A value of 0 indicates that no results are available or that some type of error occurred when the tool was executed.  Depending upon the basic type for the vision tool, zero, one, or multiple sets of results may be generated each time the tool is executed.  For example, the tool that extracts the best fit line (i.e. the Line Fitter) will return at most one set of results if a line can be fit or none if it is unsuccessful.  On the other hand, the general tool that locates parts (i.e. the Finder) can generate dozens of sets of results if multiple identical parts are in the camera's field of view.

If one or more sets of results can be accessed, the Result method should be called as many times as necessary to fetch the data for each set of results.

This property performs communications with PreciseVision. If an Ethernet network connection does not exist, a connection is automatically established.  If a connection cannot be setup or the communication link fails for any reason, this method will throw an exception.

Examples

Dim vobject As New Vision
Dim vresults As VisResult
Dim
ii As Integer
Dim
results As Integer
vobject.Process("find_part")

results = vobject.ResultCount()

For ii = 1 To results

vresults = vobject.Result(,ii)
' Process results

Next ii

See Also

Vision Classes |vision_object.Status