Siemens LOGO! PLC Saw Missing Cylinder Stroke Without PC

David Krause17 min read
PLC HardwareSiemensTroubleshooting
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

Siemens LOGO! PLC: Saw Missing Cylinder Stroke Without PC Connected

Field diagnostic for a travelling-saw application driven by a Siemens LOGO! PLC where the upward pneumatic cylinder stroke is only executed while a laptop is running LOGO! Soft Comfort in online mode. The same program, the same wiring, and the same I/O are in use, yet the moment the USB cable is unplugged the cylinder is dead in the cycle. The fault has been reproduced more than ten times and survives a full power cycle of the machine. This reference walks through the underlying STOP/RUN mechanics, the edge-trigger and retentive-flag pitfalls specific to LOGO! Soft Comfort, the pneumatic and sensor verification path, the Windows Code 45 error that often accompanies the issue, and the corrective program changes that make the saw run reliably with the laptop removed.

1. Problem Statement

A travelling saw controlled by a Siemens LOGO! base module executes its full sequence only when a laptop is plugged in and running LOGO! Soft Comfort in online mode. The reported symptoms are:

  • The saw starts and runs correctly when the laptop is online and monitoring.
  • When the laptop is disconnected, one specific element of the cycle does not occur: the pneumatic cylinder that lifts the saw carriage upward fails to actuate.
  • The fault is consistent. The operator has cycled the saw with and without the laptop at least ten times and the missing stroke always correlates with the absence of the PC.
  • A full power cycle of the machine and the LOGO! base module has been performed between tests. The fault persists.
  • "Electrically everything seems fine." All other actuators, indicators, and interlocks behave normally in both states.

The dominant reaction from anyone familiar with PLCs is that "online mode is read-only, it cannot change program flow." That statement is partially correct, and that partial correctness is exactly what makes this fault so hard to catch. Online mode does not change the program on its own, but the act of establishing the online session almost always forces a STOP-RUN transition in the LOGO! base module, and that transition resets every non-retentive resource in the controller.

2. Why a Laptop "Fixes" the Fault: STOP/RUN Mechanics

The Siemens LOGO! base module transitions between three operating modes:

  • STOP - program is held; outputs are forced off; flag, counter, and timer states are frozen.
  • RUN - program executes; outputs drive actuators; flags, counters, and timers update each cycle.
  • PROGRAM/EDIT - the LOGO! Soft Comfort tool may temporarily stop the controller to download or verify a program.

When LOGO! Soft Comfort is connected to a base module over USB or Ethernet and the operator enters Online mode, the PC negotiates with the base. The negotiation step places the base in a paused state briefly, and on completion the base re-enters RUN. Each STOP-to-RUN edge performs what Siemens calls a "cold restart" of the user program:

  • All non-retentive flag markers (M1 through the configured upper limit) are cleared to 0.
  • All non-retentive counters (C) are reset to their initial value or 0.
  • All non-retentive timers (T) are reset to 0.
  • All non-retentive on-delay, off-delay, and pulse outputs are forced to 0.
  • The cycle-time accumulator resets.

Resources flagged as "Keep" (retentive) are not cleared. These are configured per-block in LOGO! Soft Comfort by selecting the block in the program and enabling the retentive checkbox in the block properties.

The implication is direct: any program logic that depends on a flag, counter, or timer being in a known initial state at first run will behave differently between a "laptop present" start (where the cold restart occurs during connection setup) and a "laptop absent" start (where the cold restart already occurred, possibly many minutes or hours earlier, and the flag/timer has since drifted to a value that does not satisfy the conditional logic).

The operator observation "I have power-cycled" actually confirms the diagnosis. A power cycle also performs a cold restart, identical to the one LOGO! Soft Comfort performs on connect. If the fault still appears after both, the missing element is not a retained value - it is a true cold-start sequencing problem in the program.

3. Common Root Causes in LOGO! Programs

The following are the four most common program-level faults that produce the "works with PC, fails without PC" symptom. They are listed in order of likelihood based on the available symptom data.

3.1 Positive Edge Trigger (RE / Rising Edge Relay)

The RE function block in LOGO! Soft Comfort emits a one-cycle TRUE pulse on the rising edge of its input. If the input is already TRUE at the moment the program begins executing, RE will not fire because there is no 0-to-1 transition.

Sample problematic pattern:

I1 (Cycle Start) --> RE --> Q1 (Up-Cylinder Solenoid)

If I1 is held TRUE by the operator before the cycle starts, the RE block fires once on the first 0-to-1 transition, which is consumed during the cold restart that happens when the laptop is plugged in. Without the laptop, the cold restart has already happened earlier, and the I1 edge has already passed. The RE block never sees a transition during the visible cycle and Q1 never energises.

