Configuring S7-1200 SM 1234 4-20mA Output for Yaskawa VFD

David Krause14 min read
S7-1200SiemensTutorial / 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

1. Overview

This reference covers end-to-end commissioning of an analog speed reference from a Siemens SIMATIC S7-1200 CPU 1214 DC/DC/Rly with an SM 1234 analog I/O module, into a Yaskawa industrial AC drive (V1000, A1000, GA500, or J1000 family). The objective is a stable 4-20 mA speed reference loop that lets the drive execute its own internal PID while the PLC acts as setpoint master. The article documents hardware configuration in TIA Portal, two-wire current-loop wiring, scaling with NORM_X / SCALE_X, drive-side parameter assignment (H3 parameter block), run/stop source selection, and field verification.

If you only have analog voltage output available on your SM (e.g. an SM 1232 voltage variant), the wiring section also covers a passive loop isolator / signal converter as a path to 4-20 mA. Skip to Section 4.2 — Loop Isolator Path in that case.

2. Prerequisites and Hardware Identification

2.1 Required Components

Item Typical MLFB / Part Notes
S7-1200 CPU 6ES7214-1AG40-0XB0 (CPU 1214C DC/DC/Rly) Firmware V4.x supports TIA Portal V16+
Analog module 6ES7234-4HE32-0XB0 (SM 1234, 4 AI / 2 AO) AO supports ±10 V, 0-10 V, 0-20 mA, 4-20 mA
Yaskawa drive V1000 CIMR-VU, A1000 CIMR-AU, GA500, J1000 H3 parameter block is common across the family
Shielded twisted pair 2-conductor, foil + braid, 24 AWG min Ground shield at PLC end only
250 Ω precision resistor 0.1 % tolerance, 1/2 W For mA loop verification with DMM
Configuration tool TIA Portal V16 or later Match firmware version to PLC FW

2.2 SM 1234 Output Channel Selection

The SM 1234 provides two analog output channels. Each can be configured in TIA Portal for one of four output types:

  • ±10 V (bipolar, default for many installations)
  • 0 V to 10 V (unipolar)
  • 0 mA to 20 mA
  • 4 mA to 20 mA (required for this application)

The selection is made in the Device View → Properties → Analog outputs → Channel [n] dialog. The selection must also match the physical wiring of the output (current terminals are physically separate on the front connector of the SM 1234; consult the SM 1234 wiring diagram in the S7-1200 System Manual).

3. SM 1234 Hardware Configuration in TIA Portal

  1. Open your TIA Portal project and double-click the SM 1234 in the device view to open its properties.
  2. Navigate to Properties → Analog outputs.
  3. For Output channel 0 (mapped to QW address in your hardware configuration — for slot 1, this is typically QW96 when the CPU has the standard address map), set:
    • Output type: Current
    • Current range: 4 to 20 mA
    • Diagnostics: Enable Wire break and Short circuit to surface analog faults to the PLC diagnostic buffer.
  4. If only one drive is being controlled, leave Output channel 1 disabled or use it for a second drive.
  5. Confirm the Output address shown at the top of the properties window — note this address; it is the QW you will write to in the user program. The address is configurable; many installations place the first SM at QW96, but verify against your actual configuration rather than assuming.
A wire break diagnostic is invaluable. The 4-20 mA loop with a faulted wire will read 0 mA, which the drive interprets as its minimum (e.g. 0 Hz), so a broken wire would silently stall your process. Enable the diagnostic to trigger a CPU LED, fault, or alarm.

4. Wiring the 4-20 mA Current Loop

4.1 Direct Two-Wire Loop (preferred path)

The SM 1234 is a sourcing current output. It actively drives current out of the IO terminal and returns it through the M (common) terminal — there is no loop power supply to install separately, but the load (the drive input) must complete the circuit.

Recommended connections:

SM 1234 Terminal Wire Color (suggested) Yaskawa Terminal Function
AO0+ (output 0 current out) Red A1 (analog input 1 +) Current source
M (analog common) Black AC (analog common) Current return
— (do not connect) — — V models have no separate ground return
S7-1200 / SM 1234 AO0+ M Yaskawa Drive A1 AC + current out (red) return (black) 250 Ω sense resistor optional, in parallel across A1/AC for DMM measurement

4.2 Loop Isolator Path (only if SM 1234 outputs 0-10 V)

If your SM 1234 channel is wired for voltage (0-10 V), a passive loop isolator (e.g. Phoenix Contact MINI MCR, Wago 857 series, or Acromag TT330) converts 0-10 V → 4-20 mA. The isolator must be loop-powered from the drive's 24 V supply if you do not have a separate 24 V rail. Wire the SM 1234 V output to the isolator input, then wire the isolator current output into the drive's A1/AC terminals per Section 4.1.

4.3 Shielding and Routing

  • Use shielded twisted pair; ground the shield at the PLC cabinet end only, leaving the drive end floating or via a small capacitor to chassis.
  • Route the analog pair at least 200 mm away from VFD power conductors and any 3-phase motor cable, including inside the cabinet.
  • Keep loop impedance below the Yaskawa input impedance specification (typically 250 Ω for 4-20 mA). The SM 1234 source voltage compliance is >18 V at 20 mA — more than enough to drive 250 Ω.

5. Yaskawa Drive Analog Input Configuration

The Yaskawa V1000/A1000/GA500 families all expose the analog input on terminal A1 (and optionally A2/A3). The relevant parameters are in the H3 group. The following table maps the required values for a 4-20 mA input on A1 corresponding to 0-100 % speed reference.

Parameter Name Set Value Meaning
H3-01 A1 signal level 2 4-20 mA (0 = 0-10 V, 2 = 4-20 mA)
H3-02 A1 gain 100.0 20 mA = 100 % of selected reference
H3-03 A1 bias 0.0 4 mA = 0 % reference
b1-01 Frequency reference source 1 Analog input A1 (0 = keypad, 1 = A1, 4 = pulse train)
b1-02 Run command source 1 or 2 1 = digital input, 2 = serial comms (RS-485 / Modbus)
d1-01 Frequency reference 1 (max ref) per motor nameplate (e.g. 60.0) Sets 100 % reference in Hz
E1-04 Maximum output frequency per motor (e.g. 60.0) Cap on drive output
H4-01 (optional) Analog output FM signal level 2 Use terminal FM to monitor mA back to PLC if desired
If you set b1-02 = 2 (serial run command), the drive's MEMOBUS/Modbus registers must be enabled. For a first-pass commissioning, leave b1-02 = 1 and run the drive from a digital input (e.g. DI1 forward, DI2 reverse) so you can isolate analog wiring issues from run-command issues.

5.1 Loss-of-Reference Behavior

Drives in this family interpret a 4-20 mA signal < 4 mA (i.e. < 0 raw units) as a reference loss. Default behavior is set by L4-05 (frequency reference loss detection) and L4-06 (action at loss). For safety-critical applications, set L4-05 = 1 (enabled) and L4-06 = 1 (continue at L4-07 frequency) or =2 (ramp to stop). This prevents a wiring fault from driving the motor to full speed unexpectedly.

6. TIA Portal Programming: Scaling the Output Word

6.1 Raw Value Range

The S7-1200 analog I/O driver normalizes current outputs as follows when configured for 4-20 mA:

Current Raw Integer Percent of span
4 mA 0 0 %
12 mA 13824 50 %
20 mA 27648 100 %
< 4 mA (faulted loop) negative value —

The integer range 0..27648 is the entire usable span. Saturated values above 27648 indicate over-range and should be clamped.

6.2 SCL: SCALE_X for 0-100 % → 0-27648

The SCALE_X instruction maps a real (floating-point) value to an integer range. For a 0.0-100.0 % speed reference written to a tag named SpeedRef_Pct and an output integer AO0_Raw:

// FB or OB1 cyclic code, SCL
#AO0_Raw := SCALE_X(
    MIN     := 0,         // 0 % minimum engineering value
    VALUE   := #SpeedRef_Pct,   // real, 0.0 to 100.0
    MAX     := 100.0,     // 100 % maximum engineering value
    OUT_MIN := 0,         // raw integer at 0 % (= 4 mA)
    OUT_MAX := 27648      // raw integer at 100 % (= 20 mA)
);

// Clamp over-range (fault guard)
IF #AO0_Raw < 0 THEN #AO0_Raw := 0; END_IF;
IF #AO0_Raw > 27648 THEN #AO0_Raw := 27648; END_IF;

// Move to the analog output word (verify address in TIA Portal hardware config)
"%QW96"  := INT_TO_WORD(#AO0_Raw);  // adjust "%QW96" to your mapped address

6.3 SCL: NORM_X then SCALE_X for Two-Step Scaling

If your real value already has its own engineering range (e.g. 0.0-60.0 Hz), use NORM_X to bring it into 0.0-1.0 first, then SCALE_X to map 0.0-1.0 to 0-27648:

// Step 1: NORM_X (per IEEE 754 0.0-1.0 normalized)
#Norm := NORM_X(
    MIN     := 0.0,
    VALUE   := #SpeedRef_Hz,  // 0.0 to 60.0 Hz
    MAX     := 60.0,
    OUT_MIN := 0.0,
    OUT_MAX := 1.0
);

