All calculators

PLC Scan Time & Pulse Calculator

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

Enter your values

Try an example

Your 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.

A physical pulse only matters to this task when it is sampled
PLC Scan Time & Pulse CalculatorPHYSICAL INPUTTASK SAMPLESTON OUTPUT0306090120

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

How this answer is calculated

These steps use your current values. Change an input to follow a different calculation.

  1. 1

    Find the first sample at or after the rising edge

    ceil(3 ÷ 10) × 10 = 10 ms
  2. 2

    Count samples before the falling edge

    0
  3. 3

    Check the timer only at task calls

    Not reached

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.

Three pulses with a 10 ms cyclic task

Pulse intervalSamples seeing highResult
3–7 msNonePulse missed
3–15 ms10 msOne high sample
3–43 ms10, 20, 30, 40 ms15 ms TON reaches Q at 30 ms

Questions that come up on the job

Why can the same pulse sometimes work and sometimes disappear?

Its phase relative to the scan changes. A 4 ms pulse entirely between two 10 ms sample instants is invisible to this task. Move it across one sample instant and it becomes visible. Try the two short-pulse examples and compare the scope.

Will reducing the TON preset recover a missed pulse?

No. A timer cannot react to an input the task never sampled high. First establish whether the pulse is captured. Depending on the hardware, that may require a faster task, a pulse latch, an interrupt or a high-speed counter. Then consider the timer behaviour.

TRYPLC FIELD REFERENCE / 01

PLC Scan Time & Pulse Calculator

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 Time & Pulse CalculatorPHYSICAL 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