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
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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):
-
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. -
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). -
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:
-
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 theAdministrators,SIMATIC BATCH, andSQLServerMSSQLUsergroups have 'Full control'. -
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'. -
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
.\WINCCor the dedicated Batch SQL instance). - Connect using Windows Authentication or enter SQL administrative credentials (
saor 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.'
- Enter the logical Database Name: e.g.,
-
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'. -
Verify Service Operation:
- In Windows Services (services.msc), ensure the serviceSIMATIC BATCH CDV(Communication and Distribution Variable service) is running.
Verification
- In BatchCC, locate a closed batch in the batch tree.
- Right-click the closed batch and select 'Archive'. Confirm that the operation finishes with status 'Archived' and no empty string errors appear.
- Open SQL Server Management Studio (SSMS) on the server, connect to the SQL instance, expand 'Databases', and verify that
SimaticBatch_Archiveexists. - Expand tables within
SimaticBatch_Archiveand query the batch header table: confirm that the archived batch ID, start time, end time, and recipe name are present. - 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
- SIMATIC Process Control System PCS 7 SIMATIC BATCH (V8.1 / V9.0 / V9.1) Manual
- SIMATIC BATCH Electronic Batch Recording and Archiving Guide
- Siemens Industry Online Support FAQ 109740190 - Archiving Batches in SIMATIC BATCH
Related Articles
- Unit allocation based on a header parameter in BatchCC
- Configuring Process Parameters for Conditional Unit Allocation in SIMATIC BATCH
- Dynamic Unit Allocation Based on Recipe Header Parameters in SIMATIC BATCH
Related Tags
- SIMATIC BATCH
- BatchCC
- SQL Server
- Archiving
- Directory Error
- PCS 7 V9.1