The following pages describe how to access the PreciseVision machine vision system from a GPL procedure and use the vision data in a motion application.
PreciseVision is a software application that runs on a PC. The PC, in turn, is connected to cameras that acquire images to be processed. The vision processing performed by PreciseVision is specified in terms of "vision tools" and "vision processes". Details about how to setup and program PreciseVision may be found in the PreciseFlex Library, under "PreciseVision Machine Vision System."
In order for GPL to send commands to PreciseVision, GPL must know the IP address for the PC that is executing PreciseVision. This value is specified in the Configuration and Parameter Database in the "Vision server IP address" (DataID 424).
Table 19-38 summarizes some of the concepts related to vision operations that are mentioned in this section.
| Concept | Description |
|---|---|
|
Client |
A process that makes requests to a server and handles the responses. Normally a client initiates all communications and does not receive data except in response to a request. |
|
Server |
A process that responds to requests and sends responses. It normally does not initiate I/O. |
|
Vision Tool |
A single operation executed by PreciseVision. A typical tool might find an object (e.g. a Finder Tool), measure a dimension (e.g. an Edge Locator) or locate a key feature (e.g. a Line Fitter). |
|
Vision Process |
A series of vision tools performed on an image by PreciseVision. The tools in the process normally produce Vision Results that are used by a GPL procedure. |
|
Vision Result |
The output of a Vision Tool that is executed by PreciseVision. A set of Results may contain pass/fail information, location data, or general numeric data. Some tools only generate a single set of results (e.g. a Line Fitter) while others generate multiple sets of results (e.g. a Finder). A single set of results is normally stored in a VisResult object in GPL. |
When active, PreciseVision acts as a server that fields requests from client GPL procedures. These client GPL procedures execute on a Precise Controller and communicate with the PC via Ethernet. By designing GPL procedures as clients of PreciseVision, GPL procedures have complete control over when pictures are taken and processed.
To take a picture and analyze its results, a GPL procedure issues a command to PreciseVision to execute a "vision process". Normally, a vision process consists of a tool that takes a picture (i.e. an Acquisition Tool) followed by additional tools to process and analyze the picture. In the simplest case, a vision process consists of a single tool that operates on an existing picture. At times, a process can be quite complex and might contain dozens of tools that inspect multiple features of parts to verify that the parts are correct. From GPL's point of view, a vision process is a single, indivisible operation. That is, after a GPL procedure starts a vision process, no results are available until after the process completes its execution. When the process is done running, GPL can then interrogate PreciseVision for its results.
In order for GPL to execute a process and retrieve the results, GPL has to know the name that has been assigned to the process in PreciseVision and the names of any tools for which results are desired. Once the vision process has completed execution, a GPL procedure can utilize the tool names to retrieve the results from any tool. These results typically indicate the locations of parts that are to be manipulated and the type of each part. In addition, vision can be used to check for key dimensions or other features of the parts and can return information to GPL about the quality of a part. As mentioned above, some tools return only a single set of results while others can return multiple sets of information.
Each time that a vision process is executed, all of the previous results of its tools are lost and replaced by the newly computed results. However, if a second vision process is executed using another communication object, the results of first vision process are preserved.
The following pages provide a summary of the built-in GPL classes and methods that act as an interface to the PreciseVision system, as well as some simple examples.