Hand-Held Terminal: (Catalog Number 1747-PT1)
Hand-Held Terminal: (Catalog Number 1747-PT1)
Hand-Held Terminal
(Catalog Number 1747–PT1)
User Manual
Important User Information Solid state equipment has operational characteristics differing from those of
electromechanical equipment. “Safety Guidelines for the Application,
Installation and Maintenance of Solid State Controls” (Publication SGI-1.1)
describes some important differences between solid state equipment and
hard–wired electromechanical devices. Because of this difference, and also
because of the wide variety of uses for solid state equipment, all persons
responsible for applying this equipment must satisfy themselves that each
intended application of this equipment is acceptable.
The examples and diagrams in this manual are included solely for illustrative
purposes. Because of the many variables and requirements associated with
any particular installation, the Allen-Bradley Company cannot assume
responsibility or liability for actual use based on the examples and diagrams.
PLC, PLC 2, PLC 3, and PLC 5 are registered trademarks of Allen-Bradley Company, Inc.
SLC, SLC 100, SLC 500, SLC 5/01, SLC 5/02, PanelView, RediPANEL, and Dataliner are trademarks of Allen-Bradley Company, Inc.
IBM is a registered trademark of International Business Machines, Incorporated.
Summary of Changes
Summary of Changes
The information below summarizes the changes to this manual since the last
printing as 1747–809 in July 1989, which included the supplement
40063–079–01(A) from October 1990.
New Information The table below lists sections that document new features and additional
information about existing features, and shows where to find this new
information.
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-1
Who Should Use this Manual . . . . . . . . . . . . . . . . . . . . . . . P-1
Purpose of this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-1
Contents of this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . P-2
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . P-4
Common Techniques Used in this Manual . . . . . . . . . . . . . . P-4
Allen-Bradley Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-5
Local Product Support . . . . . . . . . . . . . . . . . . . . . . . . . . P-5
Technical Product Assistance . . . . . . . . . . . . . . . . . . . . . P-5
Your Questions or Comments on this Manual . . . . . . . . . . P-5
Option 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
Option 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
Monitoring a Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
Data File Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
Output File (O0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
Input File (I1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
Status Data File (S2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-6
Bit Data File (B3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
Timer Data File (T4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
Counter Data File (C5) . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8
Control Data File (R6) . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
Integer Data File (N7) . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
Online Data Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9
A–B
Preface
Read this preface to familiarize yourself with the rest of the manual. This
preface covers the following topics:
• who should use this manual
• the purpose of this manual
• conventions used in this manual
• Allen–Bradley support
Who Should Use this Manual Use this manual if you are responsible for designing, installing,
programming, or troubleshooting control systems that use Allen–Bradley
small logic controllers.
You should have a basic understanding of SLC 500 products. If you do not,
contact your local Allen–Bradley representative for information on available
training courses before using this product.
We recommend that you review The Getting Started Guide for HHT, catalog
number 1747–NM009 before using the Hand–Held Terminal (HHT).
Purpose of this Manual This manual is a reference guide for technical personnel who use the
Hand–Held Terminal (HHT) to develop control applications. It describes
those procedures in which you may use an HHT to program an SLC 500
controller.
This manual:
• explains memory organization and instruction addressing
• covers status file functions and individual instructions
• gives you an overview of ladder programming
• explains the procedures you need to effectively use the HHT
P–1
Preface
P–2
Preface
P–3
Preface
Related Documentation
The following documents contain additional information concerning
Allen–Bradley SLC and PLC products. To obtain a copy, contact your local
Allen–Bradley office or distributor.
Document
For Read this Document
Number
An overview of the SLC 500 family of products SLC 500 System Overview 1747-2.30
A description on how to install and use your Modular SLC 500 Installation & Operation Manual for Modular Hardware
1747-NI002
programmable controller Style Programmable Controllers
A description on how to install and use your Fixed SLC 500 Installation & Operation Manual for Fixed Hardware Style
1747-NI001
programmable controller Programmable Controllers
A procedural manual for technical personnel who use APS to develop Allen-Bradley Advanced Programming Software (APS)
1747-NM002
control applications User Manual
A reference manual that contains status file data, instruction set, and Allen-Bradley Advanced Programming Software (APS)
1747-NR001
troubleshooting information about APS Reference Manual
An introduction to APS for first-time users, containing basic concepts but
focusing on simple tasks and exercises, and allowing the reader to begin Getting Started Guide for APS 1747-NM001
programming in the shortest time possible
A procedural and reference manual for technical personnel who use the
APS import/export utility to convert APS files to ASCII and conversely APS Import/Export User Manual 1747-NM006
ASCII to APS files
An introduction to HHT for first-time users, containing basic concepts but
focusing on simple tasks and exercises, and allowing the reader to begin Getting Started Guide for HHT 1747-NM009
programming in the shortest time possible
A complete listing of current Automation Group documentation, including
ordering instructions. Also indicates whether the documents are Automation Group Publication Index SD499
available on CD-ROM or in multi-languages.
A glossary of industrial automation terms and abbreviations Allen-Bradley Industrial Automation Glossary ICCG-7.1
Common Techniques Used in The following conventions are used throughout this manual:
this Manual • Bulleted lists such as this one provide information, not procedural steps.
• Numbered lists provide sequential steps or hierarchical information.
• Italic type is used for emphasis.
• Text in this font indicates words or phrases you should type.
• Key names match the names shown and appear in bold, capital letters
within brackets (for example, [ENTER]).
P–4
Preface
Allen-Bradley Support Allen–Bradley offers support services worldwide, with over 75 Sales/Support
Offices, 512 authorized Distributors and 260 authorized Systems Integrators
located throughout the United States alone, plus Allen–Bradley
representatives in every major country in the world.
If you find a problem with this manual, please notify us of it on the enclosed
Publication Problem Report.
P–5
Chapter
1
Features, Installation, Powerup
Specifications:
Environmental conditions
Operating temperature 0 to +40° C (+32° to +104° F)
Storage temperature -20° to +65° C (-4° to +149° F)
Humidity rating 5 to 95% (non-condensing)
Display 8 line x 40 character super-twist nematic LCD
Keyboard 30 keys
Operating Power 0.105 Amps (max.) at 24 VDC
Communications DH-485
Certification UL listed, CSA approved
Memory Retention with Battery 2 years
Fixed, SLC 5/01, SLC 5/02
Compatibility
Not SLC 5/03
201.0 mm H x 193.0 mm W x 50.8 D
Dimensions
(7.9 in H x 7.6 in W x 2.0 in D)
1–1
Chapter 1
Features, Installation, Powerup
Display Area
1747 - PTA1E
Allen-Bradley Company Copyright 1990
All Rights Reserved
PRESS A FUNCTION KEY OFL
SELFTEST TERM PROGMAINT UTILITY
F1 F2 F3 F4 F5
F1 F2 F3 F4 F5
Calculator-style,
Color-coded Keyboard N S I O
ESC
PRE/LEN ACC/POS U SPACE
A B C
7 8 9
# - . SHIFT
0 : / ENTER
1–2
Chapter 1
Features, Installation, Powerup
Installing the Memory Pak, The HHT (with communication cable), memory pak, and battery are supplied
Battery, and Communication separately. Install each as follows:
Cable
1. Install the memory pak first. The English version is catalog number
1747–PTA1E.
a. To install the memory pak, remove the cover from the back of the
HHT.
Backside of HHT
1–3
Chapter 1
Features, Installation, Powerup
Backside of HHT
1–4
Chapter 1
Features, Installation, Powerup
a. Remove the jumper from the battery socket, then connect the battery
as shown in the figure below:
Battery Compartment
.
.
Plug battery connector
into socket (red wire up).
Secure battery
between clips.
Backside of HHT
1–5
Chapter 1
Features, Installation, Powerup
(Peripheral Port)
(Cover Open)
(Communication Port)
1747-C10 Cable
SLC Controller
(Modular)
HHT
1–6
Chapter 1
Features, Installation, Powerup
HHT Powerup After you install the memory pak and battery, and plug in the cable, you can
test the operation of the HHT by applying power to the SLC 500 controller
or plugging in the external power supply such as the 1747–NP1 or –NP2.
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
If any of the tests fail, the failure is indicated by the appropriate message on
the display. For a detailed list of HHT messages and error definitions, refer
to appendix A in this manual.
After powerup, you may perform any of five diagnostic tests using the
selftest function. Press [F1], SELFTEST. The following display appears:
OFL
DISPLAY KEYPAD RAM ROM WTCHDOG
F1 F2 F3 F4 F5
From this menu, you may choose the test you wish to perform. Press [ESC]
to return to the previous screen.
1–7
Chapter 1
Features, Installation, Powerup
HHT Display Format The HHT display format consists of the following:
• display area
• prompt/data entry/error message area
• menu tree functions
The figure below indicates what appears in these areas. To access this
particular screen, press [F3], PROGMAINT.
1–8
Chapter 1
Features, Installation, Powerup
The Keyboard This section is intended only as a brief preview of keyboard operation.
F1 F2 F3 F4 F5
Starting in chapter 6, you will become familiar with the keyboard as you are
guided through various programming procedures.
N S I O
PRE/LEN ACC/POS U SPACE ESC
A
7
B
8
C
9
Menu Function Keys (F1, F2, F3, F4, F5)
D
4
E
5
F
6
The top row of purple keys, F1 through F5, are menu function keys. They
select the menu functions shown on the bottom line of the display. Note that
T R M when the > symbol is present, the [ENTER] key will toggle additional menu
1 2 3 RUNG ZOOM
functions (if any) at a particular menu level. The [ESC] key exits the display
# - . SHIFT
0 : / ENTER to the previous menu level.
To obtain the upper function of a key, press and release the [SHIFT] key,
then press the desired key.
If you make an error while entering data, press [ESC] and re–enter the data,
or use the cursor (arrow) keys and/or the [SPACE] key to locate and correct
the error. To complete a data entry, press [ENTER]. You can also use the
[ESC] key to exit the data entry and return to the previous menu level.
Auto Shift
When you enter an instruction address, the HHT automatically goes to
SHIFT mode to enable you to enter the upper function of a key without first
pressing the [SHIFT] key. This mode is indicated by a small arrow in the
bottom right hand corner of the display.
F1 F2 F3 F4 F5
1–9
Chapter 1
Features, Installation, Powerup
Cursor Keys , , ,
1–10
Chapter 1
Features, Installation, Powerup
Address 15 data 0
B3:0 0010 0011 0100 1111
B3:1 1000 0010 0000 0000
The keys B3:2 0000 0000 1110 0000
move the cursor left, right, B3:3 0000 0000 0100 0000
up and down in a data file B3:4 0101 1101 0100 1000
display. B3/31 = 1 RUN
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
1–11
Chapter 1
Features, Installation, Powerup
The [RUNG] key moves the cursor to a particular rung. Using this key saves
time when you have a long ladder diagram. When you press [RUNG], you are
prompted for the rung number that you want to edit or monitor. Enter the
rung number and press [ENTER], the cursor moves to the selected rung and
the rung appears at the top of the display.
TON:T4:2 2.2.0.0.2
] [ (TON)
] [ ( )
] [ ( )
] [ ( )
] [ ( )
Press the [ZOOM] key
OFL
with the cursor on an
INS RNG MOD RNG SEARCH DEL RNG UND RNG >
instruction. The Zoom
F1 F2 F3 F4 F5 display shows the
instruction parameters.
EDT_DAT
F1 F2 F3 F4 F5
TON:T4:2 2.6.0.0.*
] [ (TON)
] [ ( )
] [ ( )
] [ ( )
] [ ( )
OFL
Press [RUNG][6][ENTER]. INS RNG MOD RNG SEARCH DEL RNG UND RNG >
The cursor moves from the Timer F1 F2 F3 F4 F5
rung to the left power rail of rung 6.
1–12
Chapter
2
The Menu Tree
This chapter guides you through the HHT display menu tree. It is intended
as an overview. For a more detailed introduction to ladder programming,
refer to The Getting Started Guide for HHT, catalog number 1747–NM009.
Using the HHT Menu Before you begin using the HHT to develop a user program or communicate
online, you should be familiar with the following:
1. For example, to clear the HHT memory, start from the Main menu.
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
OFL
CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP >
F1 F2 F3 F4 F5
2–1
Chapter 2
The Menu Tree
OFL
EDT_DAT SEL_PRO EDT_I/O CLR_MEM >
F1 F2 F3 F4 F5
2. Press [F4], CLR_MEM to clear the HHT memory. You are asked to
confirm:
3. Press [F2], YES. This deletes the current program in the HHT. After
you confirm, the display returns to the previous menu.
OFL
EDT_DAT SEL_PRO EDT_I/O CLR_MEM >
F1 F2 F3 F4 F5
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
2–2
Chapter 2
The Menu Tree
The Main Menu After going through diagnostic tests at startup/powerup, the HHT displays
the Main menu. It consists of the following function keys:
• Selftest
• Terminal
• Program Maintenance
• Utility
The display appears as follows:
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
Main Menu Functions Some of the procedures you may perform from the Main menu are:
SELFTEST, [F1]
Allows you to test the following components of the HHT:
• display
• keypad
• random access memory
• read only memory
• internal watchdog timer
TERMINAL, [F2]
Allows you to:
• configure the HHT for IMC 110 mode (when attached to a
1746–HS module)
• monitor and debug MML programs
2–3
Chapter 2
The Menu Tree
UTILITY, [F5]
Allows you to:
• attach online to a processor
– upload and download programs between the processor and HHT
– change processor mode
– transfer processor memory between RAM and EEPROM
– force inputs and outputs
• access network diagnostic functions
• create or delete processor passwords
• clear processor memory
• monitor the ladder diagram while the processor is in Run mode
The Menu Tree The figures that follow, graphically guide you through the HHT menus and
sub–menus.
Main Menu
F1 SELFTEST F1 DISPLAY
F2 KEYPAD
F3 RAM F2 DSTRUCT
F4 ROM F4 NONDEST
F5 WTCHDOG
F2 TERM
2–4
Chapter 2
The Menu Tree
F2 CRT_FIL F4 FILE
F3 EDT_FIL F1 INS_RNG_
F1 INS_INST
See next
page.
F2 MOD_RNG
F2 BRANCH F1 EXT_UP
F3 SEARCH F1 CUR-INS
F2 EXT_DWN
F4 DEL_RNG F2 CUR-OPD
F3 APP_BR
F5 UND_RNG
F4 INS_BR
F5 DEL_BR
F3 NEW-INS
F4 UP F3 MOD_INST
ENTER
F5 FORCE F5 ACP_RNG
F1 EDT_DAT F1 ADDRESS
ENTER
F4 SAVE_CT F2 NEXT_FL
F2 DEL_DT F5 PREV_PG
F3 NEXT_PG
ENTER F4 PREV_PG
F5 PRG_SIZE
F1 EDT_DAT F1 ADDRESS
F2 NEXT_FL
F3 PREV_FL
F4 NEXT_PG
F5 PREV_PG
F2 SEL_PRO F1 TYPE
F3 SERIES
F2 RACK 2
F3 RACK 3
F2 MOD_SLT F3 OTHER
F3 DEL_SLT
F4 UND_SLT
F5 ADV_SET F1 INT_SBR
2–5
Chapter 2
The Menu Tree
See previous
page. F1 BIT F1 -] [-
F2 TMR/CNT F1 TON F2 -] / [-
F3 LEQ F4 SVC
F4 GEQ F5 OTHERS
F5 OTHERS
F5 CPT/MTH F1 ADD
F2 SUB
F3 MUL
ENTER F4 DIV
F5 DDV
ENTER
F1 MOV/LOG F1 MOV
F4 RET F5 SQO
ENTER
F5 MCR
F2 DCD
ENTER
F3 SCL
F1 SBR F4 PID
F2 INT F5 OTHERS
F3 STE ENTER
ENTER
F4 STS
F1 FFL
F1 NOT
F5 STD
F2 FFU
F5 OTHERS
ENTER F3 LFL
F5 OTHERS
F4 LFU
F3 SUS
F5 OTHERS
F4 TND
F5 OTHERS
2–6
Chapter 2
The Menu Tree
F5 NETWORK F5 RESET
F3
*
ATTACH F1 OFFLINE
F2 DWNLOAD
F3 CLR_PRC
F4 MEM_PRC
F4 NODE_CFG F1 CHG_ADR
F2 MAX_ADR
F3 BAUD F1 19200
F5 CLR_OWNR F3 2400
F2 WHO F4 1200
F3 PASSWRD F1 ENT
F2 REM
F3 ENT_MAS
F4 REM_MAS
F5 CLR_MEM
Main Menu - Utility [F5], Default Program in Processor (If Previously Attached to that Processor)
F2 DWNLOAD
F3 CLR_PRC
F4 MEM_PRC
F5 NETWORK F5 RESET
*
F3 ATTACH F1 OFFLINE
F2 DWNLOAD
F3 CLR_PRC
F4 MEM_PRC
F4 NODE_CFG F1 CHG_ADR
F2 MAX_ADR
Legend
F3 BAUD F1 19200
2–7
Chapter 2
The Menu Tree
Main Menu - Utility [F5], Processor Program Does Not Equal HHT Program (First Time)
F5 NETWORK F5 RESET
F3
*
ATTACH F1 OFFLINE
F2 UPLOAD
F3 DWNLOAD
F4 MODE F1 RUN
F2 MAX_ADR
F3 BAUD F1 19200
F3 ENT_MAS
F4 REM_MAS
F5 CLR_MEM
Main Menu - Utility [F5], Processor Program Does Not Equal HHT Program (If Previously Attached to that Processor)
F2 UPLOAD
F3 DWNLOAD
F4 MODE F1 RUN •
F5 CLR_PRC F3 TEST • F2 CONT
F5 PROGRAM • F4 SINGLE
F5 NETWORK F5 RESET
*
F3 ATTACH F1 OFFLINE
F2 UPLOAD
F3 DWNLOAD
F4 MODE F1 RUN
F2 MAX_ADR
F3 BAUD F1 19200
F5 OWNER F1 SET_OWNR
F2 9600
F3 PASSWRD F1 ENT F5 CLR_OWNR
F3 2400
F2 REM
F4 1200
F3 ENT_MAS
F4 REM_MAS
F5 CLR_MEM
2–8
Chapter 2
The Menu Tree
Main Menu - Utility [F5], Processor Program Equals HHT Program (First Time)
Legend
F5 UTILITY F1 ONLINE F1 DIAGNSTC F1 NODE Modular controllers only
F5 NETWORK F5 RESET SLC 5/02 only
F3 ATTACH F1 OFFLINE • Toggle operation
F2 UPLOAD Enter file number
F3 DWNLOAD
* May have to select
node first
F4 MODE F1 RUN
F5 PROGRAM F4 SINGLE
ENTER
F1 PASSWRD F1 ENT
F2 REM
F3 ENT_MAS
F4 REM_MAS
F3 XFERMEM F2 MEM_PRC
F4 PRC_MEM
F4 EDT_DAT F1 ADDRESS
F2 NEXT_FL
F3 PREV_FL
F4 NEXT_PG
F5 PREV_PG
F3 TEST F2 CONT
F2 MAX_ADR F2 FORCE F1 ON
F3 BAUD F2 OFF
F5 CLR_OWNR F4 REM_ALL
F2 WHO F5 ENABLE •
F3 PASSWRD F1 ENT F3 EDT_DAT F1 ADDRESS
F2 REM F2 NEXT_FL
F3 ENT_MAS F3 PREV_FL
F4 REM_MAS F4 NEXT_PG
F5 CLR_MEM F5 PREV_PG
F4 SEARCH F1 CUR-INS
F2 CUR-OPD
F3 NEW-INS
F4 UP •
F1 19200 F5 FORCE
F2 9600
F3 2400
F4 1200
2–9
Chapter 2
The Menu Tree
Main Menu - Utility [F5], Processor Program Equals the HHT Program (If Previously Attached to that Processor)
F5 UTILITY F1 ONLINE F1 OFFLINE
F2 UPLOAD
F3 DWNLOAD
F4 MODE F1 RUN
F5 PROGRAM F4 SINGLE
ENTER
F1 PASSWRD F1 ENT
F2 REM
Legend
F3 ENT_MAS
F4 NEXT_PG
F5 PREV_PG
F3 TEST F2 CONT
F5 PROGRAM F4 SINGLE
F2 FORCE F1 ON
F2 OFF
F3 REM
F4 REM_ALL
F5 ENABLE •
F3 EDT_DAT F1 ADDRESS
F2 NEXT_FL
F3 PREV_FL
F4 NEXT_PG
F5 PREV_PG
F4 SEARCH F1 CUR-INS
F2 CUR-OPD
F5 NETWORK F5 RESET F4 UP •
F3
*
ATTACH F5 FORCE
F4 NODE_CFG F1 CHG_ADR
F2 MAX_ADR
F3 BAUD F1 19200
F5 CLR_OWNR F3 2400
F3 PASSWRD F1 ENT
F4 1200
F5 CLR_MEM F2 REM
F3 ENT_MAS
F4 REM_MAS
2–10
Chapter 2
The Menu Tree
HHT Function Keys and The following table provides a listing of the abbreviated function keys and
Instruction Mnemonics their meanings. The next table provides a list of instruction mnemonics.
Function Keys
Abbreviation Meaning
ACCUM accumulator value
ACP_RNG accept rung
ADDR address
ADV_SET advanced setup
ADV_SIZ advanced size
APP_BR append branch
B battery
BIN binary number
CAN_ED cancel edit
CAN_RNG cancel rung
CFG_SIZ configure size
CHG_ADR change node address
CHG_NAM change name
CLR_MEM clear memory
CLR_OWNR clear ownership
CLR_PRC clear processor
CONT continuous
CPT/MTH compute/math
CRT_DT create data
CRT_FIL create file
CSN continuous scan
CUR-INS current instruction
CUR-OPD current operand
DEC decimal number
DEL_BR delete branch
DEL_DT delete data
DEL_FIL delete file
DEL_INST delete instruction
DEL_RNG delete rung
DEL_SLT delete slot
DIAGNSTC diagnostic
DWNLOAD download
2–11
Chapter 2
The Menu Tree
Abbreviation Meaning
EDT_DAT edit data
EDT_FIL edit file
EDT_I/O edit I/O
ENT enter
ENT_MAS enter master
EXEC_FILE executable files
EXT_DWN extend down
EXT_UP extend up
F force
FILEPRT file protection
FLT fault
FUTACC future access
HEX/BCD hexadecimal/binary coded decimal number
INDXCHK index across files
INS_BR insert branch
INS_INST insert instruction
INS_RNG insert rung
INT_SBR interrupt subroutine
I/O_MSG I/O message
MAX_ADR maximum node address
MEM_MAP memory map
MEM_PRC memory module to processor
MEM_SIZ memory size
MOD_INST modify instruction
MOD_RCK modify rack
MOD_RNG modify rung
MOD_SET modify setup
MOD_SLT modify slot
MOR_CPT more compute
MOV/LOG move/logic
NEW-INS new instruction
NEW_PRG new program
NEXT_FL next file
NEXT_PG next page
NODE_CFG node configuration
OFL offline
OTHERS other instruction choices
2–12
Chapter 2
The Menu Tree
Abbreviation Meaning
PASSWRD password
PRC_MEM processor to memory module
PREV_FL previous file
PREV_PG previous page
PRG program
PRG_SIZE program size
PROGMAINT program maintenance
RLY relay
REM remove
REM_ALL remove all
REM_MAS remove master
SAVE_CT save and continue
SAVE_EX save and exit
SEL_PRO select processor
SET_OWNR set ownership
SFT/SEQ shift/sequencer
SNK sink
SRC source
SSN single scan
TERM terminal
TMR/CNT timer/counter
TRANS transistor
TRI triac
TSTRUNG test single rung
UND_INST undelete instruction
UND_RNG undelete rung
UND_SLT undelete slot
WTCHDOG watchdog
XFERMEM transfer memory
2–13
Chapter 2
The Menu Tree
Instruction Mnemonics
Mnemonic Instruction
ADD add
AND and
BSL bit shift left
BSR bit shift right
CLR clear
COP copy file
CTD count down
CTU count up
DCD decode 4 to 1 of 16
DDV double divide
DIV divide
EQU equal
FFL FIFO load
FFU FIFO unload
FLL file fill
FRD convert from BCD
GEQ greater than or equal to
GRT greater than
HSC high-speed counter
IID I/O interrupt disable
IIE I/O interrupt enable
IIM immediate input with mask
INT interrupt subroutine
IOM immediate output with mask
JMP jump to label
JSR jump to subroutine
LBL label
LEQ less than or equal to
LES less than
LFL LIFO load
LFU LIFO unload
LIM limit test
MCR master control reset
MEQ masked comparison for equal
MOV move
MSG message
MUL multiply
MVM masked move
2–14
Chapter 2
The Menu Tree
Mnemonic Instruction
NEG negate
NEQ not equal
NOT not
OR or
OSR one-shot rising
OTE output energize
OTL output latch
OTU output unlatch
PID proportional integral derivative
REF I/O refresh
RES reset
RET return from subroutine
RPI reset pending I/O interrupt
RTO retentive on-delay timer
SBR subroutine
SCL scale data
SQC sequencer compare
SQL sequencer load
SQO sequencer output
SQR square root
STD STI disable
STE STI enable
STS STI start immediately
SUB subtract
SUS suspend
SVC service communications
TND temporary end
TOD convert to BCD
TOF timer off-delay
TON timer on-delay
XIC examine if closed
XIO examine if open
XOR exclusive or
2–15
Chapter
3
Understanding File Organization
This chapter:
• defines program, program files, and data files
• indicates how programs are stored and transferred
• covers the use of EEPROMs and UVPROMs for program backup
Program, Program Files, and As explained in the following sections, the program can reside in:
Data Files • the Hand–Held Terminal
• an SLC 500 processor
• a memory module
• the APS terminal
Notes on terminology: The term program used in Hand-Held Terminal
(HHT) displays is equivalent to the term processor file used in APS software
displays. These terms mean the collective program files and data files
created under a particular program or processor file.
Most of the operations you perform with the HHT involve the program and
the two components created with it: program files and data files.
Program
3–1
Chapter 3
Understanding File Organization
Program
A program is the collective program files and data files of a particular user
program. It contains all the instructions, data, and configuration information
pertaining to that user program. The HHT allows only numbers and certain
letters available on the keyboard to be entered for a program name.
Upload
Download
The HHT and each CPU hold one program at a time. A program is created
in the offline mode using your HHT. You first configure your controller,
then create your user program. When you have completed and saved your
program, you download it to the processor RAM memory for online
operation. (See page 3–3 for more information on downloading.) You may
also keep a back–up of your program in the EEPROM memory module
located in the processor.
Program Files
Program files contain controller information, the main control program, and
any subroutine programs. The first three program files are required for each
program. These are:
• System Program (file 0)–This file is always included and contains
various system related information and user-programmed information
such as processor type, I/O configuration, program name and password.
• Reserved (file 1)– This file is always included and is reserved for internal
controller use.
• Main Ladder Program (file 2)–This file is always included and contains
user-programmed instructions defining how the controller is to operate.
• Subroutine Ladder Program (files 3 – 255)–These are user-created and
activated according to subroutine instructions residing in the main ladder
program file.
3–2
Chapter 3
Understanding File Organization
Data Files
Data files contain the data associated with the program files. Each program
can contain up to 256 data files. These files are organized by the type of data
they contain. Each piece of data in each of these files has an address
associated with it that identifies it for use in the program file. For example,
an input point has an address that represents its location in the input data file.
Likewise, a timer in the timer data file has an address associated with it that
allows you to represent it in the program file.
The first 9 data files (0 – 8) have default types. You designate the remainder
of the files (9 – 255) as needed. The default types are:
• Output (file 0) – This file stores the status of the output terminals or
output information written to speciality modules in the system.
• Input (file 1) – This file stores the status of the input terminals or input
information read from the speciality modules in the system.
• Status (file 2) – This file stores controller operation information. This
file is useful for troubleshooting controller and program operation.
• Bit (file 3) – This file is used for internal relay logic storage.
• Timer (file 4) – This file stores the timer accumulated and preset values
and status bits.
• Counter (file 5) – This file stores the counter accumulated and preset
values and the status bits.
• Control (file 6) – This file stores the length, pointer position, and status
bits for specific instructions such as shift registers and sequencers.
• Integer (file 7) – This file is used to store numeric values or bit
information.
• Reserved (file 8) – This file is not accessible to the user.
• User–Defined (file 9 – 255) – These files are user–defined as Bit, Timer,
Counter, Control and/or Integer data storage. In addition, file 9 is
specifically available as a Communication Interface File for
communication with non–SLC 500 devices on a DH–485 network.
Downloading Programs
When you have completed your program, it is necessary to transfer it to the
SLC 500 processor in order to run the program. You do this by attaching
your HHT to the processor and using the download function to transfer the
program into the processor RAM. When downloading, you must take the
processor out of the Run mode.
HHT PROCESSOR
RAM RAM
3–3
Chapter 3
Understanding File Organization
Uploading Programs
When you need to modify a program, it may be necessary to upload the
program from an SLC 500 processor to the HHT. If the original HHT
program is not current or the HHT has been attached to a different processor,
uploading is necessary. Use the upload function to do this. When you are
uploading, you can leave the processor in the Run mode.
HHT PROCESSOR
RAM RAM
3–4
4
Chapter
Data File Organization Data files contain the status information associated with external I/O and all
other instructions you use in your main and subroutine ladder program files.
In addition, these files store information concerning processor operation.
You can also use the files to store “recipes” and lookup tables if needed.
Data Files residing in the processor memory Data Files associated with Specialty I/O modules (SLC 5/02
processors)
0 Output image
M0 and M1 files
1 Input image
These data files reside in the memory of the specialty I/O
2 Status module. Their function depends on the particular specialty I/O
3 Bit module.
4 Timer In most cases, you can address these files in your ladder
program.
5 Counter
6 Control
7 Integer
8 Reserved G files
9 See Note below These data files are the software equivalent of DIP switches.
10–255 Bit, Timer, Counter, G files are accessed and edited offline under the I/O
Control, or Integer, Configuration function. The information is passed on to the
assigned as needed specialty I/O module when you enter the Run or Test mode.
4–1
Chapter 4
Data File Organization and Addressing
File numbers 0 through 7 are the default files, created for you. If you need
additional storage, you can create files by specifying the appropriate
identifier and a file number from 9 to 255. This applies to Bit, Timer,
Counter, Control, and Integer files only. Refer to the tables below:
Data file types, identifiers, and numbers
File File
Type Identifier Number User-Defined Files
Addressing Data Files Data files contain elements. As shown below, some data files have 1-word
elements, some have 3-word elements. You will be addressing elements,
words, and bits.
Output and Input files have 1word elements, with each element specified
by slot and word number:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
O:1.0
O:1.1
O:1.2
0
1
2
4–2
Chapter 4
Data File Organization and Addressing
The address format varies, depending on the file type. This is explained in
the following sections, beginning with file 2, the status file, and following
with files 0, 1, 3, 4, 5, 6, and 7.
Format Explanation
S Status file
: Element delimiter
/ Bit delimiter
b Bit number Bit location within the element. Ranges from 0 to 15.
Examples:
S:1/15 Element 1, bit 15. This is the first pass" bit, which you can use to
initialize instructions in your program.
S:3 Element 3. The lower byte of this element is the current scan time.
The upper byte is the watchdog scan time.
4–3
Chapter 4
Data File Organization and Addressing
I/O Addressing for a Controller with Fixed I/O: In the figure below, a
fixed I/O controller has 24 inputs and 16 outputs. An expansion rack has
been added. Slot 1 of the rack contains a module having 6 inputs and 6
outputs. Slot 2 contains a module having 8 outputs.
The figure shows how these outputs and inputs are arranged in data files 0
and 1. For these files, the element size is always 1 word.
The table on the following page explains the addressing format for outputs
and inputs. Note that the format specifies e as the slot number and s as the
word number. When you are dealing with file instructions, refer to the
element as e.s (slot and word), taken together.
4–4
Chapter 4
Data File Organization and Addressing
Assign I/O addresses to fixed I/O controllers as shown in the table below:
Format Explanation
O Output
I Input
: Element delimiter
Slot number
fixed I/O controller: 0
(decimal)
/ Bit delimiter
Terminal Inputs: 0 to 15
b
number Outputs: 0 to 15
Word addresses:
Default Values: Your programming device will display an address more formally. For example,
when you assign the address I:1/4, the HHT shows it as I1:1.0/4 (Input file, file #, slot 1, word 0,
terminal 4).
4–5
Chapter 4
Data File Organization and Addressing
The figure indicates the number of inputs and outputs in each slot and also
shows how these inputs and outputs are arranged in the data files. For these
files, the element size is always 1 word.
Slot Numbers
0 1 2 3 4 5 6 7 8 9 10
Power CPU Power
Supply Supply
I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O
Future Expansion
4–6
Chapter 4
Data File Organization and Addressing
The table below explains the addressing format for outputs and inputs. Note
that the format specifies e as the slot number and s as the word number.
When you are dealing with file instructions, refer to the element as e.s (slot
and word), taken together.
Format Explanation
O Output
I Input
: Element delimiter
Modular Processor:
Slot number Slot 0, adjacent to the power supply in the first rack,
O:e.s/b e
(decimal) applies to the processor module (CPU). Succeeding slots
are I/O slots, numbered from 1 to a maximum of 30.
/ Bit delimiter
Terminal Inputs: 0 to 15
b
number Outputs: 0 to 15
Word addresses:
Default Values: Your programming device will display an address more formally. For example,
when you assign the address O:5/0, the HHT shows it as O0:5.0/0 (Output file, file #, slot 5, word
0, terminal 0).
4–7
Chapter 4
Data File Organization and Addressing
Your programming device may display addresses slightly different than what
you entered on the HHT.
The HHT and APS always display the Bf/b format in XIO, XIC, and OTE
instructions.
4–8
Chapter 4
Data File Organization and Addressing
Timer Element
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Word
EN TT DN Internal Use 0
Preset Value PRE 1
Accumulated Value ACC 2
Format Explanation
T Timer
: Element delimiter
4–9
Chapter 4
Data File Organization and Addressing
Counter Element
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Word Addressable Bits Addressable Words
CU = Count up enable PRE = Preset
CU CD DN OV UN UA Internal Use 0 CD = Count down enable ACC = Accum
Preset Value PRE 1 DN = Done bit
Accumulated Value ACC 2 OV = Overflow bit
UN = Underflow bit
UA = Update accum. value
(HSC in fixed controller only)
Format Explanation
C Counter
File number. Number 5 is the default file. A file number between 10 - 255
f
Cf:e can be used if additional storage is required.
: Element delimiter
4–10
Chapter 4
Data File Organization and Addressing
Format Explanation
R Control file
File number. Number 6 is the default file. A file number between 10 - 255
Rf:e f
can be used if additional storage is required.
: Element delimiter
4–11
Chapter 4
Data File Organization and Addressing
Address Data
N7:0 0 Element 1 has a
N7:1 495 decimal value of 495.
N7:2 0
N7:3 66 Element 3 has a
decimal value of 66.
Format Explanation
N Integer file
File number. Number 7 is the default file. A file number between 10 - 255
f
Nf:e/b can be used if additional storage is required.
: Element delimiter
/ Bit delimiter
Examples:
4–12
Chapter 4
Data File Organization and Addressing
Indexed Addressing SLC 5/02 An indexed address is offset from its indicated address in the data table.
Processors Only Indexing of addresses applies to word addresses in bit and integer data files,
preset and accumulator words of timers and counters, and to the length and
position words of control elements. You can also index I/O addresses.
You can use more than one indexed address in your ladder program. All
indexed addresses will have the same offset, stored in word S:24. You can
manipulate the offset value in your program before each indexed address is
operated on.
Note that file instructions (SQO, COP, LFL for example) overwrite S:24
when they execute. For this reason, you must insure that the index register is
loaded with the intended value prior to the execution of an indexed
instruction that follows a file instruction.
Example
Suppose that during the operation of the ADD instruction, an offset value of
10 is stored in word S:24. The processor will take the value at N7:12
(N7:2+10) and add it to the value at N10:0. The result is placed at N11:15
(N11:5+10).
ADD
ADD
Source A #N7:2
Source B N10:0
Dest #N11:5
4–13
Chapter 4
Data File Organization and Addressing
Example
The figure below indicates the maximum offset for word address #T4:3.ACC
when allowing and disallowing crossing file boundaries.
B3:0
Maximum negative
T4:0.ACC of -3
#T4:3.ACC
#T4:3.ACC
Maximum.
T4:9.ACC positive of 6
4–14
Chapter 4
Data File Organization and Addressing
Example
If your application requires you to monitor indexed data, we recommend that
you use a MOV instruction to store the value.
B3 MOV
] [ MOVE
1 Source #N7:2
Dest N10:2
ADD
ADD
Source A #N7:2
Source B T4:0.ACC
Dest T4:1.PRE
N10:2 will contain the data value that was added to T4:0.ACC.
4–15
Chapter 4
Data File Organization and Addressing
File Instructions - Using the File instructions employ user-created files. These files are addressed with
File Indicator # the # sign. They store an offset value in word S:24, just as with indexed
addressing discussed in the last section.
COP Copy File LFL (LIFO Load)*
FLL File Fill LFU (LIFO Unload)*
BSL Bit Shift Left SQO Sequencer Output
BSR Bit Shift Right SQC Sequencer Compare
FFL (FIFO Load)* SQL Sequencer Load*
FFU (FIFO Unload)*
* Available in the SLC 5/02 processor only.
The following paragraphs explain user-created files as they apply to Bit Shift
instructions, Sequencer instructions, and File Copy and File Fill instructions.
4–16
Chapter 4
Data File Organization and Addressing
Sequencer Instructions
The figure below shows a user-defined file within bit data file 3. For this
particular user-defined file, enter the following parameters when
programming the instruction:
• #B3:4 The address of the file. This defines the starting element as
element 4, bit file 3.
• 6 This is the specified length of the file, 6 elements beyond the starting
address (totals 7 elements).
You can use user-defined integer files or bit files with sequencer instructions,
depending on the application.
You can program as many files as you like within another file. However, be
careful that the files do not overlap.
Bit Data File 3
15 0
0
1
2
3
4 0
5 1
6 2
7 #B3:4 3
8 4
9 5
10 6
11
4–17
Chapter 4
Data File Organization and Addressing
The first example is a user-defined file within Data File 7 – Integer. The file
is #N7:14, specified as 6 elements long.
The second example is a user-defined file within Data File 0 – Output Image.
We used this particular data file configuration in regard to I/O addressing on
page 4-6. Here, we are defining a file 5 elements long.
Note that for the output file (and the input file as well), an element is always
one word, referenced as the slot and word taken together. For example,
element O:3.0 refers to output file, slot 3, word 0. This defaults to O:3,
where word 0 is implied.
4–18
Chapter 4
Data File Organization and Addressing
Creating Data The SLC 500 controller provides the flexibility of a user-configured memory.
Data is created, in the Offline mode, in two ways:
• Assign addresses to instructions in your program – When you assign
an address to an instruction in your ladder program, you are allocating
memory space in a data file. Data files are expanded for instructions that
use File Addresses. As more and more addresses are assigned, the
various data files increase in size, according to the needs of your program.
Memory space is allocated in element blocks, beginning with element 0.
For example, suppose the first address you assign in your program is
B3/16. This allocates two elements to your program: B3:0, which
consists of bits B3/0 through B3/15; and B3:1, which consists of bits
B3/16 through B3/31. Since B3/16 is the first bit of element B3:1, all 16
bits of that element are created, therefore, the highest bit address now
available to you is B3/31. If the first timer element you assign in your
program is T4:99, you allocate timers T4:0 through T4:99. As described
on page 4–9, timers are 3–word elements. By assigning timer T4:100
you allocate 100 elements using 300 words of memory. So whether you
use timers T4:0 through T4:98 later in the program, they are allocated in
memory.
Obviously, you can keep the size of your data files to a minimum by
assigning addresses beginning at element 0 of each data file, and trying to
avoid creating blocks of addresses that are allocated but unused.
• Create files with the memory map function – The memory map
function of the programming device allows you to create data files by
entering addresses directly, rather than assigning addresses to instructions
in your program. You can create data files to store recipes and lookup
tables if needed.
You create a data file by entering the highest numbered element you want
to be included in the file. For example, entering address N7:20 creates 21
integer elements, N7:0 through N7:20.
4–19
Chapter 4
Data File Organization and Addressing
Deleting Data Deleting data is accomplished only in the Offline mode. There are two ways
to delete the contents of data files:
• Clear memory – This deletes your entire program, including all files
except the system program file (0) and the status data file (2).
• Use the memory map function – The memory map function allows you
to delete data in individual files or portions of files. For example, you can
delete blocks of addresses that have been allocated but are not being used.
You cannot delete an element if it is used in your program. Neither can you
delete an unused element if a higher numbered element in the file is used in
your program. (For example, if you are using element B3:5, you cannot
delete B3:0 through B3:4, even if you aren’t using them in your program.)
Important: Make certain that you do not inadvertently delete data originally
reserved for indexed addressing. Unexpected operation will
result.
Program Constants You can enter integer constants directly into many of the instructions you
program. The range of values for most instructions is –32,768 through
+32,767.
Instructions such as SQO, SQC, MEQ, and MVM allow you to enter a hex
mask, which is also a program constant. The hex mask is represented in
hexadecimal, range 0-FFFF.
Program constants are used in place of data file elements. They cannot be
manipulated by the user program. You must enter the offline program editor
to change the value of a constant.
4–20
Chapter 4
Data File Organization and Addressing
M0 and M1 Data Files - M0 and M1 files are data files that reside in specialty I/O modules only.
Specialty I/O Modules There is no image for these files in the processor memory. The application
of these files depends on the function of the particular specialty I/O module.
For some modules, the M0 file is regarded as a module output file and the
M1 file is regarded as a module input file. In any case, both M0 and M1 files
are considered read/write files by the SLC 5/02 processor.
M0 and M1 files can be addressed in your ladder program and they can also
be acted upon by the specialty I/O module – independent of the processor
scan. It is important that you keep the following in mind in creating and
applying your ladder logic:
4–21
Chapter 4
Data File Organization and Addressing
If you need to show the state of the M0 or M1 addressed bit, you can transfer
the state to an internal processor bit. This is illustrated below, where an
internal processor bit is used to indicate the true/false state of a rung.
B3 B3 EQU M0:3.0
] [ ] [ EQUAL ( )
0 1 Source A N7:12 1
Source B N7:3
This rung will not show its true rungstate because the EQU instruction is always shown as
true and the M0 instruction is always shown as false.
B3 B3 EQU B3
] [ ] [ EQUAL ( )
0 1 Source A N7:12 2
Source B N7:3 M0:3.0
( )
1
OTE instruction B3/2 has been added to the rung. This instruction shows the true or
false state of the rung.
4–22
Chapter 4
Data File Organization and Addressing
The COP instructions below copy data from a processor bit file and integer
file to an M0 file. Suppose the data is configuration information affecting
the operation of the specialty I/O module.
S:1 COP
] [ COPY FILE
15 Source #B3:0
Dest #M0:1.0
Length 16
First scan bit. It makes this
rung true only for the first COP
scan after entering the Run COPY FILE
mode. Source #N7:0
Dest #M0:1.16
Length 27
The COP instruction below copies data from an M1 data file to an integer
file. This technique is used to monitor the contents of an M0 or M1 data file
indirectly, in a processor data file.
COP
COPY FILE
Source #M1:4.3
Dest #N10:0
Length 6
4–23
Chapter 4
Data File Organization and Addressing
Access Time
During the program scan, the processor must access the specialty I/O card to
read/write M0 or M1 data. This access time must be added to the execution
time of each instruction referencing M0 or M1 data. The following table
shows approximate access times per instruction or word of data for the
SLC 5/02 processors.
COP
COPY FILE
Source #B3:0
Dest #M0:1.0
Length 34
If you are using a Series B processor, add 1.58 ms plus 0.67 ms per word of data
addressed to the M0 or M1 file. This adds 24.36 ms to the scan time of the COP
instruction. If you are using a Series C processor, add 0.95 ms plus 0.40 ms per word.
This adds 14.55 ms to the scan time of the COP instruction.
4–24
Chapter 4
Data File Organization and Addressing
M0:2.1 B3
1 ] [ ( )
1 10
B3 M0:2.1 B3
2 ] [ ] [ ( )
12 1 14
Figure 1. XIC instructions in rungs 1 and 2 are addressed to the M0 data file.
Each of these instructions adds approximately 1 ms to the scan time (Series
B processor).
M0:2.1 B3
1 ] [ ( )
1 10
B3 B3 B3
2 ] [ ] [ ( )
12 10 14
4–25
Chapter 4
Data File Organization and Addressing
B3 M0:2.1
] [ ( )
0 1
M0:2.1
] [
1
M0:2.1
] [
1
4–26
Chapter 4
Data File Organization and Addressing
G Data Files - Specialty I/O Some specialty I/O modules use G (confiGuration) files (indicated in the
Modules specialty I/O module user’s manual). These files can be thought of as the
software equivalent of DIP switches.
The content of G files is accessed and edited offline under the I/O
Configuration function. You cannot access G files under the Monitor File
function. Data you enter into the G file is passed on to the specialty I/O
module when you download the processor file and enter the Run or Test
mode.
The following figure illustrates the three G file data formats that you can
select on the HHT. Word addresses begin with the file identifier G and the
slot number you have assigned to the specialty I/O module. In this case, the
slot number is 1. Four words have been created (addresses G1:0 through
G1:3).
4–27
Chapter 4
Data File Organization and Addressing
4–28
5
Chapter
This chapter discusses the basic operation of ladder programs. For a more
simplified introduction to ladder programming, refer to The Getting Started
Guide for HHT, catalog number 1747–NM009. This guide is intended for
the first time user.
Ladder Programming The ladder program you enter into the controller’s memory contains bit
(relay logic) instructions representing external input and output devices. It
also contains other instructions, as described in the section “The Instruction
Set,” chapters 15 through 26.
Keep in mind that operation of these instructions is similar but not equivalent
to that of relay contacts and coils. In fact, a knowledge of relay control
techniques is not a prerequisite for programming the SLC 500 Programmable
Controller.
5–1
Chapter 5
Ladder Program Basics
A 1-Rung Ladder Program A ladder program consists of individual rungs, each containing at least one
output instruction and one or more input instructions. Variations of this
simple rung construction are discussed in later chapters.
This ladder rung has two input instructions and an output instruction. An
output instruction always appears at the right, next to the right power rail.
Input instructions always appear to the left of the output instruction.
Input Instructions Output Instructions
XIC XIO OTE
B3 B3 B3
10 11 12
XIC = Examine if Closed Address B3/10
XIO = Examine if Open Address B3/11
OTE = Output energize Address B3/12
Note that each instruction in the diagram above has an address. As described
in the chapter 4, this address identifies a location in the processor’s data files,
where the on/off state of the bit is stored. Addresses of the above
instructions indicate they are located in the Bit data file (B3), bits 10, 11, and
12:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
From the diagram and table above, we see that the state of bits 10, 11, and 12
indicate that the XIC, XIO, and OTE instructions of our rung are all true.
The true/false state of instructions is the basis of controller operation, as
indicated in the following paragraphs.
5–2
Chapter 5
Ladder Program Basics
Logical Continuity During controller operation, the processor determines the on/off state of the
bits in the data files, evaluates the rung logic, and changes the state of the
outputs according to the logical continuity of rungs. More specifically, input
instructions set up the conditions under which the processor will make an
output instruction true or false. These conditions are:
• When the processor finds a continuous path of true input instructions in a
rung, the OTE output instruction will become (or remain) true. We then
say that “rung conditions are true.”
• When the processor does not find a continuous path of true input
instructions in a rung, the OTE output instruction will become (or remain)
false. We then say that “rung conditions are false.”
The figure below shows the on/off state of output B3/12 as determined by the
changing states of the inputs in the rung.
Input Instructions Output Instructions
XIC XIO OTE
B3 B3 B3
10 11 12
5–3
Chapter 5
Ladder Program Basics
Series Logic In the previous section on logical continuity, you have seen examples of
series (And) logic. This means that when all input conditions in the path are
true, energize the output.
Parallel Logic Another form of logical continuity is Parallel (OR) logic. This means that
when one or another path of logic is true, energize the output.
Use branching to form parallel logic in your user program. Branches can be
established at both input and output portions of a rung. The upper limit on
the number of levels which can be programmed in a branch structure is 75.
The maximum number of instructions per rung is 127.
5–4
Chapter 5
Ladder Program Basics
Input Branching
Use an input branch in your application program to allow more than one
combination of input conditions to form parallel branches (OR–logic
conditions.) If at least one of these parallel branches forms a true logic path,
the rung logic is enabled. If none of the parallel branches forms a true logic
path, rung logic is not enabled and the output instruction logic will not be
true. (Output is not energized.)
Output Branching
You can program parallel outputs on a rung to allow a true logic path to
control multiple outputs. When there is a true logic path, all parallel outputs
become true.
B
MOV
E
U
In the above example, either A or B provides a true logic path to all three
output instructions.
5–5
Chapter 5
Ladder Program Basics
With the SLC 5/02 processor, additional input logic instructions (conditions)
can be programmed in the output branches to further condition control of the
outputs. When there is a true logic path, including extra input conditions on
an output branch, that branch becomes true.
B D E
In the above example, either A and D or B and D provide a true logic path
to E
Nested Branching
With the SLC 5/02 processor, input and output branches can be “nested” to
avoid redundant instructions, to speed–up processor scan time, and provide
more efficient programming. A “nested” branch is a branch that starts or
ends within another branch. You can nest branches up to four levels deep.
5–6
Chapter 5
Ladder Program Basics
Example
A B C F
Nested Branch
A B C F
D C
5–7
Chapter 5
Ladder Program Basics
A 4-Rung Ladder Program The following 4-rung ladder program uses the same 3 bit addresses as our
simple 1-rung diagram. It also uses an external input bit address and an
external output bit address. Note that individual bits are addressed
repeatedly. For example, B3/11 is addressed with an XIC instruction in
rungs 1 and 4, and it is addressed with both an XIC and an OTE instruction
in rung 2.
During normal controller operation, the processor checks the state of the
input data file bits then executes the program instructions individually, rung
by rung, from the beginning to the end of the program; as it does, it updates
the data file bits and the appropriate output data file bits accordingly.
When XIC instruction I:0/1 goes true (because an external momentary push
button closes):
• Rung 1 is evaluated as false, because XIC instruction B3/11 is false at this
time.
• Rung 2 is evaluated as true. XIC B3/11 in the branch of this rung goes
true to maintain continuity in the rung.
• Rung 3 is evaluated as true.
• Rung 4 is evaluated as true because XIC B3/11 has gone true. The
external device represented by OTE O:0/2 is energized.
5–8
Chapter 5
Ladder Program Basics
Application Example
Use the following program to achieve the maintained contact action of an
On–Off toggle switch using a momentary contact push button. (Press for
On; press again for Off.)
The first time you press the push button (represented by address I:0/1),
instruction B3/11 is latched, energizing output O:0/2. The second time you
press the push button, instruction B3/12 unlatches instruction B3/11,
de–energizing output O:0/2. Instruction B3/10 prevents interaction between
instructions B3/12 and B3/11.
I:0.0 B3 B3 B3
1 ] [ ]/[ ] [ ( )
1 10 11 12
I:0.0 B3 B3 B3
2 ] [ ]/[ ]/[ ( )
1 10 12 11
B3
] [
11
I:0.0 B3
3 ] [ ( )
1 10
B3 O:0.0
4 ] [ ( )
11 2
Status Bit
Rung I:0/1 B3/10 B3/11 B3/12 O:0/2
1 ] [ ]/[ ] [ ( )
2 ] [ ]/[ ( ) ] [ ]/[
3 ] [ ( )
4 ] [ ( )
5–9
Chapter 5
Ladder Program Basics
When the state of a bit changes during the scan, the effects this may have in
earlier rungs of the program are not accounted for until the next scan. To
point this out, we have shown successive scans (1000 and 1001, 2000 and
2001, etc.).
5–10
Chapter 5
Ladder Program Basics
Operating Cycle (Simplified) The diagram below shows a simplified operating cycle, consisting of the
program scan, discussed in the last section, and the I/O scan.
I/O SCAN
PROGRAM SCAN
In the I/O scan, data associated with external outputs is transferred from the
output data file to the output terminals. (This data was updated during the
preceding program scan.) In addition, input terminals are examined, and the
associated on/off state of the bits in the input data file are changed
accordingly.
In the program scan, the updated status of the external input devices is
applied to the user program. The processor executes the entire list of
instructions in ascending rung order. Status bits are updated according to
logical continuity rules as the program scan moves from instruction to
instruction through successive ladder rungs.
The I/O scan and program scan are separate, independent functions. Thus,
any status changes occurring in external input devices during the program
scan are not accounted for until the next I/O scan. Similarly, data changes
associated with external outputs are not transferred to the output terminals
until the next I/O scan.
Important: The description here does not account for the processor
overhead and communications portions of the operating cycle.
These are discussed in appendix D, Estimating Scan Time.
5–11
Chapter 5
Ladder Program Basics
The following figures indicate how the operating cycle works for the 4-rung
ladder program discussed on pages 5–7 through 5–10.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Input Data File
Input Scan
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I:0
Input Bit De-energized
I:0.0 Instructions are normal Ladder Program
intensity. O:0.0
1 2
Program
Scan
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Output Data File
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 O:0
Output Bit De-energized
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Input Data File
Input Scan
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 I:0
Input bit energized
5–12
Chapter 5
Ladder Program Basics
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Input Data File
Input Scan
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I:0
Input Bit De-energized
I:0.0 Instructions are normal Ladder Program
intensity. O:0.0
Program
1 2
Scan Output Data File
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 0 0 1 0 0 0 O:0
Output Bit Energized
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Input Data File
Input Scan
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I:0
Input Bit De-energized
Program 1 2
Scan
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Output Data File
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 O:0
Output Bit De-energized
5–13
Chapter
6
Creating a Program
In this chapter you create a ladder program. The tasks you will perform are:
• configure your SLC 500 controller
• name your program
Creating a Program Offline A program is always created offline using the HHT. In creating the program,
with the HHT you:
1. Clear the memory of the HHT.
2. Configure the processor.
3. Configure the I/O.
4. Name the ladder program and main program file.
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
6–1
Chapter 6
Creating a Program
OFL
EDT_DAT SEL_PRO EDT_I/O CLR_MEM >
F1 F2 F3 F4 F5
4. Press [F2], YES. This clears the HHT memory and the following display
appears:
OFL
EDT_DAT SEL_PRO EDT_I/O CLR_MEM >
F1 F2 F3 F4 F5
6–2
Chapter 6
Creating a Program
2. Use the cursor keys [ ↑ ] or [ ↓ ] then press [ENTER] to select the correct
processor type. For this example, select the 1747–L511 processor. Since
this is the default selection on the display, press [ENTER]. Processor
module 1747–L511 is entered into memory. The previous display
appears.
3. Press [ESC] to return to the following display:
OFL
EDT_DAT SEL_PRO EDT_I/O CLR_MEM >
F1 F2 F3 F4 F5
Slot 1 = NONE
The display shows that the processor module we just entered is assigned
to slot 0. It also shows the default rack selection 1746–A4. For this
example you do not have to change the rack selection. If you are using a
different rack, press [F1], MOD_RCK, then [F1], RACK 1. Select the
appropriate rack, using the [ ↓ ] and [ ↑ ] keys, then press [ENTER].
If you are using more than one rack, follow the same procedure for racks
2 and 3. The next task is to assign the I/O module slots. For this
example, use slots 1, 2, and 3.
2. Press [F2], MOD_SLT.
The following display appears:
Slot 1 = NONE
Slot 1 = NONE
OTHER
F1 F2 F3 F4 F5
6–3
Chapter 6
Creating a Program
3. Assign the input module found in slot 1 by scrolling with the [ ↓ ] key.
For this example, press the [ ↓ ] key once to assign the 1746–IA4
module. (The [F3], OTHER key is for configuring I/O modules not
found in the list of catalog numbers. See your specialty I/O user manual
or instruction sheet for the proper code).
4. Press [ENTER]. The 1746–IA4 AC input is entered for slot 1. The
following display appears:
Rack 1 = 1746–A4 4–SLOT RACK
Rack 2 = NONE
Rack 3 = NONE
Slot 0 = 1747–L511 CPU–1K USER MEMORY
5. Call up another slot number using the [ ↓ ] and [ ↑ ] keys. Press the
[ ↓ ] key once for slot 2. Assign the other slots by following the
procedure for slot 1.
Your controller is now fully configured. The configuration can be
changed at any time by using the functions shown here. UND_SLT can
be used to undelete a slot if it is accidently removed or to configure
multiple slots with the same module type.
6. Press [ESC]. This returns you to the display shown below.
6–4
Chapter 6
Creating a Program
Slot 6 = NONE
MOD_RCK MOD_SLT DEL_SLT UND_SLT ADV_SET
F1 F2 F3 F4 F5
Slot 6 = NONE
Slot 6 = NONE
OTHER
F1 F2 F3 F4 F5
6–5
Chapter 6
Creating a Program
4. Press [F3], OTHER. For the RIO Scanner Module, enter the module ID
code. Type 13608, then press [ENTER]. (For some module ID codes, the
HHT may request additional information). The next display appears:
OFL
INT_SBR MOD_SET CFG_SIZ ADV_SIZ
F1 F2 F3 F4 F5
6. Press [F4], ADV_SIZ to view or modify the I/O and M0/M1 file sizes:
F1 F2 F3 F4 F5
The default for the scanned output size is 32 words. In this example, to
reduce the processor scan time, enter 16 words.
7. Type 16, then press [ENTER].
The display changes as follows:
F1 F2 F3 F4 F5
6–6
Chapter 6
Creating a Program
OFL
INT_SBR MOD_SET CFG_SIZ ADV_SIZ
F1 F2 F3 F4 F5
10.Set the G file (configuration file) size to 3. Press [F3], CFG_SIZ. The
following display appears:
F1 F2 F3 F4 F5
11. Type 3, then press [ENTER]. You are returned to the previous display.
Press [F2], MOD_SET to view or modify the G file contents. The
following display appears, with the cursor positioned on G6:0:
6–7
Chapter 6
Creating a Program
13.From this display you may choose the data format you prefer to use to
configure the module for your application: BINary, DECimal,
HEXadecimal/Binary Coded Decimal. Refer to Remote I/O Scanner User
Manual, catalog number 1747–NM005, for a detailed description of the
configuration specifications.
14.When you finish configuring your specialty I/O module, press [ESC] to
return to the previous display:
OFL
INT_SBR MOD_SET CFG_SIZ ADV_SIZ
F1 F2 F3 F4 F5
OFL
CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP >
F1 F2 F3 F4 F5
6–8
Chapter 6
Creating a Program
File Name:
OFL
PROGRAM FILE
F1 F2 F3 F4 F5
File Name:
F1 F2 F3 F4 F5
4. Name your program 1000. Type 1000, then press [SPACE], then
[ENTER]. The program name is entered and you are returned to the
previous display.
File Name:
OFL
PROGRAM FILE
F1 F2 F3 F4 F5
Important: If you forget to press the [SPACE] key, the program name is now
1000ULT. Whenever you create a new program name or change
the name; if the previous name consists of more characters than
the new one, the [SPACE] key must be used to clear the
additional characters. To correct the name, repeat the above
procedure.
6–9
Chapter 6
Creating a Program
1. Continuing from the change name display, press [F4], FILE. This
display appears:
File Name:
F1 F2 F3 F4 F5
2. Name the main program file 222. Type 222, then press [ENTER]. The
main program file name is entered and you are returned to the previous
menu.
The same restrictions apply to the characters for the main program file
name as to ladder program names. Also, using the [SPACE] key may be
necessary if you are re–naming the main program file.
3. Exit this menu level by pressing [ESC]. The program maintenance
display appears:
Main Program Program Name
File Name
File Name: 222 Prog Name:1000
File Name Type Size(Instr)
0 System *
1 Reserved * File Size
2 222 Ladder *
OFL
CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP >
F1 F2 F3 F4 F5
The program directory now shows the name of the program, which is
1000 and the name of the main program file, which is 222. The display
also shows the file sizes. At this point, asterisks (*) are displayed
because no ladder programs are entered.
Passwords Password protection prevents access to a program file and prevents changes
from being made to the program. Each program may contain two passwords;
the password and the master password. The master password overrides the
password. This function is available for the offline HHT program, from the
utility menu display and for the online processor program, from the attach
display. You can only use numeric–based passwords.
6–10
Chapter 6
Creating a Program
Password and Master Password You must enter either the password or the master password
Designated to gain access to the program file.
Entering Passwords
Ordinarily, you do not enter a password until your ladder program is
completed, tested, and ready to be applied. This avoids having to type in the
password each time you edit the program, download, edit again, and so on.
In this example, enter the password, 123, for program file 1000. Use the
Offline mode for this procedure.
1. Begin at the utility display:
File Name: 222 Prog Name:1000
File Name Type Size(Instr)
0 System *
1 Reserved *
2 222 Ladder *
OFL
ONLINE WHO PASSWRD CLR_MEM
F1 F2 F3 F4 F5
OFL
ENT REM ENT_MAS REM_MAS
F1 F2 F3 F4 F5
6–11
Chapter 6
Creating a Program
3. Press [F1], ENT. The display prompts you for the password:
File Name: 222 Prog Name:1000
File Name Type Size(Instr)
0 System *
1 Reserved *
2 222 Ladder *
F1 F2 F3 F4 F5
4. Type 123. Notice that as you enter the characters, X’s are displayed for
security reasons:
File Name: 222 Prog Name:1000
File Name Type Size(Instr)
0 System *
1 Reserved *
2 222 Ladder *
F1 F2 F3 F4 F5
5. Press [ENTER].
You are prompted to verify the password, by re–typing it:
F1 F2 F3 F4 F5
6–12
Chapter 6
Creating a Program
6–13
Chapter
7
Creating and Editing Program Files
Creating and Deleting As described in chapter 2, a program must contain the main program file (file
2) for user–programmed instructions defining how the controller is to
Program Files operate. Additional program files may be created for specialized user
defined program routines. User error handler, STI interrupts and interrupt
programs require subroutine program files. These are described later in this
manual. Valid file numbers range from 3 to 255.
OFL
CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP >
F1 F2 F3 F4 F5
F1 F2 F3 F4 F5
7–1
Chapter 7
Creating and Editing a Program File
You may not name any of the subroutine program files using the HHT.
Subroutine program files may be named on an APS terminal. These
programs may be uploaded to, and displayed on the HHT.
Notice that files 4 and 5 are listed as Undefined and file 6, the file you
created, is listed as Ladder. Although files 4 and 5 are not created, they
are still displayed. You may create the files at a later time by repeating
the above procedure.
7–2
Chapter 7
Creating and Editing a Program File
2. You are prompted for the file number to delete. Press [6], then [ENTER].
The following display appears:
3. Press [F2], YES to delete the file. Refer to appendix A for a description
of HHT messages and error definitions. The following display appears:
Now that you have created all necessary subroutine program files, enter a
simple program.
7–3
Chapter 7
Creating and Editing a Program File
Editing a Program File This section describes the following editing techniques:
• entering a rung
• adding a rung with branching
• modifying rungs
• modifying instructions
• modifying branches
• deleting branches
• deleting and copying instructions
• deleting and copying rungs
Important: In the following examples, there may be multiple ways to enter
certain instructions. The examples are chosen to show the
simplest methods of programming and editing.
7–4
Chapter 7
Creating and Editing a Program File
Entering a Rung
To enter a rung, do the following:
1. Press [F3], EDT_FIL from the program maintenance display. The
following display appears:
F1 F2 F3 F4 F5
2. Edit file number 2, the main program file. Press [2], then [ENTER]. The
display shows the END of program statement. No other rungs exist at this
time. The numbers 2.0.0.0.* appear in the upper right corner of the
display. This indicates that you are editing program file 2, and the cursor
is located on rung 0, nest level 0, branch level 0, and not presently on an
editable instruction (the cursor is located on the END of program
statement).
2.0.0.0.*
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
OFL
INS_INST BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
The Insert Rung command inserts the new rung above the rung where the
cursor is positioned. In this case, since there are no other rungs, the new
rung is placed directly above the END statement. The cursor is now
located on the left power rail of rung 0. The first rung of a program file is
always numbered 0.
7–5
Chapter 7
Creating and Editing a Program File
OFL
BIT TMR/CNT I/O_MSG COMPARE CPT/MTH >
F1 F2 F3 F4 F5
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
F1 F2 F3 F4 F5
4. At the ENTER BIT ADDR: prompt, type the address I:1/0, which is an
abbreviated form of the address. The display appears as follows:
F1 F2 F3 F4 F5
7–6
Chapter 7
Creating and Editing a Program File
This zoom display, once again gives you a chance to verify that all the
information entered is accurate. Notice that the address displayed is
shown in its full format:
6. Press [F5], ACCEPT. This inserts the instruction and address into the
rung. The following rung display appears:
2.0.0.0.*
I ] [ I
<END>
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
Notice that the cursor is now located on the right power rail of rung 0. In
the next section, the Output Energize instruction is inserted to the left of
the cursor.
Further instructions may be entered in the same way.
F1 F2 F3 F4 F5
7–7
Chapter 7
Creating and Editing a Program File
3. Press [F5], ACCEPT, then press [ESC] twice to move up through the
menu displays. Now press [F5], ACP_RUNG.
The following display appears:
Notice the I symbol in the power
rails has changed to a solid line,
2.1.0.0.* indicating the rung is accepted
into the program.
] [ ( )
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
4. At this point the rung is entered and accepted. Now save this rung and
continue editing. Press [ENTER] to display additional menu options.
2.1.0.0.*
] [ ( )
<END>
OFL
EDT_DAT SAVE_CT SAVE_EX >
F1 F2 F3 F4 F5
5. To save and continue editing, press [F4], SAVE_CT, then press [F5],
ACCEPT.
7–8
Chapter 7
Creating and Editing a Program File
] [ ( )
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. Press the [ ↓ ] key once to place the cursor on the END of program
statement.
3. Press [F1], INS_RNG. The insert rung function always places the new
rung above the rung on which the cursor is positioned. This places the
new rung between the first rung and the END of program statement. If you
did not move the cursor, the new rung is inserted above the original rung.
The display appears as follows:
2.1.0.0.* Position of the new rung
indicated by the I symbol
] [ ( ) in the power rails.
I I
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
F1 F2 F3 F4 F5
7–9
Chapter 7
Creating and Editing a Program File
5. Enter the address for the first examine if closed instruction. Type the
address I:1/0, then press [ENTER], then [F5], ACCEPT. The following
display appears with the cursor positioned on the right power rail:
2.1.0.0.*
] [ ( )
I ] [ I
<END>
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
F1 F2 F3 F4 F5
7. Type the address O:3/1, then press [ENTER], then [F5], ACCEPT. The
cursor is now positioned on the output energize instruction and the
following display appears:
OTE:O0:3.0/1 NO FORCE 2.1.0.0.2
] [ ( )
Notice that with the cursor placed ] [ ( ) I The cursor location is also
on the output instruction, the
I displayed in the upper right
instruction mnemonic and <END> corner. This indicates that the
address are displayed in the cursor is located in program file
upper left corner. OFL 2, rung 1, nest level 0, branch
] [ ]/[ ( ) (L) (U) > level 0 and on the second
instruction in the rung.
F1 F2 F3 F4 F5
7–10
Chapter 7
Creating and Editing a Program File
In this example use the insert branch command. The other branching
commands are described starting on page 7–19.
1. Starting from the previous display, press [ESC] twice to bring up the
following menu display:
OTE:O0:3.0/1 NO FORCE 2.1.0.0.1
] [ ( )
I ] [ ( ) I
<END>
OFL
INS_INST BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
] [ ( )
I ] [ ( ) I
<END>
OFL
EXT_UP EXT_DWN APP_BR INS_BR DEL_BR
F1 F2 F3 F4 F5
7–11
Chapter 7
Creating and Editing a Program File
] [ ( )
I ] [ ( ) I
<END>
SELECT BRANCH TARGET, PRESS ENTER OFL
F1 F2 F3 F4 F5
The insert branch instruction places the start of the branch to the left of
the cursor position. (You choose the direction of the branch target by
using the [←] or [→] keys.)
4. The cursor is now positioned on the branch start and you are prompted to
move the cursor to the branch target. Press the[←] key once. The cursor
is now positioned to the left of the examine if closed instruction:
2.1.0.0.*
] [ ( )
I ] [ ( ) I
<END>
SELECT BRANCH TARGET, PRESS ENTER OFL
F1 F2 F3 F4 F5
] [ ( )
I ] [ ( ) I
I I
<END>
OFL
EXT_UP EXT_DWN APP_BR INS_BR DEL_BR
F1 F2 F3 F4 F5
] [ ( )
I ] [ ( ) I
I I
<END>
OFL
INS_INST BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
7–12
Chapter 7
Creating and Editing a Program File
F1 F2 F3 F4 F5
3. Type the address I:1/1, then press [ENTER], then [F5], ACCEPT. The
display appears as follows:
2.1.1.1.*
] [ ( )
I ] [ ( ) I
I ] [ I
<END>
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
4. To accept the new rung into your program, press [ESC] twice, then
[F5], ACP_RNG. The rung is now a part of your program, as indicated
by the absence of I’s in the power rails:
2.2.0.0.*
] [ ( )
] [ ( )
] [
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
5. Press [ENTER] for additional menu options, then press [F4], SAVE_CT, to
save and continue editing, then press [F5], ACCEPT.
7–13
Chapter 7
Creating and Editing a Program File
Modifying Rungs
In the previous two examples you created rungs by inserting them into the
program. After rungs are part of a ladder program, you can modify those
rungs offline, at any time.
1. From the previous display, press [ENTER] to display the additional menu
functions.
The cursor is located on the left
power rail of rung 0. 2.0.0.0.*
] [ ( )
] [ ( )
] [
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. To place the new instruction between the existing input and output
instructions, press the [→] key twice to place the cursor on the output
instruction. The display changes as follows:
OTE:O0:3.0/0 NO FORCE 2.0.0.0.2
Notice that with the cursor placed ] [ ( ) The cursor location is also
on the output instruction, the ] [ ( ) displayed in the upper right
instruction mnemonic and corner. This indicates that the
address are displayed in the ] [ cursor is located in program file
upper left corner. <END> 2, rung 0, nest level 0, branch
OFL level 0 and on the second
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG > instruction in the rung.
F1 F2 F3 F4 F5
3. Press [F2], MOD_RNG then [F1], INS_INST, then [F1], BIT for the
following display to appear:
OTE:O0:3.0/0 NO FORCE 2.0.0.0.2
I ] [ ( ) I
] [ ( )
] [
<END>
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
7–14
Chapter 7
Creating and Editing a Program File
F1 F2 F3 F4 F5
5. At the ENTER BIT ADDR: prompt, type the address I:1/2, then press
[ENTER].
6. Press [F5], ACCEPT. This inserts the instruction and address into the
rung. The following display appears:
OTE:O0:3.0/0 NO FORCE 2.0.0.0.3
I ] [ ] [ ( ) I
] [ ( )
] [
<END>
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
] [ ] [ ( )
] [ ( )
] [
<END> OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
Once again, press [ENTER], then [F4], SAVE_CT, then [F5], ACCEPT to
compile and save these edits, and continue editing.
7–15
Chapter 7
Creating and Editing a Program File
Modifying Instructions
In the previous example you modified a rung by adding an instruction to the
rung. Another function available in the HHT is the ability to modify
instructions. Instructions may be edited by changing the address and/or
changing the type of instruction. The following examples show you how to
do both.
1. From the previous save and continue display, press [ENTER]. The
following display appears:
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
I ] [ ] [ ( ) I
] [ ( )
] [
<END>
OFL
INS_INST BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
7–16
Chapter 7
Creating and Editing a Program File
6. Press [F5], ACCEPT. The display returns to the ladder display, and the
address is changed, as indicated in the upper left corner.
I ] [ ] [ ( ) I
] [ ( )
] [
<END>
OFL
BIT TMR/CNT I/O_MSG COMPARE CPT/MTH
F1 F2 F3 F4 F5
7. To accept the new address, press [ESC] once to display the proper menu,
then press [F5], ACP_RNG.
8. Save the changes.
7–17
Chapter 7
Creating and Editing a Program File
1. From the previous save and continue display, press [ENTER]. The
following display appears:
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. To change the examine if closed instruction, press the [→] key twice.
With the cursor positioned on the examine if closed instruction with
address I1:1.0/1, press [F2], MOD_RNG. The following display
appears:
I ] [ ] [ ( ) I
] [ ( )
] [
<END>
OFL
INS_INST BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
7–18
Chapter 7
Creating and Editing a Program File
I ] [ ]/[ ( ) I
] [ ( )
] [
<END>
OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
5. To accept the new instruction, press [ESC] twice to display the proper
menu, then press [F5], ACP_RNG.
6. Save the changes.
Modifying Branches
Earlier in this chapter you programmed a rung containing a branch, using the
insert branch function. The branch menu contains several different
branching functions. This example deals with those functions.
Extending a Branch Up
Use the extend branch up command to create a new branch level on an
existing branch, above your cursor location. The new branch shares the same
start and target locations as the branch on which the cursor is located. In this
example, modify rung 1 of your program to appear as follows:
I:1.0 O:3.0
] [ ( )
0 1
Add this branch to the rung.
B3 B3
] [ ] [
1 2
I:1.0
] [
1
1. From the previous save and continue display, press [ENTER]. The
following display appears:
2.0.0.0.*
] [ ]/[ ( )
] [ ( )
] [
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
7–19
Chapter 7
Creating and Editing a Program File
2. Because the cursor is positioned on the left power rail of rung 0, move the
cursor to a position within nest level 1, branch level 1 of rung 1; by
pressing the [↓] key, then the [→] key, then the [↓] key.
The display changes to the following:
2.1.1.1.*
] [ ]/[ ( )
I ] [ ( ) I
I I
] [
<END>
OFL
EXT_UP EXT_DWN APP_BR INS_BR DEL_BR
F1 F2 F3 F4 F5
7–20
Chapter 7
Creating and Editing a Program File
2.1.1.1.*
] [ ]/[ ( )
I ] [ ( ) I
I ] [ I
I I
] [
<END> OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
8. Now insert the examine if closed instruction with address B3/2. Since the
cursor is located on the right rail of the branch, press [F1], —] [— .
9. In the zoom display type the address B3/2, then press [ENTER], then
[F5], ACCEPT. The display appears as follows:
2.1.1.1.*
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ] [ I
I I
] [
<END> OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
7–21
Chapter 7
Creating and Editing a Program File
I:1.0 O:3.0
] [ ( )
0 1
B3 B3
] [ ] [
1 2
I:1.0
] [
1 Add this branch level to the rung.
B3
] [
3
1. From the previous save and continue display, press [ENTER]. The
following display appears:
2.0.0.0.*
] [ ]/[ ( )
] [ ( )
] [ ] [
] [
<END> OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. Because the cursor is positioned on the left power rail of rung 0, move the
cursor to a position within nest level 1, branch level 2 of rung 1; by
pressing the [↓] key , then the [→] key, then the [↓] key twice. The
display changes to the following:
2.1.1.2.*
] [ ]/[ ( )
] [ ( ) Cursor Location
] [ ] [
] [
<END> OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
7–22
Chapter 7
Creating and Editing a Program File
2.1.1.3.*
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ] [ I
I ] [ I
I ] [ OFL I
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
Notice that the length of the newest branch is the same as the rest.
8. Press [ESC] twice to return to the proper menu. Then press
[F5], ACP_RNG.
7–23
Chapter 7
Creating and Editing a Program File
Appending a Branch
Use the append branch command to place the start of a branch to the right of
the cursor location. In this example, you use the append branch command to
create a parallel output branch. Modify rung 1 of your program to appear as
follows:
I:1.0 O:3.0
] [ ( )
0 1
B3 B3 O:3.0 Add this branch to the rung.
] [ ] [ ( )
1 2 2
I:1.0
] [
1
B3
] [
3
1. From the previous save and continue display, press [ENTER] for the main
editing display menu:
2.0.0.0.*
] [ ]/[ ( )
] [ ( )
] [ ] [
] [
] [ OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. Press the [↓] key once then the [→] key three times to position the cursor
on the right power rail of branch level 0:
2.1.1.0.*
] [ ]/[ ( )
] [ ( )
] [ ] [
] [
] [ OFL
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
3. Press [F2], MOD_RNG, then [F2], BRANCH. The branch menu display
appears:
2.1.1.0.*
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ] [ I
I ] [ I
I ] [ OFL I
EXT_UP EXT_DWN APP_BR INS_BR DEL_BR
F1 F2 F3 F4 F5
7–24
Chapter 7
Creating and Editing a Program File
5. Press the [→] key once to place the cursor to the right of the output.
2.1.1.0.6
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ] [ I
I ] [ I
I ] [ I
SELECT BRANCH TARGET, PRESS ENTER OFL
F1 F2 F3 F4 F5
7–25
Chapter 7
Creating and Editing a Program File
9. In the zoom display, type the address O:3/2, then [ENTER], and [ACCEPT].
The display appears as follows:
2.1.1.1.7
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ] [ ( ) I
I ] [ I
I ] [ OFL I
] [ ]/[ ( ) (L) (U) >
F1 F2 F3 F4 F5
10. Press [ESC] twice to return to the proper menu. Then press
[F5], ACP_RNG.
Deleting a Branch
Use the delete branch command to remove a parallel branch and the
instructions located within the branch. Modify rung 1 of your program to
appear as follows:
I:1.0 O:3.0
] [ ( )
0 1
I:1.0 O:3.0
] [ ( )
1 2
Important: Unlike the delete rung and delete instruction commands, there is
no associated undelete branch command, in the HHT, to
re–insert a deleted branch.
7–26
Chapter 7
Creating and Editing a Program File
1. From the previous save and continue display, press [ENTER] for the main
editing display menu:
2.0.0.0.*
] [ ]/[ ( )
] [ ( )
] [ ] [ ( )
] [
] [ OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. Press the [↓] key to position the cursor on rung 1, then press
[F2], MOD_RNG. The following display appears with the cursor
positioned on the left power rail of rung 1:
2.1.0.0.*
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ] [ ( ) I
I ] [ I
I ] [ OFL I
INS_INST BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
7–27
Chapter 7
Creating and Editing a Program File
Important: When you modify a program after leaving the Run mode, the
status bits associated with the instructions that are energized
(true) or forced on, remain in that state even after they are
deleted. This can cause incorrect program operation if these
addresses are associated with other instructions.
6. Press [F2], YES to delete the branch. The display changes as follows:
2.1.1.1.*
] [ ]/[ ( )
I ] [ ( ) I
I ] [ ( ) I
I I
] [
<END>
OFL
EXT_UP EXT_DWN APP_BR INS_BR DEL_BR
F1 F2 F3 F4 F5
7. To remove the bottom branch level, press [↓], then [F5], DEL_BR.
8. Press [F2], YES, then press [ESC], to return to the previous display.
Press [F5], ACP_RNG and save the changes.
7–28
Chapter 7
Creating and Editing a Program File
Deleting an Instruction
Modify your program to appear as follows:
1. From the previous save and continue display, press [ENTER] for the main
editing display menu:
2.0.0.0.*
] [ ]/[ ( )
] [ ( )
] [ ( )
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
2. Press the [→] key twice to place the cursor on the instruction to be
deleted. Then press [F2], MOD_RNG. The following display appears:
XIO:I1:1.0/1 NO FORCE 2.0.0.0.2
I ] [ ]/[ ( ) I
] [ ( )
] [ ( )
<END>
OFL
INS_RNG BRANCH MOD_INST ACP_RNG >
F1 F2 F3 F4 F5
7–29
Chapter 7
Creating and Editing a Program File
2. Press the [→] key two times, then the [↓] key once to position the cursor
on the instruction to be copied. The display appears as follows:
XIC:I1:1.0/2 NO FORCE 2.1.1.1.2
] [ ( )
] [ ( )
] [ ( )
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
5. To insert the deleted instruction, between the input and output instructions
in rung 0, press the [↑] key three times, then the [→] key once to
position the cursor on the output energize instruction. Then press [F2],
MOD_RNG, then [ENTER].
The undelete instruction command operates the same as the insert
instruction command. The instruction is placed to the left of the cursor
position.
7–30
Chapter 7
Creating and Editing a Program File
7. To confirm this, press the [↑] key, then the [→] key twice. The display
shows you that the examine if closed instruction with address I:1.0/1 is
now the second instruction in rung 0.
XIC:I1:1.0/1 NO FORCE 2.0.0.0.2
] [ ] [ ( )
] [ ( )
] [ ( )
<END>
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
1. Starting from the previous display, with the cursor positioned on rung 0,
press [F4], DEL_RNG. The display changes as follows:
XIC:I1:1.0/1 NO FORCE 2.0.0.0.2
] [ ] [ ( )
] [ ( )
] [ ( )
<END>
DATA/FORCES IN LAST STATE,DELETE? OFL
YES NO
F1 F2 F3 F4 F5
7–31
Chapter 7
Creating and Editing a Program File
4. Copy the rung before the END statement. Position the cursor on the END
statement by pressing the [↓] key twice.
The undelete rung command functions the same as the insert rung
command, the new rung is inserted above the rung that the cursor is
positioned on.
5. Press [F5], UND_RNG. The new rung is inserted above the END
statement:
2.2.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
<END> OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
6. Since the two new rungs are identical at this point, you are not concerned
with the position of the next rung. With the cursor positioned on the left
power rail of the first new rung, press [F5], UND_RNG. The second
new rung is inserted above the previous one:
2.2.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
7. To change the addresses of the instructions in the new rungs, position the
cursor on the first instruction by pressing the [→] key. The address
appears in the upper left corner of the display:
XIC:I1:1.0/0 NO FORCE 2.2.0.0.1
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
7–32
Chapter 7
Creating and Editing a Program File
9. To change the address to I:1.0/3, press the [→] key seven times to
position the cursor on the bit element.
10. Press [3], then [ENTER], then [F5], ACCEPT. The new address is
assigned to the instruction.
XIC:I1:1.0/3 NO FORCE 2.2.0.0.1
] [ ] [ ( )
] [ ( )
] [ ( )
I ] [ ] [ ( ) I
] [ ] [ ( )
F1 F2 F3 F4 F5
11. To change the next address, press [→], then [ZOOM]. The zoom display
for this instruction appears:
7–33
Chapter 7
Creating and Editing a Program File
12. Since you are assigning an input address from a different slot, press the
[→] key three times, then press [2]. Press the [→] key three more times,
then press [0], then [ENTER]. Verify that the new address is correct, then
press [F5], ACCEPT.
13. Press the [→] key, then [ZOOM] to change the output address. The zoom
display for the output energize instruction appears:
14. Press the [→] key seven times to position the cursor on the bit element.
15. Press [3], then [ENTER], then [F5], ACCEPT.
16. To complete editing this rung, press [ESC], then [F5], ACP_RNG.
17. Repeat the above procedure for the instructions in rung 3.
18. Save and compile your changes.
Abandoning Edits
If you have made changes that you do not want and they are not saved, press
[ESC] and [F2], YES. This deletes your edits up to the last program save.
7–34
Chapter 7
Creating and Editing a Program File
The Search Function The search function allows you to quickly locate instructions and addresses
in ladder program files. This section shows you how to search for:
• instruction types, such as XIC
• addresses, such as I:1/2
• combined instruction/address, such as OTE + O:3/4
• forced I/O instructions
• a specific rung
The HHT search function is done only within the existing program file.
Subroutine files require that you go to those files to initiate another search.
The search function is accessible offline, from the edit file menu display
[F3], SEARCH, or...
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
7–35
Chapter 7
Creating and Editing a Program File
Additionally, a search rung feature is available from either the offline, edit
file display or the online, monitor file display, using the [RUNG] key located
on the keypad.
7–36
Chapter 7
Creating and Editing a Program File
The display changes as follows with the cursor on the first examine if closed
instruction. Notice the instruction mnemonic is displayed in the search
buffer, in the lower left corner of the display:
XIC:I1:1.0/0 NO FORCE 2.0.0.0.1
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
The instruction XIC + OFL
mnemonic is displayed CUR–INS CUR–OPD NEW–INS UP FORCE
in the Search Buffer. F1 F2 F3 F4 F5
Each time the search object is found, the new cursor location becomes the
search start point.
7–37
Chapter 7
Creating and Editing a Program File
You may continue to search for each XIC instruction in the program by
pressing [ENTER]. When you reach the last occurrence of this instruction
in the program, the cursor wraps around to the start of the program.
6. To conclude this search procedure and clear the search buffer, press
[ESC].
7–38
Chapter 7
Creating and Editing a Program File
3. To search for the specific address, press [SHIFT], then type the
abbreviated form of the address, I:1/1. Then press [ENTER] to place the
address into the search buffer:
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
The address is ( )
displayed in the ] [ ] [
+ I:1/1 OFL
search buffer. CUR–INS CUR–OPD NEW–INS UP FORCE
F1 F2 F3 F4 F5
4. Press [ENTER] again, to find the first occurrence of the address, which is
the second instruction in rung 0.
XIC:I1:1.0/1 NO FORCE 2.0.0.0.2
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
+ I:1/2 OFL
CUR–INS CUR–OPD NEW–INS UP FORCE
F1 F2 F3 F4 F5
5. Press [ENTER] again, to find the next occurrence of the address, which is
located in rung 1, nest level 1, branch level 1, instruction number 2:
XIC:I1:1.0/1 NO FORCE 2.1.1.1.2
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
<END>
+ I:1/1 OFL
CUR–INS CUR–OPD NEW–INS UP FORCE
F1 F2 F3 F4 F5
7–39
Chapter 7
Creating and Editing a Program File
1. Use the cursor keys to position the cursor on the left power rail of rung 0:
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
OFL
INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG >
F1 F2 F3 F4 F5
7–40
Chapter 7
Creating and Editing a Program File
4. To enter the address, press [SHIFT], then type the abbreviated address
O:3/4. Then press [ENTER] to insert the information into the search
buffer. The display appears as follows:
2.0.0.3.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
Instruction Mnemonic and OTE + O:3/4 OFL
the Address for the Output CUR–INS CUR–OPD NEW–INS UP FORCE
Energize Instruction F1 F2 F3 F4 F5
Each time you bring up the search display, the direction function displays UP:
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
+ OFL
CUR–INS CUR–OPD NEW–INS UP FORCE
F1 F2 F3 F4 F5
With UP displayed, the search starts at the cursor location, in this case at the
start of the program, and continues toward the end of the program.
7–41
Chapter 7
Creating and Editing a Program File
To change the search direction, press [F4], UP. The display changes as
follows:
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
+ OFL
CUR–INS CUR–OPD NEW–INS DOWN FORCE
F1 F2 F3 F4 F5
With DOWN displayed, the search starts at the cursor location, in this case at
the start of the program, wraps around to the end of the program and
continues toward the start of the program.
Whenever you exit the search function, the direction display defaults back to
UP.
In the Online Monitor mode, use the search forced I/O function to locate all
forced inputs and outputs that are inserted in your program.
In the Offline monitor mode, use the search forced I/O function to locate all
forced inputs and outputs that were inserted into your program the last time it
was operating in the Run mode before being uploaded to the HHT. Then
document the location of each force and investigate the effects on machine
operation before downloading the modified program.
7–42
&KDSWHU
&UHDWLQJ DQG (GLWLQJ D 3URJUDP )LOH
,Q WKLV H[DPSOH D IRUFH KDV EHHQ LQVHUWHG LQWR WKH ODGGHU SURJUDP RQ LQSXW
, 6WDUW IURP WKH RIIOLQH HGLW ILOH GLVSOD\ ZLWK WKH FXUVRU SRVLWLRQHG RQ
WKH OHIW SRZHU UDLO RI UXQJ
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
OFL
INS_RNG MOD_RNGSEARCH DEL_RNG UND_RNG>
) ) ) ) )
7R VHDUFK IRU DQ\ IRUFHV SUHVV [F3] 6($5&+ 7KH VHDUFK GLVSOD\
DSSHDUV
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
+ OFL
&85í,16 &85í23' 1(:í,16 UP FORCE
) ) ) ) )
3UHVV [ENTER] WR ILQG WKH ILUVW IRUFH 7KH FXUVRU LV SRVLWLRQHG RQ WKH
IRUFHG ELW 7KH LQVWUXFWLRQ PQHPRQLF DQG DGGUHVV WKH IRUFH VWDWXV RI WKH
ELW DQG WKH ORFDWLRQ RI WKH LQVWUXFWLRQ DUH GLVSOD\HG DORQJ WKH WRS RI WKH
GLVSOD\
XIC:I1:1.0/0 FORCE ON 2.0.0.0.1
)RUFH ,QIRUPDWLRQ ] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
ENTER TO FIND FORCE OFL
UP
) ) ) ) )
7R ILQG DQ\ DGGLWLRQDO IRUFHV SUHVV [ENTER] DJDLQ 6LQFH WKLV SURJUDP
FRQWDLQV QR RWKHU IRUFHV SUHVV [ESC] WZLFH WR H[LW WKH VHDUFK IXQFWLRQ
ï
&KDSWHU
&UHDWLQJ DQG (GLWLQJ D 3URJUDP )LOH
1 6 , 2
35(/(1 $&&326 8 63$&( (6&
$ % &
' ( )
7 5 0
581* =220
7R XVH WKH VHDUFK UXQJ IXQFWLRQ \RX PXVW EH LQ HLWKHU WKH RIIOLQH HGLW ILOH
GLVSOD\ RU WKH RQOLQH PRQLWRU ILOH GLVSOD\
7R VHDUFK IRU UXQJ VWDUW DW WKH IROORZLQJ GLVSOD\ ZLWK WKH FXUVRU ORFDWHG
RQ WKH OHIW SRZHU UDLO RI UXQJ
2.0.0.0.*
] [ ] [ ( )
] [ ( )
] [ ( )
] [ ] [ ( )
] [ ] [ ( )
OFL
INS_RNG MOD_RNGSEARCH DEL_RNG UND_RNG>
) ) ) ) )
ï
&KDSWHU
&UHDWLQJ DQG (GLWLQJ D 3URJUDP )LOH
7\SH 3 WKHQ SUHVV [ENTER] 7KH FXUVRU LV QRZ SRVLWLRQHG RQ WKH OHIW
SRZHU UDLO RI UXQJ
2.3.0.0.*
] [ ] [ ( )
<END>
OFL
INS_RNG MOD_RNGSEARCH DEL_RNG UND_RNG>
) ) ) ) )
&UHDWLQJ DQG 'HOHWLQJ 7KH PHPRU\ PDS IXQFWLRQ DOVR DOORZV \RX WR FUHDWH DQG GHOHWH GDWD HOHPHQWV
DQG ILOHV 7R ORFDWH WKH 0HPRU\ 0DS IXQFWLRQ IURP WKH ++7·V PDLQ PHQX
3URJUDP )LOHV SUHVV [F3] 352*B0$,17 DQG [F5] 0(0B0$3
<RX FDQQRW FUHDWH DGGLWLRQDO HOHPHQWV LQ WKH RXWSXW ILOH ILOH LQSXW ILOH
ILOH RU VWDWXV ILOH ILOH 7KHVH ILOHV FDQ RQO\ EH FUHDWHG WKURXJK WKH
SURFHVVRU DQG ,2 FRQILJXUDWLRQ
ï
&KDSWHU
&UHDWLQJ DQG (GLWLQJ D 3URJUDP )LOH
7KH PHPRU\ PDS LQGLFDWHV WKDW WKH LQWHJHU 1 ILOH VL]H LV HOHPHQWV
HTXLYDOHQW WR ZRUGV DQG WKH ODVW DGGUHVV LV 1
7R GHOHWH HOHPHQWV 1 WKURXJK 1 SUHVV [F2] '(/B'7 IURP WKH
PHPRU\ PDS GLVSOD\ W\SH N7:5 DQG SUHVV [ENTER] 7KH IROORZLQJ GLVSOD\
DSSHDUV
7KH PHPRU\ PDS QRZ LQGLFDWHV WKDW WKH LQWHJHU 1 ILOH VL]H LV HOHPHQWV
HTXLYDOHQW WR ZRUGV DQG WKH ODVW DGGUHVV LV 1
ï
Chapter
8
Saving and Compiling a Program
This chapter discusses the procedures used to save and compile ladder
programs. Topics include:
• save and continue editing
• save and exit offline editing
• view memory layout
Saving and Compiling When you are entering a new program or editing an existing program, the
ladder program is stored in the work area of the HHT. After completing your
Overview editing session, you must save your program to the HHT RAM memory.
First, your program is compiled, transforming it into a more efficient
package. Then the program and data files are updated. When you save and
exit, a summary of the data words and instruction words used along with the
available memory is updated.
Saving a Program As mentioned in the previous chapter, whenever you are creating a new
program or editing an existing one, you should periodically save your work.
In the event of a power loss to the HHT, any edits that you have made up to
that point, are not recoverable. Save and Continue (SAVE_CT) allows you
to save your work and continue editing. Save and Exit (SAVE_EX) allows
you to save your work and exit offline editing.
8–1
Chapter 8
Compiling and Saving a Program
Important: The above display appears if you have a SLC 5/02. If you have
a fixed controller or a SLC 5/01 processor only [F1]and [F5]
appear.
8–2
Chapter 8
Compiling and Saving a Program
If you selected SAVE_CT, you are returned to the editing display when
the compile and save is complete. If you selected SAVE_EX, the
following display appears:
Yes: Online access to the processor program and data table using a
programming terminal is unrestricted. This is the default.
No: Online access to the processor program and data table is not permitted
unless a matching copy of the online processor program is in the HHT. You
cannot:
• monitor the program
• enter or change the processor password
• upload the online processor program to HHT RAM
• transfer the program from the processor memory to a memory module
However, you can:
• clear the processor memory
• download a different program to the processor
• change the processor mode
Important: If you lose or delete the offline copy of the program, you cannot
access the program in the controller. You must clear the
controller memory and re–enter the program.
8–3
Chapter 8
Compiling and Saving a Program
Important: The HHT can save the program enabling Test Single Rung;
however, the Test Single/Rung mode is available with APS.
Allow: The processor will not verify if the indexed address, the sum of the
base address, and the offset value is in the same data file as the base address.
The processor does check to ensure that the indexed address is contained
within the data table address space.
Disallow: The processor performs runtime checks on indexed addresses to
ensure that the indexed address is contained within the same data file as the
base address. This is the default selection.
Outputs: Only the output file (O0) is protected from external data
modification. This is the default selection.
None: External devices may change any data address within the data table
files, including the output file (O0).
All: The entire data table is protected from external data modification.
8–4
Chapter 8
Compiling and Saving a Program
Viewing Program Memory The memory map function allows you to view your program memory layout.
Layout It shows you the type and size of the data files used. It also gives you a
summary of the number of the program files created and the number of
instructions used in them. Lastly, it shows you how much user memory is
left. This section covers:
• viewing data files
• viewing program file sizes
To view your program memory layout, start from the previous display or
select [F3], PROG_MAINT from the main display.
1. Press [F5], MEM_MAP. The following display appears:
This display shows one output file word and two input file words created
by the I/O configuration.
There are 16 words in the status file (file 2). The number of words in the
status file is determined by the particular processor:
• fixed and SLC 5/01 processor–16 words
• SLC 5/02 processor–33 words. There is one word in bit file 3 due to
addresses used in the sample ladder program (B3/1, B3/2, B3/3).
To view additional data files, press [F3], NEXT_PG.
For a detailed description of data files refer to chapter 4, Data File
Organization and Addressing.
2. To view the memory usage, press [F5], PRG_SIZE. The following
display appears:
OFL
F1 F2 F3 F4 F5
8–5
Chapter 8
Compiling and Saving a Program
If you had not saved your program after adding or deleting program files,
or modifying data files, the following display appears with asterisks (*)
indicating that the program has not been compiled.
OFL
F1 F2 F3 F4 F5
8–6
Chapter
9
Configuring Online Communication
This chapter describes online communication between the HHT and SLC 500
processors. Topics include:
• online configuration
• the Who function
Online Configuration As described in chapter 1, the HHT may be connected directly to a port
located on an SLC 500 processor or it may be connected to any fixed, SLC
5/01, or SLC 5/02 processor that is active on a DH–485 network.
Important: The HHT is not compatible with the SLC 5/03 processor.
Node 1
Node 0
1747–PIC
Interface Converter
9–1
Chapter 9
Configuring Online Communication
To configure your HHT for online communication, begin at the main menu
display of the HHT.
SLC 500 PROGRAMMING SOFTWARE Rel. 2.03
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
From the UTILITY menu, press [F1], ONLINE. The display changes as
follows:
9–2
Chapter 9
Configuring Online Communication
Because the program files match, there are 2 menu screens and 10 function
keys. The greater than sign (>), in the lower right corner of the display,
indicates that a second function key menu is available.
Exceptions
The function keys and menus vary depending on how the HHT and processor
programs relate. In the following example, assume that the HHT has
previously been attached to this processor, but the offline program in the
HHT has been altered and no longer matches the program in processor RAM.
If the HHT and processor programs do not match, the following display
appears when you press [F1], ONLINE:
Program Directory
Programmer Processor
Prog: 1000 Prog: 1000
File: 222 File:
Exec Files: 4 Exec Files: 4
Data Files: 9 Data Files: 9
PROGRAM FILES DIFFER RUN
OFFLINE UPLOAD DWNLOAD MODE CLR_PRC
F1 F2 F3 F4 F5
When the program files do not match, there is only one menu display and
five function keys. Notice the absence of the greater than sign (>), in the
lower right corner.
9–3
Chapter 9
Configuring Online Communication
Another exception is when the processor contains the default program. The
following screen appears:
Program Directory
Programmer Processor
Prog: 1000 Prog: DEFAULT
File: 222 File:
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 3
DEFAULT FILE IN PROCESSOR PRG
OFFLINE DWNLOAD CLR_PRC MEM_PRC
F1 F2 F3 F4 F5
The Who Function The Who function allows you to view the nodes on the network, run network
diagnostics, attach to and communicate with a specific node, change a node
configuration, and set and clear ownership.
From the utility display, press [F2], WHO. The following display appears:
Important: The HHT uses top–line editing. This means that the
information shown nearest the top of the display is the current
node address. For example, the above display indicates that
pressing [F3], ATTACH, causes the HHT to go online with
node 2.
In the following sections, “selected” refers to the node nearest the top of the
display. The current node is also indicated on the status line of the display.
To change the node address, or to view additional nodes on the network, use
the [↑] and [↓] keys.
9–4
Chapter 9
Configuring Online Communication
9–5
Chapter 9
Configuring Online Communication
Diagnostics
1. To monitor the diagnostics of the network or the selected node, press
[F1], DIAGNSTC from the Who display. The following display appears:
2. To monitor the diagnostic display of the selected node press [F1], NODE.
The following display appears:
F1 F2 F3 F4 F5
4. From this display, you can reset the messages sent and messages received
counters by pressing [F5], RESET.
5. Press [ESC] twice to return to the Who menu.
9–6
Chapter 9
Configuring Online Communication
Attach
The Attach function initiates communication between the HHT and a
processor. The Attach function allows you to:
• upload/download a program
• change processor operating modes
• clear the processor memory
• enter or remove a password/master password
• transfer memory between processor RAM and EEPROM
• monitor program execution
• monitor and change data file values
• force I/O
• search the user program for specific instructions and/or addresses
The function keys and menus vary depending on how the HHT and processor
programs relate. In this example, attach the HHT to node 4. Assume that the
HHT and processor programs are identical.
9–7
Chapter 9
Configuring Online Communication
Because the program files match, there are 2 menu displays and 10
function keys. The greater than sign (>), in the lower right corner of the
display, indicates that a second function key menu is available.
At this point, all the functions listed on page 9–3 are available to you.
Return to the utility display by pressing [F1], OFFLINE or press [ESC],
then [F2], YES.
Exception
The function keys and menus vary depending on how the HHT and processor
programs relate. In this example, attach the HHT to node 2. Assume that the
processor contains a program other than the default, and the program is
different from the program in the HHT.
1. From the utility menu display, press [F2], WHO to bring up the Who
display:
2. Use the [↑] and [↓] keys to change the order of the nodes listed, if
necessary. Press [F3], ATTACH, since the current node is already 2.
The following menu is displayed:
Program Directory
Programmer Processor
Prog: 1000 Prog: 2345
File: File:
Exec Files: 4 Exec Files: 4
Data Files: 9 Data Files: 9
PROGRAM FILES DIFFER PRG
OFFLINE UPLOAD DWNLOAD MODE CLR_PRC
F1 F2 F3 F4 F5
Node Configuration
The Node Configuration function allows you to configure a processor or the
HHT for online communication. The Node Configuration functions are:
• change the node address
• change the maximum address
• change the baud rate
9–8
Chapter 9
Configuring Online Communication
You do not need to cycle power if you change your HHT node address, the
address changes as soon as you press [ENTER].
9–9
Chapter 9
Configuring Online Communication
The default maximum node address for all SLC 500 family processors and
programming devices is 31. To minimize the network scan time, it is
recommended to eliminate any unused node addresses of a higher number
than the addresses used on the network. For example, if the highest node
address used on your network is 5, then you should set the maximum node
address of all devices on the network to 5. Consequently, the polling devices
on the network no longer take the time to look for nodes 6 through 31.
Important: If you later add a device to the network with a higher node
address than the present maximum node address, you must
change the maximum node addresses to include that address.
Failure to do so causes the devices on the network to ignore the
new device.
Important: The baud rate change to a processor does not take effect until
power is cycled to the processor.
9–10
Chapter 9
Configuring Online Communication
When the owner exits the network or goes offline, another terminal can clear
the ownership of the inactive node and gain access to an owned processor
file.
In this example, the SLC 5/02 processor with node address 5 is owned by the
APS terminal with address 0, which is no longer online. Clear node 0’s
ownership of the processor and set the HHT, node 1, as owner of node 5.
2. To claim ownership of node 5, press the [↓] key twice, then press [F5],
OWNER. The display changes as follows:
4. To clear ownership, place the cursor on the desired node and press [F5],
CLR_OWNR. In order to succeed, you must be the current owner or the
current owner cannot be active on the network.
9–11
Chapter 9
Configuring Online Communication
9–12
Chapter
10
Downloading/Uploading a Program
Downloading a Program When you have finished creating your program offline, you must download it
from the HHT to a processor. In this example you will download program
1000, that you created in the previous chapters.
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
F1 F2 F3 F4 F5
10–1
Chapter 10
Downloading/Uploading a Program
In this example assume that the HHT has not been previously attached to
a processor.
3. Press [F2], WHO.
4. Use the [↑] and [↓] keys to display node 4 as the current node. The
display should appear as follows:
Node Addr. Device Max Addr./Owner
4 5/01 (5)
5 5/02 (5) Indicates that node 4 is the current
1 TERMINAL (5) node.
3 500–20 (5)
Program Directory
Programmer Processor
Prog: 1000 Prog: DEFAULT
File: 222 File: DEFAULT indicates that a
Exec Files: 4 Exec Files: 3 program is not in the pro
Data Files: 9 Data Files: 3 cessor.
DEFAULT FILE IN PROCESSOR PRG
OFFLINE DWNLOAD CLR_PRC MEM_PRC
F1 F2 F3 F4 F5
10–2
Chapter 10
Downloading/Uploading a Program
Program Directory
Programmer Processor
Prog: 1000 Prog: 1952
File: 222 File:
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 9
DOWNLOAD TO PROCESSOR? PRG
YES NO
F1 F2 F3 F4 F5
You are now ready to perform the functions described in the following
chapters. These functions are:
• change processor operating mode
• transfer memory
• monitor or edit data files
• monitor online program operation
Uploading a Program Any changes made to a program running in a processor, such as data file
values or bit changes, or I/O forces installed, reside in the processor RAM.
If you wish to save these changes, you must upload the program from the
processor to the HHT. Also, if you wish to monitor a program, other than the
program stored in the HHT, you must upload that program.
10–3
Chapter 10
Downloading/Uploading a Program
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
1747 – PTA1E
Allen–Bradley Company Copyright 1990
All Rights Reserved
F1 F2 F3 F4 F5
or this display appears after the password is entered (for the current
offline program, which is 1000) or if a password is not required:
File Name: 222 Prog Name:1000
File Name Type Size(Instr)
0 System 77
1 Reserved 0
2 222 Ladder 13
3 Ladder 1
OFL
ONLINE WHO PASSWRD CLR_MEM
F1 F2 F3 F4 F5
3. Press [F2], WHO, then use the [↑] and [↓] keys to display node 3 as the
current node. The display should appear as follows:
Node Addr. Device Max Addr./Owner
3 500–20 (5)
4 5/01 (5) Indicates that node 3
5 5/02 (5) is the current node.
1 TERMINAL (5)
10–4
Chapter 10
Downloading/Uploading a Program
Program Directory
Programmer Processor
Prog: 1000 Prog: 03CLOCK
File: 222 File: 03M
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 9
ENTER PASSWORD: PRG
F1 F2 F3 F4 F5
or this display appears after the password is entered (for the current online
program, which is 03CLOCK) or if a password is not required:
Program Directory
Programmer Processor
Prog: 1000 Prog: 03CLOCK
File: 222 File: 03M
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 9
PROGRAM FILES DIFFER PRG
OFFLINE UPLOAD DWNLOAD MODE CLR_PRC
F1 F2 F3 F4 F5
Program Directory
Programmer Processor
Prog: 1000 Prog: 03CLOCK
File: 222 File: 03M
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 9
OVERWRITE EXISTING PROGRAM? PRG
YES NO
F1 F2 F3 F4 F5
6. Press [F2], YES to replace program 1000 with 03CLOCK in the HHT
RAM.
Program 03CLOCK is now stored in the HHT RAM and program 1000
has been erased.
You are now ready to perform the following functions:
• go offline and edit the program
• change processor operating mode
• clear processor memory
• change the password/master password
• transfer memory
• monitor or edit data files
• monitor online program operation
10–5
Chapter
11
Processor Modes
Program Mode
The Program mode facilitates the transfer of programs through the download
and upload function. In this mode the processor does not scan or execute the
ladder program and all outputs are de–energized regardless of their current
states.
11–1
Chapter 11
Processor Modes
Test Mode
The Test mode allows you to:
• Monitor the current ladder program as it is being executed.
• Use the search function.
• Force I/O.
• Monitor and edit data.
While you are in the Test mode, the processor scans or executes the ladder
program, monitors input devices, and updates the output data files without
energizing output circuits or devices.
Single Scan - In this mode, the processor executes a single operating cycle
which includes reading the inputs, executing the ladder program, and
updating all data without energizing output circuits.
The remaining portion of this chapter takes you step by step through
changing processor modes.
Changing Modes The previous chapters described going online to a processor and
downloading/uploading programs.
11–2
Chapter 11
Processor Modes
3. Change the processor to the Run mode by pressing [F1], RUN. The
display requests you to confirm your selection:
11–3
Chapter
12
Monitoring Controller Operation
Monitoring a Program File The following demonstrates how to monitor a program file while online:
1. Start from the main online display:
F1 F2 F3 F4 F5
3. To view the main program file (2), press 2, then [ENTER]. The ladder
program display appears:
2.0.0.0.*
The cursor location is displayed
] [ ] [ ( ) in the upper right corner. This
] [ ( ) indicates that the cursor is
Program Cursor ] [ ] [ located in program file 2, rung 0,
( ) nest level 0, branch level 0 and
] [ ] [ ( ) the asterisk (*) means the cursor
( ) is not on an instruction, in this
] [ ] [ case the cursor is located on the
RUN
MODE FORCE EDT_DAT SEARCH left power rail.
F1 F2 F3 F4 F5
Another Mode Processor Node Address and
Menu Operating Mode
12–1
Chapter 12
Monitoring Controller Operations
True/False Indication
Once the processor is operating in the Run or Test mode, the ladder program
indicates the logical state of the instructions, either true or false.
In the previous display and on the following pages, true instructions and the
program cursor appear as follows:
• true instructions are intensified (heavier line weight)
• the cursor is the blinking reverse video block
• a true instruction at the cursor location flashes between the intensified
instruction and the reverse video block
Monitoring Data Files This section describes the types of data files, where to access them in the
HHT, and how to monitor them.
Data Files
These files contain information used in your ladder program. Data table files
include:
• Data File 0 – Output
• Data File 1 – Input
• Data File 2 – Status
• Data File 3 – Binary or Bit
• Data File 4 – Timer
• Data File 5 – Counter
• Data File 6 – Control
• Data File 7 – Integer
• Data File 8– Reserved file
• Data Files 9–255 – User created files. They can be bit, timer, counter,
control, and integer files.
When offline, use data files 3–255 to set up sequencers, math routines,
“recipes,” and look-up tables. When online, use data files to reset timers and
counters, and sequencers to test and/or troubleshoot.
12–2
Chapter 12
Monitoring Controller Operations
Option 1
While offline, press [F3], PROGMAINT, from the menu display, then
[ENTER], and [F1], EDT_DAT.
Option 2
While monitoring a program offline, press [ENTER] and [F1], EDT_DAT.
Option 3
While online, press [ENTER] from the main online display, then [F4],
EDT_DAT.
Option 4
While monitoring a program online, press [F3], EDT_DAT.
Important: Data table file protection is available with any of the SLC 500
processors. However, the form of protection can only be
changed during offline programming.
• Fixed and SLC 5/01 processors – output files are always
protected and all other files are unprotected from online
changes while the processor is in the Run mode.
• SLC 5/02 processors – at the time you save your program
you can protect output files, all files, or no files from online
changes while the processor is in the Run mode.
C5:0 0:3.0
Rung 1 ] [ ( )
CU 0
C5:0 0:3.0
Rung 2 ] [ ( )
DN 1
C5:0 0:3.0
Rung 3 ] [ ( )
OV 2
I:1.0 0:5.0
Rung 4 ] [ (RES)
1
END
12–3
Chapter 12
Monitoring Controller Operations
The following HHT display shows the ladder program being monitored in
the online mode. The cursor is located on the XIC instruction C5:0/DN on
rung 2.
XIC:C5:0/13 2.2.0.0.1
] [ (CTU)
] [ ( )
] [ ( )
] [ ( )
] [ (RES)
RUN
MODE FORCE EDT_DAT SEARCH
F1 F2 F3 F4 F5
When you are monitoring a file, the location of the cursor in the ladder
program determines how you access a particular address within a data file:
• If the cursor is on an instruction when you press [F3], EDT_DAT, the
cursor moves to the address (bit or word level) of the instruction in the
appropriate data file.
• If the cursor is on a power rail or branch intersection when you press [F3],
EDT_DAT, the cursor moves to the beginning of the first data file, the
Output data file. You can then use the ADDRESS function key, followed
by [ENTER] to specify any address in the data table.
Monitor the counter data file by pressing [F3], EDT_DAT. The following
display appears:
COUNTER C5:0
CU CD DN OV UN UA
STATUS 0 0 0 0 0 0
PRESET 3
ACCUM 0
12–4
Chapter 12
Monitoring Controller Operations
Data File Displays The following section provides you with an example of what each data table
display appears as. The radix (or number system) that the file elements are
displayed in is fixed: binary for Input, Output, and Bit files; decimal for
Integer files; and formatted display for Status, Timer, Counter, and Control
files.
To access the data table, place the cursor on the left power rail in the online
monitor display and press [F3], EDT_DAT. The first file in the data table
appears, the output data file.
Address 15 data 0
O0:3.0 0000 0000
O0:3.0/0 = 0 RUN
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
To display the next consecutive data file – the input data file, press [F2],
NEXT_FL.
I1:1.0/0 = 0 RUN
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
12–5
Chapter 12
Monitoring Controller Operations
To display the next consecutive data file – the status data file, press [F2],
NEXT_FL.
12–6
Chapter 12
Monitoring Controller Operations
The displays below show the 33–word status file for a SLC 5/02 processor.
To move between displays, press [F3], NEXT_PG. To display the next
consecutive data file – the bit data file, press [F2], NEXT_FL.
Status File
S2:11 & S2:12 I/O Slot Enables
1 2 3
0 0 0 0
1111 1111 1111 1111 1111 1111 1111 1111
Slot = 0
S2:11/0 = 1 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
12–7
Chapter 12
Monitoring Controller Operations
B3/0 = 0 RUN
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
To display the next consecutive data file – the timer data file, press [F2],
NEXT_FL.
Timer T4:0
EN TT DN
STATUS 0 0 0
PRESET 1000
ACCUM 0
STATUS=000 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
To display the next consecutive data file – the counter data file, press [F2],
NEXT_FL.
Counter C5:0
CU CD DN OV UN UA
STATUS 0 0 0 0 0 0
PRESET 10
ACCUM 0
STATUS=000000 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
To display the next consecutive data file – the control data file, press [F2],
NEXT_FL.
12–8
Chapter 12
Monitoring Controller Operations
Control R6:0
EN EU DN EM ER UL IN FD
STATUS 0 0 0 0 0 0 0 0
PRESET 25
ACCUM 0
STATUS=0000000 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
To display the next consecutive data file – the integer data file, press [F2],
NEXT_FL.
Address Data
N7:0 1098
N7:1 0
N7:2 2000
N7:3 5
N7:0=1098 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
To display the next consecutive data file, press [F2], NEXT_FL. If a data file
numbered 8 or higher has been used, the displays will change accordingly.
Otherwise, the HHT wraps around to the start of the data table and displays
the output data file.
12–9
Chapter 12
Monitoring Controller Operations
To change online data, begin by monitoring the program online while the
processor is in either the Run or Test Continuous Scan (CSN) mode.
Counter C5:0
CU CD DN OV UN UA
STATUS 0 0 1 0 0 0
PRESET 3
ACCUM 16
STATUS=001000 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
In this display, the accumulator (ACCUM) is 16 and the done bit DN (bit
13) is set. Reset the counter by making rung 4 true momentarily. The
accumulator value and the done bit are reset to zero.
2. Change the preset and accumulator values from the EDT_DAT screen.
Press the down arrow key to place the cursor on the preset. Type 32767
(maximum value) and press [ENTER]. Press the down arrow key to place
the cursor on the accumulator (ACCUM). Type 32767 (maximum value)
and press [ENTER]. The display appears as follows:
Counter C5:0
CU CD DN OV UN UA
STATUS 0 0 1 0 0 0
PRESET 32767
ACCUM 32766
STATUS=32766 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
12–10
Chapter 12
Monitoring Controller Operations
Counter C5:0
CU CD DN OV UN UA
STATUS 0 0 1 1 0 0
PRESET 32767
ACCUM –32768
STATUS=–32768 RUN
ADDRESS NEXT_FL PREV_FL NEXT_PG PREV_PG
F1 F2 F3 F4 F5
12–11
Chapter
13
The Force Function
Forcing I/O The force function allows you to override the actual status of external input
circuits by forcing external input data file bits On or Off. You can also
override the processor logic and status of output data file bits by forcing
output circuits On or Off.
You can install and then enable or disable forces with the processor in any
mode while monitoring your file online.
To force an external input, the following program (the same program used in
the last chapter), is used throughout this chapter.
I:0.0 B3 B3 B3
0 ] [ ]/[ ] [ ( )
1 10 11 12
Operation: This program is used to achieve the maintained contact
I:0.0 B3 B3 B3 action of an On-Off toggle switch using a momentary contact push
1 ] [ ]/[ ]/[ ( ) button. (Press for on; press again for off.)
1 10 12 11 The first time you press the push button (represented by address
I:0/1), instruction B3/11 is latched, energizing output O:0/0. The
B3 second time you press the push button, instruction B3/12 unlatches
] [ instruction B3/11, de-energizing output O:0/0. Instruction B3/10
11 prevents interaction between instructions B3/12 and B3/11.
Note: If you have not yet entered this program and downloaded, refer
I:0.0 B3 to chapter 10. The controller configuration and I/O addresses
2 ] [ ( ) programmed in the HHT must match the controller you download to.
1 10 This program is written for a fixed controller.
B3 O:0.0
3 ] [ ( )
11 0
13–1
Chapter 13
The Force Function
Forcing an External Input Installing forces on input data file bits only affects the input force table.
However, enabling the installed forces affects the input force table, input data
file, and, thus, the program logic. The effects on the program logic of
installed and enabled forces can be seen in both the Run and Test modes.
In the following example, the HHT is online, monitoring the program in the
Run mode. The cursor is located on external input I:0/1. The display
indicates NO FORCE.
1. Select the force function by pressing [F2], FORCE. The force functions
appear:
Note: The HHT does not have access to the force table.
13–2
Chapter 13
The Force Function
The force is installed, but not yet enabled. This is indicated by the
flashing F appearing on the prompt line. This is also indicated by the
FORCED I/O LED on the controller, which is now flashing.
3. Enable the force by pressing [F5], ENABLE. The prompt ARE YOU
SURE? is indicated.
13–3
Chapter 13
The Force Function
4. To verify enabling of forces, press [F2]. The force is enabled. The letter
F on the prompt line is now on continuously. Also, the FORCED I/O
LED of the processor is on continuously.
2. Press [F1], ON. Rungs 1 and 3 are now false and rung 2 is true. The
output 0 LED of the controller is no longer on.
13–4
Chapter 13
The Force Function
3. Press [F2], OFF. All rungs are false. Program operation is back to the
starting point. The display shows FORCE OFF, but the force is still
enabled.
13–5
Chapter 13
The Force Function
Searching for Forced I/O To search for forced I/O, you can have the cursor located anywhere in the
program at the beginning of the search. In the following display, the cursor
is located in rung 0, on a forced instruction. The force is enabled.
1. Set up these initial conditions (a repeat of what was done on page 13–2).
13–6
Chapter 13
The Force Function
6. Press [ENTER]. The cursor has wrapped around to rung 0, the first
occurrence of a forced instruction.
Notes:
13–7
Chapter 13
The Force Function
Forcing an External Output A forced external output circuit is independent of the internal logic of the
ladder program and the output data file. Installing forces on output circuits
only affects the output force table. Enabling installed forces does not affect
the output data file or the program logic. However, it does affect the output
circuit. The effects of installed and enabled forces can only be seen in the
Run mode. The Test mode does not energize output circuits.
The procedure for forcing an external output is the same as for forcing an
external input. However, the HHT always shows the logical state of the
instruction. For example, the following display shows output O:0/0 forced
off. The controller output LED is off, yet the rung and output data file show
the output to be logically true.
13–8
Chapter 13
The Force Function
The following display shows output O:0/0 forced on. The controller output
LED is on, yet the rung and output data file show the output to be logically
false.
Forces Carried Offline When your program has forced I/O and you go offline, the FORCE ON and
FORCE OFF indications appear in the offline ladder diagram displays,
although the I/O data files do not change. If you subsequently remove the
forces online, then go offline, the FORCE ON and FORCE OFF indications
no longer appear in the offline ladder diagram displays.
13–9
Chapter
14
Using EEPROMs and UVPROMs
Using an EEPROM Memory You can transfer a program from the processor to an EEPROM and vice
versa. The procedures are similar.
Module
• Make sure the EEPROM is installed in the processor. Disconnect
controller power and insert the EEPROM in the processor. (Access to the
EEPROM socket is gained by removing the front cover of the fixed I/O
controllers or by removing the processor module of modular controllers.)
14–1
Chapter 14
Using EEPROMs and UVPROMs
14–2
Chapter 14
Using EEPROMs and UVPROMs
Program Directory
Programmer Processor
Prog: 1000 Prog: DEFAULT
File: 222 File:
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 3
DEFAULT FILE IN PROCESSOR PRG
OFFLINE DWNLOAD CLR_PRC MEM_PRC
F1 F2 F3 F4 F5
Program Directory
Programmer Processor
Prog: 1000 Prog: DEFAULT
File: 222 File:
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 3
XFER MEMORY MODULE TO PROC? PRG
YES NO
F1 F2 F3 F4 F5
Program Directory
Programmer Processor
Prog: 1000 Prog: 1066
File: 222 File:
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 9
PROGRAM FILES DIFFER PRG
OFFLINE UPLOAD DWNLOAD MODE CLR_PRC
F1 F2 F3 F4 F5
14–3
Chapter 14
Using EEPROMs and UVPROMs
14–4
Chapter 14
Using EEPROMs and UVPROMs
10.Press [F2]. The prompt line indicates XFERRING MEMORY MODULE TO PROC
momentarily, then returns to this display:
Program Directory
Programmer Processor
Prog: 1000 Prog: 1066
File: 222 File:
Exec Files: 4 Exec Files: 3
Data Files: 9 Data Files: 9
PROGRAM FILES DIFFER PRG
OFFLINE UPLOAD DWNLOAD MODE CLR_PRC
F1 F2 F3 F4 F5
EEPROM Burning Options You can burn a program into an EEPROM memory module using a processor
that is different from the one used to run the program. The following
conditions describe how to accomplish this.
You cannot use a SLC 5/02 processor to burn a program configured for a
SLC 5/01 processor or fixed controller. A program configured for a SLC
5/01 processor or fixed controller can only be downloaded to a SLC 5/01
processor or fixed controller.
You cannot use a SLC 5/01 processor or fixed controller to burn a program
configured for a SLC 5/02 processor. A program configured for a SLC 5/02
processor can only be downloaded to a SLC 5/02 processor.
14–5
Chapter 14
Using EEPROMs and UVPROMs
UVPROM Memory Modules You may choose to use UVPROM modules. These modules are protected
against electrical erasure. You can transfer a program from the UVPROM to
the processor, but you cannot transfer a program to the UVPROM.
To transfer a program from a UVPROM memory module to the processor
RAM, follow the “Transferring A Program from an EEPROM” procedures
earlier in this chapter.
14–6
15
Chapter
A–B
This chapter:
• takes a brief look at the instruction set
• lists the name, mnemonic, and function of each instruction
• points out the instructions that can be used only with SLC 5/02 processors
Important: To avoid misapplication, do not apply any of the instructions
until you have read the detailed descriptions in chapters 16
through 26.
On page 15–9 you will find an Instruction Locator. This is a list of the
instruction mnemonics, in alphabetical order, with page references.
Instruction Classifications The instruction set is divided into the classifications named in chapters 16
through 26. A brief description of the individual instructions in each
classification follows.
5/02
Instruction Name Only Function - Conditional (Input) or Output
and Mnemonic Instructions as Noted
•
Examine if Open XIO Conditional instruction. True when bit is off (0).
One-Shot Rising OSR Conditional instruction. Makes rung true for one scan
upon each falsetotrue transition of conditions
preceding it in the rung.
Output Energize OTE Output instruction. True (1) when conditions preceding
it are true. Goes false when conditions preceding it go
false.
Output Latch OTL Output instruction. Addressed bit goes true (1) when
conditions preceding the OTL instruction are true.
When conditions go false, OTL remains true until rung
containing OTU instruction with same address goes
true.
Output Unlatch OTU Output instruction. Addressed bit goes false (0) when
conditions preceding the OTU instruction are true.
Remains false until rung containing OTL instruction with
same address goes true.
15–1
Chapter 15
Instruction Set Overview
5/02
Instruction Name Only Function - Output Instructions
and Mnemonic •
Retentive Timer RTO This is an OnDelay timer that retains its accumulated
value when:
- rung conditions go false;
- the mode changes to program from run or test;
- the processor loses power;
- a fault occurs.
15–2
Chapter 15
Instruction Set Overview
5/02
Instruction Name
Only Function - Output Instructions
and Mnemonic
•
Immediate Input IIM When conditions preceding it in the rung are true, the
with Mask IIM instruction is enabled and interrupts the program
scan to read the status of a word of external inputs and
transfer it through a mask to the input data file.
Immediate Output IOM When conditions preceding it in the rung are true, the
with Mask IOM instruction is enabled and interrupts the program
scan to read a word of data from the output data file
and transfer the data through a mask to the
corresponding external outputs.
Message MSG • This instruction transfers data from one node to another
Read/Write on the DH-485 network. When the instruction is
enabled, message transfer is pending. Actual data
transfer takes place at the end of the scan, during the
communications portion of the operating cycle.
Service SVC • When conditions preceding it in the rung are true, the
Communications SVC instruction interrupts the program scan to execute
the communications portion of the operating cycle. The
program scan time then resumes from where it left off.
I/O Interrupt Enable IIE • The IIE, IID, and RPI instructions are used with
I/O Interrupt Disable IID • specialty I/O modules capable of generating an
Reset Pending RPI • interrupt. See chapter 31 for functional details.
I/O Interrupt
I/O Refresh REF • When conditions preceding it in the rung are true, the
REF instruction interrupts the program scan to execute
the I/O scan (write outputsservice commsread inputs).
The program scan then resumes from where it left off.
15–3
Chapter 15
Instruction Set Overview
5/02
Instruction Name
Only Function - Conditional Input Instructions
and Mnemonic
•
Less Than or Equal LEQ Instruction is true when source A < source B.
15–4
Chapter 15
Instruction Set Overview
5/02
Instruction Name
Only Function - Output Instructions
and Mnemonic
•
Add ADD When rung conditions are true, the ADD instruction
adds source A to source B and stores the result in the
destination.
Subtract SUB When rung conditions are true, the SUB instruction
subtracts source B from source A and stores the result
in the destination.
Multiply MUL When rung conditions are true, the MUL instruction
multiplies source A by source B and stores the result in
the destination.
Divide DIV When rung conditions are true, the DIV instruction
divides source A by source B and stores the result in
the destination and the math register.
Double Divide DDV When rung conditions are true, the DDV instruction
divides the contents of the math register by the source
and stores the result in the destination and the math
register.
Negate NEG When rung conditions are true, the NEG instruction
subtracts the source from zero and stores the result in
the destination.
Clear CLR When rung conditions are true, the CLR instruction
clears the destination to zero.
Convert to BCD TOD When rung conditions are true, the TOD instruction
converts the source value to BCD and stores it in the
math register or the destination file of the SLC 5/02.
Convert from BCD FRD When rung conditions are true, the FRD instruction
converts a BCD value in the math register or the source
file of the SLC 5/02 to an integer, and stores it in the
destination.
Decode DCD When rung conditions are true, the DCD instruction
decodes 4bit value (0 to 16), turning on the
corresponding bit in 16bit destination.
Square Root SQR • When rung conditions are true, the SQR instruction
calculates the square root of the source and places the
rounded result in the destination.
Scale SCL • When rung conditions are true, the SCL instruction
multiplies the source by a specified rate. The result is
added to an offset value and placed in the destination.
15–5
Chapter 15
Instruction Set Overview
5/02
Instruction Name
Only Function - Output Instructions
and Mnemonic
•
Move MOV When rung conditions are true, the MOV instruction
moves a copy of the source to the destination.
Masked Move MVM When rung conditions are true, the MVM instruction
moves a copy of the source through a mask to the
destination.
And AND When rung conditions are true, sources A and B of the
AND instruction are ANDed bit by bit and stored in the
destination.
Exclusive Or XOR When rung conditions are true, sources A and B of the
XOR instruction are Exclusive ORed bit by bit and
stored in the destination.
Not NOT When rung conditions are true, the source of the NOT
instruction is inverted (0→1, 1→0) bit by bit and stored
in the destination.
5/02
Instruction Name
Only Function - Output Instructions
and Mnemonic
•
File Copy COP When rung conditions are true, the COP instruction
copies a userdefined source file to the destination file.
File Fill FLL When rung conditions are true, the FLL instruction
loads a source value into a specified number of
elements in a userdefined file.
15–6
Chapter 15
Instruction Set Overview
5/02
Instruction Name
Only Function - Output Instructions
and Mnemonic
•
First In First Out (FIFO) The FFL instruction loads a word into an FIFO stack
Load (FFL) FFL • on successive false-to-true transitions. The FFU
Unload (FFU) FFU • unloads a word from the stack on successive
false-to-true transitions. The first word loaded is the
first to be unloaded.
Last In First Out (LIFO) The LFL instruction loads a word into an LIFO stack
Load (LFL) LFL • on successive false-to-true transitions. The LFU
Unload (LFU) LFU • unloads a word from the stack on successive
false-to-true transitions. The last word loaded is the
first to be unloaded.
5/02
Instruction Name
Only Function - Output Instructions
and Mnemonic
•
15–7
Chapter 15
Instruction Set Overview
Jump to Label JMP Output instruction. When rung conditions are true,
the JMP instruction causes the program scan to
jump forward or backward to the corresponding
LBL instruction.
Jump to Subroutine JSR Output instruction. When rung conditions are true,
the JSR instruction causes the processor to jump
to the targeted subroutine file.
Temporary End TND Output instruction. When rung conditions are true,
the TND instruction stops the program scan,
updates I/O and communications, then resumes
scanning at rung 0 of the main program file.
Selectable Timed Disable STD • Output instructions, associated with the Selectable
Selectable Timed Enable STE • Timed Interrupt (STI) function. STD and STE are
Selectable Timed Start STS • used to prevent an STI from occurring during a
portion of the program; STS initiates an STI.
15–8
Chapter 15
Instruction Set Overview
5/02
Instruction Name Only Function - Output Instruction
and Mnemonic
•
Proportional PID • This instruction is used to control physical properties
Integral Derivative such as temperature, pressure, liquid level, or flow rate
of process loops.
Instruction Locator The table below lists instructions by mnemonic, in alphabetical order. Page
references are included.
5/02 5/02
Instruction Mnemonic and Name Page Instruction Mnemonic and Name Page
Only Only
• •
ADD Add 20-3 MOV Move 21-2
AND And 21-5 MSG Message • 18-1
BSL Bit Shift Left 23-2 MUL Multiply 20-7
BSR Bit Shift Right 23-2 MVM Masked Move 21-3
CLR Clear 20-11 NEG Negate 20-10
COP File Copy 22-2 NEQ Not Equal 19-3
CTD Count Down 17-6 NOT Not 21-8
CTU Count Up 17-6 OR Or 21-6
DCD Decode 4 to 1 of 16 20-19 OSR One Shot Rising 16-6
DDV Double Divide 20-9 OTE Output Energize 16-4
DIV Divide 20-8 OTL Output Latch 16-5
OTU Output Unlatch 16-5
EQU Equal 19-2
PID Proportional Integral Derivative • 26-1
FFL FIFO Load • 23-5
FFU FIFO Unload • 23-5 REF I/O Refresh • 18-19
FLL File Fill 22-4 RES Reset 17-13
FRD Convert from BCD 20-15 RET Return from Subroutine 25-6
RPI Reset Pending I/O Interrupt • 18-16
GEQ Greater Than or Equal 19-7 RTO Retentive Timer On-Delay 17-5
GRT Greater Than 19-6
SBR Subroutine 25-6
HSC High-speed Counter 17-9
SCL Scale Data • 20-21
IID I/O Interrupt Disable • 18-17 SQC Sequencer Compare 24-2
IIE I/O Interrupt Enable • 18-17 SQL Sequencer Load • 24-8
IIM Immediate Input with Mask 18-15 SQO Sequencer Output 24-2
INT Interrupt Subroutine • 25-11 SQR Square Root • 20-20
IOM Immediate Output with Mask 18-16 STD STI Disable • 25-10
JMP Jump to Label 25-2 STE STI Enable • 25-10
JSR Jump to Subroutine 25-4 STS STI Start Immediately • 25-10
LBL Label 25-3 SUB Subtract 20-4
LES Less Than 19-4 SUS Suspend 25-9
LEQ Less Than or Equal 19-5 SVC Service Communications • 18-14
LFL LIFO Load • 23-8 TND Temporary End 25-8
LFU LIFO Unload • 23-8 TOD Convert to BCD 20-12
LIM Limit Test • 19-9 TOF Timer Off-Delay 17-4
TON Timer On-Delay 17-3
MCR Master Control Reset 25-7
MEQ Masked Comparison for Equal 19-8 XIC Examine if Closed 16-2
XIO Examine if Open 16-3
XOR Exclusive Or 21-7
15–9
16
Chapter
A–B
Bit Instructions
This chapter covers the bit instructions with fixed, SLC 5/01, and SLC 5/02
processors:
• Examine if Closed (XIC)
• Examine if Open (XIO)
• Output Energize (OTE)
• Output Latch (OTL)
• Output Unlatch (OTU)
• One–Shot Rising (OSR)
Bit Instructions Overview Bit instructions operate on a single bit of data. During operation, the
processor may set or reset the bit, based on logical continuity of ladder rungs.
You can address a bit as many times as your program requires.
16–1
Chapter 16
Bit Instructions
EDT_DAT
F1 F2 F3 F4 F5
I:1.0
Ladder Diagrams and APS Displays: ] [
0
16–2
Chapter 16
Bit Instructions
EDT_DAT
F1 F2 F3 F4 F5
I:1.0
Ladder Diagrams and APS Displays: ]/[
0
16–3
Chapter 16
Bit Instructions
EDT_DAT
F1 F2 F3 F4 F5
O:2.0
Ladder Diagrams and APS Displays: ( )
7
Avoid duplicate OTE addresses within the same program file: When you
want two or more different conditions or sets of conditions to control an
output, avoid programming two or more OTE instructions with the same
address. This can cause unwanted results. Use input branching and a single
OTE instruction instead, as shown in the example below.
AVOID Duplicate OTE Addresses Use Input Branching and a
B3 B3 Single OTE Instead
] [ ( ) B3 B3
1 3 ] [ ( )
1 3
B3 B3
] [ ( ) B3
2 3 ] [
2
If B3/1 is true and B3/2 is false, the OTE instruction will not
be energized. This is because the processor controls the Output B3/3 is energized when
OTE based on the status of the last rung it solved that B3/1, or B3/2, or both are true.
contains the OTE address.
16–4
Chapter 16
Bit Instructions
Output Latch (OTL), Output Output Latch, Output Unlatch OTL, OTU Output Instruction
Unlatch (OTU)
HHT Ladder Display: (L) (U)
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
B3 B3
Ladder Diagrams and APS Displays: (L) (U)
6 6
These are retentive output instructions that can be used in a pair for the data
table bit they control. Possible logic states are indicated in the table above.
OTL and OTU instructions can also be used to initialize data values at the bit
level.
When you assign an address to the OTL instruction that corresponds to the
address of an external output terminal, the output device wired to this
terminal is energized when the bit in memory is set (1). An OTU instruction
with the same address as the OTL instruction resets (0) the bit in memory.
16–5
Chapter 16
Bit Instructions
When the processor changes from the Run to the Program mode or when
power is lost (provided there is battery backup or the capacitor retains
memory), the last true output latch or output unlatch instruction in the ladder
program continues to control the bit in memory. The latched output device is
energized even though the rung conditions controlling the output latch
instruction may have gone false.
Your program can examine a bit controlled by OTL and OTU instructions as
often as necessary.
16–6
Chapter 16
Bit Instructions
EDT_DAT
F1 F2 F3 F4 F5
B3
Ladder Diagrams and APS Displays: [OSR]
0
This instruction makes a rung true for one program scan upon every
false-to-true transition of the conditions preceding it in the rung. The output
instructions on the rung are executed for only one program scan, even if the
rung goes true and remains true.
Instruction Parameters
Use a bit address from either the bit or integer data file. The addressed bit is
set (1) as long as rung conditions preceding the OSR instruction are true; the
bit is reset (0) when rung conditions preceding the OSR instruction are false.
The address assigned to the OSR instruction is not the one–shot address to be
referenced by your program. The address allows the OSR instruction to
“remember” its previous rung state. The output instruction(s) that follow the
OSR instruction can be referenced by your program.
The bit address you use for this instruction must be unique. Do not use it
elsewhere in the program.
We recommend that you do not use an input or output address to program the
address parameter of the OSR instruction.
16–7
Chapter 16
Bit Instructions
I:1.0 B3 TOD
] [ [OSR] TO BCD
0 0 Source T4:0.ACC
Dest S:13
MOV
MOVE
Source S:13
Dest O:3
In this case, the accumulated value of a timer is converted to BCD and moved to an
output word where an LED display is connected. When the timer is running, the
accumulated value is changing rapidly. This value can be frozen and displayed for each
false-to-true transition of the input condition of the rung.
Dest O:3
This example is the same as the one above, except that a MOV instruction is not required.
The accumulated value of a timer is converted to BCD and moved to an output word
where an LED display is connected. When the timer is running, the accumulated value is
changing rapidly. This value can be frozen and displayed for each false-to-true transition
of the input condition of the rung.
I:1.0 B3 B3 O:3.0
] [ ]/[ [OSR] ( )
0 1 0 0
B3 B3 O:3.0
] [ [OSR] ( )
2 3 1
Using the OSR instruction in output branching such as in this example is permitted when
using the SLC 5/02 processor. In this case, when I:1/0 is on, output O:3/0 will be on for
one scan only if B3/1 in not on, and output O:3/1 will be on for one scan only if B3/2 is on.
The SLC 5/02 processor allows you to use one OSR instruction per output in
a rung. The SLC 5/01 processor allows you to use one OSR instruction per
rung. Do not place input conditions after the OSR instruction in a rung.
Unexpected operation may occur.
16–8
17
Chapter
A–B
This chapter covers the following timer and counter instructions for use with
all processors except where noted:
• Timer On-Delay (TON)
• Timer Off-Delay (TOF)
• Retentive Timer On-Delay (RTO)
• Count Up (CTU)
• Count Down (CTD)
• High–Speed Counter (HSC) – fixed controller only
• Counter or Timer Reset (RES)
Timer and Counter Timers and counters are output instructions. They include:
Instructions Overview • Timer On-Delay (TON). It counts timebase intervals when the rung is
true and resets when the rung is false (non–retentive). The timebase is
selectable as 0.01 sec or 1.0 sec for SLC 5/02 processors, and set at 0.01
sec for fixed controllers and SLC 5/01 processors. See page 17–3.
• Timer Off-Delay (TOF). It counts timebase intervals when the rung is
false and resets when the rung is true (non–retentive). The timebase is
selectable as 0.01 sec or 1.0 sec for SLC 5/02 processors, and set at 0.01
sec for fixed controllers and SLC 5/01 processors. See page 17–4.
• Retentive Timer On-Delay (RTO). An on-delay timer which retains its
accumulated value when the rung goes false. See page 17–5.
• Count Up (CTU). The count increments at each false-true transition of
the rung. See page 17–7.
• Count Down (CTD). The count decrements at each false-true transition
of the rung. See page 17–7.
• High–Speed Counter (HSC). A special CTU counter for use with fixed
controllers having 24 VDC inputs. See page 17–9.
• Counter or Timer Reset (RES). This instruction resets the accumulated
value and status bits of a counter or timer. It cannot be used with TOF
timers. See page 17–13.
Timer and counter instructions have 3-word data file elements, illustrated on
pages 17–2 and 17–7. Word 0 is the control word, containing the status bits
of the instruction. Word 1 is the preset value. Word 2 is the accumulated
value.
The accumulated value is the current number of timebase intervals that have
been measured for a timer instruction; for a counter instruction, it is the
number of false-to–true transitions that have occurred. The preset value is
the set point that you enter in the timer or counter instruction.
When the accumulated value becomes equal to or greater than the preset
value, the done status bit is set. You can use this bit to control an output
device.
17–1
Chapter 17
Timer and Counter Instructions
Preset and accumulated values for timers range from 0 to +32,767. If a timer
preset or accumulated value is a negative number, a runtime error occurs and
places the processor in a fault condition.
Preset and accumulated values for counters range from –32,768 to +32,767.
Timebase
The timebase is a measure of the interval counted by a timer. Selectable as
0.01 sec or 1.0 sec for SLC 5/02 processors. Fixed at 0.01 sec for fixed
controllers and SLC 5/01 processors.
Accuracy
Timing accuracy is minus 0.01 to plus 0 seconds, with a program scan of up
to 2.5 seconds.
Timing accuracy described here refers only to the length of time between the
moment a timer instruction is enabled and the moment the timed interval is
complete. Inaccuracy caused by the program scan can be greater than the
timer time base. You must also consider the time required to energize the
output device.
TON
Ladder Diagrams and APS Displays: TIMER ON DELAY (EN)
Timer T4:0
Time Base 0.01 (DN)
Preset 120
Accum 0
Status Bits
The done bit (DN) is set when the accumulated value is equal to the preset
value. It is reset when rung conditions become false.
The timer timing bit (TT) is set when rung conditions are true and the
accumulated value is less than the preset value. It is reset when the rung
conditions go false or when the done bit is set.
The enable bit (EN) is set when rung conditions are true; it is reset when
rung conditions become false.
Effects of processor mode changes: When the processor changes from the
Run or Test mode to the Program mode or user power is lost while the
instruction is timing but has not reached its preset value, the following
occurs:
• Timer enable and timing bits remain set.
• Accumulated value remains the same.
Upon return to the Run or Test mode, the following can happen:
• If the rung is true, the accumulated value is reset, and the timing and
enable bits remain set.
• If the rung is false, the accumulated value is reset and the control bits are
reset.
17–3
Chapter 17
Timer and Counter Instructions
Status Bits
The done bit (DN) is reset when the accumulated value is equal to the preset
value. It is set when rung conditions become true.
The timing bit (TT) is set when rung conditions are false and the
accumulated value is less than the preset value. It is reset when the rung
conditions go true or when the done bit is reset.
The enable bit (EN) is set when rung conditions are true; it is reset when
rung conditions become false.
Effects of processor mode changes: When processor operation changes
from the Run or Test mode to the Program mode or user power is lost while a
timer off-delay instruction is timing but has not reached its preset value, the
following occurs:
• Timer enable bit remains reset.
• Timing and done bits remain set.
• The accumulated value remains the same.
17–4
Chapter 17
Timer and Counter Instructions
When you go back to the Run or Test mode, the following can happen:
• If the rung is true, the accumulated value is reset, the timing bit is reset,
the enable bit is set, and the done bit remains set.
• If the rung is false, the accumulated value is set equal to the preset value
and the control bits are reset.
The counter/timer RES instruction cannot be used with the TOF instruction.
17–5
Chapter 17
Timer and Counter Instructions
Status Bits
• The done bit (DN) is set when the accumulated value is equal to the
preset value. However, it is not reset when rung conditions become false;
it is reset only when the appropriate RES instruction is enabled.
• The timing bit (TT) is set when rung conditions are true and the
accumulated value is less than the preset value. It is reset when the rung
conditions go false or when the done bit is set.
• The enable bit (EN) is set when rung conditions are true; it is reset when
rung conditions become false.
The accumulated value must be reset by the RES instruction. When the RES
instruction having the same address as the RTO is enabled, the accumulated
value and the control bits are reset.
Effects of processor mode changes: When the processor changes from the
Run or Test mode to the Program or Fault mode, or user power is lost while
the timer is timing but not yet at the preset value, the following occurs:
• The timer enable and timing bits remain set.
• The accumulated value remains the same.
When you return to the Run or Test mode or power is restored, the following
can happen:
• If the rung is true, the accumulated value remains the same and continues
incrementing from where it stopped. The enable and timing bits remain
set.
• If the rung is false, the accumulated value remains the same, the timing
and enable bits are reset, and the done bit remains in its last state.
17–6
Chapter 17
Timer and Counter Instructions
CTU and CTD instructions are retentive. Count up and count down
instructions count false-to-true rung transitions. These rung transitions could
be caused by events occurring in the program such as parts traveling past a
detector or actuating a limit switch.
Each count is retained when the rung conditions again become false. The
count is retained until an RES instruction having the same address as the
counter instruction is enabled.
Each counter instruction has a preset and accumulated value and a control
word associated with it. The accumulated value is retained after the CTU or
CTD instruction goes false, and when power is removed from and then
restored to the processor. Also, the on or off status of counter done,
overflow, and underflow bits is retentive.
17–7
Chapter 17
Timer and Counter Instructions
Status Bits
The control word for counter instructions includes six status bits, indicated in
the figure below.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CU CD DN OV UN UA Not Used
Preset Value
Accumulated Value
Bit 15 of the counter control word is the count up enable (CU) bit. It is set
when rung conditions of the CTU instruction are true. The bit is reset when
either rung conditions go false or an RES instruction having the same address
as the CTU instruction is enabled.
CTU instructions can count beyond their preset value. When counting
continues past the preset value and reaches (32,767 + 1), an overflow
condition results. This is indicated when bit 12, the overflow (OV) bit, is set.
You can reset the overflow bit by enabling a RES instruction having the same
address as the CTU instruction. You can also reset the overflow bit by
decrementing the count less than or equal to 32,767 with a CTD instruction.
When the OV bit is set, the accumulated value wraps around to – 32,768 and
continues counting up from there.
17–8
Chapter 17
Timer and Counter Instructions
Bit 14 of the counter control word is the count down enable (CD) bit. It is
set when rung conditions of the CTD instruction are true. It is reset when
either rung conditions go false (count down instruction disabled) or the
appropriate reset instruction is enabled.
When a CTD instruction counts beyond its preset value and reaches a count
of (–32,768 – 1), the underflow bit (UN) is set. You can reset it by
energizing the appropriate RES instruction. You can also reset the underflow
bit by incrementing the count greater than or equal to –32,768 with a CTU
instruction having the same address as the CTD instruction.
When the UN bit is set, the accumulated value wraps around to +32,767 and
continues counting down from there.
17–9
Chapter 17
Timer and Counter Instructions
To begin high–speed counting, load a preset value into C5:0.PRE and enable
the counter rung. To load a preset value, do one of the following:
• Change to the Run or Test mode from another mode.
• Power up the processor in the Run mode.
• Reset the HSC using the RES instruction.
Automatic reloading occurs when the HSC itself sets the DN bit on interrupt.
Each input transition that occurs at input I:0/0 will cause the accumulator of
the HSC to increment. When the accumulator value equals the preset value,
the done bit (C5:0/DN) will be set, the accumulator will be cleared, and the
preset value (C5:0.PRE) will be loaded into the HSC in preparation for the
next high–speed transition at input I:0/0. The ladder program polls the done
bit (C5:0/DN) to determine the state of the HSC. Once the done bit has been
detected as set, the ladder program should clear bit C5:0/DN (use the unlatch
OTU instruction) before the HSC accumulator again reaches the preset value,
or the overflow bit (C5:0/OV) will be set.
It is important to note that the HSC differs from the CTU and CTD counters
in that the HSC is a hardware counter as opposed to a software counter and
that the HSC operates asynchronously to the ladder program scan. The HSC
accumulator value (C5:0.ACC) is normally updated each time the HSC rung
is evaluated in the ladder program (this means that the HSC hardware
accumulator value is transferred to the HSC software accumulator). Many
HSC counts could occur between HSC evaluations which would make
C5:0.ACC inaccurate when used throughout a ladder program. To allow for
an accurate HSC accumulator value, the update accumulator bit (C5:0/UA)
will cause C5:0.ACC to be immediately updated to the state of the hardware
accumulator when set. (Use the OTE instruction only to reset the UA bit.)
Note: The HSC instruction will immediately clear bit C5:0/UA following the
accumulator update.
The high–speed counter can be reset using the RES instruction at address
C5:0. A reset will clear the HSC status bits, clear the accumulator, and load
the preset value into the counter.
17–10
Chapter 17
Timer and Counter Instructions
Instruction Parameters
Address C5:0 is the HSC counter 3-word element.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CU CD DN OV UN UA Not Used
Preset Value
Accumulated Value
Application Example
In the figure that follows, rungs 6, 16, and 31 of the main program file each
consist of an XIC instruction addressed to the HSC done bit and a JSR
instruction. These rungs poll the status of the HSC done bit. When the DN
bit is set at any of these poll points, program execution moves to subroutine
file 3, executing the HSC logic. After the HSC logic is executed, the DN bit
is reset by an unlatch instruction, and program execution returns to the main
program file.
17–11
Chapter 17
Timer and Counter Instructions
Rung
] [ ]/[ ] [ ( )
C5:0 JSR
6 ] [ JUMP TO SUBROUTINE
DN SBR file number 3
] [ ]/[ ] [ ( )
C5:0 JSR
16 ] [ JUMP TO SUBROUTINE
DN SBR file number 3
] [ ]/[ ] [ ( )
C5:0 JSR
31 ] [ JUMP TO SUBROUTINE
DN SBR file number 3
] [ ]/[ ] [ ( )
Rung SBR
SUBROUTINE ( )
0 ] [ HSC
Application
Logic
1 ] [ ]/[ ] [ ( )
Unlatch
DN Bit
C5:0
20 (U)
DN
RET
21 RETURN
17–12
Chapter 17
Timer and Counter Instructions
EDT_DAT
F1 F2 F3 F4 F5
C5:0
(RES)
You use a reset instruction to reset timing and counting instructions. The
RES instruction can also be used to reset the position value and status bits
(except FD) of a control file (R6:0) used in sequencers, shift registers, etc.
Using the RES instruction with timers and counters: When the RES
instruction is enabled, it resets the retentive on-delay timer, count up, or
count down instruction having the same address as the RES instruction.
• With timers, the RES instruction resets the accumulated value, done bit,
timing bit, and enable bit.
• With counters, the RES instruction resets the accumulated value, overflow
or underflow bit, done bit, and enable bits.
If the counter rung is enabled, the CU or CD bit will be reset as long as the
RES instruction is enabled.
If the counter preset value is negative, the RES instruction sets the
accumulated value to zero. This in turn causes the done bit to be set by a
count down or count up instruction.
17–13
18
Chapter
A–B
18–1
Chapter 18
I/O Message and Communication
Instructions
This is an output instruction that allows you to transfer data from one node to
another on the DH–485 network. The instruction can be programmed as a
write message or read message. The target device can be another SLC 500
processor on the network, or a non-SLC 500 device, using the common
interface file (data file 9 in SLC 500 processors).
When the target device is SLC 500, communication can take place between
two SLC 5/02 processors or between a SLC 5/02 processor and a fixed or
SLC 5/01 processor. The instruction cannot be programmed in the fixed or
SLC 5/01 processor.
The data associated with a message write instruction is not sent when you
enable the instruction. Rather, it is sent at the end of the scan during service
communications of the operating cycle or at the time an SVC or REF
instruction in your ladder program is enabled. In some instances, this means
that you must buffer data in your application.
The processor can service only one message instruction at any given time,
although the processor may hold several messages “enabled and waiting.”
Waiting messages are serviced one at a time in sequential order (first in first
out).
18–2
Chapter 18
I/O Message and Communication
Instructions
Entering Parameters
After you select the MSG instruction on the HHT, the data entry display
appears. You enter seven parameters in the following order.
Choices are READ, WRITE. Read indicates that the local processor
(processor in which the instruction is located) is receiving data; write
indicates that it is sending data.
After you make a selection [F2] or [F4], the display changes to the
following:
2. Select Target Device –
Choices are 500 CPU, 485 CIF. The target device can be a fixed
controller, SLC 5/01, SLC 5/02 processor (500 CPU) or a non–SLC 500
device (485 CIF). For read message instructions, the target device sends
data. For write message instructions, the target device receives data.
18–3
Chapter 18
I/O Message and Communication
Instructions
After you make a selection [F2] or [F4], the display changes to the
following:
3. Enter Control Block –
F1 F2 F3 F4 F5
F1 F2 F3 F4 F5
18–4
Chapter 18
I/O Message and Communication
Instructions
F1 F2 F3 F4 F5
This is the node number of the device that the local processor is reading
or writing to.
After you enter a node number, the display changes to the following.
6. Target File Address/Offset –
F1 F2 F3 F4 F5
If the target device is a 500 CPU, this is the source or destination file
address in the target processor. Valid file types are S, B, T, C, R, N. If
the target device is 485 CIF, this is the offset value in the common
interface file.
18–5
Chapter 18
I/O Message and Communication
Instructions
F1 F2 F3 F4 F5
This is the length of the message in elements. The 1–word elements are
limited to a maximum length of 41. The 3–word elements (T,C,R) are
limited to a maximum length of 13.
The destination file type determines the number of words that are
transferred. Examples: A MSG read instruction specifying a target file
type C (counter), a destination file type N (integer), and a length value of
1 will transfer 1 word of information. A MSG read instruction specifying
a target file type N, a destination file type C, and a length value of 1 will
transfer 3 words.
The message length is the final parameter. After you enter it, the display
changes to the following.
18–6
Chapter 18
I/O Message and Communication
Instructions
The control block layout if you select 485 CIF as the target device:
When you are online, you can locate the cursor on the MSG instruction,
press the Zoom key, and observe the current status of some of these bits:
1
EN 0
1
EW
0
1
ST 0
1
DN 0
1
ER 0
18–8
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
+ 7DUJHW QRGH LV EXV\ 7KH 06* LQVWUXFWLRQ ZLOO DXWRPDWLFDOO\
UHORDG ,I RWKHU PHVVDJHV DUH ZDLWLQJ WKH PHVVDJH LV SODFHG DW
WKH ERWWRP RI WKH VWDFN
+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH PHVVDJH LV WRR ODUJH
+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH LW GRHV QRW XQGHUVWDQG WKH
FRPPDQG SDUDPHWHUV
+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH UHTXHVWHG IXQFWLRQ LV QRW
DYDLODEOH
+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH RI LQFRUUHFW FRPPDQG
SDUDPHWHUV RU XQVXSSRUWHG FRPPDQG
+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH ILOH LV SURWHFWHG
)+ /RFDO SURFHVVRU GHWHFWV LOOHJDO WDUJHW ILOH W\SH
(+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH OHQJWK UHTXHVWHG LV WRR
ODUJH
(%+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH WDUJHW QRGH GHQLHV DFFHVV
(&+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH UHTXHVWHG IXQFWLRQ LV
FXUUHQWO\ XQDYDLODEOH
)$+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH DQRWKHU QRGH LV ILOH RZQHU
KDV VROH ILOH DFFHVV
)%+ 7DUJHW QRGH FDQQRW UHVSRQG EHFDXVH DQRWKHU QRGH LV SURJUDP
RZQHU KDV VROH DFFHVV WR DOO ILOHV
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
MVM
Source N7:0
Dest 0OFF
Mask B3:0
$SSOLFDWLRQ ([DPSOHV
$SSOLFDWLRQ H[DPSOH LV VKRZQ EHORZ ,W LQGLFDWHV KRZ \RX FDQ
LPSOHPHQW FRQWLQXRXV RSHUDWLRQ RI D PHVVDJH LQVWUXFWLRQ
$SSOLFDWLRQ H[DPSOH EHJLQV RQ SDJH ï WKURXJK ï ,W LQYROYHV
D 6/& SURFHVVRU DQG D 6/& SURFHVVRU FRPPXQLFDWLQJ RQ D
'+ï OLQN ,QWHUORFNLQJ LV SURYLGHG WR YHULI\ GDWD WUDQVIHU DQG WR VKXW
GRZQ ERWK SURFHVVRUV LI FRPPXQLFDWLRQV IDLOV
2SHUDWLRQ $ WHPSHUDWXUHVHQVLQJ GHYLFH FRQQHFWHG DV DQ LQSXW WR WKH
6/& SURFHVVRU FRQWUROV WKH RQRII RSHUDWLRQ RI D FRROLQJ IDQ
FRQQHFWHG DV DQ RXWSXW WR WKH 6/& SURFHVVRU 7KH 6/& DQG
6/& ODGGHU SURJUDPV DUH H[SODLQHG LQ WKH ILJXUH RQ SDJH ï
$SSOLFDWLRQ H[DPSOH DSSHDUV RQ SDJH ï ,W VKRZV KRZ \RX FDQ XVH
WKH WLPHRXW ELW 72 WR GLVDEOH DQ DFWLYH PHVVDJH LQVWUXFWLRQ ,Q WKLV
H[DPSOH DQ RXWSXW LV HQHUJL]HG DIWHU ILYH XQVXFFHVVIXO DWWHPSWV WZR
VHFRQGV GXUDWLRQ WR WUDQVPLW D PHVVDJH
([DPSOH
B3 MSG
] [ READ/WRITE MESSAGE (EN)
1 Read/write WRITE
Target Device 500CPU (DN)
Control Block N7:0
Control Block Length 7 (ER)
2SHUDWLRQ 1RWHV
%LW % HQDEOHV WKH 06* LQVWUXFWLRQ :KHQ WKH 06* LQVWUXFWLRQ GRQH ELW
LV VHW LW XQODWFKHV WKH 06* HQDEOH ELW VR WKDW WKH 06* LQVWUXFWLRQ ZLOO EH
HQDEOHG LQ WKH QH[W VFDQ 7KLV SURYLGHV FRQWLQXRXV RSHUDWLRQ
7KH 06* HUURU ELW ZLOO DOVR XQODWFK WKH HQDEOH ELW 7KLV SURYLGHV
FRQWLQXRXV RSHUDWLRQ UHJDUGOHVV RI HUURUV
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
T4:0 B3
] [ (L) /DWFK ï 7KLV DODUP
DN 10 LQVWUXFWLRQ QRWLILHV WKH
DSSOLFDWLRQ LI WKH LQWHUORFN
N11:0 N7:0 T4:0 ELW 1 UHPDLQV VHW IRU
] [ ]/[ (RES) PRUH WKDQ VHFRQGV
13* 0
0HVVDJH 5HDG 'RQH N7:0
(L)
%LW 0
B3
06* LQVWUXFWLRQ
(U) VWDWXV ELWV
0 '1
N11:0 (1
(U)
15*
N10:0
(U)
15*
END
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
T4:0 B3
] [ (L) /DWFK ,QVWUXFWLRQ ï 7KLV DODUP
DN 10 QRWLILHV WKH DSSOLFDWLRQ LI WKH
LQWHUORFN ELW 1 LV QRW VHW
N7:0 B3 B3 DIWHU VHFRQGV
] [ [OSR] ( )
0 0 1
B3 N7:0
] [ (U)
1 0
T4:0
%LW RI WKH PHVVDJH (RES)
ZRUG 8VHG IRU IDQ 2 HQHUJL]HV FRROLQJ
FRQWURO N7:0 O:1.0 IDQ
] [ ( )
1 0
END
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
([DPSOH
1 B3 MSG
[LBL] ] [ READ/WRITE MESSAGE (EN)
1 Read/write WRITE (DN)
Target Device 500CPU (ER)
% LV ODWFKHG WR LQLWLDWH Control Block N7:0
WKH PHVVDJH LQVWUXFWLRQ Control Block Length 7
B3 T4:0 TON
] [ ]/[ TIMER ON DELAY (EN) ïVHFRQG WLPHU (DFK
1 DN Timer T4:0 (DN) DWWHPSW DW WUDQVPLVVLRQ KDV D
Time Base 0.01
Preset 200 ïVHFRQG GXUDWLRQ
Accum 0
T4:0 CTU
] [ COUNTUP (CU) &RXQWHU DOORZV DWWHPSWV
DN Counter C5:0
Preset 5 (DN)
Accum 0
CLR
N7:0 CLEAR
] [ &OHDU WKH FRQWURO ZRUG DQG
DEST N7:0
8 0 MXPS EDFN WR UXQJ IRU
DQRWKHU DWWHPSW
1
(JMP)
C5:0 O:1.0
] [ (L) 7KH ILIWK DWWHPSW ODWFKHV
DN 0 2
N7:0 C5:0
] [ (RES)
13*
O:1.0
(U)
06* LQVWUXFWLRQ
0 VWDWXV ELWV
B3 72
(U) '1
1 (1
END
2SHUDWLRQ 1RWHV
7KH WLPHRXW ELW LV ODWFKHG UXQJ DIWHU D SHULRG RI VHFRQGV 7KLV
FOHDUV WKH PHVVDJH LQVWUXFWLRQ IURP SURFHVVRU FRQWURO RQ WKH QH[W
VFDQ 7KH PHVVDJH LQVWUXFWLRQ LV WKHQ UHHQDEOHG IRU D VHFRQG DWWHPSW
DW WUDQVPLVVLRQ $IWHU DWWHPSWV 2 LV ODWFKHG
$ VXFFHVVIXO DWWHPSW DW WUDQVPLVVLRQ UHVHWV WKH FRXQWHU XQODWFKHV 2
DQG XQODWFKHV %
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
EDT_DAT
) ) ) ) )
<RX FDQ SODFH WKLV UXQJ DIWHU D PHVVDJH LQVWUXFWLRQ 6 ZLOO EH VHW ZKHQ
WKH PHVVDJH LQVWUXFWLRQ LV HQDEOHG DQG ZDLWLQJ SURYLGHG QR PHVVDJH LV
FXUUHQWO\ EHLQJ WUDQVPLWWHG :KHQ 6 LV VHW WKH 69& LQVWUXFWLRQ LV
HYDOXDWHG DV WUXH DQG WKH SURJUDP VFDQ LV LQWHUUXSWHG WR H[HFXWH WKH VHUYLFH
FRPPXQLFDWLRQV SRUWLRQ RI WKH RSHUDWLQJ VFDQ 7KH VFDQ WKHQ UHVXPHV DW WKH
LQVWUXFWLRQ IROORZLQJ WKH 69& LQVWUXFWLRQ
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
7KLV H[DPSOH DVVXPHV WKDW WKH &RPPV 6HUYLFLQJ 6HOHFWLRQ ELW 6 LV FOHDU
DQG WKDW WKLV LV WKH RQO\ DFWLYH 06* LQVWUXFWLRQ
,PPHGLDWH ,QSXW ZLWK 0DVN ,PPHGLDWH ,QSXW ZLWK 0DVN ,,0 2XWSXW ,QVWUXFWLRQ
,,0
++7 /DGGHU 'LVSOD\ (IIM)
EDT_DAT
) ) ) ) )
7KLV LQVWUXFWLRQ XSGDWHV LQSXW GDWD EHIRUH WKH QRUPDO LQSXW VFDQ :KHQ WKH
,,0 LQVWUXFWLRQ LV HQDEOHG WKH SURJUDP VFDQ LV LQWHUUXSWHG 'DWD IURP D
VSHFLILHG ,2 VORW LV WUDQVIHUUHG WKURXJK D PDVN WR WKH LQSXW GDWD ILOH PDNLQJ
WKH GDWD DYDLODEOH WR LQVWUXFWLRQV IROORZLQJ WKH ,,0 LQVWUXFWLRQ LQ WKH ODGGHU
SURJUDP
(QWHULQJ 3DUDPHWHUV
6/27 6SHFLI\ WKH VORW QXPEHU DQG WKH ZRUG QXPEHU SHUWDLQLQJ WR WKH VORW
$ VORW FDQ KDYH XS WR ZRUGV IRU IL[HG DQG 6/& DQG ZRUGV IRU 6/&
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
,PPHGLDWH 2XWSXW ZLWK ,PPHGLDWH 2XWSXW ZLWK 0DVN ,20 2XWSXW ,QVWUXFWLRQ
0DVN ,20
++7 /DGGHU 'LVSOD\ (IOM)
EDT_DAT
) ) ) ) )
7KLV LQVWUXFWLRQ XSGDWHV RXWSXWV EHIRUH WKH QRUPDO RXWSXW VFDQ :KHQ WKH
,20 LQVWUXFWLRQ LV HQDEOHG WKH SURJUDP VFDQ LV LQWHUUXSWHG WR WUDQVIHU GDWD WR
D VSHFLILHG ,2 VORW WKURXJK D PDVN 7KH SURJUDP VFDQ WKHQ UHVXPHV ZLWK WKH
LQVWUXFWLRQ IROORZLQJ WKH ,20 LQVWUXFWLRQ
(QWHULQJ 3DUDPHWHUV
6/27 6SHFLI\ WKH VORW QXPEHU DQG WKH ZRUG QXPEHU SHUWDLQLQJ WR WKH VORW
$ VORW FDQ KDYH XS WR ZRUGV IRU IL[HG DQG 6/& DQG ZRUGV IRU 6/&
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
EDT_DAT
) ) ) ) )
EDT_DAT
) ) ) ) )
EDT_DAT
) ) ) ) )
IID
/DGGHU 'LDJUDPV DQG $36 'LVSOD\V I/O INTERRUPT DISABLE
Slots: 2,3
IIE RPI
I/O INTERRUPT ENABLE RESET PENDING INTERRUPT
Slots: 2,3 Slots: í
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
7KH ,2 (YHQW'ULYHQ ,QWHUUXSW IXQFWLRQ LV XVHG ZLWK VSHFLDOW\ ,2 PRGXOHV
FDSDEOH RI JHQHUDWLQJ DQ LQWHUUXSW <RX VSHFLI\ D VXEURXWLQH WR EH H[HFXWHG
XSRQ UHFHLSW RI VXFK DQ LQWHUUXSW
(QWHULQJ 3DUDPHWHUV
,,' LQVWUXFWLRQ ï (QWHU D UHVHW LQ D VORW SRVLWLRQ WR LQGLFDWH D GLVDEOHG ,2
LQWHUUXSW
ï
&KDSWHU
,2 0HVVDJH DQG &RPPXQLFDWLRQ
,QVWUXFWLRQV
EDT_DAT
) ) ) ) )
<RX DUH QRW DOORZHG WR SODFH DQ 5() LQVWUXFWLRQ LQ DQ 67, LQWHUUXSW ,2
LQWHUUXSW RU XVHU IDXOW VXEURXWLQH
ï
19
Chapter
A–B
Comparison Instructions
This chapter covers input instructions that allow you to compare values of
data.
Instructions for use with fixed, SLC 5/01, and SLC 5/02 processors:
• Equal (EQU)
• Not Equal (NEQ)
• Less Than (LES)
• Less Than or Equal (LEQ)
• Greater Than (GRT)
• Greater Than or Equal (GEQ)
• Masked Comparison for Equal (MEQ)
Instruction for use with SLC 5/02 processors only
• Limit (LIM)
19–1
Chapter 19
Comparison Instructions
EDT_DAT
F1 F2 F3 F4 F5
When the values at source A and source B are equal, the instruction is
logically true. If these values are not equal, the instruction is logically false.
Entering Parameters
You must enter a word address for source A. You can enter a program
constant or a word address for source B. Signed integers are stored in two’s
complementary form.
19–2
Chapter 19
Comparison Instructions
EDT_DAT
F1 F2 F3 F4 F5
When the values at source A and source B are not equal, the instruction is
logically true. If the two values are equal, this instruction is logically false.
Entering Parameters
You must enter a word address for source A. You can enter a program
constant or a word address for source B. Signed integers are stored in two’s
complementary form.
19–3
Chapter 19
Comparison Instructions
EDT_DAT
F1 F2 F3 F4 F5
When the value at source A is less than the value at source B, this instruction
is logically true. If the value at source A is greater than or equal to the value
at source B, this instruction is logically false.
Entering Parameters
You must enter a word address for source A. You can enter a program
constant or a word address for source B. Signed integers are stored in two’s
complementary form.
19–4
Chapter 19
Comparison Instructions
Less Than or Equal (LEQ) Less Than or Equal LEQ Input Instruction
EDT_DAT
F1 F2 F3 F4 F5
When the value at source A is less than or equal to the value at source B, this
instruction is logically true. If the value at source A is greater than the value
at source B, this instruction is logically false.
Entering Parameters
You must enter a word address for source A. You can enter a program
constant or a word address for source B. Signed integers are stored in two’s
complementary form.
19–5
Chapter 19
Comparison Instructions
EDT_DAT
F1 F2 F3 F4 F5
When the value at source A is greater than the value at source B, this
instruction is logically true. If the value at source A is less than or equal to
the value at source B, this instruction is logically false.
Entering Parameters
You must enter a word address for source A. You can enter a program
constant or a word address for source B. Signed integers are stored in two’s
complementary form.
19–6
Chapter 19
Comparison Instructions
EDT_DAT
F1 F2 F3 F4 F5
When the value at source A is greater than or equal to the value at source B,
this instruction is logically true. If the value at source A is less than the
value at source B, this instruction is logically false.
Entering Parameters
You must enter a word address for source A. You can enter a program
constant or a word address for source B. Signed integers are stored in two’s
complementary form.
19–7
Chapter 19
Comparison Instructions
Masked Comparison for Masked Comparison for Equal MEQ Input Instruction
Equal (MEQ)
HHT Ladder Display: MEQ
EDT_DAT
F1 F2 F3 F4 F5
Compare B3:11
0000000001110101
Entering Parameters
• Source – the address of the value you want to compare.
• Mask – a hex value or the address of the mask through which the
instruction moves data. Refer to appendix B for more information
regarding masks and hexadecimal numbering.
• Compare – an integer value or the address of the reference.
If the 16 bits of data at the source address are equal to the 16 bits of data at
the compare address (less masked bits), the instruction is true. The
instruction becomes false as soon as it detects a mismatch. Bits in the mask
word mask data when reset, they pass data when set.
19–8
Chapter 19
Comparison Instructions
EDT_DAT
F1 F2 F3 F4 F5
This input instruction tests for values within or outside a specified range,
depending on how you set the limits.
Entering Parameters
Low Limit, Test, and High Limit values you program can be word addresses
or decimal values, restricted to the following combinations:
• If the Test parameter is a program constant, both the Low Limit and High
Limit parameters must be word addresses.
• If the Test parameter is a word address, the Low Limit and High Limit
parameters can be be either a program constant or a word address.
19–9
Chapter 19
Comparison Instructions
If the Low Limit has a value greater than the High Limit, the instruction is
false when the Test value is between the limits. If the Test value is equal to
either limit or outside the limits, the instruction is true. This is illustrated in
the figure below.
19–10
20
Chapter
A–B
Math Instructions
Instructions for use with fixed, SLC 5/01, and SLC 5/02 processors:
• Add (ADD)
• Subtract (SUB)
• Multiply (MUL)
• Divide (DIV)
• Double Divide (DDV)
• Negate (NEG)
• Clear (CLR)
• Convert to BCD (TOD)
• Convert from BCD (FRD)
• Decode (DCD)
Instructions for use with SLC 5/02 processors only:
• Square Root (SQR)
• Scale (SCL)
Application techniques possible with Series C and later SLC 5/02 processors:
• 32-bit addition and subtraction
Math Instructions Overview The following general information applies to math instructions.
Entering Parameters
• Source – address(es) of the value(s) on which the mathematical, logical,
or move operation is to be performed; can be word addresses or program
constants. An instruction that has two source operands will not accept
program constants in both operands.
• Destination – the address (destination) of the result of the operation.
Signed integers are stored in two’s complementary form. Refer to appendix
B for more information regarding two’s complement form.
20–1
Chapter 20
Math Instructions
Status word S:14 contains the most significant word of the 32-bit values of
MUL and DDV instructions. It contains the unrounded quotient for DIV and
DDV instructions. It also contains the most significant digit (digit 5) for
TOD and FRD instructions.
20–2
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source A is added to the value at source B and then stored in the
destination.
Math Register
Contents unchanged.
20–3
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source B is subtracted from the value at source A and then
stored in the destination.
Math Register
Contents unchanged.
20–4
Chapter 20
Math Instructions
32Bit Addition and With the Series C SLC 5/02 processor, you have the option of performing
Subtraction-Series C and 16-bit signed integer addition and subtraction (same as Series B SLC 5/02
Later SLC 5/02 Processors processors) or 32-bit signed integer addition and subtraction. This is
facilitated by status file bit S:2/14, the Math Overflow Selection Bit.
Note that in this program, the value of the most significant 16 bits (B3:3) of
the 32-bit number is increased by 1 if the carry bit S:0/0 is set and it is
decreased by 1 if the number being added (B3:1) is negative.
To avoid a major error from occurring at the end of the scan, you must
unlatch overflow trap bit S:5/0 as shown.
20–5
Chapter 20
Math Instructions
➀ The programming device displays 16-bit decimal values only. The decimal value of a 32-bit integer is derived from
the displayed binary or hex value. For example, 0003 1940 Hex is 16 4x3 + 16 3x1 + 16 2x9 + 16 1x4 + 16 0x0 = 203,072.
Dest B3:3
0000000000000011
Application Note: You could use the rung above with a DDV instruction and a
counter to find the average value of B3:1
20–6
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source A is multiplied by the value at source B and then stored
in the destination.
Math Register
Contains the 32–bit signed integer result of the multiply operation. This
result is valid at overflow.
20–7
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source A is divided by the value at source B with the rounded
quotient being stored in the destination. If the remainder is 0.5 or greater,
round up occurs in the destination. The unrounded quotient is stored in the
most significant word of the math register. The remainder is placed in the
least significant word of the math register.
Math Register
The unrounded quotient is placed in the most significant word, the remainder
is placed in the least significant word.
20–8
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
The contents of the math register are divided by the source value. The
rounded quotient is placed in the destination. If the remainder is 0.5 or
greater, round up occurs in the destination. The unrounded quotient is placed
in the most significant word of the math register. The remainder is placed in
the least significant word of the math register.
Math Register
Initially contains the dividend of the DDV operation. Upon instruction
execution the unrounded quotient is placed in the most significant word of
the math register. The remainder is placed in the least significant word of the
math register.
20–9
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
The source value is subtracted from 0 and then stored in the destination.
(The destination contains the 2’s complement of the source.)
Math Register
Unchanged.
20–10
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
Math Register
Unchanged.
20–11
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
Use this conversion instruction when you want to display or transfer BCD
values external to the processor.
Entering Parameters
• Source – the address of the value to be converted to BCD. If the integer
value you enter is negative, the sign is ignored and the conversion occurs
as if the number were positive. The absolute value of the number is used
for conversion.
• Destination – the address of the location to hold the result of the
conversion. With SLC 5/02 processors, the destination parameter can be
a word address in any data file, or it can be the math register, S:13 and
S:14. With fixed and SLC 5/01 processors, the destination can only be
the math register.
If the math register is the destination, 32,767 is the maximum value. If a
word address is used, 9999 is the maximum value.
20–12
Chapter 20
Math Instructions
The integer value 9760 stored at N7:3 is converted to BCD and the BCD
equivalent is stored in N10:0. The maximum BCD value possible is 9999.
9 7 6 0 N7:3 Decimal 0010 0110 0010 0000
EDT_DAT
F1 F2 F3 F4 F5
20–13
Chapter 20
Math Instructions
In the following example, the integer value 32760 stored at N7:3 is converted
to BCD. The 5-digit BCD value is stored in the math register. The lower 4
digits of the BCD value is moved to output word O:2 and the remaining digit
is moved thru a mask to output word O:3.
When using the math register as the destination parameter in the TOD
instruction, the maximum BCD value possible is 32767. However, for BCD
values above 9999, the overflow bit is set, resulting in minor error bit S:5/0
also being set. Your ladder program can unlatch S:5/0 before the end of the
scan to avoid major error 0020, as done in this example.
This example will output the absolute value (0-32767) contained in N7:3 as 5 BCD digits in output slots 2 and 3.
TOD
] [ TO BCD
Source N7:3
32760
Dest S:13 APS displays S:13 and S:14
00032760 in BCD.
Overflow bit
S:0 S:5 Minor Error Bit
] [ (U)
1 0
MOV
MOVE
Source S:13
10080
Dest O:2.0 0010 0111 0110 0000
10080 2 7 6 0
MVM
MASKED MOVE
Source S:14
3
Mask 000F
20–14
Chapter 20
Math Instructions
Convert from BCD (FRD) Convert from BCD FRD Output Instruction
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
Use this instruction when you want to convert BCD values to integer or
decimal values.
Entering Parameters
• Source – word address of the value in BCD to be converted to
integer/decimal. With SLC 5/02 processors, the source parameter can be
a word address in any data file, or it can be the math register, S:13. With
fixed and SLC 5/01 processors, the source can only be the math register.
If the math register is the source, 32,767 is the maximum value. If a word
address is used, 9999 is the maximum value.
• Destination – word address to contain the converted decimal/integer
value.
20–15
Chapter 20
Math Instructions
MOV
MOVE
Source I:2
Dest N7:1
The above rungs cause the processor to verify that the value at slot 2 (I:2)
remains the same for two consecutive scans before the FRD instruction is
executed. This prevents the FRD instruction from converting a non-BCD
value during an input value change.
20–16
Chapter 20
Math Instructions
The BCD value 9760 at source N7:3 is converted from BCD and stored in
N10:0. The maximum source value is 9999, BCD.
EDT_DAT
F1 F2 F3 F4 F5
The BCD value 32760 in the math register is converted and stored in N10:0.
The maximum source value is 32767, BCD.
EDT_DAT
F1 F2 F3 F4 F5
You should convert BCD values to integer before you manipulate them in
your ladder program. If you do not convert the values, the processor
manipulates them as integer and their value is lost.
Important: If the math register (S:13 and S:14) is used as the source for the
FRD instruction and the BCD value does not exceed 4 digits, be
sure to clear word S:14 before executing the FRD instruction.
If S:14 is not cleared and a value is contained in this word from
another math instruction located elsewhere in the program, an
incorrect decimal value will be placed in the destination word.
20–17
Chapter 20
Math Instructions
I:1.0 MOV
] [ MOVE
0 Source N7:2 0001 0010 0011 0100
4660
Dest S:13
4660
CLR
CLEAR
Dest S:14
0
FRD
FROM BCD
Source S:13 APS displays S:13 and
00001234 S:14 in BCD.
Dest N7:0
1234
0000 0100 1101 0010
When the input condition is set (1), a BCD value (from a 4digit thumbwheel switch for example) is
moved from word N7:2 into the math register. Status word S:14 is then cleared to make certain
that unwanted data is not present when the FRD instruction is executed.
20–18
Chapter 20
Math Instructions
EDT_DAT
F1 F2 F3 F4 F5
When the rung is true, this output instruction turns on one bit of the
destination word. The particular bit that is turned on depends on the value of
the first four bits of the source word. See the table below. This instruction
can be used to multiplex data. It could be used for applications such as
rotary switches, keypads, bank switching, etc.
Source Destination
Bit 15–04 03 02 01 00 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
x 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
x 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
x 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
x 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
x 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
x 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
x 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
x 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
x 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
x 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
x 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
x 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
x 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
x 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
x 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
20–19
Chapter 20
Math Instructions
Entering Parameters
• Source – the address that contains the bit decode information. Only the
first four bits (0–3) are used by the DCD instruction. The remaining bits
may be used for other application specific needs. Change the value of the
first four bits of this word to select one bit of the destination word.
• Destination – the address of the word to be decoded. Only one bit of this
word is turned on at any one time, depending on the value of the source
word.
EDT_DAT
F1 F2 F3 F4 F5
When this instruction is evaluated as true, the square root of the absolute
value of the source is calculated and the rounded result is placed in the
destination.
The instruction will calculate the square root of a negative number without
overflow or faults. In applications where the source value may be negative,
use a comparison instruction to evaluate the source value to determine if the
destination may be invalid.
20–20
Chapter 20
Math Instructions
Math Register
Contents unchanged.
EDT_DAT
F1 F2 F3 F4 F5
Offset 127
Dest N7:1
24527
20–21
Chapter 20
Math Instructions
When the SCL instruction is true, the value at the source address is
multiplied by the rate value. The rounded result is added to the offset value
and placed in the destination.
Example
SCL
SCALE
Source N7:0
100
Rate [/10000] 25000
The source 100 is multiplied by
Offset 127 25000/10000 and added to 127.
The result 377 is placed in
Dest N7:1 the destination.
377
Entering Parameters
The range of values for the following parameters is –32,768 to 32,767.
20–22
Chapter 20
Math Instructions
Math Register
Contents unchanged.
F
100
77
32
C
25 100
SCL
SCALE
Source N7:0
25
Rate [/10000] 18000
The source 25 is multiplied by
Offset 32 18000/10000 and added to 32. The
result 77 is placed in the destination.
Dest N7:1
77
20–23
21
Chapter
A–B
This chapter covers output instructions that allow you to perform move and
logical operations on individual words. Use these instructions with fixed,
SLC 5/01 and SLC 5/02 processors:
• Move (MOV)
• Masked Move (MVM)
• And (AND)
• Inclusive Or (OR)
• Exclusive Or (XOR)
• Not (NOT)
All application examples shown are in the HHT zoom display.
Move and Logical Instructions The following general information applies to move and logical instructions.
Overview
Entering Parameters
• Source – This is the address of the value on which the logical or move
operation is to be performed. It can be a word address or a program
constant. If the instruction has two source operands, it will not accept
program constants in both operands.
• Destination – This is the address of the result of the move or logical
operation. It must be a word address.
EDT_DAT
F1 F2 F3 F4 F5
The processor moves a copy of the source value to the destination location.
Entering Parameters
• Source – a program constant or the address of the data you want to move.
• Destination – the address where the instruction moves the data.
21–2
Chapter 21
Move and Logical Instructions
Application note: If you wish to move 1 word of data without affecting the
math flags, use a copy (COP) instruction with a length of 1 word instead of
using the MOV instruction. The COP instruction is discussed in chapter 22.
EDT_DAT
F1 F2 F3 F4 F5
Dest B3:7
0000000011100000
The masked move instruction is a word instruction that moves a copy of the
data from a source location to a destination, and allows portions of the
destination data to be masked by a separate word.
21–3
Chapter 21
Move and Logical Instructions
Entering Parameters
• Source – the address of the data you want to move.
• Mask – the address of the mask word through which the instruction
moves data. You can also enter a hex value (constant). Refer to appendix
B for more information regarding masks and hexadecimal numbering.
• Destination – the address where the instruction moves the data.
Operation
When the rung containing this instruction is true, data at the source address
passes through the mask to the destination address.
MVM
MASKED MOVE
Source B3:0
0101010101010101
Mask F0F0
Dest B3:2
1111111111111111
source B3:0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Mask F0F0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
unaltered unaltered
Mask (do not pass) data by resetting bits in the mask; pass data by setting
bits in the mask. The instruction does not operate unless you set mask bits to
pass data you want to use. The bits of the mask can be fixed by a constant
value, or you can vary them by assigning the mask a direct address. Bits in
the destination that correspond to 0s in the mask are not altered.
21–4
Chapter 21
Move and Logical Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source A is ANDed bit by bit with the value at source B and
then stored in the destination.
21–5
Chapter 21
Move and Logical Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source A is ORed bit by bit with the value at source B and then
stored in the destination.
Truth Table: R = A OR B
A: Source A bit A B R
B: Source B bit
R: Destination bit 0 0 0
1 0 1
0 1 1
1 1 1
21–6
Chapter 21
Move and Logical Instructions
EDT_DAT
F1 F2 F3 F4 F5
The value at source A is Exclusive ORed bit by bit with the value at source B
and then stored in the destination.
21–7
Chapter 21
Move and Logical Instructions
EDT_DAT
F1 F2 F3 F4 F5
The source value is NOTed (inverted) bit by bit and then stored in the
destination.
21–8
22
Chapter
This chapter covers the following instructions for use with the fixed, SLC
5/01, and SLC 5/02 processors:
File Copy and Fill Instructions These instructions move data from a source file or element to a destination
Overview file. They are similar to a Move (MOV) instruction, but they enable you to
move more than one word at a time. This is facilitated by the use of the file
indicator # in the parameter addresses. The # symbol indicates a file or
group of words, not just one word.
The following general information applies to file copy and file fill
instructions.
22–1
Chapter 22
File Copy and File Fill Instructions
EDT_DAT
F1 F2 F3 F4 F5
This instruction copies data from one location into another. It uses no status
bits. If you need an enable bit, you can program a parallel (branched) output
using a storage address.
The COP instruction moves data from one file to another, as illustrated
below.
Source: File Destination: File
Entering Parameters
• Source – The address of the first word of the file you want to copy. You
must use the file indicator # in the address.
• Destination – The address of the first word of the file where the copy of
the source file will be stored. You must use the file indicator # in the
address.
• Length – The number of elements in the file you want to copy. If the
destination file type is 3 words per element (file types T, C, R), you can
specify a maximum length of 42. If the destination file type is 1 word per
element (file types I, O, S, B, N), you can specify a maximum length of
128.
22–2
Chapter 22
File Copy and File Fill Instructions
All elements are copied from the specified source file into the specified
destination file each scan the rung is true. Elements are copied in ascending
order with no transformation of data. They are copied up to the specified
number (length) or until the last element of the destination file is reached,
whichever occurs first.
The destination file type determines the number of words that the instruction
transfers. For example, if the destination file type is counter and the source
file type is integer, three integer words are transferred for each element in the
counter-type file.
If your destination is a timer, counter, or control file, be sure that the source
words corresponding to the status words of your destination file contains
zeros.
Be sure that you accurately specify the starting address and length of the data
block you are copying. The instruction will not read or write over a file
boundary (such as between files N16 and N17) at the destination.
You can perform file shifts by specifying a source element address one or
more elements greater than the destination element address within the same
file. This shifts data to lower element addresses. Shifts to higher element
addresses will not work.
EDT_DAT
F1 F2 F3 F4 F5
22–3
Chapter 22
File Copy and File Fill Instructions
Typically, the FLL instruction might be used to reset or clear several integer
values all at once.
Entering Parameters
• Source – The program constant (decimal) or element address. (The file
indicator # is not required for an element address.)
• Destination – The address of the first word of the file you want to fill.
You must use the file indicator # in the address.
• Length – The number of elements in the file you want filled. If the
destination file type is 3 words per element, you can specify a maximum
length of 42. If the destination file type is 1 word per element, you can
specify a maximum length of 128.
All elements are filled from the source value (typically a program constant)
into the specified destination file each scan the rung is true. Elements are
filled in ascending order until the number of elements (length that you
entered) is reached.
The instruction will not write over a file boundary (such as between files
N16 and N17) at the destination.
Note that an error is declared if a write is attempted over a file boundary.
22–4
23
Chapter
A–B
This chapter covers instructions for use with fixed, SLC 5/01, and SLC 5/02
processors:
Bit Shift, FIFO, and LIFO The following general information applies to bit shift, FIFO, and LIFO
Instructions Overview instructions.
23–1
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
Bit Shift Left (BSL), Bit Bit Shift Left, Bit Shift Right BSL, BSR Output Instructions
Shift Right (BSR)
HHT Ladder Display: (BSL) (BSR)
BSR
BIT SHIFT RIGHT (EN)
File #B3:1
Control R6:0 (DN)
Bit Address I:1.0/0
Length 50
23–2
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
Entering Parameters
• File – The address of the bit array you want to manipulate. You must use
the file indicator # in the bit array address. The address must start on an
element boundary (for example, B3:0/0, not B3:0/4).
• Control – The instruction’s address and control (R data file) element that
stores the status byte of the instruction, the length of the array (in number
of bits), and the bit pointer (currently not used). Note: The control
address cannot be used for any other instruction.
The control element is shown below.
15 13 11 10 00
EN DN ER UL Not used
Length of bit array (number of bits)
Bit Pointer (currently not used)
23–3
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
For wraparound operation, set the Bit Address equal to the address of the last
bit of the array or to the UL bit, whichever applies.
The figure below illustrates how the Bit Shift Left instruction functions.
For wraparound operation, set the Bit Address equal to the address of the
first bit of the array or to the UL bit, whichever applies.
The figure below illustrates how the Bit Shift Right instruction functions.
23–4
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
If you wish to shift more than one bit per scan, you must create a loop using
jump (JMP) and label (LBL) instructions.
FFU
FIFO UNLOAD (EU)
FIFO #N7:12
Dest N7:11 (DN)
Control R6:0
Length 34 (EM)
Position 0
FFL and FFU instructions are used in pairs. The FFL instruction loads words
into a user-created file called a FIFO stack. The FFU instruction unloads
words from the FIFO stack, in the same order as they were entered.
23–5
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
Entering Parameters
Enter the following parameters when programming these instructions:
• Source – This word address stores the value to be entered next into the
FIFO stack. The FFL instruction places this value into the next available
element in the FIFO stack. SOURCE can be a word address or a program
constant (–32768 to 32767). For I/O addresses, the HHT requires you to
specify the slot and word number, for example I:3.0.
• Destination (Dest) – This word address stores the value that exits from
the FIFO stack. The FFU instruction unloads this value from the stack
and places it in this word address. For I/O addresses, the HHT requires
you to specify the slot and word number, for example O:3.0.
• FIFO – This is the address of the stack. It must be an indexed word
address in the input, output, status, bit, or integer file. The same address
is programmed for the FFL and FFU instructions.
• Control – This is a control file (R data file) address. The status bits, the
stack length, and the position value are stored in this element. The same
address is programmed for the FFL and FFU instructions. Do not use the
control file address for any other instruction.
The 3-word control element:
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
EN EU DN EM
Length
Position
Status Bits
• EN (bit 15) – FFL instruction enable bit. The bit is set on a false-to-true
transition of the FFL rung and is reset on a true-to-false transition.
• EU (bit 14) – FFU instruction enable bit. The bit is set on a false-to-true
transition of the FFU rung and is reset on a true-to-false transition.
• DN (bit 13) – Done bit. It is set by the FFL instruction to indicate the
stack is full. This inhibits loading the stack.
• EM (bit 12) – Empty bit. It is set by the FFU instruction to indicate the
stack is empty.
• Length (word 1) – This is the length of the stack, the maximum number
of elements in the stack, up to a maximum of 128 words. The same
number is programmed for the FFL and FFU instructions.
• Position (word 2) – The next available location where the instruction
loads data into the stack. This value changes after each load or unload
operation. The same number is used for the FFL and FFU instructions.
23–6
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
Operation
Instruction parameters have been programmed in the FFL – FFU instruction
pair shown below.
When the DN bit is set, a false–to–true transition of the FFL rung does not
change the position value or the index register value. When the EM bit is
set, a false–to–true transition of the FFU rung does not change the position
value or the index register value.
23–7
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
LFU
LIFO UNLOAD (EU)
LIFO #N7:12
Dest N7:11 (DN)
Control R6:0
Length 34 (EM)
Position 0
These instructions are the same as the FIFO load and unload instructions
except that the last data loaded is the first data to be unloaded.
Entering Parameters
The instruction parameter information on page 23–6 applies. Substitute
instruction mnemonics LIFO for FIFO, LFL for FFL, and LFU for FFU.
23–8
Chapter 23
Bit Shift, FIFO, and LIFO
Instructions
Operation
Instruction parameters have been programmed in the LFL – LFU instruction
pair shown below. For purposes of comparison, the same parameters are
used here as in the FFL – FFU example on page 23–7.
When the DN bit is set, a false-to–true transition of the LFL rung does not
change the position value or the index register value. When the EM bit is
set, a false-to–true transition of the LFU rung does not change the position
value or the index register value.
23–9
24
Chapter
A–B
Sequencer Instructions
Instructions for use with fixed, SLC 5/01, and SLC 5/02 processors:
• Sequencer Output (SQO). It transfers 16-bit data to word addresses for
the control of sequential machine operations.
• Sequencer Compare (SQC). It compares 16-bit data with stored data to
monitor machine operating conditions or for diagnostic purposes.
Instruction for use with the SLC 5/02 processor only:
• Sequencer Load (SQL). It loads 16-bit data into a file at each step of
sequencer operation.
All application examples shown are in the HHT zoom display.
24–1
Chapter 24
Sequencer Instructions
SQC
SEQUENCER COMPARE (EN)
File #B10:11
Mask FFF0 (DN)
Source I:1.0
Control R6:21 (FD)
Length 4
Position 0
24–2
Chapter 24
Sequencer Instructions
Entering Parameters
• File (SQO, SQC) – This is the address of the sequencer file. You must
use the file indicator # for this address.
Sequencer file data is used as follows:
Instruction Sequencer File Stores
SQO Data for controlling outputs
SQC Reference data for monitoring inputs
• Mask (SQO, SQC) – This is a hex code or the address of the mask word
or file through which the instruction moves data. Set mask bits to pass
data, reset mask bits to mask data. Use a mask word or file if you want to
change the mask according to application requirements.
If the mask is a file, its length will be equal to the length of the sequencer
file. The two files track automatically.
• Source (SQC) – This is the address of the input word or file from which
the instruction obtains data for comparison to its sequencer file. For input
data file addresses, the HHT requires that you enter the slot and word
number. For example, I:3.0.
• Destination (SQO) – This is the address of the output word or file to
which the instruction moves data from its sequencer file. For output data
file addresses, the HHT requires that you enter the slot and word number.
For example, O:4.0.
Important: You can address the mask, source, or destination of a sequencer
instruction as a word or file. If you address it as a file (using
file indicator #), the instruction automatically tracks through the
source, mask, or destination file as the instruction tracks
step-by-step through its sequencer file.
Note: You cannot use the control address for any other instruction.
24–3
Chapter 24
Sequencer Instructions
DN (bit 13) – The done bit is set by the SQO or SQC instruction after it has
operated on the last word in the sequencer file. It is reset on the next
false-to-true rung transition after the rung goes false.
ER (bit 11) – The error bit is set when the processor detects a negative
position value, or a negative or zero length value. This results in a major
error if not cleared before the END or TND instruction is executed.
FD (bit 08) – SQC only. The found bit indicates that a match has been found
between a compare of a word or file of input data, through a mask, to a word
or file of reference data for equality. When the status of all non-masked bits
in an input word match those of the corresponding reference word, the found
bit is set. The found bit is set when a match exists, otherwise it is cleared.
This bit is assessed each time the SQC instruction is evaluated while the rung
is true.
24–4
Chapter 24
Sequencer Instructions
When the rung goes from false–to–true, the instruction increments to the next
step (word) in the sequencer file. Data stored there is transferred through a
mask to the destination address specified in the instruction. Current data is
written to the corresponding destination word every scan that the rung
remains true.
The done bit is set when the last word of the sequencer file is transferred.
Upon the next false-to-true rung transition, the instruction resets the position
to step one, that is, automatically cycles.
At startup, if the position is = 0 when you switch the processor from the
program mode to the Run mode, instruction operation depends on whether
the rung is true or false on the first scan:
• If true, the instruction transfers the value in step 0.
• If false, the instruction waits for the first rung transition from
false–to–true and transfers the value in step 1.
Mask data by resetting bits in the mask word. The bits mask data when reset,
pass data when set. Unless you set mask bits, the instruction will not change
the value in the destination word. The mask can be fixed by entering a hex
code. The mask can be a variable by entering an element address or a file
address for changing the mask with each step. The following figure indicates
how the SQO instruction functions:
SQO
Destination O:14.0
SEQUENCER OUTPUT (EN) External Outputs
File #B10:1 15 8 7 0 associated with O:14
Mask 0F0F (DN) 0000 0101 0000 1010
Dest O:14.0 00
Control R6:20 01 ON
Length 4 Mask Value 0F0F 02
Position 2 15 8 7 0
03 ON
04
0000 1111 0000 1111 05
06
07
Sequencer Output File #B10:1 08 ON
Word Step 09
B10:1 0000 0000 0000 0000 0 10 ON
11
2 1010 0010 1111 0101 1 12
3 1111 0101 0100 1010 2 Current Step 13
4 0101 0101 0101 0101 3 14
5 0000 1111 0000 1111 4 15
24–5
Chapter 24
Sequencer Instructions
Mask data by resetting bits in the mask word. The bits mask data when reset,
pass data when set. Unless you set mask bits, the instruction will not
compare bits in the reference file against the input value. The mask can be
fixed by entering a hex code. The mask can be a variable by entering an
element address or a file address for changing the mask at each step.
When the rung goes from false–to–true, the instruction increments to the next
step (word) in the sequencer file. Data stored there is transferred through a
mask and compared against the source data for equality. If the source data
equals the reference data, the FD bit is set in the SQC’s control file or word
(R6:x/FD). Current data is compared against the source every scan that the
rung evaluates as true.
The FD bit R6:21/FD is set in this example, since the input word matches the sequencer reference
value using the mask value.
24–6
Chapter 24
Sequencer Instructions
This instruction loads data into a sequencer load file. The source of this data
can be an I/O or storage word address, a file address, or a program constant.
Entering Parameters
• File – This is the address of the sequencer file where the source data is
loaded into. You must use the file indicator # for this address.
• Source – This can be a word address, file address, or a program constant
(–32768 to 32767) indicating the value or location whose contents are
loaded into the sequencer file. For input addresses, the HHT requires that
you enter the slot and word number. For example, I:3.0.
If the source is a file address, its file length will be equal to the length of
the sequencer load file (LENGTH). The two files will track
automatically, per the position value.
• Control – This is a control file address. The status bits, length value, and
position value are stored in this element. Do not use the control file
address for any other instruction.
The 3-word control element:
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
EN DN ER
Length
Position
24–7
Chapter 24
Sequencer Instructions
Status Bits
• EN (bit 15) – The enable bit. This bit is set on a false-to-true transition
of the SQL rung and reset on a true-to-false transition.
• DN (bit 13) – The done bit. This bit is set after the instruction has
operated on the last word in the sequencer load file. It is reset on the next
false-to-true rung transition after the rung goes false.
• ER (bit 11) – The error bit. This bit is set when the processor detects a
negative position value, or a negative or zero length value. This results in
a major error if not cleared before the END or TND instruction is
executed. Use an OTU with address S:5/2 to avoid a CPU fault.
• Length (word 1) – This is the number of steps of the sequencer load file
(and also of the source if the source is a file address), starting at position
1. Position 0 is the startup position. The instruction automatically resets
(wraps) to position 1 at each cycle completion.
The position address assigned for a sequencer file is step zero. Sequencer
instructions use length plus 1 word of data for each file referenced in the
instruction. This applies to the source if addressed as a file.
A length value that points past the end of the programmed file causes a
runtime major error to occur. If you alter a length value with your ladder
program, make certain that the altered value is valid.
• Position (word 2) – This is the word location or step in the sequencer file
to which data is moved.
A position value that points past the end of the programmed file causes a
runtime major error to occur. If you alter a position value with your
ladder program, make certain that the altered value is valid.
24–8
Chapter 24
Sequencer Instructions
Operation
Instruction parameters have been programmed in the SQL instruction shown
below. Input word I:1.0 is the source. Data in this word is loaded into
integer file #N7:30 by the sequencer load instruction.
SQL External inputs associated
SEQUENCER LOAD (EN)
File #N7:30 with I:1.0
Source I:1.0 (DN)
00
Control R6:4
Length 4
01 ON
Position 2 Source I:1.0 02
15 8 7 0
03 ON
04
0000 0101 0000 1010 05
06
07
Sequencer Load File #N7:30 08 ON
Word Step 09
N7:30 0000 0000 0000 0000 0 10 ON
11
31 1010 0010 1111 0101 1 12
32 0000 0101 0000 1010 2 Current Step 13
33 0000 0000 0000 0000 3 14
34 0000 0000 0000 0000 4 15
When rung conditions change from false–to–true, the SQL enable bit (EN) is
set. The control element R6:4 increments to the next position in the
sequencer file, and loads the contents of source I:1.0 into this location. The
SQL instruction continues to load the current data into this location each scan
that the rung remains true. When the rung goes false, the enable bit (EN) is
reset.
The instruction loads data into a new file element at each false–to–true
transition of the rung. When step 4 is completed, the done bit (DN) is set.
Operation cycles to position 1 at the next false-to–true transition of the rung
after position 4.
If the source were a file address such as #N7:40, files #N7:40 and #N7:30
would both have a length of 5 (0–4) and would track through the steps
together per the position value. The SQL LENGTH parameter is still 4.
24–9
25
Chapter
A–B
Control Instructions
Instructions for Use with fixed, SLC 5/01, and SLC 5/02 processors:
• Jump to Label (JMP) and Label (LBL)
• Jump to Subroutine (JSR) and Subroutine (SBR)
• Return from Subroutine (RET)
• Master Control Reset (MCR)
• Temporary End (TND)
• Suspend (SUS)
Instructions for use with SLC 5/02 processors only:
The following instructions apply to the Selectable Timed Interrupt (STI)
function, discussed in chapter 30.
• Selectable Timed Disable (STD)
• Selectable Timed Start (STS)
• Selectable Timed Enable (STE)
The following instruction applies to Selectable Timed interrupts and I/O
Event–Driven interrupts, discussed in chapters 30 and 31.
• Interrupt Subroutine (INT)
Control Instructions Overview The following general information applies to control instructions.
Control instructions allow you to change the order that the processor
scans/solves your ladder diagram rungs. Normally, the processor solves from
left to right on each rung, and from top to bottom of the ladder diagram (rung
0 to the END statement). With control instructions, you can tell the
processor to skip certain rungs (JMP), scan certain groups of rungs (SBR),
end the scan (TND, SUS), or stop/interrupt the scan to do something else
(STI interrupts, Interrupt Subroutine interrupts). Typically, control
instructions are used to minimize scan time, create a more efficient program,
and/or troubleshoot a problem in a program.
25–1
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
1
Ladder Diagrams and APS Displays: (JMP)
When the rung condition for this output instruction is true, the processor
jumps forward or backward to the corresponding label instruction (LBL) and
resumes program execution at the label. More than one JMP instruction can
jump to the same label. The Jump (JMP) and its corresponding Label (LBL)
must be in the same program file.
When rungs of logic are “jumped over” or skipped, the processor does not
scan/evaluate them, meaning that outputs, timers, etc. are left in their last
state. The outputs are not de–energized (turned off).
Entering Parameters
Enter a decimal label number from 0 to 999. You can place up to 1000 labels
in your program or subroutine file.
25–2
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
1
Ladder Diagrams and APS Displays: [LBL]
This input instruction is the target of the JMP instruction having the same
label number. You must program this instruction as the first instruction of a
rung. The Jump (JMP) and its corresponding Label (LBL) must be in the
same program file. This instruction has no control bits. It is always
evaluated as true or logic 1.
You can program multiple jumps to the same label by assigning the same
label number to multiple JMP instructions, but assigning the same label
number to two or more labels causes a compiler error.
Important: Do not jump (JMP) into an MCR zone. Instructions that are
programmed within the MCR zone starting at the LBL
instruction and ending at the “End MCR” instruction will
always be evaluated as though the MCR zone is true, regardless
of the true state of the “Start MCR” instruction.
Entering Parameters
Enter a decimal label number from 0 to 999. You can place up to 1000 labels
in your program or subroutine file.
25–3
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
The Jump to Subroutine (JSR), Subroutine (SUB), and Return (RET) are
used in conjunction, as shown on the following page.
When rung conditions for a JSR instruction are true, the processor jumps to
the subroutine instruction (SBR) at the beginning of the target subroutine file
and resumes execution at that point (you cannot jump into any part of a
subroutine except the first instruction in that file).
When the processor does not jump to the subroutine (JSR rung false), the
SBR rungs are not scanned or evaluated, meaning outputs, timers, etc. are
left in their last state (if an OTE is on, it stays on). They are not
de–energized. Your main program should account for this and turn
off/reset/de–energize output instructions as required.
You must program each subroutine in its own program file by assigning a
unique file number (3–255).
25–4
Chapter 25
Control Instructions
Note: Runtime errors (error codes 0025, 0026, 0027, and 0030) occur if
more than the allowable levels of subroutines are called (subroutine stack
overflow) or if more returns are executed than there are call levels
(subroutine stack underflow). Also, do not execute a JSR to a subroutine that
is already active in the subroutine stack.
Entering Parameters
File – This is the SBR (subroutine) file number. Assign a decimal number
from 3 to 255.
25–5
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
The target subroutine is identified by the file number that you entered in the
JSR instruction.
EDT_DAT
F1 F2 F3 F4 F5
25–6
Chapter 25
Control Instructions
This output instruction marks the end of subroutine execution or the end of
the subroutine file. It causes the processor to resume execution in the main
program file at the instruction following the JSR instruction where it exited
the program. If a sequence of nested subroutines is involved, the instruction
causes the processor to return program execution to the previous subroutine.
The rung containing the RET instruction may be conditional if this rung
precedes the end of the subroutine. In this way, the processor omits the
balance of a subroutine only if its rung condition is true.
SLC 5/02 processors: Use the RET instruction to terminate execution of the
STI subroutine (chapter 30), I/O event-driven interrupt subroutine (chapter
31), and the user fault routine (chapter 29).
EDT_DAT
F1 F2 F3 F4 F5
You start the zone with a conditioned MCR instruction. When the MCR rung
is false, all non–retentive outputs in the zone are disabled. The processor
scans all output instructions within the zone as if they were false. When the
MCR rung is true, outputs act according to their rung logic as if the zone did
not exist. You end the zone with an unconditioned MCR instruction. You
cannot nest MCR zones.
Important: Do not jump (JMP) into an MCR zone. Instructions that are
programmed within the MCR zone starting at the LBL
instruction and ending at the “End MCR” instruction will
always be evaluated as though the MCR zone is true, regardless
of the true state of the “Start MCR” instruction.
25–7
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
This instruction, when its rung is true, stops the processor from scanning the
rest of the program file, updates the I/O, services communications, and
resumes scanning at rung 0 of the main program (file 2). If this instruction’s
rung is false, the processor continues the scan until the next TND instruction
or the END statement. You can use this instruction to progressively debug a
program, or conditionally omit the balance of your current program file or
subroutines.
When used in a subroutine, this instruction does not function the same as an
END or RET (which causes the processor to resume operation in the
previous file). The processor stops where it is, updates I/O, services
communications, and goes to the beginning of the main program.
25–8
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
This instruction, when the rung is true, places the controller in the Suspend
Idle mode. The suspend ID is placed in word 7 (S:7) of the status file. The
suspend file (program or subroutine number identifying where the executed
SUS instruction resides) is placed in word 8 (S:8) of the status file. All
outputs are de-energized.
This instruction can be used to trap and identify specific conditions for
program debugging and system troubleshooting.
Entering Parameters
SUSPEND ID – an integer in the range of –32,768 to 32,767 that is entered
when the instruction is programmed.
25–9
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
STE
SELECTABLE TIMED ENABLE
STS
SELECTABLE TIMED START
File 2
Time (x10 ms) 30
The Selectable Timed Interrupt function allows you to interrupt the scan of
the main program file automatically, on a periodic basis, in order to scan a
specified subroutine file.
25–10
Chapter 25
Control Instructions
EDT_DAT
F1 F2 F3 F4 F5
This instruction has no control bits and is always evaluated as true. The
instruction must be programmed as the first instruction of the first rung of the
subroutine.
25–11
26
Chapter
A–B
PID Instruction
This chapter applies to the SLC 5/02 processor only. It explains the PID
instruction.
26–1
Chapter 26
PID Instruction
26–2
Chapter 26
PID Instruction
The PID instruction normally controls a closed loop using inputs from an
analog input module and providing an output to an analog output module.
For temperature control, you can convert the analog output to a time
proportioning on/off output for driving a heater or cooling unit. An example
appears on pages 26–20 and 26–22.
The PID instruction can be operated in the timed mode or the STI mode. In
the timed mode, the instruction updates its output periodically at the rate you
set. In the STI mode, the instruction should be placed in an STI interrupt
subroutine. It will then update its output every time the STI subroutine is
scanned. The STI time interval and the PID loop update rate must be the
same in order for the equation to execute properly.
The PID Concept PID closed loop control holds a process variable at a desired set point. A
flow rate/fluid level example is shown below.
FFWD
or Bias
Process Control
Variable Output
Level
Detector
Control Valve
The PID equation controls the process by sending an output signal to the
control valve. The greater the error between the setpoint and process
variable input, the greater the output signal, and vice versa. An additional
value (feedforward or bias) can be added to the control output as an offset.
The result of PID calculation (control variable) will drive the process
variable you are controlling toward the set point.
26–3
Chapter 26
PID Instruction
The PID Equation The PID instruction uses the following equation:
The derivative term (rate) provides smoothing by means of a low pass filter.
The cutoff frequency of the filter is 16 times greater than the corner
frequency of the derivative term.
Entering Parameters Normally, you place the PID instruction on a rung without conditional logic.
The output remains at its last value and the integral sum (words 17 and 18) is
cleared when the rung is false.
The PID instruction is located under CPT/MTH in the HHT instruction set
menu. After you select PID, the following display appears:
F1 F2 F3 F4 F5
This is the first of three data entry displays. The prompt line asks you to
enter Control Block, then Process, and then Output.
• Control Block – This is a file that stores the data required to operate the
instruction. The file length is fixed at 23 words and should be entered as
an integer file address. For example, an entry of N7:2 will allocate
elements N7:2 through N7:24. The control block layout is shown on page
26–8.
Do not write to control block addresses with other instructions in your
program except as described later in this chapter. If you are re-using a
block of data which was previously allocated for some other use, it is
good practice to first zero the data.
26–4
Chapter 26
PID Instruction
F1 F2 F3 F4 F5
26–5
Chapter 26
PID Instruction
• Minimum output (control block word 12) – If you want to use output
limiting or alarms, enter a value. If the output limit bit is also set, this
value is the minimum control output percent (word 16) that the control
variable (CV) obtains or outputs.
• Maximum output (control block word 11) – If the output limit bit is
also set, the value you enter is the maximum control output percent (word
16) that the control variable (CV) obtains or outputs.
• Auto/manual (control block word 0, bit 1) – The default condition is
AUTO. This indicates that the PID is controlling the output. MANUAL
indicates that the user is setting the output value. When tuning, we
recommend that changes be made in the MANUAL mode, followed by a
return to AUTO. Output limiting is applied in the MANUAL mode.
• Deadband (control block word 9) – Enter a non-negative value. The
deadband extends above and below the setpoint by the value you enter.
The deadband is entered at the zero crossing of the process variable PV
and the setpoint SP. This means that the deadband is in effect only after
the process variable PV enters the deadband and passes through the
setpoint SP. Range: 0-scaled max, or 0–16383 when no scaling exists.
The display below shows typical values entered for these parameters:
F1 F2 F3 F4 F5
26–6
Chapter 26
PID Instruction
Output YES NO
Output Limiting Selected Output Limiting Deselected
min The value you enter will be the minimum The value you enter will determine when
output percent that the control variable the output alarm, lower limit bit is set.
CV will obtain. If CV drops below this minimum value,
If CV drops below this minimum value, the output alarm, lower limit LL bit will be
the following will occur: set.
• CV will be set to the value you
entered, and
• the output alarm, lower limit LL bit
will be set.
max The value you enter will be the maximum The value you enter will determine when
output percent that the control variable the output alarm, upper limit bit is set.
CV will obtain. If CV exceeds this maximum value, the
If CV exceeds this maximum value, the output alarm, upper limit UL bit will be
following will occur: set.
• CV will be set to the value you
entered, and
• the output alarm, upper limit UL bit
will be set.
26–7
Chapter 26
PID Instruction
Control Block Layout The control block length is fixed at 23 words and should be programmed as
an integer file. PID instruction flags (word 0) and other parameters are
located as shown on the following page.
26–8
Chapter 26
PID Instruction
* You may alter the state of these values with your ladder program.
PID Instruction Flags Instruction flags are in the first word of the control block. They include:
• Time mode bit TM (word 0, bit 0) – This bit specifies the PID mode. It
is set when the TIMED mode is in effect. It is cleared when the STI
mode is in effect. This bit can be set or cleared by instructions in your
ladder program.
• Auto/manual bit AM (word 0, bit 1) – This bit specifies automatic
operation when it is cleared and manual operation when it is set. This bit
can be set or cleared by instructions in your ladder program.
• Control mode bit CM (word 0, bit 2) – This bit is cleared if the control
is E=SP–PV (reverse). It is set if the control is E=PV–SP (forward). This
bit can be set or cleared by instructions in your ladder program.
26–9
Chapter 26
PID Instruction
• Output limiting enabled bit OL (word 0, bit 3) – This bit is set when
you have selected to limit the control variable. This bit can be set or
cleared by instructions in your ladder program.
• Scale setpoint flag SC (word 0, bit 5) – This bit is cleared when setpoint
scaling values have been specified.
• Loop update time too fast TF (word 0, bit 6) – This bit is set by the PID
algorithm if the loop update time you have specified cannot be achieved
by the given program (because of scan time limitations).
If this bit is set, try to correct the problem by updating your PID loop at a
slower rate or move the PID instruction to an STI interrupt routine. Reset
and rate gains will be in error if the instruction operates with this bit set.
• deadband range DB (word 0, bit 8) – This bit is set when the process
variable or error is within the deadband range.
• Output alarm, upper limit UL (word 0, bit 9) – This bit is set when the
calculated control output CV exceeds the upper CV limit.
• Output alarm, lower limit LL (word 0, bit 10) – This bit is set when the
calculated control output CV is less than the lower CV limit.
• Setpoint out of range SP (word 0, bit 11) – This bit is set when the
setpoint exceeds the maximum scaled value or is less than the minimum
scaled value.
• Process var out of range PV (word 0, bit 12) – This bit is set when the
unscaled (or raw) process variable exceeds 16383 or is less than zero.
• PID done DN (word 0, bit 13) – This bit is set on scans where the PID
algorithm is computed. (It is computed at the loop update rate.)
• PID enabled EN (word 0, bit 15) – This bit is set while the rung of the
PID instruction is enabled.
26–10
Chapter 26
PID Instruction
Runtime Errors Error code 0036 appears in the status file (S:6) when a PID instruction
runtime error occurs. Code 0036 covers the following PID error conditions,
each of which has been assigned a unique single byte code value that appears
in the MSbyte (most significant byte or upper 8 bits) of the second word
(word 1) of the PID control block.
Error Error
Code Code Description of Error Condition or Conditions Corrective Action
(Decimal) (Hex)
4352 11H 1) Loop update time Dt > 255, or Change loop update time Dt to
2) Loop update time Dt = 0 0 < Dt < 255
4608 12H 1) Proportional gain Kc > 255, or Change proportional gain Kc to
2) Proportional gain Kc = 0 0 < Kc < 255
4864 13H Integral gain (reset) Ti > 255 Change integral gain (rate) Ti to
0 < Ti < 255
5120 14H Derivative gain (rate) Td > 255 Change derivative gain (rate) Td to
0 < Td < 255
8448 21H 1) Scaled setpoint max Smax > 16383, or Change scaled setpoint max Smax to
2) Scaled setpoint max Smax < -16383 -16383 < Smax < 16383
8704 22H 1) Scaled setpoint min Smin > 16383, or Change scaled setpoint min Smin to
2) Scaled setpoint min Smin < -16383 -16383 < Smin < Smax < 16383
8960 23H Scaled setpoint min Smin > Scaled setpoint max Smax Change scaled setpoint min Smin to
-16383 < Smin < Smax < 16383
12544 31H If you are using setpoint scaling and Smin > If you are using setpoint scaling, then change the
setpoint SP > Smax, or setpoint SP to Smin < SP < Smax, or
If you are not using setpoint scaling and 0 > If you are not using setpoint scaling, then change
setpoint SP > 16383, the setpoint SP to 0 < SP < 16383.
then during the initial execution of the PID loop, this error occurs
and bit 11 of word 0 of the control block is set. However, during
subsequent execution of the PID loop if an invalid loop setpoint
is entered, the PID loop continues to execute using the old
setpoint, and bit 11 of word 0 of the control block is set.
16640 41H Scaling Selected Scaling Deselected Scaling Selected Scaling Deselected
1) Deadband < 0, or 1) Deadband < 0, or Change deadband to Change deadband to
2) Deadband > 2) Deadband > 16383 0 < deadband < 0 < deadband <
(Smax Smin), or (Smax - Smin) < 16383
3) Deadband > 16383 16383
20736 51H 1) Output high limit < 0, or Change output high limit to
2) Output high limit > 100 0 < output high limit < 100
20992 52H 1) Output low limit < 0, or Change output low limit to
2) Output low limit > 100 0 < output low limit < output high limit < 100
21248 53H Output low limit > output high limit Change output low limit to
0 < output low limit < output high limit < 100
24576 60H PID is being entered for the second time. (PID loop was inter You have at least three PID loops in your program: One in the
rupted by an I/O interrupt, which is then interrupted by the PID STI main program or subroutine file, one in an I/O interrupt file, and
interrupt.) one in the STI subroutine file. You must alter your ladder program
and eliminate the potential nesting of PID loops.
26–11
Chapter 26
PID Instruction
PID and Analog I/O Scaling For the SLC 500 PID instruction, the numerical scale for both the process
variable (PV) and the control variable (CV) is 0 to 16383. To use
engineering units, such as PSI or degrees, you must first scale your analog
I/O ranges within the above numerical scale. To do this, use the Scale (SCL)
instruction and follow the steps described below. Refer to the Analog I/O
Modules User Manual, catalog number 1746–NM003 for more information.
Scale your analog input by calculating the slope (or rate) of the analog input
range to the PV range (0 to 16383.) For example, an analog input with a
range of 4 to 20mA has a decimal range of 3277 to 16384. The decimal
range must be scaled across the range of 0 to 16383 for use as PV.
Scale the CV to span evenly across your analog output range. For example,
an analog output which is scaled at 4 to 20mA has a decimal range of 6242 to
31208. In this case, 0 to 16383 must be scaled across the range of 6242 to
31208.
Once you have scaled your analog I/O ranges to/from the PID instruction,
you can enter the minimum and maximum engineering units that apply to
your application. For example, if the 4 to 20mA analog input range
represents 0 to 300 PSI, you can enter 0 and 300 as the minimum (Smin) and
maximum (Smax) parameters respectively. The Process Variable, Error,
Setpoint, and Deadband will be displayed in engineering units in the PID
Data Monitor screen. Setpoint and Deadband can be entered into the PID
instruction using engineering units.
The following equations show the linear relationship between the input value
and the resulting scaled value.
Scaled value = (input value x slope) + offset
Use the following values in an SCL instruction to scale common analog input
ranges to PID process variables.
26–12
Chapter 26
PID Instruction
The following ladder diagram shows a typical PID loop that is programmed
in the STI mode. This example (in APS format) is provided primarily to
show the proper scaling techniques. It shows a 4 to 20mA analog input and a
4 to 20mA analog output.
This rung immediately updates the analog input used for PV.
IIM
Rung 3:0 IMMEDIATE IN w MASK
Slot I:1.0
Mask FFFF
These two rungs ensure the analog input value to be scaled remains within the limits of 3277 to 16384. This is necessary to
prevent out of range" conversion errors in both the SCL and PID instructions. The latch bits can be used elsewhere in your
program to identify the particular out of range condition that occurred.
Under range
LES B3
Rung 3:1 LESS THAN (L)
Source A I:1.0 0
0
Source B 3277
MOV
MOVE
Source 3277
Dest I:1.0
0
Over range
GRT B3
Rung 3:2 GREATER THAN (L)
Source A I:1.0 1
0
Source B 16384
MOV
MOVE
Source 16384
Dest I:1.0
0
The source to be scaled is the input I:1 and its destination is the process variable of the PID instruction. These values are
calculated knowing that the input range is 3277 to 16384, while the scaled range (PV) is 0 to 16383.
SCL
Rung 3:3 SCALE
Source I:1.0
0
Rate [/10000] 12499
Offset –4096
Dest N10:28
0
PID
Rung 3:4 PID
Control Block N10:0
Process Variable N10:28
Control Variable N10:29
Control Block Length 23
26–13
Chapter 26
PID Instruction
The PID control variable is the input for the scale instruction. The PID instruction guarantees that the CV remains within
the range of 0 to 16383. This value is to be scaled to the range of 6242 to 31208, which represents the numeric range
Rung 3:5 that is needed to produce 4 to 20mA analog output signal.
SCL
SCALE
Source N10:29
0
Rate [/10000] 15239
Offset 6242
Dest O:1.0
0
This rung immediately updates the analog output card that is driven by the PID control variable value.
IOM
Rung 3:6 IMMEDIATE OUT w MASK
Slot O:1.0
Mask FFFF
END
Online Data Changes You can monitor PID parameters and status bits when you are online under
the monitor function. You can also change data in any processor mode.
The following displays appear when you press the Zoom key with the cursor
on the PID instruction while monitoring online. Note that in the first display
you can change the mode from auto to manual and vice versa.
In the auto mode, you can also change the gain parameter:
In the manual mode, you can change the maximum output percent:
26–14
&KDSWHU
3,' ,QVWUXFWLRQ
7KH VHFRQG GLVSOD\ VKRZV WKH VWDWXV ELWV GLVFXVVHG LQ WKH ODVW VHFWLRQ
<RX FDQ FKDQJH WKH 6HWSRLQW 'HDGEDQG *DLQ 5HVHW 5DWH 2XWSXW PLQ
DQG 2XWSXW PD[ SDUDPHWHUV E\ ZULWLQJ WR WKH DSSURSULDWH ZRUG ZLWKLQ WKH
FRQWURO EORFN RI WKH 3,' 7KH FRQWURO EORFN LV VKRZQ RQ SDJH ï
ï
&KDSWHU
3,' ,QVWUXFWLRQ
1RUPDOO\ ZKHQ WKH &9 2XWSXW LV FKDQJHG WKH VFDOHG YDOXH LQ WKH
´2XWSXWµ ORFDWLRQ LV FKDQJHG 7KLV YDOXH LV D QXPEHU IURP WR
FRUUHVSRQGLQJ WR WKH &9 2XWSXW RI WR $OWKRXJK WKH &9 2XWSXW
LV GLVSOD\HG LQ WKH FRQWURO EORFN ZRUG PRGLI\LQJ WKLV ZRUG LQ WKH
PDQXDO PRGH KDV QR HIIHFW RQ WKH ´2XWSXWµ YDOXH :KHQ \RX DUH LQ WKH
PDQXDO PRGH WKH VFDOHG YDOXH LQ WKH ´2XWSXWµ ORFDWLRQ FDQ EH FKDQJHG LQ
HLWKHU RI WZR ZD\V
8VH WKH =RRP GLVSOD\ WR FKDQJH WKH &9 2XWSXW LQ WKH 5XQ PRGH RU
:ULWH D ODGGHU SURJUDP WKDW ZLOO FRQYHUW WKH &9 2XWSXW WR DQ DQDORJ
YDOXH DQG SODFH LW LQWR WKH ´2XWSXWµ RU ´&RQWURO 9DULDEOHµ ORFDWLRQ $Q
H[DPSOH RI WKLV LV VKRZQ RQ SDJH ï
,QSXW2XWSXW 5DQJHV
7KH LQSXW PRGXOH PHDVXULQJ WKH SURFHVV YDULDEOH 39 PXVW KDYH D IXOO VFDOH
ELQDU\ UDQJH RI WR ,I WKLV YDOXH LV OHVV WKDQ ELW VHW WKHQ D
YDOXH RI ]HUR ZLOO EH XVHG IRU 39 DQG WKH ´3URFHVV YDU RXW RI UDQJHµ ELW ZLOO
EH VHW ELW RI ZRUG LQ WKH FRQWURO EORFN ,I WKH SURFHVV YDULDEOH LV !
ELW VHW WKHQ D YDOXH RI LV XVHG IRU 39 DQG WKH ´3URFHVV YDU
RXW RI UDQJHµ ELW LV VHW
7KH &RQWURO 9DULDEOH FDOFXODWHG E\ WKH 3,' LQVWUXFWLRQ KDV WKH VDPH UDQJH
RI WR 7KH &RQWURO 2XWSXW ZRUG RI WKH FRQWURO EORFN KDV WKH
UDQJH RI WR <RX FDQ VHW ORZHU DQG XSSHU OLPLWV IRU WKH LQVWUXFWLRQ·V
FDOFXODWHG RXWSXW YDOXHV ZKHUH DQ XSSHU OLPLW RI FRUUHVSRQGV WR D
&RQWURO 9DULDEOH OLPLW RI
ï
&KDSWHU
3,' ,QVWUXFWLRQ
'%
63 (UURU 5DQJH
ï'%
7LPH
=HURFURVVLQJ LV GHDGEDQG FRQWURO WKDW OHWV WKH LQVWUXFWLRQ XVH WKH HUURU IRU
FRPSXWDWLRQDO SXUSRVHV DV WKH SURFHVV YDULDEOH FURVVHV LQWR WKH GHDGEDQG
XQWLO LW FURVVHV WKH VHWSRLQW 2QFH LW FURVVHV WKH VHWSRLQW HUURU FURVVHV ]HUR
DQG FKDQJHV VLJQ DQG DV ORQJ DV LW UHPDLQV LQ WKH GHDGEDQG WKH LQVWUXFWLRQ
FRQVLGHUV WKH HUURU YDOXH ]HUR IRU FRPSXWDWLRQDO SXUSRVHV
2XWSXW $ODUPV
<RX PD\ VHW DQ RXWSXW DODUP RQ WKH FRQWURO RXWSXW &2 DW D VHOHFWHG YDOXH
DERYH DQGRU EHORZ D VHOHFWHG RXWSXW SHUFHQW :KHQ WKH LQVWUXFWLRQ GHWHFWV
WKDW WKH RXWSXW &2 KDV H[FHHGHG HLWKHU YDOXH LW VHWV DQ DODUP ELW ELW IRU
ORZHU OLPLW ELW IRU XSSHU OLPLW LQ ZRUG RI WKH 3,' FRQWURO EORFN $ODUP
ELWV DUH UHVHW E\ WKH LQVWUXFWLRQ ZKHQ WKH RXWSXW &2 FRPHV EDFN LQVLGH WKH
OLPLWV 7KH LQVWUXFWLRQ GRHV QRW SUHYHQW WKH RXWSXW &2 IURP H[FHHGLQJ WKH
DODUP YDOXHV XQOHVV \RX VHOHFW RXWSXW OLPLWLQJ
6HOHFW XSSHU DQG ORZHU RXWSXW DODUPV E\ HQWHULQJ D YDOXH IRU WKH XSSHU DODUP
ZRUG DQG ORZHU DODUP ZRUG $ODUP YDOXHV DUH VSHFLILHG DV D
SHUFHQWDJH RI WKH RXWSXW ,I \RX GR QRW ZDQW DODUPV HQWHU ]HUR DQG
UHVSHFWLYHO\ IRU ORZHU DQG XSSHU DODUP YDOXHV DQG LJQRUH WKH DODUP ELWV
6HOHFW XSSHU DQG ORZHU RXWSXW OLPLWV E\ VHWWLQJ WKH OLPLW HQDEOH ELW ELW RI
FRQWURO ZRUG DQG HQWHULQJ DQ XSSHU OLPLW ZRUG DQG ORZHU OLPLW ZRUG
/LPLW YDOXHV DUH D SHUFHQWDJH WR RI WKH FRQWURO RXWSXW &2
7KH GLIIHUHQFH EHWZHHQ VHOHFWLQJ RXWSXW DODUPV DQG RXWSXW OLPLWV LV WKDW \RX
PXVW VHOHFW RXWSXW OLPLWLQJ WR HQDEOH OLPLWLQJ /LPLW DQG DODUP YDOXHV DUH
VWRUHG LQ WKH VDPH ZRUGV (QWHULQJ WKHVH YDOXHV HQDEOHV WKH DODUPV EXW QRW
OLPLWLQJ (QWHULQJ WKHVH YDOXHV DQG VHWWLQJ WKH OLPLW HQDEOH ELW HQDEOHV
OLPLWLQJ DQG DODUPV
$QWLUHVHW ZLQGXS LV D IHDWXUH WKDW SUHYHQWV WKH LQWHJUDO WHUP IURP EHFRPLQJ
H[FHVVLYH ZKHQ WKH RXWSXW &2 UHDFKHV D OLPLW :KHQ WKH VXP RI WKH 3,'
DQG ELDV WHUPV LQ WKH RXWSXW &2 UHDFKHV WKH OLPLW WKH LQVWUXFWLRQ VWRSV
FDOFXODWLQJ WKH LQWHJUDO RXWSXW WHUP XQWLO WKH RXWSXW &2 FRPHV EDFN LQ
UDQJH
ï
&KDSWHU
3,' ,QVWUXFWLRQ
,Q WKH PDQXDO PRGH WKH ++7 DOORZV \RX WR HQWHU D QHZ &2 YDOXH IURP WR
7KLV YDOXH LV FRQYHUWHG LQWR D QXPEHU IURP WR DQG ZULWWHQ WR
WKH &RQWURO 9DULDEOH DGGUHVV ,I \RX DUH XVLQJ DQ DQDORJ RXWSXW PRGXOH IRU
WKLV DGGUHVV \RX PXVW VDYH FRPSLOH WKH SURJUDP ZLWK WKH )LOH 3URWHFWLRQ
RSWLRQ VHW WR 1RQH 7KLV DOORZV ZULWLQJ WR WKH RXWSXW GDWD WDEOH ,I \RX GR
QRW SHUIRUP WKLV VDYH RSHUDWLRQ \RX ZLOO QRW EH DEOH WR VHW WKH RXWSXW OHYHO LQ
WKH PDQXDO PRGH ,I \RXU ODGGHU SURJUDP VHWV WKH PDQXDO RXWSXW OHYHO
GHVLJQ \RXU ODGGHU SURJUDP WR ZULWH WR WKH &9 DGGUHVV ZKHQ LQ WKH PDQXDO
PRGH 1RWH WKDW WKLV QXPEHU LV LQ WKH UDQJH RI WR QRW WR
:ULWLQJ WR WKH &2 SHUFHQW ZRUG ZLWK \RXU ODGGHU SURJUDP KDV QR HIIHFW
LQ WKH PDQXDO PRGH
7KH IROORZLQJ LV DQ H[DPSOH WKDW FDQ EH XVHG WR FRQWURO WKH RXWSXW &9 ZLWK
\RXU ODGGHU SURJUDP
ï
&KDSWHU
3,' ,QVWUXFWLRQ
Dest N7:0
LIM MUL
LIMIT TEST MULTIPLY
Low Lim 0 Source A N7:0
DDV
DOUBLEDIVIDE
Source 100
Dest N7:8
1RWHV RQ 2SHUDWLRQ
$ GLJLW %&' WKXPEZKHHO LV ZLUHG WR DQ LQSXW
PRGXOH DW , UDQJH ï
S:5
$ SXVKEXWWRQ ZLUHG WR , DFFHSWV WKH (U)
WKXPEZKHHO YDOXH 0
ï
&KDSWHU
3,' ,QVWUXFWLRQ
)HHG )RUZDUG
$SSOLFDWLRQV LQYROYLQJ WUDQVSRUW ODJV PD\ UHTXLUH WKDW D ELDV EH DGGHG WR WKH
&9 RXWSXW LQ DQWLFLSDWLRQ RI D GLVWXUEDQFH 7KLV ELDV FDQ EH DFFRPSOLVKHG LQ
WKH 6/& SURFHVVRU E\ ZULWLQJ D YDOXH WR WKH )HHG )RUZDUG %LDV HOHPHQW
WKH VHYHQWK HOHPHQW ZRUG LQ WKH FRQWURO EORFN ILOH VHH SDJH ï 7KH
YDOXH \RX ZULWH ZLOO EH DGGHG WR WKH RXWSXW DOORZLQJ D IHHG IRUZDUG DFWLRQ WR
WDNH SODFH <RX PD\ DGG D ELDV E\ ZULWLQJ D YDOXH EHWZHHQ DQG WR
ZRUG ZLWK \RXU ++7 RU ODGGHU SURJUDP
RQïWLPH
ï
&KDSWHU
3,' ,QVWUXFWLRQ
PID
PID
Control Block N7:2
Process Variable N7:0
Control Variable N7:1
Control Block Length 23
TON
TIMER ON DELAY (EN)
Timer T4:0
Time Base 0.01 (DN)
Preset 1000
Accum 0 &\FOH 7LPH RI WKH 2XWSXW
GRT O:1.0
GREATERTHAN (U)
Source A T4:0.ACC 0
0
Source B N7:25 7LPH 3URSRUWLRQLQJ
0 2XWSXW &RQWDFW
T4:0 T4:0
] [ (RES)
DN
NEQ O:1.0
NOT EQUAL (L)
Source A N7:25 0
0
Source B 0
DDV
DOUBLEDIVIDE
Source 16383 2XWSXW DV D )UDFWLRQ
RI &\FOH 7LPH
Dest N7:25
0
CLR
CLEAR
&OHDUV 0LQRU (UURU )ODJ
Dest S:5
0
END
ï
&KDSWHU
3,' ,QVWUXFWLRQ
3,' 7XQLQJ
3,' WXQLQJ UHTXLUHV D NQRZOHGJH RI SURFHVV FRQWURO ,I \RX DUH
LQH[SHULHQFHG LW ZLOO EH KHOSIXO LI \RX REWDLQ WUDLQLQJ RQ WKH SURFHVV FRQWURO
WKHRU\ DQG PHWKRGV XVHG E\ \RXU FRPSDQ\
7KHUH DUH D QXPEHU RI WHFKQLTXHV WKDW FDQ EH XVHG WR WXQH D 3,' ORRS 7KH
IROORZLQJ 3,' WXQLQJ PHWKRG LV JHQHUDO DQG LV OLPLWHG LQ WHUPV RI KDQGOLQJ
ORDG GLVWXUEDQFHV
3URFHGXUH
&UHDWH \RXU ODGGHU SURJUDP 0DNH FHUWDLQ WKDW \RX KDYH SURSHUO\ VFDOHG
\RXU DQDORJ LQSXW WR WKH UDQJH RI WKH SURFHVV YDULDEOH 39 DQG WKDW \RX
KDYH SURSHUO\ VFDOHG \RXU FRQWURO YDULDEOH &9 WR \RXU DQDORJ RXWSXW
&RQQHFW \RXU SURFHVV FRQWURO HTXLSPHQW WR \RXU DQDORJ PRGXOHV
'RZQORDG \RXU SURJUDP WR WKH SURFHVVRU /HDYH WKH SURFHVVRU LQ WKH
SURJUDP PRGH
,PSRUWDQW (QVXUH WKDW DOO SRVVLELOLWLHV RI PDFKLQH PRWLRQ KDYH EHHQ
FRQVLGHUHG ZLWK UHVSHFW WR SHUVRQDO VDIHW\ DQG HTXLSPHQW
GDPDJH ,W LV SRVVLEOH WKDW \RXU RXWSXW &9 PD\ VZLQJ EHWZHHQ
DQG ZKLOH WXQLQJ
ï
&KDSWHU
3,' ,QVWUXFWLRQ
$GMXVW WKH JDLQ ZKLOH REVHUYLQJ WKH UHODWLRQVKLS RI WKH RXWSXW WR WKH
VHWSRLQW RYHU WLPH
1RWH WKDW JDLQ DGMXVWPHQWV GLVUXSW WKH SURFHVV ZKHQ \RX FKDQJH YDOXHV
7R DYRLG WKLV GLVUXSWLRQ VZLWFK WR WKH 0$18$/ PRGH SULRU WR PDNLQJ
\RXU JDLQ FKDQJH WKHQ VZLWFK EDFN WR WKH $872 PRGH
:KHQ \RX QRWLFH WKDW WKH SURFHVV LV RVFLOODWLQJ DERYH DQG EHORZ WKH
VHWSRLQW LQ DQ HYHQ PDQQHU UHFRUG WKH WLPH RI F\FOH 7KDW LV REWDLQ WKH
QDWXUDO SHULRG RI WKH SURFHVV 5HFRUG WKH JDLQ YDOXH 5HWXUQ WR WKH
0$18$/ PRGH VWRS WKH SURFHVV LI QHFHVVDU\
6HW WKH ORRS XSGDWH WLPH DQG 67, WLPH LQWHUYDO LI DSSOLFDEOH WR D YDOXH RI
WR WLPHV IDVWHU WKDQ WKH QDWXUDO SHULRG
,I WKH F\FOH WLPH LV VHFRQGV IRU H[DPSOH DQG \RX FKRRVH WR VHW WKH
ORRS XSGDWH WLPH WR WLPHV IDVWHU WKDQ WKH QDWXUDO UDWH VHW WKH ORRS
XSGDWH WLPH WR ZKLFK ZRXOG UHVXOW LQ D VHFRQG UDWH
6HW WKH JDLQ .F YDOXH WR WKH JDLQ QHHGHG WR REWDLQ WKH QDWXUDO SHULRG RI
WKH SURFHVV )RU H[DPSOH LI WKH JDLQ YDOXH UHFRUGHG LQ VWHS ZDV VHW
WKH JDLQ WR
6HW WKH UHVHW WHUP 7L WR DSSUR[LPDWH WKH QDWXUDO SHULRG ,I WKH QDWXUDO
SHULRG LV VHFRQGV DV LQ RXU H[DPSOH \RX ZRXOG VHW WKH UHVHW WHUP WR
PLQXWHV SHU UHSHDW DSSUR[LPDWHV VHFRQGV
1RZ VHW WKH UDWH 7G HTXDO WR D YDOXH WKDW RI WKH UHVHW WHUP )RU RXU
H[DPSOH WKH YDOXH ZLOO EH XVHG WR SURYLGH D UDWH WHUP RI PLQXWHV
SHU UHSHDW
3ODFH WKH SURFHVV LQ WKH $872 PRGH ,I \RX KDYH DQ LGHDO SURFHVV WKH
3,' WXQLQJ ZLOO EH FRPSOHWH
7R PDNH DGMXVWPHQWV IURP WKLV SRLQW SODFH WKH 3,' LQVWUXFWLRQ LQ WKH
0$18$/ PRGH HQWHU WKH DGMXVWPHQW WKHQ SODFH WKH 3,' LQVWUXFWLRQ
EDFN LQ WKH $872 PRGH
7KLV WHFKQLTXH RI JRLQJ WR 0$18$/ WKHQ EDFN WR $872 HQVXUHV WKDW
DOO ´LQWHJUDO EXLOGXSµ DQG ´JDLQ HUURUµ LV UHPRYHG DW WKH WLPH HDFK
DGMXVWPHQW LV PDGH 7KLV DOORZV \RX WR VHH WKH HIIHFWV RI HDFK DGMXVWPHQW
LPPHGLDWHO\
ï
27
Chapter
Status File Functions The SLC 5/02 processor has the functions of the fixed and SLC 5/01
processors plus the functions listed in the right-hand column of the figure
below.
The status file gives you information concerning the various instructions you
use in your program, and other information such as EEPROM functionality.
The status file indicates minor faults, diagnostic information on major faults,
processor modes, scan time, baud rate, system node addresses, and various
other data.
Important: Do not write to status file data unless the word or bit is listed as
read/write in the descriptions that follow. If you intend writing
to status file data, it is imperative that you first understand the
function fully.
Word Function
S:0 Arithmetic Flags Words 16 through 32 are functional for the SLC 5/02 only:
S:1L, S:1H Processor Mode Status/Control Word Function
S:2L, S:2H STI Bits/DH-485 Communications S:16, S:17 Test Single Step - Start Step On - Rung/File
S:3L Current Scan Time S:18, S:19 Test Single Step - End Step Before - Rung/File
S:3H Watchdog Scan Time S:20, S:21 Test - Fault/Powerdown - Rung/File
S:4 Free Running Clock S:22 Maximum Observed Scan Time
S:5 Minor Error Bits S:23 Average Scan Time
S:6 Major Error Code S:24 Index Register
S:7, S:8 Suspend Code/Suspend File S:25, S:26 I/O Interrupt Pending
S:9, S:10 Active Nodes S:27, S28 I/O Interrupt Enabled
S:11, S;12 I/O Slot Enables S:29 User Fault Routine File Number
S:13, S:14 Math Register S:30 Selectable Timed Interrupt Setpoint
S:15L Node Address S:31 Selectable Timed Interrupt File Number
S:15H Baud Rate S:32 I/O Interrupt Executing
27–1
Chapter 27
The Status File
The following tables describe the status file functions, beginning at address
S:0 and ending at address S:32. If a bullet (•) is present in the columns
headed SLC 5/02 and SLC 5/01, Fixed, the function applies to the indicated
processor(s).
5/01,
Address Description 5/02
Fixed
Sign Bit • •
S:0/3 This bit is set by the processor when the result of a math, logical, or
move instruction is negative. Otherwise the bit remains cleared.
S:0/4 to Reserved • •
S:0/15
27–2
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–3
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–4
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
To program this feature, set this bit using the EDT_DAT function.
Then store the program in the memory module.
The memory module you install in the processor must have status
file bit S:1/12 set. Loading will take place if the master password
and/or password in the processor and memory module match.
Loading will also take place if the processor has neither a password
nor master password.
When S:1/12 is set in the status file of the user program in RAM
memory, it does not require the presence of the memory module to
enter the Run or Test modes.
Application note: Set both S:1/11 and S:1/12 to 1) autoload and run
every power cycle and 2) require the presence of the memory
module to enter the Run or Test mode.
To program this feature, set this bit using the EDT_DAT function.
Then store the program in the memory module. This feature is
particularly useful when you are troubleshooting hardware failures
with spares" (replacement modules). This feature can also be used
to facilitate application logic upgrades in the field without the need of
a programming device.
27–5
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
2) enters the user fault routine with outputs active, allowing the fault •
routine ladder logic to attempt recovery from the fault condition. If
your fault routine determines that recovery is in order, clear S:1/13
using ladder logic prior to exiting the fault routine. If the fault routine
ladder logic does not understand the fault code, or if the routine
determines that it is not desirable to continue operation, exit the fault
routine with bit S:1/13 set. The outputs will then be placed in a safe
state and indicate the program mode (0 0001) in bits S:1/0-S:1/4.
When you clear bit S:1/13 using a programming device, the processor • •
mode changes from fault to program, allowing you to reenter the run
or test modes. You can set this bit in your ladder program to generate
an applicationspecific Major Error.
Important: Once a major fault state exists, you must correct the
condition causing the fault, and you must also clear this
bit in order for the processor to accept a mode change
attempt (into program, run, or test). Also, clear S:6 (error
code) to avoid the confusion of having an error code but
no fault condition.
Note that if a faulted program is uploaded into the HHT
the fault (S:1/13 set) goes with it. If the program is then
edited offline, you must clear the major fault bit in order
to download and run the program again.
27–6
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
This bit will be set during execution of the startup protection fault •
routine. See S:1/9.
27–7
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–8
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
S:2/9 Reserved • •
thru
S:2/13
27–9
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–10
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–11
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
Dest N7:0
AND
BITWISE AND
Source A 255
Source B N7:0
Dest N7:0
LES 1
LESS THAN (JMP)
Source A N7:0
Source B 5
27–12
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–13
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
S:5/1 Reserved • •
27–14
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
S:5/3 Major Error Detected while Executing User Fault Routine Bit •
Read/write. When set, the major error code (S:6) will then represent
the major error that occurred while processing the fault routine due to
another major error.
If this bit is ever set upon execution of the END, TND, or REF
instruction, a major error (0020) will be declared. To avoid this type of
major error from occurring, examine the state of this bit inside your
fault routine, take appropriate action, and then clear bit S:5/3 using an
OTU instruction with S:5/3 or a CLR instruction with S:5.0.
Application example: Suppose you are executing your fault routine
for fault code 0016H Startup Protection. At rung 3 inside this fault
routine, a TON containing a negative preset is executed. When rung
4 is executed, fault code 0016H will be overwritten to indicate code
0034H, and S:5/3 will be set.
If your fault routine did not determine that S:5/3 was set, major error
0020H would be declared at the end of the first scan. To avoid this
problem, examine S:5/3, followed by S:6, prior to returning from your
fault routine. If S:5/3 is set, take appropriate action to remedy the
fault, then clear S:5/3.
S:5/5, Reserved • •
S:5/6, Read/write. Reserved for minor errors that revert to major errors at
S:5/7 the end of the scan.
27–15
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
S:5/12 Reserved • •
thru
S:5/15
27–16
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
Source B 22
27–17
Chapter 27
The Status File
Description User
Error
5/01,
Address Code Powerup Errors NonUser NonRecov Recov 5/02
Fixed
(Hex)
Description User
Error
5/01,
Address Code Going to Run Errors NonUser NonRecov Recov 5/02
Fixed
(Hex)
27–18
Chapter 27
The Status File
Description User
Error
5/01,
Address Code Runtime Errors NonUser NonRecov Recov 5/02
Fixed
(Hex)
S:6
0020
A minor error bit is set at the end of the scan. (See S:5 minor X • •
error bits.)
27–19
Chapter 27
The Status File
Description User
Error
5/01,
Address Code User Program Instruction Errors NonUser NonRecov Recov 5/02
Fixed
(Hex)
S:6 0030 Attempt was made to jump to one too many nested X • •
subroutine files. Can also mean that a program has
potentially recursive routines.
0033 Length of LFU, LFL, FFU, FFL, BSL, or BSR points past end X • •
of data file.
27–20
Chapter 27
The Status File
ERROR CODES: The characters xx in the following codes Slot xx Slot xx Slot xx Slot xx
represent the slot number, in hex. If the exact slot cannot be 0 00 8 08 16 10 24 18
determined, the characters xx become 1F. 1 01 9 09 17 11 25 19
2 02 10 0A 18 12 26 1A
RECOVERABLE I/O FAULTS (SLC 5/02 processors only): 3 03 11 0B 19 13 27 1B
Many I/O faults are recoverable. To recover, you must 4 04 12 0C 20 14 28 1C
disable the specified slot, xx, in the user fault routine. If you 5 05 13 0D 21 15 29 1D
do not disable slot xx, the processor will fault at the end of 6 06 14 0E 22 16 30 1E
the scan. 7 07 15 0F 23 17
Description User
Error
5/01,
Address Code I/O Errors NonUser NonRecov Recov 5/02
Fixed
(Hex)
xx52
A module required for the user program is detected as X • •
missing or removed.
xx54
A module required for the user program is detected as being X • •
the wrong type.
xx55
A module required for the user program is detected as having X • •
the wrong I/O count or wrong I/O driver.
xx56
The rack configuration specified in the user program is X • •
detected as being incorrect.
xx57
A specialty I/O module has not responded to a lock shared X • •
memory command within the required time limit.
xx58
A specialty I/O module has generated a generic fault. The X • •
module fault bit is set to 1 in the status byte of the module.
xx59
A specialty I/O module has not responded to a command as X • •
being completed within the required time limit.
xx5B
G file configuration error - user program G file size exceeds X •
capacity of the module.
27–21
Chapter 27
The Status File
Description User
Error
5/01,
Address Code I/O Errors NonUser NonRecov Recov 5/02
Fixed
(Hex)
S:6
xx5C
M0-M1 file configuration error - user program M0-M1 file X •
size exceeds capacity of the module.
27–22
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
If your program enters the SUS idle mode for code 1 when you run
the program, you have a limit switch control problem; if the SUS idle
mode for code 1 does not occur, you have a ladder logic problem.
27–23
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
Note: The SLC 5/02 processor informs each specialty I/O module •
that has been disabled/enabled. Some I/O modules may perform
other actions or inactions when disabled or reenabled. Refer to the
user information supplied with the specialty I/O module for possible
differences from the above descriptions.
27–24
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
Dest N7:0
MVM
MASKED MOVE
Source N7:0
Mask 00FF
Dest S:15
27–25
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
Dest N7:100
MVM
MASKED MOVE
Source N7:100
Mask FF00
Dest S:15
S:15H equal to 4
= 1024 decimal = 0400 hex = 0000 0100 0000 0000 binary
Example showing runtime protection for both baud rate 19200 (code
4) and node address 3:
MOV
MOVE
Source 1027
Dest S:15
27–26
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–27
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
T4:6
(RES)
The value 52 equals 0034 Hex. This is Rung Number File Number
the error code for a negative timer
preset. B3
(L)
0
S:1
(U)
13
(RET)
27–28
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–29
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–30
Chapter 27
The Status File
5/01,
Address Description 5/02
Fixed
27–31
Chapter 27
The Status File
Status File Display -SLC The status file displays that apply to SLC 5/02 processors are shown below.
5/02 Processors The displays are accessible offline and online under the EDT DAT function.
To move between data files: Press NEXT FL or PREV FL. To move
between displays: Press NEXT PG or PREV PG. To move the cursor from
any data file address to any other data file address: Press ADDRESS, enter
the address, then press ENTER.
Status File
S2:11 & S2:12 I/O Slot Enables
1 2 3
0 0 0 0
1111 1111 1111 1111 1111 1111 1111 1111
Slot = 0
S2:11/0 = 1 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
27–32
Chapter 27
The Status File
Status File Display - SLC The figures below are the status file displays that apply to the SLC 5/01 and
5/01 and Fixed Processors fixed processors. The displays are accessible offline and online under the
EDT DAT function. To move between data files: Press NEXT FL or
PREV FL. To move between displays: Press NEXT PG or PREV PG. To
move the cursor from any data file address to any other data file address:
Press ADDRESS, enter the address, then press ENTER.
27–33
28
Chapter
Troubleshooting Faults
This chapter:
• lists the major error fault codes
• indicates the probable causes of faults
• recommends corrective action
Chapter 27 also lists the error codes, under word S:6.
The subroutine does not execute for non-user faults. The user fault routine is
discussed in chapter 29.
28–1
Chapter 28
Troubleshooting Faults
Status File Fault Display The status file displays applying to major and minor faults are shown below.
The displays are accessible offline and online under the EDT DAT function.
Press NEXT__FL until you get to the status file. Move between displays by
pressing NEXT__PG or PREV__PG.
A –Word S2:1. Bit S2:1/13 in this word is the major fault bit. Clear the fault
bit at this display by setting S2:1/13 to 0. Press the [F1], ADDRESS, type
S:1/13, press [ENTER], type 0, press [ENTER].
B –Word S2:5. Minor fault bits. Clear the fault at this display by setting the
bits to 0. Press the [F1], ADDRESS, type in the address of the minor fault
bit, press [ENTER], type 0, press [ENTER].
C –Word S2:6. Fault code. Clear the code at this display by setting S2:6 to
0. Press the [F1], ADDRESS, type in the address of the fault code, press
[ENTER], type 0, press [ENTER].
Error Code Description, The following tables list error types as:
Cause, and • Powerup
Recommended Action • Going-to-Run
• Runtime
• User Program Instruction
• I/O
Each table lists the error code description, the probable cause, and the
recommended corrective action.
28–2
Chapter 28
Troubleshooting Faults
Powerup Errors
Error Code
Description Probable Cause Recommended Action
(Hex)
0001 NVRAM error. • Either Noise, Correct the problem, reload the program,
and run. You can use the autoload feature
• lightning, with a memory module to automatically
• improper grounding, reload the program and enter the Run
• lack of surge suppression on outputs mode.
with inductive loads, or
• poor power source.
• Loss of battery or capacitor backup.
0002 Unexpected hardware watchdog timeout. • Either Noise, Correct the problem, reload the program,
and run. You can use the autoload feature
• lightning, with a memory module to automatically
• improper grounding, reload the program and enter the Run
• lack of surge suppression on outputs mode.
with inductive loads, or
• poor power source.
0003 Memory module memory error. Memory module memory is corrupted. Reprogram the memory module. If the
error persists, replace the memory module.
Going-to-Run Errors
Error Code
Description Probable Cause Recommended Action
(Hex)
0010 The processor does not meet the required The revision level of the processor is not Consult your local AB representative to
revision level. compatible with the revision level for which purchase an upgrade kit for your
the program was developed. processor.
0011 The executable program file number 2 is Incompatible or corrupt program is present. Reload the program or reprogram with AB
absent. approved programming device.
0012 The ladder program has a memory error. • Either Noise, Correct the problem, reload the program,
and run. If the error persists, be sure to
• lightning, use AB approved programming device to
• improper grounding, develop and load the program.
• lack of surge suppression on outputs
with inductive loads, or
• poor power source.
0013 • The required memory module is absent, • Either one of the status bits is set in the • Either install a memory module in the
or program but the required memory processor, or
• S:1/10 or S:1/11 is not set as required module is absent, or • upload the program from the processor
by the program. • status bit S:1/10 or S:1/11 is not set in to the memory module.
the program stored in the memory
module, but it is set in the program in
the processor memory.
28–3
Chapter 28
Troubleshooting Faults
Error Code
Description Probable Cause Recommended Action
(Hex)
0014 Internal file error. • Either noise, Correct the problem, reload the program,
and run. If the error persists, be sure to
• lightning, use AB approved programming device to
• improper grounding, develop and load the program.
• lack of surge suppression on outputs
with inductive loads, or
• poor power source.
0015 Configuration file error. • Either noise, Correct the problem, reload the program,
and run. If the error persists, be sure to
• lightning, use AB approved programming device to
• improper grounding, develop and load the program.
• lack of surge suppression on
outputs with inductive loads, or
• poor power source.
0016 Startup protection after power loss. Error Status bit S:1/9 has been set by the user • Either reset bit S:1/9 if this is consistent
condition exists at powerup when bit S:1/9 program. Refer to chapter 31 for details on with the application requirements, and
is set and powerdown occurred while the operation of status bit S:1/9. change the mode back to run, or
running.
• clear S:1/13, the major fault bit, before
the end of the first program scan is
reached.
Runtime Errors
Error Code
Description Probable Cause Recommended Action
(Hex)
0004 Memory error occurred during the Run • Either noise, Correct the problem, reload the program,
mode. and run. You can use the autoload feature
• lightning, with a memory module to automatically
• improper grounding, reload the program and enter the Run
• lack of surge suppression on outputs mode.
with inductive loads, or
• poor power source.
0020 A minor error bit is set at the end of the • Either math or FRD instruction overflow Correct the programming problem, reload
scan. has occurred, the program and enter the Run mode. See
also minor error bits S:5 in chapter 27.
• sequencer or shift register instruction
error was detected,
• a major error was detected while
executing a user fault routine, or
• M0-M1 file addresses were referenced
in the user program for a disabled slot.
28–4
Chapter 28
Troubleshooting Faults
Error Code
Description Probable Cause Recommended Action
(Hex)
0021 A remote power failure of an expansion I/O Fixed and FRN 1 to 4 SLC 5/01 Fixed and FRN 1 to 4 SLC 5/01
rack has occurred. processors: Power was removed or the processors: Cycle power on the local
power dipped below specification for an rack.
Note: A modular system that encounters expansion rack.
an overvoltage or overcurrent condition in SLC 5/02 processors and FRN 5 and
any of its power supplies can produce any SLC 5/02 processors and FRN 5 and higher SLC 5/01 processors: Reapply
of the I/O error codes listed on pages 28-8 higher SLC 5/01 processors: This error power to the expansion rack.
to 28-10 (instead of code 0021). The code is present only while power is not
overvoltage or overcurrent condition is applied to an expansion rack. This is the
indicated by the power supply LED being only selfclearing error code. When power
off. is reapplied to the expansion rack, the
fault will be cleared.
ATTENTION: Fixed and FRN 1 to 4
! SLC 5/01 processors - If the
remote power failure occurred
while the processor was in the Run
mode, error 0021 will cause the
major error halted bit (S:1/13) to be
cleared at the next powerup of the
local rack.
0022 The user watchdog scan time has been • Either Watchdog time is set too low for • Either increase the watchdog timeout in
exceeded. the user program, or the status file (S:3H), or
• user program caught in a loop. • correct the user program problem.
0023 Invalid or nonexistent STI interrupt file. • Either an STI interrupt file number was • Either disable the STI interrupt setpoint
assigned in the status file, but the (S:30) and file number (S:31) in the
subroutine file was not created, or status file, or
• the STI interrupt file number assigned • create an STI interrupt subroutine file
was 0, 1, or 2. for the file number assigned in the
status file (S:31). The file number must
not be 0, 1, or 2.
0024 Invalid STI interrupt interval. The STI setpoint is out of range (greater • Either disable the STI interrupt setpoint
than 2550 ms, or negative). (S:30) and file number (S:31) in the
status file, or
• create an STI interrupt routine for the
file number referenced in the status file
(S:31). The file number must not be 0,
1, or 2.
0025 Excessive stack depth/JSR calls for the A JSR instruction is calling for a file Correct the user program to meet the
STI routine. number assigned to an STI routine. requirements and restrictions for the JSR
instruction, then reload the program and
run.
28–5
Chapter 28
Troubleshooting Faults
Error Code
Description Probable Cause Recommended Action
(Hex)
0026 Excessive stack depth/JSR calls for an I/O A JSR instruction is calling for a file Correct the user program to meet the
interrupt routine. number assigned to an I/O interrupt requirements and restrictions for the JSR
routine. instruction, then reload the program and
run.
0027 Excessive stack depth/JSR calls for the A JSR instruction is calling for a file Correct the user program to meet the
user fault routine. number assigned to the user fault routine. requirements and restrictions for the JSR
instruction, then reload the program and
run.
0028 Invalid or nonexistent startup protection" • Either a fault routine file number was • Either disable the fault routine file
fault routine file value. created in the status file, but the fault number (S:29) in the status file, or
routine file was not physically created, • create a fault routine for the file number
or referenced in the status file (S:29). The
• the file number created was 0, 1, or 2. file number must not be 0, 1, or 2.
0029 Indexed address reference is outside of The program is referencing through Correct and reload the user program. This
the entire data file space. indexed addressing an element beyond problem cannot be corrected by writing to
the allowed range. The range is from B3:0 the index register word S:24.
to the last element of the last data file
created by the user.
002A Indexed address reference is beyond the The program is referencing through Correct the user program, allocate more
specific referenced data file. indexed addressing an element beyond a data space using the memory map, or
file boundary. resave the program allowing crossing of
file boundaries. Reload the user program.
This problem cannot be corrected by
writing to the index register word S:24.
0030 An attempt was made to jump to one too • Either more than the maximum of 4 (8 if Correct the user program to meet the
many nested subroutine files. This code you are using a SLC 5/02 processor) requirements and restrictions for the JSR
can also mean that a program has levels of nested subroutines are called instruction, then reload the program and
potential recursive routines. for in the user program, or run.
• nested subroutine(s) are calling for
subroutine(s) of a previous level.
0031 An unsupported instruction reference was The type or series level of the processor • Either replace the processor with one
detected. does not support an instruction residing in that supports the user program, or
the user program.
• modify the user program so that all
instructions are supported by the
processor, then reload the program and
run.
28–6
Chapter 28
Troubleshooting Faults
Error Code
Description Probable Cause Recommended Action
(Hex)
0032 A sequencer instruction length/position The program is referencing an element Correct the user program or allocate more
parameter points past the end of a data beyond a file boundary set up by the data file space using the memory map,
file. sequencer instruction. then reload and run.
0033 The length parameter of an LFU, LFL, The program is referencing an element Correct the user program or allocate more
FFU, FFL, BSL, or BSR instruction points beyond a file boundary set up by the data file space using the memory map,
past the end of a data file. instruction. then reload and run.
0034 A negative value for a timer accumulator or The accumulated or preset value of a timer If the user program is moving values to the
preset value was entered. in the user program was detected as being accumulated or preset word of a timer,
negative. make certain these values cannot be
negative. Correct the user program,
reload, and run.
0034 A negative or zero HSC preset was The preset value for the HSC instruction is If the user program is moving values to the
(related to detected in an HSC instruction. out of the valid range. Valid range is preset word of the HSC instruction, make
HSC 1-32767. certain the values are within the valid
instruction) range. Correct the user program, reload,
and run.
0035 A TND, SVC, or REF instruction is called A TND, SVC, or REF instruction is being Correct the user program, reload, and run.
within an interrupt or user fault routine. used in an interrupt or user fault routine.
This is illegal.
0036 An invalid value is being used for a PID An invalid value was loaded into a PID Code 0036 is discussed in chapter 26.
instruction parameter. instruction by the user program or by the
user via the data monitor function for this
instruction.
0038 An RET instruction was detected in a An RET instruction resides in the main Correct the user program, reload, and run.
nonsubroutine file. program.
28–7
Chapter 28
Troubleshooting Faults
I/O Errors
Error Code
Description Probable Cause Recommended Action
(Hex)
xx50 A rack data error is detected. • Either noise, Correct the problem, clear the fault, and
reenter Run mode.
• lightning,
• improper grounding,
• lack of surge suppression on outputs
with inductive loads, or
• poor power source.
xx51 A stuck" runtime error is detected on an If this is a discrete I/O module, this is a Cycle power to the system. If this does not
I/O module. noise problem. If this is a specialty I/O correct the problem, replace the module.
module, refer to the applicable user
manual for the probable cause.
xx52 A module required for the user program is An I/O module configured for a particular • Either disable the slot in the status file
detected as missing or removed. slot is missing or has been removed. (S:11 and S:12), or
• Insert the required module in the slot.
xx53 At goingtorun, a user program declares a • Either the I/O slot is not configured for a • Either disable the slot in the status file
slot as unused, and that slot is detected as module, but a module is present, or (S:11 and S:12), clear the fault and run,
having an I/O module inserted.
• the I/O module has reset itself. • Remove the module, clear the fault and
This code can also mean that an I/O run, or
module has reset itself. • modify the I/O configuration to include
the module, then reload the program
and run.
• If you suspect that the module has reset
itself, clear the major fault and run.
xx54 A module required for the user program is An I/O module in a particular slot is a • Either replace the module with the
detected as being the wrong type. different type than was configured for that correct module, clear the fault, and run,
slot by the user. or
• change the I/O configuration for the slot,
reload the program and run.
28–8
Chapter 28
Troubleshooting Faults
Error Code
Description Probable Cause Recommended Action
(Hex)
xx55 A discrete I/O module required for the user • If this is a discrete I/O module, the I/O • If this is a discrete I/O module, replace it
program is detected as having the wrong count is different from that selected in with a module having the I/O count
I/O count. the I/O configuration. selected in the I/O configuration. Then,
This code can also mean that a specialty • If this is a specialty I/O module, the card clear the fault and run, or
card driver is incorrect. driver is incorrect. • change the I/O configuration to match
the existing module, then reload the
program and run.
• If this is a specialty I/O module, refer to
the user manual for that module.
xx56 The rack configuration is incorrect. The rack configuration specified by the Correct the rack configuration, reload the
user does not match the hardware. program and run.
xx57 A specialty I/O module has not responded The specialty I/O module is not responding Cycle rack power. If this does not correct
to a Lock Shared Memory command within to the processor in the time allowed. the problem, refer to the user manual for
the required time limit. the specialty I/O module. You may have to
replace the module.
xx58 A specialty I/O module has generated a Refer to the user manual for the specialty Cycle rack power. If this does not correct
generic fault. The card fault bit is set (1) in I/O module. the problem, refer to the user manual for
the module's status byte. the specialty I/O module. You may have to
replace the module.
xx59 A specialty I/O module has not responded A specialty I/O module did not complete a Refer to the user manual for the specialty
to a command as being completed within command from the processor in the time I/O module. You may have to replace the
the required time limit. allowed. module.
xx5A Hardware interrupt problem (stuck"). If this is a discrete I/O module, this is a Cycle rack power. Check for a noise
noise problem. If this is a specialty I/O problem and be sure proper grounding
module, refer to the user manual for the practices are used. If this is a specialty I/O
module. module, refer to the user manual for the
module. You may have to replace the
module.
xx5B G file configuration error - user program G G file is incorrect for the module in this slot. Refer to the user manual for the specialty
file size exceeds the capacity of the I/O module. Reconfigure the G file as
module. directed in the manual, then reload and
run.
xx5C M0-M1 file configuration error - user M0-M1 files are incorrect for the module in Refer to the user manual for the specialty
program M0-M1 file size exceeds capacity this slot. I/O module. Reconfigure the M0-M1 files
of the module. as directed in the manual, then reload and
run.
xx5D Interrupt service requested is not The specialty I/O module has requested Refer to the user manual for the specialty
supported by the processor. service and the processor does not I/O module to determine which processors
support it. support use of the module. Change
processor to one that supports the module.
xx5E Processor I/O driver (software) error. Corrupt processor I/O driver software. Reload program using AB approved
programming device.
28–9
Chapter 28
Troubleshooting Faults
Error Code
Description Probable Cause Recommended Action
(Hex)
xx90 Interrupt problem on a disabled slot. A specialty I/O module requested service Refer to the user manual for the
while a slot was disabled. specialty I/O module. You may have to
replace the module.
xx91 A disabled slot has faulted. A specialty I/O module in a disabled slot Cycle rack power. If this does not
has faulted. correct the problem, refer to the user
manual for the specialty I/O module.
You may have to replace the module.
xx92 Invalid or nonexistent module interrupt The I/O configuration/ISR file information Correct the I/O configuration/ISR file
subroutine (ISR) file. for a specialty I/O module is incorrect. information for the specialty I/O module.
Refer to the user manual for the module
for the correct ISR file information. Then
reload the program and run.
xx93 Unsupported I/O module specific major The processor does not recognize the Refer to the user manual for the
error. error code from a specialty I/O module. specialty I/O module.
xx94 A module has been detected as being The module has been inserted in the No module should ever be inserted in a
inserted under power in the run or test rack under power, or the module has rack under power. If this occurs and the
mode. reset itself. module is not damaged,
• Either remove the module, clear the
This code also can mean that an I/O fault and run, or
module has reset itself.
• add the module to the I/O
configuration, reference the module in
the user program where required,
reload the program and run.
28–10
29
Chapter
This chapter applies to the SLC 5/02 processor only. It covers the following
topics:
• recoverable and non–recoverable user faults
• application examples of user fault subroutines
Overview of the User Fault The SLC 5/02 processor allows you to designate a subroutine file as a User
Routine Fault Routine. This file will be executed when any recoverable or
non-recoverable user fault occurs. The file is not executed for non-user
faults.
The User Fault Routine gives you the option of preventing a processor
shutdown upon the occurrence of a specific user fault. You do this via the
designated subroutine by entering a ladder program which will prevent the
fault from occurring. You can handle a number of user faults in this way, as
the example on page 29–6 shows.
Recoverable and Faults are classified as recoverable and non-recoverable user faults, and
Non-Recoverable User Faults non-user faults. A complete list appears in chapter 27, “Status File.”
Definitions:
The user fault routine The user fault routine executes for 1 pass. The user fault routine
does not execute. (Hint: You may initiate a MSG instruction may clear the fault by
to another node to identify the fault clearing bit S:1/13.
condition of the processor.)
The required memory module is absent or either S:1/10 or S:1/11 is not set
0013
(and the program requires it).
Startup protection after power loss. Error condition exists at powerup when
0016
bit S:1/9 is set and powerdown occurred while running.
RUNTIME ERRORS
Indexed address reference outside of entire data file space (range of B3:0
0029
through the last file).
INSTRUCTION ERRORS
0033 Length of LFU, LFL, FFU, FFL, BSL, or BSR points past end of data file.
0034 A negative value for a timer accumulator or preset value was detected.
29–2
Chapter 29
Understanding the User Fault Routine
5/02 Processor Only
I/O ERRORS
Recoverable only if you disable slot xx in the
user fault routine
xx52 A module required for the user program is detected as missing or removed.
A module required for the user program is detected as being the wrong
xx54
type.
A module required for the user program is detected as having the wrong
xx55
I/O count or wrong I/O driver.
G file configuration error - User program G file size exceeds capacity of the
xx5B
module.
M0-M1 file configuration error - User program M0-M1 file size exceeds
xx5C
capacity of the module.
xx60
Identifies an I/O module specific recoverable major error. Refer to the user
thru
manual supplied with the module.
xx6F
29–3
Chapter 29
Understanding the User Fault Routine -
5/02 Processor Only
RUNTIME ERRORS
INSTRUCTION ERRORS
Attempt was made to jump to one too many nested subroutine files. Can
0030
also mean that a program has potentially recursive routines.
I/O ERRORS
A specialty I/O module has generated a generic fault. The module fault bit
xx58
is set to 1 in the status byte of the module.
xx70 thru Identifies an I/O module specific nonrecoverable major error. Refer to the
xx7F user manual supplied with the module.
In the run or test mode, a module has been detected as being inserted
xx94
under power. Can also mean that an I/O module has reset itself.
29–4
Chapter 29
Understanding the User Fault Routine
5/02 Processor Only
Creating a User Fault To utilize the user fault routine, create a subroutine file (3–255), then enter
Subroutine this file number in word S:29 of the status file. In the status file display
below, subroutine file 3 is designated as “Err File,” the user fault routine:
Status File
S2:5 Minor Fault 0000 0000 0000 0000
S2:6 Fault Code 0000H
Desc: No Error
Word S:29 S2:29 Err File: 3 Indx Cross File: No
S2:24 Index Reg: 0 Single Step: No
S2:5/0 = 0 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
Application Example Suppose you have a program in which you want to control major errors 0020
(MINOR ERROR AT END OF SCAN) and 0034 (NEGATIVE VALUE IN
TIMER PRE OR ACC) in the following manner:
• Prevent a processor shutdown if the overflow trap bit S:5/0 is set. Permit
a processor shutdown when S:5/0 is set more than five times.
• Prevent a processor shutdown if the accumulator value of timer T4:0
becomes negative. Reset the negative accumulator value to zero.
Energize an output to indicate that the accumulator has gone negative one
or more times.
• Allow a processor shutdown for all other user faults.
A possible method of accomplishing this is indicated in the following
figures. Subroutines 3, 4, and 5 are created. The user fault routine is
designated as subroutine file 3.
29–5
Chapter 29
Understanding the User Fault Routine -
5/02 Processor Only
END
If the fault code (S:6) is 0020H, subroutine file 4 is executed. If the fault code
is 0034H, subroutine file 5 is executed.
29–6
Chapter 29
Understanding the User Fault Routine
5/02 Processor Only
GRT RET
GREATER THAN RETURN
Source A C5:0.ACC
0
Source B 5
S:5 S:5
] [ (U)
0 0
S:1
(U)
13
RET
RETURN
END
29–7
Chapter 29
Understanding the User Fault Routine -
5/02 Processor Only
O:3.0
( )
3
RET
RETURN
END
29–8
30
Chapter
A–B
This chapter applies to the SLC 5/02 processor only. It covers the following
topics:
• STI operation
• STI parameters
• STD and STE instructions
• STS instruction
• INT instruction
STI Overview The STI (selectable timed interrupt) function can be used with the SLC 5/02
processor only. This function allows you to interrupt the scan of the main
program file automatically, on a periodic basis, in order to scan a specified
subroutine file.
Operation After you download your program and enter the Run mode, the STI begins
operation as follows:
• The STI timer begins timing.
• At timeout, the main program scan is interrupted and the specified STI
subroutine file is scanned; simultaneously, the STI timer is reset.
• When the STI subroutine scan is completed, scanning of the main
program file resumes at the point where it left off.
• The cycle repeats.
30–1
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
The STI subroutine will contain the rungs of your application logic. You can
program any instruction inside the STI subroutine except a TND, REF, or
SVC instruction. IIM or IOM instructions are needed in an STI subroutine if
your application requires immediate update of input or output points. End
the STI subroutine with an RET instruction.
JSR stack depth is limited to 3. That is, you may call other subroutines to a
level 3 deep from an STI subroutine.
Interrupt Occurrences
STI interrupts can occur at any point in your program, but not necessarily at
the same point on successive interrupts. Interrupts can only occur between
instructions in your program, inside the I/O scan (between slots), or between
the servicing of communications packets. STI execution time adds directly
to the overall scan time.
Interrupt Latency
The interrupt latency (interval between the STI timeout and the start of the
interrupt subroutine) is 3.7 milliseconds max. for the SLC 5/02 series B
processor, and 2.4 milliseconds max. for the SLC 5/02 series C and later.
During the latency period, the processor is performing operations that cannot
be disturbed by the STI interrupt function.
30–2
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
Interrupt Priorities
Interrupt priorities are as follows:
1. Fault routine
2. STI subroutine
3. I/O interrupt subroutine (ISR)
An executing interrupt can only be interrupted by an interrupt having higher
priority.
30–3
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
STI Parameters The following parameters are associated with the STI function. These
parameters have status file addresses. They are described here and also in
chapter 27.
Word S:31 STI file number – This can be any number from 3 to
255. A value of zero disables the STI function. An invalid number
will generate fault 0023.
Word S:30 Setpoint – This is the time between the starting point of
successive scans of the STI file. It can be any value from 10 to 2550
milliseconds. (You enter a value of 1– 255, which results in a
10–2550 ms setpoint.) A value of zero disables the STI function. An
invalid time will generate fault 0024.
Bit S:2/0 Pending bit – Read only. This bit is set when the STI
timer has timed out while the STI file is either being scanned or is
disabled.
This bit will not be set if the STI timer expires while executing the
user fault routine.
This bit is reset upon the start of the STI routine, execution of an STS
instruction, powerup, and exit from the Run mode.
Bit S:2/1 Enable bit – The default value is 1 (set). When a file
number between 3 and 255 is present in word S:31 and a setpoint
value between 1 and 255 is present in word S:30, a set enable bit
allows scanning of the STI file. If the bit is reset by an STD
instruction, scanning of the STI file no longer occurs. If the bit is set
by an STE or STS instruction, scanning is again allowed.
The enable bit only enables/disables the scanning of the STI
subroutine. It does not affect the STI timer. The STS instruction
affects both the enable bit and the STI timer. The default state is
enabled. If this bit is set/reset using the STE, STD, or STS
instruction, enable/disable takes effect immediately.
If this bit is set or reset by the user program or communications, it
will not take effect until the next end of scan.
Bit S:2/2 Executing bit – Read only. This bit is set when the STI
file is being scanned and cleared when the scan is completed. The bit
is also cleared on powerup and entry into the Run mode.
Bit S:5/10 Overrun bit – Read/write. This minor error bit is set
whenever the STI timer expires while the STI routine is executing or
disabled while the pending bit is set. When this occurs, the STI timer
continues to operate at the rate present in word S:30.
If the overrun bit becomes set, take the corrective action your
application dictates, then clear the bit.
30–4
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
Enter and monitor STI parameters at the status file displays under
EDT_DAT. Parameters are pointed out in the displays that follow.
Status File
Arithmetic Flags S:0 Z:0 V:0 C:0
S2:0 Proc Status 0000 0000 0000 0000
S2:1 Proc Status 0000 0000 0000 0001
A S2:2 Proc Status 0000 0000 0000 0010
S2:0/0 = 0 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
Status File
B S2:5 Minor Fault 0000 0000 0000 0000
C S2:6 Fault Code 0000H
D Desc: No Error
S2:29 Err File: 0 Indx Cross File: No
S2:24 Index Reg: 0 Single Step: No
S2:5/0 = 0 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
Status File
Selectable Timed Interrupt
E S2:31 Subroutine File: 0
F S2:30 Frequency [x10mS]: 0
G, H, I Enabled: 1 Executing: 0 Pending: 0
S2:31 = 0 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
A – Word S:2. Bits 0, 1, and 2 are the STI pending, enabled, and executing
bits respectively. These bits also appear in the “Selectable Timed Interrupt”
display. See G, H, I.
G – STI enabled bit S:2/1. Also appears in the first status file display.
See A.
H – STI executing bit S:2/2. Also appears in the first status file display.
See A.
I – STI pending bit S:2/0. Also appears in the first status file display. See A.
30–5
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
STD and STE Instructions The STD and STE instructions are used to create zones in which STI
interrupts cannot occur. These instructions are not required to configure a
basic STI interrupt application.
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
STE
SELECTABLE TIMED ENABLE
STD Selectable Timed Disable – This instruction, when true, will reset the
STI enable bit and prevent the STI subroutine from executing. When the
rung goes false, the STI enable bit remains reset until a true STS or STE
instruction is executed. The STI timer continues to operate while the enable
bit is reset.
30–6
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
The STD instruction (rung 6) resets the STI enable bit and the STE
instruction (rung 12) sets the enable bit again. The STI timer increments and
may time out in the STD zone, setting the pending bit S:2/0 and overrun bit
S:5/10.
The first pass bit S:1/15 and the STE instruction in rung 0 are included to
insure that the STI function is initialized following a power cycle. You
should include this rung any time your program contains an STD/STE zone
or an STD instruction.
Program File 2 STE
S:1
0 ] [ SELECTABLE TIMED ENABLE
15
1 ] [ ] [ ( )
5
STD
6 SELECTABLE TIMED DISABLE
7 ] [ ] [ ( )
STI interrupt
execution will 8
not occur
between STD 9
and STE.
10
11 ] [ ] [ ( )
STE
12 SELECTABLE TIMED ENABLE
13 ] [ ] [ ( )
14
15
16
17 END
30–7
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
STS Instruction The STS instruction can be used to condition the start of the STI timer upon
entering the Run mode – rather than starting automatically. It can also be
used to set up or change the file number or setpoint/frequency of the STI
routine that will be executed when the STI timer expires.
EDT_DAT
F1 F2 F3 F4 F5
30–8
Chapter 30
Understanding Selectable Timed
Interrupts - 5/02 Processor Only
INT Instruction The Interrupt Subroutine (INT) instruction is used in selectable timed
interrupt subroutines and I/O event–driven interrupt subroutines to
distinguish the subroutine as an interrupt subroutine versus a regular
subroutine. Use of the instruction is optional.
EDT_DAT
F1 F2 F3 F4 F5
30–9
31
Chapter
A–B
This chapter applies to the SLC 5/02 processor only. It covers the following
topics:
• I/O interrupt operation
• I/O interrupt parameters
• IID and IIE instructions
• RPI instruction
• INT instruction
I/O Overview The I/O event-driven interrupt function can be used with the SLC 5/02
processor only. This function allows a specialty I/O module to interrupt the
normal processor operating cycle in order to scan a specified subroutine file.
Interrupt operation for a specific module is described in the user’s manual for
the module.
31–1
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
Operation When you download your program and enter the Run mode, the I/O interrupt
begins operation as follows:
• The specialty I/O module determines that it needs servicing and generates
an interrupt request to the SLC processor.
• The processor is interrupted from what it is doing, and the specified
interrupt subroutine file (ISR) is scanned.
• When the ISR scan is completed, the specialty I/O module is notified.
This informs the specialty I/O module that it is allowed to generate a new
interrupt.
• The processor resumes normal operation from where it left off.
The ISR will contain the rungs of your application logic. You can program
any instruction inside an ISR except a TND, REF, or SVC instruction. IIM
or IOM instructions are needed in an ISR if your application requires
immediate update of input or output points. Terminate the ISR with an RET
(return) instruction.
JSR stack depth is limited to 3. That is, you may call other subroutines to a
level 3 deep from an ISR.
Interrupt Occurrences
I/O interrupts can occur at any point in your program, but not necessarily at
the same point on successive interrupts. Interrupts can only occur between
instructions in your program, inside the I/O scan (between slots), or between
the servicing of communications packets. ISR execution time adds directly
to the overall scan time.
31–2
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
Interrupt Latency
The interrupt latency (interval between the detection of an interrupt request
from the specialty I/O module and the start of the interrupt subroutine) is 3.7
milliseconds max. for the SLC 5/02 series B processor, and 2.4 milliseconds
max. for the SLC 5/02 series C and later. During the latency period, the
processor is performing operations that cannot be disturbed by the I/O
interrupt function.
Interrupt Priorities
Interrupt priorities are as follows:
1. Fault routine
2. STI subroutine
3. I/O interrupt subroutine (ISR)
An executing interrupt can only be interrupted by an interrupt having higher
priority.
Note: It is important to understand that the I/O Pending bit associated with
the interrupting slot remains clear during the time that the processor is
waiting for the fault routine or STI subroutine to finish.
If the STI timer expires while executing the I/O interrupt subroutine,
execution will immediately switch to the STI subroutine. When the STI
subroutine is scanned to completion, execution will resume at the point that it
left off in the I/O interrupt subroutine.
If two or more I/O interrupt requests are detected by the processor at the
same instant, or while waiting for a higher or equal priority interrupt
subroutine to finish, the interrupt subroutine associated with the specialty I/O
module in the lowest slot number will be scanned first. For example, if slot 2
(ISR 20) and slot 3 (ISR 11) request interrupt service at the same instant, the
processor will first scan ISR 20 to completion, then ISR 11 to completion.
31–3
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
I/O Interrupt Parameters The I/O interrupt parameters below have status file addresses. They are
described here and also in chapter 27.
S:11 and S:12 I/O Slot Enables – Read/Write. These words are bit
mapped to the 30 I/O slots. Bits S:11/1 through S:12/14 refer to slots
1 through 30. Bits S:11/0 and S:12/15 are reserved. The enable bit
associated with an interrupting slot must be set when an interrupt
occurs. Otherwise a major fault will occur. See chapter 27 for more
details. Changes made to these bits using the EDT_DAT function
take effect at the next end of scan.
S:25 and S:26 I/O Interrupt Pending Bits – Read only. These
words are bit mapped to the 30 I/O slots. Bits S:25/1 through
S:26/14 refer to slots 1 through 30. Bits S:25/0 and S:26/15 are
reserved. The pending bit associated with an interrupting slot is set
when the corresponding I/O slot interrupt enable bit is clear at the
time of an interrupt request. It is cleared when the corresponding I/O
event interrupt enable bit is set, or when an associated RPI
instruction is executed. The pending bit for an executing I/O
interrupt subroutine remains clear when the ISR is interrupted by an
STI or fault routine. Likewise, the pending bit remains clear if
interrupt service is requested at the time that a higher or equal
priority interrupt is executing (fault routine, STI, or other ISR).
31–4
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
You can enter and monitor parameters at the status file displays, under
EDT_DAT. Parameters are pointed out in the displays below.
Status File
A S2:11 & S2:12 I/O Slot Enables
1 2 3
0 0 0 0
1111 1111 1111 1111 1111 1111 1111 1111
Slot = 0
S2:11/0 = 1 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
Status File
B S2:27 & S2:28 I/O Interrupt Enables
1 2 3
0 0 0 0
0000 0000 0000 0000 0000 0000 0000 0000
S2:27/0 = 0 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
Status File
C S2:25 & S2:26 I/O Interrupt Pending
1 2 3
0 0 0 0
0000 0000 0000 0000 0000 0000 0000 0000
S2:25/0 = 0 PRG
ADDRESS NEXT FL PREV FL NEXT PG PREV PG
F1 F2 F3 F4 F5
31–5
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
IID and IIE Instructions The IID and IIE instructions are used to create zones in which I/O interrupts
cannot occur. These instructions are not required to configure a basic I/O
interrupt application.
EDT_DAT
F1 F2 F3 F4 F5
EDT_DAT
F1 F2 F3 F4 F5
IIE
I/O INTERRUPT ENABLE
Slots: 2,3
31–6
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
IID I/O Interrupt Disable – When true, this instruction clears the I/O
interrupt enable bits (S:27/1 through S:28/14) corresponding to the slots
parameter of the instruction (slots 1, 2, 7 in the following example).
Interrupt subroutines of the affected slots will not be able to execute when
an interrupt request is made. Instead, the corresponding I/O pending bits
(S:25/1 through S:26/14) will be set. The ISR will not be executed until an
IIE instruction with the same slot parameter is executed, or until the end of
the scan during which you use a programming device to set the
corresponding status file bit.
Use this instruction together with an IIE instruction to create a zone in your
main ladder program file or subroutine file in which I/O interrupts cannot
occur. The IID instruction takes effect immediately upon execution.
Setting/clearing the I/O interrupt enable bits (S:27 and S:28) with a
programming device or standard instruction such as MVM takes effect at
the END of the scan only.
Parameter – Enter a 0 (reset) in a slot position to indicate a disabled I/O
interrupt.
IIE I/O Interrupt Enable – When true, this instruction sets the I/O
interrupt enable bits (S:27/1 through S:28/14) corresponding to the slots
parameter of the instruction (slots 1, 2, 7 in the following example).
Interrupt subroutines of the affected slots will regain the ability to execute
when an interrupt request is made. If an interrupt was pending (S:25/1
through S:26/14) and the pending slot corresponds to the IIE slots
parameter, the ISR associated with that slot will execute immediately.
Use this instruction together with the IID instruction to create a zone in
your main ladder program file or subroutine file in which I/O interrupts
cannot occur. The IIE instruction takes effect immediately upon execution.
Setting/clearing the I/O interrupt enable bits (S:27 and S:28) with a
programming device or standard instruction such as MVM takes effect at
the END of the scan only.
Parameter – Enter a 1 (set) in a slot position to indicate an enabled I/O
interrupt.
31–7
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
The first pass bit S:1/15 and the IIE instruction in rung 0 are Program File 2
included to insure that the I/O interrupt function is initialized S:1 IIE
I/O INTERRUPT ENABLE
following a power cycle. You should include a rung such as this 0 ] [
Slots: 1,2,7
any time your program contains an IID/IIE zone or an IID 15
instruction.
The IID instruction in rung 6 clears the I/O interrupt enable bits 1 ] [ ] [ ( )
associated with slots 1, 2, and 7 (S:27/1, S:27/2, and S:27/7).
The IIE instruction in rung 12 sets these same bits. If an I/O 2
interrupt is detected by the processor while the processor is
executing rungs 7-11, the interrupt will be marked as pending 3
(S:25/1, S:25/2, and/or S:25/7 will be set). All interrupts marked
4
as pending will be serviced upon execution of rung 12 (the
lowest numbered slot is serviced first when multiple pending bits 5
are set). IID
6 I/O INTERRUPT DISABLE
Slots: 1,2,7
HHT Ladder Display:
When the cursor is on the IIE instruction, ISR execution
] [ ] [ ( )
the enabled slots are indicated here by 1s. will not occur 7
between IID 8
and IIE
IIE:0110 0001... 2.0.0.0.2 instructions 9
] [ (IIE)
( )
10
11 ] [ ] [ ( )
RUN IIE
MODE FORCE EDT DAT SEARCH I/O INTERRUPT ENABLE
12
F1 F2 F3 F4 F5 Slots: 1,2,7
16
(IID) 17 END
( )
RUN
MODE FORCE EDT DAT SEARCH
F1 F2 F3 F4 F5
31–8
Chapter 31
Understanding I/O Interrupts -
5/02 Processor Only
RPI Instruction The RPI instruction is used to purge unwanted I/O interrupt requests. This
instruction is not required to configure a basic I/O interrupt application.
EDT_DAT
F1 F2 F3 F4 F5
RPI Reset Pending Interrupt – When true, this instruction clears the I/O
pending bits (S:25/1 through S:26/14) corresponding to the slots parameter
of the instruction. In addition, the processor notifies the specialty I/O
modules in those slots that their interrupt request was aborted. Following
this notice, the slot may once again request interrupt service. This
instruction does not affect the I/O slot interrupt enable bits (S:27/1 through
S:28/14).
RUN
MODE FORCE EDT DAT SEARCH
F1 F2 F3 F4 F5
31–9
Appendix
A
HHT Messages and Error Definitions
This appendix provides details about the messages that appear on the prompt
line of the HHT display. These messages prompt you regarding
programming procedures, restrictions, and limitations. They also bring your
attention to errors such as incorrect procedures, incorrect data entry, failure
of selftest functions, and hardware/software incompatibility.
The messages in this chapter refer specifically to HHT operations. They are
listed in alphabetical order. For a list of SLC 500 family processor error
codes, refer to chapter 27.
A–1
Appendix A
HHT Messages and Error Definitions
ERROR
The length parameter of an instruction is trying to create a
EXPANDING THE Entering a smaller length.
data file larger than 256 elements.
DATA TABLE
ERROR: INVALID Choosing the correct type of instruction or abandoning this
The cursored instruction is not an input or output instruction.
FORCE attempt.
Either editing the program and changing the address to agree
with the configured I/O modules, or re-configuring the I/O to
ERROR:
A mismatch exists between the I/O addresses used in the match the entered address. For the latter, refer to chapter 4
UNDEFINED I/O
ladder program and the configured I/O modules. for more help. Important: You can SAVE the program with
ADDRESS
errors (to correct at a later time), but you cannot download the
program to the processor.
FILE CANNOT BE You are creating a ladder program file where the number
Choosing a different file number.
CREATED entered is illegal or the file already exists.
The entered program or data file number does not exist or is
FILE CANNOT BE incorrect.
Choosing a different file or aborting the procedure.
DELETED Important: Data File numbers 0, 1, and 2 and program files 0
and 1 cannot be deleted.
FILE
A file overwrite has occurred. SQO, SQC, BSL, BSR, FLL, or
OVERWRITE Correcting the file length in the appropriate instruction.
COP instruction operation has crossed file boundaries.
ERROR
You attempt to program multiple HSC instructions. Your ladder
HSC ALREADY
program is allowed to contain only one HSC instruction Remove duplicate HSC instructions.
EXISTS
(processor must be DC type).
A–2
Appendix A
HHT Messages and Error Definitions
ILLEGAL The address entered is not in the correct format. Entering the valid format.
OPERAND The address entered is not a valid data file operand. Entering a valid address.
ILLEGAL OSR An OSR instruction is placed within a branch and is not Inserting the OSR instruction at a permissible location within
LOCATION immediately adjacent to an output instruction. the rung.
The processor does not understand the command received Checking power and communication connections to the HHT
ILLEGAL SIZE
from the HHT due to invalid size of advanced I/O setup. and processor and retry the procedure.
The HHT is attempting to communicate with an invalid
INCOMPATIBLE Aborting the procedure or changing the configuration.
processor type.
PROCESSOR
TYPE The processor that you have configured in your program does Going offline and changing the processor type in the
not match the processor your HHT is communicating with. Processor Configuration.
INCORRECT You have tried to enter an incorrect password or master
Entering a valid password for that processor program file.
PASSWORD password three times for online monitoring of a processor.
INITIALIZING HHT A new memory pak is installed. Uploading a valid ladder program to the HHT.
MEMORY TO The ladder program data stored in the HHT has become
DEFAULT Uploading a valid ladder program to the HHT.
corrupt and it is necessary to replace it with a default program.
INSIDE A You are attempting to begin a branch within an existing branch
Referring to page 5-7 in this manual.
BRANCH for 500 or 5/01.
INVALID The data file address entered does not correspond to a valid
ADDRESS address in this ladder program. Entering a valid address.
You are attempting to create or monitor a data file and the
address entered is not in the correct format, the file type is Entering a valid address or file type.
INVALID DATA invalid, or it already exists as a different type.
FILE
The data file address entered does not correspond to a valid
address in this ladder program. Entering a valid address.
INVALID ERROR The HHT has encountered an unknown error. This should not Cycling power to the HHT. If that does not work contact your
CODE occur in a properly functioning HHT. A-B service representative.
INVALID FILE
This data file type is not allowed in this instruction. Entering a valid data file type.
TYPE
When you are configuring I/O and the HHT is unable to find a
INVALID ID Entering a valid ID number.
slot configuration which matches this ID number.
A–3
Appendix A
HHT Messages and Error Definitions
A–4
Appendix A
HHT Messages and Error Definitions
A–5
Appendix A
HHT Messages and Error Definitions
A–6
Appendix A
HHT Messages and Error Definitions
UNABLE TO EDIT The file number entered does not exist in this program. Entering a valid file number.
FILE The file number entered does not exist in this ladder program. Choosing the correct file number.
UNABLE TO
INSERT Inserting this instruction results in an illegal rung structure. Aborting the procedure.
INSTRUCTION
The file number entered either does not exist in the processor
UNABLE TO Choosing a different file number or downloading the program
ladder program or it is a file type not capable of being
MONITOR FILE with the program file number.
monitored.
UNABLE TO
REPLACE Replacing this instruction results in an illegal rung structure. Aborting the procedure.
INSTRUCTION
The file type returned by the data base is unknown to the
Using only S2, O0, I1, Bx, Rx, Cx, and Nx file types.
UNKNOWN FILE compiler.
TYPE The file type returned by the data base is unknown to the
Using only S2, O0, I1, Bx, Rx, Cx, and Nx file types.
compiler.
UNKNOWN There is an internal compiler error. Contacting your A-B service representative.
OPERATOR There is an internal compiler error. Contacting your A-B service representative.
A–7
Appendix A
HHT Messages and Error Definitions
The address you entered while editing does not match the I/O Either changing the address to agree with the configured I/O
configuration. modules or exiting the edit mode and re-configuring the I/O to
match the entered address.
A–8
Appendix
B
Number Systems, Hex Mask
This appendix:
• describes the different number systems you need to understand for use of
the HHT with SLC 500 family controllers
• covers binary, Binary Coded Decimal (BCD), and hexadecimal.
• explains the use of a Hex mask used to filter data in certain programming
instructions
Binary Numbers The processor memory stores 16-bit binary numbers. As indicated in the
figure below, each position in the number has a decimal value, beginning at
the right with 20 and ending at the left with 215.
B–1
Appendix B
Number Systems, Hex Mask
Other examples:
16 bit pattern = 0000 1001 0000 11102
= 211 + 28 + 23 + 22 + 21
= 2048 + 256 + 8 + 4 + 2
= 2318
16 bit pattern = 0010 0011 0010 10002
= 213 + 29 + 28 + 25 + 23
= 8192 + 512 + 256 + 32 + 8
= 9000
B–2
Appendix B
Number Systems, Hex Mask
Another example:
16–bit pattern = 1111 1000 0010 00112
= ( 214 + 213 + 212 + 211 + 25 + 21 + 20 ) – 215
= ( 16384 + 8192 + 4096 + 2048 + 32 + 2 + 1 ) – 32768
= 30755 – 32768
= –2013
An easier way to calculate a negative value is to locate the last “1” in the
string of 1s beginning at the left, then subtract its value from the total value
of positions to the right of that position.
For example:
16–bit pattern = 1111 1111 0001 10102
= ( 24 + 2 3 + 21 ) – 2 8
= ( 16 + 8 + 2 ) – 256
= –230
BCD Numbers Binary Coded Decimal numbers use a 4–bit binary code to represent decimal
values ranging from 0 to 9 as shown below:
BCD Binary
Value Value
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Thumbwheels and LED displays are two types of I/O devices that use BCD
numbers.
B–3
Appendix B
Number Systems, Hex Mask
Example: BCD bit pattern 01112, for one digit, has a decimal equivalent
value of 7:
0x23 = 0 0
1x22 = 4 4
1x21 = 2 2
1x20 = 1 + 1
7
0 1 1 1
To form multiple digit numbers, BCD uses a 16–bit pattern similar to binary.
This allows up to 4 digits, using the above 4–bit binary code. BCD numbers
have a range of 0 to 32,767 in the SLC 500 family processors.
The following figure shows the BCD representation for the decimal number
9862:
Thousands Hundreds Tens Ones
1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 Binary Pattern
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 Position Values
9 8 6 2 Decimal value
HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
B–4
Appendix B
Number Systems, Hex Mask
Hexadecimal 2 1 8 A = 8586
Binary 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 0 = 8586
8192 256 128 10
1x213 1x28 1x27 1x23+1x21
Binary 1 1 0 1 1 1 1 0 0 1 1 1 0 1 1 0 = -8586
Hexadecimal D E 7 6 = 56950
(negative number, -8586)
Hex Mask This is a 4-character code, entered as a parameter in SQO, SQC, and other
instructions to exclude selected bits of a word from being operated on by the
instruction. The hex values are used in their binary equivalent form, as
indicated in the figure below. The figure also shows an example of a hex
code and the corresponding mask word.
Hex Binary
Value Value
0 0000 Hex Code
1 0001
2 0010 0 0 F F
3 0011
4 0100
5 0101
6 0110
7 0111 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
8 1000
9 1001 Mask Word
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
B–5
Appendix B
Number Systems, Hex Mask
Bits of the mask word that are set (1) pass data from a source to a
destination. Reset bits (0) do not. In the example below, data in bits 0–7 of
the source word is passed to the destination word. Data in bits 8–15 of the
source word is not passed to the destination word. Destination bits 8–15 are
not affected (they are left in their last state).
Source Word 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0
Mask Word 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
Destination Word 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0
(all bits 0 initially)
B–6
C
Appendix
A–B
Memory Usage SLC 500 controllers have the following user memory capacities:
C–1
Appendix C
Memory Usage,
Instruction Execution Times
Fixed and SLC 5/01 Instruction Words for the Fixed and SLC 5/01 Processors
Processors
Instruction Instruction
Instruction Words Instruction Words
(approx) (approx)
ADD 1.5 MCR 0.5
AND 1.5 MEQ 1.5
MOV 1.5
BSL 2
MUL 1.5
BSR 2
MVM 1.5
CLR 1
NEG 1.5
COP 1.5
NEQ 1.5
CTD 1
NOT 1
CTU 1
OR 1.5
DCD 1.5
OSR 1
DDV 1
OTE 0.75
DIV 1.5
OTL 0.75
EQU 1.5 OTU 0.75
FLL 1.5 RES 1
FRD 1 RET 0.5
GEQ 1.5 RTO 1
GRT 1.5 SBR 0.5
HSC 1 SQC 2
SQO 2
IIM 1.5 SUB 1.5
IOM 1.5 SUS 1.5
JMP 1 TND 0.5
JSR 1 TOD 1
LBL 0.5 TOF 1
LEQ 1.5 TON 1
LES 1.5 XIC 1
XIO 1
XOR 1.5
C–2
Appendix C
Memory Usage,
Instruction Execution Times
6. Multiply the total number of I/O data words by .75 and enter the
result.
7. Multiply the total number of I/O slots, used or unused, by .75 and
enter the result.
8. To account for processor overhead, enter 65 if you are using a fixed
controller; enter 67 if you are using a 1747–L511 or 1747–L514.
Total: 9. Total steps 1 through 8. This is the estimated total memory usage of
your application system. Remember, this is an estimate, actual
compiled programs may differ by ±12%.
10. If you wish to determine the estimated amount of memory remaining
in the processor you have selected, do the following:
If you are using a fixed controller or 1747–L511, subtract the total
from 1024. If you are using a 1747–L514, subtract the total from
4096.
The result of this calculation will be the estimated total memory
remaining in your selected processor.
C–3
Appendix C
Memory Usage,
Instruction Execution Times
C–4
Appendix C
Memory Usage,
Instruction Execution Times
Instruction Execution Times for the Fixed and SLC 5/01 Processors
C–5
Appendix C
Memory Usage,
Instruction Execution Times
SLC 5/02 Processor The number of instruction words used by an instruction is indicated in the
following table. Since the program is compiled by the programmer, it is only
possible to establish estimates for the instruction words used by individual
instructions. The calculated memory usage will normally be greater than the
actual memory usage, due to compiler optimization.
C–6
Appendix C
Memory Usage,
Instruction Execution Times
2. Multiply the total number of rungs by .375 and enter the result.
3. If you are using a 1747–L524 and have enabled the Single Step
Test mode, multiply the total number of rungs by .375 and enter
the result.
4. Multiply the total number of data words (excluding the
status file and I/O data words) by .25 and enter the result.
5. Add 1 word for each data table file used and enter the result.
C–7
Appendix C
Memory Usage,
Instruction Execution Times
C–8
Appendix C
Memory Usage,
Instruction Execution Times
Dest N7:10
Example
COP
COPY FILE
Source #B3:0
Dest #M0:1.0
Length 34
For the multi–word instruction above, add 1583 microseconds plus 667
microseconds per word. In this example, 34 words are copied from #B3:0 to
M0:1.0. Add 1583 + (667 x 34) = 24261 microseconds to the execution time
listed on page C–8. This comes to 763 (calculated from page C–8 table) plus
24261 = 25024 microseconds total, or 25.0 milliseconds.
C–9
Appendix C
Memory Usage,
Instruction Execution Times
C–10
Appendix C
Memory Usage,
Instruction Execution Times
C–11
Appendix C
Memory Usage,
Instruction Execution Times
Dest N7:10
Example
COP
COPY FILE
Source #B3:0
Dest #M0:1.0
Length 34
For the multi–word instruction above, add 950 microseconds plus 400
microseconds per word. In this example, 34 words are copied from #B:3.0 to
M0:1.0. Add 950 + (400 x 34) = 14550 microseconds to the execution time
listed on page C–10. This comes to 471 (calculated from page C–10 table)
plus 14550 = 15021 microseconds total, or 15.0 milliseconds.
C–12
D
Appendix
A–B
This appendix:
• contains worksheets that allow you to estimate the scan time for your
particular controller configuration and program
• includes scan time calculation for an example controller and program
Use the instruction execution times listed in appendix C.
Events in the Operating Cycle The diagram and table below breaks down the processor operating cycle into
events. Directions for calculating the scan time of these events appear in the
worksheets.
Input Scan
Program Scan
Output Scan
Communication
Processor Overhead
Event Description
The status of input modules is read and the input image in
Input Scan
the processor is updated with this information.
The ladder program is executed. The input image table is
evaluated, ladder rungs are solved, and the output image is
Program Scan
updated. The information is not yet transferred to the
output modules.
The output image information is transferred to the output
Output Scan
modules.
Communication with programmers and other network
Communications
devices takes place.
Processor internal housekeeping takes place. Actions
Processor Overhead include performing program pre-scan and updating the
internal timebase and the Status file.
D–1
Appendix D
Estimating Scan Time
Scan Time Worksheets Worksheets A, B, and C on the following pages are for use with SLC 500
systems as follows:
• Worksheet A – Fixed controllers
• Worksheet B – 1747-L511 or 1747-L514 processor
• Worksheet C – 1747-L524 processor
These worksheets are intended to assist you in estimating scan time for your
application. Refer to appendix C for instruction execution times. Refer to
the SLC 500 System Overview, publication 1747–2.30, for I/O module part
numbers and sizes.
Single Step – When using this function with a 5/02 processor, you can
execute your program one rung or section at a time. This function is used for
debugging purposes.
D–2
Appendix D
Estimating Scan Time
D–3
Appendix D
Estimating Scan Time
5. Add processor overhead time (178 for min scan time; 278 for max. scan time) to the subtotals estimated in + 178 + 278
step 4. Use these new subtotals to calculate communications overhead in step 6. __________subtotal _________ subtotal
6. Estimate your communication overhead: x 1.000 x 1.140
A. Calculate the background communication overhead: multiply the subtotal for minimum scan time (estimated in __________ µsecs. _________ µsecs.
step 5) by 1; multiply the subtotal for maximum scan time by 1.140 (max. value accounts for active DH-485 link). + 0 + 2310
B. Calculate the foreground communication overhead: for minimum scan time add 0; for maximum scan time
add 2310. (Maximum scan time accounts for programmer being attached to processor.)
__________ µsecs. _________ µsecs.
/ 1000 / 1000
C. Convert µsecs. to msecs., divide by 1000.
Estimated minimum and maximum scan times for your 1747-L511 or 1747-L514 application: msecs. msecs.
D–4
Appendix D
Estimating Scan Time
F. Calculate the Forced Output Overhead = (No. of output modules x 104) + 140 per additional word for multi-word modules _________
3. Estimate your program scan time. This estimate assumes operation of all instructions once per operating scan.
A. Count the number of rungs in your APS program. Place value on line (a). __________ _________
B. Multiply value on line (a) by 6. (If you saved your program with Single-Step Enabled, then multiply the value on line (a) __________ _________
by 66.) a.)________ x 6 =
__________ subtotal _________ subtotal
C. Calculate your program execution time when all instructions are true. (See appendix A to do this.)
4. Add the values in the minimum and maximum scan time columns.
5. Add processor overhead time (180 for min. scan time; 280 for max. scan time) to the subtotals estimated in step 4. + 180 + 280
Use these new subtotals to calculate communication overhead in step 6. ________subtotal _________ subtotal
6. Estimate your communication overhead: x 1.040 x 1.140
A. Calculate the background communication overhead: multiply the subtotal for minimum scan time (estimated in _________ µsecs. _________ µsecs.
step 5) by 1.040; multiply the subtotal for maximum scan time by 1.140 (max. value accounts for active DH-485 link). + 2286
+ 0
B. Calculate the foreground communications overhead: for minimum scan time add 0; for maximum scan time
add 2286. (Maximum scan time accounts for programmer being attached to processor.) __________ µsecs. _________ µsecs.
/ 1000 / 1000
C. Convert µsecs. to msecs., divide by 1000.
Estimated minimum and maximum scan times for your 1747-L524 series C application: msecs. msecs.
7. Estimate the scan time for your 1747-L524 series B application; multiply the values for series C application by 0.60. x 0.60 x 0.60
Estimated minimum and maximum scan times for your 1747-L524 series B application: msecs. msecs.
D–5
Appendix D
Estimating Scan Time
Example Scan Time Suppose you have a system consisting of the following components:
Calculation
System Configuration
Description
Catalog Number Quantity
1747-L514 1 4K Processor
1746-IA8 2 8 point 120VAC Input Module
1746-IB16 1 16 point 24VDC Sinking Input Module
1746-OA16 3 16 point 120VAC Relay Output Module
1746-OB8 1 16 point 24VDC Sourcing Output Module
1746-NIO4V 1 4 Channel Analog Combination Module
Since you are using the 1747-L514 processor, worksheet B must be filled
out. This is shown on page D–7.
The ladder program below is used in this application. The execution times
for the instructions (true state) are from appendix C. The total execution
time, 465 microseconds, is entered in the worksheet on page D–7.
The worksheet indicates that the total estimated scan time is 3.85
milliseconds minimum and 8.9 milliseconds maximum.
Execution Times:
B3 B3 B3 T4:0 O:1.0
] [ ]/[ ] [ ]/[ ( ) 38 microseconds
0 1 45 DN 0
B3
] [
9
T4:0 TON
]/[ TIMER ON DELAY (EN) 139 microseconds
DN Timer T4:0
Time Base 0.01 (DN)
Preset 6000
Accum
MOV
MOVE
Source S:13
Dest O:1.0
END
D–6
Appendix D
Estimating Scan Time
D–7
Index
Symbols B
#, addressing user-created files with, 4-16 battery
installing, 1-3
specifications, 1-1
Numbers BCD
1-rung ladder program, 5-2 convert from (FRD), 15-5, 20-15
convert to (TOD), 15-5, 20-12
1747-AIC, link coupler, 1-6
ladder logic filtering of, 20-16
1747-BA mnemonic for converting from, 2-14
battery installation, 1-5 number systems, B-3
memory retention, 1-1
bit data file display, 12-8
1747-C10, communication cable, 1-6
bit instructions, 15-1, 16-1
1747-NP1, -NP2, remote programming examine if closed (XIC), 15-1, 16-2
with, 1-1 examine if open (XIO), 15-1, 16-3
1747-PTA1E, memory pak installation, one-shot rising (OSR), 15-1, 16-7
1-3 output energize (OTE), 15-1, 16-4
4-rung ladder program, 5-8 output latch (OTL), 15-1, 16-5
output unlatch (OTU), 15-1, 16-5
5/01 processor
instruction words, C-2 bit shift left (BSL)
status file displays, 27-33 bit shift instruction, 15-7, 23-2
mnemonic listing, 2-14
5/02 processor
controller memory usage, C-1 bit shift right (BSR)
instruction words, C-6 bit shift instruction, 15-7, 23-2
status file, 27-1 mnemonic listing, 2-14
status file displays, 27-32 bit shift, FIFO, and LIFO instructions,
understanding I/O interrupts, 31-1 15-7, 23-1
understanding selectable timed bit shift left (BSL), 15-7, 23-2
interrupts, 30-1 bit shift right (BSR), 15-7, 23-2
understanding the user fault routine, FIFO load (FFL), 15-7, 23-5
29-1 FIFO unload (FFU), 15-7, 23-5
LIFO load (LFL), 15-7, 23-8
LIFO unload (LFU), 15-7, 23-8
A
abandoning edits, 7-34
C
add (ADD)
math instruction, 15-5, 20-3 cable, communication, installing, 1-3
mnemonic listing, 2-14 changing an instruction type, 7-18
series C or later 5/02 processor, 20-5 changing modes, 11-2
adding a rung, 7-9 changing online data, 12-9
adding an instruction to a rung, 7-14 counter preset and accumulator values,
Allen-Bradley, P-5 12-9
contacting for assistance, P-5 monitor counter operation, 12-9
reset a counter, 12-9
and (AND)
mnemonic listing, 2-14 changing the address of an instruction,
move and logical instructions, 15-6, 7-16
21-5 clear (CLR)
appending a branch, 7-24 math instruction, 15-5, 20-11
mnemonic listing, 2-14
auto shift, 1-9
I–2 Index
clearing the memory of the HHT, 6-1 COP, file copy and file fill instruction, 22-2
communication cable, installing, 1-3 copying an instruction, 7-30
comparison instructions, 15-4, 19-1 count down (CTD)
equal (EQU), 15-4, 19-2 mnemonic listing, 2-14
greater than (GRT), 15-4, 19-6 timer and counter instructions, 15-2,
greater than or equal (GEQ), 15-4, 17-7
19-7 count up (CTU)
less than (LES), 15-4, 19-4 mnemonic listing, 2-14
less than or equal (LEQ), 15-4, 19-5 timer and counter instructions, 15-2,
limit test (LIM), 15-4, 19-9 17-7
masked comparison for equal (MEQ),
15-4, 19-8 counter data file display, 12-8
not equal (NEQ), 15-4, 19-3 creating a program file with the HHT, 6-9
configure your HHT for online creating and deleting program files, 7-1
communication, 9-1 naming your program file, 6-9
exceptions, 9-3 creating a program with the HHT, 6-1
configuring the controller, 6-2 clearing the HHT memory, 6-1
configuring the I/O, 6-3 configuring the controller, 6-2
configuring the processor, 6-2 naming the ladder program, 6-8
configuring the specialty I/O modules, creating a subroutine program file using a
6-5 non-consecutive file number, 7-2
contacting Allen-Bradley for assistance, creating a subroutine program file using the
P-5 next consecutive file number, 7-1
contents of this manual, P-2 creating and deleting programs, 7-1
control data file display, 12-9 creating a subroutine program file using a
non-consecutive file number, 7-2
control instructions, 15-8, 25-1 creating a subroutine program file using
interrupt subroutine (INT), 15-8, 25-11 the next consecutive file number,
jump to label (JMP), 15-8, 25-2 7-1
jump to subroutine (JSR), 15-8, 25-4 deleting a subroutine program file, 7-3
label (LBL), 15-8, 25-3
creating data, 4-19
master control reset (MCR), 15-8,
for indexed addresses, 4-19
25-7
offline, 4-19
return from subroutine (RET), 15-8,
25-6 cursor keys, 1-10
selectable timed interrupt (STI), 15-8,
25-10
subroutine (SBR), 15-8, 25-6 D
suspend (SUS), 15-8, 25-9
data entry keys, 1-9
temporary end (TND), 15-8, 25-8
data file 2 - status, 4-3
controller memory usage, C-1
5/02 processor, C-1 data file 3 - bit, 4-8
fixed and 5/01 processors, C-1 data file 4 - timers, 4-9
convert from BCD (FRD) data file 5 - counters, 4-10
5/02 processor example, 20-17 data file 6 - control, 4-11
fixed, 5/01, and 5/02 processor example,
20-17 data file 7 - integer, 4-12
math instruction, 15-5, 20-15 data file displays
mnemonic listing, 2-14 bit files, 12-8
convert to BCD (TOD) control files, 12-9
5/02 processor example, 20-13 counter files, 12-8
fixed, 5/01, and 5/02 processor example, examples of, 12-5
20-14 input files, 12-5
math instruction, 15-5, 20-12 integer files, 12-9
mnemonic listing, 2-15 output files, 12-5
Index I–3
World Headquarters, AllenBradley, 1201 South Second Street, Milwaukee, WI 53204 USA, Tel: (1) 414 3822000 Fax: (1) 414 3824444