Test: Place a LOGO! Soft Comfort online monitor on the RE block output. Drive the cycle with the laptop online. The RE output should pulse once. Drive the cycle with the laptop disconnected. The RE output should remain low throughout.

3.2 Retentive Flag Settings (Keep Flag)

Flag markers (M) in LOGO! are commonly used as latches. If a flag is set during a previous run and is required to be SET at the start of the next cycle, but it is not configured as retentive, the flag will clear on power cycle or laptop reconnect (both being cold restart events).

Common incorrect pattern:

SEQUENCE: --(S) M5 --> (Cycle Ready)
CYCLE_OK = M5 AND Start_Request --> Q1

If M5 is not marked as Keep and the operator is in the habit of starting the cycle immediately after a power-up, M5 will be 0 at startup, the AND condition is false, and Q1 will not energise. With the laptop plugged in, the operator is already in a "warm" state where M5 was set during a previous online session, and the condition is satisfied.

3.3 First-Scan / Initialization Flag M8

Older LOGO! documentation recommends M8 as a one-cycle initialization pulse that fires only on the first scan after a cold restart. Some programs rely on M8 to clear faults, arm timers, or prime counters. If the program structure depends on M8 firing once per cold restart, and the operator has been running online sessions that frequently trigger cold restarts, the initialization routine may have already run, leaving the primed resources in an unexpected state.

3.4 Counter or Timer Initial Value

If a counter (C) or on-delay timer (T) is expected to be at zero at the start of a cycle, but its retentive setting is misconfigured, it will retain a value from the previous run and either suppress a needed cycle or advance past a needed threshold. The cylinder upward stroke is particularly susceptible because it is often gated on a counter reaching a value that represents "carriage has returned home."

4. Pneumatic Cylinder Control Verification

Before assuming a purely software cause, the pneumatic circuit must be ruled out. The "electrically everything seems fine" comment from the operator is not conclusive; many pneumatic failures appear electrical in nature.

4.1 Solenoid and Coil

Confirm the coil voltage matches the LOGO! output. Common ratings are 24 V DC, with a power draw of 1 to 5 W depending on valve size. Measure the voltage at the coil terminals with the cylinder stroke commanded - both with the laptop connected and without. Both should show nominal 24 V DC.

4.2 Magnetic Reed Switch / Cylinder Position Sensor

The upward stroke is typically confirmed by a magnetic reed switch mounted on the cylinder. Common ratings:

Parameter Typical Value
Switch type NO (Form A), magnetically actuated
Contact rating 10 W max, 100 V max, 0.5 A max
Voltage 5 to 30 V DC
LED indicator Yes (yellow = closed)
Manufacturer examples SMC D-M9N, Festo SME-8, Parker P8S, IFM MK5

Place a multimeter on the reed switch contact with the cylinder manually stroked. The contact must close at the end of the upward stroke. If the LED on the sensor is dim, flickering, or off, the sensor is misaligned with the cylinder magnet or has failed.

4.3 5/2 or 5/3 Solenoid Valve

Single-solenoid (5/2) valves hold position only while energised. Double-solenoid (5/3) valves latch in the last commanded position. For the upward stroke to occur reliably without continuous PC monitoring, a 5/3 latching valve or a spring-return 5/2 is preferred. Verify the valve part number and datasheet against the LOGO! output current limit (LOGO! 8 relay outputs are rated 8 A at 240 V AC / 10 A at 24 V DC; transistor outputs are rated 0.3 A continuous per output).

4.4 Air Supply and Pressure

Confirm the regulator is set to the cylinder-rated pressure. Common cutting-saw cylinders operate at 6 bar (87 psi). Below 4 bar (58 psi) the cylinder will be slow and may stall under load. A pressure switch should be wired to a LOGO! input and interlocked into the cycle; if the pressure switch indicates low pressure, the upward stroke must be inhibited.

5. Diagnostic Procedure

Follow this sequence in order. Do not skip ahead; each step isolates the fault to a specific layer.

  1. Power down and isolate. Disconnect the laptop, leave the LOGO! powered.
  2. Open LOGO! Soft Comfort offline. Load the project file (.lsc or .lsc).zip) and inspect the program on a separate monitor, not on the machine.
  3. Identify the output that drives the up-cylinder solenoid. Note the output (Q1, Q2, etc.) and the LOGO! physical terminal (e.g., Q1 on a LOGO! 8 BM is terminal 8 or 9 depending on variant).
  4. Trace the rung driving that output. Identify any RE (rising edge), FE (falling edge), or pulse-edge blocks in the rung. Mark each one as a candidate.
  5. Identify all flags, counters, and timers in the rung and its upstream latches. For each, check the block properties for the Retentive (Keep) checkbox.
  6. Force a clean cold start. Power down the LOGO! for at least 30 seconds. Power up with the laptop disconnected.
  7. Run the cycle. Observe whether the upward stroke executes.
  8. Power down. Plug in the laptop, connect online, then power up the LOGO!. Run the cycle. Observe whether the upward stroke executes.
  9. Compare flag/timer/counter states. Use online monitoring to record the value of every flag, counter, and timer in the rung at the moment the cylinder command is issued, in both states. The differing values pinpoint the cold-start dependency.

