Skip to content

NIKLAS

Test engineering

Integrating visual inspection into the line: PLC connection, ejection and traceability

A visual inspection in the line is only as good as its integration. The PLC must assign the correct result to every part, the result must be available before the ejector, and every NOK part must verifiably leave the line. If a result is missing, the part counts as NOK. Inspection image and result are stored with the part number.

Selected customers

  • Logo of Lufthansa Technik AG
  • Logo of Krones AG
  • Logo of Fraunhofer-Gesellschaft
  • Logo of ÜSTRA Hannoversche Verkehrsbetriebe AG
  • Logo of Sesotec GmbH
  • Logo of Komax SLE GmbH & Co. KG
  • Logo of Flottweg SE
  • Logo of Christ Packing Systems GmbH & Co. KG
  • Logo of Die Autobahn GmbH des Bundes
  • Logo of Mannesmann Line Pipe GmbH
  • Logo of REFORM
  • Logo of PRAMAC
  • Logo of SAR Electronic GmbH

What matters when a visual inspection is added to the line?

Camera, lighting and evaluation decide whether a defect is detected. The integration decides whether the detected part is actually rejected. Four points carry this:

  1. Unique signals: the PLC assigns every result to exactly one part.
  2. Time budget: the result is available before the part reaches the ejector.
  3. Safe ejection: no result counts as NOK, and a check confirms that the part has left the line.
  4. Traceability: inspection image, result and recipe are stored with the part number.

These points apply to new lines just as much as to retrofitting an inspection into an existing plant.

Top view of an inline visual inspection with conveyor belt and inspection station

Which signals do the inspection system and the PLC exchange?

A handshake runs between inspection system and PLC: each side reports what it has done before the other continues. These signals are common:

SignalDirectionMeaning
Readyinspection system to PLCinspection system is switched on, recipe loaded, no fault
Recipe numberPLC to inspection systemwhich type comes next
Recipe acknowledgedinspection system to PLCloaded recipe, for comparison with the target
TriggerPLC or sensor to inspection systempart is in position, start image capture
Part numberPLC to inspection systemcode or serial number to which the result is linked
Image capturedinspection system to PLCimage is captured, part may move on
Result validinspection system to PLCresult for exactly this part is available
OK / NOKinspection system to PLCinspection decision, evaluate only together with result valid
Error codeinspection system to PLCwhich characteristic is NOK, for display and statistics

Trigger and result often run over digital inputs and outputs because this is fast and simple. Recipe number, part number and error code go to the PLC over a fieldbus or a network connection. Inspection data for MES or ERP usually runs separately over a database or OPC UA connection.

Three rules for the PLC

  • A result is only evaluated if result valid is set for this part. A remaining OK from the previous part must not count.
  • If the result does not arrive within the defined time, the part counts as NOK.
  • The PLC compares the acknowledged recipe with the expected type. If they differ, the line does not continue.

We also take over the programming on the PLC side if you wish. More on this under PLC and SCADA programming.

How much time does the evaluation have before the part reaches the ejector?

Between image capture and ejector the part travels a fixed distance. Evaluation, communication and the switching time of the ejector must fit into this time.

Top view of an inline inspection with ejectionConveyor belt with parts at spacing a. Camera, then after the distance s the ejector with chute into a bin for NOK parts, sensors for trigger, reject check and check after the ejector.CameraEjectorNOKReject checkTriggerCheck afterthe ejectors: distance from camera to ejectoraConveying direction
Figure 1: Inline inspection in top view with distance s and part spacing a. Here three parts lie between camera and ejector, and the PLC tracks their results.Source: own illustration, schematic, not to scale

tA + tC + tS ≤ sv

tA
time for image capture and evaluation in s
tC
time for transmitting the result and the PLC cycle in s
tS
switching time of the ejector until it acts on the part in s
s
distance from the capture position to the ejector in m
v
belt speed in m/s

Example: The ejector is 0.6 m after the camera, the belt runs at 0.4 m/s. The part needs 1.5 s to get there. With 0.1 s switching time and 0.05 s for communication, 1.35 s remain for image capture and evaluation. All values are example values.

Timing of the signals from image capture to ejectionSignal sequence for a NOK part: trigger, image captured, result valid with NOK, ejector. Below, the time shares for evaluation, communication, switching and reserve up to the travel time s divided by v.Part reaches the ejectorTriggerImage capturedResult validNOKEjectorTime ttA: image capture and evaluationtCtSReserves / v: travel time from camera to ejector
Figure 2: Signal sequence for a NOK part over time. Evaluation, communication and switching time together must be shorter than the travel time s / v to the ejector.Source: own illustration, schematic, not to scale

Calculate with the longest evaluation time, not with the mean. If the distance is not sufficient, extend it, reduce the speed or separate image capture and evaluation in time: the part moves on after image captured, the result follows later.

