CJ1M Serial Printer Output via CJ1W-SCU21-V1 Module

James Nishida14 min read
CJ/CP SeriesOmronTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

The Omron CJ1M CPU unit exposes three distinct external interfaces: a peripheral (USB or RS-232C "Tool"/peripheral) port, a built-in RS-232C port (PORT 1 on most CJ1M-CPU1[] / CPU2[] / CPU3[] units), and one or more Serial Communication Unit (SCU) slots populated with modules such as the CJ1W-SCU21-V1 or CJ1W-SCU31-V1. Engineers who need to print DM-area data on an Epson LX-300 (or any ESC/P-compatible 9-pin serial dot-matrix printer) frequently try to use the peripheral port with the TXD instruction first; that approach fails on the CJ1M because the peripheral port is reserved for CX-Programmer / Hand-Held Programming Console traffic and does not expose Host Link or No-Protocol transmission services.

The correct implementation requires:

  1. Adding a CJ1W-SCU21-V1 Serial Communication Unit to the CJ1M rack.
  2. Selecting either TXDU (No-Protocol mode, CPU unit version 3.0 or later) or PMCR with a Protocol Macro (supported on every CJ1M unit version, but requires CX-Protocol software).
  3. Wiring the Epson LX-300 to the SCU's RS-232C port with a standard DB-9 straight-through or crossover cable as dictated by the printer's DTE/DCE orientation.
  4. Formatting the DM-area payload so the printer receives the correct row, line-feed, carriage-return, and form-feed bytes for the LX-300 ESC/P command set.

This article documents the port-selection rationale, hardware configuration, ladder / ST programming, CX-Protocol macro authoring, and the commissioning checks needed to verify reliable serial printer output on the CJ1M platform. Reference material is drawn from the official Omron CJ1M CPU Unit Operation Manual (Cat. No. W472) and the CJ1W-SCU21-V1 Serial Communications Unit Operation Manual (Cat. No. W336).

Why the Peripheral Port Cannot Execute TXD on the CJ1M

The CJ1M peripheral port is a peripheral-bus interface intended solely for programming devices. According to the W472 manual, the peripheral port on the CJ1M CPU supports only the following services:

  • Host Link slave (CX-Programmer online editing, monitoring, force set/reset)
  • Programming Console bus protocol (for the CQM1H-PR001 and CS1W-PRM21 hand-held consoles)

It does not support the No-Protocol send (TXD / TXDU) mode. Any attempt to issue TXD with the destination port set to the peripheral port (port number 0 in some legacy documentation) returns error flag P_ER with a non-zero status code in A203 (communications port error). On newer CX-Programmer revisions this manifests as a "port not supported" warning during compile, but the instruction is still rejected at run-time by the CPU firmware.

Field note: The CS/CJ-series Host Link port (built-in RS-232C, often labelled "PORT 1") also does not run No-Protocol mode out of the box — the SCU module is the recommended hardware path for any non-Host-Link serial traffic on the CJ1M.

Hardware Selection: CJ1W-SCU21-V1 Module

The CJ1W-SCU21-V1 is a two-port RS-232C Serial Communications Unit that occupies a single CJ-series slot. Each port can be configured independently. With one module installed, the CJ1M gains two fully programmable serial channels that can each be set to:

  • Host Link master or slave (for CX-Programmer, NT-series HMIs, peer-to-peer SCU links)
  • No-Protocol (asynchronous, free-format) — required for direct printer output
  • Protocol Macro execution target
  • Serial PLC Link (for CJ1M-CPU1[] / CPU2[] / CPU3[] peer data sharing)
  • Modbus-RTU master / slave
Table 1 — CJ1W-SCU21-V1 port specifications
Parameter Specification
Module catalog number CJ1W-SCU21-V1
Number of ports 2 (Port 1, Port 2)
Connector Female D-Sub 9-pin (RS-232C)
Maximum distance 15 m (50 ft) per RS-232C standard
Maximum baud rate 115,200 bps (No-Protocol and Protocol Macro)
Data bits 7 or 8
Stop bits 1 or 2
Parity None, Even, Odd
Flow control None, Xon/Xoff, RS/CS (CTS/RTS)
Operating modes Host Link, No-Protocol, Protocol Macro, Serial PLC Link, Modbus-RTU
DM allocation 10 words per port in CIO/CIO-DM area (set in I/O table)

Two module variants are commonly stocked: the SCU21-V1 (RS-232C + RS-232C) and the SCU31-V1 (RS-422A/485 + RS-232C). The Epson LX-300 ships with a 9-pin male DTE RS-232C connector on its "Serial" interface option board, so the SCU21-V1 is the correct part. If a parallel-only LX-300+II is in service, you must use the C82305* / C82306* serial-interface option kit from Epson before the SCU21-V1 will be useful.

