Distance Point Point Edit ControlCognex VisionPro

This topic contains the following sections.

The Distance Point Point edit control provides a graphical user interface to the DistancePointPoint method, which returns the length of the line segment between the point (StartX, StartY) and the point (EndX, EndY). The edit control allows you to configure the two points, dictate which graphics appear as the tool executes, and view tool results. The following figure shows the Distance Point Point edit control:

Cognex Dimensioning Distance Point Point Control Distance Point Point Whole Control

The edit control offers the following features:

  • A row of control buttons at the top left
  • A set of function tabs to define the two points, choose what graphics the tool will use, and view results
  • An image display window for displaying tool images and graphics

You can experiment with the edit control by using QuickBuild to create a CogDistancePointPoint tool. A new CogDistancePointPoint tool appears as shown in the following figure:

Cognex Dimensioning Distance Point Point Control Distance Point Point Terminals

To include the edit control in your custom vision application, you must first add it to your Visual Studio.NET development environment. See Using Edit Controls in Your Custom Vision Applications for more information.

Control Buttons

Cognex Dimensioning Distance Point Point Control MTWButton Bar

The following table describes the function of each button:

Table 1. Control buttons
ButtonDescriptionFunction
Run Button
RunMeasures the distance between the two points
Electric Button
Electric modeToggles electric mode, where the Distance Point Point tool executes automatically when particular configuration parameters change. In electric mode, a lightning bolt appears next to every electric property

Local Display Button

Local image display

Opens or closes the local image display window. A Distance Point Point tool supports the following image buffers:

  • The Current.InputImage buffer contains the current image and the input points
  • The LastRun.InputImage buffer contains the results of the tool after it measures the distance between the two points
Floating Display Button
Floating image displayOpens one or more floating image windows, which support the same image buffers as the local image display window
Open Button
OpenOpens a VisionPro persistence (.vpp) file that contains a set of saved properties for this vision tool object type. VisionPro reports an error if you try to open a .vpp file for another object type.
Save Button
SaveSaves the current properties of the vision tool to a VisionPro persistence (.vpp) file. The edit control allows you to choose between saving the vision tool with or without its image buffers and tool results.
Save As Button
Save AsSaves the current properties of the vision tool to a new VisionPro persistence (.vpp) file
Reset Button
ResetResets the vision tool to its default state.
Tool Tips Button
Show ToolTipsEnables or disables the display of tooltips for individual items in the edit control
Help Button
HelpOpens this VisionPro online help file
Settings Tab

Use the Settings tab to define the two input points. The following figure shows the Settings tab:

Cognex Dimensioning Distance Point Point Control Distance Point Point Settings Tab

The Settings tab offers the following features:

Table 2. Settings tab
FeatureDescription
StartXThe x-coordinate for the point (StartX, StartY)
StartYThe y-coordinate for the point (StartX, StartY)
EndXThe x-coordinate for the point (EndX, EndY)
EndYThe y-coordinate for the point (EndX, EndY)
Graphics Tab

Use the Graphics tab to control which graphics the Distance Point Point tool generates and displays. The following figure shows the Graphics tab:

Cognex Dimensioning Distance Point Point Control Distance Point Point Graphics Tab

The Graphics tab offers the following features:

Table 3. Graphics tab
FeatureDescription
Show Input ImageDetermines whether or not the input image is recorded as part of the diagnostic record, and whether the image is copied to the record or saved in the record as a reference
Show Start PointShow (StartX, StartY) in the LastRun.InputImage buffer
Show End PointShow (EndX, EndY) in the LastRun.InputImage buffer
Show ArrowShow the line segment representing the distance between the point (StartX, StartY) and (EndX, EndY)
Results Tab

Use the Results tab to view the relationship between the point (X, Y) and Circle as determined by the Distance Point Circle tool. The following figure shows the Results tab:

Cognex Dimensioning Distance Point Point Control Distance Point Point Results Tab

The Results tab offers the following features:

Table 4. Results tab
FeatureDescription
DistanceThe distance between the point (StartX, StartY) and the point (EndX, EndY)
AngleThe angle of the line segment between the point (StartX, StartY) and the point (EndX, EndY)