Understanding and Configuring the Sample Time (SAMPLE_T) Parameter on INT_P Integrator Blocks

Understanding and Configuring the Sample Time (SAMPLE_T) Parameter on INT_P Integrator Blocks

In SIMATIC PCS 7, the SAMPLE_T parameter on the integrator block INT_P (FB19 or APL FB1852) represents the discrete sampling time interval (delta t in seconds) between consecutive mathematical integration executions. Discrete integration calculates Out = Out_prev + In * (SAMPLE_T / TI). In PCS 7 CFC, SAMPLE_T is an automated system attribute that the compiler populates automatically based on the cyclic interrupt OB where the block is placed (e.g., OB35 at 100 ms sets SAMPLE_T = 0.1 s). Manually altering SAMPLE_T offline without changing the physical OB execution cycle distorts the mathematical scaling factor, causing the output to ramp faster or slower than real time. To adjust the integration rate, engineers must modify the Integration Time Constant (TI), leaving SAMPLE_T to automated compiler management.

Table of Contents

Executive Summary

Continuous process monitoring frequently requires integrating analog rate values—such as mass flow rate (kg/h), electrical power (kW), or fluid volumetric flow (m3/h)—to calculate accumulated mass, energy, or volume. In PCS 7, engineers utilizing the integrator block INT_P often observe unexpected calculation errors: after manually editing the SAMPLE_T (Sampling Time) input parameter, the integrated result changes drastically, accumulating far faster or slower than actual process flow. This technical article explains the discrete Euler integration mechanics of INT_P, describes the automatic parameterization executed by the CFC compiler, and provides the correct method to tune integration rates without corrupting mathematical scaling.

Architecture and Fundamental Mechanics

The mathematical foundation of the SIMATIC PCS 7 INT_P integrator block operates on discrete-time approximation:
1. Discrete Integration Formula:
- In continuous mathematics, integration is represented as: $\text{Out}(t) = \frac{1}{T_I} \int \text{In}(t) \, dt$
- In digital controllers executing cyclically, the continuous integral is approximated using discrete numerical summation (Forward Euler method):
$$\text{Out}{n} = \text{Out}$$} + \text{In}_{n} \cdot \frac{\text{SAMPLE_T}}{T_I
- Where:
- $\text{In}$: Current input value (e.g., kg/s).
- $T_I$ (TI): Integration time constant (seconds).
- $\text{SAMPLE_T}$: Time elapsed between scan cycles (seconds).
2. Automatic Compiler Population (s7_sampletime := 'true'):
- In PCS 7 CFC, block types designed for cyclic execution carry the system attribute s7_sampletime := 'true' on their SAMPLE_T pin.
- When an engineer places INT_P into an execution task (e.g., OB35 with a cycle time of 100 ms), the CFC compiler automatically sets SAMPLE_T = 0.1.
- If the block is moved to OB32 (1000 ms cycle), the compiler re-writes SAMPLE_T = 1.0 upon the next chart compilation.
3. The Manual Alteration Fallacy:
- If an engineer manually overrides SAMPLE_T to 1.0 while the block remains in OB35 (which physically executes every 0.1 seconds), the CPU performs the addition 10 times per second using a delta-t of 1.0 s. The integrator ramps 10 times faster than real time, producing massive calculation errors.

Step-by-Step Implementation Procedure

  1. Verify Task Allocation and OB Cycle Time in HW Config:
    a. Open STEP 7 HW Config for the AS station.
    b. Double-click the CPU and navigate to the 'Cyclic Interrupts' tab.
    c. Verify the configured execution times for cyclic interrupt OBs (e.g., OB35 = 100 ms, OB32 = 1000 ms).

  2. Inspect Block Placement in CFC Run Sequence:
    a. Open the CFC chart containing the INT_P block.
    b. Open the Run Sequence editor (Options -> Run Sequence or press Ctrl + F5).
    c. Locate the INT_P block instance: verify which OB holds the block (typically OB35 or OB32).

  3. Restore Automated Compiler Management for SAMPLE_T:
    a. In the CFC chart, select the INT_P block.
    b. Open Object Properties -> I/Os.
    c. Locate parameter SAMPLE_T.
    d. If a manual constant was entered, delete the custom value or clear manual overrides to restore compiler assignment.
    e. Recompile charts: verify that SAMPLE_T automatically adopts the exact cycle time of the host OB (e.g., 0.1 for OB35).

  4. Configure Integration Time Constant (TI) for Engineering Units:
    a. To configure how fast the integrator accumulates, adjust parameter TI (Integration Time in seconds).
    b. Calculating TI based on incoming flow units:

    • If incoming flow In is in kg/second, set TI = 1.0 s.
    • If incoming flow In is in kg/minute, set TI = 60.0 s.
    • If incoming flow In is in kg/hour, set TI = 3600.0 s.
      c. Entering TI = 3600.0 ensures that a constant input of 1000 kg/h accumulates exactly 1000 kg in the output after 1 hour (3600 seconds).
  5. Configure Tracking and Reset Inputs:
    a. Connect reset logic (e.g., midnight pulse or batch start) to Rst.Value = 1 to zero the accumulated total.
    b. Set Out_LoLim and Out_HiLim to prevent mathematical overflow.

Verification

  1. In CFC online, simulate a constant input of 3600.0 on In with TI = 3600.0 s in OB35 (SAMPLE_T = 0.1 s).
  2. Measure accumulation over exactly 60 seconds using a stopwatch: verify that Out increments by exactly 60.0 units (1 unit per second).
  3. Move the block to OB32 (1.0 s cycle) and recompile: verify SAMPLE_T updates to 1.0 and accumulation rate remains identical.

Limitations and Operational Precautions

Placing high-speed integrator blocks in slow cyclic OBs (e.g., OB30 at 5000 ms) reduces calculation accuracy for rapidly fluctuating signals. High-frequency process streams must be integrated in OB35 (100 ms) or faster.

Engineer FAQ

What is the purpose of the SAMPLE_T parameter in INT_P?

SAMPLE_T represents the discrete time delta (dt in seconds) between block executions used in the numerical integration algorithm.

Why did changing SAMPLE_T alter my integrator output value?

Because SAMPLE_T is a direct multiplier in the integration formula; increasing it artificially multiplies the accumulation rate per scan cycle.

Does the CFC compiler automatically set SAMPLE_T?

Yes. Blocks with attribute s7_sampletime := 'true' have their SAMPLE_T parameter automatically configured by the CFC compiler to match the host OB cycle time.

How do I integrate a flow rate measured in gallons per minute (GPM)?

Set the integration time constant TI to 60.0 seconds so the output accumulates total gallons accurately.

Can the INT_P block be reset to zero at the end of a batch?

Yes, by pulsing the Rst (Reset) input parameter, which resets Out to Out_LoLim or zero.

Technical References

Related Articles

Related Tags

  • INT_P
  • SAMPLE_T
  • Integrator
  • Flow Totalization
  • CFC Run Sequence
  • APL Math
20 respuestas