Problem Description
On SINUMERIK 840D sl controllers running SINUMERIK Operate, operators and programmers intermittently encounter the message "Selected file is in use by other application" when attempting to open a part program from the Program Manager or via the Program soft key. The file cannot be opened for edit, view, simulation, or execution; the HMI returns the message and forces the user to navigate to a different program to continue work.
The condition locks the part program (.MPF, .SPF, and in some cases .TOA, .UFA, .INI) at the NCK file-system level or at the HMI selection-pointer level, even though no editor instance is visible. The symptom is sometimes channel-scoped (Channel 1 affected, Channel 2 unaffected) and frequently appears immediately after a software upgrade, a backup restore, or a controller retrofit. The workaround (open another program, return, try again) is fragile and masks the underlying state; in production cells it can shift work between channels in an uncontrolled way.
Affected Systems and Versions
| Component | Affected versions / configurations |
|---|---|
| NCU | NCU 710.3 / 720.3 / 730.3 with SINUMERIK Operate on the NCU (internal HMI active) |
| Operator panel | PCU 50.5 (Windows XP Embedded or Windows 10 IoT) or TCU with thin-client firmware |
| Software baseline | CNC-SW 2.6 SP1, 2.6 SP1 HF1, 4.4, 4.5, 4.7, 4.8 (any build with both internal and external HMI enabled) |
| Channel scope | Channel 1, Channel 2, or all channels depending on the file-lock origin |
| File types |
.MPF (main programs), .SPF (subprograms), .TOA (tool offsets), .UFA (user frames), .INI (initialization) |
| File storage | NCU compact flash card, partitions /card/user, /card/oem, /card/active, /card/commissioning
|
Reference: SINUMERIK 840D sl CNC Software 2.6 SP1 HF1 - Release Notes / Support (NCU_operate_26_SP1_HF1_76.pdf).
Root Cause Analysis
There are three independent root causes that produce the same "file in use" string. Each must be ruled out before a final fix is applied. The diagnostic order matters: start with the topology check, then the channel-pointer check, then the file-system check.
Cause 1: Internal HMI on the NCU is enabled while a PCU 50 is the active operator station
If the controller is delivered with a PCU 50.5 (Solution Line) acting as the operator panel, the NCU's internal SINUMERIK Operate must be disabled. The internal instance still holds the file handle on the active part program even though no UI is shown. The external HMI therefore sees a "file in use" lock from a process it cannot see. This is the dominant cause on retrofit machines, on cells converted from TCU-only to PCU 50 operation, and on cells where an old PCU 50.3 has been replaced with a PCU 50.5 without re-commissioning the HMI service.
Cause 2: Channel-scoped program lock from the active workpiece program
When a part program is selected as the active workpiece program of a channel (by HMI or by PLC via FB4 ProgToolChange / FC9 Channel), the NCK sets a per-channel selection pointer. The Program Manager in SINUMERIK Operate refuses to open a file for editing if the file is currently the active program of the same channel. This is intentional and prevents the operator from editing a program that the NCK is interpreting, but the message text is generic and does not mention the channel. The "Channel 1 only" symptom reported on the field is the strongest indicator of this cause.
Cause 3: Stale lock files after upgrade, restore, or abrupt power-down
Hot restore from a CF-card backup, an SW-update to 2.6 SP1 HF1, or a hard power-down (NCK reset instead of a full power off / on) can leave orphaned lock markers in /MPF.DIR, /SPF.DIR, or /CMA.DIR on the NCU compact flash. The HMI uses read-only attributes and small *.lock sidecar files as lock markers; these are not always cleaned up by the boot sequence, so the file is permanently marked as in use until the attribute is cleared or the lock file is removed.
Diagnostic Workflow
- Identify the HMI topology: does the operator panel connect via a PCU 50 or directly via a TCU to the NCU? Check the network port: PCU 50 typically uses X120 / X130, TCU uses X120 on the NCU.
- Open SINUMERIK Operate > Commissioning > HMI > Version. Note whether the internal and external HMI both report "Active". Both being active on a PCU 50 system is the diagnostic signature of Cause 1.
- From a service laptop running WinSCP, log in to the NCU as user
manufactand inspect/card/user/sinumerik/hmifor stray service entries. On the PCU 50, open a command prompt and runsc query hmiagainst the NCU to confirm the HMI service state. - Try opening the same program from the second channel's Program Manager. If it opens there, Cause 2 (channel-scoped lock) is the dominant factor and the fix is local to Channel 1.
- Check
manMachineDate/manMachineTimein the diagnostic log to confirm whether the controller was powered down or only reset. An NCK reset only restarts the NCK software; it does not clear HMI service state on the NCU compact flash. - Capture the
hmicomp.logfrom/card/user/sinumerik/hmi/logfor Siemens support if Cause 3 is suspected. Cross-reference any "file lock conflict" entries with the timestamp of the upgrade event. - Verify machine data: read
MD9030 $ON_LINE_HMI,MD9032 $HMI_LOCK, andMD9013 $MM_HMI_DEMO_FILE_ACCESSagainst the actual operator-panel topology. Mismatches here are the root cause of the symptom on most upgraded cells.
Solution A: Disable the Internal HMI (PCU 50 conflict)
This is the corrective action for Cause 1. The internal SINUMERIK Operate on the NCU is stopped and disabled from auto-start. The external HMI on the PCU 50 takes over as the only operator panel.
Prerequisites
- PCU 50.5 with administrator password for Windows (default
SUNRISEfor theManufactuser; changed on commissioning). - WinSCP or PuTTY installed on the PCU 50 desktop or on a service laptop on the same network as the NCU.
- Service login for the NCU: user
manufact, password per commissioning record (defaultSUNRISEon a virgin controller). - Network reachability between the PCU 50 (or service laptop) and the NCU on port 22 (SFTP) and port 23 (Telnet, if enabled).
Step-by-step procedure
- On the PCU 50, launch WinSCP. New Site: file protocol SFTP, host name IP-of-NCU (default
192.168.214.1for X120), port 22, usermanufact, password as per the commissioning record. - Once connected, click Commands > Open Terminal (or use PuTTY to SSH to the NCU IP, port 22).
- At the shell prompt, run the service-control command:
sc disable hmi - Wait for the confirmation message "Service hmi disabled".
- Verify the new state with
sc query hmi; the service state should report DISABLED instead of RUNNING. - Close the terminal, close WinSCP.
- Perform a full power-down of the controller: NCU power off, PCU 50 power off, mains isolator off, wait a minimum of 30 seconds, then restore power. An NCK reset alone is not sufficient for this change; the Windows-side service database must be re-read.
- On the PCU 50, observe that SINUMERIK Operate on the PCU takes over the operator panel and that the internal HMI on the NCU is no longer reachable at
https://192.168.214.1.
sc disable hmi on a TCU-only system removes the only HMI and the controller becomes inoperable from the panel. Always confirm the topology (PCU 50 vs TCU) before issuing the command. On TCU-only systems the internal HMI must remain enabled. If in doubt, use sc query hmi to read the state before changing it.Solution B: Clear the Channel-Scoped Program Selection (Cause 2)
The "Channel 1 only" symptom is almost always a per-channel selection pointer, not a file-system lock. The fix is local to the affected channel and does not require any NCU-level intervention.
- Press the Program soft key, then Program Manager, on the affected channel.
- Look at the top of the program list: a highlighted row with a small green check icon marks the currently selected program. Long-press (touch) or right-click (mouse) and choose Close / Deselect to release the pointer.
- Alternative: switch to AUTO or JOG mode and press the channel RESET button. This clears the active program pointer without deleting the file. Use this method on cells with no mouse / no touch.
- If the operator is unsure which file is the active one, navigate to Commissioning > Channel > Status and read the Selected program field. The same information is also exposed in the PLC interface via the channel-DB and the HMI-PLC interface.
- Re-attempt to open the previously blocked program. The "in use" message should be gone immediately after the channel RESET, with no further action required.
PLC-side reference
For automated cells, the program selection is typically driven by the PLC using FB4 ProgToolChange or by the NCK's PIC (Program Inventory Control) interface. After a program is selected via FB4, the corresponding selection block remains active until the channel is reset or the program is closed explicitly by the PLC. Ensure that the PLC issues a CHANNEL_RESET (or a Reset on the channel DB) at end of cycle to release the pointer, otherwise the same file is locked at the start of the next cycle and the operator's manual edit is blocked.
Channel DB layout (S7-1500 / S7-1200 with SINUMERIK PLC)
| Offset | Symbol | Meaning |
|---|---|---|
| DBB 0 | CHAN_STATE | Channel state (reset, active, interrupted) |
| DBB 1 | CHAN_ACTIVE_PROG | Active program index, mirrored in PIC |
| DBB 4..6 | CHAN_PROG_NAME | ASCII name of the active program |
| DBX 30.0 | CHAN_RESET_REQ | Set by PLC to request a channel reset |
Solution C: Remove Stale Lock Files from the NCU CF (Cause 3)
If the symptom appeared immediately after an SW upgrade to 2.6 SP1 HF1 or after a CF-card restore, perform the following from a WinSCP session on the NCU.
- Connect to the NCU via SFTP, user
manufact. - Navigate to
/card/user/sinumerik/hmi/prog/(the standard active-program directory) and to/card/oem/sinumerik/hmi/prog/for OEM-supplied programs. - For each
.MPFor.SPFthat is reported as in use, right-click and choose Properties. Clear the read-only attribute if it is set; on the HMI side, this is the lock marker. Save the change. - Also check
/card/oem/and/card/user/for stray*.lockor*.LCKsidecar files and delete them only after confirming they belong to no running process. A typical upgrade to 2.6 SP1 HF1 leaves one such lock per directory that was active at the time of the cut-over. - Repeat the check on the PCU 50's local
F:\hmi\progdirectory if the operator panel stores cached program copies there. - Power-cycle the NCU (full power off / on, 30 s minimum) and the PCU 50.
- Re-attempt the program-open operation on the affected channel.
/card/user/sinumerik/hmi/prog/ directory to a network share with WinSCP. The CF card on the NCU is the only non-volatile storage on the controller; a wrong delete forces a full commissioning of the affected part-program set, including any OEM-specific tool tables and frames.Verification
- From the operator panel, open the previously blocked program in the affected channel. The "file in use" message must not appear.
- Switch the channel to AUTO and execute the program with a safe dry-run block (e.g.
M0at the first movement, or a singleG0rapid in front of an open door with the safety chain closed). Confirm the NCK accepts the program as the active one and the channel shows Program running. - Open SINUMERIK Operate > Commissioning > HMI > Version. Verify that only one HMI instance is shown as "Active". On a PCU 50 system, only the external instance should be active; on a TCU system, only the internal instance.
- Re-trigger the original error path: power-cycle the controller, boot into the operator panel, and repeat the program-open attempt. The fix is durable only if it survives a power cycle.
- Capture the system diagnostics:
hmicomp.log,comm.log, and the lastdiagnosisarchive, and file them with the maintenance record for future reference. - Read the operator's maintenance log: confirm that the program edit was completed, that the channel RESET was issued at end of cycle (PLC path), and that no follow-on lock errors appeared in the next 24 h of production.
Preventive Measures
- Always commission HMI topology (internal HMI vs PCU 50 vs TCU) in the commissioning log, including the
sc query hmioutput before and after the change. - After any SW upgrade to 2.6 SP1 HF1 or later, run a full power-cycle, not an NCK reset. The service database on the NCU compact flash is read at full boot; an NCK reset leaves it untouched.
- Add a PLC-side block that issues a
CHANNEL_RESETat end of cycle so the active program pointer is released between workpieces. Combine this with a watchdog that checks the HMI's Selected program field at end of cycle and alarms if the pointer is not empty. - Document the WinSCP credentials and the
sc enable hmi/sc disable hmiprocedure in the machine's maintenance manual so service engineers do not need to rely on tribal knowledge. - Configure
MD9030 $ON_LINE_HMIconsistently with the actual operator-panel topology. An$ON_LINE_HMI = 1value forces the NCU to run the internal HMI even when a PCU 50 is present; this is the most common MD misconfiguration on retrofits. - Restrict operator privileges on the PCU 50 to the Operator Windows group; reserve the Manufact group for service engineers. The privilege boundary prevents accidental disabling of the internal HMI by an operator during a service window.
Related Issues and Error Codes
| Symptom / alarm | Likely cause | First action |
|---|---|---|
| "Selected file is in use by other application" - all channels | Internal HMI on NCU + PCU 50 conflict | Disable internal HMI with sc disable hmi; full power-cycle |
| "Selected file is in use by other application" - one channel only | Channel-scoped active program pointer | Channel RESET or deselect the program in the Program Manager |
| "Selected file is in use by other application" - after SW upgrade to 2.6 SP1 HF1 | Stale lock files on CF card | WinSCP: clear read-only attributes and remove stray *.lock files; power-cycle |
| Alarm 16962 "Channel %1 program %2 not in memory" | NCK memory reset during active program | Reload program; check $NC_USER_DATA_R size and persistence settings |
| Alarm 14011 "Channel %1 program %2 not selected" | No program selected in the channel | Select program in HMI or via PLC using FB4 |
| Alarm 14860 "Channel %1 program %2 already selected" | Same program selected in a second channel | Deselect in the other channel first, or use program selection in channel semantics |
| Alarm 12000 "Channel %1 program %2 inconsistent" | Program structure mismatch after a partial edit | Restore from backup; check hmicomp.log for the failed commit |
| HMI freezes on "Loading program list" | CF card I/O error or filesystem corruption | Run sc check cf from a service session; replace CF if errors persist |
State Machine: Program Lock Lifecycle
Field-Commissioning Checklist
| Step | Check | Acceptance |
|---|---|---|
| 1 | Identify HMI topology (PCU 50 vs TCU) | Recorded in commissioning log |
| 2 | Internal HMI state: sc query hmi
|
Matches topology (disabled if PCU 50, enabled if TCU) |
| 3 | Channel pointer: try to open every .MPF in each channel |
No "file in use" message on any channel |
| 4 | Read MD9030 $ON_LINE_HMI and MD9032 $HMI_LOCK
|
Values match the topology |
| 5 | Power-cycle test (full off / on, 30 s) | Symptom does not return after a power-cycle |
| 6 | Log hmicomp.log and comm.log to a network share |
Filed in maintenance record |
| 7 | Verify PLC end-of-cycle CHANNEL_RESET
|
Active program pointer is empty between cycles |
| 8 | Lock down WinSCP credentials and document procedure | Service engineers can reproduce the fix without escalation |
Safety and Operational Notes
- All program-edit operations on a running cell must be performed with the channel in RESET state and the safety chain closed. Editing a program that the NCK is actively interpreting is a hard rule, not a soft warning, on every 840D sl release.
- Disabling the internal HMI on the NCU is a one-way action until
sc enable hmiis re-issued. On a PCU 50 system, this is the correct state; on a TCU system, the controller becomes inoperable from the panel. Always confirm the topology before issuing the command. - The compact flash card on the NCU is the only non-volatile storage on the controller. A wrong delete forces a full commissioning of the affected part-program set, including any OEM-specific tool tables and frames. Always back up first.
- Channel RESET does not erase part programs. It only releases the active-program pointer. Use this as the first action on a "file in use" complaint, before opening WinSCP, before any service command, and before any power-cycle.
- Do not rely on the "open another program and back" workaround. It masks the underlying state, hides the cause from the maintenance log, and is not durable across a power-cycle.
Quick Reference: Commands and Paths
| Action | Command or path | Where |
|---|---|---|
| Read HMI service state | sc query hmi |
NCU shell, SFTP user manufact
|
| Disable internal HMI | sc disable hmi |
NCU shell, SFTP user manufact
|
| Re-enable internal HMI | sc enable hmi |
NCU shell, SFTP user manufact
|
| Standard active program dir | /card/user/sinumerik/hmi/prog/ |
NCU compact flash |
| OEM part programs | /card/oem/sinumerik/hmi/prog/ |
NCU compact flash |
| HMI log directory | /card/user/sinumerik/hmi/log/ |
NCU compact flash |
| Topology machine data |
MD9030 $ON_LINE_HMI, MD9032 $HMI_LOCK
|
Commissioning > Machine data |
| Channel reset from PLC | Set DBX30.0 CHAN_RESET_REQ in channel DB |
PLC program |
FAQ
Why does the error appear on Channel 1 only and not on Channel 2?
The "file in use" message is generic and does not mention the channel. The most common cause is a per-channel active program pointer: the file is the active workpiece program of Channel 1 and the HMI is configured to refuse edit on the active program. Issue a channel RESET on Channel 1 or deselect the program in the Program Manager; the lock is released without deleting the file.
Can I open the program with WinSCP while it is reported as in use?
Yes. WinSCP reads through the SFTP layer of the NCU, which is independent of the HMI's program-selection pointer. This is the recommended way to copy the program off the controller as a safety measure before any delete or attribute change. Always back up first; the NCU compact flash is the only non-volatile storage on the controller.
Is an NCK reset enough to clear the lock, or do I need a full power cycle?
For a per-channel selection pointer, an NCK reset is enough. For the internal-HMI / PCU 50 conflict (Cause 1) and for stale lock files from an SW upgrade (Cause 3), a full power cycle (NCU off, PCU off, mains off, 30 s, restore) is required. An NCK reset leaves the Windows-side service database and the CF card state untouched, so the lock returns on the next boot.
Does the fix apply to TCU-only systems with no PCU 50?
No. On TCU-only systems the NCU's internal SINUMERIK Operate is the only HMI; disabling it removes the only operator panel and the controller becomes inoperable from the panel. On TCU systems, focus on the channel pointer (Cause 2) and on stale lock files (Cause 3) instead. Confirm the topology with the X120 / X130 network port assignment before issuing any service command.
Which Siemens document covers this fix in detail?
The release notes for CNC-SW 2.6 SP1 HF1 (NCU_operate_26_SP1_HF1_76.pdf) describe the HMI service management commands sc enable hmi and sc disable hmi and the recommended power-cycle sequence. Cross-reference the SINUMERIK Operate (IM9) programming and operator-component manuals for the channel-selection semantics and the PLC interface layout.