Problem Context and Integration Goal
Integrating a Sick CLV-series fixed-mount barcode scanner with an Omron CQM1H PLC and an NT20 HMI is a recurring need in conveyor, packaging, and parts-tracking cells. The challenge is two-fold: capture the decoded ASCII string from the scanner's RS-232C port into the PLC's Data Memory, then present that data to the operator on the NT20. The CQM1H-CPU51's built-in peripheral RS-232C port can be addressed directly from ladder logic using TXD(48) and RXD(47), which removes the need for a protocol-macro inner board when only free-run ASCII exchange is required.
This reference covers the complete path: cable pinout, PLC serial port configuration in Syswin 3.4 (and the equivalent CX-Programmer setup), scanner triggering, ladder logic, DM storage, NT20 display mapping, common faults, and a verification procedure. A final section addresses modern alternatives for new designs where the CQM1H is no longer the preferred controller.
Hardware Stack
| Component | Part / Series | Role |
|---|---|---|
| CPU | Omron CQM1H-CPU51 | Built-in RS-232C port on the CPU module; supports TXD/RXD instructions natively |
| Barcode scanner | Sick CLV410, CLV430, CLV440, or CLV450 | Fixed-mount laser scanner with RS-232C ASCII output and |
| HMI | Omron NT20S or NT20M (host link, RS-232C) | Operator panel for displaying decoded data; NT20M supports ASCII strings |
| Serial comm board (optional) | Omron CQM1H-SCB41 | Required only for CX-Protocol macro operation; not needed for plain TXD/RXD |
| Cable | DB9 male-to-female shielded | CQM1H CPU port to Sick CLV serial port; cross TXD/RXD, single-point ground |
| Power supply | 24 VDC regulated, isolated | Shared by PLC, scanner, and digital I/O |
TXD(48)/RXD(47) ladder logic against the CPU port, the SCB41 is not necessary. Adding it unnecessarily burns a slot and complicates the I/O table.RS-232C Pinout and Cable Wiring
The CQM1H-CPU51's peripheral port follows Omron's standard RS-232C pin assignment, which differs from the IBM-PC convention used on most PCs. Verify your cable against the following table before applying power. A miswired ground is the single most common cause of silent failures in this integration.
| CQM1H CPU Port Pin (DB9) | Signal | Direction | Sick CLV DB9 Pin | Notes |
|---|---|---|---|---|
| 2 (SD) | Send Data (TXD) | PLC to Scanner | 3 (RD) | Cross-connect with scanner receive |
| 3 (RD) | Receive Data (RXD) | PLC from Scanner | 2 (SD) | Cross-connect with scanner send |
| 4 (RS) | Request to Send | PLC to Scanner | 8 (CTS) | Connect only if scanner hardware-handshakes |
| 5 (CS) | Clear to Send | PLC from Scanner | 7 (RTS) | Connect only if scanner hardware-handshakes |
| 9 (SG) | Signal Ground | Common | 5 (SG) | Mandatory; single-point ground only |
| Frame (shell) | Shield | — | Chassis | Ground at one end only to avoid ground loops |
Key wiring rules:
- Cross the TXD and RXD pairs: PLC pin 2 to scanner pin 3, and PLC pin 3 to scanner pin 2.
- Connect signal grounds: PLC pin 9 to scanner pin 5. Do not tie chassis to ground at both ends.
- If the Sick CLV is configured for hardware handshaking, wire the RS/CS pairs. If not, leave pins 4 and 5 unconnected or use a jumper for XON/XOFF (depending on the CLV configuration).
- Use shielded cable, ground the shield at the PLC end only, and keep the run under 3 m for reliable 9600 baud operation in noisy industrial environments.
Configuring the CQM1H CPU Port in Syswin
The CQM1H-CPU51 serial port parameters are set in the PLC Setup area, which is mirrored to DM6645 through DM6649. The minimum required settings for free-run ASCII communication are:
| DM Word | Value | Meaning |
|---|---|---|
| DM6645 | 0000 | Port 0 mode: Serial (not Host Link). Bits 0-7 select the protocol. |
| DM6646 | 0003 | Baud rate: 0003 = 9600 baud. Other options 0000=1200, 0001=2400, 0002=4800, 0003=9600, 0004=19200. |
| DM6647 | 0000 | Format: 8 data bits, no parity, 1 stop bit (8N1). Required by the Sick CLV default. |
| DM6648 | 0000 | Transmit delay: default 0 ms. Set to 0050 (50 ms) if the scanner needs a power-on stabilization period. |
| DM6649 | 0000 | No protocol macro loaded; standard ASCII exchange. |
Confirm the port is in Serial Communications Mode (not Host Link). Host Link mode silently discards ASCII data and is the most frequent misconfiguration when porting a working program from a CP1-series PLC.
In Syswin 3.4, open the PLC Setup dialog from the PLC menu, set the values above, and transfer to the PLC. In CX-Programmer, use the PLC Settings editor with the same DM range. After writing, cycle power once to latch the new setup values.
Triggering the Scanner
The Sick CLV scanners do not reliably accept a "scan" command over RS-232C from a CQM1H ladder program. Supported trigger methods are:
- Hardware trigger (recommended): Drive one of the scanner's discrete sensor inputs (e.g., the "Sensor 1" input on the CLV410) from a CQM1H output. Use a 24 VDC sourcing output routed through a 100 ms pulse to give the scanner enough exposure time to read the label.
- Continuous reading mode: Configure the CLV via the CLV Setup software for auto-trigger or continuous mode. The scanner then decodes any barcode in the read range and outputs the data string as soon as a valid read occurs.
-
Serial command (firmware-dependent): Some Sick CLV firmware versions accept a host command such as
<STX>RS<ETX>to request a single read. This is not standardized across the CLV family and must be verified against the specific firmware loaded on your unit.
For most CQM1H applications, option 1 is the most deterministic. Assign a discrete output, for example CIO 100.00, and pulse it ON for 100 ms whenever a scan is required. Wire the output to the CLV's sensor input through the appropriate opto or relay.
Ladder Logic: TXD(48) and RXD(47)
The TXD(48) instruction transmits data from a DM area to the serial port. The RXD(47) instruction receives bytes from the port into a DM area. A typical receive-then-display sequence looks like this:
| 0.00 P_On RXD C:47 D:0 C2:0 D2:DM0500 C3:20 |
| ; port=0 (CPU), buffer @ DM500, 20 words max |
| ; AR8.05 latches ON when receive completes |
| |
| 0.01 trigger TXD C:48 S:DM0510 C2:0 N:5 |
| ; send 5-byte prompt from DM510 to port 0 |
Key control words and flags for port 0 (CPU port):
| Operand | Meaning | When to Use |
|---|---|---|
| AR8.05 | Port 0 Receive Complete flag | Latches ON when RXD buffer is full. Reset with the RXD control word or by executing a fresh RXD. |
| AR8.06 | Port 0 Transmit Complete flag | Latches ON when TXD completes. Used to confirm the outbound prompt was accepted. |
| AR8.07 | Port 0 Error flag | Latches ON on parity error, overrun, or framing error. Must be reset before further receives. |
| AR8.04 | Port 0 Busy flag | Active while a TXD or RXD is in progress. Use to gate ladder execution. |
| DM0500-DM0519 | Receive buffer | 20 words = 40 bytes maximum per RXD invocation. DM0500 holds the byte count and the first two ASCII characters. |
| DM0510-DM0514 | Transmit buffer | Source data for outbound commands (trigger prompts, configuration strings). |
To read variable-length barcodes, the typical pattern is:
- Check AR8.04 (busy) to confirm the port is idle.
- Execute RXD with a fixed buffer size that exceeds the longest expected barcode.
- Wait for AR8.05 to latch ON.
- Read the actual byte count from the low byte of DM0500.
- Move the data from DM0501 onward to a display string area (e.g., DM0600+).
- Reset AR8.05 and AR8.07 by re-executing the RXD with a fresh C3 control word, or by toggling the appropriate bit in the serial port setup.
ASCII Data Storage and String Handling
The Sick CLV outputs the decoded barcode terminated with <CR> (0x0D) by default. When RXD stores the data into DM0500, each ASCII character occupies one byte within a 16-bit word. The byte layout for a 6-character barcode ("ABC123" + <CR>) loaded into DM0500-DM0503 looks like this:
| Word | High Byte | Low Byte |
|---|---|---|
| DM0500 | 0x07 (count) | 0x41 ('A') |
| DM0501 | 0x42 ('B') | 0x43 ('C') |
| DM0502 | 0x31 ('1') | 0x32 ('2') |
| DM0503 | 0x33 ('3') | 0x0D (<CR>) |
To present a readable string on the NT20:
- Move the raw DM0500 buffer to a display string area (e.g., DM0600-DM0619) using
XFER(70)or a series ofMOV(21)instructions. - On the NT20, configure a Numeric Display object of type "Decimal" or "Hex" pointing to the DM range. The operator reads the hex or decimal representation character by character.
The NT20S firmware does not natively render ASCII strings from DM. Two workable approaches for the NT20S:
- Hex display: Display each DM word as a 4-digit hex value. The operator visually decodes the ASCII codes. Practical for short codes or debug.
- BCD/decimal split: For numeric-only barcodes (Code 39 numeric, Interleaved 2 of 5), extract two digits per word and present as a 4-digit decimal number using the NT20's Numeric Display with a "Word" address and 4-digit zero-suppressed format.
For full ASCII string display, the NT20S is the wrong tool. The NT20M (with the V2 firmware upgrade) or migrating to an NS/NB-series HMI is the practical path. The NS5, NS8, NS10, NS12, and NS15 all support ASCII string display with direct DM binding, and the NB-series adds Ethernet connectivity.
CX-Protocol Macro Alternative
CX-Protocol (versions 1.7 through 1.9, depending on the CQM1H-SCB41 firmware) lets you build a full protocol macro that handles framing, terminators, retries, and error recovery. The CQM1H-SCB41 Serial Communication Board is required because the CPU's built-in port cannot run protocol macros. The SCB41 provides one RS-232C and one RS-422A/485 port, occupies one inner slot on the CQM1H, and is configured in the I/O table.
Advantages of the macro approach:
- All serial state machine handling is offloaded from the scan cycle. The PLC does not need to poll AR8.04, AR8.05, or AR8.07.
- CX-Protocol generates clean "barcode received" flags, "transmit complete" flags, and a separate error word you can monitor from ladder.
- Multi-step protocols (handshake, retry, length validation) are defined graphically rather than as a tangle of TXD and RXD rungs.
Disadvantages:
- Requires the SCB41 hardware. Adds cost and slot count.
- Requires CX-Protocol software, which is licensed separately from CX-Programmer.
- Programmers familiar with Syswin 3.4 may need to learn a separate tool.
If you are limited to the CPU port and Syswin 3.4, stay with the TXD/RXD method described above. If you have the SCB41 inner board and CX-Protocol is available, the macro approach offloads all serial handling from the scan cycle and gives you clean "barcode received" flags.
Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| AR8.06 never goes true | TXD instruction not executing; wrong port; or port in Host Link mode | Verify CIO 0.00 contact closes each scan; check C2 control word = 0 for port 0; set DM6645 to Serial mode |
| DM500 never updates | RXD not enabled; port in Host Link; or AR8.07 latched error | Check DM6645 for Serial mode; clear AR8.07 by re-executing RXD with a reset C3 |
| Garbage characters received | Baud rate, parity, or stop bit mismatch | Verify 9600-8-N-1 on both sides; check DM6646 = 0003 and DM6647 = 0000 |
| Scanner LED flickers but no data | TXD/RXD cross-wired incorrectly; or ground missing | Swap pins 2 and 3 between PLC and scanner; verify pin 9 to pin 5 ground |
| Receive complete flag toggles but data is offset | Terminator not configured; or buffer overflowed | Set Sick CLV to append <CR> only; check receive length does not exceed 40 bytes |
| 0x0D appears as last byte unexpectedly | CLV appending <CR> as configured |
Expected behavior; strip the <CR> in ladder if needed using a byte-mask and shift |
| Intermittent misses | Handshaking mismatch; or noise on long cable | Enable RS/CS hardware flow control; wire pins 4/5 to scanner pins 7/8; shorten cable to under 3 m |
| AR8.07 error flag latches ON permanently | Framing error, overrun, or buffer full | Clear with a dummy TXD or by re-initializing the port in the PLC Setup |
| Barcode data appears in DM0500 but NT20 shows zeros | NT20 numeric display not bound to the correct DM range; or display in Decimal with no zero-suppress | Verify the NT20 tag address matches DM0600+; switch to Hex display for direct ASCII view |
Verification Procedure
After installation, perform the following sequence to confirm the integration is working end to end:
- Power up the PLC and scanner. Confirm the CLV's "Power" and "Ready" LEDs are green. The CLV beeps once on power-up if its internal self-test passes.
- From Syswin Online mode, place the PLC in Monitor. Force CIO 0.01 ON momentarily to trigger the scan output (assuming you wired the trigger to CIO 100.00 mapped from 0.01).
- Present a known barcode (e.g., a Code 128 test card reading "TEST12345") to the scanner window.
- Observe DM0500 in the Syswin watch window. Verify the high byte of DM0500 equals 0x0A (10 = 9 ASCII characters + 1
<CR>), and that the bytes spell out "TEST12345" in order across DM0501-DM0504. - Verify AR8.05 latches ON, then clear it with the reset bit or a fresh RXD execution.
- Check the NT20 numeric display. Confirm the hex value of the displayed words matches the expected ASCII codes.
- Cycle the trigger 20 times to confirm repeatability. If any cycle drops the data, the issue is most likely a handshaking or cable noise problem.
- Power-cycle the PLC and confirm the DM6645-DM6649 setup values are retained. The CQM1H holds these in flash-backed RAM; on a cold start, they reload to the last saved values.
Safety and Wiring Cautions
- Do not connect the CQM1H serial port signal ground (pin 9) to chassis ground at both ends. Use a single-point ground to avoid ground-loop currents that can corrupt the data stream. Ground loops at 50/60 Hz often appear as bursts of corrupted characters every 20 ms or 16.67 ms.
- Verify the Sick CLV's 24 VDC supply is isolated from inductive loads such as contactors, solenoids, and motor starters. Scanner comm ports are sensitive to supply-borne noise; a single suppressor on each inductive load is cheap insurance.
- When extending the cable beyond 3 m, switch to RS-422A on the CQM1H-SCB41 to maintain signal integrity. RS-232C is rated to 15 m by spec but is unreliable in noisy industrial environments above 3 m.
- Always check the AR8.07 error flag after each RXD cycle. A stuck error flag will silently block further receives, and the failure mode is "it worked once, then never again."
- The Sick CLV is a Class 2 laser product. Do not stare into the scan window during operation. Most CLV models emit a visible red aiming beam that is eye-safe under normal use but should not be directed at operators' faces.
Modern Alternatives for New Designs
If you are scoping a new system rather than maintaining a legacy CQM1H, the following options simplify the integration considerably:
- Omron CP1H or CP1L PLC: Native support for serial ASCII over the CPU port with TXD/RXD, plus a built-in barcode-reader protocol macro on the optional CP1W-CIF01 RS-232C option board. Programs port directly from CQM1H with minimal changes.
- Omron VHV5-F next-generation fixed-mount barcode reader: Long-range autofocus up to 2 m, designed for high-speed conveyor and robotic assembly applications. Available with Ethernet/IP or RS-232C output. Connects directly to NX/NJ controllers over EtherNet/IP and exposes the decoded string as assembly input data, eliminating the serial cable and ladder parsing entirely. See the manufacturer's VHV5-F product announcement for specifications.
- Direct EtherNet/IP barcode readers: Models from Sick (CLV6xx series), Keyence SR-2000 series, and Cognex DataMan eliminate the serial cable entirely. The PLC reads the decoded string as cyclic assembly data on EtherNet/IP, with the scanner reporting its status, read confidence, and match string in the same telegram.
- NS/NB-series HMI: Native ASCII string display with direct DM binding. The NS5, NS8, NS10, NS12, and NS15 panels all support string tags, and the NB-series adds Ethernet connectivity for remote HMI access.
For a full portfolio of Omron fixed-mount barcode readers, see the Omron Fixed-Mount Barcode Readers product page. The portfolio spans hand-held imagers, fixed-mount laser scanners (V-series), and 2D code readers with built-in EtherNet/IP.
Field-Commissioning Notes
From field experience, three issues appear more often than the documentation suggests:
- The CPU port is sometimes mistaken for the peripheral port. The CQM1H-CPU51 has a peripheral port (top, mini-DIN) used for Syswin/CX-Programmer online connection, and a separate RS-232C port (DB9) on the front. The DB9 port is the one wired to the scanner. The peripheral port should be left for the programming tool.
- DM6645 must be saved to flash. In Syswin 3.4, edits to the PLC Setup are written to the DM area but are not retained across a power cycle unless you specifically transfer the setup and store it. In CX-Programmer, use Transfer to PLC and then Option / Flash Backup after every setup change.
-
The CLV's default string terminator may be
<CR><LF>on some firmware. The CLV Setup software exposes the terminator in the "Output Format" dialog. Confirm only<CR>(0x0D) is enabled, otherwise the receive buffer will contain an extra 0x0A byte that you must filter in ladder.
Related Syswin and CX-Programmer References
- Syswin 3.4 online help, topic "Serial Communications Instructions" - documents TXD(48), RXD(47), and the related control bits in AR8.
- CX-Programmer Operation Manual (W446), section on PLC Setup for CP1/CJ/CS-series - the same DM6645-DM6649 structure applies to the CQM1H but with the original register names.
- CQM1H Serial Communications Board Operation Manual (W363) - required reading for CQM1H-SCB41 protocol macros.
- Sick CLV Setup Software user manual - covers the full CLV410/430/440/450 configuration tree, including output format, terminator selection, and read mode.
Can I trigger a Sick CLV barcode scanner over RS-232C from the CQM1H CPU port?
No, the CLV series does not support a reliable serial-trigger command. Use a discrete output (24 V) wired to the scanner's sensor input for hardware triggering, or use the CLV's auto/continuous read mode configured through the CLV Setup software.
Why does AR8.06 never go true even though my TXD rung has power flow?
AR8.06 is the transmit-complete flag for port 0, but it only latches after a successful TXD execution. Verify that the port control word (C2) is 0, that DM6645 puts the port in Serial Communications Mode (not Host Link), and that the source data range contains the bytes you intend to send.
Is the CQM1H-SCB41 required for the TXD/RXD method?
No. The SCB41 is only required for CX-Protocol macro execution. The CQM1H-CPU51's built-in RS-232C port supports TXD(48) and RXD(47) directly, and a free-run ASCII exchange with a Sick CLV scanner can be implemented in ladder without any inner board.
The NT20S only shows numbers, not ASCII strings - what are my options?
The NT20S firmware does not support native ASCII string display from DM. Either display each DM word as a 4-digit hex value (operator reads the ASCII codes), upgrade to the NT20M with the V2 firmware upgrade, or migrate to the NS or NB series HMI which supports direct ASCII string binding from DM.
What is the maximum number of bytes the CQM1H CPU port can buffer?
The CQM1H CPU port can buffer up to 40 bytes per RXD invocation (20 words). For longer barcodes, perform multiple RXD reads with a C3 control word, or move to the CQM1H-SCB41 which supports larger protocol macro buffers (up to 200 bytes in a single receive).