FM 354 Servo Positioning Module Reading Actual Position

David Krause12 min read
Motion ControlSiemensTroubleshooting
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 SIMATIC FM 354 is a function module for the S7-300 / ET 200M distributed I/O family that closes the position loop between an incremental encoder and a servo drive (analog ±10 V setpoint or stepper pulse interface). The module supports incremental, jog, and reference-point operating modes and exchanges process data with the CPU through the cyclic I/O image (PIW / PQW) and an acyclic parameter channel that is mapped onto an FM-specific user data block (UDB / FM-DB).

One of the most common field issues reported with the FM 354 is that the encoder counter increments correctly when the shaft is rotated and is visible in a STEP 7 VAT at the configured PIW address, yet no corresponding actual position value ever appears in the FM data block opened in the user program. This is not a wiring or PROFIBUS fault; it is the expected behaviour of the FM 354 cyclic/process image, which exposes only a subset of module data and requires the Request application data mechanism (CODE_AP) to read diagnostic values such as actual position, following error, and axis state.

Key field observation: the FM 354 cannot deliver the absolute actual position cyclically into the UDB. The value must be requested through the acyclic CODE_AP interface (DBB246 + trigger DBX43.6) and is then written into DBD382 as a one-shot result. After each read the trigger must be re-armed.

System Architecture and Hardware Topology

The reference configuration described in the source thread consists of:

  • SIMATIC S7-400 CPU 412-4H acting as the PROFIBUS DP master (redundant H-system not required for FM 354, but the FM 354 plugs onto the IM 153-2 redundant interface module as standard S7-300 I/O).
  • ET 200M station with IM 153-2 (6ES7153-2BA02-0XB0 or higher firmware).
  • FM 354 (6ES7354-1AH01-0AE0, the canonical S7-300 servo positioning module) seated in the ET 200M rack.
  • Incremental encoder wired to the FM 354 front-panel X2 SSI/ENCODER connector (RS-422 differential, 5 V supply).
  • Servo drive (analog ±10 V) driven from FM 354 front-panel X1 setpoint output.
S7-400 CPU 412-4H (DP Master) IM 153-2 ET 200M FM 354 (6ES7354-1AH01) UDB / PIW / PQW PROFIBUS DP PROFIBUS DP Incremental Encoder / Servo Drive

The FM 354 occupies 8 input bytes and 8 output bytes in the PROFIBUS I/O area of the ET 200M. Within those 8 bytes the cyclic image carries mode, setpoint, and a small set of status bits. Anything beyond that, including the 32-bit actual position, must be moved across the parameter channel.

Problem Description

The user-observed symptom is best stated as a delta between two data sinks:

  • PIW (process input word) address in the VAT: the encoder count appears correctly and updates every OB1 cycle. This is the small slice of data the FM 354 publishes into the cyclic image.
  • DB (FM user data block) in the user program: the actual position field that the program expects to read (or to trend) never changes, or appears stuck at 0.

No SF/ BF LEDs on the FM 354 are lit. The CPU is in RUN. Hardware configuration downloaded without errors. Step 7 / TIA reports the FM 354 as configured correctly. The conclusion that the user reaches - that the FM 354 is "not sending values to the DB" - is a misunderstanding of where the actual position lives in the FM 354 data model.

Root Cause Analysis

The root cause is architectural rather than faulty. The FM 354 partitions its data exchange into three classes:

Channel Direction Where it lives Update
Cyclic I/O image Bidirectional PIW / PQW in VAT Every PROFIBUS cycle (~1-10 ms)
Parameter channel (CODE / CODE_AP) Bidirectional, acyclic FM-DB offsets DBB244..DBB253 On user request (triggered)
Data channel (parameter request/response) Bidirectional, acyclic FM-DB offsets DBB380..DBD389 (read area) and DBB246 + DBX43.6 (request/ack) Per request

The 32-bit actual position belongs to the third class. It is not pushed cyclically. To read it, the user program must:

  1. Write the application-data code 1 into FM-DB.DBB246.
  2. Set the trigger bit FM-DB.DBX43.6 from 0 to 1 (rising edge interpreted as request).
  3. Wait for the FM 354 firmware to acknowledge (typical 5-20 ms).
  4. Read the 32-bit actual position from FM-DB.DBD382.
  5. Clear the trigger and request again when a fresh value is required.
The exact byte/bit offsets and the meaning of CODE 1 are documented in section 6 ("Request application data") of the FM 354 Equipment Manual and in section 7 of the FM 354 Application Manual covering "Starting up the FM 354 / Drive actuation". Refer to SIMATIC FM 354 Manual (06/2002 edition) and SIMATIC FM 354 Equipment Manual (09/2011) for the complete data block layout and CODE list.

Prerequisites

