SINAMICS G120 CU250S-2 PN Encoder Setup in TIA Portal V14
1. Application Context and Architecture
The SINAMICS G120 is a modular low-voltage drive family. The CU250S-2 PN Control Unit adds a PROFINET interface (2-port switch, ERTEC ASIC), encoder evaluation for two physical channels, and the integrated Basic Positioner (EPOS) for entry-level positioning. The combination of a SIMATIC S7-1200 (in this case the AC/DC/RLY variant) and a SINAMICS G120 with CU250S-2 PN is one of the most common positioning architectures in laboratory, packaging, conveyor, and small-format assembly applications.
For a project with a SIMATIC S7-1200 AC/DC/RLY controlling a SINAMICS G120 CU250S-2 PN over PROFINET and an external encoder wired to the drive, two engineering paths exist. The choice depends on where the closed-loop position controller should run:
-
Path A (drive-based position control): The CU250S-2 runs the closed-loop position controller through the integrated Basic Positioner (EPOS). The PLC is the higher-level motion coordinator, sending target positions, velocities, override values, and jog commands through the
SINA_POSblock (from the Siemens DriveLib library). The encoder feedback is read by the drive and exposed to the PLC as process data. This is the cleaner path for an entry-level positioning axis. - Path B (PLC-based position control): The S7-1200 hosts a technology object (TO_PositioningAxis or TO_SynchronousAxis) that closes the position loop in the PLC. The drive operates as a speed-controlled actuator (telegram 1 or 3), and the technology object drives the speed setpoint. Useful when the position loop must interact directly with PLC logic, registration marks, or with other axes.
Both paths are covered below. The decision should be made before commissioning because the parameter set, the telegram selection, and the block library differ.
2. CU250S-2 Encoder Interface Topology
The CU250S-2 provides two physical encoder interfaces:
| Interface | Connector | Supported protocols | Typical use |
|---|---|---|---|
| X9 | 15-pin Sub-D | HTL, TTL, SSI | Motor-mounted incremental encoder (speed/position); SSI absolute encoder |
| X10 | Push-in terminal | HTL, TTL | External machine-mounted encoder (position feedback) |
If only one encoder is connected, X9 is used. If two encoders are connected, one is used for motor speed control and the other for position feedback. The combination rules — including which encoder can be assigned to which control function — are described in the Siemens application document "Which encoder combinations can be used on the SINAMICS G120 Control Unit CU250S-2" (entry ID 109813048).
Encoder combinations for SINAMICS G120 CU250S-2 (PDF, Siemens support, 109813048)
3. Compatible Encoder Types
The CU250S-2 firmware evaluates the following encoder protocols. The maximum input frequency applies to the firmware evaluation, not the encoder's own output frequency.
| Protocol | Signal level | Max. input frequency | Interface | Configuration parameter |
|---|---|---|---|---|
| HTL incremental | 24 V push-pull or open-collector | 500 kHz | X9, X10 | p0400 = 1 |
| TTL incremental | 5 V differential (RS-422) | 1 MHz | X9 | p0400 = 2 |
| SSI absolute | 24 V, clock + data on RS-422 | 500 kHz | X9 | p0400 = 12 |
Resolvers are not supported on the CU250S-2. For resolvers, use a different Control Unit family (e.g., a CU240E-2 with the appropriate option module) or a different SINAMICS drive.
For a motor-mounted incremental encoder in the 1024 to 2500 ppr range, the TTL interface on X9 is the most common choice. For SSI absolute encoders (often used in safety applications or to avoid re-homing on power-up), X9 is the only option.
4. Hardware Wiring
4.1 X9 Sub-D Pinout (TTL Incremental, the most common case)
| Pin | Signal | Description |
|---|---|---|
| 1 | A+ | Track A, positive |
| 2 | A− | Track A, negative |
| 3 | B+ | Track B, positive |
| 4 | B− | Track B, negative |
| 5 | R+ | Reference pulse (zero mark), positive |
| 6 | R− | Reference pulse (zero mark), negative |
| 7…12 | reserved | Not connected |
| 13 | +24 V | Encoder power supply |
| 14 | 0 V | Encoder power supply return |
| 15 | shield | Cable shield, bonded to the connector backshell |
For TTL encoders, the 5 V supply is normally generated inside the encoder from a 24 V input. The encoder's 5 V output is fed back into the drive on pins 1…6. Always verify the actual pinout against the encoder's datasheet; encoder manufacturers do not always follow a single convention.
4.2 X9 Sub-D Pinout (SSI Absolute)
For SSI encoders, the clock signals are output on pins 1/2 (CL+ / CL−) and the data is returned on pins 3/4 (DA+ / DA−). The pin numbering matches TTL, but the protocol is set in p0400 = 12 and the protocol details (clock rate, monoflop time, coding) in p0421.
4.3 X10 Terminal Pinout (HTL / TTL)
| Terminal | Signal |
|---|---|
| 1 | +24 V supply |
| 2 | 0 V supply |
| 3 | A+ |
| 4 | A− |
| 5 | B+ |
| 6 | B− |
X10 is the second encoder channel and is used for an external encoder (machine feedback). It does not evaluate SSI and does not evaluate a zero mark on the terminal block side.
For full pin assignments, refer to the G120 with CU250S-2 Control Units operating instructions (PDF, Siemens support, 99730303).
5. TIA Portal V14 Project Setup
5.1 Prerequisites
| Item | Required version / specification |
|---|---|
| TIA Portal | V14 SP1 (V14.0.0.x) or higher |
| STEP 7 | V14 (bundled with TIA Portal) |
| SINAMICS Startdrive | V14 SP1 option package (or higher) |
| DriveLib (Siemens library) | V14 (matches the TIA Portal version) |
| GSDML file for CU250S-2 PN | Latest revision from Siemens support (for fallback when Startdrive is not installed) |
| S7-1200 CPU firmware | V4.2 or higher recommended |
| CU250S-2 PN firmware | V4.4 through V4.7 SPx (version-specific to the hardware release) |
The S7-1200 AC/DC/RLY designation in the question refers to the CPU power supply (AC mains input), the internal logic (DC derived from the AC), and the digital output type (RLY = relay). It does not affect the PROFINET interface or the DriveLib functionality. The exact order number of the CPU (for example, 6ES7214-1xxx40-0xB0) should be confirmed in the TIA Portal hardware catalog under "SIMATIC S7-1200 → CPU."
5.2 Project Creation and CPU Addition
- Open TIA Portal V14 and create a new project.
- Add the S7-1200 CPU: in the project tree, "Add new device" → "SIMATIC S7-1200 CPU" → select the actual order number from the catalog.
- Switch to the device view of the CPU. Set the PROFINET interface (X1) IP address (for example, 192.168.0.10) and the PROFINET device name (for example,
plc-1200). The device name must be unique on the PROFINET subnet. - Connect the CPU to a PROFINET subnet in the network view.
5.3 Adding the SINAMICS G120
Two methods are available:
-
Through the TIA Portal hardware catalog (preferred): With Startdrive V14 installed, drag the SINAMICS G120 CU250S-2 PN into the network view. Set the IP address (for example, 192.168.0.20) and the PROFINET device name (for example,
g120-cu250s). The PROFINET name is what the S7-1200 uses to address the drive. - Through GSD import (fallback): Download the GSDML file for the CU250S-2 PN from the Siemens support pages. Install the GSD in TIA Portal under "Options → Manage general station description files (GSD)." The drive then appears in the catalog under "Other field devices → PROFINET IO → Drives → Siemens AG."
With the Startdrive option package, the G120 is configured directly inside the TIA Portal project. This is the recommended path because the parameter assignment, the drive commissioning, and the PLC programming are managed in the same tool, and the DriveLib blocks (SINA_POS, SINA_SPEED) are available as native project elements.
5.4 PROFINET Telegram Configuration
The standard positioning telegram on the CU250S-2 PN is telegram 111. The basic speed-control telegrams are telegram 1 and telegram 3.
| Telegram | Direction | Typical use |
|---|---|---|
| 1 | Speed setpoint (16-bit) | Simple speed-controlled drive (Path B) |
| 3 | Speed setpoint (32-bit) + 2 encoder words | Extended speed control with encoder feedback (Path B) |
| 111 | Positioning (EPOS) — target position, velocity override, control/status words, actual position, actual velocity | Path A — EPOS-based positioning |
| 999 | Free configuration | Custom mapping of process data |
In the device view of the G120, navigate to "Properties → PROFINET interface → Telegram configuration." Assign telegram 111 for the positioning path. If the encoder feedback is to be exchanged in a structured form (for example, raw pulse count alongside the position), telegram 999 (free configuration) can be used to map specific process data. For most applications, telegram 111 is sufficient.
6. DriveLib Installation
DriveLib is the Siemens library that exposes drive-specific function blocks for STEP 7 in TIA Portal. The library contains:
| Block | Purpose |
|---|---|
| SINA_POS | Positioning via the drive's integrated EPOS |
| SINA_SPEED | Speed control via telegram 1 or 3 |
| SINA_INFEED | Infeed unit control (for Active Line Modules) |
| SINA_G120 | Parameter read/write access to the drive |
To install DriveLib V14:
- Open TIA Portal V14.
- Open the project.
- Select "Options → Global libraries."
- In the global library pane, click "Open global library" and navigate to the DriveLib archive (downloaded from Siemens support, entry ID 109475016 or the most recent DriveLib V14).
- Drag the master copies of the required blocks (for example, SINA_POS, SINA_SPEED) into the project's program blocks. The FB types and the corresponding instance DBs are created.
7. SINAMICS Parameter Assignment for Encoder and EPOS
After the project is loaded into the CU250S-2 (through Startdrive online or through the drive's web server), the encoder and EPOS parameters must be set. The minimum parameter set for Path A (EPOS) is shown below.
| Parameter | Description | Typical value |
|---|---|---|
| p0010 | Drive commissioning parameter filter | 0 = ready (1 = quick commissioning, 30 = factory setting) |
| p0015 | Macro drive configuration | 7 = EPOS with PROFINET telegram 111 (verify against the macro selection in the firmware) |
| p0100 | Motor standard | 0 = IEC (kW, 50 Hz, SI); 1 = NEMA (hp) |
| p0201 | Power module code number | Read automatically from the Power Module |
| p0300…p0335 | Motor data | Match the motor nameplate |
| p0400 | Encoder 1 type | 1 = HTL incremental; 2 = TTL incremental; 12 = SSI absolute |
| p0404 | Encoder 1 configuration | 0 = channel A/B; verify zero-pulse handling |
| p0408 | Encoder 1 pulses per revolution | Set to the encoder's ppr value (1024, 2048, 2500, etc.) |
| p0410 | Encoder direction reversal | 0 = normal, 1 = reversed (swap if the actual position decrements when the motor rotates in the positive direction) |
| p0431 | Encoder 1 zero mark position | Set if a referenced position is required |
| p2502 | EPOS enable | 1 = enable EPOS |
| p2503 | EPOS position reference point coordinate | Sets the absolute reference after referencing |
| p2504 | EPOS operating mode | 0 = jog; 1 = MDI; 2 = traversing block |
| p2506 | EPOS encoder assignment | 1 = encoder 1; 2 = encoder 2 |
| p2572 | EPOS maximum acceleration | Project-specific (in LU/s²) |
| p2573 | EPOS maximum deceleration | Project-specific |
| p2580 | EPOS software limit switch, negative | Lower mechanical limit in LU |
| p2581 | EPOS software limit switch, positive | Upper mechanical limit in LU |
| p2593 | EPOS active homing configuration | Set the homing mode, direction, and zero-pulse handling |
| p2596 | EPOS set reference point | 1 = set the current actual position to p2503 (used for setting a reference from the PLC) |
The parameter list is intentionally minimal. For complete drive commissioning (motor identification, current controller optimization, speed controller optimization, encoder test, referencing mode), the G120 with CU250S-2 Control Units operating instructions (PDF, Siemens support, 99730303) is the authoritative reference.
The encoder combination rules — that is, which encoder is used for speed control and which is used for position feedback when two encoders are connected — are documented in the Encoder combinations for SINAMICS G120 CU250S-2 (PDF, Siemens support, 109813048). The assignment is made through p2506 (EPOS encoder) and the speed/position controller encoder selectors in the firmware.
8. Option A — EPOS in the Drive, SINA_POS in the PLC
8.1 Concept
In Path A, the closed-loop position controller is implemented inside the CU250S-2. The PLC issues high-level commands: "move to position X at velocity V using acceleration A," "jog in the positive direction," "stop," "set reference point." The drive handles the ramp generator, the position controller, the encoder evaluation, and the safety limits. The PLC receives the actual position and the status word as process feedback. This is the simpler of the two paths for an entry-level application and gives the cleanest separation between motion control (in the drive) and machine logic (in the PLC).
8.2 SINA_POS Interface (DriveLib V14, representative call)
// FB SINA_POS — DriveLib V14
// Inputs
iEnableAxis : BOOL; // TRUE enables the drive and the positioner
iCancel : BOOL; // TRUE aborts the active motion
iIntermStop : BOOL; // TRUE ramps to zero (intermediate stop)
iDirPos : BOOL; // TRUE jog / MDI positive
iDirNeg : BOOL; // TRUE jog / MDI negative
iAck : BOOL; // Rising edge clears drive faults
iExecMode : BOOL; // TRUE executes the MDI setpoint
iMode : INT; // 0 = jog, 1 = MDI relative, 2 = MDI absolute
rTargetPos : REAL; // Target position in length units (LU)
rTargetVel : REAL; // Velocity in LU/min
rAccel : REAL; // Acceleration in LU/s^2
rDecel : REAL; // Deceleration in LU/s^2
iAxisNo : INT; // Drive axis number (1 by convention)
iHWIDSTW : HW_IO; // Hardware identifier of the control word (STW)
iHWIDZSW : HW_IO; // Hardware identifier of the status word (ZSW)
// Outputs
rActualPos : REAL; // Actual position in LU
rActualVel : REAL; // Actual velocity
wAxisStatus : WORD; // Drive status word
bError : BOOL; // TRUE on error
wErrorID : WORD; // Error number
The hardware identifiers (HWIDSTW, HWIDZSW) are obtained automatically when the SINA_POS block is dropped onto the S7-1200 program and the "Call options" dialog is used to connect it to the PROFINET telegram of the G120 in the project tree. The HMI connection is configured in the same step.
8.3 STW1 (Control Word 1) Bit Pattern
EPOS is controlled by the STW1 bits. The SINA_POS block sets these bits automatically; understanding them is necessary for diagnosis.
| Bit | Name | Function |
|---|---|---|
| 0 | ON/OFF1 | Rising edge: precharge and ready; falling edge: ramp stop, then pulse inhibit |
| 1 | OFF2 | 0 = coast to stop (pulse inhibit immediate); 1 = no coast stop |
| 2 | OFF3 | 0 = quick stop (ramp to zero at p2573); 1 = no quick stop |
| 3 | Enable inverter | 1 = enable pulses; 0 = inhibit pulses |
| 4 | Enable ramp | 1 = enable ramp generator; 0 = freeze ramp generator |
| 5 | Enable setpoint | 1 = apply setpoints; 0 = inhibit setpoints |
| 6 | Acknowledge fault | Rising edge: acknowledge pending faults |
| 7 | (reserved) | n.c. |
| 8 | Jog 1 | 1 = jog with velocity setpoint 1 |
| 9 | Jog 2 | 1 = jog with velocity setpoint 2 |
| 10 | Control by PLC | 1 = control and setpoints from PLC (required for PROFINET) |
| 11 | Set reference point | Rising edge: set the actual position to p2503 (used for referencing) |
| 12, 13 | (reserved) | n.c. |
| 14 | Traversing block bit 0 | Traversing block selection (only when p2504 = 2) |
| 15 | Traversing block bit 1 | Traversing block selection |
8.4 ZSW1 (Status Word 1) Bit Pattern
| Bit | Name | Meaning |
|---|---|---|
| 0 | Ready to switch on | 1 = power supply OK, electronics initialized |
| 1 | Ready to operate | 1 = no fault, DC bus charged, no OFF2/OFF3 active |
| 2 | Operation enabled | 1 = pulses enabled, drive follows setpoints |
| 3 | Fault present | 1 = at least one fault active |
| 4 | Coasting stop active | 1 = OFF2 active |
| 5 | Quick stop active | 1 = OFF3 active |
| 6 | Switch-on inhibited | 1 = drive cannot be switched on (e.g., DC bus not charged) |
| 7 | Alarm present | 1 = at least one alarm active |
| 8 | Following error in tolerance | 1 = |setpoint − actual| < p2544 |
| 9 | Control requested | 1 = PLC has control authority |
| 10 | Reference point reached | 1 = drive has been homed |
| 11 | Setpoint reached | 1 = drive is in position and within tolerance |
| 12, 13 | (reserved) | n.c. |
| 14 | Traversing block bit 0 | Traversing block status |
| 15 | Traversing block bit 1 | Traversing block status |
8.5 Reading Encoder Data Without Using EPOS
If the application does not need closed-loop positioning — for example, if the encoder is used only for speed feedback and the position is calculated in the PLC — the actual position in EPOS units (LU) is available on the output of SINA_POS, and the actual velocity in the same block.
For raw encoder counts (pulses per revolution × gearbox ratio), the SINAMICS parameter r0481 (encoder 1 actual position, in pulses) can be read through the standard acyclic parameter read/write mechanism (PROFIdrive parameter channel, record data sets 0xB02E for read, 0xB02F for write). The PLC uses the RDREC and WRREC instructions.
A typical acyclic read of r0481 is performed with:
- Request header: function = 1 (read by parameter number), parameter number = 481, index = 0.
- Response: 4 bytes of encoder position data in big-endian order.
The full acyclic parameter channel format is in the PROFIdrive profile and the G120 operating instructions. For periodic encoder data, the cyclic process data (telegram 111 or telegram 3 with an encoder word) is more efficient than the acyclic channel.
8.6 Commissioning Sequence (Path A — EPOS)
- Wire the encoder to X9 (or X10) following the pinout. Verify the shield is bonded at the connector backshell.
- Power up the drive. Confirm the Control Unit is online and PROFINET is connected (LEDs on the CU: "RDY" green, "BF" off, "LINK" on the PROFINET ports).
- Run the basic commissioning in Startdrive: set the motor data (p0300…p0335), perform motor identification (p1910), and perform speed controller optimization (p1960).
- Configure the encoder in p0400 (type), p0404 (configuration), p0408 (pulses per revolution). Verify the encoder is detected correctly using r0458 (encoder diagnostics word).
- Configure the EPOS function: p2502 = 1, p2506 = 1 (or 2 if encoder 2 is used for position), p2503, p2504, p2580, p2581, p2572, p2573.
- Configure the PROFINET telegram (111) on the drive in the device view.
- Load the DriveLib blocks (SINA_POS) into the PLC program and call them with valid parameters. Connect the HWIDSTW and HWIDZSW inputs to the hardware identifiers of the drive's PROFINET telegram in the TIA Portal project.
- Compile and download the PLC project.
- Run the drive in jog mode first (mode = 0) to verify the encoder direction. The actual position should increment when the motor rotates in the positive direction. If it decrements, swap p0410 to 1 (direction reversal) or swap the A/B phases on the encoder cable.
- Set the reference point: trigger "Set reference point" from the PLC (STW1 bit 11), or run active referencing through p2593 (start a homing sequence).
- Run an MDI motion (mode = 2, absolute) and verify the actual position converges to the target position with zero steady-state error. Monitor the following error on the HMI or in the watch table.
9. Option B — Technology Objects in the S7-1200
9.1 Concept
In Path B, the S7-1200 hosts a positioning axis technology object. The technology object closes the position loop in the PLC. The drive operates in speed-controlled mode (telegram 1 or 3), and the drive's speed setpoint is set by the technology object. This approach is useful when the position loop must interact with other PLC logic (registration marks, master encoder, camming, multi-axis coordination) and the engineering team prefers to keep all motion in the PLC.
9.2 Technology Object Configuration
In the S7-1200 program, add a new technology object:
- "Technology objects → Add new object → Motion Control → TO_PositioningAxis."
- Name:
Axis_G120. - Assign the PROFINET telegram of the drive (telegram 1 or telegram 3).
- Configure the mechanics: load distance per motor revolution, gearbox ratio.
- Configure the encoder source: choose "Encoder on PROFINET IO." The drive's encoder is the source, and the position is read from the drive's status word.
- Configure the limits: maximum velocity, maximum acceleration, maximum jerk.
- Configure the homing procedure: active homing with reference cam and zero pulse, or passive homing through a digital input.
The technology object is connected to the drive through the "Axis" interface in the technology object view. The drive's speed setpoint and enable signals are wired automatically. The MC_Power, MC_MoveAbsolute, MC_MoveRelative, MC_MoveVelocity, MC_Home, and MC_Stop instructions are available as standard PLCopen motion control blocks.
9.3 Encoder Source in Technology Object
| Source | Description |
|---|---|
| Encoder on PROFINET IO | Encoder is connected to a PROFINET device (for example, the drive's encoder input) |
| Encoder on a high-speed counter | Encoder is connected to the PLC's onboard HSC |
| Encoder on a TM (Technology Module) | Encoder is connected to a TM PTO/HSC module (signal board, signal module) |
For the SINAMICS G120 case, the drive's encoder is the encoder source. The technology object reads the actual position from the drive's process data and computes the speed setpoint, which is sent back to the drive through the same telegram.
9.4 MC_Power and Axis Enable
The MC_Power instruction enables the axis. The Enable input must be TRUE and the drive must be ready (the technology object polls the drive's ZSW1 bit 2 "Operation enabled"). The StopMode input selects the response to a stop request (0 = immediate, 1 = emergency stop with ramp, 2 = emergency stop with jerk-limited ramp).
A typical configuration is:
// MC_Power — enable the axis
MC_Power_inst(
Axis := Axis_G120,
Enable := bEnableAxis,
StopMode := 1, // 1 = emergency stop with ramp
Status => bAxisEnabled,
Busy => bAxisBusy,
Error => bAxisError,
ErrorID => wAxisErrorID
);
10. Homing Procedures
Homing is the procedure that establishes a known position reference for the axis. The SINAMICS G120 EPOS supports several homing modes:
| Mode | Description |
|---|---|
| Active homing with reference cam and zero pulse | The drive moves the axis in the configured direction at the homing velocity (p2604) until the reference cam is reached, then searches for the next encoder zero pulse to set the reference point. |
| Active homing without reference cam | The drive moves the axis in the configured direction and uses the first encoder zero pulse to set the reference point. |
| Passive homing | The drive sets the reference point at the next encoder zero pulse after a digital input is asserted by the PLC (used when the homing switch is connected to the PLC, not the drive). |
| Set reference point | The drive sets the current actual position to the value in p2503 (the "reference point coordinate"). This is the simplest mode and is often used for teaching a position. |
After power-up, the reference point is retained only for absolute encoders (SSI multi-turn, or a multi-turn encoder on the motor). For incremental encoders, the homing sequence must be re-executed on every power-up. The PLC must wait for the "reference point reached" status bit (ZSW1 bit 10) before issuing MDI moves.
11. Process Data and Telegram Mapping (Telegram 111)
In the CU250S-2 with telegram 111, the process data words are mapped as follows. The exact mapping is firmware-dependent and should be verified against the drive's telegram documentation in the operating instructions.
| Word offset | Direction | Content |
|---|---|---|
| 0 | PLC → drive | STW1 (control word 1) |
| 1 | PLC → drive | STW2 (control word 2) |
| 2 | PLC → drive | Position setpoint, high word |
| 3 | PLC → drive | Position setpoint, low word |
| 4 | PLC → drive | Velocity override |
| 5 | PLC → drive | Acceleration override |
| 6 | PLC → drive | Deceleration override |
| 0 | Drive → PLC | ZSW1 (status word 1) |
| 1 | Drive → PLC | ZSW2 (status word 2) |
| 2 | Drive → PLC | Actual position, high word |
| 3 | Drive → PLC | Actual position, low word |
| 4 | Drive → PLC | Actual velocity |
| 5 | Drive → PLC | Following error |
| 6 | Drive → PLC | Reserved |
The position setpoint and the actual position are 32-bit signed integers. The scaling is configured in the drive (p2900) and in the technology object (mechanics → load distance per motor revolution). When the two scalings are consistent, the position values are in the same length unit (LU).
12. Reading Encoder Data into PLC Tags
The simplest way to make encoder data visible in a TIA Portal V14 program is to map the drive's actual position to a PLC tag through the SINA_POS block. The block exposes the actual position as a REAL output, which can be assigned to a tag in the PLC's data block.
A minimal example (Path A, EPOS):
- Add a global DB called
DriveDatawith a REAL tagActualPosition, a REAL tagActualVelocity, and a BOOL tagAxisReady. - Call SINA_POS in OB1 with the inputs tied to your application logic.
- Wire the SINA_POS output
ActualPositiontoDriveData.ActualPosition,ActualVelocitytoDriveData.ActualVelocity, and the bit pattern ofAxisStatusWordto aAxisReadytag (bit 0 = "ready to switch on", bit 1 = "ready to operate", bit 2 = "operation enabled"). - Compile, download, and go online.
- In the watch table or on a HMI screen, observe the value of
DriveData.ActualPositionas the motor moves. The value increments and decrements in length units.
A more advanced pattern is to expose the actual position to a HMI (for example, a SIMATIC KTP1200) through a text field with the format %.0f LU, or to an OPC UA server for higher-level monitoring. With TIA Portal V14 and a SIMATIC HMI, the tag is automatically available on the HMI when the HMI connection is configured in the HMI device's "Connections" editor.
13. Verification and Diagnostics
13.1 Online Diagnostics in TIA Portal
| Diagnostic | Path in TIA Portal |
|---|---|
| PROFINET connection state | Project tree → Devices & networks → right-click the drive → "Online & diagnostics" |
| Telegram diagnosis | Drive device view → Properties → Telegram configuration → "Online" |
| Encoder status | Drive online → "Diagnostics → Encoder diagnostics" (r0458) |
| EPOS actual position | Drive online → "Diagnostics → Position control" (r2521 = MDI position, r2522 = actual position) |
| Drive state | Drive online → "Control panel" (run / stop / speed / position commands) |
| PLC program state | PLC online → "Monitoring" view of the OB / FB containing the SINA_POS call |
13.2 Verifying the Encoder is Connected
- In the TIA Portal project, open the drive's online view.
- Navigate to "Diagnostics → Encoder."
- Read r0458 (encoder actual value). The value should increment when the motor is rotated in the positive direction.
- If the value does not change, the encoder is not connected correctly. Check the wiring, verify p0400 matches the encoder type, and verify the encoder supply voltage on X9 pin 13 (+24 V) and pin 14 (0 V).
- If the value changes but in the wrong direction, swap p0410 to 1 (direction reversal) or swap the A and B phases on the cable.
- Use the control panel to command a small jog motion (in EPOS mode) and verify the actual position follows the setpoint without a following error.
14. Fault Code Reference
The most common encoder- and PROFINET-related faults on the SINAMICS G120 are listed below. The full list is in the G120 with CU250S-2 Control Units operating instructions (PDF, Siemens support, 99730303).
| Fault code (r0947) | Meaning | First-action |
|---|---|---|
| F31117 | Encoder 1 signal level A/B outside tolerance | Check wiring, check shielding, replace encoder |
| F31118 | Encoder 1 speed too high for the input frequency | Reduce speed, or check p0408 vs. the actual ppr |
| F31131 | Encoder 1 zero mark not detected | Verify zero mark wiring (R+/R−), check p0431 |
| F31136 | Encoder 1 internal error (CRC, parity) | Replace encoder, check cable |
| F31900 | Encoder 1 general failure | Inspect connector, replace encoder |
| F08501 | PROFINET communication error | Check PROFINET name, IP, cabling |
| F07412 | Speed controller output limited (encoder feedback issue) | Check encoder, check motor data |
| F07414 | Encoder signal amplitude too low | Adjust p0421 for SSI, or check cable for HTL/TTL |
| A08502 | PROFINET sign-of-life failure | Check PROFINET connection, reduce update time |
| F07490 | EPOS: position controller output limited | Reduce acceleration, check mechanical binding |
| F07491 | EPOS: following error too large | Increase p2544, check mechanical train |
Alarms (Axxxx) are warnings that do not stop the drive; faults (Fxxxx) stop the drive and require acknowledgment (rising edge on STW1 bit 6, or the SINA_POS AcknowledgeFaults input).
15. Troubleshooting Matrix
| Symptom | Likely cause | Action |
|---|---|---|
| Drive does not appear in TIA Portal | GSD not installed, or Startdrive option not installed | Install the GSDML for CU250S-2 PN, or install the Startdrive V14 option package |
| PROFINET connection does not establish | Wrong device name, wrong IP, cabling | Verify device name and IP on the drive, check the PROFINET cable, check the PLC is the IO controller |
| Encoder value does not change | Wrong encoder type (p0400), bad wiring, no power | Verify p0400, check the encoder supply voltage on X9/X10, check the cable |
| Encoder direction reversed | A/B phase swap, p0410 = 0 | Swap A and B at the connector, or set p0410 = 1 |
| EPOS reports "no reference set" | Homing not executed | Run active homing (p2593) or set p2596 = 1 to accept a reference point from the PLC |
| MDI motion does not start | Drive not enabled, STW1 bits not set | Check STW1 bit pattern (bit 0 = ON/OFF1, bit 1 = OFF2, bit 2 = OFF3, bit 3 = enable inverter, bit 4 = enable ramp, bit 5 = enable setpoint, bit 6 = acknowledge); confirm the SINA_POS instance is enabled |
| Following error exceeds limit | Mechanical binding, acceleration too high, encoder slip | Reduce acceleration in p2572/p2573, inspect the mechanical train, verify the encoder is rigidly coupled to the load |
| Position is incorrect after power cycle | No absolute encoder, or SSI reference lost | Use an SSI absolute encoder, or re-execute homing on power-up |
| DriveLib blocks are missing in the library | DriveLib not installed | Open "Options → Global libraries" and open the DriveLib archive; drag the required FBs to the project |
| SINA_POS reports AxisError = TRUE | Drive fault | Read AxisErrorID and the drive's r0947 (fault code), then follow the fault remedy in the operating instructions |
| Compile error: "Unknown type SINA_POS" | DriveLib not added to the project, or version mismatch | Open the DriveLib V14 archive in the global library, drag the SINA_POS FB to the project; ensure TIA Portal is V14 |
| Jog works but MDI does not move | Drive not referenced (ZSW1 bit 10 = 0) | Execute homing (p2593) or set the reference point (p2596) before MDI |
| Actual position jumps at start of motion | Encoder index not aligned, mechanical backlash | Verify p0408, inspect the coupling, run the encoder test in Startdrive |
16. Field-Proven Caveats
Firmware-dependent encoder support. The CU250S-2 firmware version controls which encoder types are supported and what parameters are available. For SSI encoders, firmware V4.5 or higher is recommended. For HTL encoders with cable lengths over 50 m, use a 24 V push-pull driver at the encoder and route the cable away from VFD power cables.
PROFINET update time. The default PROFINET update time is 1 ms. For positioning accuracy in the 0.1 mm range with a 1024 ppr encoder, 1 ms is acceptable. For higher accuracy, increase the update time on the IO controller to 0.5 ms. Note that not all PROFINET IO controllers support 0.5 ms; the S7-1200 supports it on the PROFINET interface of most CPU variants.
Reference point retention. The CU250S-2 retains the reference point across power cycles only for multi-turn absolute encoders. For incremental encoders, the homing sequence must be re-executed on every power-up. The PLC must wait for the "referenced" status bit (ZSW1 bit 10) before issuing MDI moves.
Following error handling. A persistent following error indicates a mechanical issue or a mis-tuned position controller. The drive's p2544 (following error tolerance) and p2546 (following error timeout) are the standard parameters. For a project with a learning curve, set p2544 to a large value (for example, 10000 LU) initially, and tighten it once the motion is working.
Earthing and shielding. Encoder cables must use twisted pairs with an overall shield, and the shield must be bonded to the cabinet ground at the drive end only. Floating shields are a common source of noise-induced encoder faults (F31117, F31136).
TIA Portal V14 compatibility. DriveLib V14 is the correct library for TIA Portal V14. DriveLib V13 SP1 may also be used, but the block interfaces might differ slightly. For TIA Portal V15 and higher, a newer DriveLib is required. Mixing libraries and TIA Portal versions is a common cause of compile errors.
PLC firmware. The S7-1200 AC/DC/RLY used in this project must have firmware V4.2 or higher to support the required DriveLib blocks. Older firmware versions do not support some motion control instructions and will reject the SINA_POS call with a type error.
Encoder cable length. The maximum cable length for HTL encoders on the CU250S-2 is approximately 100 m at 24 V. For TTL encoders, the maximum is approximately 50 m at 1 MHz. For longer cable runs, a signal repeater or a line driver is required.
Two-encoder configuration. When two encoders are connected (one to X9, one to X10), the speed controller uses one encoder (typically the motor-mounted encoder on X9) and the position controller uses the other (the external machine encoder on X10). The assignment is made through p2506 and the speed/position controller encoder selectors. The combination rules are documented in the Encoder combinations for SINAMICS G120 CU250S-2 (PDF, Siemens support, 109813048).
17. Worked Example: From Power-On to First MDI Move
The following sequence summarizes a first-time commissioning of a SINAMICS G120 CU250S-2 PN with a TTL incremental encoder on X9, controlled by an S7-1200 through SINA_POS, on TIA Portal V14.
- Hardware. Wire the encoder to X9: A+ to pin 1, A− to pin 2, B+ to pin 3, B− to pin 4, +24 V to pin 13, 0 V to pin 14. Bond the shield to the connector backshell. Connect PROFINET port 1 of the CU to the S7-1200 PROFINET port.
- Project creation. Create a new TIA Portal V14 project. Add the S7-1200 CPU and the G120 CU250S-2 PN. Assign IP addresses (PLC: 192.168.0.10, drive: 192.168.0.20) and PROFINET device names.
- Telegram. Configure telegram 111 on the drive's PROFINET interface.
- DriveLib. Install DriveLib V14. Drag SINA_POS into the PLC program. Open the call options and connect the block to the drive's PROFINET telegram. The HWIDSTW and HWIDZSW inputs are populated automatically.
- Drive parameters. With Startdrive, go online to the drive. Set p0015 to the EPOS macro (typically macro 7, verify against the firmware). Set p0300…p0335 to match the motor. Set p0400 = 2 (TTL), p0408 = 1024 (encoder ppr). Set p2502 = 1 (EPOS enable), p2506 = 1 (encoder 1 for position), p2580 = −1000000, p2581 = 1000000 (software limits in LU).
- Commissioning. Run p1910 (motor identification) and p1960 (speed controller optimization). Save the parameters to the drive's non-volatile memory (copy RAM to ROM, p0971 = 1).
- Encoder test. Open the drive's online view in TIA Portal, navigate to "Diagnostics → Encoder." Read r0458. Rotate the motor by hand and verify the value increments. If it decrements, set p0410 = 1.
- PLC program. In OB1, call SINA_POS with the application logic. Set Mode = 0 (jog) and PositiveDirection = TRUE briefly. Verify the motor rotates in the expected direction. Set Mode = 0 and NegativeDirection = TRUE briefly. Verify the motor rotates in the opposite direction.
- Homing. Execute active homing through p2593, or set p2596 = 1 from the PLC to set the current position to p2503. Verify ZSW1 bit 10 ("Reference point reached") is TRUE.
- First MDI move. Set Mode = 2 (MDI absolute), Position = 1000 (LU), Velocity = 1000 (LU/min), Acceleration = 1000 (LU/s²). Pulse ExecuteMode. Verify the motor moves to position 1000 LU and the actual position in the watch table converges to 1000.
-
Error handling. Read the drive's fault buffer (r0947) and alarm buffer (r2110) after any unexpected behavior. Clear faults by pulsing the SINA_POS
AcknowledgeFaultsinput.
18. References to Official Siemens Documentation
G120 with CU250S-2 Control Units operating instructions (PDF, Siemens support, 99730303) — primary commissioning manual for the CU250S-2 Control Unit, including encoder wiring, parameter assignment, and fault diagnosis.
Encoder combinations for SINAMICS G120 CU250S-2 (PDF, Siemens support, 109813048) — application note describing the supported encoder combinations and the assignment of two encoders to speed/position control.
Where do I see the encoder value in TIA Portal V14?
Open the drive's online view in the project tree (Devices & networks → right-click the SINAMICS G120 → "Online & diagnostics"). Navigate to "Diagnostics → Encoder" and read r0458 (encoder 1 actual value) or r0461 (encoder 2 actual value). In a running SINA_POS instance, the actual position is also exposed as the output ActualPosition of the block, and the actual velocity as ActualVelocity.
Do I need Startdrive, or can I use a generic PROFINET GSD with the G120?
Startdrive is strongly recommended because it provides a parameter view of the drive inside TIA Portal and integrates with the DriveLib blocks. With a generic GSD, you can read and write the I/O process data of telegram 111, but the parameter editor and the DriveLib blocks are not available, and the acyclic parameter channel must be implemented manually with RDREC / WRREC.
Can I use a third-party encoder (not Siemens) with the CU250S-2?
Yes, as long as the encoder is HTL, TTL, or SSI and the input frequency is below the CU250S-2 limit (500 kHz for HTL, 1 MHz for TTL, 500 kHz for SSI). Set p0400 to the matching encoder type and p0408 to the encoder's pulses per revolution. Verify the encoder in the diagnostics view (r0458) before commissioning the position loop.
Why does the drive report F31117 after the motor is enabled?
F31117 means the encoder signal amplitude is outside the allowed tolerance. The most common causes are a damaged cable, missing shield bonding, or an encoder supply voltage that is too low. Check the cable for damage, verify the shield is bonded to the backshell of the Sub-D connector with a 360° clamp, and verify the encoder supply voltage on X9 pin 13 (+24 V) and pin 14 (0 V) is in the encoder's specified range.
Should I run the position loop in the drive (EPOS + SINA_POS) or in the PLC (technology object)?
For a standalone axis with simple motion (point-to-point moves, jog, homing), EPOS in the drive plus SINA_POS in the PLC is the simpler and more robust path. For a multi-axis application with cross-axis coordination, registration marks, camming, or where the position loop must interact closely with PLC logic, the technology object in the PLC (TO_PositioningAxis) gives more direct access to the controller and the MC_Power / MC_MoveAbsolute / MC_Home instruction set.