Overview
The SINAMICS G120 modular drive, equipped with a CU250S-2 Control Unit, supports a "simple limit switch function with speed control" in addition to the more capable EPOS (basic positioner). The simple limit switch routine is the right choice when the application needs only two end-of-travel digital inputs and an OFF1 ramp stop, with no encoder-based position feedback. It is distinct from EPOS in two important ways: it works in pure speed control mode, and it does not know the absolute axis position. If the application requires a real position reference, traverse profiles, or homing, use EPOS instead. If the application is a guarded travel that simply needs to stop at the end of the rail, the simple limit switch function is lighter, faster to commission, and easier to debug.
The function block takes three binector inputs and produces one status output:
- p3340 — Start command (the "upper binector" the original poster asked about). Asserts motion.
- p3342 — Limit switch 1 signal source (low-active).
- p3343 — Limit switch 2 signal source (low-active).
- r3344 — Status word that reports the current state of the motion block.
Travel direction is taken from the sign of the speed setpoint, with p1113 acting as a sign-flip toggle. When a limit is reached, the drive triggers OFF1 along the deceleration ramp defined in p1121. The behavior of the function is documented in chapter 6.11 of the SINAMICS G120/G120D/G150 function manual and reinforced by the Siemens FAQ F3981040 — Limit switches with CU2xy-2.
Prerequisites and Tooling
Before commissioning, confirm the following:
- Hardware: SINAMICS G120 with a CU250S-2 Control Unit. The simple limit switch function with speed control is a CU250S-2 feature. Order numbers for the CU250S-2 family include 6SL3246-0BA22-1FA0 (PN), 6SL3246-0BA22-1PA0 (DP), 6SL3246-0BA22-1CA0 (CAN), and 6SL3246-0BA22-1FA1 (PN-F with PROFIsafe). On the older CU240B/E-2 and CU230P-2, the same parameter numbers exist but the function semantics differ — always check the variant.
- Firmware: V4.7 SP3 or later is recommended because the runtime behavior of r3344 was refined in newer firmware. Older firmware (V4.5 and earlier) exposes the parameters in the list, but the runtime update of r3344 is less consistent. Cross-reference the firmware-specific List Manual.
- Commissioning tool: STARTER V5.x (legacy) or Startdrive in TIA Portal V15.1 and later. Startdrive is the recommended path for new projects; STARTER is still supported for service work on installed bases. Both expose the simple limit switch function as a dedicated mask under "Functions → Limit switches" in the drive configuration.
- Online connection: The runtime output r3344 only updates in online mode. Offline parameter editing does not exercise the motion block. A working PROFINET, PROFIBUS, or Ethernet/IP route between the PG/PC and the CU250S-2 is required.
- Wiring: Two digital inputs wired to the end-of-travel limit switches (DI 2 and DI 3 are commonly used), a start command source (DI or PLC bit), and a speed setpoint source (analog input, fixed setpoint, or fieldbus). The default PNP sourcing input type on the G120 expects a contact that pulls the DI to 0 V when actuated.
- Memory card (optional but recommended): A SINAMICS SD card to back up parameters so the configuration survives a CU swap.
Parameter Map
| Parameter | Meaning | Direction | Default | Notes |
|---|---|---|---|---|
| p3340 | Limit switch: Start command (binector input) | Input | 0 | Top of the function block. The "upper binector" from the source thread. The drive only travels while this is asserted and no limit is reached. |
| p3342 | Limit switch 1 signal source | Input | 0 | Wire to a digital input that represents the first end of travel. Low-active. |
| p3343 | Limit switch 2 signal source | Input | 0 | Wire to the opposite end of travel. Low-active. |
| r3344 | Limit switch status word | Output | — | Runtime output. Reports the current state of the motion (idle, traveling, limit reached). Only updates in online mode. |
| p1113 | Direction of rotation reversal | Setting | 0 | Flips the sign convention. With p1113 = 0, positive setpoint = positive direction; with p1113 = 1, the sign is inverted. |
| p1121 | OFF1 ramp-down time | Setting | 10 s (default) | Used to brake the drive when a limit is reached. Tune to the mechanics and the load inertia. |
| p0840 | ON / OFF1 source | Setting | 0 | Standard enable. Must be asserted for any motion, including the limit switch routine. |
| p1000 | Speed setpoint source | Setting | 2 (analog) | Defines where the speed setpoint comes from. With the simple limit switch function, the sign of the setpoint decides the direction. |
| r1198 | Smoothed speed setpoint | Output | — | Mentioned in the source thread as a possible BiCo target for p3340. The thread does not converge on a definitive answer; p3340 is a generic binector input and can be wired to any binector source. |
The three inputs (p3340, p3342, p3343) are binector inputs — they are interconnected using the standard SINAMICS BiCo (Binector/Connector) mechanism. p3342 and p3343 are low-active; a logic 0 on the assigned DI means "limit reached."
BiCo and Signal Routing
Every signal path in the SINAMICS parameter world is a BiCo (Binector/Connector) interconnection. A binector is a 1-bit digital signal; a connector is a 16- or 32-bit analog signal. The parameter editor in STARTER or Startdrive lets you click on a binector input (such as p3340, p3342, p3343) and pick the binector source (a parameter whose r-value is a bit) from a tree.
Common BiCo sources for p3342 and p3343 are the raw digital input bits:
- r0722.x — DI 0..5 status, non-inverted
- r0723.x — DI 0..5 status, inverted (used when the field device is the opposite polarity from the function block expects)
- Bits from the cyclic PROFIdrive receive telegram (r2090..r2099 for the standard mapping, r2050 indices for user-defined mappings)
For p3340 (start), the typical sources are a DI bit, a control word bit from the PLC, or the output of another function block (such as a sequencer). The thread raises r1198 (smoothed speed setpoint) as a candidate, but r1198 is a connector, not a binector, so it cannot be wired directly to a binector input. A common alternative is to wire p3340 to a control word bit delivered over PROFINET/PROFIBUS, for example STW1 bit from r2089 after the appropriate masking.
Wiring the Digital Inputs
The simple limit switch function depends entirely on the digital inputs. A typical wiring assignment on the CU250S-2 terminal strip is:
| Terminal | Function | Source / Behavior |
|---|---|---|
| DI 0 | ON / OFF1 (p0840) | Pushbutton, normally open, sourcing PNP |
| DI 1 | Direction reversal (p1113) | Selector switch, active = invert direction |
| DI 2 | Limit switch 1 (p3342) | Mechanical end-of-travel limit, low-active |
| DI 3 | Limit switch 2 (p3343) | Mechanical end-of-travel limit, low-active |
| DI 4 (optional) | Start command (p3340) | Pushbutton, sourcing PNP |
| AI 0 | Speed setpoint (p1000) | ±10 V analog from a potentiometer or PLC |
The two limit switches are wired to digital inputs 2 and 3, and the Siemens FAQ F3981040 explicitly notes that the drive is stopped via OFF1 with the down ramp in p1121 once a limit switch is actuated.
The "low-active" property means a logic 0 on the DI is the limit condition. With PNP sourcing, this corresponds to a contact that pulls the DI to 0 V when actuated. If the field device is NPN (sinking) or normally-closed with a wired-OR topology, the polarity is inverted, and you must set the DI inversion in p0722/p0723 or feed the signal through a BiCo inverter. Without the inversion, the function will interpret the resting state of the DI as "limit reached" and refuse to start.
Direction, Speed Setpoint, and Ramp
The simple limit switch function has no direction parameter of its own. The travel direction is taken from the sign of the speed setpoint, with p1113 acting as a sign-flip toggle. The source manual phrases it as: "the direction of motion is defined by the speed setpoint (positive speed setpoint = positive movement if p1113 = 0, otherwise vice versa)."
Common speed setpoint sources (p1000):
- p1000 = 2: Analog input (AI 0 on the CU250S-2, default ±10 V).
- p1000 = 3: Fixed setpoints (p1001..p1015) selectable via DI bits.
- p1000 = 6: Fieldbus setpoint via the PROFIdrive receive telegram (NSOLL_A or NSOLL_B depending on the telegram).
- p1000 = 7: Analog setpoint with an additive digital trim.
For the limit switch function, the magnitude of the setpoint determines the travel speed, and the sign determines the direction. Pick a setpoint magnitude that the mechanics can stop within the available braking distance at the ramp in p1121.
The ramp in p1121 is shared with the normal OFF1 deceleration. If the limit switch must be approached gently, lengthen p1121. If a fast stop is required (e.g., the limit switch is the only safety end stop), shorten it. Watch the motor current during the ramp to confirm the drive is not in current limit; a current-limited stop extends the braking distance unpredictably.
Step-by-Step Commissioning in STARTER or Startdrive
- Open the project, go online with the CU250S-2, and upload the drive configuration to the PG/PC if you are working from a swap-out or unknown state.
- Confirm that the control mode is "Speed control" (not position control / EPOS). The simple limit switch function is only available in speed control mode. If you previously configured EPOS, switch it off and clear the position-related parameters.
- Use a standard wiring preset to bring up the DIs quickly. In STARTER, the typical preset for ON/OFF1 + AI0 + direction reversal is "Standard wiring 7" (or the equivalent in your firmware). In Startdrive, the wizard offers the same presets under "Function blocks → Standard wiring." This preset maps DI 0 to ON/OFF1 (p0840), DI 1 to direction reversal (p1113), AI 0 to speed setpoint (p1000 = 2), and clears the unused DIs.
- Configure the digital inputs:
- DI 0: ON/OFF1 (p0840)
- DI 1: Direction reversal (p1113)
- DI 2: Limit switch 1 (BiCo to p3342)
- DI 3: Limit switch 2 (BiCo to p3343)
- DI 4 (optional): Start command (BiCo to p3340)
- Open the parameter list, filter by "3340", and assign:
-
p3340= source for the start command (e.g.,r0722.4for DI 4, or a PLC bit such asr2090.0from a PROFIdrive control word bit). -
p3342= source for limit switch 1 (e.g.,r0722.2for DI 2, non-inverted). -
p3343= source for limit switch 2 (e.g.,r0722.3for DI 3, non-inverted).
-
- Set the DI inversion bits in p0722/p0723 if the field device is the opposite polarity from the function block expects.
- Tune
p1121(OFF1 ramp-down time) to the mechanical requirements. - Save the project to the PG/PC, then RAM to ROM on the drive. If a memory card is present, copy the parameters to the card so a CU swap can restore them automatically.
- Run the verification sequence in the next section.
Online vs Offline Behavior of r3344
The most common confusion (and the issue the original poster ran into) is that r3344 only updates in online mode. The reason is that r3344 is a runtime parameter: it is calculated by the drive firmware based on the current state of p3340, p3342, p3343 and the speed setpoint. When you work offline in STARTER or Startdrive, the parameter view shows the last cached value (often 0 or the boot-time state) and does not change when you toggle p3340, p3342, p3343 in the editor.
To verify the function is wired correctly:
- Go online with the drive.
- Open the parameter list and add r3344 to a watch table.
- Assert the start (p3340 = 1) and confirm that the drive accelerates in the direction set by the speed setpoint sign.
- Force p3342 to 0 (limit 1 reached) and observe r3344. The pattern should reflect the "limit reached" state, and the drive should ramp down via OFF1.
- Reset p3342 to 1, force p3343 to 0, and repeat the test.
- With both limits cleared, cycle p3340 and confirm the drive accelerates in the opposite direction (or stays put, if the setpoint is also 0).
If r3344 does not change, the most common causes are:
- You are not online — the parameter is a runtime output.
- The BiCo sources on p3342/p3343 are not actually pointing at the right bits (e.g., a typo, or the bit belongs to a different DI).
- The drive is in a higher-priority state (fault, OFF2, missing enable, STO active).
Timing Diagram and State Behavior
The state machine of the simple limit switch function can be summarized as follows:
state = IDLE
on p3340 rising edge:
if speed_setpoint > 0 and p3342 = 1:
state = TRAVEL_POSITIVE
enable drive, setpoint = abs(speed_setpoint)
elif speed_setpoint < 0 and p3343 = 1:
state = TRAVEL_NEGATIVE
enable drive, setpoint = abs(speed_setpoint)
else:
state = IDLE # already at the requested limit
on p3342 = 0 (limit 1 reached):
state = LIMIT1
trigger OFF1, ramp via p1121
on p3343 = 0 (limit 2 reached):
state = LIMIT2
trigger OFF1, ramp via p1121
on p3342 = 1 and p3343 = 1 (limits cleared):
if p3340 = 1:
# re-evaluate direction
...
r3344 = encoded state word
After a limit stop, p3340 must typically be reasserted (or the firmware behavior is to wait for the limit to clear and a new rising edge of p3340) before the next travel begins. The exact edge behavior depends on the firmware; check the function manual chapter 6.11 for the version you are running.
Verification and Acceptance Test
After commissioning, run the following checks before handing the machine over to production:
- Manual jog in each direction, with the limit switches clear. Confirm that the motor runs only when p3340 is asserted and the matching limit switch is not yet reached.
- Drive into each limit switch at low speed. Confirm that the drive decelerates along p1121 and stops without overshoot.
- Repeat at the application speed. Confirm that the deceleration ramp is gentle enough to avoid mechanical shock and short enough to keep the motor inside the safe travel range.
- Toggle the limit switch wiring with the drive disabled (OFF2). Confirm that r3344 reports the correct "limit reached" state when the drive is re-enabled.
- Power cycle the drive. Confirm that the limit switch function comes up in the same state as before (parameters are stored on the CU250S-2).
- Watch r3344 in the trace. Confirm that the state word changes as expected during a full travel cycle.
- From the PLC, force a start over PROFINET/PROFIBUS and confirm that p3340 reacts, r3344 updates, and the drive behaves as in the manual jog test.
Differences vs EPOS and Safety Notes
Engineers often confuse the simple limit switch function with the EPOS basic positioner. Key differences:
- The simple limit switch function works in speed control mode and only needs DIs. EPOS requires a position encoder (or operates in encoderless mode with reduced dynamics) and additional parameter setup (mechanical system, position limits, homing, traversing blocks).
- The simple limit switch function is suitable for "travel from A to B and stop" without position feedback. EPOS is suitable for "move to absolute position X" with closed-loop control.
- The simple limit switch function has no homing; the "home position" is wherever the limit switch contact closes. EPOS has a full homing routine (passive homing to a reference cam, active homing with homing mark).
- EPOS can be moved into the limit range by software (setpoint-based), but the simple limit switch function only reacts to the digital inputs.
If your application needs to know where the axis is, use EPOS. If you just need a guarded travel that stops at the end of the rail, the simple limit switch function is the simpler and more reliable choice.
On safety: the simple limit switch function is not a SIL/PL-rated function. The DI inputs are not safety inputs. If the end of travel is a safety boundary, add an STO (Safe Torque Off) channel via PROFIsafe on a CU250S-2 PN-F, or a hardwired safety relay that opens the STO enable on a separate limit switch contact. The simple limit switch routine can still be used for process control; the safety channel provides the protective stop.
Troubleshooting Matrix
| Symptom | Likely Root Cause | Fix |
|---|---|---|
| r3344 never changes when toggling p3340/p3342/p3343 | Working offline. The runtime output only updates in online mode. | Go online with the CU250S-2. The r3344 in the watch table will start to update. |
| Drive does not move when p3340 = 1 | Missing ON/OFF1 (p0840), missing enable, or wrong BiCo source on p3340. | Check p0840 is asserted, the control word has the enable bits, and p3340 actually points at a signal that toggles. Trace the BiCo source with the commissioning tool. |
| Drive runs in the wrong direction | Speed setpoint sign or p1113 mismatch. | Verify the sign of the speed setpoint and p1113. With p1113 = 0, positive setpoint = positive direction; with p1113 = 1, the sign is inverted. |
| Drive stops as soon as it starts | A limit switch is reading 0 (active). The wiring may be inverted, or the limit switch contact is normally closed. | Verify the DI level. If the limit switch is normally closed, swap to a normally open contact, or invert the DI through p0722/p0723. |
| Drive overshoots the limit switch | p1121 is too long, or the speed setpoint is too high for the available braking distance. | Reduce p1121, reduce the maximum speed, or both. Watch the motor current during the ramp to make sure the drive is not in current limit. |
| Function not available in the parameter list | Wrong firmware version or wrong CU variant. The simple limit switch function with speed control is a CU250S-2 feature. | Check the Control Unit order number and the firmware version. Cross-reference with the List Manual. |
| The drive does not respond to p3340 from a PLC | The BiCo source on p3340 is not a PROFINET/PROFIBUS bit, or the bit is read at the wrong time. | Use a control word bit (e.g., STW1 bit from the PLC) and BiCo it to p3340. Verify the telegram mapping in the device configuration. |
| Drive starts in the wrong direction after a power cycle | The sign of the analog setpoint at boot depends on the AI wiring and the AI configuration. The limit switch function does not have a "remembered direction" state. | Set p1113 explicitly before commissioning, and verify the AI scaling (p075x parameters) at boot. |
| Fault F01611 or similar when entering the limit range | The drive has been configured for EPOS and the simple limit switch function at the same time, and the EPOS software limit switches are firing. | Disable the EPOS function block, or set the EPOS software limit switches to a wider range than the mechanical limit switches. |
FAQ
What is the purpose of p3340 in the SINAMICS G120 simple limit switch function?
p3340 is the start command (upper binector input) of the limit switch function. The drive only begins a travel when p3340 is asserted, the matching limit switch is clear, and an ON/OFF1 enable is present.
Are p3342 and p3343 high-active or low-active?
They are low-active: a logic 0 on the interconnected digital input means "limit reached." For PNP wiring, this means the limit switch pulls the DI to 0 V when actuated. If your device is the opposite polarity, invert the DI through p0722/p0723 or feed the signal through a BiCo inverter.
Why does r3344 not change when I toggle p3340/p3342/p3343 in the parameter view?
r3344 is a runtime output. It is calculated by the drive firmware based on the current state of the inputs. Toggle the parameters while online with the CU250S-2, and r3344 will update. Offline parameter editing does not exercise the runtime.
How is the direction of motion defined in the simple limit switch function?
The direction is taken from the sign of the speed setpoint, with p1113 as a sign-flip toggle. With p1113 = 0, a positive speed setpoint moves the drive in the positive direction. With p1113 = 1, the sign is inverted.
When should I use the simple limit switch function instead of EPOS?
Use the simple limit switch function when you only need two end-of-travel DIs and a controlled stop via OFF1 (p1121). Use EPOS when you need closed-loop position control, an absolute target position, or a homing routine. The simple limit switch function is much lighter to commission and debug, but it does not know the axis position.
Can I wire the start command from a PLC over PROFINET?
Yes. BiCo p3340 to a control word bit from the PLC telegram (e.g., STW1 bit). Verify the telegram mapping in the device configuration of TIA Portal / Startdrive and confirm r3344 reacts in online mode.
Is the simple limit switch function safety-rated?
No. The DI inputs and the function block are standard (non-safety) inputs. For SIL/PL-rated end-of-travel protection, use STO via PROFIsafe on a CU250S-2 PN-F, or a hardwired safety relay, in addition to the limit switch routine.
What firmware version of the CU250S-2 is required?
The function is available across the CU250S-2 firmware line, but the parameter group around p3340/p3342/p3343/r3344 was refined in newer firmware (V4.7 SP3 and later recommended). Always cross-check against the List Manual for the firmware installed in the drive.