Data Analysis Edit ControlCognex VisionPro

This topic contains the following sections.

The Data Analysis edit control provides a graphical user interface to the CogDataAnalysis tool, which allows you to set tolerance ranges and perform statistical analysis on the results of other vision tools. The edit control allows you to set the various test ranges, view the tolerance results for individual values or aggregate values, and view a statistical analysis of previous test results. The following figure shows a Data Analysis edit control:

Cognex Core Data Analysis Data Analysis Whole Control

The edit control offers the following features:

  • A row of control buttons at the top left
  • A tab to set tolerance ranges
  • A tab to view the status of tolerance tests and the statistics compiled from recent tests

You can experiment with the edit control by using QuickBuild to create a CogDataAnalysis tool. A new CogDataAnalysis tool appears with one data channel ready to accept a single result value, as shown in the following figure:

Cognex Core Data Analysis Data Analysis Terminals

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

See the topic How To Link Data Properties to a Data Analysis Tool for details on how to link the data property of a vision tool to a data channel.

Control Buttons

Cognex Core Data Analysis Data Analysis Button Bar

The following table describes the function of each button:

Table 1. Control buttons
ButtonDescriptionFunction
Run Button
RunApply the current set of tolerance ranges to all input values.
Open Button
OpenOpen 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
SaveSave the current properties of the vision tool to a VisionPro persistence (.vpp) file.
Save As Button
Save AsSave the current properties of the vision tool to a new VisionPro persistence (.vpp) file.

Reset Button

Reset

Reset the vision tool to its default state.

This tool gives you a choice between resetting to the default-constructed state, which is appropriate when you are using it in a Visual Studio.NET application, and its template-initialized state, which is appropriate for QuickBuild applications.

Cognex Core Data Analysis Floating Channels
Show Floating ChannelsOpen a floating channels configuration window, which gives you the same access to channel configuration available from the Settings tab. Any changes you make on this grid will be reflected in the grid on the Settings tab.
Results Button
Show Floating ResultsOpen a separate results window with the same contents as seen in the Results tab.
Tool Tips Button
Show ToolTipsEnable or disables the display of tooltips for individual items in the edit control.
Help Button
HelpOpen this VisionPro online help file.
Settings Tab

This section contains the following subsections.

Use the Settings tab to determine the number of data channels the Data Analysis tool will use, set the tolerance ranges for each channel, and control buffered statistics. The following figure shows the Settings tab:

Cognex Core Data Analysis DATSettings Tab

By default, the Settings tab has one data channel, but you can add more channels and test the data properties of multiple vision tools simultaneously.

Channels

This section contains the following subsections.

Cognex Core Data Analysis DATChannels Settings

Use the Channels area of the Settings tab to determine the number of data channels this Data Analysis edit control will use, verify that each channel receives the current input value, and set a range of tolerance values for each input value. See the topic Link Data Properties to a Data Analysis Tool for details on how to link the data property of a vision tool to a data channel.

Use the following function buttons to manage the data channels:

Cognex Core Data Analysis DATChannel Function Buttons

Table 2. Function Buttons
ButtonDescription

Cognex Core Data Analysis DATAdd Channel

AddNew a new channel to the end of the list.

Cognex Core Data Analysis DATDelete Channel

Remove the currently highlighted channel from the list.

Cognex Core Data Analysis DATMove Up

Move the currently highlighted channel up in the list, and update the index of the function within the collection.

Cognex Core Data Analysis DATMove Down

Move the currently highlighted channel down in the list, and update the index of the function within the collection.

Configure each data channel with the following information:

Table 3. Channel Information
FieldDescription
ItemNumerical index for the channel.
NameProvide a unique text string to identify the input value to be tested.
CurrentValueThis field shows the current input value generated and supplied by another vision tool. If the value has not been updated since the last time the Data Analysis tool executed, or if the tool has not yet executed, then the value appears with an asterisk.
RejectLowLimitEnter a tolerance value that the input value must not fall below or else the channel generates a Reject Low result.
WarnLowLimitEnter a tolerance value that the input value must not fall below or else the channel generates a Warn Low result.
WarnHighLimitEnter a tolerance value that the input value must not exceed or else the channel generates a Warn High result.
RejectHighLimitEnter a tolerance value that the input value must not exceed or else the channel generates a Reject High result.
NominalValueThis is the ideal value as compared to the actual input value tested by this channel. This field is for reference only and has no effect on the operation of the channel.

Entering Tolerance Values

To enter a tolerance value for a data channel, first select the checkbox underneath the desired tolerance check. Then enter a tolerance value directly or use the spin control to select the desired value. For example, the following figure shows the tolerance check for Warn Low enabled with a value of 100:

Cognex Core Data Analysis DATWarn Low

Status Bar

In addition to the status bar symbols used for all tools (green circle for pass, and red rectangle for fail), the Data Analysis tool uses the following unique symbols:

Table 4. Status Bar Icons
IconDescription