// Step 2: SCALE_X (0.0-1.0 to 0-27648 integer)
#AO0_Raw := SCALE_X(
    MIN     := 0.0,
    VALUE   := #Norm,
    MAX     := 1.0,
    OUT_MIN := 0,
    OUT_MAX := 27648
);

6.4 Watchdog and Restart Behavior

When the CPU transitions from STOP → RUN, the analog output holds its last value or 0, depending on the SM behavior configuration. To prevent a drive from receiving a stale 100 % reference on startup, write 0 (or a defined default like 0 %) to SpeedRef_Pct in the startup OB (OB100) before the main OB1 cycle writes the value.

7. Run/Stop and Direction Source Configuration

The analog output only carries the speed setpoint. The drive also needs a run command and, if required, a direction. There are three common architectures:

Architecture Yaskawa Config PLC Source Pros Cons
A: PLC digital outputs to drive DI b1-02 = 1 CPU DO → DI1 (FWD), DI2 (REV), DI3 (EXT FAULT) Simple, isolated, easy to debug with a multimeter Wires per drive
B: PLC DO single RUN line b1-02 = 1, set DI to 2-wire control DO → DI1 (RUN/STOP), DI2 (FWD/REV) 2 wires per drive, OK for unidirectional fans/pumps Direction change requires coil of DI2
C: Serial Modbus (MEMOBUS) b1-02 = 2, H5-01 = 1 (RS-485), H5-02 = 3 (9600), H5-03 = 0 PLC CM1241 RS-485 or CM PtP module Bidirectional, drive status feedback, no copper for run/feedback More programming; register map complexity

For the questioner's application — driving multiple fans/pumps from a single S7-1200 with the drive doing its own PID — Architecture A or C is typical. Architecture A is the lowest-risk starting point for a single drive. Multi-drive networks should standardize on Modbus RTU via a single CM 1241 module.

8. Commissioning and Verification

Follow this order. Do not skip ahead — most analog faults are caught at step 2 or 3.

  1. Loop integrity check (no drive connected yet). Disconnect A1/AC at the drive. Place a 250 Ω precision resistor across A1/AC in the drive (or at the cable end). Connect a DMM in mA mode in series. With the PLC in RUN, force the QW to 0 and verify 4.00 mA; force 13824 and verify 12.00 mA; force 27648 and verify 20.00 mA. Tolerances: ±0.02 mA.
  2. Drive input check. Reconnect the wires. On the Yaskawa keypad, navigate to U1-13 (terminal A1 input %). You should see 0.0 % at 4 mA, 50.0 % at 12 mA, 100.0 % at 20 mA. If the keypad shows the wrong percentage, the H3 parameter block is misconfigured.
  3. Drive at zero reference. With b1-02 = 1 and no run command, force the PLC output to 0 (4 mA). The drive keypad should show 0.00 Hz output. Apply the run command from the digital input; the motor should remain at 0 Hz.
  4. Ramp test. From the PLC, step the reference to 25 %, 50 %, 75 %, 100 % in 5-second dwells. Confirm the drive output frequency tracks linearly using the keypad U1-02 reading. Watch the motor for smooth response; any oscillation is a sign that the PLC scan is too slow or the H3 gain/bias need tuning.
  5. Loss-of-reference simulation. With the drive running at 50 % reference, disconnect the loop wire at the PLC terminal. Within the time set in L4-05 (default ~2 s) the drive should perform the action in L4-06 (continue, alarm, or stop).
  6. Full process verification. Run the process under PLC control for at least 30 minutes. Monitor U1-13 on the drive and the PLC's actual output word; they must agree to within 0.5 % over the full range.

9. Common Faults and Field Diagnostics

