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