Welcome to the Industrial Automation website!

NameDescriptionContent
XING-Automation
E-mail  
Password  
  
Forgot password?
  Register
当前位置:

KEYENCE XG-8000 Line Scan Visual Debugging Guide

F: | Au:FANS | DA:2026-05-25 | 22 Br: | 🔊 点击朗读正文 ❚❚ | Share:

Complete Guide to Hardware Integration and Image Optimization of KEYENCE XG-8000 Series Line Scanning Vision System

On modern high-speed and high-precision manufacturing lines, line scanning cameras have become an ideal choice for detecting long materials, cylindrical surfaces, or large workpieces on conveyor belts due to their ability to image objects line by line during continuous motion. The Keyence XG-8000 series machine vision system, with its multi-core DSP, line scan camera (XG-HL08M) supporting up to 8192 pixels, and flexible I/O and communication expansion capabilities, provides engineers with a complete solution from hardware installation to image correction. This article will delve into the key steps of system integration, common causes of image distortion, trigger synchronization settings, light source control, and troubleshooting methods for the XG-8000 series (including the XG-8702L/8502L controller and XG-HL series line scan camera), helping on-site engineers quickly build a stable and reliable visual inspection system.


System composition and hardware installation points

1.1 Standard kits and selection confirmation

The XG-8000 controller (taking XG-8702L as an example) that leaves the factory includes:

Host unit x 1

SD card (CA-SD1G 1GB or OP-87133 512MB, must be inserted into SD1 slot to boot)

RS-422 ferrite magnetic ring (ZCAT2035-0930A)

Terminal label group

The optional line scan camera is available in three resolutions:

XG-HL02M: 2048 pixels, pixel size 7 × 7 μ m, minimum row scanning period 24 μ s

XG-HL04M: 4096 pixels, pixel size 3.5 × 3.5 μ m, minimum row scanning period 24 μ s

XG-HL08M: 8192 pixels, pixel size 3.5 × 3.5 μ m, minimum line scanning period 45 μ s (requires M40 interface lens)

1.2 Installation taboos for controllers and cameras

Heat dissipation requirements: Leave a ventilation gap of at least 50mm above and below the controller, and 50mm on both sides. If multiple units are installed side by side, the spacing should not be less than 50mm. The front panel needs to leave 90mm for cable insertion and removal.

Installation direction: It can only be installed in the "upward" direction as shown in the bottom diagram, and cannot be inverted or placed on the side.

Insulation treatment: The camera casing is isolated from the equipment through a plastic mounting bracket. The accompanying plastic mounting plate and screws must be used, otherwise the camera circuit may be damaged due to live or noise interference from the mounting base.

Lens installation: Do not touch the internal photosensitive surface of the camera before installation; Tightening torque ≤ 0.5 N · m to avoid lens loosening caused by vibration (thread locking adhesive can be used).

1.3 Connection sequence of expansion units

Camera Expansion Unit XG-E800: Connected to Expansion Unit Connector 1 on the right side of the controller, used to connect a second camera (up to two, requiring XG-EC80L).

CC Link Unit CA NCL10E: Connected to the left Expansion Unit Connector 2. If you need to use the CA-DC21E lighting expansion unit simultaneously, you must first install the CC Link unit tightly against the controller, and then install the lighting unit on the left side of the CC Link unit. It is prohibited to install CC Link units on the outside of lighting units.

Lighting Expansion Unit CA-DC21E: Up to 4 units can be connected in series, controlling up to 8 LED light sources. When connecting, it is necessary to install the accompanying gasket first.

All expansion units must be loaded and unloaded while the controller is powered off, otherwise the interface may be burned.


Anti interference measures for power supply, grounding, and cables

2.1 Power terminal wiring

The power supply terminals of the controller are A1 (+24V), A2 (0V), and FG (protective ground). AWG14~22 wire must be used, with a terminal screw torque of 0.8 N · m. Power requirements:

Rated 24 V DC, allowable fluctuation -15%~+10% (i.e. 20.4~26.4 V)

Recommend using switch mode power supplies with double insulation or reinforced insulation (such as CA-U3)

The A2 terminal must be grounded (Class D grounding, grounding resistance ≤ 100 Ω), otherwise it may cause program abnormalities due to electromagnetic interference.

