How to Check Tank Inventory Before Starting a SIMATIC BATCH Recipe

How to Check Tank Inventory Before Starting a SIMATIC BATCH Recipe

SIMATIC BATCH's recipe validity check verifies recipe consistency and completeness; it does not check the live quantity available in a tank. For a pre-start inventory check, compare the requested transfer against the project's current usable-inventory signal in AS logic, then gate batch creation. The PCS 7 Industry Library V9.0 SP1 BatchIf (FB1222) block can create a batch and set named recipe parameters; the inventory rule itself must be engineered for the plant.

Table of Contents

Distinguish recipe validity from inventory availability

SIMATIC BATCH V9.0's Recipe Editor Check validity function checks consistency and completeness of the recipe in the active window. Recipe validation also checks configured recipe/process-cell information, such as whether materials, steps, transitions, and normalized batch quantity are defined correctly. It is not a live tank-stock check. A recipe can be structurally valid while the requested transfer exceeds the usable amount currently available in a tank.
For a pre-start decision, the project needs a separate inventory rule that compares the requested batch quantity with an authoritative, current inventory value. Keep this check outside the recipe transition if the purpose is to reject the batch before the batch is created or started.

Recommended pre-start method with BatchIf

For PCS 7 Industry Library V9.0 SP1, Siemens documents BatchIf (FB1222) as an interface that can generate batches from the PLC level. A CFC interlock can evaluate the inventory business rule first, then issue a BatchIf create command only when the check passes.
1. Identify the engineering-system signal that represents usable inventory in the source tank, and the recipe value that requests the transfer. Confirm that both values describe the same material and use compatible engineering units and scaling.
2. Add the project-specific comparison and any required inventory reservation/availability logic in the AS. The ticket does not specify an inventory block, tag, formula, or reservation scheme, so none can be prescribed generically.
3. Configure BatchIf with the process cell, order category, master recipe or formula name, recipe version, and the corresponding recipe parameter values. Siemens' manual lists PCell, OrderCat, RecipeName, RecipeVersion, and batch data among its inputs.
4. Gate the command so that the create command is issued only when the quantity check passes. If it fails, do not issue a batch-creation command; present the failure through the project's approved operator interface.
5. For a preflight that creates a batch but does not start it, use the documented CmdLi value 1 (create batch and set parameters). Do not use 3 unless the intended action is to create, enable, and start the batch as one command.
6. Monitor CmdBusy and OS_RetValOut. The manual defines return value 1 as the command being accepted by SIMATIC BATCH. Confirm the created batch and its parameter values in the configured BatchCC workflow before an operator starts it.

This creates a project-specific gate before the batch command. BatchIf does not itself calculate tank inventory or decide whether 5 tons are available.

Configure recipe quantities and command behavior

The V9.0 SP1 Industry Library manual separates several quantity fields; use the one matching the configured recipe data model.

Data being passedBatchIf inputs documented in V9.0 SP1UseA named recipe parameterPxx_Name plus the matching Pxx_ValInt, Pxx_ValDint, Pxx_ValReal, or Pxx_ValStr, selected with Pxx_ValSelUse the exact parameter name and data type expected by the master recipeA material specificationMxx_Name, Mxx_Amount, and the configured material ID or code inputsUse when the requested value is configured as a batch material amountBatch quantityBatchSizeUse for the batch quantity field; do not assume it substitutes for a recipe parameter

The manual says OS command processing matches the supplied Pxx_Name and Mxx_Name values against recipe parameters/material definitions and applies the associated values when names match. It supports up to 16 named batch parameters and up to two material specifications.
The command values documented for CmdLi/CmdOp are:

ValueBatchIf command0Empty command1Create batch and set parameters2Create and enable batch3Create, enable, and start batch

A new linked command is detected by a value change while CmdBusy is 0. Siemens instructs the user program to set CmdLi to 0 for at least one cycle after activating a command, preparing for the next command.

Handle an in-recipe transition check separately

A check implemented in a recipe transition can evaluate a condition during recipe execution, but it occurs after the batch has been created and the control recipe has started. It therefore does not meet a requirement to detect insufficient stock before batch start. If the transition method is used for a different purpose, specify its failure path explicitly, including how the control recipe is held, rejected, or stopped under the site's approved batch procedure. Do not treat a later transition check as a pre-start inventory reservation.