Before attempting the actual-position read, verify the following.

  • STEP 7 V5.5 or TIA Portal V13 SP1+ with the FM 354 HSP / support pack installed (order number 6ES7354-1AH01-0AE0 module). TIA Portal V16+ no longer supports FM 354 - keep STEP 7 V5.5 for this module.
  • FM 354 firmware compatible with hardware version 2 (or 1). The PIW data is only updated when the encoder is configured as an incremental encoder with the correct count direction in the parameterization screen of HW Config.
  • FM-DB (UDB) generated and downloaded. The DB is created automatically by STEP 7 from the FM 354 properties; it must be in the S7 program and have its symbolic name known.
  • Hardware configuration online: the FM 354 parameterization screen must be online with the module. If the configuration screen stays grey, the FM 354 is not communicating on PROFIBUS or the IM 153-2 GSD mismatch prevents parameter upload.
  • CPU in RUN and no OB82 / OB86 / OB122 diagnostics pending.

Step-by-Step Solution: Reading Actual Position

Step 1 - Locate the FM Data Block

Open the S7 program in STEP 7 and find the data block associated with the FM 354. In the default naming scheme it appears as DBxxx with a comment such as "FM354 UDB" or as the user-allocated name entered in the FM 354 properties dialog of HW Config. The two offsets that matter for CODE_AP are:

Offset Type Meaning
DBB246 BYTE CODE_AP request code. 1 = read actual position.
DBX43.6 BOOL Request trigger (write 1 to start the read).
DBD382 DWORD (REAL-equivalent) Result: actual position value returned by the FM 354.

Step 2 - Write the Request Code

Before every read, write the value 1 to FM-DB.DBB246. This tells the FM 354 firmware that the next request is a "read actual position" operation.

Step 3 - Pulse the Trigger Bit

Set FM-DB.DBX43.6 from FALSE to TRUE. The FM 354 interprets this rising edge as the request. After the FM 354 has acknowledged and copied the value into DBD382, the bit should be cleared (FALSE) so the next request is recognised as a new rising edge.

Step 4 - Read the Result

After a delay of approximately one PROFIBUS cycle + 5 ms, the actual position is available in FM-DB.DBD382. It is encoded as a 32-bit signed value in the FM 354 internal units (typically 1 LSB = 1 µm for linear axes; for rotary axes the units are configured in the parameterization).

Step 5 - Repeat

The actual position is not updated cyclically. To obtain a refreshed value the trigger pulse must be repeated. In a typical STEP 7 application this is done in OB35 (cyclic interrupt, e.g. 100 ms) or via a user-driven poll.

STEP 7 STL Code Example

The following STL fragment shows a minimal trigger routine for OB35. It assumes FM_DB is the symbolic name of the FM 354 user data block.

// OB35 - cyclic interrupt, e.g. 100 ms
// Read actual position from FM 354
//
      L     1
      T     "FM_DB".DBB246        // CODE_AP = read actual position

      U     "FM_DB".DBX43.6
      R     "FM_DB".DBX43.6        // ensure falling edge first

      S     "FM_DB".DBX43.6        // pulse trigger

      // ---- wait one PROFIBUS cycle ----
      CALL  "WAIT_MS"              // user FB, 20 ms delay
      IN:   :=20
      RET_VAL: MW200

      L     "FM_DB".DBD382         // load actual position
      T     MD 300                 // copy to flag double-word

      R     "FM_DB".DBX43.6        // clear trigger

An equivalent ladder logic representation is:

Network 1 - Write CODE
  [ MOVE ]
  EN   ENO
  IN0: 1
  OUT : "FM_DB".DBB246