6. Programmatic Fixes

6.1 Replace RE with a Level-Triggered Output

If the upstream condition is a level (e.g., "cycle in progress and home sensor TRUE"), the RE block is not needed. Replace it with a direct connection or with an AND block.

Before:

I1 (Home) --> RE --> AND --> Q1
I2 (Run) ------->     ^

After:

I1 (Home) --> AND --> Q1
I2 (Run) ------->  ^

6.2 Make Critical Flags Retentive

Right-click each flag (M) in the program, open block properties, and check the Retentive box if the flag represents a state that must persist across cold starts. Common candidates are cycle-step flags (e.g., M5 = Cycle_Complete) and operator-mode flags (M6 = Auto_Mode).

Do not make every flag retentive. Retentive flags retain faults. A flag set by an E-stop must be cleared by an explicit reset, not by a cold restart. Choose retentive settings per flag based on its semantic role.

6.3 Add an Initialization Pulse Block

If the program needs to perform first-time setup on every cold start, place the initialization logic at the top of the program and gate it with the LOGO! built-in "first-cycle" pulse or use the M8 initialisation marker (LOGO! 0BA5 and earlier) or the LOGO! 8 Initialization flag on the digital output blocks. Confirm with the version-specific manual.

6.4 Decouple Sequencing from Cold-Start Events

Restructure the sequence so that the up-cylinder stroke is initiated by a transition that is guaranteed to occur each cycle, regardless of cold-start timing. A typical robust pattern:

Home_Sensor (I3) --> AND --> S( ) M7 --> M7 (Stroke_Up_Done)
Run_Request (I4) -> AND --> R( ) M7
M7 --> AND --> T_OnDelay (0.5s) --> AND --> Q1 (Up_Coil)

The set/reset latches M7, which is driven by physical inputs that are guaranteed to transition each cycle. The 0.5 s on-delay debounces the home sensor and provides a stable window for the coil to energise.

7. Hardware Verification

7.1 LOGO! 8 Output Wiring

LOGO! 8 base modules with relay outputs use terminal numbers that depend on the variant. For the BM (basic module) with 8 digital inputs and 4 relay outputs:

Output Terminal
Q1 8 (NO), 9 (COM), 10 (NO/NC depending on variant)
Q2 11 (NO)
Q3 12 (NO)
Q4 13 (NO)

Confirm the up-cylinder solenoid wire lands on the correct terminal. A common installation error is to assume Q4 when the program references Q1, or vice versa, when a previous technician rewired the panel.

7.2 LOGO! Power Supply

LOGO! 8 BM operates on 12/24 V DC or 115/230 V AC depending on the ordered variant. Confirm the supply is within tolerance. Under-voltage can cause the relay outputs to chatter. Measure at the LOGO! power terminals: 24 V DC variant should show 20.4 to 28.8 V DC.

7.3 USB Cable and Port

Verify the USB cable is data-rated, not charge-only. Many low-cost USB cables used for phone charging lack the data lines and will power the LOGO! enough to appear connected but will not enumerate as a serial device. Use the supplied Siemens LOGO! USB cable (part number 6ED1057-1AA00-0BA0 for the LOGO! USB PC cable) or a known-good equivalent.

7.4 Windows Device Manager: Code 45

When the laptop is connected to the LOGO! and Windows Device Manager shows the entry "This hardware device is not connected to the computer (Code 45)" for the LOGO! USB device, the data path is broken even though the cable may be plugged in. This is documented as Code 45 - Currently, this hardware device is not connected to the computer on the Microsoft Windows Hardware Developer documentation. For LOGO! deployments the typical remedies are:

  1. Uninstall the LOGO! device in Device Manager, scan for hardware changes, and let Windows reinstall the driver.
  2. Replace the USB cable with a known data-rated cable.
  3. Try a different USB port, preferably one directly on the motherboard (rear panel on a desktop).
  4. Update the LOGO! Soft Comfort installation to a version that bundles the latest USB driver (LOGO! Soft Comfort V8.3 and later).
  5. Disable USB selective suspend in Windows Power Options for the LOGO! USB root hub.

If the saw is functioning when the laptop is connected and Code 45 is present, the connection itself is not actually being used for program flow; the laptop is acting as a stable ground reference or noise sink that masks an underlying sensor or wiring issue. Treat Code 45 as a warning, not a root cause.

8. Verification

