AutomationDirect
Search
Login | Register
Accounts & Orders
Cart
0
$0.00

Recent Orders

View and Manage | Request Cancellation

Your Account

Account Home

Checkout   $0.00


  • My Orders
  • Product Returns (RMAs)
  • Pay Proforma Invoices
  • Pay Freights
  • Invoices / Invoice Reprint
  • Quotes / Favs / BOMs
  • Packing List Reprint
  • My Product Docs
  • Credit Application
  • Tax Exemption
| Direct Sales in US and Canada | 1-800-633-0405 | About Us | Contact Us | 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
  • Wiring Solutions
  • 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 H2 PLCs or
    Do-more T1H Series
  • 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
  • AC Motors
  • 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
  • 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
Filter Results Clear All
You've selected:
> Programmable Controllers > Do-more H2 & T1H PLCs (Micro Modular & Stackable)
  •   Shop  
  •   Overview  
  •   In Depth  
Do-more Home Download Free Software
 
Features
Top 11 Ways You Can Do More with this PLC Serial Communications Ethernet Communications High Speed Modules Hign Speed Inputs Motion Control Remote I/O Free Online Training
Free Software
Simulator Auto-Discover I/O Communications Powerful Math Monitoring & Troubleshooting Memory Management Program Management Project Management Security Download the FREE software
Hardware
H2 CPUs T1H CPUs Bases AC I/O Modules DC I/O Modules AC & DC I/O Modules Analog I/O Modules Specialty Modules Go to ZIPLink Selector Tool
Videos


Do-more H2 (Micro Modular PLC) Videos

View Do-more Designer Videos


Detailed Product
Overview



To learn more: https://www.automationdirect.com/do-more?utm_source=ktenhleMzz8&utm_medium=VideoTeamDescription - (VID-DM-0043)

Learn the fundamentals of how Programs and Tasks work and understand they are not the same thing as subroutines. Once you understand how Do-more Designer's Programs and Tasks work, you will be able to take advantage of them in your own programs!
**Software Version used in this video: Do-more Designer 2.0.0

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

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


Hide Transcript
View Transcript
It’s important to understand that Programs

and Tasks are NOT subroutines. When you call a subroutine, the code that

calls the subroutine literally jumps to the subroutine code, executes it and then returns

to what it was doing and continues on its way. When you run a program or execute a task,

the main logic just keeps right on going. All that did was arm the task or program so

when the execution gets to it, it will run. Tasks and programs that weren’t armed during

the previous scan don’t run. That’s really important to understand – when

you call a program or enable a task they don’t get executed right away. When do they get executed? Well, that up to you. Over here in the project browser if you click

on this execution order button, you can specify when you want something to be executed – if

it’s been armed, of course. Does the main program have to be run first? No. You can make it the last thing to run if you

want to. Just beware that if you enable a task or a

program in the main program, it won’t be executed until the next scan which means it

could be operating on inputs that have changed since the program or task was enabled. And that can be handy in some applications,

but most of the time you’ll want to execute your programs and tasks THIS scan so they

are all working with the same input values so you’ll usually put them below the main

program. Of course, if this program depends on this

task running first, then you’ll want to make sure that task runs BEFORE the program

in the execution order. Of course, if this program depends on this

task running first, then you will want to make sure that task runs before the program,

right? So what would you use Programs or Tasks for? Well, I mostly use them for running background

or asynchronous tasks or even running end of shift reports where I have to gather and

manage lots of data infrequently. Stuff like that. For example, suppose you have a scan loop

that is monitoring and controlling some system and you need some PID loops. Could you put them in your main ladder code? Sure. But since they are running their own independent

process it makes more sense to launch them and just let them run off to the side all

by them selves. These are actually located down here in whatever

execution order you setup, I’m just showing them off to the side as a reminder that once

enabled by the run instructions, they execute every scan and are off doing their thing independent

of the main scan loop. Now you have a nice clean scan loop taking

care of business, with these independent processes sitting over here running in the background. When you enable a task, it runs once through

and it’s done. This is ideal for setting up or initializing

the background process you are about to launch or maybe doing a report at the end of a shift

where you just need to collect and store a bunch of data. So a task would be ideal for setting up the

PID loops before you run them, again, because it runs once through setting up all the PID

parameters and it’s done. Could you do this single pass with a Program? Sure, but know this: TASKs are much more efficient