Verification

In an approved test configuration, first verify that the inventory signal, requested quantity, material identity, and units are valid inputs to the project comparison. Exercise both the sufficient-inventory and insufficient-inventory cases without initiating a production transfer. Confirm that the insufficient case does not issue CmdLi=1 and that the sufficient case sends the intended recipe and parameter values to BatchIf.
For an accepted command, Siemens documents OS_RetValOut=1 as SIMATIC BATCH accepting the command. Then inspect the resulting batch in BatchCC and confirm its recipe version, unit/process cell, parameter values, and status before an operator proceeds. Acceptance of a create command alone does not verify the tank calculation or prove that inventory remained available until batch start.

Limitations and Operational Precautions

The live-inventory calculation, signal source, quantity reservation, failure message, and exact parameter mapping are project-specific and are not provided in the question. BatchIf V9.0 SP1 is a batch-generation interface; Siemens' manual does not describe it as a tank-inventory checker. The described FB and interface apply to Industry Library V9.0 SP1, while the installation's PCS 7, SIMATIC BATCH, library update, and configured Batch API are not confirmed.
The manual lists prerequisites for BatchIf operation: SIMATIC BATCH Base (including the Batch API) on the PCS 7 OS Server and Client stations, a configured and loaded Batch client for the OS stations, and running PCS 7 OS Runtime and the relevant Batch Server. Confirm the exact installation and support matrix for the project.
A check can become stale if another batch reserves or transfers material after the comparison. Where concurrent use is possible, the project must coordinate availability or reserve the quantity before allowing batch start. Validate interlocks, failure handling, restart behavior, and rollback under site change controls. This procedure has not been lab-tested.

Engineer FAQ

Does Check validity verify that a tank currently contains the requested quantity? No. The V9.0 manual describes recipe consistency/completeness validation and checks configured recipe parameters and process-cell data; it does not describe a live inventory query.
What is the supported BatchIf block in Industry Library V9.0 SP1? Siemens identifies BatchIf as FB1222, a SIMATIC BATCH interface block used to generate batches from the PLC level.
Can the stock check run before the batch is created? Yes, as project-specific AS logic that gates the BatchIf create command. The inventory source and business rule must be engineered for the plant; BatchIf itself does not perform the stock calculation.
Which BatchIf command creates a batch without starting it? CmdLi=1 creates the batch and sets its parameters. Value 2 also enables it; value 3 creates, enables, and starts it.
How are named recipe parameters transferred? Configure Pxx_Name with the recipe parameter name and provide its matching typed value input and selector. The OS command processing applies values when it finds matching names.
Is BatchSize the same as a recipe setpoint? Not necessarily. The manual lists batch quantity BatchSize separately from up to 16 named recipe parameters and from material amount inputs. Match the input to the recipe's configured data model.
How many material amounts can BatchIf pass? The V9.0 SP1 manual documents up to two material specifications with material names, amount, and ID/code selection inputs.
What does OS_RetValOut=1 prove? It means SIMATIC BATCH accepted the command. It does not prove the inventory comparison was correct or that stock stayed available afterward.
What must be ready for BatchIf command execution? Siemens lists SIMATIC BATCH Base with Batch API on PCS 7 OS Server and Client stations, a configured and loaded Batch client for those OS stations, and running OS Runtime and Batch Server.
Why is a transition check later than an external preflight? The transition is evaluated during control-recipe execution after batch creation and start, so it cannot provide the requested pre-start refusal by itself.

Technical References

  • Siemens, PCS 7 Industry Library for PCS 7 (V9.0 SP1), Function Manual, 09/2020, A5E42064404-AB, sections 21.3.1–21.3.5, “BatchIf – SIMATIC BATCH interface block,” especially configuration, supported parameters, command processing, return values, and I/O: https://cache.industry.siemens.com/dl/files/100/109782100/att_1032898/v1/P7IL90b_en-US.pdf
  • Siemens, SIMATIC BATCH V9.0, Operating Manual, 05/2017, A5E38210537-AA, section 9.5.6 “Status and validity of recipes,” including recipe/formula validation and release conditions; section 15.3.1.12 “Check validity (Recipe menu)”: https://cache.industry.siemens.com/dl/files/661/109748661/att_923993/v1/sb-onlinehelp_b_en-US.pdf

Related Articles

Related Tags

20 respuestas