Welcome to Kunshan EEK Automation Equipment Co., Ltd.
Home/Technical Guides/How to Integrate Vision Systems with PLCs and Production Lines

How to Integrate Vision Systems with PLCs and Production Lines

Guide to integrating visual inspection systems with PLCs and production lines: covering when to use common communication methods such as I/O, TCP, RS485, Modbus, S7 and Profinet, plus key timing design points for trigger, judgement and rejection.

Clarify One Thing First

Integration is not the last step; it has to be settled early in the solution stage

The Short Answer

Vision system integration with the PLC mainly uses hardwired I/O, TCP, RS485, Modbus, S7, and Profinet; the choice depends on the site PLC brand, the available interfaces, and the real-time requirements. The key to integration design is timing: triggering, imaging, judgement, result output, and rejection action must be strictly aligned in time.

Many vision projects stall at the final stage over "integration": the inspection itself performs well, but the results do not reach the production line, or the rejection timing is wrong and good parts next to it are rejected as well.

The root cause of this type of problem is usually Integration design starts too late. The choice of communication method in turn affects the solution structure - for example, hardwired I/O can only transmit "signal / no signal", while transmitting defect codes requires a bus or network.

So the integration plan should be settled early in the project, and at minimum it should define: the brand and model of the on-site PLC, the available interfaces, what information must be transferred, and the response time of the rejection mechanism.

selection Factors

I/O Hardwiring

The simplest and most direct method, using a digital signal to transmit OK/NG or a trigger signal. Best real-time performance but the least information, able to transmit only "present/absent".

TCP / Ethernet

Structured data is exchanged over a socket and can carry defect type, coordinates and quantity. Flexible, but the protocol format must be agreed.

RS485 / Modbus

A serial method commonly used on industrial sites, suitable for small to medium data volumes and multi-device chain scenarios.

S7 / Profinet

A native protocol of the Siemens ecosystem; it is the most natural fit on Siemens PLC sites, with better configuration and real-time performance.

Trigger Mode

Photoelectric sensor trigger, encoder trigger or software trigger. Continuous material travel scenarios usually must use encoder synchronization.

Rejection Timing

There is a conveying distance between the trigger and the rejection point that must be aligned by encoder counting or delay compensation, otherwise the rejection position will be off.

Field of View and Pixel Sampling

Do Not Mistake Pixel Scale for Inspection Accuracy

Relationship between field of view, working distance and focal lengthExplains that working distance and focal length together determine the field of view (FOV) size, which in turn affects per-pixel sampling capability.Camera + LensField of view FOV: H × V (depends on focal length and working distance)Working Distance WDLonger focal lengthSmaller field of viewSingle-pixel SamplingHigher capabilityPixel sampling value ≠ inspection accuracy: the lens / light source / workpiece / mounting distance / mechanical stability / algorithm together determine the final result
FOV / working distance / focal length relationship diagram — increasing the focal length narrows the field of view and raises the pixel sampling capability per unit area; but the pixel sampling value cannot be taken directly as inspection accuracy.

Timing is the most error-prone part of integrating vision with a production line. The typical chain is: workpiece in position → sensor trigger → camera imaging → algorithm judgement → result output → rejection mechanism action.

Every segment in between takes time. If the rejection mechanism acts before the result is output, or if the workpiece has already passed the rejection position when it acts, an escape or a wrong rejection occurs.

StagesKey SpecificationsFrequently asked questions
triggerSensor response time, trigger delayTriggering too early, so the workpiece has not fully entered the field of view
imaging Exposure time, transmission timeOverlong exposure causes motion blur
judgement Algorithm Processing TimeFluctuating processing time makes output timing unstable
TransmissionCommunication CycleNetwork jitter causes PLC read latency
rejectionMechanism response time, conveying distanceNo position compensation leads to rejecting at the wrong position

Light Source and illumination

Light Shielding and Protection

Light sources in the inspection area need shielding to isolate ambient light; dust and oil mist on site require protective structures, otherwise contaminated lenses will degrade imaging quality.

Installation Space

The station must accommodate the camera, light source, controller, and cabling. Installation space is often the first constraint to be fixed and must be verified during the solution stage.

Vibration

Equipment vibration causes image shake. The inspection station usually needs to be isolated from vibration sources.

Power Supply and Compressed Air Supply

