AutomationDirect
Login | Register
Accounts & Orders
Cart
3
$503.00

Recent Orders

View and Manage | Request Cancellation
Loading Order History
Loading...Loading...

Your Account

Account Home

Checkout   $503.00


  • My Orders
  • Product Returns (RMAs)
  • Pay Proforma Invoices
  • Pay Freights
  • Pay Invoices / Invoice Reprint
  • Quotes / Favs / BOMs
  • Packing List Reprint
  • Purchase History Reports
  • My Product Docs
  • Manage / Apply for Credit
  • Tax Exemption
| Direct Sales US & Canada | 800-633-0405 | About | Contact | Line Card |
Products | Support
| Compare
  
Ordering Tools  
warning Cookies are not enabled on your browser.
Cookies are required for our site. Please enable cookies in your browser preferences to continue.
+
Navigation
+
Shopping Categories
  • Barcode / RFID / Vision
  • Bulk Wire & Cable
  • Cables (Terminated)
  • Circuit Protection / Fuses / Disconnects
  • Communications
  • Drives & Soft Starters
  • Enclosure Thermal Management & Lights
  • Enclosures & Racks
  • Field I/O
  • HMI (Human Machine Interface)
  • Hydraulic Components
  • Motion Control
  • Motor Controls
  • Motors
  • Pneumatic Components
  • Power Products (Electrical)
  • Power Transmission (Mechanical)
  • Process Control & Measurement
  • Programmable Controllers
  • Pushbuttons / Switches / Indicators
  • Relays / Timers
  • Safety
  • Sensors / Encoders
  • Stacklights
  • Structural Frames / Rails
  • Tools & Test Equipment
  • Valves
  • Water (Potable) Components
  • Wire & Cable Management
  • Wire & Cable Termination
  • Retired Products
+
Learn More
  • Brand Line Card
  • What's New
  • E-newsletter
  • Online PDF Catalog
  • Video Tutorials
  • Company Reviews
  • Learning Library
  • Affordable Training
  • Free Online PLC training
  • Cybersecurity
+
In Depth Product Sites
  • Programmable Logic Controllers
  • Productivity1000 PLCs
  • Productivity2000 PLCs
  • Productivity3000 PLCs
  • ProductivityCODESYS
  • LS Electric XGB Series PLCs
  • ProductivityOpen
  • CLICK PLCs
  • Do-more BRX PLCs
  • C-more Touch Panels
  • AC & DC Drives
  • Motion Control Components
  • Servos
  • StrideLinx
  • Pneumatics
+
Product Selectors &
Configuration Utilities
  • PLC Family Selector
  • P1000 PLC Systems
  • P2000 PLC Systems
  • P3000 PLC Systems
  • ProductivityCODESYS
  • CLICK PLC Systems
  • Do-more® BRX PLC Systems
  • LS-Electric® XGB PLC Systems
  • Productivity®Open Systems
  • Datalogic® Safety Light Curtains
  • LS-Electric® Servo Systems
  • Nitra® Pneumatic Grippers
  • Object Detection (Sensors)
  • PAL Controller Configurator
  • Precision Gearbox Selector
  • Protos X® Field I/O
  • Pyrometers Selector
  • Quadritalia® Modular Enclosures
  • Stellar® Soft Starters
  • Stepper System Selector
  • SureFrame T-slot Extrusion
  • SureMotion® XYZ Gantry
  • SureServo2® System Selector
  • SureStep® Linear Actuators
  • Timing Belts & Pulleys
  • Werma® Stacklights
  • ZIPLinks

Stop Writing One Giant PLC Program! (CLICK PLC Structure) | AutomationDirect


Related Products