CPU Version Determines the Programming Path

The choice of ladder instruction depends on the CJ1M CPU unit's version label, which is printed on the side sticker as "Lot No. __ _ _ _" and exposed as the first two DM words of the CPU status area (e.g. A100 / A101). The version also appears in CX-Programmer under PLC > Properties > CPU Type.

Table 2 — CJ1M CPU unit versions and supported serial send instructions
CJ1M CPU type Unit version No-Protocol send Protocol Macro send Required software
CJ1M-CPU11 / CPU21 Pre-V3 (V1/V2) Not supported on serial ports via TXD/TXDU Supported via PMCR CX-Protocol
CJ1M-CPU12 / CPU22 / CPU13 / CPU23 V3.0 or later Supported via TXDU on SCU ports Supported via PMCR CX-Protocol (only if macros are used)
CJ1M-CPU11/21/12/22 (later lots) EV1 (lot 0306 or later) Supported on built-in RS-232C port only (TXD with port 0) Not on built-in port CX-Programmer only

For a Version 3 CPU, the simplest path is TXDU on the SCU port. For any pre-V3 lot, you must build a Protocol Macro in CX-Protocol and call it from ladder with PMCR(260). The macro approach is more verbose but works on every CJ1M ever shipped, and it is the only viable path on early lots.

Wiring the Epson LX-300 to the CJ1W-SCU21-V1

The Epson LX-300 serial interface is a 9-pin DTE (data terminal equipment) male connector. The CJ1W-SCU21-V1 port is a 9-pin DCE (data communications equipment) female connector. For the simplest No-Protocol link with software (Xon/Xoff) flow control, a "null-modem" crossover cable is required. For hardware (RTS/CTS) flow control, a partial crossover is required.

Table 3 — Recommended DB-9 crossover cable for Epson LX-300 (Xon/Xoff flow control)
Signal SCU21-V1 (DCD/DCE) pin Direction Epson LX-300 (DTE) pin
RD (RXD) 2 3 (TD)
TD (TXD) 3 2 (RD)
SG (Signal Ground) 5 5 (SG)
DSR 6 4 (DTR) — bridge to DSR if no hardware flow
DTR 4 20 (if present, on DB-25) — not used on LX-300 DB-9

If you choose hardware handshaking, also connect SCU pin 7 (RTS) to LX-300 pin 5 (CTS) and SCU pin 8 (CTS) to LX-300 pin 8 (RTS). Always tie signal ground (pin 5 to pin 5) — floating grounds are the single most common cause of intermittent ESC/P character corruption on the LX-300.

Caution: The Epson LX-300 default DIP-switch block on the serial interface board sets baud rate to 9600, no parity, 8 data bits, 1 stop bit, and "Auto line feed OFF". Verify these match the SCU port configuration in CX-Programmer's PC Link & Serial Comm setup, or the printer will silently drop or double-space output.

Configuring the SCU Port in CX-Programmer

After the CJ1W-SCU21-V1 is registered in the I/O table, open PLC > Serial Communications > Port Configuration in CX-Programmer. The dialog allocates the following setup words to the chosen port's DM area. The following parameters target the Epson LX-300 at 9600 bps, 8N1, Xon/Xoff flow control, No-Protocol mode:

Table 4 — SCU port DM area setup for Epson LX-300 No-Protocol
Word (port 1 example) Address Value (hex) Meaning
Port 1 Settings D32000 8000 Bit 15 = 1 enables serial port 1; protocol bits 12–8 = 0 select No-Protocol
Port 1 Transmission Format D32001 000A 8 data bits, 1 stop bit, no parity, Xon/Xoff flow
Port 1 Baud Rate D32002 0005 9600 bps (per W336 baud rate table)
Port 1 Send Delay D32003 0000 0 ms delay before transmission
Port 1 Receive Buffer Size D32004 0400 1024-byte receive buffer (not used for printer output)

The exact DM word addresses depend on the SCU's slot number and whether the CPU is configured for 1:N DM allocation. CX-Programmer writes these values automatically when you click Transfer to PLC; the values are stored in non-volatile flash on the SCU module itself, so they survive power cycle.

DM-Area Payload Layout for LX-300 Print Output

The Epson LX-300 expects printable ASCII characters terminated by carriage return (0x0D). A line-feed (0x0A) is optional if the printer's "Auto LF" DIP is set, but for predictable output it is best to include both. Page ejection is performed with form feed (0x0C). Build the print string in a contiguous DM block as follows:

Table 5 — Example DM area payload (single-line printout)
DM address Content (hex) ASCII meaning
D100 5453 "ST" — first two chars of header
D101 4F4C "OL"
D102 3031 "01"
D103 3030 "00"
D104 3A20 ": "
D105 434F "CO"
D106 554E "UN"
D107 543D "T="
D108 3031 "01" — counter value BCD, right-justified
D109 3235 "25"
D110 370D "7\r"
D111 0A00 "\n" + NUL terminator marker

In ladder, populate this block with ASCII constants and use a counter (CIO 2000.00CIO 2000.01 or a real CN register) converted to ASCII via ASC(286) before the TXDU call. Each DM word holds two ASCII characters in big-endian (high byte first), which is the order TXDU transmits.

TXDU Programming on a Version 3 CPU

The TXDU(256) instruction on a CJ1M-CPU12/22/13/23 V3+ SCU port has the following operand structure (full operand reference is in the W472 Instruction Reference section):

TXDU(256)
  S    : D100       ; first source word of ASCII payload
  C    : D200       ; control word block (5 words)
  N    : 12         ; number of bytes to transmit (must be even and ≤ 256)

The control block at D200 must be pre-loaded with the following:

Table 6 — TXDU control block (D200–D204)
Word Name Value (decimal) Meaning
D200 Port number 0 (built-in) / 100 (SCU port 1) / 200 (SCU port 2) Logical port identifier
D201 Reserved 0 Always 0
D202 Send complete flag (set by CPU) Read-only status
D203 Send count (set by CPU) Bytes transmitted, decremented during transmission
D204 Error code (set by CPU) Non-zero on failure (e.g. 0101 = port busy, 0202 = parity error)

A minimal rung that fires the print on rising edge of W0.00:

| W0.00 |---[ TXDU(256) S:=D100 C:=D200 N:=12 ]---( W1.00 )

W1.00 will turn on for one scan when the send completes successfully. On failure, examine D204 and the SCU status word A220 + n*10 (where n is the SCU unit number in the I/O table).

Edge case: If TXDU is executed while a previous send is still in progress, the instruction sets ER and D204 = 0101 (port busy). Use W1.00 (send-complete) to gate subsequent calls, or risk losing print data.

PMCR Protocol Macro Path (All CPU Versions)

For pre-V3 CJ1M units, or when you need to drive a printer with a more complex handshake (e.g. ESC/P status polling, multi-line form feeds triggered by buffer-full characters), build a Protocol Macro in CX-Protocol. A macro is a sequence of steps and send/receive messages stored in the SCU's flash memory. Ladder code triggers the macro with PMCR(260).

Creating the macro in CX-Protocol

  1. Launch CX-Protocol and create a new project. Select Target > CJ1W-SCU21-V1.
  2. Define a protocol named P001 with a sequence named S001 containing one step, S001.01.
  3. Set the step's Send Message to a Variable (Word) reference pointing to D100 with length 12.
  4. Set the step's Repeat Counter to 1 (no retry) and Send Wait to 0 ms.
  5. Add a Receive message (optional) to clear the Xon/Xoff state after transmission.
  6. Click Transfer to PLC > Protocol Data to write the macro into the SCU module's flash.

Ladder invocation

PMCR(260)
  C1 : #0000       ; control word — always 0000 for standard send
  C2 : #0001       ; protocol number (1 = P001)
  S  : #0001       ; sequence number (1 = S001)
  D  : D300        ; first result word; 4 words of status returned
  W  : W0          ; internal work word (set to 0 before call)

Full register-by-register behaviour is documented in the CX-Protocol Operation Manual (Cat. No. W344). The macro's flash footprint is small (typically < 2 KB), so dozens of print formats can coexist on one SCU module.

Multi-Device Topology: Touch Panel + Printer + Second PLC

The original application requires three serial devices to share one SCU module. The recommended assignment, consistent with the discussion from which this reference is derived, is:

Table 7 — Port assignment table for SCU21-V1 with three downstream devices
SCU port Device Mode Baud / format Flow control
Built-in RS-232C (PORT 1) Omron NT3S touch panel Host Link (NT-Link 1:N) 9600, 7E2 None
SCU21-V1 Port 1 Epson LX-300 printer No-Protocol or Protocol Macro 9600, 8N1 Xon/Xoff
SCU21-V1 Port 2 Second CJ1M (Serial PLC Link) Serial PLC Link (polled) 115200, 8N1 None

Do not cascade the printer onto the same port as the touch panel. ESC/P traffic from the SCU will collide with NT-Link polling and corrupt the HMI screen update. Two independent physical ports are mandatory.

Verification and Commissioning Checks