Symptom Likely Cause Diagnostic Resolution
Drive reads 0.00 Hz even with non-zero PLC output Wrong QW address; output not enabled in TIA Portal; SM1234 channel set to Voltage, not Current Go online in TIA Portal → watch the QW value; check SM properties Fix the address; re-check the channel type
Drive reads 100 % reference regardless of PLC output Loop wiring reversed or grounded; H3-01 still 0 (voltage) and 0-10 V applied as 24 V from faulted wire Measure V across A1-AC with drive off — should be 0 V; verify H3-01 Re-wire per Section 4.1; set H3-01 = 2
PLC diagnostic buffer: "Analog output wire break" Loop open, resistor too high, or supply compliance exceeded Total loop resistance > 18 V / 20 mA = 900 Ω Use 250 Ω sense; check isolator compliance
Drive reads reference but motor does not run Run command source mismatch (b1-02) Check DI LEDs on drive; check U1-12 (run status) Set b1-02 = 1 if using DI; toggle DI and observe
Output frequency oscillates around setpoint Scan time too long; or H3 gain/bias set incorrectly Monitor PLC OB1 scan time vs. drive accel/decel ramps Add filter (PT1) on SpeedRef_Pct; lengthen accel ramp C1-01
Motor runs at half the requested speed Loop is 0-20 mA, drive expects 4-20 mA; or H3-02 gain is 50 % Check H3-01, H3-02 Set H3-01 = 2, H3-02 = 100.0
CPU goes to STOP with "I/O access error" Writing to a QW address that is not assigned to an output module TIA Portal online → Device view → check QW addresses Use the address shown in the hardware config, not a guessed one

10. Notes on Multi-Drive Scaling

When the S7-1200 SM 1234 controls multiple drives (one QW per drive), each drive needs its own SCALE_X instance. Place a global data block with an array of structures DriveCtrl[n] holding SpeedRef_Pct : Real and AO_Raw : Int, then loop in OB1:

FOR #i := 0 TO 1 DO
    "DriveCtrl".SpeedRef_Raw[#i] := SCALE_X(
        MIN := 0.0,
        VALUE := "DriveCtrl".SpeedRef_Pct[#i],
        MAX := 100.0,
        OUT_MIN := 0,
        OUT_MAX := 27648
    );
END_FOR;
"%QW96" := INT_TO_WORD("DriveCtrl".SpeedRef_Raw[0]);
"%QW98" := INT_TO_WORD("DriveCtrl".SpeedRef_Raw[1]);  // second SM1234 channel

If you need more than two drives, the SM 1234 (2 AO) is insufficient. Use a SM 1232 (2 AO) or add a second SM 1234 in the next slot. The S7-1200 System Manual documents maximum analog module count per CPU; for a 1214C the limit is typically 8 signal modules total.

Why does my drive stay at 0 Hz even though I see a non-zero value in the PLC QW?

The most common cause is that the SM 1234 output channel is still configured as Voltage in TIA Portal Device View. Open the SM 1234 properties, select Analog outputs → Current, set range to 4 to 20 mA, and recompile. Also confirm the QW address you are writing to matches the SM output address in the hardware configuration.

How is 4-20 mA different from 0-20 mA when scaling the raw integer?

In 0-20 mA mode, 0 mA maps to raw 0 and 20 mA to 27648. In 4-20 mA mode, the PLC internally maps 0 raw to 4 mA and 27648 to 20 mA. So 0-27648 is the correct raw range for either mode — the live-zero offset is handled by the analog module driver, not by your scaling block. A signal below 4 mA (broken wire) shows up as a negative raw value, which is the SM 1234's wire-break diagnostic trigger.

Do I need SCALE_X and NORM_X, or is one of them enough?

Use SCALE_X alone when your source is a real number already in engineering units (e.g. 0.0 to 100.0 % or 0.0 to 60.0 Hz). Use NORM_X followed by SCALE_X only when you want a normalized 0.0 to 1.0 intermediate — typically for re-using the same percent-of-span value across multiple drive types. For a single drive, SCALE_X in one step is cleaner.

What Yaskawa parameter controls the loss-of-4-20 mA behavior?

On V1000/A1000/GA500, set L4-05 = 1 to enable frequency reference loss detection and L4-06 to choose the action (0 = ramp to stop, 1 = continue at L4-07 frequency, 2 = coast to stop). Without L4-05 enabled, a wire break will result in 0 mA and the drive will hold 0 Hz indefinitely — silent failure.

Can I monitor the actual mA back into the PLC to confirm the drive is receiving the reference?

Yes. Use a second SM 1234 AI channel (or an SM 1231) to measure across a 250 Ω precision resistor placed in the loop. With 4-20 mA flowing, the resistor drops 1-5 V; the AI channel will report 0-27648 corresponding to 4-20 mA. Alternatively, read drive parameter U1-13 (analog input %) via MEMOBUS/Modbus from the PLC to cross-check.

Back to blog