# Operation

This section describes how certain processes work in theory and in practice.

## Theory of Operation

Reading inspection results into a PLC after an image is acquired consists of setting a control bit and reading status bits. As with trigger or acquisition, these bits work together to form a 4-way handshake to keep the PLC and vision system in sync. The handshaking diagram from Operation topic applies to the reading of results into the PLC although the event source and acknowledgement are reversed in this case.

1. The Event Results Valid signal sent from the vision system only needs to be set when the Inspection Results Acknowledgement signal is set low in the PLC.

2. The Inspection Results Acknowledgement is set in the PLC when the Event Results Valid signal is received or processed.

3. The Event Results Valid is held high in the vision system until the Inspection Results Acknowledgement signal is received from the PLC.

4. The Inspection Results Acknowledgement signal must be held high in the PLC until the Event Results Valid signal is cleared in the vision system.

## Process

1. The Results Valid bit is set to 1 when the inspection completes in the vision system.

2. Once the PLC sees the Results Valid bit is set to 1:

   - It reads the new results set from the vision system.

   - It sets the Inspection Results Ack bit to 1.

3. The vision system sees that the Inspection Results Ack bit is set to 1 and sets the Results Valid bit to 0.

4. The PLC then sees the Results Valid bit is 0 and sets the Inspection Results Ack bit to 0.

The steps correlate to the 4 steps above describing the 4-way handshake.

In unbuffered results mode, the handshaking needs to be used as described above. If the 4-way handshaking is not used, the Results Valid bit just stays set with the last set of results being the most current. There are several other methods that you can use to determine if there are new results but this is the easiest to implement.

Results data can be sent to the PLC from the vision system using manual triggering when the vision system is in offline mode. This is useful for testing and debugging purposes.