The vision system requires a stable power supply; the pneumatic rejection mechanism requires a compressed air supply. These on-site conditions must be confirmed during the solution stage.

algorithm Selection

The key integration point on the algorithm side is that "results must be output stably". If algorithm runtime varies widely, the PLC timing design must leave sufficient margin, otherwise occasional execution misalignment occurs.

Judgement Result Encapsulation

Packages the judgement, defect type, and position of each part into structured data.

  • Easy for PLC and host systems to parse
  • Format to be agreed by both parties

Timeout Protection

When the algorithm encounters an anomaly, it outputs a fixed safe result to avoid stopping the production line.

  • A clear degradation strategy is required
  • Avoiding "lock-up"

Heartbeat and Status

Report system operating status periodically to facilitate production line monitoring.

  • Anomalies can be detected early
  • Easier fault localization

Data Feedback

Send inspection data back to the host system for statistics and traceability.

  • Integration with MES / host systems
  • The interface method is decided on site

Communication and interlocking

Visual inspection judgement chainThe complete chain from image acquisition to OK/NG judgement and PLC interlocking.image acquisitiontrigger captureTarget Positioningtemplate matchingfeature recognitionAlgorithm JudgementResult JudgementOK / NGindustrial communicationPLC interlockingRelease OKRejection / NG AlarmEvery step's result retains the image and judgement item, for traceability and review
Inspection Judgement Chain — Acquisition → Positioning → Recognition → Judgment → Communication interlocking; the entire chain runs locally on the machine.

The integration solution needs to be confirmed jointly by both sides early in the project, including the protocol, data format, timing parameters and exception handling. Writing these into the technical agreement avoids a lot of back-and-forth during joint debugging.

  • 01 Confirm the on-site PLC brand and available interfaces
  • 02 Determine the information content to be transmitted
  • 03 Choose the communication method and protocol
  • 04 Agree on data format and timing specifications
  • 05 Determine the trigger mode and encoder configuration
  • 06 Account for the rejection position compensation
  • 07 Joint debugging and dry-run validation
  • 08 Run trial production and measure execution accuracy

Common Question

Our PLC Is an Old Model: Can It Be Integrated?
In most cases yes. Older models may only have I/O or RS485, in which case digital signals carry OK/NG; if more information must be transmitted, a communication gateway or relaying through a host computer can be considered. It depends on the interfaces available at the site.
The rejection position is always slightly off - what is the cause?
The common cause is not compensating for transport distance. There is a gap between the inspection position and the rejection position, so encoder counting or a precise delay is needed to align the rejection action with the workpiece position. When the speed changes, the compensation must change with it.
Do results need to be sent to MES?
Yes. The vision system can output inspection results and image data to a host system, with the interface customized to your MES requirements. We recommend defining the data fields early in the project.
Does a change in production line speed affect inspection?
Yes. Speed changes affect the exposure time (which may cause motion blur) and the rejection position compensation. In continuous feed scenarios, encoder synchronization is recommended so that imaging and conveying correspond exactly.
What If the Algorithm Occasionally Stalls?
Timeout protection needs to be designed: if the algorithm times out, a preset safe result is output to keep the production line from stalling while waiting. Exception logs should also be recorded for easy diagnosis.
What needs to be prepared in advance for integration?
Recommended to provide in advance: PLC brand and model, list of available interfaces, the data content to be transmitted, the rejection mechanism type and response time, the conveying speed range and the distance from the inspection position to the rejection position.

Submit sample testing

The integration solution must be designed around on-site conditions. Please provide the PLC model and interface information, and we will propose a communication and interlocking solution accordingly.

JPG / PNG supported, multiple files allowed
Each file must not exceed 20 MB
    JPG / PNG supported, multiple files allowed
    Each file must not exceed 20 MB
      JPG / PNG supported, multiple files allowed
      Each file must not exceed 20 MB
        A solution engineer will contact you within 1 business day after submission

        Need to assess imaging conditions, defect criteria and cycle time item by item? Go to the Full Requirement Assessment →

        The Most Effective Step in Selection: Test Your Own Sample

        For the same workpiece, the inspection result differs greatly with different lenses, light sources, mounting distances and algorithm combinations. Sending us samples for measurement is more reliable than extrapolating from a specification table.

        Online support WhatsApp
        WeChat
        Scan the QR code to add us on WeChat
        Call us Back to top