Cognex Core Data Analysis Data Analysis Warn

The tool ran successfully, but at least one value was between the warning tolerance and the reject tolerance.

Cognex Core Data Analysis Data Analysis Fail

The tool ran successfully, but at least one value was at or above the reject tolerance.

Rejecting Old Data and Viewing Individual Results

The Data Analysis tool only checks tolerances and computes statistics on input values that have been set since the last time the tool was run. If you attempt to run the tool twice in succession without providing a new input value for a given channel (setting the CurrentValue property for the channel), the statistics for that channel will remain unchanged and its status will indicate that the value was invalid. If the Reject if Channels Not Updated checkbox is checked, an invalid value for any channel causes the Data Analysis tool to produce a status of Reject. If this checkbox is unchecked, channels with invalid values will have no effect on the aggregate tolerance status of the tool.

The Individual Results Enabled checkbox determines whether the tool generates an individual result object for each data channel. When enabled, the results collection for the tool will contain a result object for each channel and the edit control generates a column in the Results tab indicating that result. Clear the checkbox to prevent the tool from generating individual results for each channel, which allows to the tool to execute faster.

Statistics

Cognex Core Data Analysis DATStatistics Settings

Use the Statistics area of the Settings tab for configuring statistical analysis settings for both running statistics and buffered statistics. Running statistics factor in the last valid input value to update a set of statistical calculations. Buffered statistics are statistical values produced for a finite number of recent input values.

The Statistics area supports the following features:

Table 5. Statistics Settings
FeatureDescription
ChannelBufferLengthYou can modify the number of input values that that the tool will save in the buffer.
NumBufferedValuesThis field indicates the number of input values currently buffered to produce the buffered statistics.
ResetBufferedValuesDiscards all buffered statistics.
ResetRunningStatisticsReset all running statistics to zero.
Results Tab

This section contains the following subsections.

Use the Results tab to view all the results from the tool. The following figure shows the Results tab:

Cognex Core Data Analysis DATResults Tab

Aggregate Tolerances

Cognex Core Data Analysis DATAggregate Results

Use the Aggregate Tolerances area of the Results tab to view the tolerance status of the most recent test. The individual test fields indicate the number of data channels that fall into each category when the tool was last run.

The Aggregate Tolerances area supports the following indicators:

Table 6. Aggregate Results
FeatureDescription
AggregateToleranceStatusView the tolerance status of the most recent test.
NumPassValuesView the count of the number of tests where the input value passed all tolerance ranges.
NumRejectValuesView the count of the number of tests where the input value exceeded the reject tolerance ranges.
NumWarnValuesView the count of the number of tests where the input value exceeded the warn tolerance ranges.
NumInvalidValuesView the count of the number of tests where the channels did not receive new input values before the Data Analysis tool ran.
Channels

Cognex Core Data Analysis DATChannels Results

Use the Channels grid of the Results tab to view running and buffered statistics. The Channels grid supports the following fields:

Table 7. Channels Grid
FieldDescription
ItemNumerical index for the channel.

Name

This text string identifies the input value. If you change the value of this field in the Settings tab, the Name field remains the same until the next time the tool runs. In addition, because the Name value is used to locate the channel that corresponds to any particular result, the statistics of a renamed channel will be unavailable until the tool is run again.

Be aware that "[ ]" characters are reserved and cannot be used in naming the channel.

CurrentValueThe Data Analysis tool tested this value against all tolerance ranges.
CogDataAnalysisToleranceStatusConstantsThis field only appears if the Individual Results Enabled checkbox is enabled on the Settings tab, and displays the tolerance status just for this channel only. If the channel is deleted after running the tool, the status result will remain on the Results tab but its statistics will not.
RunningNumSamplesThe tool records the total number of input values tested against the set tolerance ranges. This value does not increment if the tool runs on the same input value twice. Clicking Reset Running Statistics on the Settings tab resets this field to zero. All other running statistics fields are blanked out.
RunningMeanThe tool calculates the average of all the input values for each channel.
RunningStandardDeviationThe tool calculates the standard deviation, or spread of values, for all input values to each channel.
RunningMinValueThe tool records the minimum value received as an input value.
RunningMaxValueThe tool records the maximum value received as an input value.

If the Show [Buffered] Statistics checkbox at the bottom of the Results tab is enabled, the Channels grid also contains the following fields:

Table 8. Buffered Results in Channels Grid
FieldDescription
GetBufferedNumSamplesThe tool records the total number of buffered input values it tests against the set tolerance ranges. Clicking Reset Buffered Statistics on the Settings tab resets this field, and all other buffered statistics fields, to zero.
GetBufferedMeanThe tool calculates the average of the buffered input values.
GetBufferedStandardDeviationThe tool calculates the standard deviation, or spread of values, for the buffered input values.
GetBufferedMinValueThe tool tracks the minimum of the buffered input values.
GetBufferedMaxValueThe tool records the maximum of the buffered input values.