Set up

Both the AOI, which provides the images (Reinspect Server), and the visual inspection station for displaying the images (Reinspect Client) need to be adapted.

Reinspect Server (AOI)

If not already done, the Reinspect server plugin must first be activated in the AOI, e.g. via the Info dialog. If the plugin is not listed here, the installation of Viper.NET must be changed and Other plugins -> Reinspect must be selected.


Selection of the Reinspect Server Plugin

Views for visual inspection station

For defining the view, i.e. the combination of images and graphics to be displayed to the user during the visual inspection, the Viper.NET default mechanism of User views is used. The name of the views for the visual inspection must conform to the Reinspect_{ID} schema. The {ID} parameter will be used later for identifying the view.


Each {ID} must be unique within a BV types.


Creating a User View for ReInspect

Communication with visual inspection station

The data exchange between the AOI and the visual inspection station takes place via TCP/IP, more precisely via Viper.NET Streams. For the AOI, a ConPassiveSocket is created with the ConProtGData protocol. Any free port can be chosen.



Beside the Streams TimeOut there is another TimeOut parameter in the Stations.xml which specifies how long to wait for a Telegram response.

Konfiguration des Server-Plugins

In the global-settings the configuration parameters must be adjusted in the Reinspect server tab:

  1. Server streams: Hier werden die vorher konfigurierten Streams für die Kommunikation mit einem oder mehreren Nacharbeitsplätzen eingetragen. Es können mehrere Streams angegeben werden, indem diese mit Trennzeichen aneinander gereiht werden. Als Trennzeichen interpretiert werden Kommata (,), Semikola (;) oder Pipes (|).

  2. Enable downstream reinspect: Enables downstream reinspect: The views are stored in files within the specified View storage path for later retrieval. The checkboxes can be used to additionally specify that only views of specific inspection results (pass/ warn / fail) of the AOI should be stored . The views are only saved for the activated results.


Gespeicherte Ansichten werden nicht automatisch gelöscht. Deshalb muss für das View storage directory eine Überwachung in GEFASOFT WatchDir eingerichtet werden.

Configuration of the BV stations

If downstream reinspection is enabled, the reinspect token must be configured for each in the stations.xml for each AOI station (see Downstream reinspection):

                  <data varRef="VarsVisionStation1.SerialNo" id="reinspectToken" />

This may also require configuration of variables in GInOut.

Reinspect Client (visual inspection station)

For the visual inspection station, more configuration effort is required, since communication with both the PLC and the AOI must be set up here.

Installation Viper.NET and project

For the visual inspection station, both the vision plugin and, analogous to the server, the Reinspect plugin must be activated. If the two plugins are not listed, they may have to be installed later.

When creating the Viper.NET project for the visual inspection station, the template Basic project can be used. In the subsequent dialog, both the Vision plugin and the Reinspect client plugin are then activated. The template Vision project could also be used, but contains many unnecessary additional parameters and GUI elements.

If the Vision plugin is active, the license status of Cognex VisionPro is checked by default. VisionPro components that can be used without a license are required to display the check view. So a dongle is not necessary. Therefore the dongle check can be deactivated in the project file:

<?xml version="1.0" encoding="utf-8"?>
<dataStore guid="81f2f63a-9ffa-4313-ae3f-39dc2a7e8a4a" name="GConfiguration" architecture="MSIL" Version="">
    <dataStore name="VisionPluginConfig" guid="30a23417-f978-4dbd-a2aa-054182260c4a" visionProVersion="9.6" Version="">
      <param name="disableLicenseCheckerCognex" value="True" />

Communication with AOI

Analogous to the AOI, Viper.NET Streams are configured for communication with connected AOIs. However, here ConClientSocket is created with the ConProtGData protocol. The port and IP address must match the AOI. In addition, a meaningful name should be assigned to the stream.


At this point, the connection between AOI and visual inspection station can be tested.

Communication with PLC

Communication with the controller is implemented via a digital handshake, see also Stations. The PLC selects from which AOI which view is to be queried.