2.2 Encoder connection (RS-422 with open collector)

XG-8000 supports connecting rotary encoders through IN2 terminal blocks to achieve image line acquisition and object motion synchronization.

RS-422 line drive output: Connect the A+, B - and other signals of the encoder to the corresponding terminal of IN2. The accompanying ferrite magnetic ring must be fitted within 300mm of the controller side cable. The 5V OUT terminal can supply power to the encoder, but the current is ≤ 150 mA; if it exceeds the limit, an external 5V power supply is required. The shielding layer is connected to FG.

Open collector output (24V DC type): can be directly connected to the universal input terminal of IN1 or parallel I/O (24V level). Note that 5V open collector encoders are not supported.

After connection, the encoder needs to be enabled in the system configuration:

System configuration → Communication&I/O → Terminal blocks&parallel ports → Input allocation → Encoder settings, select "Encoder 1" and match the output type (Open Collector or RS-422). After activation, some universal input terminals (such as F_IN1~3) will be occupied.

2.3 Light source connection and voltage selection

The CA-DC21E lighting expansion unit provides two LED output ports (LIGHT 1, LIGHT 2). Maximum load of output terminal: 24 V DC or 12 V DC, selected through the DIP switch (8-bit) on the right side of the unit:

Position 1-4 controls LIGHT 1 (all OFF=12V, all ON=24V)

Position 5-8 controls LIGHT 2 (all OFF=12V, all ON=24V)

Danger warning: If a 12V light is connected to a 24V output, it will immediately burn out and may cause a fire. The default voltage at the factory is 12V. Before making any changes, be sure to check the lamp nameplate.

The IN terminal block provides a forced light off input (LOFF), and when the terminal is ON, all LED outputs are turned off, which can be used for safety interlocking.

Image acquisition mode and parameter calculation

The line scan camera has two core acquisition modes: "Fixed" and "Continuous".

3.1 Fixed frame mode (suitable for shooting a rectangular image with a single trigger)

Used for detecting workpieces with limited length, collect one frame (consisting of N rows) per trigger.

Key parameters:

Shutter Speed: Exposure time per line (μ s). It must be at least 3 μ s smaller than the Line Trigger Cycle.

Number of Lines: Frame height (number of lines). Calculation formula:

Rows=vertical field of view (mm)/horizontal pixel resolution (mm/pixel)

For example, with a 2048 pixel camera and a horizontal field of view of 150 mm, the resolution is 0.073 mm/pixel. To shoot a 100mm long workpiece, 100/0.073 ≈ 1370 lines are required.

Line Trigger Cycle: The time interval (μ s/line) between two adjacent lines of data collection, determined by the speed of object movement

Cycle (μ s)=(vertical movement time (μ s))/number of rows

Movement time=Vertical field of view length (mm)/Movement speed (mm/s).

For example, if the speed is 200 mm/s, the vertical length is 100 mm, and the movement time is 0.5 s=500000 μ s, then the period is approximately 500000/1370 ≈ 365 μ s/line.

Trigger method:

Timed trigger: Select "Method"="Time" in Capture Options and trigger internally according to the set cycle.

Encoder trigger: Select "Encoder" and trigger each line of acquisition through external pulses. The unit of Line trigger cycle needs to be set in "Parameters" as the number of pulses per line. For example, if the total number of pulses for the workpiece is 4110 and 1370 rows are required, then set 3 pulses per row.

3.2 Continuous mode (suitable for infinite length material detection)

The camera continues to capture, and the image buffer adopts a "overlay" mode. Additional Overlapping Lines need to be set to create overlapping areas between adjacent frames to avoid frame loss.

Note: The continuous mode forces the number of image buffers to be set to 3, and the operation type is' overwrite '. If the original settings do not match, the system will automatically make changes.

3.3 Correction of vertical stretching/compression of images

If the displayed image is stretched or flattened in the vertical direction, it indicates that the Line Trigger Cycle does not match the actual motion speed:

The image is stretched downwards → the triggering period of the row is too large → the period value should be reduced.

Image compression upwards → line trigger cycle too small → cycle value should be increased.