and execute quicker than a program. So if you can use a TASK, do it. Most of the time you will want to run a program

to start it, and then let it run forever. But if you do need to stop it, there’s a

number of ways to stop and restart a program. The debug menu one is handy. Maybe you need to shut down a PID or Communications

process running in the background while you are doing some debug on something else. That’s a quick way to kill a program without

modifying your code. To stop a program from within the code, the

EXIT instruction allows the program to terminate itself so it can finish what its doing and

shut itself down. And you can even make the EXIT conditional. HALT allows something external to the Program

or Task to shut down the program or task you choose here. SUSPEND prevents the Program or Task you specify

here from running during any scan that the SUSPEND is enabled. The key thing to understand here is SUSPEND

maintains the current state of the program or task so when you remove power flow from

the SUSPEND the Program or Task picks back up right where it left off. Maybe it was in the middle of a loop collecting

data but you needed to suspend that task while some other time critical process had to be

taken care of. That time critical process simply suspends

the TASK or PROGRAM and then releases the Program or Task when it’s done. That’s a great way to ensure background

tasks don’t interfere with critical path processes. RESTART also halts a program or a task, but

it also resets the Program or Task so on the next scan it starts running from the beginning. That’s for when you have a process that

when it gets to a certain time of day or to a certain level or something like that and

you need for it to restart regardless of what it’s doing. If you have a TASK or a Program talks up a

lot of time, how do you break it up into smaller chunks that are spread out across multiple

scans? Easy. Just right click on the program or task, and

choose one of these. We’ll cover all of these options and show

you how to take advantage of them in the next video which is dedicated to Yielding and some

other lose ends. And in the final video in this series we’ll

do some live examples so you can see exactly how to get the most out of Programs and Tasks

in your own code. If you have any questions, please contact

AutomationDirect’s free, award winning support team during regular business hours. They will be happy to help. And don’t forget the forums. There are lots of automation professionals

there that love to share their years of experience. Just don’t post any questions directed at

AutomationDirect’s support team there, they don’t monitor the forums on a regular basis. Spend Less, Do-more. With AutomationDirect.


Playlist Not Found Could not find playlist PLPdypWXY_ROoEcDCcD10Qdb3S9tOmfEn5

Playlist Not Found Could not find playlist PLPdypWXY_ROoJx-HnK9gj2Z5a-i7th-UK

Playlist Not Found Could not find playlist PLPdypWXY_ROqvbaYVBWc3kH-pP01fI4-E

Playlist Not Found Could not find playlist PLPdypWXY_ROr5OPw3e0o8rLC0JQijmCNY

Playlist Not Found Could not find playlist PLPdypWXY_ROrtSkGYNq8Xc52QWTCWf2Ci

Playlist Not Found Could not find playlist PLPdypWXY_ROrRJ5YuFYxs3mSXr9250AN7

Playlist Not Found Could not find playlist PLPdypWXY_ROqJO86ikigKmjnSkbguBKBw

Playlist Not Found Could not find playlist PLPdypWXY_ROqWWy8OnWGt3YD4Dald6uf-

Playlist Not Found Could not find playlist PLPdypWXY_ROrmjIdXLaeovoTLZP65hdac

Playlist Not Found Could not find playlist PLPdypWXY_ROoqTZihvX8c8UUj5GzVCuKH

Playlist Not Found Could not find playlist PLPdypWXY_ROr0ZfCV-fAgau5yDemA19CV

BRX Do-more PLCs - Motion Control & High Speed Inputs
  • Video
    BRX Do-more CTRIO2 Motion Demo Hardware from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Config & JOG from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Dynamic Motion from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Using Limits from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Trapezoid Moves from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Using Encoders from AutomationDirect
BRX Do-more PLCs - Hardware
  • Video
    How To Sense Temperature with a Do-more PLC from AutomationDirect
  • Video
    How To Detect Objects with an AutomationDirect Do-more PLC
  • Video
    AC Motor On/Off with Do-more PLC Part 1 from AutomationDirect
  • Video
    AC Motor On/Off with Do-more PLC Part 2 from AutomationDirect
  • Video
    How to Sense Distance with an AutomationDirect Do-more PLC
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-2025 AutomationDirect.  ALL RIGHTS RESERVED.
Site Map     Send Us your Feedback     Unsubscribe     Email Preferences     Legal & Business Policies     YouTube Terms of Service
Clear login credentials



Back to Top


spinner Updating...
Info
„