In the field of industrial visual inspection, the Keyence XG-8000 series and XG-7000 series are renowned for their ultra-high speed, multi camera support, and flexible processing capabilities. With the firmware upgrade to Ver.5.1 (XG-8000) and Ver.4.2 (XG-7000), the system has added a large number of practical features, including 1D barcode reading unit, image stitching unit, PROFINET industrial Ethernet communication, enhanced calculation functions, additional data output for target classification, FTP image transmission, and German interface support. The addition of these functions enables the XG series to not only complete traditional positioning, measurement, and appearance inspection, but also directly read barcodes, stitch large field of view images, and exchange data with PLCs at high speed through PROFINET, greatly expanding its application scope in intelligent manufacturing and automation production lines.
This article starts from the perspective of on-site application by engineers, systematically sorting out the configuration methods, typical application scenarios, common problems, and solutions of these new features, helping users quickly get started and avoid pitfalls.
1D barcode reading unit: allowing the visual system to directly read barcodes
1.1 Function Overview
Before Ver. 5.1/4.2, the XG series mainly relied on 2D code reading units to process QR codes, etc. The newly added 1D code reading unit supports the following code systems:
CODE39 (does not support Full ASCII conversion)
CODE128 (does not support FNC2 linking characters)
EAN/JAN/UPC (including EAN-8/13, UPC-A/E, and 2-digit/5-digit additional codes)
This unit can output rich result data such as barcode reading string, center position (X/Y coordinates), deflection angle, minimum bar width (pixels/module), reading stability (level 5), reasons for reading errors, etc. It also supports comparison with preset reference strings to achieve dynamic date, time, and serial number verification.
1.2 Key parameter settings and optimization
Suggested values for parameter description
Barcode type CODE39/CODE128/EAN/UPC can be selected as needed
When the minimum bar width module width (in pixels) position correction is turned off, it should be ≥ 1.5 pixels; Color image+position correction ≥ 3.2 pixels
The sensitivity of contrast feature extraction is set to Normal by default, and low contrast can be adjusted to Low
Barcode color black background white stripe/white background black stripe/both take a long time, it is recommended to fix them
The expected barcode direction of the reference angle is horizontal at 0 °, which can adapt to rotation
The maximum time for decoding timeout and single recognition is set to 3 seconds by default, which can be adjusted according to the beat
1.3 Advanced Features: Data Segmentation and Fixed Length Output
Data segmentation: The read string can be divided into up to 8 segments based on the starting position and length. Each segment can be output separately and used for reference comparison, suitable for composite information (such as batch number+production date+serial number).
Fixed length output: If the number of characters read is less than the set length, the specified characters (such as underscores) can be automatically filled in, making it convenient for PLC to receive fixed length data blocks.
Symbol identifier: Barcode type identification defined by JIS X 0530 can be added (such as "] J0" representing CODE39) to facilitate downstream system recognition of the code system.
1.4 Auto Tune
Click the "Auto Tune" button, and the system will automatically analyze the barcode in the current image, setting the most suitable contrast, minimum bar width, length range, etc. Possible reasons for automatic tuning failure:
There are multiple barcodes in the inspection area (unable to specify which one to read)
Excessive background noise or extremely low barcode contrast
The timeout period is too short
Solution: Reduce the inspection area to ensure that only one barcode is included; Increase lighting or use filters; Increase the decoding timeout value appropriately.
1.5 Error Handling and Common Problems
Possible causes and solutions for the phenomenon
Unable to read bar width too small (<1.2 pixels) to increase camera resolution or zoom in on objects
Read unstable and insufficient contrast. Enable the "contrast conversion" filter or use RGB grayscale extraction
Misunderstanding barcode with no static area around, increasing the detection area edge blank, or using a position correction unit
If the decoding time exceeds the set value, increase the decoding timeout, or optimize the image quality to reduce the computational load

