Configuring SQL Database Archiving in SIMATIC BATCH and Resolving Directory Empty String Errors

Configuring SQL Database Archiving in SIMATIC BATCH and Resolving Directory Empty String Errors

In SIMATIC BATCH (V8.1 through V9.1), configuring automatic batch archiving to a Microsoft SQL Server database requires creating a valid SQL database container in the Batch Control Center (BatchCC) Project Settings. If manual or automatic archiving aborts with the error 'Directory: No empty strings permitted', the storage directory path for the SQL database files (.mdf and .ldf) was left blank during database initialization. To resolve this, specify a valid local or network NTFS directory in the SQL database creation dialog and confirm that the SQL Server master database credentials have administrative rights.

Table of Contents

Executive Summary

Regulatory compliance standards such as FDA 21 CFR Part 11 and GMP guidelines require industrial batch processes to retain immutable electronic batch records (EBR). In SIMATIC BATCH, completed batches can be archived to external media or directly into dedicated Microsoft SQL Server databases for long-term historical analysis and enterprise reporting.

When commissioning SQL archiving in BatchCC, automation engineers frequently select the 'Archive automatically' radio button, only to find that closed batches remain stuck in the local runtime database. Attempting a manual archive triggers the dialog error: Directory: No empty strings permitted. This abort occurs because the BatchCC archive manager cannot create the target database files without an explicit absolute file system path. This guide provides the complete engineering procedure to establish SQL archive databases, eliminate directory path errors, and automate batch archiving.

Architecture and Fundamental Mechanics

The SIMATIC BATCH archiving engine utilizes Microsoft SQL Server to store structured batch execution records (recipe headers, phase transitions, operator interventions, alarms, and measured process values):

  1. Archive Architecture: While active batches execute within the primary SIMATIC BATCH database (SBDatabase), completed and closed batches are offloaded to an archive database (e.g., SimaticBatch_Archive) to maintain high runtime transaction performance.

  2. SQL Database Initialization: Unlike standard file-based archives (*.sbx), SQL database archiving requires BatchCC to issue SQL DDL scripts (CREATE DATABASE ... ON PRIMARY ...) to the local or remote SQL Server instance. This command requires two core parameters:
    - Database Name: The logical identifier inside SQL Server (e.g., SimaticBatch).
    - Physical Storage Directory: The absolute folder path where SQL Server allocates the primary data file (.mdf) and transaction log file (.ldf).

  3. The 'Directory: No empty strings permitted' Exception: In the BatchCC 'Create SQL Server Database' dialog, the directory input field defaults to an empty string. If an engineer clicks 'OK' without using the folder browser to designate a physical storage folder, BatchCC rejects the operation with Directory: No empty strings permitted. Furthermore, the Windows account executing the SQL Server service (NT SERVICE\MSSQL$<Instance> or local system) must possess full write permissions to the specified folder.

Step-by-Step Implementation Procedure

Follow these steps to configure SQL database archiving and resolve directory path errors in SIMATIC BATCH:

  1. Create the Storage Folder for SQL Archive Files:
    - On the Batch Server PC (or dedicated SQL Server), open Windows Explorer.
    - Create a dedicated directory on an NTFS volume with sufficient storage capacity (e.g., D:\Batch_Archives\SQL_Data).
    - Right-click the folder, select 'Properties > Security', and ensure the Administrators, SIMATIC BATCH, and SQLServerMSSQLUser groups have 'Full control'.

  2. Configure Archive Settings in Batch Control Center (BatchCC):
    - Launch BatchCC with administrative privileges.
    - In the main menu, select 'Options > Settings' (or right-click the project root node and select 'Project Settings...').
    - In the settings tree, navigate to 'Archives'.
    - In the 'Format' selection group, select the radio button 'SQL Server'.

  3. Create the SQL Archive Database:
    - Click the 'Create...' button adjacent to the database selection field.
    - In the 'Create SQL Server Database' dialog:

    • Enter the logical Database Name: e.g., SimaticBatch_Archive.
    • In the 'Directory' field, do NOT leave the box blank. Click 'Browse' (or type the path) and select the designated physical folder created in Step 1: D:\Batch_Archives\SQL_Data.
    • Under 'SQL Server Login', select the target SQL instance (typically .\WINCC or the dedicated Batch SQL instance).
    • Connect using Windows Authentication or enter SQL administrative credentials (sa or authorized account).
    • Ensure the master database is selected as the initial connection endpoint.
    • Click 'OK'. BatchCC connects to SQL Server and creates the database files.
    • Confirm the success dialog: 'Database was successfully created.'
  4. Configure Automatic Archiving Triggers:
    - In the BatchCC 'Archives' settings tab, check the box 'Archive automatically'.
    - Select the desired archiving trigger: 'After batch closure' or 'After batch approval'.
    - (Optional) Configure automatic deletion of local batches after successful archiving to conserve runtime database space.
    - Click 'Apply' and 'OK'.

  5. Verify Service Operation:
    - In Windows Services (services.msc), ensure the service SIMATIC BATCH CDV (Communication and Distribution Variable service) is running.

Verification

  1. In BatchCC, locate a closed batch in the batch tree.
  2. Right-click the closed batch and select 'Archive'. Confirm that the operation finishes with status 'Archived' and no empty string errors appear.
  3. Open SQL Server Management Studio (SSMS) on the server, connect to the SQL instance, expand 'Databases', and verify that SimaticBatch_Archive exists.
  4. Expand tables within SimaticBatch_Archive and query the batch header table: confirm that the archived batch ID, start time, end time, and recipe name are present.
  5. Run a new batch to completion: confirm that BatchCC automatically transitions the batch to 'Archived' status upon closure.

Limitations and Operational Precautions

Ensure that the drive hosting the SQL archive database is backed up regularly and has adequate disk space monitoring; if the storage volume fills up, SQL Server will mark the archive database as read-only or suspended, blocking subsequent batch archiving. SQL archive databases created by SIMATIC BATCH cannot be modified directly via third-party SQL scripts without risking data integrity. Hardware, storage, and software licensing must be verified through an authorized Siemens distributor or the Siemens Industry Mall.

Engineer FAQ

What causes the error 'Directory: No empty strings permitted'?

The error occurs because the physical storage directory field was left blank when creating the SQL Server database in BatchCC Project Settings.

Can I archive batches to a remote SQL Server on another PC?

Yes. Specify the remote computer name and SQL instance in the SQL Server Login dialog, and ensure the target SQL Server is configured to accept remote TCP/IP connections on port 1433.

What is the difference between file archiving (*.sbx) and SQL archiving?

File archiving exports individual batches into proprietary compressed .sbx files. SQL archiving writes batches into structured SQL database tables, enabling SQL queries, reporting tools, and enterprise MES integration.

Does SQL batch archiving consume extra SIMATIC BATCH licenses?

No. The ability to archive to SQL Server is an integrated capability of SIMATIC BATCH Server and does not require additional PO or client licenses.

Can an archived batch be restored back into BatchCC?

Yes. In BatchCC, select 'Archive > Restore' to reload an archived batch from the SQL database back into the active BatchCC browser for detailed review.

Technical References

Related Articles

Related Tags

  • SIMATIC BATCH
  • BatchCC
  • SQL Server
  • Archiving
  • Directory Error
  • PCS 7 V9.1
20 respuestas