Sei sulla pagina 1di 502

DL05 Micro PLC User Manual

D0-USER-M
 WARNING 
Thank you for purchasing automation equipment from Automationdirect.com™. We want your new
automation equipment to operate safely. Anyone who installs or uses this equipment should read this
publication (and any other relevant publications) before installing or operating the equipment.
To minimize the risk of potential safety problems, you should follow all applicable local and national codes
that regulate the installation and operation of your equipment. These codes vary from area to area and
usually change with time. It is your responsibility to determine which codes should be followed, and to
verify that the equipment, installation, and operation is in compliance with the latest revision of these
codes.
At a minimum, you should follow all applicable sections of the National Fire Code, National Electrical
Code, and the codes of the National Electrical Manufacturer's Association (NEMA). There may be local
regulatory or government offices that can also help determine which codes and standards are necessary for
safe installation and operation.
Equipment damage or serious injury to personnel can result from the failure to follow all applicable codes
and standards. We do not guarantee the products described in this publication are suitable for your
particular application, nor do we assume any responsibility for your product design, installation, or
operation.
Our products are not fault-tolerant and are not designed, manufactured or intended for use or resale as on-
line control equipment in hazardous environments requiring fail-safe performance, such as in the
operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life
support machines, or weapons systems, in which the failure of the product could lead directly to death,
personal injury, or severe physical or environmental damage ("High Risk Activities").
Automationdirect.com™ specifically disclaims any expressed or implied warranty of fitness for High Risk
Activities.
For additional warranty and safety information, see the Terms and Conditions section of our catalog. If
you have any questions concerning the installation or operation of this equipment, or if you need
additional information, please call us at 770-844-4200.
This publication is based on information that was available at the time it was printed. At
Automationdirect.com™ we constantly strive to improve our products and services, so we reserve the
right to make changes to the products and/or publications at any time without notice and without any
obligation. This publication may also discuss features that may not be available in certain revisions of the
product.

Trademarks
This publication may contain references to products produced and/or offered by other companies. The
product and company names may be trademarked and are the sole property of their respective owners.
Automationdirect.com™ disclaims any proprietary interest in the marks and names of others.
Copyright 2004, Automationdirect.com™ Incorporated
All Rights Reserved
No part of this manual shall be copied, reproduced, or transmitted in any way without the prior, written
consent of Automationdirect.com™ Incorporated. Automationdirect.com™ retains the exclusive rights to
all information included in this document.
 AVERTISSEMENT 
Nous vous remercions d'avoir acheté l'équipement d'automatisation de Automationdirect.comMC. Nous tenons à ce
que votre nouvel équipement d'automatisation fonctionne en toute sécurité. Toute personne qui installe ou utilise cet
équipement doit lire la présente publication (et toutes les autres publications pertinentes) avant de l'installer ou de
l'utiliser.
Afin de réduire au minimum le risque d'éventuels problèmes de sécurité, vous devez respecter tous les codes locaux et
nationaux applicables régissant l'installation et le fonctionnement de votre équipement. Ces codes diffèrent d'une
région à l'autre et, habituellement, évoluent au fil du temps. Il vous incombe de déterminer les codes à respecter et de
vous assurer que l'équipement, l'installation et le fonctionnement sont conformes aux exigences de la version la plus
récente de ces codes.
Vous devez, à tout le moins, respecter toutes les sections applicables du Code national de prévention des incendies,
du Code national de l'électricité et des codes de la National Electrical Manufacturer's Association (NEMA). Des
organismes de réglementation ou des services gouvernementaux locaux peuvent également vous aider à déterminer les
codes ainsi que les normes à respecter pour assurer une installation et un fonctionnement sûrs.
L'omission de respecter la totalité des codes et des normes applicables peut entraîner des dommages à l'équipement
ou causer de graves blessures au personnel. Nous ne garantissons pas que les produits décrits dans cette publication
conviennent à votre application particulière et nous n'assumons aucune responsabilité à l'égard de la conception, de
l'installation ou du fonctionnement de votre produit.
Nos produits ne sont pas insensibles aux défaillances et ne sont ni conçus ni fabriqués pour l'utilisation ou la revente
en tant qu'équipement de commande en ligne dans des environnements dangereux nécessitant une sécurité absolue,
par exemple, l'exploitation d'installations nucléaires, les systèmes de navigation aérienne ou de communication, le
contrôle de la circulation aérienne, les équipements de survie ou les systèmes d'armes, pour lesquels la défaillance du
produit peut provoquer la mort, des blessures corporelles ou de graves dommages matériels ou environnementaux
(«activités à risque élevé»). La société Automationdirect.comMC nie toute garantie expresse ou implicite d'aptitude à
l'emploi en ce qui a trait aux activités à risque élevé.
Pour des renseignements additionnels touchant la garantie et la sécurité, veuillez consulter la section Modalités et
conditions de notre documentation. Si vous avez des questions au sujet de l'installation ou du fonctionnement de cet
équipement, ou encore si vous avez besoin de renseignements supplémentaires, n'hésitez pas à nous téléphoner au
770-844-4200.
Cette publication s'appuie sur l'information qui était disponible au moment de l'impression. À la société
Automationdirect.com, nous nous efforçons constamment d'améliorer nos produits et services. C'est pourquoi nous
nous réservons le droit d'apporter des modifications aux produits ou aux publications en tout temps, sans préavis ni
quelque obligation que ce soit. La présente publication peut aussi porter sur des caractéristiques susceptibles de ne
pas être offertes dans certaines versions révisées du produit.

Marques de commerce
La présente publication peut contenir des références à des produits fabriqués ou offerts par d'autres entreprises. Les
désignations des produits et des entreprises peuvent être des marques de commerce et appartiennent exclusivement à
leurs propriétaires respectifs. Automationdirect.comMC nie tout intérêt dans les autres marques et désignations.
Copyright 2004, Automationdirect.com™ Incorporated
Tous droits réservés
Nulle partie de ce manuel ne doit être copiée, reproduite ou transmise de quelque façon que ce soit sans le
consentement préalable écrit de la société Automationdirect.com™ Incorporated. Automationdirect.com™ conserve
les droits exclusifs à l'égard de tous les renseignements contenus dans le présent document.
DL05 MICRO PLC
USER MANUAL

Please include the Manual Number and the Manual Issue, both shown below,
when communicating with Technical Support regarding this publication.

Manual Number: D0-USER-M


Issue: Fifth Edition
Issue Date: 6/04

Publication History
Issue Date Description of Changes
Original 12/98 Original issue
2nd Edition 2/00 added pid chapter,analog module chapter and memory cartridge chapter
2nd Edition, Rev. A 7/00 added DC power
3rd Edition 11/01 removed MC and analog module chapters, corrected drum instruction, several minor
corrections, added PLC weights, EU directive additions
3rd Edition, Rev. A 7/02 Added new discrete option modules
4th Edition 11/02 Converted manual to QuarkXPress
5th Edition 6/04 Removed option module data, added MC chapter, updated instruction set, inserted
memory appendix, made minor corections
TABLE OF CONTENTS

Chapter 1: Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–2
The Purpose of this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–2
Where to Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–2
Supplemental Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–2
Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–2
Key Topics for Each Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–3
Conventions Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–3
DL05 Micro PLC Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–4
The DL05 Micro PLC Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–4
Programming Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–4
DirectSOFT32 Programming for Windows™ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–4
Handheld Programmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–5
I/O Selection Quick Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–5
Quick Start for PLC Checkout and Programming . . . . . . . . . . . . . . . . . . . . . . . . . .1–6
Steps to Designing a Successful System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–10
Questions and Answers about DL05 Micro PLCs . . . . . . . . . . . . . . . . . . . . . . . . . .1–12

Chapter 2: Installation, Wiring, and Specifications . . . . . . . . . . . . . . .2–1


Safety Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–2
Plan for Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–2
Three Levels of Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–2
Orderly System Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–3
System Power Disconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–3
Emergency Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–3
Orientation to DL05 Front Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–4
Table of Contents

Connector Removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–5


Mounting Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–6
Unit Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–6
Enclosures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–6
Panel Layout & Clearances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–7
Using DIN Rail Mounting Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–8
Environmental Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–9
Agency Approvals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–9
Wiring Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–10
Fuse Protection for Input Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–10
External Power Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–11
Planning the Wiring Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–11
Fuse Protection for Input and Output Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–12
I/O Point Numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–12
System Wiring Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–13
PLC Isolation Boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–13
Connecting Operator Interface Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–14
Connecting Programming Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–14
Sinking / Sourcing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–15
I/O “Common” Terminal Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–16
Connecting DC I/O to “Solid State” Field Devices . . . . . . . . . . . . . . . . . . . . . . . . .2–17
Solid State Input Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–17
Solid State Output Loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–17
Relay Output Wiring Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–19
Surge Suppresion For Inductive Loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–20
Prolonging Relay Contact Life . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–21
DC Input Wiring Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–22
DC Output Wiring Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–23
High Speed I/O Wiring Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–24
Glossary of Specification Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–25
Wiring Diagrams and Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–26
D0–05AR I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–26
D0–05DR I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–28
D0–05AD I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–30

ii DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents
D0–05DD I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–32
D0–05AA I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–34
D0–05DA I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–36
D0–05DR–D I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–38
D0–05DD–D I/O Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–40

Chapter 3: High-speed Input and Pulse Output Features . . . . . . . . . .3–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–2
Built-in Motion Control Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–2
Availability of HSIO Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–2
Dedicated High- Speed I/O Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–3
Wiring Diagrams for Each HSIO Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–3
Choosing the HSIO Operating Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–4
Understanding the Six Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–4
Default Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–4
Configuring the HSIO Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–5
Configuring Inputs X0 – X2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–5
Mode 10: High-Speed Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–6
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–6
Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–6
Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–7
Interfacing to Counter Intputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–7
Interfacing to Counter Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–7
Setup for Mode 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–8
Presets and Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–8
Preset Data Starting Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–9
Using Fewer than 24 Presets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–9
Equal Relay Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–9
Calculating Your Preset Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–10
X Input Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–10
Writing Your Control Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–11
Program Example: Counter Without Preset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–12
Counter With Presets Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–14
Counter With Preload Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–16
Troubleshooting Guide for Mode 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–17
Symptom: The counter does not count. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–17

DL05 Micro PLC User Manual; 5th Edition, 6/04 iii


TTable of Contents

Symptom: The counter counts but the presets do not function. . . . . . . . . . . . . . .3–17
Symptom: The counter counts up but will not reset. . . . . . . . . . . . . . . . . . . . . . . .3–17
Mode 20: Quadrature Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–18
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–18
Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–18
Quadrature Encoder Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–18
Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–19
Interfacing to Encoder Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–19
Setup for Mode 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–20
X Input Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–20
Writing Your Control Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–21
Quadrature Counter w/Preload Program Example . . . . . . . . . . . . . . . . . . . . . . . . .3–21
Counter Preload Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–23
Troubleshooting Guide for HSIO Mode 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–23
Symptom: The counter does not count. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–23
Symptom: The counter counts in the wrong direction. . . . . . . . . . . . . . . . . . . . . .3–23
Symptom: The counter counts up and down but will not reset. . . . . . . . . . . . . . .3–23
Mode 30: Pulse Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–24
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–24
Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–25
Wiring Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–26
Interfacing to Drive Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–26
Motion Control Profile Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–27
Physical I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–27
Logical I/O Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–27
Setup for Mode 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–28
Profile / Velocity Select Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–28
Profile Parameter Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–29
Trapezoidal Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–29
Registration Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–29
Velocity Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–29
Choosing the Profile Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–30
Trapezoidal Profile Defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–30
Registration and Home Search Profiles Defined . . . . . . . . . . . . . . . . . . . . . . . . . . .3–30
Velocity Profile Defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–30

iv DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

Trapezoidal Profile Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–31


Trapezoidal Profile Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–31
Trapezoidal Profile Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–32
Preload Position Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–33
Registration Profile Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–34
Registration Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–34
Registration Profile Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–35
Home Search Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–37
Velocity Profile Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–39
Velocity Profile Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–39
Velocity Profile Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–40
Pulse Output Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–42
Troubleshooting Guide for HSIO Mode 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–42
Symptom: The stepper motor does not rotate. . . . . . . . . . . . . . . . . . . . . . . . . . . .3–42
Symptom: The motor turns in the wrong direction. . . . . . . . . . . . . . . . . . . . . . . .3–43
Mode 40: High-Speed Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–44
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–44
Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–44
Setup for Mode 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–45
Interrupts and the Ladder Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–45
External Interrupt Timing Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–46
Timed Interrupt Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–46
X Input / Timed INT Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–46
Independent Timed Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–46
External Interrupt Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–47
Timed Interrupt Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–48
Mode 50: Pulse Catch Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–49
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–49
Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–49
Pulse Catch Timing Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–49
Setup for Mode 50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–50
X Input Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–50
Pulse Catch Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–51
Mode 60: Discrete Inputs with Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–52

DL05 Micro PLC User Manual; 5th Edition, 6/04 v


TTable of Contents

Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–52
Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–52
Input Filter Timing Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–52
Setup for Mode 60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–53
X Input Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–53
Filtered Inputs Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–54

Chapter 4: CPU Specifications and Operation . . . . . . . . . . . . . . . . . . .4–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–2
DL05 CPU Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–2
CPU Specificatons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–3
CPU Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–4
Communication Port Pinout Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–4
Connecting the Programming Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–5
CPU Setup Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–5
Status Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–6
Mode Switch Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–6
Changing Modes in the DL05 PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–7
Mode of Operation at Power-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–7
Auxiliary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–8
Clearing an Existing Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–8
Initializing System Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–8
Setting Retentive Memory Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–9
Using a Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–10
CPU Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–11
CPU Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–11
Program Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–12
Run Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–12
Read Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–13
Service Peripherals and Force I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–13
Update Special Relays and Special Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–14
Solve Application Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–14
Write Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–15
Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–15

vi DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–15


Is Timing Important for Your Application? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–15
Normal Minimum I/O Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–15
Normal Maximum I/O Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–16
Improving Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–17
CPU Scan Time Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–18
Reading Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–18
Writing Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–18
Application Program Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–19
PLC Numbering Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–20
PLC Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–20
V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–21
Binary-Coded Decimal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–21
Hexadecimal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–21
Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–22
Octal Numbering System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–22
Discrete and Word Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–22
V-memory Locations for Discrete Memory Areas . . . . . . . . . . . . . . . . . . . . . . . . . .4–22
Input Points (X Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–23
Output Points (Y Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–23
Control Relays (C Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–23
Timers and Timer Status Bits (T Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–23
Timer Current Values (V Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–24
Counters and Counter Status Bits (CT Data type) . . . . . . . . . . . . . . . . . . . . . . . . .4–24
Counter Current Values (V Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–24
Word Memory (V Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–25
Stages (S Data type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–25
Special Relays (SP Data Type) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–25
DL05 System V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–26
System Parameters and Default Data Locations (V Data Type) . . . . . . . . . . . . . . . .4–26
DL05 Memory Map Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–28
DL05 Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–29
X Input Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–30
Y Output Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–30
Stage Control / Status Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–30

DL05 Micro PLC User Manual; 5th Edition, 6/04 vii


TTable of Contents

Control Relay Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–31


Timer Status Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–32
Counter Status Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–32
Network Configuration and Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–33
Configuring the DL05’s Comm Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–33
Networking DL05 to DL05 RS-232C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–33
Networking PC to DL05s RS–422 and to Other PLCs . . . . . . . . . . . . . . . . . . . . . . .4–34
MODBUS Port Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–35
DirectNET Port Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–36
Network Slave Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–37
MODBUS Function Codes Supported . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–37
Determining the MODBUS Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–37
If Your Host Software Requires the Data Type and Address... . . . . . . . . . . . . . . . . .4–38
Example 1: V2100 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–39
Example 2: Y20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–39
Example 3: T10 Current Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–39
Example 4: C54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–39
If Your MODBUS Host Software Requires an Address ONLY . . . . . . . . . . . . . . . . . .4–40
Example 1: V2100 584/984 Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–42
Example 2: Y20 584/984 Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–42
Example 3: T10 Current Value 484 Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–42
Example 4: C54 584/984 Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–42
Network Master Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–43
Step 1: Identify Master Port # and Slave # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–44
Step 2: Load Number of Bytes to Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–44
Step 3: Specify Master Memory Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–45
Step 4: Specify Slave Memory Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–45
Communications from a Ladder Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–46
Multiple Read and Write Interlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–46

Chapter 5: Ctandard RLL Instructions . . . . . . . . . . . . . . . . . . . . . . . . .5–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–2
Using Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–4
END Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–4

viii DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

Simple Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–4


Normally Closed Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–4
Contacts in Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–5
Midline Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–5
Parallel Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–5
Joining Series Branches in Parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–6
Joining Parallel Branches in Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–6
Combination Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–6
Comparative Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–6
Boolean Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–7
Immediate Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–8
Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–9
Comparative Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–25
Immediate Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–31
Timer, Counter and Shift Register Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . .5–35
Using Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–35
Timer Example Using Discrete Status Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–37
Timer Example Using Comparative Contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–37
Accumulating Fast Timer (TMRAF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–38
Accumulating Timer Example using Discrete Status Bits . . . . . . . . . . . . . . . . . . . . .5–39
Accumulator Timer Example Using Comparative Contacts . . . . . . . . . . . . . . . . . . .5–39
Using Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–40
Counter Example Using Discrete Status Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–42
Counter Example Using Comparative Contacts . . . . . . . . . . . . . . . . . . . . . . . . . . .5–42
Stage Counter Example Using Discrete Status Bits . . . . . . . . . . . . . . . . . . . . . . . . .5–44
Stage Counter Example Using Comparative Contacts . . . . . . . . . . . . . . . . . . . . . .5–44
Up / Down Counter Example Using Discrete Status Bits . . . . . . . . . . . . . . . . . . . .5–46
Up / Down Counter Example Using Comparative Contacts . . . . . . . . . . . . . . . . . .5–46
Accumulator/Stack Load and Output Data Instructions . . . . . . . . . . . . . . . . . . . .5–48
Using the Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–48
Copying Data to the Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–48
Changing the Accumulator Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–49
Using the Accumulator Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–50
Using Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–51

DL05 Micro PLC User Manual; 5th Edition, 6/04 ix


TTable of Contents

Pop Instruction Continued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–59


Logical Instructions (Accumulator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–60
Math Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–68
Bit Operation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–82
Number Conversion Instructions (Accumulator) . . . . . . . . . . . . . . . . . . . . . . . . . .5–87
Shuffle Digits Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–94
Table Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–96
Copy Data From a Data Label Area to V-memory . . . . . . . . . . . . . . . . . . . . . . . . .5–98
CPU Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–99
Program Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–101
Understanding Master Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–106
MLS/MLR Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–107
Interrupt Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–108
External Interrupt Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–109
Timed Interrupt Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–110
Independent Timed Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–110
Message Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–111
Fault (FAULT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–111
Fault Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–111
Data Label Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–113
Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–118

Chapter 6: Drum Instruction Programming . . . . . . . . . . . . . . . . . . . .6–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–2
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–2
Drum Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–2
Drum Chart Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–3
Output Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–3
Step Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–4
Drum Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–4
Timer-Only Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–4
Timer and Event Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–5
Event-Only Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–6

x DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

Counter Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–6


Last Step Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–7
Overview of Drum Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–8
Drum Instruction Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–8
Powerup State of Drum Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–9
Drum Control Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–10
Drum Control Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–10
Self-Resetting Drum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–11
Initializing Drum Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–11
Using Complex Event Step Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–11
Drum Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–12
Timed Drum with Discrete Outputs (DRUM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–12
Event Drum (EDRUM) Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–14
Handheld Programmer Drum Mnemonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–16

Chapter 7: RLLPLUS Stage Programming . . . . . . . . . . . . . . . . . . . . . .7–1


Introduction to Stage Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–2
Overcoming “Stage Fright” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–2
Learning to Draw State Transition Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–3
Introduction to Process States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–3
The Need for State Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–3
A 2–State Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–3
RLL Equivalent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–4
Stage Equivalent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–4
Let’s Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–5
Initial Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–5
What Stage Bits Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–6
Stage Instruction Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–6
Using the Stage Jump Instruction for State Transitions . . . . . . . . . . . . . . . . . . . . .7–7
Stage Jump, Set, and Reset Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–7
Stage Program Example: Toggle On/Off Lamp Controller . . . . . . . . . . . . . . . . . . .7–8
A 4–State Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–8
Four Steps to Writing a Stage Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–9

DL05 Micro PLC User Manual; 5th Edition, 6/04 xi


TTable of Contents

Stage Program Example: A Garage Door Opener . . . . . . . . . . . . . . . . . . . . . . . . .7–10


Garage Door Opener Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–10
Draw the Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–10
Draw the State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–11
Add Safety Light Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–12
Modify the Block Diagram and State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–12
Using a Timer Inside a Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–13
Add Emergency Stop Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–14
Exclusive Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–14
Stage Program Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–15
Stage Program Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–15
How Instructions Work Inside Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–16
Using a Stage as a Supervisory Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–17
Stage Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–17
Power Flow Transition Technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–18
Stage View in DirectSOFT32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–18
Parallel Processing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–19
Parallel Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–19
Converging Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–19
Convergence Stages (CV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–19
Convergence Jump (CVJMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–20
Convergence Stage Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–20
RLLPLUS (Stage) Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–21
Stage (SG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–21
Initial Stage (ISG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–22
JUMP (JMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–22
Not Jump (NJMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–22
Converge Stage (CV) and Converge Jump (CVJMP) . . . . . . . . . . . . . . . . . . . . . . . .7–23
Questions and Answers about Stage Programming . . . . . . . . . . . . . . . . . . . . . . .7–25

Chapter 8: PID Loop Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–1


DL05 PID Loop Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–2
Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–2
The Basics of PID Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–4

xii DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

Loop Setup Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–6


Loop Table and Number of Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–6
PID Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–6
Establishing the Loop Table Size and Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–7
Loop Table Word Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–8
PID Mode Setting 1 Bit Descriptions (Addr + 00) . . . . . . . . . . . . . . . . . . . . . . . . . . .8–9
PID Mode Setting 2 Bit Descriptions (Addr + 01) . . . . . . . . . . . . . . . . . . . . . . . . . .8–10
Mode/Alarm Monitoring Word (Addr + 06) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–11
Ramp/Soak Table Flags (Addr + 33) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–11
Ramp/Soak Table Location (Addr + 34) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–12
Ramp/Soak Table Programming Error Flags (Addr + 35) . . . . . . . . . . . . . . . . . . . .8–12
Loop Sample Rate and Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–13
Loop Sample Rates Addr + 07 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–13
Choosing the Best Sample Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–13
Determining a suitable sample rate (Addr+07): . . . . . . . . . . . . . . . . . . . . . . . . . . .8–14
Programming the Sample Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–14
PID Loop Effect on CPU Scan Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–15
Ten Steps to Successful Process Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–17
Basic Loop Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–19
Data Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–19
Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–19
Direct Access to Analog I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–20
Loop Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–21
CPU Modes and Loop Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–22
How to Change Loop Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–23
Operator Panel Control of PID Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–24
PLC Modes’ Effect on Loop Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–24
Loop Mode Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–24
Bumpless Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–25
PID Loop Data Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–26
Loop Parameter Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–26
Choosing Unipolar or Bipolar Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–26
Handling Data Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–27
Setpoint (SP) Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–27
Remote Setpoint (SP) Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–28

DL05 Micro PLC User Manual; 5th Edition, 6/04 xiii


TTable of Contents

Process Variable (PV) Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–28


Control Output Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–29
Error Term Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–30
PID Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–31
Position Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–31
Velocity Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–32
Direct-Acting and Reverse-Acting Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–33
P-I-D Loop Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–34
Using a Subset of PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–35
Derivative Gain Limiting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–36
Bias Term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–36
Bias Freeze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–37
Loop Tuning Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–38
Open-Loop Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–38
Manual Tuning Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–39
Auto Tuning Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–40
Tuning Cascaded Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–44
PV Analog Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–45
The DL05 Built-in Analog Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–45
Creating an Analog Filter in Ladder Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–46
Feedforward Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–47
Feedforward Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–48
Time-Proportioning Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–49
On/Off Control Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–50
Cascade Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–51
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–51
Cascaded Loops in the DL05 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–52
Process Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–53
PV Absolute Value Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–54
PV Deviation Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–54
PV Rate-of-Change Alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–55
PV Alarm Hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–56
Alarm Programming Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–56
Loop Calculation Overflow/Underflow Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–56

xiv DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

Ramp/Soak Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–57


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–57
Ramp/Soak Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–58
Ramp/Soak Table Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–60
Ramp/Soak Generator Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–60
Ramp/Soak Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–60
Ramp/Soak Profile Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–61
Ramp/Soak Programming Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–61
Testing Your Ramp/Soak Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–61
Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–62
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–63
Glossary of PID Loop Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–64

Chapter 9: Maintenance and Troubleshooting . . . . . . . . . . . . . . . . . .9–1


Hardware System Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
Standard Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
Fatal Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
Non-fatal Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
V-memory Error Code Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–3
Special Relays (SP) Corresponding to Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . .9–3
DL05 Micro PLC Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–4
Program Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–5
CPU Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–6
RUN Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–7
CPU Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–7
Communications Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–7
I/O Point Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–8
Possible Causes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–8
Some Quick Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–8
Handheld Programmer Keystrokes Used to Test an Output Point . . . . . . . . . . . . . . .9–9
Noise Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–10

DL05 Micro PLC User Manual; 5th Edition, 6/04 xv


TTable of Contents

Electrical Noise Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–10


Reducing Electrical Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–10
Machine Startup and Program Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . .9–11
Syntax Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–11
Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–12
Duplicate Reference Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–13
Run Time Edits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–14
Forcing I/O Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–16
Bit Forcing with Direct Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–16

Chapter 10: Memory Cartridge/Real Time Clock . . . . . . . . . . . . . . .10–1


General Information about the D0–01MC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
Jumper Selects Write Enable or Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
Low Battery Alert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
Clock/Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
New Ladder Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
Error Code Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–2
Setting the Write Enable/Disable Jumper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–3
Write Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–3
Write Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–3
Plugging-in the Memory Cartridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–4
Remove the Slot Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–4
Insert the Memory Cartridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–4
Software and Firmware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–5
How to Update Your DirectSOFT32 Programming Software . . . . . . . . . . . . . . . . .10–5
How to Update Your DL05 Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–5
Naming the Memory Cartridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–6
Up to 8 Alphanumeric Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–6
Name is Retained in Cartridge Memory and Project Folder . . . . . . . . . . . . . . . . . .10–6
Setting the Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–7
Memory Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–8
CPU to MC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–8
MC to CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–8

xvi DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

LED Indicator Lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–9


Password Protected Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–9
Memory Map and Forwarding Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–10
Battery Back-up During AC Power Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–11
What if the Battery Dies? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–11
Battery Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–11
Removing and Replacing the Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–11
Specifications and Agency Approvals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–12
Clock/Calendar Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–13
Date (DATE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–13
Time (TIME) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–14
Move Memory Cartridge / Load Label (MOVMC) (LDLBL) . . . . . . . . . . . . . . . . . .10–15
Copy Data From a Data Label Area to V-memory . . . . . . . . . . . . . . . . . . . . . . . .10–16
Copy Data From V-memory to a Data Label Area . . . . . . . . . . . . . . . . . . . . . . . .10–17
Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–18

Appendix A: Auxiliary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–2
Purpose of Auxiliary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–2
Accessing AUX Functions via DirectSOFT32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–3
Accessing AUX Functions via the Handheld Programmer . . . . . . . . . . . . . . . . . . . . .A–3
AUX 2* — RLL Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 21 Check Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 22 Change Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 23 Clear Ladder Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 24 Clear Ladders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 3* — V-memory Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 31 Clear V-Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 4* — I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 41 Show I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 5* — CPU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5
AUX 51 Modify Program Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5
AUX 53 Display Scan Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5

DL05 Micro PLC User Manual; 5th Edition, 6/04 xvii


TTable of Contents

AUX 54 Initialize Scratchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5


AUX 55 Set Watchdog Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5
AUX 56 CPU Network Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5
AUX 57 Set Retentive Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–6
AUX 58 Test Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–6
AUX 59 Bit Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–6
AUX 5B Counter Interface Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–7
AUX 5D Select PLC Scan Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–7
AUX 6* — Handheld Programmer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 61 Show Revision Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 62 Beeper On/Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 65 Run Self Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 7* — EEPROM Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
Transferrable Memory Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 71 CPU to HPP EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 72 HPP EEPROM to CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 73 Compare HPP EEPROM to CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 74 HPP EEPROM Blank Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 75 Erase HPP EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 76 Show EEPROM Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 8* — Password Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 81 Modify Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
AUX 82 Unlock CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–10
AUX 83 Lock CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–10

Appendix B: DL05 Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .B–1

Appendix C: Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . .C–1


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–2
V-memory Data Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–2
V-memory Bit Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–2
How to Read the Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–2
Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–3
Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–3

xviii DL05 Micro PLC User Manual; 5th Edition, 6/04


Table of Contents

Comparative Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–4


Immediate Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–10
Timer, Counter and Shift Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–10
Accumulator Data Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–11
Logical Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–12
Math Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–12
Bit Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–14
Number Conversion Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–14
Table Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–14
CPU Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–15
Program Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–15
Interrupt Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–15
Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–15
Message Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–16
RLL plus Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–16
Drum Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–16

Appendix D: Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D–1


DL05 PLC Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D–2

Appendix E: Product Weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .E–1


Product Weight Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .E–2

Appendix F: PLC Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .F-1


DL05 PLC Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .F-2

Appendix G: European Union Directives (CE) . . . . . . . . . . . . . . . . . .G–1


European Union (EU) Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-2
Member Countries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-2
Applicable Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-2
Compliance G-2
Special Installation Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-3
Other Sources of Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-4
Basic EMC Installation Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-4
Enclosures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-4

DL05 Micro PLC User Manual; 5th Edition, 6/04


xix
TTable of Contents

AC Mains Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-5


Suppression and Fusing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-5
Internal Enclosure Grounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-5
Equi–potential Grounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-6
Communications and Shielded Cables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-6
Analog and RS232 Cables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-7
Multidrop Cables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-7
Shielded Cables within Enclosures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-7
Network Isolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-7
For Communication Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-8
For I/O Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-8
DC Powered Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-8
Items Specific to the DL05 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-9

Index

xx DL05 Micro PLC User Manual; 5th Edition, 6/04


CHAPTER
GETTING STARTED
1
In This Chapter:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
Conventions Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–3
DL05 Micro PLC Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–4
Programming Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–4
I/O Selection Quick Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1–5
Quick Start for PLC Checkout and Programming . . . . . . . . . . . . . . .1–6
Steps to Designing a Successful System . . . . . . . . . . . . . . . . . . . . .1–10
Questions and Answers about DL05 Micro PLCs . . . . . . . . . . . . . .1–12
Chapter 1: Getting Started

1 Introduction
The Purpose of this Manual
2 Thank you for purchasing a DL05 Micro PLC. This manual shows you how to install,
program, and maintain all the Micro PLCs in the DL05 family. It also helps you understand
3 how to interface them to other devices in a control system.This manual contains important
information for personnel who will install DL05 PLCs, and for the PLC programmer. If you
D understand PLC systems our manuals will provide all the information you need to get and
keep your system up and running.

5 Where to Begin
If you already understand the DL05 Micro PLC please read Chapter 2, “Installation, Wiring,
and Specifications”, and proceed on to other chapters as needed. Be sure to keep this manual
6 handy for reference when you run into questions. If you are a new DL05 customer, we
suggest you read this manual completely so you can understand the wide variety of features in
7 the DL05 family of products. We believe you will be pleasantly surprised with how much you
can accomplish with AutomationDirect™ products.
8 Supplemental Manuals
The D0–OPTIONS–M manual will be most helpful to select and use any of the optional
9 modules that are available for the DL05 PLC which includes the analog I/O modules. If you
have purchased operator interfaces or DirectSOFT32 you will need to supplement this
manual with the manuals that are written for these products.
10 Technical Support
11 We realize that even though we strive to be the best, we may have arranged our information
in such a way you cannot find what you are looking for. First, check these resources for help
in locating the information:
12 • Table of Contents – chapter and section listing of contents, in the front of this manual
• Appendices – reference material for key topics, near the end of this manual
13 You can also check our online resources for the latest product support information:
• Internet – the address of our website is: http://www.automationdirect.com
14 If you still need assistance, please call us at 770–844–4200. Our technical support team will
be available to work with you in answering your questions. They are available Monday
A through Friday from 9:00 A.M. to 6:00 P.M. Eastern Standard Time. If you have a comment
or question about any of our products, services, or manuals, please fill out and return the
B ‘Suggestions’ card that was shipped with this manual.

C
D

1–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 1: Getting Started

Conventions Used 1
2
When you see the “notepad” symbol in the left-hand margin, the paragraph to its
immediate right will be a special note. 3
The word NOTE: in boldface will mark the beginning of the text.
D
5
6
When you see the “exclamation mark” symbol in the left-hand margin, the
paragraph to its immediate right will be a warning. This information could
prevent injury, loss of property, or even death (in extreme cases).
7
The word WARNING: in boldface will mark the beginning of the text.
8
9
10
Key Topics for Each Chapter
11
1
The beginning of each chapter will list the key topics
that can be found in that chapter. 12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–3


Chapter 1: Getting Started

1 DL05 Micro PLC Components


The DL05 Micro PLC family is a versatile product line that
2 provides a wide variety of DL05 Micro PLC components
The DL05 Micro PLC family is a versatile product line that
provides a wide variety of features in a very compact
3 footprint. The PLCs are small, yet offer many features PW
RU
CP
TX1
1
R
N
U

usually found in larger, more expensive systems. These


RX
TX2
2
RX

D include a removable connector, and two RS-232C


communication ports.

5 The DL05 Micro PLC Family


The DL05 Micro PLC family includes eight different versions. All have the same appearance
and CPU performance. The CPU offers the same instruction set as our popular DL240 CPU,
6 plus several more instructions specifically designed for machine control applications. All
DL05 PLCs have two RS–232C communications ports. Units with DC inputs have
7 selectable high-speed input features on three input points. Units with DC outputs offer
selectable pulse output capability on the first and second output points. All DL05 Micro
8 PLCs offer a large amount of program memory, a substantial instruction set and advanced
diagnostics. Details of these features and more are covered in Chapter 4, CPU Specifications
and Operation. The eight types of DL05 Micro PLCs provide a variety of Input/Output
9 choices, listed in the following table.
DL05 Micro PLC Family
10 DL05 Part Discrete Input Discrete Output External Power High-Speed Pulse Output
Number Type Type Input
11 D0–05AR
D0–05DR
AC
DC
Relay
Relay
95–240 VAC
95–240 VAC
No
Yes
No
No
D0–05AD AC DC 95–240 VAC No Yes
12 D0–05DD DC DC 95–240 VAC Yes Yes
D0–05AA AC AC 95–240 VAC No No
13 D0–05DA
D0–05DR–D
DC
DC
AC
Relay
95–240 VAC
12–24 VDC
Yes
Yes
No
No
D0–05DD–D DC DC 12–24 VDC Yes Yes
14
Programming Methods
A Two programming methods are available: RLL (Relay Ladder Logic) and RLL . RLL PLUS PLUS

combines the added feature of flow chart programming (Stage) to the standard RLL language.
B Both the DirectSOFT32 programming package and the handheld programmer support
RLL as well as standard RLL instructions.
PLUS

C DirectSOFT32 Programming for Windows™


The DL05 Micro PLC can be programmed with one of the most advanced programming
D packages in the industry ––DirectSOFT32, a Windows-based software package that supports
familiar features such as cut-and-paste between applications, point-and-click editing, viewing
and editing multiple application programs at the same time, etc.

1–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 1: Getting Started

DirectSOFT32 universally supports the DirectLOGIC CPU families. This means you can use
the full version of DirectSOFT32 to program DL05, DL06, DL105, DL205, DL305, 1
DL405 or any new CPUs we may add to our product line. (Upgrade software may be
required for new CPUs as they become available.) A separate manual discusses DirectSOFT32
programming software. DirectSOFT32 version 2.4 or later is needed to program the DL05.
2
Handheld Programmer
All DL05 Micro PLCs have built-in programming ports for use with the handheld
3
programmer (D2–HPP), the same programmer used with the DL06, DL105 and DL205
families. The handheld programmer can be used to create, modify and debug your D
application program. A separate manual discusses the Handheld Programmer. Only
D2–HPPs with firmware version 1.09 or later will program the DL05. 5
I/O Selection Quick Chart 6
The eight versions of the DL05 have Input/Output circuits which can interface to a wide
variety of field devices. In several instances a particular Input or Output circuit can interface
to either DC or AC voltages, or both sinking and sourcing circuit arrangements. Check this
7
chart carefully to find the proper DL05 Micro PLC to interface to the field devices in your
application. 8
I/O Selection Chart 9
INPUTS OUTPUTS
DL05 Part
Number I/O type/
commons Sink/Source
Voltage
Ranges
I/O type/ Sink/Source
commons Voltage/ Current Ratings 10
6 – 27VDC, 2A*
D0–05AR AC / 2 – 90 – 120 VAC Relay / 2 Sink or Source 6 – 240 VAC, 2A *
6 – 27VDC, 2A*
11
D0–05DR DC / 2 Sink or Source 12 – 24 VDC Relay / 2 Sink or Source 6 – 240 VAC, 2A *
D0–05AD AC / 2 – 90 – 120 VAC DC / 1 Sink 6 – 27 VDC, 0.5A (Y0–Y2)
6 – 27 VDC, 1.0A (Y3–Y5)
12
6 – 27 VDC, 0.5A (Y0–Y2)
D0–05DD DC / 2 Sink or Source 12 – 24 VDC DC / 1 Sink
D0–05AA AC / 2 – 90 – 120 VAC AC / 2 –
6 – 27 VDC, 1.0A (Y3–Y5)
17 – 240 VAC, 47 – 63 Hz 0.5A*
13
D0–05DA DC / 2 Sink or Source 12 – 24 VDC AC / 2 – 17 – 240 VAC, 47 – 63 Hz 0.5A *
D0–05DR–D DC / 2 Sink or Source 12 – 24 VDC Relay / 2 Sink or Source 6 – 27 VDC, 2A
6 – 240 VAC, 2A *
14
6 – 27 VDC, 0.5A (Y0–Y2)
D0–05DD–D DC / 2 Sink or Source 12 – 24 VDC DC / 1 Sink 6 – 27 VDC, 1.0A (Y3–Y5) A
* See Chapter 2 Specifications for your particular DL05 version.
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–5


Chapter 1: Getting Started

1 Quick Start for PLC Checkout and Programming


If you have experience with PLCs, or if you just want to setup a quick example, this example
2 is for you! This example is not intended to tell you everything you need to start-up your
system, warnings and helpful tips are in the rest of the manual. It is only intended to give you
a general picture of what you will need to do to get your system powered-up.
3 Step 1: Unpack the DL05 Equipment
Unpack the DL05 and gather the parts necessary to build this demonstration system. The
D recommended components are:
• DL05 Micro PLC
5 • AC power cord or DC power supply
• Toggle switches (see Step 2 on next page).
6 • Hook-up wire, 16-22 AWG
• DL05 User Manual (this manual)
7 • A small screwdriver, 5/8” flat or #1 Philips type
You will need at least one of the following programming options:
8 • DirectSOFT32 Programming Software, DirectSOFT32 Manual, and a programming cable
(connects the DL05 to a personal computer),or
9 • D2-HPP Handheld Programmer (comes with programming cable), and the Handheld Programmer
Manual
10
11
12 PW
RU
CP
R
N
U

TX1
1
RX

13
TX2
2
RX

14
A
B
C
D

1–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 1: Getting Started

Step 2: Connect Switches to Input Terminals


To finish this quick-start exercise or study other examples in this manual, you’ll need to
1
connect some input switches as shown below. If you have DC inputs you will need to use the
FA–24PS (24VDC) or another external 12-24VDC power supply. Be sure to follow the 2
instructions in the accompanying WARNING note.

D0–05DR, D0–05DD, D0–05DA


3
D0–05DR–D, D0–05DD–D
(DC input versions, 12–24VDC) D
5
6
7
– 8
+

12–24VDC 9
Power Supply Toggle Switches, UL Listed
10
D0–05AR, D0–05AD, D0–05AA
(AC input versions, 120VAC only)
11
12
13
WARNING: DO NOT wire
the toggle switches as shown to 14
240VAC-powered units. The
discrete inputs will only accept
120VAC nominal. Also,
A
remove power and unplug the
DL05 when wiring the B
switches. Only use UL-
approved switches rated for at C
Firmly mount the switches
before using.
D
Toggle Switches, UL Listed

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–7


Chapter 1: Getting Started

Step 3: Connect the Power Wiring


1 Connect the power input wiring for the DL05. Observe all precautions stated earlier in this
manual. For more details on wiring, see Chapter 2 on Installation, Wiring, and Specifications.
2 When the wiring is complete, close the connector covers. Do not apply power at this time

3 110/220 VAC Power Input 12/24 VDC Power Input

D
+ –

5
6
7
8 LG N
95 – 240 VAC
+G –
12 – 24 VDC

9 Step 4: Connect the Programming Device


Most programmers will use DirectSOFT32 programming software, installed on a personal
10 computer. Or, you may need the portability of the Handheld Programmer. Both devices will
connect to COM port 1 of the DL05 via the appropriate cable.

11
12
13
Use cable part #
14 D2–DSCBL

A
B (cable comes with HPP)

For replacement
C cable, use part #
DV–1000CBL

1–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 1: Getting Started

Step 5: Switch on the System Power


Apply power to the system and ensure the PWR indicator on the DL05 is on. If not, remove 1
power from the system and check all wiring and refer to the troubleshooting section in
Chapter 9 for assistance. 2
Step 6: Initialize Scratchpad Memory
It’s a good precaution to always clear the system memory (scratchpad memory) on a new 3
DL05. There are two ways to clear the system memory:
• In DirectSOFT32, select the PLC menu, then Setup, then Initialize Scratchpad. For additional
information, see the DirectSOFT32 Manual.
D
• For the Handheld Programmer, use the AUX key and execute AUX 54.
See the Handheld Programmer Manual for additional information.
5
Step 7: Enter a Ladder Program 6
At this point, DirectSOFT32 programmers need to refer to the Quick Start Tutorial in the
DirectSOFT32 Manual. There you will learn how to establish a communications link with
the DL05 PLC, change CPU modes to Run or Program, and enter a program. If you are
7
learning how to program with the Handheld Programmer, make sure the CPU is in Program
Mode (the RUN LED on the front of the DL05 should be off ). If the RUN LED is on, use 8
the MODE key on the Handheld Programmer to put the PLC in Program Mode. Enter the
following keystrokes on the Handheld Programmer. 9
10
Clear the Program
Equivalent DirectSOFT display
C
CLR

E
CLR
11
AUX ENT ENT CLR
X0 Y0 2 4

OUT 12
$ A Move to the first
NEXT ENT

END
STR 0 address and enter
X0 contact 13
Enter output Y0
GX
OUT
A
0
ENT
14
SHFT E
4
N
TMR
D
3
ENT
Enter the END
statement A
After entering the simple example program put the PLC in Run mode by using the Mode key
on the Handheld Programmer.
B
The RUN indicator on the PLC will illuminate indicating the CPU has entered the Run
mode. If not, repeat this step, ensuring the program is entered properly or refer to the
C
troubleshooting guide in chapter 8.
After the CPU enters the run mode, the output status indicator for Y0 should follow the
D
switch status on input channel X0. When the switch is on, the output will be on.

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–9


Chapter 1: Getting Started

1 Steps to Designing a Successful System


Step 1: Review the Installation Guidelines
2 Always make safety the first priority in any system
design. Chapter 2 provides several guidelines that
3 will help you design a safer, more reliable system.
This chapter also includes wiring guidelines for the
D various versions of the DL05 PLC.

5
Step 2: Understand the PLC Setup Procedures
6 The PLC is the heart of your automation system.
Make sure you take time to understand the various
7 features and setup requirements.
PW
RU
CP
TX1
RX
1

TX2
R
N
U

2
RX

8
9 Step 3: Review the I/O Selection Criteria Input
PLC

There are many considerations involved when you


10 select your I/O type and field devices. Take time to +
Input
understand how the various types of sensors and – Sensing

11 loads can affect your choice of I/O type. Common

12 AC
Step 4: Choose a System Wiring Strategy Power

13 It is important to understand the various


DL05
Loads

system design options that are available before PLC


Power Input 6 Outputs Commons

14 wiring field devices and field-side power


supplies to the Micro PLC.
+24 VDC
8 Inputs Commons

+ –

A
B Step 5: Understand the System Operation
Before you begin to enter a program, it is very
helpful to understand how the DL05 system
C processes information. This involves not only
Power Up

program execution steps, but also involves the Initialize Hardware

D various modes of operation and memory


layout characteristics.

1–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 1: Getting Started

Step 6: Review the Programming Concepts


The DL05 PLC instruction set provides for three main approaches to solving the application
1
program, depicted in the figure below.
• RLL diagram-style programming is the best tool for solving boolean logic and general CPU 2
register/accumulator manipulation. It includes dozens of instructions, which will also be needed to
augment drums and stages.
• The Timer/Event Drum Sequencer features up to 16 steps and offers both time and/or event-based
3
step transitions. The DRUM instruction is best for a repetitive process based on a single series of
steps. D
• Stage programming (also called RLLPlus) is based on state-transition diagrams. Stages divide the
ladder program into sections which correspond to the states in a flow chart you draw for your
process.
5
Standard RLL Programming Timer/Event Drum Sequencer Stage Programming
6
(see Chapter 5) (see Chapter 6) (see Chapter 7)
7
Push–UP RAISE
X0
LDD
V1076 8
DOWN LIGHT UP
CMPD

SP62
K309482
Y0
LOWER Push–
9
OUT DOWN

After reviewing the programming concepts above, you’ll be equipped with a variety of tools to 10
write your application program.
Step 7: Choose the Instructions 11
Once you have installed the Micro PLC and
understand the main programming concepts, you
TMR
K30
T1
12
can begin writing your application program. At CNT CT3
that time you will begin to use one of the most
powerful instruction sets available in a small PLC.
K10
13
14
Step 8: Understand the Maintenance and
Troubleshooting Procedures
A
Sometimes equipment failures occur when we least
expect it. Switches fail, loads short and need to be B
replaced, etc. In most cases, the majority of the
troubleshooting and maintenance time is spent PW
RU
R
N
U
C
trying to locate the problem. The DL05 Micro
CP
TX1
1
RX
TX2

PLC has many built-in features such as error codes


D
2
RX

that can help you quickly identify problems.

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–11


Chapter 1: Getting Started

1 Questions and Answers about DL05 Micro PLCs


Q. What is the instruction set like?
2 A. The instruction set is very close to our popular DL240 CPU. However, there are
significant additions, such as the drum instruction, networking, and High-Speed I/O
3 capabilities.
Q. Do I have to buy the full DirectSOFT32 programming package to program
D the DL05?
A. No. We offer a DL05-specific version of DirectSOFT32 that’s very affordable.
5 Q. Is the DL05 expandable?
A. No, the DL05 series are stand-alone PLCs, they do not have expansion bases, such as, our
6 DL205 system which does have expansion bases, yet very compact and affordable.
Q. Does the DL05 have motion control capability?
7 A. Yes. The High-Speed I/O features offer either encoder inputs with high-speed counting
and presets with interrupt, or a pulse/direction output for stepper control. Three types of
8 motion profiles are available, which are explained in Chapter 3.
Q. Are the ladder programs stored in a removable EEPROM?
9 A. The DL05 contains a non-removable FLASH memory for program storage, which may be
written and erased thousands of times. You may transfer programs to/from DirectSOFT on
10 a PC, or the HPP (which does support a removable EEPROM).
Q. Does the DL05 contain fuses for its outputs?
11 A. There are no output circuit fuses. Therefore, we recommend fusing each channel, or fusing
each common. See Chapter 2 for I/O wiring guidelines.
12 Q. Is the DL05 Micro PLC U.L. approved?
A. The Micro PLC has met the requirements of UL (Underwriters’ Laboratories, Inc.), and
13 CUL (Canadian Underwriters’ Laboratories, Inc.).
Q. Does the DL05 Micro PLC comply with European Union (EU) Directives?
14 A. The Micro PLC has met the requirements of the European Union Directives (CE).

A
B
C
D

1–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 1: Getting Started

Q. Which devices can I connect to the communication ports of the DL05?


A. Port 1: The port is RS-232C, fixed at 9600 baud, and uses the proprietary K-sequence 1
protocol. The DL05 can also connect to MODBUS and DirectNET networks as a slave
device through port 1. The port communicates with the following devices: 2
• DV-1000 Data Access Unit or Optimation Operator interface panels
• DirectSOFT32 (running on a personal computer) 3
• D2-HPP handheld programmer
• Other devices which communicate via K-sequence protocol should work with the DL05 Micro
PLC. Contact the vendor for details.
D
A. Port 2: The port is RS-232C, with selective baud rates (300-38,400bps), address and
parity.It also supports the proprietary K-sequence protocol as well as DirectNET and Modbus
5
and non-sequence/print protocols.
Q. Can the DL05 accept 5VDC inputs?
6
A. No, 5 volts is lower than the DC input ON threshold. However, many TTL logic circuits
can drive the inputs if they are wired as open collector (sinking) inputs. See Chapter 2 for I/O
7
wiring guidelines.
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–13


INSTALLATION, WIRING, CHAPTER
AND SPECIFICATIONS
2
In This Chapter:
Safety Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–2
Orientation to DL05 Front Panel . . . . . . . . . . . . . . . . . . . . . . . . . . .2–4
Mounting Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–6
Wiring Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–10
System Wiring Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2–13
Glossary of Specification Terms . . . . . . . . . . . . . . . . . . . . . . . . . . .2–25
Wiring Diagrams and Specifications . . . . . . . . . . . . . . . . . . . . . . . .2–26
Chapter 2: Installation, Wiring, and Specifications

A Safety Guidelines
2 NOTE: Products with CE marks perform their required functions safely and adhere to relevant standards as
specified by CE directives provided they are used according to their intended purpose and that the
instructions in this manual are adhered to. The protection provided by the equipment may be impaired if
3 this equipment is used in a manner not specified in this manual. A listing of our international affiliates is
availble on our Web site: http://www.automationdirect.com

D WARNING: Providing a safe operating environment for personnel and equipment is your
responsibility and should be your primary goal during system planning and installation.
5 Automation systems can fail and may result in situations that can cause serious injury to
personnel or damage to equipment. Do not rely on the automation system alone to provide a
safe operating environment. You should use external electromechanical devices, such as relays
6 or limit switches, that are independent of the PLC application to provide protection for any
part of the system that may cause personal injury or damage. Every automation application is
7 different, so there may be special requirements for your particular application. Make sure you
follow all national, state, and local government requirements for the proper installation and
use of your equipment.
8 Plan for Safety
9 The best way to provide a safe operating environment is to make personnel and equipment
safety part of the planning process. You should examine every aspect of the system to
determine which areas are critical to operator or machine safety. If you are not familiar with
10 PLC system installation practices, or your company does not have established installation
guidelines, you should obtain additional information from the following sources.
11 • NEMA — The National Electrical Manufacturers Association, located in Washington, D.C.,
publishes many different documents that discuss standards for industrial control systems. You can
order these publications directly from NEMA. Some of these include:
12 ICS 1, General Standards for Industrial Control and Systems
ICS 3, Industrial Systems
13 ICS 6, Enclosures for Industrial Control Systems
• NEC — The National Electrical Code provides regulations concerning the installation and use of
various types of electrical equipment. Copies of the NEC Handbook can often be obtained from your
14 local electrical equipment distributor or your local library.
• Local and State Agencies — many local governments and state governments have additional
A requirements above and beyond those described in the NEC Handbook. Check with your local
Electrical Inspector or Fire Marshall office for information.

B Three Levels of Protection


The publications mentioned provide many ideas and requirements for system safety. At a
minimum, you should follow these regulations. Also, you should use the following
C techniques, which provide three levels of system control.
• Orderly system shutdown sequence in the PLC control program
D • Mechanical disconnect for output module power
• Emergency stop switch for disconnecting system power

2–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Orderly System Shutdown


The first level of fault detection is ideally the PLC control A
program, which can identify machine problems. You must
shutdown sequences that must be performed. These types
of problems are usually things such as jammed parts, etc.
2
that do not pose a risk of personal injury or equipment
damage. Turn off
3
Jam
Saw
WARNING: The control program must not be the only
form of protection for any problems that may result in a
Detect
RST D
risk of personal injury or equipment damage.
System Power Disconnect
RST
Retract
5
You should also use electromechanical devices, such as master control relays and/or limit
switches, to prevent accidental equipment startup at an unexpected time. These devices 6
should be installed in such a manner to prevent any machine operations from occurring.
For example, if the machine has a jammed part the PLC control program can turn off the saw 7
blade and retract the arbor. However, since the operator must open the guard to remove the
part, you should also include a bypass switch that disconnects all system power any time the
guard is opened.
8
Emergency Stop
The machinery must provide a quick manual method of disconnecting all system power. The
9
disconnect device or switch must be clearly labeled “Emergency Stop”.
Use E-Stop and Master Relay
10
Guard Line Switch
Emergency
Stop
E STOP Power On Guard
Link
Master
Relay 11
&
12
#

13
14
To Disconnect To disconnect PLC Saw
A
PLC Power output circuit ry Arbor

Master Relay Contacts


B
After an Emergency shutdown or any other type of power interruption, there may be
requirements that must be met before the PLC control program can be restarted. For C
example, there may be specific register values that must be established (or maintained from
the state prior to the shutdown) before operations can resume. In this case, you may want to D
use retentive memory locations, or include constants in the control program to ensure a
known starting point.

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–3


Chapter 2: Installation, Wiring, and Specifications

A Orientation to DL05 Front Panel


Most connections, indicators, and labels on the DL05 Micro PLCs are located on its front
2 panel. The communication ports are located on the top side of the PLC. Please refer to the
drawing below.

3
Mode Switch
D Mounting tab
Communication Ports

5 Output Status Indicators

6 Input Status Indicators

Status
7 Indicators

8
9
10 Mounting tab

11 External Power
Inputs
Discrete Input Discrete Output Output Circuit Power Input
Terminals Terminals (for DC output versions only)

12
The upper section of the connector accepts external power connections on the two left-most
13 terminals. From left to right, the next five terminals are one of the input commons (C0) and
input connections X1, X3, X4, and X6. The remaining four connections are an output
14 common (C2) and output terminals Y1, Y3, and Y5.
The lower section of the connector has the chassis ground (G) and the logic ground (LG) on
the two left-most terminals. The next two terminals are for the inputs X0 and X2. Next is the
A other input common (C1) followed by inputs X5 and X7. The last four terminals are for
outputs Y0, Y2, Y4, and the second output common (C3). On DC output units, the end
B terminal on the right accepts power for the output stage.
WARNING: For some applications, field device power may still be present on the terminal
C block even though the Micro PLC is turned off. To minimize the risk of electrical shock,
check all field device power before you expose or remove either connector
D

2–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Connector Removal
wire under a terminal, or two 18 AWG wires (one on each side of the screw). Be All of the
A
terminals for the DL05 are contained on one connector block. In some instances, it may be
desireable to remove the connector block for easy wiring. The connector is designed for easy
2
removal with just a small screwdriver. The drawing below shows the procedure for removal at one
end. 3
Connector Removal
1. Loosen the retention screws on each end of the connector block. D
5
6
7
8
2. From the center of the connector block, pry upward with the screwdriver until the 9
connector is loose.
The terminal block connector on DL05 PLCs has regular screw terminals, which will accept 10
either standard or #1 Philips screwdriver tips. Use No. 16 to 18 AWG solid/stranded wire.
The maximum torque is 0.343Nm (3.036 inch-lbs). 11
Spare terminal block connectors and connector covers may be ordered by individual part
numbers: 12
Spare Parts -Terminal Block and Cover
Part Number
D0–IOCON
Qty Per Package
2
Description
DL05 I/O Terminal Block
13
D0–IOCVR 2 DL05 I/O Terminal Cover
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–5


Chapter 2: Installation, Wiring, and Specifications

A Mounting Guidelines
In addition to the panel layout guidelines, other specifications can affect the definition and
2 installation of a PLC system. Always consider the following:
• Environmental Specifications

3 • Power Requirements
• Agency Approvals

D • Enclosure Selection and Component Dimensions


Unit Dimensions
5 The following diagram shows the outside dimensions and mounting hole locations for all
versions of the DL05. Make sure you follow the installation guidelines to allow proper
spacing from other components.
6 0.39"
10mm

7 3.94"
100mm
0.39"
10mm
2.56"
8 65mm

0.47"
3.34" 12mm

9 85mm

0.71"
18mm

10 1.46"
37mm
4.72"

11 120mm
0.24" mounting tab
6mm
2.68"

12 3.74"
95mm
68mm
(DIN Rail)

13
14 Enclosures
Your selection of a proper enclosure is important to ensure safe and proper operation of your
DL05 system. Applications of DL05 systems vary and may require additional features. The
A minimum considerations for enclosures include:
• Conformance to electrical standards
B • Protection from the elements in an industrial environment
• Common ground reference
C • Maintenance of specified ambient temperature
• Access to equipment
D • Security or restricted access
• Sufficient space for proper installation and maintenance of equipment

2–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Panel Layout & Clearances


There are many things to consider when designing the panel layout. The following items
A
correspond to the diagram shown. Note: there may be additional requirements, depending on your
application and use of other components in the cabinet.
2
1. Mount the PLCs horizontally as shown below to provide proper ventilation. You cannot
mount the DL05 units vertically, upside down, or on a flat horizontal surface. If you place 3
more than one unit in a cabinet, there must be a minimum of 7.2” (183mm) between the
units. D
OK
5
AirFlow
6
2. Provide a minimum clearance of 2” (50mm) between the unit and all sides of the cabinet.
Note, remember to allow for any operator panels or other items mounted in the door.
7
3. There should also be at least 3” (78mm) of clearance between the unit and any wiring
ducts that run parallel to the terminals.
8
Note: There is a minimum clearance requirement
of 2” (51cm) between the panel door or
9
Temperature Probe
any devices mounted in the panel door)
and the nearest DL05 component. 10
2"
50mm
min
11
Power Source
2"
12
50mm

13
min
Panel Ground braid
copper lugs Panel Ground Terminal 2"
50mm
min

BusB
ar
14
Panel or single
Star Washers Star Washers point ground

4. The ground terminal on the DL05 base must be connected to a single point ground. Use
A
copper stranded wire to achieve a low impedance. Copper eye lugs should be crimped and
soldered to the ends of the stranded wire to ensure good surface contact. B
5. There must be a single point ground (i.e. copper bus bar) for all devices in the panel
requiring an earth ground return. The single point of ground must be connected to the panel C
ground termination. The panel ground termination must be connected to earth ground.
Minimum wire sizes, color coding, and general safety practices should comply with
appropriate electrical codes and standards for your area.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–7


Chapter 2: Installation, Wiring, and Specifications

6. A good common ground reference (Earth ground) is essential for proper operation of the
A DL05. One side of all control and power circuits and the ground lead on flexible shielded
cable must be properly connected to Earth ground. There are several methods of providing an
2 adequate common ground reference, including:
a) Installing a ground rod as close to the panel as possible.
b) Connection to incoming power system ground.
3 7. Evaluate any installations where the ambient temperature may approach the lower or upper
limits of the specifications. If you suspect the ambient temperature will not be within the
D operating specification for the DL05 system, measures such as installing a cooling/heating
source must be taken to get the ambient temperature within the range of specifications.
5 8. The DL05 systems are designed to be powered by 95-240 VAC or 12–24 VDC normally
available throughout an industrial environment. Electrical power in some areas where the
6 PLCs are installed is not always stable and storms can cause power surges. Due to this,
powerline filters are recommended for protecting the DL05 PLCs from power surges and
EMI/RFI noise. The Automation Powerline Filter, for use with 120 VAC and 240 VAC, 1–5
7 Amps, is an exellent choice (locate at www.automationdirect.com), however, you can use a
filter of your choice. These units install easily between the power source and the PLC.
8 NOTE: If you are using other components in your system, make sure you refer to the appropriate manual to
determine how those units can affect mounting dimensions.
9 Using DIN Rail Mounting Rails
10 DL05 Micro PLCs can be secured to a panel by using mounting rails. We recommend rails
that conform to DIN EN standard 50 022. They are approximately 35mm high, with a depth
of 7mm. If you mount the Micro PLC on a rail, do consider using end brackets on each side
11 of the PLC. The end bracket helps keep the PLC from sliding horizontally along the rail,
reducing the possibility of accidentally pulling the wiring loose. On the bottom of the PLC is
12 a small retaining clip. To secure the PLC to a DIN rail, place it onto the rail and gently push
up on the clip to lock it onto the rail. To remove the PLC, pull down on the retaining clip,
lift up on the PLC slightly, then pulling it away from the rail.
13
14
A
B
C
D

2–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Din Rail Dimensions Din Rail Slot


"
Use 35mm x 7mm rail conforming
DIN EN 50052
to
A
7mm

2
3
35mm

D
Retaining clip
5
NOTE: Refer to our catalog for a complete listing of DINnector connection systems. 6
Environmental Specifications
The following table lists the environmental specifications that generally apply to DL05 7
Micro PLCs. The ranges that vary for the Handheld Programmer are noted at the bottom
of this chart. Certain output circuit types may have derating curves, depending on the
ambient temperature and the number of outputs ON. Please refer to the appropriate
8
section in this chapter pertaining to your particular DL05 PLC.
9
Environmental Specifications
Specification Rating 10
Storage temperature –4° F to 158° F (–20° C to 70° C)
Ambient operating temperature*
Ambient humidity**
32° F to 131° F (0° C to 55° C)
5% – 95% relative humidity (non–condensing)
11
Vibration resistance MIL STD 810C, Method 514.2
Shock resistance
Noise immunity
MIL STD 810C, Method 516.2
NEMA (ICS3–304)
12
Atmosphere
Agency approvals
No corrosive gases
UL, CE, FCC class A 13
* Operating temperature for the Handheld Programmer and the DV–1000 is 32° to 122° F
(0° to 50° C) Storage temperature for the Handheld Programmer and the DV–1000 is –4° 14
to 158° F (–20° to70° C).
** Equipment will operate down to 5% relative humidity. However, static electricity problems A
occur much more frequently at low humidity levels (below 30%). Make sure you take
adequate precautions when you touch the equipment. Consider using ground straps, anti-
static floor coverings, etc. if you use the equipment in low-humidity environments.
B
Agency Approvals
Some applications require agency approvals for particular components. The DL05 Micro
C
PLC agency approvals are listed below:
• UL (Underwriters’ Laboratories, Inc.)
D
• CUL (Canadian Underwriters’ Laboratories, Inc.)
• CE (European Economic Union)

DL05 Micro PLC User Manual, 5th Edition, 6/04


2–9
Chapter 2: Installation, Wiring, and Specifications

A Wiring Guidelines
Connect the power input wiring for the DL05. Observe all precautions stated earlier in this
2 manual. Follow the guidelines in this chapter. When the wiring is complete, close the
connector covers. Do not apply power at this time.

3 110/220 VAC Power Input 12/24 VDC Power Input

D
5 + –

6
7
8
LGN +G –
9 95 – 240 VAC 12 – 24 VDC

WARNING: Once the power wiring is connected, secure the terminal block cover in the
10 closed position. When the cover is open there is a risk of electrical shock if you accidentally
touch the connection terminals or power wiring.
11 Fuse Protection for Input Power
There are no internal fuses for the input power circuits, so external circuit protection is
12 needed to ensure the safety of service personnel and the safe operation of the equipment itself.
To meet UL/CUL specifications, the input power must be fused. Depending on the type of
13 input power being used, follow these fuse protection recommendations:
208/240 VAC Operation
14 When operating the unit from 208/240 VAC, whether the voltage source is a step-down
transformer or from two phases, fuse both the line (L) and neutral (N) leads. The
A recommended fuse size is 0.375A.
110/125 VAC Operation
B When operating the unit from 110/125 VAC, it is only necessary to fuse the line (L) lead; it is
not necessary to fuse the neutral (N) lead. The recommended fuse size is 0.5A.
C
D

2–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

12/24 VDC Operation


When operating at these lower DC voltages, wire gauge size is just as important as proper A
fusing techniques. Using large conductors minimizes the voltage drop in the conductor. Each
DL05 input power terminal can accommodate one 16 AWG wire or two 18 AWG wires. A 2
DC failure can maintain an arc for much longer time and distance than AC failures. Typically,
the main bus is fused at a higher level than the branch device, which in this case is the DL05.
The recommended fuse size for the branch circuit to the DL05 is 1A (for example, a
3
Littlefuse 312.001 or equivalent).
External Power Source
D
The power source must be capable of suppling voltage and current complying with individual
Micro PLC specifications, according to the following specifications: 5
Item
Power Source Specifications
DL05 VAC Powered Units DL05 VDC Powered Units
6
Input Voltage Range
Maximum Inrush Current
110/220 VAC (95–240 VAC)
13 A, 1ms (95–240 VAC)
12–24 VDC (10.8–26.4 VDC)
10A
7
15 A, 1ms (240–264 VAC)
Maximum Power
Voltage Withstand (dielectric)
30 VA 20 W
1 minute @ 1500 VAC between primary, secondary, field ground
8
Insulation Resistance > 10 M at 500 VDC
9
NOTE:The rating between all internal circuits is BASIC INSULATION ONLY.
10
Planning the Wiring Routes
The following guidelines provide general information on how to wire the I/O connections to
DL05 Micro PLCs. For specific information on wiring a particular PLC refer to the
11
corresponding specification sheet further in this chapter.
1. Each terminal connection of the DL05 PLC can accept one 16 AWG wire or two 18 AWG size
12
wires. Do not exceed this recommended capacity.
2. Always use a continuous length of wire. Do not splice wires to attain a needed length. 13
3. Use the shortest possible wire length.
4. Use wire trays for routing where possible. 14
5. Avoid running wires near high energy wiring.
6. Avoid running input wiring close to output wiring where possible. A
7. To minimize voltage drops when wires must run a long distance , consider using multiple wires for
the return line. B
8. Avoid running DC wiring in close proximity to AC wiring where possible.
9. Avoid creating sharp bends in the wires. C
10. Install the recommended powerline filter to reduce power surges and EMI/RFI noise.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–11


Chapter 2: Installation, Wiring, and Specifications

Fuse Protection for Input and Output Circuits


A Input and Output circuits on DL05 Micro PLCs do not have internal fuses. In order to
protect your Micro PLC, we suggest you add external fuses to your I/O wiring. A fast-blow
2 fuse, with a lower current rating than the I/O bank’s common current rating can be wired to
each common. Or, a fuse with a rating of slightly less than the maximum current per output
3 point can be added to each output. Refer to the Micro PLC specification sheets further in this
chapter to find the maximum current per output point or per output common. Adding the
external fuse does not guarantee the prevention of Micro PLC damage, but it will provide
D added protection.

5
6
External Fuses

7 (shown with DIN Rail, Fuse Blocks)

8
9
10
11
12
13
14
A
B I/O Point Numbering
All DL05 Micro PLCs have a fixed I/O configuration. It follows the same octal numbering
system used on other DirectLogic family PLCs, starting at X0 and Y0. The letter X is always
C used to indicate inputs and the letter Y is always used for outputs.
The I/O numbering always starts at zero and does not include the digits 8 or 9. The addresses
D are typically assigned in groups of 8 or 16, depending on the number of points in an I/O
group. For the DL05 the eight inputs use reference numbers X0 – X7. The six output points
use references Y0 – Y5.

2–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

System Wiring Strategies A


The DL05 Micro PLC is very flexible and will work in many different wiring configurations.
By studying this section before actual installation, you can probably find the best wiring
strategy for your application . This will help to lower system cost, wiring errors, and avoid
2
safety problems.
PLC Isolation Boundaries
3
PLC circuitry is divided into three main regions separated by isolation boundaries, shown in
the drawing below. Electrical isolation provides safety, so that a fault in one area does not D
damage another. A powerline filter will provide isolation between the power source and the
power supply. A transformer in the power supply provides magnetic isolation between the
primary and secondary sides. Opto-couplers provide optical isolation in Input and Output
5
circuits. This isolates logic circuitry from the field side, where factory machinery connects.
Note that the discrete inputs are isolated from the discrete outputs, because each is isolated 6
from the logic side. Isolation boundaries protect the operator interface (and the operator)
from power input faults or field wiring faults. When wiring a PLC, it is extremely important to 7
avoid making external connections which connect to the logic side of the PLC circuits.
Primary Side Secondary, or Field Side 8
Logic side

Power
PLC
Input
Discrete inputs
9
Main Circuit
input
Filter Power CPU 10
Supply Output Discrete outputs
Circuit
11
Isolation "" Isolation
Boundary Programming Device or
Operator Interface
Boundary 12
The next figure shows the internal layout of DL05 PLCs, as viewed from the front panel. 13
To programming device

DL05
or operator interface
14
PLC
CPU
2 Comm.
Ports
A
Main
Power
B
Supply

Input Circuit Output Circuit


C
D
Power 8 discrete Commons 6 discrete outputs Commons
Filter
Input inputs

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–13


Chapter 2: Installation, Wiring, and Specifications

Connecting Operator Interface Devices


A Operator interfaces require data and power connections. Operator interfaces with a large
CRT usually require separate AC power. However, small operator interface devices like the
2 popular DV-1000 Data Access Unit and the Optimation panels may be powered directly
from the DL05 Micro PLC.
3 Connect the DV-1000 to either communication port on the DL05 Micro PLC using the
cable shown below. A single cable contains transmit/receive data wires and +5V power.
D DL05 Micro PLC DV-1000
RJ12 RJ12

5 phone style phone style

Use cable part no.


DV–1000CBL
6
7 Optimation operator interface panels require separate power and communications
connections. Connect the DL05 to the proper D-shell connector on the rear of the
8 Optimation panel using the cable shown below. Optimation panels require 8–30VDC power.
DL05 Micro PLC Optimation Panel

9
RJ12 15-pin D-shell
phone style male

10 Use cable part no.


OP–2CBL

11 Connecting Programming Devices


DL05 Micro PLCs can be programmed with either a handheld programmer or with
12 DirectSOFT on a PC. Connect the DL05 to a PC using the cable shown below.

13 DL05 Micro PLC RJ12


phone style
9-pin D-shell
female

14 Use cable part no.


D2–DSCBL

A
B The D2-HPP Handheld Programmer comes with a communications cable. For a replacement
part, use the cable shown below.
C DL05 Micro PLC RJ12
phone style
RJ12
phone style
D2–HPP

D (cable comes with HPP)


For replacement
cable, use part no.
DV–1000CBL

2–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Sinking / Sourcing Concepts


Before going further in our study of wiring strategies, we must have a solid understanding of A
“sinking” and “sourcing” concepts. Use of these terms occurs frequently in input or output
circuit discussions. It is the goal of this section to make these concepts easy to understand, 2
further ensuring your success in installation. First we give the following short definitions,
followed by practical applications.
3
Sinking = Path to supply ground (–)
Sourcing = Path to supply source (+) D
First you will notice that these are only associated with DC circuits and not AC, because of
the reference to (+) and (–) polarities. Therefore, sinking and sourcing terminology only applies 5
to DC input and output circuits. Input and output points that are either sinking or sourcing
can conduct current in only one direction. This means it is possible to connect the external
supply and field device to the I/O point with current trying to flow in the wrong direction,
6
and the circuit will not operate. However, we can successfully connect the supply and field
device every time by understanding “sourcing” and “sinking”. 7
For example, the figure to the right depicts a
“sinking” input. To properly connect the external Input
PLC 8
supply, we just have to connect it so the the input (sinking)
provides a path to ground (–). So, we start at the
PLC input terminal, follow through the input
+
Input
9
sensing circuit, exit at the common terminal, and
connect the supply (–) to the common terminal. By

Common
Sensing
10
adding the switch, between the supply (+) and the
input, we have completed the circuit. Current flows
in the direction of the arrow when the switch is closed.
11
By applying the circuit principle above to the four possible combinations of input/output
sinking/sourcing types, we have the four circuits as shown below. DL05 Micro PLCs provide
12
all except the sourcing output I/O circuit types.
13
Sinking Input Sinking Output
Input
PLC PLC
Output
Load
14
+ +

– Common
Input
Sensing
Output
Switch Common –
A
B
Sourcing Input Sourcing Output
Common
PLC PLC
Common C
+ +

– Input
Input
Sensing Output
Switch Output –
D
Load

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–15


Chapter 2: Installation, Wiring, and Specifications

I/O “Common” Terminal Concepts


A In order for a PLC I/O circuit to operate, Field Main Path
PLC

current must enter at one terminal and exit Device (I/O point) I/O
2 at another. This means at least two terminals
are associated with every I/O point. In the
+
Circuit

3 figure to the right, the Input or Output


terminal is the main path for the current.

Return Path
One additional terminal must provide the
D return path to the power supply.
If we had unlimited space and budget for PLC
5 I/O terminals, then every I/O point could
have two dedicated terminals just as the
Input Sensing
Input 1
6 figure above shows. However, providing
this level of flexibility is not practical or Input 2
even necessary for most applications. So,
7 most Input or Output point groups on Input 3
PLCs share the return path among two or
Input 4
8 more I/O points. The figure to the right
shows a group (or bank) of 4 input points +
which share a common return path. In
9 this way, the four inputs require only five
– Common

terminals instead of eight.


10 Note: In the circuit above, the current in the common path is 4 times any channel’s input
current when all inputs are energized. This is especially important in output circuits, where
11 heavier gauge wire is sometimes necessary on commons.
Most DL05 input and output circuits are grouped into
banks that share a common return path. The best
12 indication of I/O The I/O common grouping bar, labeled
at the right, occurs in the section of wiring label below it. It
13 indicates X0, X1, X2, and X3 share the common terminal
located to the left of X1.
14 The following complete label shows two banks of four inputs and two banks of three outputs.
One common is provided for each bank.
A
B
The following label is for DC output versions. One common is provided for all of the outputs
C and the terminal on the bottom right accepts power for the output stage.

2–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Connecting DC I/O to “Solid State” Field Devices


In the previous section on Sourcing and Sinking concepts, we explained that DC I/O circuits A
sometimes will only allow current to flow one way. This is also true for many of the field
devices which have solid-state (transistor) interfaces. In other words, field devices can also be 2
sourcing or sinking. When connecting two devices in a series DC circuit, one must be wired as
sourcing and the other as sinking.
3
Solid State Input Sensors
The DL05’s DC inputs are flexible in that they detect current flow in either direction, so they
can be wired as either sourcing or sinking. In the following circuit, a field device has an open-
D
collector NPN transistor output. It sinks current from the PLC input point, which sources
current. The power supply can be the FA-24PS +24 VDC power supply or another supply 5
(+12 VDC or +24VDC), as long as the input specifications are met.
Field Device
Output Input
PLC DC Input
6
(sinking) (sourcing)

Ground
Supply
– + Common
7
8
In the next circuit, a field device has an open-emitter PNP transistor output. It sources
current to the PLC input point, which sinks the current back to ground. Since the field
device is sourcing current, no additional power supply is required.
9
Field Device
=>
Input
PLC DC Input 10
(sinking)
Output (sourcing) 11
Ground Common
12
Solid State Output Loads
Sometimes an application requires connecting a PLC output point to a solid state input on a 13
device. This type of connection is usually made to carry a low-level signal, not to send DC
power to an actuator. 14
The DL05’s DC outputs are sinking-only. This means that each DC output provides a path
to ground when it is energized. Also, remember that all six outputs have the same electrical
common, even though there are two common terminal screws. Finally, recall that the DC
A
output circuit requires power (20 – 28 VDC) from an external power source.
In the following circuit, the PLC output point sinks current to the output common when B
energized. It is connected to a sourcing input of a field device input.
PLC DC Output
= $
$
Field Device
=>
C
7 8 9 + 7
20-28 VDC
# 9 D
" " –

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–17


Chapter 2: Installation, Wiring, and Specifications

A In the next example we connect a PLC DC output point to the sinking input of a field
device. This is a bit tricky, because both the PLC output and field device input are sinking
2 type. Since the circuit must have one sourcing and one sinking device, we add sourcing
capability to the PLC output by using a pull-up resistor. In the circuit below, we connect
Rpull-up from the output to the DC output circuit power input.
3 PLC DC Output
Power
+DC pwr

D R pull-up
(sourcing)
Field Device

(sinking) Output Input R input


5 Supply
+ (sinking)

Common – Ground

6
NOTE: DO NOT attempt to drive a heavy load (>25 mA) with this pull-up method.
7 NOTE 2: Using the pull-up resistor to implement a sourcing output has the effect of inverting the output
point logic. In other words, the field device input is energized when the PLC output is OFF, from a ladder
8 logic point-of-view. Your ladder program must comprehend this and generate an inverted output. Or, you
may choose to cancel the effect of the inversion elsewhere, such as in the field device.

9 It is important to choose the correct value of R pull-up. In order to do so, we need to know
the nominal input current to the field device (I input) when the input is energized. If this
10 value is not known, it can be calculated as shown (a typical value is 15 mA). Then use I input
and the voltage of the external supply to compute R pull-up. Then calculate the power Ppull-
up (in watts), in order to size R pull-up properly.
11 V input (turn–on)
I input =
12 R input
2
V supply – 0.7 V supply
R pull-up = – R input P =
13 I input
pull-up
R pullup
The drawing below shows the actual wiring of the DL05 Micro PLC to the supply and
14 pull-up resistor.

A
B
C
D Common
Output

Supply +

2–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Relay Output Wiring Methods


The D0–05AR and the D0–05DR models feature relay outputs. Relays are best for the A
following applications:
• Loads that require higher currents than the solid-state DL05 outputs can deliver 2
• Cost-sensitive applications
• Some output channels need isolation from other outputs (such as when some loads require AC 3
while others require DC)
Some applications in which NOT to use relays: D
• Loads that require currents under 10 mA
• Loads which must be switched at high speed and duty cycle 5
Assuming relays are right for your application, we’re now ready to explore various ways to
wire relay outputs to the loads. Note that there are six normally-open SPST relays available.
They are organized with three relays per common. The figure below shows the relays and the
6
internal wiring of the PLC. Note that each group is isolated from the other group of outputs.
7
Y0 Common Y1 Y2 Y3 Y4 Common Y5

8
9
10
In the circuit below, all loads use the same AC power supply which powers the DL05 PLC. In
this example, all commons are connected together.
11
12
13
14
A
Fuse or
Line
Ground
B
Circuit
Breaker Neutral

Output Point Wiring


C
In the circuit on the following page, loads for Y0 – Y2 use the same AC power supply which D
powers the DL05 PLC. Loads for Y3 – Y5 use a separate DC supply. In this example, the
commons are separated according to which supply powers the associated load.

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–19


Chapter 2: Installation, Wiring, and Specifications

A
2
3
Fuse or +
D
Line
Circuit Ground
Breaker Neutral –
Output Point Wiring
5 Surge Suppresion For Inductive Loads
Inductive load devices (devices with a coil) generate transient voltages when de-energized with
6 a relay contact. When a relay contact is closed it “bounces”, which energizes and de-energizes
the coil until the “bouncing” stops. The transient voltages generated are much larger in
amplitude than the supply voltage, especially with a DC supply voltage.
7 When switching a DC-supplied inductive load the full supply voltage is always present when
the relay contact opens (or “bounces”). When switching an AC-supplied inductive load there
8 is one chance in 60 (60 Hz) or 50 (50 Hz) that the relay contact will open (or “bounce”)
when the AC sine wave is zero crossing. If the voltage is not zero when the relay contact opens
9 there is energy stored in the inductor that is released when the voltage to the inductor is
suddenly removed. This release of energy is the cause of the transient voltages.
10 When inductive load devices (motors, motor starters, interposing relays, solenoids, valves,
etc.) are controlled with relay contacts, it is recommended that a surge suppression device be
connected directly across the coil of the field device. If the inductive device has plug-type
11 connectors, the suppression device can be installed on the terminal block of the relay output.
Transient Voltage Suppressors (TVS or transorb) provide the best surge and transient
12 suppression of AC and DC powered coils, providing the fastest response with the smallest
overshoot.
13 Metal Oxide Varistors (MOV) provide the next best surge and transient suppression of AC
and DC powered coils.
14 For example, the waveform in the figure below shows the energy released when opening a
contact switching a 24 VDC solenoid. Notice the large voltage spike.
A +24 VDC

B
+24 VDC –24 VDC
C
D Module Relay Contact

–324 VDC

2–20 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

This figure shows the same circuit with a transorb (TVS) across the coil. Notice that the
voltage spike is significantly reduced. A
+24 VDC 2
+24 VDC –24 VDC
–42 VDC 3
Module Relay Contact
D
Use the following table to help select a TVS or MOV suppressor for your application based
on the inductive load voltage. 5
Surge Suppressors
Vendor / Catalog Type Inductive Load Voltage Part Number 6
General Instrument TVS 110/120 VAC P6KE180CAGICT–ND
Transient Voltage Suppressors,
LiteOn Diodes;
from DigiKey Catalog;
TVS
TVS
220/240 VAC
12/24 VDC
P6KE350CA
P6K30CAGICT–ND
7
Phone: 1-800-344-4539 Diode 12/24 VDC 1N4004CT–ND

Harris Metal Oxide Varistors; MOV 110/120 VAC V150LA20C


8
from Newark Catalog; MOV 220/240 VAC V250LA20C
Phone: 1-800-463-9275
Prolonging Relay Contact Life 9
Relay contacts wear according to the amount of relay switching, amount of spark created at
the time of open or closure, and presence of airborne contaminants. There are some steps you 10
can take to help prolong the life of relay contacts, such as switching the relay on or off only
when it is necessary, and if possible, switching the load on or off at a time when it will draw
the least current. Also, take measures to suppress inductive voltage spikes from inductive DC
11
loads such as contactors and solenoids.
For inductive loads in DC circuits we recommend using a suppression diode as shown in the
12
following diagram (DO NOT use this circuit with an AC power supply). When the load is
energized the diode is reverse-biased (high impedance). When the load is turned off, energy 13
stored in its coil is released in the form of a negative-going voltage spike. At this moment the
diode is forward-biased (low impedance) and shunts the energy to ground. This protects the
relay contacts from the high voltage arc that would occur just as the contacts are opening.
14
Place the diode as close to the inductive field device as possible. Use a diode with a peak
inverse voltage rating (PIV) at least 100 PIV, 3A forward current or larger. Use a fast-recovery
A
type (such as Schottky type). DO NOT use a small-signal diode such as 1N914, 1N941, etc.
Be sure the diode is in the circuit correctly before operation. If installed backwards, it short- B
circuits the supply when the relay energizes.
PLC Relay Output Inductive Field Device C
Output Input
D
Common + – Common

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–21


Chapter 2: Installation, Wiring, and Specifications

DC Input Wiring Methods PLC DC Input


A DL05 Micro PLCs with DC inputs are particularly Input
flexible because they can be either sinking or
2 sourcing. The dual diodes (shown to the right) allow
10.8 – 26.4 VDC. The target applications are +12
3 VDC and +24 VDC. You can actually wire half of
the inputs as DC sinking and the other half as DC
Common

sourcing. Inputs grouped by a common must be all


D sinking or all sourcing.
In the first and simplest example below, all commons are connected together and all inputs
5 are sinking.

6
7
8
9
10

11 +24 VDC
+

12
In the next example, the first four inputs are sinking, and the last four are sourcing.
13
14
A
B
C
D – +
+12 VDC
+24 VDC
+ –

2–22 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

DC Output Wiring Methods


DL05 DC output circuits are high-performance transistor switches with low on-resistance A
and fast switching times. Please note the following characteristics which are unique to the DC
output type: 2
• There is only one electrical common for all six outputs. All six outputs belong to one bank.
• The output switches are current-sinking only. However, you can still use different DC voltages from
one load to another.
3
• The output circuit inside the PLC requires external power. The supply (–) must be connected to a
common terminal, and the supply (+) connects the the right-most terminal on the upper connector.
D
In the example below, all six outputs share a common supply.
5
6
7
8

9
+24 VDC
+ 10
Output Point W iring
In the next example below, the outputs have “split” supplies. The first three outputs are using 11
a +12 VDC supply, and the last three are using a +24 VDC supply. However, you can split
the outputs among any number of supplies, as long as:
• all supply voltages are within the specified range
12
• all output points are wired as sinking
• all source (–) terminals are connected together
13
14
A
B
C
+12 VDC
– –
+24 VDC
D
+ +
Output Point Wiring

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–23


Chapter 2: Installation, Wiring, and Specifications

High Speed I/O Wiring Methods


A DL05 versions with DC type input or output points contain a dedicated High-Speed I/O
circuit (HSIO). The circuit configuration is programmable, and it processes select I/O points
2 independently from the CPU scan. Chapter 3 discusses the programming options for HSIO.
While the HSIO circuit has six modes, we show wiring diagrams for two of the most popular
3 modes in this chapter. The high-speed input interfaces to points X0 – X2. Properly
configured, the DL05 can count quadrature pulses at up to 5 kHz from an incremental
encoder as shown below.
D
5
6
7
Signal Common

8 Phase B
+
12 – 24 VDC
Phase A –

9 Encoder Input Wiring


Encoder

10
11 DL05 versions with DC type output points can use the High Speed I/O Pulse Output
feature. It can generate high-speed pulses for specialized control such as stepper motor /
12 intelligent drive systems. Output Y0 and Y1 can generate pulse and direction signals, or it can
generate CCW and CW pulse signals respectively. See Chapter 3 on high-speed input and
pulse output options.
13
14
A
B Signal Common
+
+24 VDC

C Motor Amplifier

Pulse
D Direction

Pulse Output Wiring


Power Input

2–24 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

Glossary of Specification Terms A


Discrete Input
One of eight input connections to the PLC which converts an electrical signal from a field
2
device to a binary status (off or on), which is read by the internal CPU each PLC scan.
Discrete Output
3
One of six output connections from the PLC which converts an internal ladder program
result (0 or 1) to turn On or Off an output switching device. This enables the program to D
turn on and off large field loads.
I/O Common 5
A connection in the input or output terminals which is shared by multiple I/O circuits. It
usually is in the return path to the power supply of the I/O circuit. 6
Input Voltage Range
The operating voltage range of the input circuit. 7
Maximum Voltage
Maximum voltage allowed for the input circuit.
8
ON Voltage Level
The minimum voltage level at which the input point will turn ON.
9
OFF Voltage Level 10
The maximum voltage level at which the input point will turn OFF
Input Impedance 11
Input impedance can be used to calculate input current for a particular operating voltage.
Input Current 12
Typical operating current for an active (ON) input.
Minimum ON Current 13
The minimum current for the input circuit to operate reliably in the ON state.
Maximum OFF Current
14
The maximum current for the input circuit to operate reliably in the OFF state.
OFF to ON Response
A
The time the module requires to process an OFF to ON state transition.
B
ON to OFF Response
The time the module requires to process an ON to OFF state transition. C
Status Indicators
The LEDs that indicate the ON/OFF status of an input or output point. All LEDs on DL05 D
Micro PLCs are electrically located on the logic side of the input or output circuit.

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–25


Chapter 2: Installation, Wiring, and Specifications

A Wiring Diagrams and Specifications


The remainder of this chapter dedicates two pages to each of the eight versions of DL05
2 Micro PLCs. Each section contains a basic wiring diagram, equivalent I/O circuits, and
specification tables. Please refer to the section which describes the particular DL05 version
used in your application.
3 D0–05AR I/O Wiring Diagram
The D0–05AR Micro PLC features eight AC inputs and six relay contact outputs. The
D following diagram shows a typical field wiring example. The AC external power connection
uses four terminals at the left as shown.
5
6
7
8
9
10
11 Power Input
Wiring Input Point Wiring Output Point Wiring
12
13 Equivalent Input Circuit
Circuit Derating Chart for Relay Outputs Equivalent
Equivalent Output
Output CircuitCircuit
Equivalent Input

14 Input
Optical
+V +V

L
OUTPUT
Internal module circuitry

+V
Isolator

A To LED

B
Common
COM
To LED
Line
To other circuits in bank
6–27 VDC
6–240 VAC

C The eight AC input channels use terminals in the middle of the connector. Inputs are
organized into two banks of four. Each bank has a common terminal. The wiring example
above shows all commons connected together, but separate supplies and common circuits
D may be used. The equivalent input circuit shows one channel of a typical bank.

2–26 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

The six relay output channels use terminals on the right side of the connector. Outputs are
organized into two banks of three normally-open relay contacts. Each bank has a common A
terminal. The wiring example on the last page shows all commons connected together, but
separate supplies and common circuits may be used. The equivalent output circuit shows one
channel of a typical bank. The relay contacts can switch AC or DC voltages.
2
D0-05AR General Specifications
External Power Requirements 95 – 240 VAC, 30 VA maximum,
3
Communication Port 1 9600 baud (Fixed), 8 data
bits, 1 stop bit, odd parity
K–Sequence (Slave)DirectNET (Slave) MODBUS (Slave)
D
Communication Port 2 9600 baud (default), 8 data K–Sequence (Slave) DirectNET (Master/Slave) MODBUS
bits, 1 stop bit, odd parity
Programming cable type
(Master/Slave) Non-sequence / print
D2–DSCBL
5
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature
Relative Humidity
–4 to 158° F (–20 to 70 C)
5 to 95% (non-condensing)
6
Environmental air
Vibration
No corrosive gases permitted
MIL STD 810C 514.2
7
Shock MIL STD 810C 516.2
Noise Immunity
Terminal Type
NEMA ICS3–304
Removable
8
Wire Gauge One AWG16 or two AWG18, AWG24 minimum
9
AC Input Specifications X0-X7
Input Voltage Range (Min. - Max.) 80 – 132 VAC, 47 - 63 Hz 10
Operating Voltage Range 90 – 120 VAC, 47 -63 Hz
Input Current
Max. Input Current
8 mA @ 100 VAC at 50 Hz 10 mA @ 100 VAC at 60 Hz
12 mA @ 132 VAC at 50 Hz 15 mA @ 132 VAC at 60 Hz
11
Input Impedance 14K @50 Hz, 12K @60 Hz
ON Current/Voltage >6 mA @ 75 VAC 12
OFF Current/Voltage <2 mA @ 20 VAC
OFF to ON Response
ON to OFF Response
< 40 mS
< 40 mS
13
Status Indicators Logic Side
Commons 4 channels / common x 2 banks 14
Relay Output Specifications Y0-Y5
Output Voltage Range (Min. – Max.) 5 – 264 VAC (47 -63 Hz), 5 – 30 VDC
A
Operating Voltage Range
Output Current
6 – 240 VAC (47 -63 Hz), 6 – 27 VDC
2A / point, 6A / common B
Max. leakage current 0.1 mA @264VAC
Smallest Recommended Load
OFF to ON Response
5 mA @5 VDC
< 15 mS
C
ON to OFF Response
Status Indicators
< 10 mS
Logic Side D
Commons 3 channels / common x 2 banks
Fuses None (external recommended)

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–27


Chapter
Chapter 2:
2: Installation,
Installation, Wiring,
Wiring, and
and Specifications
Specifications

D0–05DR I/O Wiring Diagram


A These micro PLCs feature eight DC inputs and six relay contact outputs. The following
diagram shows a typical field wiring example. The AC external power connection uses four
2 terminals at the left as shown.

3
D
5
6
7
8 Power Input
Wiring Input Point Wiring Output Point Wiring

9 Equivalent Circuit, Standard


Inputs (X3-X7)
Derating Chart for Relay Outputs Equivalent Output Circuit

10
11
12
13 Equivalent Circuit, High-speed
Inputs (X0-X2)
The eight DC input channels use terminals in the middle of the
connector. Inputs are organized into two banks of four. Each
14 bank has an isolated common terminal, and may be wired as
either sinking or sourcing inputs. The wiring example above
shows all commons connected together, but separate supplies
A and common circuits may be used. The equivalent circuit for
standard inputs is shown above, and the high-speed input circuit
To all other output circuits

B is shown to the left.


The six output channels use terminals on the right side of the connector. Outputs are
C organized into two banks of three normally-open relay contacts. Each bank has a common
terminal. The wiring example above shows all commons connected together, but separate
supplies and common circuits may be used. The equivalent output circuit shows one channel
D of a typical bank. The relay contacts can switch AC or DC voltages.

2–28 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05DR General Specifications


External Power Requirements 95 – 240 VAC, 30 VA maximum,
A
Communication Port 1 9600 baud (Fixed), 8 data
bits, 1 stop bit, odd parity
K–Sequence (Slave) DirectNET (Slave) MODBUS (Slave)
2
Communication Port 2 9600 baud (default), 8 data K–Sequence (Slave) DirectNET (Master/Slave) MODBUS
bits, 1 stop bit,odd parity
Programming cable type
(Master/Slave) Non-sequence / print
D2–DSCBL 3
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature
Relative Humidity
–4 to 158° F (–20 to 70 C)
5 to 95% (non-condensing)
D
Environmental air
Vibration
No corrosive gases permitted
MIL STD 810C 514.2 5
Shock MIL STD 810C 516.2
Noise Immunity
Terminal Type
NEMA ICS3–304
Removable
6
Wire Gauge One AWG16 or two AWG18, AWG24 minimum
7
DC Input Specifications
Parameter High–Speed Inputs, X0 – X2 Standard DC Inputs X3 – X7 8
Min. - Max. Voltage Range 10.8 – 26.4 VDC 10.8 – 26.4 VDC
Operating Voltage Range
Peak Voltage
12 -24 VDC
30 VDC (5 kHz maximum frequency)
12 -24 VDC
30 VDC
9
Minimum Pulse Width 100 µs N/A
ON Voltage Level > 10 VDC > 10 VDC 10
OFF Voltage Level < 2.0 VDC < 2.0 VDC
Input Impedance
Max. Input Current
1.8 k @ 12 – 24 VDC
6mA @12VDC 13mA @24VDC
2.8 k @ 12 – 24 VDC
4mA @12VDC 8.5mA @24VDC
11
Minimum ON Current >5 mA >4 mA
Maximum OFF Current < 0.5 mA <0.5 mA 12
OFF to ON Response <100 µs 2 – 8 mS, 4 mS typical
ON to OFF Response
Status Indicators
< 100 µs
Logic side
2 – 8 mS, 4 mS typical
Logic side
13
Commons 4 channels / common x 2 bank
14
Relay Output Specifications
Output Voltage Range (Min. - Max.)
Operating Voltage
5 -264 VAC (47 -63 Hz), 5 - 30 VDC
6 -240 VAC (47 -63 Hz), 6 - 27 VDC
A
Output Current
Maximum Voltage
2A / point 6A / common
264 VAC, 30 VDC B
Max leakage current 0.1 mA @264 VAC
Smallest Recommended Load
OFF to ON Response
5 mA
< 15 mS
C
ON to OFF Response
Status Indicators
< 10 mS
Logic Side D
Commons 3 channels / common x 2 banks
Fuses None (external recommended)

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–29


Chapter 2: Installation, Wiring, and Specifications

D0–05AD I/O Wiring Diagram


A The D0–05AD Micro PLC features eight AC inputs and six DC outputs. The following
diagram shows a typical field wiring example. The AC external power connection uses four
terminals at the left as shown.
2
3
D
5
6
7
8
Power Input

9 Wiring Input Point Wiring Output Point Wiring

10
11
12
13 Equivalent Input Circuit Derating Chart for DC Outputs Equivalent Output Circuit

14 The eight AC input channels use terminals in the middle of the connector. Inputs are
organized into two banks of four. Each bank has an isolated common terminal. The wiring
A example above shows all commons connected together, but separate supplies and common
circuits may be used. The equivalent input circuit shows one channel of a typical bank.
The six current sinking DC output channels use terminals on the right side of the connector.
B All outputs actually share the same electrical common. Note the requirement for external
power on the end (right-most) terminal. The equivalent output circuit shows one channel of
C the bank of six.

2–30 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05AD General Specifications


External Power Requirements 95 – 240 VAC, 30 VA maximum,
A
Communication Port: 1 9600 baud (Fixed),
8 data bits, 1 stop bit, odd parity
K–Sequence (Slave) DirectNET (Slave) MODBUS (Slave) 2
Communication Port 2: 9600 baud (default), K–Sequence (Slave) DirectNET (Master/Slave)
8 data bits, 1 stop bit, odd parity
Programming cabletype
MODBUS (Master/Slave) Non-sequence / print
D2–DSCBL
3
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature –4 to 158° F (–20 to 70 C) D
Relative Humidity 5 to 95% (non-condensing)
Environmental air
Vibration
No corrosive gases permitted
MIL STD 810C 514.2
5
Shock MIL STD 810C 516.2
Noise Immunity NEMA ICS3–304 6
Terminal Type Removable
Wire Gauge One AWG16 or two AWG18, AWG24 minimum
7
AC Input Specifications
Input Voltage Range (Min. - Max.) 80 – 132 VAC, 47 - 63 Hz
8
Operating Voltage Range 90 – 120 VAC, 47 - 63 Hz
Input Current 8 mA @ 100 VAC (50Hz) 10 mA @ 100 VAC (60Hz) 9
Max. Input Current 12 mA @ 132 VAC (50Hz) 15 mA @ 132 VAC (60Hz)
Input Impedance
ON Current/Voltage
14K @50 Hz, 12K @60 Hz
>6 mA @ 75 VAC
10
OFF Current/Voltage <2 mA @ 20 VAC
OFF to ON Response < 40 mS 11
ON to OFF Response < 40 mS
Status Indicators
Commons
Logic Side
4 channels / common x 2 banks
12
DC Output Specifications
13
Parameter Pulse Outputs, Y0 – Y1 Standard Outputs, Y2 – Y5
Min. - Max. Voltage Range 5 – 30 VDC 5 – 30 VDC 14
Operating Voltage 6 – 27 VDC 6 – 27 VDC
Peak Voltage
On Voltage Drop
< 50 VDC (7 kHz max. frequency)
0.3 VDC @ 1A
< 50 VDC
0.3 VDC @ 1A
A
Max Current (resistive) 0.5 A / pt. (1A / point for standard pt.) 1.0 A / point
Max leakage current 15 µA @ 30 VDC 15 µA @ 30 VDC B
Max inrush current 2 A for 100 mS 2 A for 100 mS
Extenal DC power required
OFF to ON Response
20 - 28 VDC max 150mA
<10 µS
20 - 28 VDC max 150mA
< 10 µS
C
ON to OFF Response <30 µS < 60 µS
Status Indicators Logic Side Logic Side D
Commons 6 channels / common x 1 banks
Fuses None None

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–31


Chapter 2: Installation, Wiring, and Specifications

D0–05DD I/O Wiring Diagram


A These micro PLCs feature eight DC inputs and six DC outputs. The following diagram
shows a typical field wiring example. The AC external power connection uses four terminals
2 at the left as shown.

3
D
5
6
7
Power Input
8 Wiring Input Point Wiring Output Point Wiring

9
10
11 To all other output circuits

High Speed Inputs (X0-X2) DC Standard Inputs (X3-X7)


12 DC Pulse Outputs (Y0-Y1)
The eight DC input channels use terminals in the middle of
the connector. Inputs are organized into two banks of four.
13 Each bank has an isolated common terminal, and may be
wired as either sinking or sourcing inputs. The wiring
14 example above shows all commons connected together, but
separate supplies and common circuits may be used. The
equivalent circuits for standard inputs and the high-speed
A inputs are shown above.
DC Standard Outputs (Y2-Y5)
B The six current sinking DC output channels use terminals
on the right side of the connector. All outputs actually share
C the same electrical common. Note the requirement for
external power on the end (right-most) terminal. The
D equivalent output circuit shows one channel of the bank of
six.

Derating Chart for DC Outputs

2–32 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05DD General Specifications


External Power Requirements 95 – 240 VAC, 30 VA maximum,
A
Communication Port 1 9600 baud (Fixed), K–Sequence (Slave) DirectNET (Slave)
8 data bits, 1 stop bit, odd parity
Communication Port 2 9600 baud (default),
MODBUS (Slave) 2
K–Sequence (Slave) DirectNET (Master/Slave)
8 data bits, 1 stop bit, odd parity MODBUS (Master/Slave) Non-sequence / print
Programming cable type D2–DSCBL 3
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature
Relative Humidity
–4 to 158° F (–20 to 70 C)
5 to 95% (non-condensing)
D
Environmental air No corrosive gases permitted
Vibration MIL STD 810C 514.2 5
Shock MIL STD 810C 516.2
Noise Immunity
Terminal Type
NEMA ICS3–304
Removable
6
Wire Gauge One AWG16 or two AWG18, AWG24 minimum
DC Input Specifications
7
Parameter High–Speed Inputs, X0 – X2 Standard DC Inputs X3 – X7
Min. - Max. Voltage Range 10.8 – 26.4 VDC 10.8 – 26.4 VDC 8
Operating Voltage Range 12 – 24 VDC 12 – 24 VDC
Peak Voltage
Minimum Pulse Width
30 VDC (5 kHz maximum frequency)
100 µs
30 VDC
N/A
9
ON Voltage Level > 9.0 VDC > 9.0 VDC
OFF Voltage Level < 2.0 VDC < 2.0 VDC 10
Max. Input Current 6mA @12VDC, 13mA @24VDC 4mA @12VDC, 8.5mA @24VDC
Input Impedance
Minimum ON Current
1.8 qk @ 12 – 24 VDC
>5 mA
2.8 qk @ 12 – 24 VDC
>4 mA
11
Maximum OFF Current < 0.5 mA <0.5 mA
OFF to ON Response <100 µS 2 – 8 mS, 4 mS typical 12
ON to OFF Response < 100 µS 2 – 8 mS, 4 mS typical
Status Indicators
Commons
Logic side
4 channels / common x 2 banks
Logic side
13
Parameter
DC Output Specifications
Pulse Outputs Y0 – Y1 Standard Outputs Y3 – Y5
14
Min. - Max. Voltage Range 5 – 30 VDC 5 – 30 VDC
Operating Voltage 6 – 27 VDC 6 – 27 VDC A
Peak Voltage < 50 VDC (7 kHz max. frequency) < 50 VDC
On Voltage Drop
Max Current (resistive)
0.3 VDC @ 1 A
0.5 A / pt., 1A / pt. as standard pt.
0.3 VDC @ 1 A
1.0 A / point
B
Max leakage current 15 A @ 30 VDC 15 A @ 30 VDC
Max inrush current 2 A for 100 mS 2 A for 100 mS C
External DC power required 20 - 28 VDC Max 150mA 20 - 28 VDC Max 150mA
OFF to ON Response
ON to OFF Response
< 10µ s
< 30 µs
< 10 µs
< 60 µs
D
Status Indicators Logic Side Logic Side
Commons 6 channels / common x 1 banks
Fuses None (external recommended)

DL05 Micro PLC User Manual, 5th Edition, 6/04


2–33
Chapter 2: Installation, Wiring, and Specifications

D0–05AA I/O Wiring Diagram


A The D0–05AA Micro PLC features eight AC inputs and six AC outputs. The following
diagram shows a typical field wiring example. The AC external power connection uses four
2 terminals at the left as shown.

3
D
5
6
7
8
Power Input Input Point Wiring Output Point Wiring
9 Wiring

10
11
12
13 Equivalent Output Circuit
Equivalent Input Circuit Derating Chart for AC Outputs

14 The eight AC input channels use terminals in the middle of the connector. Inputs are
organized into two banks of four. Each bank has an isolated common terminal. The wiring
A example above shows all commons connected together, but separate supplies and common
circuits may be used. The equivalent input circuit shows one channel of a typical bank.
B The six output channels use terminals on the right side of the connector. Outputs are
organized into two banks of three triac switches. Each bank has a common terminal. The
C wiring example above shows all commons connected together, but separate supplies and
common circuits may be used. The equivalent output circuit shows one channel of a typical
bank.
D

2–34 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05AA General Specifications


External Power Requirements 95 – 240 VAC, 30 VA maximum,
A
Communication Port 1 9600 baud (Fixed),
8 data bits, 1 stop bit odd parity
K–Sequence (Slave) DirectNET (Slave) MODBUS (Slave)
2
Communication Port 2 9600 baud (default) K–Sequence (Slave) DirectNET (Master/Slave) MODBUS
8 data bits, 1 stop bit odd parity
Programming cable type
(Master/Slave) Non-sequence / print
D2–DSCBL 3
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature
Relative Humidity
–4 to 158° F (–20 to 70 C)
5 to 95% (non-condensing)
D
Environmental air
Vibration
No corrosive gases permitted
MIL STD 810C 514.2 5
Shock MIL STD 810C 516.2
Noise Immunity
Terminal Type
NEMA ICS3–304
Removable
6
Wire Gauge One AWG16 or two AWG18, AWG24 minimum
7
AC Input Specifications
Input Voltage Range (Min. - Max.)
Operating Voltage Range
80 – 132 VAC, 47 - 63 Hz
90 – 120 VAC, 47 - 63 Hz
8
8 mA @100 VAC at 50 Hz
Input Current 10 mA @100 VAC at 60 Hz 9
12 mA @132 VAC at 50 Hz
Max. Input Current 15 mA @132 VAC at 60 Hz
Input Impedance 14Kq @50 Hz, 12Kq @60Hz 10
ON Current/Voltage > 6 mA @ 75 VAC
OFF Current/Voltage
OFF to ON Response
< 2 mA @ 20 VAC
< 40 mS
11
ON to OFF Response
Status Indicators
< 40 mS
Logic Side 12
Commons 4 channels / common x 2 banks

AC Output Specifications
13
Output Voltage Range (Min. - Max.)
Operating Voltage
15 – 264 VAC, 47 – 63 Hz
17 – 240 VAC, 47 – 63 Hz 14
On Voltage Drop 1.5 VAC (>50mA) 4.0 VAC (<50mA)
Max Current
Max leakage current
0.5 A / point, 1.5 A / common
<4 mA @ 264 VAC
A
Max inrush current
Minimum Load
10 A for 10 mS
10 mA B
OFF to ON Response 1 mS
ON to OFF Response
Status Indicators
1 mS +1/2 cycle
Logic Side
C
Commons
Fuses
3 channels / common x 2 banks
None (external recommended) D

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–35


Chapter 2: Installation, Wiring, and Specifications

D0–05DA I/O Wiring Diagram


A The D0–05DA Micro PLC features eight DC inputs and six AC outputs. The following
diagram shows a typical field wiring example. The AC external power connection uses four
terminals at the left as shown.
2
3
D
5
6
7
8 Power Input
Wiring
Input Point Wiring Output Point Wiring

9
10
11
12 To all other output circuits

High Speed Inputs (X0-X2) Standard Inputs (X3-X7) Equivalent Output Circuit
13
The eight DC input channels use terminals in the middle of the
14 connector. Inputs are organized into two banks of four. Each bank
has an isolated common terminal, and may be wired as sinking or
A sourcing inputs. The wiring example above shows all commons
connected together, but separate supplies and common circuits may
be used. The equivalent circuit for standard inputs is shown above,
B and the high-speed input circuit is shown above left.
The six output channels use terminals on the right side of the
C Derating Chart for AC Outputs connector. Outputs are organized into two banks of three triac
switches. Each bank has a common terminal. The wiring example
D above shows all commons connected together, but separate supplies
and common circuits may be used. The equivalent output circuit
shows one channel of a typical bank.

2–36 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05DA General Specifications A


External Power Requirements 95 – 240 VAC, 30 VA maximum,
Communication Port 1 9600 baud (Fixed), 8 data
bits, 1 stop bit, odd parity
K–Sequence (Slave) DirectNET (Slave)
MODBUS (Slave) 2
Communication Port 2 9600 baud (default), 8 data K–Sequence (Slave) DirectNET (Master/Slave)
bits, 1 stop bit, odd parity
Programming cable type
MODBUS (Master/Slave) Non-sequence/print
D2–DSCBL
3
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature –4 to 158° F (–20 to 70 C) D
Relative Humidity 5 to 95% (non-condensing)
Environmental air
Vibration
No corrosive gases permitted
MIL STD 810C 514.2
5
Shock MIL STD 810C 516.2
Noise Immunity NEMA ICS3–304 6
Terminal Type Removable
Wire Gauge One AWG16 or two AWG18, AWG24 minimum 7
DC Input Specifications
Parameter
Input Voltage Range
High–Speed Inputs, X0 – X2
10.8 – 26.4 VDC
Standard DC Inputs X3 – X7
10.8 – 26.4 VDC
8
Operating Voltage Range
Maximum Voltage
12 – 24 VDC
30 VDC (5 kHz maximum frequency)
12 – 24 VDC
30 VDC
9
Minimum Pulse Width 100 µS N/A
ON Voltage Level
OFF Voltage Level
> 10 VDC
< 2.0 VDC
> 10 VDC
< 2.0 VDC
10
Input Impedance
Minimum ON Current
1.8 k @ 12 – 24 VDC
>5 mA
2.8 k @ 12 – 24 VDC
>4 mA
11
Maximum OFF Current < 0.5 mA <0.5 mA
OFF to ON Response
ON to OFF Response
<100 µS
< 100 µS
2 – 8 mS, 4 mS typical
2 – 8 mS, 4 mS typical
12
Status Indicators
Commons
Logic side
4 channels / common x 2 bank
Logic side
13
AC Output Specifications
Output Voltage Range (Min. - Max.) 15 – 264 VAC, 47 – 63 Hz
14
Operating Voltage 17 – 240 VAC, 47 – 63 Hz
On Voltage Drop 1.5 VAC @> 50mA, 4 VAC @< 50mA A
Max Current 0.5 A / point, 1.5 A / common
Max leakage current
Max inrush current
< 4 mA @ 264 VAC, 60Hz
10 A for 10 mS
B
Minimum Load 10 mA
OFF to ON Response 1 mS C
ON to OFF Response 1 mS +1/2 cycle
Status Indicators
Commons
Logic Side
3 channels / common x 2 banks
D
Fuses None (external recommended)

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–37


Chapter 2: Installation, Wiring, and Specifications

D0–05DR–D I/O Wiring Diagram


A These micro PLCs feature eight DC inputs and six relay contact outputs. The following
diagram shows a typical field wiring example. The DC external power connection uses three
2 terminals at the left as shown.

3
D
5
6
7
8 Power Input
Wiring
Input Point Wiring Output Point Wiring

9
10
11
12 To all other output circuits

High-speed Input Circuit (X0-X2) Standard Input Circuit (X3-X7) Standard Output Circuit
13 The eight DC input channels use terminals in the middle of the
connector. Inputs are organized into two banks of four. Each
14 bank has an isolated common terminal, and may be wired as
either sinking or sourcing inputs. The wiring example above
shows all commons connected together, but separate supplies and
A common circuits may be used. The equivalent circuit for
standard inputs is shown above, and the high-speed input circuit
B is shown above left.
The six output channels use terminals on the right side of the
C Derating Chart for Relay Outputs
connector. Outputs are organized into two banks of three
normally-open relay contacts. Each bank has a common
terminal. The wiring example above shows all commons
D connected together, but separate supplies and common circuits
may be used. The equivalent output circuit shows one channel of
a typical bank. The relay contacts can switch AC or DC voltages.

2–38 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05DR-D General Specifications


External Power Requirements 12 – 24 VDC, 20 W maximum,
A
Communication Port 1 9600 baud (Fixed),
8 data bits, 1 stop bit, odd parity
K–Sequence (Slave) DirectNET (Slave) MODBUS (Slave)
2
Communication Port 2 9600 baud (default), K–Sequence (Slave) DirectNET (Master/Slave)
8 data bits, 1 stop bit, odd parity MODBUS (Master/Slave) Non-sequence / print
Programming cable type D2–DSCBL 3
Operating Temperature 32 to 131° F (0 to 55 C)
Storage Temperature –4 to 158° F (–20 to 70 C) D
Relative Humidity 5 to 95% (non-condensing)
Environmental air
Vibration
No corrosive gases permitted
MIL STD 810C 514.2
5
Shock MIL STD 810C 516.2
Noise Immunity NEMA ICS3–304 6
Terminal Type Removable
Wire Gauge One AWG16 or two AWG18, AWG24 minimum 7
DC Input Specifications
Parameter High–Speed Inputs, X0 – X2 Standard DC Inputs X3 – X7 8
Min. - Max. Voltage Range 10.8 – 26.4 VDC 10.8 – 26.4 VDC
Operating Voltage Range
Peak Voltage
12 -24 VDC
30 VDC (5 kHz maximum frequency)
12 -24 VDC
30 VDC
9
Minimum Pulse Width 100 µs N/A
ON Voltage Level > 10 VDC > 10 VDC 10
OFF Voltage Level < 2.0 VDC < 2.0 VDC
Input Impedance
Max. Input Current
1.8 k @ 12 – 24 VDC
6mA @12VDC 13mA @24VDC
2.8 k @ 12 – 24 VDC
4mA @12VDC 8.5mA @24VDC
11
Minimum ON Current >5 mA >4 mA
Maximum OFF Current < 0.5 mA <0.5 mA 12
OFF to ON Response <100 µs 2 – 8 mS, 4 mS typical
ON to OFF Response
Status Indicators
< 100 µs
Logic side
2 – 8 mS, 4 mS typical
Logic side
13
Commons 4 channels / common x 2 bank
14
Relay Output Specifications
Output Voltage Range (Min. - Max.)
Operating Voltage
5 -264 VAC (47 -63 Hz), 5 - 30 VDC
6 -240 VAC (47 -63 Hz), 6 - 27 VDC
A
Output Current 2A / point 6A / common
Maximum Voltage 264 VAC, 30 VDC B
Max leakage current 0.1 mA @264 VAC
Smallest Recommended Load
OFF to ON Response
5 mA
< 15 mS
C
ON to OFF Response < 10 mS
Status Indicators Logic Side D
Commons 3 channels / common x 2 banks
Fuses None (external recommended)

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–39


Chapter 2: Installation, Wiring, and Specifications

D0–05DD–D I/O Wiring Diagram


A These micro PLCs feature eight DC inputs and six DC outputs. The following diagram
shows a typical field wiring example. The DC external power connection uses four terminals
2 at the left as shown.

3
D
5
6
7
8 Power Input
Wiring
Input Point Wiring Output Point Wiring

9
10
11 To all other output circuits

12 High Speed Inputs (X0-X2) Standard Input Circuit (X3-X7) Pulse Output Circuit
The eight DC input channels use terminals in the middle of the
13 connector. Inputs are organized into two banks of four. Each bank
has an isolated common terminal, and may be wired as either
14 sinking or sourcing inputs. The wiring example above shows all
commons connected together, but separate supplies and common
circuits may be used. The equivalent circuit for standard inputs is
A shown above, and the high-speed input circuit is shown above left.
Standard Output Circuit
B
The six current sinking DC output channels use terminals on the
C right side of the connector. All outputs actually share the same
electrical common. Note the requirement for external power on the
D end (right-most) terminal. The equivalent output circuit shows one
channel of the bank of six.
Derating Chart for DC Outputs

2–40 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 2: Installation, Wiring, and Specifications

D0-05DD-D General Specifications


External Power Requirements 12 – 24 VDC, 20 W maximum, A
Communication Port 1: 9600 baud (Fixed), K–Sequence (Slave) DirectNET (Slave)
8 data bits, 1 stop bit, odd parity
Communication Port 2: 9600 baud (default),
MODBUS (Slave)
K–Sequence (Slave) DirectNET (Master/Slave)
2
8 data bits, 1 stop bit,odd parity MODBUS (Master/Slave) Non-sequence / print
Programming cable type
Operating Temperature
D2–DSCBL
32 to 131° F (0 to 55 C)
3
Storage Temperature
Relative Humidity
–4 to 158° F (–20 to 70 C)
5 to 95% (non-condensing) D
Environmental air No corrosive gases permitted
Vibration
Shock
MIL STD 810C 514.2
MIL STD 810C 516.2
5
Noise Immunity
Terminal Type
NEMA ICS3–304
Removable 6
Wire Gauge One AWG16 or two AWG18, AWG24 minimum
DC Input Specifications 7
Parameter High–Speed Inputs, X0 – X2 Standard DC Inputs X3 – X7
Min. - Max. Voltage Range
Operating Voltage Range
10.8 – 26.4 VDC
12 – 24 VDC
10.8 – 26.4 VDC
12 – 24 VDC
8
Peak Voltage 30 VDC (5 kHz maximum frequency) 30 VDC
Minimum Pulse Width 100 µs N/A 9
ON Voltage Level >9.0 VDC > 9.0 VDC
OFF Voltage Level
Max. Input Current
< 2.0 VDC
6mA @12VDC, 13mA @24VDC
< 2.0 VDC
4mA @12VDC, 8.5mA @24VDC
10
Input Impedance 1.8 k @ 12 – 24 VDC 2.8 k @ 12 – 24 VDC
Minimum ON Current >5 mA >4 mA 11
Maximum OFF Current < 0.5 mA <0.5 mA
OFF to ON Response
ON to OFF Response
<100 µS
< 100 µS
2 – 8 mS, 4 mS typical
2 – 8 mS, 4 mS typical
12
Status Indicators Logic side Logic side
Commons 4 channels / common x 2 banks 13
DC Output Specifications
Parameter
Min. - Max. Voltage Range
Pulse Outputs, Y0 – Y1
5 – 30 VDC
Standard Outputs, Y3 – Y5
5 – 30 VDC
14
Operating Voltage
Peak Voltage
6 – 27 VDC
< 50 VDC (7 kHz max. frequency)
6 – 27 VDC
< 50 VDC A
On Voltage Drop 0.3 VDC @ 1 A 0.3 VDC @ 1 A
Max Current (resistive)
Max leakage current
0.5 A / pt., 1A / pt. as standard pt.
15 µA @ 30 VDC
1.0 A / point
15 µA @ 30 VDC
B
Max inrush current
External DC power required
2 A for 100
20 - 28 VDC Max 150mA
mS 2 A for 100 mS
20 - 28 VDC Max 150mA C
OFF to ON Response < 10 µs < 10 µs
ON to OFF Response
Status Indicators
< 30 µs
Logic Side
< 60 µs
Logic Side
D
Commons 6 channels / common x 1 banks
Fuses None (external recommended)

DL05 Micro PLC User Manual, 5th Edition, 6/04 2–41


HIGH-SPEED INPUT AND CHAPTER
PULSE OUTPUT FEATURES
3
2
In This Chapter:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–2
Choosing the HSIO Operating Mode . . . . . . . . . . . . . . . . . . . . . . . .3–4
Mode 10: High-Speed Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–6
Mode 20: Quadrature Counter . . . . . . . . . . . . . . . . . . . . . . . . . . .3–18
Mode 30: Pulse Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–24
Trapezoidal Profile Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–31
Registration Profile Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–34
Velocity Profile Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–39
Mode 40: High-Speed Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . .3–44
Mode 50: Pulse Catch Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3–49
Mode 60: Discrete Inputs with Filter . . . . . . . . . . . . . . . . . . . . . . .3–52
Chapter 3: High-speed Input and Pulse Output Features

1 Introduction
Built-in Motion Control Solution
2 Many machine control applications require various
types of simple high-speed monitoring and control.
3 These applications usually involve some type of motion
control, or high-speed interrupts for time-critical PW
RU
R
N

events. The DL05 Micro PLC solves this traditionally CP


U

D
TX1
1
RX
2
TX2
2
RX

expensive problem with built-in CPU enhancements.


Let’s take a closer look at the available high-speed I/O
5 features.
The available high-speed input features are:
6 • High Speed Counter (5 kHz max.) with up to 24 counter presets and built-in interrupt subroutine,
counts up only, with reset
7 • Quadrature encoder inputs to measure counts and clockwise or counter clockwise direction (5 kHz
max.), counts up or down, with reset

8 • High-speed interrupt input for immediate response to critical or time-sensitive tasks


• Pulse catch feature to monitor one input point, having a pulse width as small as 100S (0.1ms)

9 • Programmable discrete filtering (both on and off delay up to 99ms) to ensure input signal integrity
(this is the default mode for inputs X0–X2)
The available pulse output features are:
10 • Single-axis programmable pulse output (7 kHz max.) with three profile types, including trapezoidal
moves, registration, and velocity control
11 Availability of HSIO Features
IMPORTANT: Please note the following restrictions on availability of features:
12 • High-speed input options are available only on DL05s with DC inputs.
• Pulse output options are available only on DL05s with DC outputs.
13 • Only one HSIO feature may be in use at one time. You cannot use a high–speed input feature and
the pulse output at the same time.
14
A DL05 Part Number
Specifications
Discrete Input Type Discrete Output Type High-Speed Input Pulse Output
D0–05AR
B D0–05DR
AC
DC
Relay
Relay
No
Yes
No
No
D0–05AD AC DC No Yes
C D0–05DD
D0–05AA
DC
AC
DC
AC
Yes
No
Yes
No

D D0–05DA
D0–05DR–D
DC
DC
AC
Relay
Yes
Yes
No
No
D0–05DD–D DC DC Yes Yes

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–2
Chapter 3: High-speed Input and Pulse Output Features

Dedicated High- Speed I/O Circuit


The internal CPU’s main task is to execute the ladder program and read/write all I/O points 1
during each scan. In order to service high-speed I/O events, the DL05 includes a special
circuit which is dedicated to a portion of the I/O points. Refer to the DL05 block diagram in
the figure below.
2
6 Discrete Outputs
3
DL05
PLC Output Circuit
D
Y0, Y1 Y2 - Y5

High-Speed
I/O Circuit
CPU 5
X0 - X2

Input Circuit
X3 -X7
6
8 Discrete Inputs
7
The high-speed I/O circuit (HSIO) is dedicated to the first three inputs (X0 – X2) and the 8
first two outputs (Y0 – Y1). We might think of this as a “CPU helper”. In the default
operation (called “Mode 60”) the HSIO circuit just passes through the I/O signals to or from 9
the CPU, so that all eight inputs behave equally and all six outputs behave equally. When the
CPU is configured in any other HSIO Mode, the HSIO circuit imposes a specialized
function on the portion of inputs and outputs shown. The HSIO circuit operates
10
independently of the CPU program scan. This provides accurate measurement and capturing of
high-speed I/O activity while the CPU is busy with ladder program execution. 11
Wiring Diagrams for Each HSIO Mode
After choosing the appropriate HSIO mode for your application, you’ll need to refer to the 12
section in this chapter for that specific mode. Each section includes wiring diagram(s) to help
you connect the High-Speed I/O points correctly to field devices. An example of the
quadrature counter mode diagram is shown below.
13
14
A
B
Signal Common
Phase B
C
+
12 – 24 VDC

Encoder Input
Encoder
Phase A

InputWiring
Wiring

D
Encoder

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–3
Chapter 3: High-speed Input and Pulse Output Features

1 Choosing the HSIO Operating Mode


Understanding the Six Modes
2 The High-Speed I/O circuit operates in one of 6 basic modes as listed in the table below. The
number in the left column is the mode number (later, we’ll use these numbers to configure
3 the PLC). Choose one of the following modes according to the primary function you want
from the dedicated High-Speed I/O circuit. You can simply use all eight inputs and six
outputs as regular I/O points with Mode 60.
D
High Speed I/O Basic Modes
5 Mode Number Mode Name Mode Features
5 kHz counter with 24 presets and reset input, counts
10 High-SpeedCounter up only, causes interrupt on preset
6 20 Quadrature Counter Channel A / Channel B 5 kHz quadrature input, counts
up and down

7 30 Pulse Output Stepper control – pulse and direction signals,


programmable motion profile (7kHz max.)

8 40 High-Speed Interrupt Generates an interrupt based on input transition or


time
50 Pulse Catch Captures narrow pulses on a selected input
9 60 Discrete/Filtered Input Rejects narrow pulses on selected inputs

In choosing one of the six high-speed I/O modes, the I/O points listed in the table below
10 operate only as the function listed. If an input point is not specifically used to support a
particular mode, it usually operates as a filtered input by default. Similarly, output points
11 operate normally unless Pulse Output mode is selected.
Physical I/O Point Usage
12 DC Input Points DC Output Points
Mode X0 X1 X2 Y0 Y1
13 High-Speed Counter Counter clock Filtered Input Filtered Input or
Reset Cnt Regular Output Regular Output
Filtered Input or
Quadrature Counter Phase A Input Phase B Input Regular Output Regular Output
14 High-Speed Interrupt Interrupt Input Filtered Input
Reset Cnt
Filtered Input Regular Output Regular Output
Pulse Catch Pulse Input Filtered Input Filtered Input Regular Output Regular Output
A Pulse Output Filtered Input Filtered Input Filtered Input Pulse or CW Direction or CCW
Pulse Pulse
Filtered Input Filtered Input Filtered Input Filtered Input Regular Output Regular Output
B Default Mode
C Mode 60 (Filtered Inputs) is the default mode. The DL05 is initialized to this mode at the
factory, and any time you reset V-memory scratchpad. In the default condition, X0–X2 are
filtered inputs (10 mS delay) and Y0–Y1 are standard outputs
D

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–4
Chapter 3: High-speed Input and Pulse Output Features

Configuring the HSIO Mode


If you have chosen a mode suited to the high-speed I/O needs of your application, we’re ready
1
to proceed to configure the PLC to operate accordingly. In the block diagram below, notice
the V-memory detail in the expanded CPU block. V-memory location V7633 determines the 2
functional mode of the high-speed I/O circuit. This is the most important V-memory
configuration value for HSIO functions! 3
DL05
PLC
Output Circuit
D
Y0 - Y1 Y2 - Y5

High-Speed
I/O Data
CPU
V-Memory
5
I/O Circuit Mode Select

X0 - X2
V7633

X3 -X7
xxxx
6
Input Circuit
7
The contents of V7633 is a 16-bit word, to be entered in binary–coded decimal. The figure
below defines what each 4-bit BCD digit of the word represents.
8
Bits 15 14 13 12 11
Memory Location V7633
10 9 8 7 6 5 4 3 2 1 0
9
0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
10
0 0 5 0
11
Bits 8 - 15 are not used HSIO Mode Setup (BCD)
in V7633. 00 = Not Used 12
10 = High-Speed Counting Mode
20 = Quadrature Counting Mode
30 = Pulse Output T rain 13
40 = High-Speed Interrupts
50 = Pulse Catching
60 = Discrete Filtered Inputs (default)
14
Bits 0 – 7 define the mode number 00, 10.. 60 previously referenced in this chapter. The A
example data “2050” shown selects Mode 50 – Pulse Catch (BCD = 50). The DL05 PLC
ignores bits 8 - 15 in V7633. B
Configuring Inputs X0 – X2 V-Memory
In addition to configuring V7633 for the HSIO mode, you’ll Mode V7633 xxxx
need to program the next three locations in certain modes
C
according to the desired function of input points X0 – X2. X0 V7634 xxxx
Other memory locations may require configuring, depending X1 V7635 xxxx D
on the HSIO mode (see the corresponding section for X2 V7636 xxxx
particular HSIO modes).

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–5
Chapter 3: High-speed Input and Pulse Output Features

1 Mode 10: High-Speed Counter


Purpose
2 The HSIO circuit contains one high-speed counter. A single pulse train from an external
source (X0) clocks the counter on each signal leading edge. The counter counts only upwards,
3 from 0 to 99999999. The counter compares the current count with up to 24 preset values,
which you define. The purpose of the presets is to quickly cause an action upon arrival at
specific counts, making it ideal for such applications as cut-to-length. It uses counter registers
D CT76 and CT77 in the CPU.

5 Functional Block Diagram


Refer to the block diagram below. When the lower byte of HSIO Mode register V7633
contains a BCD “10”, the high-speed up counter in the HSIO circuit is enabled. X0
6 automatically becomes the “clock” input for the high-speed counter, incrementing it upon
each off-to-on transition. The external reset input on X2 is the default configuration for
7 Mode 10. Input X1 is the filtered input, available to the ladder program.

8 DL05 Output Circuit


PLC
9 Y0 - Y1 Y2 - Y5

HSIO CPU
I/O data
10 COUNTER
FILTER Mode Select
V-memory
CLK Reset V7633 0010

11 X0 X2 X1 X3 - X7

Input Circuit
12
13 Instead of using X2 as a dedicated reset input, you can configure X2 as a normal filtered
input. In this way, the counter reset must be generated in ladder logic.

14 DL05 Output Circuit


PLC

A HSIO
Y0 - Y1 Y2 - Y5

CPU
I/O data

B COUNTER
CLK Reset FILTER
Mode Select
V-memory
V7633 0010

C X0 X1-X2 X3-X7

Input Circuit

D
Next, we will discuss how to program the high-speed counter and its presets.

3–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Wiring Diagram
A general wiring diagram for counters/encoders to the DL05 in HSIO Mode 10 is shown
1
below. Many types of pulse-generating devices may be used, such as proximity switches,
single-channel encoders, magnetic or optical sensors, etc. Devices with sinking outputs (NPN 2
open collector) are probably the best choice for interfacing. If the counter sources to the
inputs, it must output 12 to 24 VDC. Note that devices with 5V sourcing outputs will not
work with DL05 inputs.
3
Interfacing to Counter Intputs D
5
6
7
Counter Input Wiring
Signal 8
– + Signal Common

Interfacing to Counter Outputs


9
The DL05’s DC inputs are flexible in that they detect current flow in either direction, so they
can be wired to a counter with either sourcing or sinking outputs. In the following circuit, a
10
counter has open-collector NPN transistor outputs. It sinks current from the PLC input
point, which sources current. The power supply can be the FA–24PS or another supply 11
(+12VDC or +24VDC), as long as the input specifications are met.
Counter Output
X0 Input 12
Output Input
(sinking)
12-24 VDC Supply
(sourcing)
13
Ground – + Common
14
In the next circuit, an encoder has open-emitter PNP transistor outputs. It sources current to
the PLC input point, which sinks the current back to ground. Since the encoder sources
A
current, no additional power supply is required. However, note that the encoder output must
be 12 to 24 volts (5V encoder outputs will not work). B
Counter Output

+12 to 24 VDC
Input
X0 Input C
Output (sourcing)
:
(sinking)
D
Ground Common

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–7


Chapter 3: High-speed Input and Pulse Output Features

Setup for Mode 10


1 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD
10 in the lower byte of V7633 to select the High-Speed Counter Mode. The DL05 does not
2 use bits 8 - 15 in V7633.
Memory Location V7633

3 Bits 15
0
14
0
13
0
12 11
0 0
10
0
9
0
8
0
7
0
6
0
5
0
4
1
3
0
2
0
1
0 0
0

D 0 0 1 0

For the function of bits 8 - 15, HSIO Mode Setup (BCD)


5 refer to page 3-6. 10 = High-Speed Counter

Choose the most convenient method of programming V7633 from the following:
6 • Include load and out instructions in your ladder program

7 • DirectSOFT’s memory editor or Data View


• Use the Handheld Programmer D2–HPP

8 We recommend using the first method above so that the HSIO setup becomes an integral part
of your application program. An example program later in this section shows how to do this.

9 Presets and Special Relays


The goal of counting is to do a special action when the count reaches a preset value. Refer to
the figure below. The counter features 24 presets, which you can program. A preset is a
10 number you derive and store so that the counter will constantly compare the current count
with the preset. When the two are equal, a special relay contact is energized and program
11 execution jumps to the interrupt routine. We recommend using the special relay(s) in the
interrupt service routine to cause any immediate action you desire. After the interrupt service
routine is complete, the CPU returns to the ladder program, resuming program execution
12 from the point of interruption. The compare function is ready for the next preset event.

13 Counter
CPU Scan
Input
Current
Update
14 Value
X0, counter clock Ladder INT
Reset
A X2, external reset Does =
Program
Execution
count HSIO
B V-memory Preset Data
V2320 0000 1000
= Preset?
Current
Interrupt
Routine
V2322 0000 2000 Instruction Program
C V2324 0000 2500
Output
SPxxx
V2326 0000 3175 Update IRT
D
V2376 0921 0000

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–8
Chapter 3: High-speed Input and Pulse Output Features

Preset Data Starting Location Preset Table Pointer


V7630 is a pointer location which points to the beginning of the V7630 2000 1
Preset Data Table. The default starting location for the Preset
Data Table is V2320 (default after initializing scratchpad
V-memory). However, you may change this by programming a
2
V2000 0000 1000
different value in V7630. Use the LDA and OUT instructions as
shown:
V2002
V2004
0000
0000
2000
2500
3
Load the octal address,
LDA convert to hex, leave V2006 0000 3175
O2000 result in accumulator. D
Output this address to
OUT
V7630
V7630, the location of the
pointer to the Preset data. V2076 0000 0000 5
Using Fewer than 24 Presets
When using fewer than 24 preset registers, the HSIO looks for V2320 0000 1000
6
V2322 0000 2000
“0000 FFFF” (use LDD Kffff ) in the next preset location to
indicate the last preset has been reached. The example to the right V2324 0000 2500 7
uses four presets. The 0000 FFFF in V2331-V2330 indicates the V2326 0000 3175
previous preset was the last. V2330 0000 FFFF 8
NOTE: Each successive preset must be greater than the previous preset value. If a preset value is less than
a lower-numbered preset value, the CPU cannot compare for that value, since the counter can only count 9
upwards.

Equal Relay Numbers


10
The following table lists all 24 preset register default locations. Each occupies two 16-bit
V-memory registers. The corresponding special relay contact number is in the next column. 11
We might also call these “equal” relay contacts, because they are true (closed) when the
present high-speed counter value is equal to the preset value. Each contact remains closed
until the counter value equals the next preset value.
12
Preset Register Table 13
Preset V-memory Special Relay Preset V-memory Special Relay
Preset Preset
1
Register
V2321 / V2320
Number
SP540 13
Register
V2351 / V2350
Number
SP554
14
2 V2323 / V2322 SP541 14 V2353 / V2352 SP555
3 V2325 / V2324 SP542 15 V2355 / V2354 SP556 A
4 V2327 / V2326 SP543 16 V2357 / V2356 SP557
5
6
V2331 / V2330
V2333 / V2332
SP544
SP545
17
18
V2361 / V2360
V2363 / V2362
SP560
SP561
B
7 V2335 / V2334 SP546 19 V2365 / V2364 SP562
8
9
V2337 / V2336
V2341 / V2340
SP547
SP550
20
21
V2367 / V2366
V2371 / V2370
SP563
SP564
C
10
11
V2343 / V2342
V2345 / V2344
SP551
SP552
22
23
V2373 / V2372
V2375 / V2374
SP565
SP566 D
12 V2347 / V2346 SP553 24 V2377 / V2376 SP567

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–9


Chapter 3: High-speed Input and Pulse Output Features

Calculating Your Preset Values


1 The preset values occupy two data words each. They can range in value from 0000 0000 to
9999 9999, just like the high-speed counter value. All 24 values are absolute values, meaning
2 that each one is an offset from the counter zero value.
The preset values must be individually derived for each application. In the industrial lathe
3 diagram below, the PLC monitors the position of the lead screw by counting pulses. At points
A, B, and C along the linear travel, the cutter head pushes into the work material and cuts a
groove.
D
PLC
Industrial Lathe
5
@ A
6
7 Counter
Device
Motor
X0, counter clock
Start
8
9
The timing diagram below shows the duration of each equal relay contact closure. Each
10 contact remains on until the next one closes. All go off when the counter resets.

11 Equal Relays A B C

12 SP540
SP541
13 SP542

14 NOTE: Each successive preset must be two numbers greater than the previous preset value. In the
industrial lathe example, B>A+1 and C>B+1.
A X Input Configuration
The configurable discrete input options for High-Speed Counter Mode are listed in the table
B below. Input X0 is dedicated for the counter clock input. Input X1 can be a normal or filtered
input. The section on Mode 60 operation at the end of this chapter describes programming
C the filter time constants. Input X2 can be configured as the counter reset, with or without the
interrupt option. The interrupt option allows the reset input (X2) to cause an interrupt like
presets do, but there is no SP relay contact closure (instead, X2 will be on during the
D interrupt routine, for 1 scan). Or finally, X2 may be left simply as a filtered input.

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–10
Chapter 3: High-speed Input and Pulse Output Features

Input Options
Input Configuration Register Function Hex Code Required
1
X0 V7634 Counter Clock 0001
X1 V7635 Filtered Input xx06, xx = filter time
0 - 99 ms (BCD)
2
Counter Reset (no interrupt) 0007* (default) 0207*
0107*
3
Counter Reset (with interrupt) 0307*
X2 V7636

Filtered Input xx06, xx= filter time D


0 - 99 ms (BCD)
*With the counter reset, you have the option of a normal reset or a faster reset. However, the
fast reset does not recognize changed preset values during program execution. When ‘0007’ or
5
‘0107’ are set in V7636 and preset values are changed during program execution, the DL05
6
recognizes the changed preset values at the time of the reset. When ‘0207’ or ‘0307’ are set in
V7636 the CPU does not check for changed preset values, so the DL05 has a faster reset
time. 7
Writing Your Control Program
You may recall that the counter instruction is a standard instruction in the DL05 instruction 8
set. Refer to the figure below. The mnemonic for the counter is UDC (up-down counter).The
DL05 can have up to 128 counters, labeled CT0 through CT177. The high speed counter in
the HSIO circuit is accessed in ladder logic by using UDC CT76. It uses counter registers
9
CT76 and CT77 exclusively when the HSIO mode 10 is active (otherwise, CT76 and CT77
are available for standard counter use). The HSIO counter needs two registers because it is a 10
double-word counter. It has three inputs as shown. The first input (Enable) allows counting
when active. The middle input is a dummy and has no fuction other than it is required by the 11
built-in compiler. The bottom signal is the reset. The Dummy Input must be off while the
counter is counting.
12
Standard Counter Function HSIO Counter Function 13
UP Count UDC CTxx Enable Input UDC CT76 14
DOWN Count
Kxxxxxxxx
Dummy Input
Kxxxxxxxx A
Reset Input Reset Input
B
Counts UP and DOWN
Preload counter by write to value
Counts UP only
Can use Dummy Input to change count
C
Reset input is internal only Reset may be internal or external
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–11


Chapter 3: High-speed Input and Pulse Output Features

The next figure shows how the HSIO counter will appear in a ladder program. Note that the
1 Enable Interrupt (ENI) command must execute before the counter value reaches the first
preset value. We do this at powerup by using the first scan relay. When using the counter but
2 not the presets and interrupt, we can omit the ENI.
Direct SOFT32
3 SP1
ENI Required
D
XX
Enable Input UDC CT76
5
XX
6 Dummy Input Kxxxxxxxx
XX
7 Reset Input Preset Range:
1-99999999

8 When the enable input is energized, the high-speed counter will respond to pulses on X0 and
increment the counter at CT76 – CT77. The reset input contact behaves in a logical OR
9 fashion with the physical reset input X2 (when selected). So,the high speed counter can
receive a reset form either the contact(s) on the reset rung in the ladder, OR the external reset
X2 if you have configured X2 as an external reset.
10 Program Example: Counter Without Preset
11 The following example is the simplest way to use the high-speed counter, which does not use
the presets and special relays in the interrupt routine. The program configures the HSIO
circuit for Mode 10 operation, so X0 is automatically the counter clock input. It uses the
12 Compare-double (CMPD) instruction to cause action at certain count values. Note that this
allows you to have more than 24 “presets”.Then it configures X2 to be the external reset of
13 the counter.

14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–12
Chapter 3: High-speed Input and Pulse Output Features

Program Example Cont’d


Direct SOFT32
1
First Scan Only
SP0
LD
Load constant K10 into the accumulator . This
selects Mode 10 as the HSIO mode.
2
K10

Mode 10 OUT
V7633
Output the constant K10 to V7633, the
location of HSIO Mode select register .
3
LD
K1
Load the constant required to configure X0 as
the counter clock. D
OUT
V7634
Output the constant K1 to V7634, the location of
the setup parameter for X0. 5
Configure
Inputs
LD
K1006
Load the constant required to configure input
as filtered inputs. 6
Output the constant K1006 to V7635, the location
OUT
V7635
of setup parameter for X1.
7
Load the constant required to configure X2 as
LD
K7
an external reset without interrupt.
8
Output the constant K7 to V7636, the location of
OUT
V7636
the setup parameter for X2.
9
SP1 10
UDC CT76 CT76 is the HSIO counter . The first rung’ s SP1
SP1
Kxxxxxxxx
always enables the counter . The dummy input in
the middle is always of f. The third rung’s Reset
input is always off, because we will use the
11
external reset.
SP1
12
SP1 Load the current count of the HSIO counter in
LDD
V1076 V1076 and V1077 into the accumulator
13
Use the Compare-double instruction to compare
CMPD
K309482 the double word in the accumulator to the constant
K309482 14
SP62 Y0
OUT The execution of the above CMPD instruction turns
on special relay contact SP62 if the current count
is greater than the comparison number (K309482).
A
END END coil marks the end of the main program.
B
The compare double instruction above uses the current count of the HSIO counter to turn C
on Y0. This technique can make more than 24 comparisons, but it is scan-time dependent.
However, use the 24 built-in presets with the interrupt routine if your application needs a
very fast response time, as shown in the next example.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–13


Chapter 3: High-speed Input and Pulse Output Features

Counter With Presets Program Example


1 The following example shows how to program the HSIO circuit to trigger on three preset
values. You may recall the industrial lathe example from the beginning of this chapter. This
2 example program shows how to control the lathe cutter head to make three grooves in the
work-piece at precise positions. When the lead screw turns, the counter device generates
pulses which the DL05 can count. The three preset variables A, B, and C represent the
3 positions (number of pulses) corresponding to each of the three grooves.

D A V2320 0000 1500 Industrial Lathe


Preset Data B V2322 0000 3780

5 C V2324 0000
V2326 0000
4850
FFFF
A B C

6 I/O
Assignments
X3 - Cutter head extended
X4 - Cutter head retracted
Y0 - Lead screw motor
Counter
Device
Start
Cutter head Lead screw
Y1 - Cutter head solenoid
7 Direct SOFT32
SP0 Enable Interrupts before reaching a preset
8 ENI generates an interrupt. Special Relay SP0 is on
during the first CPU scan.

9 SP0
LD
K10
Load constant K10 into the accumulator . This
selects Mode 10 as the HSIO mode.

10 OUT
V7633
Output this address to V7633, the location of
HSIO Mode select register .

Load the constant required to configure X0 as


LD
11 K1
the counter clock.

Output the constant K1 to V7634, the location of


OUT the setup parameter for X0.
12 V7634
Load the constant required to configure X2 as
Select Mode 10 LD an external reset with interrupt.
K107
13 OUT Output the constant to V7636, the location of the
V7636 setup parameter for X2.

14 LDA
Load the octal address O2320 into the
accumulator. This instruction automatically
O2320 converts the address into hex.

A OUT
V7630
Output this address to V7630, the location of
the pointer to the Preset Table.

B SP0
LDD
K1500
Load the preset A value into the accumulator.

C Load Presets OUTD


V2320
Output the accumulator contents to the memory
location for preset 1.

D LDD
K3780
Load the preset B value into the accumulator .

OUTD Output the accumulator contents to the memory


V2322 location for preset 2.

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–14
Chapter 3: High-speed Input and Pulse Output Features

LDD
K4850
Load the preset C value into the accumulator. 1
OUTD
V2324
Output the accumulator contents to the memory
location for preset 3.
2
LDD
Kffff
Load the constant Kffff into the accumulator. This
value represents the end of the preset list. 3
Output the accumulator contents to the memory
OUTD
V2326 location for preset 4 (end of preset marker). D
SP1
UDC CT76 CT76 is the HSIO counter. The first rung’s SP1
always enables the counter. The dummy input in
5
SP1 the middle is off (unused in this example).
Kxxxxxxxx
6
SP1

SP0
The third rung’s Reset input is normally off,
because we will use the external reset. You can
7
optionally reset the counter value on each powerup
using the SP0 contact.
8
X3 Y1
RST Input X3 energizes when the groove has finished
cutting. So, we retract the cutter head. 9
X4 Y0
SET Turn lead screw on again, after cutter head has
retracted. 10
END END coil marks the end of the main program.
11
The INT label marks the beginning of the interrupt
INT O0
service routine program.
12
SP540 Preset 1 Y0
RSTI Inside the interrupt service routine, we turn OFF the
lead screw motor immediately. 13
SP541
These special “equal” relays turn on individually as
Preset 2 Y1
SETI
the corresponding preset is reached. In this
application, each results in the cutting of a groove
14
SP542 (Y1), so they are logically ORed together.
Preset 3
A
X2 C10
SETI Input X2 will be energized inside the interrupt
routine if X2 external interrupt was the source. B
IRT Return from the interrupt service routine.

Some applications will require a different type of action at each preset. It is possible for the C
interrupt routine to distinguish one preset event from another, by turning on a unique output
for each equal relay contact SPxxx. We can determine the source of the interrupt by
examining the equal relay contacts individually, as well as X2. The X2 contact will be on
D
(inside the interrupt routine only) if the interrupt was caused by the external reset, X2 input.

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–15


Chapter 3: High-speed Input and Pulse Output Features

Counter With Preload Program Example


1 The following example shows how you can preload the current count with another value.
When the preload command input (X4 in this example) is energized, we disable the counter
2 from counting with C0. Then we write the value K3000 to the count register (V1076-
V1077). We preload the current count of the counter with K3000. When the preload
command (X4) is turned off, the counter resumes counting any pulses, but now starting from
3 K3000.
Direct SOFT32
D SP0
LD
Load constant K10 into the accumulator . This
selects Mode 10 as the HSIO mode.
K10

5 Select Mode 10 OUT


V7633
Output this address to V7633, the location of
HSIO Mode select register .

6 LD
K1
Load the constant required to configure X0 as
the counter clock.

Output the constant K1 to V7634, the location of

7 OUT
V7634
the setup parameter for X0.

Load the constant required to configure X2 as


LD an external reset with interrupt.
8 K107

OUT Output the constant to V7636, the location of the


V7636 setup parameter for X2.

9 C0
SET Set C0 on at powerup to enable counting.
C0
10 UDC CT76 CT76 is the HSIO counter . The first rung’ s C0
contact enables the counter. The dummy input is in
C1 the middle.

11 C2
K99999999

The third rung’s Reset input is normally off,


12 SP0
because we will use the external reset. You can
optionally reset the counter value on each powerup
using the SP0 contact.

13 X4 C0
RST
When the preload request is made, the user turns
on X4. First we disable counting by resetting C0,
the counter ’s enable input.

14 LDD
K3000
Load the BCD value K3000 into the
accumulator.

A OUTD
V1076
Output the constant to V1076/V1077, the location
of the accumulated count for CT76.

C1
B C0 C1
PD
Generate a preload counter input pulse, which
causes the counter to preload from V1076-V1077.
C0
Enable the counter by setting C0, when the
C SET preolad pulse on C1 has occurred (C1 is off).

END END coil marks the end of the main program.

3–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Troubleshooting Guide for Mode 10


If you’re having trouble with Mode 10 operation, please study the following symptoms and 1
possible causes. The most common problems are listed below.
Symptom: The counter does not count. 2
Possible causes:
1. Field sensor and wiring – Verify that the encoder, proximity switch,or counter actually turns on 3
and illuminates the status LED for X0. The problem could be due to sinking-sourcing wiring
problem, etc. Remember to check the signal ground connection. Also verify that the pulse on-time D
is long enough for the PLC to recognize it.
2. Configuration – use the Data View window to check the configuration parameters. V7633 must
be set to 10, and V7634 must be set to 1 to enable the HSIO counter mode. 5
3. Stuck in reset – check the input status of the reset input, X2. If X2 is on, the counter will not
count because it is being held in reset. 6
4. Ladder program – make sure you are using counter CT76 in your program. The top input is the
enable signal for the counter. It must be on before the counter will count. The middle input is the
dummy input. The bottom input is the counter reset, and must be off during counting.
7
Symptom: The counter counts but the presets do not function.
Possible causes:
8
1. Configuration – Ensure the preset values are correct. The presets are 32-bit BCD values having a
range of 0 to 99999999. Make sure you write all 32 bits to the reserved locations by using the 9
LDD and OUTD instructions. Use only even–numbered addresses, from V2320 to V2376. If
using less than 24 presets, be sure to place “0000FFFF” in the location after the last preset used. 10
2. Interrupt routine – Only use Interrupt #0. Make sure the interrupt has been enabled by executing
an ENI instruction prior to needing the interrupt. The interrupt routine must be placed after the
main program, using the INT label and ending with an interrupt return IRT. 11
3. Special relays – Check the special relay numbers in your program. Use SP540 for Preset 1, SP541
for Preset 2, etc. Remember that only one special equal relay contact is on at a time. When the 12
counter value reaches the next preset, the SP contact which is on now goes off and the next one
turns on.
Symptom: The counter counts up but will not reset.
13
Possible causes:
1. Check the LED status indicator for X2 to make sure it is active when you want a reset. Or, if you
14
are using an internal reset, use the status mode of DirectSOFT32 to monitor the reset input to the
counter. A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–17


Chapter 3: High-speed Input and Pulse Output Features

1 Mode 20: Quadrature Counter


Purpose
2 The counter in the HSIO circuit can count two quadrature signal pulses instead of a single
pulse train (mode 10 operation). Quadrature signals are commonly generated from
3 incremental encoders, which may be rotary or linear. The quadrature counter has two ranges
from 0 to 99999999 or -8388608 to 8388607. Using CT76 and CT77, the quadrature
counter can count at up to a 5 kHz rate. Unlike Mode 10 operation, Mode 20 operation can
D count UP or DOWN, but does not feature automated preset values or “interrupt on external
reset” capability. However, you have the standard ladder instruction preset of CT76.
5 Functional Block Diagram
The diagram below shows HSIO functionality in Mode 20. When the lower byte of HSIO
6 Mode register V7633 contains a BCD “20”, the quadrature counter in the HSIO circuit is
enabled. Input X0 is dedicated to the Phase A quadrature signal, and input X1 receives Phase
7 B signal. X2 is dedicated to reset the counter to zero value when energized.

8 DL05
PLC
Output Circuit

Y0, Y1 Y2 - Y5

9 COUNTER
HSIO
I/O data

Mode select
CPU
V-memory
Phase Phase V7633 0020

10 A

X0
B

X1
Reset

X2 X3 - X7

11 Input Circuit

12 Quadrature Encoder Signals


Quadrature encoder signals contain position and direction information, while their frequency
represents speed of motion. Phase A and B signals shown below are phase-shifted 90 degrees,
13 thus the quadrature name. When the rising edge of Phase A precedes Phase B’s leading edge
(indicates clockwise motion by convention), the HSIO counter counts UP. If Phase B’s rising
14 edge precedes Phase A’s rising edge (indicates counter-clockwise motion), the counter counts
DOWN.
A Leading Edge Signal 90˚ phase shift

Clockwise sequence
B Phase A

Phase B

C Counterclockwise sequence
Phase A
D Phase B

Leading Edge Signal one cycle

3–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Wiring Diagram
A general wiring diagram for encoders to the DL05 in HSIO Mode 20 is shown below. 1
Encoders with sinking outputs (NPN open collector) are probably the best choice for
interfacing. If the encoder sources to the inputs, it must output 12 to 24 VDC. Note that
encoders with 5V sourcing outputs will not work with DL05 inputs.
2
3
Signal Common D
Phase A
+
Phase B –
12 – 24 VDC
5
Encoder Input Wiring
Encoder
6
7
Interfacing to Encoder Outputs
The DL05’s DC inputs are flexible in that they detect current flow in either direction, so they
8
can be wired to an encoder with either sourcing or sinking outputs. In the following circuit,
an encoder has open-collector NPN transistor outputs. It sinks current from the PLC input 9
point, which sources current. The power supply can be the +24VDC auxiliary supply or
another supply (+12VDC or +24VDC), as long as the input specifications are met.
Encoder Output,
10
(one phase) Phase A or B Input
Output Input 11
(sinking) (sourcing)
12-24 VDC Supply 12
Ground – + Common
13
In the next circuit, an encoder has open-emitter PNP transistor outputs. It sources current to 14
the PLC input point, which sinks the current back to ground. Since the encoder sources
current, no additional power supply is required. However, note that the encoder output must
be 12 to 24 volts (5V encoder outputs will not work).
A
Encoder Output,
(one phase) B
+12 to 24VDC Phase A or B Input
Input C
(sinking)
Output (sourcing)

Common
D
Ground

DL05 Micro PLC User Manual, 5th Edition, 6/04


3–19
Chapter 3: High-speed Input and Pulse Output Features

Setup for Mode 20


1 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD
20 in the lower byte of V7633 to select the High-Speed Counter Mode. The DL05 does not
2 use bits 8 - 15 in V7633.
Memory Location V7633
3 Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
D
0 0 2 0
5 HSIO Mode Setup (BCD)
Bits 8 - 15 are not used
6 in V7633. 20 = Quadrature Counter

Choose the most convenient method of programming V7633 from the following:
7 • Include load and out instructions in your ladder program
• DirectSOFT32’s memory editor
8 • Use the Handheld Programmer D2–HPP
We recommend using the first method above so that the HSIO setup becomes an integral
9 part of your application program. An example program later in this section shows how to do
this.
10 X Input Configuration
The configurable discrete input options for High-Speed Counter Mode are listed in the table
11 below. Input X0 is dedicated for Phase A, and input X1 is for Phase B. Input X2 is the reset
input to the quadrature counter, but it does not cause an interrupt. The section on Mode 60
operation at the end of this chapter describes programming the filter time constants.
12
13 Input Configuration Function Hex Code Required
Register
14 0002 (default) quadrature,
absolute 0 to 99999999
X0 V7634 Phase A
A 0012 quadrature, absolute -
8388608 to 8388607
X1 V7635 Phase B 0000
B X2 V7636
Counter Reset (no interrupt)
Discrete filtered input
0007
1006

C
D

3–20 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Writing Your Control Program 1


You may recall that the Up-Down counter instruction is standard in the DL05 instruction
set. Refer to the figure below. The mnemonic for the counter is UDC (up-down counter).The
DL05 can have up to 128 counters, labeled CT0 through CT177. The quadrature counter in
2
the HSIO circuit is accessed in ladder logic by using UDC CT76. It uses counter registers
CT76 and CT77 exclusively when the HSIO mode 20 is active (otherwise, CT76 and CT77 3
are available for standard counter use). The HSIO counter needs two registers because it is a
double-word counter. It also has three inputs as shown, but they are redefined. The first input D
is the enable signal, the middle is a preload (write), and the bottom is the reset. The enable
input must be on before the counter will count. The enable input must be off during a
preload.
5
Standard Counter Function HSIO Counter Function
6
UP Count UDC CTxx Enable Input UDC CT76
DOWN Count Dummy Input
7
Kxxxxxxxx Kxxxxxxxx
Reset Input Reset Input
8
Counts UP and DOWN
Preload counter by write to value
Counts UP and DOWN (from X0, X1)
Can use Dummy Input to change count 9
Reset input is internal only Reset may be internal or external

The next figure shows the how the HSIO quadrature counter will appear in a ladder program.
10
11
Enable Input UDC CT76
Dummy Input
12
Kxxxxxxxx
Reset Input 13
Preset Range:
1-99999999
14
When the enable input is energized, the counter will respond to quadrature pulses on X0 and
X1, incrementing or decrementing the counter at CT76 – CT77. The reset input contact
behaves in a logical OR fashion with the physical reset input X2. This means the quadrature
A
counter can receive a reset from either the contact(s) on the reset rung in the ladder, OR the
external reset X2. B
Quadrature Counter w/Preload Program Example
Since presets are not available in quadrature counting, this mode is best suited for simple C
counting and measuring. The example program on the following page shows how to
configure the quadrature counter. The program configures the HSIO circuit for Mode 20
operation, so X0 is Phase A and X1 is Phase B clock inputs. Counter w/Preload
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–21


Chapter 3: High-speed Input and Pulse Output Features

Program Example Cont’d


1
Direct SOFT32

2 SP0
LD
K20
Load constant K20 into the accumulator . This selects
Mode 20 as the HSIO mode.

Output this address to V7633, the location of the HSIO


3 Select Mode 20 OUT
V7633 Mode select register.

LD Load the constant required to configure X0 as Phase A


K2 input.
D Output the constant to V7634, the location of the setup
OUT
V7634 register for X0.

5 LD
K0
Load the constant required to configure X1 as Phase B
input.

6 OUT
V7635
Output the constant to V7635, the location of the setup
register for X1.

Load the constant required to configure X2 as an external


7 LD
K7 reset.

OUT Output the constant to V7636, the location of the setup

8 V7636

C0
register for X2.

SET Set C0 on at powerup to enable counting.

9 C0
UDC CT76 CT76 is the HSIO quadrature counter. The first rung’s SP1

10 C1
Kxxxxxxxx
always enables the counter. The dummy input is used by
the built-in compiler.

C2
11 The third rung’s Reset input is normally of f,
because we will use the external reset. You can
SP0
optionally reset the counter value on each powerup
12 using the SP0 contact.

SP1 Load the current value of the counter into the accumulator
LDD
13 V1076
on each scan.

Compare the value in the accumulator with the constant


Select Mode 20 CMPD K44292. If they are equal, the SP61 contact will be
14 SP61
K44292

Y0
turned on.

Set Y0 to ON when the counter reaches or exceeds


SET * our comparison value while COUNTING UP.
A SP62

B SP61 Y1
SET * Set Y1 to ON when the counter reaches or goes below
our comparison value while COUNTING DOWN.
SP60
C
END END coil marks the end of the main program.

D * Note: You can reset Y0 later in the program by using the RST instruction.

To preload the counter, just add the following example rungs to the program above.

3–22 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Counter Preload Program Example


X4 C0 When the preload request is made, the user turns
on X4. First we disable counting by resetting C0,
1
RST the counter ’s enable input.

Preload counter LDD


K3000
Load the BCD value K3000 into the
accumulator.
2
OUTD
V1076
Output the constant to V1076/V1077, the location
of the accumulated pulse count. 3
C1
Generate a preload counter input pulse, which
PD
C0 C1 C0
causes the counter to preload from V1076-V1077.
D
Enable the counter by setting C0, when the
SET preload pulse on C1 has occurred (C1 is off).

Troubleshooting Guide for HSIO Mode 20 5


If you’re having trouble with Mode 20 operation, please study the following symptoms and
possible causes. The most common problems are listed below. 6
Symptom: The counter does not count.
Possible causes: 7
1. Field sensor and wiring – Verify that the encoder or other field device inputs actually turn on and
illuminates the status LEDs for X0 and X1. A standard incremental encoder will visibly, alternately 8
turn on the LEDs for X0 and X1 when rotating slowly (1 RPM). Or, the problem could be due to
a sinking-sourcing wiring problem, etc. Remember to check the signal ground connection. Also
verify that the pulse on-time, duty cycle, voltage level, and frequency are within the input
specifications.
9
2. Configuration – make sure all of the configuration parameters are correct. V7633 must be set to
20, and V7634 must be set to “0002” to enable the Phase A input, and V7635 must be set to
10
“0000” to enable the Phase B input.
3. Stuck in reset – check the input status of the reset input, X2. If X2 is on, the counter will not 11
count because it is being held in reset.
4. Ladder program – make sure you are using counter CT76 in your program. The top input is the
enable signal for the counter. It must be on before the counter will count. The middle input is the
12
dummy input and must be off for the counter to count. The bottom input is the counter reset, and
must be off during counting. 13
Symptom: The counter counts in the wrong direction
(up instead of down, and visa-versa).
14
Possible causes:
1. Channel A and B assignment – It’s possible that Channel A and B assignments of the encoder
A
wires is backwards from the desired rotation/counting orientation. Just swap the X0 and X1 inputs,
and the counting direction will be reversed. B
Symptom: The counter counts up and down but will not reset.
Possible causes: C
1. Check the LED status indicator for X2 to make sure it is active when you want a reset. Also verify
the configuration register V7636 for X2 is set to 7. Or, if you are using an internal reset, use the
status mode of DirectSOFT32 to monitor the reset input to the counter.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–23


Chapter 3: High-speed Input and Pulse Output Features

1 Mode 30: Pulse Output


Purpose
2 The HSIO circuit in Mode 30 generates output pulse Trapezoidal Profile
trains suitable for open-loop control of a single-axis Velocity
3 motion positioning system. It generates pulse (stepper
increment) and direction signals which you can connect
Accel Decel
to motor drive systems and perform various types of
D motion control. Using Mode 30 Pulse Output, you can
select from three profile types detailed later in this
5 chapter:
Time

• Trapezoidal – Accel Slope to Target Velocity to Decel Slope


6 • Registration – Velocity to Position Control on Interrupt (also used for home search moves)
• Velocity Control – Speed and Direction only
7 The HSIO circuit becomes a high-speed pulse generator (up to 7 kHz) in Mode 30. By
programming acceleration and deceleration values, position and velocity target values, the
8 HSIO function automatically calculates the entire motion profile. The figure below shows the
DL05 generating pulse and direction signals to the drive amplifier of a stepper positioning
system. The pulses accomplish the profile independently and without interruption to ladder
9 program execution in the CPU.
Stepper

10 Motor

Drive

11 DL05 Micro PLC Pulse


Amplifier

12 Direction

13 In the figure above, the DL05 generates pulse and


direction signals. Each pulse represents the smallest CCW Pulse

increment of motion to the positioning system (such as


14 one step or micro-step to a stepper system). CW Pulse
Alternatively, the HSIO Pulse Output Mode may be
A configured to deliver counter clock-wise (CCW) and
clock-wise (CW) pulse signals as shown to the right.
Drive
Amplifier

B NOTE: The pulse output is designed for open loop stepper motor systems. This, plus its minimum velocity
of 40 pps make it unsuitable for servo motor control.
C
D

3–24 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Functional Block Diagram


The diagram below shows HSIO functionality in Mode 30. When the lower byte of HSIO 1
Mode register V7633 contains a BCD “30”, the pulse output capability in the HSIO circuit
is enabled. The pulse outputs use Y0 and Y1 terminals on the output connector. Remember
that the outputs can only be DC type to operate.
2
3
DL05 Output Circuit
PLC D
Y0 Y1
(Pulse / CW) (Direction / CCW) Y2 - Y5
5
HSIO
SP 104 Profile Complete
CPU
6
PULSE GEN Y0 Start Profile
Y1 Preload Position Value
7
Interrupt FILTER
X1 Filtered Input
Mode select
V-memory 8
V7633 xx30

X2 during
9
Registration
Profile only
X0, X1, X2 X3 - X7 10
Input Circuit
11
IMPORTANT NOTE: In Pulse Output Mode, Y0 and Y1 references are redefined or are used differently in 12
two ways. Physical references refer to terminal screws, while logical references refer to I/O references in
the ladder program. Please read the items below to understand this very crucial point.
13
Notice the I/O point assignment and usage in the above diagram:
• X0 and X1 can only be filtered inputs in Pulse Output Mode, and they are available as an input 14
contacts to the ladder program.
• X2 behaves as an external interrupt to the pulse generator for registration profiles. In other profile
modes, it can be used as a filtered input just like X1 (registration mode configuration shown above).
A
• References “Y0” and “Y1” are used in two different ways. At the discrete output connector, Y0 and
Y1 terminals deliver the pulses to the motion system. The ladder program uses logical references Y0
B
and Y1 to initiate “Start Profile” and “Load Position Value” HSIO functions in Mode 30.
Hopefully, the above discussion will explain why some I/O reference names have dual C
meanings in Pulse Output Mode. Please read the remainder of this section with care, to
avoid confusion about which actual I/O function is being discussed. D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–25


Chapter 3: High-speed Input and Pulse Output Features

Wiring Diagram
1 The generalized wiring diagram below shows pulse outputs Y0 and Y1 connected to the drive
amplifier inputs of a motion control system.
2
3
D
+
5 Motor Amplifier
Signal Common

+24 VDC

6 Pulse
Direction

7 Pulse Output Wiring


Power Input

8 Interfacing to Drive Inputs


The pulse signals from Y0 and Y1 outputs will typically go to drive input circuits as shown
9 above. Remember that the DL05’s DC outputs are sinking-only. It will be helpful to locate
equivalent circuit schematics of the drive amplifier. The following diagram shows how to
interface to a sourcing drive input circuit.
10 Y0, Y1 Pulse Output Drive Input
Power
11 +DC Power
Output Input
+V

(sourcing)
12 (sinking) +

Common – Ground
13
14 The following circuit shows how to interface to a sinking drive input using a pullup resistor.
Please refer to Chapter 2 to learn how to calculate and install Rpullup.
A Y0, Y1 Pulse Output
Power
+DC power
B R pullup Drive Input
(sourcing)
C (sinking) Output Input R Input
+ (sinking)
D Common
Supply
– Ground

3–26 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Motion Control Profile Specifications


The motion control profiles generated in Pulse Output Mode have the following 1
specifications:
Motion Control Profile Specifications 2
Parameter Specification

Profiles
Trapezoidal – Accel Slope / Target Velocity / Decel Slope
Registration – Velocity to Position Control on Interrupt
3
Velocity Control – Speed and Direction only
Position Range –88388608 to 88388607 D
Positioning Absolute / relative command
Velocity Range
V-memory registers
40 Hz to 7 kHz
V2320 to V2325 (Profile Parameter Table)
5
Current Position CT76 and CT77 (V1076 and V1077)
6
Physical I/O Configuration
The configurable discrete I/O options for Pulse Output Mode are listed in the table below.
The CPU uses SP 104 contact to sense “profile complete”. V7637 is used to select
7
pulse/direction or CCW/CW modes for the pulse outputs. Input X2 is dedicated as the
external interrupt for use in registration mode.
8
Physical I/O Configuration
Physical Input Configuration Register Function Hex Code Required 9
V7637 Y0 = Pulse Y1 = Direction 0103
– Y0 = CW Pulse
Y1 = CCW Pulse 0003 10
X0
X1
V7634
V7635
Discrete filtered input
Discrete filtered input xx06, xx = filter time
0 99 (BCD)
11
X2 V7636 Discrete filtered input
12
Logical I/O Functions
The following logical I/O references define functions that allow the HSIO to communicate
with the ladder program.
13
Logical I/O/ Functions 14
Logical I/O Function

SP 104
Profile Complete – the HSIO turns on SP104 to the CPU
when the profile completes. Goes back off when Start
A
Profile (Y0) turns on.
Start Profile – the ladder program turns on Y0 to start
motion. If turned off before the move completes, motion
B
Y0 stops. Turning it on again will start another profile, unless
the current position equals the target position.
Preload Position Value – if motion is stopped and Start
C
Profile is off, you can load a new value in CT76/CT77, and
Y1 turn on Y1. At that transition, the value in CT76/CT77
becomes the current position.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–27


Chapter 3: High-speed Input and Pulse Output Features

Setup for Mode 30


1 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD
30 in the lower byte of V7633 to select the High-Speed Counter Mode. The DL05 does not
2 use bits 8 - 15 in V7633.
Memory Location V7633
3 Bits 15
0
14 13
0 0
12
0
11
0
10
0
9
0
8
0
7
0
6
0
5
1
4
1
3
0
2
0
1
0
0

D 0 0 3 0

5 Bits 8 - 15 are not used


in V7633.
HSIO Mode Setup (BCD)
30 = Pulse Output

6 Choose the most convenient method of programming V7633 from the following:
• Include load and out instructions in your ladder program

7 • DirectSOFT32’s memory editor


• Use the Handheld Programmer D2–HPP

8 We recommend using the first method above so that the HSIO setup becomes an integral
part of your application program. An example program later in this section shows how to do
this.
9 Memory Location V2320 (default)
Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
10 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0

11 0 7 0 0

Profile Select (BCD) Target V elocity Value


12 0 = Trapezoidal Profile, Absolute Position
8 = Trapezoidal Profile, Relative Position
Range = 4 to 700, representing
40 Hz to 7 kHz pulse rate
9 = Registration Profile, Relative Position
13 2 = Velocity Profile

Profile / Velocity Select Register


14 The first location in the Profile Parameter Table stores two key pieces of information. The
upper four bits (12–15) select the type of profile required. The lower 12 bits (0-11) select the
A Target Velocity.
The ladder program must program this location before initiating any of the three profiles.
B The LD and OUT instruction will write all 16 bits, so be sure to fully specify the full four-
digit BCD value for the Position / Velocity Select Register each time.
The absolute and relative selection determines how the HSIO circuit will interpret your
C specified target position. Absolute position targets are referenced to zero. Relative position
targets are referenced to the current position (previous target position). You may choose
D whichever reference method that is most convenient for your application.

3–28 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Profile Parameter Table Profile Table Pointer


V7630 is a pointer location which points to the V7630 2320
1
beginning of the Profile Parameter Table. The
default starting location for the profile parameter
table is V2320. However, you may change this by
Profile Parameter Table 2
V2320 xxxx
programming a different value in V7630.
Remember to use the LDA (load address)
V2321
V2323
xxxx
xxxx
xxxx 3
instruction, converting octal into hex.
V2324 xxxx
The HSIO uses the next V-memory register past V2325 xxxx
D
the bottom of the profile parameter table to
indicate profile errors. See the error table at the
end of this section for error code definitions.
Pulse Output Error Code 5
V2326 00xx
Trapezoidal Profile 6
V-Memory Function Range Units
V2320, bits 12–15
V2320,
Trapezoidal Profile
Target Velocity Value
0=absolute, 8=relative
4 to 700

x 10 pps
7
V2321/ 2322
V2323
Target Position Value
Starting Velocity
–8388608 to 8388607
4 to 100
Pulses
x 10 pps
8
V2324 Acceleration Time 1 to 100 x 100 mS
V2325
V2326
Deceleration Time
Error Code
1 to 100
(see end of section)
x 100 mS

9
Registration Profile
10
V-Memory
V2320, bits 12–15
Function
Registration Profile
Range
9=relative
Units

11
V2320, bits 0–11
V2321/ 2322
Target Velocity Value
Target Position Value
4 to 700
–8388608 to 8388607
x 10 pps
Pulses
12
V2323 Starting Velocity 4 to 100 x 10 pps
V2324 Acceleration Time 1 to 100 x 100 mS 13
V2325 Deceleration Time 1 to 100 x 100 mS
V2326 Error Code (see end of section) – 14
Velocity Profile
A
V-Memory Function Range Units
V2320
V2321/ 2322
Velocity Profile
Direction Select
2000 only
80000000=CCW, 0=CW

Pulses
B
V2323 Velocity 4 to 700 x 10 pps
V2326 Error Code (see end of section) – C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–29


Chapter 3: High-speed Input and Pulse Output Features

Choosing the Profile Type


1 Pulse Output Mode generates three types of motion profiles. Most applications use one type
for most moves. However, each move can be different if required.
2 • Trapezoidal – Accel Slope to Target Velocity to Decel Slope
• Registration – Velocity to Position Control on Interrupt
3 • Velocity Control – Speed and Direction only
Trapezoidal Profile
Velocity
Trapezoidal Profile Defined Fixed Velocity
D The trapezoidal profile is the most common positioning
profile. It moves the load to a pre-defined target position by Accel Decel

5 creating a move profile. The acceleration slope is applied at


the starting position. The deceleration slope is applied Time
backwards from the target position. The remainder of the Start position Target position
6 move in the middle is spent traveling at a defined velocity.
Trapezoidal profiles are best for simple point-to-point moves, when the distance between the
7 starting and ending positions of the move is known in advance.
Registration profiles solve a class of motion control
8 problems. In some applications, product material in work
moves past a work tool such as a drill station. Shown to the
9 right, registration marks on the scrap area of the work-piece
allow a machine tool to register its position relative to the Finished part area
Scrap
Area
rectangle, to drill properly.
10 Home search moves allow open-loop motion systems to re-
calibrate (preload) the current position value at powerup.
11 Registration and Home Search Profiles Defined
direction of motion

Registration marks

Registration profiles are a combination of velocity and


12 position control modes. The move begins by accelerating to a
Registration Profile
Velocity
Control
Position
Control
programmed velocity. The velocity is sustained and the move Velocity

13 is of indefinite duration. When an external interrupt signal


occurs (due to registration sensing), the profile switches from Accel Decel
velocity to position control. The move ends by continuing
14 motion a pre-defined distance past the interrupt point (such
as a drill hole location). The deceleration ramp is applied in Target position
A advance of the target position. Interrupt

Velocity Profile Defined


B The velocity profile controls only the direction and speed of Velocity
Velocity Profile

motion. There is no target position specified, so the move


C can be of indefinite length. Only the first velocity value
needs to be defined. The remaining velocity values can be
created while motion is in progress. Arrows in the profile
D shown indicate velocity changes.
Time

3–30 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Trapezoidal Profile Operation 1


Trapezoidal Profile Applications
The trapezoidal profile is best suited for simple point-to-point moves, when the target 2
position is known in advance. Starting velocities must be within the range of 40 pps to 1k
pps. The remainder of the profile parameters are in the profile parameter table. 3
Trapezoidal Profile
Velocity D
Target Velocity
5
Accel Decel
Starting
6
Velocity
7
Time
Start position Target position 8
Start Y0
9
Profile
Complete SP104
10
The time line of signal traces below the profile indicates the order of events. The HSIO uses
logical output Y0 as the Start input to the HSIO, which starts the profile. Immediately the
HSIO turns off the Profile Complete signal (SP104), so the ladder program can monitor the
11
progress of the move. Typically a ladder program will monitor this bit so it knows when to
initiate the next profile move. 12
If you are familiar with motion control, you’ll notice that we do not have to specify the
direction of the move. The HSIO function examines the target position relative to the current 13
position, and automatically outputs the correct direction information to the motor drive.
Notice that the motion accelerates immediately to the starting velocity. This segment is useful 14
in stepper systems so we can jump past low speed areas when low-torque problems or a
resonant point in the motor might cause a stall. (When a stepper motor stalls, we have lost
the position of the load in open-loop positioning systems). However, is is preferable not to
A
make the starting velocity too large, because the stepper motor will also “slip” some pulses due
to the inertia of the system. B
When you need to change the current position value, use logical Y1 output coil to load a new
value into the HSIO counter. If the ladder program loads a new value in CT76/CT77
(V1076/V1077), then energizing Y1 will copy that value into the HSIO circuit counter. This
C
must occur before the profile begins, because the HSIO ignores Y1 during motion.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–31


Chapter 3: High-speed Input and Pulse Output Features

Trapezoidal Profile Program Example


1 The trapezoidal profile we want to perform is drawn and labeled in the following figure. It
consists of a non-zero starting velocity, and moderate target velocity.
2 Trapezoidal Profile
Velocity
3 Target V elocity = 1 kHz

D Accel = 2 sec Decel = 4 sec

5 Starting
Velocity = 40

6 Time
Start position Target position = 5000
7 The following program will realize the profile drawn above, when executed. The beginning of
8 the program contains all the necessary setup parameters for Pulse Output Mode 30. We only
have to do this once in the program, so we use first-scan contact SP0 to trigger the setup.

9 DirectSOFT32

SP0 Load constant K30 into the accumulator. This selects

10 LD
K30
Mode 30 as the HSIO mode.

Mode 30 Output the constant to V7633, the location of the HSIO


OUT
11 V7633 Mode select register.

Load the octal address of the beginning of the Profile


Locate Parameter LDA Parameter Table. The LDA instruction converts this to a
12 Table (optional) O2320 hex number in the accumulator.
Output this address to V7630, the location of the pointer
OUT to the Profile Parameter Table.

13 Select Pulse /
V7630

LD
Load the constant K103 which is required to select
pulse and direction for physical Y0 and Y1 functions,
Direction K103 respectively (use K3 if your application needs CCW
14 OUT
and CW).
Output this constant to V7637, configuring the pulse
V7637 output type.

A Filtered Inputs LD Load the constant K1006 which is required to select


filtered inputs with a 10 mS filter time constant.
K1006

B OUT
V7635
Output this constant to V7635, configuring X1.

C OUT
V7636
Output this constant to V7636, configuring X2.

3–32 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Program Example Cont’d


1
SP0 Load the constant K100 which is required to select
LD
K100
Trapzoidal Profile, absolute positioning, and a target
velocity of 1 kHz. 2
Profile / Target Output this constant to V2320, the location of the Profile
OUT
Velocity V2320
Select / Starting Velocity setup register .

Load the constant K5000 which selects a target


3
Target Position LDD position of 5000 pulses. Don’t forget to use double
K5000 word size (8-digit BCD position value).
D
Output this constant to V2321 and V2322, the location of
OUTD the Target Position double-word register .

Starting V elocity
V2321
Load the constant K4 which is required to select a
5
LD starting velocity of 40 Hz (4 x 10 pps).
K4

Output this constant to V2323, the location of the starting


6
OUT velocity parameter register .
V2323

Acceleration Load the constant K20 which is required to select an


7
LD acceleration time of 2 seconds (20 x 100 mS).
K20

OUT
Output this constant to V2324, the location of the
8
acceleration parameter register .
V2324

Deceleration LD
Load the constant K40 which is required to select a
deceleration time of 4 seconds (40 x 100 mS).
9
K40

OUT
Output this constant to V2325, the location of the
deceleration parameter register .
10
V2325
Start Profile
X3 Y0 We use a spare filtered input to allow the operator 11
OUT to start the profile. When the operator turns X3 ON,
then OFF , logical output Y0 starts the profile.
Profile Complete
SP 104 Y2
12
SP104 is the logical output of the HSIO to indicate
OUT the move is complete. W e use Y2 to energize an
annunciator that the profile has finished. 13
Preload Position Value
At any time you can write (preload) a new position into the current position value. This often 14
done after a home search (see the registration example programs).
A
SP0
LDD
K1000
Load the constant K1000 as the new current position
value.
B
Profile / Target
Velocity
OUTD
V1076
Output this constant to V1076/V1077 (CTA76/CTA77),
the location of the current position value.
C
Y1
PD Turn on Y1 for 1 scan. The off-to-on transition D
causes the HSIO to preload the current position
with the value

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–33


Chapter 3: High-speed Input and Pulse Output Features

1 Registration Profile Operation


Registration Applications
2 1. In a typical application shown to the right,
product material in work moves past a work tool Finished part area Scrap

3 such as a drill. Registration marks on the scrap


area of the work-piece allow a machine tool to
Area

register its position relative to the rectangle, to


D drill properly.
direction of motion
Registration marks

2. In other examples of registration, the work


5 piece is stationary and the tool moves. A drill bit
may approach the surface of a part in work,
6 preparing to drill a hole of precise depth.
However, the drill bit length gradually decreases
Detect contact

due to tool wear. A method to overcome this is to detect the moment of contact with the part
7 surface on each drill, moving the bit into the part a constant distance after contact. Detect
contact Finished part area Scrap Area Registration marks direction of motion
8 3. The home search move allows a motion system to calibrate its position on startup. In this
case, the positioning system makes an indefinite move and waits for the load to pass by a
9 home limit switch. This creates an interrupt at the moment when the load is in a known
position. We then stop motion and preload the position value with a number which equates
to the physical “home position”.
10 The registration profile begins with only velocity control. When an interrupt pulse occurs on
physical input X2, the starting position is declared to be the present count (current load
11 position). The velocity control switches to position control, moving the load to the target
position. Note that the minimum starting velocity is 40 pps. This instantaneous velocity
12 accommodates stepper motors that can stall at low speeds.
Velocity
Registration Profile

13 Target Velocity

Accel Decel

14 Starting
Velocity

Start Target Time

A Start Y0
position position

External Interrupt X2

B Profile Complete SP104

C The time line of signal traces below the profile indicates the order of events. The CPU uses
logical output Y0 to start the profile. Immediately the HSIO turns off the Profile Complete
signal (SP104), so the ladder program can monitor the move’s completion by sensing the
D signal’s on state.

3–34 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Registration Profile Program Example


The registration profile we want to perform is drawn and labeled in the following figure. It 1
consists of a non-zero starting velocity, and moderate target velocity.
Registration Profile 2
Velocity
Target V elocity = 1 kHz 3
Accel = 2 sec Decel = 4 sec D
Starting
Velocity = 40
5
Time 6
Start position Target position = 5000
The following program will realize the profile drawn above, when executed. The first program
7
rung contains all the necessary setup parameters. We only have to do this once in the
program, so we use first-scan contact SP0 to trigger the setup. 8
DirectSOFT32
SP0 Load constant K30 into the accumulator. This selects
9
LD Mode 30 as the HSIO mode.
K30

Mode 30 OUT
Output this constant to V7633, the location of the HSIO
Mode select register.
10
V7633

Locate Parameter LDA


O2320
Load the octal address of the beginning of the Profile
Parameter Table. The LDA instruction converts this to a
11
Table (optional) hex number in the accumulator.

OUT
V7630
Output this address to V7630, the location of the pointer
to the Profile Parameter Table.
12
Select Pulse /
Direction
LD
K103
Load the constant K103 which is required to select
pulse and direction for physical Y0 and Y1 functions,
respectively (your application may use CCW and CW).
13
OUT
V7637
Output this constant to V7637, configuring the pulse
output type. 14
Load the constant K2006 which is required to select X1
Filtered Inputs LD
K2006
as a filtered input with a 20 mS filter time constant.
A
Output this constant to V7635, configuring X1.
OUT
V7635
Load the constant K1006 which is required to select the
B
LD external interrupt.
K1006

OUT
Output this constant to V7636, configuring X2, the
C
registration interrupt input.
V7636
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–35


Chapter 3: High-speed Input and Pulse Output Features

Program Example Cont’d


1
2 SP0
LD
K9100
Load the constant K9100 which is required to select
Registration Profile, relative positioning, and a target
velocity of 1 kHz (9xxx times 10 pps).

3 Profile / Target
Velocity
OUT
V2320
Output this constant to V2320, the location of the Profile
Select / Starting Velocity setup register .

D Target Position LDD


K5000
Load the constant K5000 which selects a target
position of 5000 pulses. Don’t forget to use double
word size (8-digit BCD position value).

5 OUTD
V2321
Output this constant to V2321 and V2322, the location of
the Target Position double-word register.

6 Starting Velocity LD
K4
Load the constant K4 which is required to select a
starting velocity of 40 Hz (4 x 10 pps).

7 OUT
V2323
Output this constant to V2323, the location of the starting
velocity parameter register.

8 Acceleration LD
K20
Load the constant K20 which is required to select an
acceleration time of 2 seconds (20 x 100 mS).

9 OUT
V2324
Output this constant to V2324, the location of the
acceleration parameter register.

10 Deceleration LD
K40
Load the constant K40 which is required to select a
deceleration time of 4 seconds (40 x 100 mS).

11 OUT
V2325
Output this constant to V2325, the location of the
deceleration parameter register.

12 Start Profile
X3 Y0
SET We use an input to allow the operator to start the
13 Profile Complete
profile. X3 is a momentary Start switch. When the
operator turns X3 ON, logical output Y0 starts the
profile.

14 SP104 Y2
OUT SP104 is the logical output of the HSIO to indicate
the move is complete. W e use Y2 to energize an

A C0
PD
annunciator that the profile has finished. This won’t
occur until after the interrupt from X2 has occurred
and the profile is complete.

B C0 Y0
RST

C
The profile will begin when the start input (X3) is given. Then the motion begins an
D indefinite move, which lasts until an external interrupt on X2 occurs. Then the motion
continues on for 5000 more pulses before stopping.

3–36 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Home Search Program Example


One of the more challenging aspects of motion control is the establishment of actual position 1
at powerup. This is especially true for open-loop systems which do not have a position
feedback device. However, a simple limit switch located at an exact location on the
positioning mechanism can provide “position feedback” at one point. For most stepper
2
control systems, this method is a good and economical solution. 3
Load

Positioning System Motor D


5
Limit Switches CCW limit (X1) Home limit (X2) CW limit (X3)

Motion 6
Numbering System -3000 -2000 -1000 0 1000 2000 3000

In the drawing above, the load moves left or right depending on the CCW/CW direction of 7
motor rotation. The PLC ladder program senses the CCW and CW limit switches to stop the
motor, before the load moves out-of-bounds and damages the machine. The home limit
switch is used at powerup to establish the actual position. The numbering system is arbitrary, 8
depending on a machine’s engineering units.
At powerup, we do not know whether the load is located to the left or to the right of the 9
home limit switch. Therefore, we will initiate a home search profile, using the registration
mode. The home limit switch is wired to X2, causing the interrupt. We choose an arbitrary
initial search direction, moving in the CW (left-to-right) direction.
10
• If the home limit switch closes first, then we stop and initialize the position (this value is typically
“0”, but it may be different if preferred).
11
• However, if the CW limit switch closes first, we must reverse the motor and move until the home
limit switch closes, stopping just past it. 12
In the latter case, we repeat the first move, because we always need to make the final approach
to the home limit switch from the same direction, so that the final physical position is the same 13
in either case!

SP0
Direct SOFT32
Selects Mode 30 as
14
LD the HSIO mode.

Mode 30
K30

OUT
Filtered Inputs

LD
The constant K2006
selects a 20 mS filter
A
V7633 K2006 time constant.

Locate LDA Configure the address


of the parameter table.
OUT
V7635
Output this constant to
V7635, configuring X1.
B
Parameter O2320
Table (optional)
OUT
V7630
LD
K1006
The constant K1006
selects a 10 mS filter
C
time constant.
Select Pulse /
Direction
LD
K103
Configure the Y0 and Y1
pulse outputs for pulse
and direction, respectively. OUT
V7636
Output this constant to
V7636, configuring X2, the
D
registration interrupt input.
OUT
V7637

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–37


Chapter 3: High-speed Input and Pulse Output Features

1 Profile / Target Velocity


C1
SP0 Select Registration Profile, TMR Add a timer to

2 LD
K9100 relative positioning, and a
target velocity of 1000 pps
(9xxx times 10 pps).
T0
K5
create a slight
delay before
reversing motor.
OUT T0 C2
3 Starting Velocity
V2320

The constant K4 selects a


SET CCW delay done.

LD starting velocity of 40 Hz Y0
K4
D (4 x 10 pps).
CCW past home
SET Start profile again.

OUT C2 C3 X2 C3
V2323
5 Acceleration LD
The constant K20 selects
an acceleration time of 2
SET CCW past home

Load a small
K20 seconds (20 x 100 mS). LDD positive position
6 OUT
V2324
K50 count (go CW).

OUTD
V2321
7 Deceleration
OUT
V2325
We’ll choose the same for
the deceleration value. Home Limit found, CW search direction
C3 X2 Y0
8 X7 C10
SET Start the home search
when X7 turns on.
RST Turn off Start Profile.

C4
9 Search in CW direction
C10 C0 The constant K50 selects C4
SET
Go CW back to
home.
Add a timer to
LDD a target position of 50 TMR
create a slight
10 Target Position
K50

OUTD
pulses (CW direction). T1
K5
delay before
reversing motor.

V2321 T1 C5
11 Y0
Turn on Start Profile,
searching for either the
home limit or the CW limit
SET CW delay done.

SET (depends on our starting Y0

12 C0
SET
position).
Set C0 to indicate the CW
SET Start profile again.

home search has begun. Home Limit found, CW search direction

13 CW Limit found
C0 C1 X3 Y0
C0 C1 C3 X2 Y0
RST Turn off Start Profile.
RST Turn off Start Profile.

14 LDD
The constant –K200
selects a target
C5
LDD
K0
Load the constant
K0 for our initialized
position.
K80000200 position of –200

A OUTD
V2321
pulses, which is in
the CCW direction.
OUTD
V1076
Output this constant
to C1076/V1077.

B C1
SET
The CW limit has
been reached.

C The home search profile will execute specific parts of the program, based on the order of
detection of the limit switches. Ladder logic sets C0 to initiate a home search in the CW
D direction. If the CW limit is encountered, the program searches for home in the CCW
direction, passes it slightly, and does the final CW search for home. After reaching home, the
last ladder rung preloads the current position to “0”.

3–38 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Velocity Profile Operation 1


Velocity Profile Applications
The velocity profile is best suited for applications which involve motion but do not require 2
moves to specific points. Conveyor speed control is a typical example.
3
Velocity
D
5
6
Time 7

Start Y0
8
Profile
Complete SP104 9
The time line of signal traces below the profile indicates the order of events. Assuming the
velocity is set greater than zero, motion begins when the Start input (Y0) energizes. Since 10
there is no end position target, the profile is considered in progress as long as the Start input
remains active. The profile complete logical input to ladder logic (X0) correlates directly to
the Start input status when velocity profiles are in use.
11
While the Start input is active, the ladder program can command a velocity change by writing
a new value to the velocity register (V2323 by default). The full speed range of 40 Hz to 7
12
kHz is available. Notice from the drawing that there are no acceleration or deceleration ramps
between velocity updates. This is how velocity profiling works with the HSIO. However, the 13
ladder program can command more gradual velocity changes by incrementing or
decrementing the velocity value more slowly. A counter or timer can be useful in creating
your own acceleration/deceleration ramps. Unless the load must do a very complex move, it is
14
easier to let the HSIO function generate the accel/decel ramps by selecting the trapezoidal or
registration profiles instead.
A
Unlike the trapezoidal and registration profiles, you must specify the desired direction of
travel with velocity profiles. Load the direction select register (V2321/V2322 by default) with B
8000 0000 hex for CCW direction, or 0 for CW direction.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–39


Chapter 3: High-speed Input and Pulse Output Features

Velocity Profile Program Example


1 The velocity profile we want to perform is drawn and labeled in the following figure. Each
velocity segment is of indefinite length. The velocity only changes when ladder logic (or other
2 device writing to V-memory) updates the velocity parameter.
Velocity Profile
3 Velocity

D
5
6 Time

The following program uses dedicated discrete inputs to load in new velocity values. This is a
7 fun program to try, because you can create an infinite variety of profiles with just two or three
input switches. The intent is to turn on only one of X1, X2, or X3 at a time. The beginning
8 of the program contains all the necessary setup parameters for Pulse Output Mode 30. We
only have to do this once in the program, so we use first-scan contact SP0 to trigger the setup

9 DirectSOFT32

SP0 Load constant K30 into the accumulator. This selects


LD
10 K30
Mode 30 as the HSIO mode.

Mode 30 Output this constant to V7633, the location of the HSIO


OUT
11 V7633 Mode select register.

Load the octal address of the beginning of the Profile


Locate Parameter LDA Parameter Table. The LDA instruction converts this to
12 Table (optional) O2320 hex number in the accumulator.
Output this address to V7630, the location of the pointer
OUT to the Profile Parameter Table.
13 V7630
Load the constant K103 which is required to select
Select Pulse / LD pulse and direction for physical Y0 and Y1 functions,
K103
14 Direction

OUT
respectively (your application may use CCW and CW).
Output this constant to V7637, configuring the pulse
output type.
V7637
A Filtered Inputs LD
Load the constant K1006 which is required to select
filtered inputs with a 10 mS filter time constant.
K1006
B OUT
Output this constant to V7635, configuring X1.
V7635

C OUT
Output this constant to V7636, configuring X2.
V7636

3–40 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Program Example Cont’d


1
SP0
LD
Load the constant K2000 which is required to select 2
Velocity Profile. This data word contains no velocity
K2000 information in the case of velocity mode.
Output this constant to V2320, the location of the Profile
3
Profile / Target OUT
Velocity Select setup register .
V2320
D
Load the constant K80000000 which selects CCW
Select Direction LDD
K80000000
direction for Velocity Profiles. Don’t forget to use double
word size (8-digit BCD position value). 5
Output this constant to V2321 and V2322, the location of
OUTD
V2321
the Target Position double-word register. 6
Set Velocity LD
K10
Load the constant K10 which is required to select an
initial velocity of 100 pps (uses x10 multiplier). 7
OUT
Output this constant to V2323, the location of the velocity
parameter register . After the program is running, we can
8
V2323 write here again, using discrete input switches.

Start Profile
9
X1 Y0
OUT We use a spare filtered input to allow the operator
10
to start the profile. When the operator turns X1 ON
Go Slow
and leaves it on, logical output Y0 starts the profile. 11
X2 Load the constant K50 which is required to select a
LD
K50 velocity of 500 pps when the operator closes X2. 12
OUT
V2323
Output this constant to V2323, the location of the velocity
parameter register . The speed will change immediately . 13
Go Moderately
X3
LD
Load the constant K200 which is required to select a 14
K200 velocity of 2000 pps when the operator closes X3.

Output this constant to V2323, the location of the velocity


A
OUT
parameter register . The speed will change immediately .
Go Fast
V2323
B
X4 Load the constant K600 which is required to select a
LD
K600 velocity of 6000 pps when the operator closes X4.
C
OUT
V2323
Output this constant to V2323, the location of the velocity
parameter register . The speed will change immediately . D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–41


Chapter 3: High-speed Input and Pulse Output Features

Pulse Output Error Codes


1 The Profile Parameter Table starting at V2320 (default location) defines the profile. Certain
numbers will result in a error when the HSIO attempts to use the parameters to execute a
2 move profile. When an error occurs, the HSIO writes an error code in V2326.
Most errors can be corrected by rechecking the Profile Parameter Table values. The error is
3 automatically cleared at powerup and at Program-to-Run Mode transitions.

Error Code Error Description


D 0000 No error
0010 Requested profile type code is invalid (must use 0, 1, 2, 8, or 9)
5 0020 Target Velocity is not in BCD
0021 Target Velocity is specified to be less than 40 pps

6 0022
0030
Target Velocity is specified to be greater than 7,000 pps
Target Position value is not in BCD
0040 Starting Velocity is not in BCD
7 0041 Starting Velocity is specified to be less than 40 pps
0042 Starting Velocity is specified to be greater than 1,000 pps

8 0050
0051
Acceleration Time is not in BCD
Acceleration Time is zero
0052 Acceleration Time is greater than 10 seconds
9 0060 Deceleration Time is not in BCD
0061 Deceleration Time is zero

10 0062 Deceleration Time is greater than 10 seconds

Troubleshooting Guide for HSIO Mode 30


11 If you’re having trouble with Mode 30 operation, please study the following symptoms and
possible causes. The most common problems are listed below:
12 Symptom: The stepper motor does not rotate.
Possible causes:
13 1. Configuration – Verify that the HSIO actually generates pulses on outputs Y0 and Y1. Watch the
status LEDs for Y0 and Y1 when you start a motion profile. If the LEDs flicker on and off or are
steadily on, the configuration is probably correct.
14 2. Programming error – If there are no pulses on Y0 or Y1 you may have a programming error.
Check the contents of V2326 for an error code that may be generated when the PLC attempts to
A do the move profile. Error code descriptions are given above.
3. Check target value – The profile will not pulse if the count value is equal to the target value
B (ex. count =0, target=0)

C
D

3–42 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

4. Wiring – Verify the wiring to the stepper motor is correct. Remember the signal ground
connection from the PLC to the motion system is required. 1
5. Motion system – Verify that the drive is powered and enabled. To verify the motion system is
working, you can use Mode 60 operation (normal PLC inputs/outputs) as shown in the test
program below. With it, you can manually control Y0 and Y1 with X0 and X1, respectively. Using
2
an input simulator is ideal for this type of manual debugging. With the switches you can single-
step the motor in either direction. If the motor will not move with this simple control, Mode 30
operation will not be possible until the problem with the motor drive system or wiring is corrected.
3
DirectSOFT32
SP0 Load constant K60 into the accumulator. This
D
LD selects Mode 60 as the HSIO mode.
K60

Mode 60 OUT
Output the constant to V7633, the location of the
5
HSIO Mode select register.
V7633

Filtered Inputs LD
Load the constant K1006 which is required to configure
6
filtered inputs with a time constant of 10 mS.
K1006

OUT
Output this constant to V7634, configuring X0.
7
V7634

OUT
Output this constant to V7635, configuring X1.
8
V7635

OUT
Output this constant to V7636, configuring X2.
9
V7636

X0
10
Y0
OUT Use a switch on X0 input to manually control output Y0.
11
X1 Y1
OUT Use a switch on X1 input to manually control output Y1.
12
END END coil marks the end of the main program..
13
6. Memory Error – HSIO configuration parameters are stored in the CPU system memory.
Corrupted data in this memory area can sometimes interfere with proper HSIO operation. If all 14
other corrective actions fail, initializing the scratchpad memory may solve the problem. With
DirectSOFT, select the PLC menu, then Setup, then Initialize Scratchpad. A
Symptom: The motor turns in the wrong direction.
Possible causes: B
1. Wiring – If you have selected CW and CCW type operation, just swap the wires on Y0 and Y1
outputs.
2. Direction control – If you have selected Pulse and Direction type operation, just change the
C
direction bit to the opposite state.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–43


Chapter 3: High-speed Input and Pulse Output Features

1 Mode 40: High-Speed Interrupts


Purpose
2 The HSIO Mode 40 provides a high-speed interrupt to the ladder program. This capability is
provided for your choice of the following application scenarios:
3 • An external event needs to trigger an interrupt subroutine in the CPU. Using immediate I/O
instructions in the subroutine is typical.
D • An interrupt routine needs to occur on a timed basis which is different from the CPU scan time
(either faster or slower). The timed interrupt is programmable, from 5 to 999 mS.

5 Functional Block Diagram


The HSIO circuit creates the high-speed interrupt to the CPU. The following diagram shows
6 the external interrupt option, which uses X0. In this configuration X1 and X2 are normal
filtered inputs.

7 DL05 Output Circuit


PLC
8 Y0, Y1 Y2 -Y5

HSIO I/O data CPU


9 Interrupt Interrupt
V-memory
Mode select
V7633 0040
10 FILTER !

X0 X1, X2 X3 - X7

11 Input Circuit

12
Alternately, you may configure the HSIO circuit to generate interrupts based on a timer, as
13 shown below. In this configuration, inputs X0 through X2 are filtered inputs.

14 DL05
PLC
Output Circuit

Y0, Y1 Y2 - Y5
A HSIO I/O data CPU
Interrupt
B FILTER Timer
Interrupt
Mode select
V-memory
V7633 0040

C X0, X1, X2 X3 - X7

D Input Circuit

3–44 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Setup for Mode 40


Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 1
40 in the lower byte of V7633 to select the High-Speed Counter Mode. The DL05 does not
use bits 8 - 15 in V7633. 2
Memory Location V7633
Bits 15
0
14
0
13
0
12 11
0 0
10
0
9
0
8
0
7
0
6
1
5
0
4
0
3
0
2
0
1
0
0
3
0 0 4 0
D
Bits 8 - 15 are not used HSIO Mode Setup (BCD)
in V7633. 40 = High-Speed Interrupt
5
Choose the most convenient method of programming V7633 from the following:
• Include load and out instructions in your ladder program
• DirectSOFT’s memory editor
6
• Use the Handheld Programmer D2–HPP
We recommend using the first method above so that the HSIO setup becomes an integral
7
part of your application program. An example program later in this section shows how to do
this. 8
Interrupts and the Ladder Program 9
Refer to the drawing below. The source of the interrupt may be external (X0), or the HSIO
timer function. The setup parameter in V7634 serves a dual purpose:,
• It selects between the two interrupt sources, external (X0) or an internal timer.
10
• In the case of the timer interrupt, it programs the interrupt timebase between 5 and 999 mS.
The resulting interrupt uses label INT 0 in the ladder program. Be sure to include the Enable
11
Interrupt (ENI) instruction at the beginning of your program. Otherwise, the interrupt
routine will not be executed. 12
CPU Scan
Input
13
Update
14
Ladder INT
X0, External Interrupt Program
Execution
A
Interrupt
Routine
B
TIMER current Program
Interrupt source /
instruction
IRT
C
Time select Input
V7634 xxx4
Update D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–45


Chapter 3: High-speed Input and Pulse Output Features

External Interrupt Timing Parameters


1 Signal pulses at X0 must meet certain timing criteria to guarantee an interrupt will result.
Refer to the timing diagram below. The input characteristics of X0 are fixed (it is not a
2 programmable filtered input). The minimum pulse width is 0.1 mS. There must be some
delay before the next interrupt pulse arrives, such that the interrupt period cannot be smaller
than 0.5 mS.
3 0.5 mS minimum

D External
0.1 mS minimum

Interrupt X0
5 Time
Timed Interrupt Parameters
6 When the timed interrupt is selected, the HSIO generates the interrupt to ladder logic. There
is no interrupt “pulse width” in this case, but the interrupt period can be adjusted from 5 to
7 999 mS.

5 mS to 999 mS
8 Timed
Interrupt

9 Time

X Input / Timed INT Configuration


10 The configurable discrete input options for High-Speed Interrupt Mode are listed in the table
below. Input X0 is the external interrupt when “0004” is in V7634. If you need a timed
11 interrupt instead, then V7634 contains the interrupt time period, and input X0 becomes a
filtered input (uses X1’s filter time constant by default). Inputs X1, and X2, can only be
filtered inputs, having individual configuration registers and filter time constants. However,
12 X0 will have the same filter time constant as X1 when the timed interrupt is selected.
Input Configuration Register Function Hex Code Required
13 V7634 External Interrupt 0004 (default)
X0 Filtered Input (when timed xxx4, xxx = INT timebase
Uses X1’s time setting in V7635
14 X1 V7635
interrupt is in use)
Filtered Input
5 - 999 ms (BCD)
xx06 (xx = filter time)
0 - 99 ms (BCD)

A X2 V7636 Filtered Input xx06 (xx = filter time)


0 - 99 ms (BCD)

B Independent Timed Interrupt


Interrupt O1 is also available as an interrupt. This interrupt is independent of the HSIO
features. Interrupt O1 uses an internal timer that is configured in V memory location V7647.
C The interrupt period can be adjusted from 5 to 9999 mS. Once the interrupt period is set
and the interrupt is enabled in the program, the CPU will continuously call the interrupt
D routine based on the time setting in V7647.
Input Configuration Register Function Hex Code Required
– V7647 High-Speed Timed Interrupt xxxx (xxxx = timer setting) 5- 9999 mS (BCD)

3–46 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

External Interrupt Program Example


The following program selects Mode 40, then selects the external interrupt option. Inputs X1 1
and X2 are configured as filtered inputs with a 10 mS time constant. The program is
otherwise generic, and may be adapted to your application. 2
Direct SOFT32

SP0 Load constant K40 into the accumulator . This


3
LD selects Mode 40 as the HSIO mode.
K40
D
Mode 40 Output this constant to V7633, the location of the
OUT HSIO Mode select register .
V7633
Load the constant K4 which is required to select the
5
External Interrupt LD external interrupt option. X0 is the interrupt input.
K4

Output this constant to V7634, configuring the


6
OUT external interrupt option for X0.
V7634
Load the constant K1006 which is required to select
7
Filtered Inputs LD filtered inputs with a 10 mS filter time constant.
K1006
8
Output this constant to V7635, configuring X1.
OUT
V7635
9
Output this constant to V7636, configuring X2.
OUT
V7636
10
Y5
RST Reset output Y0. 11
INT Enable ENI Enable Interrupts at the beginning of the program.
12
Main Program Insert Main Program rungs here for your application.

END END coil marks the end of the main program..


13
INT O0 The INT label marks the beginning of the interrupt
service routine program.
14
Interrupt Routine Insert interrupt service routine rungs here for your
application.
A
SP1 Y5
SETI Use the pulse catch input to set output Y0 on. B
IRT Return to the main ladder program. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–47


Chapter 3: High-speed Input and Pulse Output Features

Timed Interrupt Program Example


1 The following program selects Mode 40, then selects the timed interrupt option, with an
interrupt period of 100 mS.
2 100 mS
Timed

3 Interrupt
Time
Inputs X0, X1, and X2, are configured as filtered inputs with a 10 mS time constant. Note
D that X0 uses the time constant from X1. The program is otherwise generic, and may be
adapted to your application.
5 Direct SOFT32

SP0
6 LD
K40
Load constant K40 into the accumulator . This
selects Mode 40 as the HSIO mode.

Output this constant to V7633, the location of the


Mode 40
7 OUT
V7633 HSIO Mode select register.

Load the constant K1004 which is required to sele


LD the timed interrrupt option, with a period of 100 m
Timed Interrupt
8 K1004

OUT
Output this constant to V7634, configuring the tim
interrupt for 100 mS period.
V7634
9 Filtered Inputs LD
K1006
Load the constant K1006 which is required to sele
filtered inputs with a 10 mS filter time constant.

10 OUT
V7635
Output this constant to V7635, configuring X1 and

Output this constant to V7636, configuring X2.


11 OUT
V7636

12 INT Enable ENI Enable Interrupts at the beginning of the program.

Insert Main Program rungs here for your applicatio

13 Main Program
END END coil marks the end of the main program.

14 INT O0 The INT label marks the beginning of the interrupt


service routine program.
Interrupt Routine Insert interrupt service routine rungs here for your
application.
A SP1
LD Load constant K1 into the accumulator .
K1

B ADD
V2000
Add the value in the accumulator with the value in
memory location V2000.

C OUT
V2000
Output the result into memory location V2000.

D IRT Return to the main ladder program.

3–48 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Mode 50: Pulse Catch Input 1


Purpose
The HSIO circuit has a pulse-catch mode of operation. It monitors the signal on input X0, 2
preserving the occurrence of a narrow pulse. The purpose of the pulse catch mode is to enable
the ladder program to “see” an input pulse which is shorter in duration than the current scan 3
time. The HSIO circuit latches the input event on input X0 for one scan. This contact
automatically goes off after one scan.
D
Functional Block Diagram
Refer to the block diagram below. When the lower byte of HSIO Mode register V7633
contains a BCD “50”, the pulse catch mode in the HSIO circuit is enabled. X0 automatically
5
becomes the pulse catch input, which sets the latch on each rising edge. The HSIO resets the
latch at the end of the next CPU scan. Inputs X1 and X2 are available as filtered discrete inputs. 6
DL05 Output Circuit
7
PLC

HSIO
Y0, Y1 Y2 -Y5

CPU
8
I/O data
LATCH
V-memory
9
FILTER Mode select
Set Reset V7633 0050
10
X0 scan X1, X2 X3 - X7

Input Circuit
11
12
Pulse Catch Timing Parameters
Signal pulses at X0 must meet certain timing criteria to guarantee a pulse capture will result. Refer 13
to the timing diagram below. The input characteristics of X0 are fixed (it is not a programmable
filtered input). The minimum pulse width is 0.1 mS. There must be some delay before the next
pulse arrives, such that the pulse period cannot be smaller than 0.5 mS. If the pulse period is
14
smaller than 0.5 mS, the next pulse will be considered part of the current pulse.
A
0.5 mS minimum

0.1 mS minimum
B
Pulse
Input X0 C
Time
D
Note: that the pulse catch and filtered input functions are opposite in nature. The pulse catch feature on X0
seeks to capture narrow pulses, while the filter input feature on X1 and X2 seeks to reject narrow pulses.

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–49


Chapter 3: High-speed Input and Pulse Output Features

Setup for Mode 50


1 Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD
50 in the lower byte of V7633 to select the High-Speed Counter Mode. The DL05 does not
2 use bits 8 - 15 in V7633.
Memory Location V7633
3 Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
D
0 0 5 0
5
Bits 8 - 15 are not used HSIO Mode Setup (BCD)
6 in V7633. 50 = Pulse Catch Input
7 Choose the most convenient method of programming V7633 from the following:
• Include load and out instructions in your ladder program
8 • DirectSOFT32’s memory editor
• Use the Handheld Programmer D2–HPP
9 We recommend using the first method above so that the HSIO setup becomes an integral
part of your application program. An example program later in this section shows how to do
10 this.
X Input Configuration
11 The configurable discrete input options for Pulse Catch Mode are listed in the table below.
Input X0 is the pulse input, and must have “0005” loaded into it configuration register
V7634. Inputs X1 and X2 can only be filtered inputs. Each input has its own configuration
12 register and filter time constant.

13
14 Input Configuration Function Hex Code Required
Register
A X0 V7634 Pulse Catch Input 0005
xx06 (xx = filter time)
X1 V7635 Filtered Input 0 - 99 ms (BCD)
B X2 V7636 Filtered Input xx06 (xx = filter time)
0 - 99 ms (BCD)

C
D

3–50 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Pulse Catch Program Example


The following program selects Mode 50, then programs the pulse catch code for X0. Inputs 1
X1 and X2 are configured as filtered inputs with 10 and 30 mS time constants respectively.
The program is otherwise generic, and may be adapted to your application. 2
Direct SOFT32
3
SP0 Load constant K50 into the accumulator . This
LD selects Mode 50 as the HSIO mode.
K50 D
Mode 50 OUT
V7633
Output this constant to V7633, the location of the
HSIO Mode select register. 5
Pulse Catch LD
Load the constant K5 which is required to configure X0
as the pulse catch input.
6
K5

OUT
Output this constant to V7634, configuring the pulse 7
catch option for X0.
V7634

Filtered Inputs Load the constant K1006 which is required to select


8
LD filtered inputs with a 10 mS filter time constant.
K1006
9
Output this constant to V7635, configuring X1.
OUT
V7635 10
Load the constant K3006 which is required to select
LD
K3006
filtered inputs with a 30 mS filter time constant. 11
OUT
Output this constant to V7636, configuring X2. 12
V7636
13
14
A
Main Program B
X0 Y0
SET Use the pulse catch input to set output Y0 on. This will
work even for a very short pulse on X0.
C
END END coil marks the end of the main program.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–51


Chapter 3: High-speed Input and Pulse Output Features

1 Mode 60: Discrete Inputs with Filter


Purpose
2 The last mode we will discuss for the HSIO circuit is Mode 60, Discrete Inputs with Filter.
The purpose of this mode is to allow the input circuit to reject narrow pulses and accept wide
3 ones, as viewed from the ladder program. This is useful in especially noisy environments or
other applications where pulse width is important. In all other modes in this chapter, X0 to
X2 usually support the mode functions as special inputs. Only spare inputs operate as filtered
D inputs by default. Now in Mode 60, all three inputs X0 through X2 function only as discrete
filtered inputs.
5 Functional Block Diagram
Refer to the block diagram below. When the lower byte of HSIO Mode register V7633
6 contains a BCD “60”, the input filter in the HSIO circuit is enabled. Each input X0 through
X2 has its own filter time constant. The filter circuit assigns the outputs of the filters as logical
7 references X0 through X2.

8 DL05
PLC
Output Circuit

Y0, Y1 Y2-Y5
9 HSIO I/O data CPU

10 FILTERS X0-X2
Mode select
V-memory
V7633 0060

11 X0 X1 X2 X3-X7

12 Input Circuit

13 Input Filter Timing Parameters


Signal pulses at inputs X0 – X2 are filtered by using a delay time. In the figure below, the
14 input pulse on the top line is longer than the filter time. The resultant logical input to ladder
is phase-shifted (delayed) by the filter time on both rising and falling edges. In the bottom
waveforms, the physical input pulse width is smaller than the filter time. In this case, the
A logical input to the ladder program remains in the OFF state (input pulse was filtered out).

B Filter Time Filter Time

Physical Input X0
C Logical Input X0

D Time
Physical Input X0
Logical Input X0

3–52 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 3: High-speed Input and Pulse Output Features

Setup for Mode 60


Recall that V7633 is the HSIO Mode Select register. Refer to the diagram below. Use BCD 1
60 in the lower byte of V7633 to select the High-Speed Counter Mode. The DL05 does not
use bits 8 - 15 in V7633. 2
Memory Location V7633
Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
3
0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
D
0 0 6 0 5
Bits 8 - 15 are not used
in V7633.
HSIO Mode Setup (BCD) 6
60 = Discrete Filtered Inputs
7
Choose the most convenient method of programming V7633 from the following:
• Include load and out instructions in your ladder program
8
• DirectSOFT32’s memory editor
• Use the Handheld Programmer D2–HPP
9
We recommend using the first method above so that the HSIO setup becomes an integral
part of your application program. An example program later in this section shows how to to
10
this.
X Input Configuration
11
The configurable discrete input options for Discrete Filtered Inputs Mode are listed in the
table below. The filter time constant (delay) is programmable from 0 to 99 mS (the input acts 12
as a normal discrete input when the time constant is set to 0). The code for this selection
occupies the upper byte of the configuration register in BCD. We combine this number with
the required “06” in the lower byte to get “xx06”, where xx = 0 to 99. Input X0, X1, and X2
13
can only be filtered inputs. Each input has its own configuration register and filter time
constant. 14
Input Configuration Function Hex Code Required
A
Register
X0 V7634 Filtered Input xx06 (xx = filter delay time)
0 - 99 ms (BCD) B
xx06 (xx = filter delay time)
X1 V7635 Filtered Input 0 - 99 ms (BCD)
xx06 (xx = filter delay time)
C
X2 V7636 Filtered Input 0 - 99 ms (BCD)
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 3–53


Chapter 3: High-speed Input and Pulse Output Features

Filtered Inputs Program Example


1 The following program selects Mode 60, then programs the filter delay time constants for
inputs X0, X1, and X2. Each filter time constant is different, for illustration purposes. The
2 program is otherwise generic, and may be adapted to your application.
Direct SOFT32
3 SP0 Load constant K60 into the accumulator . This
LD selects Mode 60 as the HSIO mode.
D K60

Mode 60 Output the constant to V7633, the location of the


5 OUT
V7633
HSIO Mode select register .

6 Filtered Inputs LD
K1006
Load the constant K1006 which is required to configure
filtered inputs with a time constant of 10 mS.

7 OUT
Output this constant to V7634, configuring X0.
V7634
8 LD
Load the constant K2006 which is required to select
filtered inputs with a 20 mS filter time constant.
K2006
9 Output this constant to V7635, configuring X1.
OUT
10 V7635
Load the constant K5006 which is required to select
11 LD
K5006
filtered inputs with a 50 mS filter time constant.

12 OUT
V7636
Output this constant to V7636, configuring X2.

13
Main Program Insert Main Program rungs here for your application.
14
END END coil marks the end of the main program..
A
B
C
D

3–54 DL05 Micro PLC User Manual, 5th Edition, 6/04


CPU SPECIFICATIONS AND CHAPTER
OPERATION
4
In This Chapter:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–2
CPU Specificatons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–3
CPU Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–4
CPU Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–11
I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–15
CPU Scan Time Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . .4–18
Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–22
DL05 System V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–26
DL05 Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-29
X Input Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–30
Y Output Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–30
Stage Control / Status Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . .4–30
Control Relay Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–31
Timer Status Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–32
Counter Status Bit Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–32
Network Configuration and Connections . . . . . . . . . . . . . . . . . . . .4–37
Network Slave Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–36
Network Master Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4–41
Chapter 4: CPU Specifications and Operation

1 Introduction
The Central Processing Unit (CPU) is the heart of the Micro PLC. Almost all PLC
2 operations are controlled by the CPU, so it is important that it is set up correctly. This
chapter provides the information needed to understand:
• Steps required to set up the CPU
3 • Operation of ladder programs
• Organization of Variable Memory
4 To Programming Device
or Operator Interface
5 DL05
PLC
2 Comm.
6 CPU Ports

7 Main
Power
Supply
8 Input Circuit Output Circuit

9 Power
Input 8 Discrete Inputs Commons 6 Discrete Outputs Commons
10 Note: The High-Speed I/O function (HSIO) consists of dedicated but configurable hardware in the DL05. It
is not considered part of the CPU, because it does not execute the ladder program. For more on HSIO
11 operation, see Chapter 3.

12 DL05TheCPU Features
DL05 Micro PLC which has 6K words of memory comprised of 2.0K of ladder memory
and 4K words of V-memory (data registers). Program storage is in the FLASH memory which
13 is a part of the CPU board in the PLC. In addition, there is RAM with the CPU which will
store system parameters, V-memory, and other data which is not in the application program.
The RAM is backed up by a “super-capacitor”, storing the data for several hours in the event
14 of a power outage. The capacitor automatically charges during powered operation of the PLC.
The DL05 supports fixed I/O which includes eight discrete input points and six output
A points. If more than the fourteen fixed I/O points are needed, select an I/O module for your
application from the DL05/06 Options Manual. This module will plug into the expansion
B slot.
Over 120 different instructions are available for program development as well as extensive
C internal diagnostics that can be monitored from the application program or from an operator
interface. Chapters 5, 6, and 7 provide detailed descriptions of the instructions.
D The DL05 provides two built-in RS232C communication ports, so you can easily connect a
handheld programmer, operator interface, or a personal computer without needing any
additional hardware.

4–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

CPU Specificatons 1
Specifications

Total Program memory (words)


Feature DL05
6K
2
Ladder memory (words) 2048
Total V-memory (words) 4096 3
User V-memory (words) 3968
Non-volatile V Memory (words)
Contact execution (boolean)
128
2.0uS
4
Typical scan (boolean) 2.7–3.2mS
RLL Ladder style Programming Yes 5
RLL and RLLPLUS Programming Yes
Run Time Edits
Scan
Yes
Variable / fixed
6
Handheld programmer Yes
DirectSOFT32 programming for Windows. Yes 7
Built-in communication ports (RS232C) Yes
FLASH Memory
Local Discrete I/O points available
Standard on CPU
14
8
Local Analog input / output channels maximum None
High-Speed I/O (quad., pulse out, interrupt, pulse catch, etc.) Yes, 2 9
I/O Point Density 8 inputs, 6 outputs
Number of instructions available (see Chapter 5 for details)
Control relays
129
512
10
Special relays (system defined) 512
Stages in RLLPLUS 256 11
Timers 128
Counters
Immediate I/O
128
Yes
12
Interrupt input (external / timed) Yes
Subroutines Yes 13
For/Next Loops Yes
Math
Drum Sequencer Instruction
Integer
Yes
14
Time of Day Clock/Calendar No
Internal diagnostics Yes A
Password security Yes
System error log
User error log
No
No
B
Battery backup No (built–in super–cap)
Yes, with memory cartridge C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–3


Chapter 4: CPU Specifications and Operation

1 CPU Hardware Setup


Communication Port Pinout Diagrams
2 Cables are available that allow you to quickly and easily connect a Handheld Programmer or a
personal computer to the DL05 PLCs. However, if you need to build your own cables, use
3 the pinout diagrams shown. The DL05 PLCs require an RJ-12 phone plug to fit the built-in
jacks.
4 The Micro PLC has two built-in RS232C communication ports. Port 1 is generally used for
connecting to a D2-HPP, DirectSOFT32, operator interface, MODBUS slave, or a
5 DirectNET slave. . The baud rate is fixed at 9600 baud for port 1. Port 2 can be used to
connect to a D2-HPP, DirectSOFT32, operator interface, MODBUS master/slave, or a
DirectNET master/slave. Port 2 has a range of speeds from 300 baud to 38.4K baud.
6 NOTE: The 5V pins are rated at 200mA maximum, primarilly for use with some operator interface units.

7 Port 1 Pin Descriptions Port 2 Pin Descriptions


1 0V Power (–) connection (GND) 1 0V Power (–) connection (GND)
8 1234 5 6
2
3
5V
RXD
Power (+) connection
Receive Data (RS232C)
2
3
5V
RXD
Power (+) connection
Receive Data (RS232C)
4 TXD Transmit Data (RS232C 4 TXD Transmit Data (RS232C
9 Modular
6-pin Female
Connector
5
6
5V
0V
Power (+) conection
Power (–) connection (GND)
5
6
RTS
0V
Request to Send
Power (–) connection (GND)

10
11
12 1 1

13
Top View
14 Communication Port 1 Communication Port 2

A Com 1 Connects to HPP , Direct SOFT32,


operator interfaces, etc.
Com 2 Connects to HPP , Direct SOFT32,
operator interfaces, etc.
6-pin, RS232C 6-pin, RS232C
B 9600 Baud (Fixed)
Parity - odd (default)
Communication speed (baud)
300, 600, 1200, 2400, 4800,
Station address 1 (fixed) 9600, 19200, 38400
C 8 data bits
1 start, 1 stop bit
Asynchronous, Half-duplex, DTE
Parity - odd (default), even, none
Station address 1 (default)
8 data bits
Protocol: (Auto-Select) 1 start, 1 stop bit
D K sequence (Slave only)
DirectNET (Slave only)
Asynchronous, Half-duplex, DTE
Protocol: (Auto-Select)
MODBUS (Slave only) K sequence (Slave only)
DirectNET (Master/Slave)
MODBUS (Master/Slave)
Non-sequence/Print
4–4 DL05 Micro PLC User Manual, 5th Edition, 6/04
Chapter 4: CPU Specifications and Operation

Connecting the Programming Devices


If you’re using a Personal Computer with the DirectSOFT32 programming package, you can 1
connect the computer to either of the DL05’s programming ports. For an engineering office
environment (typical during program development), this is the preferred method of
programming.
2
3
4
5
Use cable part no.
D2–DSCBL
6
The Handheld programmer is connected to the CPU with a handheld programmer cable. 7
This device is ideal for maintaining existing installations or making small program changes.
The handheld programmer is shipped with a cable, which is approximately 6.5 feet (200 cm)
long.
8
9
(cable comes with HPP)

For replacement
cable, use part #
10
DV–1000CBL
11
12
CPU Setup Information
Even if you have years of experience using PLCs, there are a few things you need to do before 13
you can start entering programs. This section includes some basic things, such as changing
the CPU mode, but it also includes some things that you may never have to use. Here’s a brief
list of the items that are discussed. Selecting and Changing the CPU Modes
14
• Using Auxiliary Functions
• Clearing the program (and other memory areas)
A
• How to initialize system memory
• Setting retentive memory ranges
B
The following paragraphs provide the setup information necessary to get the CPU ready for
programming. They include setup instructions for either type of programming device you are
C
using. The D2–HPP Handheld Programmer Manual provides the Handheld keystrokes
required to perform all of these operations. The DirectSOF32. Manual provides a description D
of the menus and keystrokes required to perform the setup procedures via DirectSOFT32.

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–5


Chapter 4: CPU Specifications and Operation

Mode Switch

1
2
3 Status
Indicators

4
5
6 Status Indicators
7 The status indicator LEDs on the CPU front panels have specific functions which can help in
programming and troubleshooting.

8 Indicator
PWR
Status
ON
Meaning
Power good
OFF Power failure
9 RUN ON CPU is in Run Mode
OFF CPU is in Stop or program Mode
10 CPU ON CPU self diagnostics error
OFF CPU self diagnostics good

11 TX1 ON
OFF
Data is being transmitted by the CPU - Port 1
No data is being transmitted by the CPU - Port 1
RX1 ON Data is being received by the CPU - Port 1
12 OFF No data is being received by the CPU - Port 1
TX2 ON Data is being transmitted by the CPU - Port 2
13 OFF No data is being transmitted by the CPU - Port 2
RX2 ON Data is being received by the CPU - Port 2

14 OFF No data is being received by the CPU - Port 2

Mode Switch Functions


A The mode switch on the DL05 PLC provides positions for enabling and disabling program
changes in the CPU. Unless the mode switch is in the TERM position, RUN and STOP
B mode changes will not be allowed by any interface device, (handheld programmer,
DirectSOFT32 programing package or operator interface). Programs may be viewed or
C monitored but no changes may be made. If the switch is in the TERM position and no
program password is in effect, all operating modes as well as program access will be allowed
through the connected programming or monitoring device.
D

4–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Changing Modes in the DL05 PLC


Modeswitch Position CPU Action
1
RUN (Run Program)
CPU is forced into the RUN mode if no errors are
encountered. No changes are allowed by the attached
programming/monitoring device.
2
PROGRAM and the TEST modes are available. Mode and
TERM (Terminal) RUN, program changes are allowed by the
programming/monitoring device.
3
STOP CPU is forced into the STOP mode. No changes are allowed
by the programming/monitoring device.Table 4
There are two ways to change the CPU mode. You can use the CPU mode switch to select
the operating mode, or you can place the mode switch in the TERM position and use a
5
programming device to change operating modes. With the switch in this position, the CPU
can be changed between Run and Program modes. You can use either DirectSOFT32 or the 6
Handheld Programmer to change the CPU mode of operation. With DirectSOFT32 you use
a menu option in the PLC menu. With the Handheld Programmer, you use the MODE key. 7
8
9
10
11
12
MODE
Menu Options Key 13
Mode of Operation at Power-up
The DL05 CPU will normally power-up in the mode that it was in just prior to the power
14
interruption. For example, if the CPU was in Program Mode when the power was
disconnected, the CPU will power-up in Program Mode (see warning note below). A
WARNING: Once the super capacitor has discharged, the system memory may not retain the previous
mode of operation. When this occurs, the PLC can power-up in either Run or Program Mode if the B
mode switch is in the term position. There is no way to determine which mode will be entered as the
startup mode. Failure to adhere to this warning greatly increases the risk of unexpected equipment
startup.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–7


Chapter 4: CPU Specifications and Operation

Auxiliary Functions
Many CPU setup tasks involve the use of Auxiliary (AUX) Functions. The AUX Functions
1 perform many different operations, ranging from clearing ladder memory, displaying the scan
time, copying programs to EEPROM in the handheld programmer, etc. They are divided into
2 categories that affect different system parameters. Appendix A provides a description of the
AUX functions.
3 You can access the AUX Functions from DirectSOFT32. or from the D2–HPP Handheld
Programmer. The manuals for those products provide step-by-step procedures for accessing
the AUX Functions. Some of these AUX Functions are designed specifically for the Handheld
4 Programmer setup, so they will not be needed (or available) with the DirectSOFT32 package.
The following table shows a list of the Auxiliary functions for the Handheld Programmer.
5 AUX 2* — RLL Operations 5B HSIO Configuration
21 Check Program 5D Scan Control Setup
6 22
23
Change Reference
Clear Ladder Range
AUX 6* — Handheld ProgrammerConfiguration
61 Show Revision Numbers
24 Clear All Ladders 62 Beeper On / Off
7 AUX 3* — V-Memory Operations 65 Run Self Diagnostics
31 Clear V Memory AUX 7* — EEPROM Operations
8 AUX 4* — I/O Configuration 71 Copy CPU memory to HPP EEPROM
41 Show I/O Configuration 72 Write HPP EEPROM to CPU
9 AUX 5* — CPU Configuration
51 Modify Program Name
73
74
Compare CPU to HPP EEPROM
Blank Check (HPP EEPROM)
53 Display Scan Time 75 Erase HPP EEPROM
10 54 Initialize Scratchpad 76 Show EEPROM Type (CPU and HPP)
55 Set Watchdog Timer AUX 8* — Password Operations
11 56
57
Set Communication Port 2
Set Retentive Ranges
81
82
Modify Password
Unlock CPU

12 58
59
Test Operations
Override Setup
83 Lock CPU

13 Clearing an Existing Program


Before you enter a new program, be sure to always clear ladder memory. You can use AUX
14 Function 24 to clear the complete program.
You can also use other AUX functions to clear other memory areas.
A • AUX 23 — Clear Ladder Range
• AUX 24 — Clear all Ladders
B • AUX 31 — Clear V Memory
Initializing System Memory
C The DL05 Micro PLC maintain system parameters in a memory area often referred to as the
“scratchpad”. In some cases, you may make changes to the system setup that will be stored in
D system memory. For example, if you specify a range of Control Relays (CRs) as retentive,
these changes are stored in system memory. AUX 54 resets the system memory to the default
values.

4–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

WARNING: You may never have to use this feature unless you want to clear any setup information that
is stored in system memory. Usually, you’ll only need to initialize the system memory if you are
changing programs and the old program required a special system setup. You can usually load in new 1
programs without ever initializing system memory.
Remember, this AUX function will reset all system memory. If you have set special parameters such as
retentive ranges, etc. they will be erased when AUX 54 is used. Make sure you that you have
2
considered all ramifications of this operation before you select it.
3
Setting Retentive Memory Ranges
The DL05 PLCs provide certain ranges of retentive memory by default. The default ranges
are suitable for many applications, but you can change them if your application requires
4
additional retentive ranges or no retentive ranges at all. The default settings are:
You can use AUX 57 to set the retentive ranges. You can also use DirectSOFT32 menus to
5
select the retentive ranges. Appendix A contains detailed information about auxiliary
DL05
6
Memory Area
Control Relays
Default Range
C400 – C777
Available Range
C0 – C777
7
V Memory V1400 – V7777 V0 – V7777
Timers None by default T0 – T177 8
Counters CT0 – CT177 CT0 – CT177
Stages None by default S0 – S377
9
WARNING: The DL05 PLCs do not have battery back-up (unless the memory cartridge, D0–01MC, is
installed) The super capacitor will retain the values in the event of a power loss, but only for a short
period of time, depending on conditions.
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–9


Chapter 4: CPU Specifications and Operation

Using a Password
1 The DL05 PLCs allow you to use a password to help minimize the risk of unauthorized
program and/or data changes. Once you enter a password you can “lock” the PLC against
2 access. Once the CPU is locked you must enter the password before you can use a
programming device to change any system parameters.
3 You can select an 8-digit numeric password. The Micro PLCs are shipped from the factory
with a password of 00000000. All zeros removes the password protection. If a password has
been entered into the CPU you cannot just enter all zeros to remove it. Once you enter the
4 correct password, you can change the password to all zeros to remove the password
protection.
5 WARNING: Make sure you remember your password. If you forget your password you will not be able to
access the CPU. The Micro PLC must be returned to the factory to have the password removed.
6 You can use the D2–HPP Handheld Programmer or
DirectSOFT32. to enter a password. The following diagram
7 shows how you can enter a password with the Handheld
Programmer.
8 DirectSOFT32 D2–HPP
Select AUX 81
9 CLR CLR I
8
B
1
AUX ENT
PASSWORD
10 00000000
11 Enter the new 8-digit password

12 X X X ENT
PASSWORD
xxxxxxxx
13 Press CLR to clear the display

14 There are three ways to lock the CPU once the password has been entered.
1. If the CPU power is disconnected, the CPU will be automatically locked against access.

A 2. If you enter the password with DirectSOFT32, the CPU will be automatically locked against
access when you exit DirectSOFT32.
3. Use AUX 83 to lock the CPU.
B When you use DirectSOFT32, you will be prompted for a password if the CPU has been
locked. If you use the Handheld Programmer, you have to use AUX 82 to unlock the CPU.
C Once you enter AUX 82, you will be prompted to enter the password.

4–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

CPU Operation 1
Achieving the proper control for your equipment or process requires a good understanding of
how DL05 CPUs control all aspects of system operation. There are four main areas to
understand before you create your application program:
2
• CPU Operating System — the CPU manages all aspects of system control. A quick overview of all
the steps is provided in the next section. 3
• CPU Operating Modes — The two primary modes of operation are Program Mode and Run
Mode. 4
• CPU Timing — The two important areas we discuss are the I/O response time and the CPU scan
time.
• CPU Memory Map — DL05 CPUs offer a wide variety of resources, such as timers, counters,
5
inputs, etc. The memory map section shows the organization and availability of these data types.
CPU Operating System
6
Power up
At powerup, the CPU initializes the internal electronic
hardware. Memory initialization starts with examining the Initialize hardware
7
retentive memory settings. In general, the contents of
retentive memory is
Initialize various memory
based on retentive
configuration
8
preserved, and non-retentive memory is initialized to zero
(unless otherwise specified).
Update input
9
After the one-time powerup tasks, the CPU begins the
cyclical scan activity. The flowchart to the right shows
how the tasks differ, based on the CPU mode and the
Service peripheral 10
existence of any errors. The “scan time” is defined as the
average time around the task loop. Note that the CPU is
Update Special Relays
11
always reading the inputs, even during program mode.
This allows programming tools to monitor input status at
any time.
PGM
Mode?
12
RUN
The outputs are only updated in Run mode. In program
mode, they are in the off state.
Execute program
13
Update output
Error detection has two levels. Non-fatal errors are
reported, but the CPU remains in its current mode. If a
14
fatal error occurs, the CPU is forced into program mode
and the outputs go off.
Do diagnostics
A
YES
OK?

NO
B
Report error, set flag
register, turn on LED
C
NO
Fatal error

YES
D
Force CPU into
PGM mode

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–11


Chapter 4: CPU Specifications and Operation

Program Mode
1 In Program Mode, the CPU does not execute the
application program or update the output points.
2 The primary use for Program Mode is to enter or
change an application program. You also use
program mode to set up the CPU parameters, such
3 as HSIO features, retentive memory areas, etc.
You can use a programming device, such as
4 DirectSOFT32 or the D2–HPP Handheld
Programmer to place the CPU in Program Mode. Download
5 Run Mode
In Run Mode, the CPU executes the application
6 program and updates the I/O system. You can
perform many operations during Run Mode. Some
7 of these include:
• Monitor and change I/O point status

8 • Update timer/counter preset values


• Update Variable memory locations

9 Run Mode operation can be divided into several key


areas. For the vast majority of applications, some of
these execution segments are more important than
10 others. For example, you need to understand how
Normal Run mode scan
the CPU updates the I/O points, handles forcing
11 operations, and solves the application program. The
remaining segments are not that important for most Read Inputs
applications.
12 You can use DirectSOFT32 or the D2–HPP Service Peripherals
Handheld Programmer to place the CPU in Run
13 Mode. Update Special Relays
You can also edit the program during Run Mode.
14 The Run Mode Edits are not “bumpless” to the Solve the Application Program
outputs. Instead, the CPU maintains the outputs in
A their last state while it accepts the new program
information. If an error is found in the new
Write Outputs

program, then the CPU will turn all the outputs off
B and enter the Program Mode. This feature is
Diagnostics

discussed in more detail in Chapter 9.


C WARNING: Only authorized personnel fully familiar with all aspects of the application should make
changes to the program. Changes during Run Mode become effective immediately. Make sure you
D thoroughly consider the impact of any changes to minimize the risk of personal injury or damage to
equipment.

4–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Read Inputs
The CPU reads the status of all inputs, then stores it in the image register. Input image 1
register locations are designated with an X followed by a memory location. Image register data
is used by the CPU when it solves the application program. 2
Of course, an input may change after the CPU has just read the inputs. Generally, the CPU
scan time is measured in milliseconds. If you have an application that cannot wait until the
next I/O update, you can use Immediate Instructions. These do not use the status of the
3
input image register to solve the application program. The Immediate instructions
immediately read the input status directly from the I/O modules. However, this lengthens the 4
program scan since the CPU has to read the I/O point status again. A complete list of the
Immediate instructions is included in Chapter 5. 5
Service Peripherals and Force I/O
After the CPU reads the inputs from the input modules, it reads any attached peripheral 6
devices. This is primarily a communications service for any attached devices. For example, it
would read a programming device to see if any input, output, or other memory type status
needs to be modified. There are two basic types of forcing available with the DL05 CPUs.
7
• Forcing from a peripheral – not a permanent force, good only for one scan
• Bit Override – holds the I/O point (or other bit) in the current state. Valid bits are X, Y, C, T, CT,
8
and S. (These memory types are discussed in more detail later in this chapter).
Regular Forcing — This type of forcing can temporarily change the status of a discrete bit. 9
For example, you may want to force an input on, even though it is really off. This allows you
to change the point status that was stored in the image register. This value will be valid until 10
the image register location is written to during the next scan. This is primarily useful during
testing situations when you need to force a bit on to trigger another event.
Bit Override — Bit override can be enabled on a point-by-point basis by using AUX 59 from
11
the Handheld Programmer or, by a menu option from within DirectSOFT32. Bit override
basically disables any changes to the discrete point by the CPU. For example, if you enable bit 12
override for X1, and X1 is off at the time, then the CPU will not change the state of X1. This
means that even if X1 comes on, the CPU will not acknowledge the change. So, if you used 13
X1 in the program, it would always be evaluated as “off ” in this case. Of course, if X1 was on
when the bit override was enabled, then X1 would always be evaluated as “on”.
There is an advantage available when you use the bit override feature. The regular forcing is
14
not disabled because the bit override is enabled. For example, if you enabled the Bit Override
for Y0 and it was off at the time, then the CPU would not change the state of Y0. However, A
you can still use a programming device to change the status. Now, if you use the
programming device to force Y0 on, it will remain on and the CPU will not change the state
of Y0. If you then force Y0 off, the CPU will maintain Y0 as off. The CPU will never update
B
the point with the results from the application program or from the I/O update until the bit
override is removed. The following diagram shows a brief overview of the bit override feature. C
Notice the CPU does not update the Image Register when bit override is enabled.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–13


Chapter 4: CPU Specifications and Operation

1
Input Update Input Update
2 Bit Override OFF Force from
X128
OFF
Y128
...
...
...
X2
ON
Y2
X1
ON
Y1
X0
OFF
Y0 Force from Bit Override ON
Programmer OFF ... ON ON OFF Programmer
3 Result of Program
C377
OFF
...
...
C2
ON
C1
OFF
Image Register (example)
C0
OFF
Result of Program
Solution Solution

4
5 WARNING: Only authorized personnel fully familiar with all aspects of the application should make
changes to the program. Make sure you thoroughly consider the impact of any changes to minimize the
risk of personal injury or damage to equipment.
6
Update Special Relays and Special Registers
7 There are certain V-memory locations that contain Special Relays and other dedicated register
information. This portion of the execution cycle makes sure these locations get updated on
every scan. Also, there are several different Special Relays, such as diagnostic relays, etc., that
8 are also updated during this segment.
Solve Application Program
9 The CPU evaluates each instruction in the application
program during this segment of the scan cycle. The
10 instructions define the relationship between the input
conditions and the desired output response. The CPU
11 uses the output image register area to store the status of
the desired action for the outputs. Output image register
locations are designated with a Y followed by a memory
12 location. The actual outputs are updated during the write
Normal Run mode scan

outputs segment of the scan cycle. There are immediate


13 output instructions available that will update the output
points immediately instead of waiting until the write
Read Inputs

Service Peripherals
output segment. A complete list of the Immediate
14 instructions is provided in Chapter 5.
Update Special Relays
The internal control relays (C), the stages (S), and the
A variable memory (V) are also updated in this segment. Solve the Application Program

You may recall that you can force various types of points
B in the system. (This was discussed earlier in this chapter.)
Write Outputs

If any I/O points or memory data have been forced, the Diagnostics
C output image register also contains this information.

4–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Write Outputs
Once the application program has solved the instruction logic and constructed the output 1
image register, the CPU writes the contents of the output image register to the corresponding
output points. Remember, the CPU also made sure that any forcing operation changes were
stored in the output image register, so the forced points get updated with the status specified
2
earlier.
3
Diagnostics
During this part of the scan, the CPU performs all system diagnostics and other tasks such as
calculating the scan time and resetting the watchdog timer. There are many different error
4
conditions that are automatically detected and reported by the DL05 PLCs. Appendix B
contains a listing of the various error codes. 5
Probably one of the more important things that occurs during this segment is the scan time
calculation and watchdog timer control. The DL05 CPU has a “watchdog” timer that stores 6
the maximum time allowed for the CPU to complete the solve application segment of the
scan cycle. If this time is exceeded the CPU will enter the Program Mode and turn off all
outputs. The default value set from the factory is 200 ms. An error is automatically reported.
7
For example, the Handheld Programmer would display the following message “E003 S/W
TIMEOUT” when the scan overrun occurs. 8
You can use AUX 53 to view the minimum, maximum, and current scan time. Use AUX 55
to increase or decrease the watchdog timer value. 9
I/O Response Time 10
Is Timing Important for Your Application? 11
I/O response time is the amount of time required for the control system to sense a change in
an input point and update a corresponding output point. In the majority of applications, the
CPU performs this task in such a short period of time that you may never have to concern 12
yourself with the aspects of system timing. However, some applications do require extremely
fast update times. In these cases, you may need to know how to to determine the amount of
time spent during the various segments of operation.
13
There are four things that can affect the I/O response time.
• The point in the scan cycle when the field input changes states
14
• Input Off to On delay time
• CPU scan time
A
• Output Off to On delay time B
The next paragraphs show how these items interact to affect the response time.
Normal Minimum I/O Response C
The I/O response time is shortest when the input changes just before the Read Inputs portion
of the execution cycle. In this case the input status is read, the application program is solved,
and the output point gets updated. The following diagram shows an example of the timing
D
for this situation.

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–15


Chapter 4: CPU Specifications and Operation

Scan
1 Solve Solve Solve Solve
Scan Program Program Program Program

2 Read
Inputs
Write
Outputs

3 Field Input

CPU Reads CPU Writes

4 Input
Off/On Delay
Inputs Outputs

5 Output
Off/On Delay

6 I/O Response T ime

7 In this case, you can calculate the response time by simply adding the following items:

8 Input Delay + Scan Time + Output Delay = Response Time

Normal Maximum I/O Response


9 The I/O response time is longest when the input changes just after the Read Inputs portion
of the execution cycle. In this case the new input status is not read until the following scan.
10 Scan

Solve Solve Solve Solve

11 Scan Program
Read
Program
Write
Program Program

Inputs Outputs

12 Field Input

13 Input
CPU Reads
Inputs
CPU Writes
Outputs

Off/On Delay
14
Output

A Off/On Delay

I/O Response T ime


B
The following diagram shows an example of the timing for this situation.
C In this case, you can calculate the response time by simply adding the following items:

D Input Delay +(2 x Scan Time) + Output Delay = Response Time

4–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Improving Response Time


There are a few things you can do the help improve throughput. 1
• You can choose instructions with faster execution times
• You can use immediate I/O instructions (which update the I/O points during the program 2
execution)
• You can use the HSIO Mode 50 Pulse Catch features designed to operate in high-speed 3
environments. See the Chapter 3 for details on using this feature.
• Change Mode 60 filter to 0msec for X0, X1, X2 and X3. 4
Of these four things the Immediate I/O instructions are probably the most important
and most useful. The following example shows how an immediate input instruction 5
Solve
Scan

Solve Solve Solve


6
Scan Program Program Program Program
Normal
Read
Input
Read
Input
Immediate
Write
Output
Immediate
Normal
Write
Outputs
7
Field Input 8
Input
Off/On Delay
9
Output
10
Off/On Delay

I/O Response Time


11
12
and immediate output instruction would affect the response time.
In this case, you can calculate the response time by simply adding the following items. 13
Input Delay + Instruction Execution Time + Output Delay = Response Time 14
The instruction execution time would be calculated by adding the time for the immediate
input instruction, the immediate output instruction, and any other instructions in between A
the two.
NOTE: Even though the immediate instruction reads the most current status from I/O, it only uses the
B
results to solve that one instruction. It does not use the new status to update the image register. Therefore,
any regular instructions that follow will still use the image register values. Any immediate instructions that
follow will access the I/O again to update the status.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–17


Chapter 4: CPU Specifications and Operation

1 CPU Scan Time Considerations


The scan time covers all the cyclical tasks that are
Power up
2 performed by the operating system. You can use
DirectSOFT32 or the Handheld Programmer to display Initialize hardware
the minimum, maximum, and current scan times that
3 have occurred since the previous Program Mode to Run Initialize various memory
based on retentive
Mode transition. This information can be very important configuration

4 when evaluating the performance of a system. As we’ve


shown previously there are several segments that make up Update input
the scan cycle. Each of these segments requires a certain
5 amount of time to complete. Of all the segments, the Service peripheral
following are the most important.
6 • Input Update Update Special Relays

• Peripheral Service PGM


7 • Program Execution
RUN
Mode?

• Output Update
8 • Timed Interrupt Execution
Execute program

The only one you really have the most control over is the Update output

9 amount of time it takes to execute the application


program. This is because different instructions take Do diagnostics
different amounts of time to execute. So, if you think you
10 need a faster scan, then you can try to choose faster YES
OK?
instructions.
11 Your choice of I/O type and peripheral devices can also NO
Report error, set flag
affect the scan time. However, these things are usually register, turn on LED

12 dictated by the application.


NO
The following paragraphs provide some general Fatal error

13 information on how much time some of the segments


can require.
YES
Force CPU into
PGM mode

14 Reading Inputs
The time required during each scan to read the input status is 40 µS. Don’t confuse this with
A the I/O response time that was discussed earlier.
Writing Outputs
B The time required to write the output status is 629 µS. Don’t confuse this with the I/O
response time that was discussed earlier.

C
D

4–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Application Program Execution


The CPU processes the program from address 0 to the END instruction. The CPU executes 1
the program left to right and top to bottom. As each rung is evaluated the appropriate image
register or memory location is updated. The time required to solve the application program
depends on the type and number of instructions used, and the amount of execution overhead.
2
Just add the execution times for all the instructions in your program to determine to total
execution time. Appendix C provides a complete list of the instruction execution times for the
3
DL05 Micro PLC. For example, the execution time for running the program shown below is
calculated as follows: 4
Instruction
STR X0
Time
.2 µs
X0 X1 Y0
OUT
5
OR C0 1.6 µs
ANDN X1
OUT Y0
1.6
6.8
µs
µs
C0
6
STRN C100 2.3 µs
LD K10
STRN C101
42.7
2.3
µs
µs
C100
LD
K10 7
OUT V2002 16.6 µs C101
STRN C102
LD K50
2.3
42.7
µs
µs
OUT V2002
8
STRN C103 2.3 µs C102
LD
OUT V2006
STR X5
ANDN X10
16.6
2
1.6
µs
µs
µs C103
K50
9
OUT V2006
OUT Y3 6.8 µs
END 24 µs
X5 X10 Y3
10
OUT
SUBT OTAL 174.2 µs

Overhead DL05 END


11
Minimum 0.66 µs
Maximum 2.5 µs
12
TOTAL TIME = (Program execution time + Overhead) x 1.1

TOTAL TIME = (Program execution time + Overhead) x 1.1


13
The program above takes only 174.2 µs to execute during each scan. The DL05 spends
0.1ms, on internal timed interrupt management, for every 1ms of instruction time. The total 14
scan time is calculated by adding the program execution time to the overhead (shown
above)and multiplying the result (ms) by 1.1. “Overhead” includes all other housekeeping A
and diagnostic tasks. The scan time will vary slightly from one scan to the next, because of
fluctuation in overhead tasks.
Program Control Instructions — the DL05 PLCs have an interrupt routine feature that
B
changes the way a program executes. Since this instruction interrupts normal program flow, it
will have an effect on the program execution time. For example, a timed interrupt routine C
with a 10 mS period interrupts the main program execution (before the END statement)
every 10 mS, so the CPU can execute the interrupt routine. Chapter 5 provides detailed D
information on interrupts.

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–19


Chapter 4: CPU Specifications and Operation

PLC Numbering Systems octal binary


1 If you are a new PLC user or are using
AutomationDirect PLCs for the first time, please take a ?
1482
BCD
? 3
?
0402 ?
3A9
2 moment to study how our PLCs use numbers. You’ll 7 –961428 ASCII
find that each PLC manufacturer has their own 1001011011 hexadecimal
conventions on the use of numbers in their PLCs. We 177 1011
?
3 want to take just a moment to familiarize you with how decimal
–300124
A 72B
?
numbers are used in AutomationDirect PLCs. The
4 information you learn here applies to all of our PLCs!
As any good computer does, PLCs store and manipulate numbers in binary form: just ones
5 and zeros. So why do we have to deal with numbers in so many different forms? Numbers
have meaning, and some representations are more convenient than others for particular
purposes. Sometimes we use numbers to represent a size or amount of something. Other
6 numbers refer to locations or addresses, or to time. In science we attach engineering units to
numbers to give a particular meaning.
7 PLC Resources
PLCs offer a fixed amount of resources, depending on the model and configuration. We use
8 the word “resources” to include variable memory (V-memory), I/O points, timers, counters,
etc. Most modular PLCs allow you to add I/O points in groups of eight. In fact, all the
resources of our PLCs are counted in octal. It’s easier for computers to count in groups of
9 eight than ten, because eight is an even power of 2.
Decimal 1 2 3 4 5 6 7 8
Octal means simply counting in groups of eight things
10 at a time. In the figure to the right, there are eight
circles. The quantity in decimal is “8”, but in octal it is Octal 1 2 3 4 5 6 7 10
11 “10” (8 and 9 are not valid in octal). In octal, “10”
means 1 group of 8 plus 0 (no individuals).
12 In the figure below, we have two groups of eight circles. Counting in octal we have “20”
items, meaning 2 groups of eight, plus 0 individuals Don’t say “twenty”, say “two–zero octal”.
This makes a clear distinction between number systems.
13 Decimal 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

14
Octal 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20
A After counting PLC resources, it’s time to access PLC resources (there’s a difference). The
CPU instruction set accesses resources of the PLC using octal addresses. Octal addresses are
B the same as octal quantities, except they start counting at zero. The number zero is significant
to a computer, so we don’t skip it.
C Our circles are in an array of square containers to
the right. To access a resource, our PLC instruction
X= 0 1 2 3 4 5 6 7

D will address its location using the octal references


shown. If these were counters, “CT14” would
X

access the black circle location. 1X


2X

4–20 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

V–memory
Variable memory (called “V- V-memory address V-memory data
1
memory”) stores data for the ladder (octal) (binary)
program and for configuration
settings. V-memory locations and
V2017
MSB
0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 1 2LSB

V-memory addresses are the same thing, and are numbered in octal. For example, V2073 is a
valid location, while V1983 is not valid (“9” and “8” are not valid octal digits). 3
Each V-memory location is one data word wide, meaning 16 bits. For configuration registers,
our manuals will show each bit of a V-memory word. The least significant bit (LSB) will be 4
on the right, and the most significant bit (MSB) on the left. We use the word “significant”,
referring to the relative binary weighting of the bits. 5
V-memory data is 16-bit binary, but we rarely program the data registers one bit at a time. We
use instructions or viewing tools that let us work with decimal, octal, and hexadecimal
numbers. All these are converted and stored as binary for us.
6
A frequently-asked question is “How do I tell if a number is octal, BCD, or hex”? The answer 7
is that we usually cannot tell just by looking at the data... but it does not really matter. What
matters is: the source or mechanism which writes data into a V-memory location and the
thing which later reads it must both use the same data type (i.e., octal, hex, binary, or 8
whatever). The V-memory location is just a storage box... that’s all. It does not convert or
move the data on its own.
BCD number 4 9
9
3 6
Binary-Coded Decimal Numbers
Since humans naturally count in V-memory storage 0 1 0 0 1 0 0 1
10
0 0 1 1 0 1 1 0

decimal (10 fingers, 10 toes), we prefer to enter and view PLC data in decimal as well.
However, computers are more efficient in using pure binary numbers. A compromise solution
between the two is Binary-Coded Decimal (BCD) representation. A BCD digit ranges from 0
11
to 9, and is stored as four binary bits (a nibble). This permits each V-memory location to
store four BCD digits, with a range of decimal numbers from 0000 to 9999. 12
In a pure binary sense, a 16-bit word can represent numbers from 0 to 65535. In storing
BCD numbers, the range is reduced to only 0 to 9999. Many math instructions use Binary- 13
Coded Decimal (BCD) data, and DirectSOFT32 and the handheld programmer allow us to
enter and view data in BCD.
14
Hexadecimal Numbers
Hexadecimal numbers are similar to BCD numbers, except they utilize all possible binary
values in each 4-bit digit. They are base-16 numbers so we need 16 different digits. To extend
A
our decimal digits 0 through 9,
we use A through F as shown.
Decimal
Hexadecimal
0 1 2 3
0 1 2 3
4 5
4 5
6
6
7
7
B
8 9 10 11 12 13 14 15
8 9 A B C D E F
A 4-digit hexadecimal number can represent all 65536 values in a V-memory word. The range
is from 0000 to FFFF (hex). PLCs often need this full range for sensor data, etc. Hexadecimal C
is just a convenient way for humans to view full binary data.
Hexadecimal number A 7 F D 4

V-memory storage 1 0 1 0 0 1 1 1 1 1 1 1 0 1 0 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–21


Chapter 4: CPU Specifications and Operation

1 Memory Map
With any PLC system, you generally have many different types of information to process.
2 This includes input device status, output device status, various timing elements, parts counts,
etc. It is important to understand how the system represents and stores the various types of
data. For example, you need to know how the system identifies input points, output points,
3 data words, etc. The following paragraphs discuss the various memory types used in DL05
Micro PLCs. A memory map overview for the
4 CPU follows the memory descriptions.
Octal Numbering System
5 All memory locations and resources are numbered
in Octal (base 8). For example, the diagram shows
how the octal numbering system works for the
6 discrete input points. Notice the octal system does
not contain any numbers with the digits 8 or 9.
7 Discrete and Word Locations
X0 X1 X2 X3 X4 X5 X6 X7

As you examine the different memory types, you’ll


8 notice two types of memory in the DL05, discrete
and word memory. Discrete memory is one bit that X10 X11
9 can be either a 1 or a 0. Word memory is referred
to as V memory (variable) and is a 16-bit location
Discrete – On or Off, 1 bit
X0
normally used to manipulate data/numbers, store
10 data/numbers, etc.
Some information is automatically stored in Word Locations – 16 bits
11 V memory. For example, the timer current
values are stored in V memory. 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 1
12
V-memory Locations for Discrete Memory Areas
13 The discrete memory area is for inputs, outputs, control relays, special relays, stages, timer
status bits and counter status bits. However, you can also access the bit data types as a V-
14 memory word. Each V-memory location contains 16 consecutive discrete locations. For
example, the following diagram shows how the X input points are mapped into V-memory
locations.
A
8 Discrete (X) Input Points
B X7 X6 X5 X4 X3 X2 X1 X0

C
D Bit # 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 V40400
These discrete memory areas and their corresponding V memory ranges are listed in the
memory area table for DL05 Micro PLCs on the following pages.

4–22 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Input Points (X Data Type)


The discrete input points are noted by an X data X0 Y0
1
type. There are 8 discrete input points and 256 OUT
discrete input addresses available with DL05
CPUs. In this example, the output point Y0 will
2
be turned on when input X0 energizes.
3
Output Points (Y Data Type)
The discrete output points are noted by a Y data
type. There are 6 discrete outputs and 256 discrete
X1 Y1
OUT
4
output addresses available with DL05 CPUs. In
this example, output point Y1 will be turned on 5
when input X1 energizes.
Control Relays (C Data Type) 6
Control relays are discrete bits normally used to
control the user program. The control relays do
X6 C5
OUT 7
not represent a real world device, that is, they
cannot be physically tied to switches, output coils,
etc. They are internal to the CPU. Because of this,
C5 Y10
OUT
8
control relays can be programmed as discrete
inputs or discrete outputs. These locations are used Y20
OUT
9
in programming the discrete memory locations
(C) or the corresponding word location which
contains 16 consecutive discrete locations.
10
In this example, memory location C5 will energize
when input X6 turns on. The second rung shows a
11
simple example of how to use a control relay as an
input. 12
Timers and Timer Status Bits (T Data Type)
Timer status bits reflect the relationship between 13
the current value and the preset value of a specified
timer. The timer status bit will be on when the
current value is equal or greater than the preset X0
14
TMR T1
value of a corresponding timer.
When input X0 turns on, timer T1 will start.
K30
A
When the timer reaches the preset of 3 seconds
(K30) timer status contact T1 turns on. When T1
T1 Y12
OUT
B
turns on, output Y12 turns on. Turning off X0
resets the timer. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–23


Chapter 4: CPU Specifications and Operation

Timer Current Values (V Data Type)


1 As mentioned earlier, some information is
X0
automatically stored in V-memory. This is true for the TMR T1
2 current values associated with timers. For example, V0
holds the current value for Timer 0, V1 holds the
K1000

current value for Timer 1, etc.


3 The primary reason for this is programming flexibility.
V1 K30 Y2
OUT

The example shows how you can use relational contacts


4 to monitor several time intervals from a single timer.
V1 K50 Y3
OUT
Counters and Counter Status Bits (CT Data type)
5 Counter status bits that reflect the relationship between V1 K75 V1 K100 Y4
the current value and the preset value of a specified OUT
6 counter. The counter status bit will be on when the
current value is equal to or greater than the preset value
7 of a corresponding counter.
Each time contact X0 transitions from off to on, the
X0
CNT CT3
K10
8 counter increments by one. (If X1 comes on, the
counter is reset to zero.) When the counter reaches the
X1

preset of 10 counts (K of 10) counter status contact


9 CT3 turns on. When CT3 turns on, output Y2 turns CT3 Y2
on. OUT

10 Counter Current Values (V Data Type)


Just like the timers, the counter current values are also
11 automatically stored in V-memory. For example, V1000
holds the current value for Counter CT0, V1001 holds
X0
CNT
K10
CT3

the current value for Counter CT1, etc.


12 The primary reason for this is programming flexibility.
X1

The example shows how you can use relational contacts


13 to monitor the counter values. V1003 K1 Y2
OUT

14 V1003 K3 Y3
OUT
A
V1003 K5 V1003 K8 Y4

B OUT

C
D

4–24 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Word Memory (V Data Type)


Word memory is referred to as V-memory (variable) and 1
is a 16-bit location normally used to manipulate
data/numbers, store data/numbers, etc. Some
information is automatically stored in V-memory. For
X0
LD
K1345
2
example, the timer current values are stored in V
memory. The example shows how a four-digit BCD OUT V2000
3
constant is loaded into the accumulator and then stored
in a V-memory location. 4
Stages (S Data type)
Stages are used in RLLPLUS programs to create a structured Word Locations – 16 bits 5
program, similar to a flowchart. Each program Stage 0 0 0 1 00 1 1 0 1 0 0 0 1 0 1
denotes a program segment. When the program segment,
or Stage, is active, the logic within that segment is
6
executed. If the Stage is off, or inactive, the logic is not 1 3 4 5
executed and the CPU skips to the next active Stage. (See 7
Chapter 7 for a more detailed description of RLLPLUS Ladder Representation
programming.) ISG
S0000 Wait for Start
8
Each Stage also has a discrete status bit that can be used as
an input to indicate whether the Stage is active or
inactive. If the Stage is active, then the status bit is on. If
Start

X0
S1
JMP

S500
9
JMP
the Stage is inactive, then the status bit is off. This status
bit can also be turned on or off by other instructions,
SG
S0001

Part
Check for a Part
10
such as the SET or RESET instructions. This allows you Present S2
JMP
to easily control stages throughout the program. X1
Part
Present S6
11
Special Relays (SP Data Type) JMP

Special relays are discrete memory locations with pre- SG


S0002
X1

Clamp the part


12
defined functionality. There are many different types of
special relays. For example, some aid in program
development, others provide system operating status Part
Locked
Clamp
SET
S400
S3
13
information, etc. Appendix D provides a complete listing JMP

of the special relays.


X2
14
In this example, control relay C10 will energize for 50 ms
and de-energize for 50 ms because SP5 is a pre–defined A
relay that will be on for 50 ms and off for 50 ms.
SP5 C10
OUT
B
C
SP4: 1 second clock
SP5: 100 ms clock
D
SP6: 50 ms clock

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–25


Chapter 4: CPU Specifications and Operation

1 DL05 System V-memory


System Parameters and Default Data Locations (V Data Type)
2 The DL05 PLCs reserve several V-memory locations for storing system parameters or certain
types of system data. These memory locations store things like the error codes, High-Speed
3 I/O data, and other types of system setup information.
System Default Values /
4 V-memory Description of Contents Ranges
V2320–V2377 The default location for multiple preset values for the High-Speed Counter N/A
5 V7620
V7620–V7627 Locations for DV–1000 operator interface parameters
Sets the V-memory location that contains the value V0 – V2377

6 V7621
V7622
Sets the V-memory location that contains the message
Sets the total number (1 – 16) of V-memory locations to be displayed.
V0 – V2377
1 – 16
V7623 Sets the V-memory location containing the numbers to be displayed. V0 – V2377
7 V7624 Sets the V-memory location containing the character code to be displayed V0 – V2377
V-memory location for X, Y,
V7625 Contains the function number that can be assigned to each key. or C points used
8 V7626
V7627
Power-up operational mode. 0, 1, 2, 12, 3
Change preset value. 0000 to 9999

9 V7630 Starting location for the multi–step presets for channel 1. The default value is
2320, which indicates the first value should be obtained from V2320. Since there Default: V2320 Range: V0 –
are 24 presets available, the default range is V2320 – V2377. You can change the V2320
starting point if necessary.
10 V7631–V7632 Reserved N/A

11 Default: 0060
Lower Byte Range:
Range: 10 –Counter
20 – Quadrature
12 30 – Pulse Out
Sets the desired function code for the high speed counter, interrupt, pulse catch, 40 – Interrupt
V7633 pulse train, and input filter. Location can also be used to set thepower-up in Run 50 – Pulse Catch
13 Mode option. 60 – Filtered discrete In.
Upper Byte Range:
Bits 8–12, 14, 15: Unused
Bit 13: Power–up in RUN,
14 only if Mode Switch is in
TERM position.

A V7634 - X0
V7635 - X1 Setup Registers for High-Speed I/O functions Default: 1006

B V7636
V7637
- X2
Pulse/Direction Default: 0000
V7640–V7646 Reserved N/A
C V7647 Timed Interrupt
Default: 0000
Range:0003–03E7h
(3–9999ms)
D V7650–V7654
V7655
Reserved
Port 2: Setup for the protocol, time-out, and the response delay time.
N/A
Default: 00E0
V7656 Port 2: Setup for the station number, baud rate, STOP bit, and parity. Default: 8501

4–26 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

System
V-memory
Description of Contents Default Values /
Ranges 1
V7657 Port 2: Setup completion code used to notify the completion of the parameter setup. Default: 0A00
V7660 Scan control setup: Keeps the scan control mode.
Setup timer over counter: Counts the times the actual scan time exceeds the user
Default: 0000 2
V7661 setup time.
V7662–V7717 Reserved 3
V7720–V7722 Locations for DV–1000 operator interface parameters.
V7720
V7721
Titled Timer preset value pointer
Title Counter preset value pointer
4
V7722 HiByte-Titled Timer preset block size, LoByte-Titled Counter preset block size
V7723–V7750 Reserved 5
Fault Message Error Code — stores the 4-digit code used with the FAULT instruction
V7751 when the instruction is executed.
V7752–V7754 Reserved 6
V7755 Error code — stores the fatal error code.
V7756
V7757
Error code — stores the major error code.
Error code — stores the minor error code.
N/A
7
V7760–V7762 Reserved
V7763 Program address where syntax error exists 8
V7764 Syntax error code
V7765 Scan — stores the total number of scan cycles that have occurred since the last
Program Mode to Run Mode transition. 9
V7766–V7774 Reserved
V7775 Scan — stores the current scan time (milliseconds).
Scan — stores the minimum scan time that has occurred since the last Program
10
V7776 Mode to Run Mode transition (milliseconds).
V7777 Scan — stores the maximum scan time that has occurred since the last Program
Mode to Run Mode transition (milliseconds).
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–27


Chapter 4: CPU Specifications and Operation

DL05 Memory Map Table


1 Discrete Memory Word Memory
Memory Type Reference Reference Decimal Symbol
2 (octal) (octal)
Input Points X0
X0 – X377 V40400 - V40417 256
3 (See note 1)

Output Points Y0
Y0 – Y377 V40500 – V40517 256
4 (See note 1)

C0 C0
Control Relays C0 – C777 V40600 - V40637 512
5
SP0
Special Relays SP0 – SP777 V41200 – V41237 512
6
Timers T0 – T177 V41100 – V41107 128 TMR T0
7 K100
V0 K100
Timer Current Values None V0 – V177 128
8
T0
Timer Status Bits T0 – T177 V41100 – V41107 128
9
CNT CT0
10 Counters CT0 – CT177 V41140 – V41147 128 K10

V1000 K100
11 Counter
Current Values None V1000 – V1177 128

CT0
12 Counter Status Bits CT0 – CT177 V41140 – V41147 128

13 Data Words None V1200 – V7377 3968 None specific, used with many
instructions.
None specific, used with many
14 Data Words
Non-volatile None V7400 – V7577 128
instructions.
Data can be rewritten to EEPROM at least
100,000 times before it fails.
A Stages S0 – S377 V41000 – V41017 256
SG SP0
S001
B System parameters None V7600 – V7777 128 None specific, used for various purposes

C
1-The DL05 systems are limited to 8 discrete inputs and 6 discrete outputs with the present
D available hardware, but 256 point addresses exist.

4–28 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

DL05 Aliases 1
An alias is an alternate way of referring to certain memory types, such as timer/counter
current values, V-memory locations for I/O points, etc., which simplifies understanding the
memory address. The use of the alias is optional, but some users may find the alias to be
2
helpful when developing a program. The table below shows how the aliases can be used.
3
DL05 Aliases
Address Start Alias Start Example 4
V0 is the timer accumulator value for timer 0, therefore, it’s
V0 TA0 alias is TA0. TA1 is the alias for V1, etc..
V1000 is the counter accumulator value for counter 0,
5
V1000 CTA0 therefore, it’s alias is CTA0. CTA1 is the alias for V1001, etc.
V40000 is the word memory reference for discrete bits GX0
through GX17, therefore, it’s alias is VGX0. V40001 is the word
6
V40000 VGX memory reference for discrete bits GX20 through GX 37,
therefore, it’s alias is VGX20.
V40200 is the word memory reference for discrete bits GY0
7
through GY17, therefore, it’s alias is VGY0. V40201 is the word
V40200 VGY memory reference for discrete bits GY20 through GY 37,
therefore, it’s alias is VGY20.
8
V40400 is the word memory reference for discrete bits X0
V40400 VX0 through X17, therefore, it’s alias is VX0. V40401 is the word
memory reference for discrete bits X20 through X37, therefore,
9
it’s alias is VX20.

V40500 VY0
V40500 is the word memory reference for discrete bits Y0
through Y17, therefore, it’s alias is VY0. V40501 is the word 10
memory reference for discrete bits Y20 through Y37, therefore,
it’s alias is VY20.
V40600 is the word memory reference for discrete bits C0 11
V40600 VC0 through C17, therefore, it’s alias is VC0. V40601 is the word
memory reference for discrete bits C20 through C37, therefore,
it’s alias is VC20. 12
V41000 is the word memory reference for discrete bits S0
V41000 VS0 through S17, therefore, it’s alias is VS0. V41001 is the word
memory reference for discrete bits S20 through S37, therefore,
it’s alias is VS20.
13
V41100 is the word memory reference for discrete bits T0
V41100 VT0 through T17, therefore, it’s alias is VT0. V41101 is the word
memory reference for discrete bits T20 through T37, therefore,
14
it’s alias is VT20.
V41140 is the word memory reference for discrete bits CT0
through CT17, therefore, it’s alias is VCT0. V41141 is the word
A
V41140 VCT0 memory reference for discrete bits CT20 through CT37,
therefore, it’s alias is VCT20.
V41200 is the word memory reference for discrete bits SP0
B
V41200 VSP0 through SP17, therefore, it’s alias is VSP0. V41201 is the word
memory reference for discrete bits SP20 through SP37,
therefore, it’s alias is VSP20. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–29


Chapter 4: CPU Specifications and Operation

1 X InputThisBittableMap
provides a listing of individual Input points associated with each V-memory
2 address bit for the DL05’s eight physical inputs. Actual available references are X0 to X377
(V40400 – V40417).

3
MSB DL05 Input (X) Points
Address
4 17 16

15

14

13

12

11

10

7

6
007
5
006
4
005
3
004
2
003
1
002
0
001 000 V40400

5
Y Output Bit Map
6 This table provides a listing of individual output points associated with each V-memory
address bit for the DL05’s six physical outputs. Actual available references are Y0 to Y377
7 (V40500 – V40517).

8 MSB
17 16 15 14 13 12 11 10
DL05 Output (Y) Points
7 6 5 4 3 2 1
LSB
0
Address

9 – – – – – – – – – – 005 004 003 002 001 000 V40500

10 Stage Control / Status Bit Map


This table provides a listing of individual™ Stage control bits associated with each V-memory
11 address bit.

12 MSB
17 16 15 14 13 12 11 10
DL05 Stage (S) Control Bits
7 6 5 4 3 2 1
LSB
0
Address
017 016 015 014 013 012 011 010 007 006 005 004 003 002 001 000 V41000
13 037 036 035 034 033 032 031 030 027 026 025 024 023 022 021 020 V41001
057 056 055 054 053 052 051 050 047 046 045 044 043 042 041 040 V41002
14 077
117
076
116
075
115
074
114
073
113
072
112
071
111
070
110
067
107
066
106
065
105
064
104
063
103
062
102
061
101
060
100
V41003
V41004
137 136 135 134 133 132 131 130 127 126 125 124 123 122 121 120 V41005
A 157 156 155 154 153 152 151 150 147 146 145 144 143 142 141 140 V41006
177 176 175 174 173 172 171 170 167 166 165 164 163 162 161 160 V41007
B 217
237
216
236
215
235
214
234
213
233
212
232
211
231
210
230
207
227
206
226
205
225
204
224
203
223
202
222
201
221
200
220
V41010
V41011
257 256 255 254 253 252 251 250 247 246 245 244 243 242 241 240 V41012
C 277 276 275 274 273 272 271 270 267 266 265 264 263 262 261 260 V41013
317 316 315 314 313 312 311 310 307 306 305 304 303 302 301 300 V41014
D 337
357
336
356
335
355
334
354
333
353
332
352
331
351
330
350
327
347
326
346
325
345
324
344
323
343
322
342
321
341
320
340
V41015
V41016
377 376 375 374 373 372 371 370 367 366 365 364 363 362 361 360 V41017

4–30 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Control Relay Bit Map 1


This table provides a listing of the individual control relays associated with each V-memory
address bit
2
MSB DL05 Control Relays (C) LSB
Address
17
017
16
016
15
015
14
014
13
013
12
012
11
011
10
010
7
007
6
006
5
005
4
004
3
003
2
002
1
001
0
000 V40600
3
037 036 035 034 033 032 031 030 027 026 025 024 023 022 021 020 V40601
057 056 055 054 053 052 051 050 047 046 045 044 043 042 041 040 V40602 4
077 076 075 074 073 072 071 070 067 066 065 064 063 062 061 060 V40603
117
137
116
136
115
135
114
134
113
133
112
132
111
131
110
130
107
127
106
126
105
125
104
124
103
123
102
122
101
121
100
120
V40604
V40605
5
157
177
156
176
155
175
154
174
153
173
152
172
151
171
150
170
147
167
146
166
145
165
144
164
143
163
142
162
141
161
140
160
V40606
V40607
6
217 216 215 214 213 212 211 210 207 206 205 204 203 202 201 200 V40610
237 236 235 234 233 232 231 230 227 226 225 224 223 222 221 220 V40611 7
257 256 255 254 253 252 251 250 247 246 245 244 243 242 241 240 V40612
277
317
276
316
275
315
274
314
273
313
272
312
271
311
270
310
267
307
266
306
265
305
264
304
263
303
262
302
261
301
260
300
V40613
V40614
8
337 336 335 334 333 332 331 330 327 326 325 324 323 322 321 320 V40615
357 356 355 354 353 352 351 350 347 346 345 344 343 342 341 340 V40616 9
377 376 375 374 373 372 371 370 367 366 365 364 363 362 361 360 V40617
417
437
416
436
415
435
414
434
413
433
412
432
411
431
410
430
407
427
406
426
405
425
404
424
403
423
402
422
401
421
400
420
V40620
V40621
10
457
477
456
476
455
475
454
474
453
473
452
472
451
471
450
470
447
467
446
466
445
465
444
464
443
463
442
462
441
461
440
460
V40622
V40623
11
517 516 515 514 513 512 511 510 507 506 505 504 503 502 501 500 V40624
537 536 535 534 533 532 531 530 527 526 525 524 523 522 521 520 V40625 12
557 556 555 554 553 552 551 550 547 546 545 544 543 542 541 540 V40626
577
617
576
616
575
615
574
614
573
613
572
612
571
611
570
610
567
607
566
606
565
605
564
604
563
603
562
602
561
601
560
600
V40627
V40630
13
637 636 635 634 633 632 631 630 627 626 625 624 623 622 621 620 V40631
657 656 655 654 653 652 651 650 647 646 645 644 643 642 641 640 V40632 14
677 676 675 674 673 672 671 670 667 666 665 664 663 662 661 660 V40633
717
737
716
736
715
735
714
734
713
733
712
732
711
731
710
730
707
727
706
726
705
725
704
724
703
723
702
722
701
721
700
720
V40634
V40635
A
757
777
756
776
755
775
754
774
753
773
752
772
751
771
750
770
747
767
746
766
745
765
744
764
743
763
742
762
741
761
740
760
V40636
V40637 B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–31


Chapter 4: CPU Specifications and Operation

1 Timer Status Bit Map


This table provides a listing of individual timer contacts associated with each V-memory
2 address bit.

3 MSB
17 16 15 14 13 12
DL05 Timer (T) Contacts
11 10 7 6 5 4 3 2 1
LSB
0
Address
017 016 015 014 013 012 011 010 007 006 005 004 003 002 001 000 V41100
4 037
057
036
056
035
055
034
054
033
053
032
052
031
051
030
050
027
047
026
046
025
045
024
044
023
043
022
042
021
041
020
040
V41101
V41102

5 077
117
076
116
075
115
074
114
073
113
072
112
071
111
070
110
067
107
066
106
065
105
064
104
063
103
062
102
061
101
060
100
V41103
V41104
137 136 135 134 133 132 131 130 127 126 125 124 123 122 121 120 V41105
6 157
177
156
176
155
175
154
174
153
173
152
172
151
171
150
170
147
167
146
166
145
165
144
164
143
163
142
162
141
161
140
160
V41106
V41107

7
Counter Status Bit Map
8 This table provides a listing of individual counter contacts associated with each V-memory
address bit.
9 MSB DL05 Counter (CT) Contacts LSB
Address
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
10 017 016 015 014 013 012 011 010 007 006 005 004 003 002 001 000 V41140
037 036 035 034 033 032 031 030 027 026 025 024 023 022 021 020 V41141
11 057
077
056
076
055
075
054
074
053
073
052
072
051
071
050
070
047
067
046
066
045
065
044
064
043
063
042
062
041
061
040
060
V41142
V41143
117 116 115 114 113 112 111 110 107 106 105 104 103 102 101 100 V41144
12 137 136 135 134 133 132 131 130 127 126 125 124 123 122 121 120 V41145
157 156 155 154 153 152 151 150 147 146 145 144 143 142 141 140 V41146
13 177 176 175 174 173 172 171 170 167 166 165 164 163 162 161 160 V41147

14
A
B
C
D

4–32 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Network Configuration and Connections 1


Configuring the DL05’s Comm Ports
This section describes how to configure the CPU’s built-in networking ports for either 2
MODBUS or DirectNET. This will allow you to connect the DL05 PLC system directly to
MODBUS networks using the RTU protocol, or to other devices on a DirectNET network.
MODBUS host systems must be capable of issuing the MODBUS commands to read or
3
write the appropriate data. For details on the MODBUS protocol, check with your
MODBUS supplier for the lastest version of the Gould MODBUS Protocol reference Guide. 4
For more details on DirectNET, order our DirectNET manual, part number DA–DNET–M.
5
Communication Port 1 Communication Port 2
Com 2 Connects to HPP, DirectSOFT32, operator 6
Com 1 Connects to HPP, DirectSOFT32, operator interfaces, etc.6-pin, RS232C Communication
interfaces, etc. 6-pin, RS232C 9600 Baud (Fixed)
Parity - odd (default) Station address 1 (fixed) 8
speed (baud) 300, 600, 1200, 2400, 4800,9600,
19200, 3840arity - odd (default), even, noneStation
address 1 (default) 8 data bits1 start, 1 stop bit
7
data bits 1 start, 1 stop bitAsynchronous, Half- Asynchronous, Half-duplex, DTE
duplex, DTE Protocol: (Auto-Select)
K sequence (Slave only)
DirectNET (Slave only)
Protocol: (Auto-Select)
K sequence (Slave only) 8
MODBUS (Slave only) DirectNET (Master/Slave)
MODBUS (Master/Slave
Non-sequence/Print 9
Networking DL05 to DL05 RS-232C 10
You will need to make sure the network connection is a 3-wire RS–232 type. Normally, the
RS–232 signals are used for for communications between two devices with distances up to a
maximum of 15 meters.
11
Port 1 Pin Descriptions Port 2 Pin Descriptions 12
1 0V Power (–) connection (GND) 1 0V Power (–) connection (GND)
1234 5 6
2
3
5V Power (+) conection
RXD Receive Data (RS232C)
2
3
5V
RXD
Power (+) conection
Receive Data (RS232C)
13
4 TXD Transmit Data (RS232C 4 TXD Transmit Data (RS232C
5
6
5V
0V
Power (+) conection
Power (–) connection (GND)
5 RTS Request to Send 14
6 0V Power (–) connection (GND)

A
B
DL05
C
DL05
PORT 2 PORT 1 or 2
1 0V
3 RXD
0V 1
RXD 3
D
4 TXD TXD 4

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–33


Chapter 4: CPU Specifications and Operation

Networking PC to DL05s RS–422 and to Other PLCs


1
Networking
2 PC to DL05s
RS–422 1234 5 6

3 6-pin Female
Modular Connector
4
F2–UNICON DL05
5 0V 0V 1
GND
TXD+
GND
RXD+
1 or 6 0V 0V 1 or 6 PORT 2
3 RXD RXD 3
RXD RXD 3 RXD– 4 TXD TXD 4
6
TXD–
TXD TXD 4 RXD– TXD–
2 CTS 5V 2
RTS RTS 5 RXD+ TXD+
5 5V RTS 5

7 FA–ISONET

8 Note: When using the DL05 on a multi-drop


network, the RTS ON Delay time must be set
to at least 5ms and the RTS OFF Delay time F2–UNICON DL05

9 must be set to at least 2ms . If you encounter


problems, the time can be increased.
GND
RXD+
1 or 6 0V 0V 1 or 6 PORT 2
3 RXD RXD 3
RXD– 4 TXD TXD 4

10 Networking
TXD–
TXD+
2 CTS
5 5V
5V 2
RTS 5
DL05 Master
11 to Other PLCs

12
13 DL05 F2–UNICON DL05
PORT 2 1 or 6 0V 0V 1 or 6 PORT 2
14 1 or 6 0V 0V 1 or 6
3 RXD RXD 3
GND
TXD+
TXD–
GND
RXD+
RXD–
3 RXD
4 TXD
RXD 3
TXD 4
4 TXD TXD 4 RXD– TXD–
2 CTS
A 2 CTS
5 5V
5V 2
RTS 5
RXD+ TXD+
5 5V
5V 2
RTS 5

B FA–ISONET

C F2–UNICON DL240
GND
1 0V 0V 1 PORT 2

D RXD+
RXD–
TXD–
3 RXD
4 TXD
RXD 3
TXD 4
2 CTS 5V 2
TXD+
5 5V RTS 5

4–34 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

MODBUS Port Configuration


In DirectSOFT32, choose the PLC menu, then Setup, then “Secondary Comm Port”. 1
• Port: From the port number list box at the top, choose “Port 2”.
• Protocol: Click the check box to the left of “MODBUS” (use AUX 56 on the HPP, andselect 2
“MBUS”), and then you’ll see the dialog box below.
Setup Communication Ports
3
Port:
Protocol:
Port 2
K-sequence
DirectNET
Close
4
Help

Timeout:
MODBUS
Non-sequence
800 mS
5
RTS ON Delay Time:
RTS OFF Delay Time:
5 mS
2 mS
6
Station Number: 1

Baud Rate: 38400 7


Stop Bits: 1

Parity: None 8
• Timeout: amount of time the port will wait after it sends a message to get a response before logging
an error. 9
• RTS ON / OFF Delay Time: The RTS ON Delay Time specifies the time the DL05 waits to send
the data after it has raised the RTS signal line. The RTS OFF Delay Time specifies the time the
DL05 waits to release the RTS signal line after the data has been sent. When using the DL05 on a
10
multi-drop network, the RTS ON Delay time must be set to at least 5ms and the RTS OFF Delay time
must be set to at least 2ms. If you encounter problems, the time can be increased. 11
• Station Number: The possible range for MODBUS slave numbers is from 1 to 247, but the DL05
network instructions used in Master mode will access only slaves 1 to 99. Each slave must have a
unique number. At powerup, the port is automatically a slave, unless and until the DL05 executes
12
ladder logic network instructions which use the port as a master. Thereafter, the port reverts back to
slave mode until ladder logic uses the port again. 13
• Baud Rate: The available baud rates include 300, 600, 1200, 2400, 4800, 9600, 19200, and 38400
baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors
or noise problems on the network. Important: You must configure the baud rates of all devices on
14
the network to the same value. Refer to the appropriate product manual for details.
• Stop Bits: Choose 1 or 2 stop bits for use in the protocol. A
• Parity: Choose none, even, or odd parity for error checking.
Then click the button indicated to send the Port configuration to the CPU, B
and click Close.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–35


Chapter 4: CPU Specifications and Operation

DirectNET Port Configuration


1 In DirectSOFT32, choose the PLC menu, then Setup, then “Secondary Comm Port”.
• Port: From the port number list box, choose “Port 2 ”.
2 • Protocol: Click the check box to the left of “DirectNET” (use AUX 56 on the HPP, then select
“DNET”), and then you’ll see the dialog box below.
3 Setup Communication Ports

Port: Port 2 Close


4 Protocol:
K-sequence
DirectNET
MODBUS Help
5 Timeout:
Non-sequence
800 mS

6 RTS ON Delay Time:


RTS OFF Delay Time:
5 mS
2 mS

7 Station Number:
Baud Rate:
1
38400

Stop Bits: 1
8 Parity: None
Format: Hex

9 • Timeout: amount of time the port will wait after it sends a message to get a response before
logging an error.
10 • RTS ON / OFF Delay Time: The RTS ON Delay Time specifies the time the DL05 waits
to send the data after it has raised the RTS signal line. The RTS OFF Delay Time specifies
11 the time the DL05 waits to release the RTS signal line after the data has been sent. When
using the DL05 on a multi-drop network, the RTS ON Delay time must be set to at least 5ms
and the RTS OFF Delay time must be set to at least 2ms. If you encounter problems, the time
12 can be increased.
• Station Number: For making the CPU port a DirectNET master, choose “1”. The
13 allowable range for DirectNET slaves is from 1 to 90 (each slave must have a unique
number). At powerup, the port is automatically a slave, unless and until the DL05 executes
14 ladder logic instructions which attempt to use the port as a master. Thereafter, the port
reverts back to slave mode until ladder logic uses the port again.
A • Baud Rate: The available baud rates include 300, 600, 1200, 2400, 4800, 9600, 19200,
and 38400 baud. Choose a higher baud rate initially, reverting to lower baud rates if you
experience data errors or noise problems on the network. Important: You must configure
B the baud rates of all devices on the network to the same value.
• Stop Bits: Choose 1 or 2 stop bits for use in the protocol.
C • Parity: Choose none, even, or odd parity for error checking.
• Format: Choose between hex or ASCII formats.
D Then click the button indicated to send the Port configuration to the CPU,
and click Close.

4–36 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Network Slave Operation 1


This section describes how other devices on a network can communicate with a CPU port
that you have configured as a DirectNETslave or MODBUS slave (DL05). A MODBUS host
must use the MODBUS RTU protocol to communicate with the DL05 as a slave. The host
2
software must send a MODBUS function code and MODBUS address to specify a PLC
memory location the DL05 comprehends. The DirectNET host uses normal I/O addresses to 3
access applicable DL05 CPU and system. No CPU ladder logic is required to support either
MODBUS slave or DirectNET slave operation. 4
MODBUS Function Codes Supported
The MODBUS function code determines whether the access is a read or a write, and whether
to access a single data point or a group of them. The DL05 supports the MODBUS function
5
codes described below.
6
MODBUS Function Code Function DL05 Data Types Available
01 Read a group of coils Y, CR, T, CT 7
02 Read a group of inputs X, SP
05
15
Set / Reset a single coil
Set / Reset a group of coils Y,
Y, CR, T, CT
CR, T, CT
8
03, 04
06
Read a value from one or more registers
Write a value into a single register
V
V 9
16 Write a value into a group of registers V

Determining the MODBUS Address 10


There are typically two ways that most host software conventions allow you to specify a PLC
memory location. These are: 11
• By specifying the MODBUS data type and address
• By specifying a MODBUS address only 12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–37


Chapter 4: CPU Specifications and Operation

If Your Host Software Requires the Data Type and Address...


1 Many host software packages allow you to specify the MODBUS data type and the
MODBUS address that corresponds to the PLC memory location. This is the easiest method,
2 but not all packages allow you to do it this way.
The actual equation used to calculate the address depends on the type of PLC data you are
3 using. The PLC memory types are split into two categories for this purpose.
• Discrete – X, SP, Y, CR, S, T, C (contacts)
4 • Word – V, Timer current value, Counter current value
In either case, you basically convert the PLC octal address to decimal and add the appropriate
5 MODBUS address (if required). The table below shows the exact equation used for each
group of data.

6
MODBUS Address MODBUS Data Type
7 DL05 Memory Type QTY (Dec.) PLC Range(Octal Range (Decimal)
For Discrete Data Types .... Convert PLC Addr. to Dec. + Start of Range + Data Type
8 Inputs (X)
Special Relays(SP)
256
512
X0 – X377
SP0 – SP777
2048 – 2303
3072 – 3583
Input
Input

9 Outputs (Y)
Control Relays (CR)
256
512
Y0 – Y377
C0 – C777
2048 – 2303
3072 – 4583
Coil
Coil
Timer Contacts (T) 128 T0 – T177 6144 – 6271 Coil
10 Counter Contacts (CT)
Stage Status Bits(S)
128
256
CT0 – CT177
S0 – S377
6400 – 6527
5120 – 5375
Coil
Coil

11 For Word Data Types .... Convert PLC Addr. to Dec. + Data Type
Timer Current Values (V) 128 V0 – V177 0 – 127 Input Register
Counter Current Values (V) 128 V1000 – V1177 512 – 639 Input Register
12 V Memory, user data (V) 3968 V1200 – V7377 640 – 3839 Holding Register
V Memory, non-volatile (V) 128 V7600 – V7777 3968 – 4095 Holding Register
13
14
A
B
C
D

4–38 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

The following examples show how to generate the MODBUS address and data type for hosts
which require this format. 1
PLC Address (Dec) + Data Type
Example 1: V2100
Find the MODBUS address for
V2100 = 1088 decimal 2
User V location V2100. 1088 + Hold. Reg. = Holding Reg 1088
1. Find V memory in the table. 3
2. Convert V2100 into decimal (1088).
3. Use the MODBUS data type from the table. 4
V Memory, user data (V) 3200 V1200 – V7377 640 – 3839 Holding Register
5
Example 2: Y20 6
Find the MODBUS address for output PLC Address (Dec) +Start Addr + Data Type
Y20.
1. Find Y outputs in the table.
Y20 = 16 decimal
16 + 2048 + Coil = Coil 2064
7
2. Convert Y20 into decimal (16).
3. Add the starting address for the range (2048).
8
4. Use the MODBUS data type from the table.
9
Outputs (V)

Example 3: T10 Current Value


256 Y0 – Y377 2048 - 2303

PLC Address (Dec) + Data Type


Coil
10
Find the MODBUS address to obtain the
current value from Timer T10.
T10 = 8 decimal
8 + Input Reg. = Input Reg. 8
11
1. Find Timer Current Values in the table.
2. Convert T10 into decimal (8).
12
3. Use the MODBUS data type from the table.
13
Timer Current Values (V) 128 V0 – V177 0 - 127 Input Register 14
Example 4: C54
PLC Address (Dec) + Start Addr. + Data Type
A
Find the MODBUS address for Control
Relay C54.
1. Find Control Relays in the table.
C54 = 44 decimal
44 + 3072 + Coil = Coil 3116
B
2. Convert C54 into decimal (44).
3. Add the starting address for the range (3072).
C
4. Use the MODBUS data type from the table. D
Control Relays (CR) 512 C0 – C77 3072 – 3583 Coil

DL05 Micro PLC User Manual, 5th Edition, 6/04


4–39
Chapter 4: CPU Specifications and Operation

If Your MODBUS Host Software Requires an Address ONLY


1 Some host software does not allow you to specify the MODBUS data type and address.
Instead, you specify an address only. This method requires another step to determine the
2 address, but it’s still fairly simple. Basically, MODBUS also separates the data types by address
ranges as well. So this means an address alone can actually describe the type of data and
location. This is often referred to as “adding the offset”. One important thing to remember
3 here is that two different addressing modes may be available in your host software package.
These are:
4 • 484 Mode
• 584/984 Mode
5 We recommend that you use the 584/984 addressing mode if your host software allows you
to choose. This is because the 584/984 mode allows access to a higher number of memory
6 locations within each data type. If your software only supports 484 mode, then there may be
some PLC memory locations that will be unavailable. The actual equation used to calculate
the address depends on the type of PLC data you are using. The PLC memory types are split
7 into two categories for this purpose.
• Discrete – X, SP, Y, CR, S, T (contacts), C (contacts)
8 • Word – V, Timer current value, Counter current value
In either case, you basically convert the PLC octal address to decimal and add the appropriate
9 MODBUS addresses (as required). The table below shows the exact equation used for each
group of data.
10 Discrete Data Types

11 DL05 Memory Type PLC Range


(Octal)
Address Address
(484 Mode) (584/984 Mode)
MODBUS
Data Type
GX0-GX1746 1001 - 1999 10001 - 10999 Input
12 Global Inputs (GX)
GX1747-GX3777 --- 11000 - 12048 Input
Inputs (X) X0 – X1777 --- 12049 - 13072 Input

13 Special Relays (SP)


Global Outputs (GY)
SP0 – SP777
GY0 - GY3777
---
1 - 2048
13073 - 13584
1 - 2048
Input
Output
Outputs (Y) Y0 – Y1777 2049 - 3072 2049 - 3072 Output
14 Control Relays (CR) C0 – C3777 3073 - 5120 3073 - 5120 Output
Timer Contacts (T) T0 – T377 6145 - 6400 6145 - 6400 Output
A Counter Contacts (CT)
Stage Status Bits (S)
CT0 – CT377
S0 – S1777
6401 - 6656
5121 - 6144
6401 - 6656
5121 - 6144
Output
Output

B
C
D

4–40 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Word Data Types


PLC Range Input/Holding Input/Holding
1
Registers (Octal) (484 Mode)* (584/984 Mode)*
V Memory (Timers) V0 - V377 3001/4001 30001/40001
2
V Memory (Counters) V1000 - V1177 3513/4513 30513/40513
V1200 - V1377 3641/4641 30641/40641 3
V1400 - V1746 3769/4769 30769/40769
V Memory (Data Words) V1747 - V1777
V2000 - V7377
---
---
31000/41000
41025
4
V10000 - V17777 --- 44097
5
* MODBUS: Function 04
The DL05/06, DL250-1/260, DL350 and DL450 will support function 04, read input
register (Address 30001). To use function 04, put the number ‘4’ into the most significant
6
position (4xxx). Four digits must be entered for the intruction to work properly with this
mode. 7
8
LD The Maximum constant possible is 4128. This
K101 is due to the 128 maximum number of Bytes 9
that the RX/WX instruction can allow. The
LD
K4128
value of 4 in the most significant position of the
word will cause the RX to use function 04
10
(30001 range).
LDA
O4000
11
RX 12
Y0
13
1. Refer to your PLC user manual for the correct memory mapping size of your PLC. Some of 14
the addresses shown above might not pertain to your particular CPU.

2. For an automated MODBUS/Koyo address conversion utility, download the file


A
modbus_conversion.xls from the www.automationdirect.com website.
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–41


Chapter 4: CPU Specifications and Operation

Example 1: V2100 584/984 Mode


1 Find the MODBUS address for user V-memory PLC Address (Dec) +Mode Address
V2100. V2100 = 1088 decimal
2 1. Find V memory in the table.
2. Convert V2100 into decimal (1088).
1088 + 40001 = 41089

3. Add the MODBUS starting address for the mode (40001).


3 For Word Data Types.... PLC Address (Dec.) + Appropriate Mode Address

4 Timer Current Values (V)


Counter Current Values (V)
128
128
V0 – V177
V1200 – V7377
0 – 127
512 – 639
3001
3001
30001
30001
Input Register
Input Register
V Memory, user data (V) 1024 V2000 – V3777 1024 – 2047 4001 40001 Holding Register
5
Example 2: Y20 584/984 Mode
6 Find the MODBUS address for output Y20.
1. Find Y outputs in the table.
PLC Address (Dec) +Start Addr + Mode
Y20 = 16 decimal
2. Convert Y20 into decimal (16).
7 3. Add the starting address for the range (2048).
16 + 2048 + 1 = 2065

4. Add the MODBUS address for the mode (1).


8 Outputs (Y) 320 Y0 - Y477 2048 - 2367 1 1 Coil
Control Relays (CR) 256 C0 - C377 3072 - 3551 1 1 Coil
9 Timer Contacts (T) 128 T0 - T177 6144 - 6271 1 1 Coil

Example 3: T10 Current Value 484 Mode


10 Find the MODBUS address to obtain the current value PLC Address (Dec) +Mode Address
for Timer T10. T10 = 8 decimal
11 1. Find Timer Current Values in the table.
2. Convert T10 into decimal (8).
8 + 3001 = 3009

3. Add the MODBUS starting address for the mode (3001).


12 For Word Data Types.... PLC Address (Dec.) + Appropriate Mode Address

13 Timer Current Values (V)


Counter Current Values (V)
128
128
V0 – V177
V1200 – V7377
0 – 127
512 – 639
3001
3001
30001
30001
Input Register
Input Register
V Memory, user data (V) 1024 V2000 – V3777 1024 – 2047 4001 40001 Holding Register
14
Example 4: C54 584/984 Mode
A Find the MODBUS address for Control Relay C54. PLC Address (Dec) +Start Addr + Mode
C54 = 44 decimal
1. Find Control Relays in the table.
B 2. Convert C54 into decimal (44).
3. Add the starting address for the range (3072).
44 + 3072 + 1 = 3117

4. Add the MODBUS address for the mode (1).


C Outputs (Y) 320 Y0 - Y477 2048 - 2367 1 1 Coil
Control Relays (CR) 256 C0 - C377 3072 - 3551 1 1 Coil
D Timer Contacts (T) 128 T0 - T177 6144 - 6271 1 1 Coil

4–42 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Network Master Operation 1


This section describes how the DL05 can communicate on a MODBUS or DirectNET
network as a master. For MODBUS networks, it uses the MODBUS RTU protocol, which
must be interpreted by all the slaves on the network. Both MODBUS and DirectNet are
2
single master/multiple slave networks. The master is the only member of the network that can
initiate requests on the network. This section teaches you how to design the required ladder 3
logic for network master operation.
MODBUS RTU Protocol, or DirectNET
4
5
Slave #1 Slave #2 Slave #3

6
7
Master
8
9
When using the DL05 PLC as the master station, simple RLL instructions are used to initiate 10
the requests. The WX instruction initiates network write operations, and the RX instruction
initiates network read operations. Before executing either the WX or RX commands, we will
need to load data related to the read or write operation onto the CPU’s accumulator stack.
11
When the WX or RX instruction executes, it uses the information on the stack combined
with data in the instruction box to completely define the task, which goes to the port. 12
Network

WX (write)
13
RX (read)
Slave 14
A
B
Master
C
D
The following step-by-step procedure will provide you the information necessary to set up
your ladder program to receive data from a network slave.

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–43


Chapter 4: CPU Specifications and Operation

Step 1: Identify Master Port # and Slave # F 2 0 1


1 The first Load (LD) instruction identifies the
communications port number on the network
2 master (DL05) and the address of the slave
station. This instruction can address up to 99 Slave address (BCD)
MODBUS slaves, or 90 DirectNET slaves. The
3 format of the word is shown to the right. The
Port number (BCD)
“F2” in the upper byte indicates the use of the Internal port (hex)
4 right port of the DL05 PLC, port number 2. The
lower byte contains the slave address number in LD
5 BCD (01 to 99). KF201
Step 2: Load Number of Bytes to Transfer
6 The second Load (LD) instruction determines the
number of bytes which will be transferred 6 4 (BCD)
between the master and slave in the subsequent
7 WX or RX instruction. The value to be loaded is
in BCD format (decimal), from 1 to 128 bytes.
# of bytes to transfer
8
The number of bytes specified also depends on
9 the type of data you want to obtain. For example,
LD
K64
the DL05 Input points can be accessed by V-
10 memory locations or as X input locations.
However, if you only want X0 – X27, you’ll have
to use the X input data type because the V-
11 memory locations can only be accessed in 2-byte
increments. The following table shows the byte
12 ranges for the various types of DirectLOGIC™.
products.

13 DL 05 / 205 / 350 / 405 Memory Bits per unit Bytes


V memory 16 2
14 T / C current value 16 2
Inputs (X, SP) 8 1

A Outputs
(Y, C, Stage, T/C bits)
8 1

Scratch Pad Memory 8 1


B Diagnostic Status 8 1

DL330 / 340 Memory Bits per unit Bytes


C Data registers 8
16
1
2
T / C accumulator
D I/O, internal relays, shift register
bits, T/C bits, stage bits
1 1

Scratch Pad Memory 8 1


Diagnostic Status(5 word R/W) 16 10

4–44 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 4: CPU Specifications and Operation

Step 3: Specify Master Memory Area


The third instruction in the RX or WX sequence is a
4 0 6 0 0 (octal) 1
Load Address (LDA) instruction. Its purpose is to
load the starting address of the memory area to be
transferred. Entered as an octal number, the LDA
Starting address of
master transfer area
2
instruction converts it to hex and places the result in
the accumulator. LDA
O40600
3
For a WX instruction, the DL05 CPU sends the
number of bytes previously specified from its
V40600
4
memory area beginning at the LDA address specified. MSB LSB
For an RX instruction, the DL05 CPU reads the 15 0
5
number of bytes previously specified from the slave, V40601
placing the received data into its memory area
beginning at the LDA address specified.
MSB LSB
6
15 0
NOTE: Since V memory words are always 16 bits, you may
not always use the whole word. For example, if you only specify 3 bytes and you are reading Y outputs
7
from the slave, you will only get 24 bits of data. In this case, only the 8 least significant bits of the last
word location will be modified. The remaining 8 bits are not affected. 8
Step 4: Specify Slave Memory Area 9
The last instruction in our sequence is the WX or RX SP116
LD
instruction itself. Use WX to write to the slave, and RX
to read from the slave. All four of our instructions are
KF201 10
shown to the right. In the last instruction, you must
specify the starting address and a valid data type for the
LD
K64
11
slave.
• DirectNET slaves – specify the same address in the WX
and RX instruction as the slave’s native I/O address
LDA 12
O40600
• MODBUS DL405, DL205, or DL05 slaves – specify the
same address in the WX and RX instruction as the slave’s RX
13
native I/O address Y0
• MODBUS 305 slaves – use the following table to convert 14
DL305 addresses to MODBUS addresses
A
DL305 Series CPU Memory Type–to–MODBUS Cross Reference (excluding 350 CPU)
PLC Memory Type PLC Base Address MODBUS
Base Address PLC Memory Type PLC Base Address MODBUS
Base Address
B
TMR/CNT Current
Values
R600 V0 TMR/CNT Status Bits CT600 GY600
C
I/O Points IO 000 GY0 Control Relays CR160 GY160
Data Registers
Stage Status Bits
R401,R400 V100 Shift Registers SR400 GY400
D
S0 GY200
(D3-330P only)

DL05 Micro PLC User Manual, 5th Edition, 6/04 4–45


Chapter 4: CPU Specifications and Operation

Communications from a Ladder Program


1 Typically network communications will
last longer than 1 scan. The program must
2 wait for the communications to finish
before starting the next transaction.
3 Port 2, which can be a master, has two
Special Relay contacts associated with it
SP117 Y1
SET

(see Appendix D for comm port special


4 relays).One indicates “Port busy”(SP116), Port Communication Error
SP116
LD
KF201

and the other indicates ”Port LD


5 Communication Error”(SP117). The
example above shows the use of these
Port Busy K0003

LDA
O40600
contacts for a network master that only
6 reads a device (RX). The “Port Busy” bit is RX
Y0
on while the PLC communicates with the
7 slave. When the bit is off the program can
initiate the next network request.
8 The “Port Communication Error” bit
turns on when the PLC has detected an
error. Use of this bit is optional. When used, it should Interlocking Relay
9 be ahead of any network instruction boxes since the SP116 C100
LD
error bit is reset when an RX or WX instruction is KF201
10 executed.
LD
Multiple Read and Write Interlocks K0003
11 If you are using multiple reads and writes in the RLL
program, you have to interlock the routines to make LDA
O40600
12 sure all the routines are executed. If you don’t use the
interlocks, then the CPU will only execute the first
RX
routine. This is because each port can only handle one
13 transaction at a time.
Interlocking
Relay
VY0

C100
In the example to the right, after the RX instruction is
14 executed, C0 is set. When the port has finished the
SP116 C100
SET

communication task, the second routine is executed LD


A and C0 is reset. KF201

LD
B K0003

LDA
C O40400

D WX
VY0

C100
RST

4–46 DL05 Micro PLC User Manual, 5th Edition, 6/04


STANDARD RLL CHAPTER
INSTRUCTIONS
5
In This Chapter:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–2
Using Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–4
Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–9
Comparative Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–25
Immediate Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–31
Timer, Counter and Shift Register Instructions . . . . . . . . . . . . . . . .5–35
Accumulator / Stack Load and Output Data Instructions . . . . . . . .5–48
Logical Instructions (Accumulator) . . . . . . . . . . . . . . . . . . . . . . . . .5–60
Math Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–68
Bit Operation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–82
Number Conversion Instructions (Accumulator) . . . . . . . . . . . . . . .5–87
Table Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–96
CPU Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–99
Program Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–101
Interrupt Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–108
Message Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–111
Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5–118
Chapter 5: Standard RLL Instructions

1 IntroductionDL05 Micro PLCs offer a wide variety of instructions to perform many different types of
2 operations. This chapter shows you how to use each standard Relay Ladder Logic (RLL)
instruction. In addition to these instructions, you may also need to refer to the Drum
instruction in Chapter 6, or the Stage programming instructions in Chapter 7.
3 There are two ways to quickly find the instruction you need.
• If you know the instruction category (Boolean, Comparative Boolean, etc.) just use the title at the
4 top of the page to find the pages that discuss the instructions in that category.
• If you know the individual instruction name, use the following table to find the page(s) that
5 discusses the instruction.

Instruction Page Instruction Page


6 Accumulating Timer (TMRA) 5–38 Decode (DECO) 5–86
Accumulating Fast Timer (TMRAF) 5-38 Decrement (DEC) 5–76
7 Add (ADD) 5–68 Decrement Binary (DECB) 5–77
Add Binary (ADDB) 5–78 Disable Interrupts (DISI) 5–109
8 Add Double (ADDD) 5–69 Divide (DIV) 5–74
And (AND) 5–13 Divide Binary (DIVB) 5–81
9 And (AND) 5–30 Divide Double (DIVD) 5–75
And (AND) 5–60 Enable Interrupts (ENI) 5–108
10 And Bit-of-Word (ANDB)
And Double (ANDD)
5-14
5–61
Encode (ENCO)
End (END)
5–85
5–99

11 And If Equal (ANDE)


And If Not Equal (ANDNE)
5–27
5–27
Exclusive Or (XOR)
Exclusive Or Double (XORD)
5–65
5–64

12 And Immediate (ANDI)


And Negative Differential (ANDND)
5–32
5–21
Fault (FAULT)
For / Next (FOR) (NEXT)
5–111
5–101
And Not (ANDN) 5–13 Goto Subroutine (GTS) (SBR) 5–103
13 And Not (ANDN) 5–30 Gray Code (GRAY) 5–93
And Not Bit-of-Word (ANDNB) 5-14 HEX to ASCII (HTA) 5–91
14 And Not Immediate (ANDNI) 5–32 Increment (INC) 5–76
And Positive Differential (ANDPD) 5–21 Increment Binary (INCB) 5–77
A And Store (AND STR) 5–15 Interrupt (INT) 5–108
ASCII Constant (ACON) 5–112 Interrupt Return (IRT) 5–108
B ASCII to HEX (ATH)
Binary (BIN)
5–90
5–87
Interrupt Return Conditional (IRTC)
Invert (INV)
5–108
5–89

C Binary Coded Decimal (BCD)


Compare (CMP)
5–88
5–66
Load (LD)
Load Address (LDA)
5–53
5–56

D Compare Double (CMPD)


Counter (CNT)
5–67
5–41
Load Double (LDD)
Load Formatted (LDF)
5–54
5–55
Data Label (DLBL) 5–112 Load Label (LDLBL) 5–97

5–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions
Instruction Page Instruction Page
Master Line Reset (MLR) 5–106 Print Message (PRINT) 5–114
Master Line Set (MLS) 5–106 Read from Network (RX) 5–118 1
Move (MOV) 5–96 Reset (RST) 5–22
Move Memory Cartridge (MOVMC) 5–97 Reset Bit-of-Word (RSTB) 5-23 2
Multiply (MUL) 5–72 Reset Immediate (RSTI) 5–34
Multiply Binary (MULB) 5–80 Reset Watch Dog Timer (RSTWT) 5–100 3
Multiply Double (MULD) 5–73 Set (SET) 5–22
No Operation (NOP) 5–99 Set Bit-of-Word (SETB) 5-23 4
Not (NOT) 5–18 Set Immediate (SETI) 5–34
Numerical Constant (NCON)
Or (OR)
5–112
5–11
Shift Left (SHFL)
Shift Register (SR)
5–83
5–47
5
Or (OR)
Or (OR)
5–29
5–62
Shift Right (SHFR)
Shuffle Digits (SFLDGT)
5–84
5–94
6
Or Bit-of-Word (ORB) 5-12 Stage Counter (SGCNT) 5–43
Or Double (ORD) 5–63 Stop (STOP) 5–99 7
Or If Equal (ORE) 5–26 Store (STR) 5–9
Or If Not Equal (ORNE) 5–26 Store (STR) 5–28 8
Or Immediate (ORI) 5–31 Store Bit-of-Word (STRB) 5-10
Or Negative Differential (ORND) 5–20 Store If Equal (STRE) 5–25 9
Or Not (ORN) 5–11 Store If Not Equal (STRNE) 5–25
Or Not (ORN) 5–29 Store Immediate (STRI) 5–31 10
Or Not Bit-of-Word (ORNB) 5-12 Store Negative Differential (STRND) 5–19
Or Not Immediate (ORNI)
Or Out (OR OUT)
5–31
5–16
Store Not (STRN)
Store Not (STRN)
5–9
5–28
11
Or Out Immediate (OROUTI)
Or Positive Differential (ORPD)
5–33
5–20
Store Not Bit-of-Word (STRNB)
Store Not Immediate (STRNI)
5-10
5–31
12
Or Store (OR STR) 5–15 Store Positive Differential (STRPD) 5–19
Out (OUT) 5–16 Subroutine Return (RT) 5–103
13
Out (OUT) 5–57 Subroutine Return Conditional (RTC) 5–103
Out Bit-of-Word (OUTB) 5-17 Subtract (SUB) 5–70 14
Out Double (OUTD) 5–57 Subtract Binary (SUBB) 5–79
Out Formatted (OUTF) 5–58 Subtract Double (SUBD) 5–71 A
Out Immediate (OUTI) 5–33 Sum (SUM) 5–81
Pause (PAUSE) 5–24 Timer (TMR) and Timer Fast (TMRF) 5–36 B
Pop (POP) 5–58 Up Down Counter (UDC) 5–45
Positive Differential (PD) 5–18 Write to Network (WX) 5–120 C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–3


Chapter 5: Standard RLL Instructions - Boolean Instructions

1 Using Boolean Instructions


Do you ever wonder why so many PLC manufacturers always quote the scan time for a 1K
2 boolean program? Simple. Most all programs utilize many boolean instructions. These are
typically very simple instructions designed to join input and output contacts in various series
and parallel combinations. Since the DirectSOFT32. package allows you to use graphic
3 symbols to build the program, you don’t absolutely have to know the mnemonics of the
instructions. However, it may helpful at some point, especially if you ever have to
4 troubleshoot the program with a Handheld Programmer.The following paragraphs show how
these instructions are used to build simple ladder programs.

5 END Statement
All DL05 programs require an END statement as the last instruction. This tells the CPU that
this is the end of the program. Normally, any instructions placed after the END statement
6 will not be executed. There are exceptions to this such as interrupt routines, etc. Chapter 5
discusses the instruction set in detail.
7 X0 Y0

8 All programs must have


OUT

an END statement
9 END

10 Simple Rungs
You use a contact to start rungs that contain both contacts and coils. The boolean instruction
that does this is called a Store or, STR instruction. The output point is represented by the
11 Output or, OUT instruction. The following example shows how to enter a single contact and
a single output coil.
12 Direct SOFT32 Example Handheld Mnemonics

X0 Y0 STR X0
13 OUT
OUT Y0
END

14 END

A Normally Closed Contact


Normally closed contacts are also very common. This is accomplished with the Store Not or,
STRN instruction. The following example shows a simple rung with a normally closed
B contact.

C X0
Direct SOFT32 Example
Y0
Handheld Mnemonics
STRN X0
OUT OUT Y0
D END

END

5–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Contacts in Series
Use the AND instruction to join two or more contacts in series. The following example shows 1
two contacts in series and a single output coil. The instructions used would be STR X0, AND
X1, followed by OUT Y0. 2
Direct SOFT32 Example Handheld Mnemonics

X0 X1 Y0 STR X0
AND X1
3
OUT OUT Y0
END 4
END
5
Midline Outputs
Sometimes it is necessary to use midline outputs to get additional outputs that are conditional
6
on other contacts. The following example shows how you can use the AND instruction to
continue a rung with more conditional outputs. 7
Direct SOFT32 Example Handheld Mnemonics
STR X0
8
X0 X1 Y0
AND X1
OUT OUT Y0
AND X2
9
X2 Y1 OUT Y1
OUT
AND X3
OUT Y2
10
END
X3 Y2
OUT
11
END
12
Parallel Elements 13
Direct SOFT32 Example Handheld Mnemonics 14
X0 Y0 STR X0
OUT OR X1
OUT Y0 A
X1 END

B
END
C
You also have to join contacts in parallel. The OR instruction allows you to do this. The
following example shows two contacts in parallel and a single output coil. The instructions
would be STR X0, OR X1, followed by OUT Y0.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–5


Chapter 5: Standard RLL Instructions - Boolean Instructions

Joining Series Branches in Parallel


1 Quite often it is necessary to join several groups of series elements in parallel. The Or Store
(ORSTR) instruction allows this operation. The following example shows a simple network
2 consisting of series elements joined in parallel.
Direct SOFT32 Example Handheld Mnemonics

3 X0 X1 Y0
OUT
STR X0
AND X1
STR X2

4 X2 X3 AND X3
ORSTR
OUT Y0
END END
5
Joining Parallel Branches in Series
6 You can also join one or more parallel branches in series. The And Store (ANDSTR)
instruction allows this operation. The following example shows a simple network with contact
7 branches in series with parallel contacts.
Direct SOFT32 Example Handheld Mnemonics

8 X0 X1 Y0
OUT
STR X0
STR X1
OR X2

9 X2 ANDSTR
OUT Y0
END

10 Combination Networks
END

11 You can combine the various types of series and parallel branches to solve most any
application problem. The following example shows a simple combination network.

12 X0 X2 X5 Y0
OUT

13 X1 X3 X4

X6
14
END

A Comparative Boolean
Some PLC manufacturers make it really difficult to do a simple comparison of two numbers.
B Some of them require you to move the data all over the place before you can actually perform
the comparison. The DL05 Micro PLCs provide Comparative Boolean instructions that allow
you to quickly and easily solve this problem. The Comparative Boolean provides evaluation of
C two 4-digit values using boolean contacts. The valid evaluations are: equal to, not equal to,
equal to or greater than, and less than.
D In the following example when the value in V-memory V1400 K1234 Y3
OUT
location V1400 is equal to the constant value 1234, Y3
will energize.

5–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Boolean Stack
There are limits to how many elements you can include in a rung. This is because the DL05 1
PLCs use an 8-level boolean stack to evaluate the various logic elements. The boolean stack is
a temporary storage area that solves the logic for the rung. Each time the program encounters
a STR instruction, the instruction is placed on the top of the stack. Any other STR
2
instructions already on the boolean stack are pushed down a level. The ANDSTR, and
ORSTR instructions combine levels of the boolean stack when they are encountered. An 3
error will occur during program compilation if the CPU encounters a rung that uses more
than the eight levels of the boolean stack. 4
The following example shows how the boolean stack is used to solve boolean logic.
5

STR
X0
STR
X1 ORSTR AND X4 Y0
OUT Output
6
X2 AND X3
ANDSTR
7
STR

X5 OR
8
STR X0 STR X1 STR X2 AND X3
9
1 STR X0 1 STR X1 1 STR X2 1 X2 AND X3
2
3
2
3
STR X0 2
3
STR X1
2
3
STR X1
STR X0
10
STR X0
4
5
4
5
4
5
4
5
11
6 6 6 6
7 7 7 7 12
8 8 8 8

ORSTR AND X4 ORNOT X5 13


1 X1 or (X2 AND X3) 1 X4 AND {X1 or (X2 AND X3)} 1 NOT X5 OR X4 AND {X1 OR (X2 AND X3)}
2
3
STR X0 2
3
STR X0 2
3
STR X0 14
. . .

8
.

8
.

8
.
A
ANDSTR
1 XO AND (NOT X5 or X4) AND {X1 or (X2 AND X3)}
B
2
3
C
.

8
.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–7


Chapter 5: Standard RLL Instructions - Boolean Instructions

Immediate Boolean
1 The DL05 Micro PLCs can usually complete an operation cycle in a matter of milliseconds.
However, in some applications you may not be able to wait a few milliseconds until the next
2 I/O update occurs. The DL05 PLCs offer Immediate input and outputs which are special
boolean instructions that allow reading directly from inputs and writing directly to outputs
during the program execution portion of the CPU cycle. You may recall that this is normally
3 done during the input or output update portion of the CPU cycle. The immediate
instructions take longer to execute because the program execution is interrupted while the
4 CPU reads or writes the I/O point. This function is not normally done until the read inputs
or the write outputs portion of the CPU cycle.
5 NOTE: Even though the immediate input instruction reads the most current status from the input point, it
only uses the results to solve that one instruction. It does not use the new status to update the image
6 register. Therefore, any regular instructions that follow will still use the image register values. Any
immediate instructions that follow will access the I/O again to update the status. The immediate output
instruction will write the status to the I/O and update the image register.
7
8
9
10
CPU Scan
11 The CPU reads the inputs from the local
base and stores the status in an input
Read Inputs

12
image register.

X11 ... X2 X1 X0
OFF ... ON OFF OFF ON X0
Input Image Register

13 OFF X1

Read Inputs from Specialty I/O

14
A Solve the Application Program
X0 Y0
Immediate instruction does not use the
input image register, but instead reads
the status from the module immediately.
I I/O Point X0 Changes

B ON X0

C Write Outputs
OFF X1

D Write Outputs to Specialty I/O

Diagnostics

5–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Boolean Instructions 1
Store (STR)
The Store instruction begins a new rung or an additional
Aaaa
2
branch in a rung with a normally open contact. Status of
the contact will be the same state as the associated image 3
register point or memory location.
Store Not (STRN) 4
The Store Not instruction begins a new rung or an Aaaa
additional branch in a rung with a normally closed
contact. Status of the contact will be opposite the state of
5
the associated image register point or memory location.
6
Operand Data Type DL05 Range
....................................A
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0–377
7
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
0–377
0–777 8
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
0–177
0–177
9
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP

In the following Store example, when input X1 is on, output Y2 will energize.
0–777
10
Direct SOFT32 Handheld Programmer Keystrokes
11
X1 Y2

OUT
$
STR
B
1
ENT
12
GX C ENT
OUT 2
13
14
In the following Store Not example, when input X1 is off output Y2 will energize.
Direct SOFT32 Handheld Programmer Keystrokes
A
X1 Y2

OUT
SP
STRN
B
1
ENT
B
GX C ENT
OUT 2
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–9


Chapter 5: Standard RLL Instructions - Boolean Instructions

Store Bit-of-Word (STRB)


1 The Store Bit-of-Word instruction begins a new rung or an
additional branch in a rung with a normally open contact. Aaaa.bb
2 Status of the contact will be the same state as the bit referenced
in the associated memory location.
3 Store Not Bit-of-Word (STRNB)
The Store Not Bit-of-Word instruction begins a new rung or Aaaa.bb
4 an additional branch in a rung with a normally closed contact.
Status of the contact will be opposite the state of the bit
referenced in the associated memory location.
5 Operand Data Type DL05 Range
..................................... A aaa bb
6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B See memory map BCD, 0 to 15
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB See memory map BCD, 0 to 15
7 In the following Store Bit-of-Word example, when bit 12 of V-memory location V1400 is on,
output Y2 will energize.
8 DirectSOFT32

9 B1400.12 Y2

OUT

10
Handheld Programmer Keystrokes
11 STR SHFT B V 1 4 0 0

12 OUT
K 1

2 ENT
2 ENT

13 In the following Store Not Bit-of-Word example, when bit 12 of V-memory location V1400
is off, output Y2 will energize.
14
A DirectSOFT32
B1400.12 Y2

OUT

B
C Handheld Programmer Keystrokes

STRN SHFT B V 1 4 0 0
D K 1 2 ENT

OUT 2 ENT

5–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Or (OR)
The Or instruction logically ors a normally open contact in 1
parallel with another contact in a rung. The status of the
contact will be the same state as the associated image register
point or memory location.
Aaaa
2
Or Not (ORN) 3
The Or Not instruction logically ors a normally closed
contact in parallel with another contact in a rung. The status
of the contact will be opposite the state of the associated
Aaaa 4
image register point or memory location.
In 5
Operand Data Type DL05 Range the
....................................A
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0–377
6
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777 7
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0–177
0–177
8
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP 0–777

following Or example, when input X1 or X2 is on, output Y5 will energize.


9
Direct SOFT32 Handheld Programmer Keystrokes
10
X1 Y5

OUT
$
STR
B
1
ENT 11
Q C
X2
GX
OR
F
2
ENT

ENT
12
OUT 5

13
In the following Or Not example, when input X1 is on or X2 is off, output Y5 will
energize. 14
Direct SOFT32 Handheld Programmer Keystrokes A
X1 Y5 $ B
OUT
R
STR
C
1
ENT

ENT
B
ORN 2
X2
GX
OUT
F
5
ENT C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–11


Chapter 5: Standard RLL Instructions - Boolean Instructions

1 Or Bit-of-Word (ORB)
The Or Bit-of-Word instruction logically ors a normally
2 open contact in parallel with another contact in a rung.
Status of the contact will be the same state as the bit
Aaaa.bb

3 referenced in the associated memory location.


Or Not Bit-of-Word (ORNB)
4 The Or Not Bit-of-Word instruction logically ors a
normally closed contact in parallel with another contact
Aaaa.bb
in a rung. Status of the contact will be opposite the state
5 of the bit referenced in the associated memory location.

6 Operand Data Type DL05 Range


..................................... A aaa bb
7 V-memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B
PB
See memory map
See memory map
BCD, 0 to 15
BCD, 0 to 15

8 In the following Or Bit-of-Word example, when input X1 or bit 7 of V1400 is on, output Y5
will energize.
9 DirectSOFT32

X1 Y7

10 OUT

B1400.7

11 Handheld Programmer Keystrokes

STR 1 ENT

12 OR SHFT B V 1 4 0 0

K 7 ENT

13 OUT 7 ENT

14 In the following Or Bit-of-Word example, when input X1 is on or bit 7 of V1400 is off,


output Y7 will energize.
A DirectSOFT32

X1 Y7

B OUT

B1400.7

C Handheld Programmer Keystrokes

STR 1 ENT

D ORN SHFT

K
B

7 ENT
V 1 4 0 0

OUT 7 ENT

5–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

AND (AND)
The And instruction logically ands a normally open Aaaa
1
contact in series with another contact in a rung. The
status of the contact will be the same state as the
associated image register point or memory location.
2
And Not (ANDN) 3
The And Not instruction logically ands a normally Aaaa
closed contact in series with another contact in a rung.
The status of the contact will be opposite the state of
4
the associated image register point or memory location.
5
Operand Data Type DL05 Range
....................................A
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0–377
6
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777 7
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0–177
0–177
8
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP 0–777

In the following And example, when input X1 and X2 are on output Y5 will energize.
9
10
Direct SOFT32

X1 X2 Y5
Handheld Programmer Keystrokes

$ B
11
ENT
STR 1
OUT
V
AND
C
2
ENT 12
GX
OUT
F
5
ENT
13
In the following And Not example, when input X1 is on and X2 is off output Y5 will
energize.
14
A
Direct SOFT32 Handheld Programmer Keystrokes

X1 X2 Y5 $
STR
B
1
ENT
B
OUT
W
ANDN
C
2
ENT C
GX F ENT
OUT 5
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–13


Chapter 5: Standard RLL Instructions - Boolean Instructions

And Bit-of-Word (ANDB)


1 The And Bit-of-Word instruction logically ands a
normally open contact in series with another contact in a Aaaa.bb

2 rung. The status of the contact will be the same state as


the bit referenced in the associated memory location.
3 And Not Bit-of-Word (ANDNB)
The And Not Bit-of-Word instruction logically ands a
4 normally closed contact in series with another contact in
a rung. The status of the contact will be opposite the state
Aaaa.bb

of the bit referenced in the associated memory location.


5
Operand Data Type DL05 Range
6 ..................................... A aaa bb
V-memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B See memory map BCD, 0 to 15
7 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB See memory map BCD, 0 to 15

In the following And Bit-of-Word example, when input X1 and bit 4 of V1400 is on output
8 Y5 will energize.

9 DirectSOFT32

X1 B1400.4 Y5

OUT

10 Handheld Programmer Keystrokes

11
STR 1 ENT

12 AND SHFT

K
B

4 ENT
V 1 4 0 0

13 OUT 5 ENT

14 In the following And Not Bit-of-Word example, when input X1 is on and bit 4 of V1400 is
off output Y5 will energize.
A DirectSOFT32

X1 B1400.4 Y5

B OUT

C Handheld Programmer Keystrokes

STR 1 ENT

D ANDN SHFT B V 1 4 0 0

K 4 ENT

OUT 5 ENT

5–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

And Store (AND STR)


The And Store instruction logically ands two OUT
1
branches of a rung in series. Both branches must
begin with the Store instruction. 1 2
2
Or Store (OR STR) 1
3
The Or Store instruction logically ors two
branches of a rung in parallel. Both branches
must begin with the Store instruction.
OUT
4
2

5
In the following And Store example, the branch
consisting of contacts X2, X3, and X4 have been anded with the branch consisting of contact
X1.
6
Direct SOFT32 Handheld Programmer Keystrokes
7
X1 X2 X3 Y5

OUT
$
STR
B
1
ENT 8
$ C
X4
V
STR
D
2
ENT
9
ENT
AND 3
Q
OR
E
4
ENT 10
L
ANDST
GX
ENT

F
11
ENT
OUT 5

12
In the following Or Store example, the branch consisting of X1 and X2 have been ored with
the branch consisting of X3 and X4. 13
Direct SOFT32 Handheld Programmer Keystrokes

X1 X2 Y5 $ B ENT
14
STR 1

X3 X4
OUT
V
AND
C
2
ENT A
$ D

V
STR
E
3
ENT
B
ENT
AND 4
M
ORST
ENT C
GX F
OUT 5
ENT
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–15


Chapter 5: Standard RLL Instructions - Boolean Instructions

Out (OUT)
1 The Out instruction reflects the status of the rung (on/off ) and Aaaa
outputs the discrete (on/off ) state to the specified image OUT

2 register point or memory location.


Multiple Out instructions referencing the same discrete location should not be used since
3 only the last Out instruction in the program will control the physical output point. Instead,
use the next instruction, the Or Out.
4 Operand Data Type
....................................A
DL05 Range
aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0–377
5 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777
6 In the following Out example, when input X1 is on, output Y2 and Y5 will energize.
7 Direct SOFT32

X1 Y2
Handheld Programmer Keystrokes

$ B ENT
STR 1

8 OUT

Y5
GX
OUT
C
2
ENT

GX F

9 OUT OUT 5
ENT

Or Out (OR OUT)


10 The Or Out instruction allows more than one rung of discrete
A aaa
logic to control a single output. Multiple Or Out instructions
11 referencing the same output coil may be used, since all
contacts controlling the output are logically ORed together. If
OR OUT

the status of any rung is on, the output will also be on.
12
Operand Data Type DL05 Range
13 ....................................A
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0–177
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0177
14 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777

In the following example, when X1 or X4 is on, Y2 will energize.


A
B Direct SOFT32

X1 Y2
Handheld Programmer Keystrokes

$ B ENT

C OR OUT
O
STR

INST#
D
3
F
1

5
ENT ENT C
2
ENT

D X4 Y2
$

O
STR
D
E

F
4
ENT

ENT ENT C ENT


INST# 3 5 2
OR OUT

5–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Out Bit-of-Word (OUTB)


The Out Bit-of-Word instruction reflects the status of the rung 1
(on/off ) and outputs the discrete (on/off ) state to the specified
Aaaa.bb
bit in the referenced memory location. Multiple Out Bit-of-Word
instructions referencing the same bit of the same word generally OUT 2
should not be used since only the last Out instruction in the
program will control the status of the bit. 3
Operand Data Type DL05 Range 4
A aaa bb
V-memory
Pointer
B
PB
See memory map
See memory map
BCD, 0 to 15
BCD, 0 to 15
5
In the following Out Bit-of-Word example, when input X1 is on, bit 3 of V1400 and bit 6 of 6
V1401 will turn on.
DirectSOFT32

X1 B1400.3
7
OUT
8
B1401.6
Handheld Programmer Keystrokes
OUT
9
STR 1 ENT

OUT SHFT

K
B

3 ENT
V 1 4 0 0
10
OUT SHFT

K
B

6 ENT
V 1 4 0 1
11
The following Out Bit-of-Word example contains two Out Bit-of-Word instructions using
the same bit in the same memory word. The final state bit 3 of V1400 is ultimately controlled
12
by the last rung of logic referencing it. X1 will override the logic state controlled by X0. To
avoid this situation, multiple outputs using the same location must not be used in 13
programming.
14
X0 B1400.3

OUT
A
B
X1 B1400.3
C
OUT
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–17


Chapter 5: Standard RLL Instructions - Boolean Instructions

Not (NOT)
1 The Not instruction inverts the status of the rung at
the point of the instruction.
2 In the following example when X1 is off, Y2 will energize. This is because the Not instruction
inverts the status of the rung at the Not instruction.
3 DirectSOFT32 Handheld Programmer Keystrokes

X1 Y2 $ B ENT
4 OUT
SHFT
STR
N O
1
T ENT
TMR INST# MLR

5 GX
OUT
C
2
ENT

6 NOTE: DirectSOFT Release 1.1i and later supports the use of the NOT instruction. The above example
rung is merely intended to show the visual representation of the NOT instruction. The rung cannot be
7 created or displayed in DirectSOFT versions earlier than 1.1i.

Positive Differential (PD)


8 The Positive Differential instruction is typically A aaa
known as a one shot. When the input logic
9 produces an off to on transition, the output will
PD

energize for one CPU scan.


10
Operand Data Type DL05 Range
11 ....................................A aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0–377

12 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
0–377
0–777

13 In the following example, every time X1 makes an off to on transition, C0 will energize for
one scan.
14
DirectSOFT32 Handheld Programmer Keystrokes
A X1 C0 $
STR
B
1
ENT
PD
B SHFT P
CV
SHFT D
3
A
0

C
D

5–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Store Positive Differential (STRPD)


The Store Positive Differential instruction begins a 1
new rung or an additional branch in a rung with a
normally open contact. The contact closes for one
CPU scan when the state of the associated image
Aaaa
2
register point makes an Off-to-On transition.
Thereafter, the contact remains open until the next 3
Off-to-On transition (the symbol inside the contact
represents the transition). This function is sometimes
called a “one-shot”.
4
Store Negative Differential (STRND) 5
The Store Negative Differential instruction begins a
new rung or an additional branch in a rung with a
normally closed contact. The contact closes for one
Aaaa 6
CPU scan when the state of the associated image
register point makes an On-to-Off transition. 7
Thereafter, the contact remains open until the next
On-to-Off transition (the symbol inside the contact
represents the transition).
8
Operand Data Type DL05 Range 9
....................................A aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0–377
0–377
10
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377 11
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177 12
In the following example, each time X1 is makes an Off-to-On transition, Y4 will energize for
one scan. 13
DirectSOFT32
X1 Y4
Handheld Programmer Keystrokes
$
STR
SHFT P
CV
D
3
B
1
ENT
14
OUT GX
OUT
E
4
ENT
A
In the following example, each time X1 is makes an On-to-Off transition, Y4 will energize for
B
one scan.
DirectSOFT32 Handheld Programmer Keystrokes
C
$ N D B
X1

OUT
Y4

GX
STR
SHFT

E
TMR

ENT
3 1
ENT
D
OUT 4

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–19


Chapter 5: Standard RLL Instructions - Boolean Instructions

Or Positive Differential (ORPD)


1 The Or Positive Differential instruction logically ors a contact
in parallel with another contact in a rung. The status of the
2 contact will be open until the associated image register point
makes an Off-to-On transition, closing it for one CPU scan.
Aaaa

Thereafter, it remains open until another Off-to-On


3 transition.
Or Negative Differential (ORND)
4 The Or Negative Differential instruction logically ors a
contact in parallel with another contact in a rung. The status
5 of the contact will be open until the associated image register Aaaa
point makes an On-to-Off transition, closing it for one CPU
6 scan. Thereafter, it remains open until another On-to-Off
transition.
7 Operand Data Type DL05 Range
....................................A aaa
8 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0–377
0–377

9 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–777
0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177
10 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177
In the following example, Y 5 will energize whenever X1 is on, or for one CPU scan when X2
11 transitions from Off to On.

12 DirectSOFT32

X1 Y5
Handheld Programmer Keystrokes
$ B ENT
STR 1

13 OUT Q
OR
SHFT P
CV
D
3
C
2
ENT

X2 GX F
ENT

14 OUT 5

A In the following example, Y 5 will energize whenever X1 is on, or for one CPU scan when X2
transitions from On to Off.
B
Handheld Programmer Keystrokes
C DirectSOFT32

X1 Y5
$
STR
B
1
ENT

OUT Q N D C
D X2 GX
OR
SHFT

F
TMR

ENT
3 2
ENT

OUT 5

5–20 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

And Positive Differential (ANDPD)


The And Positive Differential instruction logically ands a 1
contact in parallel with another contact in a rung. The
status of the contact will be open until the associated
image register point makes an Off-to-On transition,
Aaaa 2
closing it for one CPU scan. Thereafter, it remains open
until another Off-to-On transition. 3
And Negative Differential (ANDND)
The And Negative Differential instruction logically ands
4
a contact in parallel with another contact in a rung. The
status of the contact will be open until the associated
Aaaa
5
image register point makes an On-to-Off transition,
closing it for one CPU scan. Thereafter, it remains open
until another On-to-Off transition.
6
Operand Data Type DL05 Range 7
....................................A aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0–377
0–377
8
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–777
0–377
9
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177 10
In the following example, Y5 will energize for one CPU scan whenever X1 is on and X2
transitions from Off to On. 11
DirectSOFT32

X1 X2 Y5
Handheld Programmer Keystrokes
$
STR
B
1
ENT
12
OUT Q

GX
OR
SHFT P

F
CV
D

ENT
3
C
2
ENT
13
OUT 5

14
In the following example, Y5 will energize for one CPU scan whenever X1 is on and X2
transitions from On to Off. A
DirectSOFT32 Handheld Programmer Keystrokes
B
X1 X2 Y5

OUT
$

Q
STR
B

N
1
ENT

D C
C
SHFT ENT
OR TMR 3 2
GX
OUT
F
5
ENT D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–21


Chapter 5: Standard RLL Instructions - Boolean Instructions

Set (SET)
1 The Set instruction sets or turns on an image register
Optional
memory range

point/memory location or a consecutive range of image A aaa aaa


2 register points/memory locations. Once the
point/location is set it will remain on until it is reset
SET

using the Reset instruction. It is not necessary for the


3 input controlling the Set instruction to remain on.
Reset (RST)
4 The Reset instruction resets or turns off an image register
Optional
Memory. range

point/memory location or a range of image registers A aaa aaa


5 points/memory locations. Once the point/location is RST
reset it is not necessary for the input to remain on.
6 Operand Data Type DL05 Range
....................................A aaa
7 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0–377
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
8 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–777
0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177
9 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177

In the following example when X1 is on, Y2 through Y5 will energize.


10
11 DirectSOFT32 Handheld Programmer Keystrokes

12 X1
Y2
SET
Y5 $
STR
B
1
ENT

X C F ENT
SET 2 5
13
14
In the following example when X1 is on, Y2 through Y5 will be reset or de–energized.
A
B DirectSOFT32

X2
Handheld Programmer Keystrokes

$ B
Y2 Y5 ENT
STR 1

C RST
S
RST
C
2
F
5
ENT

5–22 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Boolean Instructions

Set Bit-of-Word (SETB)


The Set Bit-of-Word instruction sets or turns on a bit in a 1
V-memory location. Once the bit is set it will remain on until it is Aaaa.bb
reset using the Reset Bit-of-Word instruction. It is not necessary
for the input controlling the Set Bit-of-Word instruction to
SET
2
remain on.
3
Reset Bit-of-Word (RSTB)
The Reset Bit-of-Word instruction resets or turns off a bit in a
V-memory location. Once the bit is reset it is not necessary for the
A aaa.bb
RST
4
input to remain on.
Operand Data Type DL05 Range
5
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B
aaa
See memory map
bb
BCD, 0 to 15
6
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB See memory map BCD, 0 to 15

In the following example when X1 turns on, bit 1 in V1400 is set to the on state.
7
DirectSOFT32

X1
8
B1400.1
SET
9
Handheld Programmer Keystrokes
10
STR 1 ENT 11
SET SHFT B V 1 4 0 0

K 1 ENT 12
In the following example when X2 turns on, bit 1 in V1400 is reset to the off state.
DirectSOFT32 13
X2
B1400.1
RST 14
A
Handheld Programmer Keystrokes

STR 2 ENT
B
SHFT V 1 4 0 0
RST

K
B

1 ENT
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–23


Chapter 5: Standard RLL Instructions - Boolean Instructions

Pause (PAUSE)
1 The Pause instruction disables the output update on a
range of outputs. The ladder program will continue to Y aaa aaa
2 run and update the image register. However, the outputs
in the range specified in the Pause instruction will be
PAUSE

turned off at the output points.


3
Operand Data Type DL05 Range
4 aaa
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
5 In the following example, when X1 is ON, Y5-Y7 will be turned OFF. The execution of the
ladder program will not be affected.
6 DirectSOFT32

7 X1 Y5 Y7

PAUSE

8
9 Since the D2–HPP Handheld Programmer does not have a specific Pause key, you can use
the corresponding instruction number for entry (#960), or type each letter of the command.
10 Handheld Programmer Keystrokes

11 $
STR
B
1
ENT

O J G A D F
12 INST# 9 6 0
ENT ENT
3 5
ENT

13 In some cases, you may want certain output points in the specified pause range to operate
normally. In that case, use Aux 58 to over-ride the Pause instruction.
14
A
B
C
D

5–24 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Comparative Boolean

Comparative Boolean 1
Store If Equal (STRE)
The Store If Equal instruction begins a new rung or 2
additional branch in a rung with a normally open V aaa B bbb
comparative contact. The contact will be on when Vaaa 3
=Bbbb .
Store If Not Equal (STRNE) 4
The Store If Not Equal instruction begins a new rung V aaa B bbb
or additional branch in a rung with a normally closed
comparative contact. The contact will be on when Vaaa
5
Bbbb.
Operand Data Type DL05 Range
6
....................................B aaa bbb
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28) All (See page 4–28) 7
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28) All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K –– 0–9999 8
In the following example, when the value in V-memory location V2000 = 4933, Y3 will
energize. 9
In
DirectSOFT32 Handheld Programmer Keystrokes the 10
V2000 K4933 Y3 $ SHFT E C A A A

OUT
STR
E
4
J
4

9
D
3
D
2

3
ENT
0 0 0
11
GX
OUT
D
3
ENT
12
following example, when the value in V-memory location V2000 is not equal to 5060, Y3
will energize.
13
14
DirectSOFT32 Handheld Programmer Keystrokes

V2000 K5060 Y3

OUT
SP
STRN
SHFT E
4
C
2
A
0
A
0
A
0 A
F A G A ENT

GX
OUT
5
D
0

3
ENT
6 0
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–25


Chapter 5: Standard RLL Instructions - Comparative Boolean

Or If Equal (ORE)
1 The Or If Equal instruction connects a normally open
comparative contact in parallel with another contact. V aaa B bbb
2 The contact will be on when Vaaa = Bbbb. B bbb
Or If Not Equal (ORNE)
3 The Or If Not Equal instruction connects a normally
closed comparative contact in parallel with another
4 contact. The contact will be on when Vaaa Bbbb. B
bbb
V aaa B bbb

5 Operand Data Type DL05 Range


aaa bbb
6 ....................................B
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28) All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28) All (See page 4–28)
7 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K –– 0–9999

In the following example, when the value in V-memory location V2000 = 4500 or
8 V2002 = 2345 , Y3 will energize.

9 DirectSOFT32 Handheld Programmer Keystrokes

$ SHFT E C A A A
V2000 K4500 Y3

10 OUT
E
STR

4
F
5
A
4

0
A
0
ENT
2 0 0 0

V2002 K2345 Q E C A A C

11 C
OR

2
SHFT

D
3
E
4

4
F
5
ENT
2 0 0 2

12 GX
OUT
D
3
ENT

13 In the following example, when the value in V-memory location V2000 = 3916 or V2002 is
not equal to 050, Y3 will energize.
14
A DirectSOFT32

V2000 K3916 Y3
Handheld Programmer Keystrokes

$
STR
SHFT E
4
C
2
A
0
A
0
A
0
OUT

B V2002 K2500
D

R
3
J

SHFT
9
B

E
1
G
6
ENT

C A A C
ORN 4 2 0 0 2

C C

GX
2
F
5
A

D
0
A

ENT
0
ENT

OUT 3

5–26 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Comparative Boolean

And If Equal (ANDE)


The And If Equal instruction connects a normally V aaa B bbb
1
open comparative contact in series with another
contact. The contact will be on when Vaaa = Bbbb. 2
And If Not Equal (ANDNE)
The And If Not Equal instruction connects a V aaa B bbb 3
normally closed comparative contact in series with
another contact. The contact will be on when Vaaa
Bbbb
4
Operand Data Type DL05 Range
5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28) All (See page 4–28) 6
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28) All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K –– 0–9999 7
In the following example, when the value in V-memory location V2000 = 5000 and
V2002 = 2345, Y3 will energize. 8
DirectSOFT32 Handheld Programmer Keystrokes
9
V2000 K5000 V2002 K2345 Y3
OUT
$

F
STR
SHFT

A
E

A
4
A
C
2
A
0
A
0
A
0 10
ENT
5 0 0 0
V
AND
SHFT E
4
C
2
A
0
A
0
C
2 11
C D E F ENT
2 3 4 5
GX
OUT
D
3
ENT 12
In the following example, when the value in V-memory location V2000 = 2550 and V2002 13
does not equal 050, Y3 will energize.

DirectSOFT32 Handheld Programmer Keystrokes


14
V2000 K5000 V2002 K2345 Y3
OUT
$

F
STR
SHFT

A
E

A
4
A
C

ENT
2
A
0
A
0
A
0
A
5 0 0 0
V

C
AND
SHFT

D
E

E
4
F
C

ENT
2
A
0
A
0
C
2 B
2 3 4 5
GX
OUT
D
3
ENT C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–27


Chapter 5: Standard RLL Instructions - Comparative Boolean

Store (STR)
1 The Comparative Store instruction begins a new rung or A aaa B bbb
additional branch in a rung with a normally open comparative
2 contact. The contact will be on when Aaaa Bbbb.
Store Not (STRN)
3 The Comparative Store Not instruction begins a new rung or A aaa B bbb
additional branch in a rung with a normally closed comparative
4 contact. The contact will be on when Aaaa < Bbbb.

5 Operand Data Type


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa
DL05 Range
bbb

6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p
All (See page 4–28)
All (See page 4–28)
All (See page 4–28)
All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K –– 0–9999
7 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0–177
0–177

8 In the following example, when the value in V-memory location V2000 욷 1000, Y3 will
energize.
9
DirectSOFT32 Handheld Programmer Keystrokes

10 V2000 K1000 Y3
OUT
$
STR
SHFT V
AND
C
2
A
0
A
0
A
0
B A A A ENT

11 GX
OUT
1
D
0

3
ENT
0 0

12
13 In the following example, when the value in V-memory location V2000 < 4050, Y3 will
energize.
14
A DirectSOFT32

V2000 K4050 Y3
Handheld Programmer Keystrokes

SP
STRN
SHFT V
AND
C
2
A
0
A
0
A
0
OUT

B GX
E
4
A

D
0
F

ENT
5
A
0
ENT

OUT 3

C
D

5–28 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Comparative Boolean

Or (OR)
The Comparative Or instruction connects a normally 1
open comparative contact in parallel with another A aaa B bbb
contact. The contact will be on when Aaaa Bbbb. 2
Or Not (ORN)
The Comparative Or Not instruction connects a 3
normally open comparative contact in parallel with
another contact. The contact will be on when Aaaa <
Bbbb. A aaa B bbb
A aaa B bbb
4
Operand Data Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa
DL05 Range
bbb
5
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p
All (See page 4–28)
All (See page 4–28)
All (See page 4–28)
All (See page 4–28) 6
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K –– 0–9999
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0–177
0–177
7
In the following example, when the value in V-memory location V2000 = 6045 or 8
V2002 욷 2345, Y3 will energize.
9
DirectSOFT32

V2000 K6045 Y3
Handheld Programmer Keystrokes

$
STR
SHFT E
4
C
2
A
0
A
0
A
0
10
11
OUT G A E F ENT
6 0 4 5

V2002 K2345 Q SHFT V C A A C


OR AND 2 0 0 2
C

GX
2
D
3
E

D
4
F
5
ENT
12
ENT
OUT 3

13
In the following example when the value in V-memory location V2000 = 1000 or
V2002 < 050, Y3 will energize.
14
A
B
DirectSOFT32 Handheld Programmer Keystrokes
$ SHFT E C A A A
V2000 K1000 Y3 STR 4 2 0 0 0
OUT B A A A ENT

V2002 K2500
R
ORN
1 0 0

SHFT V
AND
0
C
2
A
0
A
0
C
2
C
C F A A

GX
OUT
2 5
D
0

3
0

ENT
ENT
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–29


Chapter 5: Standard RLL Instructions - Comparative Boolean

And (AND)
1 The Comparative And instruction connects a normally A aaa B bbb
open comparative contact in series with another contact.
2 The contact will be on when Aaaa Bbbb.
And Not (ANDN)
3 The Comparative And Not instruction connects a A aaa B bbb
normally open comparative contact in parallel with
4 another contact. The contact will be on when Aaaa <
Bbbb.

5 Operand Data Type


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa
DL05 Range
bbb

6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p
All (See page 4–28)
All (See page 4–28)
All (See page 4–28)
All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K –– 0–9999
7 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0–177
0–177

8 In the following example, when the value in V-memory location V2000 = 5000, and
V2002 욷 2345, Y3 will energize.
9
10 DirectSOFT32

V2000 K5000 V2002 K2345 Y3


Handheld Programmer Keystrokes

$
STR
SHFT E
4
C
2
A
0
A
0
A
0
OUT
F A A A

11 V
AND
5 0

SHFT
0
V
AND
0
C
ENT

2
A
0
A
0
C
2

12 C

GX
2
D
3
E

D
4
F
5

ENT
ENT

OUT 3

13
14 In the following example, when the value in V-memory location V2000 = 7000 and
V2002 < 050, Y3 will energize.
A DirectSOFT32 Handheld Programmer Keystrokes

$ E C A A A

B V2000 K7000 V2002 K2500 Y3


OUT H
STR

7
SHFT

A
0
A
4

0
A
0
ENT
2 0 0 0

C W
ANDN
C F
SHFT

A
V

A
AND
C

ENT
2
A
0
A
0
C
2

2 5 0 0

D GX
OUT
D
3
ENT

5–30 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Immediate Instructions

Immediate Instructions 1
Store Immediate (STRI)
The Store Immediate instruction begins a new rung 2
or additional branch in a rung. The status of the X aaa
contact will be the same as the status of the 3
associated input point at the time the instruction is
executed. The image register is not updated.
4
Store Not Immediate (STRNI)
The Store Not Immediate instruction begins a new
rung or additional branch in a rung. The status of X aaa
5
the contact will be opposite the status of the
associated input point at the time the instruction is 6
executed. The image register is not updated.
Operand Data Type DL05 Range 7
aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0–377 8
In the following example when X1 is on, Y2 will energize.
DirectSOFT32 Handheld Programmer Keystrokes
9
X1 Y2

OUT
$

GX
STR
SHFT I

C
8

ENT
B
1
ENT
10
OUT 2

In the following example when X1 is off, Y2 will energize.


11
DirectSOFT32
X1 Y2
Handheld Programmer Keystrokes

SP
STRN
SHFT I
8
B
1
ENT
12
OUT
GX
OUT
C
2
ENT
13
Or Immediate (ORI) 14
The Or Immediate connects two contacts in parallel. The
status of the contact will be the same as the status of the
associated input point at the time the instruction is executed.
X aaa
A
The image register is not updated.
Or Not Immediate (ORNI)
B
The Or Not Immediate connects two contacts in parallel.
The status of the contact will be opposite the status of the X aaa C
associated input point at the time the instruction is executed.
The image register is not updated. D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–31


Chapter 5: Standard RLL Instructions - Immediate Instructions

OR Immediate Instructions Cont’d


1 Operand Data Type DL05 Range
2 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0–377
In the following example, when X1 or X2 is on, Y5 will energize.
3 DirectSOFT32 Handheld Programmer Keystrokes
X1 Y5

4
$ B ENT
OUT STR 1
Q SHFT I C ENT
X2 OR 8 2

5 GX
OUT
F
5
ENT

In the following example, when X1 is on or X2 is off, Y5 will energize.


6 DirectSOFT32
Handheld Programmer Keystrokes

X1 Y5 $ B

7 X2
OUT
R
ORN
STR

SHFT I
1

8
ENT

C
2
ENT

8
GX F ENT
OUT 5

And Immediate (ANDI)


9 The And Immediate connects two contacts in series. The
status of the contact will be the same as the status of the X aaa
associated input point at the time the instruction is
10 executed. The image register is not updated.
And Not Immediate (ANDNI)
11 The And Not Immediate connects two contacts in series. X aaa
The status of the contact will be opposite the status of the
12 associated input point at the time the instruction is
executed. The image register is not updated.
13 In the following example, when X1 and X2 are on, Y5 will energize.
Operand Data Type DL05 Range
14 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0–377

A DirectSOFT32
X1 X2
OUT
Y5
Handheld Programmer Keystrokes

$
STR
B
1
ENT

B
V SHFT I C ENT
AND 8 2
GX F ENT
OUT 5

C In the following example, when X1 is on and X2 is off, Y5 will energize.


DirectSOFT32 Handheld Programmer Keystrokes

D X1 X2 Y5

OUT
$

W
ANDN
STR

SHFT
B

I
1

8
ENT

C
2
ENT

GX F ENT
OUT 5

5–32 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions

Out Immediate (OUTI)


The Out Immediate instruction reflects the status of the 1
rung (on/off ) and outputs the discrete (on/off ) status to
the specified module output point and the image register
at the time the instruction is executed. If multiple Out Y aaa
2
Immediate instructions referencing the same discrete OUTI
point are used it is possible for the module output status 3
to change multiple times in a CPU scan. See Or Out
Immediate. 4
Or Out Immediate (OROUTI)
The Or Out Immediate instruction has been designed to 5
use more than 1 rung of discrete logic to control a single
output. Multiple Or Out Immediate instructions
referencing the same output coil may be used, since all
Y aaa 6
OROUTI
contacts controlling the output are ored together. If the
status of any rung is on at the time the instruction is 7
executed, the output will also be on.

Operand Data Type DL05 Range


8
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
aaa
0–377
9
In the following example, when X1 is on, output point Y2 on the output module will turn
on. For instruction entry on the Handheld Programmer, you can use the instruction number 10
(#350) as shown, or type each letter of the command.
DirectSOFT32 Handheld Programmer Keystrokes
11
X1
OUTI
Y2 $
STR
B
1
ENT
12
O D F A ENT ENT
INST#
C
3

2
ENT
5 0
13
In the following example, when X1 or X4 is on, Y2 will energize.
14
DirectSOFT32 Handheld Programmer Keystrokes A
$ B ENT
X1 Y2

OR OUTI O
STR

INST#
D
3
F
1

5
A
0
ENT ENT
B
X4 Y2

OR OUTI $
C
2
ENT

E ENT
C
STR 4
O
INST#
D
3
F
5
A
0
ENT ENT D
C ENT
2

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–33


Chapter 5: Standard RLL Instructions - Immediate Instructions

Set Immediate (SETI)


1 The Set Immediate instruction immediately sets, or
turns on an output or a range of outputs in the image
2 register and the corresponding output point(s) at the
time the instruction is executed. Once the outputs are
Y aaa
SETI
aaa

set it is not necessary for the input to remain on. The


3 Reset Immediate instruction can be used to reset the
outputs.
4 Reset Immediate (RSTI)
The Reset Immediate instruction immediately resets,
5 or turns off an output or a range of outputs in the
Y aaa aaa
image register and the output point(s) at the time the
RSTI
6 instruction is executed. Once the outputs are reset it is
not necessary for the input to remain on.
7 Operand Data Type DL05 Range
aaa
8 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
In the following example, when X1 is on, Y2 through Y5 will be set on in the image register
9 and on the corresponding output points.

10 DirectSOFT32 Handheld Programmer Keystrokes

$ B ENT
X1 Y2 Y5
11 SETI X
STR

SHFT I
1
C F ENT
SET 8 2 5

12
13
In the following example, when X1 is on, Y5 through Y22 will be reset (off ) in the image
14 register and on the corresponding output module(s).

A DirectSOFT32
Handheld Programmer Keystrokes
X1 Y5 Y22

B RSTI
$

S
STR

SHFT
B

I
1
ENT

F C C ENT
RST 8 5 2 2

C
D

5–34 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Timer, Counter and Shift Register Instructions 1


Using Timers
Timers are used to time an event for a desired length of time. The single input timer will time 2
as long as the input is on. When the input changes from on to off the timer current value is
reset to 0. There is a tenth of a second and a hundredth of a second timer available with a 3
maximum time of 999.9 and 99.99 seconds respectively. There is a discrete bit associated with
each timer to indicate that the current value is equal to or greater than the preset value. The
timing diagram below shows the relationship between the timer input, associated discrete bit,
4
current value, and timer preset.
5
Seconds
X1
6
0 1 2 3 4 5 6 7 8 TMR T1
X1

Timer Preset
K30
7
T1
T1 Y0
OUT
8
Current 0 10 20 30 40 50 60 0
Value 1/10 Seconds
9
There are those applications that need an accumulating timer, meaning it has the ability to 10
time, stop, and then resume from where it previously stopped. The accumulating timer works
similarly to the regular timer, but two inputs are required. The start/stop input starts and
stops the timer. When the timer stops, the elapsed time is maintained. When the timer starts
11
again, the timing continues from the elapsed time. When the reset input is turned on, the
elapsed time is cleared and the timer will start at 0 when it is restarted. There is a tenth of a 12
second and a hundredth of a second timer available with a maximum time of 9999999.9 and
999999.99 seconds respectively. The timing diagram below shows the relationship between
the timer input, timer reset, associated discrete bit, current value, and timer preset.
13
14
0 1 2 3
Seconds
4 5 6 7 8 X1
TMRA T0
A
K30
X1 Enable

X2
B
X2

Reset Input
C
T0

Current
Value
0 10 10 20 30 40 50 0 D
1/10 Seconds

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–35


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Timer (TMR) and Timer Fast (TMRF)


1 The Timer instruction is a 0.1 second single input timer that
times to a maximum of 999.9 seconds. The Timer Fast TMR T aaa

2 instruction is a 0.01 second single input timer that times up


to a maximum of 99.99 seconds. These timers will be
B bbb

enabled if the input logic is true (on) and will be reset to 0 if


3 the input logic is false (off ).
Preset Timer#

Instruction Specifications
4 Timer Reference (Taaa): Specifies the timer number. TMRF
B bbb
T aaa

Preset Value (Bbbb): Constant value (K) or a V-memory


5 location. Preset Timer#
Current Value: Timer current values are accessed by
6 referencing the associated V or T memory location*. For The timer discrete status bit and the
example, the timer current value for T3 physically resides current value are not specified in the
7 in V-memory location V3. timer instruction

Discrete Status Bit: The discrete status bit is referenced by


8 the associated T memory location. Operating as a “timer
done bit”, it will be on if the current value is equal to or
greater than the preset value. For example, the discrete
9 status bit for Timer 2 is TA2.

10 NOTE: Timer preset constants (K) may be changed by using a handheld programmer, even when the CPU
is in Run Mode. Therefore, a V-memory preset is required only if the ladder program must change the
preset.
11 Operand Data Type DL05 Range
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
12 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177 ––

V-memory for preset values . . . . . . . . . . . . . . . V –– 1200–7377


13 7400–7577
1200–7377
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P –– 7400–7577
14 Constants (preset only) . . . . . . . . . . . . . . . . . . K –– 0–9999
Timer discrete status bits . . . . . . . . . . . . . . . T/V 0–177 or V41100–41107
A Timer current values . . . . . . . . . . . . . . . . . . V /T* 0–177

NOTE: * With the HPP, both the Timer discrete status bits and current value are accessed with the same
B data reference. DirectSOFT32 uses separate references, such as “T2” for discrete status bit for Timer T2,
and “TA2” for the current value of Timer T2.

C You can perform functions when the timer reaches the specified preset using the discrete
status bit. Or, use comparative contacts to perform functions at different time intervals, based
D on one timer. The examples on the following page show these two methods of programming
timers.

5–36 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Timer Example Using Discrete Status Bits


In the following example, a single input timer is used with a preset of 3 seconds. The timer 1
discrete status bit (T2) will turn on when the timer has timed for 3 seconds. The timer is reset
when X1 turns off, turning the discrete status bit off and resetting the timer current value to
0.
2
3
Direct SOFT32

X1
TMR T2 0 1 2 3
Timing Diagram
Seconds
4 5 6 7 8
4
K30

T2 Y0

OUT
X1
5
T2

Handheld Programmer Keystrokes


Y0 6
Current 0 10 20 30 40 50 60 0
$ B ENT Value

N
TMR
STR
C
1

2
D
3
A
0
ENT 7
$ SHFT T C ENT

GX
OUT
STR
A
0
MLR

ENT
2

8
Timer Example Using Comparative Contacts
In the following example, a single input timer is used with a preset of 4.5 seconds.
9
Comparative contacts are used to energize Y3, Y4, and Y5 at one second intervals respectively.
When X1 is turned off the timer will be reset to 0 and the comparative contacts will turn off 10
Y3, Y4, and Y5.
Direct SOFT32 Timing Diagram 11
X1 Seconds
TMR T20

TA20 K10
K45

Y3 X1
0 1 2 3 4 5 6 7 8

12
OUT

TA20 K20 Y4
Y3

Y4
13
OUT

TA20 K30 Y5
OUT
Y5

T2
14
0 10 20 30 40 50 60 0

A
Current
Value

Handheld Programmer Keystrokes

$ B

N
TMR
STR
C
1

2
ENT

A
0
E
4
F
5
ENT
B
$ SHFT T C A B A ENT

GX
OUT
STR
D
3
MLR

ENT
2 0 1 0

C
$ SHFT T C A C A ENT

D
STR MLR 2 0 2 0
GX E ENT
OUT 4
$ SHFT T C A D A ENT
STR MLR 2 0 3 0
GX F ENT
OUT 5

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–37


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Accumulating Timer (TMRA)


1 The Accumulating Timer is a 0.1 second two input timer that
Enable TMRA
B bbb
T aaa

will time to a maximum of 9999999.9. Reset


2 Accumulating Fast Timer (TMRAF)
The Accumulating Fast Timer is a 0.01 second two-input Timer#
3 timer that will time to a maximum of 99999.99. Each one uses
Preset

two timer registers in V-memory. These timers have two inputs,


4 an enable and a reset. The timer starts timing when the enable
is on and stops when the enable is off (without resetting the
Enable TMRAF T aaa
count). The reset will reset the timer when on and allow the
5 timer to time when off.
Reset
B bbb

Instruction Specifications
6 Timer Reference (Taaa): Specifies the timer number.
Preset Timer#
Preset Value (Bbbb): Constant value (K) or a V-memory
7 location.
Current Value: Timer current values are accessed by The timer discrete status bit
8 referencing the associated V or T memory location*. For and the current value are not
specified in the timer
example, the timer current value for T3 resides in V-memory
instruction
9 location V3.
Discrete Status Bit: The discrete status bit is accessed by
10 referencing the associated T memory location. Operating as a
“timer done bit” ,it will be on if the current value is equal to or
greater than the preset value. For example the discrete status bit for timer 2 would be T2.
11 NOTE: The accumulating type timer uses two consecutive V-memory locations for the 8-digit value, and
therefore two consecutive timer locations. For example, if TMR 1 is used, the next available timer
12 number is TMR 3.

13 Operand Data Type


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa
DL05 Range
bbb
Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–176 ––
14 V-memory for preset values . . . . . . . . . . . . . . . V –– 1200–7377/7400–7577
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P –– 1200–7377/7400–7577
A Constants (preset only) . . . . . . . . . . . . . . . . . . K
Timer discrete status bits . . . . . . . . . . . . . . . T/V
–– 0–99999999
0–176 or V41100–41107
Timer current values . . . . . . . . . . . . . . . . . . V /T* 0–176
B NOTE: * With the HPP, both the Timer discrete status bits and current value are accessed with the same

C data reference. DirectSOFT32 uses separate references, such as “T2” for discrete status bit for Timer
T2, and “TA2” for the current value of Timer T2.

D The following examples show two methods of programming timers. One performs functions
when the timer reaches the preset value using the discrete status bit, or use comparative
contacts to perform functions at different time intervals.

5–38 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Accumulating Timer Example using Discrete Status Bits


In the following example, a two input timer (accumulating timer) is used with a preset of 3 1
seconds. The timer discrete status bit (T6) will turn on when the timer has timed for 3
seconds. Notice in this example that the timer times for 1 second , stops for one second, then
resumes timing. The timer will reset when C10 turns on, turning the discrete status bit off
2
and resetting the timer current value to 0.
Direct SOFT32 Timing Diagram
3
X1
TMRA T6

X1
0 1 2 3
Seconds
4 5 6 7 8
4
K30
C10
C10
5
Y7 T6
T6
OUT Current
Value
0 10 10 20 30 40 50 0
6
Handheld Programmer Keystrokes Handheld Programmer Keystrokes (cont)

$
STR
B
1
ENT D
3
A
0
ENT 7
$ SHFT C B A ENT $ SHFT T G ENT
STR 2 1 0 STR MLR 6
N
TMR
SHFT A
0
G
6
GX
OUT
B
1
A
0
ENT 8
Accumulator Timer Example Using Comparative Contacts
9
In the following example, a single input timer is used with a preset of 4.5 seconds.
Comparative contacts are used to energized Y3, Y4, and Y5 at one second intervals 10
respectively. The comparative contacts will turn off when the timer is reset.
Contacts
11
Direct SOFT32 Timing Diagram
X1
TMRA

K45
T20

X1
0 1 2 3
Seconds
4 5 6 7 8
12
C10

Y3
C10

Y3
13
TA20 K10

TA20 K20
OUT

Y4
Y4

Y5
14
OUT

TA20 K30 Y5
Current
T20

0 10 10 20 30 40 50 0
A
OUT Value

Handheld Programmer Keystrokes

$ B
Handheld Programmer Keystrokes (cont)

GX E
B
ENT ENT
STR 1 OUT 4

N
STR

SHFT
SHFT

A
C
2
B

C
1
A

A
0
ENT

E F ENT
$

D
STR
A
SHFT

ENT
T
MLR
C
2
A
0 C
TMR 0 2 0 4 5 3 0

GX
OUT
STR
SHFT

D
3
T
MLR

ENT
C
2
A
0
B
1
A
0
ENT
GX
OUT
F
5
ENT
D
$ SHFT T C A C A ENT
STR MLR 2 0 2 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–39


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Using Counters
1 Counters are used to count events . The counters available are up counters, up/down
counters, and stage counters (used with RLLPLUS programming).
2 The up counter has two inputs, a count input and a reset input. The maximum count value is
9999. The timing diagram below shows the relationship between the counter input, counter
3 reset, associated discrete bit, current value, and counter preset.

4 X1
X1

Up
CNT
K3
CT1

X2
X2
5 CT1
Reset

6 Current
alue
1 2
Counts
3 4 0 Counter preset

7 The up down counter has three inputs, a count up input, count down input and reset input.
The maximum count value is 99999999. The timing diagram below shows the relationship
8 between the counter input, counter reset, associated discrete bit, current value, and counter
preset.
9
X1
UDC CT2
10 X1

X2
Up K3

X2

11 X3
X3
Down

12 CT2
Current
Value
1 2 1
Counts
2 3 0
Reset

Counter Preset
13 The stage counter has a count input and is reset by the RST instruction. This instruction is
useful when programming using the RLLPLUS structured programming. The maximum count
14 value is 9999. The timing diagram below shows the relationship between the counter input,
associated discrete bit, current value, counter preset and reset instruction.
A
B X1 X1
SGCNT CT2
K3

C CT2

Current 1 2 3 4 0
Value Counts Counter preset
D RST
CT2

5–40 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Counter (CNT)
The Counter is a two input counter that increments Counter# 1
when the count input logic transitions from off to on.
When the counter reset input is on the counter resets
to 0. When the current value equals the preset value,
Count CNT
B bbb
CT aaa 2
the counter status bit comes on and the counter
continues to count up to a maximum count of 9999.
Reset 3
The maximum value will be held until the counter is
reset. Preset 4
Instruction Specifications The counter discrete status bit and the
Counter Reference (CTaaa): Specifies the counter current value are not specified in the
counter instruction.
5
number.
Preset Value (Bbbb): Constant value (K) or a 6
V-memory location.
Current Values: Counter current values are accessed by referencing the associated V or CT
memory locations*. The V-memory location is the counter location + 1000. For example, the
7
counter current value for CT3 resides in V-memory location V1003.
Discrete Status Bit: The discrete status bit is accessed by referencing the associated CT
8
memory location. It will be on if the value is equal to or greater than the preset value. For
example the discrete status bit for counter 2 would be CT2. 9
NOTE: Counter preset constants (K) may be changed by using a programming device, even when the CPU
is in Run Mode. Therefore, a V-memory preset is required only if the ladder program must change the
10
preset.

Operand Data Type DL05 Range


11
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177 –– 12
1200–7377
V-memory (preset only) . . . . . . . . . . . . . . . . . . V –– 7400–7577 13
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P –– 1200–7377

Constants (preset only) . . . . . . . . . . . . . . . . . . K ––


7400–7577
0–9999
14
Counter discrete status bits . . . . . . . . . . . . CT/V 0–177 or V41140–41147
Counter current values . . . . . . . . . . . . . . . V /CT* 0–177 A
NOTE: * With the HPP, both the Counter discrete status bits and current value are accessed with the same
data reference. DirectSOFT32 uses separate references, such as “CT2” for discrete status bit for Counter
CT2, and “CTA2” for the current value of Counter CT2.
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–41


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Counter Example Using Discrete Status Bits


1 In the following example, when X1 makes an off to on transition, counter CT2 will
increment by one. When the current value reaches the preset value of 3, the counter status bit
2 CT2 will turn on and energize Y7. When the reset C10 turns on, the counter status bit will
turn off and the current value will be 0. The current value for counter CT2 will be held in
V-memory location V1002.
3
DirectSOFT32 Counting diagram

4 X1
CNT CT2
X1

5 C10
K3

C10

CT2 or

6 CT2 Y7

OUT
Y7
Current Value 1 2 3 4 0

7 Handheld Programmer Keystrokes

$
STR
B
1
ENT
Handheld Programmer Keystrokes (cont)

$
STR
SHFT C
2
SHFT T
MLR
C
2
ENT

8 $

GY
CNT
STR
SHFT

C
2
C
2
B

D
1

3
A

ENT
0
ENT GX
OUT
B
1
A
0
ENT

9 Counter Example Using Comparative Contacts


In the following example, when X1 makes an off to on transition, counter CT2 will
10 increment by one. Comparative contacts are used to energize Y3, Y4, and Y5 at different
counts. When the reset C10 turns on, the counter status bit will turn off and the counter
11 current value will be 0, and the comparative contacts will turn off.

12 DirectSOFT32

X1
CNT CT2
Counting diagram

X1

13 C10
K3

C10

CTA2 K1 Y3 Y3

14 OUT
Y4

CTA2 K2 Y4
Y5

A CTA2 K3
OUT

Y5
Current
Value
1 2 3 4 0

OUT

B Handheld Programmer Keystrokes Handheld Programmer Keystrokes (cont)

$ B ENT $ SHFT C SHFT T C

C
STR 1 STR 2 MLR 2
$ SHFT C B A ENT C ENT
STR 2 1 0 2
GY C D ENT GX E ENT
CNT 2 3 OUT 4

D $
STR
B
1
SHFT

ENT
C
2
SHFT T
MLR
C
2
$
STR
D
3
SHFT

ENT
C
2
SHFT T
MLR
C
2

GX D ENT GX F ENT
OUT 3 OUT 5

5–42 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Stage Counter (SGCNT)


The Stage Counter is a single input counter that 1
increments when the input logic transitions from off to Counter#
on. This counter differs from other counters since it will
hold its current value until reset using the RST SGCNT CT aaa
2
instruction. The Stage Counter is designed for use in
RLLPLUS programs but can be used in relay ladder logic
B bbb
3
programs. When the current value equals the preset Preset
value, the counter status bit turns on and the counter
continues to count up to a maximum count of 9999. The counter discrete status bit and the
4
current value are not specified in the
The maximum value will be held until the counter is
reset. counter instruction. 5
Instruction Specifications
Counter Reference (CTaaa): Specifies the counter number.
6
Preset Value (Bbbb): Constant value (K) or a V-memory location.
Current Values: Counter current values are accessed by referencing the associated V or CT
7
memory locations*. The V-memory location is the counter location + 1000. For example, the
counter current value for CT3 resides in V-memory location V1003. 8
Discrete Status Bit: The discrete status bit is accessed by referencing the associated CT
memory location. It will be on if the value is equal to or greater than the preset value. For 9
example the discrete status bit for counter 2 would be CT2.
Operand Data Type DL05 Range 10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177 –– 11
V-memory (preset only) . . . . . . . . . . . . . . . . . . V –– 1200–7377
7400–7577
1200–7377
12
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P –– 7400–7577
Constants (preset only) . . . . . . . . . . . . . . . . . . K –– 0–9999 13
Counter discrete status bits . . . . . . . . . . . . CT/V 0–177 or V41140–41147
Counter current values . . . . . . . . . . . . . . . V /CT* 1000–1177 14
NOTE: * With the HPP, both the Counter discrete status bits and current value are accessed with the same
data reference. DirectSOFT32 uses separate references, such as “CT2” for discrete status bit for Counter A
CT2, and “CTA2” for the current value of Counter CT2.
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–43


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Stage Counter Example Using Discrete Status Bits


1 In the following example, when X1 makes an off to on transition, stage counter CT7 will
increment by one. When the current value reaches 3, the counter status bit CT7 will turn on
2 and energize Y7. The counter status bit CT7 will remain on until the counter is reset using
the RST instruction. When the counter is reset, the counter status bit will turn off and the
counter current value will be 0. The current value for counter CT7 will be held in V-memory
3 location V1007.

4 DirectSOFT32 Counting diagram


X1
SGCNT CT7

5 CT7
K3

Y7
X1

Y7
OUT Current 1 2 3 4 0

6 C5 CT7
RST
Value

RST
CT7

7 Handheld Programmer Keystrokes

$
STR
B
1
ENT
Handheld Programmer Keystrokes (cont)

GX
OUT
B
1
A
0
ENT

S G GY $ C F

8 SHFT

H
7
RST
SHFT

D
3
6

ENT
SHFT
CNT
S
RST
STR
SHFT

SHFT C
2

2
SHFT
5
ENT

T
MLR
H
7
ENT

$ SHFT C SHFT T H ENT

9 STR 2 MLR 7

Stage Counter Example Using Comparative Contacts


10 In the following example, when X1 makes an off to on transition, counter CT2 will
increment by one. Comparative contacts are used to energize Y3, Y4, and Y5 at different
11 counts. Although this is not shown in the example, when the counter is reset using the Reset
instruction, the counter status bit will turn off and the current value will be 0. The current
value for counter CT2 will be held in V-memory location V1002.
12 DirectSOFT32 Counting diagram
X1

13 SGCNT
K10
CT2

X1

CT2 K1 Y3

14
Y3
OUT

Y4
CT2 K2 Y4

A
OUT
Y5

Y5 Current 1 2 3 4 0
CT2 K3
Value
OUT

B Handheld Programmer Keystrokes


RST
CT2

Handheld Programmer Keystrokes (cont)

$ B $ C T C

C
ENT SHFT SHFT
STR 1 STR 2 MLR 2

SHFT S G SHFT GY C ENT


RST 6 CNT 2
C B A ENT GX E ENT

D
2 1 0 OUT 4
$ SHFT C SHFT T C $ SHFT C SHFT T C
STR 2 MLR 2 STR 2 MLR 2
B ENT D ENT
1 3
GX D ENT GX F ENT
OUT 3 OUT 5

5–44 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Up Down Counter (UDC) 1


This Up/Down Counter counts up on each off to on
transition of the Up input and counts down on each
off to on transition of the Down input. The counter Up UDC
B bbb
CT aaa 2
is reset to 0 when the Reset input is on. The count
range is 0–99999999. The count input not being
used must be off in order for the active count input
Down
Counter # 3
to function.
Instruction Specification
Reset
Preset
4
Counter Reference (CTaaa): Specifies the counter
number.
Caution: The UDC uses two
V-memory locations for the 8 digit
5
current value. This means that the
Preset Value (Bbbb): Constant value (K) or two
consecutive V-memory locations.
UDC uses two consecutive
counter locations. If UDC CT1 is
6
Current Values: Current count is a double word value used in the program, the next
accessed by referencing the associated V or CT available counter is CT3. 7
memory locations*. The V-memory location is the The counter discrete status bit and
counter location + 1000. For example, the counter
current value for CT5 resides in V-memory location
the current value are not specified in 8
the counter instruction
V1005 and V1006.
Discrete Status Bit: The discrete status bit is accessed by
9
referencing the associated CT memory location.
Operating as a “counter done bit” it will be on if the 10
value is equal to or greater than the preset value. For
example the discrete status bit for counter 2 would be CT2. 11
Operand Data Type DL05 Range
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb 12
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–176 ––

V-memory (preset only) . . . . . . . . . . . . . . . . . . V –– 1200–7377


7400–7577
13
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P –– 1200–7377
7400–7577
14
Constants (preset only) . . . . . . . . . . . . . . . . . . K –– 0–99999999
Counter discrete status bits . . . . . . . . . . . . CT/V 0–176 or V41140–41147 A
Counter current values . . . . . . . . . . . . . . . V /CT* 0–176

NOTE: * With the HPP, both the Counter discrete status bits and current value are accessed with the same B
data reference. DirectSOFT32 uses separate references, such as “CT2” for discrete status bit for Counter
CT2, and “CTA2” for the current value of Counter CT2. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04


5–45
Chapter 5: Standard RLL Instructions

Up / Down Counter Example Using Discrete Status Bits


1 In the following example if X2 and X3 are off ,when X1 toggles from off to on the counter
will increment by one. If X1 and X3 are off the counter will decrement by one when X2
2 toggles from off to on. When the count value reaches the preset value of 3, the counter status
bit will turn on. When the reset X3 turns on, the counter status bit will turn off and the
current value will be 0.
3
DirectSOFT32 Counting Diagram

4 X1
UDC
K3
CT2
X1
X2

5 X3
X2

X3

6 CT2 Y7
CT2

Current 1 2 1 2 3 0
OUT Value

7 Handheld Programmer Keystrokes

$ B
Handheld Programmer Keystrokes (cont)

D
ENT ENT
STR 1 3

8 $

$
STR
C

D
2
ENT

ENT
$

GX
STR
SHFT

B
C

A
2
SHFT

ENT
T
MLR
C
2
ENT

STR 3 OUT 1 0

9 SHFT U
ISG
D
3
C
2
C
2

10 Up / Down Counter Example Using Comparative Contacts


11 In the following example, when X1 makes an off to on transition, counter CT2 will
increment by one. Comparative contacts are used to energize Y3 and Y4 at different counts.
When the reset (X3) turns on, the counter status bit will turn off, the current value will be 0,
12 and the comparative contacts will turn off.
DirectSOFT32 Counting Diagram
X1

13 X2
UDC
V2000
CT2
X1

X2

14 X3
X3

A CTA2 K1 Y3 Y3
OUT

Y4

CTA2 K2 Y4 1 2 3 4 0
Current

B Handheld Programmer Keystrokes


OUT
Value

Handheld Programmer Keystrokes (cont)

C $

$
STR

STR
B

C
1

2
ENT

ENT GX
OUT
B
1
ENT

D
3
ENT

$ D $ C T C

D STR

SHFT U
ISG
D
3

3
ENT

C
2
C
2
STR
C
2
SHFT

ENT
2
SHFT
MLR 2

SHFT V C A A A ENT GX E ENT


AND 2 0 0 0 OUT 4
$ SHFT C SHFT T C
STR 2 MLR 2

5–46 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Timer, Counter and Shift Register Instructions

Shift Register (SR)


The Shift Register instruction shifts data through a
SR
1
predefined number of control relays. The control ranges DATA
in the shift register block must start at the beginning of
an 8 bit boundary use 8-bit blocks.
From A aaa 2
CLOCK
The Shift Register has three contacts.
To B bbb
3
• Data — determines the value (1 or 0) that will enter the
RESET
register
• Clock — shifts the bits one position on each low to high
4
transition
• Reset —resets the Shift Register to all zeros. 5
With each off to on transition of the clock input, the bits which make up the shift register
block are shifted by one bit position and the status of the data input is placed into the starting 6
bit position in the shift register. The direction of the shift depends on the entry in the From
and To fields. From C0 to C17 would define a block of sixteen bits to be shifted from left to
right. From C17 to C0 would define a block of sixteen bits, to be shifted from right to left.
7
The maximum size of the shift register block depends on the number of available control
relays. The minimum block size is 8 control relays. 8
Operand Data Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa
DL05 Range
bbb
9
Control Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777 0–777
10
Direct SOFT32 Handheld Programmer Keystrokes

X1
Data Input SR
$
STR
B
1
ENT 11
$ C

X2
Clock Input
From C0
$
STR

STR
D
2

3
ENT

ENT
12
X3
Reset Input
To C17 SHFT S

B
RST
SHFT

H
R
ORN
SHFT A
0 13
ENT
1 7

Inputs on Successive Scans Shift Register Bits


14
1 0-1-0 0
C0 C17 A
0
0
0-1-0
0-1-0
0
0
B
1 0-1-0 0 C
0 0-1-0 0
0 0 1 D
Indicates Indicates
ON OFF

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–47


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

1 Accumulator/Stack Load and Output Data Instructions


Using the Accumulator
2 The accumulator in the DL05 internal CPUs is a 32 bit register which is used as a temporary
storage location for data that is being copied or manipulated in some manor. For example,
3 you have to use the accumulator to perform math operations such as add, subtract, multiply,
etc. Since there are 32 bits, you can use up to an 8-digit BCD number. The accumulator is
4 reset to 0 at the end of every CPU scan.
Copying Data to the Accumulator
5 The Load and Out instructions and their variations are used to copy data from a V-memory
location to the accumulator, or, to copy data from the accumulator to V-memory. The
following example copies data from V-memory location V2000 to V-memory location
6 V2010.
V2000

7 X1 LD
V2000
8 9 3 5

Unused accumulator bits


8 Copy data from V2000 to the
lower 16 bits of the accumu-
lator
are set to zero

Acc. 0 0 0 0 88 99 33 55

9
OUT

10 V2010

Copy data from the lower 16 bits


8 9 3

V2010
5

of the accumulator to V2010

11 Since the accumulator is 32 bits and V-memory locations are 16 bits the Load Double and
Out Double (or variations thereof ) use two consecutive V-memory locations or 8 digit BCD
12 constants to copy data either to the accumulator from a V-memory address or from a
V-memory address to the accumulator. For example if you wanted to copy data from V2000
13 and V2001 to V2010 and V2011 the most efficient way to perform this function would be as
follows:

14 X1
LDD
V2000 6
V2001
7 3 9 5
V2000
0 2 6

A Copy data from V2000 and


V2001 to the accumulator

Acc. 6 7 3 9 55 00 22 66
B
OUTD
C V2010 6 7 3 9 5 0 2 6
Copy data from the accumulator to
V2011 V2010
D V2010 and V2011

5–48 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Changing the Accumulator Data


Instructions that manipulate data also use the accumulator. The result of the manipulated 1
data resides in the accumulator. The data that was being manipulated is cleared from the
accumulator. The following example loads the constant value 4935 into the accumulator,
shifts the data right 4 bits, and outputs the result to V2010.
2
3
X1 LD
K4935
Constant 4 9 3 5
4
Load the value 4935 into the
accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0
8
1
7
0
6 5
0 1
4 3
1 0
2
1
1
0
0
1
5
The upper 16 bits of the accumulator
will be set to 0

Shifted out of
accumulator
6
SHFR 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
7
K4 Acc. 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1

Shift the data in the accumulator


4 bits (K4) to the right
8
OUT
V2010
9
0 4 9 3
Output the lower 16 bits of the ac-
cumulator to V2010 V2010 10
11
Some of the data manipulation instructions use 32 bits. They use two consecutive V-memory
locations or an 8 digit BCD constant to manipulate data in the accumulator. 12
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is added
with the value in V2006 and V2007 using the Add Double instruction. The value in the
13
accumulator is copied to V2010 and V2011 using the Out Double instruction.
V2001 V2000
14
X1 6 7 3 9 5 0 2 6
LDD
V2000

Load the value in V2000 and


A
V2001 into the accumulator

ADDD
V2006
+ 2
6 7
0
3
0
9
0
5
4
0
0
2
4
6
6
(Accumulator)

(V2006&V2007)
B
Acc. 8 7 3 9 9 0 7 2
Add the value in the
accumulator with the value
in V2006 and V2007 C
OUTD
V2010

Copy the value in the


8 7 3

V2011
9 9 0

V2010
7 2
D
accumulator to V2010 and
V2011

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–49


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Using the Accumulator Stack


1 The accumulator stack is used for instructions that require more than one parameter to
execute a function or for user defined functionality. The accumulator stack is used when more
2 than one Load instruction is executed without the use of an Out instruction. The first load
instruction in the scan places a value into the accumulator. Every Load instruction thereafter
without the use of an Out instruction places a value into the accumulator and the value that
3 was in the accumulator is placed onto the accumulator stack. The Out instruction nullifies
the previous load instruction and does not place the value that was in the accumulator onto
4 the accumulator stack when the next load instruction is executed. Every time a value is placed
onto the accumulator stack the other values in the stack are pushed down one location. The
5 accumulator is eight levels deep (eight 32 bit registers). If there is a value in the eighth
location when a new value is placed onto the stack, the value in the eighth location is pushed
off the stack and cannot be recovered.
6
X1 LD Constant 3 2 4 5

7 K3245

Load the value 3245 into the


accumulator
Current Acc. value

Acc. 0 0 0 0 3 2 4 5
Level 1 X
Accumulator Stack

X X X X X X X
Previous Acc. value X X X X X X X

8 Acc. X X X X X
X X X X
Level 2
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Level 5 X X X X X X X X

9 LD
Constant 5 1 5 1
Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X

K5151 Level 8 X X X X X X X X
Current Acc. value

10 Load the value 5151 into the


accumulator, pushing the value
3245 onto the stack
Acc. 0 0 0

Previous Acc. value


0 55 1 5 1
Accumulator Stack
Bucket

Acc. 0 0 0 0 33 22 44 55 Level 1 0 0 0 0 3 2 4 5

11 Level 2
Level 3
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Level 4 X X X X X X X X

12 Level 5
Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Constant 6 3 6 3
LD

13
Level 8 X X X X X X X X
K6363 Current Acc. value

Acc. 0 0 0 0 66 33 66 33
Load the value 6363 into the Bucket
accumulator, pushing the value Previous Acc. value Accumulator Stack

14 5151 to the 1st stack location


and the value 3245 to the
2nd stack location
Acc. 0 0 0 0 55 1 5 1 Level 1
Level 2
0
0
0
X
0
0
0
X
0 0 5
0 0 3 2 4 5
0 0
X X X X X X
1 5 1

Level 3

A Level 4
Level 5
Level 6
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Level 7 X X X X X X X X

B Level 8 X X X X X X X X

Bucket

C
The POP instruction rotates values upward through the stack into the accumulator. When a
D POP is executed the value which was in the accumulator is cleared and the value that was on
top of the stack is in the accumulator. The values in the stack are shifted up one position in
the stack.

5–50 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

X1 POP Previous Acc. value


1
Acc. X X X X XX XX XX X

POP the 1st value on the stack into the


accumulator and move stack values
up one location
Current Acc. value

Acc. 0 0 0 0 44 55 4 5 Level 1 0
Accumulator Stack

0 0 0 3 7 9 2
2
Level 2 0 0 0 0 7 9 3 0
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
3
Level 5 X X X X X X X X
OUT
V2000

Copy data from the accumulator to


V2000 4 5 4 5 Level 6
Level 7
Level 8
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
4
V2000

POP Previous Acc. value


5
Acc. 0 0 0 0 44 55 44 55

POP the 1st value on the stack into the


accumulator and move stack values
up one location
Current Acc. value

Acc. 0 0 0 0 33 77 99 22 Level 1 0
Accumulator Stack

0 0 0 7 9 3 0
6
Level 2 X X X X X X X X
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X 7
Level 5 X X X X X X X X
OUT
V2001

Copy data from the accumulator to


V2001 3 7 9 2 Level 6
Level 7
Level 8
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
8
V2001.

POP
Previous Acc. value

Acc. 0 0 0 0 33 47 69 02
9
POP the 1st value on the stack into the
accumulator and move stack values
up one location
Current Acc. value

Acc. X X X X 77 99 33 00 Level 1
Level 2
X
X
Accumulator Stack

X
X
X
X
X
X
X
X
X
X
X
X
X
X
10
X X X X X X X X

11
Level 3
Level 4 X X X X X X X X
Level 5 X X X X X X X X
OUT V2002 7 9 3 0 Level 6 X X X X X X X X
V2002

Copy data from the accumulator to


V2002
Level 7
Level 8
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
12
13
Using Pointers
Many of the DL05 series instructions will allow V-memory pointers as a operand (commonly 14
known as indirect addressing). Pointers allow instructions to obtain data from V-memory
locations referenced by the pointer value. A
NOTE: DL05 V-memory addressing is in octal. However, the pointers reference a V-memory location with
values viewed as HEX. Use the Load Address (LDA) instruction to move an address into the pointer
location. This instruction performs the Octal to Hexadecimal conversion automatically.
B
In the following simple example we are using a pointer operand in a Load instruction. C
V-memory location 2000 is being used as the pointer location. V2000 contains the value 440
which the CPU views as the Hex equivalent of the Octal address V-memory location V2100.
The CPU will copy the data from V2100 which in this example contains the value 2635 into
D
the lower word of the accumulator.

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–51


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

1
X1 V2076 X X X X
LD

2 P2000

V2000 (P2000) contains the value 440


V2077
V2100
X
2
X
6 3
X X
5
V2101 X X X X
HEX. 440 HEX. = 2100 Octal which

3 contains the value 2635.


V2000
V2102
V2103
X
X
X
X
X
X
X
X
Accumulator
0 4 4 0 V2104 X X X X

4 OUT
V2105 X X X X
2 6 3 5

V2200

5 Copy the data from the lower 16 bits of


the accumulator to V2200. V2200 2 6 3 5
V2201 X X X X

6
7 The following example is identical to the one above with one exception. The LDA (Load
Address) instruction automatically converts the Octal address to Hex.
8
9
10 X1 LDA
O 2100
Load the lower 16 bits of the
accumulator with Hexadecimal
equivalent to Octal 2100 (440) 2 1 0 0

2100 Octal is converted to Hexadecim

11 Unused accumulator bits


are set to zero
440 and loaded into the accumulator

Acc. 0 0 0 0 00 44 44 00

12 OUT Copy the data from the lower 16 bits of


the accumulator to V2000 0 4 4 0
V 2000

13 V2000

14 V2076
V2077
X
X
X
X
X
X
X
X
V2100 2 6 3 5

A LD V2000 (P2000) contains the value 440


Hex. 440 Hex. = 2100 Octal which V2101 X X X X
P 2000 contains the value 2635
V2102 X X X X
V2100 V2103 X X X X

B 0 4 4 0 V2104
V2105
X
X
X
X
X
X
X
X 0 0
Accumulator
0 0 22 66 33 55

C OUT
V 2200
Copy the data from the lower 16 bits of
the accumulator to V2200 V2200 2 6 3 5
V2201 X X X X

5–52 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions

Load (LD)
The Load instruction is a 16 bit instruction that loads the
LD
1
value (Aaaa), which is either a V-memory location or a 4
digit constant, into the lower 16 bits of the accumulator.
The upper 16 bits of the accumulator are set to 0.
A aaa
2
Operand Data Type
....................................A
DL05 Range
aaa
3
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All V mem. (See page 4–28)
4
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–FFFF

Discrete Bit Flags Description


5
SP53 on when the pointer is outside of the available range.
SP70 on when the value loaded into the accumulator
by any instruction is zero.
6
SP76 on when the result in the accumulator is negative.
7
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack. 8
In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator and output to V2010. 9
Direct SOFT32
X1 LD 8
V2000
9 3 5
10
V2000

Load the value in V2000 into


the lower 16 bits of the
The unused accumulator
bits are set to zero
11
accumulator
Acc. 0 0 0 0 88 99 33 55

OUT
12
V2010

Copy the value in the lower


16 bits of the accumulator to
8 9 3 5 13
V2010
V2010

Handheld Programmer Keystrokes


14
$
STR
L
B

D
1
X
SET A
SHFT
ANDST 3
C
2
A
0
A
0
A
0
ENT
B
GX
OUT
SHFT V
AND
C
2
A
0
B
1
A
0
ENT
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–53


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Load Double (LDD)


1 The Load Double instruction is a 32 bit instruction that loads LDD
the value (Aaaa), which is either two consecutive V-memory A aaa
2 locations or an 8 digit constant value, into the accumulator.
Operand Data Type DL05 Range
3 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
4 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All V mem. (See page 4–28)
0–FFFF

5 Discrete Bit Flags Description


SP53 on when the pointer is outside of the available range.

6 SP70 on when the value loaded into the accumulator


by any instruction is zero.
SP76 on when the value loaded into the accumulator
by any instruction is zero.
7
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
8 accumulator stack.

In the following example, when X1 is on, the 32 bit value in V2000 and V2001 will be
9 loaded into the accumulator and output to V2010 and V2011.

10 Direct SOFT32
X1 LDD V2001 V2000
6 7 3 9 5 0 2 6

11 V2000

Load the value in V2000 and


V2001 into the 32 bit
accumulator

12 Acc. 6 7 3 9 65 00 22 66

13 OUTD
6 7 3 9 5 0 2 6

V2010 V2011 V2010

14 Copy the value in the 32 bit


accumulator to V2010 and
V2011

A Handheld Programmer Keystrokes

$ B ENT

B SHFT
STR
L
ANDST
D
1

3
D
3

C C

GX
2
A
0
A

D
0
A
0
ENT

SHFT
OUT 3

D C
2
A
0
B
1
A
0
ENT

5–54 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Load Formatted (LDF)


The Load Formatted instruction loads 1–32 1
consecutive bits from discrete memory locations into LDF A aaa
the accumulator. The instruction requires a starting
location (Aaaa) and the number of bits (Kbbb) to be
K bbb 2
loaded. Unused accumulator bit locations are set to
zero. 3
Operand Data Type DL05 Range
....................................A aaa bbb 4
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0–377 ––
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . .
Y
C
0–377
0–777
––
––
5
Stage Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377 ––
Timer Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177 –– 6
Counter Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177 ––
Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . .
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SP
K
0–777
––
––
1–32
7
SP70
Discrete Bit Flags Description
on when the value loaded into the accumulator by any instruction is zero.
8
SP76 on when the value loaded into the accumulator by any instruction is zero.
9
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack. 10
In the following example, when C0 is on, the binary pattern of C10–C16 (7 bits) will be
loaded into the accumulator using the Load Formatted instruction. The lower 7 bits of the 11
accumulator are output to Y0–Y6 using the Out Formatted instruction.
12
Direct SOFT32
C0 LDF
K7
C10
Location

C10
Constant

K7
C16 C15 C14 C13 C12 C11 C10
OFF OFF OFF ON ON ON OFF 13
Load the status of 7
consecutive bits (C10–C16) The unused accumulator bits are set to zero
into the accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 1
2
1
1
1
0
0
14
OUTF
K7
Y0 A
Location Constant Y6 Y5 Y4 Y3 Y2 Y1 Y0

B
Copy the value from the
specified number of bits in Y0 K7 OFF OFF OFF ON ON ON OFF
the accumulator to Y0 – Y6
Handheld Programmer Keystrokes

$ C A

SHFT
STR
L
ANDST
SHFT

D
3
F
2

5
0
ENT

C
SHFT C B A H ENT

GX
OUT
SHFT
2
F
1

5
0 7

D
A H ENT
0 7

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–55


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Load Address (LDA)


1 The Load Address instruction is a 16 bit instruction. It
converts any octal value or address to the HEX equivalent LDA

2 value and loads the HEX value into the accumulator. This
instruction is useful when an address parameter is required
O aaa

since all addresses for the DL05 system are in octal.


3
Operand Data Type DL05 Range
4 Octal Address . . . . . . . . . . . . . . . . . . . . . . . . . . O
aaa
All V mem. (See page 4–28)

5 Discrete Bit Flags Description


SP70 on when the value loaded into the accumulator by any instruction is zero.
6 SP76 on when the value loaded into the accumulator by any instruction is zero.

7 NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.

8 In the following example when X1 is on, the octal number 40400 will be converted to a HEX
4100 and loaded into the accumulator using the Load Address instruction. The value in the
lower 16 bits of the accumulator is copied to V2000 using the Out instruction.
9
10 Direct SOFT32
X1 LDA Octal Hexadecimal
O 40400 4 0 4 0 0 4 1 0 0

11 Load The HEX equivalent to


the octal number into the The unused accumulator
lower 16 bits of the bits are set to zero

12 accumulator
Acc. 0 0 0 0 4 1 0 0

13 4 1 0 0
OUT

14 V2000 V2000

Copy the value in lower 16


bits of the accumulator to
A V2000

Handheld Programmer Keystrokes


B $
STR
B
1
ENT

C SHFT L
ANDST
D
3
A
0
E A E A A ENT

D GX
OUT
4 0

SHFT
4
V
AND
0
C
0

2
A
0
A
0
A
0
ENT

5–56 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Out (OUT)
The Out instruction is a 16 bit instruction that copies the OUT 1
value in the lower 16 bits of the accumulator to a specified A aaa
V-memory location (Aaaa). 2
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
3
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V mem. (See page 4–28)

Discrete Bit Flags Description


4
SP53
In the following example, when X1 is on, the value in V2000 will be loaded into the lower 16
on when the pointer is outside of the available range.
5
bits of the accumulator using the Load instruction. The value in the lower 16 bits of the
accumulator are copied to V2010 using the Out instruction.V2000 6
Direct SOFT32 Handheld Programmer Keystrokes
X1 LD
V2000 8
V2000
9 3 5
$
STR
L
B

D
1
ENT
7
Load the value in V2000 into SHFT
ANDST 3
The unused accumulator

8
the lower 16 bits of the
accumulator bits are set to zero C A A A ENT
2 0 0 0
Acc. 0 0 0 0 88 99 33 55
OUT GX SHFT V C A B A ENT
OUT AND 2 0 1 0

9
V2010

Copy the value in the lower


16 bits of the accumulator to 8 9 3 5
V2010 V2010

10
Out Double (OUTD)
The Out Double instruction is a 32 bit instruction that
copies the value in the accumulator to two consecutive V
OUTD 11
A aaa
memory locations at a specified starting location (Aaaa).
Operand Data Type DL05 Range
12
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
13
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V mem. (See page 4–28)
Discrete Bit Flags Description 14
SP53 on when the pointer is outside of the available range.

In the following example, when X1 is on, the 32 bit value in V2000 and V2001 will be A
loaded into the accumulator using the Load Double instruction. The value in the
accumulator is output to V2010 and V2011 using the Out Double instruction. B
Direct SOFT32 V2001 V2000 Handheld Programmer Keystrokes

X1 LDD
V2000
6 7 3 9 5 0 2 6
$

SHFT
STR
L
B

D
1
D
ENT
C
Load the value in V2000 and ANDST 3 3
Acc. 6
D
V2001 into the accumulator 7 3 9 55 00 22 66
C A A A ENT
2 0 0 0
OUTD
GX SHFT D
V2010 OUT 3
Copy the value in the 6 7 3 9 5 0 2 6 C A B A ENT
accumulator to V2010 and V2011 V2010 2 0 1 0
V2011

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–57


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Out Formatted (OUTF)


1 The Out Formatted instruction outputs 1–32 bits from the
OUTF A aaa
accumulator to the specified discrete memory locations. The
2 instruction requires a starting location (Aaaa) for the
destination and the number of bits (Kbbb) to be output.
K bbb

3 Operand Data Type DL05 Range


....................................A aaa bbb
4 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0–377
0–377
––
––

5 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
0–777
––
––
1–32

6 In the following example, when C0 is on, the binary pattern of C10–C16 (7 bits) will be
loaded into the accumulator using the Load Formatted instruction. The lower 7 bits of the
7 accumulator are output to Y0–Y6 using the Out Formatted instruction.

8 Direct SOFT32
C0 LDF C10
Location Constant
C16 C15 C14 C13 C12 C11 C10
K7 C10 K7 OFF OFF OFF ON ON ON OFF

9 Load the status of 7


consecutive bits (C10–C16)
into the accumulator
The unused accumulator bits are set to zero

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

10 OUTF
K7
Y20
0 0 0
Accumulator
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0

Copy the value of the

11 specified number of bits


from the accumulator to
Y20–Y26 Location

Y0
Constant

K7
Y26 Y25 Y24 Y23 Y22 Y21 Y20
OFF OFF OFF ON ON ON OFF
Handheld Programmer Keystrokes

12 $
STR
SHFT C
2
A
0
ENT

SHFT L D F
ANDST 3 5

13 SHFT C
2
B
1
A
0
H
7
ENT

GX SHFT F
OUT 5

14 A
0
H
7
ENT

A
POP
B The POP instruction moves the value from the first level of the POP
accumulator stack (32 bits) to the accumulator and shifts each
C value in the stack up one level.

D Discrete Bit Flags Description


SP63 on when the result of the instruction causes the value in the accumulator to be zero.

5–58 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data

Pop Instruction Continued


In the example below, when C0 is on, the value 4545 that was on top of the stack is moved 1
into the accumulator using the Pop instruction The value is output to V2000 using the Out
instruction. The next Pop moves the value 3792 into the accumulator and outputs the value
to V2001. The last Pop moves the value 7930 into the accumulator and outputs the value to
2
V2002. Please note if the value in the stack were greater than 16 bits (4 digits) the Out
Double instruction would be used and two V-memory locations for each Out Double must 3
be allocated.
Direct SOFT32
C0
Previous Acc. value
4
POP
Acc. X X X X XX XX XX XX

Pop the 1st. value on the stack into the


accumulator and move stack values
Current Acc. value

Acc. 0 0 0 0 44 55 44 55 Level 1 0
Accumulator Stack

0 0 0 3 7 9 2
5
up one location Level 2 0
0 0
0 0 0 7 9 3 0

OUT
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
6
V2000 Level 5 X X X X X X X X

Copy the value in the lower 16 bits of


the accumulator to V2000
V2000 4 5 4 5 Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
7
Level 8 X X X X X X X X

POP
Previous Acc. value
8
Acc. 0 0 0 0 44 55 44 55
Pop the 1st. value on the stack into the
accumulator and move stack values
up one location
Current Acc. value

Acc. 0 0 0 0 3 7 9 2 Level 1 0
Accumulator Stack

0 0 0 7 9 3 0
9
Level 2 X X X X X X X X
OUT
V2001
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
10
Copy the value in the lower 16 bits of Level 5 X X X X X X X X
the accumulator to V2001 V2001 3 7 9 2 Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
11
POP Level 8 X X X X X X X X

Pop the 1st. value on the stack into the Previous Acc. value
12
accumulator and move stack values
up one location Acc. 0 0 0 0 3 7 9 2

OUT
Current Acc. value

Acc. 0 0 0 0 7 9 3 0 Level 1 X
Accumulator Stack

X X X X X X X
13
V2002 Level 2 X X X X X X X X

Copy the value in the lower 16 bits of


the accumulator to V2002
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
14
Level 5 X X X X X X X X

Handheld Programmer Keystrokes


V2002 7 9 3 0 Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
A
$ SHFT C A ENT Level 8 X X X X X X X X

B
STR 2 0

SHFT P SHFT O P ENT


CV INST# CV
GX SHFT V C A A A ENT
OUT

SHFT P
CV
SHFT O
AND

INST#
P
2

CV
ENT
0 0 0
C
GX V C A A B
OUT

SHFT P
CV
SHFT

SHFT O
AND

INST#
P
2

CV
ENT
0 0 1
ENT
D
GX SHFT V C A A C ENT
OUT AND 2 0 0 2

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–59


Chapter 5: Standard RLL Instructions - Logical Instructions

1 Logical Instructions (Accumulator)


And (AND)
2 The And instruction is a 16 bit instruction that logically ands the
value in the lower 16 bits of the accumulator with a specified AND

3 V-memory location (Aaaa). The result resides in the accumulator. A aaa

The discrete status flag indicates if the result of the And is zero.
4 Operand Data Type DL05 Range
....................................A aaa
5 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All (See page 4–28)

6 Discrete Bit Flags


SP63
Description
Will be on if the result in the accumulator is zero.

7 SP70 on when the value loaded into the accumulator by any instruction is zero.

NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the accumulator is anded with the value
9 in V2006 using the And instruction. The value in the lower 16 bits of the accumulator is
output to V2010 using the Out instruction.
10
11 Direct SOFT32
X1 LD
V2000
2
V2000
8 7 A

12 Load the value in V2000 into


the lower 16 bits of the
accumulator
The upper 16 bits of the accumulator
will be set to 0

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

13 AND
V2006 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

14 AND the value in the 6A38


accumulator with AND (V2006) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0
the value in V2006
Acc. 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0

A OUT
V2010
2 8 3 8
Copy the lower 16 bits of the
accumulator to V2010

B Handheld Programmer Keystrokes


V2010

$ B ENT
STR 1

C SHFT L
ANDST
D
3
C
2
A
0
A
0
A
0
ENT

V SHFT V C A A G ENT

D
AND AND 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0

5–60 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Logical Instructions

And Double (ANDD)


The And Double is a 32 bit instruction that logically ands the 1
value in the accumulator with two consecutive V-memory
locations or an 8 digit (max.) constant value (Aaaa). The
result resides in the accumulator. Discrete status flags indicate
ANDD
K aaa 2
if the result of the And Double is zero or a negative number
(the most significant bit is on). 3
Operand Data Type DL05 Range 4
aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All (See page 4–28)
5
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–FFFFFFFF
6
Discrete Bit Flags Description
SP63
SP70
Will be on if the result in the accumulator is zero.
Will be on if the result in the accumulator is negative
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is anded 9
with 36476A38 using the And double instruction. The value in the accumulator is output to
V2010 and V2011 using the Out Double instruction. 10
Direct SOFT32
X1 LDD 5
V2000
4 7 E 2
V2000
8 7 A
11
12
V2000

Load the value in V2000 and


V2001 into the accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

13
Acc. 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

ANDD
K36476A38 Acc. 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

AND the value in the


accumulator with
the constant value
36476A38
AND 36476A38

Acc.
0

0
0

0
1

0
1

0
1
0

0
1

1
1

0
0

0
0

0
1

0
1
0

0
0

0
0

0
1

0
1
1

1
0
1

0
0

0
1

0
1

1
0

0
1

1
0

0
1

0
0

0
0

0
0

0
1

1
1

1
1

1
0

0
0

0
0

0
14
OUTD
V2010 1 4 4 6 2 8 3 8
A
Copy the value in the
accumulator to V2010 and
V2011
V2011 V2010
B
Handheld Programmer Keystrokes
$
STR
B
1
ENT
C
SHFT

V
AND
L
ANDST

SHFT
D

D
3

3
D
3

SHFT
C

K
JMP
2
A

D
0

3
A

G
0

6
A

E
0

4
H
ENT

7
G
6
SHFT A
0
SHFT D
3
I
8
ENT
D
GX SHFT D C A B A ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–61


Chapter 5: Standard RLL Instructions - Logical Instructions

Or (OR)
1 The Or instruction is a 16 bit instruction that logically ors the
value in the lower 16 bits of the accumulator with a specified V- OR
2 memory location (Aaaa). The result resides in the accumulator.
The discrete status flag indicates if the result of the Or is zero.
A aaa

3 Operand Data Type


....................................A
DL05 Range
aaa

4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All (See page 4–28)

Discrete Bit Flags Description


5 SP63 Will be on if the result in the accumulator is zero.
SP70 on when the value loaded into the accumulator by any instruction is zero.
6
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
7 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the accumulator is ored with V2006
8 using the Or instruction. The value in the lower 16 bits of the accumulator are output to
V2010 using the Out instruction.
9
10 Direct SOFT32
X1 V2000
LD
2 8 7 A

11 V2000

Load the value in V2000 into


the lower 16 bits of the
The upper 16 bits of the accumulator
will be set to 0
accumulator

12
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

OR
V2006

13
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

Or the value in the 6A38


accumulator with OR (V2006) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0
the value in V2006
Acc. 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0

14 OUT
V2010

A Copy the value in the lower


16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes
6 A

V2010
7 A

B $

SHFT
STR
L
B

D
1
ENT

C A A A ENT
ANDST 3 2 0 0 0

C Q

GX
OR
SHFT V

V
AND
C

C
2
A

A
0
A

B
0
G

A
6
ENT

SHFT ENT
OUT AND 2 0 1 0

5–62 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Logical Instructions

Or Double (ORD)
The Or Double is a 32 bit instruction that ors the value in 1
the accumulator with the value (Aaaa), which is either two ORD
consecutive V-memory locations or an 8 digit (max.)
constant value. The result resides in the accumulator.
K aaa 2
Discrete status flags indicate if the result of the Or Double is
zero or a negative number (the most significant bit is on). 3
Operand Data Type DL05 Range 4
aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All (See page 4–28)
5
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–FFFFFFFF

Discrete Bit Flags Description


6
SP63 Will be on if the result in the accumulator is zero.
SP70 Will be on if the result in the accumulator is negative 7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is ored 9
with 36476A38 using the Or Double instruction. The value in the accumulator is output to
V2010 and V2011 using the Out Double instruction. 10
Direct SOFT32
11
X1 V2001 V2000
LDD
V2000

Load the value in V2000 and


5 4 7 E 2 8 7 A
12
V2001 into accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0
8
0
7
0
6 5
1 1
4 3
1 1
2
0
1
1
0
0
13
ORD
K36476A38

OR the value in the


accumulator with
Acc.

OR 36476A38
0

0
1

0
0

1
1

1
0

0
1

1
0

1
0

0
0

0
1

1
1

0
1

0
1

0
1

1
1

1
0

1
0

0
0

1 1
1 0

0
1

1
0

0
0

1
0

0
0

0
1

0
1

1
1

1
1

1
0

0
1

0
0

0
14
the constant value

A
36476A38 Acc. 0 0
1 0
1 0
1 0 1 0
1 0 0 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0

OUTD
V2010
6 A 7 A

B
7 6 7 F
Copy the value in the
accumulator to V2010 and V2011 V2010
V2011

Handheld Programmer Keystrokes

$
STR
L
B

D
1
D
ENT

C A A A
C
SHFT ENT
ANDST 3 3 2 0 0 0
Q

GX
OR
SHFT

SHFT
D

D
3
SHFT

C
K

A
JMP
D

B
3
G

A
6
E

ENT
4
H
7
G
6
SHFT A
0
SHFT D
3
I
8
ENT
D
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–63


Chapter 5: Standard RLL Instructions - Logical Instructions

Exclusive Or (XOR)
1 The Exclusive Or instruction is a 16 bit instruction that
performs an exclusive or of the value in the lower 16 bits of XOR
2 the accumulator and a specified V-memory location (Aaaa).
The result resides in the in the accumulator. The discrete
A aaa

status flag indicates if the result of the XOR is zero.


3 Operand Data Type DL05 Range
4 ....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)
5 Discrete Bit Flags Description
SP63 Will be on if the result inthe accumulator is zero.
6 SP70 on when the value loaded into the accumulator by any instruction is zero.

7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example, when X1 is on, the value in V2000 will be loaded into the
8 accumulator using the Load instruction. The value in the accumulator is exclusive ored with
V2006 using the Exclusive Or instruction. The value in the lower 16 bits of the accumulator
9 are output to V2010 using the Out instruction.

10
11
Direct SOFT32
X1 V2000
LD
2 8 7 A
V2000

12
Load the value in V2000 into The upper 16 bits of the accumulator
the lower 16 bits of the will be set to 0
accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

13 XOR
V2006 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

XOR the value in the 6A38

14 accumulator with
the value in V2006
XOR (V2006)

Acc.
0

0
0

0
0

0
0

0
0

0
0

1
0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
1

1
1

0
0

0
1

0
0

0
1

1
0

0
0

0
0

1
1

0
1

0
1

0
0

0
0

1
0

A
OUT
V2010
4 2 4 2
Copy the lower 16 bits of the
accumulator to V2010 V2010

B Handheld Programmer Keystrokes

$ X B
SHFT ENT
STR SET 1

C SHFT L
ANDST
X
D
3
Q
SHFT V
AND
C

V
2
A

C
0
A

A
0
A

A
0
ENT

G
SHFT SHFT SHFT ENT
SET OR AND 2 0 0 6

D GX
OUT
SHFT V
AND
C
2
A
0
B
1
A
0
ENT

5–64 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Logical Instructions

Exclusive Or Double (XORD)


The Exclusive OR Double is a 32 bit instruction that 1
performs an exclusive or of the value in the accumulator
and the value (Aaaa), which is either two consecutive
V-memory locations or an 8 digit (max.) constant. The
XORD
K aaa 2
result resides in the accumulator. Discrete status flags
indicate if the result of the Exclusive Or Double is zero 3
or a negative number (the most significant bit is on).
Operand Data Type DL05 Range
4
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
5
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–FFFFFFFF 6
Discrete Bit Flags Description
SP63 Will be on if the result in the accumulator is zero. 7
SP70 Will be on if the result in the accumulator is negative
8
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into 9
the accumulator using the Load Double instruction. The value in the accumulator is
exclusively ored with 36476A38 using the Exclusive Or Double instruction. The value in the
accumulator is output to V2010 and V2011 using the Out Double instruction.
10
Direct SOFT32
X1 5
V2001
4 7 E 2
V2000
8 7 A
11
LDD
V2000

Load the value in V2000 and


V2001 into the accumulator
12
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XORD
K36476A38

XORD the value in the


Acc. 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0
13
Acc. 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0
accumulator with
the constant value
36476A38

OUTD
XORD 36476A38 0

0
0

0
1
1

0
1
1

0
0

0
1

1
0
1

0
1
0

0
0

0
1

0
0

0
1
0

0
1
0

0
1
1

0
1

0
1

0
1
0

0
1

1
1

0
0

0
1

0
0

0
1

1
0

0
0

0
0

1
1

0
1

0
1

0
0

0
0

1
0

0
14
Acc.

A
V2010

Copy the value in the


accumulator to V2010
and V2011 6 2 3 9 4 2 4 2

Handheld Programmer Keystrokes


$
STR
B
1
ENT
V2011 V2010
B
SHFT

SHFT
L
ANDST
X
D

Q
3
D

SHFT
3
D
C
2
A
0

SHFT
A

K
0
A
0
ENT
C
SET OR 3 JMP
D

GX
3
G

SHFT
6
E

D
4
H
7
G

C
6
A
SHFT A

B
0
SHFT

A
D

ENT
3
I
8
ENT
D
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–65


Chapter 5: Standard RLL Instructions - Logical Instructions

Compare (CMP)
1 The compare instruction is a 16 bit instruction that compares the
value in the lower 16 bits of the accumulator with the value in a CMP
2 specified V-memory location (Aaaa). The corresponding status flag
will be turned on indicating the result of the comparison.
A aaa

3 Operand Data Type DL05 Range


....................................A aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All (See page 4–28)

5 Discrete Bit Flags Description


SP60 On when the value in the accumulator is less than the instruction value.
6 SP61
SP62
On when the value in the accumulator is equal to the instruction value.
On when the value in the accumulator is greater than the instruction value.

7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

8 In the following example when X1 is on, the constant 4526 will be loaded into the lower
16 bits of the accumulator using the Load instruction. The value in the accumulator is
compared with the value in V2000 using the Compare instruction. The corresponding
9 discrete status flag will be turned on indicating the result of the comparison. In this example,
if the value in the accumulator is less than the value specified in the Compare instruction,
10 SP60 will turn on energizing C30.
Direct SOFT32

11 X1 LD
K4526 4
CONSTANT
5 2 6

Load the constant value

12 4526 into the lower 16 bits of


the accumulator
The unused accumulator
bits are set to zero

Acc. 0 0 0 0 44 55 22 66

13 Compared
with
CMP

14 V2000

Compare the value in the


8 9 4 5

accumulator with the value V2000

A SP60
in V2000

C30

B Handheld Programmer Keystrokes


$ B ENT

C SHFT
STR
L
ANDST
D
1

3
SHFT K
JMP
E
4
F
5
C
2
G
6
ENT

C M P C A A A

D SHFT

$
STR
2
SHFT

SHFT
ORST
SP
STRN
G
CV

6
A
0
ENT
2 0 0 0
ENT

GX SHFT C D A ENT
OUT 2 3 0

5–66 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Logical Instructions

Compare Double (CMPD)


The Compare Double instruction is a 32–bit instruction that 1
compares the value in the accumulator with the value (Aaaa), CMPD
which is either two consecutive V-memory locations or an
8–digit (max.) constant. The corresponding status flag will be
A aaa 2
turned on indicating the result of the comparison.
3
Operand Data Type DL05 Range
....................................A aaa 4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
0–FFFFFFFF
5
SP60
Discrete Bit Flags Description
On when the value in the accumulator is less than the instruction value.
6
SP61
SP62
On when the value in the accumulator is equal to the instruction value.
On when the value in the accumulator is greater than the instruction value. 7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8
In the following example when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is 9
compared with the value in V2010 and V2011 using the CMPD instruction. The
corresponding discrete status flag will be turned on indicating the result of the comparison. In
this example, if the value in the accumulator is less than the value specified in the Compare
10
instruction, SP60 will turn on energizing C30.
Direct SOFT32
V2001 V2000
11
X1 LDD
V2000

Load the value in V2000 and


V2001 into the accumulator
4 5 2 6 7 2 9 9

12
Acc. 4 5 2 6

Compared
77 72 9 9
13
CMPD with
V2010

Compare the value in the


accumulator with the value
6 7 3
V2011
9 5 0 2
V2010
6 14
in V2010 and V2011

SP60 C30 A
Handheld Programmer Keystrokes
B
$ B
STR

SHFT L
ANDST
D
1

3
D
ENT

3
C
2
A
0
A
0
A
0
ENT
C
$
SHFT

STR
C
2
SHFT

SHFT
M
ORST
SP
STRN
P

G
CV

6
D

A
3

0
ENT
C
2
A
0
B
1
A
0
ENT
D
GX SHFT C D A ENT
OUT 2 3 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–67


Chapter 5: Standard RLL Instructions - Math Instructions

1 Math Instructions
Add (ADD)
2 Add is a 16 bit instruction that adds a BCD value in the ADD
A aaa
accumulator with a BCD value in a V-memory location (Aaaa).
3 The result resides in the accumulator.
Operand Data Type DL05 Range
4 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)

5 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)

Discrete Bit Flags Description


6 SP63
SP66
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16 bit addition instruction results in a carry.

7 SP67
SP70
On when the 32 bit addition instruction results in a carry.
On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.
8
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
9 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the lower 16 bits of the accumulator are
10 added to the value in V2006 using the Add instruction. The value in the accumulator is
copied to V2010 using the Out instruction.
11 Direct SOFT32
X1 LD
4
V2000
9 3 5

12 V2000

Load the value in V2000 into


the lower 16 bits of the The unused accumulator
accumulator bits are set to zero

13 ADD
+
0 0 0 0 4

2
9

5
3

0
5

0
(Accumulator)

(V2006)
V2006

14 Add the value in the lower


16 bits of the accumulator
with the value in V2006
Acc. 7 4 3 5

A OUT
V2010 7 4 3 5

Copy the value in the lower V2010


B 16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes

C $
STR
L
B

D
1
ENT

C A A A
SHFT ENT
ANDST 3 2 0 0 0

D SHFT A
0
D
3
D
3
C
2
A
0
A
0
G
6
ENT

GX SHFT V C A B A ENT
OUT AND 2 0 1 0

5–68 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Add Double (ADDD)


Add Double is a 32 bit instruction that adds the BCD 1
value in the accumulator with a BCD value (Aaaa), ADDD
which is either two consecutive V-memory locations or
an 8–digit (max.) BCD constant. The result resides in
A aaa 2
the accumulator.
3
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
4
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
0–99999999
5
SP63
Discrete Bit Flags Description
On when the result of the instruction causes the value in the accumulator to be zero.
6
SP66 On when the 16 bit addition instruction results in a carry.
SP67 On when the 32 bit addition instruction results in a carry. 7
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered. 8
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
9
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is added
with the value in V2006 and V2007 using the Add Double instruction. The value in the
10
accumulator is copied to V2010 and V2011 using the Out Double instruction.
Direct SOFT V2001 V2000
11
X1 6 7 3 9 5 0 2 6
LDD
V2000

Load the value in V2000 and


12
V2001 into the accumulator

ADDD
+ 2
6 7
0
3
0
9
0
5
4
0
0
2
4
6
6
(Accumulator)
(V2006 and V2007)
13
V2006

Add the value in the


accumulator with the value
in V2006 and V2007
Acc. 8 7 3 9 9 0 7 2
14
OUTD
V2010 8 7 3 9 9 0 7 2
A
Copy the value in the V2011 V2010
accumulator to V2010 and
V2011 B
Handheld Programmer Keystrokes
$
STR
B
1
ENT C
SHFT L D D C A A A ENT

SHFT
ANDST
A
0
D
3

3
D
3

3
D
3
2
C
0

2
A
0

0
A
0

0
G
6
ENT
D
GX SHFT D SHFT V C A B A ENT
OUT 3 AND 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–69


Chapter 5: Standard RLL Instructions - Math Instructions

Subtract (SUB)
1 Subtract is a 16 bit instruction that subtracts the BCD value (Aaaa) SUB
in a V-memory location from the BCD value in the lower 16 bits of A aaa

2 the accumulator. The result resides in the accumulator.


Operand Data Type DL05 Range
3 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)

4 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)

Discrete Bit Flags Description


5 SP63
SP64
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16 bit addition instruction results in a borrow

6 SP65
SP70
On when the 32 bit addition instruction results in a borrow
On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in V2006 is subtracted from the value in
9 the accumulator using the Subtract instruction. The value in the accumulator is copied to
V2010 using the Out instruction.
10
11 Direct SOFT32

X1 LD
2
V2000
4 7 5

V2000

12 Load the value in V2000 into


the lower 16 bits of the
The unused accumulator
bits are set to zero
accumulator 0 0 0 0 2 4 7 5 (Accumulator)

13 SUB
V2006
_
1 5 9 2 (V2006)

Acc. 0 8 8 3

14 Subtract the value in V2006


from the value in the lower
16 bits of the accumulator

A OUT
V2010
0 8 8 3

V2010

B Copy the value in the lower


16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes

C $
STR
B
1
ENT

L D C A A A

D
SHFT ENT
ANDST 3 2 0 0 0

SHFT S U B SHFT V C A A G ENT


RST ISG 1 AND 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0

5–70 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Subtract Double (SUBD)


Subtract Double is a 32 bit instruction that subtracts the BCD value SUBD 1
A aaa
(Aaaa), which is either two consecutive V-memory locations or an 8-
digit (max.) constant, from the BCD value in the accumulator. 2
Operand Data Type DL05 Range
....................................A aaa
3
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28) 4
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–99999999

Discrete Bit Flags Description 5


SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP64
SP65
On when the 16 bit addition instruction results in a borrow
On when the 32 bit addition instruction results in a borrow
6
SP70
SP75
On anytime the value in the accumulator is negative.
On when a BCD instruction is executed and a NON–BCD number was encountered.
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in V2006 and V2007 is 9
subtracted from the value in the accumulator. The value in the accumulator is copied to
V2010 and V2011 using the Out Double instruction. 10
Direct SOFT V2001 V2000

X1 LDD
V2000
0 1 0 6 3 2 7 4
11
Load the value in V2000 and
V2001 into the accumulator
0 1 0 6 3 2 7 4 (Accumulator)
12
_ 6 7 2 3 7 5 (V2006 and V2007)
SUBD
V2006 ACC. 0 0 3 9 0 8 9 9 13
The in V2006 and V2007 is
subtracted from the value in
the accumulator 14
OUTD 0 0 3 9 0 8 9 9
V2010
V2011 V2010 A
Copy the value in the
accumulator to V2010 and
V2011
B
Handheld Programmer Keystrokes

$
STR
B
1
ENT C
L D D C A A A
SHFT

SHFT
ANDST
S SHFT
3
U
3
B D
2 0
C
0
A
0
ENT

A G ENT
D
RST ISG 1 3 2 0 0 6
GX SHFT D C A B A ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–71


Chapter 5: Standard RLL Instructions - Math Instructions

Multiply (MUL)
1 Multiply is a 16 bit instruction that multiplies the BCD
MUL
value (Aaaa), which is either a V-memory location or a
2 4–digit (max.) constant, by the BCD value in the lower
16 bits of the accumulator The result can be up to 8 digits
A aaa

and resides in the accumulator.


3 Operand Data Type DL05 Range
4 ....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)

5 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
0–99999999
Discrete Bit Flags Description
6 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
7 SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.

NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in V2006 is multiplied by the value in the
9 accumulator. The value in the accumulator is copied to V2010 and V2011 using the Out
Double instruction.
10 Direct SOFT32 V2000

11 X1 LD
V2000
1 0 0 0

The unused accumulator


Load the value in V2000 into

12 the lower 16 bits of the


accumulator
bits are set to zero
0 0 0 0 1 0 0 0 (Accumulator)
(V2006)
X 2 5
MUL

13 V2006

The value in V2006 is


Acc. 0 0 0 2 5 0 0 0

multiplied by the value in the

14 accumulator

0 0 0 2 5 0 0 0
OUTD

A V2010

Copy the value in the


V2011 V2010

accumulator to V2010 and

B V2011

Handheld Programmer Keystrokes

C $
STR
B
1
ENT

SHFT L D C A A A ENT
D SHFT
ANDST
M
ORST
U
ISG
3
L
ANDST
2
C
0

2
A
0

0
A
0

0
G
6
ENT

GX SHFT D C A B A ENT
OUT 3 2 0 1 0

5–72 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Multiply Double (MULD)


Multiply Double is a 32 bit instruction that multiplies the 8- 1
digit BCD value in the accumulator by the 8-digit BCD
value in the two consecutive V-memory locations specified in
the instruction. The lower 8 digits of the results reside in the
MULD
A aaa
2
accumulator. Upper digits of the result reside in the
accumulator stack. 3
Operand Data Type DL05 Range
....................................A aaa
4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28) 5
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero. 6
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered. 7
NOTE: Status flags are valid only until another instruction uses the same flag.

In the following example, when X1 is on, the constant Kbc614e hex will be loaded into the
8
accumulator. When converted to BCD the number is ”12345678”. That number is stored in
V1400 and V1401. After loading the constant K2 into the accumulator, we multiply it times 9
12345678, which is 24691356.
Direct SOFT32 Display
1 2 3 4 5 6 7 8 (Accumulator)
10
X1 LDD Load the hex equivalent
Kbc614e
of 12345678 decimal into
the accumulator.

Convert the value to V1401 V1400


11
BCD
BCD format. It will 1 2 3 4 5 6 7 8

OUTD
occupy eight BCD digits
(32 bits).
Output the number to
V1400 and V1401 using
X 2 (Accumulator)
12
V1400 the OUTD instruction. Acc. 2 4 6 9 1 3 5 6

LD
K2
Load the constant K2
into the accumulator.
13
MULD
V1400
Multiply the accumulator
contents (2) by the
8-digit number in V1400
and V1401.
2 4 6

V1403
9 1 3

V1402
5 6
14
A
OUTD Move the result in the
accumulator to V1402
V1402 and V1403 using the
OUTD instruction.
Handheld Programmer Keystrokes

$
STR
L
B

D
1
D
ENT

B C G B E E
B
SHFT PREV SHFT SHFT SHFT ENT
ANDST 3 3 1 2 6 1 4 4

SHFT

GX
B

SHFT
1
C

D
2
D
3
ENT

B E A A ENT
C
OUT 3 1 4 0 0

SHFT

SHFT
L
ANDST
M
D

U
3
L
PREV

D
C
2
B
ENT

E A A ENT
D
ORST ISG ANDST 3 1 4 0 0
GX SHFT D B E A C ENT
OUT 3 1 4 0 2

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–73


Chapter 5: Standard RLL Instructions - Math Instructions

Divide (DIV)
1 Divide is a 16 bit instruction that divides the BCD value
in the accumulator by a BCD value (Aaaa), which is
2 either a V-memory location or a 4-digit (max.) constant.
The first part of the quotient resides in the accumulator
DIV
A aaa
and the remainder resides in the first stack location.
3
Operand Data Type DL05 Range
4 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
5 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–99999999
6 Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
7 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
8 SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.

NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
9
In the following example, when X1 is on, the value in V2000 will be loaded into the
10 accumulator using the Load instruction. The value in the accumulator will be divided by the
value in V2006 using the Divide instruction. The value in the accumulator is copied to
V2010 using the Out instruction.
11 Direct SOFT32 V2000
5 0 0 0

12 X1 LD
V2000

Load the value in V2000 into The unused accumulator

13 the lower 16 bits of the


accumulator

DIV
bits are set to zero
0 0 0 0 5 0 0 0 (Accumulater)

÷ 4 9 V2006

14
V2006
Acc. 1 0 2 0 0 0 0 0 0 0 2
The value in the
accumulator is divided by First stak location contains
the value in V2006 the remainder

A OUT 1 0 2
V2010 V2010

B Copy the value in the lower


16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes

C $
STR
B
1
ENT

L D C A A A

D SHFT

SHFT
ANDST
D
3
I
3

8
V
AND
2
C
0

2
A
0

0
A
0

0
G
ENT

6
ENT

GX SHFT V C A B A ENT
OUT AND 2 0 1 0

5–74 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Divide Double (DIVD)


Divide Double is a 32 bit instruction that divides the BCD 1
value in the accumulator by a BCD value (Aaaa), which
must be obtained from two consecutive V-memory locations.
(You cannot use a constant as the parameter in the box.) The
DIVD
A aaa 2
first part of the quotient resides in the accumulator and the
remainder resides in the first stack location. 3
Operand Data Type DL05 Range
4
....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28) 5
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)

Discrete Bit Flags Description 6


SP53 On when the value of the operand is larger than the accumulator can work with.
SP63
SP70
On when the result of the instruction causes the value in the accumulator to be zero.
On anytime the value in the accumulator is negative.
7
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.

NOTE: Status flags are valid only until another instruction uses the same flag.
8
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into 9
the accumulator using the Load Double instruction. The value in the accumulator is divided
by the value in V1420 and V1421 using the Divide Double instruction. The first part of the
quotient resides in the accumulator an the remainder resides in the first stack location. The
10
value in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
Direct SOFT32 V1401 V1400
11
X1 LDD 0 1 5 0 0 0 0 0
V1400

Load the value in V1400 and The unused accumulator


12
bits are set to zero
V1401 into the accumulator

DIVD 쐦
0
0
1
0
5
0
0
0
0
0
0
0
0
5
0
0
(Accumulator)

(V1421 and V1420)


13
V1420
Acc. 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0
The value in the accumulator
is divided by the value in
V1420 and V1421
First stack location contains
the remainder
14
OUTD
0 0 0 3 0 0 0 0
A
V1500

Copy the value in the


accumulator to V1500
and V1501
V1501 V1500
B
Handheld Programmer Keystrokes

$
STR
B
1
ENT SHFT L
ANDST
D
3
D
3
C
B E A A D I V
1
B
4
E
0
C
0
A
ENT SHFT

ENT GX
3

SHFT
8
D
AND
D
1 4 2 0 OUT 3
B F A A ENT
1 5 0 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–75


Chapter 5: Standard RLL Instructions - Math Instructions

Increment (INC)
1 The Increment instruction increments a BCD value in a INC
specified V-memory location by “1” each time the instruction A aaa
2 is executed.
Decrement (DEC)
3 The Decrement instruction decrements a BCD value in a DEC
specified V-memory location by “1” each time the instruction
A aaa
4 is executed.

Operand Data Type DL05 Range


5 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
6 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)

Discrete Bit Flags Description


7 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.
8 NOTE: Status flags are valid only until another instruction uses the same flag.

9 In the following increment example, when C5 is on the value in V1400 increases by one.
Direct SOFT32 V1400

10 C5 INC
8 9 3 5

V1400

11 Increment the value in


V1400 by “1”. V1400
8 9 3 6
12 Handheld Programmer Keystrokes

$ F
NEXT NEXT NEXT NEXT ENT
STR 5

13 SHFT I
8
N
TMR
C
2
B
1
E
4
A
0
A
0
ENT

14 In the following decrement example, when C5 is on the value in V1400 is decreased by one.

A Direct SOFT32

C5 DEC
8
V1400
9 3 5

B V1400

Decrement the value in


V1400 by “1”.
V1400
C Handheld Programmer Keystrokes
8 9 3 4

D $
STR
D E
NEXT NEXT

C
NEXT NEXT

B
F

E
5
ENT

A A
SHFT ENT
3 4 2 1 4 0 0

5–76 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Increment Binary (INCB)


The Increment Binary instruction increments a binary INCB 1
value in a specified V-memory location by “1” each time A aaa
the instruction is executed. 2
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
3
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)
4
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
In the following example when C5 is on, the binary value in V2000 is increased by 1.
5
6
Direct SOFT32

C5 INCB
4
V2000
A 3 C
Handheld Programmer Keystrokes

$
STR
SHFT C
2
F
5
ENT
7
V2000

Increment the binary value


in the accumulator by“1”

4
V2000
A 3 D
SHFT I
8
N
TMR
C
2
B
1
C
2
A
0
A
0
A
0
ENT
8
Decrement Binary (DECB) 9
The Decrement Binary instruction decrements a binary
value in a specified V-memory location by “1” each time DECB
A aaa
10
the instruction is executed.
11
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
12
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)

Discrete Bit Flags Description


13
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
14
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example when C5 is on, the value in V2000 is decreased by 1.


A
Direct SOFT32 V2000
B
Handheld Programmer Keystrokes
4 A 3 C
C5 DECB
V2000

Decrement the binary value


$
STR

SHFT D
3
SHFT

E
4
C

C
2

2
F

B
5

1
ENT

C
2
A
0
A
0
A
0
ENT
C
in the accumulator by“1” V2000
4 A 3 B
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–77


Chapter 5: Standard RLL Instructions - Math Instructions

Add Binary (ADDB)


1 Add Binary is a 16 bit instruction that adds the unsigned 2’s
complement binary value in the lower 16 bits of the ADDB
2 accumulator with an unsigned 2’s complement binary value
(Aaaa), which is either a V-memory location or a 16-bit
A aaa

constant. The result can be up to 32 bits (unsigned 2’s


3 complement) and resides in the accumulator.

4 Operand Data Type


....................................A
DL05 Range
aaa
5 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 4–28)
All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0–FFFF
6 Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
7 SP66 On when the 16 bit addition instruction results in a carry.
SP67 On when the 32 bit addition instruction results in a carry.
8 SP70
SP73
On anytime the value in the accumulator is negative.
On when a signed addition or subtraction results in a incorrect sign bit.

9 NOTE: Status flags are valid only until another instruction uses the same flag.

10 In the following example, when X1 is on, the value in V1400 will be loaded into the
accumulator using the Load instruction. The binary value in the accumulator will be added to
the binary value in V1420 using the Add Binary instruction. The value in the accumulator is
11 copied to V1500 and V1501 using the Out instruction.
DirectS OF T32 Dis play V1400

12 X1 LD
V1400
0 A 0 5

13 Load the value in V1400 into the


lower 16 bits of the accumulator
The unused accumulator
bits are s et to zero
0 0 0 0 0 A 0 5 (Accumulator)

14
ADDB + 1 2 C 4 (V1420)
V1420
Acc. 1 C C 9
The binary value in the
accumulator is added to the

A binary value in V1420

OUTD 1 C C 9

B V1500

Copy the value in the lower


16 bits of the accumulator to
V1500

V1500 and V1501

C Handheld Programmer Keys trokes

D S TR

S HF T L
X(IN)

D
1

V
E NT

1 4 0 0 E NT

S HF T A D D B V 1 4 2 0 E NT

OUT S HF T D V 1 5 0 0 E NT

5–78 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Subtract Binary (SUBB)


Subtract Binary is a 16 bit instruction that subtracts the 1
unsigned 2–s complement binary value (Aaaa), which is S UBB
either a V-memory location or a 16-bit 2’s complement
binary value, from the binary value in the accumulator.
A aaa 2
The result resides in the accumulator.
3
Operand Data Type DL05 Range
....................................A aaa 4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
0–FFFF
5
SP63
Discrete Bit Flags Description
On when the result of the instruction causes the value in the accumulator to be zero.
6
SP64
SP65
On when the 16 bit addition instruction results in a borrow
On when the 32 bit addition instruction results in a borrow 7
SP70 On any time the value in the accumulator is negative.

NOTE: Status flags are valid only until another instruction uses the same flag.
8
In the following example, when X1 is on, the value in V1400 will be loaded into the 9
accumulator using the Load instruction. The binary value in V1420 is subtracted from the
binary value in the accumulator using the Subtract Binary instruction. The value in the
accumulator is copied to V1500 using the Out instruction.
10
DirectSOFT32 Display

X1
1
V1400
0 2 4
11
LD
V1400

Load the value in V1400 into the The unus ed accumulator


12
lower 16 bits of the accumulator bits are s et to zero

SUBB _
0 0 0 0

0
1 0

A 0
2 4

B
(Accumulator)

(V1420)
13
V1420

The binary value in V1420 is


subtracted from the value in
the accumulator
Acc. 0 6 1 9
14
OUT
V1500
0 6 1 9 A
V1500
Copy the value in the lower 16
bits of the accumulator to V1500 B
Handheld Programmer Keys trokes

S TR X(IN) 1 E NT
C
S HF T

S HF T
L

S
D

S HF T
V

U
1

B
4

B
0 0 E NT
D
V 1 4 2 0 E NT

OUT S HF T D V 1 5 0 0 E NT

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–79


Chapter 5: Standard RLL Instructions - Math Instructions

Multiply Binary (MULB)


1 Multiply Binary is a 16 bit instruction that multiplies the
unsigned 2’s complement binary value (Aaaa), which is either MULB
a V-memory location or a 16-bit unsigned 2’s complement A aaa
2 binary constant, by the16-bit binary value in the
accumulator The result can be up to 32 bits and resides in
3 the accumulator.
Operand Data Type DL05 Range
4 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
5 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
1–FFFF

6 Discrete Bit Flags Description


SP63 On when the result of the instruction causes the value in the accumulator to be zero.
7 SP70 On any time the value in the accumulator is negative.

NOTE: Status flags are valid only until another instruction uses the same flag.
8
In the following example, when X1 is on, the value in V1400 will be loaded into the
9 accumulator using the Load instruction. The binary value in V1420 is multiplied by the
binary value in the accumulator using the Multiply Binary instruction. The value in the
accumulator is copied to V1500 using the Out instruction.
10 DirectS OF T32 Dis play V1400
0 A 0 1
11 X1 LD
V1400

Load the value in V1400 into the


12 lower 16 bits of the accumulator The unus ed accumulator
bits are s et to zero
0 0 0 0 0 A 0 1 (Accumulator)
MULB
13 V1420
X

Acc. 0 0 0 1
0

C
0

C
2

2
E

E
(V1420)

The binary value in V1420 is

14 multiplied by the binary


value in the accumulator

A OUTD
V1500
0 0

V1501
0 1 C C 2

V1500
E

Copy the value in the lower


B 16 bits of the accumulator to
V1500 and V1501

C Handheld Programmer Keys trokes

S TR X 1 E NT

D S HF T

S HF T
L

M
D

U
V

L B
1 4 0

V
0

1
E NT

4 2 0 E NT

OUT S HF T D V 1 5 0 0 E NT

5–80 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Math Instructions

Divide Binary (DIVB)


Divide Binary is a 16 bit instruction that divides the
unsigned 2’s complement binary value in the accumulator by DIVB
1
a binary value (Aaaa), which is either a V-memory location A aaa
or a 16-bit unsigned 2’s complement binary constant. The
first part of the quotient resides in the accumulator and the
2
remainder resides in the first stack location.
3
Operand Data Type DL05 Range
....................................A aaa 4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
0–FFFF
5
Discrete Bit Flags Description 6
SP53 On when the value of the operand is larger than the accumulator can work with.
SP63
SP70
On when the result of the instruction causes the value in the accumulator to be zero.
On anytime the value in the accumulator is negative.
7
NOTE: Status flags are valid only until another instruction uses the same flag. 8
In the following example, when X1 is on, the value in V1400 will be loaded into the
accumulator using the Load instruction. The binary value in the accumulator is divided by 9
the binary value in V1420 using the Divide Binary instruction. The value in the accumulator
is copied to V1500 using the Out instruction.
DirectS OF T32 Dis play
10
V1400

X1 LD
V1400
F A 0 1
11
Load the value in V1400 into the
lower 16 bits of the accumulator
The unus ed accumulator
bits are s et to zero 12
0 0 0 0 F A 0 1 (Accumulator)
DIVB
V1420
쐦 0 0 5 0 (V1420)
13
Acc. 0 3 2 0 0 0 0 0 0 0 0 0
The binary value in the
accumulator is divided by
the binary value in V1420
Firs t s tack location contains
the remainder 14
OUT
V1500
0 3 2

V1500
0
A
Copy the value in the lower 16
bits of the accumulator to V1500 B
Handheld Programmer Keys trokes
S TR X 1 E NT
C
S HF T L D V 1 4 0 0 E NT
D
S HF T D I V B V 1 4 2 0 E NT

OUT S HF T D V 1 5 0 0 E NT

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–81


Chapter 5: Standard RLL Instructions - Bit Operation Instructions

1 Bit Operation Instructions


Sum (SUM)
2 The Sum instruction counts number of bits that are
SUM

set to “1” in the accumulator. The HEX result resides


3 in the accumulator.

4 Discrete Bit Flags


SP63
Description
On when the result of the instruction causes the value in the accumulator to be zero.

5 In the following example, when X1 is on, the value formed by discrete locations X10–X17 is
loaded into the accumulator using the Load Formatted instruction. The number of bits in the
accumulator set to “1” is counted using the Sum instruction. The value in the accumulator is
6 copied to V1500 using the Out instruction.

7
8 Direct SOFT32 Display

X1 LDF X10
X17 X16 X15 X14 X13 X12 X11 X10
ON ON OFF OFF ON OFF ON ON

K8 The unused accumulator

9 Load the value represented by


discrete locations X10–X17
into the accumulator
bits are set to zero

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 1

10
Acc. 0 0 0 0 0 0 0 5
SUM

11 Sum the number of bits in


the accumulator set to “1”

12 OUT 0 0 0 5

13 V1500

Copy the value in the lower


16 bits of the accumulator
V1500

to V1500

14 Handheld Programmer Keystrokes

$
STR
B
1
ENT

A SHFT

SHFT
L
ANDST
S
D

SHFT
3
F

U
5
M
B
1
A

ENT
0
I
8
ENT

RST ISG ORST

B GX
OUT
PREV PREV PREV B
1
F
5
A
0
A
0
ENT

C
D

5–82 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Bit Operation Instructions

Shift Left (SHFL)


Shift Left is a 32 bit instruction that shifts the bits in the SHFL 1
accumulator a specified number (Aaaa) of places to the A aaa
left. The vacant positions are filled with zeros and the bits
shifted out of the accumulator are discarded.
2
Operand Data Type DL05 Range 3
....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28) 4
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-32

In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
5
the accumulator using the Load Double instruction. The bit pattern in the accumulator is
shifted 2 bits to the left using the Shift Left instruction. The value in the accumulator is 6
copied to V2010 and V2011 using the Out Double instruction.

Discrete Bit Flags Description


7
SP63
SP70
On when the result of the instruction causes the value in the accumulator to be zero.
On anytime the value in the accumulator is negative. 8
Direct SOFT32
9
V2001 V2000
X1 LDD
V2000

Load the value in V2000 and


6 7 0 5 33 31 10 01

10
V2001 into the accumulator

SHFL
K2
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0
8
1
7
0
6 5
0 0
4 3
0 0
2
0
1
0
0
1
11
The bit pattern in the
accumulator is shifted 2 bit
positions to the left Shifted out of the
accumulator
. . . . 12
OUTD
V2010

Copy the value in the Acc.


31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0
1 0 0 0
1 0
1 1 0 0 0 0 0 0
1 0 0
1 0 0 1 1 0 0 0 1 0
8
0
7
0
6 5
0 0
4 3
0 0
2
1
1
0
0
0
13
accumulator to V2010 and
V2011

14
9 C

V2011
1 4 C 4

V2010
0 4 A
Handheld Programmer Keystrokes

$
STR
L
B

D
1
D
ENT

C A A A
B
SHFT ENT
ANDST 3 3 2 0 0 0

SHFT

GX
S
RST
D
SHFT H
7
F

C
5
L
ANDST
A B
C

A
2
ENT
C
SHFT ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–83


Chapter 5: Standard RLL Instructions - Bit Operation Instructions

Shift Right (SHFR)


1 Shift Right is a 32 bit instruction that shifts the bits in the SHFR
accumulator a specified number (Aaaa) of places to the right. A aaa
2 The vacant positions are filled with zeros and the bits shifted out
of the accumulator are lost.
3 Operand Data Type DL05 Range
....................................A aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
1-32

5 Discrete Bit Flags Description


SP63 On when the result of the instruction causes the value in the accumulator to be zero.
6 SP70 On anytime the value in the accumulator is negative.

In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
7 the accumulator using the Load Double instruction. The bit pattern in the accumulator is
shifted 2 bits to the right using the Shift Right instruction. The value in the accumulator is
8 copied to V2010 and V2011 using the Out Double instruction.

9 Direct SOFT32 V2001 V2000


X1 Constant 6 7 0 5 33 11 00 11

10 LDD
V2000

Load the value in V2000 and


V2001 into the accumulator

11 SHFR
K2
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0
8
1
7
0
6 5
0 0
4 3
0 0
2
0
1
0
0
1

12 ... .
The bit pattern in the
accumulator is shifted 2 bit
positions to the right Shifted out of the
accumulator

13
OUTD
V2010 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Copy the value in the Acc. 0 0 0 0


1 1
0 0
1 0 1
0 1
0 1
0 0 0 0 0 0 0
1 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0
accumulator to V2010 and
V2011

14
A 1 9

V2011
C 1 4 C

V2010
4 0

B Handheld Programmer Keystrokes

$
STR
B
1
ENT

C SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0

SHFT S SHFT H F R C ENT


RST 7 5 ORN 2
GX D C A B A

D OUT
SHFT
3 2 0 1 0
ENT

5–84 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Bit Operation Instructions

Encode (ENCO)
The Encode instruction encodes the bit position in the 1
accumulator having a value of 1, and returns the appropriate
binary representation. If the most significant bit is set to 1 (Bit
31), the Encode instruction would place the value HEX 1F
ENCO 2
(decimal 31) in the accumulator. If the value to be encoded is
0000 or 0001, the instruction will place a zero in the 3
accumulator. If the value to be encoded has more than one bit
position set to a “1”, the least significant “1” will be encoded
and SP53 will be set on.
4
Discrete Bit Flags Description 5
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
6
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example, when X1 is on, The value in V2000 is loaded into the accumulator
7
using the Load instruction. The bit position set to a “1” in the accumulator is encoded to the
corresponding 5 bit binary value using the Encode instruction. The value in the lower 16 bits 8
of the accumulator is copied to V2010 using the Out instruction.
9
Direct SOFT32 V2000
10
1 0 0 0
X1

11
LD
V2000

Load the value in V2000 into


the lower 16 bits of the 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
accumulator
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

Bit postion 12 is
0 0 0 0 0 0 0 0 0 0
12
converted

ENCO
to binary
13
Encode the bit position set
to “1” in the accumulator to a
5 bit binary value
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 1
2
1
1
0
0
0 14
OUT
A
V2010

Copy the value in the lower 16 bits


of the accumulator to V2010
0 0 0

V2010
C

Binary value
for 12.
B
Handheld Programmer Keystrokes

$
STR
B
1
ENT C
SHFT L D C A A A ENT
ANDST 3 2 0 0 0

SHFT E
4
N
TMR
C
2
O
INST#
ENT D
GX SHFT V C A B A ENT
OUT AND 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04


5–85
Chapter 5: Standard RLL Instructions - Bit Operation Instructions

Decode (DECO)
1 The Decode instruction decodes a 5 bit binary value of 0–31
(0–1F HEX) in the accumulator by setting the appropriate bit DECO
2 position to a 1. If the accumulator contains the value F (HEX),
bit 15 will be set in the accumulator. If the value to be decoded
is greater than 31, the number is divided by 32 until the value
3 is less than 32 and then the value is decoded.
In the following example when X1 is on, the value formed by discrete locations X10–X14 is
4 loaded into the accumulator using the Load Formatted instruction. The five bit binary
pattern in the accumulator is decoded by setting the corresponding bit position to a “1” using
5 the Decode instruction.

6
Direct SOFT32
X14 X13 X12 X11 X10

7 X1 LDF
K5
X10 OFF ON OFF ON ON

Load the value in

8 represented by discrete
locations X10–X14 into the
accumulator
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 1
2
0
1
1
0
1

9 The binary vlaue


is converted to
bit position 11.
DECO

10 Decode the five bit binary


pattern in the accumulator
and set the corresponding
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
8
0
7
0
6 5
0 0
4 3
0 0
2
0
1
0
0
0

bit position to a “1”

11 Handheld Programmer Keystrokes

$ B ENT

12
STR 1

SHFT L D F B A F ENT
ANDST 3 5 1 0 5

SHFT D E C O ENT

13
3 4 2 INST#

14
A
B
C
D

5–86 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

Number Conversion Instructions (Accumulator) 1


Binary (BIN)
The Binary instruction converts a BCD value in the
BIN 2
accumulator to the equivalent binary value. The result
resides in the accumulator. 3
In the following example, when X1 is on, the value in V2000 and V2001 is loaded into the
accumulator using the Load Double instruction. The BCD value in the accumulator is
converted to the binary (HEX) equivalent using the BIN instruction. The binary value in the
4
accumulator is copied to V2010 and V2011 using the Out Double instruction. (The
handheld programmer will display the binary value in V2010 and V2011 as a HEX value.) 5
SP63
Discrete Bit Flags Description
On when the result of the instruction causes the value in the accumulator to be zero.
6
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered. 7
DirectSOFT32 V2001 V2000

X1 LDD
V2000
0 0 0 2 8 5 2 9
8
9
Load the value in V2000 and
V2001 into the accumulator

8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1

BCD Value
10
28529 = 16384 + 8192 + 2048 + 1024 + 512 + 256 + 64 + 32 + 16 + 1

BIN Binary Equivalent Value


11
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Convert the BCD value in
the accumulator to the
binary equivalent value
Acc. 0
2
0 0
1 5
0
2
0
1
0
6 3
0 0
1
0
8
0
4
0
2
0 0
1 5
0
2
0
1
0
6
0
3
1 1
1 8
0
4
1
2
1
1
1 1
5 2
0
1 6
1 1
3
1 0
1 8
0
4
0
2
1
1
12
1 0 3 6 3 7 3 6 3 1 0 0 2 6 3 5 2 6 1 0 0 0 1 5 2 4 2 6

13
4 7 6 8 4 1 5 7 8 9 9 4 4 2 1 5 7 3 9 9 4 2 2 6 8
7 3 8 4 2 0 5 7 8 4 7 8 2 1 0 3 6 8 2 6 8 4
4 7 7 3 1 8 4 7 6 3 1 5 8 4 7 6 8 4
4 4 0 5 7 8 4 2 0 0 5 7 8 4 2
8 1 9 4 7 6 3 1 8 4 2 6
3 8 1 5 2 4 2 6
6
4
8
2
4
2 6 8
14
OUTD
V2010 The Binary (HEX)
A
0 0 0 0 6 F 7 1 value copied to

B
Copy the binary data in the
V2010
accumulator to V2010 and V2011 V2011 V2010
St

C
Handheld Programmer Keystrokes
d d RLL

$ B ENT
STR 1
L D D C A A A
SHFT

SHFT
ANDST

B
1
I
3

8
N
TMR
3

ENT
2 0 0 0
ENT
D
GX SHFT D C A B A ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–87


Chapter 5: Standard RLL Instructions - Number Conversions Instructions

Binary Coded Decimal (BCD)


1 The Binary Coded Decimal instruction converts a binary value BCD
in the accumulator to the equivalent BCD value. The result
2 resides in the accumulator.
In the following example, when X1 is on, the binary (HEX) value in V2000 and V2001 is
3 loaded into the accumulator using the Load Double instruction. The binary value in the
accumulator is converted to the BCD equivalent value using the BCD instruction. The BCD
value in the accumulator is copied to V2010 and V2011 using the Out Double instruction.
4
Discrete Bit Flags Description
5 SP63
SP70
On when the result of the instruction causes the value in the accumulator to be zero.
On anytime the value in the accumulator is negative.

6 DirectSOFT32 V2001 V2000

X1 0 0 0 0 6 F 7 1

7
LDD
V2000 Binary Value

Load the value in V2000 and


V2001 into the accumulator

8 Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1
8

1
7 6 5

0 1 1
4 3

1 0
2

0 0
1 0

1
2 1 5 2 1 6 3 1 8 4 2 1 5 2 1 6 3 1 8 4 2 1 5 2 1 6 3 1 8 4 2 1

9 1
4
7
0
7
3
3
6
8
6
8
4
3
4
2
7
1
0
3
5
5
6
7
7
3
8
8
1
9
4
0
9
7
0
4
8
2
4
2
6
2
1
3
1
0
5
5
3
2
7
6
6
3
8
1
9
2
0
9
6
0
4
8
0
2
4
1
2
5
6
2 4
8
2 6

4 7 7 3 1 8 4 7 6 3 1 5 8 4 7 6 8 4
4 4 0 5 7 8 4 2 0 0 5 7 8 4 2

10 8
3
6
1
8
2
9
1
2
4
5
6
7
2
8
6
4
3
2
1
6
8 4 2 6

4 4
8

11 BCD
16384 + 8192 + 2048 + 1024 + 512 + 256 + 64 + 32 + 16 + 1 = 28529

12 Convert the binary value in


the accumulator to the BCD
BCD Equivalent Value

equivalent value 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1

13 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1

14 OUTD
V2010

A Copy the BCD value in the


accumulator to V2010 and V2011
0 0 0
V2011
2 8 5 2
V2010
9 The BCD value
copied to
V2010 and V2011

B Handheld Programmer Keystrokes

$ B ENT
STR 1

C SHFT
L
ANDST
B
D

C
3
D

D
3
C
2
A
0
A
0
A
0
ENT

SHFT ENT
1 2 3

D GX
OUT
SHFT D
3
C
2
A
0
B
1
A
0
ENT

5–88 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Number Conversions Instructions

Invert (INV)
The Invert instruction inverts or takes the one’s INV
1
complement of the 32 bit value in the accumulator. The
result resides in the accumulator. 2
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is inverted
using the Invert instruction. The value in the accumulator is copied to V2010 and V2011
3
using the Out Double instruction.
4
5
Direct SOFT32 V2001 V2000
6
X1 0 4 0 5 00 22 55 00
LDD
V2000

Load the value in V2000 and


V2001 into the accumulator
7
8
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0

INV

Invert the binary bit pattern


Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0
8
1
7
1
6 5
0 1
4 3
0 1
2
1
1
1
0
1
9
in the accumulator

OUTD F B F A F D A F
10
V2010 V2011 V2010
Copy the value in the
accumulator to V2010 and
V2011
11
Handheld Programmer Keystrokes
12
$ B ENT

SHFT
STR
L
ANDST
D
1

3
D
3
C
2
A
0
A
0
A
0
ENT
13
SHFT I N V ENT

GX
OUT
SHFT
8
D
TMR

3
AND
C
2
A
0
B
1
A
0
ENT 14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–89


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

ASCII to HEX (ATH)


1 The ASCII TO HEX instruction converts a table of ASCII
values to a specified table of HEX values. ASCII values are
2 two digits and their HEX equivalents are one digit. This
means an ASCII table of four V-memory locations would
ATH
V aaa
only require two V-memory locations for the equivalent
3 HEX table. The function parameters are loaded into the
accumulator stack and the accumulator by two additional
4 instructions. Listed below are the steps necessary to program
an ASCII to HEX table function. The example on the
5 following page shows a program for the ASCII to HEX table
function.
Step 1: — Load the number of V-memory locations for the ASCII table into the first level of
6 the accumulator stack.
Step 2: — Load the starting V-memory location for the ASCII table into the accumulator.
7 This parameter must be a HEX value.
Step 3: — Specify the starting V-memory location (Vaaa) for the HEX table in the ATH
8 instruction.
Helpful Hint: — For parameters that require HEX values when referencing memory
9 locations, the LDA instruction can be used to convert an octal address to the HEX equivalent
and load the value into the accumulator.
10 Operand Data Type DL05 Range
aaa
11 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)

Discrete Bit Flags Description


12 SP53 On when the value of the operand is larger than the accumulator can work with.

13 In the example on the following page, when X1 is ON the constant (K4) is loaded into the
accumulator using the Load instruction and will be placed in the first level of the accumulator
stack when the next Load instruction is executed. The starting location for the ASCII table
14 (V1400) is loaded into the accumulator using the Load Address instruction. The starting
location for the HEX table (V1600) is specified in the ASCII to HEX instruction. The table
A below lists valid ASCII values for ATH conversion.
ASCII Values Valid for ATH Conversion
B ASCII Value
30
HEX Value
0
ASCII Value
38
HEX Value
8
31 1 39 9
C 32 2 41 A
33 3 42 B

D 34
35
4
5
43
44
C
D
36 6 45 E
37 7 46 F

5–90 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

Direct SOFT32 Hexadecimal

X1 LD
K4
Load the constant value
into the lower 16 bits of the
accumulator. This value
defines the number of V
ASCII TABLE Equivalents

1
memory location in the

LDA
O 1400
ASCII table

Convert octal 1400 to HEX


300 and load the value into
the accumulator
V1400 33 34
1234 V1600
2
ATH
V1600
V1600 is the starting
location for the HEX table
V1401 31 32
3
Handheld Programmer Keystrokes

$ B ENT V1402 37 38
4
STR 1

SHFT

SHFT
L
ANDST
L
ANDST
D

D
3

3
A
0
PREV E

B
4

1
E
ENT

4
A
0
A
0
ENT
V1403 35 36
5678 V1601
5
A T H B G A A
SHFT
0 MLR 7 1 6 0 0
ENT

6
7
HEX to ASCII (HTA)
The HEX to ASCII instruction converts a table of 8
HEX values to a specified table of ASCII values. HTA
HEX values are one digit and their ASCII
equivalents are two digits.
V aaa 9
This means a HEX table of two V-memory locations would require four V-memory locations
for the equivalent ASCII table. The function parameters are loaded into the accumulator
10
stack and the accumulator by two additional instructions. Listed below are the steps necessary
to program a HEX to ASCII table function. The example on the following page shows a 11
program for the HEX to ASCII table function.
Step 1: — Load the number of V-memory locations in the HEX table into the first level of 12
the accumulator stack.
Step 2: — Load the starting V-memory location for the HEX table into the accumulator. This
parameter must be a HEX value.
13
Step 3: — Specify the starting V-memory location (Vaaa) for the ASCII table in the HTA
instruction.
14
Helpful Hint: — For parameters that require HEX values when referencing memory
locations, the LDA instruction can be used to convert an octal address to the HEX equivalent
A
and load the value into the accumulator.
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–91


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

1 Operand Data Type DL05 Range


aaa
2 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)

Discrete Bit Flags Description


3 SP53 On when the value of the operand is larger than the accumulator can work with.
In the following example, when X1 is ON the constant (K2) is loaded into the accumulator
using the Load instruction. The starting location for the HEX table (V1500) is loaded into
4 the accumulator using the Load Address instruction. The starting location for the ASCII table
(V1400) is specified in the HEX to ASCII instruction.
5 Direct SOFT32

X1 LD
Hexadecimal
Equivalents ASCII TABLE
K2

6 Load the constant value into


the lower 16 bits of the
accumulator. This value
defines the number of V 33 34 V1400

7 locations in the HEX table.


V1500 1234
LDA
31 32 V1401

8 O 1500

Convert octal 1500 to HEX


340 and load the value into
the accumulator

9
HTA 37 38 V1402

10 V1400

V1400 is the starting


location for the ASCII table.
V1501 5678
The conversion is executed 35 36 V1403

11 by this instruction.

Handheld Programmer Keystrokes

$ B

12 SHFT
STR
L
ANDST
D
1

3
ENT

SHFT K
JMP
E
4
ENT

13 SHFT L D A B F A A ENT
ANDST 3 0 1 5 0 0

SHFT H T A B E A A ENT
7 MLR 0 1 4 0 0

14 The table below lists valid ASCII values for HTA conversion.

ASCII Values Valid for HTA Conversion


A Hex Value ASCII Value Hex Value ASCII Value
0 30 8 38
B 1 31 9 39
2 32 A 41
C 3 33 B 42
4 34 C 43
D 5 35 D 44
6 36 E 45
7 37 F 46

5–92 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

Gray Code (GRAY)


The Gray code instruction converts a 16 bit gray code 1
value to a BCD value. The BCD conversion requires 10
bits of the accumulator. The upper 22 bits are set to “0”.
This instruction is designed for use with devices
2
(typically encoders) that use the grey code numbering
scheme. The Gray Code instruction will directly convert
GRAY
3
a gray code number to a BCD number for devices
having a resolution of 512 or 1024 counts per
revolution. If a device having a resolution of 360 counts
4
per revolution is to be used you must subtract a BCD
value of 76 from the converted value to obtain the 5
proper result. For a device having a resolution of 720
counts per revolution you must subtract a BCD value of 6
152.
In the following example, when X1 is ON the binary value represented by X10–X27 is loaded
into the accumulator using the Load Formatted instruction. The gray code value in the
7
accumulator is converted to BCD using the Gray Code instruction. The value in the lower 16
bits of the accumulator is copied to V2010. 8
SP63
Discrete Bit Flags Description
On when the result of the instruction causes the value in the accumulator to be zero.
9
SP70 On anytime the value in the accumulator is negative.
Direct SOFT32
X27 X26 X25 X12 X11 X10
10
X1 OFF OFF OFF ON OFF ON
LDF
X10
K16

Load the value represented


11
by X10–X27 into the lower
16 bits of the accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 0
2
1
1
0
0
1
12
GRAY

Convert the 16 bit grey code


value in the accumulator to a
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
13
BCD value

OUT
V2010
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
14
A
Copy the value in the lower
16 bits of the accumulator to Gray Code BCD
V2010
0000000000 0000 0 0 0 6

Handheld Programmer Keystrokes 0000000001 0001 V2010

$
STR
B
1
ENT
0000000011
0000000010
0002
0003
B
L D F B A B G 0000000110 0004
SHFT ENT

SHFT
ANDST
G
6
R
ORN
3
A
5

0
Y
MLS
ENT
1 0 1 6
0000000111
0000000101
0005
0006
C
GX V C A B A 0000000100 0007

D
SHFT ENT
OUT AND 2 0 1 0

1000000001 1022
1000000000 1023

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–93


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

Shuffle Digits (SFLDGT)


1 The Shuffle Digits instruction shuffles a maximum of 8 SFLDGT
digits rearranging them in a specified order. This function
2 requires parameters to be loaded into the first level of the
accumulator stack and the accumulator with two additional instructions. Listed below are
the steps necessary to use the shuffle digit function. The example on the following page
3 shows a program for the Shuffle Digits function.
Step 1:— Load the value (digits) to be shuffled into the first level of the accumulator stack.
4 Step 2:— Load the order that the digits will be shuffled to into the accumulator.
Step 3:— Insert the SFLDGT instruction.
5
Note:— If the number used to specify the order contains a 0 or 9–F, the corresponding position will
6 be set to 0.

Discrete Bit Flags Description


7 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
8 Shuffle Digits Block Diagram
Digits to be
There are a maximum of 8 digits that can be
9 shuffled. The bit positions in the first level of the
shuffled (first stack location)

9 A B C D E F 0
accumulator stack defines the digits to be shuffled.
10 They correspond to the bit positions in the
accumulator that define the order the digits will be
11 shuffled. The digits are shuffled and the result
resides in the accumulator.
1 2 8 7 3 6

Specified order (accumulator)


5 4

12 Bit Positions 8 7 6 5 4 3 2 1

13 B C E F

Result (accumulator)
0 D A 9

14
A
B
C
D

5–94 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Number Conversion Instructions

In the following example when X1 is on, The value in the first level of the accumulator stack
will be reorganized in the order specified by the value in the accumulator. 1
Example A shows how the shuffle digits works when 0 or 9 –F is not used when specifying
the order the digits are to be shuffled. Also, there are no duplicate numbers in the specified
order.
2
Example B shows how the shuffle digits works when a 0 or 9–F is used when specifying the
order the digits are to be shuffled. Notice when the Shuffle Digits instruction is executed, the
3
bit positions in the first stack location that had a corresponding 0 or 9–F in the accumulator
(order specified) are set to “0”. 4
Example C shows how the shuffle digits works when duplicate numbers are used specifying
the order the digits are to be shuffled. Notice when the Shuffle Digits instruction is executed, 5
the most significant duplicate number in the order specified is used in the result.

Direct SOFT
6
A B C
X1 LDD
V2000 9
V2001
A B C D
V2000
E F 0 0
V2001
F E D C
V2000
B A 9 9
V2001
A B C D
V2000
E F 0 7
Load the value in V2000 and
V2001 into the accumulator
Original
bit
Positions
8
9
7
A B
6
C
5 4
D
3
E
2
F
1
0 Acc.
8 7 6 5
0 F E D
4
C
3
B
2
A
1
9 Acc.
8
9
7
A
6
B
5
C
4
D
3
E
2
F
1
0 Acc. 8
V2007 V2006 V2007 V2006 V2007 V2006
LDD
V2006

Load the value in V2006 and


1 2 8 7 3 6 5 4 0 0 4 3 0 0 2 1 4 3 2 1 4 3 2 1
9
V2007 into the accumulator Specified

10
8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1
order
1 2 8 7 3 6 5 4 Acc. 0 0 4 3 0 0 2 1 Acc. 4 3 2 1 4 3 2 1 Acc.

New bit 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1

11
SFLDGT Positions
B C E F 0 D A 9 Acc. 0 0 0 0 E D A 9 Acc. 0 0 0 0 9 A B C Acc.

Shuf fle the digits in the first


level of the accumulator
stack based on the pattern
in the accumulator. The
result is in the accumulator . 12
OUTD
B C E F 0 D A 9 0 0 0 0 E D A 9 0 0 0 0 9 A B C
V2010

Copy the value in the


accumulator to V2010 and
V2011 V2010 V2011 V2010 V2011 V2010
13
V2011

Handheld Programmer Keystrokes


14
$

SHFT
STR
L
ANDST
B

D
1

3
D
ENT

3
C
2
A
0
A
0
A
0
ENT
A
SHFT

SHFT
L
ANDST
S
RST
D

SHFT
3
D

F
3

5
L
ANDST
C

D
2

3
A

G
0

6
A

T
MLR
0
G

ENT
6
ENT
B
GX
OUT
SHFT D
3
C
2
A
0
B
1
A
0
ENT
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–95


Chapter 5: Standard RLL Instructions - Table Instructions

1 Table Instructions
Move (MOV)
2 The Move instruction moves the values from a V-memory
table to another V-memory table the same length. The
3 function parameters are loaded into the first level of the MOV
V aaa
accumulator stack and the accumulator by two additional
4 instructions. Listed below are the steps necessary to program
the Move function.
• Step 1:— Load the number of V-memory locations to be moved into the first level of the
5 accumulator stack. This parameter is a HEX value (K40 max, 100 octal).
• Step 2:— Load the starting V-memory location for the locations to be moved into the accumulator.
6 This parameter is a HEX value.
• Step 3:— Insert the MOVE instruction which specifies starting V-memory location (Vaaa) for the
7 destination table.
Helpful Hint: — For parameters that require HEX values when referencing memory
8 locations, the LDA instruction can be used to convert an octal address to the HEX equivalent
and load the value into the accumulator.

9 Operand Data Type DL05 Range


aaa
10 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 4–28)

11 Discrete Bit Flags Description


SP53 On when the value of the operand is larger than the accumulator can work with.
12 In the following example, when X1 is on, the constant value (K6) is loaded into the
accumulator using the Load instruction. This value specifies the length of the table and is
13 placed in the first stack location after the Load Address instruction is executed. The octal
address 2000 (V2000), the starting location for the source table is loaded into the
accumulator. The destination table location (V2030) is specified in the Move instruction.
14 Direct SOFT32

X1 Load the constant value 6


LD (HEX) into the lower 16 bits X X X X V2026

A LDA
K6 of the accumulator

Convert octal 2000 to HEX


400 and load the value into
0 1 2 3 V2000
X
0
X
1
X
2
X V2027
3 V2030
O 2000 the accumulator 0 5 0 0 V2001 0 5 0 0 V2031

B MOV
V2030
Copy the specified table
locations to a table
beginning at location V2030
9
3
8
9
0
9
9
7
8
9 V2002
4 V2003
9 V2004
9
3
8
9
0
9
9
7
8
9 V2032
4 V2033
9 V2034

C
1 0 1 0 V2005 1 0 1 0 V2035
Handheld Programmer Keystrokes
X X X X V2006 X X X X V2036
$ B ENT
STR 1 X X X X V2007 X X X X V2037

D SHFT L D SHFT K G ENT


ANDST 3 JMP 6

SHFT L D A C A A A ENT
ANDST 3 0 2 0 0 0

SHFT M O V C A D A ENT
ORST INST# AND 2 0 3 0

5–96 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Table Instructions

Move Memory Cartridge (MOVMC)


Load Label (LDLBL)
1
MOVMC
The Move Memory Cartridge and the Load Label instructions are
used to copy data from program ladder memory to V-memory. The
V aaa
2
Load Label instruction is used with the MOVMC instruction when
copying data from program ladder memory to V-memory. 3
To copy data from the program ladder memory to V-memory, the LDLBL
function parameters are loaded into the first two levels of the
accumulator stack and the accumulator by two additional
K aaa 4
instructions. Listed below are the steps necessary to program the
Move Memory Cartridge and Load Label functions. 5
• Step 1:— Load the number of words to be copied into the second level of the accumulator stack.
• Step 2:— Load the offset for the data label area in ladder memory and the beginning of the
6
V-memory block into the first level of the stack.
• Step 3:— Load the source data label (LDLBL Kaaa) into the accumulator when copying data from 7
ladder memory to V-memory. This is the source location of the value.
• Step 4:— Insert the MOVMC instruction which specifies destination in V-memory (Vaaa). This is
the copy destination.
8
Operand Data Type DL05 Range
9
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–97


Chapter 5: Standard RLL Instructions - Table Instructions

Copy Data From a Data Label Area to V-memory


1 In the example to the right, data is copied from a Data Label Area to V-memory. When X1 is
on, the constant value (K4) is loaded into the accumulator using the Load instruction. This
2 value specifies the length of the table and is placed in the second stack location after the next
Load and Load Label (LDLBL) instructions are executed. The constant value (K0) is loaded
into the accumulator, specifying the offset for the source and destination data. It is placed in
3 the first stack location after the LDLBL instruction is executed. The source address where
data is being copied from is loaded into the accumulator using the LDLBL instruction. The
4 MOVMC instruction specifies the destination starting location and executes the copying of
data from the Data Label Area to V-memory.
5
6 Data label area
programmed after
Direct SOFT32
X1 LD
the END instruction K4
7 DLBL K1
.
. Load the value 4 into the
accumulator specifying the

8 N
K
C
1
O
2
N
3 4
1 2 3 4 V2000 number of locations to be
copied.

N C O N 4 5 3 2 V2001 LD

9 K

N
4

C
5

O
3

N
2
6 1 5 1 V2002
K0

Load the value 0 into the


accumulator specifying the
10 K

N
6

C
1

O
5

N
1
8 8 4 5 V2003
offset for source and
destination locations
K 8 8 4 5

11 X X
.
X X V2004
LDLBL
K1

. Load the value 1 into the


12 accumulator specifying the
Data Label Area K1 as the
starting address of the data
to be copied.

13 Handheld Programmer Keystrokes

$ B
MOVMC
ENT V2000
STR 1

14 SHFT L
ANDST
D
3
SHFT K
JMP
E
4
ENT V2000 is the destination
starting address for the data
to be copied.
L D K A
A SHFT
ANDST
L D
3
L
SHFT

B L
JMP 0
ENT

B
SHFT ENT
ANDST 3 ANDST 1 ANDST 1

B SHFT M
ORST
O
INST#
V
AND
M
ORST
C
2
C
2
A
0
A
0
A
0
ENT

C
D

5–98 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - CPU Control Instructions

CPU Control Instructions 1


No Operation (NOP)
The No Operation is an empty (not programmed) memory location. NOP 2
Direct SOFT32 Handheld Programmer Keystrokes

N O P
3
SHFT ENT
NOP TMR INST# CV

4
End (END) 5
The End instruction marks the termination point of the normal
program scan. An End instruction is required at the end of the main
program body. If the End instruction is omitted an error will occur and
END 6
the CPU will not enter the Run Mode. Data labels, subroutines and
interrupt routines are placed after the End instruction. The End 7
instruction is not conditional; therefore, no input contact is allowed.

Direct SOFT32 Handheld Programmer Keystrokes


8
END
SHFT E
4
N
TMR
D
3
ENT
9
10
Stop (STOP)
The Stop instruction changes the operational mode of the CPU
11
from Run to Program (Stop) mode. This instruction is typically STOP
used to stop PLC operation in an error condition. 12
In the following example, when C0 turns on, the CPU will stop
operation and switch to the program mode. 13
DirectSOFT32 Handheld Programmer Keystrokes
14
C0 $ SHFT C A ENT
STR 2 0
STOP
SHFT S
RST
SHFT T
MLR
O
INST#
P
CV
ENT
A
B
Discrete Bit Flags Description
SP16 On when the DL05 goes into the TERM_PRG mode.
C
SP53 On when the DL05 goes into the PRG mode.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–99


Chapter 5: Standard RLL Instructions - CPU Control Instructions

Reset Watch Dog Timer (RSTWT)


1 The Reset Watch Dog Timer instruction resets the CPU scan
timer. The default setting for the watch dog timer is 200ms.
2 Scan times very seldom exceed 200ms, but it is possible.
For/next loops, subroutines, interrupt routines, and table
RSTWT

instructions can be programmed such that the scan becomes


3 longer than 200ms. When instructions are used in a manner
that could exceed the watch dog timer setting, this
4 instruction can be used to reset the timer.
A software timeout error (E003) will occur and the CPU will enter the program mode if the
5 scan time exceeds the watch dog timer setting. Placement of the RSTWT instruction in the
program is very important. The instruction has to be executed before the scan time exceeds
the watch dog timer’s setting.
6 If the scan time is consistently longer than the watch dog timer’s setting, the timeout value
may be permanently increased from the default value of 200ms by AUX 55 on the HPP or
7 the appropriate auxiliary function in your programming package. This eliminates the need for
the RSTWT instruction.
8 In the following example the CPU scan timer will be reset to 0 when the RSTWT instruction
is executed. See the For/Next instruction for a detailed example.
9 Direct SOFT 32 Handheld Programmer Keystrokes

R S T W T
10 RSTWT
SHFT
ORN RST MLR ANDN MLR
ENT

11
12
13
14
A
B
C
D

5–100 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Program Control Instructions

Program Control Instructions 1


For / Next (FOR) (NEXT)
The For and Next instructions are used to execute a section of 2
ladder logic between the For and Next instruction a specified
numbers of times. When the For instruction is enabled, the
A aaa
FOR 3
program will loop the specified number of times. If the For
instruction is not energized the section of ladder logic between the
For and Next instructions is not executed.
4
For / Next instructions cannot be nested. The normal I/O update
and CPU housekeeping is suspended while executing the For / 5
Next loop. The program scan can increase significantly, depending
on the amount of times the logic between the For and Next
NEXT
6
instruction is executed. With the exception of immediate I/O
instructions, I/O will not be updated until the program execution
is completed for that scan. Depending on the length of time
7
required to complete the program execution, it may be necessary
to reset the watch dog timer inside of the For / Next loop using 8
the RSTWT instruction.
9
Operand Data Type
....................................A
DL05 Range
aaa
10
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
All (See page 4–28)
1-9999 11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–101


Chapter 5: Standard RLL Instructions - Program Control Instructions

In the following example, when X1 is on, the application program inside the For / Next loop
1 will be executed three times. If X1 is off the program inside the loop will not be executed.
The immediate instructions may or may not be necessary depending on your application.
2 Also, The RSTWT instruction is not necessary if the For / Next loop does not extend the
scan time larger the Watch Dog Timer setting. For more information on the Watch Dog
Timer, refer to the RSTWT instruction.
3 Direct SOFT32
1 2 3
X1 K3

4 FOR

5 RSTWT

6 X20 Y5
OUT

7
8 NEXT

9 Handheld Programmer Keystrokes

10 $
STR
B
1
ENT

SHFT F O R D ENT

11 SHFT R
ORN
5 INST#
S
RST
T
ORN

MLR
W
ANDN
T
MLR
3

ENT

12 $
STR
SHFT I
8
C
2
A
0
ENT

GX F ENT
OUT 5
13 SHFT N
TMR
E
4
X
SET
T
MLR
ENT

14
A
B
C
D

5–102 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Program Control Instructions

Goto Subroutine (GTS) (SBR)


The Goto Subroutine instruction allows a section of ladder 1
logic to be placed outside the main body of the program K aaa
execute only when needed. There can be a maximum of 64
GTS instructions and 64 SBR instructions used in a program.
GTS
2
The GTS instructions can be nested up to 8 levels. An error
E412 will occur if the maximum limits are exceeded. Typically 3
this will be used in an application where a block of program
logic may be slow to execute and is not required to execute
every scan. The subroutine label and all associated logic is SBR K aaa
4
placed after the End statement in the program. When the
subroutine is called from the main program, the CPU will 5
execute the subroutine (SBR) with the same constant number
(K) as the GTS instruction which called the subroutine. 6
By placing code in a subroutine it is only scanned and executed when needed since it resides
after the End instruction. Code which is not scanned does not impact the overall scan time of
the program.
7
Operand Data Type DL05 Range 8
aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-FFFF 9
Subroutine Return (RT) 10
When a Subroutine Return is executed in the subroutine the RT
CPU will return to the point in the main body of the program 11
from which it was called. The Subroutine Return is used as
termination of the subroutine which must be the last
instruction in the subroutine and is a stand alone instruction
12
(no input contact on the rung).
Subroutine Return Conditional (RTC)
RTC 13
The Subroutine Return Conditional instruction is a optional
instruction used with a input contact to implement a 14
conditional return from the subroutine. The Subroutine Return (RT) is still required for
termination of the Subroutine. A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–103


Chapter 5: Standard RLL Instructions - Program Control Instructions

In the following example, when X1 is on, Subroutine K3 will be called. The CPU will jump
1 to the Subroutine Label K3 and the ladder logic in the subroutine will be executed. If X35 is
on the CPU will return to the main program at the RTC instruction. If X35 is not on
2 Y0–Y17 will be reset to off and then the CPU will return to the main body of the program.
Direct SOFT32 Display X1 K3

3 C0
LD
GTS

K10

4
5 SBR K3
END

6 X20 Y5
OUTI

7 X21 Y10
OUTI

8 X35
RT C

X35

9
Y0 Y17
RSTI

10 RT

Handheld Programmer Keystrokes

11 $
STR
B
1
ENT

SHFT G T S D ENT

12 6 MLR RST 3

SHFT E N D ENT

13 SHFT S
4

RST
TMR

SHFT B
3

1
R
ORN
D
3
ENT

$ I C A

14 GX
OUT
STR
SHFT

SHFT I
8

8
F
2

5
ENT
0
ENT

A $

GX
STR
SHFT

SHFT
I

I
8
C

B
2
B

A
1
ENT

ENT
OUT 8 1 0

B $
STR
SHFT

R
I

T
8
C
D
3
F
5
ENT

SHFT ENT
ORN MLR 2

C SP
STRN
SHFT I
8
D
3
F
5
ENT

S SHFT I A B H ENT

D RST

SHFT R
ORN
T
MLR
8

ENT
0 1 7

5–104 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Program Control Instructions

In the following example, when X1 is on, Subroutine K3 will be called. The CPU will jump
to the Subroutine Label K3 and the ladder logic in the subroutine will be executed. The CPU 1
will return to the main body of the program after the RT instruction is executed.
Direct SOFT 32 2
X1 K3

GTS 3
4
END 5
6
SBR K3

7
X20 Y5

OUT
8
X21 Y10
9
OUT
10
RT 11
Handheld Programmer Keystrokes
12
$
STR
G
B

T
1
S
ENT

D
13
SHFT ENT
6 MLR RST 3

14
SHFT E
4
N
TMR
D
3
ENT A
SHFT S SHFT B R D ENT

$
RST

SHFT I
1
C
ORN
A ENT
3
B
STR 8 2 0
GX
OUT
F
5
ENT C
$ SHFT I C B ENT

GX
OUT
STR
B
8

1
A
0
ENT
2 1
D
SHFT R T ENT
ORN MLR

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–105


Chapter 5: Standard RLL Instructions - Program Control Instructions

Master Line Set (MLS)


1 The Master Line Set instruction allows the program to control
sections of ladder logic by forming a new power rail controlled K aaa
2 by the main left power rail. The main left rail is always master
line 0. When a MLS K1 instruction is used, a new power rail is
MLS

created at level 1. Master Line Sets and Master Line Resets can
3 be used to nest power rails up to seven levels deep.

4 Operand Data Type DL05 Range


aaa
5 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-7

6 Master Line Reset (MLR)


The Master Line Reset instruction marks the end of control K aaa

7 for the corresponding MLS instruction. The MLR reference


is one less than the corresponding MLS.
MLR

8 Operand Data Type DL05 Range


aaa
9 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0-7

10 Understanding Master Control Relays


The Master Line Set (MLS) and Master Line Reset (MLR) instructions allow you to quickly
11 enable (or disable) sections of the RLL program. This provides program control flexibility.
The following example shows how the MLS and MLR instructions operate by creating a sub
power rail for control logic.
12 Direct SOFT32
X0 K1
When contact X0 is ON, logic under the first MLS
13 MLS will be executed.

X1 Y7

14 OUT

X2 K2

A MLS
When contact X0 and X2 are ON, logic under the
second MLS will be executed.

X3 Y10

B OUT

K1

C MLR
The MLR instructions note the end of the Master
K0 Control area.

D MLR

X10 Y11
OUT

5–106 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Program Control Instructions

MLS/MLR Example
In the following MLS/MLR example logic between the first MLS K1 (A) and MLR K0 (B) 1
will function only if input X0 is on. The logic between the MLS K2 (C) and MLR K1 (D)
will function only if input X10 and X0 is on. The last rung is not controlled by either of the
MLS coils.
2
DirectSOFT32
X0
Handheld Programmer Keystrokes 3
K1
A $ A
MLS
Y
STR
B
0
ENT

ENT
4
X1 C0 MLS 1

OUT $
STR
B
1
ENT 5
X2 GX C A
C1

OUT
$
OUT
C
SHFT

ENT
2 0
ENT
6
STR 2
X3 Y0

OUT
GX
OUT
SHFT C
2
B
1
ENT 7
$ D
X10 K2
C
GX
STR
A
3
ENT
8
MLS ENT
OUT 0

X5 Y1
$
STR
B
1
A
0
ENT 9
OUT Y C

X4 Y2 $
MLS
F
2
ENT
10
ENT
STR 5
OUT

K1
GX
OUT
B
1
ENT 11
D
MLR
$

GX
STR
E

C
4
ENT
12
X5 C2 ENT
OUT 2
OUT T
MLR
B
1
ENT
13
X6 Y3

OUT
$

GX
STR
F
5
C
ENT

C
14
SHFT ENT
OUT 2 2
K0

MLR
B
$
STR
G
6
ENT
A
X7 Y4

OUT
GX
OUT
D
3
ENT
B
T A ENT

$
MLR

STR
H
0

7
ENT
C
GX
OUT
E
4
C
2
ENT
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–107


Chapter 5: Standard RLL Instructions - Interrupt Instructions

1 Interrupt Instructions INT O aaa


Interrupt (INT)
2 The Interrupt instruction allows a section of ladder
logic to be placed below the main body of the program
3 and executed only when needed. High-Speed I/O
INT 1
Modes 10, 20, and 40 can generate an interrupt. With
4 Mode 40, you may select an external interrupt (input
X0), or a time-based interrupt (5–999 mS).

5 Typically, interrupts are used in an application when a fast response to an input is needed or a
program section must execute faster than the normal CPU scan. The interrupt label and all
associated logic must be placed after the End statement in the program. When an interrupt
6 occurs, the CPU will complete execution of the current instruction it is processing in ladder
logic, then execute the interrupt routine. After interrupt routine execution, the ladder
7 program resumes from the point at which it was interrupted.
See Chapter 3, the section on Mode 40 (Interrupt) Operation for more details on interrupt
configuration. In the DL05, only one hardware interrupt is available.
8
Operand Data Type DL05 Range
9 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . O 0, 1

10 Interrupt Return (IRT)


An Interrupt Return is normally executed as the last instruction
11 in the interrupt routine. It returns the CPU to the point in the
main program from which it was called. The Interrupt Return
IRT

is a stand-alone instruction (no input contact on the rung).


12 Interrupt Return Conditional (IRTC)
The Interrupt Return Conditional instruction is a optional
13 instruction used with an input contact to implement a IRTC
conditional return from the interrupt routine. The Interrupt
14 Return is required to terminate the interrupt routine.
Enable Interrupts (ENI)
A The Enable Interrupt instruction is placed in the main ladder
program (before the End instruction), enabling the interrupt. ENI
B The interrupt remains enabled until the program executes a
Disable Interrupt instruction.
C
D

5–108 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Interrupt Instructions

Disable Interrupts (DISI)


A Disable Interrupt instruction in the main body of the 1
application program (before the End instruction) will disable
the interrupt (either external or timed). The interrupt remains
disabled until the program executes an Enable Interrupt
DISI
2
instruction.
External Interrupt Program Example
3
In the following example, we do some initialization on the first scan, using the first-scan
contact SP0. The interrupt feature is the HSIO Mode 40. Then we configure X0 as the
4
external interrupt by writing to its configuration register, V7634. See Chapter 3, Mode 40
Operation for more details. 5
During program execution, when X2 is on the interrupt is enabled. When X2 is off the
interrupt will be disabled. When an interrupt signal (X0) occurs the CPU will jump to the 6
interrupt label INT O 0. The application ladder logic in the interrupt routine will be
performed. The CPU will return to the main body of the program after the IRT instruction is
executed.
7
8
Direct SOFT32 Handheld Programmer Keystrokes
SP0 LD Load the constant value
K40 (K40) into the lower 16 bits
of the accumulator
$
STR
L
SHFT

D
SP
STRN
A
0
ENT

K E A
9
OUT Copy the value in the lower SHFT SHFT ENT
16 bits of the accumulator to ANDST 3 JMP 4 0

LD
V7633
V7633

Load the constant value (K4)


GX
OUT
SHFT V
AND
H
7
G
6
D
3
D
3
ENT 10
K4 into the lower 16 bits of the L D K E
SHFT SHFT ENT

OUT
accumulator

Copy the value in the lower


16 bits of the accumulator to
GX
OUT
ANDST

SHFT
3
V
AND
H
7
G
JMP

6
D
4

3
E
4
ENT
11
V7634
V7634 $ C
X2
ENI SHFT
STR
E N
2
I
ENT

ENT
12
4 TMR 8
X2
DISI
SP
STRN
D
C

I
2
S
ENT

I
13
SHFT ENT
3 8 RST 8

14
SHFT E N D ENT
END
SHFT I
4

8
N
TMR

TMR
T
MLR
3
A
0
ENT
A
INT O0

X1 Y5
$

X
STR
SHFT

SHFT
I

I
8
B

F
1
ENT

ENT
B
SETI SET 8 5

X3 Y7
SETI
$
STR
SHFT I

I
8
D

H
3
ENT
C
X SHFT ENT
SET 8 7

IRT SHFT I
8
R
ORN
T
MLR
ENT D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–109


Chapter 5: Standard RLL Instructions - Interrupt Instructions

Timed Interrupt Program Example


1 In the following example, we do some initialization on the first scan, using the first-scan
contact SP0. The interrupt feature is the HSIO Mode 40. Then we configure the HSIO timer
2 as a 10 mS interrupt by writing K104 to the configuration register for X0 (V7634). See
Chapter 3, Mode 40 Operation for more details.
3 When X4 turns on, the interrupt will be enabled. When X4 turns off, the interrupt will be
disabled. Every 10 mS the CPU will jump to the interrupt label INT O 0. The application
ladder logic in the interrupt routine will be performed. If X3 is not on Y0–Y7 will be reset to
4 off and then the CPU will return to the main body of the program.
Direct SOFT32 Handheld Programmer Keystrokes

5 SP0
LD
K40
Load the constant value
(K40) into the lower 16 bits
of the accumulator
$
STR
B
1
ENT

SHFT L D SHFT K E A ENT


ANDST 3 JMP 4 0

6 OUT
V7633
Copy the value in the lower
16 bits of the accumulator to
V7633
GX
OUT
SHFT V
AND
H
7
G
6
D
3
D
3
ENT

SHFT L D SHFT K B A E ENT

7 LD
K104
Load the constant value
(K10) into the lower 16 bits
of the accumulator
GX
OUT
ANDST

SHFT
3
V
AND
H
7
G
JMP

6
D
1

3
E
0

4
ENT
4

$ E ENT

8 OUT Copy the value in the lower


16 bits of the accumulator to
SHFT
STR
E
4
N
TMR
4
I
8
ENT
V7634 V7634
SP E

9 X4

ENI
STRN

SHFT D
3
I
4

8
S
ENT

RST
I
8
ENT

10 X4
DISI
SHFT E N D ENT

11 END
SHFT I
4

8
N
TMR

TMR
T
MLR
3
A
0
ENT

$ SHFT I C ENT

12 INT O0
X
STR

SET
SHFT I
8

8
F
2

5
ENT

SP I D

13 X2 Y5

SETI
STRN
X
SET
SHFT

SHFT I
8

8
A
3

0
ENT

H
7
ENT

14 X3 Y0

RSTI
Y7 SHFT I
8
R
ORN
T
MLR
ENT

A IRT

B Independent Timed Interrupt


Interrupt O1 is also available as an interrupt. This interrupt is independent of the HSIO
C features. Interrupt O1 uses an internal timer that is configured in V-memory location V7647.
The interrupt period can be adjusted from 5 to 9999 mS. Once the interrupt period is set and the
interrupt is enabled in the program, the CPU will continuously call the interrupt routine based on the time
D setting in V7647.
Input Configuration Register Function Hex Code Required
– V7647 High-Speed Timed Interrupt xxxx (xxxx = timer setting) 5 - 9999 mS (BCD)

5–110 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Message Instructions

Message Instructions 1
Fault (FAULT)
The Fault instruction is used to display a message on the handheld 2
programmer or in the DirectSOFT32 status bar. The message has a FAULT
maximum of 23 characters and can be either V-memory data, A aaa 3
numerical constant data or ASCII text.
To display the value in a V-memory location, specify the V-memory location in the
instruction. To display the data in ACON (ASCII constant) or NCON (Numerical constant)
4
instructions, specify the constant (K) value for the corresponding data label area.
5
Operand Data Type DL05 Range
....................................A aaa 6
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-FFFF 7
SP50
Discrete Bit Flags
On when the FAULT instruction is executed
Description
8
Fault Example 9
In the following example when X1 is on, the message
SW 146 will display on the handheld programmer. FAULT :
10
The NCONs use the HEX ASCII equivalent of the *SW 146

text to be displayed. (The HEX ASCII for a blank is


20, a 1 is 31, 4 is 34 ...)
11
12
Direct SOFT32

X1
Handheld Programmer Keystrokes
13
FAULT $ B ENT
STR 1

14
K1

SHFT F A U L T B ENT
5 0 ISG ANDST MLR 1

DLBL
END

E N D
A
K1 SHFT ENT
4 TMR 3

ACON
A SW
SHFT D
3
L
ANDST
B
1
L
ANDST
B
1
ENT B
SHFT A C O N S W ENT

NCON
K 2031
SHFT N
TMR
0
C
2

2
INST#
O
INST#
N
TMR

TMR
C
RST

2
ANDN
A
0
D
3
B
1
ENT
C
N C O N D E D G
SHFT
TMR 2 INST# TMR 3 4 3 6
ENT
D
NCON
K 3436

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–111


Chapter 5: Standard RLL Instructions - Message Instructions

Data Label (DLBL)


1 The Data Label instruction marks the beginning of an
ASCII / numeric data area. DLBLs are programmed after DLBL K aaa
2 the End statement. A maximum of 64 DLBL instructions
can be used in a program. Multiple NCONs and
ACONs can be used in a DLBL area.
3
4 Operand Data Type DL05 Range
aaa

5 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-FFFF

ASCII Constant (ACON)


6 The ASCII Constant instruction is used with the
DLBL instruction to store ASCII text for use with
ACON
7 other instructions. Two ASCII characters can be stored
in an ACON instruction. If only one character is
A aaa

stored in an ACON a leading space will be inserted.


8
Operand Data Type DL05 Range
9 aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A 0-9 A-Z
10 Numerical Constant (NCON)
11 The Numerical Constant instruction is used with the
DLBL instruction to store the HEX ASCII equivalent
of numerical data for use with other instructions. Two
12 digits can be stored in an NCON instruction.
NCON
K aaa

13
Operand Data Type DL05 Range
14 aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0-FFFF
A
B
C
D

5–112 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Message Instructions

Data Label Example


In the following example, an ACON and two NCON instructions are used within a DLBL 1
instruction to build a text message. See the FAULT instruction for information on displaying
messages. The DV-1000 Manual also has information on displaying messages. 2
Direct SOFT32
3
4
END
5
DLBL
K1 6
ACON
A SW
7
8
NCON
K 2031
9
10
NCON
K 3436
11
Handheld Programmer Keystrokes
12
13
E N D
SHFT

SHFT D
4
L
TMR
B
3
L
ENT

B ENT
14
3 ANDST 1 ANDST 1

SHFT A
0
C
2
O
INST#
N
TMR
S
RST
W
ANDN
ENT A
N C O N C A D B
SHFT

SHFT N
TMR
C
2 INST#
O N
TMR
D
2
E
0
D
3
G
1
ENT

ENT
B
TMR 2 INST# TMR 3 4 3 6

C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–113


Chapter 5: Standard RLL Instructions - Message Instructions

Print Message (PRINT)


1 The Print Message instruction prints the embedded text PRINT A aaa
or text/data variable message to the specified “Hello, this is a PLC message”
2 communications port (Port 2 on the DL05 CPU),
which must have the communications port configured.
3 Operand Data Type DL05 Range

4 ....................................A
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
aaa
2

5 You may recall from the CPU specifications in Chapter 3 that the DL05’s ports are capable of
several protocols. Port 1 cannot be configured for the non-sequence protocol. To configure
port 2 using the Handheld Programmer, use AUX 56 and follow the prompts, making the
6 same choices as indicated below on this page. To configure a port in DirectSOFT32, choose
the PLC menu, then Setup, then Setup Secondary Comm Port.
7 • Port: From the port number list box at the top, choose “Port 2”.
• Protocol: Click the check box to the left of “Non-sequence”, and then you’ll see the dialog box
8 shown below.

9
10
11
12
13
14
A
B • Baud Rate: Choose the baud rate that matches your printer.
• Stop Bits, Parity: Choose number of stop bits and parity setting to match your printer.

C • Memory Address: Choose a V-memory address for DirectSOFT32 to use to store the port setup
information. You will need to reserve 9 words in V-memory for this purpose. Select “Always use for
printing” if it applies.
D Then click the button indicated to send the Port 2 configuration to the CPU,
and click Close. Then see Chapter 3 for port wiring information, in order to
connect your printer to the DL05.

5–114 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Message Instructions

Port 2 on the DL05 has standard RS232 levels, and should work with most printer serial
input connections. 1
Text element – this is used for printing character strings. The character strings are defined as
the character (more than 0) ranged by the double quotation marks. Two hex numbers
preceded by the dollar sign means an 8-bit ASCII character code. Also, two characters
2
preceded by the dollar sign is interpreted according to the following table:
3
# Character code Description
1
2
$$
$”
Dollar sign ($)
Double quotation (”)
4
3 $L or $l Line feed (LF)
4 $N or $n Carriage return line feed (CRLF) 5
5 $P or $p Form feed
6
7
$R or $r
$T or $t
Carriage return (CR)
Tab
6
The following examples show various syntax conventions and the length of the output to the 7
printer.
Example: 8
”” Length 0 without character
”A” Length 1 with character A 9
”” Length 1 with blank
” $” ” Length 1 with double quotation mark 10
”$R$L” Length 2 with one CR and one LF
”$0D$0A” Length 2 with one CR and one LF 11
”$$” Length 1 with one $ mark
In printing an ordinary line of text, you will need to include double quotation marks before
12
and after the text string. Error code 499 will occur in the CPU when the print instruction
contains invalid text or no quotations. It is important to test your PRINT instruction data 13
during the application development.
The following example prints the message to port 2. We use a PD contact, which causes the 14
message instruction to be active for just one scan. Note the $N at the end of the message,
which produces a carriage return / line feed on the printer. This prepares the printer to print
the next line, starting from the left margin.
A
X1
B
PRINT K2 Print the message to Port 2 when
“Hello, this is a PLC message.$N” X1 makes an off-to-on transition. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–115


Chapter 5: Standard RLL Instructions - Message Instructions

V-memory element - this is used for printing V-memory contents in the integer format or
1 real format. Use V-memory number or V-memory number with “-” and data type. The data
types are shown in the table below. The Character code must be capital letters.
2 NOTE: There must be a space entered before and after the V-memory address to separate it from the text
string. Failure to do this will result in an error code 499.
3 # Character code Description
1 none 16-bit binary (decimal number)
4 2 :B 4 digit BCD
3 :D 32-bit binary (decimal number)
5 4 :DB 8 digit BCD

Example:
6 V2000 Print binary data in V2000 for decimal number
V2000 : B Print BCD data in V2000
7 V2000 : D Print binary number in V2000 and V2001 for decimal number

8 V2000 : D B Print BCD data in V2000 and V2001


Example: The following example prints a message containing text and a variable. The “reactor
temperature” labels the data, which is at V2000. You can use the : B qualifier after the V2000
9 if the data is in BCD format, for example. The final string adds the units of degrees to the
line of text, and the $N adds a carriage return / line feed.
10 X1 PRINT K2 Print the message to Port 2
“Reactor temperature = ” V2000 “deg. $N” when X1 makes an off-to-on
11 Message will read:
⊥ ⊥ transition.
⊥ represents a space

Reactor temperature = 0156 deg


12 V-memory text element ¨This is used for printing text stored in V-memory. Use the %
followed by the number of characters after V-memory number for representing the text. If
13 you assign “0” as the number of characters, the print function will read the character count
from the first location. Then it will start at the next V-memory location and read that number
14 of ASCII codes for the text from memory.
Example:
A V2000 % 16 16 characters in V2000 to V2007 are printed.
V2000 % 0 The characters in V2001 to Vxxxx (determined by the number in V2000)
B will be printed.

C
D

5–116 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Message Instructions

Bit element – this is used for printing the state of the designated bit in V-memory or a relay
bit. The bit element can be assigned by the designating point (.) and bit number preceded by 1
the V-memory number or relay number. The output type is described as shown in the table
below. 2
# Data format Description
1 none Print 1 for an ON state, and 0 for an 3
OFF state
2 : BOOL Print “TRUE” for an ON state, and
“FALSE” for an OFF state 4
3 : ONOFF Print “ON” for an ON state, and “OFF”
for an OFF state
Example:
5
V2000 . 15 Prints the status of bit 15 in V2000, in 1/0 format
C100 Prints the status of C100 in 1/0 format
6
C100 : BOOL Prints the status of C100 in TRUE/FALSE format 7
C100 : ON/OFF Prints the status of C00 in ON/OFF format
V2000.15 : BOOL Prints the status of bit 15 in V2000 in TRUE/FALSE format 8
The maximum numbers of characters you can print is 128. The number of characters for
each element is listed in the table below: 9
Element Type Maximum Characters
Text, 1 character 1 10
16 bit binary 6
32 bit binary
4 digit BCD
11
4
11
8 digit BCD
Floating point (real number)
8
12 12
Floating point (real with exponent) 12
V-memory/text
Bit (1/0 format)
2
1
13
Bit (TRUE/FALSE format)
Bit (ON/OFF format)
5
3 14
The handheld programmer’s mnemonic is “PRINT,” followed by the DEF field.
Special relay flags SP116 and SP117 indicate the status of the DL05 CPU ports (busy, or
A
communications error). See the appendix on special relays for a description.
B
NOTE: You must use the appropriate special relay in conjunction with the PRINT command to ensure the
ladder program does not try to PRINT to a port that is still busy from a previous PRINT or WX or RX
instruction.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–117


Chapter 5: Standard RLL Instructions - Network Instructions

1 Network Instructions
Read from Network (RX)
2 The Read from Network instruction causes the master device on a
network to read a block of data from a slave device on the same
3 network. The function parameters are loaded into the accumulator
RX
A aaa
and the first and second level of the stack. Listed below are the
4 program steps necessary to execute the Read from Network
function.

5 Step 1: — Load the slave address (0–90 BCD) into the low byte and “F2” into the high byte
of the accumulator (the next two instructions push this word down to the second layer of the
stack).
6 Step 2: — Load the number of bytes to be transferred into the accumulator (the next
instruction pushes this word onto the top of the stack).
7 Step 3: — Load the starting Master CPU address into the accumulator. This is the memory
location where the data read from the slave will be put. This parameter requires a HEX value.
8 Step 4: — Insert the RX instruction which specifies the starting V-memory location (Aaaa)
where the data will be read from in the slave.
9 Helpful Hint: — For parameters that require HEX values, the LDA instruction can be used
to convert an octal address to the HEX equivalent and load the value into the accumulator.
10 Operand Data Type DL05 Range
....................................A aaa
11 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V mem. (See page 4–28)
12 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0–377
0–377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0–777
13 Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177
14 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP
0–177
0–777
Program Memory . . . . . . . . . . . . . . . . . . . . . . . $ 0–2047 (2K program mem.)
A
B
C
D

5–118 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Network Instructions

In the following example, when X1 is on and the port busy relay SP116 (see special relays) is
not on, the RX instruction will access port 2 operating as a master. Ten consecutive bytes of 1
data (V2000 – V2004) will be read from a CPU at station address 5 and copied into
V-memory locations V2300–V2304 in the CPU with the master port. 2
Direct SOFT32

X1 SP116 LD
KF205
3
Master Slave
The constant value KF205
specifies the port number (2)
and the slave address (5)
CPU CPU 4
LD
K10
X X X X X X X X V1777
5
V2277
The constant value K10
specifies the number of
bytes to be read
V2300
V2301
3
8
4
5
5
3
7
4
3
8
4
5
5
3
7
4
V2000
V2001
6
V2302 1 9 3 6 1 9 3 6 V2002
LDA
O 2300 V2303 9 5 7 1 9 5 7 1 V2003 7
V2304 1 4 2 3 1 4 2 3 V2004
Octal address 2300 is
converted to 4C0 HEX and
loaded into the accumulator.
V2300 is the starting
V2305 X X X X X X X X V2005
8
location for the Master CPU
where the specified data will
be read into 9
RX
V2000
10
V2000 is the starting
location in the for the Slave
CPU where the specified
11
data will be read from

Handheld Programmer Keystrokes


12
$
STR
B
1
ENT 13
W SHFT SP B B G ENT
ANDN

SHFT L D
STRN

SHFT
1
K
1

SHFT
6
F SHFT C A F ENT
14
ANDST 3 JMP 5 2 0 5

SHFT L
ANDST
D
3
SHFT K
JMP
B
1
A
0
ENT A
L D A C D A A
SHFT

SHFT
ANDST
R X
3 0
C A
2
A
3
A
0

ENT
0
ENT
B
ORN SET 2 0 0 0

C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–119


Chapter 5: Standard RLL Instructions - Network Instructions

Write to Network (WX)


1 The Write to Network instruction is used to write a
block of data from the master device to a slave device on
2 the same network. The function parameters are loaded
into the accumulator and the first and second level of
WX
A aaa
the stack. Listed below are the program steps necessary
3 to execute the Write to Network function.
Step 1: — Load the slave address (0–90 BCD) into the low byte and “F2” into the high byte
4 of the accumulator (the next two instructions push this word down to the second layer of the
stack).
5 Step 2: — Load the number of bytes to be transferred into the accumulator (the next
instruction pushes this word onto the top of the stack).
6 Step 3: — Load the starting Master CPU address into the accumulator. This is the memory
location where the data will be written from. This parameter requires a HEX value.
7 Step 4: — Insert the WX instruction which specifies the starting V-memory location (Aaaa)
where the data will be written to in the slave.
8 Helpful Hint: — For parameters that require HEX values, the LDA instruction can be used
to convert an octal address to the HEX equivalent and load the value into the accumulator.
9
Operand Data Type DL05 Range
10 ....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 4–28)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V mem. (See page 4–28)
11 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0–377
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0–377
12 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–777
0–377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0–177
13 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0–177
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP 0–777
14 Program Memory . . . . . . . . . . . . . . . . . . . . . . . $ 0–2048 (2K program mem.)

A
B
C
D

5–120 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL Instructions - Network Instructions

In the following example when X1 is on and the module busy relay SP116 (see special relays)
is not on, the WX instruction will access port 2 operating as a master. Ten consecutive bytes 1
of data is read from the Master CPU and copied to V-memory locations V2000–V2004 in
the slave CPU at station address 5.
Direct SOFT32
2
X1 SP116 LD
KF205
3
Master Slave
The constant value KF205
specifies the port number (2)
and the slave address (5)
CPU CPU 4
LD
K10
V2277 X X X X X X X X V1777
5
The constant value K10
specifies the number of
bytes to be written
V2300
V2301
3
8
4
5
5
3
7
4
3
8
4
5
5
3
7
4
V2000
V2001 6
V2302 1 9 3 6 1 9 3 6 V2002
LDA
O 2300 V2303
V2304
9
1
5
4
7
2
1
3
9
1
5
4
7
2
1
3
V2003
V2004
7
Octal address 2300 is
converted to 4C0 HEX and
loaded into the accumulator.
V2300 is the starting
V2305 X X X X X X X X V2005
8
location for the Master CPU
where the specified data will
be read from. 9
WX
V2000
10
V2000 is the starting
location in the for the Slave
CPU where the specified
11
data will be written to

Handheld Programmer Keystrokes


12
$
STR
B
1
ENT
13
W SHFT SP B C E ENT
ANDN

SHFT L
ANDST
D
3
STRN

SHFT
1
K
JMP
1

SHFT
6
F
5
SHFT
C
2
A
0
F
5
ENT
14
SHFT L
ANDST
D
3
SHFT K
JMP
B
1
A
0
ENT
A
SHFT L D A C D A A ENT

SHFT
ANDST
W
ANDN
X
SET
3 0
C
2
A
2

0
A
3

0
A
0

0
ENT
0
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 5–121


DRUM INSTRUCTION CHAPTER
PROGRAMMING
6
In This Chapter:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–2
Step Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–4
Overview of Drum Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–8
Drum Control Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–10
Drum Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6–12
Event Drum (EDRUM) Instruction . . . . . . . . . . . . . . . . . . . . . . . . .6–14
Chapter 6: Drum Instruction Programming

1 Introduction
Purpose
2 The Event Drum (EDRUM) instruction in the DL05 CPU electronically simulates an
electro-mechanical drum sequencer. The instruction offers enhancements to the basic
3 principle, which we describe first.
Drum Terminology
4 Drum instructions are best suited for repetitive processes that consist of a finite number of
steps. They can do the work of many rungs of ladder logic with elegant simplicity. Therefore,
5 drums can save a lot of programming and debugging time.
We introduce some terminology associated with the drum instruction by describing the
6 original mechanical drum shown below. The mechanical drum generally has pegs on its
curved surface. The pegs are populated in a particular pattern, representing a set of desired
actions for machine control. A motor or solenoid rotates the drum a precise amount at
7 specific times. During rotation, stationary wipers sense the presence of pegs (present = on,
absent = off ). This interaction makes or breaks electrical contact with the wipers, creating
8 electrical outputs from the drum. The outputs are wired to devices on a machine for On/Off
control.
9 Drums usually have a finite number of positions within one rotation, called steps. Each step
represents some process step. At powerup, the drum resets to a particular step. The drum
rotates from one step to the next based on a timer, or on some external event. During special
10 conditions, a machine operator can manually increment the drum step using a jog control on
the drum’s drive mechanism. The contact closure of each wiper generates a unique on/off
11 pattern called a sequence, designed for controlling a specific machine. Because the drum is
circular, it automatically repeats the sequence once per rotation. Applications vary greatly, and
a particular drum may rotate once per second, or as slowly as once per week.
12 Pegs

13
14
A Wipers
Drum

B
C Outputs

D Electronic drums provide the benefits of mechanical drums and more. For example, they have
a preset feature that is impossible for mechanical drums: The preset function lets you move
from the present step directly to any other step on command!

6–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

Drum Chart Representation


For editing purposes, the electronic drum is presented in chart form in DirectSOFT32 and in 1
this manual. Imagine slicing the surface of a hollow drum cylinder between two rows of pegs,
then pressing it flat. Now you can view the drum as a chart as shown below. Each row
represents a step, numbered 1 through 16. Each column represents an output, numbered 0
2
through 15 (to match word bit numbering). The solid circles in the chart represent pegs (On
state) in the mechanical drum, and the open circles are empty peg sites (Off state). 3
OUTPUTS
STEP 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 4
1
2
3
4
5
5
6
7
8
6
9
10
11
12
7
13
14
15
16
8
Output Sequences 9
The mechanical drum sequencer derives its name from sequences of control changes on its
electrical outputs. The following figure shows the sequence of On/Off controls generated by 10
the drum pattern above. Compare the two, and you will find that they are equivalent! If you
can see their equivalence, you are well on your way to understanding drum instruction
operation.
11
Output
1
Step
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12
0 0

1
2
1
0
1
0
13
1
3
4
0
1
0
14
1
5
6
0
1
0
1
A
7 0

8
9
1
0
1
B
0

10
11
1
0
1
0
C
1
12
13
0
1
0
D
1
14 0
1
15 0

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–3


Chapter 6: Drum Instruction Programming

1 Step Transitions
Drum Instruction Types
2 There are two types of Drum instructions in the DL05 CPU:
• Timed Drum with Discrete Outputs (DRUM)
3 • Time and Event Drum with Discrete Outputs (EDRUM)
The two drum instructions include time-based step transitions, and the EDRUM includes
4 event-based transitions as well. Each drum has 16 steps, and each step has 16 outputs. Refer
to the figure below. Each output can be either an X, Y, or C coil, offering programming
5 flexibility. We assign Step 1 an arbitrary unique output pattern
Timer-Only Transitions
6 Drums move from one step to another based on time and/or an external event (input). Each
step has its own transition condition which you assign during the drum instruction entry. The
7 figure below shows how timer-only transitions work.
Step 1 Outputs : F f f f F f F f f f f F F f f f
8
9 Increment
count timer
10
11 No Ha s counts per
step expired?
12 Yes
13 Step 2 Outputs : f f f F f f f f F F f F f f F F

14
U s e next transition criteria
A The drum stays in Step 1 for a specific duration (user-programmable). The timebase of the
timer is programmable, from 0.01 seconds to 99.99 seconds. This establishes the resolution,
B or the duration of each “tick of the clock”. Each step uses the same timebase, but has its own
unique counts per step, which you program. When the counts for Step 1 have expired, then
C the drum moves to Step 2. The outputs change immediately to match the new pattern for
Step 2.
The drum spends a specific amount of time in each step, given by the formula:
D Time in step = 0.01 seconds X Timebase x Counts per step

6–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

For example, if you program a 5 second time base and 12 counts for Step 1, then the drum
will spend 60 seconds in Step 1. The maximum time for any step is given by the formula: 1
Max Time per step = 0.01 seconds X 9999 X 9999
= 999,800 seconds = 277.7 hours = 11.6 days 2
NOTE: When first choosing the timebase resolution, a good rule of thumb is to make it about 1/10 the
duration of the shortest step in your drum. Then you will be able to optimize the duration of that step in
10% increments. Other steps with longer durations allow optimizing by even smaller increments
3
(percentage-wise). Also, note that the drum instruction executes once per CPU scan. Therefore, it is
pointless to specify a drum timebase that is much faster than the CPU scan time. 4
Timer and Event Transitions 5
Step transitions may also occur based on time and/or external events. The figure below shows
how step transitions work in these cases. 6
Step 1 Outputs : F f f f F f F f f f f F F f f f
7
No
8
Is Step event
true?
9
Yes
10
Increment
count timer
11
Has step
12
No
counts expired?
13
Yes
14
Step 2 Outputs : f f f F f f f f F F f F f f F F
A
U s e next tra ns ition criteria
When the drum enters Step 1, it sets the output pattern as shown. Then it begins polling the
B
external input programmed for that step. You can define event inputs as X, Y, or C discrete
point types. Suppose we select X0 for the Step 1 event input. If X0 is off, then the drum
remains in Step 1. When X0 is On, the event criteria is met and the timer increments. The
C
timer increments as long as the event (X0) remains true. When the counts for Step 1 have
expired, then the drum moves to Step 2.The outputs change immediately to match the new D
pattern for Step 2.

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–5


Chapter 6: Drum Instruction Programming

Event-Only Transitions
1 Step transitions do not require both the event and the timer criteria programmed for each
step. You have the option of programming just one of the two, and even mixing transition
2 types among all the steps of the drum. For example, you might want Step 1 to transition on
an event, Step 2 to transition on time only, and Step 3 to transition on both time and an
event. Furthermore, you may elect to use only part of the 16 steps, and only part of the 16
3 outputs.

4
5 Step 1 Outputs:

6 No Is Step event
true?

7 Yes

Step 2 Outputs:

8 Use next transition criteria

9
Counter Assignments
10 Each drum instruction uses the resources of four counters in the CPU. When programming
the drum instruction, you select the first counter number. The drum also uses the next three
11 counters automatically. The counter bit associated with the first counter turns on when the
drum has completed its cycle, going off when the drum is reset. These counter values and the
counter bit precisely indicate the progress of the drum instruction, and can be monitored by
12 your ladder program.
Counter Assignments
Suppose we program a timer drum to have 8
13 steps, and we select CT10 for the counter number
CT10
CT11
Counts in step V1010
Timer Value V1011
1528
0200
(remember, counter numbering is in octal).
CT12
14 Counter usage is shown to the right. The right
column holds typical values, interpreted below.
CT13
Preset Step
Current Step
V1012
V1013
0001
0004

A CT10 shows that we are at the 1528th count in the current step, which is step 4 (shown in
CT13). If we have programmed step 4 to have 3000 counts, then the step is just over half
completed. CT11 is the count timer, shown in units of 0.01 seconds. So, each least-
B significant-digit change represents 0.01 seconds. The value of 200 means that we have been in
the current count (1528) for 2 seconds (0.01 x 100). Finally, CT12 holds the preset step value
C which was programmed into the drum instruction. When the drum’s Reset input is active, it
presets to step 1 in this case. The value of CT12 changes only if the ladder program writes to
it, or the drum instruction is edited and the program is restarted. Counter bit CT10 turns on
D when the drum cycle is complete, and turns off when the drum is reset.

6–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

Last Step Completion


The last step in a drum sequence may be any step number, since partial drums are valid. Refer 1
to the following figure. When the transition conditions of the last step are met, the drum sets
the counter bit corresponding to the counter named in the drum instruction box (such as
CT0). Then it moves to a final “drum complete” state. The drum outputs remain in the
2
pattern defined for the last step. Having finished a drum cycle, the Start and Jog inputs have
no effect at this point. The drum leaves the “drum complete” state when the Reset input 3
becomes active (or on a program-to–run mode transition). It resets the drum complete bit
(such as CT0), and then goes directly to the appropriate step number defined as the preset 4
step.
5
Las t step Outputs : F F F f f f F f f F f F F FfF

6
No Are tra ns ition
conditions met?
(Timer a nd/or
Event criteria )
7
Yes
8
Set
CT10 = 1 S et Drum Complete bit 9
10
Complete Outputs : F F F f f f F f f F f F F Ff F
11
No Res et Input
Active?
12
Yes 13
R es et
CT10 = 0
Res et Drum Complete bit 14
G o to Pres et Step
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–7


Chapter 6: Drum Instruction Programming

1 Overview of Drum Operation


Drum Instruction Block Diagram
2 The drum instruction utilizes various inputs and outputs in addition to the drum pattern
itself. Refer to the figure below.
3 Inputs DRUM INSTRUCTION Outputs
Block Diagram
4 Start

Jog
5 Real time
Input s
Reset
(from ladder )
Drum
6 Preset Step
Step
Step
f
f
f
f
f
f
F
f
f
f
f
f
f f
f f
F f
Final
Drum
Counts/Step Control Poi nter Outputs
F F f F F f
7 Timebase
f
f
f
F
F
F
F
F
f
f
f
f
F f
F F
F F
Programming f F F f f F

8 Selections Events
Counter #

9 Pattern

10
Counter Assignments
11 CTA10Counts in step V1010 xxxx
CTA11Timer Value V1011 xxxx
12 CTA12Preset Step V1012 xxxx
CTA13Current Step V1013 xxxx
13 The drum instruction accepts several inputs for step control, the main control of the
drum.The inputs and their functions are:
14 • Start – The Start input is effective only when Reset is off. When Start is on, the drum timer runs if
it is in a timed transition, and the drum looks for the input event during event transitions. When
A Start is off, the drum freezes in its current state (Reset must remain off ), and the drum outputs
maintain their current on/off pattern.
B • Jog – The jog input is only effective when Reset is off (Start may be either on or off ). The jog input
increments the drum to the next step on each off-to-on transition (only EDRUM supports the jog
input).
C • Reset – The Reset input has priority over the Start input. When Reset is on, the drum moves to its
preset step. When Reset is off, then the Start input operates normally.
D • Preset Step – A step number from 1 to 16 that you define (typically is step 1). The drum moves to
this step whenever Reset is on, and whenever the CPU first enters run mode.

6–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

• Counts/Step – The number of timer counts the drum spends in each step. Each step has its own
counts parameter. However, programming the counts/step is optional. 1
• Timer Value – the current value of the counts/step timer.
• Counter # – The counter number specifies the first of four consecutive counters which the drum
uses for step control. You can monitor these to determine the drum’s progress through its control
2
cycle. The DL05 has 128 counters (CT0 – CT177 in octal).
• Events – Either an X, Y, C, S, T, or CT type discrete point serves as step transition inputs. Each step
3
has its own event. However, programming the event is optional.
WARNING: The outputs of a drum are enabled any time the CPU is in Run Mode. The Start Input does 4
not have to be on, and the Reset input does not disable the outputs. Upon entering Run Mode, drum
outputs automatically turn on or off according to the pattern of the current step of the drum. This initial
step number depends on the counter memory configuration: non-retentive versus retentive.
5
Powerup State of Drum Registers 6
The choice of the starting step on powerup and program-to-run mode transitions are
important to consider for your application. Please refer to the following chart. If the counter 7
memory is configured as non-retentive, the drum is initialized the same way on every
powerup or program-to-run mode transition. However, if the counter memory is configured
to be retentive, the drum will stay in its previous state.
8
Counter Number Function
Initialization on Powerup 9
Non-Retentive Case Retentive Case
CT(n)
CT(n + 1)
Current Step Count
Counter Timer Value
Initialize = 0
Initialize = 0
Use Previous (no change)
Use Previous (no change)
10
CT(n + 2) Preset Step Initialize = Preset Step # Use Previous (no change)
CT(n + 3) Current Step # Initialize = Preset Step # Use Previous (no change) 11
Applications with relatively fast drum cycle times typically will need to be reset on powerup,
using the non-retentive option. Applications with relatively long drum cycle times may need 12
to resume at the previous point where operations stopped, using the retentive case. The
default option is the retentive case. This means that if you initialize scratchpad V-memory, the
memory will be retentive.
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–9


Chapter 6: Drum Instruction Programming

1 Drum Control Techniques Start X0

Setup
Drum Control Inputs Jog X1
2 Now we are ready to put together the concepts
Reset
Info
X2
Outputs

on the previous pages and demonstrate general


3 control of the drum instruction box. The Steps f
f
f
f
F
f
f
f
f f
f f
drawing to the right shows a simplified generic f f f f F f

4 drum instruction. Inputs from ladder logic


control the Start, Jog, and Reset Inputs (only
F
f
F
F
f
F
F
f
F f
F f
f F F f F F
the EDRUM instruction supports the Jog f F f f F F
5 Input). The first counter bit of the drum (CT0, f F F f f F

for example) indicates the drum cycle is done.


6 The timing diagram below shows an arbitrary timer drum input sequence and how the drum
responds. As the CPU enters Run mode it initializes the step number to the preset step
7 number (typically it is Step 1). When the Start input turns on the drum begins running,
waiting for an event and/or running the timer (depends on the setup).
After the drum enters Step 2, Reset turns On while Start is still On. Since Reset has priority
8 over Start, the drum goes to the preset step (Step 1). Note that the drum is held in the preset
step during Reset, and that step does not run (respond to events or run the timer) until Reset
9 turns off.
After the drum has entered step 3, the Start input goes off momentarily, halting the drum’s
10 timer until Start turns on again.
S tart Reset Hold Resume Drum Reset
drum drum drum drum Complete drum
11
Inputs
12 S tart
1
0
1
13 J og 0
1
Reset 0
14
Drum S tatus
A S tep #
Drum
1
1 1 2 1 1 2 3 3 4 ... 15 16 16 16 1 1

Complete (CT10) 0
B Outputs (x 16)
1
0
C When the drum completes the last step (Step 16 in this example), the Drum Complete bit
(CT0) turns on, and the step number remains at 16. When the Reset input turns on, it turns
D off the Drum Complete bit (CT0), and forces the drum to enter the preset step.
NOTE: The timing diagram shows all steps using equal time durations. Step times can vary greatly,
depending on the counts/step programmed.

6–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

In the figure below, we focus on how the Jog input works on event drums. To the left of the
diagram, note that the off-to-on transitions of the Jog input increments the step. Start may be 1
either on or off (however, Reset must be off ). Two jogs takes the drum to step three. Next, the
Start input turns on, and the drum begins running normally. During step 6 another Jog input
signal occurs. This increments the drum to step 7, setting the timer to 0. The drum begins
2
running immediately in step 7, because Start is already on. The drum advances to step 8
normally. 3
As the drum enters step 14, the Start input turns off. Two more Jog signals moves the drum
to step 16. However, note that a third Jog signal is required to move the drum through step 4
16 to “drum complete”. Finally, a Reset input signal arrives which forces the drum into the
preset step and turns off the drum complete bit.
Drum
5
Completed
Jog
drum
Jog
drum
Jog
drum
R es et
drum 6
Inputs
S tart
1
0
7
Jog
1
0

1
8
R es et 0

Drum S tatus
9
1 2 3 3 3 4 5 6,7 8 ... 14 15 16 16 16 1
S tep #
Drum
Complete (CT0)
1

0
10
Self-Resetting Drum
Applications often require drums that automatically start
X0
Start
Setup
11
Outputs
over once they complete a cycle. This is easily X1
Start Info.
accomplished, using the drum complete bit. In the figure X2
R es et
Steps f
f
f
f
F
f
f
f
f f
f f
12
to the right, the drum instruction setup is for CT0, so we f f f f F f

logically OR the drum complete bit (CT0) with the


Reset input. When the last step is done, the drum turns
CT0 F
f
f
F
F
F
f
F
F
F
f
f
F f
F f
F F
13
f F f f F F
on CT0 which resets itself to the preset step, also f F F f f F

resetting CT0. Contact X2 still works as a manual reset. 14


Initializing Drum Outputs
The outputs of a drum are enabled any time the CPU is in run mode. On program-to-run A
mode transitions, the drum goes to the preset step, and the outputs energize according to the
pattern of that step. If your application requires all outputs to be off at powerup, make the B
preset step in the drum a “reset step”, with all outputs off.
Using Complex Event Step Transitions C
Each event-based transition accepts only one contact reference for the event. However, this
does not limit events to just one contact. Just use a control relay contact such as C0 for the
step transition event. Elsewhere in ladder logic, you may use C0 as an output coil, making it
D
dependent on many other “events” (contacts).

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–11


Chapter 6: Drum Instruction Programming

1 Drum Instruction
The DL05 drum instructions may be programmed using DirectSOFT32 or for the EDRUM
2 instruction only you can use a handheld programmer (firmware version v1.8 or later. This
section covers entry using DirectSOFT32 for all instructions plus the handheld mnemonics
for the EDRUM instruction.
3 Timed Drum with Discrete Outputs (DRUM)
The Timed Drum with Discrete Outputs is the most basic of the DL05’s drum instructions.
4 It operates according to the principles covered on the previous pages. Below is the instruction
in chart form as displayed by DirectSOFT32.
5 Counter Number Step Preset
Discrete Output Assignment
Timebas e

6 Control
Start
DR UM
Step Preset
CT aaa
K bb
15
(Fffff) (Fffff) (Fffff) (Fffff)
(Fffff) (Fffff) (Fffff) (Fffff)
(Fffff) (Fffff)
(Fffff)
0
(Fffff) (Fffff)
(Fffff) (Fffff) (Fffff)
Inputs R es et 0.01 s ec/Count K cccc
7 Step # Counts
1 Kdddd f f f f f f f f f f f f f f f f
2 Kdddd f f f f f f f f f f f f f f f f

8 Step Number
3
4
5
Kdddd
Kdddd
Kdddd
f f f f f f f f f f f f
f f f f f f f f f f f f
f f f f f f f f f f f f
f
f
f
f
f
f
f
f
f
f
f
f
Counts per Step 6 Kdddd f f f f f f f f f f f f f f f f
9 7
8
Kdddd
Kdddd
f f f f f f f f f f f f
f f f f f f f f f f f f
f
f
f
f
f
f
f
f
Output Pattern 9 Kdddd f f f f f f f f f f f f f f f f

10 f= Off, F= On 10
11
Kdddd
Kdddd
f f f f f f f f f f f f
f f f f f f f f f f f f
f
f
f
f
f
f
f
f
12 Kdddd f f f f f f f f f f f f f f f f
f f f f f f f f f f f f f f f f
11 13
14
15
Kdddd
Kdddd
Kdddd
f f f f f f f f f f f f
f f f f f f f f f f f f
f
f
f
f
f
f
f
f
16 Kdddd f f f f f f f f f f f f f f f f

12 The Timed Drum features 16 steps and 16 outputs. Step transitions occur only on a timed
13 basis, specified in counts per step. Unused steps must be programmed with “counts per step”
= 0 (this is the default entry). The discrete output points may be individually assigned as X, Y,
or C types, or may be left unused. The output pattern may be edited graphically with
14 DirectSOFT32.
Whenever the Start input is energized, the drum’s timer is enabled. It stops when the last step
A is complete, or when the Reset input is energized. The drum enters the preset step chosen
upon a CPU program-to-run mode transition, and whenever the Reset input is energized.
B
Drum Parameters Field Data Types Ranges
C Counter Number aaa -- 0 --174
Preset Step bb K 1 -- 16
D Timer base
Counts per step
cccc
dddd
K
K
0 -- 99.99 seconds
0 -- 9999
Discrete Outputs Fffff X, Y, C see page 4-- 28

6–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

Drum instructions use four counters in the CPU. The ladder program can read the counter
values for the drum’s status. The ladder program may write a new preset step number to 1
CT(n+2) at any time. However, the other counters are for monitoring purposes only.
Counter Number Ranges of (n) Function Counter Bit Function 2
CT(n) 0 -- 174 Counts in step CTn = Drum Complete
CT( n+1)
CT( n+2)
1 -- 175
2 -- 176
Timer value
Preset Step
CT(n+1) = (not used)
CT(n+2) = (not used)
3
CT( n+3) 3 -- 177 Current Step CT(n+3) = (not used)
4
The following ladder program shows the DRUM instruction in a typical ladder program, as
shown by DirectSOFT32. Steps 1 through 10 are used, and twelve of the sixteen output
points are used. The preset step is step 1. The timebase runs at (K10 x 0.01) = 0.1 second per
5
count. Therefore, the duration of step 1 is (25 x 0.1) = 2.5 seconds. In the last rung, the
Drum Complete bit (CT0) turns on output Y0 upon completion of the last step (step 10). A 6
drum reset also resets CT0.
DirectSOFT Display

15 0
7
X0 DRUM CT0
Start

X1
Step Preset K1
Reset 0.01 sec/Count: K 10
( )
( )
( )
( ) (C14) (Y10)
(C30) (Y20) (C2)
(C4)
(Y6)
(Y5) (Y13) (C7)
(Y42) (C10) 8
Step # Counts
1
2
K0025
K0020 9
3 K1500
4
5
6
K0045
K0180
K0923
10
7 K1200
8
9
K8643
K1200 11
10 K4000
11
12
13
12
14
15
16 13
CT0
Drum Complete Y0
OUT
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–13


Chapter 6: Drum Instruction Programming

1 Event Drum (EDRUM) Instruction


The Event Drum (EDRUM) features time-based and event-based step transitions. It operates
2 according to the general principles of drum operation covered in the beginning of this
C ounter Number

3 Step Preset
T imebas e
Discrete Output Assignment

Start 15 0
4 C ontrol J og
E DR U M
Step Preset
C T aa
K bb (F fff)
(F fff) (F fff)
(F fff) (F fff)
(F fff) (F fff)
(F fff)
(F fff)
(F fff) (F fff)
(F fff) (F fff)
(F fff) (F fff)
(F fff)
Inputs 0.01 s ec/C ount: K cccc
R es et
5 Step # C ounts E vent
1 K dddd E eeee f f f f f f f f f f f f f f f f
2 K dddd E eeee f f f f f f f f f f f f f f f f

6 Step Number
3
4
K dddd
K dddd
E eeee
E eeee
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
5 K dddd E eeee f f f f f f f f f f f f f f f f
f f f f f f f f f f f f f f f f
7 Counts per Step 6
7
8
K dddd
K dddd
K dddd
E eeee
E eeee
E eeee
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
Event per Step 9 K dddd E eeee f f f f f f f f f f f f f f f f
8 Output P attern
10
11
K dddd
K dddd
E eeee
E eeee
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f= Off, F= On 12 K dddd E eeee f f f f f f f f f f f f f f f f

9 13
14
15
K dddd
K dddd
K dddd
E eeee
E eeee
E eeee
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f f f f f f f f f f f f f f f f
10 16 K dddd E eeee

chapter. Below is the instruction as displayed by DirectSOFT32.


11 The Event Drum features 16 steps and 16 discrete outputs. Step transitions occur on timed
and/or event basis. The jog input also advances the step on each off-to-on transition. Time is
specified in counts per step, and events are specified as discrete contacts. Unused steps and
12 events must be left blank. The discrete output points may be individually assigned.
Whenever the Start input is energized, the drum’s timer is enabled. As long as the event is true
13 for the current step, the timer runs during that step. When the step count equals the counts
per step, the drum transitions to the next step. This process stops when the last step is
14 complete, or when the Reset input is energized. The drum enters the preset step chosen upon
a CPU program-to-run mode transition, and whenever the Reset input is energized.
A Drum Parameters Field Data Types Ranges
Counter Number aa -- 0 -- 174

B Preset Step
Timer base
bb
cccc
K
K
1 -- 16
0 -- 99.99 seconds
Counts per step dddd K 0 -- 9999
C Event eeee X, Y, C, S, T, CT see page 4-- 28
Discrete Outputs ffff X, Y, C see page 4-- 28

6–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

Drum instructions use four counters in the CPU. The ladder program can read the counter
values for the drum’s status. The ladder program may write a new preset step number to 1
CT(n+2) at any time. However, the other counters are for monitoring purposes only.
2
Counter Number Ranges of (n) Function Counter Bit Function
CT(n)
C( n+1)
0 -- 174
1 -- 175
Counts in step
Timer value
CTn = Drum Complete
CT(n+1) = (not used)
3
CT( n+2) 2 -- 176 Preset Step CT(n+2) = (not used)
CT( n+3) 3 -- 177 Current Step CT(n+3) = (not used) 4
The following ladder program shows the EDRUM instruction in a typical ladder program, as
shown by DirectSOFT32. Steps 1 through 11 are used, and all sixteen output points are used.
5
The preset step is step 1. The timebase runs at (K10 x 0.01) = 0.1 second per count.
Therefore, the duration of step 1 is (1 x 0.1) = 0.1 second. Note that step 1 is time-based only 6
(event is left blank). And, the output pattern for step 1 programs all outputs off, which is a
typically desirable powerup condition. In the last rung, the Drum Complete bit (CT4) turns
on output Y0 upon completion of the last step (step 11). A drum reset also resets CT4.
7
DirectS OF T Dis play
8
X0
S tart E DR UM CT 4 15 0 9
X1
J og Step Preset K1 (C34) (Y6) (C14) (Y0) (C4) (Y5) (Y1) (C7)

X2
R es et
0.01 s ec/Count: K 10
(Y3) (Y7) (C30) (Y2) (C2) (Y6) (Y4) (C10)
10
Step # Counts E vent
1
2
K0001
K0020 Y4
f
F
f
f
f
f
f
F
f
F
f
f
f
f
f
f
f
f
f
f
f
f
f
F
f
f
f
f
f
F
f
f
11
3 K0150 X1 f f F f F f f f F f f F f F f f
4
5
K0048 X2
K0180 C0
f
f
F
F
f
f
f
F
f
f
F
f
f
f
f
F
f
f
F
F
F
F
F
f
f
F
F
f
F
f
f
F
12
6 K0923 C1 F f f F f f F F f F f f f f F F
7
8
K0120 X0
K0864 X5
f
F
F
f
f
f
f
F
f
f
F
f
f
F
f
f
F
f
f
F
f
f
f
F
f
F
F
f
F
f
f
F
13
9 K1200 X3 f f f f f f F F F f f f F f F f
10 K0400 Y7 f F f F F f f f f F F f f F f f 14
11 K0000 C20 F f f f f F f f f F f f f F F F
f f f f f f f f f f f f f f f f
12
13 f f f f f f f f f f f f f f f f A
14 f f f f f f f f f f f f f f f f
15
16
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f
f B
CT4
Drum Complete
Y0
OUT
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–15


Chapter 6: Drum Instruction Programming

Handheld Programmer Drum Mnemonics


1 The EDRUM instruction may be programmed using either DirectSOFT32 or a handheld
programmer. This section covers entry via the handheld programmer (Refer to the
2 DirectSOFT32 manual for drum instruction entry using that tool).
X0
First, enter Store instructions for the ladder rungs Start
Setup
3 controlling the drum’s ladder inputs. In the
example to the right, the timer drum’s Start, Jog,
X1
Jog Info
Outputs
Mask
Steps f f F f f f
4 and Reset inputs are controlled by X0, X1 and X2
respectively. The required keystrokes are listed
X2
Reset f
f
f
f
f f
f f
f f
F f
F F f F F f
beside the mnemonic.
5 These keystrokes precede the EDRUM instruction
f
f
f
F F f
F F f
F f f
F f
F F
F F
mnemonic. Note that the ladder rungs for Start, f F F f f F

6 Jog, and Reset inputs are not limited to being


single–contact rungs.
Handheld Programmer Keystrokes

Store X0 $ STR A

7 After the Store instructions, enter the EDRUM


(using Counter CT0) as shown:
0
ENT

(Repeat for Store X1 and Store X

8 Handheld Programmer Keystrokes

E D R U M A
EDRUM CNT0 SHFT ENT

9 4 3 ORN ISG ORST 0

After entering the EDRUM mnemonic as above, the handheld programmer creates an input
10 form for all the drum parameters. The input form consists of approximately fifty or more
default mnemonic entries containing DEF (define) statements. The default mnemonics are
already “input” for you, so they appear automatically. Use the NXT and PREV keys to move
11 forward and backward through the form. Only the editing of default values is required, thus
eliminating many keystrokes. The entries required for the basic timer drum are in the chart
12 below.
NOTE: Default entries for output points and events are “DEF 0000”, which means they are unassigned. If
13 you need to go back and change an assigned output as unused again, enter “K0000”. The entry will again
show as “DEF 0000”.

14
Drum Multiple Default Valid Data
A Parameters Entries Mnemonic / Entry Mnemonic Types Ranges
Start Input -- STR (plus input rung) -- -- --

B Jog Input
Reset Input
--
--
STR (plus input rung)
STR (plus input rung)
--
--
--
--
--
--
Drum Mnemonic -- DRUM CNT aa -- CT 0 -- 174
C Preset Step 1 bb DEF K0000 K 1 -- 16
Timer base 1 cccc DEF K0000 K 1 -- 9999

D Output points
Counts per step
16
16
ffff
dddd
DEF 0000
DEF K0000
X, Y, C *
K
see page 4-- 28
0 -- 9999
Events 16 dddd DEF K0000 X, Y, C, S, T, CT see page 4-- 28
Output pattern 16 gggg DEF K0000 K 0 -- FFFF

6–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 6: Drum Instruction Programming

Using the DRUM entry chart (two pages before), we show the method of entry for the basic
time/event drum instruction. First, we convert the output pattern for each step to the 1
equivalent hex number, as shown in the following example.
Step 1 Outputs : f f f f F f f F f f f F F f F f 2
- converts to: 15 0

The following diagram shows the method for entering the previous EDRUM example on the
0 9 1 A
3
HHP. The default entries of the form are in parenthesis. After the drum instruction entry (on
the fourth row), the remaining keystrokes over-write the numeric portion of each default 4
DEF statement.
NOTE: Drum editing requires Handheld Programmer firmware version 1.7 or later. 5
Start
Handheld Programmer Keystrokes

$
STR
A
0
ENT Note: You may use the NXT and PREV keys
6
to skip past entries for unused outputs or steps.
Jog

Reset
$

$
STR
B

C
1
ENT

ENT
7
STR 2

Drum Inst. SHFT E


4
D
3
R
ORN
U
ISG
M
ORST
E
4 ENT
8
Preset Step ( DEF K0001) NEXT

Time Base ( DEF K0000 ) G


6
E
4
NEXT
Handheld Programmer Keystrokes cont’d
9
1 ( DEF 0000 ) SHFT C H NEXT 1 ( DEF K0000 ) F NEXT
2 7 5

( DEF 0000 ) SHFT


C
2
B
1
A
0
NEXT ( DEF K0000 ) C
2
A
0
NEXT 10
( DEF 0000 ) Y B B F A
SHFT NEXT NEXT

11
MLS 1 ( DEF K0000 ) 1 5 0

( DEF 0000 ) SHFT Y E NEXT ( DEF K0000 ) E F NEXT


MLS 4 4 5

Y F B I A
( DEF 0000 )

( DEF 0000 )
SHFT

SHFT
Y
MLS

MLS
G
5

6
NEXT

NEXT
( DEF K0000 )

( DEF K0000 )
J
1

9
C
8

2
D
0

3
NEXT

NEXT
12
( DEF 0000 )

( DEF 0000 )
SHFT

SHFT
C

C
2
E

C
4
NEXT

NEXT
( DEF K0000 )
B

I
1
C

G
2
A

E
0
NEXT

NEXT
13
2 2 Counts/ ( DEF K0000 ) 8 6 4
Outputs
( DEF 0000 )

( DEF 0000 )
SHFT Y

Y
MLS
A

C
0
NEXT
Step
( DEF K0000 ) B

E
1
C

A
2
A

A
0
A
0
NEXT
14
SHFT NEXT ( DEF K0000 ) NEXT
MLS 2 4 0 0

( DEF 0000 ) SHFT C


2
B
1
E
4
NEXT ( DEF K0000 ) NEXT A
C D A
( DEF 0000 ) SHFT NEXT ( DEF K0000 ) NEXT
2 3 0

( DEF 0000 ) SHFT


Y
MLS
G
6
NEXT ( DEF K0000 ) NEXT
skip over
B
Y H unused steps
( DEF 0000 ) SHFT NEXT ( DEF K0000 ) NEXT

( DEF 0000 ) SHFT


C
MLS

2
D
7

3
E
4
NEXT ( DEF K0000 ) NEXT
C
Y B

D
16 ( DEF 0000 ) SHFT NEXT 16 ( DEF K0000 ) NEXT
MLS 1

(Continued on next page )

NOTE: You may use the NXT and PREV keys to skip past entries for unused outputs or steps.

DL05 Micro PLC User Manual, 5th Edition, 6/04 6–17


Chapter 6: Drum Instruction Programming

1
2 Handheld Programmer Keystrokes cont’d Handheld Programmer Keystrokes cont’d

3 1 ( DEF 0000 ) NEXT skip over unused event 1


( DEF K0000 ) NEXT step 1 pattern = 000
( DEF 0000 ) SHFT Y E NEXT J I B C

4 ( DEF 0000 ) SHFT


X
MLS

SET
B
4

1
NEXT
( DEF K0000 )

( DEF K0000 )
C
9

I
8

J
1

E
2
NEXT

NEXT
2 8 9 4

5 ( DEF 0000 ) SHFT X

C
SET
C

A
2
NEXT
( DEF K0000 )
E
4
E
4
H
7
G
6
NEXT

( DEF 0000 ) SHFT NEXT F B G J


2 0 ( DEF K0000 ) NEXT

6
5 1 6 9

( DEF 0000 ) SHFT C B NEXT J D E D


2 1 ( DEF K0000 ) NEXT
9 3 4 3
X A

7 ( DEF 0000 ) SHFT NEXT E E I G


SET 0 ( DEF K0000 ) NEXT
4 4 8 6

( DEF 0000 ) SHFT X F NEXT


SET 5 Output ( DEF K0000 )
J E F J
NEXT
Outputs 9 4 5 9
Pattern
8 ( DEF 0000 ) SHFT X

Y
SET
D

H
3
NEXT
( DEF K0000 )
D
3
I
8
SHFT A
0
NEXT

( DEF 0000 ) SHFT NEXT F I G E


MLS 7 NEXT

9
( DEF K0000 ) 5 8 6 4

( DEF 0000 ) SHFT C C A NEXT I E E H


2 2 0 ( DEF K0000 ) NEXT
8 4 4 7

10 ( DEF 0000 )

( DEF 0000 )
NEXT

NEXT
( DEF K0000 ) NEXT

( DEF K0000 ) NEXT

11 ( DEF 0000 ) NEXT


( DEF K0000 ) NEXT unused steps
( DEF 0000 ) NEXT

12 ( DEF K0000 ) NEXT

16 ( DEF 0000 ) NEXT 16


( DEF K0000 ) NEXT

13 Last rung
$
STR
GY

Y
CNT
E

A
4 NEXT

SHFT NEXT
MLS 0

14 Note: you may use the NXT and PREV keys to skip past entries for unused outputs or steps.

A
B
C
D

6–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


RLLPLUS STAGE CHAPTER
PROGRAMMING
7
In This Chapter:
Introduction to Stage Programming . . . . . . . . . . . . . . . . . . . . . . . .7–2
Learning to Draw State Transition Diagrams . . . . . . . . . . . . . . . . . .7–3
Using the Stage Jump Instruction for State Transitions . . . . . . . . . . .7–7
Stage Program Example: Toggle On/Off Lamp Controller . . . . . . . .7–8
Four Steps to Writing a Stage Program . . . . . . . . . . . . . . . . . . . . . .7–9
Stage Program Example: A Garage Door Opener . . . . . . . . . . . . . .7–10
Stage Program Design Considerations . . . . . . . . . . . . . . . . . . . . . .7–15
Parallel Processing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–19
RLLPLUS (Stage) Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7–21
Questions and Answers about Stage Programming . . . . . . . . . . . .7–25
Chapter 7: RLLPLUS Stage Programming

1 Introduction to Stage Programming


Stage Programming provides a way to organize and program complex applications with
2 relative ease, when compared to purely relay ladder logic (RLL) solutions. Stage programming
does not replace or negate the use of traditional boolean ladder programming. This is why
Stage Programming is also called RLLplus You won’t have to discard any training or
.

3 experience you already have. Stage programming simply allows you to divide and organize a
RLL program into groups of ladder instructions called stages. This allows quicker and more
4 intuitive ladder program development than traditional RLL alone provides.
Overcoming “Stage Fright”
5 Many PLC programmers in the industry have
become comfortable using RLL for every PLC
X0 C0
RST
program they write... but often remain skeptical or
6 even fearful of learning new techniques such as
X4 C1 Y0
SET
stage programming. While RLL is great at solving
7 boolean logic relationships, it has disadvantages as
well: STAGE!

8 • Large programs can become almost unmanageable,


because of a lack of structure. X3 Y2
OUT
• In RLL, latches must be tediously created from self-
9 latching relays.
• When a process gets stuck, it is difficult to find the
10 rung where the error occurred.
• Programs become difficult to modify later, because
11 they do not intuitively resemble the application
problem they are solving.
It’s easy to see that these inefficiencies consume a lot of additional time, and time is money.
12 Stage programming overcomes these obstacles! We believe a few moments of studying the stage
concept is one of the greatest investments in programming speed and efficiency a PLC
13 programmer can make!
So, we encourage you to study stage programming and add it to your “toolbox” of
14 programming techniques. This chapter is designed as a self-paced tutorial on stage
programming. For best results:
A • Start at the beginning and do not skip over any sections.
• Study each stage programming concept by working through each example. The examples build
progressively on each other.
B • Read the Stage Questions and Answers at the end of the chapter for a quick review.

C
D

7–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Learning to Draw State Transition Diagrams 1


Introduction to Process States Inputs Ladder Outputs
Those familiar with ladder program execution know that
Program 2
the CPU must scan the ladder program repeatedly, over
and over. Its three basic steps are: 3
1. Read the inputs
2. Execute the ladder program 1) Read Execute Write 4
3. Write the outputs 2) Read Execute Write

The benefit is that a change at the inputs can affect the 3) Read (Etc..... ) 5
outputs in just a few milliseconds.
Most manufacturing processes consist of a series of activities or conditions , each lasting for 6
several seconds. minutes, or even hours. We might call these “process states”, which are either
active or inactive at any particular time. A challenge for RLL programs is that a particular
input event may last for just a brief instant. We typically create latching relays in RLL to
7
preserve the input event in order to maintain a process state for the required duration.
We can organize and divide ladder logic into sections called “stages”, representing process
8
states. But before we describe stages in detail, we will reveal the secret to understanding stage
programming: state transition diagrams. 9
The Need for State Diagrams
Sometimes we need to forget about the scan nature of PLCs, and focus our thinking toward 10
the states of the process we need to identify. Clear thinking and concise analysis of an
application gives us the best chance at writing efficient, bug-free programs. State diagrams are 11
just a tool to help us draw a picture of our process! You’ll discover that if we can get the picture
right, our program will also be right! Inputs Outputs 12
A 2–State Process ON
X0 Motor

Consider the simple process shown to the right, which controls


an industrial motor. We will use a green momentary SPST
OFF
X1
Ladder
Program
Y0
13
pushbutton to turn the motor on, and a red one to turn it off.
The machine operator will press the appropriate pushbutton for State
X0
Transition condition 14
just a second or so. The two states of our process are ON and
OFF. OFF
X1
ON
A
The next step is to draw a state transition diagram, as shown to
the right. It shows the two states OFF and ON, with two Output equation: Y0 = On

transition lines in-between. When the event X0 is true, we transition from OFF to ON.
B
When X1 is true, we transition from ON to OFF.
If you’re following along, you are very close to grasping the concept and the problem-solving
C
power of state transition diagrams. The output of our controller is Y0, which is true any time
we are in the ON state. In a boolean sense, Y0=ON state. D
Next, we will implement the state diagram first as RLL, then as a stage program. This will
help you see the relationship between the two methods in problem solving.

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–3


Chapter 7: RLLPLUS Stage Programming

The state transition diagram to the right is a picture


1 of the solution we need to create. The beauty of it is
this: it expresses the problem independently of the X0
2 programming language we may use to realize it. In
other words, by drawing the diagram we have already OFF ON
solved the control problem! X1
3 First, we’ll translate the state diagram to traditional Output equation Y0 = ON
RLL. Then we’ll show how easy it is to translate the
4 diagram into a stage programming solution.
RLL Equivalent Set Reset Latch
5 The RLL solution is shown to the right. It consists of X0 X1 C0
a self-latching control relay, C0. When the On OUT
6 pushbutton (X0) is pressed, output coil C0 turns on
and the C0 contact on the second row latches itself
on. So, X0 sets the latch C0 on, and it remains on
7 after the X0 contact opens. The motor output Y0 also
Latch
C0
Output
Y0
has power flow, so the motor is now on. OUT
8 When the Off pushbutton (X1) is pressed, it opens
the normally-closed X1 contact, which resets the
9 latch. Motor output Y0 turns off when the latch coil
C0 goes off.
10 Stage Equivalent
The stage program solution is shown to the right. SG
S0 OFF State
11 The two inline stage boxes S0 and S1 correspond to
the two states OFF and ON. The ladder rung(s) Transition
below each stage box belong to each respective stage. X0 S1
12 This means that the PLC only has to scan those JMP
rungs when the corresponding stage is active!
13 For now, let’s assume we begin in the OFF State, so
stage S0 is active. When the On pushbutton (X0) is
SG
S1 ON State
Output
14 pressed, a stage transition occurs. The JMP S1
instruction executes, which simply turns off the Stage SP1 Always On Y0
bit S0 and turns on Stage bit S1. So on the next PLC OUT
A scan, the CPU will not execute Stage S0, but will
Transition
execute stage S1!
X1 S0
B In the On State (Stage S1), we want the motor to
always be on. The special relay contact SP1 is defined
JMP

as always on, so Y0 turns the motor on.


C When the Off pushbutton (X1) is pressed, a transition back to the Off State occurs. The JMP
S0 instruction executes, which simply turns off the Stage bit S1 and turns on Stage bit S0. On
D the next PLC scan, the CPU will not execute Stage S1, so the motor output Y0 will turn off.
The Off state (Stage 0) will be ready for the next cycle.

7–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Let’s Compare
Right now, you may be thinking “I don’t see the big advantage to Stage Programming... in 1
fact, the stage program is longer than the plain RLL program”. Well, now is the time to
exercise a bit of faith. As control problems grow in complexity, stage programming quickly
out-performs RLL in simplicity, program size, etc.
2
For example, consider the diagram below. Notice how easy
it is to correlate the OFF and ON states of the state
3
transition diagram below to the stage program at the right. SG
Now, we challenge anyone to S0 OFF State 4
easily identify the same states X0 S1
in the RLL program on the
previous page!
JMP 5
SG
Initial Stages
01
S1

SP1
ON State

Y0
6
At powerup and Program-to-
OUT
Run Mode transitions, the
PLC always begins with all
OFF
0-
ON
X1 S0 7
JMP
normal stages (SG) off. So, the stage programs shown so far
have actually had no way to get started (because rungs are 8
not scanned unless their stage is active). Powerup in OFF State
Assume that we want to always begin in the Off state ISG
S0 Initial Stage
9
(motor off ), which is how the RLL program works. The X0 S1
Initial Stage (ISG) is defined to be active at powerup. In the
modified program to the right, we have changed stage S0 to
JMP 10
the ISG type. This ensures the PLC will scan contact X0
after powerup, because Stage S0 is active. After powerup, an
SG
S1 11
Initial Stage (ISG) works just like any other stage! SP1 Y0

We can change both programs so that the motor is ON at X1


OUT
S0
12
powerup. In the RLL below, we must add a first scan relay JMP
SP0, latching C0 on. In the stage example to the right, we
simply make Stage S1 an initial stage (ISG) instead of S0.
13
Powerup in ON State
Powerup in ON State
X0 X1 C0 SG
S0
14
OUT
C0 Y0
OUT
X0 S1
JMP
A
SP0
First Scan
ISG
S1
Initial Stage
B
SP1 Y0

X1
OUT

S0
C
JMP
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–5


Chapter 7: RLLPLUS Stage Programming

We can mark our desired powerup state as shown to Powerup


1 the right, which helps us remember to use the X0
appropriate Initial Stages when creating a stage
OFF ON
2 program. It is permissible to have as many initial
stages as the process requires. X1

3 What Stage Bits Do


You may recall that a stage is just a section of ladder program which is either active or inactive
at a given moment. All stage bits (S0 to S377) reside in the PLC’s image register as individual
4 status bits. Each stage bit is either a boolean 0 or 1 at any time.
Program execution always reads ladder rungs from top to bottom, and from left to right. The
5 drawing below shows the effect of stage bit status. The ladder rungs below the stage
instruction continuing until the next stage instruction or the end of program belong to stage
6 0. Its equivalent operation is shown on the right. When S0 is true, the two rungs have power
flow.
7 • If Stage bit S0 = 0, its ladder rungs are not scanned (executed).
• If Stage bit S0 = 1, its ladder rungs are scanned (executed).

8 Actual Program Appearance Functionally Equivalent Ladder

9 SG
S0
S0

10
(includes all rungs in stage)
11
Stage Instruction Characteristics
12 The inline stage boxes on the left power rail divide the ladder
SG
program rungs into stages. Some stage rules are: S0
13 • Execution – Only logic in active stages are executed on any
scan.
14 • Transitions – Stage transition instructions take effect on the
next occurrence of the stages involved. SG
S1

A • Octal numbering – Stages are numbered in octal, like I/O


points, etc. So “S8” is not valid.
• Total Stages – The DL05 offers up to 256 stages (S0 to S377 in
B octal). SG
S2
• No duplicates – Each stage number is unique and can be used
C just once.
• Any order – You can skip numbers and sequence the stage
D numbers in any order.
• Last Stage – the last stage in the ladder program includes all
END

rungs from its stage box until the end coil.

7–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Using the Stage Jump Instruction for State Transitions 1


Stage Jump, Set, and Reset Instructions
The Stage JMP instruction we have used deactivates the stage in which the instruction occurs,
2
while activating the stage in the JMP instruction. Refer to the state transition shown below.
When contact X0 energizes, the state transition from S0 to S1 occurs. The two stage examples 3
shown below are equivalent. So, the Stage Jump instruction is equal to a Stage Reset of the
current stage, plus a Stage Set instruction for the stage to which we want to transition.
X0
4
S0 S1 5
SG
S0
SG
S0 6
S1
Equivalent S0
X0 X0
JMP RST 7
S1
SET 8
Please Read Carefully – The jump instruction is easily misunderstood. The “jump” does not
occur immediately like a GOTO or GOSUB program control instruction when executed.
9
Here’s how it works:
• The jump instruction resets the stage bit of the stage in which it occurs. All rungs in the stage still 10
finish executing during the current scan, even if there are other rungs in the stage below the jump
instruction! 11
• The reset will be in effect on the following scan, so the stage that executed the jump instruction
previously will be inactive and bypassed.
• The stage bit of the stage named in the Jump instruction will be set immediately, so the stage will be
12
executed on its next occurrence. In the left program shown below, stage S1 executes during the same
scan as the JMP S1 occurs in S0. In the example on the right, Stage S1 executes on the next scan 13
after the JMP S1 executes, because stage S1 is located above stage S0.

SG SG Executes on next
14
S0 S1 scan after Jmp
X0 S1
S1 Y0
A
JMP
OUT

SG Executes on same SG
B
S1 scan as Jmp S0

S1 Y0
X0 S1
JMP
C
OUT

D
NOTE: Assume we start with Stage 0 active and stage 1 inactive for both examples.

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–7


Chapter 7: RLLPLUS Stage Programming

1 Stage Program Example: Toggle On/Off Lamp Controller Inputs Outputs


A 4–State Process
2 In the process shown to the right, we use an ordinary Toggle
Ladder
X0 Y0
momentary pushbutton to control a light bulb. The
3 ladder program will latch the switch input, so that we
Program

will push and release to turn on the light, push and


4 release again to turn it off (sometimes called toggle
function). Sure, we could just buy a mechanical switch
Powerup
X0
with the alternate on/off action built in... However, this
5 example is educational and also fun! Next we draw the
OFF
X0
ON

state transition diagram.


6 A typical first approach is to use X0 for both transitions
Output equation: Y0 = ON

(like the example shown to the right). However, this is incorrect (please keep reading).
7 Note that this example differs from the motor example, because now we have just one
pushbutton. When we press the pushbutton, both transition conditions are met. We would
just transition around the state diagram at top speed. If implemented in Stage, this solution
8 would flash the light on or off each scan (obviously undesirable)!
The solution is to make the the push and the release of the pushbutton separate events. Refer
9 to the new state transition diagram below. At powerup we enter the OFF state. When switch
X0 is pressed, we enter the Press-ON state. When it is released, we enter the ON state. Note
10 that X0 with the bar above it denotes X0 NOT.

11 Powerup X0 Push–ON X0
ISG
S0 OFF State

S1
12 OFF ON
X0
JMP

13 X0
Push–OFF
X0
SG
S1 Push–On State

X0 S2

14 When in the ON state, another push and release cycle


JMP

similarly takes us back to the OFF state. Now we have


A two unique states (OFF and ON) used when the
pushbutton is released, which is what was required to
SG
S2
ON State
Output
SP1 Y0
solve the control problem.
B The equivalent stage program is shown to the right. The
OUT
X0 S3
desired powerup state is OFF, so we make S0 an initial
C stage (ISG). In the ON state, we add special relay
JMP

contact SP1, which is always on. SG Push–Off State


D Note that even as our programs grow more complex, it
S3
X0 S0
is still easy to correlate the state transition diagram with JMP
the stage program!

7–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Four Steps to Writing a Stage Program 1


By now, you’ve probably noticed that we follow the same steps to solve each example
problem. The steps will probably come to you automatically if you work through all the
examples in this chapter. It’s helpful to have a checklist to guide us through the problem
2
solving. The following steps summarize the stage program design procedure:
1. Write a Word Description of the application.
3
Describe all functions of the process in your own words. Start by listing what happens first,
then next, etc. If you find there are too many things happening at once, try dividing the 4
problem into more than one process. Remember, you can still have the processes
communicate with each other to coordinate their overall activity. 5
2. Draw the Block Diagram.
Inputs represent all the information the process needs for decisions, and outputs connect to 6
all devices controlled by the process.
• Make lists of inputs and outputs for the process. 7
• Assign I/O point numbers (X and Y) to physical inputs and outputs.
3. Draw the State Transition Diagram. 8
The state transition diagram describes the central function of the block diagram, reading
inputs and generating outputs. 9
• Identify and name the states of the process.
• Identify the event(s) required for each transition between states. 10
• Ensure the process has a way to re-start itself, or is cyclical.
• Choose the powerup state for your process. 11
• Write the output equations.
4. Write the Stage Program. 12
Translate the state transition diagram into a stage program.
• Make each state a stage. Remember to number stages in octal. Up to 256 total stages are available in
the DL05, numbered 0 to 377 in octal.
13
• Put transition logic inside the stage which originates each transition (the stage each arrow points
away from).
14
• Use an initial stage (ISG) for any states that must be active at powerup.
• Place the outputs or actions in the appropriate stages.
A
You’ll notice that Steps 1 through 3 just prepare us to write the stage program in Step 4.
However, the program virtually writes itself because of the preparation beforehand. Soon
B
you’ll be able to start with a word description of an application and create a stage program in
one easy session! C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–9


Chapter 7: RLLPLUS Stage Programming

1 Stage Program Example: A Garage Door Opener


Garage Door Opener Example
2 In this next stage programming example we’ll create a
garage door opener controller. Hopefully most readers
3 are familiar with this application, and we can have
fun besides!
4 The first step we must take is to describe how the
door opener works. We will start by achieving the
basic operation, waiting to add extra features later.
5 Stage programs are very easy to modify.
Our garage door controller has a motor which raises
6 or lowers the door on command. The garage owner
pushes and releases a momentary pushbutton once to
7 raise the door. After the door is up, another push-
release cycle will lower the door.
8 In order to identify the inputs and outputs of the
system, it’s sometimes helpful to sketch its main
components, as shown in the door side view to the Up limit switch
9 right. The door has an up limit and a down limit
switch. Each limit switch closes only when the door Motor Raise
10 has reach the end of travel in the corresponding
direction. In the middle of travel, neither limit switch
Lower

is closed.
11 The motor has two command inputs: raise and lower.
When neither input is active, the motor is stopped.
12 The door command is just a simple pushbutton.
Door
Command
Whether wall-mounted as shown, or a radio-remote
13 control, all door control commands logical OR
together as one pair of switch contacts. Down limit switch

14 Draw the Block Diagram


The block diagram of the controller is shown to the
A right. Input X0 is from the pushbutton door control.
Input X1 energizes when the door reaches the full up Inputs Outputs
position. Input X2 energizes when the door reaches
B the full down position. When the door is positioned
Toggle
X0
To motor:
between fully up or down, both limit switches are Ladder
Up limit
C open.
The controller has two outputs to drive the motor.
Program
X1 Y1
Raise

Down limit
D Y1 is the up (raise the door) command, and Y2 is the
down (lower the door) command.
X2 Y2 Lower

7–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Draw the State Diagram


Now we are ready to draw the state transition diagram. Like the previous light bulb controller 1
example, this application also has just one switch for the command input. Refer to the figure
below. 2
• When the door is down (DOWN state), nothing happens until X0 energizes. Its push and release
brings us to the RAISE state, where output Y1 turns on and causes the motor to raise the door.
• We transition to the UP state when the up limit switch (X1) energizes, and turns off the motor.
3
• Then nothing happens until another X0 press-release cycle occurs. That takes us to the LOWER
state, turning on output Y2 to command the motor to lower the door. We transition back to the
4
DOWN state when the down limit switch (X2) energizes.
5
Powerup X0 Push–UP
X0
RAISE X1 6
ISG DOWN State

DOWN UP
S0
X0 S1 7
JMP

X2 LOWER Push–DOWN X0
SG
S1 Push–UP State 8
X0 X0 S2

Output equations: Y1 = Raise Y2 = Lower


JMP 9
The equivalent stage program is shown to the right. For now, we
SG
S2
RAISE State
10
will assume the door is down at powerup, so the desired powerup SP1 Y1

state is DOWN. We make S0 an initial stage (ISG). Stage S0


remains active until the door control pushbutton activates. Then X1
OUT
S3 11
JMP
we transition (JMP) to Push-UP stage, S1.
A push-release cycle of the pushbutton takes us through stage S1 SG
S3
UP State 12
to the RAISE stage, S2. We use the always-on contact SP1 to X0 S4
energize the motor’s raise command, Y1. When the door reaches JMP 13
the fully-raised position, the up limit switch X1 activates. This
SG
takes us to the UP Stage S3, where we wait until another door
control command occurs.
S4
X0
Push–DOWN State

S5
14
JMP
In the UP Stage S3, a push-release cycle of the pushbutton will
take us to the LOWER Stage S5, where we activate Y2 to SG LOWER State
A
command the motor to lower the door. This continues until the S5

door reaches the down limit switch, X2. When X2 closes, we


transition from Stage S5 to the DOWN stage S0, where we began.
SP1 Y2
OUT
B
NOTE: The only special thing about an initial stage (ISG) is that it is
X2 S0
JMP C
automatically active at powerup. Afterwards, it is just like any other.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–11


Chapter 7: RLLPLUS Stage Programming

Add Safety Light Feature


1 Next we will add a safety light feature to the door
opener system. It’s best to get the main function
2 working first as we have done, then adding the
secondary features.
Safety light
3 The safety light is standard on many commercially-
available garage door openers. It is shown to the
right, mounted on the motor housing. The light
4 turns on upon any door activity, remaining on for
approximately 3 minutes afterwards.
5 This part of the exercise will demonstrate the use of
parallel states in our state diagram. Instead of using
6 the JMP instruction, we’ll use the set and reset
commands.

7 Modify the Block Diagram and State Diagram


To control the light bulb, we add an output to our
Inputs Outputs

controller block diagram, shown to the right, Y3 is the Toggle X0


8 light control output.
Y1
Raise

In the diagram below, we add an additional state


9 called “LIGHT”. Whenever the garage owner presses
Up limit
X1 Y2
Lower
the door control switch and releases, the RAISE or
10 LOWER state is active and the LIGHT state is
simultaneously active. The line to the Light state is
Down limit
X2 Y3 Light
dashed, because it is not the primary path.
11 We can think of the Light state as a parallel process to the raise and lower state. The paths to
the Light state are not a transition (Stage JMP), but a State Set command. In the logic of the
12 Light stage, we will place a three-minute timer. When it expires, timer bit T0 turns on and
resets the Light stage. The path out of the Light stage goes nowhere, indicating the Light stage
13 just becomes inactive, and the light goes out!

14 X0
Output equations: Y1 = RAISE
Y2 = LOWER
Y3 = LIGHT
A X0 Push–UP RAISE X1

X0
B
DOWN LIGHT T0 UP
C
D X0

X2 LOWER Push–DOWN X0
X0

7–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Using a Timer Inside a Stage


The finished modified program is shown to the right. The 1
shaded areas indicate the program additions.
In the Push-UP stage S1, we add the Set Stage Bit S6 2
instruction. When contact X0 opens, we transition from S1 ISG DOWN State
S0
and go to two new active states: S2 and S6. In the Push-
DOWN state S4, we make the same additions. So, any time
X0 S1 3
JMP
someone presses the door control pushbutton, the light turns
on. SG
S1 Push–UP State
4
Most new stage programmers would be concerned about
where to place the Light Stage in the ladder, and how to
X0 S2
JMP
5
number it. The good news is that it doesn’t matter! S6
• Just choose an unused Stage number, and use it for the new
stage and as the reference from other stages.
SG
RAISE State
SET 6
S2
• Placement in the program is not critical, so we place it at the
end.
SP1 Y1
OUT
7
You might think that each stage has to be directly under the
stage that transitions to it. While it is good practice, it is not
X1 S3
JMP
8
required (that’s good, because our two locations for the Set
S6 instruction make that impossible). Stage numbers and
SG
S3
UP State
9
how they are used determines the transition paths. X0 S4

In stage S6, we turn on the safety light by energizing Y3.


Special relay contact SP1 is always on. Timer T0 times at 0.1
JMP
10
SG Push–DOWN State
second per count. To achieve 3 minutes time period, we
calculate:
S4
X0 S5
11
JMP

K=
3 min. x 60 sec/min S6 12
0.1 sec/count SET
SG
K = 1800 counts S5

SP1
LOWER State
Y2
13
The timer has power flow whenever stage S6 is active. The
corresponding timer bit T0 is set when the timer expires. So X2
OUT
S0
14
three minutes later, T0=1 and the instruction Reset S6 causes JMP
the stage to be inactive.
SG LIGHT State
A
While Stage S6 is active and the light is on, stage transitions S6
in the primary path continue normally and independently of
Stage 6. That is, the door can go up, down, or whatever, but
SP1 Y3
OUT
B
the light will be on for precisely 3 minutes.
TMR T0
K1800
C
T0 S6
RST D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–13


Chapter 7: RLLPLUS Stage Programming
Add Emergency Stop Feature
Some garage door openers today will detect an object under
1 the door. This halts further lowering of the door. Usually
implemented with a photocell (“electric-eye”), a door in the
2 process of being lowered will halt and begin raising. We will
define our safety feature to work in this way, adding the
input from the photocell to the block diagram as shown to
3 the right. X3 will be on if an object is in the path of the
door.
4 Next, we make a simple addition to the state transition Inputs Outputs
diagram, shown in shaded areas in the figure below. Note Toggle
X0 Y1

5 the new transition path at the top of the LOWER state. If


we are lowering the door and detect an obstruction (X3),
Up limit
X1 Y2
Raise

Lower
Ladder
we then jump to the Push-UP State. We do this instead of
6 jumping directly to the RAISE state, to give the Lower
Down limit
X2
Program
Y3 Light
output Y2 one scan to turn off, before the Raise output Y1 Obstruction
X3
7 energizes.
X0

8 X0 Push–UP
X0
RAISE X1

9 DOWN X3 LIGHT UP
T0

10
X0

11 X2 X3
LOWER Push–DOWN X0
X0

12 Exclusive Transitions
It is theoretically possible that the down limit (X2) and the obstruction input (X3) could
13 energize at the same moment. In that case, we would “jump” to the Push-UP and DOWN
states simultaneously, which does not make sense.
14 Instead, we give priority to the obstruction by
changing the transition condition to the DOWN SG
LOWER State
A state to [X2 AND NOT X3]. This ensures the
obstruction event has the priority. The
S5

SP1 Y2
modifications we must make to the LOWER Stage
B (S5) logic are shown to the right. The first rung
to DOWN
OUT

remains unchanged. The second and third rungs X2 X3 S0


C implement the transitions we need. Note the
opposite relay contact usage for X3, which ensures
JMP
X3 to Push-UP S2
D the stage will execute only one of the JMP
instructions.
JMP

7–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Stage Program Design Considerations 1


Stage Program Organization
The examples so far in this chapter used one self-contained state diagram to represent the
2
main process. However, we can have multiple processes implemented in stages, all in the same
ladder program. New stage programmers sometimes try to turn a stage on and off each scan, 3
based on the false assumption that only one stage can be on at a time. For ladder rungs that
you want to execute each scan, just put them in a stage that is always on.
The following figure shows a typical application. During operation, the primary
4
manufacturing activity Main Process, Powerup Initialization, E-Stop and Alarm Monitoring,
and Operator Interface are all running. At powerup, three initial stages shown begin 5
operation.
Main Process
6
XXX = ISG
Idle Fill Agitate Rinse Spin
7
Powerup Initialization E-Stop and Alarm Monitoring Operator Interface

Powerup Monitor Control Recipe


8
9
Status
10
In a typical application, the separate stage sequences above operate as follows:
• Powerup Initialization – This stage contains ladder rung tasks done just once at powerup. Its last 11
rung resets the stage, so this stage is only active for one scan (or only as many scans that are
required).
• Main Process – this stage sequence controls the heart of the process or machine. One pass through
12
the sequence represents one part cycle of the machine, or one batch in the process.
• E-Stop and Alarm Monitoring – This stage is always active because it is watching for errors that
13
could indicate an alarm condition or require an emergency stop. It is common for this stage to reset
stages in the main process or elsewhere, in order to initialize them after an error condition. 14
• Operator Interface – this is another task that must always be active and ready to respond to an
operator. It allows an operator interface to change modes, etc. independently of the current main
process step.
A
Although we have separate processes, there can be
coordination among them. For example, in an error Operator Interface B
condition, the Status Stage may want to Control Recipe
automatically switch the operator interface to the C
status mode to show error information as shown to
the right. The monitor stage could set the stage bit
for Status and Reset the stages Control and Recipe.
Monitor Status D
E-Stop and
Alarm Monitoring

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–15


Chapter 7: RLLPLUS Stage Programming

How Instructions Work Inside Stages


1 We can think of states or stages as simply dividing up our ladder program as depicted in the
figure below. Each stage contains only the ladder rungs which are needed for the
2 corresponding state of the process. The logic for transitioning out of a stage is contained
within that stage. It’s easy to choose which ladder rungs are active at powerup by using an
“initial” stage type (ISG).
3 Stage 0 Stage 1

4
Stage 2

5
6 Most all instructions work just like they do in standard RLL. You can think of a stage just like
a miniature RLL program which is either active or inactive.
7 Output Coils – As expected, output coils in active stages will turn on or off outputs
according to power flow into the coil. However, note the following:
8 • Outputs work as usual, provided each output reference (such as “Y3”) is used in only one stage.
• An output can be referenced from more than one stage, as long as only one of the stages is active at
9 a time.
• If an output coil is controlled by more than one stage simultaneously, the active stage nearest the
10 bottom of the program determines the final output status during each scan. Therefore, use the
OROUT instruction instead when you want multiple stages to have a logical OR control of an
output.
11 One-Shot or PD coils – Use care if you must use a Positive Differential coil in a stage.
Remember that the input to the coil must make a 0–1 transition. If the coil is already
12 energized on the first scan when the stage becomes active, the PD coil will not work. This is
because the 0–1 transition did not occur.

13 PD coil alternative: If there is a task which you want to do only once (on 1 scan), it can be
placed in a stage which transitions to the next stage on the same scan.
Counter – In using a counter inside a stage, the stage must be active for one scan before the
14 input to the counter makes a 0–1 transition. Otherwise, there is no real transition and the
counter will not count.
A The ordinary Counter instruction does have a restriction inside stages: it may not be reset
from other stages using the RST instruction for the counter bit. However, the special Stage
B counter provides a solution (see next paragraph).
Stage Counter – The Stage Counter has the benefit that its count may be globally reset from
C other stages by using the RST instruction. It has a count input, but no reset input. This is the
only difference from a standard counter.

D Drum – Realize that the drum sequencer is its own process, and is a different programming
method than stage programming. If you need to use a drum with stages, be sure to place the
drum instruction in an ISG stage that is always active.

7–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Using a Stage as a Supervisory Process


You may recall the light bulb on-off controller 1
example from earlier in this chapter. For the purpose
of illustration, suppose we want to monitor the
“productivity” of the lamp process, by counting the
Toggle
X0 Ladder Y0
2
Program
number of on-off cycles which occurs. This
application will require the addition of a simple 3
counter, but the key decision is in where to put the
counter. 4
Powerup
ISG OFF State
5
S0
Supervisor Supervisor Process
X0 S1
JMP
6
Powerup X0 Push–ON X0
SG
S1 Push–On State 7
OFF Main Process ON X0 S2
JMP
8
Push–OFF
X0 X0
SG
S2
ON State 9
New stage programming students will typically try to place
the counter inside one the the stages of the process they are
trying to monitor. The problem with this approach is that
SP1 Y0
OUT
10
the stage is active only part of the time. In order for the
counter to count, the count input must transition from off
X0 S3
JMP
11
to on at least one scan after its stage activates. Ensuring this
requires extra logic that can be tricky. SG
S3
Push–Off State 12
In this case, we only need to add another supervisory stage
X0 S0
as shown above, to “watch” the main process. The counter
inside the supervisor stage uses the stage bit S1 of the main
JMP 13
process as its count input. Stage bits used as a contact let us
monitor a process!
ISG
S4
Supervisor State 14
Note that both the Supervisor stage and the OFF stage are initial S1
stages. The supervisor stage remains active indefinitely.
SGCNT
K5000
CT0
A
Stage Counter B
The counter in the above example is a special Stage Counter. Note that it does not have a
reset input. The count is reset by executing a Reset instruction, naming the counter bit (CT0
in this case). The Stage Counter has the benefit that its count may be globally reset from
C
other stages. The standard Counter instruction does not have this global reset capability. You
may still use a regular Counter instruction inside a stage... however, the reset input to the D
counter is the only way to reset it.

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–17


Chapter 7: RLLPLUS Stage Programming

Power Flow Transition Technique


1 Our discussion of state transitions has shown how the Stage JMP instruction makes the
current stage inactive and the next stage (named in the JMP) active. As an alternative way to
2 enter this in DirectSOFT32, you may use the power flow method for stage transitions.
The main requirement is that the current stage be located directly above the next (jump-to)
3 stage in the ladder program. This arrangement is shown in the diagram below, by stages S0
and S1, respectively.
4 S0 X0
S1

5 SG
S0
SG
S0
S1
Equivalent
X0
6 JMP
All other rungs in stage...

X0

7 SG
S1 Power flow
transition

8 SG
S1

9 Recall that the Stage JMP instruction may occur anywhere in the current stage, and the result
is the same. However, power flow transitions (shown above) must occur as the last rung in a
10 stage. All other rungs in the stage will precede it. The power flow transition method is also
achievable on the handheld programmer, by simply following the transition condition with
the Stage instruction for the next stage.
11 The power flow transition method does eliminate one Stage JMP instruction, its only
advantage. However, it is not as easy to make program changes as using the Stage JMP.
12 Therefore, we advise using Stage JMP transitions for most programmers.
Stage View in DirectSOFT32
13 The Stage View option in DirectSOFT32 will let you view the ladder program as a flow
chart. The figure below shows the symbol convention used in the diagrams. You may find the
14 stage view useful as a tool to verify that your stage program has faithfully reproduced the logic
of the state transition diagram you intend to realize.
A SG
Stage Reference to Transition
J Jump S Set Stage
a Stage Logic

B R Reset Stage

The following diagram is a typical stage view of a ladder program containing stages. Note the
C left-to-right direction of the flow chart.

D ISG
SO
J
SG
S1
J
SG
S2 S
SG
S4

SG SG
J J S5
S3

7–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Parallel Processing Concepts 1


Parallel Processes
Previously in this chapter we discussed how a state may transition to either one state or
2
another, called an exclusive transition. In other cases, we may need to branch simultaneously to
two or more parallel processes, as shown below. It is acceptable to use all JMP instructions as 3
shown, or we could use one JMP and a Set Stage bit instruction(s) (at least one must be a
JMP, in order to leave S1). Remember that all instructions in a stage execute, even when it
transitions (the JMP is not a GOTO).
4
Process A
S2 S3
SG
S1
X0
Push–On State

S2
5
S0 S1 X0

S4 S5
JMP

S4
6
Process B JMP

Note that if we want Stages S2 and S4 to energize exactly on the same scan, both stages must
7
be located below or above Stage S1 in the ladder program (see the explanation at the bottom
of page 7–7). Overall, parallel branching is easy! 8
Converging Processes
Now we consider the opposite case of parallel branching, which is converging processes. This 9
simply means we stop doing multiple things and continue doing one thing at a time. In the
figure below, processes A and B converge when stages S2 and S4 transition to S5 at some
point in time. So, S2 and S4 are Convergence Stages.
10
Process A S1 S2 11
= Convergence Stage

S3 S4
S5 S6
12
Process B

Convergence Stages (CV) 13


While the converging principle is simple enough, it brings a new complication. As parallel
processing completes, the multiple processes almost never finish at the same time. In other
words, how can we know whether Stage S2 or S4 will finish last? This is an important point,
14
because we have to decide how to transition to Stage S5.
The solution is to coordinate the transition condition out of CV
AConvergence
S2
Stages
convergence stages. We accomplish this with a stage type designed
for this purpose: the Convergence Stage (type CV). In the example CV
B
to the right, convergence stages S2 and S4 are required to be S4

grouped together as shown. No logic is permitted between CV


stages! The transition condition (X3 in this case) must be located
X3 C S5
CVJMP
in the last convergence stage. The transition condition only has
power flow when all convergence stages in the group are active. SG
S5
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–19


Chapter 7: RLLPLUS Stage Programming

Convergence Jump (CVJMP)


1 Recall the last convergence stage only has power flow CV
when all CV stages in the group are active. To S2 Convergence
2 complement the convergence stage, we need a new
jump instruction. The Convergence Jump (CVJMP)
Jump

CV
shown to the right will transition to Stage S5 when
3 X3 is active (as one might expect), but it also
S4

X3 S5
automatically resets all convergence stages in the group.
4 This makes the CVJMP jump a very powerful
instruction. Note that this instruction may only be
CVJMP

SG

5 used with convergence stages. S5

Convergence Stage Guidelines


6 The following summarizes the requirements in the use of convergence stages, including some
tips for their effective application:
7 • A convergence stage is to be used as the last stage of a process which is running in parallel to another
process or processes. A transition to the convergence stage means that a particular process is
through, and represents a waiting point until all other parallel processes also finish.
8 • The maximum number of convergence stages which make up one group is 16. In other words, a
maximum of 16 stages can converge into one stage.
9 • Convergence stages of the same group must be placed together in the program, connected on the
power rail without any other logic in between.

10 • Within a convergence group, the stages may occur in any order, top to bottom. It does not matter
which stage is last in the group, because all convergence stages have to be active before the last stage
has power flow.
11 • The last convergence stage of a group may have ladder logic within the stage. However, this logic
will not execute until all convergence stages of the group are active.
12 • The convergence jump (CVJMP) is the intended method to be used to transition from the
convergence group of stages to the next stage. The CVJMP resets all convergence stages of the
group, and energizes the stage named in the jump.
13 • The CVJMP instruction must only be used in a convergence stage, as it is invalid in regular or
initial stages.
14 • Convergence Stages or CVJMP instructions may not be used in subroutines or interrupt routines.

A
B
C
D

7–20 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

RLLPLUS (Stage) Instructions 1


Stage (SG)
The Stage instructions are used to create structured RLLPLUS
2
programs. Stages are program segments which can be activated by SG
transitional logic, a jump or a set stage that is executed from an S aaa 3
active stage. Stages are deactivated one scan after transitional logic, a
jump, or a reset stage instruction is executed. 4
Operand Data Type DL05 Range

Stage S
aaa
0–377
5
The following example is a simple RLLPLUS program. This program utilizes an initial stage, 6
stage, and jump instructions to create a structured program.
7
Direct SOFT32 Handheld Programmer Keystrokes
8
ISG S0
U
ISG
A
0
ENT
9
$ A ENT
STR 0

X0 Y0
GX
OUT
A
0
ENT 10
OUT $ B

X1 S2 X
STR

SHFT
1
ENT

S C ENT
11
SET RST 2
SET

X5 S1
$
STR
F
5
ENT
12
K B ENT
JMP JMP 1
2
SG
B
1
ENT 13
SG S1 $ C

GX
STR
B
2
ENT

ENT
14
OUT 1
X2 Y1

OUT
2
SG
C
2
ENT
A
$ G ENT
STR 6

SG S2
GX
OUT
C
2
ENT B
$ H

V
STR

SHFT
7
ENT

S B ENT
C
X6 Y2 AND RST 1

OUT K
JMP
A
0
ENT
D
X7 S1 S0

JMP

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–21


Chapter 7: RLLPLUS Stage Programming

Initial Stage (ISG)


1 The Initial Stage instruction is normally used as the first ISG
segment of an RLLPLUS program. Multiple Initial Stages are
S aaa
2 allowed in a program. They will be active when the CPU
enters the Run mode allowing for a starting point in the
program.
3 Operand Data Type DL05 Range
4 Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
aaa
0–377

5 Initial Stages are also activated by transitional logic, a jump or a set stage executed from an
active stage.
6 JUMP (JMP)
The Jump instruction allows the program to transition from
S aaa
7 an active stage containing the jump instruction to another
stage (specified in the instruction). The jump occurs when
JMP

the input logic is true. The active stage containing the Jump
8 will deactivate 1 scan later.

9 Operand Data Type DL05 Range


aaa
10 Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377

11 Not Jump (NJMP)


The Not Jump instruction allows the program to transition
from an active stage which contains the jump instruction to
12 another which is specified in the instruction. The jump will S aaa
occur when the input logic is off. The active stage that NJMP
13 contains the Not Jump will be deactivated 1 scan after the
Not Jump instruction is executed.
14 Operand Data Type DL05 Range
aaa
A Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0–377

B
C
D

7–22 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

In the following example, only stage ISG0 will be active when program execution. begins.
When X1 is on, program execution will jump from Initial Stage 0 to Stage 1. 1
Direct SOFT32 Handheld Programmer Keystrokes 2
ISG S0 U A

$
ISG
B
0
ENT

ENT
3
S1 STR 1
X1
JMP K
JMP
B
1
ENT 4
2 B
SG S1

$
SG
C
1
ENT
5
ENT
Y5 STR 2
X2
OUT
GX
OUT
F
5
ENT 6
$ H
X7
S2

JMP
K
STR
C
7
ENT
7
ENT
JMP 2
X7
S3

NJMP
SHFT N
TMR
SHFT K
JMP
D
3
ENT 8
9
Converge Stage (CV) and Converge Jump (CVJMP)
The Converge Stage instruction is used to group certain 10
stages together by defining them as Converge Stages.
When all of the Converge Stages within a group become 11
active, the CVJMP instruction (and any additional logic in
the final CV stage) will be executed. All preceding CV
stages must be active before the final CV stage logic can be
CV
S aaa 12
executed. All Converge Stages are deactivated one scan after
the CVJMP instruction is executed. 13
Additional logic instructions are only allowed following the
last Converge Stage instruction and before the CVJMP 14
instruction. Multiple CVJUMP instructions are allowed. S aaa
Converge Stages must be programmed in the main body of CVJMP A
the application program. This means they cannot be
programmed in Subroutines or Interrupt Routines.
B
C
Operand Data Type DL05 Range

Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
aaa
0–377
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–23


Chapter 7: RLLPLUS Stage Programming

In the following example, when Converge Stages S10 and S11 are both active the CVJMP
1 instruction will be executed when X4 is on. The CVJMP will deactivate S10 and S11, and
activate S20. Then, if X5 is on, the program execution will jump back to the initial stage, S0.
2
3 Direct SOFT32 Handheld Programmer Keystrokes

U A ENT
ISG 0

4 ISG S0
$
STR
A
0
ENT

GX A ENT

5 Y0
$
OUT

STR
B
0

1
ENT
X0

6 OUT K

K
JMP
B

B
1
A
ENT

ENT
S1 JMP 1 0

7 X1
JMP 2
SG
B
1
ENT

S10 $ C ENT
8 JMP
K
JMP
STR
B
2

1
B
1
ENT

9 SG S1 SHFT C

C
2
V

V
AND
B

B
1
A

B
0
ENT

SHFT ENT
2 AND 1 1

10 X2 S11
JMP
$
STR
D
3
ENT

GX D

11 CV S10 $
OUT
E
3
ENT

ENT
STR 4

12 CV S11
SHFT C
2
V
AND
SHFT K
JMP
C
2
A
0
ENT

2 C A ENT
SG 2 0
13 Y3
$
STR
F
5
ENT
X3
OUT K A
14 JMP 0
ENT

X4 S20
A CVJMP

B SG S20

S0
C X5
JMP

7–24 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 7: RLLPLUS Stage Programming

Questions and Answers about Stage Programming 1


We include the following commonly-asked questions about Stage Programming as an aid to
new students. All question topics are covered in more detail in this chapter.
2
Q. What does stage programming do that I can’t do with regular RLL programs?
A. Stages allow you to identify all the states of your process before you begin programming.
This approach is more organized, because you divide up a ladder program into sections. As
3
stages, these program sections are active only when they are actually needed by the process.
Most processes can be organized into a sequence of stages, connected by event-based 4
transitions.
Q. What are Stage Bits? 5
A. A stage bit is just a single bit in the CPU’s image register, representing the active/inactive
status of the stage in real time. For example, the bit for Stage 0 is referenced as “S0”. If S0 6
= 0, then the ladder rungs in Stage 0 are bypassed (not executed) on each CPU scan. If S0
= 1, then the ladder rungs in Stage 0 are executed on each CPU scan. Stage bits, when used
as contacts, allow one part of your program to monitor another part by detecting stage
7
active/inactive status.
Q. How does a stage become active?
8
A. There are three ways:
• If the Stage is an initial stage (ISG), it is automatically active at powerup.
9
• Another stage can execute a Stage JMP instruction naming this stage, which makes it active upon its
next occurrence in the program. 10
• A program rung can execute a Set Stage Bit instruction (such as Set S0).
Q. How does a stage become inactive? 11
A. There are three ways:
• Standard Stages (SG) are automatically inactive at powerup.
12
• A stage can execute a Stage JMP instruction, resetting its Stage Bit to 0.
• Any rung in the program can execute a Reset Stage Bit instruction (such as Reset S0).
13
Q. What about the power flow technique of stage transitions? 14
A. The power flow method of connecting adjacent stages (directly above or below in the
program) actually is the same as the Stage Jump instruction executed in the stage above,
naming the stage below. Power flow transitions are more difficult to edit in A
DirectSOFT32, we list them separately from two preceding questions.
Q. Can I have a stage which is active for only one scan? B
A. Yes, but this is not the intended use for a stage. Instead, just make a ladder rung active for
1 scan by including a stage Jump instruction at the bottom of the rung. Then the ladder C
will execute on the last scan before its stage jumps to a new one.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 7–25


Chapter 7: RLLPLUS Stage Programming

Q. Isn’t a Stage JMP just like a regular GOTO instruction used in software?
1 A. No, it is very different. A GOTO instruction sends the program execution immediately to
the code location named by the GOTO. A Stage JMP simply resets the Stage Bit of the
2 current stage, while setting the Stage Bit of the stage named in the JMP instruction. Stage
bits are 0 or 1, determining the inactive/active status of the corresponding stages. A stage
JMP has the following results:
3 • When the JMP is executed, the remainder of the current stage’s rungs are executed, even if they
reside past(under) the JMP instruction. On the following scan, that stage is not executed, because it
4 is inactive.
• The Stage named in the Stage JMP instruction will be executed upon its next occurrence. If located
5 past (under) the current stage, it will be executed on the same scan. If located before (above) the
current stage, it will be executed on the following scan.

6 Q. How can I know when to use stage JMP, versus a Set Stage Bit or Reset Stage
Bit?
7 A. These instructions are used according to the state diagram topology you have derived:
• Use a Stage JMP instruction for a state transition... moving from one state to another.
8 • Use a Set Stage Bit instruction when the current state is spawning a new parallel state or stage
sequence, or when a supervisory state is starting a state sequence under its command.
• Use a Reset Bit instruction when the current state is the last state in a sequence and its task is
9 complete, or when a supervisory state is ending a state sequence under its command.
Q. What is an initial stage, and when do I use it?
10 A. An initial stage (ISG) is automatically active at powerup. Afterwards, it works just like any
other stage. You can have multiple initial stages, if required. Use an initial stage for ladder
11 that must always be active, or as a starting point.
Q. Can I have place program ladder rungs outside of the stages, so they are
12 always on?
A. It is possible, but it’s not good software design practice. Place ladder that must always be
13 active in an initial stage, and do not reset that stage or use a Stage JMP instruction inside
it. It can start other stage sequences at the proper time by setting the appropriate Stage
14 Bit(s).
Q. Can I have more than one active stage at a time?
A A. Yes, and this is a normal occurrence for many programs. However, it is important to
organize your application into separate processes, each made up of stages. And a good
process design will be mostly sequential, with only one stage on at a time. However, all the
B processes in the program may be active simultaneously.

C
D

7–26 DL05 Micro PLC User Manual, 5th Edition, 6/04


CHAPTER
PID LOOP OPERATION
8
In This Chapter:
In This Chapter: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–1
DL05 PID Loop Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–2
Loop Setup Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–6
Loop Sample Rate and Scheduling . . . . . . . . . . . . . . . . . . . . . . . . .8–13
Ten Steps to Successful Process Control . . . . . . . . . . . . . . . . . . . . .8–17
Basic Loop Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–19
PID Loop Data Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–26
PID Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–31
Loop Tuning Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–38
PV Analog Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–45
Feedforward Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–47
Time-Proportioning Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–49
Cascade Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–51
Ramp/Soak Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–57
Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–62
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–63
Glossary of PID Loop Terminology . . . . . . . . . . . . . . . . . . . . . . . . .8–64
Chapter 8: PID Loop Operation

1 DL05 PID Loop Features


Main Features
2 The DL05 process loop control offers a sophisticated set of features to address many
application needs. The main features are:
3 • Up to 4 loops, individual programmable sample rates
• Manual/ Automatic/Cascaded loop capability available
4 • Two types of bumpless transfer available
• Full-featured alarms
5 • Ramp/soak generator with up to 16 segments
• Auto Tuning
6 The DL05 CPU has process control loop capability in addition to ladder program execution.
You can select and configure up to four loops. All sensor and actuator wiring connects directly
7 to DL05 analog modules. All process variables, gain values, alarm levels, etc., associated with
each loop reside in a Loop Variable Table in the CPU. The DL05 CPU reads process variable
8 (PV) inputs during each scan. Then it makes PID loop calculations during a dedicated time
slice on each PLC scan, updating the control output value. The control loops use a
Proportional-Integral-Derivative (PID) algorithm to generate the control output. This chapter
9 describes how the loops operate, and what you must do to configure and tune the loops.
Analog Output
10
DL05
11 PID Loop Calculations Manufacturing Process

12
13
14
A Analog Input
The best tool for configuring loops in the DL05 is the DirectSOFT32 programming
B software, release 3.0c, or later. DirectSOFT32 uses dialog boxes to help you set up the
individual loops. After completing the setup, you can use DirectSOFT32’s PID Trend View
C to tune each loop. The configuration and tuning selections you make are stored in the DL05’s
FLASH memory, which is retentive. The loop parameters also may be saved to disk for recall
later.
D

8–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

PID Loop Feature


Number of loops Selectable, 4 maximum
Specifications 1
CPU V-memory needed
PID algorithm
32 words (V locations) per loop selected, 64 words if using ramp/soak
Position or Velocity form of the PID equation
2
Control Output polarity Selectable direct-acting or reverse-acting
Error term curves
Loop update rate (time between
Selectable as linear, square root of error, and error squared 3
PID calculation) 0.05 to 99.99 seconds, user programmable
Minimum loop update rate 0.05 seconds for 1 to 4 loops, 4
Loop modes Automatic, Manual (operator control), or Cascade control
Ramp/Soak Generator
PV curves
Up to 8 ramp/soak steps (16 segments) per loop with indication of ramp/soak step number
Select standard linear, or square-root extract (for flow meter input)
5
Set Point Limits Specify minimum and maximum setpoint values
Process Variable Limits Specify minimum and maximum Process Variable values 6
Proportional Gain Specify gains of 0.01 to 99.99
Integrator (Reset)
Derivative (Rate)
Specify reset time of 0.1 to 999.8 in units of seconds or minutes
Specify the derivative time from 0.01 to 99.99 seconds
7
Rate Limits Specify derivative gain limiting from 1 to 20
Bumpless Transfer I Automatically initialized bias and setpoint when control switches from manual to automatic
Automatically set the bias equal to the control output when control switches from manual to
8
Bumpless Transfer II automatic
Step Bias Provides proportional bias adjustment for large setpoint changes 9
Anti-windup For position form of PID, this inhibits integrator action when the control output reaches 0% or
100 % (speeds up loop recovery when output recovers from saturation)
Error Deadband Specify a tolerance (plus and minus) for the error term (SP–PV), so that no change in control
output value is made
10
11
Alarm Feature
Deadband
Specifications
Specify 0.1% to 5% alarm deadband on all alarms
12
PV Alarm Points
PV Deviation
Select PV alarm settings for Low–low, Low, High, and High-high conditions
Specify alarms for two ranges of PV deviation from the setpoint value
13
Rate of Change Detect when PV exceeds a rate of change limit you specify
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–3


Chapter 8: PID Loop Operation

The Basics of PID Loops


1 The key parts of a PID control loop are shown in the block diagram below. The path from
the PLC to the Manufacturing Process and back to the PLC is the “loop” in “closed loop
2 control.”
Loop Configuring External

3 PLC System
and Monitoring Disturbances

4 Setpoint Value
+ 
Error T erm Loop
Calculation
Control Output Manufacturing
Process

5 Process Variable

6 Manufacturing Process – the set of actions that adds value to raw materials. The process can
involve physical changes and/or chemical changes to the material. The changes render the
material more useful for a particular purpose, ultimately used in a final product.
7 Process Variable – a measurement of some physical property of the raw materials.
Measurements are made using some type of sensor. For example, if the manufacturing process
8 uses an oven, you will most likely want to control temperature. Temperature is a process
variable.
9 Setpoint Value – the theoretically perfect quantity of the process variable, or the desired
amount which yields the best product. The machine operator knows this value, and either sets
it manually or programs it into the PLC for later automated use.
10 External Disturbances – the unpredictable sources of error which the control system attempts
to cancel by offsetting their effects. For example, if the fuel input is constant an oven will run
11 hotter during warm weather than it does during cold weather. An oven control system must
counter-act this effect to maintain a constant oven temperature during any season. Thus, the
12 weather (which is not very predictable), is one source of disturbance to this process.
Error Term – the algebraic difference between the process variable and the setpoint. This is
13 the control loop error, and is equal to zero when the process variable is equal to the setpoint
(desired) value. A well-behaved control loop is able to maintain a small error term magnitude.

14 Loop Calculation – the real-time application of a mathematical algorithm to the error term,
generating a control output command appropriate for minimizing the error magnitude.
Various control algorithms are available, and the DL05 uses the Proportional-Integral-
A Derivative (PID) algorithm (more on this later).
Control Output – the result of the loop calculation, which becomes a command for the
B process (such as the heater level in an oven).
Loop Configuring – operator-initiated selections which set up and optimize the performance
C of a control loop. The loop calculation function uses the configuration parameters in real time
to adjust gains, offsets, etc.
D Loop Monitoring – the function which allows an operator to observe the status and
performance of a control loop. This is used in conjunction with the loop configuring to
optimize the performance of a loop (minimize the error term).

8–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

The diagram below shows each loop element in the form of its real-world physical
component. The example manufacturing process involves a liquid in a reactor vessel. A sensor 1
probe measures a process variable which may be pressure, temperature, or another parameter.
The sensor signal is amplified through a transducer, and is sent through the wire in analog
form to the PLC input module.
2
Using an analog I/O combination module, the PLC reads the PV from its analog input. The
CPU executes the loop calculation, and writes to the analog output. This signal goes to a 3
device in the manufacturing process, such as a heater, valve, pump, etc. Over time, the liquid
begins to change enough to be measured on the sensor probe. The process variable changes 4
accordingly. The next loop calculation occurs, and the loop cycle repeats in this manner
continuously.
5
Loop Configuration
and Monitoring
6
Process Variable 7
Control Output
8
9
10
Loop 11
Calculation
12
13
Manufacturing
Process
14
A
B
The personal computer shown is used to run DirectSOFT32, the PLC programming software
for DirectLOGIC programmable controllers. DirectSOFT32, release 3.0c or later, can C
program the DL05 PLC (including the PID feature). The software features a forms-based
editor to configure loop parameters. It also features a PID loop trending screen which will be
helpful during the loop tuning process. Details on how to use that software are in the
D
DirectSOFT32 Manual.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–5


Chapter 8: PID Loop Operation

1 Loop Setup Parameters


Loop Table and Number of Loops
2 The DL05 PLC gets its PID loop processing instructions only from tables in V-memory. A
“PID instruction” type in RLL does not exist for the DirectLogic PLCs. Instead, the CPU
3 reads setup parameters from reserved V-memory locations. Shown in the table below, you
must program a value in V7640 to point to the main loop table. Then you will need to
4 program V7641 with the number of loops you want the CPU to calculate. V7642 contains
error flags which will be set if V7640 or V7641 are programmed improperly.

5 Address
V7640
Setup Parameter Data type
Loop Parameter
Ranges
Octal
Read/Write
V1200 – V7377 write
Table Pointer
6 V7641
V7642
Number of Loops
Loop Error Flags
BCD
Binary
0–4
0 or 1
write
read

7 If the number of loops is “0”, the loop controller task is turned off during the ladder program
scan. The loop controller will allow use of loops in ascending order, beginning with 1. For
example, you cannot use loop 1 and 4 while skipping 2 and 3. The loop controller attempts
8 to control the full number of loops specified in V7641.
PID Error Flags
9 The CPU reports any programming errors of the setup parameters in V7640 and V7641. It
does this by setting the appropriate bits in V7642
10 on program-to-run mode transitions. PID Error Flags, V7642
If you use the DirectSOFT32 loop setup dialog
11 box, its automatic range checking prohibits
possible setup errors. However, the setup
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

parameters may be written using other methods such as RLL, so the error flag register may be
12 helpful in those cases. The following table lists the errors reported in V7642.
Bit Error Description (0 = no error, 1 = error)
13 0 The starting address (in V7640) is out of the lower V-memory range.
1 The starting address (in V7640) is out of the upper V-memory range.
14 2
3
The number of loops selected (in V7641) is greater than 4.
The loop table extends past (straddles) the boundary at V7377. Use an address closer to V1200.

A As a quick check, if the CPU is in Run mode and V7642=0000, there are no programming
errors.
B
C
D

8–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Establishing the Loop Table Size and Location


On a program -to-run mode transition, the CPU reads the loop setup parameters as pictured 1
below. At that moment, the CPU learns the location of the loop table and the number of
loops it configures. Then during the ladder program scan, the PID Loop task uses the loop
data to perform calculations, generate alarms, and so on. There are some loop table
2
parameters the CPU will read or write on every loop calculation.
3
4
CPU Tasks V–Memory Space 5
READ/
WRITE
User Data
6
Ladder LOOP
Program DATA
CONFIGURE/
7
MONITOR
PID Loop
Task
8
Setup Parameters
READ
(at powerup)
V7640, V7641 9
DirectSOFT32 Programming Software
10
V–Memory User Data
11
The Loop Parameter table contains data for
only as many loops as you selected in V7641.
12
Each loop configuration occupies 32 words (0 V2000
to 37 octal) in the loop table. V2037
LOOP #1
32 words 13
For example, suppose you have an application V2040 LOOP #2
with 4 loops, and you choose V2000 as the
V2077 32 words 14
starting location. The Loop Parameter will
LOOP #3
occupy V2000 – V2037 for loop 1, V2040 –
V2077 for loop 2 and so on. Loop 4 occupies 32 words A
V2140 - V2177. LOOP #4
32 words B
NOTE: The DL05 CPU’s PID algorithm requires DirectSOFT32 Version 3.0c (or later) and firmware version
2.1 (or later). See our website for more information: www.automationdirect.com.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–7


Chapter 8: PID Loop Operation

Loop Table Word Definitions


1 The parameters associated with each loop are listed in the following table. The address offset
is in octal, to help you locate specific parameters in a loop table. For example, if a table begins
2 at V2000, then the location of the reset (integral) term is Addr+11, or V2011. Do not use the
word# (in the first column) to calculate addresses.
3
4 Word #
1
Address+Offset
Addr + 0
Description
PID Loop Mode Setting 1
Format
bits
2 Addr + 1 PID Loop Mode Setting 2 bits
5 3 Addr + 2 Setpoint Value (SP) word/binary
4 Addr + 3 Process Variable (PV) word/binary
6 5
6
Addr + 4
Addr + 5
Bias (Integrator) Value
Control Output Value
word/binary
word/binary
7 Addr + 6 Loop Mode and Alarm Status bits
7 8 Addr + 7 Sample Rate Setting word/BCD
9 Addr + 10 Gain (Proportional) Setting word/BCD
8 10
11
Addr + 11
Addr + 12
Reset (Integral) Time Setting
Rate (Derivative) Time Setting
word/BCD
word/BCD
12 Addr + 13 PV Value, Low-low Alarm word/binary
9 13 Addr + 14 PV Value, Low Alarm word/binary
14 Addr + 15 PV Value, High Alarm word/binary
10 15
16
Addr + 16
Addr + 17
PV Value, High-high Alarm
PV Value, deviation alarm (YELLOW)
word/binary
word/binary
17 Addr + 20 PV Value, deviation alarm (RED) word/binary
11 18 Addr + 21 PV Value, rate-of-change alarm word/binary
19 Addr + 22 PV Value, alarm hysteresis setting word/binary
12 20
21
Addr + 23
Addr + 24
PV Value, error deadband setting
PV low-pass filter constant
word/binary
word/BCD
22 Addr + 25 Loop derivative gain limiting factor setting word/BCD
13 23 Addr + 26 SP value lower limit setting word/binary
24 Addr + 27 SP value upper limit setting word/binary
14 25
26
Addr + 30
Addr + 31
Control output value lower limit setting
Control output value upper limit setting
word/binary
word/binary
27 Addr + 32 Remote SP Value V-Memory Address Pointer word/hex
A 28 Addr + 33 Ramp/Soak Setting Flag bit
29 Addr + 34 Ramp/Soak Programming Table Starting Address word/hex
B 30
31
Addr + 35
Addr + 36
Ramp/Soak Programming Table Error Flags
PV direct access, channel number
bits
word/hex
32 Addr + 37 Control output direct access, channel number word/hex
C
D

8–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

PID Mode Setting 1 Bit Descriptions (Addr + 00)


The individual bit definitions of the PID Mode Setting 1 word (Addr+00) are listed in the 1
following table. Additional information about the use of this word is available later in this
chapter. 2
3
Bit
0
PID Mode Setting 1 Description
Manual Mode Loop Operation request
Read/Write
write
Bit=0

Bit=1
01 request
4
1 Automatic Mode Loop Operation request write – 01 request
2 Cascade Mode Loop Operation request write – 01 request 5
3 Bumpless Transfer select write Mode I Mode II
4
5
Direct or Reverse-Acting Loop select
Position / Velocity Algorithm select
write
write
Direct
Position
Reverse
Velocity
6
6 PV Linear / Square Root Extract select write Linear Sq. root
7 Error Term Linear / Squared select write Linear Squared 7
8 Error Deadband enable write Disable Enable
9
10
Derivative Gain Limit select
Bias (Integrator) Freeze select
write
write
Off
Off
On
On
8
11 Ramp/Soak Operation select write Off On
12 PV Alarm Monitor select write Off On 9
13 PV Deviation alarm select write Off On
14
15
PV rate-of-change alarm select
Loop mode is independent from CPU mode when set
write
write
Off
Loop withCPU
On
Loop Independent
10
mode of CPU mode
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–9


Chapter 8: PID Loop Operation

PID Mode Setting 2 Bit Descriptions (Addr + 01)


1 The individual bit definitions of the PID Mode Setting 2 word (Addr+01) are listed in the
following table. Additional information about the use of this word is available later in this
2 chapter.

3 Bit PID Mode Setting 2 Description Read/Write Bit=0 Bit=1


0 Input (PV) and Control Output Range Unipolar/Bipolar
select (See Notes 1 and 2) write unipolar bipolar
4 1 Input/Output Data Format select (See Notes 1 and 2) write 12 bit 15 bit
2 Analog Input filter write off on
5 3 SP Input limit enable
4 Integral Gain (Reset) units select
write
write
disable
seconds
enable
minutes
5 Select Autotune PID algorithm write closed loop open loop
6 6 Autotune selection write PID PI only (rate = 0)
7 Autotune start read/write autotune done force start
7 8 PID Scan Clock (internal use) read – –
9 Input/Output Data Format 16-bit select
(See Notes 1 and 2) write not 16 bit select 16 bit

8 10 Select separate data format for input and output


(See Notes 2, and 3) write same format separate formats

11 Control Output Range Unipolar/Bipolar select


9 See Notes 2, and 3)
12 Output Data Format select (See Notes 2, and 3)
write
write
unipolar
12 bit
bipolar
15 bit
13 Output data format 16-bit select (See Notes 2, and 3) write not 16 bit select16 bit
10 14–15 Reserved for future use – – –

11 Note 1: If the value in bit 9 is 0, then the values in bits 0 and 1 are read. If the value in bit 9 is 1, then the
values in bits 0 and 1 are not read, and bit 9 defines the data format (the range is automatically
unipolar).
12
Note 2: If the value in bit 10 is 0, then the values in bits 0, 1, and 9 define the input and output ranges and
13 data formats (the values in bits 11, 12, and 13 are not read). If the value in bit 10 is 1, then the
values in bits 0, 1, and 9 define only the input range and data format, and bits 11, 12, and 13 are
14 read and define the output range and data format.

Note 3: If bit 10 has a value of 1 and bit 13 has a value of 0, then bits 11 and 12 are read and define the
A output range and data format. If bit 10 and bit 13 each have a value of 1, then bits 11 and 12 are
not read, and bit 13 defines the data format, (the output range is automatically unipolar).
B
C
D

8–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Mode/Alarm Monitoring Word (Addr + 06)


The individual bit definitions of the Mode / Alarm monitoring (Addr+06) word is listed in 1
the following table. More details are in the PID Mode section and Alarms section.

Bit Mode/Alarm Bit Description Read/Write Bit=0 Bit=1


2
0 Manual Mode Indication read – Manual
1 Automatic Mode Indication read – Auto 3
2 Cascade Mode Indication read – Cascade
3 PV Input LOW–LOW Alarm
4 PV Input LOW Alarm
read
read
Off
Off
On
On
4
5 PV Input HIGH Alarm read Off On
6 PV Input HIGH–HIGH Alarm read Off On 5
7 PV Input YELLOW Deviation Alarm read Off On
8 PV Input RED Deviation Alarm
9 PV Input Rate-of-Change Alarm
read
read
Off
Off
On
On
6
10 Alarm Value Programming Error read – Error
11 Loop Calculation Overflow/Underflow read – Error 7
12 Loop in Auto-Tune indication read Off On
13 Auto-Tune error indication
14–15 Reserved for Future Use
read



Error

8
Ramp/Soak Table Flags (Addr + 33) 9
The individual bit definitions of the Ramp/Soak Table Flag (Addr+33) word is listed in the
following table. Further details are given in the Ramp/Soak Operation section. 10
Bit Ramp/Soak Flag Bit Description Read/Write Bit=0 Bit=1
0
1
Start Ramp / Soak Profile
Hold Ramp / Soak Profile
write
write


01 Start
01 Hold
11
2
3
Resume Ramp / soak Profile
Jog Ramp / Soak Profile
write
write


01 Resume
01 Jog 12
4 Ramp / Soak Profile Complete read – Complete
5
6
PV Input Ramp / Soak Deviation
Ramp / Soak Profile in Hold
read
read
Off
Off
On
On
13
7
8–15
Reserved
Current Step in R/S Profile
read
read
– –
decode as byte (hex) 14
Bits 8–15 must be read as a byte to indicate the current segment number of the Ramp/Soak
generator in the profile. This byte will have the values 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E,
A
F, and 10, which represent segments 1 to 16 respectively. If the byte=0, then the Ramp/Soak
table is not active. B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–11


Chapter 8: PID Loop Operation

Ramp/Soak Table Location (Addr + 34)


1 Each loop that you configure has the option of using a built-in Ramp/Soak generator
dedicated to that loop. This feature generates SP values that follow a profile. To use the Ramp
2 Soak feature, you must program a separate table of 32 words with appropriate values. A
DirectSOFT32 dialog box makes this easy to do.
3 In the loop table, the Ramp/Soak Table Pointer at Addr+34 must point to the start of the
ramp/soak data for that loop. This may be anywhere in user memory, and does not have to
adjoin to the Loop Parameter table, as shown to the left. Each R/S table requires 32 words,
4 regardless of the number of segments programmed.
The ramp/soak table parameters are defined in the table below. Further details are in the
5 section on Ramp/Soak Operation in this chapter.
Addr Step Addr Step Description
6 Offset Description Offset
V–Memory Space + 00 1 Ramp End SP Value + 20 9 Ramp End SP Value
7 User Data
+ 01
+ 02
1
2
Ramp Slope
Soak Duration
+ 21
+ 22
9
10
Ramp Slope
Soak Duration

8 V2000
V2037
LOOP #1
32 words
LOOP #2
+ 03
+ 04
2
3
Soak PV Deviation
Ramp End SP Value
+ 23
+ 24
10
11
Soak PV Deviation
Ramp End SP Value
32 words + 05 3 Ramp Slope + 25 11 Ramp Slope
9 V3000
+ 06
+ 07
4
4
Soak Duration
Soak PV Deviation
+ 26
+ 27
12
12
Soak Duration
Soak PV Deviation
Ramp/Soak #1

10 32 words
+ 10
+ 11
5
5
Ramp End SP Value
Ramp Slope
+ 30
+ 31
13
13
Ramp End SP Value
Ramp Slope
+ 12 6 Soak Duration + 32 14 Soak Duration
11 V2034 = 3000 Octal
Pointer to R/S table
+ 13
+ 14
6
7
Soak PV Deviation
Ramp End SP Value
+ 33
+ 34
14
15
Soak PV Deviation
Ramp End SP Value

12 + 15
+ 16
7
8
Ramp Slope
Soak Duration
+ 35
+ 36
15
16
Ramp Slope
Soak Duration
+ 17 8 Soak PV Deviation + 37 16 Soak PV Deviation
13 Ramp/Soak Table Programming Error Flags (Addr + 35)
The individual bit definitions of the Ramp/Soak Table Programming Error Flags word
14 (Addr+35) is listed in the following table. Further details are given in the PID Loop Mode
section and in the PV Alarm section later in this chapter.
A
Bit R/S Error Flag Bit Description Read/Write Bit=0 Bit=1
B 0
1
Starting Addr out of lower V-memory range
Starting Addr out of upper V-memory range
read
read


Error
Error
2–3 Reserved for Future Use – – –
C 4 Starting Addr in System Parameter V-memory Range read – Error
5–15 Reserved for Future Use – – –
D

8–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Loop Sample Rate and Scheduling 1


Loop Sample Rates Addr + 07
The main tasks of the CPU fall into categories 2
as shown to the right. The list represents the Read
tasks done when the CPU is in Run Mode, on Inputs 3
each PLC scan. Note that PID loop calculations
occur after the ladder logic task.
Note: It is possible to keep the PID loops
Service 4
Peripherals
running even when the ladder is not. This is
done by selecting direct access in Addr + 36 and 5
placing a 1 in bit 15 of Addr + 00. Ladder

The sample rate of a control loop is simply the PLC


Program
6
frequency of the PID calculation. Each Scan
calculation generates a new control output
value. With the DL05 CPU, you can set the
Calculate
PID Loops
7
sample rate of a loop from 50 mS to 99.99
seconds. Most loops do not require a fresh PID
Internal
8
calculation on every PLC scan. Some loops may Diagnostics
need to be calculated only once in 1000 scans. 9
You select the desired sample rate for each loop,
and the CPU automatically schedules and
executes PID calculations on the appropriate
Write
Outputs
10
scans.
Choosing the Best Sample Rate
11
For any particular control loop, there is no single perfect sample rate to use. A good sample
rate is a compromise that simultaneously satisfies various guidelines:
12
• The desired sample rate is proportional to the response time of the PV to a change in control
output. Usually, a process with a large mass will have a slow sample rate, but a small mass needs a 13
faster sample rate.
• Faster sample rates provide a smoother control output and accurate PV performance, but use more
CPU processing time. Sample rates much faster than necessary serve only to waste CPU processing
14
power.
• Slower sample rates provide a rougher control output and less accurate PV performance, but use less
A
CPU processing time.
• A sample rate which is too slow will cause system instability, particularly when a change in the B
setpoint or a disturbance occurs.
As a starting point, determine a sample rate for your loop which will be fast enough to avoid C
control instability (which is extremely important). Follow the procedure on the next page to
find a starting sample rate:
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–13


Chapter 8: PID Loop Operation

Determining a suitable sample rate (Addr+07):


1 1. Operate the process open-loop (the loop does not even need to be configured yet). Place
the CPU in run mode (and the loop in Manual mode, if you have already configured it).
2 Manually set the control output value so the PV is stable and in the middle of a safe range.
2. Try to choose a time when the process will have negligible external disturbances. Then
3 induce a sudden 10% step change in the control value.
3. Record the rise or fall time of the PV (time between 10% to 90% points).
4 4. Divide the recorded rise or fall time by 10. This is the initial sample rate you can use to
begin tuning your loop.
5 Control 10% of full output range
Output
6 90%

7 PV
10%
Rise T ime
8 Sample
Rate
9 In the figure above, suppose the measured rise time response of the PV was 25 seconds. The
suggested sample rate from this measurement will be 2.5 seconds. For illustration, the sample
10 rate time line shows ten samples within the rise time period. These show the frequency of
PID calculations as the PV changes values. Of course, the sample rate and PID calculations
are continuous during operation.
11 NOTE: An excessively fast sample rate will diminish the available resolution in the PV Rate-of-Change
Alarm, because the alarm rate value is specified in terms of PV change per sample period. For
12 example, a 50 mS sample rate means the smallest PV rate-of-change we can detect is 20 PV counts
(least significant bit counts) per second, or 1200 LSB counts per minute.
13 Programming the Sample Rate
14 The Loop Parameter table for each loop has a data location for the sample rate. Referring to
the figure below, location V+07 contains a BCD number from 00.05 to 99.99 (with an
implied decimal point). This represents 50 mS to 99.99 seconds. This number may be
A programmed using DirectSOFT32’s PID Setup screen, or any other method of writing to V-
memory. It must be programmed before the loop will operate properly.
B Setpoint Error T erm Loop Control Output
+  Calculation
C –

Process Variable
D Sample Rate–V+07
Sample Rate
X X X X BCD 00.05 to 99.99 sec

8–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

PID Loop Effect on CPU Scan Time


Since PID loop calculations are a task within the CPU scan activities, the use of PID loops 1
will increase the average scan time. The amount of scan time increase is proportional to the
number of loops used and the sample rate of each loop. 2
The execution time for a single loop calculation depends PID Calculation Time
on the number of options selected, such as alarms, error
squared, etc. The chart to the right gives the range of times
Minimum
Typical
150 µS
250 µS
3
you can expect. Maximum 350 µS
To calculate scan time increase, we also must know (or estimate) the scan time of the ladder
4
(without loops). A fast scan time will increase by a smaller percentage than a slow scan time
will, when adding the same PID loop calculation load in each case. The formula for average 5
scan time calculation is:

Avg. Scan Time with PID loop =


Scan time without loop
X PID calculation time + Scan time without loop
6
Sample rate of loop
7
50 mS
Average Scan time with PID loop =
3 sec.
X 250 µ S + 50 mS = 50.004 mS 8
As the calculation shows, the addition of only one loop with a slow sample rate has a very
small effect on scan time. Next, expand the equation above to show the effect of adding any
9
number of loops:
10
n=L

Avg. Scan Time with PID loops =


n=1
Scan time without loop
Sample rate of nth loop
X PID calculation time + Scan time
without loops
11
In the new equation above, you calculate the summation term (inside the brackets) for each
12
loop from 1 to L (last loop), and add the right-most term “scan time without loops” only
once at the end. Suppose you have a DL05 PLC controlling four loops. The table below 13
shows the data and summation term values for each loop.

Loop Number Description Sample Rate Summation Term


14
1
2
Steam Flow, Inlet valve
Water bath temperature
0.25 sec
30 sec
50 µS
0.42 µS
A
3 Dye level, main tank 10 sec 1.25 µS
4 Steam Pressure, Autoclave 1.5 sec 8.3 µS B
Now adding the summation terms, plus the original scan time value, we have: C
Avg. Scan Time with PID loops = 50 µS + 0.42 µS + 1.25 µS + 8.3µS + 50 mS = 50.06 mS D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–15


Chapter 8: PID Loop Operation

The DL05 CPU only does PID calculation on a particular scan for the loop(s) which have
1 sample time periods that are due for an update (calculation). The built-in loop scheduler
applies the following rules:
2 • Loops with sample rates 2 seconds are processed at the rate of as many loops per scan as is required
to maintain each loop’s sample rate. Specifying loops with fast sample rates will increase the PLC
scan time. So, use this capability only if you need it!
3 • Loops with sample rates > 2 seconds are processed at the rate of one or fewer loops per scan, at the
minimum rate required to maintain each loop’s sample rate.
4 The implementation of loop calculation scheduling is shown in the flow chart below. This is a
more detailed look at the contents of the “Calculate PID Loops” task in the CPU scan
5 activities flow chart. The pointers “I” and “J” correspond to the slow (> 2 sec) and fast ( 2 sec)
loops, respectively. The flow chart allows the J pointer to increment from loop 1 to the last
loop, if there are any fast loops specified. The I pointer increments only once per scan, and
6 then only when the next slow loop is due for an update. In this way, both I and J pointers
cycle from 1 to the highest loop number used, except at different rates. Their combined
7 activity keeps all loops properly updated.

8 Loop Sample Times  2 seconds: Loop Sample Times > 2 seconds:

9 Begin PID loop task

10
Loop J
11 No
Sample rate 2 sec?
No Loop I
Time up?

12 Yes Yes

Loop I
No Loop J PID Calculation
13 Time up?

Yes
14 Loop J Set I = I+1
PID Calculation
A
I > total number
B No J > total Yes
selected loops?
Yes

number of loops?
C Set J = J+1 Set J = 0
No Set I=0

D
End PID loop task

8–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Ten Steps to Successful Process Control 1


Modern electronic controllers such as the DL05 CPU provide sophisticated process control
features. Automated control systems can be difficult to debug, because a given symptom can
have many possible causes. We recommend a careful, step-by-step approach to bringing new 2
control loops online:
Step 1: Know the Recipe 3
The most important knowledge is – how to make your product. This knowledge is the
foundation for designing an effective control system. A good process “recipe” will do the 4
following:
• Identify all relevant Process Variables, such as temperature, pressure, or flow rates, etc. which need
precise control.
5
• Plot the desired Setpoint values for each process variables for the duration of one process cycle. 6
Step 2: Plan Loop Control Strategy
This simply means choosing the method the machine will use to maintain control over the
Process Variables to follow their Setpoints. This involves many issues and trade-offs, such as
7
energy efficiency, equipment costs, ability to service the machine during production, and
more. You must also determine how to generate the Setpoint value during the process, and 8
whether a machine operator can change the SP.
Step 3: Size and Scale Loop Components 9
Assuming the control strategy is sound, it is still crucial to properly size the actuators and
properly scale the sensors. 10
• Choose an actuator (heater, pump. etc.) which matches the size of the load. An oversized actuator
will have an overwhelming effect on your process after a SP change. However, an undersized
actuator will allow the PV to lag or drift away from the SP after a SP change or process disturbance.
11
• Choose a PV sensor which matches the range of interest (and control) for our process. Decide the
resolution of control you need for the PV (such as within 2 deg. C), and make sure the sensor input
12
value provides the loop with at least 5 times that resolution (at LSB level). However, an over-
sensitive sensor can cause control oscillations, etc. The DL05 provides 12–bit and 15–bit unipolar
and bipolar data format options, and a 16–bit unipolar option. This selection affects SP, PV,
13
Control Output and Integrator sum.
Step 4: Select I/O Modules
14
After deciding the number of loops, PV variables to measure, and SP values, you can choose
the appropriate I/O modules. Refer to the figure on the next page. In many cases, you will be A
able to share input or output modules, or use a analog I/O combination module, among
several control loops. The example shown sends the PV and Control Output signals for two
loops through the same set of modules.
B
Automationdirect offers DL05 analog input modules with 4 channels per module that accept
0 – 20mA or 4 – 20mA signals. Also, analog input and output combination modules are now
C
available. Refer to the sales catalog for further information on these modules, or find the
modules on our website, www.automationdirect.com. D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–17


Chapter 8: PID Loop Operation

DL05 CPU

1 Input
Module
V-memory

Loop 1 Data
Digital
Output

Channel 1 PV SP OUT Channel 1 Process 1

2 Channel 2 PV
Loop 2 Data
SP OUT Channel 2 Process 2

Channel 3

3 Channel 4

4 Step 5: Wiring and Installation


After selection and procurement of all loop components and I/O module(s), you can perform the
5 wiring and installation. Refer to the wiring guidelines in Chapter 2 of this Manual, and to the
D0–OPTIONS–M manual. The most common wiring errors when installing PID loop controls are:
• Reversing the polarity of sensor or actuator wiring connections.
6 • Incorrect signal ground connections between loop components.
Step 6: Loop Parameters
7 After wiring and installation, choose the loop setup parameters. The easiest method for
programming the loop tables is using DirectSOFT32 (3.0c or later). This software provides
8 PID Setup dialog boxes which simplify the task. Note: It is important to understand the
meaning of all loop parameters mentioned in this chapter before choosing values to enter.
9 Step 7: Check Open Loop Performance
With the sensor and actuator wiring done, and loop parameters entered, we must manually
10 and carefully check out the new control system (use Manual Mode).
• Verify that the PV value from the sensor is correct.
11 • If it is safe to do so, gradually increase the control output up above 0%, and see if the PV responds
(and moves in the correct direction!).

12 Step 8: Loop Tuning


If the Open Loop Test (see Loop Tuning on page 8–38) shows the PV reading is correct and
13 the control output has the proper effect on the process, you can follow the closed loop tuning
procedure (see Automatic Mode on page 8–39). In this step, you tune the loop so the PV
automatically follows the SP.
14 Step 9: Run Process Cycle
If the closed loop test shows the PV will follow small changes in the SP, consider running an
A actual process cycle. You will need to have completed the programming which will generate
the desired SP in real time. In this step, you may want to run a small test batch of product
B through the machine, watching the SP change according to the recipe.
WARNING: Be sure the Emergency Stop and power-down provision is readily accessible, in case the
C process goes out of control. Damage to equipment and/or serious injury to personnel can
result from loss of control of some processes.

D Step 10: Save Parameters


When the loop tests and tuning sessions are complete, be sure to save all loop setup
parameters to disk.

8–18 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Basic Loop Operation 1


Data Locations
Each PID loop is dependent on the instructions and data values in its respective loop table. 2
The following diagram shows an example of the loop table locations corresponding to the
main three loop variables: SP, PV, and Control Output. The example below begins at V2000 3
(you can use any memory location compatible with Loop Table requirements). The SP, PV
and Control Output are located at the addresses shown.
Setpoint V+02 Error Loop Control Output V+05
4
+  Term Calculation

Process Variable V+03
5
V2002
Loop Table
XXXX Setpoint
6
V2003 XXXX Process Variable
V2005 XXXX Control Output 7
Data Sources
The data for the SP, PV, and Control Output must interface with real-world devices. In the 8
figure below, the sources or destinations are shown for each loop variable. The Control
Output and Process Variable values move through the analog input/output combination
module to interface with the process itself.
9
A few rungs of ladder logic are required to copy data from the analog module to the loop
table, or vice versa. Refer to the analog module chapter of this manual for an example of the
10
required ladder logic.
11
Setpoint V+02
+ 
Loop
Calculation
Control Output V+05
Analog
12
Setpoint Sources: – Output
Operator Input
Process Variable V+03
Process
13
Ramp/soak generator
Ladder Program
Another loop’s output (cascade)
Analog
Input 14
The Setpoint has several possible sources, as listed above. Many applications will use two or
more of the sources at different times, depending on the loop mode. In addition, the loop
A
control strategy and programming method also determine how the setpoint is generated.
When using the built-in Ramp/Soak generator or when cascading a loop, the PID controller
B
automatically writes the setpoint data in location V+02 for you. If you want to use a setpoint
from any other source, the ladder program must write that setpoint to the loop table C
location V+02.
Each of the three main loop parameters can have only one source or destination at any given D
time. During the application development, it is a good idea to draw loop schematic diagrams
showing data sources, etc., to help avoid mistakes.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–19


Chapter 8: PID Loop Operation

Direct Access to Analog I/O


1 The loop controller in the DL05 PLC has the ability to directly access analog input and
output values independent of the ladder logic scan. These values represent the process variable
2 (PV) and the control output. The Direct Access feature makes it possible for the loop
controller to perform closed-loop control while the CPU is in Program Mode.
3 The loop controller can read the analog PV value in the selected data format directly from the
desired analog input module and write the control output value in the same or a different
data format to the desired analog output. The Direct Access feature, when enabled, accesses
4 the analog values only once per PID calculation for each respective loop. The ladder logic,
however, may simultaneously access the same analog input data by the standard method (LD
5 instruction) or by the pointer method whenever the CPU is in Run Mode.
NOTE: If PID direct access is used, do not use the analog output pointer logic to send data to the outputs.
6 You may optionally configure each loop to access its analog I/O (PV and control output) by
7 placing proper values in the associated loop table registers. The figure below shows the loop
table parameters at V+36 and V+37 and their role in direct access to the analog values.

8 Setpoint V+02

Error Loop Control output V+05
Calculation

9 Process Variable V+03

10 Loop Table
V2036 0F XX Slot / channel number for PV

11 V2037 0F XX Slot / channel number for Output

0F XX
12 Channel number, 1 to 4
Stands for Option Module Slot
13
You may program these loop table parameters directly, or use the appropriate DirectSOFT32
14 dialog box for easy configuring. For example, a value of “0F02” in register V2036 directs the
loop controller to read the PV data from channel 1 of the analog input module. A value of
“0000” in either register tells the loop controller not to access the corresponding analog value
A directly. In that case, ladder logic must transfer the value between the loop table and the
analog input module.
B If the PV or control output values require some math manipulation by ladder logic, then it
will not be possible to use the direct access function of the loop controller. In this case, ladder
C logic will have to perform the math and transfer the data from the analog module as required.
NOTE: The loop controller restricts the transfer of analog data to or from the module to one method. In
D other words, you must designate the analog module for direct access or ladder logic access.

8–20 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Loop Modes
The DL05 gives you the three standard control modes: Manual, Automatic, and Cascade. The 1
sources of the three basic variables SP, PV, and control output are different for each mode. An
introduction to the three control modes and their signal sources follows. 2
In Manual Mode, the loop is not executing PID calculations (however, loop alarms are still
active). With regard to the loop table, the CPU stops writing values to location V+05 for that
loop. It is expected that an operator or other intelligent source is manually controlling the
3
output, by observing the PV and writing data to V+05 as necessary to keep the process under
control. The drawing below shows the equivalent schematic diagram of manual mode 4
operation.
Input from Operator Manual 5
Control Output V+05
Loop
Calculation
6
Auto
In Automatic Mode, the loop operates normally and generates new control output values. It 7
calculates the PID equation and writes the result in location V+05 every sample period of that
loop. The equivalent schematic diagram is shown below. 8
Input from Operator Manual

Control Output V+05 9


Loop
Calculation
Auto 10
In Cascade Mode, the loop operates as it does in Automatic Mode, with one important
difference. The data source for the SP changes from its normal location at V+02, using the
control output value from another loop. So in Auto or Manual modes, the loop calculation
11
uses the data at V+02. In Cascade Mode, the loop calculation reads the control output from
another loop’s parameter table. 12
Another loop Cascaded loop

Loop Control Output V+05 Cascade 13


Calculation Control Output
Setpoint Loop

Normal SP V+02 +

Calculation 14
Auto/Manual Process Variable
As pictured below, A loop can be changed from one mode to another, but cannot go from A
Manual Mode directly to Cascade, or vice versa. This mode change is prohibited because a loop
would be changing two data sources at the same time, and could cause a loss of control. B
C
Manual Automatic Cascade
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–21


Chapter 8: PID Loop Operation

CPU Modes and Loop Modes


1 The DL05 PLC has the ability to run PID calculations while the CPU is in Program Mode.
Usually, a CPU in Program Mode has halted all operations. However, a DL05 PLC in
2 Program Mode may or may not be running PID calculations (and providing PID control
output), depending on your configuration settings. Having the ability to run loops
3 independent of the ladder logic makes it feasible to make a ladder logic change while the
process is still running. This is especially beneficial for large-mass continuous processes that
are difficult or costly to interrupt.
4 Loops that run independent of the ladder scan must have the ability to directly access the
analog module channels for the PV and control output values. The loop controller does have
5 this capability, which is covered in the section on direct access of analog I/O (located prior to
this section in this chapter).
6 The relationship between CPU modes and loop modes is depicted in the figure below. The
vertical dashed line shows the optional relationship between the mode changes. Bit 15 of PID
Mode 1 setting word (V+00) determines the selection. If set to zero so the loop follows the
7 CPU mode, then placing the CPU in Program Mode will force all loops into Manual Mode.
Similarly, placing the CPU in Run mode will allow each loop to return to the mode it was in
8 previously (which includes Manual, Automatic, and Cascade). With this selection you
automatically affect the modes of the loops by changing the CPU mode.
9 CPU Modes:

Mode change
Program Run

10
Loop Mode Linking
11 0 = loop follows PLC mode
1 = loop is independent
PID Mode 1 Setting V+00

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
of PLC mode
12 Loop
Modes:

13 Manual
Mode change
Automatic
Mode change
Cascade

14 If Bit 15 is set to one, then the loops will run independent of the CPU mode. It is like having
two independent processors in the CPU... one is running ladders and the other is running the
A process loops.
NOTE: .To make changes to any loop table parameter values, the PID loop must be in Manual Mode and
B the PLC must be stopped. If you have selected (as shown above) to operate the PID loop
independent of the CPU mode, then you must take certain steps to make it possible to make loop
C parameter changes. You can temporarily make the loops follow the CPU mode by changing bit 15 to
0. Then your programming device (such as DirectSOFT32) will be able to place the loop into Manual
Mode. After you change the loop’s parameter setting, just restore bit 15 to a value of 1 to re-
D establish PID operation independent of the CPU.

8–22 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

How to Change Loop Modes


The first three bits of the PID Mode 1 word (V+00)
PID Mode 1 Setting V+00
1
request the operating mode of the corresponding loop. Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note: these bits are mode change requests, not
commands (certain conditions can prohibit a particular Cascade Manual
2
mode change – see next page). Automatic

The normal state of these mode request bits is “000”. To request a mode change, you must
3
SET the corresponding bit to a “1”, for one scan. The PID loop controller automatically
resets the bits back to “000” after it reads the mode change request. Methods of requesting 4
mode changes are:
• DirectSOFT32’s PID View – this is the easiest method. Click on one of the radio buttons, and
DirectSOFT32 sets the appropriate bit.
5
• HPP – Use Word Status (WD ST) to monitor the contents of V+00, which will be a 4-digit
BCD/hex value. You must calculate and enter a new value for V+00 that ORs the correct mode bit
6
with its current value.
• Ladder program– ladder logic can request any loop mode when the PLC is in Run Mode. This will 7
be necessary after application startup.
Go to Auto Mode
Use the program shown to the right to SET the mode bit
(do not use an out coil). On a 0–1 transition of X0, the rung
X0 B2000.1
8
SET
sets the Auto bit equal to 1. The loop controller resets it.
• Operator panel – interface the operator’s panel to ladder
9
logic using standard methods, then use the logic to the right to set the mode bit.
Since we can only request mode changes, the PID loop controller decides when to permit 10
mode changes and provides the loop mode status. It reports the current mode on bits 0, 1,
and 2 of the Loop Mode and Alarm Status word, location V+06 in the loop table. The
parallel request/monitoring functions are shown in the figure below. The figure also shows the
11
two possible mode-dependent SP sources, and the two possible Control Output sources.
12
Control Output
Input from Operator
Manual 13
from another loop Cascade Control Output
Setpoint
+  Error T erm Loop
Calculation
14
Normal Source – Auto/Cascade
Auto/Manual Process Variable
Mode Select
A
PID Mode
B
Control

PID Mode 1 Setting V+00 Loop Mode and Alarm Status V+06
C
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D
Mode Request Mode Monitoring
Cascade Manual Cascade Manual
Automatic Automatic

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–23


Chapter 8: PID Loop Operation

Operator Panel Control of PID Modes


1 Since the modes Manual, Auto, and Cascade are the most fundamental and important PID
loop controls, you may want to “hard-wire” mode control switches to an operator’s panel.
2 Most applications will need only Manual and Auto selections (Cascade is used in a few
advanced applications). Remember that mode controls are really mode request bits, and the
3 actual loop mode is indicated elsewhere.
The following figure shows an operator’s panel using momentary push-buttons to request
PID mode changes. The panel’s mode indicators do not connect to the switches, but interface
4 to the corresponding data locations.

5 Operator’s Panel Manual

Auto

6 Mode Request

PID Mode 1 Setting V+00


Cascade
Mode Monitoring

Loop Mode and Alarm Status V+06

7 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

PLC Modes’ Effect on Loop Modes


8 If you have selected the option for the loops to follow the PLC mode, the PLC modes
(Program, Run) interact with the loops as a group. The following summarizes this interaction:
9 • When the PLC is in Program Mode, all loops are placed in Manual Mode and no loop calculations
occur. However, note that output modules (including analog outputs) turn off in PLC Program
Mode. So, actual manual control is not possible when the PLC is in Program Mode.
10 • The only time the CPU will allow a loop mode change is during PLC run Mode operation. As such,
the CPU records the modes of all 4 loops as the desired mode of operation. If power failure and
11 restoration occurs during PLC Run Mode, the CPU returns all loops to their prior mode (which
could be Manual, Auto, or Cascade).
• On a Program-to-Run mode transition, the CPU forces each loop to return to its prior mode
12 recorded during the last PLC Run Mode.
• You can add and configure new loops only when the PLC is in Program Mode. New loops
13 automatically begin in Manual Mode.
Loop Mode Override
14 In normal conditions the mode of a loop is determined by the request to V+00, bits 0,
1, and 2. However, some conditions exist which will prevent a requested mode change
A from occurring:
• A loop that is not set independent of PLC mode cannot change modes when the PLC is in Program
mode.
B • A major loop of a cascaded pair of loops cannot go from Manual to Auto until its minor loop is in
Cascade mode.
C In other situations, the PID loop controller will automatically change the mode of the loop to
ensure safe operation:
D • A loop which develops an error condition automatically goes to Manual.
• If the minor loop of a cascaded pair of loops leaves Cascade Mode for any reason, its major loop
automatically goes to Manual Mode.

8–24 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Bumpless Transfers
In process control, the word “transfer” has a particular meaning. A loop transfer occurs when 1
we change its mode of operation, as shown below. When we change loop modes, what we are
really doing is causing a transfer of control of some loop parameter from one source to
another. For example, when a loop changes from Manual Mode to Automatic Mode, control
2
of the output changes from the operator to the loop controller. When a loop changes from
Automatic Mode to Cascade Mode, control of the SP changes from its original source in Auto 3
Mode to the output of another loop (the major loop).
Manual
Mode change
Automatic
Mode change
Cascade
4
Operator PID
5
Transfer
generates calculates
loop output loop output 6
SP
generated
Transfer SP
generated
7
local to loop remotely by
major loop 8
The basic problem of loop transfers is the two different sources of the loop parameter being
transferred will have different numerical values. This causes the PID calculation to generate 9
an undesirable step change, or “bump” on the control output, thereby upsetting the loop to
some degree. The “bumpless transfer” feature arbitrarily forces one parameter equal to
another at the moment of loop mode change, so the transfer is smooth (no bump on the
10
control output).
The bumpless transfer feature of the DL05 loop PID Mode 1 Setting V+00 11
controller is available in two types: Bumpless I, and
Bumpless II. Use DirectSOFT32’s PID Setup dialog
box to select transfer type. Or, you can use bit 3 of
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 12
Bumpless Transfer I / II select
PID Mode 1 V+00 setting as shown.
The characteristics of Bumpless I and II transfer types are listed in the chart below. Note that
13
their operation also depends on which PID algorithm you are using, the position or velocity
form of the PID equation. Note that you must use Bumpless Transfer type I when using the 14
velocity form of the PID algorithm.
A
TransferType Transfer PID Algorithm Manual-to-Auto Auto-to-Cascade
Select Bit Transfer Action Transfer Action B
Bumpless Transfer I 0 Position Forces Bias = Control Output Forces Major Loop Output =

Velocity
Forces SP = PV
Forces SP = PV Forces
Minor Loop PV
Major Loop Output = C
Minor Loop PV
Bumpless Transfer II 1 Position Forces Bias = Control Output none D
Velocity none none

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–25


Chapter 8: PID Loop Operation

1 PID Loop Data Configuration


Loop Parameter Data Formats
2 In choosing the Process Variable range and resolution, a related choice to make is the data
format of the three main loop variables: SP, PV, and Control Output (the Integrator sum in
3 V+04 also uses this data format). The four data formats available are 12 or 15 bit (right
justified), signed or unsigned (MSB is sign bit in bipolar formats). The four binary
4 combinations of bits 0 and 1 of PID Mode 2 word V+01 choose the format. The
DirectSOFT32 PID Setup dialog sets these bits automatically when you select the data
format from the menu.
5 Setpoint V+02 Loop Control Output V+05
 + Calculation
6 PID Mode 2 Setting V+01

Process Variable V+03

7 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

8 00
Data formats LSB
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
12 bit unipolar 0 to 0FFF (0 to 4095)

9 Select data
format using
bits 0 and 1.
01 12 bit bipolar 0 to 0FFF, 8FFF to 8001
(0 to 4095, –4095 to –1)
10 15 bit unipolar 0 to 32767
10 11 15 bit bipolar 0 to 7FFF, FFF to 8001
(0 to 32767, –32767 to –1)
= sign bit
11 The data format is a very powerful setting, because it determines the numerical interface
between the PID loop and the PV sensor, and the Control Output device. The Setpoint must
12 also be in the same data format. Normally, the data format is chosen during the initial loop
configuration and is not changed again.
13 Choosing Unipolar or Bipolar Format
Choosing the data format involves deciding whether to use unipolar or bipolar numbers.
14 Most applications such as temperature control will use only positive numbers, and therefore
need unipolar format. Usually it is the Control Output which determines bipolar/unipolar
A selection. For example, velocity control may include control of forward and reverse directions.
At a zero velocity setpoint the desired control output is also zero. In that case, bipolar format
must be used.
B
C Unipolar Bipolar

8–26 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Handling Data Offsets


In many batch process applications, sensors or actuators interface to DL05 analog modules 1
using 4–20 mA signals. This signal type has a built-in 20% offset, because the zero-point is a
4 mA instead of 0 mA. However, remember the analog modules convert the signals into data
and remove the offset at the same time. For example, a 4–20 mA signal is often converted to
2
0000 – 0FFF hex, or 0 to 4095 decimal. In this case, all you need to do is choose 12-bit
unipolar data format, and make sure the ladder program copies the data appropriately 3
between the loop table and the analog modules.
• PV Offset – In the event you have a PV value with a 20% offset, convert it to zero–offset by 4
subtracting 20% of the top of its range, and multiply by1.25.
• Control Output – In the event the Control Output is going to a device with 20% offset, all you
need to do is have the ladder program write a value equivalent to the offset to the integrator register
5
(V+04), before transitioning from Manual to Auto mode. The loop will then see this offset as a part
of the process, taking care of it for you automatically. 6
Setpoint (SP) Limits
The Setpoint in loop table location V+02 represents the desired value of the process variable. 7
After selecting the data format for these variables, you can set limits on the range of SP values
which the loop calculation will use. Many loops have two or more possible sources writing the
Setpoint at various times, and the limits you set will help safeguard the process from the
8
effects of a bad SP value.
In the figure below, the SP has a selectable limit function, enabled by PID Mode 2 Setting
9
V+01 word, bit 3. If enabled, then locations V+26 and V+27 determine the lower and upper
SP limits, respectively. The loop calculation applies this limit internally, so it is always possible 10
to write any value to V+02.
11
No
Limits
12
0
Control
Setpoint
With 1
+ 
Loop
Calculation
Output 13
Limits –
Process Variable (PV) 14
Loop Table
V+26 XXXX SP Lower Limit PID Mode 2 Setting V+01 A
V+27 XXXX SP Upper Limit
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

SP Limits enable
B
C
The loop calculation checks these SP upper and lower limits before each calculation. This D
means ladder logic can change the limit settings while a process is in progress, allowing you to
keep a tighter guard band on the SP input value.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–27


Chapter 8: PID Loop Operation

Remote Setpoint (SP) Location


1 You may recall there are generally several possible data sources for the SP value. The PID loop
controller has the built-in ability to select between two sources according to the current loop
2 mode. Refer to the figure below. A loop reads its setpoint from table location V+02 in Auto or
Manual modes. If you plan to use Cascade Mode for the loop at any time, then you must
3 program its loop parameter table with a remote setpoint pointer.
The Remote SP pointer resides in location V+32 in the loop table. For loops that will be
cascaded (made a minor loop), you will need to program this location with the address of the
4 major loop’s Control Output address. Find the starting location of the major loop’s parameter
table and add offset +05 to it.
5 Loop Table
V+32 XXXX Remote SP Pointer
6 Another loop
(major loop) Cascaded loop
Cascade (minor loop)

7 Loop
Calculation
Control Output V+05
Setpoint

Loop Control Output
+ Calculation
Normal SP V+02
8 Auto/Manual

Process Variable
A DirectSOFT32 Loop Setup dialog box will allow you to enter the Remote SP pointer if you
9 know the address. Otherwise, you can enter it with a HPP or program it through ladder logic
using the LDA instruction.
10 Process Variable (PV) Configuration
The process variable input to each loop is the value the loop is ultimately trying to control, to
11 make it equal to the setpoint and follow setpoint changes as quickly as possible. Most sensors
for process variables have a primarily linear response curve. Most temperature sensors are
12 mostly linear across their sensing range. However, flow sensing using an orifice plate
technique gives a signal representing (approximately) the square of the flow. Therefore, a
square-root extract function is necessary before using the signal in a linear control system
13 (such as PID).
Some flow transducers are available which will do the square-root extract, but they add cost to
14 the sensor package. The PID loop PV input has a selectable square-root extract function,
pictured below. You can select between normal (linear) PV data, and data needing a square-
A root extract by using PID Mode setting V+00 word, bit 6.
Setpoint Loop Control Output
B +

Calculation
Linear PV
0

C 1 Square-
Process Variable

root PV
D PID Mode 1 Setting V+00

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Linear/Square-root PV select

8–28 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

IMPORTANT: The scaling of the SP must be adjusted if you use PV square-root extract,
because the loop drives the output so the square root of the PV is equal to the PV input. 1
Divide the desired SP value by the square root of the analog span, and use the result in the
V+02 location for the SP. This does reduce the resolution of the SP, but most flow control
loops do not require a lot of precision (the recipient of the flow is integrating the errors). Use
2
one of the following formulas for the SP according to the data format you are using. It’s a
good idea to set the SP upper limit to the top of the allowed range. 3
Data Format SP Scaling SP Range PV range
12-bit SP = PV input / 64 0 – 64 0 – 4095 4
15-bit SP = PV input / 181.02 0 – 181 0 – 32767

Control Output Configuration


5
The Control Output is the numerical result of the PID calculation. All of the other parameter
choices ultimately influence the value of a loop’s Control Output for each calculation. Some 6
final processing selections dedicated to the Control Output are available, shown below. At the
far right of the figure, the final output may be restricted by lower and upper limits that you
program. The values for V+30 and V+31 may be set once using DirectSOFT32’s PID Setup
7
dialog box.
The Control Output lower and upper limits can help guard against commanding an excessive
8
correction to an error when a loop fault occurs (such as PV sensor signal loss). However, do
not use these limits to restrict mechanical motion that might otherwise damage a machine 9
(use hard-wired limit switches instead).

With
10
Normal Output
Limits
Setpoint

Loop
Calculation
0
Control Output 11
+
– Inverted Output 1

Process Variable
12

Maintenance
PID Mode 1 Setting V+00
V+30 XXXX
Loop Table
Control Output Lower Limit
13
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 V+31 XXXX Control Output Upper Limit

Normal / Inverted Output Select 14


The other available selection is the normal/inverted output selection (called “forward/reverse”
in DirectSOFT32). Use bit 4 of the PID Mode 1 Setting V+00 word to configure the output.
A
Independently of unipolar or bipolar format, a normal output goes upward on positive errors
and downward on negative errors (where Error=(SP–PV)). The inverted output reverses the B
direction of the output change.
The normal/inverted output selection is used to configure direct-acting/reverse-acting loops. C
This selection is ultimately determined by the direction of the response of the process variable
to a change in the control output in a particular direction. Refer to the PID Algorithms
section for more on direct-acting and reverse-acting loops.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–29


Chapter 8: PID Loop Operation

Error Term Configuration


1 The Error term is internal to the CPUs PID loop controller, and is generated again in each
PID calculation. Although its data is not directly accessible, you can easily calculate it by
2 subtracting: Error = (SP–PV). If the PV square-root extract is enabled, then Error = (SP –
(sqrt(PV)). In any case, the size of the error and algebraic sign determine the next change of
3 the control output for each PID calculation.
Now we will superimpose some “special effects” on to the error term as described. Refer to the
diagram below. Bit 7 of the PID Mode Setting 1 V+00 word lets you select a linear or squared
4 error term, and bit 8 enables or disables the error deadband.

5 NOTE: When first configuring a loop, it’s best to use the standard error term. After the loop is tuned, then
you will be able to tell if these functions will enhance control.

6
Error Error
7 Setpoint
Error
Term
0 0
Loop
+  Error Error with Calculation
8 – squared
1
Deadband
1

9 Process Variable
PID Mode 1 Setting V+00 Loop Table
10 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
V+23 XXXX Error Deadband

11 Error Deadband select Linear/Squared Error select

12 Error Squared – When selected, the squared error function simply squares the error term (but
preserves the original algebraic sign), which is used in the calculation. This affects the Control
13 Output by diminishing its response to smaller error values, but maintaining its response to
larger errors. Some situations in which the error squared term might be useful:

14 • Noisy PV signal – using a squared error term can reduce the effect of low-frequency electrical noise
on the PV, which will make the control system jittery. A squared error maintains the response to
larger errors.
A • Non-linear process – some processes (such as chemical pH control) require non-linear controllers
for best results. Another application is surge tank control, where the Control Output signal must be
B smooth.
Error Deadband – When selected, the error deadband function takes a range of small error
values near zero, and simply substitutes zero as the value of the error. If the error is larger than
C the deadband range, then the error value is used normally.
Loop parameter location V+23 must be programmed with a desired deadband amount. Units
D are the same as the SP and PV units (0 to FFF in 12-bit mode, and 0 to 7FFF in 15-bit
mode). The PID loop controller automatically applies the deadband symmetrically about the
zero-error point.

8–30 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

PID Algorithms 1
The Proportional–Integral–Derivative (PID) algorithm is widely used in process control. The
PID method of control adapts well to electronic solutions, whether implemented in analog or
digital (CPU) components. The DL05 CPU implements the PID equations digitally by 2
solving the basic equations in software. I/O modules serve only to convert electronic signals
into digital form (or vise-versa). 3
The DL05 features two types of PID controls: “position” and “velocity”. These terms usually
refer to motion control situations, but here we use them in a different sense: 4
• PID Position Algorithm – The control output is calculated so it responds to the displacement
(position) of the PV from the SP (error term).
• PID Velocity Algorithm – The control output is calculated to represent the rate of change (velocity)
5
for the PV to become equal to the SP.
The majority of applications will use the position form of the PID equation. If you are not
6
sure of which algorithm to use, try the Position Algorithm first. Use DirectSOFT32’s PID
View Setup dialog box to select the desired algorithm. Or, use bit 5 of PID Mode 1 Setting 7
V+00 word as shown below to select the algorithm.

Loop Calculation
8
0
Setpoint
+ 
Error
Position Algorithm
Control Output 9
1
– Velocity Algorithm

10
Process Variable PID Mode 1 Setting V+00

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 11
Position / Velocity select

NOTE: The selection of a PID algorithm is very fundamental to control loop operation, and is normally
12
never changed after the initial configuration of a loop.
13
Position Algorithm
The Position Algorithm causes the PID equation to calculate the Control Output Mn: 14
n
Mn = Kc * en + Ki *  ei + Kr * (en – en–1) + Mo A
i=1
In the formula above, the sum of the integral terms and the initial output are combined into
the “Bias” term, Mx. Using the bias term, we define formulas for the Bias and Control B
Output as a function of sampling time:
Mxo =Mo C
Mxn =Ki * en + Mxn–1
Mn = Ki *
n
 ei + Mo
D
i=1
Mn = Kc * en + Kr * (en – en–1) + Mxn.....Output for sampling time “n”

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–31


Chapter 8: PID Loop Operation

1 The position algorithm variables and related variables are:


Ts = Sample rate
2 Kc = Proportional gain
Ki = Kc * (Ts/Ti) coefficient of integral term
3 Kr = Kc * (Td/Ts) coefficient of derivative term
Ti = Reset time (integral time)
4 Td = Rate time (derivative time)
SPn = Set Point for sampling time “n” (SP value)
5 PVn = Process variable for sampling time “n”
(PV) Mn = K c * e n + Ki *
n
 e i + Kr * (e n – e n–1) + Mo
i=1

6 en = SPn – PVn = Error term for sampling time


“n” Control
Output
Proportional
Term
Integral
Term
Derivative
Term
Initial
Output
M0 = Control Output for sampling time “0”
7 Mn = Control Output for sampling time “n”
Bias
Term

Analysis of these equations will be found in most good text books on process control. At a
8 glance, we can isolate the parts of the PID Position Algorithm which correspond to the P, I,
and D terms, and the Bias as shown above.
9 The initial output is the output value assumed from Manual mode control when the loop
transitioned to Auto Mode. The sum of the initial output and the integral term is the bias
10 term, which holds the “position” of the output. Accordingly, the Velocity Algorithm discussed
next does not have a bias component.

11 Velocity Algorithm
The Velocity Algorithm form of the PID equation can be obtained by transforming Position
Algorithm formula with subtraction of the equation of (n–1)th degree from the equation of
12 nth degree.
The velocity algorithm variables and related variables are:
13 Ts = Sample rate
Kc = Proportional gain
14 Ki = Kc * (Ts/Ti) = coefficient of integral term
Kr = Kc * (Td/Ts) = coefficient of derivative term
A Ti = Reset time (integral time)
Td = Rate time (derivative time)
B SPn = Set Point for sampling time “n” (SP value)
PVn = Process variable for sampling time “n” (PV)
C en = SPn – PVn = Error term for sampling time “n”
Mn = Control Output for sampling time “n”
D The resulting equations for the Velocity Algorithm form of the PID equation are:
 Mn =Mn – Mn–1
 Mn = K c * (e n – e n–1 ) + K i * en + K r * (e n – 2*e n–1 +e n–2 )

8–32 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Direct-Acting and Reverse-Acting Loops


The gain of a process determines, in part, how it must be controlled. The process shown in 1
the diagram below has a positive gain, which we call “direct-acting”. This means that when
the control output increases, the process variable also eventually increases. Of course, a true
process is usually a complex transfer function that includes time delays. Here, we are only
2
interested in the direction of change of the process variable in response to a control output
change. 3
Most process loops will be direct-acting, such as a temperature loop. An increase in the heat
applied increases the PV (temperature). Accordingly, direct-acting loops are sometimes called 4
heating loops.
5
Direct-Acting Loop Process
Setpoint

Loop Control Output
+
6
+ Calculation

Process Variable
7
A “reverse-acting” loop is one in which the process has a negative gain, as shown below. An
8
increase in the control output results in a decrease in the PV. This is commonly found in
refrigeration controls, where an increase in the cooling input causes a decrease in the PV 9
(temperature). Accordingly, reverse-acting loops are sometimes called cooling loops.

Reverse-Acting Loop Process


10
Setpoint
+ 
Loop
Calculation
Control Output
– 11

Process Variable
12
It is crucial to know whether a particular loop is direct or reverse-acting! Unless you are
controlling temperature, there is no obvious answer. In a flow control loop, a valve
13
positioning circuit can be configured and wired reverse-acting as easily as direct-acting. One
easy way to find out is to run the loop in Manual Mode, where you must manually generate 14
control output values. Observe whether the PV goes up or down in response to a step increase
in the control output. A
To run a loop in Auto or Cascade Mode, the control output must be correctly programmed
(refer to the previous section on Control Output Configuration). Use “normal output” for
direct-acting loops, and “inverted output” for reverse-acting loops. To compensate for a
B
reverse-acting loop, the PID controller must know to invert the control output. If you have a
choice, configure and wire the loop to be direct-acting. This will make it easier to view and C
interpret loop data during the loop tuning process.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–33


Chapter 8: PID Loop Operation

P-I-D Loop Terms


1 You may recall the introduction of the position and velocity forms of the PID loop equations.
The equations basically show the three components of the PID calculation. The following
2 figure shows a schematic form of the PID calculation, in which the control output is the sum
of the proportional, integral and derivative terms. On each calculation of the loop, each term
3 receives the same error signal value.
Loop Calculation
4 Setpoint Error T erm
P
+ Control Output
+  I + 
5 – D +
Process Variable
6 The role of the P, I, and D terms in the control task are as follows:
• Ramp– the proportional term simply responds proportionally to the current size of the error. This
7 loop controller calculates a proportional term value for each PID calculation. When the error is
zero, the proportional term is also zero.
8 • Integral – the integrator (or reset) term integrates (sums) the error values. Starting from the first
PID calculation after entering Auto Mode, the integrator keeps a running total of the error values.
For the position form of the PID equation, when the loop reaches equilibrium and there is no error,
9 the running total represents the constant output required to hold the current position of the PV.
• Derivative – the derivative (or rate) term responds to change in the current error value from the
10 error used in the previous PID calculation. Its job is to anticipate the probable growth of the error
and generate a contribution to the output in advance.

11 The P, I, and D terms work together as a team. To do that effectively, they will need some
additional instructions from us. The figure below shows the P, I, and D terms contain
programmable gain values kp, ki, and kd respectively. The values reside in the loop table in
12 the locations shown. The goal of the loop tuning process (covered later) is to derive gain
values that result in good overall loop performance.
13 NOTE: The proportional gain is also simply called “gain”, in PID loop terminology.

14 Loop Calculation

kp P
A
Setpoint Error T erm + Control Output
B +  ki I + 
– +

C Process Variable kd D

D V+10 XX.XX Proportional gain


Loop Table V+11 XX.XX Integral gain
V+12 XX.XX Derivative gain

8–34 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

The P, I and D gains are 4-digit BCD numbers with values from
0000 to 9999. They contain an implied decimal point in the kp P
1
middle, so the values are actually 00.00 to 99.99. Some gain +
ki 
values have units – Integral gain may be in units of seconds or
minutes, by programming the bit shown. Derivative gain is in
I +
+ 2
seconds. kd D

V+10 XX.XX P gain –


3
V+11 XX.XX I gain 0=sec, 1=min.
V+12 XX.XX D gain sec. PID Mode 2 Setting V+01 4
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Units select 5
In DirectSOFT32’s trend view, you can program the gain values and units in realtime while
the loop is running. This is typically done only during the loop tuning process. 6
Proportional Gain – This is the most basic gain of the three. Values range from 0000 to
9999, but they are used internally as xx.xx. An entry of “0000” effectively removes the
proportional term from the PID equation. This accommodates applications which need
7
integral-only loops.
Integral Gain – Values range from 0001 to 9998, but they are used internally as xx.xx. An
8
entry of “0000” or “9999”causes the integral gain to be “”, effectively removing the integrator
term from the PID equation. This accommodates applications which need proportional-only 9
loops. The units of integral gain may be either seconds or minutes, as shown above.
Derivative Gain – Values range from 0001 to 9999, but they are used internally as xx.xx. An 10
entry of “0000” allows removal of the derivative term from the PID equation (a common
practice). This accommodates applications which need proportional and/or integral-only
loops. The derivative term has an optional gain limiting feature, discussed in the next section.
11
NOTE: It is very important to know how to increase and decrease the gains. The proportional and derivative
gains are as one might expect... smaller numbers produce less gains and larger numbers produce
12
more gain. However, the integral term has a reciprocal gain(1/Ts), so smaller numbers produce
more gain and larger numbers produce less gain. This is very important to know during loop tuning. 13
Using a Subset of PID Control 14
Each of the P, I, and D gains allows a setting to eliminate that term from the PID equation.
Many applications actually work best by using a subset of PID control. The figure below
shows the various combinations of PID control offered on the DL05. We do not recommend
A
using any other combination of control, because most of them are inherently unstable.
B
P P
C
+ + + +
I +  I +  P  I  D
D +

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–35


Chapter 8: PID Loop Operation

Derivative Gain Limiting


1 The derivative term is unique in that it has an optional gain-limiting feature. This is provided
because the derivative term reacts badly to PV signal noise or other causes of sudden PV
2 fluctuations. The function of the gain-limiting is shown in the diagram below. Use bit 9 of
PID Mode 1 Setting V+00 word to enable the gain limit.
3 Loop Calculation
Proportional
P
Control
4 Setpoint
+ 
Error T erm
I
Integral +
+ 
Output

– +
Derivative
5 Process Variable
D 0

Derivative,
6 gain-limited
1

7 Loop Table P ID Mode 1 Setting V+00


V+25 00XX Derivative Gain Limit

8 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Derivative gain limit select


The derivative gain limit in location V+25 must have a value between 0 and 20, in BCD
9 format. This setting is operational only when the enable bit = 1.
The gain limit can be particularly useful during loop tuning. Most loops can tolerate only a
10 little derivative gain without going into wild oscillations.
Bias Term
11 In the widely-used position form of the PID equation, an important component of the
control output value is the bias term shown below. Its location in the loop table is in V+04.
12 the loop controller writes a new bias term after each loop calculation.
n

13 Mn = K c * e n + Ki *  e i + Kr * (e n – e n–1) + Mo
i=1

14 Control
Output
Proportional
Term
Integral
Term
Derivative
Term
Initial
Output

A V+04 XXXX Bias term


Bias Term

If we cause the error (en) to go to zero for two or more sample periods, the proportional and
B derivative terms cancel. The bias term is the sum of the integral term and the initial output
(Mo). It represents the steady, constant part of the control output value, and is similar to the
C DC component of a complex signal waveform.
The bias term value establishes a “working region” for the control output. When the error
D fluctuates around its zero point, the output fluctuates around the bias value. This concept is very
important, because it shows us why the integrator term must respond more slowly to errors
than either the proportional or derivative terms.

8–36 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Bias Freeze
The term “reset windup” refers to an undesirable characteristic of integrator behavior which 1
occurs naturally under certain conditions. Refer to the figure below. Suppose the PV signal
becomes disconnected, and the PV value goes to zero. While this is a serious loop fault, it is
made worse by reset windup. Notice the bias (reset) term keeps integrating normally during
2
the PV disconnect, until its upper limit is reached. When the PV signal returns, the bias value
is saturated (windup) and takes a long time to return to normal. The loop output 3
consequently has an extended recovery time. Until recovery, the output level is wrong and
causes further problems. 4
PV
0
PV loss PV loss 5
Reset windup Freeze bias enabled 6
Bias
7
Output
8
Recovery time Recovery time
9
In the second PV signal loss episode in the figure, the freeze bias feature is enabled. It causes
the bias value to freeze when the control output goes out of bounds. Much of the reset
10
windup is thus avoided, and the output recovery time is much less.
For most applications, the freeze bias feature will PID Mode 1 Setting V+00 11
work with the loop as described above. You may
enable the feature using the DirectSOFT32 PID
View setup dialog, or set bit 10 of PID Mode 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 12
Bias freeze
Setting word as shown to the right.
select 13
NOTE: The bias freeze feature stops the bias term from changing when the control output reaches the end
of the data range. If you have set limits on the control output other than the range (i.e, 0–4095 for a
14
unipolar/12bit loop), the bias term still uses the end of range for the stopping point and bias freeze
will not work. A
In the feedforward method discussed later in this chapter, ladder logic writes directly to the
bias term value. However, there is no conflict with the freeze bias feature, because bias term
B
writes due to feedforward are relatively infrequent when in use.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–37


Chapter 8: PID Loop Operation

1 Loop Tuning Procedure


This is perhaps the most important step in closed-loop process control. The goal of a loop
2 tuning procedure is to adjust the loop gains so the loop has optimal performance in dynamic
conditions. The quality of a loop’s performance may generally be judged by how well the PV
follows the SP after a SP step change.
3 Auto Tuning versus Manual Tuning – you may change the PID gain values directly (manual
tuning), or you can have the PID processing engine in the CPU automatically calculate the
4 gains (auto tuning). Most experienced process engineers will have a favorite method, and the
DL05 will accommodate either preference. The use of the auto tuning can eliminate much of
5 the trial-and-error of the manual tuning approach, especially if you do not have a lot of loop
tuning experience. However, note that performing the auto tuning procedure will get the
gains close to optimal values, but additional manual tuning changes can take the gain values
6 to their optimal values.
WARNING: Only authorized personnel fully familiar with all aspects of the process should make
7 changes that affect the loop tuning constants. Using the loop auto tune procedures will
affect the process, including inducing large changes in the control output value. Make sure
you thoroughly consider the impact of any changes to minimize the risk of injury to
8 personnel or damage to equipment. The auto tune in the DL05 is not intended to perform as
a replacement for your process knowledge.
9 Open-Loop Test
10 Whether you use manual or auto tuning, it is very important to verify basic characteristics of
a newly-installed process before attempting to tune it. With the loop in Manual Mode, verify
the following items for each new loop.
11 • Setpoint – verify the source which is to generate the setpoint can do so. You can put the PLC in
Run Mode, but leave the loop in Manual Mode. Then monitor the loop table location V+02 to see
12 the SP value(s). The ramp/soak generator (if you are using it) should be tested now.
• Process Variable – verify the PV value is an accurate measurement, and the PV data arriving in the
loop table location V+03 is correct. If the PV signal is very noisy, consider filtering the input either
13 through hardware (RC low-pass filter), or using a digital S/W filter.
• Control Output – if it is safe to do so, manually change the output a small amount (perhaps 10%)
14 and observe its affect on the process variable. Verify the process is direct-acting or reverse acting, and
check the setting for the control output (inverted or non-inverted). Make sure the control output
upper and lower limits are not equal to each other.
A • Sample Rate – while operating open-loop, this is a good time to find the ideal sample rate
(procedure give earlier in this chapter). However, if you are going to use auto tuning, note the auto
B tuning procedure will automatically calculate the sample rate in addition to the PID gains.
The discussion beginning on the following page covers the manual tuning procedure. If want
C to perform only auto tuning, please skip the next section and proceed directly to the section
on auto tuning.
D

8–38 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Manual Tuning Procedure


Now comes the exciting moment when we actually close the loop (go to Auto Mode) for the 1
first time. Use the following checklist before switching to Auto mode:
• Monitor the loop parameters with a loop trending instrument. We recommend using the PID view 2
feature of DirectSOFT.

NOTE: We recommend using the PID trend view setup menu to select the vertical scale feature to manual, 3
for both SP/PV area and Bias/Control Output areas. The auto scaling feature will otherwise change
the vertical scale on the process parameters and add confusion to the loop tuning process.
4
• Adjust the gains so the Proportional Gain = 10, Integrator Gain = 9999, and Derivative Gain
=0000. This disables the integrator and derivative terms, and provides a little proportional gain.
• Check the bias term value in the loop parameter table (V+04). If it is not zero, then write it to zero
5
using DirectSOFT32 or HPP, etc.
Now we can transition the loop to Auto Mode. Check the mode monitoring bits to verify its
6
true mode. If the loop will not stay in Auto Mode, check the troubleshooting tips at the end
of this chapter. 7
CAUTION: If the PV and Control Output values begin to oscillate, reduce the gain values immediately. If
the loop does not stabilize immediately, then transfer the loop back to Manual Mode and 8
manually write a safe value to the control output. During the loop tuning procedure, always
be near the Emergency Stop switch which controls power to the loop actuator in case a
shutdown is necessary. 9
• At this point, the SP should = PV because of the bumpless transfer feature. Increase the SP a little,
in order to develop an error value. With only the proportional gain active and the bias term=0, we
10
can easily check the control output value:
Control Output = (SP – PV) x proportional gain 11
• If the control output value changed, the loop should be getting more energy from the actuator,
heater, or other device. Soon the PV should move in the direction of the SP. If the PV does not
change, then increase the proportional gain until it moves slightly.
12
• Now, add a small amount of integral gain. Remember that large numbers are small integrator gains
and small numbers are large integrator gains! After this step, the PV should = SP, or be very close. 13
Until this point we have only used proportional and integrator gains. Now we can “bump the
process” (change the SP by 10%), and adjust the gains so the PV has an optimal response. 14
Refer to the figure below. Adjust the gains according to what you see on the PID trend view.
The critically- damped response shown gives the fastest PV response without oscillating. A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–39


Chapter 8: PID Loop Operation

• Over-damped response – the gains are too small, so gradually increase them, concentrating on the
1 proportional gain first.
• Under-damped response – the gains are too large. Reduce the integral gain first, and then the
2 proportional gain if necessary.
• Critically-damped response – this is the the optimal gain setting. You can verify that this is the best
3 response by increasing the proportional gain slightly. the loop then should make one or two small
oscillations.

4
5 10% of over-damped response
SP range
6 critically-damped response
SP
7 PV under-damped response

8 Now you may want to add a little derivative gain to further improve the critically-damped
response above. Note the proportional and integral gains will be very close to their final values
9 at this point. Adding some derivative action will allow you to increase the proportional gain
slightly without causing loop oscillations. The derivative action tends to tame the
proportional response slightly, so adjust these gains together.
10
Auto Tuning Procedure
11 Autotuning is initiated within DirectSOFT32. You can use autotuning to establish initial PID
parameter values (autotuning is not run continuously during operation). Whenever a
substantial change in loop dynamics occurs (mass of process, size of actuator, etc.), you will
12 need to repeat the tuning procedure to derive the new gains that are required for optimal
control.
13 WARNING: Only authorized personnel fully familiar with all aspects of the process should make
changes that affect the loop tuning constants. Using the loop auto tuning procedures will
14 affect the process, including inducing large changes in the control output value. Make sure
you thoroughly consider the impact of any changes to minimize the risk of injury to
personnel or damage to equipment. The auto tune in the DL05 is not intended to perform as
A a replacement for your process knowledge.

The loop controller offers both closed-loop and open-loop methods. If you intend to use the
B auto tune feature, we recommend you use the open-loop method first. This will permit you
to use the closed-loop method of auto tuning when the loop is operational (Auto Mode) and
C cannot be shut down (Manual Mode). The following sections describe how to use the auto
tuning feature, and what occurs in open and closed-loop auto tuning.

8–40 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

The controls for the auto tuning function use three bits in the PID Mode 2 word V+01, as
shown below. DirectSOFT32 will manipulate these bits automatically when you use the auto 1
tune feature within DirectSOFT32. Or, you may have ladder logic access these bits directly
for allowing control from another source such as a dedicated operator interface. The
individual control bits let you to start the auto tune procedure, select PID or PI tuning, and
2
select closed-loop or open-loop tuning. If you select PI tuning, the auto tune procedure leaves
the derivative gain at 0. The Loop Mode and Alarm Status word V+06 reports the auto tune 3
status as shown. Bit 12 will be on (1) when during the auto tuning cycle, automatically
returning to off (0) when done.
Auto Tune Function
4
Start Auto Tune
(0 to 1 transition)
Auto Tune
Active
5
Auto Tuning
0=PID tuning,
1=open PI tuning
Auto Tune
Error Auto Tuning 6
Controls 0=closed loop, Status

PID Mode 2 Setting V+01


1=open loop
Loop Mode and Alarm Status V+06 7
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
8
Open-Loop Auto Tuning – During an open-loop auto tuning cycle, the loop controller
operates as shown in the diagram below. Before starting this procedure, place the loop in
Manual mode and ensure the PV and control output values are in the middle of their ranges
9
(away from the end points).
10
PLC System
Process Variable
11
Response Step Function
Open Loop
Auto Tuning
12
Setpoint Value Error Term Loop
Control
Output Manufacturing
13
+  Calculation Process
– 14
Process Variable

A
NOTE: In theory, the SP value does not matter in this case, because the loop is not closed. However, the
firmware requires that the SP value be more than 205 counts away from the PV value before B
starting the auto tune cycle (205 counts or more below the SP for forward-acting loops, or 205
counts or more above the SP for reverse-acting loops).
C
When auto tuning, the loop controller induces a step change on the output and simply
observes the response of the PV. From the PV response, the auto tune function calculates the
gains and the sample time. It automatically places the results in the corresponding registers in
D
the loop table.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–41


Chapter 8: PID Loop Operation

The following timing diagram shows the events which occur in the open-loop auto tuning
1 cycle. The auto tune function takes control of the control output and induces a 10%-of-span
step change. If the PV change which the loop controller observes is less than 2%, then the
2 step change on the output is increased to 20%-of-span.
PV
Tangent Rr = Slope
3 Process Wave
(%)
SP

Base Line
4 LrRr
(%)
Lr
5 (sec.)
Time (sec)
Step Change m=10%
6 Output Value
(%)
7 Auto Tune Cycle
PID Cycle PID Cycle
8 Auto Tune Start Auto Tune End
* When Auto Tune starts, step change output m=10%
9 * During Auto Tune, the controller output reached the full scale positive limit. Auto Tune stopped
and the Auto Tune Error bit in the Alarm word bit turned on.
10 * When PV change is under 2%, output is changed at 20%. Open Loop Auto Tune Cycle Wave: Step
Response Method
11 When the loop tuning observations are complete, the loop controller computes Rr
(maximum slope in %/sec.) and Lr (dead time in sec). The auto tune function computes the
12 gains according to the Ziegler-Nichols equations, shown below:

13 PID Tuning
P=1.2*m/LrRr
PI Tuning
P=0.9*m/LrRr
I=2.0* Lr I=3.33* Lr
14 D=0.5* Lr D=0
Sample Rate = 0.056* Lr Sample Rate = 0.12*Lr
A m = Output step change (10% = 0.1, 20% = 0.2)

We highly recommend using DirectSOFT32 for the auto tuning interface. The duration of
B each auto tuning cycle will depend on the mass of our process. A slowly-changing PV will
result in a longer auto tune cycle time. When the auto tuning is complete, the proportional,
C integral, and derivative gain values are automatically updated in loop table locations V+10,
V+11, and V+12 respectively. The sample time in V+07 is also updated automatically. You
can test the validity of the values the auto tuning procedure yields by measuring the closed-
D loop response of the PV to a step change in the output. The instructions on how to do this
are in the section on the manual tuning procedure (located prior to this section on auto
tuning).

8–42 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Closed-Loop Auto Tuning – During a closed-loop auto tuning cycle, the loop controller
operates as shown in the diagram below. 1
PLC System
Process V ariable
2
Response
Closed Loop
Limit cycle wave 3
Auto T uning

Control
4
Setpoint Value Error T erm Loop Output Manufacturing
+ 

Calculation Process 5
Process Variable
6
When auto tuning, the loop controller imposes a square wave on the output. Each transition
7
of the output occurs when the PV value crosses over (or under) the SP value. Therefore, the
frequency of the limit cycle is roughly proportional to the mass of the process. From the PV 8
response, the auto tune function calculates the gains and the sample time. It automatically
places the results in the corresponding registers in the loop table. 9
The following timing diagram shows the events which occur in the closed-loop auto tuning
cycle. The auto tune function examines the direction of the offset of the PV from the SP. The
auto tune function then takes control of the control output and induces a full-span step
10
change in the opposite direction. Each time the sign of the error (SP – PV) changes, the
output changes full-span in the opposite direction. This proceeds through three full cycles. 11
Closed Loop Auto Tune Cycle Wave: Limit Cycle Method
Xo 12
Process Wave
SP
PV 13
Output Value 14
M

A
To B
PID Cycle PID Cycle

Auto Tune Start


Auto Tune Cycle

Auto Tune End


Calculation of
C
PID parameter

*Mmax = Output Value upper limit setting. Mmin = Output Value lower limit setting. D
* This example is direct–acting. When set at reverse–acting, output is inverted.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–43


Chapter 8: PID Loop Operation

When the loop tuning observations are complete, the loop controller computes To (bump
1 period) and Xo (amplitude of the PV). Then it uses these values to compute Kpc (sensitive
limit) and Tpc (period limit). From these values, the loop controller auto tune function
2 computes the PID gains and the sample rate according to the Ziegler-Nichols equations
shown below:
3 Kpc = 4M / ( *X0) Tpc = 0
M = Amplitude of output

4 P = 0.45*Kpc
PID Tuning
P = 0.30*Kpc
PI Tuning

I = 0.60*Tpc I = 1.00*Tpc
5 D = 0.10*Tpc D=0
Sample Rate = 0.014*Tpc Sample Rate = 0.03*Tpc
6 Auto tuning error – if the auto tune error bit (bit 13 of Loop Mode and Alarm status word
V+06) is on, please verify the PV and SP values are within 5% of full scale difference, as
7 required by the auto tune function. The bit will also turn on if the closed-loop method is in
use, and the output goes to the limits of the range.
8 NOTE: If your PV fluctuates rapidly, you probably need to use the built-in analog filter (see page 8–45) or
create a filter in ladder logic (see example on page 8–46).

9 Tuning Cascaded Loops


In tuning cascaded loops, we will need to de-couple the cascade relationship and tune the
10 loops individually, using one of the loop tuning procedures previously covered.
1. If you are not using auto tuning, then find the loop sample rate for the minor loop, using the
11 method discussed earlier in this chapter. Then set the sample rate of the major loop slower than the
minor loop by a factor of 10. Use this as a starting point.

12 2. Tune the minor loop first. Leave the major loop in Manual Mode, and you will need to generate
SP changes for the minor loop manually as described in the loop tuning procedure.
3. Verify the minor loop gives a critically-damped response to a 10% SP change while in Auto Mode.
13 Then we are finished tuning the minor loop.
4. In this step, you will need to get the minor loop in Cascade Mode, and then the Major loop in
14 Auto Mode. We will be tuning the major loop with the minor loop treated as a series component its
overall process. Therefore, do not go back and tune the minor loop again while tuning the major
loop.
A 5. Tune the major loop, following the standard loop tuning procedure in this section. The response of
the major loop PV is actually the overall response of the cascaded loops together.
B
C
D

8–44 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

PV Analog Filter 1
A noisy PV signal can make tuning difficult and can cause the control output to be more
extreme than necessary, as the output tries to respond to the peaks and valleys of the PV.
There are two equivalent methods of filtering the PV input to make the loop more stable. 2
The first method is accomplished using the DL05’s built-in filter. The second method
achieves a similar result using ladder logic. 3
The DL05 Built-in Analog Filter
The DL05 provides a selectable first-order low-pass PV input filter which can be particularly 4
helpful during auto tuning, using the closed-loop method. Shown in the figure below, we
strongly recommend the use of a filter during auto tuning. You may disable the filter after
auto tuning is complete, or continue to use it if the PV input signal is noisy.
5
+ 
Loop
Calculation
Control Output 6
– Unfiltered
0
PV 7
Process V ariable
1 Filtered
PV
8
P ID Mode 2 Setting V+01 9
Loop Table
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

PV filter V+24 XXXX FIlter constant 10


enable/disable
Bit 2 of PID Mode Setting 2 provides the enable/disable control for the low-pass PV filter 11
(0=disable, 1=enable). The roll-off frequency of the single-pole low-pass filter is controlled by
using register V+24 in the loop parameter table, the filter constant. The data format of the
filter constant value is BCD, with an implied decimal point 00X.X, as follows:
12
• The filter constant has a valid range of 000.1 to 001.0.
• DirectSOFT32 converts values above the valid range to 001.0 and values below this range to 000.1
13
• Values close to 001.0 result in higher roll-off frequencies, while values closer to 000.1 result in lower
roll-off frequencies.
14
We highly recommend using DirectSOFT32 for the auto tuning interface. The duration of
each auto tuning cycle will depend on the mass of your process. A slowly-changing PV will A
result in a longer auto tune cycle time.
When the auto tuning is complete, the proportional, integral, and derivative gain values are B
automatically updated in loop table locations V+10, V+11, and V+12 respectively. The
sample time in V+07 is also updated automatically. You can test the validity of the values the
auto tuning procedure yields by measuring the closed-loop response of the PV to a step
C
change in the output. The instructions on how to do this are in the section on the manual
tuning procedure. D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–45


Chapter 8: PID Loop Operation

The algorithm which the built-in filter follows is:


1 yi = k (xi – yi–1) + yi–1
yi is the current output of the filter
2 xi is the current input to the filter
yi–1 is the previous output of the filter
3 k is the PV Analog Input Filter Factor
Creating an Analog Filter in Ladder Logic
4 A similar algorithm can be built in your ladder program. Your analog inputs can be filtered
effectively using either method. The following programming example describes the ladder
5 logic you will need. Be sure to change the example memory locations to those that fit your
application.
Filtering can induce a 1 part in 1000 error in your output because of “rounding.” If your
6 process cannot tolerate a 1 part in 1000 error, do not use filtering. Because of the rounding
error, you should not use zero or full scale as alarm points. Additionally, the smaller the filter
7 constant the greater the smoothing effect, but the slower the response time. Be sure a slower
response is acceptable in controlling your process.
8 SP1 Load the filter constant into the accumulator. To mimick
LD the built-in filter, use values between 1 and 10. This is

9 K2

OUT
equivalent to the 0.1 to 1.0 range of the built-in filter.
Output the constant to a convenient memory location that
is not in use.
V1400

10 V2200 V2003
LD
V2200
If the raw analog input (V2200 in our example) is greater
than or equal to the current PV value in the PID Loop Table
(V2003), load the raw analog input into the accumulator.

11 SUB
V2003
Subtract the Loop Table PV value from the raw
analog input.

MUL
V1400
12 DIV
The MUL and DIV instructions have the
combined effect of multiplying by a decimal
number between 0.1 and 1.0.
K10

13 ADD
V2003
Add the adjusted difference (between the raw analog
input and the PV) back to the PV.

OUT Replace the previous Loop Table PV value with the


14 V2200 V2003
V2003 new filtered analog value in the Loop Table.

If the raw analog input is less than the current PV


LD value in the PID Loop Table (V2003), load the current
V2003
A SUB
PV value into the accumulator.
Subtract the raw analog input the from Loop Table PV
V2200 value.

B MUL
V1400 The MUL and DIV instructions have the
combined effect of multiplying by a decimal
DIV number between 0.1 and 1.0.
C K10
Add the adjusted difference (between the raw analog input
ADD
V2200 and the PV) back to the analog input value.

D OUT
V2003
Replace the previous Loop Table PV value with the
new filtered analog value in the Loop Table.

END END coil marks the end of the main program.

8–46 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Feedforward Control 1
Feedforward control is an enhancement to standard closed-loop control. It is most useful for
diminishing the effects of a quantifiable and predictable loop disturbance or sudden change in
setpoint. Use of this feature is an option available to you on the DL05. However, it’s best to 2
implement and tune a loop without feedforward, and adding it only if better loop
performance is still needed. The term “feed-forward” refers to the control technique involved, 3
shown in the diagram below. The incoming setpoint value is fed forward around the PID
equation, and summed with the output.
4
Feedforward path
kf
5
+
Setpoint
+ 
Loop
Calculation + 
Control Output
6

Process Variable 7
In the previous section on the bias term, we said that “the bias term value establishes a
“working region” or operating point for the control output. When the error fluctuates around 8
its zero point, the output fluctuates around the bias value.” Now, when there is a change in
setpoint, an error is generated and the output must change to a new operating point. This
also happens if a disturbance introduces a new offset in the loop. The loop does not really
9
“know its way” to the new operating point... the integrator (bias) must increment/decrement
until the error disappears, and then the bias has found the new operating point. 10
Suppose that we are able to know a sudden setpoint change is about to occur (common in
some applications). We can avoid much of the resulting error in the first place, if we can 11
quickly change the output to the new operating point. If we know (from previous testing)
what the operating point (bias value) will be after the setpoint change, we can artificially
change the output directly (which is feedforward). The benefits from using feedforward are:
12
• The SP–PV error is reduced during predictable setpoint changes or loop
offset disturbances.
13
• Proper use of feedforward will allow us to reduce the integrator gain. Reducing integrator gain gives
us an even more stable control system. 14
Feedforward is very easy to use in the DL05 loop controller, as shown below. The bias term
has been made available to the user in a special read/write location, at PID Parameter Table A
location V+04.
Parameter Table location V+04. B
Loop Calculation
kp P

V+04
C
Setpoint Error T erm + Control Output
 
+

ki I XXXX Bias T erm
+
+ D
Process Variable kd D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–47


Chapter 8: PID Loop Operation

To change the bias (operating point), ladder logic only has to write the desired value to V+04.
1 The PID loop calculation first reads the bias value from V+04 and modifies the value based
on the current integrator calculation. Then it writes the result back to location V+04. This
2 arrangement creates a sort of “transparent” bias term. All you have to do to implement feed
forward control is write the correct value to the bias term at the right time (the example below
shows you how).
3 NOTE: When writing the bias term, one must be careful to design ladder logic to write the value only once,

4 at the moment when the new bias operating point is to occur. If ladder logic writes the bias value on
every scan, the loop’s integrator is effectively disabled.

5 Feedforward Example
How do we know when to write to the bias term, and what value to write? Suppose we have
6 an oven temperature control loop, and we have already tuned the loop for optimal
performance. Refer to the figure below. We notice that when the operator opens the oven
door, the temperature sags a bit while the loop bias adjusts to the heat loss. Then when the
7 door closes, the temperature rises above the SP until the loop adjusts again. Feedforward
control can help diminish this effect.
8 Oven Closed
Open Closed
door

9 PV PV sags
PV excess

10
Bias
11
First, we record the amount of bias change the loop controller generates when the door opens
12 or closes. Then, we write a ladder program to monitor the position of an oven door limit
switch. When the door opens, our ladder program reads the current bias value from V+04,
13 adds the desired change amount, and writes it back to V+04. When the door closes, we
duplicate the procedure, but subtracting desired change amount instead. The following figure
shows the results.
14
Oven Closed
Open Closed
A door

PV
B Feed-forward Feed-forward

C Bias

D The step changes in the bias are the result of our two feed-forward writes to the bias term. We
can see the PV variations are greatly reduced. The same technique may be applied for changes
in setpoint.

8–48 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Time-Proportioning Control 1
The PID loop controller in the DL05 CPU generates a smooth control output signal across a
numerical range. The control output value is suitable to drive an analog output module,
which connects to the process. In the process control field, this is called continuous control, 2
because the output is on (at some level) continuously.
While continuous control can be smooth and robust, the cost of the loop components (such 3
as actuators, heater amplifiers) can be expensive. A simpler form of control is called time-
proportioning control. This method uses actuators which are either on or off (no in-between).
Loop components for on/off-based control systems are lower cost than their continuous
4
control counterparts.
In this section, we will show you how to convert the control output of a loop to time-
5
proportioning control for the applications that need it. Let’s take a moment to review how
alternately turning a load on and off can control a process. The diagram below shows a hot-air 6
balloon following a path across some mountains. The desired path is the setpoint. The balloon
pilot turns the burner on and off alternately, which is his control output. The large mass of air
in the balloon effectively averages the effect of the burner, converting the bursts of heat into a
7
continuous effect: slowly changing balloon temperature and ultimately the altitude, which is
8
9
10
11
12
13
the process variable.
Time-proportioning control approximates continuous control by virtue of its duty-cycle – the 14
ratio of ON time to OFF time. The following figure shows an example of how duty cycle
approximates a continuous level when it is averaged by a large process mass.
period
A
Desired
Effect
B
On
On/Off
Control Off C
If we were to plot the on/off times of the burner in the hot-air balloon, we would probably
see a very similar relationship to its effect on balloon temperature and altitude. D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–49


Chapter 8: PID Loop Operation

On/Off Control Program Example


1 The following ladder segment provides a time proportioned on/off control output. It converts
the continuous output in V2005 to on/off control using the output coil, Y0.
2
SP Loop V2005 Time Y0 P
 Process
3 +

Calculation Proportioning V
continuous on/off
PV
4
The example program uses two timers to generate On/Off control. It makes the following
5 assumptions, which you can alter to fit your application:
• The loop table starts at V2000, so the control output is at V2005.
6 • The data format of the control output is 12-bit, unipolar (0 – FFF).
• The time base (one full cycle) for the On/Off waveform is 10 seconds. We use a fast timer (0.01
7 sec/tick), counting to 1000 ticks (10 seconds).
• The On/Off control output is Y0.

8 The time proportioning program must match the resolution of the output (1 part in 1000) to
the resolution of the time base of T0 (also 1 part in 1000).
9 NOTE: Some processes change too fast for time proportioning control. Consider the speed of your process
when you choose this control method. Use continuous control for processes that change too fast
for time proportioning control.
10 Use a fast timer (0.01 sec. resolution) for the main time
T0 base. The K1000 provides a preset of 10 seconds. The
TMRF T0
11 K1000 N.C. T0 contact makes this self-resetting. T0 is on for
one scan each 10 seconds.

T0 At the end of the 10 second period, T0 turns on, and


LD
12 V2005 loads the control output value (binary) from the loop table
V+05 location, V2005.

Convert the number in the accumulator to BCD


BCD
13 format, to satisfy the MUL, DIV, and TMRF format
requirement.

Multiply the Control Output (BCD) by 1,000. This step


MUL
14 Direct SOFT32
K1000
combined with the following DIV function converts the
range to 0 – 1000.

Divide the product of the previous step by 4095. This


DIV completes the conversion of the output range from

A K4095 0 – 4095 to 0 – 1000, which matches the number of


ticks in our 10 second timer range.
OUT Output our result to V1400. This is our arbitrary location
V1400
B T0
TMRF T1
for the second timer’s preset value.

The second fast timer also counts in increments of


.01 seconds, so its range is also 0 – 1000. This timer’s
V1400 output, T1, turns the output coil, Y0, off when the preset

C is reached.

Using the N.C. T1 contact, invert the T1 timer output, so


T1 TA1 K0 Y0 the On/Off control output is on at the beginning of the

D OUT 10-second timebase. Y0 turns off when T1 turns on. The


STRNE contact prevents Y0 from energizing during the
scan when T1 is resetting. Y0 goes to the actuator, heater,
etc. for the loop.

END END coil marks the end of the main program.

8–50 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Cascade Control 1
Introduction
Cascaded loops are an advanced control technique that is superior to individual loop control 2
in certain situations. As the name implies, cascade means that one loop is connected to
another loop. In addition to Manual (open loop) and Auto (closed loop) Modes, the DL05 3
also provides Cascaded Mode.
NOTE: Cascaded loops are an advanced process control technique. Therefore we recommend their use only 4
for experienced process control engineers.

When a manufacturing process is complex and contains a lag time from control input to 5
process variable output, even the most perfectly tuned single loop around the process may
yield slow and inaccurate control. It may be the actuator operates on one physical property, 6
which eventually affects the process variable, measured by a different physical property.
Identifying the intermediate variable allows us to divide the process into two parts as shown
in the following figure.
7
Control input
PROCESS
Intermediate
Variable
Process
Variable (PV)
8
Process A Process B

9
The principle of cascaded loops is simply that we add another process loop to more precisely control
the intermediate variable! This separates the source of the control lag into two parts, as well.
The diagram below shows a cascade control system, showing that it is simply one loop nested
10
inside another. The inside loop is called the minor loop, and the outside loop is called the
major loop. For overall stability, the minor loop must be the fastest responding loop of the 11
two. We do have to add the additional sensor to measure the intermediate variable (PV for
process A). Notice the setpoint for the minor loop is automatically generated for us, by using
the output of the major loop. Once the cascaded control is programmed and debugged, we
12
only need to deal with the original setpoint and process variable at the system level. The
cascaded loops behave as one loop, but with improved performance over the previous single- 13
loop solution.
External
Disturbances
External
Disturbances
14
Setpoint
+ 
Loop B
Calculation
Output B/
Setpoint A
+ 
Loop A
Calculation
Output A Process A
(secondary)
Process B
(primary)
A
– –

Minor
Loop
B
Major
Loop PV, Process A
PV, Process B C
One of the benefits to cascade control can be seen by examining its response to external
disturbances. Remember the minor loop is faster acting than the major loop. Therefore, if a
disturbance affects process A in the minor loop, the Loop A PID calculation can correct the
D
resulting error before the major loop sees the effect.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–51


Chapter 8: PID Loop Operation

Cascaded Loops in the DL05 CPU


1 In the use of the term “cascaded loops”, we must make an important distinction. Only the
minor loop will actually be in the Cascade Mode. In normal operation, the major loop must
2 be in Auto Mode. If you have more than two loops cascaded together, the outer-most (major)
loop must be in Auto Mode during normal operation, and all inner loops in Cascade Mode.
3 NOTE: Technically, both major and minor loops are “cascaded” in strict process control terminology.
Unfortunately, we are unable to retain this convention when controlling loop modes. Remember that
4 all minor loops will be in Cascade Mode, and only the outer-most (major) loop will be in Auto Mode.

You can cascade together as many loops as necessary on the DL05, and you may have
5 multiple groups of cascaded loops. For proper operation on cascaded loops you must use the
same data range (12/15 bit) and unipolar/bipolar settings on the major and minor loop.
6 To prepare a loop for Cascade Mode operation as a minor loop, you must program its remote
Setpoint Pointer in its loop parameter table location V+32, as shown below. The pointer must
be the address of the V+05 location (control output) of the major loop. In Cascade Mode, the
7 minor loop will ignore the its local SP register (V+02), and read the major loop’s control
output as its SP instead.
8 Major Loop (Auto mode) Minor Loop (Cascade Mode)
Loop Table Loop Table

9 V+02

V+03
XXXX

XXXX
SP

PV
V+02

V+03
XXXX

XXXX
SP

PV

10 V+05 XXXX Control Output V+05 XXXX Control Output

11 V+32 XXXX Remote SP Pointer

When using DirectSOFT32’s PID View to watch the SP value of the minor loop,
12 DirectSOFT32 automatically reads the major loop’s control output and displays it for the
minor loop’s SP. The minor loop’s normal SP location, V+02, remains unchanged.
13 Now, we use the loop parameter arrangement above and draw its equivalent loop schematic,
shown below.
14
Major loop Minor Cascaded loop
A Loop Control Output V+05 Cascade
Control
Calculation
Remote Setpoint Loop Output
B SP +  Calculation
Local SP

V+02 Auto/Manual Process Variable
C
D Remember that a major loop goes to Manual Mode automatically if its minor loop is taken
out of Cascade Mode.

8–52 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Process Alarms
The performance of a process control loop may be generally measured by how closely the 1
process variable matches the setpoint. Most process control loops in industry operate
continuously, and will eventually lose control of the PV due to an error condition. Process
alarms are vital in early discovery of a loop error condition, and can alert plant personnel to
2
manually control a loop or take other measures until the error condition has been repaired.
The DL05 CPU has a sophisticated set of alarm features for each loop:
3
• PV Absolute Value Alarms – monitors the PV with respect to two lower limit values and two upper
limit values. It generates alarms whenever the PV goes outside these programmed limits. 4
• PV Deviation Alarm – monitors the PV value as compared to the SP. It alarms when the difference
between the PV and SP exceed the programmed alarm value. 5
• PV Rate-of-change Alarm – computes the rate-of-change of the PV, and alarms if it exceeds the
programmed alarm amount 6
• Alarm Hysteresis – works in conjunction with the absolute value and deviation alarms to eliminate
alarm “chatter” near alarm thresholds.
The alarm thresholds are fully programmable, and each type of alarm may be independently
7
enabled and monitored. The following diagram shows the PV monitoring function. Bits 12,
13, and 14 of PID Mode 1 Setting V+00 word in the loop parameter table to enable/disable 8
the alarms. DirectSOFT32’s PID View setup dialog screens allow easy programming,
enabling, and monitoring of the alarms. Ladder logic may monitor the alarm status by
examining bits 3 through 9 of PID Mode and alarm Status word V+06 in the loop table.
9
Setpoint Error Term Loop Control Output
10
 Calculation
+
– 11
Process Variable

Alarm Generation
12
1

1
0 PV Value 13
PV Deviation
1
0
14
0 PV Rate-of-change

A
Enable Alarms PID Mode 1 Setting PID Alarm Word Monitor Alarms

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
B
Alarm Enable Bits Alarm Bits
C
Unlike the PID calculations, the alarms are always functioning any time the CPU is in Run
Mode. The loop may be in Manual, Auto, or Cascade, and the alarms will be functioning if D
the enable bit(s) as listed above are set =1.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–53


Chapter 8: PID Loop Operation

PV Absolute Value Alarms


1 The PV absolute value alarms are organized as two upper and two lower alarms. The alarm
status is false as long as the PV value remains in the region between the upper and lower
2 alarms, as shown below. The alarms nearest the safe zone are named High Alarm and Low
Alarm. If the loop loses control, the PV will cross one of these thresholds first. Therefore, you
3 can program the appropriate alarm threshold values in the loop table locations shown below
to the right. The data format is the same as the PV and SP (12-bit or 15-bit). The threshold
values for these alarms should be set to give an operator an early warning if the process loses
4 control.
High–high Alarm
5 High Alarm V+16 XXXX
Loop Table
High-high Alarm
V+15 XXXX High Alarm
6 PV
Low Alarm
V+14 XXXX Low Alarm
V+13 XXXX Low-low Alarm
Low–low Alarm
7
8 If the process remains out of control for some time, the PV will eventually cross one of the
outer alarm thresholds, named High-high alarm and Low-low alarm. Their threshold values
are programmed using the loop table registers listed above. A High-high or Low-low alarm
9 indicates a serious condition exists, and needs the immediate attention of the operator.
The PV Absolute Value Alarms are reported in the four bits in PID Mode and Alarm Status V+06
10 the PID Mode and Alarm Status word in the loop table, as
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
shown to the right. We highly recommend using ladder logic to
monitor these bits. The bit-of-word instructions make this easy High-high Alarm
11 to do. Additionally, you can monitor PID alarms using
High Alarm
Low Alarm
DirectSOFT32. Low-low Alarm
12 PV Deviation Alarms
The PV Deviation Alarms monitor the PV deviation with respect to the SP value. The
13 deviation alarm has two programmable thresholds, and each threshold is applied equally
above and below the current SP value. In the figure below, the smaller deviation alarm is
14 called the “Yellow Deviation”, indicating a cautionary condition for the loop. The larger
deviation alarm is called the “Red Deviation”, indicating a strong error condition for the loop.
The threshold values use the loop parameter table locations V+17 and V+20 as shown.
A Red Deviation Alarm Red

B SP
Yellow Deviation Alarm Yellow

Green V+17 XXXX


Loop Table
Yellow Deviation Alarm
V+20 XXXX Red Deviation Alarm
C Yellow Deviation Alarm
Red Deviation Alarm
Yellow

Red

D The thresholds define zones, which fluctuate with the SP value. The green zone which
surrounds the SP value represents a safe (no alarm) condition. The yellow zones lie outside
the green zone, and the red zones are beyond those.

8–54 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

The PV Deviation Alarms are reported in the two bits in the PID Mode and Alarm Status V+06
PID Mode and Alarm Status word in the loop table, as shown 1
to the right. We highly recommend using ladder logic to Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

monitor these bits. The bit-of-word instructions make this Red Deviation
easy to do. Additionally, you can monitor PID alarms using Yellow Deviation
2
DirectSOFT32.
The PV Deviation Alarm can be independently enabled and disabled from the other PV 3
alarms, using bit 13 of the PID Mode 1 Setting V+00 word.
Remember the alarm hysteresis feature works in conjunction with both the deviation and 4
absolute value alarms, and is discussed at the end of this section.
PV Rate-of-Change Alarm 5
One powerful way to get an early warning of a process fault is to monitor the rate-of-change of
the PV. Most batch processes have large masses and slowly-changing PV values. A relatively 6
fast-changing PV will result from a broken signal wire for either the PV or control output, a
SP value error, or other causes. If the operator responds to a PV Rate-of-Change Alarm
quickly and effectively, the PV absolute value will not reach the point where the material in
7
process would be ruined.
The DL05 loop controller provides a programmable PV Rate-of-Change Alarm, as shown 8
below. The rate-of-change is specified in PV units change per loop sample time. This value is
programmed into the loop table location V+21. 9
PV slope OK PV slope excessive
Loop Table 10
V+21 XXXX PV Rate-of-Change Alarm

PV 11
PID Mode and Alarm Status V+06
rate-of-change alarm
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
12
Sample time Sample time
PV Rate of
Change Alarm 13
As an example, suppose the PV is temperature for our process, and we want an alarm when
the temperature changes faster than 15 degrees / minute. We must know PV counts per 14
degree and the loop sample rate. Then, suppose the PV value (in V+03 location) represents 10
counts per degree, and the loop sample rate is 2 seconds. We will use the formula below to
convert our engineering units to counts / sample period:
A
Alarm Rate-of-Change =
15 degrees
X
10 counts / degree
=
150
= 5 counts / sample period
B
1 minute 30 loop samples / min. 30
From the calculation result, we would program the value 5 in the loop table for the rate-of- C
change. The PV Rate-of-Change Alarm can be independently enabled and disabled from the
other PV alarms, using bit 14 of the PID Mode 1 Setting V+00 word.
The alarm hysteresis feature (discussed next) does not affect the Rate-of-Change Alarm.
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–55


Chapter 8: PID Loop Operation

PV Alarm Hysteresis
1 The PV Absolute Value Alarm and PV Deviation Alarm are programmed using threshold
values. When the absolute value or deviation exceeds the threshold, the alarm status becomes
2 true. Real-world PV signals have some noise on them, which can cause some fluctuation in
the PV value in the CPU. As the PV value crosses an alarm threshold, its fluctuations cause
3 the alarm to be intermittent and annoy process operators. The solution is to use the PV
Alarm Hysteresis feature.
The PV Alarm Hysteresis amount is programmable from 1 to 200 (hex). When using the PV
4 Deviation Alarm, the programmed hysteresis amount must be less than the programmed
deviation amount. The figure below shows how the hysteresis is applied when the PV value
5 goes past a threshold and descends back through it.

6 Alarm threshold
Hysteresis

7 PV
V+22 XXXX
Loop Table
PV Alarm Hysteresis

8 Alarm 1
0

9 The hysteresis amount is applied after the threshold is crossed, and toward the safe zone. In
this way, the alarm activates immediately above the programmed threshold value. It delays
10 turning off until the PV value has returned through the threshold by the hysteresis amount.
Alarm Programming Error
11 The PV Alarm threshold values must have
certain mathematical relationships to be valid.
12 The requirements are listed below. If not met,
the Alarm Programming Error bit will be set, as
PID Mode and Alarm Status V+06

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
indicated to the right.
13 • PV Absolute Alarm value requirements:
Alarm Programming Error

Low-low < Low < High < High-high


14 • PV Deviation Alarm requirements:
Yellow < Red
A Loop Calculation Overflow/Underflow Error
This error occurs whenever the output reaches PID Mode and Alarm Status V+06
B it’s upper or lower limit and the PV does not
reach the setpoint. A typical example might be Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

when a valve is stuck, the output is at it’s limit,


C but the PV has not reached setpoint. Loop Calculation Overflow/Underflow Error

8–56 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Ramp/Soak Generator 1
Introduction
Our discussion of basic loop operation noted the setpoint for a loop will be generated in 2
various ways, depending on the loop operating mode and programming preferences. In the
figure below, the ramp/soak generator is one of the ways the SP may be generated. It is the 3
responsibility of your ladder program to ensure only one source attempts to write the SP value
at V+02 at any particular time.
Setpoint Sources:
4
Operator Input
Ramp/soak generator
Setpoint V+02
+ 
Loop
Calculation
Control Output 5
Ladder Program –
Another loop’s output (cascade) 6
Process Variable

If the SP for your process rarely changes or can tolerate step changes, you probably will not
7
need to use the ramp/soak generator. However, some processes require precisely-controlled SP
value changes. The ramp/soak generator can greatly reduce the amount of programming required 8
for these applications. SP
The terms “ramp” and “soak” have special meanings in the
process control industry, and refer to desired setpoint (SP)
Soak 9
Ramp
values in temperature control applications. In the figure to
the right, the setpoint increases during the ramp segment. It slope 10
remains steady at one value during the soak segment. Time
Complex SP profiles can be generated by specifying a series of ramp/soak segments. The ramp 11
segments are specified in SP units per second time. The soak time is also programmable in
minutes. 12
It is instructive to view the ramp/soak generator as a dedicated function to generate SP values,
as shown below. It has two categories of inputs which determine the SP values generated. The
ramp/soak table must be programmed in advance, containing the values that will define the
13
ramp/soak profile. The loop reads from the table during each PID calculation as necessary.
The ramp/soak controls are bits in a special loop table word that control the real-time 14
start/stop functionality of the ramp/soak generator. The ladder program can monitor the
status of the ramp soak profile (current ramp/segment number). A
Ramp/soak table
Ramp/soak Setpoint Loop Control Output
B

Ramp/soak controls Generator +

Calculation
C
Process Variable D

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–57


Chapter 8: PID Loop Operation

Now that we have described the general ramp/soak generator operation, we list its specific
1 features:
• Each loop has its own ramp/soak generator (use is optional).
2 • You may specify up to eight ramp/soak steps (16 segments).
• The ramp soak generator can run anytime the PLC is in Run mode. Its operation is independent of
3 the loop mode (Manual or Auto).
• Ramp/soak real-time controls include Start, Hold, Resume, and Jog.
4 • Ramp/soak monitoring includes Profile Complete, Soak Deviation (SP minus PV), and current
ramp/soak step number.

5 The following figure shows a SP profile consisting of ramp/soak segment pairs. The segments
are individually numbered as steps from 1 to 16. The slope of each of the ramp may be either
increasing or decreasing. The ramp/soak generator automatically knows whether to increase
6 or decrease the SP based on the relative values of a ramp’s end points. These values come from
the ramp/soak table.
7 16
15
8 6
13 14
Soak
Ramp
Soak

5 Ramp

9 Step 2
3 4
Soak
Ramp
Soak

1 Ramp

10 SP
Ramp
Soak

11 Ramp/Soak Table
12 The parameters which define the ramp/soak profile for
a loop are in a ramp/soak table. Each loop may have V–Memory Space
its own ramp/soak table, but it is optional. Recall the
13 Loop Parameter table consists a 32-word block of User Data
memory for each loop, and together they occupy one V2000
14 contiguous memory area. However, the ramp/soak
table for a loop is individually located, because it is
V2037
V2040
LOOP #1
32 words
V2034 =
3000 octal
LOOP #2
optional for each loop. An address pointer in location V2074 =
A V+34 in the loop table specifies the starting location
V2077 32 words
3600 octal

of the ramp/soak table.


B In the example to the right, the loop parameter tables
V3000 Ramp/Soak #1
32 words
for Loop #1 and #2 occupy contiguous 32-word
C blocks as shown. Each has a pointer to its ramp/soak
table, independently located elsewhere in user V-
memory. Of course, you may locate all the tables in
D one group, as long as they do not overlap. V3600 Ramp/Soak #2
32 words

8–58 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

The parameters in the ramp/soak table must be user-defined. the most convenient way is to
use DirectSOFT32, which features a special editor for this table. Four parameters are required 1
to define a ramp and soak segment pair, as pictured below.
• Ramp End Value – specifies the destination SP value for the end of the ramp. Use the same data
format for this number as you use for the SP. It may be above or below the beginning SP value, so
2
the slope could be up or down (we don’t have to know the starting SP value for ramp #1).
• Ramp Slope – specifies the SP increase in counts (units) per second. It is a BCD number from 3
00.00 to 99.99 (uses implied decimal point).
• Soak Duration – specifies the time for the soak segment in minutes, ranging from 000.1 to 999.9 4
minutes in BCD (implied decimal point).
• Soak PV Deviation – (optional) specifies an allowable PV deviation above and below the SP value
during the soak period. A PV deviation alarm status bit is generated by the ramp/soak generator.
5
Ramp End
6
SP Value Soak PV Ramp/Soak Table
deviation V+00 XXXX Ramp End SP Value 7
V+01 XXXX Ramp Slope
Slope
SP Soak
duration
V+02
V+03
XXXX
XXXX
Soak Duration
Soak PV Deviation
8
segment becomes active
9
The ramp segment becomes active when the previous soak segment ends. If the ramp is the
first segment, it becomes active when the ramp/soak generator is started, and automatically
assumes the present SP as the starting SP.
10
Offset Step Description Offset Step Description 11
+ 00 1 Ramp End SP Value + 20 9 Ramp End SP Value
+ 01
+ 02
1
2
Ramp Slope
Soak Duration
+ 21
+ 22
9
10
Ramp Slope
Soak Duration
12
+ 03 2 Soak PV Deviation + 23 10 Soak PV Deviation
+ 04 3 Ramp End SP Value + 24 11 Ramp End SP Value 13
+ 05 3 Ramp Slope + 25 11 Ramp Slope
+ 06
+ 07
4
4
Soak Duration
Soak PV Deviation
+ 26
+ 27
12
12
Soak Duration
Soak PV Deviation
14
+ 10 5 Ramp End SP Value + 30 13 Ramp End SP Value
+ 11 5 Ramp Slope + 31 13 Ramp Slope A
+ 12 6 Soak Duration + 32 14 Soak Duration
+ 13
+ 14
6
7
Soak PV Deviation
Ramp End SP Value
+ 33
+ 34
14
15
Soak PV Deviation
Ramp End SP Value
B
+ 15 7 Ramp Slope + 35 15 Ramp Slope
+ 16 8 Soak Duration + 36 16 Soak Duration C
+ 17 8 Soak PV Deviation + 37 16 Soak PV Deviation

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–59


Chapter 8: PID Loop Operation

Many applications do not require all 16 R/S steps. Use all zeros in the table for unused steps.
1 The R/S generator ends the profile when it finds ramp slope=0.
Ramp/Soak Table Flags
2 The individual bit definitions of the Ramp/Soak Table Flag (Addr+33) word is listed in the
following table.
3 Bit Ramp/Soak Flag Bit Description Read/Write Bit=0 Bit=1
0 Start Ramp / Soak Profile write – 01 Start
4 1
2
Hold Ramp / Soak Profile
Resume Ramp / soak Profile
write
write


01 Hold
01 Resume
3 Jog Ramp / Soak Profile write – 01 Jog
5 4 Ramp / Soak Profile Complete read – Complete
5 PV Input Ramp / Soak Deviation read Off On
6 6
7
Ramp / Soak Profile in Hold
Reserved
read
read
Off
Off
On
On
8–15 Current Step in R/S Profile read decode as byte (hex)
7
Ramp/Soak Generator Enable
8 The main enable control to permit ramp/soak
generation of the SP value is accomplished with bit 11 in
PID Mode 1 Setting V+00

the PID Mode 1 Setting V+00 word, as shown to the


9 right. The other ramp/soak controls in V+33 shown in
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Ramp/Soak
the table above will not operate unless this bit=1 during Generator Enable

10 the entire ramp/soak process.


Ramp/Soak Controls Ramp/Soak Settings V+33
11 The four main controls for the ramp/soak generator are
in bits 0 to 3 of the ramp/soak settings word in the loop Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

12 parameter table. DirectSOFT32 controls these bits


directly from the ramp/soak settings dialog. However,
Jog
Resume
you must use ladder logic to control these bits during
13 program execution. We recommend using the bit-of- Hold
Start
word instructions.
14 Ladder logic must set a control bit to a “1” to command the corresponding function. When
the loop controller reads the ramp/soak value, it automatically turns off the bit for you.
A Therefore, a reset of the bit is not required, when the
CPU is in Run Mode.
Start R/S Generator
B The example program rung to the right shows how
an external switch X0 can turn on, and the PD X0 B2033.0
contact uses the leading edge to set the proper SET
C control bit to start the ramp soak profile. This uses
the Set Bit-of-word instruction.
D

8–60 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

The normal state for the ramp/soak control bits is all zeros. Ladder logic must set only one
control bit at a time. 1
• Start – a 0-to-1 transition will start the ramp soak profile. The CPU must be in Run Mode, and the
loop can be in Manual or Auto Mode. If the profile is not interrupted by a Hold or Jog command,
it finishes normally.
2
• Hold – a 0-to-1 transition will stop the ramp/soak profile in its current state, and the SP value will
be frozen. 3
• Resume – a 0-to-1 transition cause the ramp/soak generator to resume operation if it is in the hold
state. The SP values will resume from their previous value. 4
• Jog – a 0-to-1 transition will cause the ramp/soak generator to truncate the current segment (step),
and go to the next segment. 5
Ramp/Soak Profile Monitoring
You can monitor the Ramp/Soak profile status using
other bits in the Ramp/Soak Settings V+33 word,
6
Ramp/Soak Settings V+33
shown to the right.
• R/S Profile Complete – =1 when the last programmed Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
7
step is done.
• Soak PV Deviation – =1 when the error (SP–PV) exceeds
R/S Profile in Hold
Soak PV Deviation 8
the specified deviation in the R/S table. R/S Profile Complete
• R/S Profile in Hold – =1 when the profile was active but 9
is now in hold. Ramp/Soak Settings V+33
The number of the current step is available in the
upper 8 bits of the Ramp/Soak Settings V+33 word.
Ramp/Soak Settings V+33
10
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The bits represent a 2-digit hex number, ranging from
1 to 10. Ladder logic can monitor these to synchronize 11
other parts of the program with the ramp/soak profile. Current Profile Step, 2–digit hex
Load this word to the accumulator and shift right 8
bits, and you have the step number.
Value = 01 to 10 hex, 12
or 1 to 16 decimal
Ramp/Soak Programming Errors Ramp/Soak Table Error V+35
13
The starting address for the ramp/soak table must be a
valid location. If the address points outside the range of
user V-memory, one of the bits to the right will turn on
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Starting Address set in


14
when the ramp/soak generator is started. We reserved system V-memory
recommend using DirectSOFT32 to configure the Starting Address set out of
V-memory upper range
A
ramp/soak table. It automatically range checks the
addresses for you. Starting Address set out
of V-memory lower range B
Testing Your Ramp/Soak Profile
It’s a good idea to test your ramp/soak profile before using it to control the process. This is C
easy to do, because the ramp/soak generator will run even when the loop is in Manual Mode.
Using DirectSOFT32’s PID View will be a real time-saver, because it will draw the profile on-
screen for you. Be sure to set the trending timebase slow enough to display completed ramp-
D
soak segment pairs in the waveform window.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–61


Chapter 8: PID Loop Operation

1 Troubleshooting Tips
Q. The loop will not go into Automatic Mode.
2 A. Check the following for possible causes:
• A PV alarm exists, or a PV alarm programming error exists.
3 • The loop is the major loop of a cascaded pair, and the minor loop is not in Cascade Mode.

4 Q. The Control Output stays at zero constantly when the loop is in Automatic
Mode.
5 A. Check the following for possible causes:
• The Control Output upper limit in loop table location V+31 is zero.
6 • The loop is driven into saturation, because the error never goes to zero value and changes (algebraic)
sign.

7 Q. The Control Output value is not zero, but it is incorrect.


A. Check the following for possible causes:
8 • The gain values are entered improperly. Remember, gains are entered in the loop table in BCD,
while the SP and PV are in binary. If you are using DirectSOFT32, it displays the SP, PV, Bias and
Control output in decimal (BCD), converting it to binary before updating the loop table.
9 Q. The Ramp/Soak Generator does not operate when I activate the Start bit.
A. Check the following for possible causes:
10 • The Ramp/Soak enable bit is off. Check the status of bit 11 of loop parameter table location V+00.
It must be set =1.
11 • The hold bit or other bits in the Ramp/Soak control are on.
• The beginning SP value and the first ramp ending SP value are the same, so first ramp segment has
12 no slope and consequently has no duration. The ramp/soak generator moves quickly to the soak
segment, giving the illusion the first ramp is not working.

13 • The loop is in Cascade Mode, and is trying to get the SP remotely.


• The SP upper limit value in the loop table location V+27 is too low.

14 • Check your ladder program to verify it is not writing to the SP location (V+02 in the loop table). A
quick way to do this is to temporarily place an end coil at the beginning of your program, then go
to PLC Run Mode, and manually start the ramp/soak generator.
A Q. The PV value in the table is constant, even though the analog module receives
the PV signal.
B A. Your ladder program must read the analog value from the module successfully and write it
into the loop table V+03 location. Verify the analog module is generating the value, and
C the ladder is working.
Q. The Derivative gain doesn’t seem to have any affect on the output.
D A. The derivative limit is probably enabled (see section on derivative gain limiting).

8–62 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

Q. The loop Setpoint appears to be changing by itself.


A. Check the following for possible causes: 1
• The Ramp/Soak generator is enabled, and is generating setpoints.
• If this symptom occurs on loop Manual-to-Auto Mode changes, the loop automatically sets the 2
SP=PV (bumpless transfer feature).
• Check your ladder program to verify it is not writing to the SP location (V+02 in the loop table). A
quick way to do this is to temporarily place an end coil at the beginning of your program, then go
3
to PLC Run Mode.
Q. The SP and PV values I enter with DirectSOFT32 work okay, but these
4
values do not work properly when the ladder program writes the data.
A. The PID View in DirectSOFT32 lets you enter SP, PV, and Bias values in decimal, and
5
displays them in decimal for your convenience. For example, when the data format is 12 bit
unipolar, the values range from 0 to 4095. However, the loop table actually requires these in 6
hex, so DirectSOFT32 converts them for you. The values in the table range from 0 to FFF,
for 12-bit unipolar format. 7
Q. The loop seems unstable and impossible to tune, no matter what gains I use.
A. Check the following for possible causes: 8
• The loop sample time is set too long. Refer to the section near the front of this chapter on selecting
the loop update time. 9
• The gains are too high. Start out by reducing the derivative gain to zero. Then reduce the integral
gain, and the proportional gain if necessary.
• There is too much transfer lag in your process. This means the PV reacts sluggishly to control
10
output changes. There may be too much “distance” between actuator and PV sensor, or the actuator
may be weak in its ability to transfer energy into the process. 11
• There may be a process disturbance that is over-powering the loop. Make sure the PV is relatively
steady when the SP is not changing. 12
Bibliography 13
Fundamentals of Process Control Theory, Second Edition Application Concepts of Process Control
14
Author: Paul W. Murrill Author: Paul W. Murrill
Publisher: Instrument Society of America Publisher: Instrument Society of America
ISBN 1–55617–297–4
PID Controllers: Theory, Design, and Tuning, 2nd Edition Author:
ISBN 1–55617–080–7
Fundamentals of Temperature, Pressure, and Flow Measurements,
A
K. Astrom and T Hagglund Third edition
Publisher: Instrument Society of America
ISBN 1–55617–516–7
Author: Robert P. Benedict
Publisher: John Wiley and Sons
B
ISBN 0–471–89383–8
Process / Industrial Instruments & Controls Handbook, Fourth
Edition
pH Measurement and Control, Second Edition
Author: Gregory K. McMillan C
Author (Editor-in-Chief): Douglas M. Considine Publisher: Instrument Society of America
Publisher: McGraw-Hill, Inc ISBN 0-07-012445-0
Process Control, Third Edition Instrument Engineer’s Handbook
ISBN 1–55617–483–7
Process Measurement and Analysis, Third Edition Instrument D
Author (Editor-in-Chief): Bela G. Liptak Engineer’s Handbook
Publisher: Chilton. . . . . . . ISBN 0–8019–8242–1 Author (Editor-in-Chief): Bela G. Liptak
Publisher: Chilton. . . . . . . ISBN 0–8019–8197–2

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–63


Chapter 8: PID Loop Operation

1 Glossary of PID Loop Terminology


Automatic Mode An operational mode of a loop, in which it makes PID calculations and updates the
2 loop’s control output.
Bias Freeze A method of preserving the bias value (operating point) for a control output, by inhibiting
3 the integrator when the output goes out-of-range. The benefit is a faster loop recovery.
Bias Term In the position form of the PID equation, it is the sum of the integrator and the initial
control output value.
4 Bumpless Transfer A method of changing the operation mode of a loop while avoiding the usual
sudden change in control output level. This consequence is avoided by artificially making the SP and
5 PV equal, or the bias term and control output equal at the moment of mode change.
Cascaded Loops A cascaded loop receives its setpoint from the output of another loop. Cascaded loops
6 have a major/minor relationship, and work together to ultimately control one PV.
Cascade Mode An operational mode of a loop, in which it receives its SP from another loop’s output.
7 Continuous Control Control of a process done by delivering a smooth (analog) signal as the control
output.
8 Direct-Acting Loop A loop in which the PV increases in response to a control output increase. In other
words, the process has a positive gain.
9 Error The difference in value between the SP and PV, Error=SP – PV
Error Deadband An optional feature which makes the loop insensitive to errors when they are small.
10 You can specify the size of the deadband.
Error Squared An optional feature which multiplies the error by itself, but retains the original algebraic
11 sign. It reduces the effect of small errors, while magnifying the effect of large errors.
Feedforward A method of optimizing the control response of a loop when a change in setpoint or
12 disturbance offset is known and has a quantifiable effect on the bias term.
Control Output The numerical result of a PID equation which is sent by the loop with the intention of
13 nulling out the current error.
Derivative Gain A constant that determines the magnitude of the PID derivative term in response to

14 the current error.


Integral Gain A constant that determines the magnitude of the PID integral term in response to the
current error.
A Major Loop In cascade control, it is the loop that generates a setpoint for the cascaded loop.

B Manual Mode An operational mode of a loop, it which the PID calculations are stopped. The operator
must manually control the loop by writing to the control output value directly.
Minor Loop In cascade control, the minor loop is the subordinate loop that receives its SP from the
C major loop.
On/Off Control A simple method of controlling a process, through on/off application of energy into
D the system. The mass of the process averages the on/off effect for a relatively smooth PV. A simple ladder
program can convert the DL05’s continuous loop output to on/off control.

8–64 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 8: PID Loop Operation

PID Loop A mathematical method of closed-loop control involving the sum of three terms based on
proportional, integral, and derivative error values. The three terms have independent gain constants, 1
allowing one to optimize (tune) the loop for a particular physical system.
Position Algorithm The control output is calculated so it responds to the displacement (position) of the
PV from the SP (error term)
2
Process A manufacturing procedure which adds value to raw materials. Process control particularly
refers to inducing chemical changes to the material in process.
3
Process Variable (PV) A quantitative measurement of a physical property of the material in process,
which affects final product quality and is important to monitor and control.
4
Proportional Gain A constant that determines the magnitude of the PID proportional term in response
to the current error. 5
PV Absolute Alarm A programmable alarm that compares the PV value to alarm threshold values.
PV Deviation Alarm A programmable alarm that compares the difference between the SP and PV
6
values to a deviation threshold value.
Ramp/Soak Profile A set of SP values called a profile, which is generated in real time upon each loop
7
calculation. The profile consists of a series of ramp and soak segment pairs, greatly simplifying the task
of programming the PLC to generate such SP sequences. 8
Rate Also called differentiator, the rate term responds to the changes in the error term.
Remote Setpoint The location where a loop reads its setpoint when it is configured as the minor loop in 9
a cascaded loop topology.
Reset Also called integrator, the reset term adds each sampled error to the previous, maintaining a 10
running total called the bias.
Reset Windup A condition created when the loop is unable to find equilibrium, and the persistent error 11
causes the integrator (reset) sum to grow excessively (windup). Reset windup causes an extra recovery
delay when the original loop fault is remedied.
Reverse-Acting Loop A loop in which the PV increases in response to a control output decrease. In
12
other words, the process has a negative gain.
Sampling time The time between PID calculations. The CPU method of process control is called a
13
sampling controller, because it samples the SP and PV only periodically.
Setpoint (SP) The desired value for the process variable. The setpoint (SP) is the input command to the
14
loop controller during closed loop operation.
Soak Deviation The soak deviation is a measure of the difference between the SP and PV during a soak
A
segment of the Ramp/Soak profile, when the Ramp/Soak generator is active.
Step Response The behavior of the process variable in response to a step change in the SP (in closed B
loop operation), or a step change in the control output (in open loop operation)
Transfer To change from one loop operational mode to another (between Manual, Auto, or Cascade). C
The word “transfer” probably refers to the transfer of control of the control output or the SP,
depending on the particular mode change. D
Velocity Algorithm The control output is calculated to represent the rate of change (velocity) for the PV
to become equal to the SP.

DL05 Micro PLC User Manual, 5th Edition, 6/04 8–65


MAINTENANCE AND CHAPTER
TROUBLESHOOTING
9
In This Chapter:
Hardware System Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–2
CPU Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–6
Communications Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–7
I/O Point Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–8
Noise Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9–10
Machine Startup and Program Troubleshooting . . . . . . . . . . . . . . .9–11
Chapter 9: Maintenance and Troubleshooting

1 Hardware System Maintenance


Standard Maintenance
2 No regular or preventative maintenance is required for this product (there are no internal batteries);
however, a routine maintenance check (about every one or two months) of your PLC and control
3 system is good practice, and should include the following items:
• Air Temperature – Check the air temperature in the control cabinet, so the operating temperature
4 range of any component is not exceeded.
• Air Filter – If the control cabinet has an air filter, clean or replace it periodically as required.
5 • Fuses or breakers – Verify that all fuses and breakers are intact.
• Cleaning the Unit – Check that all air vents are clear. If the exterior case needs cleaning, disconnect
6 the input power, and carefully wipe the case using a damp cloth. Do not let water enter the case
through the air vents and do not use strong detergents because this may discolor the case.

7 Diagnostics
8 Diagnostics
Your DL05 Micro PLC performs many pre-defined diagnostic routines with every CPU scan. The
9 diagnostics can detect various errors or failures in the PLC. The two primary error classes are fatal and
non-fatal.

10 FatalFatal
Errors
errors are errors which may cause the system to function improperly, perhaps introducing a safety
problem. The CPU will automatically switch to Program Mode if it is in Run Mode. (Remember, in
11 Program Mode all outputs are turned off.) If the fatal error is detected while the CPU is in Program
Mode, the CPU will not allow you to transition to Run Mode until the error has been corrected.
12 Some examples of fatal errors are:
• Power supply failure
13 • Parity error or CPU malfunction
• Particular programming errors
14 Non-fatal Errors
Non-fatal errors are errors that need your attention, but should not cause improper operation. They do
A not cause or prevent any mode transitions of the CPU. The application program can use special relay
contacts to detect non-fatal errors, and even take the system to an orderly shutdown or switch the CPU
B to Program Mode if desired. An example of a non-fatal error is:
• Particular programming errors The programming devices will notify you of an error if one occurs
while online.
C • DirectSOFT32 provides the error number and an error message.

D • The handheld programmer displays error numbers and short descriptions of the error.
Appendix B has a complete list of error messages in order by error number. Many error messages point
to supplemental V-memory locations which contain related information. Special relays (SP contacts)
also provide error indications.

9–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

V-memory Error Code Locations


The following table names the specific memory locations that correspond to certain types of 1
error messages.

Error Class Error Category


Diagnostic 2
V-memory
User-Defined
System Error
Error code used with FAULT instruction
Fatal Error code
V7751
V7755
3
Major Error code V7756
Minor Error code V7757 4
Grammatical Address where syntax error occurs V7763

CPU Scan
Error Code found during syntax check
Number of scans since last Program to Run Mode transition
V7764
V7765
5
Current scan time (ms) V7775
Minimum scan time (ms) V7776 6
Maximum scan time (ms) V7777
7
Special Relays (SP) Corresponding to Error Codes
The special relay table also includes status indicators which can indicate errors. For a more
detailed description of each of these special relays refer to Appendix D.
8
CPU Status Relays Accumulator Status Relays
9
SP11 Forced Run mode SP60 Acc. is less than value
SP12 Terminal Run mode SP61 Acc. is equal to value 10
SP13 Test Run mode SP62 Acc. is greater than value
SP15
SP16
Test stop mode
Terminal Program mode
SP63
SP64
Acc. result is zero
Half borrow occurred
11
SP17 Forced stop SP65 Borrow occurred
SP20 STOP instruction was executed SP66 Half carry occurred 12
SP22 Interrupt enabled SP67 Carry occurred

SP36
System Monitoring Relays
Override setup
SP70
SP71
Result is negative (sign)
Pointer reference error
13
SP37 Scan control error SP73 Overflow
SP40 Critical error SP75 Data is not in BCD 14
SP41 Non-critical error SP76 Load zero
SP42
SP44
Diagnostics error
Program memory error
A
SP45 I/O error
SP46 Communications error B
SP50 Fault instruction was executed
SP51
SP52
Watchdog timeout
Syntax error
C
SP53 Cannot solve the logic
SP54 Communication error D
SP56 Table instruction overrun

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–3


Chapter 9: Maintenance and Troubleshooting

DL05 Micro PLC Error Codes


1 These errors can be generated by the CPU or by the Handheld Programmer, depending on
the actual error. Appendix B provides a more complete description of the error codes.
2 The errors can be detected at various times. However, most of them are detected at power-up,
on entry to Run Mode, or when a Handheld Programmer key sequence results in an error or
3 an illegal request.
Error Code Description Error Code Description
4 E003 Software time-out E525 Mode Switch not in Term position
E004 Invalid instruction(RAM parity error in the CPU) E526 Unit is offline
5 E104
E151
Write failed
Invalid command
E527
E528
Unit is online
CPU mode
E311 Communications error 1
6 E312 Communications error 2
E540
E541
CPU locked
Wrong password
E313 Communications error 3 E542 Password reset
7 E316
E320
Communications error 6
Time out
E601 Memory full
E602 Instruction missing
E321 Communications error
8 E360 HP Peripheral port time-out
E604
E620
Reference missing
Out of memory
E501 Bad entry
E621 EEPROM Memory not blank
9 E502
E503
Bad address
Bad command
E622 No Handheld Programmer EEPROM
E624 V memory only
E504 Bad reference / value
10 E505 Invalid instruction E625
E627
Program only
Bad write operation
E506 Invalid operation
11 E520
E521
Bad operation – CPU in Run
Bad operation – CPU in Test Run
E628
E640
Memory type error (should be EEPROM)
Mis-compare
E523 Bad operation – CPU in Test Program E650 Handheld Programmer system error
12 E524 Bad operation – CPU in Program E651 Handheld Programmer ROM error
E652 Handheld Programmer RAM error

13
14
A
B
C
D

9–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

Program Error Codes


The following table lists program syntax and runtime error codes. Error detection occurs 1
during a Program-to-Run mode transition, or when you use AUX 21 – Check Program. The
CPU will also turn on SP52 and store the error code in V7755. Appendix B provides a more
complete description of the error codes.
2
3
Error Code Description Error Code Description
E4** No Program in CPU E438 Invalid IRT address 4
E401 Missing END statement E440 Invalid Data Address
E402
E403
Missing LBL
Missing RET
E441
E451
ACON/NCON
Bad MLS/MLR
5
E404 Missing FOR E453 Missing T/C
E405 Missing NEXT E454 Bad TMRA 6
E406 Missing IRT E455 Bad CNT
E412
E421
SBR / LBL >64
Duplicate stage reference
E456
E461
Bad SR
Stack Overflow
7
E422 Duplicate SBR/LBL reference E462 Stack Underflow
E423 HP Peripheral port time-out E463 Logic Error 8
E431 Invalid ISG/SG address E464 Missing Circuit
E433
E434
Invalid ISG / SG address
Invalid RTC
E471
E472
Duplicate coil reference
Duplicate TMR reference
9
E435 Invalid RT E473 Duplicate CNT reference
E436 Invalid INT address E499 Print instruction 10
E437 Invalid IRTC

11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–5


Chapter 9: Maintenance and Troubleshooting

1 CPU Indicators
The DL05 Micro PLCs have indicators on the front to help you determine potential
2 problems with the system. In normal runtime operation only, the RUN and PWR indicators
are on. The table below is a quick reference to potential problems.

3 Indicator Status Potential Problems

4 PWR (LED off)


1. System voltage incorrect

2. PLC power supply faulty


5 1. CPU programming error
RUN (LED off)
6 2. CPU in program mode

1. Electrical noise interference


7 CPU (LED on)
2. Internal CPU defective

8 PWR Indicator
In general there are three reasons for the CPU power status LED (PWR) to be OFF:
9 1. Power to the unit is incorrect or is not applied.
2. PLC power supply is faulty.
10 3. Other component(s) have the power supply shut down.
If the voltage to the power supply is not correct, the PLC may not operate properly or may
11 not operate at all. Use the following guidelines to correct the problem.
WARNING: To minimize the risk of electrical shock, always disconnect the system power before
12 inspecting the physical wiring.

1. First, disconnect the external power.


13 2. Verify that all external circuit breakers or fuses are still intact.
3. Check all incoming wiring for loose connections. If you’re using a separate termination block,
14 check those connections for accuracy and integrity.
4. If the connections are acceptable, reconnect the system power and verify the voltage at the DL05
A power input is within specification. If the voltage is not correct shut down the system and correct
the problem.

B 5. If all wiring is connected correctly and the incoming power is within the specifications, the PLC
internal supply may be faulty.
The best way to check for a faulty PLC is to substitute a known good one to see if this
C corrects the problem. The removable connectors on the DL05 make this relatively easy. If
there has been a major power surge, it is possible the PLC internal power supply has been
D damaged. If you suspect this is the cause of the power supply damage, consider installing an
AC line conditioner to attenuate damaging voltage spikes in the future.

9–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

RUN Indicator
If the CPU will not enter the Run mode (the RUN indicator is off ), the problem is usually in 1
the application program, unless the CPU has a fatal error. If a fatal error has occurred, the
CPU LED should be on. (You can use a programming device to determine the cause of the
error.)
2
Both of the programming devices, Handheld Programmer and DirectSOFT32., will return an
error message describing the problem. Depending on the error, there may also be an AUX
3
function you can use to help diagnose the problem. The most common programming error is
“Missing END Statement”. All application programs require an END statement for proper 4
termination. A complete list of error codes can be found in Appendix B.
CPU Indicator 5
If the CPU indicator is on, a fatal error has occurred in the CPU. Generally, this is not a
programming problem but an actual hardware failure. You can power cycle the system to clear 6
the error. If the error clears, you should monitor the system and determine what caused the
problem. You will find this problem is sometimes caused by high frequency electrical noise
introduced into the CPU from an outside source. Check your system grounding and install
7
electrical noise filters if the grounding is suspected. If power cycling the system does not reset
the error, or if the problem returns, you should replace the CPU. 8
Communications Problems 9
If you cannot establish communications with the CPU, check for these problems:
• The cable is disconnected. 10
• The cable has a broken wire or has been wired incorrectly.
• The cable is improperly terminated or grounded. 11
• The device connected is not operating at the correct baud rate (9600 baud).
• The device connected to the port is sending data incorrectly. 12
• A grounding difference exists between the two devices.
• Electrical noise is causing intermittent errors. 13
• The PLC has a bad communication port and should be replaced.
For problems in communicating with DirectSOFT32 on a personal computer, refer to the 14
DirectSOFT32 manual. It includes a troubleshooting section that can help you diagnose PC
problems in communications port setup, address or interrupt conflicts, etc. A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–7


Chapter 9: Maintenance and Troubleshooting

1 I/O Point Troubleshooting


Possible Causes
2 If you suspect an I/O error, there are several things that could be causing the

3 problem.
• High-Speed I/O configuration error

4 • A blown fuse in your machine or panel (the DL05 does not have internal I/O fuses)
• A loose terminal block

5 • The auxiliary 24 VDC supply has failed


• The Input or Output Circuit has failed

6 Some Quick Steps


When troubleshooting the DL05 Micro PLCs there are a few facts you should be aware of.
7 These facts may assist you in quickly correcting an I/O problem.
• HSIO configuration errors are commonly mistaken for I/O point failure during program
development. If the I/O point in question is in X0–X2, or Y0–Y1, check all parameter locations
8 listed in Chapter 3 that apply to the HSIO mode you have selected.
• The output circuits cannot detect shorted or open output points. If you suspect one or more faulty
9 points, measure the voltage drop from the common to the suspect point. Remember when using a
Digital Volt Meter, leakage current from an output device such as a triac or a transistor must be
considered. A point which is off may appear to be on if no load is connected the point.
10 • The I/O point status indicators are logic-side indicators. This means the LED which indicates the
on or off status reflects the status of the point with respect to the CPU. On an output point the
11 status indicators could be operating normally while the actual output device (transistor, triac etc.)
could be damaged. With an input point, if the indicator LED is on the input circuitry is probably
operating properly. Verify the LED goes off when the input signal is removed.
12 • Leakage current can be a problem when connecting field devices to an I/O point. False input signals
can be generated when the leakage current of an output device is great enough to turn on the
13 connected input device. To correct this, install a resistor in parallel with the input or output of the
circuit. The value of this resistor will depend on the amount of leakage current and the voltage
applied but usually a 10K to 20K resistor will work. Verify the wattage rating of the resistor is
14 correct for your application.
• Because of the removable terminal blocks on the DL05, the easiest method to determine if an I/O
A circuit has failed is to replace the unit if you have a spare. However, if you suspect a field device is
defective, that device may cause the same failure in the replacement PLC as well. As a point of
caution, you may want to check devices or power supplies connected to the failed I/O circuit before
B replacing the unit with a spare.

C
D

9–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

Output points can be set on or off in the DL05 series CPUs. If you want to do an I/O check
out independent of the application program, follow the procedure below: 1
Step Action
1 Use a handheld programmer or DirectSOFT32. to communicate online to the PLC. 2
2 Change to Program Mode.
3 Go to address 0.
Insert an “END” statement at address 0. (This will cause program execution to occur only at address 0 and
3
4 prevent the application program from turning the I/O points on or off).
5 Change to Run Mode. 4
6 Use the programming device to set (turn) on or off the points you wish to test.
7 When you finish testing I/O points delete the “END” statement at address 0. 5
WARNING: Depending on your application, forcing I/O points may cause unpredictable machine
operation that can result in a risk of personal injury or equipment damage. Make sure you 6
have taken all appropriate safety precautions prior to testing any I/O points.

Handheld Programmer Keystrokes Used to Test an Output Point


7
8
END

X0 X2 X5 X7 Y2 Insert an END statement 9


at the beginning of the
X1 X3 X4 program. This disables
the remainder of the 10
program.

From a clear display, use the following keystrokes


END
11
ST AT ENT
16P STATUS 12
BIT REF X
13
Use the PREV or NEXT keys to select the Y data type

NEXT A ENT
Y 10 Y0
14
0

A
Use arrow keys to select point, then use Y2 is now on
ON and OFF to change the status
ON Y 10 Y0
B
SHFT
INS

C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–9


Chapter 9: Maintenance and Troubleshooting

1 Noise Troubleshooting
Electrical Noise Problems
2 Noise is one of the most difficult problems to diagnose. Electrical noise can enter a system in
many different ways and they fall into one of two categories, conducted or radiated. It may be
3 difficult to determine how the noise is entering the system but the corrective actions for either
of the types of noise problems are similar.
4 • Conducted noise is when the electrical interference is introduced into the system by way of a
attached wire, panel connection ,etc. It may enter through an I/O circuit, a power supply
connection, the communication ground connection, or the chassis ground connection.
5 • Radiated noise is when the electrical interference is introduced into the system without a direct
electrical connection, much in the same manner as radio waves.
6 Reducing Electrical Noise
While electrical noise cannot be eliminated, it can be reduced to a level that will not affect the
7 system.
• Most noise problems result from improper grounding of the system. A good earth ground can be
8 the single most effective way to correct noise problems. If a ground is not available, install a ground
rod as close to the system as possible. Ensure all ground wires are single point grounds and are not
daisy chained from one device to another. Ground metal enclosures around the system. A loose wire
9 can act as a large antenna, introducing noise into the system. Therefore, tighten all connections in
your system. Loose ground wires are more susceptible to noise than the other wires in your system.
10 Review Chapter 2 Installation, Wiring, and Specifications if you have questions regarding how to
ground your system.
• Electrical noise can enter the system through the power source for the PLC and I/O circuits.
11 Installing an isolation transformer for all AC sources can correct this problem. DC sources should
be well-grounded good quality supplies.
12 • Separate
wiring.
input wiring from output wiring. Never run low-voltage I/O wiring close to high voltage

13
14
A
B
C
D

9–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

Machine Startup and Program Troubleshooting 1


The DL05 Micro PLCs provide several features that can help you debug your program before
and during machine startup. This section discusses the following topics which can be very
helpful. 2
• Program Syntax Check
• Duplicate Reference Check
3
• Special Instructions
• Run Time Edits
4
• Forcing I/O Points
Syntax Check
5
Even though the Handheld Programmer and DirectSOFT32 provide error checking during
program entry, you may want to check a program that has been modified. Both programming 6
devices offer a way to check the program syntax. For example, you can use AUX 21, CHECK
PROGRAM to check the program syntax from a Handheld Programmer, or you can use the 7
PLC Diagnostics menu option within DirectSOFT32. This check will find a wide variety of
programming errors. The following example shows how to use the syntax check with a
Handheld Programmer.
8
Use AUX 21 to perform syntax check
9
CLR C B AUX ENT
AUX 21 CHECK PRO
2 1
1:SYN 2:DUP REF 10
Select syntax check (default selection)
11
(You may not get the busy display BUSY
ENT
if the program is not very long.) 12
One of two displays will appear 13
Error Display (example)
$00050 E401
MISSING END
14
(shows location in question)
A
Syntax OK display
NO SYNTAX ERROR B
?

See the Error Codes Section for a complete listing of programming error codes. If you get an
C
error, just press CLR and the Handheld will display the instruction where the error occurred.
Correct the problem and continue running the Syntax check until the NO SYNTAX ERROR D
message appears.

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–11


Chapter 9: Maintenance and Troubleshooting

Special Instructions
1 There are several instructions that can be used to help you debug your program during
machine startup operations.
2 • END
• PAUSE
3 • STOP
END Instruction: If you need a way to quickly disable part of the program, just insert an
4 END statement prior to the portion that should be disabled. When the CPU encounters the
END statement, it assumes that is the end of the program. The following diagram shows an
5 example.
Normal Program New END disables X10 and Y1
6 X0 X2 Y0 X0 X2 Y0

7 X1 X3 X4 X1 X3 X4

X10 Y1
8 END

Y1
X10

9 END

END

10 PAUSE Instruction: This instruction provides a quick way to allow the inputs (or other logic)
to operate while disabling selected outputs. The output image register is still updated, but the
11 output circuits are not. For example, you could make this conditional by adding an input
contact or CR to control the instruction with a switch or a programming device. Or, you
12 could just add the instruction without any conditions so the selected outputs would be
disabled at all times.
13 X0
Normal Program
X2 Y0
PAUSE disables Y0 and Y1

Y0 – Y1

14 X1 X3 X4 X0 X2
PAUSE

Y0

A X10 Y1 X1 X3 X4

X10 Y1
B END

C END

STOP Instruction: Sometimes during machine startup you need a way to quickly turn off all
the outputs and return to Program Mode. You can use the STOP instruction. When this
D instruction is executed the CPU automatically exits Run Mode and enters Program Mode.
Remember, all outputs are turned off during Program Mode. The following diagram shows an
example of a condition that returns the CPU to Program Mode.

9–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

Normal Program STOP puts CPU in Program Mode

X0 X2 Y0 X7
ST OP
1
X1 X3 X4 X0 X2 Y0
2
X5 Y1 X1 X3 X4

X5 Y1
3
END

END
4
In the example shown above, you could trigger X7 which would execute the STOP
instruction. The CPU would enter Program Mode and all outputs would be turned off. 5
Duplicate Reference Check
You can also check for multiple uses of the same output coil. Both programming devices offer 6
a way to check for this condition.. For example, you can AUX 21, CHECK PROGRAM to
check for duplicate references from a Handheld Programmer, or you can use the PLC
Diagnostics menu option within DirectSOFT32. The following example shows how to
7
perform the duplicate reference check with a Handheld Programmer.
8
Use AUX 21 to perform syntax check

CLR C
2
B
1
AUX ENT AUX 21 CHECK PRO
9
1:SYN 2:DUP REF
10
Select duplicate reference check
ENT (You may not get the busy BUSY
11
display if the program is not
very long.) 12
One of two displays will appear
$00024 E471
13
Error Display (example)
DUP COIL REF
(shows location in question) 14
NO DUP REFS A
Syntax OK display
?
B
If you get an error, just press CLR and the Handheld will display the instruction where the
error occurred. Correct the problem and continue running the Duplicate Reference check
until no duplicate references are found.
C
NOTE: You can use the same coil in more than one location, especially in programs containing Stage
instructions and / or OROUT instructions. The Duplicate Reference check will find occurrences, even
D
though they are acceptable.

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–13


Chapter 9: Maintenance and Troubleshooting

Run Time Edits


1 The DL05 Micro PLC allows you to make changes to the application program during Run
Mode. These edits are not “bumpless.” Instead, CPU scan is momentarily interrupted (and
2 the outputs are maintained in their current state) until the program change is complete. This
means if the output is off, it will remain off until the program change is complete. If the
3 output is on, it will remain on.
WARNING: Only authorized personnel fully familiar with all aspects of the application should make
changes to the program. Changes during Run Mode become effective immediately. Make
4 sure you thoroughly consider the impact of any changes to minimize the risk of personal
injury or damage to equipment. There are some important operational changes during Run
5 Time Edits.
1. If there is a syntax error in the new instruction, the CPU will not enter the Run Mode.
2. If you delete an output coil reference and the output was on at the time, the output will
6 remain on until it is forced off with a programming device.
3. Input point changes are not acknowledged during Run Time Edits, so, if you’re using a
high-speed operation and a critical input comes on, the CPU may not see the change.
7
Not all instructions can be edited during a Run Time Edit session. The following list shows
8 the instructions that can be edited.
Mnemonic Description Mnemonic Description
9 TMR
TMRF
Timer
Fast timer
OR, ORN
LD
Or greater than or equal or less than
Load data (constant)

10 TMRA
TMRAF
Accumulating timer
Accumulating fast timer
LDD
ADDD
Load data double (constant)
Add data double (constant)
CNT Counter SUBD Subtract data double (constant)
11 UDC
SGCNT
Up / Down counter
Stage counter
MUL
DIV
Multiply (constant)
Divide (constant)

12 STR, STRN
AND, ANDN
Store, Store not
And, And not
CMPD
ANDD
Compare accumulator (constant)
And accumulator (constant)
OR, ORN Or, Or not ORD Or accumulator (constant)
13 STRE, STRNE
ANDE, ANDNE
Store equal, Store not equal
And equal, And not equal
XORD
LDF
Exclusive or accumulator (constant)
Load discrete points to accumulator

14 ORE, ORNE
STR, STRN
Or equal, Or not equal
Store greater than or equal
OUTF
SHFR
Output accumulator to discrete points
Shift accumulator right
Store less than SHFL Shift accumulator left
A AND, ANDN And greater than or equal
And less than
NCON Numeric constant

B
C
D

9–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 9: Maintenance and Troubleshooting

We’ll use the program logic shown to describe


how this process works. In the example, we’ll X0 X1 Y0
OUT
1
change X0 to C10. Note, the example assumes
you have already placed the CPU in Run Mode. C0
2
Use the MODE key to select Run Time Edits
y
3
*MODE CHANGE*
4
MODE NEXT NEXT ENT
RUN TIME EDIT?

Press ENT to confirm the Run Time Edits


5
ENT
(Note, the RUN LED on the D2–HPP
Handheld starts flashing to indicate
*MODE CHANGE*
RUNTIME EDITS
6
Run T ime Edits are enabled.)
7
Find the instruction you want to change (X0).
8
SHFT X A SHFT FD REF
SET 0 FIND
$00000 STR X0 9
Press the arrow key to move to the X. Then enter the new contact (C10). 10
SHFT C
2
B
1
A
0
ENT
RUNTIME EDIT? 11
STR C10

Press ENT to confirm the change.


12
13
(Note, once you press ENT , the next
ENT
address is displayed. OR C0 14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 9–15


Chapter 9: Maintenance and Troubleshooting

1 Forcing I/O Points


There are many times, especially during machine startup and troubleshooting, that you need
the capability to force an I/O point to be either on or off. Before you use a programming
2 device to force any data type it is important you understand how the DL05 CPUs process the
forcing requests.
3 WARNING: Only authorized personnel fully familiar with the application should make program changes.
Do thoroughly consider the impact of any changes to minimize the risk of personal injury or
4 damage to equipment.

Bit Forcing — Bit forcing temporarily changes the status of a discrete bit. For example, you
5 may want to force an input on even though the program has turned it off. This allows you to
change the point status stored in the image register. The forced value will be valid until the
CPU writes to the image register location during the next scan. This is useful you just need to
6 force a bit on to trigger another event.
X0 Y0
The following diagrams show a brief example of how
7 you could use the D2–HPP Handheld Programmer to
C0
OUT

force an I/O point. The example assumes you have


8 already placed the CPU into Run Mode.
From a clear display, use the following keystrokes
9 STAT ENT
16P STATUS
BIT REF X
10 Use the PREV or NEXT keys to select the Y data type. (Once the Y appears, press 0 to
start at Y0.)
11
NEXT A ENT
Y10 Y0

12
0

Use arrow keys to select point, then use ON and OFF to change the status
13 Y2 is now on

14 SHFT ON
INS
Y 10 Y0

A Bit Forcing with Direct Access


From a blank display, use the following keystrokes to force Y 7 ON
B Solid fill indicates point is on.

SHFT Y H SHFT ON
BIT FORCE
C
MLS 7 INS

Y7

From a blank display, use the following keystrokes to force Y 7 OFF


D No fill indicates point is off.

SHFT Y
MLS
H
7
SHFT OFF
DEL
BIT FORCE
Y7

9–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


MEMORY CARTRIDGE/ CHAPTER
REAL TIME CLOCK
10
In This Chapter...
General Information about the D0–01MC . . . . . . . . . . . . . . . . . . . . .10–2
Setting the Write Enable/Disable Jumper . . . . . . . . . . . . . . . . . . . . . .10–3
Plugging-in the Memory Cartridge . . . . . . . . . . . . . . . . . . . . . . . . . .10-4
Software and Firmware Requirements . . . . . . . . . . . . . . . . . . . . . . . .10–5
Naming the Memory Cartridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–6
Setting the Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–7
Memory Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–8
LED Indicator Lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–9
Password Protected Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–9
Memory Map and Forwarding Range . . . . . . . . . . . . . . . . . . . . . . .10–10
Battery Back-up During AC Power Loss . . . . . . . . . . . . . . . . . . . . . .10–11
Specifications and Agency Approvals . . . . . . . . . . . . . . . . . . . . . . . .10–12
Clock/Calendar Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–13
Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10–18
Chapter 10: Memory Cartridge

1 General Information about the D0–01MC


The D0–01MC installs into any of the DL05 PLCs. The MC backs-up the
2 ladder program and data in CMOS RAM. The on–board lithium battery lasts
up to three years. The module’s V–memory maps one–for–one to the PLC’s
memory locations.
3 When the Memory Cartridge is inserted in the option slot, it automatically
becomes the source of the controlling program. It is also where the program is
4 accessed. You can choose to overwrite the program residing in the PLC via a
pushbutton on the face of the module, but you may chose not to.
5 You can copy the program from the PLC to the MC or from the MC to the PLC
or you can operate directly from the MC. By removing the module, you return
control to the PLC’s internal program.
6 Two pushbuttons on the face of the module initiate memory copies. The
pushbuttons are clearly marked to indicate the direction of the copy, and a green
7 LED flashes to confirm the direction and success of the memory copy.
WARNING: The D0–01MC will only work in the DL05 PLC, it will not work in the DL06 PLC.
8
Jumper Selects Write Enable or Disable
9 A jumper enables/disables the write function in the MC. Write disable prevents overwriting the
MC memory. Write enable allows overwriting the MC memory. See page 10–3 for more
10 information.
Low Battery Alert
11 A red LED alerts you to a low battery condition. If the battery drops below 2.5V the “BATT”
LED comes on, and an internal bit is set. You can use the internal bit to activate alarm functions
or to execute an orderly shut–down. See page 10–11 for more information.
12 Clock/Calendar
The date and time are easily set or accessed using DirectSOFT32, Version 3.0b or later,
13 programming software. The “year” field contains four digits so it is ready for Y2K and beyond.

14 Specifications
Environmental specifications for the D0–01MC are the same as for the DL05 PLCs. UL and
CE approvals are pending. (Go to www.automationdirect.com for the latest UL and CE
A updates.) See page 10–12 for detailed specifications.
New Ladder Instructions
B New ladder instructions are available when using the D0–01MC. See page 10–13 for Date and
Time instructions. The MOVMC instruction has the ability to use a constant (K value) when
C used with the Memory Cartridge.
Error Code Changes
D Two Error Codes have expanded definitions when using the Memory Cartridge. See page
10–18.

10–2 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Setting the Write Enable/Disable Jumper 1


The position of jumper J1 determines whether or not the Memory Cartridge can be
overwritten. The Write Disable position is used only for transporting a program. With J1 in the
Write Disable position the Memory Cartridge program can be copied to the CPU, but the PLC
2
cannot be put in RUN mode. The PLC can only be put in the RUN mode with J1 in the Write
Enable position. Write failures will generate the E104 Error Code (for more information see 3
page 10–18).
Write Enable 4
Set the jumper as shown in Figure 1 if you want the CPU to be able to overwrite the Memory
Cartridge. 5
The module ships from the factory with
the jumper in the Write Enable position. 6
7
Figure 1

8
BATTERY
This jumper setting allows the
Memory Cartridge to be overwritten. 3V
9
10
Write Enable

J1 Disable

WARNING: Power to the DL05 PLC must be disconnected before inserting or removing the D0–01MC 11
Memory Cartridge. Failure to disconnect power could result in serious damage to the module, the PLC or
both. 12
Write Disable
Set the jumper as shown in Figure 2 if you do not want the CPU or DirectSOFT32 to be able
13
to overwrite the Memory Cartridge.
14
A
Figure 2
B
BATTERY
This jumper setting prevents the
Memory Cartridge from being
overwritten.
3V
C
D
Write Enable
J1

Disable

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–3


Chapter 10: Memory Cartridge

1 Plugging-in the Memory Cartridge


Remove the Slot Cover
2 Remove the protective cover from the DL05 option card slot by squeezing the pinch tabs and
lifting the cover off.
3 Pinch Tabs

4
5
Option Card
6 Slot Cover

7
8
9
Insert the Memory Cartridge
10 Insert the D0-01MC module into the open option card slot. The printed markings on the
module should be oriented in the same direction as the markings on the PLC. The female
11 connector on the printed circuit board of the module will align with the male connector on
the PLC mother board. Press the module into the slot until the front of the module is flush
with the front of the PLC.
12
13
14
A
B
C
D WARNING: Power to the DL05 PLC must be disconnected before inserting or removing the D0-01MC
Memory Cartridge/Real Time Clock. Failure to disconnect power could result in serious damage to the
module, the PLC or both.

10–4 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Software and Firmware Requirements 1


How to Update Your DirectSOFT32 Programming Software
You will need DirectSOFT32 Version 3.0b (or later) to use all features of the D0–01MC. If you
2
have a licensed copy of Version 3.0 or 3.0a, the Version 3.0c Maintenance Release (or a later
maintenance release) is available for free on our website at www.automationdirect.com. 3
Your DL05 must have Version 2.0, or later, firmware to operate correctly with all features of the
D0–01MC. To determine your firmware revision level, connect to the DL05 with 4
DirectSOFT32 programming software, and click on PLC/Diagnostics/System Information.
This will bring up the System Information screen.
5
6
7
8
9
10
11
The “CPU Version:” will tell you what firmware revision level is installed in your PLC.
12
13
14
A
How to Update Your DL05 Firmware B
If your DL05 requires new firmware, you may download the latest firmware and upgrade tool
from our website. Point your browser to www.automationdirect.com, and click on Technical
Support. There you will find the latest firmware for the DL05 by going to Downloads, then C
Firmware Upgrades. Be sure to download the Koyo Upgrade tool and the Firmware Binary file.
Follow the upgrade instructions contained in the downloaded files. Cycle power after upgrading D
the firmware in your DL05 PLC, and DirectSOFT32 will recognize the new features available
to your PLC.

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–5


Chapter 10: Memory Cartridge

1 Naming the Memory Cartridge


DirectSOFT32 allows you to name your Memory Cartridge. Use this feature to identify a
2 specific machine, a version number for your ladder logic program, etc.

3
4
5
6
7
8
9 Up to 8 Alphanumeric Characters
Within DirectSOFT32, click on PLC/Setup/Memory Cartridge Name to create a name for the
Memory Cartridge. You can use up to 8 alphanumeric or special characters.
10 When you type a name in the “Cartridge Name” field,
you can save the name to disk by clicking on the button
11 with the arrow pointing to the disk, which will store the
name in the DirectSOFT32 project folder. You can also
12 read the name from the project folder (if the Memory
Cartridge was previously named) by clicking on the
button with the arrow coming from the disk.
13 If the PC is connected to the PLC, the PLC-icon buttons
will become active. When the PLC-icon buttons are active, you can also transfer the name to
14 the PLC or transfer an existing name from the PLC into DirectSOFT32. Transfering the
Memory Cartridge name into the PLC transfers the name directly to the Memory Cartridge.
A Name is Retained in Cartridge Memory and Project Folder
Naming the Memory Cartridge is independent of the ladder logic program – although the name
B is stored in the DirectSOFT32 project folder. It is also stored in the battery-backed memory on-
board the Memory Cartridge. Transferring a program from the PLC does not change the name
of the Memory Cartridge even if the program in the PLC originated as a program in another
C Memory Cartridge that has a different name.
If you require the name of your Memory Cartridge to change, you must change it using the
D screen shown.

10–6 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Setting the Time and Date 1


Use DirectSOFT32 to set the date and time in your Memory Cartridge, connect to the DL05.
Inside the Project Window, click on PLC/Setup/Calendar to bring up the Calendar window.
2
Note: You can also use ladder instructions to set the date and time. See Clock/Calendar Instructions
beginning on page 10–13. 3
4
5
6
7
8
9
The first time you view the Calendar window, you will see the factory settings for date and time, 10
as shown below. You can either change each field individually, or you can click on the “Get PC
Time” button. If you click on the “Get PC Time” button, you will see the values change in all
fields. Note, the values will not continue to update. In order to save this new time, you need to
11
click on the “Write to PLC” button.
12
13
14
A
The clock and calendar functions are stored in the following V-memory locations: B
V7766 Seconds 2 digits BCD 00 - 59
V7767
V7770
Minutes
Hours
2 digits BCD
2 digits BCD
00 - 59
00 - 23
C
V7771 Day of the Week (00=Sun, 01=Mon, etc.) 2 digits BCD 00 - 06
V7772 Day of the Month 2 digits BCD 01 - 31 D
V7773 Month 2 digits BCD 01 - 12
V7774 Year 4 digits BCD 1970 - 2069

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–7


Chapter 10: Memory Cartridge

1 Memory Transfers
CPU to MC
2 With system supply power on and the Memory Cartridge installed, put the PLC in STOP
mode. Press and hold the CPU > MC button for about one second, then release. This will
3 transfer the program from the CPU to the
Memory Cartridge. To confirm the transfer,
4 the associated LED will blink for a few
seconds. If the LED does not blink, the
PLC is not in STOP mode. If the LED
5 continues to blink, an error has occurred.
To acknowledge the error, press either of
6 the two buttons on the face of the
module.

7
8
9 NOTE: Memory transfer functions cannot be accessed while the PLC is in RUN mode. Use the toggle switch
on the DL05 to switch the PLC out of RUN mode, or use your DirectSOFT32 programming software to
10 make the change.

11 MC toWithCPUsystem supply power on and the Memory Cartridge installed, put the PLC in STOP
mode. Press and hold the CPU < MC button for about one second, then release. This will
12 transfer the program from the Memory Cartridge to the CPU. To confirm the transfer, the
associated LED will blink for a few seconds. If the LED does not blink, the PLC is not in STOP
13 mode. If the LED continues to blink, an
error has occurred.

14
A
B
C To acknowledge the error, press either of
the two buttons on the face of the module.
D

10–8 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

LED Indicator Lights 1


The three indicator lights on the face of the Memory Cartridge perform the following
functions:
2
Password Protected Programs
3
LED Indicator Condition Meaning
BATT (red) On
Flashes for several seconds
Replace battery 4
Successful completion of transfer
(150 msec on; 150 msec off)
CPU > MC
(green) Does not flash No memory transfer; change to STOP mode 5
Flashes continually with
CPU < MC LED steady on
Error; press either button to clear
6
Flashes for several seconds
Successful completion of transfer
CPU < MC
(150 msec on; 150 msec off)
Does not flash No memory transfer; change to STOP mode
7
(green)
Flashes continually with
CPU > MC LED steady on
Error; press either button to clear 8
Password protected programs cannot be transferred from the CPU on-board memory to the
Memory Cartridge. Also, password protected programs cannot be transferred from the Memory
9
Cartridge to the CPU on-board memory. Programs can only be transferred in either direction
when a password is not used. 10
PLC Mode
Password
CPU > MC CPU < MC 11
DL05 D0-01MC
No No
Disable
(No LED ON)
Disable
(No LED ON)
12
Disable Disable
RUN
Yes No
(No LED ON) (No LED ON) 13
Disable Disable
No Yes
(No LED ON)
Disable
(No LED ON)
Disable
14
Yes Yes
(No LED ON) (No LED ON)

No No Enable Enable
A
(> LED blinks) (< LED blinks)

Yes No
Disable
(< LED keeps blinking)
Disable
(< LED keeps blinking)
B
Program
No Yes
Disable
(> LED keeps blinking)
Disable
(> LED keeps blinking) C
Disable Disable
Yes Yes
(> & < LED keeps blinking) (> & < LED keeps blinking) D

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–9


Chapter 10: Memory Cartridge

1 Memory Map and Forwarding Range


The Memory Cartridge’s on-board memory maps one-for-one to the DL05 PLC. The memory
2 types represented in the table below have the same designated locations in either the Memory
Cartridge or the DL05 PLC.

3 Memory Type Range


Program memory 2K (all)
4 V00000 - V00177 (128 words)
V00200 - V00777 (384 words)
5 V01000 - V01177 (128 words)
V01200 - V07377 (3200 words)
V07400 - V07577 (128 words)
6 V07600 - V07777 (128 words)
V-memory V40400 - V40417 (16 words)

7 V40500 - V40517 (16 words)


V40600 - V40637 (32 words)
V41000 - V41017 (16 words)
8 V41100 - V41107 (8 words)
V41140 - V41147 (8 words)
V41200 - V41237 (32 words)
9 System Parameters 0.5K (all)

10
11
12
13
14
A
B
C
D

10–10 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Battery Back-up During AC Power Loss 1


What if the Battery Dies?
In the event of AC power loss to the DL05 PLC, the on-board lithium battery will back-up the
2
program logic and data values for a period up to three years.
If the Memory Cartridge’s battery voltage drops below 3
approximately 2.5VDC, the red “BATT” LED will illuminate on
the face of the module. At the same time, the Special Relay SP43 is 4
set to “1.” You can use this internal bit as a contact in your ladder
program. Use it to trigger an external alarm – indicating that it is
time to change the battery.
5
SP43 Y0
OUT
6
7
During normal operation, the AC power to the PLC will retain the memory in the Memory
Cartridge. If the AC power fails, or is disconnected, a super-capacitor will continue to hold the 8
memory for 4 – 7 days even if the battery is too weak to hold the memory. Only after the
capacitor has discharged and the battery has become too weak to retain the memory will 9
program logic and data memory be lost.
Battery Type 10
When you see the “BATT” indicator light, replace the battery with a CR2032, coin-type 3.0V
lithium battery (Automationdirect.com, part no. D0–BAT). Do you need to change the battery
while retaining the stored program? If the answer is yes, change the battery during the 4 – 7 days
11
that the super-capacitor will retain the program after AC power is disconnected.
12
NOTE: Be sure your hands are clean and dry before handling the battery. Moisture will corrode the battery
surfaces and shorten the life of the battery.
13
Removing and Replacing the Battery
Push
14
BATTERY

3V
BATTERY

3V
A
B
J1

J1

To replace the battery:


C
To remove the battery:
Push the battery in the direction
indicated. You will feel the
battery press against the spring
The positive (+) side should be facing
out. The battery should enter the
socket as shown (at about a 30 angle
D
in the battery socket. Fully to the printed circuit board). Push the
compress the spring and lift the battery into the socket until the battery
battery out of the socket. snaps into place.

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–11


Chapter 10: Memory Cartridge

1 Specifications and Agency Approvals


2 Specifications
Ambient Operating Temperature 0 °C to 55 °C (32 °F to 131 °F)

3 Storage Temperature
Ambient Humidity
-20 °C to 70 °C (-4°F to 158°F)
5% to 95% non-condensing
Atmosphere No corrosive gases, max. environmental pollution = 2, UL840
4 Vibration Resistance
Shock Resistance
MIL STD 810C, method 514.2
MIL STD 810C, method 516.2

5 Noise Immunity
NEMA ICS3-304
Impulse noise 1µs, 1000V
FCC Class A
RFI (144MHz, 430MHz, 10W, 10cm)
6 Size 120mm x 95mm x 65mm
Weight 50g
7 Battery Number CR2032
(Automationdirect.com part # D0-BAT)

8 Battery Type
Battery Life
Coin type, 3.0V Lithium Battery, 190mAh
Typ 3 years (at 25°C)
Battery Voltage Typ 3.0VDC
9 Battery Abnormal Voltage
Typ < 2.5VDC
Indication: illuminates red LED and
sets SP43 to "1"
10 Write Protect Internal jumper pins
Memory Type CMOS RAM 32KBytes

11 Calendar
Frequency accuracy: ±20PPM (25°C)
Temperature characteristic: +10/-20PPM
(0°- 55°C)
12 Agency Approvals UL, CE (pending)

13
14
A
B
C
D

10–12 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Clock/Calendar Instructions 1
Date (DATE)
The Date instruction can be used to set the date in the
2
Memory Cartridge. The instruction requires two consecutive
V-memory locations (Vaaa) to set the date. If the values in the DATE
V aaa
3
specified locations are not valid, the date will not be set. The
current date can be read from four consecutive V-memory
locations (V7771–V7774).
4
V Memory Location (BCD)
5
Date Range (READ Only)
Year 1970-2069 V7774 6
Month 1-12 V7773
Day of Month
Day of Week
1-31
0-06
V7772
V7771
7
The values entered for the day of week are:
0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday 8
Operand Data Type
...................................................A
DL05 Range
aaa
9
V-memory V All (See page 10-9)
10
In the following example, when C0 is on, the constant value (K00010301) is loaded into the
accumulator using the Load Double instruction (C0 can be a contact from a one shot (PD)
instruction). The value in the accumulator is output to V2000 using the Out Double
11
instruction. The Date instruction uses the value in V2000 to set the date in the CPU. The
example loads the date January 3, 2000. 12
Direct SOFT32 Display Constant (K)
In this example, the Date
C0
LDD
K00010301
0 0 0 1 0 3 0 1
instruction uses the value set in
V2000 and V2001 to set the date
13
Load the constant Acc. 0 0 0 1 0 3 0 1 in the appropriate V memory
value (K00010301)
into the accumulator

Acc. 0 0 0 1 0 3 0 1
locations (V7771–V7774). The
year is entered as a two digit
number, but it is converted
14
OUTD internally to a four digit number.
V2000

Copy the value in


the accumulator to
0 0 0 1 0 3 0 1
Two digit values ranging between
70 – 99 are converted to 1970 –
1999. Values of 00 – 69 are
A
V2000 and V2001 V2001 V2000
converted to 2000 – 2069.

DATE
V2000
V2001 V2000
B
Format 0 0 0 1 0 3 0 1
Set the date in the CPU
using the value in V2000
and V2001
C
Handheld Programmer Keystrokes
Year Month Day Day of Week
STR

SHFT L
C

D
0

D
ENT

K 0 0 0 1
D
0 3 0 1 ENT

OUT SHFT D V 2 0 0 0 ENT

SHFT D A T E V 2 0 0 0 ENT

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–13


Chapter 10: Memory Cartridge

Time (TIME)
1 The Time instruction can be used to set the time (24 hour
clock) in the CPU. The instruction requires two
2 consecutive V-memory locations (Vaaa) which are used to
set the time. If the values in the specified locations are not
TIME
V aaa

3 valid, the time will not be set. The current time can be read
from memory locations V7766–V7770.

4 Date Range V Memory Location (BCD)


(READ Only)
5 Seconds
Minutes
0-59
0-59
V7766
V7767

6 Hour 0-23 V7770

Operand Data Type DL05 Range


7 A aaa
V-memory V All (See page 10-9)
8 In the following example, when C0 is on, the constant value (K73000) is loaded into the
accumulator using the Load Double instruction (C0 should be a contact from a one shot (PD)
9 instruction). The value in the accumulator is output to V2000 using the Out Double instruction.
The Time instruction uses the value in V2000 to set the time in the CPU.
10 Direct SOFT32 Display Constant (K)

C0 LDD
0 0 0 7 3 0 0 0 The Time instruction uses the

11 K73000

Load the constant


value (K73000) into
Acc. 0 0 0 7 3 0 0 0
value set in V2000 and V2001 to
set the time in the appropriate V
memory locations (V7766–V7770)
the accumulator

12 OUTD
V2000
Acc. 0 0 0 7 3 0 0 0

13 Copy the value in the


accumulator to V2000
and V2001
0 0 0

V2001
7 3 0 0

V2000
0

Format
V2001 V2000
14 TIME
V2000 0 0 0 7 3 0 0 0
Set the time in the CPU
using the value in V2000

A and V2001

Handheld Programmer Keystrokes


Not
Used
Hour Minutes Seconds
STR C 0 ENT

B SHFT

OUT
L

SHFT
D

D
D

V
K

2
7

0
3

0
0

0
0

ENT
0 ENT

C
SHFT T I M E V 2 0 0 0 ENT

10–14 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Move Memory Cartridge / Load Label (MOVMC) (LDLBL)


The Move Memory Cartridge instruction is used to 1
copy data between V-memory and program ladder
memory. The Load Label instruction is only used
with the MOVMC instruction when copying data MOVMC
2
A aaa
from program ladder memory to V-memory.
To copy data between V-memory and program
3
ladder memory, the function parameters are loaded
into the first two levels of the accumulator stack 4
and the accumulator by two additional
instructions. Listed below are the steps necessary to
program the Move Memory Cartridge and Load
LDLBL 5
K aaa
Label functions.
6
7
Step 1:— Load the number of words to be copied into the second level of the accumulator
stack.
Step 2:— Load the offset for the data label area in the program ladder memory and the
8
beginning of the V-memory block into the first level of the accumulator stack.
Step 3:— Load the source data label (LDLBL Kaaa) into the accumulator when copying data
9
from ladder memory to V-memory. Load the source address into the accumulator when copying
data from V-memory to ladder memory. This is where the value will be copied from. If the 10
source address is a V-memory location, the value must be entered in HEX.
Step 4:— Insert the MOVMC instruction which specifies destination (Aaaa). This is where the 11
value will be copied to.

Operand Data Type DL05 Range


12
A aaa
V-memory V All (See page 10-9) 13
Constant K 1-FFFF

NOTE: The MOVMC instruction supports K values only when the D0–01MC is installed. Without the D0–01MC
14
installed, the MOVMC instruction supports V-memory values only.
A
Discrete Bit Flags Description
SP53 On if there is a table pointer error B
C
D

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–15


Chapter 10: Memory Cartridge

Copy Data From a Data Label Area to V-memory


1 In the following example, data is copied from a Data Label Area to V-memory. When X1 is on,
the constant value (K4) is loaded into the accumulator using the Load instruction. This value
2 specifies the length of the table and is placed in the second stack location after the next Load and
Load Label (LDLBL) instructions are executed. The constant value (K0) is loaded into the
3 accumulator using the Load instruction. This value specifies the offset for the source and
destination data, and is placed in the first stack location after the LDLBL instruction is
executed. The source address where data is being copied from is loaded into the accumulator
4 using the LDLBL instruction. The MOVMC instruction specifies the destination starting
location and executes the copying of data from the Data Label Area to V-memory.
5 Direct SOFT32 Display

X1
LD
Data Label Area
Programmed
After the END
Instruction X X X X V1777

6 K4

Load the value 4 into the


accumulator specifying the
DLBL K1
N C O N 1 2 3 4 V2000
number of locations to be
K 1 2 3 4

7
copied.
N C O N 4 5 3 2 V2001
LD
K0 K 4 5 3 2

N C O N 6 1 5 1 V2002

8 Load the value 0 into the


accumulator specifying the
offset for source and
destination locations
K

N
6 1

C O N
5 1
8 8 4 5 V2003
K 8 8 4 5
LDLBL

9 K1

Load the value 1 into the


X X X X V2004

accumulator specifying the

10
Data Label Area K1 as the
starting address of the data
to be copied.

MOVMC

11 V2000

V2000 is the destination


starting address for the data
to be copied.

12
13
14 END

DLBL

A K1

NCON
K1234

B NCON
K4532
Handheld Programmer Keystrokes

$ B ENT

C NCON
K6151
STR

SHFT L
ANDST
D
1

3
SHFT K
JMP
E
4
ENT

NCON SHFT L D SHFT K A ENT

D K8845
SHFT
ANDST
L
ANDST
D
3

3
L
ANDST
B
1
L
JMP

ANDST
0
B
1
ENT
NCON
SHFT M O V M C C A A A ENT
K7777
ORST INST# AND ORST 2 2 0 0 0

10–16 DL05 Micro PLC User Manual; 5th Edition, 6/04


Chapter 10: Memory Cartridge

Copy Data From V-memory to a Data Label Area


In the following example, data is copied from V-memory to a data label area. When X1 is on, 1
the constant value (K4) is loaded into the accumulator using the Load instruction. This value
specifies the length of the table and is placed in the second stack location after the next Load and
Load Address instructions are executed. The constant value (K2) is loaded into the accumulator
2
using the Load instruction. This value specifies the offset for the source and destination data,
and is placed in the first stack location after the Load Address instruction is executed. The 3
source address where data is being copied from is loaded into the accumulator using the Load
Address instruction. The MOVMC instruction specifies the destination starting location and 4
executes the copying of data from V-memory to the data label area.
Direct SOFT32 Display

X1
LD
Data Label Area
Programmed
5
K4 After the END

Load the value 4 into the


accumulator specifying the
number of locations to be
X X X X V1777
Instruction

DLBL K1 6
copied.

LD
K2 Offset
1 2 3 4 V2000 N
K
C O N
7 0 4 1
Offset
7
4 5 3 2 V2001 N C O N
Load the value 2 into the
accumulator specifying the
offset for source and
destination locations. 6 1 5 1 V2002 N
K 4

C O N
6 4 8
8
K 6 1 5 1
LDA
O 2000

Convert octal 2000 to HEX


400 and load the value into
8

2
8

5
4

0
5

0
V2003

V2004
N

N
K
C O N
8

C O N
8 4 5 9
the accumulator. This
specifies the source location
where the data will be
copied from
6 8 3 5 V2005 N
K

K
2

C O N
6
5

8
0

3
0

5
10
MOVMC X X X X V2006
K1

K1 is the data label


11
destination area where the

12
data will be copied to

13
END

DLBL
K1

NCON
14
K1234

NCON
K4532
Handheld Programmer Keystrokes A
$ B ENT
STR 1
NCON
K6151 SHFT L
ANDST
D
3
SHFT K
JMP
E
4
ENT B
NCON SHFT L D SHFT K C ENT

NCON
K8845
SHFT
ANDST
L
ANDST
D
3

3
A
0
C
JMP

2
A
2

0
A
0
A
0
ENT C
SHFT M O V M C SHFT K B ENT
K7777
ORST INST# AND ORST 2 JMP 1
D

DL05 Micro PLC User Manual; 5th Edition, 6/04 10–17


Chapter 10: Memory Cartridge

1 Error Codes
The full list of Error Codes associated with the DL05 PLC is contained in the DL05 User
2 Manual. The following error codes have different or expanded definitions when associated with
the D0–01MC Memory Cartridge. Also see page 10–3 concerning error messages you may
encounter when the Memory Cartridge is in the Write Disable position.
3
DL05 Error Code Description
4 E104
WRITE FAILED
A write to the CPU was not successful. Disconnect the power, remove the Memory
Cartridge, and make sure the Memory Cartridge is not Write Disabled.
E505 An invalid instruction was entered into the handheld programmer or a program which
5 INVALID
INSTRUCTION
includes an instruction which requires the Memory Cartridge (D0-01MC) was run in a
DL05 PLC without a Memory Cartridge.

6
7
8
9
10
11
12
13
14
A
B
C
D

10–18 DL05 Micro PLC User Manual; 5th Edition, 6/04


APPENDIX
AUXILIARY FUNCTIONS
A
In This Appendix:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–2
AUX 2* — RLL Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 3* — V-memory Operations . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 4* — I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–4
AUX 5* — CPU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–5
AUX 6* — Handheld Programmer Configuration . . . . . . . . . . . . . . .A–8
AUX 7* — EEPROM Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . .A–8
AUX 8* — Password Operations . . . . . . . . . . . . . . . . . . . . . . . . . . .A–9
Appendix A: Auxiliary Functions

Introduction
A Purpose of Auxiliary Functions
Many CPU setup tasks involve the use of Auxiliary (AUX) Functions. The AUX Functions
2 perform many different operations, including clearing ladder memory, displaying the scan
time, and copying programs to EEPROM in the handheld programmer. They are divided
3 into categories that affect different system resources. You can access the AUX Functions from
DirectSOFT32 or from the D2–HPP Handheld Programmer. The manuals for those
products provide step-by-step procedures for accessing the AUX Functions. Some of these
4 AUX Functions are designed specifically for the Handheld Programmer setup, so they will
not be needed (or available) with the DirectSOFT32 package. Even though this Appendix
5 provides many examples of how the AUX functions operate, you should supplement this
information with the documentation for your choice of programming device. Note, the
Handheld Programmer may have additional AUX functions that are not supported with the
6 DL05 PLCs.

7
AUX Function and Description DL05 AUX Function and Description DL05
8 AUX 2* — RLL Operations AUX 6* — Handheld Programmer Configuration
21 Check Program * 61 Show Revision Numbers *
9 22 Change Reference * 62 Beeper On / Off HP
23 Clear Ladder Range * 65 Run Self Diagnostics HP
24 Clear All Ladders * AUX 7* — EEPROM Operations
10 AUX 3* — V-Memory Operations
71
Copy CPU memory to HPP
HP
31 Clear V Memory * EEPROM

11 AUX 4* — I/O Configuration


41 Show I/O Configuration *
72 Write HPP EEPROM to CPU HP

AUX 5* — CPU Configuration Compare CPU to HPP


12 51 Modify Program Name *
73
EEPROM
HP

53 Display Scan Time * 74 Blank Check (HPP EEPROM) HP


13 54
55
Initialize Scratchpad
Set Watchdog Timer
*
* 75 Erase HPP EEPROM HP
56 Set Communication Port 2 *
14 57 Set Retentive Ranges * 76
Show EEPROM Type (CPU and
HPP)
HP
58 Test Operations *
A 59
5B
Override Setup
HSIO Interface Configuration
*
*
AUX 8* — Password Operations
81 Modify Password *
5D Scan Control Setup * 82 Unlock CPU *
B 83 Lock CPU *

C * - Supported
HP - Handheld Programmer function
D

A–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix A: Auxiliary Functions

Accessing AUX Functions via DirectSOFT32


DirectSOFT32 provides various menu options during both online and offline programming. A
Some of the AUX functions are only available during online programming, some only during
offline programming, and some during both online and offline programming. The following
diagram shows and example of the PLC operations menu available within DirectSOFT32.
2
3
4
Menu Options
5
6
Accessing AUX Functions via the Handheld Programmer
7
You can also access the AUX functions by using a Handheld Programmer. Plus, remember
some of the AUX functions are only available from the Handheld. Sometimes the AUX name 8
or description cannot fit on one display. If you want to see the complete description, just
press the arrow keys to scroll left and right. Also, depending on the current display, you may
have to press CLR more than once.
9
10
CLR AUX
AUX FUNCTION SELECTION
AUX 2* RLL OPERATIONS 11
Use NXT or PREV to cycle through the menus
12
AUX FUNCTION SELECTION
NEXT
AUX 3* V OPERATIONS 13
Press ENT to select sub-menus 14
ENT AUX 3* V OPERATIONS
A
AUX 31 CLR V MEMORY
B
You can also enter the exact AUX number to go straight to the sub-menu.
Enter the AUX number directly C
CLR D B AUX
AUX 3* V OPERATIONS
D
3 1
AUX 31 CLR V MEMORY

DL05 Micro PLC User Manual, 5th Edition, 6/04 A–3


Appendix A: Auxiliary Functions

A AUX 2*RLL
— RLL Operations
Operations auxiliary functions allow you to perform various operations on the ladder program.
2 AUX 21 Check Program
Both the Handheld and DirectSOFT32 automatically check for errors during program entry. However,
3 there may be occasions when you want to check a program that has already been in the CPU. Two types
of checks are available:
• Syntax
4 • Duplicate References

5 The Syntax check will find a wide variety of programming errors, such as missing END statements. If
you perform this check and get an error, see Appendix B for a complete listing of programming error
codes. Correct the problem and then continue running the Syntax check until the message “NO
6 SYNTAX ERROR appears.
Use the Duplicate Reference check to verify you have not used the same output coil reference more than
7 once. Note, this AUX function will also find the same outputs even if they have been used with the
OROUT instruction, which is perfectly acceptable.

8 This AUX function is available on the PLC Diagnostics sub-menu from within DirectSOFT32.
AUX 22 Change Reference
9 There will probably be times when you need to change an I/O address reference or control relay
reference. AUX 22 allows you to quickly and easily change all occurrences, (within an address range), of
a specific instruction. For example, you can replace every instance of X5 with X10.
10 AUX 23 Clear Ladder Range
11 There have been many times when we’ve taken existing programs and added or removed certain
portions to solve new application problems. By using AUX 23 you can select and delete a portion of the
program. DirectSOFT32 does not have a menu option for this AUX function, but you can just select
12 the appropriate portion of the program and cut it with the editing tools.
AUX 24 Clear Ladders
13 AUX 24 clears the entire program from CPU memory. Before you enter a new program, you should
always clear ladder memory. This AUX function is available on the PLC/Clear PLC sub-menu within
14 DirectSOFT32.

AUX 3* — V-memory Operations


A
AUX 31 Clear V-Memory
B AUX 31 clears all the information from the V-memory locations available for general use. This AUX
function is available on the PLC/Clear PLC sub-menu within DirectSOFT32.

C AUX 4* — I/O Configuration


D AUX 41 Show I/O Configuration
This AUX function allows you to display the current I/O configuration on the DL05. Both
the Handheld Programmer and DirectSOFT32 will show the I/O configuration.

A–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix A: Auxiliary Functions

AUX 5* — CPU Configuration A


The following auxiliary AUX functions allow you to setup, view, or change the CPU configuration.
AUX 51 Modify Program Name 2
DL05 PLCs can use a program name for the CPU program or a program stored on EEPROM in the
Handheld Programmer. (Note: you cannot have multiple programs stored on the EEPROM.) The
program name can be up to eight characters in length and can use any of the available characters (A–Z,
3
0–9). AUX 51 allows you to enter a program name. You can also perform this operation from within
DirectSOFT32 by using the PLC/Setup sub-menu. Once you’ve entered a program name, you can only 4
clear the name by using AUX 54 to reset the system memory. Make sure you understand the possible
effects of AUX 54 before you use it! 5
AUX 53 Display Scan Time
AUX 53 displays the current, minimum, and maximum scan times. The minimum and maximum times
are the ones that have occurred since the last Program Mode to Run Mode transition. You can also
6
perform this operation from within DirectSOFT32 by using the PLC/Diagnostics sub-menu.
AUX 54 Initialize Scratchpad
7
The CPU maintains system parameters in a memory area often referred to as the “scratchpad”. In some
cases, you may make changes to the system setup that will be stored in system memory. For example, if
8
you specify a range of Control Relays (CRs) as retentive, these changes are stored.

NOTE: You may never have to use this feature unless you have made changes that affect system memory.
9
Usually, you’ll only need to initialize the system memory if you are changing programs and the old
program required a special system setup. You can usually change from program to program without 10
ever initializing system memory.

AUX 54 resets the system memory to the default values. You can also perform this operation from 11
within DirectSOFT32. by using the PLC/Setup sub-menu.
AUX 55 Set Watchdog Timer 12
DL05 PLCs have a “watchdog” timer that is used to monitor the scan time. The default value set from
the factory is 200 ms. If the scan time exceeds the watchdog time limit, the CPU automatically leaves 13
RUN mode and enters PGM mode. The Handheld displays the following message E003 S/W
TIMEOUT when the scan overrun occurs. 14
Use AUX 55 to increase or decrease the watchdog timer value. You can also perform this operation from
within DirectSOFT32 by using the PLC/Setup sub-menu.
A
AUX 56 CPU Network Address
Since the DL05 CPU has an additional communication port, you can use the Handheld to set the
network address for port 2 and the port communication parameters. The default settings are:
B
• Station address 1
• HEX mode
C
• Odd parity
You can use this port with either the Handheld Programmer, DirectSOFT32, or, as a communication
D
port for DirectNET and MODBUS. Refer to DirectNET and MODBUS manuals for additional
information about communication settings required for network operation.

DL05 Micro PLC User Manual, 5th Edition, 6/04 A–5


Appendix A: Auxiliary Functions

A NOTE: You will only need to use this procedure if you have port 2 connected to a network. Otherwise, the
default settings will work fine.

2 Use AUX 56 to set the network address and communication parameters. You can also
perform this operation from within DirectSOFT32 by using the PLC/Setup sub-menu.
3 AUX 57 Set Retentive Ranges
DL05 CPUs provide certain ranges of retentive memory by default. Some of the retentive
4 memory locations are backed up by a super-capacitor, and others are in non-volatile FLASH
memory. The FLASH memory locations are V7400 to V7577. The default ranges are suitable
for many applications, but you can change them if your application requires additional
5 retentive ranges or no retentive ranges at all. The default settings are:

6 DL05
Memory Area Default Range Available Range
7 Control Relays
V Memory
C400 – C777
V1400 – V7777
C0 – C777
V0 – V7777
Timers None by default T0 – T177
8 Counters CT0 – CT177 CT0 – CT177
Stages None by default S0 – S377
9 Use AUX 57 to change the retentive ranges. You can also perform this operation from within
DirectSOFT32 by using the PLC/Setup sub-menu.
10 WARNING: The DL05 CPUs do not have battery-backed RAM. The super-capacitor will retain the values
in the event of a power loss, but only up to 3 weeks. (The retention time may be as short as
11 4 1/2 days in 60 degree C operating temperature.)

AUX 58 Test Operations


12 AUX 58 is used to override the output disable function of the Pause instruction. Use AUX 58
to program a single output or a range of outputs which will operate normally even when
13 those points are within the scope of the pause instruction.
AUX 59 Bit Override
14 Bit override can be enabled on a point-by-point basis by using AUX 59 from the Handheld
Programmer or, by a menu option from within DirectSOFT32. Bit override basically disables
A any changes to the discrete point by the CPU. For example, if you enable bit override for X1,
and X1 is off at the time, then the CPU will not change the state of X1. This means that even
B if X1 comes on, the CPU will not acknowledge the change. So, if you used X1 in the
program, it would always be evaluated as “off ” in this case. Of course, if X1 was on when the
bit override was enabled, then X1 would always be evaluated as “on”.
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04


A–6
Appendix A: Auxiliary Functions

There is an advantage available when you use the bit override feature. The regular forcing is
not disabled because the bit override is enabled. For example, if you enabled the Bit Override A
for Y0 and it was off at the time, then the CPU would not change the state of Y0. However,
you can still use a programming device to change the status. Now, if you use the
programming device to force Y0 on, it will remain on and the CPU will not change the state
2
of Y0. If you then force Y0 off, the CPU will maintain Y0 as off. The CPU will never update
the point with the results from the application program or from the I/O update until the bit 3
override is removed from the point. The following diagram shows a brief overview of the bit
override feature. Notice the CPU does not update the Image Register when bit override is
enabled.
4
Bit Override OFF Bit Override ON 5
Input Update
X128 ... X2 X1 X0
Input Update
6
OFF ... ON ON OFF
Force from
Programmer
Y128
OFF
C377
...
...
...
Y2
ON
C2
Y1
ON
C1
Y0
OFF
C0
Force from
Programmer 7
OFF ... ON OFF OFF
Result of Program
Solution
Image Register (example)
Result of Program
Solution
8
AUX 5B Counter Interface Configuration 9
AUX 5B is used with the High-Speed I/O (HSIO) function to select the configuration. You
can choose the type of counter, set the counter parameters, etc. See Chapter 3 for a complete 10
description of how to select the various counter features.
AUX 5D Select PLC Scan Mode 11
The DL05 CPU has two program scan modes: fixed and variable. In fixed mode, the scan time is
lengthened to the time you specify (in milliseconds). If the actual scan time is longer than the 12
fixed scan time, then the error code ’E504 BAD REF/VAL’ is displayed. In variable scan mode, the
CPU begins each scan as soon as the previous scan’s activities complete. 13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 A–7


Appendix A: Auxiliary Functions

A AUX 6* — Handheld Programmer Configuration


The following auxiliary functions allow you to setup, view, or change the Handheld
2 Programmer configuration.
AUX 61 Show Revision Numbers
3 As with most industrial control products, there are cases when additional features and
enhancements are made. Sometimes these new features only work with certain releases of
firmware. By using AUX 61 you can quickly view the CPU and Handheld Programmer
4 firmware revision numbers. This information (for the CPU) is also available from within
DirectSOFT32 from the PLC/Diagnostics sub-menu.
5 AUX 62 Beeper On/Off
The Handheld has a beeper that provides confirmation of keystrokes. You can use Auxiliary
6 (AUX) Function 62 to turn off the beeper.
AUX 65 Run Self Diagnostics
7 If you think the Handheld Programmer is not operating correctly, you can use AUX 65 to
run a self diagnostics program. You can check the following items.
8 • Keypad
• Display
9 • LEDs and Backlight
• Handheld Programmer EEPROM check
10 AUX 7* — EEPROM Operations
11 The following auxiliary functions allow you to move the ladder program from one area to
another and perform other program maintenance tasks.
12 Transferrable Memory Areas
Many of these AUX functions allow you to copy different areas of memory to and from the
13 CPU and handheld programmer. The following table shows the areas that may be mentioned.

Option and Memory Type DL05 Default Range


14 1:PGM — Program $00000 – $02047
2:V — V-memory $00000 – $07777
A 3:SYS — System
4:etc (All)— Program, System and non-volatile
Non-selectable copies system parameters
Non-selectable
Vmemory only
B
AUX 71 CPU to HPP EEPROM
C AUX 71 copies information from the CPU memory to an EEPROM installed in the
Handheld Programmer.You can copy different portions of EEPROM (HP) memory to the
D CPU memory as shown in the previous table.

A–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix A: Auxiliary Functions

AUX 72 HPP EEPROM to CPU


AUX 72 copies information from the EEPROM installed in the Handheld Programmer to A
CPU memory in the DL05. You can copy different portions of EEPROM (HP) memory to
the CPU memory as shown in the previous table. 2
AUX 73 Compare HPP EEPROM to CPU
AUX 73 compares the program in the Handheld programmer (EEPROM) with the CPU 3
program. You can compare different types of information as shown previously.
AUX 74 HPP EEPROM Blank Check 4
AUX 74 allows you to check the EEPROM in the handheld programmer to make sure it is
blank. It’s a good idea to use this function anytime you start to copy an entire program to an
EEPROM in the handheld programmer.
5
AUX 75 Erase HPP EEPROM 6
AUX 75 allows you to clear all data in the EEPROM in the handheld programmer. You
should use this AUX function before you copy a program from the CPU. 7
AUX 76 Show EEPROM Type
You can use AUX 76 to quickly determine what size EEPROM is installed in the Handheld
Programmer.
8
AUX 8* — Password Operations 9
There are several AUX functions available that you can use to modify or enable the CPU
password. You can use these features during on-line communications with the CPU, or, you 10
can also use them with an EEPROM installed in the Handheld Programmer during off-line
operation. This will allow you to develop a program in the Handheld Programmer and 11
include password protection.
• AUX 81 — Modify Password 12
• AUX 82 — Unlock CPU
• AUX 83 — Lock CPU 13
AUX 81 Modify Password
You can use AUX 81 to provide an extra measure of protection by entering a password that 14
prevents unauthorized machine operations. The password must be an eight-character numeric
(0–9) code. Once you’ve entered a password, you can remove it by entering all zeros
(00000000). (This is the default from the factory.)
A
Once you’ve entered a password, you can lock the CPU against access. There are two ways to
lock the CPU with the Handheld Programmer. B
• The CPU is always locked after a power cycle (if a password is present).
• You can use AUX 82 and AUX 83 to lock and unlock the CPU. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 A–9


Appendix A: Auxiliary Functions

You can also enter or modify a password from within DirectSOFT32 by using the
A PLC/Password sub-menu. This feature works slightly differently in DirectSOFT32. Once
you’ve entered a password, the CPU is automatically locked when you exit the software
2 package. It will also be locked if the CPU is power cycled.
WARNING: Make sure you remember the password before you lock the CPU. Once the CPU is locked
3 you cannot view, change, or erase the password. If you do not remember the password, you
have to return the CPU to the factory for password removal.

4 NOTE: The DL05 CPUs support multi-level password protection of the ladder program. This allows
password protection while not locking the communication port to an operator interface. The multi-
5 level password can be invoked by creating a password with an upper case “A” followed by seven
numeric characters (e.g. A1234567).

6 AUX 82 Unlock CPU


AUX 82 can be used to unlock a CPU that has been password protected. DirectSOFT32 will
7 automatically ask you to enter the password if you attempt to communicate with a CPU that
contains a password.
8 AUX 83 Lock CPU
AUX 83 can be used to lock a CPU that contains a password. Once the CPU is locked, you
9 will have to enter a password to gain access. Remember, this is not necessary with
DirectSOFT32 since the CPU is automatically locked whenever you exit the software
package.
10
11
12
13
14
A
B
C
D

A–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


APPENDIX
DL05 ERROR CODES
B
In This Appendix:
DL05 Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .B–1
Appendix B: DL05 Error Codes

DL05 Error Code Description


A E003 If the program scan time exceeds the time allotted to the watchdog timer, this error will
SOFTWARE occur. SP51 will be on and the error code will be stored in V7755. To correct this problem
B TIME-OUT use AUX 55 to extend the time allotted to the watchdog timer.
The CPU attempted to execute an instruction code, but the RAM contents had a parity error.
E004 Performing a program download to the CPU in an electrically noisy environment can corrupt
3 INVALID INSTRUCTION
E043
a program’s contents. Clear the CPU program memory, and download the program again.

MC BATTERY LOW The battery in the CMOS RAM cartridge is low and should be replaced.
4 E104 A write to the CPU was not successful. Disconnect the power, remove the CPU, and make
sure the EEPROM is not write protected. If the EEPROM is not write protected, make sure
WRITE FAILED the EEPROM is installed correctly. If both conditions are OK, replace the CPU.
5 E151
A parity error has occurred in the application program. SP44 will be on and the error code
will be stored in V7755 .This problem may possibly be due to electrical noise. Clear the
BAD COMMAND memory and download the program again. Correct any grounding problems. If the error
6 E263
returns replace the Micro PLC.

CONFIGURED I/O ADDRESS Out of range addresses have been assigned while manually configuring the I/O.
7 OUT OF RANGE Correct the address assignments using AUX46.

E311 A request from the handheld programmer could not be processed by the CPU. Clear the
HP COMM error and retry the request. If the error continues replace the CPU. SP46 will be on and the
8 ERROR 1 error code will be stored in V7756.
E312 A data error was encountered during communications with the CPU. Clear between the two
9 HP COMM
ERROR 2
devices, replace the handheld programmer, then if necessary replace the CPU. The error
code will be stored in V7756.

E313 An address error was encountered during communications with the CPU. Clear the error and
10 HP COMM
ERROR 3
retry the request. If the error continues check the cabling between the two devices, replace
the handheld programmer, then if necessary replace the CPU. The error code will be stored
in V7756.

11 E316
HP COMM E
A mode error was encountered during communications with the CPU. Clear the error and
retry the request. If the error continues replace the handheld programmer, then if necessary
ERROR 6 replace the CPU. The error code will be stored in V7756.

12 E320
HP COMM
The CPU did not respond to the handheld programmer communication request. Check to
insure cabling is correct and not defective. Power cycle the system. If the error continues
TIME-OUT replace the CPU first and then the handheld programmer, if necessary.
13 E321
COMM ERROR
A data error was encountered during communication with the CPU. Check to insure cabling
is correct and not defective. Power cycle the system. If the error continues replace the CPU
first and then the handheld programmer, if necessary.
14
A
B
C
D

B–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix B: DL05 Error Codes

E360
DL05 Error Code Description
The device connected to the peripheral port did not respond to the handheld programmer
A
HP PERIPHERAL communication request. Check to insure cabling is correct and not defective. The peripheral
PORT TIME-OUT device or handheld programmer could be defective.
A syntax error exists in the application program. The most common is a missing END
B
E4** statement. Run AUX21 to determine which one of the E4** series of errors is being flagged.
NO PROGRAM SP52 will be on and the error code will be stored in V7755. 3
E401 All application programs must terminate with an END statement. Enter the END statement in
appropriate location in your program. SP52 will be on and the error code will be stored in
MISSING END STATEMENT V7755. 4
E402 A MOVMC or LDLBL instruction was used without the appropriate label. Refer to Chapter 5
MISSING LBL
E403
for details on these instructions. SP52 will be on and the error code will be stored in V7755.
A subroutine in the program does not end with the RET instruction. SP52 will be on and the
5
MISSING RET error code will be stored in V7755.
E404
MISSING FOR
A NEXT instruction does not have the corresponding FOR instruction. SP52 will be on and
the error code will be stored in V7755.
6
E405
MISSING NEXT
A FOR instruction does not have the corresponding NEXT instruction. SP52 will be on and
the error code will be stored in V7755.
7
E406 An interrupt routine in the program does not end with the IRT instruction. SP52 will be on
MISSING IRT and the error code will be stored in V7755. 8
E412 There is greater than 64 SBR or DLBL instructions in the program. This error is also
SBR/LBL>64 returned if there is greater than 2 INT instructions used in the program.SP52 will be on and
the error code will be stored in V7755. 9
E421 Two or more SG or ISG labels exist in the application program with the same number. A
DUPLICATE STAGE REFERENCE unique number must be allowed for each Stage and Initial Stage. SP52 will be on and the
error code will be stored in V7755. 10
E422 Two or more LBL instructions exist in the application program with the same number. A
DUPLICATE LBL
REFERENCE
unique number must be allowed for each and label. SP52 will be on and the error code will
be stored in V7755.
11
E423 Nested loops (programming one FOR/NEXT loop inside of another) are not allowed. SP52
NESTED LOOPS will be on and the error code will be stored in V7755. 12
E431 An ISG or SG instruction must not be placed after the end statement (such as inside a
INVALID ISG/SG
ADDRESS subroutine). SP52 will be on and the error code will be stored in V7755.
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 B–3


Appendix B: DL05 Error Codes

DL05 Error Code Description


A E433 A SBR must be programmed after the end statement, not in the main body of the program or
INVALID SBR in an interrupt routine. SP52 will be on and the error code will be stored in V7755.
B ADDRESS
E434
INVALID RTC A RTC must be programmed after the end statement, not in the main body of the program or
in an interrupt routine. SP52 will be on and the error code will be stored in V7755.
3 ADDRESS
E435
INVALID RT A RT must be programmed after the end statement, not in the main body of the program or
4 ADDRESS
E436
in an interrupt routine. SP52 will be on and the error code will be stored in V7755.

INVALID INT An INT must be programmed after the end statement, not in the main body of the program.
5 ADDRESS SP52 will be on and the error code will be stored in V7755.

E437 An IRTC must be programmed after the end statement, not in the main body of the program.
6 INVALID IRTC
ADDRESS SP52 will be on and the error code will be stored in V7755.

E438 An IRT must be programmed after the end statement, not in the main body of the program.
7 INVALID IRT
ADDRESS SP52 will be on and the error code will be stored in V7755.

E440
8 INVALID DATA
ADDRESS
Either the DLBL instruction has been programmed in the main program area (not after the
END statement), or the DLBL instruction is on a rung containing input contact(s).

E441 An ACON or NCON must be programmed after the end statement, not in the main body of
9 ACON/NCON the program. SP52 will be on and the error code will be stored in V7755.
E451 MLS instructions must be numbered in ascending order from top to bottom.
10 BAD MLS/MLR
E453 A timer or counter contact is being used where the associated timer or counter does not
MISSING T/C exist.
11 E454
BAD TMRA One of the contacts is missing from a TMRA instruction.

12 E455
BAD CNT One of the contacts is missing from a CNT or UDC instruction.

E456
13 BAD SR One of the contacts is missing from the SR instruction.

14
A
B
C
D

B–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix B: DL05 Error Codes

E461
DL05 Error Code Description
A
STACK More than nine levels of logic have been stored on the stack. Check the use of OR STR and
AND STR instructions.
OVERFLOW
E462
B
STACK An unmatched number of logic levels have been stored on the stack. Insure the number of
UNDERFLOW
E463
AND STR and OR STR instructions match the number of STR instructions.
3
LOGIC ERROR A STR instruction was not used to begin a rung of ladder logic.
E464
MISSING CKT A rung of ladder logic is not terminated properly.
4
E471
DUPLICATE COIL Two or more OUT instructions reference the same I/O point. 5
REFERENCE
E472
DUPLICATE TMR Two or more TMR instructions reference the same number.
6
REFERENCE
E473
DUPLICATE CNT Two or more CNT instructions reference the same number.
7
REFERENCE
E499
PRINT Invalid PRINT instruct usage. Quotations and/or spaces were not entered or entered
8
INSTRUCTION incorrectly.
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 B–5


Appendix B: DL05 Error Codes

DL05 Error Code Description


A E501 An invalid keystroke or series of keystrokes was entered into the handheld programmer.
BAD ENTRY
B E502
BAD ADDRESS An invalid or out of range address was entered into the handheld programmer.

3 E503
BAD COMMAND An invalid command was entered into the handheld programmer.

E504
4 BAD REF/VAL An invalid value or reference number was entered with an instruction.

E505 An invalid instruction was entered into the handheld programmer.


INVALID INSTRUCTION
5 E506 An invalid operation was attempted by the handheld programmer.
INVALID OPERATION
6 E520
BAD OP–RUN An operation which is invalid in the RUN mode was attempted by the handheld programmer.

7 E521
BAD OP–TRUN
An operation which is invalid in the TEST RUN mode was attempted by the handheld
programmer.
E523 An operation which is invalid in the TEST PROGRAM mode was attempted by the handheld
8 BAD OP–TPGM programmer.
E524 An operation which is invalid in the PROGRAM mode was attempted by the handheld
BAD OP–PGM programmer.
9 E525 An operation was attempted by the handheld programmer while the CPU mode switch was
MODE SWITCH in a position other than the TERM position.
10 E526
OFF LINE
The handheld programmer is in the OFFLINE mode. To change to the ONLINE mode use the
MODE key.

11 E527
ON LINE
The handheld programmer is in the ON LINE mode. To change to the OFF LINE mode use
the MODE key.
E528
12 CPU MODE The operation attempted is not allowed during a Run Time Edit.

E540 The CPU has been password locked. To unlock the CPU use AUX82 with the password.
CPU LOCKED
13 E541 The password used to unlock the CPU with AUX82 was incorrect.
WRONG PASSWORD
14 E542
PASSWORD RESET
The CPU powered up with an invalid password and reset the password to 00000000. A
password may be re-entered using AUX81.

A E601
MEMORY FULL Attempted to enter an instruction which required more memory than is available in the CPU.

E602
B INSTRUCTION MISSING A search function was performed and the instruction was not found.

C
D

B–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix B: DL05 Error Codes

DL05 Error Code Description


E603 A search function was performed and the data was not found.
A
DATA MISSING
E604
REFERENCE MISSING A search function was performed and the reference was not found. B
E620
OUT OF MEMORY
An attempt to transfer more data between the CPU and handheld programmer than the
receiving device can hold. 3
E621 An attempt to write to a non-blank EEPROM in the handheld programmer was made. Erase
EEPROM NOT BLANK the EEPROM and then retry the write. 4
E622 A data transfer was attempted with no EEPROM (or possibly a faulty EEPROM) installed in
NO HPP EEPROM the handheld programmer.
E623 A function was requested with an EEPROM in the handheld programmer which contains
5
SYSTEM EEPROM system information only.
E624
V-MEMORY ONLY
A function was requested with an EEPROM in the handheld programmer which contains V-
memory data only.
6
E625
PROGRAM ONLY
A function was requested with an EEPROM in the handheld programmer which contains
program data only. 7
E626 An attempt to transfer data from a tape to a UVPROM Memory Cartridge. This transfer must
PROM MC be made using a CMOS RAM Cartridge. 8
E627 An attempt to write to a write-protected or faulty EEPROM in the handheld programmer was
BAD WRITE made. Check the write protect jumper and replace the EEPROM if necessary.
E628 The wrong size EEPROM is being used in the handheld programmer. This error occurs when
9
EEPROM TYPE ERROR the program size is larger than what the HPP can hold.
E640
COMPARE ERROR
A compare between the EEPROM handheld programmer and the CPU was found to be in
error.
10
E641
VOLUME LEVEL
The volume level of the cassette player is not set properly. Adjust the volume and retry the
operation. 11
E642 An error was detected while data was being transferred to the handheld programmer’s
CHECKSUM ERROR Memory Cartridge. Check cabling and retry the operation. 12
E650 A system error has occurred in the handheld programmer. Power cycle the handheld
HPP SYSTEM ERROR programmer. If the error returns replace the handheld programmer.
E651 A ROM error has occurred in the handheld programmer. Power cycle the handheld
13
HPP ROM ERROR programmer. If the error returns replace the handheld programmer.
E652
HPP RAM ERROR
A RAM error has occurred in the handheld programmer. Power cycle the handheld
programmer. If the error returns replace the handheld programmer.
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 B–7


INSTRUCTION EXECUTION APPENDIX
TIMES
C
In This Appendix:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–2
Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C–3
Appendix C: Instruction Execution Times

A Introduction
This appendix contains several tables that provide the instruction execution times for DL05
2 Micro PLCs. Many of the execution times depend on the type of data used with the
instruction. Registers may be classified into the following types:

C • Data (word) Registers


• Bit Registers

4 V-memory Data Registers


Some V-memory locations are considered data registers, such as timer or counter current
values. Standard user V-memory is classified as a V-memory data register. Note that you can
5 load a bit pattern into these types of registers, even though their primary use is for data
registers. The following locations are data registers:
6 Data Registers DL05
Timer Current Values V0 - V177
7 Counter Current Values V1000 - V1177
User Data Words V1200 - V7377
V7400 - V7577
8 V-memory Bit Registers
You may recall that some of the discrete points such as X, Y, C, etc. are automatically mapped
9 into V-memory. The following bit registers contain this data:

10 How to Read the Tables


Bit Registers DL05
11 Input Points (X)
Output Points (Y)
V40400 - V40417
V40500 - V40517

12 Control Relays (C)


Stages (S)
V40600 - V40637
V41000 - V41017
Timer status Bits V41100 - V41107
13 Counter status Bits
Special Relays (SP)
V41140 - V41147
V41200 - V41237

14 Some instructions can have more than one parameter. For example, the SET instruction
shown in the ladder program to the right can set a single
point or a range of points. Two Data Locations Available
A In these cases, execution times depend on the amount and X0 X1 Y0 – Y7
SET
type of parameters. The execution time tables list execution
B times for both situations, as shown below: C0

C
SET 1st #: X, Y, C, S 42.0 µs
D 2nd #: X, Y, C, S (N pt) 32.4 µs + 25.6 µs x N Execution depends
on numbers of
RST 1st #: X, Y, C, S 44.5 µs locations and types
2nd #: X, Y, C, S (N pt) of data used
33.8 µs + 25.7 µs x N

C–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

Instruction Execution Times A


Boolean Instructions
2
Boolean Instructions DL05
Instruction Legal Data Types Execute Not Execute
C
STR X, Y, C, T, CT, S,SP 2.0 µs 2.0 µs
STRN X, Y, C, T, CT, S,SP 2.2 µs 2.2 µs 4
OR X, Y, C, T, CT, S,SP 2.5 µs 2.4 µs
ORN
AND
X, Y, C, T, CT, S,SP
X, Y, C, T, CT, S,SP
2.5 µs
2.2 µs
2.4 µs
2.1 µs
5
ANDN X, Y, C, T, CT, S,SP 2.3 µs 2.3 µs
ANDSTR None 1.2 µs 1.2 µs 6
ORSTR None 1.2 µs 1.2 µs
OUT
OROUT
X, Y, C
X, Y, C
6.8 µs
6.7 µs
7.0 µs
7.2 µs
7
NOT None 1.6 µs 1.6 µs
PD X, Y, C 55.0 µs 55.0 µs 8
STRPD X, Y, C, T, CT, S,SP 20.2 µs 12.9 µs
STRND
ORPD
X, Y, C, T, CT, S,SP
X, Y, C, T, CT, S,SP
20.1 µs
20.0 µs
13.0 µs
12.6 µs
9
ORND X, Y, C, T, CT, S,SP 19.8 µs 12.7 µs
ANDPD X, Y, C, T, CT, S,SP 20.0 µs 12.6 µs 10
ANDND X, Y, C, T, CT, S,SP 19.9 µs 12.8 µs
SET 1st #: X, Y, C, S,
2nd #: X, Y, C, S (N pt)
42.0 µs
32.4 µs + 25.6 µs x N
3.7 µs
4.7 µs
11
1st #: X, Y, C,S 44.5µs 3.9 µs
RST
2nd #: X, Y, C,S (N pt)
1st #: T, CT
33.8 µs + 25.7 µs x N
73.0 µs
4.8 µs
3.7 µs
12
2nd #: T, CT (N pt) 80.9 µs + 2.6 µs x N 4.8 µs
PAUSE 1wd: Y
2wd: Y (N pt)
31.6 µs
48.4 µs + 12.1 µs x N
31.1 µs
48.8 µs
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–3


Appendix C: Instruction Execution Times

Comparative Boolean Instructions


A
Comparative Boolean Instructions DL05
2 Instruction
STRE 1st
Legal Data Types
2nd
Execute Not Execute

C V: Data Reg. V:Data Reg.


V:Bit Reg
K:Constant
16.5 µs
16.5 µs
11.9 µs
16.4 µs
16.4 µs
11.7 µs
P:Indir. (Data) 62.9 µs 62.8 µs
4 V: Bit Reg
P:Indir. (Bit)
V:Data Reg
62.9 µs
16.5 µs
62.8 µs
16.4 µs
V:Bit Reg 16.5 µs 16.4 µs
5 K:Constant
P:Indir. (Data)
P:Indir. (Bit)
11.9 µs
62.9 µs
62.9 µs
11.7 µs
62.8 µs
62.8 µs
P: Indir. (Data) V:Data Reg 63.1 µs 63.0 µs
6 V:Bit Reg
K:Constant
63.1 µs
57.2 µs
63.0 µs
57.1 µs
P:Indir. (Data) 106.8 µs 106.6 µs
7 P: Indir. (Bit)
P:Indir. (Bit)
V:Data Reg
V:Bit Reg
106.8 µs
63.1 µs
63.1 µs
106.6 µs
63.0 µs
63.0 µs
K:Constant 57.2 µs 57.1 µs
8 P:Indir. (Data)
P:Indir. (Bit)
106.8 µs
106.8 µs
106.6 µs
106.6 µs

9 STRNE 1st
V: Data Reg
2nd
V:Data Reg 16.6 µs 16.7 µs
V:Bit Reg 16.6 µs 16.7 µs
K:Constant 12.0 µs 12.1 µs
10 P:Indir. (Data)
P:Indir. (Bit)
63.0 µs
63.0 µs
63.1 µs
63.1 µs
V: Bit Reg V:Data Reg 16.6 µs 16.7 µs
11 V:Bit Reg
K:Constant
16.6 µs
12.0 µs
16.7 µs
12.1 µs
P:Indir. (Data) 63.0 µs 63.1 µs
P:Indir. (Bit) 63.0 µs 63.1 µs
12 P: Indir. (Data) V:Data Reg
V:Bit Reg
63.3 µs
63.3 µs
63.4 µs
63.4 µs
K:Constant 57.4 µs 57.5 µs
13 P:Indir. (Data)
P:Indir. (Bit)
106.9 µs
106.9 µs
107.0 µs
107.0 µs
P: Indir. (Bit) V:Data Reg 63.3 µs 63.4 µs
14 V:Bit Reg
K:Constant
P:Indir. (Data)
63.3 µs
57.4 µs
106.9 µs
63.4 µs
57.5 µs
107.0 µs
P:Indir. (Bit) 106.9 µs 107.0 µs
A
B
C
D

C–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

A
Comparative Boolean Instructions (cont.) DL05
Instruction
ORE 1st
Legal Data Types
2nd
Execute Not Execute 2
V: Data Reg V:Data Reg
V:Bit Reg
K:Constant
16.1 µs
16.1 µs
11.3 µs
16.0 µs
16.0 µs
11.2 µs
C
P:Indir. (Data) 62.4 µs 62.2 µs
V: Bit Reg
P:Indir. (Bit)
V:Data Reg.
62.4 µs
16.1 µs
62.2 µs
16.0 µs
4
V:Bit Reg 16.1 µs 16.0 µs
K:Constant
P:Indir. (Data)
P:Indir. (Bit)
11.3 µs
62.4 µs
62.4 µs
11.2 µs
62.2 µs
62.2 µs
5
P: Indir. (Data) V:Data Reg 62.6 µs 62.5 µs
V:Bit Reg
K:Constant
62.6 µs
56.8 µs
62.5 µs
56.8 µs
6
P:Indir. (Data) 106.4 µs 106.2 µs
P: Indir. (Bit)
P:Indir. (Bit)
V:Data Reg
V:Bit Reg
106.4 µs
62.6 µs
62.6 µs
106.2 µs
62.5 µs
62.5 µs
7
K:Constant 56.8 µs 56.8 µs
P:Indir. (Data)
P:Indir. (Bit)
106.4 µs
106.4 µs
106.2 µs
106.2 µs
8
ORNE 1st
V: Data Reg.
2nd
V:Data Reg. 16.3 µs 16.3 µs 9
V:Bit Reg. 16.3 µs 16.3 µs
K:Constant 11.5 µs 11.6 µs
P:Indir. (Data)
P:Indir. (Bit)
62.5 µs
62.5 µs
62.6 µs
62.6 µs
10
V: Bit Reg. V:Data Reg 16.3 µs 16.3 µs
V:Bit Reg.
K:Constant
16.3 µs
11.5 µs
16.3 µs
11.6 µs 11
P:Indir. (Data) 62.5 µs 62.6 µs
P: Indir. (Data)
P:Indir. (Bit)
V:Data Reg.
V:Bit Reg.
62.5 µs
62.7 µs
62.7 µs
62.6 µs
62.9 µs
62.9 µs
12
K:Constant 57.0 µs 57.1 µs
P:Indir. (Data)
P:Indir. (Bit)
106.5 µs
106.5 µs
106.6 µs
106.6 µs 13
P: Indir. (Bit) V:Data Reg. 62.7 µs 62.9 µs
V:Bit Reg.
K:Constant
P:Indir. (Data)
62.7 µs
57.0 µs
106.5 µs
62.9 µs
57.1 µs
106.6 µs
14
P:Indir. (Bit) 106.5 µs 106.6 µs
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–5


Appendix C: Instruction Execution Times

A Comparative Boolean Instructions (cont.)


Instruction Legal Data Types Execute
DL05
Not Execute

2 ANDE 1st
V: Data Reg.
2nd
V:Data Reg 16.1 µs 16.0 µs
V:Bit Reg 16.1 µs 16.0 µs
K:Constant 11.3 µs 11.3 µs
C P:Indir. (Data)
P:Indir. (Bit)
62.4 µs
62.4 µs
62.2 µs
62.2 µs
V: Bit Reg. V:Data Reg 16.1 µs 16.0 µs
4 V:Bit Reg
K:Constant
16.1 µs
11.3 µs
16.0 µs
11.3 µs
P:Indir. (Data) 62.4 µs 62.2 µs
P:Indir. (Bit) 62.4 µs 62.2 µs
5 P: Indir. (Data) V:Data Reg
V:Bit Reg
62.6 µs
62.6 µs
62.5 µs
62.5 µs
K:Constant 56.9 µs 56.7 µs
6 P:Indir. (Data)
P:Indir. (Bit)
106.4 µs
106.4 µs
106.2 µs
106.2 µs
P: Indir. (Bit) V:Data Reg 62.6 µs 62.5 µs
V:Bit Reg 62.6 µs 62.5 µs
7 K:Constant
P:Indir. (Data)
56.9 µs
106.4 µs
56.7 µs
106.2 µs
P:Indir. (Bit) 106.4 µs 106.2 µs
8 ANDNE 1st 2nd
V: Data Reg. V:Data Reg. 16.2µs 16.4 µs
9 V:Bit Reg.
K:Constant
P:Indir. (Data)
16.2µs
11.5 µs
62.5 µs
16.4 µs
11.6 µs
62.7 µs
P:Indir. (Bit) 62.5 µs 62.7 µs
10 V: Bit Reg. V:Data Reg.
V:Bit Reg
16.2 µs
16.2 µs
16.4 µs
16.4 µs
K:Constant 11.5 µs 11.6 µs
11 P: Indir. (Data)
P:Indir. (Data)
P:Indir. (Bit)
V:Data Reg.
62.5 µs
62.5 µs
62.7 µs
62.7 µs
62.7 µs
62.85 µs
V:Bit Reg. 62.7 µs 62.85 µs
12 K:Constant
P:Indir. (Data)
57.0 µs
106.5 µs
57.1 µs
106.6 µs
P:Indir. (Bit) 106.5 µs 106.6 µs
13 P: Indir. (Bit) V:Data Reg.
V:Bit Reg.
K:Constant
62.7 µs
62.7 µs
57.0 µs
62.85 µs
62.85 µs
57.10 µs
P:Indir. (Data) 106.5 µs 106.6 µs
14 P:Indir. (Bit) 106.5 µs 106.6 µs

A
B
C
D

C–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

Instruction
Comparative Boolean Instructions (cont.)
Legal Data Types Execute
DL05
Not Execute
A
STR 1st
V: T, CT
2nd
V:Data Reg. 16.5 µs 16.4 µs 2
V:Bit Reg 16.5 µs 16.4 µs
K:Constant
P:Indir. (Data)
P:Indir. (Bit)
11.9 µs
62.9 µs
62.9 µs
11.7 µs
62.7 µs
62.7 µs
C
V Data Reg V:Data Reg. 16.5 µs 16.4 µs
V:Bit Reg
K:Constant
16.5 µs
11.9 µs
16.4 µs
11.7 µs 4
P:Indir. (Data) 62.9 µs 62.7 µs
V: Bit Reg.
P:Indir. (Bit)
V:Data Reg.
V:Bit Reg
62.9 µs
16.5 µs
16.5 µs
62.7 µs
16.4 µs
16.4 µs
5
K:Constant 11.9 µs 11.7 µs
P:Indir. (Data)
P:Indir. (Bit)
62.9 µs
62.9 µs
62.7 µs
62.7 µs
6
P: Indir. (Data) V:Data Reg. 63.1 µs 63.0 µs
V:Bit Reg
K:Constant
P:Indir. (Data)
63.1 µs
56.2µs
106.8 µs
63.0 µs
57.1 µs
106.6 µs
7
P: Indir. (Bit) P:Indir. (Bit) 106.8 µs 106.6 µs
V:Data Reg
V:Bit Reg
63.1 µs
63.1 µs
63.0 µs
63.0 µs
8
K:Constant 56.2 µs 57.1 µs
P:Indir. (Data)
P:Indir. (Bit)
106.8 µs
106.8 µs
106.6 µs
106.6 µs 9
STRN 1st
V: T, CT
2nd
V:Data Reg. 16.6 µs 16.7 µs 10
V:Bit Reg. 16.6 µs 16.7 µs
K:Constant
P:Indir. (Data)
P:Indir. (Bit)
12.0 µs
63.0 µs
63.0 µs
12.1 µs
63.1 µs
63.1 µs
11
V: Data Reg. V:Data Reg. 16.6 µs 16.7 µs
V:Bit Reg
K:Constant
16.6 µs
12.0 µs
16.7 µs
12.1 µs 12
P:Indir. (Data) 63.0 µs 63.1 µs
V: Bit Reg
P:Indir. (Bit
V:Data Reg.
V:Bit Reg.
63.0 µs
16.6 µs
16.6 µs
63.1 µs
16.7 µs
16.7 µs
13
K:Constant 12.0 µs 12.1 µs
P:Indir. (Data)
P:Indir. (Bit)
63.0 µs
63.0 µs
63.1 µs
63.1 µs
14
P: Indir. (Data) V:Data Reg. 63.2 µs 63.4 µs
V:Bit Reg.
K:Constant
P:Indir. (Data)
63.2 µs
57.4 µs
106.9 µs
63.4 µs
57.5 µs
107.0 µs
A
P:Indir. (Bit) 106.9 µs 107.0 µs
P: Indir. (Bit) V:Data Reg.
V:Bit Reg.
63.2 µs
63.2 µs
63.4 µs
63.4 µs
B
K:Constant 57.4 µs 57.5 µs
P:Indir. (Data)
P:Indir. (Bit)
106.9 µs
106.9 µs
107.0 µs
107.0 µs C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–7


Appendix C: Instruction Execution Times

A Comparative Boolean Instructions (cont.)


Instruction Legal Data Types Execute
DL05
Not Execute
2 OR 1st
V: T, CT
2nd
V Data Reg 16.1 µs 16.0 µs
V:Bit Reg 16.1 µs 16.0 µs
K:Constant 11.3 µs 11.2 µs
C P:Indir. (Data)
P:Indir. (Bit)
62.4 µs
62.4 µs
62.2 µs
62.2 µs
V: Data Reg. V:Data Reg. 16.1 µs 16.0 µs
4 V:Bit Reg
K:Constant
16.1 µs
11.3 µs
16.0 µs
11.3 µs
P:Indir. (Data) 62.4 µs 62.2 µs
P:Indir. (Bit) 62.4 µs 62.2 µs
5 V: Bit Reg. V:Data Reg.
V:Bit Reg
16.1 µs
16.1 µs
16.0 µs
16.0 µs
K:Constant 11.3 µs 11.2 µs
6 P:Indir. (Data)
P:Indir. (Bit)
62.4 µs
62.4 µs
62.2 µs
62.2 µs
P: Indir. (Data) V:Data Reg 62.6 µs 62.5 µs
7 V:Bit Reg
K:Constant
P:Indir. (Data)
62.6 µs
56.8 µs
106.4 µs
62.5 µs
56.7 µs
106.2 µs
P:Indir. (Bit) 106.4 µs 106.2 µs
8 P: Indir. (Bit) V:Data Reg
V:Bit Reg
62.6 µs
62.6 µs
62.5 µs
62.5 µs
K:Constant 56.8 µs 56.7 µs
9 P:Indir. (Data
P:Indir. (Bit)
106.4 µs
106.4 µs
106.2 µs
106.2 µs

10 ORN 1st
V: T, CT
2nd
V:Data Reg. 16.2 µs 16.3 µs
V:Bit Reg 16.2 µs 16.3 µs
K:Constant 11.5 µs 11.6 µs
11 P:Indir. (Data
P:Indir. (Bit)
62.5 µs
62.5 µs
62.6 µs
62.6 µs
V: Data Reg V:Data Reg 16.2 µs 16.3 µs
12 V:Bit Reg
K:Constant
16.2 µs
11.5 µs
16.3 µs
11.6 µs
P:Indir. (Data) 62.5 µs 62.6 µs
P:Indir. (Bit) 62.5 µs 62.6 µs
13 V: Bit Reg. V:Data Reg.
V:Bit Reg.
16.2 µs
16.2 µs
16.3 µs
16.3 µs
K:Constant 11.5 µs 11.6 µs
14 P:Indir. (Data)
P:Indir. (Bit)
62.5 µs
62.5 µs
62.6 µs
62.6 µs
P: Indir. (Data) V:Data Reg. 62.7 µs 62.9 µs
A V:Bit Reg.
K:Constant
P:Indir. (Data)
62.7 µs
57.0 µs
106.5 µs
62.9 µs
57.1 µs
106.6 µs
P:Indir. (Bit) 106.5 µs 106.6 µs
B P: Indir. (Bit) V:Data Reg.
V:Bit Reg.
62.7 µs
62.7 µs
62.9 µs
62.9 µs
K:Constant 57.0 µs 57.1 µs
C P:Indir. (Data)
P:Indir. (Bit)
106.5 µs
106.5 µs
106.6 µs
106.6 µs

C–8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

Comparative Boolean Instructions (cont.) DL05 A


Instruction Legal Data Types Execute Not Execute
AND 1st
V: T, CT
2nd
V Data Reg. 16.1 µs 16.0 µs 2
V:Bit Reg 16.1 µs 16.0 µs
K:Constant
P:Indir. (Data)
P:Indir. (Bit)
11.3 µs
62.4 µs
62.4 µs
11.2 µs
62.2 µs
62.2 µs
C
V: Data Reg. V:Data Reg 16.1 µs 16.0 µs
V:Bit Reg
K:Constant
16.1 µs
11.3 µs
16.0 µs
11.2 µs
4
P:Indir. (Data) 62.4 µs 62.2 µs
V: Bit Reg.
P:Indir. (Bit)
V:Data Reg.
V:Bit Reg
62.4 µs
16.1 µs
16.1 µs
62.2 µs
16.0 µs
16.0 µs
5
K:Constant 11.3 µs 11.2 µs
P:Indir. (Data)
P:Indir. (Bit)
62.4 µs
62.4 µs
62.2 µs
62.2 µs
6
P: Indir. (Data) V:Data Reg 62.6 µs 62.5 µs
V:Bit Reg
K:Constant
P:Indir. (Data)
62.6 µs
56.8 µs
106.4 µs
62.5 µs
56.7 µs
106.2 µs
7
P:Indir. (Bit) 106.4 µs 106.2 µs
P: Indir. (Bit) V:Data Reg
V:Bit Reg
62.6 µs
62.6 µs
62.5 µs
62.5 µs
8
K:Constant 56.8 µs 56.7 µs
P:Indir. (Data)
P:Indir. (Bit)
106.4 µs
106.4 µs
106.2 µs
106.2 µs 9
ANDN 1st
V: T, CT
2nd
V:Data Reg. 16.2 µs 16.4 µs 10
V:Bit Reg. 16.2 µs 16.4 µs
K:Constant
P:Indir. (Data)
P:Indir. (Bit)
11.5 µs
62.5 µs
62.5 µs
11.6 µs
62.6 µs
62.6 µs
11
V: Data Reg. V:Data Reg 16.2 µs 16.4 µs
V:Bit Reg.
K:Constant
16.2 µs
11.5 µs
16.4 µs
11.6 µs
12
P:Indir. (Data) 62.5 µs 62.6 µs
V: Bit Reg.
P:Indir. (Bit)
V:Data Reg.
V:Bit Reg.
62.5 µs
16.2 µs
16.2 µs
62.6 µs
16.4 µs
16.4 µs
13
K:Constant 11.5 µs 11.6 µs
P:Indir. (Data)
P:Indir. (Bit)
62.5 µs
62.5 µs
62.6 µs
62.6 µs
14
P: Indir. (Data) V:Data Reg. 62.8 µs 62.9 µs
V:Bit Reg.
K:Constant
P:Indir. (Data)
62.8 µs
57.0 µs
106.5 µs
62.9 µs
57.1 µs
106.6 µs
A
P:Indir. (Bit) 106.5 µs 106.6 µs
P: Indir. (Bit) V:Data Reg.
V:Bit Reg.
62.8 µs
62.8 µs
62.9 µs
62.9 µs
B
K:Constant 57.0 µs 57.1 µs
P:Indir. (Data)
P:Indir. (Bit)
106.5 µs
106.5 µs
106.6 µs
106.6 µs C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–9


Appendix C: Instruction Execution Times

Immediate Instructions
A Immediate Instructions DL05

2 STRI
Instruction Legal Data Types
X
Execute
51.87 µs
Not Execute
0.0

C STRNI
ORI
X
X
52.0 µs
51.87 µs
0.0
0.0
ORNI X 51.9 µs 0.0
4 ANDI X 51.87 µs 0.0
ANDNI X 51.9 µs 0.0

5 OUTI
OROUTI
Y
Y
96.0 µs
105.0 µs
0.0
0.0
1st #: Y 84.0 µs 0.0
6 SETI
2nd #: Y (Npt) 147.4 µs + 5 µs x N 0.0
1st #: Y 84.0 µs 0.0
RSTI
7 2nd #: Y (Npt) 147.5 µs + 5 µs x N 0.0

Timer, Counter and Shift Register


8
Timer, Counter, and Shift Register, (cont.) DL05
9 Instruction Legal Data Types Execute Not Execute
1st 2nd
10 TMR T
V:Data Reg.
V:Bit Reg.
74.23 µs
74.23 µs
70.5 µs
70.5 µs
K:Constant 68.83 µs 64.7 µs
11 P:Indir. (Data)
P:Indir. (Bit)
123.0 µs
123.0 µs
119.3 µs
119.3 µs
1st 2nd
12 TMRF T
V:Data Reg.
V:Bit Reg.
K:Constant
145.23 µs
145.23 µs
109.6 µs
70.5 µs
70.5 µs
64.5 µs
P:Indir. (Data) 194.0 µs 119.3 µs
13 1st
P:Indir. (Bit)
2nd
194.0 µs 119.3 µs

V:Data Reg.
14 TMRA T
V:Bit Reg.
K:Constant
118.87 µs
118.87 µs
111.33 µs
73.4 µs
73.4 µs
66.75 µs
P:Indir. (Data) 166.9 µs 128.1 µs
A 1st
P:Indir. (Bit)
2nd
166.9 µs 128.1 µs

V:Data Reg. 148.53 µs 73.4 µs


B TMRAF T
V:Bit Reg.
K:Constant
148.53 µs
142.30 µs
73.4 µs
66.7 µs
P:Indir. (Data) 197.3 µs 128.15 µs
P:Indir. (Bit)
C 1st 2nd
197.3 µs 128.15 µs

V:Data Reg. 102.53 µs 81.5 µs


D CNT T
V:Bit Reg.
K:Constant
P:Indir. (Data)
102.53 µs
97.1 µs
81.5 µs
76.1 µs
151.4 µs 130.4 µs
P:Indir. (Bit) 151.4 µs 130.4 µs

C–10 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

A
Timer, Counter, and Shift Register, (cont.) DL05
Instruction
1st
Legal Data Types
2nd
Execute Not Execute 2
SGCNT CT
V:Data Reg.
V:Bit Reg.
K:Constant
100.0 µs
100.0 µs
64.6 µs
92.4 µs
92.4 µs
87.0 µs
C
P:Indir. (Data) 148.90 µs 141.30 µs

1st
P:Indir. (Bit)
2nd
148.90 µs 141.30 µs 4
V:Data Reg. 139.87 µs 120.20 µs
UDC CT
V:Bit Reg.
K:Constant
139.87 µs
133.73 µs
120.20 µs
114.15 µs
5
P:Indir. (Data) 188.80 µs 169.10 µs

SR C (N points to shift)
P:Indir. (Bit) 188.80 µs
49.0 µs + 4.9 µs x N
169.10 µs
39.15 µs
6
Accumulator Data Instructions
7
Accumulator /Stack Load and Output Data DL05
8
Instructions
Instruction Legal Data Types Execute Not Execute 9
V:Data Reg. 47.0 µs 3.9 µs
LD
V:Bit Reg.
K:Constant
47.0 µs
41.37 µs
3.9 µs
3.3 µs 10
P:Indir. (Data) 93.3 µs 3.2 µs
P:Indir. (Bit) 93.3 µs 3.2 µs
11
V:Data Reg. 46.6 µs 3.35 µs
LDD
V:Bit Reg.
K:Constant
P:Indir. (Data)
46.6 µs
41.5 µs
93.8 µs
3.35 µs
3.35 µs
3.4 µs
12
P:Indir. (Bit) 93.8 µs 3.4 µs
1st 2nd
13
LDF 78.0 µs + 3.3 µs x N 4.4 µs
X, Y, C, S,T, CT,SP K:Constant (N pt)
LDA O: (Octal constant for address) 41.37 µs 3.3 µs 14
V:Data Reg. 14.4 µs 3.2 µs
OUT V:Bit Reg.
P:Indir. (Data)
14.4 µs
61.6 µs
3.2 µs
3.3 µs A
P:Indir. (Bit) 61.6 µs 3.3 µs

V:Data Reg.
V:Bit Reg.
17.3 µs
17.3 µs
3.4 µs
3.4 µs
B
OUTD P:Indir. (Data) 65.27 µs 3.35 µs
P:Indir. (Bit) 65.27 µs 3.35 µs C
1st 2nd
OUTF 49.8 µs + 5.4 µs x N 4.3 µs

POP
X, Y, C K:Constant (N pt)
None 42.3 µs 2.2 µs
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–11


Appendix C: Instruction Execution Times

Logical Instructions
A
Logical (Accumulator) Instructions DL05
2 Instruction Legal Data Types Execute Not Execute
AND V:Data Reg. 23.63 µs 3.4 µs
C V:Bit Reg.
P:Indir. (Data)
P:Indir. (Bit)
23.63 µs
68.1 µs
68.1 µs
3.4 µs
3.4 µs
3.4 µs
ANDD V:Data Reg. 23.4 µs 3.25 µs
4 V:Bit Reg.
K:Constant
23.4 µs
19.27 µs
3.25 µs
3.35 µs
P:Indir. (Data) 70.0 µs 3.4 µs
5 OR
P:Indir. (Bit)
V:Data Reg.
70.0 µs
23.50 µs
3.4 µs
3.25 µs
V:Bit Reg. 23.50 µs 3.25 µs
6 P:Indir. (Data)
P:Indir. (Bit)
69.77 µs
69.77 µs
3.2 µs
3.2 µs
ORD V:Data Reg. 23.9 µs 3.35 µs
7 V:Bit Reg.
K:Constant
P:Indir. (Data)
23.9 µs
19.13 µs
69.8 µs
3.35 µs
3.3 µs
3.25 µs
P:Indir. (Bit) 69.8 µs 3.25 µs
8 XOR V:Data Reg
V:Bit Reg.
23.6 µs
23.6 µs
3.3 µs
3.3 µs
P:Indir. (Data) 69.83 µs 3.4 µs
9 XORD
P:Indir. (Bit)
V:Data Reg.
69.83 µs
23.4 µs
3.4 µs
3.25 µs
V:Bit Reg. 23.4 µs 3.25 µs
10 K:Constant
P:Indir. (Data)
P:Indir. (Bit)
19.27 µs
71.0 µs
71.0 µs
3.4 µs
3.4 µs
3.4 µs
CMP V:Data Reg. 22.5 µs 3.3 µs
11 V:Bit Reg.
P:Indir. (Data)
22.5 µs
68.67 µs
3.3 µs
3.2 µs
P:Indir. (Bit) 68.67 µs 3.2 µs
12 CMPD V:Data Reg.
V:Bit Reg.
37.9 µs
37.7 µs
3.4 µs
3.4 µs
K:Constant 33.4 µs 3.25 µs
13 P:Indir. (Data)
P:Indir. (Bit)
84.23 µs
84.23 µs
3.3 µs
3.3 µs
Math Instructions
14 Math Instructions (Accumulator) DL05
A Instruction Legal Data Types
V:Data Reg.
Execute
168.4 µs
Not Execute
3.9 µs
ADD V:Bit Reg. 168.4 µs 3.9 µs
B P:Indir. (Data)
P:Indir. (Bit)
213.08 µs
213.08 µs
3.9 µs
3.9 µs
V:Data Reg. 177.3 µs 3.8 µs
C ADDD
V:Bit Reg.
K:Constant
P:Indir. (Daa)
177.3 µs
151.8 µs
222.2 µs
3.8 µs
3.9 µs
3.8 µs
P:Indir. (Bit) 222.2 µs 3.8 µs
D V:Data Reg. 175.3 µs 3.9 µs
SUB V:Bit Reg 175.3 µs 3.9 µs
P:Indir. (Data) 219.9 µs 3.9 µs
P:Indir. (Bit) 219.9 µs 3.9 µs

C–12 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

Math Instructions (Accumulator) Continued


Instruction Legal Data Types Execute
DL05
Not Execute
A
SUBD
V:Data Reg.
V:Bit Reg.
K:Constant
187.4 µs
187.4 µs
158.5 µs
3.8 µs
3.8 µs
3.8 µs
2
P:Indir. (Data) 229.1 µs 3.9 µs
P:Indir. (Bit) 229.1 µs 3.9 µs C
V:Data Reg. 483.55 µs 3.8 µs
V:Bit Reg. 483.55 µs 3.8 µs
MUL K:Constant
P:Indir. (Data)
473.30 µs
542.30 µs
3.9 µs
3.8 µs
4
P:Indir. (Bit) 542.30 µs 3.8 µs

V:Data Reg. 1594.0 µs 3.8 µs 5


MULD V:Bit Reg. 1594.0 µs 3.8 µs
P:Indir. (Data) 1656.0 µs 3.8 µs
P:Indir. (Bit) 1656.0 µs 3.8 µs 6
V:Data Reg. 707.1 µs 3.9 µs
DIV
V:Bit Reg
K:Constant
707.1 µs
688.3 µs
3.9 µs
3.8 µs 7
P:Indir. (Data) 751.6 µs 3.8 µs
P:Indir. (Bit)

V:Data Reg.
751.6 µs

712.1 µs
3.8 µs

3.8 µs
8
V:Bit Reg. 712.1 µs 3.8 µs
DIVD P:Indir. (Data)
P:Indir. (Bit)
754.6 µs
754.6 µs
3.8 µs
3.8 µs
9
INC
V:Data Reg
V:Bit Reg
66.4 µs
66.4 µs
3.8 µs
3.8 µs
10
P:Indir. (Data) 109.9 µs 3.8 µs
P:Indir. (Bit) 109.9 µs 3.8 µs
11
V:Data Reg. 68.2 µs 3.8 µs
DEC V:Bit Reg.
P:Indir. (Data )
68.2 µs
112.7 µs
3.8 µs
3.8 µs 12
P:Indir. (Bit) 112.7 µs 3.8 µs

V:Data Reg.
V:Bit Reg.
70.0 µs
70.0 µs
3.7 µs
3.7 µs
13
ADDB K:Constant 82.9 µs 3.8 µs
P:Indir. (Data)
P:Indir. (Bit)
113.9 µs
113.9 µs
3.8 µs
3.8 µs 14
V:Data Reg. 70.25 µs 3.8 µs
SUBB
V:Bit Reg.
K:Constant
70.25 µs
68.3 µs
3.8 µs
3.8 µs A
P:Indir. (Data) 114.0 µs 3.8 µs
P:Indir. (Bit)
V:Data Reg.
114.0 µs
23.9 µs
3.8 µs
3.8 µs
B
V:Bit Reg. 23.9 µs 3.8 µs
MULB K:Constant
P:Indir. (Data)
P:Indir. (Bit)
20.3 µs
67.9 µs
67.9 µs
3.8 µs
3.8 µs
3.8 µs
C
DIVB
V:Data Reg.
V:Bit Reg.
K:Constant
80.9 µs
80.9 µs
77.25 µs
3.8 µs
3.8 µs
3.8 µs
D
P:Indir. (Data) 124.9 µs 3.8 µs
P:Indir. (Bit) 124.9 µs 3.8 µs

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–13


Appendix C: Instruction Execution Times

A Math Instructions (Accumulator) Continued DL05


Instruction Legal Data Types Execute Not Execute
2 V:Data Reg.
V:Bit Reg.
23.4 µs
23.4 µs
3.9 µs
3.9 µs
INCB P:Indir. (Data) 66.5 µs 3.8 µs
C P:Indir. (Bit) 66.5 µs 3.8 µs
V:Data Reg. 23.2 µs 3.8 µs
V:Bit Reg. 23.2 µs 3.8 µs
4 DECB P:Indir. (Data)
P:Indir. (Bit)
67.2 µs
67.2 µs
3.9 µs
3.9 µs

5 Bit Instructions
6 Bit Instructions (Accumulator) DL05
Instruction Legal Data Types Execute Not Execute
7 SUM None
V:Data Reg. (N bits)
26.9 µs
21.8 µs
2.6 µs
2.1 µs
SHFL V:Bit Reg. (N bits) 21.8 µs 2.1 µs
8 K:Constant (N bits)
V:Data Reg. (N bits)
19.5 µs
21.5 µs
2.1 µs
2.1 µs
SHFR V:Bit Reg. (N bits) 21.5 µs 2.1 µs
9 ENCO
K:Constant (N bits)
None
19.6 µs
382.0 µs
2.1 µs
2.7 µs

10 DECO None 16.4 µs 2.7 µs

Number Conversion Instructions


11 Number Conversion Instructions (Accumulator) DL05
12 BIN
Instruction
None
Legal Data Types Execute
159.9 µs
Not Execute
2.6 µs

13 BCD
INV
None
None
175.0 µs
6.7 µs
2.6 µs
2.6 µs
ATH None 319.0 µs 3.7 µs
14 HTA None 301.6 µs 3.9 µs
GRAY None 213.4 µs 2.7 µs

A SFLDGT None 259.1 µs 2.7 µs

B Table Instructions
Table Instructions DL05
C Instruction Legal Data Types Execute Not Execute
V: Data/Bit Reg. to
D MOV Vdata/Bit Reg (N pt) 136.1 µs + 20.8 µs x N 3.25 µs

MOVMC V: Data/Bit Reg <=> E2 (N pt) 86.0 µs + 30.7 µs x N 0


LDLBL K: Constant 33.2 µs 0

C–14 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

CPU Control Instructions


A
CPU Control Instructions DL05

NOP
Instruction
None
Legal Data Types Execute
1.0 µs
Not Execute
1.0 µs
2
END
STOP
None
None
21.8 µs
2.6 µs
0.0
1.15 µs
C
RSTWDT None 6.3 µs 2.6 µs
NOT None 1.6 µs 1.6 µs 4
Program Control Instructions
Program Control Instructions DL05
5
FOR
Instruction
V, K
Legal Data Types Execute
202.9 µs
Not Execute
15.0 µs
6
NEXT
GTS
None
K: Constant
62.27 µs
27.6 µs
-
15.3 µs 7
SBR K: Constant 1.6 µs 0.0
RTC
RT
None
None
25.7 µs
21.6 µs
12.1 µs
0.0
8
MLS
MLR
K: Constant
K: Constant
35.6 µs
15.4 µs
35.6 µs
15.4 µs 9
Interrupt Instructions 10
Interrupt Instructions DL05
Instruction Legal Data Types Execute Not Execute
11
ENI None 23.8 µs 2.2 µs
DISI None 9.4 µs 2.3 µs 12
INT O 7.5 µs 0
IRT
IRTC
None
None
6.6 µs
0.9 µs
0
1.3 µs
13
Network Instructions 14
Network Instructions DL05
Instruction Legal Data Types Execute Not Execute
A
X, Y, C, T, CT, SP, S,V
V:Data Reg.
1639.0 µs
1639.0 µs
4.2 µs
4.2 µs B
RX V:Bit Reg. 1639.0 µs 4.2 µs
P:Indir. (Data) 1674.0 µs 4.2 µs
P:Indir. (Bit) 1674.0 µs 4.2 µs C
WX
X, Y, C, T, CT, SP, S, V
V:Data Reg.
V:Bit Reg.
1691.0 µs
1691.0 µs
1691.0 µs
4.2 µs
4.2 µs
4.2 µs
D
P:Indir. (Data) 1726.0 µs 4.2 µs
P:Indir. (Bit) 1726.0 µs 4.2 µs

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–15


Appendix C: Instruction Execution Times

Message Instructions
A
Message Instructions DL05
2 Instruction Legal Data Types Execute Not Execute
V:Data Reg. 163.5 µs 4.2 µs
C FAULT V:Bit Reg.
K:Constant
163.5 µs
204.4 µs
4.2 µs
4.3 µs
DLBL K: Constant – 0.0
4 NCON
ACON
K: Constant
K: Constant


0.0
0.0

5 PRINT 817.23 µs 3.8 µs

RLL plus Instructions


6
RLLplus Instructions DL05
7 Instruction Legal Data Types Execute Not Execute
ISG S 57.27 µs 54.4 µs
8 SG
JMP
S
S
57.25 µs
109.2 µs
54.4 µs
8.9 µs
NJMP S 109.2 µs 8.9 µs
9 CV S 38.9 µs 38.9 µs
CVJMP S 26.0 µs 26.0 µs
10 Drum Instructions

11 Drum Instructions
Instruction Legal Data Types Execute
DL05
Not Execute
12 DRUM CT 1204.0 µs 398.2 µs
EDRUM CT 989.2 µs 421.05 µs

13
14
A
B
C
D

C–16 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix C: Instruction Execution Times

Word Bit Instructions


Word Bit Instructions DL05
A
Instruction Legal Data Types
V:Data Reg.
Execute
5.6 µs
Not Execute
5.6 µs
2
V:Bit Reg. 5.6 µs 5.6 µs
STRB P:Indir. (Data)
P:Indir. (Bit)
30.8 µs
64.4 µs
30.8 µs
64.4 µs
C
V:Data Reg. 5.6 µs 5.6 µs
STRNB V:Bit Reg.
P:Indir. (Data)
5.5 µs
30.7 µs
5.5 µs
30.7 µs 4
P:Indir. (Bit) 64.4 µs 64.4 µs

ORB
V:Data Reg.
V:Bit Reg.
P:Indir. (Data)
5.5 µs
5.5 µs
30.9 µs
5.5 µs
5.5 µs
30.9 µs
5
P:Indir. (Bit) 64.5 µs 64.5 µs
V:Data Reg.
V:Bit Reg.
5.6 µs
5.5 µs
5.6 µs
5.5 µs
6
ORNB P:Indir. (Data) 30.9 µs 30.9 µs
P:Indir. (Bit)
V:Data Reg
64.5 µs
5.6 µs
64.5 µs
5.6 µs
7
ANDB V:Bit Reg. 5.5 µs 5.5 µs
P:Indir. (Data)
P:Indir. (Bit)
30.9 µs
64.5 µs
30.9 µs
64.5 µs 8
V:Data Reg. 5.6 µs 5.6 µs
ANDNB V:Bit Reg.
P:Indir. (Data)
P:Indir. (Bit)
5.6 µs
30.9 µs
64.6 µs
5.6 µs
30.9 µs
64.5 µs
9
V:Data Reg. 11.4 µs 11.5 µs
OUTB V:Bit Reg.
P:Indir. (Data)
11.4 µs
36.7 µs
11.5 µs
36.7 µs
10
P:Indir. (Bit) 70.2 µs 70.4 µs

SETB
V:Data Reg.
V:Bit Reg.
9.5 µs
9.5 µs
4.7 µs
4.8 µs 11
P:Indir. (Data) 34.7 µs 30.0 µs
P:Indir. (Bit)
V:Data Reg.
V:Bit Reg.
68.4 µs
9.8 µs
9.8 µs
63.7 µs
4.8 µs
4.7 µs
12
RSTB P:Indir. (Data) 35.1 µs 30.0 µs
P:Indir. (Bit) 68.7 µs 63.7 µs 13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 C–17


APPENDIX
SPECIAL RELAYS
D
In This Appendix:
DL05 PLC Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D–2
Appendix D: Special Relays

A DL05 PLC Special Relays


“Special Relays” are contacts which are set by the CPU operating system to indicate a
2 particular system event has occurred. These contacts are available for use in your ladder
program. Knowing just the right special relay contact to use for a particular situation can save
a lot of programming time. Since the CPU operating system sets and clears special relay
3 contacts, the ladder program only has to use them as inputs in ladder logic.

D
5 Startup and Real Time Relays
6 SP0 First scan
On for the first scan after a power cycle or program to run transition only. The relay is
reset to off on the second scan. It is useful where a function needs to be performed
only on program startup.

7 SP1
SP3
Always ON
1 minute clock
Provides a contact to insure an instruction is executed every scan.
On for 30 seconds and off for 30 seconds.
SP4 1 second clock On for 0.5 second and off for 0.5 second.
8 SP5 100 ms clock On for 50 ms. and off for 50 ms.
SP6 50 ms clock On for 25 ms. and off for 25 ms.

9 SP7 Alternate scan On every other scan.

10
11 CPU Status Relays
SP11 Forced run mode On when the mode switch is in the run position and the CPU is running.
12 SP12 Terminal run mode On when the CPU is in the run mode.
SP13 Test run mode On when the CPU is in the test run mode.
13 SP15
SP16
Test stop mode
Terminal PGM mode
On when the CPU is in the test stop mode.
On when the mode switch is the the TERM position and the CPU is in program mode.
SP17 Forced stop On when the mode switch is in the STOP position.
14 SP20 Forced stop mode On when the STOP instruction is executed.
SP22 Interrupt enabled On when interrupts have been enabled using the ENI instruction.
A
B
C
D

D–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix D: Special Relays

System Monitoring
SP36 Override setup relay On when the override function is used.
A
SP37 Scan controller On when the actual scan time runs over the prescribed scan time.
SP40 Critical error On when a critical error such as I/O communication loss has occurred.
2
SP41 Warning On when a non critical error has occurred.
SP42 Diagnostics error On when a diagnostics error or a system error occurs. 3
SP44 Program memory error On when a memory error such as a memory parity error has occurred.
SP45 I/O error On when an I/O error such as a blown fuse occurs. D
SP46 Communication error On when a communication error occurs on any of the CPU ports.
SP50 Fault instruction On when a Fault Instruction is executed. 5
SP51 Watch Dog timeout On if the CPU Watch Dog timer times out.
SP52 Grammatical error On if a grammatical error has occurred either while the CPU is running or if the syntax 6
SP53 Solve logic error On if CPU cannot solve the logic.
SP54 Communication error On when RX, WX, RD, WT instructions are executed with the wrong parameters. 7
Table instruction On if a table instruction with a pointer is executed and the pointer value is outside the
SP56 overrun table boundary.
8
9
10
Accumulator Status
SP60 Value less than On when the accumulator value is less than the instruction value. 11
SP61 Value equal to On when the accumulator value is equal to the instruction value.
SP62 Greater than On when the accumulator value is greater than the instruction value 12
SP63 Zero On when the result of the instruction is zero (in the accumulator.)
SP64
SP65
Half borrow
Borrow
On when the 16 bit subtraction instruction results in a borrow.
On when the 32 bit subtraction instruction results in a borrow.
13
SP66
SP67
Half carry
Carry
On when the 16 bit addition instruction results in a carry.
On when the 32 bit addition instruction results in a carry.
14
SP70
SP71
Sign
Pointer reference error
On anytime the value in the accumulator is negative.
On when the V-memory specified by a pointer (P) is not valid.
A
SP73 Overflow On if overflow occurs in the accumulator when a signed addition or subtraction results
in an incorrect sign bit. B
SP75 Data error On if a BCD number is expected and a non–BCD number is encountered.
SP76 Load zero On when any instruction loads a value of zero into the accumulator. C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 D–3


Appendix D: Special Relays

HSIO Pulse Output Relay


A SP104 Profile Complete On when the pulse output profile is completed. (Mode 30)

2
Communication Monitoring Relay
3 SP116 CPU port busy Port 2 On when port 2 is the master and sending data.
Communication error
SP117 On when port 2 is the master and has a communication error.
D SP120
Port 2
Communication busy Option card slot
SP121 Communication error Option card slot
5
6 Equal Relays for HSIO Mode 10 Counter Presets
SP540
7 SP541
Current = target value
Current = target value
On when the counter current value equals the value in V2320 / V2321.
On when the counter current value equals the value in V2322 / V2323.
SP542 Current = target value On when the counter current value equals the value in V2324 / V2325.
8 SP543 Current = target value On when the counter current value equals the value in V2326 / V2327.
SP544 Current = target value On when the counter current value equals the value in V2330 / V2331.
9 SP545 Current = target value On when the counter current value equals the value in V2332 / V2333.
SP546 Current = target value On when the counter current value equals the value in V2334 / V2335.
10 SP547 Current = target value On when the counter current value equals the value in V2336 / V2337.
SP550 Current = target value On when the counter current value equals the value in V2340 / V2341.
11 SP551 Current = target value On when the counter current value equals the value in V2342 / V2343.
SP552 Current = target value On when the counter current value equals the value in V2344 / V2345.
12 SP553 Current = target value On when the counter current value equals the value in V2346 / V2347.
SP554 Current = target value On when the counter current value equals the value in V2350 / V2351.
13 SP555 Current = target value On when the counter current value equals the value in V2352 / V2353.
SP556 Current = target value On when the counter current value equals the value in V2354 / V2355.
14 SP557 Current = target value On when the counter current value equals the value in V2356 / V2357.
SP560 Current = target value On when the counter current value equals the value in V2360 / V2361.

A SP561
SP562
Current = target value
Current = target value
On when the counter current value equals the value in V2362 / V2363.
On when the counter current value equals the value in V2364 / V2365.

B SP563
SP564
Current = target value
Current = target value
On when the counter current value equals the value in V2366 / V2367.
On when the counter current value equals the value in V2370 / V2371.

C SP565
SP566
Current = target value
Current = target value
On when the counter current value equals the value in V2372 / V2373.
On when the counter current value equals the value in V2374 / V2375.

D SP567 Current = target value On when the counter current value equals the value in V2376 / V2377.

D–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


APPENDIX
PRODUCT WEIGHTS
E
In This Appendix:
Product Weight Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .E–2
Appendix E: Product Weights

A Product Weight Table


2
PLC Weight
3 D0–05AR 0.60 lb. (272g)
D0–05DR 0.60 lb. (272g)
4 D0–05AD 0.58 lb. (263g)

E D0–05DD
D0–05AA
0.56 lb. (254g)
0.60 lb. (272g)

6 D0–05DA
D0–05DR–D
0.60 lb. (272g)
0.56 lb. (254g)

7 D0–05DD–D 0.58 lb. (263g)

8
9
10
11
12
13
14
A
B
C
D

E–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


APPENDIX
PLC MEMORY
F
E
In this Appendix
DL05 PLC Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .F–2
Appendix F: PLC Memory

1 DL05 PLC Memory


When designing a PLC application, it is important for the PLC user to understand the
2 different types of memory in the PLC. Two types of memory are used by the DL05: CPU,
RAM and EEPROM. This memory can be configured by the PLC user as either retentive or
non-retentive memory.
3 Retentive memory is memory that is configured by the user to maintain values through a
power cycle or a PROGRAM to RUN transition. Non-retentive memory is memory that is
F configured by the PLC user to clear data after a power cycle or a PROGRAM to RUN
transition. The retentive ranges can be configured with either the handheld programmer
5 using AUX57 or DirectSOFT32 (PLC Setup).
The contents of RAM memory can be written to and read from an infinite number of times,
but RAM requires a power source to maintain the contents of memory. The contents of RAM
F are maintained by the internal power supply (5VDC) only while the PLC is powered by an
external source, normally 120VAC. When power to the PLC is turned off, the contents of
7 RAM are maintained by a ”Super-Capacitor”. If the Super-Capacitor ever discharges, the
contents of RAM will be lost. The data retention time of the Super-Capacitor backed RAM is
8 3 weeks maximum, and 4 1/2 days minimum (at 60쎷 C).
The contents of EEPROM memory can be read from an infinite number of times, but there
is a limit to the number of times it can be written to (typical specification is 100,000 writes).
9 EEPROM does not require a power source to maintain the memory contents. It will retain
the contents of memory indefinately.
10 PLC user V-memory is stored in both volatile RAM and non-volatile EEPROM memory.
Data being stored in RAM uses V400-V677, V1200-V7377 and V10000-V17777. Data
11 stored in EEPROM uses V7400-V7577 and V700-V777, V7600-V7777 and V36000-
V37777.
12 Data values that must be retained for long periods of time, when the PLC is powered off,
should be stored in EEPROM based V-memory.

13 Data values that are continually changing or which can be initialized with program logic
should be stored in RAM based V-memory.

14
A
B
C
D

F-2 DL05 Micro PLC User Manual; 5th Ed.,6/04


Appendix F: PLC Memory

Non-volatile V-memory in the DL05


The use of non-volatile V-memory.
1
1. The non-volatile V-memory area is V7400-V7577.
2. Access to the non-volatile V-memory.
2
There are 2 types of memory assigned for the non-volatile V-memory area. They are RAM
and flach ROM (EEPROM). They are sharing the same V-memory addresses; however, you
3
can only use the MOVE instruction, D2-HPP and DirectSOFT32 to write data to the
flash ROM. When you write data to the flash ROM, the same data is also written to RAM. F
If you use other instructins, you can only write data to RAM. When you read data from the
non-volatile V-memory area, the data is always read from RAM. 5
Writing data Reading data F
RAM Flash ROM RAM Flash ROM
7
V7400-V7577 V7400-V7577 V7400-V7577 V7400-V7577 8
9
Other instructions MOVE MOVE There is no way to read data
(OUT, OUTD...) D2-HPP
DirectSOFT32
D2-HPP
DirectSOFT32
from the Flash ROM directly.
10
After a power cycle, the PLC always copies the data in the flash ROM to the RAM. 11
3. A possible problem.
If you use the instructions except the MOVE instruction to write data into the non-volatile
12
V-memory area, you only update the data in RAM. After a power cycle, the PLC copies the
previous data from the flash memory to the RAM, so you may think the data you changed 13
has disappeared. To avoid trouble such as this, we recommend that you use the MOVE
instruction. 14
RAM Flash ROM
V7400 = 1111 V7400 = 1111 A
LD K2222
OUT V7400
V7400 = 2222 V7400 = 1111 Not changed
B
Cycle power Copy C
V7400 = 1111 V7400 = 1111

This appears to be previous data returning.


D

DL05 Micro PLC User Manual; 5th Ed., 6/04 F-3


EUROPEAN UNION APPENDIX
DIRECTIVES (CE)
G
In This Appendix:
European Union (EU) Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . .G-2
Basic EMC Installation Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . .G–4
Appendix G: European Union Directives (CE)

1 European Union (EU) Directives


2 NOTE: The information contained in this section is intended as a guideline and is based on our interpretation of the
various standards and requirements. Since the actual standards are issued by other parties, and in some cases
governmental agencies, the requirements can change over time without advance warning or notice. Changes or

3 additions to the standards can possibly invalidate any part of the information provided in this section.

This area of certification and approval is absolutely vital to anyone who wants to do business
4 in Europe. One of the key tasks that faced the EU member countries and the European
Economic Area (EEA) was the requirement to bring several similar yet distinct standards
together into one common standard for all members. The primary purpose of a single
G standard was to make it easier to sell and transport goods between the various countries and
to maintain a safe working and living environment. The Directives that resulted from this
6 merging of standards are now legal requirements for doing business in Europe. Products that
meet these Directives are required to have a CE mark to signify compliance.
G Member Countries
As of August 1, 2002, the members of the EU are Austria, Belgium, Denmark, Finland,
8 France, Germany, Greece, Ireland, Italy, Luxembourg, The Netherlands, Portugal, Spain,
Sweden, and the United Kingdom. Iceland, Liechtenstein, and Norway together with the EU
members make up the European Economic Area (EEA) and all are covered by the Directives.
9 Applicable Directives
There are several Directives that apply to our products. Directives may be amended, or added,
10 as required.
• Electromagnetic Compatibility Directive (EMC) — this Directive attempts to ensure that devices,
11 equipment, and systems have the ability to function satisfactorily in an electromagnetic
environment without introducing intolerable electromagnetic disturbance to anything in that
12 environment.
• Machinery Safety Directive — this Directive covers the safety aspects of the equipment,
installation, etc. There are several areas involved, including testing standards covering both electrical
13 noise immunity and noise generation.
• Low Voltage Directive — this Directive is also safety related and covers electrical equipment that
14 has voltage ranges of 50–1000VAC and/or 75–1500VDC.
• Battery Directive — this Directive covers the production, recycling, and disposal of batteries.
A Compliance
Certain standards within each Directive already require mandatory compliance. The EMC
B Directive, which has gained the most attention, became mandatory as of January 1, 1996.
The Low Voltage Directive became mandatory as of January 1, 1997.
C Ultimately, we are all responsible for our various pieces of the puzzle. As manufacturers, we
must test our products and document any test results and/or installation procedures that are
necessary to comply with the Directives. As a machine builder, you are responsible for
D installing the products in a manner which will ensure compliance is maintained. You are also
responsible for testing any combinations of products that may (or may not) comply with the
Directives when used together.

G-2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix G: European Union Directives (CE)

The end user of the products must comply with any Directives that may cover maintenance,
disposal, etc. of equipment or various components. Although we strive to provide the best 1
assistance available, it is impossible for us to test all possible configurations of our products with
respect to any specific Directive. Because of this, it is ultimately your responsibility to ensure that
your machinery (as a whole) complies with these Directives and to keep up with applicable
2
Directives and/or practices that are required for compliance.
As of August 1, 2002, the DL05, DL06, DL205, DL206, DL305, and DL405 PLC systems
3
manufactured by Koyo Electronics Industries or FACTS Engineering, when properly installed
and used, conform to the Electromagnetic Compatibility (EMC), Low Voltage Directive, and 4
Machinery Directive requirements of the following standards.
• EMC Directive Standards Relevent to PLCs
EN50081–1 Generic emission standard for residential, commercial, and light industry
G
EN50081–2 Generic emission standard for industrial environment.
EN50082–1 Generic immunity standard for residential, commercial, and light industry 6
EN50082–2 Generic immunity standard for industrial environment.
• Low Voltage Directive Standards Applicable to PLCs
EN61010–1 Safety requirements for electrical equipment for measurement, control, and laboratory
G
use.
• Product Specific Standard for PLCs 8
EN61131–2 Programmable controllers, equipment requirements and tests. This standard replaces
the above generic standards for immunity and safety. However, the generic emissions standards must
still be used in conjunction with the following standards:
9
-EN 61000-3-2 Harmonics
-EN 61000-3-2 Fluctuations 10
AutomationDirect is currently in the process of changing their testing procedures from the generic
standards to the product specific standards. 11
Special Installation Manual
The installation requirements to comply with the requirements of the Machinery Directive,
EMC Directive and Low Voltage Directive are slightly more complex than the normal
12
installation requirements found in the United States. To help with this, we have published a
special manual which you can order: 13
• DA–EU–M – EU Installation Manual that covers special installation requirements to meet the EU
Directive requirements. Order this manual to obtain the most up-to-date information. 14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 G-3


Appendix G: European Union Directives (CE)

Other Sources of Information


1 Although the EMC Directive gets the most attention, other basic Directives, such as the
Machinery Directive and the Low Voltage Directive, also place restrictions on the control
2 panel builder. Because of these additional requirements it is recommended that the following
publications be purchased and used as guidelines:
3 • BSI publication TH 42073: February 1996 – covers the safety and electrical aspects of the
Machinery Directive

4 • EN 60204–1:1992 – General electrical requirements for machinery, including Low Voltage and
EMC considerations
• IEC 1000–5–2: EMC earthing and cabling requirements
G • IEC 1000–5–1: EMC general considerations
It may be possible for you to obtain this information locally; however, the official source of
6 applicable Directives and related standards is:
The Office for Official Publications of the European Communities L–2985 Luxembourg;
G quickest contact is via the World Wide Web at http://euro–op.eu.int/indexn.htm
Another source is:
8 British Standards Institution – Sales Department
Linford Wood
9 Milton Keynes
MK14 6LE
10 United Kingdom; the quickest contact is via the World Wide Web at http://www.bsi.org.uk

11 Basic EMC Installation Guidelines


12 Enclosures
The simplest way to meet the safety requirements of the Machinery and Low Voltage
13 Directives is to house all control equipment in an industry standard lockable steel enclosure.
This normally has an added benefit because it will also help ensure that the EMC
characteristics are well within the requirements of the EMC Directive. Although the RF
14 emissions from the PLC equipment, when measured in the open air, are well below the EMC
Directive limits, certain configurations can increase emission levels. Holes in the enclosure,
A for the passage of cables or to mount operator interfaces, will often increase emissions.

B
C
D

G-4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix G: European Union Directives (CE)

AC Mains Filters
DL05, DL205 and DL305 AC powered 1
base power supplies require extra mains
filtering to comply with the EMC
Directive on conducted RF emissions. All Filter
Schaf fner
FN2010
2
PLC equipment has been tested with
filters from Schaffner, which reduce 3
emissions levels if the filters are properly
grounded (earth ground). A filter with a To AC
Input
4
current rating suitable to supply all PLC Transient Circuitry
power supplies and AC input modules
should be selected. We suggest the
Suppressor
G
Fused
FN2010 for DL05/DL205 systems and Terminals
the FN2080 for DL305 systems. DL405
Earth
Terminal 6
systems do not require extra filtering. L N

NOTE: Very few mains filters can reduce problem emissions to negligible levels. In some cases, filters may G
increase conducted emissions if not properly matched to the problem emissions.

Suppression and Fusing


8
In order to comply with the fire risk requirements of the Low Voltage and Machinery
Directive electrical standards EN 61010–1, and EN 60204–1, by limiting the power into
9
“unlimited” mains circuits with power leads reversed, it is necessary to fuse both AC and DC
supply inputs. You should also install a transient voltage suppressor across the power input 10
connections of the PLC. Choose a suppressor such as a metal oxide varistor, with a rating of
275VAC working voltage for 230V nominal supplies (150VAC working voltage for 115V
supplies) and high energy capacity (eg. 140 joules).
11
Transient suppressors must be protected by fuses and the capacity of the transient suppressor
must be greater than the blow characteristics of the fuses or circuit breakers to avoid a fire
12
risk. A recommended AC supply input arrangement for Koyo PLCs is to use twin 3 amp TT
fused terminals with fuse blown indication, such as DINnectors DN–F10L terminals, or twin 13
circuit breakers, wired to a Schaffner FN2010 filter or equivalent, with high energy transient
suppressor soldered directly across the output terminals of the filter. PLC system inputs
should also be protected from voltage impulses by deriving their power from the same fused,
14
filtered, and surge-suppressed supply.
Internal Enclosure Grounding
A
A heavy-duty star earth terminal block should be provided in every cubicle for the connection
of all earth ground straps, protective earth ground connections, mains filter earth ground B
wires, and mechanical assembly earth ground connections. This should be installed to comply
with safety and EMC requirements, local standards, and the requirements found in IEC
1000–5–2.The Machinery Directive also requires that the common terminals of PLC input
C
modules, and common supply side of loads driven from PLC output modules should be
connected to the protective earth ground terminal. D

DL05 Micro PLC User Manual, 5th Edition, 6/04 G-5


Appendix G: European Union Directives (CE)

Equi–potential Grounding
1
2
3
4
G Key
Serial Communication Cable
Equi-potential Bond
Adequate site earth grounding must be provided for equipment containing modern electronic
6 circuitry. The use of isolated earth electrodes for electronic systems is forbidden in some
countries. Make sure you check any requirements for your particular destination. IEC
G 1000–5–2 covers equi-potential bonding of earth grids adequately, but special attention
should be given to apparatus and control cubicles that contain I/O devices, remote I/O racks,
or have inter-system communications with the primary PLC system enclosure. An equi-
8 potential bond wire must be provided alongside all serial communications cables, and to any
separate items of the plant which contain I/O devices connected to the PLC. The diagram
9 shows an example of four physical locations connected by a communications cable.
Communications and Shielded Cables
10 Screened
Conductive
Adapter
Cable
11 Serial
I/O

12
To Earth

13 Block

Equi-potential

14 Bond

Control Cubicle
A
Good quality 24 AWG minimum twisted-pair shielded cables, with overall foil and braid
B shields are recommended for analog cabling and communications cabling outside of the PLC
enclosure. To date it has been a common practice to only provide an earth ground for one end
C of the cable shield in order to minimize the risk of noise caused by earth ground loop currents
between apparatus. The procedure of only grounding one end, which primarily originated as
a result of trying to reduce hum in audio systems, is no longer applicable to the complex
D industrial environment. Shielded cables are also efficient emitters of RF noise from the PLC
system, and can interact in a parasitic manner in networks and between multiple sources of
interference.

G-6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix G: European Union Directives (CE)

The recommendation is to use shielded cables as electrostatic “pipes” between apparatus and systems,
and to run heavy gauge equi-potential bond wires alongside all shielded cables. When a shielded cable 1
runs through the metallic wall of an enclosure or machine, it is recommended in IEC 1000–5–2 that
the shield should be connected over its full perimeter to the wall, preferably using a conducting adapter,
and not via a pigtail wire connection to an earth ground bolt. Shields must be connected to every
2
enclosure wall or machine cover that they pass through.
Analog and RS232 Cables
3
Providing an earth ground for both ends of the shield for analog circuits provides the perfect electrical
environment for the twisted pair cable as the loop consists of signal and return, in a perfectly balanced 4
circuit arrangement, with connection to the common of the input circuitry made at the module
terminals. RS232 cables are handled in the same way. G
Multidrop Cables
RS422 twin twisted pair, and RS485 single twisted pair cables also require a 0V link, which has often 6
been provided in the past by the cable shield. It is now recommended that you use triple twisted pair
cabling for RS422 links, and twin twisted pair cable for RS485 links. This is because the extra pair can
be used as the 0V inter-system link. With loop DC power supplies earth grounded in both systems,
G
earth loops are created in this manner via the inter-system 0v link. The installation guides encourage
earth loops, which are maintained at a low impedance by using heavy equi-potential bond wires. To 8
account for non–European installations using single-end earth grounds, and sites with far from ideal
earth ground characteristics, we recommend the addition of 100 ohm resistors at each 0V link
connection in network and communications cables.
9
10
Last Slave Slave n Master
TXD 0V RXD TXD 0V RXD RXD 0V TXD
+ – + – + – + – + – + –

100 ⏲ 100 ⏲

100 ⏲
Termination

11
Termination

Shielded Cables within Enclosures 12


When you run cables between PLC items within an enclosure which also contains susceptible electronic
equipment from other manufacturers, remember that these cables may be a source of RF emissions.
There are ways to minimize this risk. Standard data cables connecting PLCs and/or operator interfaces
13
should be routed well away from other equipment and their associated cabling. You can make special
serial cables where the cable shield is connected to the enclosure’s earth ground at both ends, the same 14
way as external cables are connected.
Network Isolation A
For safety reasons, it is a specific requirement of the Machinery Directive that a keyswitch must be
provided that isolates any network input signal during maintenance, so that remote commands cannot B
be received that could result in the operation of the machinery. The FA–ISONET does not have a
keyswitch! Use a keylock and switch on your enclosure which when open removes power from the
FA–ISONET. To avoid the introduction of noise into the system, any keyswitch assembly should be
C
housed in its own earth grounded steel box and the integrity of the shielded cable must be maintained.
Again, for further information on EU directives we recommend that you get a copy of our EU
D
Installation Manual (DA–EU–M). Also, if you are connected to the World Wide Web, you can check
the EU Commision’s official site at: http://eur–op.eu.int/

DL05 Micro PLC User Manual, 5th Edition, 6/04 G-7


Appendix G: European Union Directives (CE)

DC Powered Versions
1 Due to slightly higher emissions radiated by the DC powered versions of the DL05, and the
differing emissions performance for different DC supply voltages, the following stipulations
2 must be met:
• The PLC must be housed within a metallic enclosure with a minimum amount of orifices.
3 • The communication cable and all I/O cables must pass through suitable ferrite beads which must be
mounted within the enclosure. The I/O cables can be bundled together and passed through the
same ferrite.
4 Recommended ferrite beads and split cores are detailed below. These were used in extensive
EMC tests and found to successfully attenuate radiated emissions to a high degree.
G
6 For I/O Bundle

G 1 Turn 1 Turn
Manufacturer Mfg. Part No. OD mm ID mm L mm L/25 MHz ⏲ L/100 MHz⏲
2 Turn
⏲ L/25 MHz⏲
2 Turn
⏲ L/100 MHz ⏲

8 RS Online 260–6795 17.5 9.5 28.5 153 210 649 632

Fair–Rite 2643665702 17.5 9.5 28.5 153 210 649 632


9 Wurth Elektronik 742 700 9 17.5 9.5 28.5 153 210 649 632

10
11 For Communication Cable

12 1 Turn 1 Turn
Manufacturer Mfg. Part No. OD mm ID mm L mm L/25 MHz ⏲ L/100 MHz⏲
2 Turn
⏲ L/25 MHz⏲
2 Turn
⏲ L/100 MHz ⏲

13 RS Online 222–4416 26.6 N/A 16.6 72 132 301 547

Fair–Rite 0444167281 26.6 10.7 16.6 72 132 301 547


14 Richco MTFC 231114–T 26.6 10.7 16.6 72 132 301 547

A
B
C
D

G-8 DL05 Micro PLC User Manual, 5th Edition, 6/04


Appendix G: European Union Directives (CE)

Items Specific to the DL05


• The rating between all circuits in this product are rated as basic insulation only, as appropriate for 1
single fault conditions.
• There is no isolation offered between the PLC and the analog inputs of this product. 2
• It is the responsibility of the system designer to earth one side of all control and power circuits, and
to earth the braid of screened cables.
• This equipment must be properly installed while adhering to the guidelines of the in house PLC
3
installation manual DA–EU–M, and the installation standards IEC 1000–5–1, IEC 1000–5–2 and
IEC 1131–4. 4
• It is a requirement that all PLC equipment must be housed in a protective steel enclosure, which
limits access to operators by a lock and power breaker. If access is required by operators or untrained
personnel, the equipment must be installed inside an internal cover or secondary enclosure.
G
• It should be noted that the safety requirements of the machinery directive standard EN60204–1
state that all equipment power circuits must be wired through isolation transformers or isolating
6
power supplies, and that one side of all AC or DC control circuits must be earthed.
• Both power input connections to the PLC must be separately fused using 3 amp T type anti–surge G
fuses, and a transient suppressor fitted to limit supply overvoltages.
• If the user is made aware by notice in the documentation that if the equipment is used in a manner
not specified by the manufacturer the protection provided by the equipment may be impaired.
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 5th Edition, 6/04 G-9


INDEX

A And Store Instruction, 5–15


ASCII Constant Instruction, 5–112
Accessing AUX Functions ASCII to HEX Instruction, 5–90
via direct entry, A–3 Auxiliary Functions, 4–8, A–2
via DirectSOFT32, A–3 AUX 2* — RLL Operations, A–4
via the Handheld Programmer, A–3 AUX 3* — V-memory Operations, A–2, A–4
Accumulating Fast Timer Instruction, 5–38 AUX 4* — I/O Configuration, A–2, A–4
Accumulating Timer Instruction, 5–38 AUX 5* — CPU Configuration, A–5
Accumulator / Stack Load Instructions, 5–48 AUX 6* — Handheld Programmer
Add Binary Instruction, 5–78 Configuration, A–2, A–8
Add Double Instruction, 5–69 AUX 7* — EEPROM Operations, A–2, A–8
Add Instruction, 5–68 AUX 8* — Password Operations, A–2, A–9
Agency Approvals, 2–9
Alarms, PID, 8–53
B
And (Logical) Instructions, 5–60 Binary Coded Decimal Instruction, 5–88
Comparative, 5–30 Binary Instruction, 5–87
And Bit-of-Word instruction, 5–14 Bit Operation Instructions, 5–82
And Comparative Instruction, 5–30 Boolean Instructions, 5–4, 5–9
And Double Instruction, 5–61 Bumpless Transfers, 8–25
And If Equal Instruction, 5–27
And If Not Equal Instruction, 5–27 C
And Immediate instruction, 5–32 Cables
And Instruction, 5–13 operator interface, 2–14
And Negative Differential Instruction, 5–21 Programming Device, 2–14
And Not Bit-of-Word instruction, 5–14 Cascade Control, 8–51
And Not Immediate Instruction, 5–32 Common Terminals, 2–16
And Not Instruction, 5–13 Communication Ports, 1–13
Comparative, 5–30 Communication Ports Specifications, 4–33
And Positive Differential Instruction, 5–21 pinout diagrams, 4–4
Index

Communications Problems, 9–7 CPU Scan Time, 4–18


Comparative Boolean Instructions, 5–25
Compare Double Instruction, 5–67 D
Compare Instruction, 5–66 Data Label Instruction, 5–112
Components, 1–6 Example, 5–113
Configuring, 3–5 Decode Instruction, 5–86
Connections Decrement Binary Instruction, 5–77
Power input, 1–8 Decrement Instruction, 5–76
Programming Devices, 1–8 Derivative Terms, 8–34
Connector Designing a Successful System, 1–10
Common Terminal Concepts, 2–16 Diagnostics, 9–2
Connector Removal, 2–5 Dimensions, 2–6
Diagram, 2–16
DIN Rail Mounting Rails, 2–8
Control Output, 8–29
Direct-Acting Loop, 8–33
Control Relay Bit Map, 4–31
DirectNET, 4–36
Converge Jump Instruction, 7–23
Disable Interrupts Instruction, 5–109
Converge Stage, 7–23
Divide Binary Instruction, 5–81
Converge Stage Instruction, 7–23
Divide Double Instruction, 5–75
Convergence Jump, 7–20
Divide Instruction, 5–74
Convergence Stages, 7–19
DL05 Micro PLC
Converting Number Formats Environmental Specifications, 2–9
ASCII to HEX (ATH), 5–90 Front Panel, 2–4, 2–6
HEX to ASCII (HTA), 5–91 Panel Layout & Clearances, 2–7
Counter Instruction, 5–41 DL05 Micro PLC Error Codes, 9–4
Counter Status Bit Map, 4–32 Drum Instruction, 6–2, 6–12
CPU Chart Representation, 6–3
Changing Modes, 4–7 Counter Assignments, 6–6
Features, 4–2 Drum Control Techniques, 6–10
Hardware Setup, 4–4 Event Drum, 6–14
Mode Switch, 4–6 Event-Only Transitions, 6–6
Operation, 4–11 Handheld Programmer Mnemonics, 6–16
Specificatons, 4–3 Last Step Completion, 6–7
Status Indicators, 4–6 Output Sequences, 6–3
CPU Configuration, A–2, A–5 Overview of Drum Operation, 6–8
CPU Control Instructions, 5–99 Powerup State, 6–9
CPU Indicators, 9–1, 9–6 Self-Resetting, 6–11

1–2 DL05 Micro PLC User Manual, 5th Edition, 6/04


Index

Step Transitions, 6–4 Discrete Inputs with Filter, 3–52


Timed Drum with Discrete Outputs, 6–12 Features, 3–2
High-Speed Counter, 3–6
E High-Speed Interrupts, 3–44
Emergency Stop, 2–3 I/O points usage, 3–4
Modes, 3–4
Enable Interrupts Instruction, 5–108
Programming, 3–11
Encode Instruction, 5–85
Pulse Catch Input, 3–49
END Instruction, 5–4, 5–99
Pulse Output, 3–24
Equal Relays
Error Codes I
Pulse Output, 3–42
Error Codes Lisiting, B–2 I/O Response Time, 4–15
Error Term, 8–30 I/O Selection Quick Chart, 1–5
European Union (EU) Directives, G-2 Increment Binary Instruction, 5–77
Exclusive Or Double Instruction, 5–65 Increment Instruction, 5–76
Exclusive Or Instruction, 5–64 Initial Stage Instruction, 7–22
Execution Times, C–2 Instruction, 6–16
Drum, 6–2, 6–12
F Instruction Execution Times, C–3
Accumulator Data Instructions, C–11
Fatal Errors, 9–2
Bit Instructions, C–14
Fault, 5–111 Boolean Instructions, C–3
Feedforward Control, 8–47 Comparative Boolean Instructions, C–4
For / Next Instruction, 5–101 CPU Control Instructions, C–15
Fuse Protection, 2–10 Drum Instructions, C–16
Immediate Instructions, C–10
G Interrupt Instructions, C–15
Goto Subroutine, 5–103 Logical Instructions, C–12
Gray Code Instruction, 5–93 Math Instructions, C–12
Message Instructions, C–16
H Network Instructions, C–15
Number Conversion Instructions, C–14
Handheld Programmer, A–3, A–8, A–9
Program Control Instructions, C–15
EEPROM Operations, A–2, A–8
RLL plus Instructions, C–16
HEX to ASCII Instruction, 5–91 Table Instructions, C–14
High- Speed I/O Timer, Counter and Shift Register, C–10
Configuring, 3–5 Word Bit Instructions, C–17

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–3


Index

Instruction List, 5–2 Load Address Instruction, 5–56


Instructions, 9–12 Load Double Instruction, 5–54
accumulator/stack load, 5–48 Load Formatted Instruction, 5–55
Bit Operation, 5–82 Load Instruction, 5–53
Boolean, 5–4 Load Label Instruction, 5–97
Capable of Run Time Edit, 9–14 Logical Instructions, 5–60
Comparative Boolean, 5–25 Loop Tuning Procedure
CPU Control, 5–99 Auto Tuning, 8–38
Immediate, 5–31 Manual Tuning, 8–39
Interrupt, 5–109
Logical, 5–60 M
Math, 5–68
Maintenance, 9–2
Message, 5–114
Network, 5–118 Manual organization, 1–2
Number Conversion, 5–87 Master Line Reset Instruction, 5–106
Program Control, 5–101 Master Line Set Instruction, 5–106
Stage, 7–21 Math Instructions, 5–68
Stage Programming, 7–2 Memory, 1–2
Table, 5–96 EEPROM, 1–12
Timer/Counter/Shift Register Instructions, FLASH, 1–12
5–35 Memory Cartridge, 10–2
Integral Term, 8–34 Battery Back-up, 10–11
Interrupt Instruction, 5–108 Clock/Calendar Instructions, 10–13
Interrupt Return Conditional Instruction, 5–108 Error Codes, 10–18
Interrupt Return Instruction, 5–108 Firmware Upgrade, 10–5
Interrupts, 3–47, 5–108 Move Memory Cartridge instruction, 10–15
Disable, 5–109 Naming Cartridge, 10–6
External, 3–46, 5–109 Write Enable/Disable Jumper, 10–3
High-Speed, 3–44 Memory Map, 4–22
Timed, 3–46 Table, 4–28
Timed Interrupt Program Example, 5–110 Message Instruction, 5–114
Invert, 5–89 MODBUS, 4–35
MODBUS Address Table, 4–40
J Mode of Operation
at Power-up, 4–7
Jump Instruction, 7–7, 7–22
Changing, 4–7
L Mode Switch Functions, 4–6

1–4 DL05 Micro PLC User Manual, 5th Edition, 6/04


Index

Motion Control Profile, 3–27 Or Instruction (comparative), 5–29


Mounting Guidelines, 2–6 Or Logical Instruction, 5–62
Using Mounting Rails, 2–8 Or Negative Differential Instruction, 5–20
Mounting Rail, 2–8 Or Not Bit-of-Word instruction, 5–12
Move Instruction, 5–96 Or Not Immediate Instruction, 5–31
Move Memory Cartridge Instruction, 5–97 Or Not Instruction, 5–11
Multiply Binary Instruction, 5–80 Or Not Instruction (comparative), 5–29
Multiply Double Instruction, 5–73 Or Out Immediate Instruction, 5–33
Multiply Instruction, 5–72 Or Out Instruction, 5–16
Or Positive Differential Instruction, 5–20
N Or Store, 5–15
Network Configuration and Connections, 4–33 Out, 5–16
Networking Diagrams, 4–34 Out Bit-of-Word, 5–17
Network Instructions, 5–118 Out Double Instruction, 5–57
Network Master Operation, 4–43 Out Formatted Instruction, 5–58
Network Slave Operation, 4–37 Out Immediate Instruction, 5–33
NEXT Instruction, 5–101 Out Instruction, 5–57
No Operation Instruction, 5–99 Output Data Instructions, 5–48
Non-fatal Errors, 9–2
Normally Closed Contact, 5–4
P
Not Instruction, 5–18 Panel Layout, 2–7
Not Jump Instruction, 7–22 Wiring, 2–3
Number Conversion Instructions, 5–87 Parallel Processing Concepts
Numbering Systems, 4–20 Converging Processes, 7–19
Numerical Constant Instruction, 5–112 Parallel Processes, 7–19
Part Number, 1–4, 1–5
O Password, 4–10
On/Off Control, 8–50 AUX 8*, A-9
One Shot Instruction, 5–18 Pause Instruction, 5–24
Or Bit-of-Word instruction, 5–12 PID
Or Double Instruction, 5–63 Algorithms, 8–31
Basic Loop Operation, 8–19
Or If Equal Instruction, 5–26
Bias Freeze, 8–37
Or If Not Equal Instruction, 5–26
Bibliography, 8–63
OR Immediate Instruction, 5–31, 5–32
Cascade Control, 8–51
Or Instruction, 5–11
Data Configuration, 8–26

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–5


Index

Feedforward control, 8–47 Stage programming, 1–11


Main Features, 8–2 Programming Methods, 1–4
On/Off Control, 8–50 DirectSOFT Programming for Windows™,
Process Alarms, 8–53 1–4
Ramp / Soak generator, 8–57 Handheld Programmer, 1–5
Sample Rates, 8–13
Scheduling, 8–13 Q
Setup Parameters, 8–6 Quick Start, 1–6
Terminology, 8–4, 8–64
Troubleshooting Tips, 8–62 R
Tuning Procedure, 8–38
Ramp Soak , 8–34
PLC Numbering Systems, 4–20
Ramp/Soak Generator, 8–57
POP instruction, 5–58
Read from Network Instruction, 5–118
Position Algorithm, 8–31
Registration Profile, 3–34
Positive Differential Instruction, 5–18
Relay Output Wiring Methods, 2–19, PB 2–19
Power Indicator, 9–6
Prolonging Relay Contact Life, 2–21
Presets
Surge Suppresion For Inductive Loads, 2–20
Calculating Values, 3–10
Reset Bit-of-Word instruction, 5–23
Starting Location, 3–9
Reset Immediate Instruction, 5–34
Print Message Instruction, 5–114
Reset Instruction, 5–22
Process Control, 8–17
Reset Watch Dog Timer Instruction, 5–100
Product Weight Table, E–2
Retentive Memory Ranges, 4–9
Profile, 3–29
Home Search, 3–37 Reverse-Acting Loop , 8–33
Motion Control, 3–27 RUN Indicator, 9–7
Registration, 3–29 Run Mode, 4–12
Trapezoidal, 3–29, 3–31 Run Time Edits, 9–14
Velocity, 3–29, 3–39
Program Control Instructions, 5–101
S
Program Error Codes, 9–5 Safety Guidelines, 2–2
Error Code Locations, 9–3 Scratchpad Memory, 1–9
Program Execution Time, 4–19 Set Bit-of-Word instruction, 5–23
Application Program Execution Formula, 4–19 Set Immediate Instruction, 5–34
Program Mode, 4–12 Set Instruction, 5–22
Programming Concepts, 1–11 Setpoint, 8–27
Drum Sequencer Programming, 1–11 Shift Register Instructions, 5–35
RLL diagram-style programming, 1–11

1–6 DL05 Micro PLC User Manual, 5th Edition, 6/04


Index

Shift Register (SR), 5–47 Stage View, 7–18


Shift Right Instruction, 5–84 State Diagrams, 7–3
Shuffle Digits Instruction, 5–94 Supervisory Process, 7–17
Sinking / Sourcing Concepts, 2–15 Timer Inside a Stage, 7–13
Special Relays, 3–8, D–1, D–2, D–3, D–4 Standard Maintenance, 9–2
Relay Wiring, D–1, D–2, D–3, D–4 Status Indicators, 4–6
Special Relays (SP) Corresponding to Error Codes, Stop Instruction, 5–99
9–3 Store Bit-of-Word instruction, 5–10
Specifications, 2–10 Store If Equal Instruction, 5–25
D0–05AA, 2–34 Store If Not Equal Instruction, 5–25
D0–05AD, 2–30 Store Immediate Instruction, 5–31
D0–05AR, 2–26 Store Instruction, 5–9
D0–05DA, 2–36 Store Instruction (comparative), 5–28
D0–05DD, 2–32 Store Negative Differential Instruction, 5–19
D0–05DD–D, 2–40
Store Not Immediate Instruction, 5–31
D0–05DR, 2–28
Store Not Instruction, 5–9
D0–05DR–D, 2–38
Store Not Bit-of-Word Instruction, 5–10
Environmental, 2–9
Store Not Instruction (comparative), 5–28
Input Power, 2–11
Store Positive Differential Instruction, 5–19
Stage Control / Status Bit Map, 4–30
Subroutine Return Conditional Instruction, 5–103
Stage Counter Instruction, 5–43
Subroutine Return Instruction, 5–103
Stage Instruction, 7–21
Subtract Binary Instruction, 5–79
Stage Programming
Subtract Double Instruction, 5–71
Convergence, 7–19
Emergency Stop, 7–14 Subtract Instruction, 5–70
Exclusive Transitions, 7–14 Sum Instruction, 5–82
Four Steps to Writing a Stage Program, 7–9 System Power, 1–9
Garage Door Opener Example, 7–10 System V-memory, 4–26
Initial Stage, 7–5
Introduction, 7–2
T
Jump Instruction, 7–7 Table Instructions, 5–96
Parallel Processing Concepts, 7–19 Technical Support, 1–2
Parallel States, 7–12 Time-Proportioning Control, 8–49
Power Flow Transition, 7–18 Timer Fast Instruction, 5–36
Program Organization, 7–15
Timer Instruction, 5–36
Questions and Answers, 7–25
Timer Status Bit Map, 4–32
Stage Instruction Characteristics, 7–6
Trapezoidal Profile, 3–30, 3–32

DL05 Micro PLC User Manual, 5th Edition, 6/04 1–7


Index

Troubleshooting
Communications, 9–7
Debug Special Instructions, 9–12
Electrical Noise, 9–10
I/O Point, 9–8
Program debug, 9–11
Troubleshooting Guide, 3–23
HSIO Mode 20, 3–23
HSIO Mode 30, 3–42

U
Up Down Counter Instruction, 5–45
Using Pointers, 5–51

V
Velocity Algorithm, 8–32
Velocity Profile, 3–30, 3–40
V-memory, 4–26, F-2, F-3
V-memory Error Code Locations, 9–3

W
Website, 1–2
Wiring, 1–12, 2–10
Counter Outputs, 3–7
Encoder, 3–3
DC Input Wiring Methods, 2–22
DC Output Wiring Methods, 2–23
Drive Inputs, 3–26
Emergency Stop, 2–3
External Power Source, 2–11
Fuse Protection, 2–12
High Speed I/O Wiring Method, 2–24
Input Power, 2–10
Power Input, 1–9
Write to Network Instruction, 5–120

1–8 DL05 Micro PLC User Manual, 5th Edition, 6/04

Potrebbero piacerti anche