To set up the Reinspect Client Station, first create the required data and bits in GInOut and modify the configuration file stations.xml.

<!-- ************************** -->
<!-- *******Reinspect********** -->
<!-- ************************** -->
<station id="100" name="Reinspect" type="ReinspectStation">
    <!-- Name of the connection stream to use -->
    <param name="streamName" value="1|PCBKleben;4|Deckel2;5|Deckel1;6|LFJetten;7|NTCJetten;8|Schutzgel;9|NTCTest"/>

    <!-- Timeout to receive the reinspection view from the vision app -->
    <param name="receiveViewTimeoutMs" value="20000"/>
    <!-- Screen id on which the result is to be displayed. -->
        <param name="wait4NegEdgeTrigger" value="true"/>
        <param name="wait4NegEdgeTriggerTO" value="5000"/>
        <param name="bitToASCII" value="false"/>
            <bit bitRef="101" id="trigger"/>
            <bit bitRef="101" id="ready"/>
            <bit bitRef="102" id="busy"/>
            <bit bitRef="103" id="error"/>
            <bit bitRef="104" id="io"/>
            <bit bitRef="105" id="nio"/>
            <data dataRef="01" offset="0" length="128" id="DATA"/>
            <data dataRef="01" offset="4" length="2" id="errCode" converter="System.Int16" converterParams="twistBytes=true"/>
            <data dataRef="01" offset="6" length="2" id="resCode" converter="System.Int16" converterParams="twistBytes=true"/>
            <!-- If value is 'x', a view is requested. If value is '99', the view is to be cleared. -->
            <data varRef="ReinspectList.Command" id="cmd"/>
            <!-- Contains the view number if cmd is set to 'x0'. -->
            <data varRef="ReinspectList.Type" id="type"/>
            <!-- Identification token for the current trigger/part. Only required for downstream reinspect. -->
            <data varRef="ReinspectList.Token" id="reinspectToken" />
            <data dataRef="02" offset="4" length="2" id="errCode" converter="System.Int16" converterParams="twistBytes=true"/>
            <data dataRef="02" offset="6" length="2" id="resCode" converter="System.Int16" converterParams="twistBytes=true"/>

The handshake and the parameterization correspond as far as possible to the Viper.NET Standard station. The selection of AOI and test view ID is specified by the PLC during triggering via the Int16 parameters cmd and type:

Other station parameters:

  • streamName: Mapping of command number (cmd) to a Viper.NET stream (which communicates with the AOI).

    Format: {Command}|{StreamName}.


    If multiple streams are to be used, the individual entries are separated by a semicolon: {Command1}|{StreamName1};{Command2}|{StreamName2}.


    Some command numbers are reserved for special actions, see also below.

  • receiveViewTimeoutMs: Receive timeout for the view requested by the AOI.

The handshake with the PLC is completed when the data for the visual inspection has been received and displayed. The PLC must then wait for the operator to press one of the IO/NIO buttons. The following commands can then be used:

Reserved command numbers

  • 98: Saves the images, graphics, and other information for later analysis.

  • 99: Clears the view for visual inspection.

Attention mode

Downstream reinspection

With downstream reinspection, reinspect views can be stored on the AOI system and retrieved later from the re-evaluation station. In production lines, for example, the re-evaluation of an AOI inspection can only take place once the affected component has arrived at the re-evaluation station.

Since there are many components in a production system and thus also many re-evaluation views, a unique Reinspect token (string) is required for identification. This token can be an existing identifier such as a serial number, but it can also be generated by the higher-level PLC.

For each AOI trigger, the reinspect-token must also be passed to the AOI. The AOI uses the token to save the re-evaluation view under a unique name if save is enabled.

At the revaluation place the token must then also be passed at the trigger. The re-evaluation place then does not request the current view at the AOI, but the one that was saved for the given token.


Saved views are not automatically deleted. Therefore, monitoring must be set up in GEFASOFT WatchDir for the ViewStorageDirectory.