MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How do you tell whether unsynchronized machine actions come from an excessive scan cycle?
HomeModels
Table of contents

On this page

PLC & Programming (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How do you tell whether unsynchronized machine actions come from an excessive scan cycle?

Unsynchronized actions have two possible origins: an inevitable order caused by program execution sequence, and the overall lag and jitter caused by a scan cycle that is too long. Telling them apart takes measurement, not guesswork from the symptom. This article gives the distinguishing features, the verification method and the order of treatment.

1. Telling the two kinds of "out of step" apart

Sequence in the design is normal: within one scan the program runs from top to bottom, so an instruction written earlier changes state before one written later, which waits for the next scan. That kind of offset is fixed and predictable — the interval equals the scan time or the execution time of the program section. A fault-driven offset varies: the interval is large at times and small at others, does not match the measurements, or lags a beat behind the pushbutton.

2. What a scan overrun usually looks like

Four typical signs: the action lags a beat behind the button and the amount of lag changes with program load; two outputs that should act together show a fixed time difference of one or several scans; high-speed actions drop beats or jitter; communication and scanning slow each other, so actions lag more when traffic is heavy. The common thread is lag and jitter, not an action that never happens at all.

3. Locking the cause down with data

Three checks. First, monitor the current scan time, the maximum scan time and the execution time of each program section online, and see whether the maximum is approaching or exceeding the lag the machine allows. Second, capture the input signal and two output rising edges together on an oscilloscope or logic analyser, measure the real interval and compare it with the scan time. Third, disable or split the subprograms one by one and watch which section changes the interval, which locates the code that stretches the scan. The three sets of evidence corroborate each other; judging from the symptom without measuring usually blames the wrong thing.

4. Rule out the other sources first

Besides the scan cycle, several other things produce a similar picture: filter times set differently between input channels, so the signals themselves arrive in a different order; mechanical operating times that differ with output type, a relay being slower than a transistor; the real response of pneumatic and hydraulic valves and cylinders; the synchronisation period between a master and a slave PLC; the bus refresh period of remote I/O. Compare like channels and like loads rather than drawing a conclusion from one channel.

5. Decide, then treat

Measure before changing. Once the scan is confirmed as the cause, simplify the program and shorten the execution part and move non-real-time work into interrupts or spread it over several scans; for outputs that must stay in step, use the same module, the same refresh batch or high-speed outputs; and for safety-related actions do not rely on program synchronisation but wire them directly. After the change, re-measure the maximum scan time and the actual action interval and confirm the margin before returning to production.

6. Symptom–cause–verification–action table

SymptomLikely causeHow to verifyDirection of fix
Action lags as a whole behind the buttonScan time near or above the lag allowedRead the maximum scan time onlineShorten the execution part
Fixed difference between two outputsProgram sections are orderedCompare program execution orderReposition or synchronise the outputs
Interval varies at randomProgram branches or communication load fluctuateCollect a scan time distributionCut communication load, stage the tasks
High-speed action drops beatsAction rate near or above the scan rhythmMeasure output frequency on a scopeMove to interrupt or a high-speed module
Inputs themselves arrive in orderFilter times differ between channelsCheck each channel's filter settingMake the filter times uniform
Same-class actions still differMechanical time differs with output typeCompare relay and transistor outputsUse one output type
Actuator responds slowlyValve and cylinder response is slowMeasure at the actuator itselfChange the air circuit or re-select
Master and slave out of stepMaster–slave communication period is longRead the synchronisation parametersShorten the synchronisation period
Distributed stations lagRemote I/O refresh period is longCheck the bus refresh timeMove closer or shorten the network

7. Notes

In many cases the scan cycle is not the culprit at all: the program fakes synchronisation with time delays, estimating a wait with a timer, which drifts as soon as the load changes. A steadier approach is to confirm arrival with a status word or a handshake signal rather than depending on time. The judgement always rests on measurement: the same symptom has completely different fixes depending on whether the scan is overrunning or a delay is faking synchronisation.

8. References

The requirements for operational monitoring and response time of programmable controllers are given in GB/T 15969.2 and IEC 61131-2. Protection, earthing and fault diagnosis for electrical equipment of machines follow GB 5226.1 and IEC 60204-1, and graphical symbols and terminal designations for electrical diagrams follow the GB/T 4728 series. Module filter times, output delays and bus refresh periods are as stated in the manufacturer's technical data.

9. Points to watch

⚠️ Three common traps:
(1) Judging from the symptom without measuring and treating the inherent order of the program as a fault, so nothing changes however much is reworked;
(2) Faking synchronisation with time delays, so it falls apart the moment the machine load changes — and it hides the real scan problem;
(3) Speeding up the scan by editing the program without ruling out differences in input filtering and actuator response, so the actions are still out of step.

Any change to action timing must be made with the supply isolated, tested dead and locked off, and re-checked with measured data afterwards. Synchronisation of safety-related actions must not depend on the PLC program.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL