Input and result data

Data exchange between Cognex toolgroups and Viper.NET is done via tools. Toolbocks* are used, which follow a naming convention. Output terminals of the tools provide input data for the toolgroup. Result data of the toolgroup in turn are retrieved after complete execution of input terminals of special toolbocks.

Control variables - GInOut

Data can be exchanged with external controllers via GInOut. Integration into the toolgroup is done via InputDataBlock and OutputDataBlock. Links of the toolblock terminals with GInOut data are created in the Data tab of the ToolgroupItem-Editor.

Communication can take place via different channels:

Variables: Variables are configured in the HW Explorer. Variables from the HW Explorer are then linked to input/output terminals at TG item level.

Direct data access: Input / output terminals are directly linked to a memory area. The configuration in the HW Explorer is omitted.

Note

Variables should be configured in the HW Explorer and used here.

Input data

The input data is used to feed parameters of an external control to the evaluation and thus to influence it dynamically.

Direct access

../../_images/data-inputdata-directaccess.png

The plus or minus button is used to create new input data or delete existing input data. Below this is the list with the currently configured input data. To be able to define new ones, the following settings exist:

  • Terminal: Terminal into which the input data is to be written.

  • Data: Definition of the data block

  • Offset: Offset of the data in the data block

  • Length: Length of the data in bytes

  • Converter: Converter for converting the HW data into the target type

  • Generic type: Selection of the target data type

  • Read data: Reads current values from the data field and displays them in the “current” field.

  • Update preview: Updates the preview field, i.e. converts the value “current” according to the converter.

Below the selection of the converter are settings for the conversion. These differ depending on the type of converter. The following settings are usually available:

  • Twisted Bytes: Determines whether the order of the bits should be inverted.

    Note

    The parameters required here correspond to those in HW Explorer. See the chapters there for more details on transferring data to and from external hardware.

About hardware variables

First, it is always necessary to create variables in the Hardware Explorer. Then the input variables can be connected to the terminals of the Input Data Block.

../../_images/data-inputdata-variables.png

To make it easier to understand in which direction the data flows, the Direction arrow is shown in the middle of the table.

Output data

With the help of the output data, the results of the evaluation can be passed on to an external controller, which then reacts accordingly.

Direct access

../../_images/data-outputdata-directaccess.png

The definition of the output data is identical to the input data. In addition, however, default values can be entered, which are available in the data area in the event of an error.

About hardware variables

The definition of the output data is identical to the input data.

../../_images/data-outputdata-variables.png

Defining result bits

So-called result bits can be defined for the evaluation of test criteria. In this case, results of the DataAnalysis terminals are transferred as individual bits to an external control.

../../_images/event-bit-definition.png

On the left side are the currently configured result bits. With Plus a new (already configured) bit can be added and with Minus an existing one can be removed.

In the middle part of the dialog is a list of all evaluations of all DataAnalysis terminals in the ToolGroup. By the arrows a criterion can be taken over to the right side and influences the selected bit.

If a terminal has been deleted but is assigned to a result bit, it will appear in the “Invalid entries” list.

Images

Input images to toolgroups in Viper.NET are obtained from a ImagesToolBlock. In the ToolGroup Item Editor, the terminals are associated with image-sources.

Result images can be saved using SaveImagesEx-ToolBlock.

See also

CSV files

Viper.NET offers two mechanisms to store results of a toolgroup in csv files:

  1. ResultCsv-Tool: The VisionPro tool can be included in any toolgroup. Each time the tool is executed, the terminal values are included as a line in an output file. The tool is suitable if individual values are to be recorded in a table.

  2. JobResultCsv-Plugin: The plugin must be activated in the project configuration. It writes typical result values of jobs, such as all CogDataAnalysisTool terminals, to csv files. It is therefore suitable for logging and analysis of BV results.