Part tracking up to the ejector

If several parts lie between camera and ejector, the PLC must assign the results in the correct order.

N = sa

N
parts between camera and ejector at the same time
s
distance from camera to ejector in m
a
spacing of the parts on the belt in m

Example: With a distance of 0.6 m and a part spacing of 0.15 m, four parts are on their way. The PLC keeps a list in which every result travels with its part.

With a fixed part spacing a shift register that moves on with every part is sufficient. With varying spacing the PLC tracks the position with a rotary encoder on the belt or with a second sensor shortly before the ejector. Otherwise, if a part is removed by hand, the assignment shifts for all following parts.

How do you make sure that every NOK part leaves the line?

The type of ejector depends on part, cycle time and sensitivity:

EjectorSuitable forPoints to note
Pusherstable parts with a flat baseswitching time, space next to the belt
Air nozzlelight parts at high cycle ratescompressed air, scatter of the trajectory
Diverter or flapparts that must not be pushedswitching time, gap between the parts
Gripper or delta pickersensitive parts, sorting into several classescycle time of the robot

Reject check

The fact that the ejector has switched does not mean that the part is out. A sensor in the reject path or at the bin confirms every NOK part. If the confirmation is missing, the line stops or reports a fault. A second sensor after the ejector checks that no NOK part arrives there.

  • Design the bin for NOK parts so that parts cannot return to the line unnoticed, for example covered or locked.
  • Eject a recheck class separately if parts close to the limit are evaluated by hand.
  • Consider faults, emergency stop and power failure: parts that lie between camera and ejector on restart count as not inspected.

The ejector is a moving part of the line. It belongs in the risk assessment and, if necessary, behind a guard.

Which inspection data should be stored for each part?

For traceability and complaints, store for each part: part number or code, time, recipe and recipe version, result per characteristic, error code, the version of the evaluation model and the inspection image. Where traceability is required, ISO 9001 section 8.5.2 requires the identification of outputs and the retention of the necessary information.

M = z · b · m · T

M
storage requirement in MB
z
parts per day
b
images per part
m
size of one image in MB
T
retention period in days

Example: 10,000 parts per day, two images per part, 5 MB per image as with 5 megapixels in monochrome at 8 bit uncompressed, 90 days retention: this gives 9,000,000 MB, or about 9 TB.

This is why it pays to differentiate: store NOK images completely, OK images with low-loss compression or as a sample, result data always. Define retention period and storage location in advance with your quality department and IT.

With the NIKLAS Vision Check, inspection image and inspection data are documented for each part and can be passed on to the next process. How results get into the inspection report and the ERP is described on the NIKLAS test software page.

How do you test the integration during commissioning?

Test the whole chain from image capture to the bin for NOK parts. These tests belong in the commissioning report:

  1. Send reference reject parts through the line in different positions: each must arrive in the NOK bin.
  2. Several reject parts directly one after the other and mixed with good parts: the assignment must be correct.
  3. Disconnect camera or network: the parts must count as NOK, the line must react.
  4. Specify a wrong recipe: the PLC must detect the difference.
  5. Block the reject path: the missing confirmation must trigger a fault.
  6. Emergency stop and restart with parts on the belt: parts not inspected must not pass as OK.

In operation, run a reference reject part through regularly, for example at the start of each shift. This checks detection and ejection in one pass. How to design and accept the detection itself is described in the article AI visual inspection in final inspection.

Frequently asked questions about integrating a visual inspection

Short answers for production, maintenance and automation.

Can a visual inspection be retrofitted into an existing line?

Yes, if installation space, feeding and cycle time fit and the PLC can be extended with the signals and the part tracking. We check this on site and on your sample parts.

What happens if the camera fails?

If the result does not arrive, the part counts as NOK. The PLC detects the failure via the ready signal and a timeout and stops the line or reports a fault.

Who programs the PLC side?

Either your team according to our interface description, or we do. We also program the PLC side and commission the whole chain with you.

How long should inspection images be kept?

You define this with your quality department and your customer. What matters is how long complaints are to be expected. Result data needs little space, images a lot.

Does every part need a code?

For assignment within the line a serial number in the PLC is sufficient. For traceability beyond the line the part or its load carrier needs a marking, for example a 2D code.

How do you prevent NOK parts from returning to the line?

With a reject check by sensor, a second sensor after the ejector and a bin from which parts cannot be put back unnoticed.

Integrate visual inspection

Tell us the component, cycle time, control system and what is to be inspected. We will get back to you with an initial assessment of inspection station, ejection and connection.

We process your details to handle your enquiry. See our privacy policy.

Simon Niklas, your contact

Simon Niklas

Mechanical engineer, M.Sc.

+49 941 56956720[email protected]

“Good engineering proves itself in day-to-day production. That is why we combine technical planning with a close understanding of process, operation and maintenance.”

Book a consultation