Network 2 - Pulse trigger
  [ P ]  --(
  IN : "FM_DB".DBX43.6       // self-latching pulse
  OUT: "FM_DB".DBX43.6

Network 3 - Wait and read
  TON  IN: M100.0             // 20 ms one-shot
       PT: T#20MS
       Q : M100.1
       ET: MW210
  [ MOVE ]
  EN  : M100.1
  IN0 : "FM_DB".DBD382
  OUT : MD300

Network 4 - Clear trigger
  [ ] --( R )-- "FM_DB".DBX43.6

Incremental vs Jog Mode Considerations

The source thread explicitly confirms incremental encoder mode. The actual-position value retrieved by CODE_AP behaves identically across the supported operating modes (Jog, Incremental, Reference Point, Automatic/Block), but the meaning of the value differs:

Mode DBD382 content Reference frame
Incremental Position relative to last power-on or last reference-point approach Software counter, 32-bit signed
Jog Position relative to current reference point Same counter as incremental
Reference Point Position during the reference-point approach sequence Counted toward the configured reference coordinate
Automatic / Block Position of the axis relative to the reference point of the loaded block Programmed block reference
If DBD382 reads zero but the encoder counter increments in the PIW image, the FM 354 has not been referenced. Run a reference-point approach sequence (MODE = "Reference point", JOG+, JOG-) or issue the FM 354 internal command Set reference point from the parameterization screen before relying on absolute coordinates.

Online Parameterization Troubleshooting

The source thread also reports that the parameterization window does not come online. This is a separate fault that often coexists with the actual-position read issue. Work through the following checks in order.

  1. PROFIBUS connection: verify the IM 153-2 GSD file matches the one installed in STEP 7. Mismatch causes the FM 354 to be present in HW Config but unreachable at runtime.
  2. DP slave diagnostics: right-click the IM 153-2 in HW Config, "Operating mode", and check that the FM 354 appears with status "OK" and not "Not reachable".
  3. FM 354 diagnostics buffer: in the parameterization screen click "Module Information". The diagnostic buffer lists SF causes with hex codes; record them for cross-reference with the manual.
  4. Wiring of the X2 encoder connector: confirm 24 V is present on pins 1-2 (encoder supply), A on pin 3, /A on pin 4, B on pin 5, /B on pin 6, N on 7, /N on 8. Any wiring error sets the SF LED and the parameterization screen stays offline.
  5. Drive enable: the FM 354 holds the parameterization screen offline until the drive interface is correctly parameterised and the controller enable terminal (X1 pin 1 = +24 V, pin 2 = 0 V) is supplied. Without controller enable the module reports 43h ("Drive not ready") and refuses to go online.

LED Status and Diagnostics Matrix

SF BF 5 V Meaning Action
Off Off Green Normal operation, DP and module OK None
On Off Green Module-internal fault (parameter error, encoder fault) Read DIAG buffer, check encoder wiring
Off Flashing Green PROFIBUS not established Check DP address, IM 153-2, cable
On On Off No 24 V backplane supply Replace or power the IM 153-2
Flashing Off Green Configuration mismatch Re-download HW Config

Common Fault Codes and Remedies

Hex code Meaning Typical cause Remedy
11h Encoder fault Broken wire, wrong signal level Verify RS-422 levels on X2
22h Following error exceeded Mechanical stall, wrong Kv gain Tune Kv; check motor connection
33h Position limit overrun Software limit not parameterised Enter SW-limit +/- in parameterization
43h Drive not ready Controller enable missing Apply 24 V on X1 pin 1
55h Traversing range exceeded Mechanical endstop reached Reverse direction, re-reference
77h Communication error with FM-DB UDB missing or wrong number Recreate the UDB, download HW Config

Verification Procedure

To confirm that the actual-position read is operational, perform the following five checks.

  1. Visual: rotate the shaft by hand; the PIW encoder counter increments and DBD382 shows a moving value.
  2. Reference: approach a reference point; DBD382 should reset to the configured reference coordinate.
  3. Polarity: rotate the shaft in the positive direction; DBD382 increases monotonically. Reverse rotation decreases monotonically.
  4. Latency: with OB35 at 100 ms, the value updates every 100 ms. Trigger pulse width of 20 ms is sufficient on a clean PROFIBUS; on a heavily loaded bus increase to 50 ms.
  5. Edge trigger: verify in the VAT that DBX43.6 is a clean 0→1→0 square wave. If the bit is held high, the FM 354 ignores subsequent requests and the value freezes.
A common mistake is to set DBX43.6 as a normal output rather than as a pulse. The FM 354 only acts on a 0→1 transition; a latched 1 produces no further reads and the actual position appears "stuck". Always toggle the bit explicitly.

Notes on Parameter Channel Throughput

Because the parameter channel is acyclic and runs over PROFIBUS DP-V0, the actual-position read is not suitable for very fast closed-loop control on the CPU side. The FM 354 itself closes the position loop internally at the configured sampling rate. If the application needs the actual position at high rate, the FM 354 should remain the position controller and the CPU should only supervise. The CODE_AP mechanism is intended for visualisation, diagnostics, and slow supervisory control, not for replacing the on-module PID.

Migration and Replacement Notes

The FM 354 was phased out of active sales in 2014 and is no longer supported by TIA Portal beyond V13 SP1. The recommended migration path for new projects is the SIMATIC S7-1500 / ET 200MP platform with the TM PosInput 2 or the T-CPU technology objects. For S7-300 installations, the FM 354 remains fully functional and is documented in:

Frequently Asked Questions

Why does the FM 354 show encoder values in the PIW but never updates the actual position in the DB?

The 32-bit actual position is not part of the cyclic process image. It is exposed through the acyclic parameter channel. Write CODE 1 to FM-DB.DBB246, pulse FM-DB.DBX43.6, and read the result from FM-DB.DBD382. The value is delivered as a one-shot and must be re-requested.

How often can I read the actual position from the FM 354?

As often as the OB cycle allows, subject to the PROFIBUS DP-V0 acyclic turnaround. A 20 ms trigger pulse in OB35 at 100 ms is a typical proven configuration. Faster rates are possible but increase bus load.

DBD382 reads zero even after the trigger - is the FM 354 faulty?

No. DBD382 returns zero until the axis has been referenced. Run the reference-point approach sequence or use the FM 354 "Set reference point" parameterization function before reading absolute coordinates.

Does this mechanism work the same in jog, incremental, and automatic modes?

Yes - the CODE_AP request mechanism is identical. The interpretation of the returned value differs by mode: incremental returns a relative counter, automatic returns the position of the active traversing block.

What is the difference between CODE and CODE_AP on the FM 354?

CODE writes parameter data to the FM 354 (e.g. set-point, override). CODE_AP reads application data from the FM 354 (e.g. actual position, following error, axis state). CODE 1 on the read side maps to the "actual position" application datum described in section 6 of the FM 354 manual.

Back to blog