After applying a programmatic or hardware fix, verify the saw functions correctly under all of the following conditions:

  1. Cold start, no laptop. Power down the LOGO! for at least 30 seconds. Power up. Run the cycle five times consecutively. The upward stroke must execute every cycle.
  2. Warm start, no laptop. Run the cycle five times consecutively without power cycling between runs. The upward stroke must execute every cycle.
  3. Online monitor, no input forcing. Connect the laptop, enter Online mode, do not switch to Online Test, and do not force any inputs. Run the cycle five times. The upward stroke must execute every cycle.
  4. Online test with input forcing. Connect the laptop, enter Online Test mode. Force I1 (cycle start) and verify that the program state is identical to a manual start without input forcing. This guards against operators who use the test mode to bypass interlocks.
  5. E-stop recovery. Trip the E-stop during a cycle, reset it, and restart the cycle. The upward stroke must execute correctly on the first cycle after reset.
  6. Power brown-out simulation. Briefly pull the LOGO! supply below the brown-out threshold (typically 18 V DC for the 24 V variant) and restore. The controller should restart cleanly and the cycle should execute.

Document each verification with the LOGO! Soft Comfort project version, firmware version of the base module, and the date. This forms the commissioning baseline for future troubleshooting.

9. Firmware and Software Considerations

LOGO! base module firmware versions have introduced and removed features relevant to this fault class. The following table summarises the major changes.

Firmware Relevant Behaviour
0BA0 to 0BA5 Initial product line. M8 used as first-scan pulse. No Keep-flag persistence for analog flags.
0BA6 / 0BA7 Keep-flag persistence added to analog timers and counters.
0BA8 (LOGO! 8) New editor, Ethernet port, web server. First-scan pulse renamed and behaviour clarified. Retentive settings accessible per block in the editor.
8.2 and later Improved online handshake; STOP-RUN transition on connect can be disabled in some configurations.
8.3 / 8.4 Program transfer optimisations; reduced instances of forced cold restart on online connect.

If the saw is running on an early LOGO! 8 base with firmware below 8.2, consider an upgrade to the latest firmware as part of the corrective action. The upgrade is performed through LOGO! Soft Comfort and requires the project to be re-transferred. Confirm the firmware upgrade notes on the Siemens Industry Online Support portal before proceeding.

10. Prevention Best Practices

  • Configure all cycle-state flags as retentive where the state must persist across cold restarts.
  • Avoid relying on edge-triggered blocks (RE, FE) for safety-critical or cycle-critical functions unless the upstream input is guaranteed to transition.
  • Add a watchdog output to a LOGO! display or HMI that indicates "cold restart completed," and require operator acknowledgement before the first cycle.
  • Standardise on the Siemens LOGO! USB PC cable (6ED1057-1AA00-0BA0) and label it "Data, not Charge."
  • Maintain a revision-controlled .lsc file for every LOGO! deployment, with a comment block recording the firmware version and the date.
  • Train operators to start the saw in normal mode rather than Online Test, and to disconnect the laptop only after the cycle has completed.
  • When the saw is upgraded or the program is edited, run all six verification steps in Section 8 before returning the machine to production.

11. Related Documentation

Why does my Siemens LOGO! saw work only when a laptop is connected?

Connecting LOGO! Soft Comfort in online mode forces the base module through a STOP-RUN transition, which is a cold restart that clears all non-retentive flags, counters, and timers. If your program depends on an edge-triggered block or a flag that is not configured as retentive, the missing cold-start event changes program behaviour. The laptop is masking a sequencing bug in the program, not fixing it.

What is the difference between Online mode and Online Test mode in LOGO! Soft Comfort?

Online mode is passive monitoring: you view inputs, outputs, flags, and block values without affecting execution. Online Test mode lets you force inputs and outputs, change parameter values, and simulate field conditions. Online Test mode is the only mode that can directly alter program flow.

How do I make a flag retentive in LOGO! Soft Comfort?

Right-click the flag block in the program, open Block Properties, and enable the Retentive (Keep) checkbox. The flag will then retain its value across power cycles and STOP-RUN transitions. Apply retentive settings only to flags that semantically represent persistent state.

What does Code 45 in Windows Device Manager mean for a LOGO! connection?

Code 45 indicates that the operating system can see the device node but the hardware is not currently connected or is not responding. For a LOGO! USB link this usually points to a charge-only cable, a failed driver, or a USB selective suspend issue. It does not change the LOGO! program flow, but it confirms the data path between laptop and base is unreliable.

Which LOGO! firmware version should I run to minimise cold-start issues?

LOGO! 8 base modules with firmware 8.2 or later have improved online handshake behaviour and fewer forced cold restarts on connect. Upgrade through LOGO! Soft Comfort after confirming compatibility with the project on the Siemens Industry Online Support portal.

Back to blog