When adjusting, you can simultaneously observe the Brightness and Sharpness LED indicators on the back of the camera. Default threshold: Brightness LEDs 1/2/3 correspond to maximum grayscale values of 64/128/192 respectively; The sharpness LED corresponds to a maximum differential value of 10/20/30.


Lens selection and working distance determination

The XG-HL02M/04M uses a C-mount lens (such as the CA-LHW series), while the XG-HL08M uses an M40 P0.75 special interface lens (such as the CA-LHL series).

Check FOV chart: Taking CA-LHW16 (16mm lens) as an example, if a horizontal field of view of 200mm is required, the chart should display a working distance (WD) of 200mm and a 0.5mm extension ring should be added.

Note:

Ordinary C-mount lenses (non CA-LHW) may not be able to cover the wide image plane of line scan cameras, resulting in dark corners at the edges.

When using macro lenses (CA-LM0210, CA-LML0210), the lens must be directly fixed to the device using a dedicated mounting bracket (OP-87337), otherwise the weight of the lens may damage the camera interface.


Lighting Technology and Shadow Correction

5.1 Selection of Lighting Modes

Mirror reflection: used to detect dents, scratches (scattered light, defects in dark areas) on flat surfaces.

Diffuse reflection: used to detect protrusions and burrs (light directly reflects back to the camera, bright areas display defects).

Transmitting illumination: used for foreign object detection on transparent/semi transparent films, where foreign objects obstruct light and present dark spots.

5.2 Shading Correction

When the brightness within the field of view is uneven (such as dark edges and bright centers), shadow correction must be performed.

Operation steps:

Open the Linescan Calibration tool in Flow Editor.

Click Shading Correction to display the intensity curves before and after correction.

Set Correction Region: X center, width, and average number of lines in the Y direction (it is recommended to take the average of multiple lines).

Set Smooth Range: A narrower range is suitable for local brightness changes, while a wider range is suitable for overall gradients.

Click Execute, and the calibration values will be automatically written into the camera's internal system.

The correction values can be saved to the SD card (default path SD2: xg linecam ) and restored through Load Correction Values.

Note: The maximum correction magnification is 5 times. If adjustments are still needed after calibration, please perform calibration again and do not manually modify the gain.

5.3 LED Threshold Customization

The brightness/sharpness LED threshold on the back of the camera can be modified in Linescan Calibration. For example, changing the threshold of Brightness LED 3 from 192 to 240, so that only very bright areas trigger the third light, is suitable for high reflective materials.

Communication interface configuration and PC software connection

XG-8000 provides five communication methods, and engineers need to choose according to the requirements of the on-site PLC or upper computer.

6.1 RS-232C (Port 1: RJ-11, Port 2: D-sub 9-pin)

Default usage: Port 1 is used for data output/command control, and Port 2 is used for touch screens (CA series).

Parameters can be set: baud rate (9600~230400 bps), data bits of 8, stop bits of 1/2, parity check of none/odd/even.

Wiring: Use OP-26487 (2.5m direct connection) or self-made crossover wire. Pay attention to the signal GND and power GND being grounded together to avoid voltage differences.

6.2 Ethernet

Connection method: Supports 1:1 crossover (recommended OP-66843 Gigabit crossover) or direct connection through a switch (Category 5e or above STP shielded wire).

Protocol: TCP/IP (ASCII commands), PLC Link, EtherNet/IP, and FTP client.

Settings: IP address, subnet mask, and default gateway are set in the system configuration. When using 1000BASE-T, it is necessary to use Category 5e or higher.

6.3 USB (for dedicated software only)

Usage: Only for connecting XG VisionEditor/VisionEerminal, does not support ordinary USB devices such as mice and USB drives.

Driver installation: The first connection requires installing the USB driver from the CD (located in driver USB). Under Win7, drivers need to be manually updated through the Device Manager.

Limitation: Only one controller can be connected to the same PC; Excessive cable length or the use of extension cords can cause instability.

6.4 CC-Link(CA-NCL10E)

Station type: Ver.1.10 or Ver.2.00 remote device station.

Communication speed: 156 kbps~10 Mbps, total extension distance is rate dependent (≤ 100 m at 10 Mbps).

