Posted by: Harold Ennulat | January 14, 2010

PLC Tip: Watching Out for PLC Scan Gotchas!

It surprises me how often I run into people who work on PLC’s who are not aware of how a PLC scans the program and I/O.  Ignoring the PLC scan can cause gremlins to appear in the program.

Many (perhaps most) PLC’s scan the I/O separately from the program.  This can cause problems in the program if the program assumes that an input will maintain its state for the entire logic scan.  For example, a pushbutton status in one part of the program will not necessarily be in the same state as in another part of the program.

To make sure that an input remains in the same state for the entire program scan, use the input in one place only in the program and attach it to an internal bit (or coil).  Use this intermediate bit as your start bit throughout the program and your “input” will not change state for the rest of the scan.

This is a practice that I’ve adopted by default.  This gremlin is one that has been slain!


  1. Also, by doing these cross reference rungs in one subroutine named XREF, helps improve scan cycle and troubelshooting. (Becuase troubleshooting starts with realworld input or output, and lead back to realworld I/O.)

    • I typically put the I/O in a routine called something like “Inputs”.
      However with large programs I might do this in different areas of the program depending on how the machine or process is laid out.
      I’ve also put outputs in a single routine as well, sometimes the same routine as the inputs for similiar reasons.

      Thanks for your comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: