Machine vision is one of the fastest-growing areas in industrial automation. Combined with modern PLCs and AI, camera-based systems now handle quality inspection, part counting, optical character recognition, guidance for robots, and defect detection at speeds impossible for human inspectors.
This guide covers how vision systems integrate with PLCs, which vendors to consider, and how to build a production-ready inspection system. Aimed at automation engineers expanding their skills into vision.
What Is Machine Vision?
Machine vision is the use of cameras and image processing to perform industrial tasks automatically. Components:
- Camera (area-scan, line-scan, 3D, thermal)
- Lighting (backlight, ring, coaxial, structured light)
- Lens (macro, telecentric, wide-angle)
- Processor (embedded smart camera or PC with frame grabber)
- Software (pre-built tools or custom AI models)
- Communication to PLC (Ethernet/IP, PROFINET, Modbus, digital I/O)
Common Industrial Vision Applications
- Quality inspection — Detect defects, contamination, colour variation.
- Part counting and sorting — Count components on a conveyor.
- Dimensional measurement — Measure parts to sub-millimetre accuracy.
- OCR / barcode reading — Read labels, serial numbers, lot codes.
- Robot guidance — Locate parts for pick-and-place.
- Assembly verification — Confirm correct parts in correct positions.
- Packaging inspection — Fill levels, seal integrity, label alignment.
- AI-based defect detection — Identify defects no rule-based system can catch.
Vision System Types
Smart Cameras (Self-Contained)
All-in-one cameras with built-in processor, software, and PLC communication. Most popular for simple to medium applications.
Vendors:
- Cognex In-Sight (industry leader, expensive but powerful)
- Keyence CV-X / IV Series (Japanese, strong UK presence)
- Omron FH/FH-L (good mid-range)
- Basler pylon Vision (modular, cheaper)
Pros: Fast setup, rugged, reliable, direct PLC connection. Cons: Limited flexibility, expensive per unit (£3k–£8k).
PC-Based Vision
Industrial PC with frame grabbers and multiple cameras. Used for complex systems or high-throughput lines.
Vendors:
- Cognex VisionPro (flagship platform)
- MVTec HALCON (deep toolbox, developer-focused)
- MATLAB/Simulink Computer Vision Toolbox
- OpenCV (free, Python-based, flexible)
Pros: Unlimited flexibility, advanced AI integration, multi-camera. Cons: Longer development, higher total cost (£10k–£50k+), requires programming skills.
AI-Powered Vision (2024+ trend)
Platforms combining traditional vision tools with deep learning. Ideal for defects that are hard to describe with rules.
Vendors:
- Cognex ViDi (deep learning add-on)
- Landing AI (no-code deep learning vision)
- Keyence KI-AI
- Google Cloud Vision AI (cloud-based, for offline analysis)
Integration with PLCs
Method 1: Ethernet/IP or PROFINET
Most modern smart cameras speak PLC protocols natively. Typical flow:
- PLC triggers inspection via Ethernet/IP command.
- Camera captures image, processes, stores result.
- Camera returns pass/fail, measurement, or ID via Ethernet/IP.
- PLC acts on result — reject part, log data, adjust process.
Example Cognex setup with Siemens S7-1500:
- Camera configured in TIA Portal as PROFINET device.
- Define input data (trigger, job selection).
- Define output data (result, measurement value, timestamp).
- Write ladder logic: "Rising edge on trigger → send TRIGGER → wait for DONE → read RESULT."
Method 2: Digital I/O (Legacy)
Direct wire between camera output and PLC input. Camera activates a relay on PASS or FAIL.
Pros: Simple, reliable, no programming on camera side. Cons: No detailed data, no measurements — just pass/fail.
Method 3: Modbus TCP
Simple polled communication. Camera exposes a Modbus register map; PLC polls it.
Pros: Universally supported, easy to integrate. Cons: Slower than native protocols.
Method 4: REST API / MQTT (IIoT)
Modern camera systems expose REST APIs. Used with IIoT platforms, not direct PLC integration.
Project Example: Fill Level Inspection on a Packaging Line
Real-world scenario we build with students at EDWartens.
Goal: Inspect bottle fill levels at 300 bottles per minute, reject underfilled bottles.
Hardware
- Cognex In-Sight 2000 smart camera
- Pneumatic ejector with PLC-controlled valve
- Conveyor with part-present sensor
- Siemens S7-1500 PLC (or CompactLogix 5370)
- HMI for setup and alarm display
Setup
- Camera configuration (In-Sight Explorer):
- Define a region of interest (ROI) around the liquid level.
- Use a Trained Tool to detect the liquid-air interface.
- Define pass/fail thresholds (e.g., liquid must be 90–100% of bottle height).
- PLC integration (TIA Portal):
- Add camera as PROFINET device.
- Create an FB called "BottleInspection" with tags: `Trigger`, `FillHeight`, `Pass`, `Fail`.
- On rising edge of the part-present sensor, pulse the camera trigger.
- Wait for the camera's INSPECTION_DONE bit.
- Read PASS/FAIL result.
- If FAIL, energise the ejector valve after a delay of 300 ms (based on conveyor speed).
- HMI screen:
- Show live camera image.
- Display current and last-5 fill heights.
- Alarm on consecutive failures (could indicate a filler problem).
- Count pass/fail totals.
Expected Performance
- Inspection rate: 300 bottles/minute (5 per second).
- False positive rate: < 0.1%.
- Total system cost: ~£15,000 (camera, lights, PLC integration, HMI).
- Payback: 3–6 months typical (reduced waste + fewer rejected batches).
Lighting Is 80% of Machine Vision
Most machine vision problems are lighting problems in disguise. Get this right and the rest follows:
- Backlight: Best for silhouette measurements.
- Coaxial light: Best for flat, shiny surfaces (reduces glare).
- Ring light: Good general-purpose for reflective parts.
- Structured light / laser triangulation: 3D measurement.
- IR backlight: Can see through certain plastics.
- UV light: Highlights fluorescent labels or contamination.
- Dome light: Good for multi-faceted glossy parts.
Test lighting on actual samples before committing. Lighting mistakes cost more than any other vision error.
Getting Started: Learning Path
- Understand PLC fundamentals first — Professional Module at EDWartens.
- Learn image processing basics — OpenCV Python tutorials are free and excellent.
- Train on smart cameras — Cognex In-Sight certification courses (1–3 days).
- Hands-on project — Build a simple inspection using In-Sight Explorer or Keyence CV-X.
- Advance to AI vision — Take our AI Module which includes machine vision with TensorFlow and Cognex ViDi.
Common Pitfalls
- Underestimating lighting. Solve lighting before buying a camera.
- Buying the most expensive camera. Often an In-Sight 2000 (£3k) does what VisionPro (£15k) was sold for.
- Ignoring vibration. Camera and conveyor vibration destroy measurement accuracy.
- Over-fitting AI models. AI trained on perfect samples fails on real defects.
- Not integrating with the PLC properly. A camera without fast PLC feedback is useless.
- No calibration strategy. Vision systems drift; calibration procedures must be part of maintenance.
The Future: AI + Edge + Vision
Modern industrial vision is converging with:
- Edge computing: Processing on the camera or near-camera gateway.
- Cloud analytics: Long-term defect trend analysis.
- Digital twins: Vision data feeds digital replicas for predictive maintenance.
- 5G/private LTE: High-bandwidth camera streams in harsh industrial networks.
Our AI Module covers the intersection of AI and machine vision specifically for industrial applications — predictive defect detection, adaptive quality control, and computer vision for robotics.
Further Reading
- The Future of SCADA Systems in Industry 4.0
- How to Start a Career in Industrial Automation in the UK
- Top 5 PLC Programming Languages
Ready to add machine vision to your skillset? Start with the Professional Module for PLC foundations, then advance to the AI Module for vision and AI integration.