Terminal resistor: Select the matching terminal resistor according to the cable model and install it between the DA and DB ends of the network.

Settings: Set the number of occupied stations (1-4) and loop settings (1x/2x/4x/8x) in the system configuration. After changing the settings, the controller and main station must be restarted.

6.5 Parallel I/O (40 pin flat cable)

Expand 22 universal inputs and 22 universal outputs (partially high-speed output F_OUT) using OP-51657 (3-meter ribbon cable).

Default allocation: IN0-IN15, OUT0-OUT21. Functions can be redefined through system variables such as Trg1Ready and CMDReady.

Attention: COMOUT2 terminals 17 and 40 are connected internally, ensuring that both have the same potential.


Handheld controller and special start combination key

The handheld controller OP-84231 provides the following core functions:

8-way joystick: Move the cursor and confirm in the center.

TRIGGER (No.3): Trigger all cameras at once; Long press to enter continuous triggering.

Function (No.1): Call out function menu.

RUN/STOP switch: Switch between run/edit mode.

Special startup combination key (for fault recovery):

Combination key function

No.2+Power ON initializes the controller to default settings and formats the SD1 card (all data will be lost)

No.1+Power ON forced display of initial startup screen (language/resolution selection)

No.1+8-way joystick+power ON forced offline mode start

No.6+Power on, obtain network settings through BOOTP

Runtime key combination (default):

No.1+No.5 (or No.7+No.5): Save the screenshot to SD2.

No.1+No.2 (or No.7+No.2): Send a reset signal in operation mode.

No.1+No.4 (or No.7+No.4): Switch screen display type (raw/filtered, etc.).


Common fault diagnosis and troubleshooting

8.1 No display after power on

Check if the 24V power supply is connected to A1/A2 and the polarity is correct.

Confirm that the monitor supports SVGA (800 × 600) or XGA (1024 × 768) with a vertical frequency of 60 Hz.

Check if the SD1 card is inserted and functioning properly (the controller cannot start without the SD1 card).

If the screen is still black, press and hold the No.1 key while powering on to force entry into the initial settings screen.

8.2 The image is completely black (but triggers normally)

Check if the aperture is open and if the lens cover is removed.

Confirm if the lighting power is turned on (the PWR LED of CA-DC21E should be on).

Adjust shutter time: If the shutter speed is ≤ 3 μ s but the Line Trigger Cycle is smaller, the shutter cannot complete the exposure (the 3 μ s difference must be followed).

Check 'Lighting Expansion Unit' in Capture Options and specify the correct light number.

8.3 Vertical displacement or skipping rows in the image

Encoder pulse counting abnormality: Use an oscilloscope to check the A/B phase signals and ensure a phase difference of 90 °. Adjust the Sampling Mode (1x/2x/4x) in Encoder Settings to match the encoder resolution.

Direction error: If the actual motion direction causes the image to reverse, you can set it to CW (clockwise counting only) in the Encoder Direction or enable Reverse Detection for reverse counting at the same time.

8.4 Communication Error (RS-232C or Ethernet)

Check if the port settings are consistent with external devices (baud rate, parity).

When using XG VisionTerminal, ensure that the firewall is not blocking UDP ports.

For USB connections, if frequently interrupted, investigate nearby sources of interference such as frequency converters and solenoid valves. Plug and unplug the USB cable and restart the software.

8.5 SD card error

Green indicator light: normal; Red: Accessing (cannot be unplugged); Extinguish: Can be safely removed.

Before removing the SD2 card, you must first select Stop SD2 Operation from the function menu, click OK, the indicator light will turn off, and then unplug it.

The SD1 slot cover plate is fixed with screws to prevent accidental removal during operation.


Debugging tools: Linescan Intensity Calibration and Edge Graph

Linescan Calibration: Real time display of the grayscale curve and differential curve of the selected row. Can be used for precise focusing (making the differential peak steepest), adjusting the angle of the light source to obtain a flat grayscale distribution.

Edge Graph: In running mode, selecting the edge detection tool can dynamically display the edge intensity change curve to assist in determining whether the threshold setting is reasonable.