C0-04POT
C0-04POT Thumbnail
C2-03CPU
C2-03CPU Thumbnail
C2-03CPU-2
C2-03CPU-2 Thumbnail
C2-02CPU
C2-02CPU Thumbnail
C2-02CPU-2
C2-02CPU-2 Thumbnail
C2-01CPU
C2-01CPU Thumbnail
C2-01CPU-2
C2-01CPU-2 Thumbnail
C0-00DD1-D
C0-00DD1-D Thumbnail
C0-00DD2-D
C0-00DD2-D Thumbnail
C0-00DR-D
C0-00DR-D Thumbnail
C0-00AR-D
C0-00AR-D Thumbnail
C0-01DD1-D
C0-01DD1-D Thumbnail
C0-01DD2-D
C0-01DD2-D Thumbnail
C0-01DR-D
C0-01DR-D Thumbnail
C0-01AR-D
C0-01AR-D Thumbnail
C0-02DD1-D
C0-02DD1-D Thumbnail
C0-02DD2-D
C0-02DD2-D Thumbnail
C0-02DR-D
C0-02DR-D Thumbnail
C0-10DD1E-D
C0-10DD1E-D Thumbnail
C0-10DD2E-D
C0-10DD2E-D Thumbnail
C0-10DRE-D
C0-10DRE-D Thumbnail
C0-10ARE-D
C0-10ARE-D Thumbnail
C0-11DD1E-D
C0-11DD1E-D Thumbnail
C0-11DD2E-D
C0-11DD2E-D Thumbnail
C0-11DRE-D
C0-11DRE-D Thumbnail
C0-11ARE-D
C0-11ARE-D Thumbnail
C0-12DD1E-D
C0-12DD1E-D Thumbnail
C0-12DD2E-D
C0-12DD2E-D Thumbnail
C0-12DRE-D
C0-12DRE-D Thumbnail
C0-12ARE-D
C0-12ARE-D Thumbnail
C0-12DD1E-1-D
C0-12DD1E-1-D Thumbnail
C0-12DD2E-1-D
C0-12DD2E-1-D Thumbnail
C0-12DRE-1-D
C0-12DRE-1-D Thumbnail
C0-12ARE-1-D
C0-12ARE-1-D Thumbnail
C0-12DD1E-2-D
C0-12DD1E-2-D Thumbnail
C0-12DD2E-2-D
C0-12DD2E-2-D Thumbnail
C0-12DRE-2-D
C0-12DRE-2-D Thumbnail
C0-12ARE-2-D
C0-12ARE-2-D Thumbnail
C0-08SIM
C0-08SIM Thumbnail


To learn more: https://www.automationdirect.com/clickplcs?utm_source=MnR8e-cZLUs&utm_medium=VideoTeamDescription

(VID-CL-0081)

Is your PLC scan time creeping up? A giant "Main" program can lead to watchdog timeouts and sluggish machine responses. In this tutorial, we show you how to organize your logic using the three distinct program types in CLICK PLCs to keep your code lean, fast, and professional.

What we cover:
Main Program: The "heartbeat" of your logic—learn what stays here and what needs to move.
Subroutines: How to create modular building blocks for reusable code like pump sequences or alarm handlers.
Interrupt Programs: Your "emergency response team"—how to handle high-speed encoder pulses and PID loops that can't wait for a full scan.
Best Practices: Why CLICK doesn't allow "nesting" and how to manage memory status when jumping between programs.
Stop fighting with long scan times. Master the structure of your CLICK PLC today!

CLICK PLC Hardware: https://www.automationdirect.com/clickplcs?utm_source=MnR8e-cZLUs&utm_medium=VideoTeamDescription
FREE CLICK Programming Software: https://www.automationdirect.com/support/software-downloads
Free PLC Training: https://www.automationdirect.com/programmable-logic-controllers/plc-training

Online Support Page: https://community.automationdirect.com/s/contactsupport?utm_source=MnR8e-cZLUs&utm_medium=VideoTeamDescription

**Please check our website for our most up-to-date product pricing and availability.

#PLC #ClickPLC #PLCTutorial #Automation #LadderLogic #ScanTime #Subroutine #Interrupt #PLCProgramming #AutomationDirect


Hide Transcript
View Transcript