Image stitching unit (XG-8700/8700L only)
2.1 Principles and Limitations
The image stitching unit can stitch 2-4 monochrome images (source images) into a large image with a maximum of 4864 × 4864 pixels according to the specified reference position and result position. The merged image can be used for all subsequent detection tools, such as pattern search, edge detection, etc.
Limitations:
Only supports XG-8700/8700L (high-speed models)
Only supports monochrome images (color images cannot be stitched together)
The combined image size needs to be pre allocated with multiple camera type image variables
2.2 Configuration steps
Add image variables of the "multi camera" or "multi camera array" type in the variable settings, and set sufficient width and height (32 pixel multiplier width, 1 pixel multiplier height).
In the image stitching unit, specify for each source image:
Whether to participate in splicing (Include=Yes)
Source image variable
Reference position (point in the source image coordinate system, default to top left corner)
Result location (target coordinates in the final image)
Rotation angle (around reference point)
Set the result image variable.
Choose the overlapping area processing method: Max (take the brightest pixel) or Min (take the darkest pixel).
If smooth edge stitching is required, enable "interpolation processing" (which will increase computation time).
2.3 Typical Applications
Multiple cameras capture large-sized workpieces and combine them into a complete image for overall defect detection.
The line scan camera captures long images in segments and then concatenates them to avoid excessive data volume in a single capture.
2.4 Precautions
To ensure the accuracy of stitching, it is recommended to first perform distortion correction on each camera image (using a calibration unit) before stitching.
The spliced image can only be used as a monochrome image and cannot restore color information.
If there is an overlapping area between the source images, selecting an appropriate overlay mode can eliminate the seam.
PROFINET Communication: Making XG a True Industrial IoT Node
3.1 Overview of Supporting Features
XG series Ver. 5.1/4.2 now supports PROFINET IO, following Conformance Class A, and can achieve:
Loop communication: Exchange I/O data according to the update cycle (≥ 4ms), with a maximum of 1408 bytes.
Record data communication (non cyclic): Use RDREC/WRREC instructions to read and write up to 1024 bytes of data records.
Data output: The data output unit can directly write the measurement results into the PROFINET output buffer.
I/O control: Mapping system variables (such as external triggers, gating signals) to input/output of PROFINET bits, replacing physical wiring.
Command control: Execute custom instructions (such as switching programs, obtaining versions, reading and writing variables) through PROFINET.
Variable synchronization: Through the% InDataMieldbus [] array, internal variable values can be efficiently modified externally.
3.2 Configuration Process (Taking Siemens S7-300 as an Example)
XG side settings:
System Settings → Communication&I/O → PROFINET → Enable
Set the device name (such as "xg-8000") and IP address (on the same network segment as the PLC)
Choose data processing priority (recommend prioritizing "communication" to avoid timeouts)
Configure I/O address mapping: specify command function start address, data output start address, etc
Generate GSDML file: Use "Create GSDML file" on XG to generate a device description file and import it into STEP 7.
PLC side configuration:
Install GSDML file in HW Config and drag XG-8XXX into PROFINET IO system.
Set the device name to match the XG end, and the IP address can be automatically assigned.
Attention: Do not delete the Bit module (slots 1-5, 12-16), otherwise communication will be abnormal.
The update time and parameter/result byte module size can be adjusted as needed.
Download configuration and run: After both PLC and XG are restarted, the LINK LED flashes to indicate successful communication.
3.3 Data output and handshake
After selecting "PROFINET" as the device for the data output unit, offset address and handshake mode can be configured.
Handshake ON (recommended): After each output, set the Result ready flag to 1. After the PLC completes reading, set the Result ack flag to 1. Only after XG receives it, clear the ready flag and prepare for the next output. Avoid data being overwritten.
Handshake OFF: XG continues to overwrite output data, and the PLC needs to determine the validity of the data on its own.
FAQ:
The Result OR flag is always 0 → Confirm that the data output unit has output at least one data to PROFINET.
Data misalignment or overlap → Check the byte range occupied by offset addresses and command functions to avoid conflicts.
3.4 Command Control Practice
The process of executing commands through PROFINET:
Write the command code into the Command Number (such as PW representing program switching).
Write the parameters into Command Parameters 1-16.
Set the Command request flag.
Wait for the Command complete flag to become 1 and check if the Command error flag is 0.
Read Command Data (return value) and Command Result (0 successful).
Clear the Command request flag and prepare for the next command.
Example: Switch the program to the 11th
Command Number=2 (Custom PW Command Number)
Command Parameter1 = 11
After triggering the request, the program switch is completed.
3.5 Variable synchronization
By mapping% InDataMieldbus [0]~[n] to the byte address of PROFINET output data, PLC can directly modify XG internal user variables. The use of the 'InDataMieldbus sync inhibit flag' enables multiple variables to be updated simultaneously, preventing intermediate states from being read.

