WinCC Flexible Scheduler: Change Directory Name for PC Runtime

David Krause17 min read
SiemensTutorial / How-toWinCC
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

WinCC Flexible Scheduler: Changing the Directory Name Field for PC Runtime

When a WinCC flexible project is built against a Multipanel target (for example an MP 377 19" Touch), the Scheduler's "Directory Name" field on an ArchiveLogFile action is locked to a fixed list of panel storage tokens. The most common symptom is the field defaulting to Storage Card MMC and refusing to accept a Windows path such as C:\Export\Logs. The root cause is the device type, not the Scheduler: changing the field requires re-targeting the project to WinCC flexible PC Runtime and editing the project with a WinCC flexible Advanced Engineering license. This reference walks through the exact procedure, the license model, the storage token mapping, string-tag binding, and the field verification steps that confirm a successful deployment. Background material is available from the Siemens Industry Online Support portal and the WinCC flexible 2008 manual set.

1. Problem Description and Symptoms

The Scheduler in WinCC flexible 2008 and later exposes a configurable list of jobs. Each job is bound to a trigger (Time, Event, or Hotkey) and a single action. The action Run ArchiveLogFile writes the contents of the active log archive to a file in a directory. The dialog exposes a Directory Name field that the engineer expects to type a Windows path into.

When the project device is a Multipanel (MP 277, MP 377, Mobile Panel 277, or any Comfort Panel from the same generation), the field is rendered as a read-only drop-down populated with three tokens:

  • Storage Card MMC – the panel's internal SD card slot
  • Storage Card USB – the panel's external USB port
  • Network Path – a UNC path validated against the panel's network configuration

Typing C:\Export into the field is silently rejected. The drop-down does not contain a Windows path option and the text box does not accept arbitrary input. The dialog behaves the same way regardless of the Storage Path setting in the project, the log-tag configuration, or the Runtime version installed on the panel.

Engineers who have selected an MP 377 19" as the device type in the project to lock in the 19" resolution will see the exact same behavior, because the device type is still classified as a Multipanel by WinCC flexible regardless of the screen size. The choice of an MP device is therefore not a way to obtain a free-form directory path; the path layer is bound to the device family, not the panel's resolution.

2. Root Cause: Device Type Drives the Storage Model

The "Directory Name" field is not a free-form input box. It is a typed enumerator that is populated from the device's storage layer at the moment the project is loaded into the engineering client. The storage layer for Multipanel-class devices is a thin abstraction over the WinCE file system and the panel's external interfaces. It does not know about Windows drive letters.

WinCC flexible PC Runtime targets use the full Windows file system as their storage layer. When the device is re-targeted to PC Runtime, the field's enum is rebuilt against the new layer and becomes an editable Windows path string. No recompile or rebuild is required to expose the field; the field changes the moment the device type changes in the project tree.

The second gatekeeper is the engineering license. The device catalog entry PC Systems > WinCC flexible PC Runtime is licensed by the WinCC flexible Advanced tier. WinCC flexible Standard and Compact licenses do not show PC Runtime in the device catalog, and a project opened with those licenses cannot be saved with a PC Runtime target. Runtime licenses are independent: a WinCC flexible Runtime 2048 license is sufficient to run a project on a PC, but the engineering side requires Advanced. License activation is performed through the Automation License Manager.

3. Prerequisites

Before changing the device type, confirm the following are in place on the engineering station and on the target Runtime PC:

  1. WinCC flexible 2008 SP5 or later. Earlier service packs predate the modern Scheduler dialog. SP5 is the lowest version that exposes the current job editor. SP3 and SP4 customers must upgrade the engineering software first; the project format is forward-compatible across SP5 and later. The current SP is documented in the SIOS entry "WinCC flexible 2008 SP updates".
  2. WinCC flexible Advanced license. Engineering license, not a Runtime license. The license is a floating or node-locked USB dongle, or (from 2008 SP2 onward) a License Key file activated through the Automation License Manager. Compact and Standard engineering licenses do not allow the project to be saved with a PC Runtime target.
  3. WinCC flexible Runtime license sized for the target. A 2048 PowerTag Runtime is the minimum for non-redundant installations; larger projects require 8192 or 65536 PowerTag tiers. The Runtime license is bound to the target PC's hardware or to a network license server.
  4. A project node for PC Runtime in the project tree. The PC Runtime node is added automatically when the device type is changed; it appears as a sibling of the original panel device.
  5. Windows administrator rights on the target Runtime PC to install the Runtime, configure the service account, and create the destination directory.
  6. A writable destination directory such as C:\Export\Logs. The directory must exist; the Scheduler does not auto-create folders at job start.
  7. Network share access if the path is a UNC. The Runtime service account must have write permission on the share and the NTFS file system.
License tier details: WinCC flexible Compact supports only Micro Panels and Basic Panels. WinCC flexible Standard adds support for the Multipanel and Comfort Panel families. WinCC flexible Advanced is the only tier that exposes the PC Runtime catalog and the network/OPC features. Mixing licenses on the same project is not supported; opening an Advanced project with a Standard license hides the PC Runtime node but does not delete it, and a subsequent save fails with error W7xF "License insufficient for active device".

4. Re-Targeting the Project to PC Runtime

The project must be re-targeted before the "Directory Name" field becomes editable. Follow the procedure below on the engineering station.

4.1 Open the Project and Verify the Current Device

  1. Launch WinCC flexible from the Start menu or the SIMATIC Manager if the project is integrated.
  2. Open the project.
  3. Confirm the active device by reading the device node label in the project tree (for example MP 377 19" Touch).
  4. Open Project > Device Integration and note the current resolution. Write it down; you will need it when selecting the PC Runtime template.

4.2 Change the Device Type

  1. Right-click the device node in the project tree and select Change Device Type.
  2. The device catalog opens on the left. Navigate to PC Systems > WinCC flexible PC Runtime.
  3. Select the template that matches the resolution of the original panel. WinCC flexible 2008 ships with templates for 800x600, 1024x768, 1280x1024, 1366x768, 1920x1080, and 1920x1200. The MP 377 19" is 1280x1024; the MP 377 15" Touch is 1024x768.
  4. Click OK to apply the device change.
  5. WinCC flexible prompts whether to keep screens, tags, alarms, and scripts. Accept the defaults if the existing project is the only project in the database. Reject the change if the project contains compiled code you want to preserve untouched.

4.3 Verify the Project Tree

After the change, the project tree should show a new node labeled with the chosen PC Runtime template. The Multipanel node is removed. Open Project > Properties on the new node and confirm:

  • Display resolution matches the original panel's resolution.
  • Runtime version matches the version installed on the target PC.
  • Color depth is 16-bit or 32-bit (PC Runtime does not support 8-bit).

5. Configuring the Scheduler Job and Directory Name

With the project now targeting PC Runtime, the Scheduler dialog exposes an editable Windows path. Use the following steps to create a job that writes the active log archive to C:\Export\Logs.

  1. In the project tree, expand the PC Runtime node and double-click Scheduler.
  2. The Scheduler editor opens with an empty job list. Click New Job to add a job.
  3. In the job properties pane, set a Name (for example DailyLogExport) and an optional Comment.
  4. Open the Trigger tab. Choose Time, Event, or Hotkey. For a daily 23:00 export, select Time, set the start time, and check Daily.
  5. Open the Action tab. From the action drop-down, select Run ArchiveLogFile.
  6. The action parameter group expands. The Log field lists every log defined under Logs in the project. Pick the log you want to export.
  7. The File Name field is editable. Enter a literal name or a string tag. Static names are common; the Scheduler appends a date stamp when the file is written if the field ends with the wildcard token *.
  8. The Directory Name field is now editable. Type the absolute Windows path. For a local SSD: C:\Export\Logs. For a NAS share: \\nas01\logs. For a mapped drive, the path is not portable and is not recommended; see the pitfalls section.
  9. Click Apply and OK to save the job.

If the project is being deployed to multiple sites with different share layouts, bind the Directory Name to a string tag. The tag can be set from the PLC, from a recipe, or from the operator at runtime, allowing the path to be changed without recompilation.

6. String-Tag Binding for the Directory Name

The Directory Name field accepts a tag reference as well as a literal string. The tag can be a Standard tag of type STRING or WSTRING, or an external tag tied to a PLC address. The internal tag is the most common pattern.

6.1 Declaring the Tag

  1. Open Project > Tags in the project tree.
  2. Add a new tag with the following properties:
    Property Value
    Name ArchivePath
    Data type WSTRING (Unicode path) or STRING (ANSI path)
    Length 255 characters
    Acquisition Cyclic, 1 s, or On Change
    PLC connection Internal tag (no PLC)
    Initial value C:\Export\Logs
  3. Save the tag table.

6.2 Binding the Tag to the Scheduler

  1. Return to the Scheduler job and open the action parameters.
  2. Click the small tag icon next to the Directory Name field. The tag browser opens.
  3. Select ArchivePath and confirm. The Directory Name field now shows the tag name in curly braces, e.g. {ArchivePath}.
  4. Compile the project.

6.3 Updating the Path at Runtime

The operator can update the path by writing to the tag from a screen, a script, or the PLC. The Scheduler evaluates the tag at the moment the job trigger fires. Jobs already in progress at the moment of a tag change continue with the path they captured at trigger time. This behavior is intentional and matches the WinCC flexible VBScript model of point-in-time resolution.

Path validation is not performed by the Scheduler. If the tag holds a path that does not exist or is not writable, the Scheduler silently fails the job and writes a Scheduler: cannot open directory entry to the diagnostics log. Always pre-validate the path on the Runtime PC before relying on a tag-driven directory.

7. PC Runtime vs Multipanel Storage Comparison

Feature Multipanel (MP 277 / MP 377) WinCC flexible PC Runtime
Directory Name field Locked to MMC / USB / UNC tokens Editable Windows path string
Engineering license Standard or higher Advanced only
Runtime license Panel-specific (no separate license) 2048 / 8192 / 65536 PowerTag Runtime
File system WinCE 6.0 with limited NTFS emulation Full NTFS / ReFS
Path length Max 256 characters including tokens Up to 32 767 characters (Windows limit)
UNC paths Yes, with panel network configuration Yes, native SMB stack
Mapped drive support No No (mapped drives are user-session-only)
Special folders Not supported CSIDL / KNOWNFOLDERID resolved by Runtime
Service account Panel OS user (Autostart user) Local System or designated service account
Concurrent writers Single process Multi-process; external apps can write to the same path

8. Verification Procedure

After compiling and transferring the project, verify the Scheduler job on the Runtime PC. The procedure below runs the job manually and confirms that the file is written to the configured directory.

  1. Start the WinCC flexible Runtime on the target PC. The Runtime starts as a service or as a foreground application depending on how it was installed.
  2. Open the Runtime diagnostics view. The path is Start > SIMATIC > WinCC flexible Runtime > Diagnostics, or in the System Tray right-click the Runtime icon and pick Diagnostics.
  3. Open the Scheduler runtime view. The view is reachable from the configured start screen, or from System > Scheduler if the system screens are enabled.
  4. Locate the job DailyLogExport in the list. Right-click and select Run once. The job runs immediately, ignoring its trigger configuration.
  5. On the target PC, navigate to C:\Export\Logs in Windows Explorer. Confirm that a file with the configured name and a timestamped extension is present. For a log named AlarmLog exported with file name AlarmExport, the file is AlarmExport_YYYYMMDD_HHMMSS.csv.
  6. Open the file in Notepad or Excel. Confirm the contents match the active log archive: the header row, the column delimiters, and the row count.
  7. Return to the diagnostics view. Open the Scheduler log. Look for the entry Job DailyLogExport executed successfully. If the entry is absent, see the troubleshooting section.

For unattended verification over a 24-hour period, set the job to run every minute, leave the Runtime running, and confirm that 1440 files are written (or 1440 entries in the Scheduler log) the next day. Then restore the original trigger schedule.

9. Diagnostics and Scheduler Event Codes

The Scheduler writes structured events to the Runtime diagnostics log. The most common events for ArchiveLogFile actions are:

Event Meaning Common Cause
Job started The job trigger fired and the action is running Normal
Action executed The Run ArchiveLogFile action completed Normal
Cannot open directory The directory does not exist or is not accessible Wrong path, missing share, ACL
Cannot create file The directory is writable but file creation failed Read-only volume, disk full, file in use
Log not found The configured log is not registered with the Runtime Log deleted from project after transfer
Tag read error The bound tag returned an error code PLC disconnected, tag length exceeded
Job disabled The job is currently disabled in the Scheduler view Operator disabled the job

For a deeper investigation, enable the Scheduler's verbose diagnostics by setting the registry key HKLM\SOFTWARE\Siemens\WinCC flexible\Scheduler\LogLevel = 3 on the Runtime PC. A value of 0 disables logging, 1 logs normal events, 2 logs warnings, 3 logs every action start and end. The log file is written to %ProgramData%\Siemens\WinCC flexible\Scheduler.log.

10. Common Pitfalls and Field-Proven Caveats

10.1 Field Appears Editable but Writes Are Rejected

Symptom: the Directory Name field accepts a Windows path, but after compile and transfer, the Runtime still writes to the MMC. Cause: the project was compiled against a Multipanel target because the engineer clicked the wrong device node before compiling. Always check the device node label in the project tree header before each compile. The compiled RT file is named after the active device, and a Multipanel RT file running on a PC produces no output at all.

10.2 Mapped Drive Paths

A path such as Z:\Logs works for the interactive Windows user who mapped the drive, but fails when the Runtime is running as a service under a different account. The Scheduler cannot resolve mapped drives in a service context. Use UNC paths exclusively, or resolve the drive to a UNC path with a startup script.

10.3 Trailing Backslash

The Directory Name field accepts both C:\Export\Logs and C:\Export\Logs\. The trailing backslash is preserved in the binding but ignored by the underlying file API. Leave it off for cleanliness, leave it on for clarity in log files.

10.4 Auto-Creation of Folders

The Scheduler does not create the target folder. If the path is C:\Export\Logs\2024\Q4 and only C:\Export exists, the job fails with Cannot open directory. Pre-create the folder hierarchy, or use a startup script that calls FileSystemObject.CreateFolder before the Runtime starts.

10.5 Concurrent Scheduler Jobs Writing to the Same Directory

Two jobs writing to the same directory with the same file name will overwrite each other. Use unique file names per job, or use the wildcard token * in the file name to force a timestamp suffix. The wildcard is replaced with YYYYMMDD_HHMMSS at job start.

10.6 Migrating from TIA Portal

Engineers porting a WinCC flexible project into TIA Portal will find the Scheduler dialog is named Scheduled Tasks in WinCC (TIA Portal). The migration tool carries the project but not the Scheduler jobs; the jobs must be recreated manually. The field semantics (Windows path on PC Runtime, storage tokens on Unified Comfort Panel) are preserved. Refer to the SIOS migration guide for the supported field mapping.

10.7 8.3 Short File Name Pitfall

If the target directory contains legacy 8.3 short file names (typical on industrial PCs imaged from old FAT32 partitions), the file written by the Scheduler may be locked by the OS for several seconds after creation. Do not run a downstream process that opens the same file inside the same second; insert a 1 s wait in the calling script.

11. Service Account Configuration on the Runtime PC

The WinCC flexible Runtime is installed as a Windows service named CCFlexRuntime (default) under the Local System account by default. Local System has read access to the system drive and most mapped network shares, but lacks write access to user-profile folders and most UNC shares configured with user-level authentication. To allow the Scheduler to write to a UNC path:

  1. Create a dedicated Windows user, e.g. svc-runtime, with a strong password that does not expire.
  2. Grant the user write permission on the share and the NTFS folder.
  3. Open services.msc, find the WinCC flexible Runtime service, open Properties > Log On, switch from Local System to This account, and enter the service user credentials.
  4. Restart the service. The Scheduler now runs under the service account and can resolve the UNC path.
  5. Verify with runas /user:svc-runtime cmd.exe and a manual dir \\server\share before starting the Runtime.
Storing service-account passwords in clear text on the Runtime PC is a security risk. Use a Group Policy preference with a Protected Configuration password, or store the credentials in the Windows Credential Manager of the service account.

12. Step-by-Step Recap

  1. Confirm the project uses a WinCC flexible Advanced license.
  2. Re-target the device to PC Systems > WinCC flexible PC Runtime at the original resolution.
  3. Open the Scheduler editor on the PC Runtime node.
  4. Create a job with a Time, Event, or Hotkey trigger.
  5. Bind the Run ArchiveLogFile action.
  6. Type a Windows path into the Directory Name field, or bind a string tag.
  7. Pre-create the destination directory on the Runtime PC.
  8. Configure the Runtime service account to have write access to the directory or share.
  9. Compile the project and transfer the RT file to the Runtime PC.
  10. Run the job once from the Scheduler runtime view.
  11. Verify the file appears in the destination directory and the Scheduler log records success.

13. FAQ

Why is the Directory Name field locked to "Storage Card MMC" in my WinCC flexible project?

The field is bound to the active device's storage layer. Multipanel targets (MP 277, MP 377, Mobile Panel 277) expose only the MMC, USB, and UNC tokens. The field becomes editable when the project is re-targeted to WinCC flexible PC Runtime, which uses the full Windows file system. See section 2 for the device-type mapping.

Can I use a mapped drive like Z:\Logs as the Directory Name?

No. Mapped drives are tied to the interactive user session, but the Runtime runs as a service. The Scheduler cannot resolve the drive letter in a service context. Use a UNC path such as \\server\share\Logs and grant the Runtime service account write permission on the share, as described in section 11.

Which license do I need to edit the Directory Name field?

WinCC flexible Advanced. The PC Runtime catalog is licensed by the Advanced tier. Compact and Standard licenses hide the PC Runtime node and lock the field to panel storage tokens. See section 3 for the license tier table.

How do I change the directory at runtime without recompiling?

Bind the Directory Name to a string tag (WSTRING, 255 chars). Update the tag from the PLC, a recipe, or an HMI screen. The Scheduler evaluates the tag at trigger time and writes the file to the new path on the next job tick. See section 6 for the tag declaration and binding procedure.

What does "Cannot open directory" mean in the Scheduler log?

The directory does not exist, the Runtime service account lacks read or traverse permission, or the path string is malformed. Pre-create the directory, validate the UNC path, and confirm the service account has access. Enable verbose Scheduler logging via the registry key HKLM\SOFTWARE\Siemens\WinCC flexible\Scheduler\LogLevel = 3 for full diagnostics. The full event-code mapping is in section 9.

Does the Scheduler auto-create subfolders like 2024\Q4\November under the configured directory?

No. The Scheduler does not create folders. If the path includes subfolders that do not yet exist, the job fails with Cannot open directory. Pre-create the folder hierarchy, or run a VBScript on Runtime start that calls FileSystemObject.CreateFolder for the desired path before the Scheduler fires.

Back to blog