Signals & timing

PLC Scan & Pulse Timing

Explore whether a cyclic PLC task samples a pulse and whether a non-retentive on-delay timer reaches its preset.

YOUR INPUTS

LIVE RESULT

First sampled highNot sampled high
High samples
0
TON Q first true (ms)
Not reached

Check the interpretation

The physical pulse is completely missed by the cyclic task.

FOLLOW THE SIGNAL
PLC Scan & Pulse TimingPHYSICAL INPUTTASK SAMPLESTON OUTPUT0306090120

Scope shows up to 12 scan intervals near the pulse start; numeric results cover the full pulse.

THE RELATIONSHIPceil(3 ÷ 10) × 10 = 10 ms

How to use this on a job

The input can turn on and off without the program ever seeing it. A cyclic task samples at specific instants. Moving the same short pulse between those instants changes what the software sees without changing the sensor.

  1. 01

    Set a fixed task interval. Samples occur at 0, one interval, two intervals and so on. Set the physical pulse’s start and duration on that same timeline.

  2. 02

    Read the first high sample and the count of high samples. The visual scope displays a bounded portion of the timeline; the numeric calculation covers the whole pulse without iterating through every scan.

  3. 03

    Set the TON preset. This model starts elapsed time at the first sampled high and checks the timer at each task call. It resets when a low input is sampled. A preset of zero makes Q true at the first high sample.

Work through one example

first sample = ceil(pulse start ÷ scan interval) × scan interval

With a 10 ms task, a pulse from 3 ms to 7 ms is missed. Extend it to end at 15 ms and it appears at the 10 ms sample. For a pulse from 3 ms to 43 ms and a 15 ms TON preset, the timer first sees high at 10 ms and Q becomes true at the 30 ms task call.

Before you trust the answer

This is an ideal fixed-period sampling model, not a simulation of a particular input module or runtime. It excludes input filtering, I/O update delays, jitter and asynchronous tasks. At an exact falling-edge boundary the input is low. Short pulses may need a hardware latch, interrupt or high-speed counter; check the actual hardware.

TRYPLC FIELD REFERENCE / 01

PLC Scan & Pulse Timing

Explore whether a cyclic PLC task samples a pulse and whether a non-retentive on-delay timer reaches its preset.

  • A pulse between sample instants can disappear
  • The timer starts when software sees high
  • Q changes on a task call, not between calls
  • A low sample resets a non-retentive TON
PLC Scan & Pulse TimingPHYSICAL INPUTTASK SAMPLESTON OUTPUT0306090120

Scope shows up to 12 scan intervals near the pulse start; numeric results cover the full pulse.

How to use this on a job

The input can turn on and off without the program ever seeing it. A cyclic task samples at specific instants. Moving the same short pulse between those instants changes what the software sees without changing the sensor.

  1. 01

    Set a fixed task interval. Samples occur at 0, one interval, two intervals and so on. Set the physical pulse’s start and duration on that same timeline.

  2. 02

    Read the first high sample and the count of high samples. The visual scope displays a bounded portion of the timeline; the numeric calculation covers the whole pulse without iterating through every scan.

  3. 03

    Set the TON preset. This model starts elapsed time at the first sampled high and checks the timer at each task call. It resets when a low input is sampled. A preset of zero makes Q true at the first high sample.

Work through one example

first sample = ceil(pulse start ÷ scan interval) × scan interval

With a 10 ms task, a pulse from 3 ms to 7 ms is missed. Extend it to end at 15 ms and it appears at the 10 ms sample. For a pulse from 3 ms to 43 ms and a 15 ms TON preset, the timer first sees high at 10 ms and Q becomes true at the 30 ms task call.

Before you trust the answer

This is an ideal fixed-period sampling model, not a simulation of a particular input module or runtime. It excludes input filtering, I/O update delays, jitter and asynchronous tasks. At an exact falling-edge boundary the input is low. Short pulses may need a hardware latch, interrupt or high-speed counter; check the actual hardware.

https://tryplc.com/tools/plc-scan-timing