Watchdog timer alarms? Scan time overruns? Your PLC scan time may be creeping up because every piece of logic—timers, math, sequences, everything—is crammed into one giant Main Program. That exact frustration is what the Click PLC’s program structure was built to eliminate. By dividing your ladder logic into three distinct types—Main Program, Subroutine Programs, and Interrupt Programs—you gain the power to keep scan times short, code organized, responses lightning-fast, and troubleshooting straightforward. Let’s walk through what each type does, how they interact, and when to reach for each one so you can build more reliable, easier-to-maintain automation. The Main Program is the heartbeat of your application. Every scan cycle, the PLC reads inputs, executes the Main Program rung by rung, updates outputs, and repeats. This is where your core machine control lives: start/stop sequences, monitoring sensors, driving actuators, running most timers and counters. Starting from the top, it executes sequentially down the ladder—unless sidetracked by a subroutine or interrupt program—and it ends with an END instruction to close the scan. Use the Main Program for the everyday logic that must happen on every cycle—but keep it lean. A bloated Main Program slows everything down. Subroutine Programs are your modular building blocks. You can create hundreds of named subroutines, depending on the total program size and step count. They only run when explicitly called with a CALL instruction from the Main Program. When called, the PLC jumps to the subroutine, executes every rung until it hits a RETURN (which you must include), then returns exactly to the instruction after the CALL. Subroutines shine for reusable code: a common pump startup sequence, an alarm handler, a recipe calculation, or any block you want to call from multiple places. They make your Main Program shorter, cleaner, and faster to scan while keeping logic organized and easy to maintain. A couple of things to keep in mind: If a sub is not called on any given scan, the bit memory and data registers within the sub will maintain their status from the last time the sub was called—unless changed in the Main, of course. Also, in the Click, no nesting of subs is possible. In other words, you can’t CALL from within a subroutine. Interrupt Programs are your emergency-response team. Up to 12 on standard CPUs, 8 on analog models, or up to 32 on Click Plus. They trigger on specific events—rising or falling edges on high-speed inputs, or timed intervals you define (every 10 ms, every 3 seconds, etc.). When the trigger fires, the PLC immediately pauses the current scan, executes the interrupt program to completion, hits RETURN, and resumes exactly where it left off. Interrupts cannot call subroutines and do not use END. Reserve them for anything that absolutely cannot wait for the next full scan: counting fast encoder pulses without missing counts, updating a PID loop on a precise schedule, or reacting instantly to a crucial limit switch. Put it all together like this: build your foundation in the Main Program, break out reusable or conditional logic into Subroutines, and protect time-sensitive tasks with Interrupts. That separation keeps scans quick, code readable, and your machine responsive. Open the free CLICK software, experiment with these program types, and check the built-in help. Better yet, visit AutomationDirect.com to find out about free PLC training. Click here to see more videos about our Click line of PLCs. Click here to check out our webstore and free PLC training. Click here to subscribe to our YouTube channel and keep up to date on all new products and news from AutomationDirect.



No data returned!
An error has occurred! Please contact support
Videos Home > Stop Writing One Giant PLC Program! (CLICK PLC Structure) | AutomationDirect
Contact, Connect & More
Sign Up
to receive:
FREE e-Newsletter
sign up today!
Connect With Us
Social Media Channels:
linkedin    facebook    x    instagram    youtube
Company Information
About Us
Brand Line Card
System Integrator Program
International Sales
Panel Builder Program
Site Help
Company Reviews
Download Price List
Contact Us
Contact Options
1-800-633-0405
Monday - Friday
9 a.m. - 6 p.m. ET
excluding holidays
Career Opportunities
Voted #1 mid-sized employer in Atlanta
We're a great place to work!
Check out our job openings

Need Training?
Affordable Training by Interconnecting Automation
Free Online PLC Training
FREE Video Tutorials
Information & News
What's New / In The News
FREE e-Newsletter
Automation Notebook
Product Literature
White Papers
News, Product and Training Bulletins
E-Books
Shop with confidence
Checked   Safe & Secure
payment methods


We accept VISA, MasterCard, Discover, American Express, PayPal or company purchase orders.
AutomationDirect

BBB Accredited

Voted #1 mid-sized employer in Atlanta
Check out our job openings

Copyright © 1999-2026 AutomationDirect.  ALL RIGHTS RESERVED.
Site Map     Send Us your Feedback     Unsubscribe     Email Preferences     Legal & Business Policies     YouTube Terms of Service     AutomationDirect Product API
Clear login credentials



Back to Top


spinner Updating...
Info