Generating Fixed-Duration Pulses in SIMATIC PCS 7 CFC - TimerP and Pulse Configuration

Generating Fixed-Duration Pulses in SIMATIC PCS 7 CFC - TimerP and Pulse Configuration

In SIMATIC PCS 7 CFC, generating a fixed-duration pulse from either a momentary trigger or a sustained continuous signal is implemented using the standard Advanced Process Library (APL) block TimerP (FB1810) or CFC system block TIMER_P (FB5). By configuring the block in Pulse Mode (Mode 0), TimerP produces an output pulse of exactly the configured duration (Ti) upon detecting a rising edge (0 to 1 transition) on the input, regardless of whether the input signal remains high or drops immediately. The configured pulse duration must be greater than or equal to the cyclic interrupt execution interval of the host organization block (e.g. OB35).

Table of Contents

Pulse Generation Mechanics in Continuous Process Control

In process automation, discrete control tasks frequently require fixed-duration actuation signals:
* Sampler Valves: Opening an automated grab sampler valve for exactly 3.0 seconds upon laboratory request.
* Filter Bag Pulse Cleaning: Actuating reverse-jet compressed air solenoid valves for exactly 200 ms.
* Third-Party Handshakes: Triggering external packaging machines or weight hoppers with a guaranteed 1.0 second reset pulse.

If an operator holds a pushbutton in WinCC, or if a field limit switch remains permanently closed, the actuation signal must not remain energized. A pulse timer guarantees deterministic duration regardless of input signal retention.

Configuring TimerP (FB1810) and TIMER_P (FB5) for Fixed Pulses

In SIMATIC PCS 7, two primary standard blocks provide pulse timing:
1. TimerP (FB1810) - APL (Advanced Process Library):
* In (BOOL): Input trigger signal.
* Ti (TIME): Configured pulse duration (e.g. T#2s).
* Mode (INT): Operating Mode:
* Mode = 0: Pulse (TP). A rising edge on In drives output Out to TRUE for duration Ti. Subsequent input changes during the pulse are ignored.
* Mode = 1: Extended Pulse. A rising edge on In starts the pulse; re-triggering In during the pulse restarts the timer from zero.
* Mode = 2: On-Delay (TON).
* Mode = 3: Off-Delay (TOF).
* Out (BOOL): Pulse output signal.
2. TIMER_P (FB5) - CFC Standard Library:
* Uses identical mode enumeration and is intended for non-APL or legacy S7 program charts.

CFC Signal Flow and Timing Diagram

The execution behavior in Mode 0 (Pulse) operates deterministically as follows:

Input Signal (In)
   ┌─────────┐                ┌──────────────────────────────┐
───┘         └────────────────┘                              └─────────

Timer Output (Out) - Mode 0 (Fixed Pulse Duration Ti = 2s)
   ┌────────────────┐         ┌────────────────┐
───┘                └─────────┘                └───────────────────────
   ◄────── Ti ──────►         ◄────── Ti ──────►
   (Input drops early)        (Input held permanently HIGH)

Notice that even when In remains TRUE indefinitely, Out de-energizes precisely when Ti expires, preventing actuator damage.

PCS 7 Pulse Block Operational Modes Comparison

Compare the operational modes of TimerP (FB1810) to select the correct timing behavior:

Mode Parameter (Mode)Timer Function (IEC 61131-3)Rising Edge ResponseHigh Input BehaviorRe-Trigger BehaviorMode 0Pulse (TP)Output Out = TRUE for TiDe-energizes after TiIgnores input transitions while activeMode 1Extended PulseOutput Out = TRUE for TiDe-energizes after TiRestarts time count if re-triggeredMode 2On-Delay (TON)Starts delay timerOutput Out = TRUE after TiResets if input drops before TiMode 3Off-Delay (TOF)Output Out = TRUE immediatelyStays TRUE while In is TRUEHolds output TRUE for Ti after falling edge

Verification

To confirm proper fixed pulse generation in CFC:
1. In CFC Editor, place TimerP (FB1810) into a chart assigned to OB35 (100 ms).
2. Set parameter Mode := 0 and Ti := T#3s.
3. Switch CFC to Test Mode online.
4. Toggle In := TRUE for 0.5 seconds, then return to FALSE; verify that Out remains TRUE for exactly 3.0 seconds.
5. Toggle In := TRUE and leave it permanently TRUE; verify that Out de-energizes after exactly 3.0 seconds.
6. Connect Out to the field output channel driver (Pcs7DiOu); confirm on the physical card LED that the pulse terminates on schedule.

Limitations and Operational Precautions

The configured pulse duration Ti must be significantly longer than the cyclic interrupt sampling time of the execution OB. For example, if TimerP is scheduled in OB35 (100 ms execution), configuring Ti = T#50ms will result in erratic pulse lengths (or missed pulses) due to execution discretization. For high-speed sub-millisecond pulses, use specialized hardware counter or pulse-train output modules (e.g. FM 350-1 or ET 200M fast pulse outputs).

Engineer FAQ

What happens if a new trigger pulse arrives while the timer is still timing?

In Mode 0 (Pulse), the block ignores all input transitions until the configured time Ti has completely expired. In Mode 1 (Extended Pulse), a new rising edge restarts the timing interval.

Can I reset an active pulse before it finishes?

Yes. In APL TimerP, asserting the input Reset := TRUE immediately de-energizes Out and resets elapsed time to zero.

Why did the pulse output fail to energize on a fast 20 ms field pulse?

If the block is installed in OB32 (1000 ms scan rate), a 20 ms field pulse arriving between OB scans will be missed completely. Move the channel driver and TimerP to OB35 (100 ms) or use process interrupt OB40.

Where is TimerP located in the PCS 7 catalog?

In the CFC catalog, navigate to Libraries -> PCS 7 AP Library V82 -> Blocks -> Math / Time -> TimerP (FB1810).

Technical References

Related Articles

Related Tags

  • TimerP
  • Pulse Generation
  • APL FB1810
  • TIMER_P
  • CFC Timing
6 respuestas