Before declaring the print job production-ready, run the following acceptance checks in order:

  1. Loopback test: Disconnect the printer, fit a DB-9 male-to-female loopback plug (TD↔RD, RTS↔CTS) on the SCU port, and run a Protocol Macro Send + Receive sequence. Verify that all 12 bytes echo back unchanged. This confirms the SCU's UART is healthy and the wiring is correct.
  2. Status-word sanity: With CX-Programmer online, watch the SCU port status word (n+9 in the SCU's allocated CIO area, where n is the unit word). Bit 7 should be 0 (ready) and bit 6 should be 0 (no transmission error).
  3. Print a known string: Load D100D110 with the literal "DIAG OK v3.0\r\n". Trigger TXDU from the PLC. The LX-300 must print DIAG OK v3.0 on a single line and the green ONLINE light must remain lit.
  4. Throughput test: Print 200 lines in a loop with 50 ms inter-line delay. The LX-300 must not stall, double-space, or drop characters. If characters are dropped, drop baud rate to 4800 or enable Xon/Xoff in the SCU setup word.
  5. Long-run soak: Print 5,000 lines continuously. Verify that the SCU's send-complete flag does not latch on and that no 0101 (port busy) errors accumulate in D204.

Troubleshooting Matrix

Table 8 — Common fault signatures and corrective actions
Symptom Likely cause Corrective action
No output, ER flag set, D204 = 0101 Port busy from previous send Wait for W1.00 (send complete) before re-triggering
Garbled characters Baud-rate or parity mismatch Match SCU port settings to LX-300 DIP switches (default 9600, 8N1)
Output prints but double-spaces Printer "Auto LF" ON and CPU sending LF as well Disable Auto LF on the LX-300, or remove the 0x0A from the DM payload
First 10 lines print, then printer stalls No flow control, SCU overruns LX-300 buffer Enable Xon/Xoff in D32001 setup word and in CX-Protocol macro
PMCR returns 0x0001 in result word Macro P001/S001 not transferred to SCU flash Use CX-Protocol Transfer to PLC > Protocol Data
TXDU executes but nothing leaves the SCU SCU port 1 setup DM block cleared by cold start Re-initialise port settings on first scan with first-run flag P_First_Cycle
Prints OK on bench, fails in cabinet Ground potential difference > 1 V Bond both chassis grounds, use shielded cable, tie shield at one end only

Field-Engineer Checklist

  • Confirm CJ1M CPU lot number is V3.0+ for TXDU shortcut, otherwise plan for a Protocol Macro build.
  • Verify the Epson LX-300 has the serial interface option board installed (C82305*/C82306*) — the parallel-only unit will not respond to SCU traffic.
  • Set SCU port 1 to No-Protocol, 9600, 8N1, Xon/Xoff, 12-byte send length.
  • Pre-load the DM payload with the literal ASCII string, terminated by 0x0D 0x0A for each line and 0x0C for page eject.
  • Trigger TXDU(256) on a single rising-edge input. Latch the send-complete flag to gate the next call.
  • Run loopback test, single-line print, and 200-line throughput test before commissioning.
  • Document the SCU slot number, port number, and DM block addresses on the cabinet label for future maintenance.

Can I use the CJ1M peripheral port with TXD to send data to an Epson LX-300 printer?

No. The CJ1M peripheral port supports only Host Link and Programming Console traffic. It does not expose No-Protocol mode, so the TXD / TXDU instructions will return an error. Use a CJ1W-SCU21-V1 module on a regular CJ-series slot for printer output.

Which CPU lot version allows the simple TXDU instruction on an SCU port?

CJ1M-CPU12 / CPU22 / CPU13 / CPU23 with unit version V3.0 or later support TXDU(256) directly on SCU ports. Earlier lots must use PMCR(260) with a CX-Protocol macro.

What RS-232C cable do I need between the SCU21-V1 and an Epson LX-300?

A null-modem crossover cable connecting SCU pins 2-3-5 to LX-300 pins 3-2-5 is the minimum (TX, RX, signal ground). For hardware handshaking, also cross pins 7 (RTS) ↔ 8 (CTS). Maximum cable length per RS-232C is 15 m.

Do I need CX-Protocol if my CJ1M is a Version 3 unit?

Not for simple ASCII printing — you can use TXDU directly in CX-Programmer. CX-Protocol is required only when you build a Protocol Macro (for older CPUs, complex ESC/P sequences, or status polling).

Why does my LX-300 print double-spaced or drop characters?

Most double-spacing is caused by the printer's "Auto LF" DIP switch being ON while the CPU is also sending 0x0A. Drop either the LF in the DM payload or disable Auto LF on the printer. Character drops at high baud rates indicate missing Xon/Xoff flow control — enable it in the SCU port setup word (typically D32001) and match it on the printer.

Back to blog