Locating and Integrating SIMATIC BATCH COM API Libraries and Sample Applications in PCS 7

Locating and Integrating SIMATIC BATCH COM API Libraries and Sample Applications in PCS 7

In SIMATIC PCS 7 V9.0 and V9.0 SP1, the SIMATIC BATCH COM API dynamic link libraries (BatchAPI.dll and BatchObjects.dll) and type libraries are not standalone downloadable files; they are installed automatically on any system where the SIMATIC BATCH Server or SIMATIC BATCH Client software is installed, located in 'C:\Program Files (x86)\Siemens\BATCH\bin'. If developing an external .NET C# or C++ connector on a remote workstation that lacks SIMATIC BATCH, engineers must install the SIMATIC BATCH Client component or copy the required interop assemblies. Official reference code and project templates are provided in the Siemens Industry Online Support sample project 'Sample Application for SIMATIC BATCH COM API' (Entry ID 92344632), which remains forward-compatible from PCS 7 V8.2 through V9.1.

Table of Contents

Executive Summary

Integrating Manufacturing Execution Systems (MES), Laboratory Information Management Systems (LIMS), or custom scheduling portals with SIMATIC BATCH requires developing client applications using the SIMATIC BATCH COM API. Developers searching for the latest API binaries often struggle to locate standalone SDK installers, noting that public download portals only host the sample project (Entry ID 92344632) while local development environments lack the necessary .dll and .tlb files. This guide details the physical installation paths of the BATCH API, explains how to configure development workstations, and outlines the correct method to consume the COM type libraries in modern Visual Studio solutions.

Architecture and Fundamental Mechanics

The development and runtime architecture of the SIMATIC BATCH API encompasses specific COM registration and deployment rules:
1. Installation Footprint and Component Distribution:
- The COM API binaries are bundled exclusively within the SIMATIC BATCH software media.
- Installing SIMATIC BATCH Client or SIMATIC BATCH Server deploys the core COM servers into:
C:\Program Files (x86)\Siemens\BATCH\bin
- Key COM server files include:
a. BatchAPI.dll: Core API methods for server connection, recipe manipulation, and batch execution.
b. BatchObjects.dll: Data structures representing batches, units, phases, and parameters.
c. BatchAPI.tlb: Type library defining COM interfaces (ISimaticBatchServer, ISimaticBatchRecipe).
2. Consuming COM Libraries in Visual Studio:
- In modern .NET development (C# / VB.NET), adding a direct reference to BatchAPI.dll generates a Primary Interop Assembly (PIA) named Interop.BATCHAPILib.dll.
- Visual Studio embeds these interop types or compiles against the runtime callable wrapper (RCW).
3. Version Compatibility Across PCS 7 Releases:
- While the underlying COM server evolves between PCS 7 V8.2, V9.0, and V9.1, the public interface definitions remain backward-compatible.
- Sample applications written for V8.2 execute cleanly against V9.0/V9.1 runtimes provided the COM GUIDs match the registered versions.

Step-by-Step Implementation Procedure

  1. Deploy SIMATIC BATCH Client on Development PC:
    a. Insert or mount the SIMATIC PCS 7 V9.0 / V9.1 installation media.
    b. Run Setup.exe and select 'Custom installation'.
    c. In the package selection tree, select SIMATIC BATCH -> BATCH Client.
    d. Complete installation to ensure that BatchAPI.dll and COM registration entries are properly written to the Windows Registry (HKEY_CLASSES_ROOT\TypeLib).

  2. Download Official Siemens BATCH API Sample Application:
    a. Access Siemens Industry Online Support (SIOS).
    b. Search for Entry ID 92344632 ('Sample Application for SIMATIC BATCH COM API').
    c. Download the compressed archive containing Visual Studio sample code (C# and C++ implementations).

  3. Configure C# Visual Studio Project References:
    a. Open Visual Studio as Administrator.
    b. Open your existing integration solution or create a new .NET Framework Class Library / Console Application (targeting .NET Framework 4.5 or 4.7.2).
    c. In Solution Explorer, right-click 'References' and select Add Reference....
    d. Switch to the COM tab and scroll to locate SIMATIC BATCH API Type Library.
    e. Alternatively, browse directly to C:\Program Files (x86)\Siemens\BATCH\bin\BatchAPI.dll.
    f. In the reference properties window, set Embed Interop Types to False and Copy Local to True.

  4. Establish API Connection Code:
    a. In your C# class, import the namespace: using BATCHAPILib;.
    b. Instantiate the server object: var batchServer = new SimaticBatchServer();.
    c. Establish a session: batchServer.Connect("BATCH_SRV_NAME", "ApplicationName", "Password");.

  5. License Verification:
    a. Ensure the target computer or BATCH Server has the SIMATIC BATCH API license key active in Automation License Manager (ALM).

Verification

  1. Build the C# project in Visual Studio: verify compilation finishes with 0 errors and 0 missing type warnings.
  2. Execute the application against a running BATCH Server: confirm the connection method returns success and retrieves the list of active batches.
  3. Verify in Windows Task Manager on the BATCH Server that the client connection registers under active BATCH service processes.

Limitations and Operational Precautions

The SIMATIC BATCH COM API cannot be used as a standalone library on computers without COM registration; the BATCH runtime components or interop wrappers must be present on the host PC.

Engineer FAQ

Where are the SIMATIC BATCH API DLL files located on disk?

They are located in 'C:\Program Files (x86)\Siemens\BATCH\bin' on any PC with SIMATIC BATCH Client or Server installed.

Can I download the BATCH API DLLs without installing PCS 7?

No. The DLLs are licensed components of SIMATIC BATCH and are not distributed as standalone SDK downloads.

What SIOS Entry ID contains the official BATCH API sample application?

Siemens Industry Online Support Entry ID 92344632.

Is the BATCH API compatible across PCS 7 V8.2 and V9.0?

Yes, the COM interfaces maintain backward compatibility, allowing client applications developed on V8.2 to communicate with V9.0 servers.

What license is required to use the SIMATIC BATCH API?

A dedicated 'SIMATIC BATCH API' license key is required in Automation License Manager.

Technical References

Related Articles

Related Tags

  • SIMATIC BATCH
  • BATCH API
  • COM Interface
  • C# Development
  • Entry ID 92344632
  • PCS 7 V9.0
20 respuestas