Trend Edge Profile: displays the average, maximum, and minimum values of segmented edge positions, suitable for detecting changes in width or translation.

  • Omron NS12-TS01B-V2 Touch Screen HMI
  • Mitsubishi FX3GE-24MT/ESS PLC Controller
  • Grundig NEA02 AES 0 PLC I O Module
  • Beckhoff EP3204-0002 EtherCAT Box Module
  • Mitsubishi MDS-A-CV-220 Power Supply Unit
  • MCX20B2 080G0330 Motion Controller
  • Toyo Keiki P CARD5 Interface Board YH-212
  • National Instruments NI 9242 Analog Input Module
  • B&R 3AM055.6 PLC Module
  • Omron CJ1W-ETN21 Ethernet Module PLC
  • Allen-Bradley 2711P-T15C4A7 PanelView Plus 1500 Guide
  • Pilz 777602 Safety Module XV1P Specifications
  • NI cFP-2220 and cFP Modules Technical Guide
  • Keyence XG-EC80 Camera Input Unit Overview
  • Dynatronix CRS9-10 DC Power Supply Manual
  • Omron G3PW-A220EC-S-FLK Power Controller Manual
  • EVO SP SYSTEM PLC Control Panel Overview
  • B&R X20IF10G3-1 Interface Module Specifications
  • NL8060BC21-11 Industrial LCD Screen Specification
  • SK-G9-FAN1-F6 Cooling Fan Technical Specifications
  • US Drives 3000-4220-4-4 PLC Add-on Module
  • Allen-Bradley 2002-NX70-HSC4 High-Speed Counter
  • Schneider TM258LF42DR PLC Controller
  • Harris 8800-00002-02 PLC Power Control Center
  • NLT NL8060BC21-11C 8.4 LCD Panel
  • ABB PLUTO S20 V2 CFS Safety PLC
  • Omron NS12-TS00B-V2 NS12-TS00B-ECV2 HMI
  • 7-29 10 00 A PLC Expansion Module
  • B&R X20DC2395 PLC Module
  • Omron NE1A-SCPU02 Network Controller
  • GE IC200UEX624-C VersaMax Micro PLC
  • Rexroth GIV50-11 Position Limit Switch Assembly
  • B&R X20SLX410 Safety Logic Module
  • Omron CJ1W-NC433 Position Control Unit
  • Inovance AM600-CPU1608TP PLC Controller
  • ABB Pluto S20 V2 CFS Safety PLC
  • Omron CJ1W-NC113 Position Control Unit
  • Grundig NEA02 AES 0 PLC I O Module
  • Fanuc A16B-2202-0432 Control PCB Board
  • Siemens 6SN1124-1AA00-0DA0 Simodrive LT Module
  • B&R X20AO2632 Analog Output Module Specifications
  • Georges Renault 6159187760 PLC Board Technical Guide
  • IDEC PLC FC6A-D32K3CEE MicroSmart Controller Manual
  • 6ES7226-6BA32-0XB0 Fail-Safe Digital Input Guide
  • Programmable Controller PLC EC20-4040BRA Specification
  • Grundig PLC NEA02 AES 0 I/O Card Specification
  • Seiki POS-M 10-22-01 Card Positioning Board Manual
  • Ormec Systems PMC960 Motion Controller CPU Guide
  • GEFRAN U16-NS 6YC000000000002 PCB Technical Specification
  • ABB SPAJ 140 C Overcurrent Relay Technical Manual
  • Omron NS5-MQ00B-V2 Touch Screen HMI
  • Siemens 6DP1280-8AB SIMADYN D Control Module
  • Schneider HJA36060U43X PowerPact H Breaker
  • WITTENSTEIN LP120X-MF2-50-1I1-3X-SPE Planetary Gear
  • Omron G9SX-GS226-T15-RT Safety Guard Relay
  • Omron CPM1A-40CDT1-D-V1 Programmable Controller
  • ABB ACH550-01-05A4-4 HVAC Drive 2.2kW
  • Schneider TSXDMZ28DT Modicon TSX Micro I/O Module
  • Siemens 6DL1131-6BH00-0EH1 ET200SP HA DI Module
  • B&R X20IF10E3-1 PROFINET IO Interface Module
  • Siemens QBE3000-D4 Transmitter
  • Inovance H3U-3624MT PLC Controller
  • Inovance AM600-CPU1608TP PLC Module
  • Omron NS8-TV00B-V2 NS8-TV00B-ECV2 HMI
  • Phoenix ILC 151 ETH PLC Module
  • National Instruments NI-9242 Analog Input Module
  • Fanuc A16B-3200-0521 Main Board
  • NLT NL8060BC26-35F 10.4 LCD Screen
  • Pilz PSEN cs1.1P 540050 Safety Switch
  • Keyence VT-SW4 VT-7SR Touch Panel
  • Siemens 6ES7 131-1BL11-0XB0 Digital Input Module
  • Mitsubishi RJ71EIP91 Ethernet IP Module
  • Siemens 3RW4047-1BB14 Soft Starter 55kW
  • Mitsubishi AJ71C21-A PLC Programmable Controller
  • NL8060BC21-06 8.4 Inch LCD Module
  • Siemens 6ES7215-1HG40-0XB0 PLC S7-1200
  • Siemens 3VA2463-5HL32-0AA0 630A Breaker
  • Saginomiya E-UJ-44030-B Control Board
  • Schmersal MV10H330-11y-M20-1348 Safety Switch
  • Fanuc A16B-1211-0301-04A Control Board
  • Siemens 6SN1123-1AB00-0AA2 LT Module
  • A100005506 Compair Delcos 3100 Control Panel
  • Omron ZFV-CA40 Smart Sensor Amplifier
  • Fanuc A16B-2200-0660 I O Board
  • Omron CJ1W-NC471 Position Control Unit
  • Siemens 6SN1112-1AA00-0AA0 Simodrive PWM Module
  • Mitsubishi GT2708 HMI Touch Panel
  • Siemens 3TK2834-1BB40 Safety Switch
  • INSYS EBW-E100 Industrial Ethernet Router
  • Schneider LC1F400 Contactor TeSys F
  • Mitsui RYP-51 PCB Control Board
  • Tamagawa TS2620N941E172 Encoder
  • Pilz PZE 9 Safety Relay
  • Omron C1000H-CPU01-V1 PLC
  • Siemens 6SL3210-1KE21-3UP1 Frequency Converter
  • Allen-Bradley 440E-L22BNSM Rope Pull Switch
  • ABB CI868K01 Interface Module
  • Stein Sohn E 083.1 PLC Rack
  • Mitsubishi GT2508-VTBD GT2508-VTBA HMI
  • ABB 3BSE018161R1 Module
  • CAREL ASD100 PGD1AY0I00 Operation Panel
  • ABB EK370-40-11 Contactor 220-230V
  • Eaton 9PX1500IRTM UPS 1500VA
  • NCV-20NGNMP Programmable Controller
  • Mitsubishi LE-40MTA-E Tension Controller
  • Fanuc A16B-3200-0429 Control Board
  • Mitsubishi GT2310-VTBA HMI Touch Screen
  • 3A99184G 1C31170G PCB Module Rev 10
  • Schneider 140NOM25200 Modicon Quantum Adapter
  • Mitsubishi NV400-SW 400A Circuit Breaker
  • Applied Materials 0190-51102 Heater Controller
  • Omron C200H-DA003 Analog Output Module
  • Yaskawa JANCD-YCP21-E DX200 CPU Board
  • IAI 12G2-60-250-P-L-C1-SP Intelligent Actuator
  • NLT NL8060BC21-11 8.4 LCD Screen
  • Omron NX502-1300 Controller Unit
  • ABB RVT-6 Power Factor Controller
  • Schneider TM258LF66DT4L PLC Controller
  • NLT NL6448BC26-27D 8.4 LCD Panel
  • NLT NL8060BC21-09 8.4 LCD Screen
  • Keyence XG-8700L Multi-camera Imaging System
  • EPC 50 3183045486 I O Motherboard
  • Nidec Emerson M701-054-00270A CT Drive
  • Therma Wave 18-011040 Controller Assembly
  • Mitsubishi Q03UDECPU PLC CPU Module
  • Allen-Bradley 2002-NX70-MWLINK PLC Module
  • AS-2P-60M-B Industrial PLC Cable
  • Yaskawa JANCD-YCP21-E DX200 CPU Board