# Inspection Signals

The Inspection signals are the following:

- [out] Buffer Results Enable:

  When this bit is set the Job Pass, Inspection Result Code, Inspection ID and Inspection Results fields are held constant (held in a queue) until the Inspection Results Ack bit is set to acknowledge the results set. Up to 16 result sets are held in the buffer of the vision system. The vision system responds to the acknowledgement by clearing the Results Valid bit and sending the next result set. Once the Inspection Results Ack bit is cleared and there is a new set of results sent to the PLC, the Results Valid bit is set again. If the Inspection Results Ack bit is set and cleared again and there are no more results in the buffer to be sent to the PLC the Results Valid bit remains cleared.

- [out] Inspection Results Ack:

  - Buffer Results Enable bit set: The Inspection Results Ack bit is set by the PLC to acknowledge that it has received the current result set (Job Pass, Inspection Result Code, Inspection ID and Inspection Results fields). The next set of results is then sent to the PLC. Clearing the Inspection Results Ack bit causes the vision system to set the Results Valid bit if the results buffer is not empty. If the results buffer is empty the Results Valid bit remains cleared.

  - Buffer Results Enable bit cleared: The Inspection Results Ack bit must be set by the PLC in order to clear the Results Valid bit. If it is not set, then the Results Valid bit remains set and new results continue to be sent to the PLC. It is for synchronizing results with the PLC so it knows when the results are indeed valid to read and act upon them.

- [in] Inspection Completed:

  This bit is toggled (0 to 1 to 0 to1 and so on) by the vision system upon the completion of an inspection. It is guaranteed to be toggled after the new result set (Job Pass, Inspection Result Code, Inspection ID and Inspection Results fields) has been sent to the PLC.

- [in] Results Valid:

  This bit is set by the vision system when the new result set (Job Pass, Inspection Result Code, Inspection ID and Inspection Results fields) has been sent to the PLC and signals they are valid and can be acted upon in the PLC.

- Inspection Result Set:

  The Inspection Result set consists of the Job Pass bit, Inspection Result Code, Inspection ID and Inspection Results fields. These fields are all updated with the latest inspection results and are not sent to the PLC until all fields have been updated for the inspection that occurred.

  - [in] Job Pass:

    This bit is set by the vision system if the most recent job inspection passed as configured in the Job Status Settings dialog in the Sensor menu in In-Sight Vision Suite. This bit is cleared if the job did not pass.

  - [in] Inspection Result Code:

    The Inspection Result Code is a 16-bit integer and is defined by the Result Code parameter of the WriteResultsBuffer Spreadsheet function. You can tie this value to any cell in the Spreadsheet to send user-defined inspection information to the PLC.

  - [in] Inspection ID:

    The Acquisition ID associated with this set of results. This is a 16-bit integer.

  - [in] Inspection Results:

    Inspection results data defined in the Spreadsheet using the FormatOutputData and WriteResultsBuffer functions. It is a byte array of data that varies per protocol and can be up to 4000 bytes long.

- [in] Results Buffer Overrun:

  This bit is set when Buffer Results Enable is enabled and there are more results than the results buffer can hold (16). Trying to add more results to the buffer when this bit is set causes the last set of results to remain and the 16th set continues to be last (new results are dropped) until some results are read using the Inspection Results Ack bit.