Enhancement of data output unit
4.1 Crop array data according to the number of detections
When outputting array results (such as the coordinates of multiple spots), even if no object is detected, the default value (such as 0) will still be output. After adding the option 'Use number of detected items to control outputting array data', the output quantity will be consistent with the actual detection quantity, avoiding the PLC from processing a large amount of useless data.
Applicable scenario: Detecting changes in the number of targets (such as different numbers of screws on different batches of parts).
4.2 FTP Server as Output Destination
The image output unit has added an FTP server option. The inspection images can be directly saved to a remote FTP server for central data archiving. Use in accordance with file name rules (automatic date and time or sequential numbering) to avoid overwriting.
Attention: Before use, it is necessary to configure the IP address, port, username and password of the FTP server in the system settings.
New functions added to the computing unit
Ver. 5.1/4.2 has added multiple utility functions to the computing unit:
Typical Applications of Function Functions
CalibInfo (P1, P2, CALIB [], CINFO []) calculates the field of view size, pixel resolution, camera rotation angle, and whether left or right hand conversion occurs based on calibration parameters and camera pixel size to convert pixel coordinates into actual physical coordinates
AngleTrans (D, P) converts angle values to a specified range (-179.9~180 ° or 0~359.9 °) for normalized angle output
UVWTrans (P1, P2, P3, P4 [], P5 [], UVW []) converts the relative displacement of the XY θ platform into the displacement of each axis of the UVW (three-axis) platform for platform alignment control
ClearVariables S/P/L/C and array versions reset the accumulator by resetting user variables to zero
ResetVariable S/P/L/C and array versions restore user variables to their initial values and preset values
These functions greatly enhance the flexibility of on-site custom calculations and reduce reliance on external PLCs or PCs.
Additional data for target classification
The target classification function (used to classify detected defects or objects) now allows for the addition of three additional user specified data items (such as processing times, defect area, variable values). Additional data will be displayed on the classification result interface and can be output together with the classification results.
Note: This feature is only available for XG-8000 series Ver.5.1, and once enabled, unit parameters cannot be saved in Ver.5.0 format.
Communication monitoring and diagnosis
7.1 EtherNet/IP Monitoring
Added the "EtherNet/IP Monitor&Diagnostics" tool, which allows real-time viewing of the bit and byte status of input/output data, and supports manual forced modification of output data for offline testing. Very suitable for troubleshooting communication data mismatch issues.
7.2 PROFINET Monitoring
Similarly, "PROFINET Monitor&Diagnostics" can view loop data, connection status, and diagnostic information. When communication is disconnected, "Disconnected" will be displayed here to help quickly locate the problem.
Shadow Correction (HSP)
The shadow correction filter has added a "Shading Correction (HSP)" mode. Compared to regular shadow correction, HSP suppresses partial correction effects and has a faster processing speed. Suitable for scenes with uneven lighting but high real-time requirements.
German language support
German (Deutsch) has been added to the system interface. Change "System Language" to German in the system settings and restart. In display templates and custom menus, you can specify German text by adding the prefix "<G>" before the text to achieve multilingual switching.
Summary of Common Problems and Solutions
Cause and solution of the problem
PROFINET cannot connect to the device name or IP address mismatch. Ensure that the XG device name matches the PLC configuration; Check if the IP is on the same subnet; Restart both devices
1D code reading timeout, poor barcode quality or too large area, reduced inspection area; Enable automatic tuning; Adjust lighting or lens focal length
After image stitching, there are jagged edges and interpolation is not used. Enable 'Use Interpolation'; If it still exists, check if the reference position is accurate
The number of data output arrays is incorrect and not enabled. Control by detection quantity. Check 'Use number of detected items...'
Variable synchronization update is not synchronized. The synchronization suppression flag is not set to InDataMieldbus sync inhibition flag. Write all variables and then clear the flag
The German character display garbled system language has not been switched to German and restarted to ensure language consistency during upload/download
