personal injury or death, property damage, or economic loss.
IMPORTANT
for Personal Protective Equipment (PPE).
Important User Information
Read this document and the documents listed in the additional resources section about installation, configuration, and
operation of this equipment before you install, configure, operate, or maintain this product. Users are required to familiarize
themselves with installation and wiring instructions in addition to requirements of all applicable codes, laws, and standards.
Activities including installation, adjustments, putting into service, use, assembly, disassembly, and maintenance are required to
be carried out by suitably trained personnel in accordance with applicable code of practice.
If this equipment is used in a manner not specified by the manufacturer, the protection provided by the equipment may be
impaired.
In no event will Rockwell Automation, Inc. be responsible or liable for indirect or consequential damages resulting from the use
or application of this equipment.
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, Rockwell Automation, Inc. cannot assume responsibility or liability for
actual use based on the examples and diagrams.
No patent liability is assumed by Rockwell Automation, Inc. with respect to use of information, circuits, equipment, or software
described in this manual.
Reproduction of the contents of this manual, in whole or in part, without written permission of Rockwell Automation, Inc., is
prohibited.
Throughout this manual, when necessary, we use notes to make you aware of safety considerations.
WARNING: Identifies information about practices or circumstances that can cause an explosion in a hazardous environment, which may lead to
ATTENTION: Identifies information about practices or circumstances that can lead to personal injury or death, property damage, or economic loss.
Attentions help you identify a hazard, avoid a hazard, and recognize the consequence.
Identifies information that is critical for successful application and understanding of the product.
Labels may also be on or inside the equipment to provide specific precautions.
SHOCK HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that dangerous voltage may be present.
BURN HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that surfaces may reach dangerous
temperatures.
ARC FLASH HAZARD: Labels may be on or inside the equipment, for example, a motor control center, to alert people to potential Arc Flash. Arc Flash
will cause severe injury or death. Wear proper Personal Protective Equipment (PPE). Follow ALL Regulatory requirements for safe work practices and
2 Publication 1756-RM003V-EN-P - November 2020
Topic Name
Reason
Added FBD Function element.
Added FBD Function element.
on page 478
and ULINT data types.
Added FBD Function element.
Added FBD Function element.
Equal To (EQU)on page 270
Updated the String Compare Flow Chart.
and ULINT data types.
and ULINT data types.
Summary of changes
This manual includes new and updated information. Use these reference
tables to locate changed information.
Global changes
The Legal noticeshave been updated.
New or enhanced features
This table contains a list of topics changed in this version, the reason for the
change, and a link to the topic that contains the changed information.
Arc Cosine (ACS)on page 705Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Added FBD Function element.
Bitwise And (AND) on page 413Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Added FBD Function element.
Arc Sine (ASN, ASIN) on page 711Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Arc Tangent (ATN, ATAN) on page 717Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Compare (CMP)on page 266Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Added support for logical operators &&, ||, ^^, and !.
Added support for IsINF and IsNAN.
Copy File (COP), Synchronous Copy File (CPS)
Cosine (COS) on page 723Added support for LINT, LREAL, USINT, UINT, UDINT
Compute (CPT)on page 356Removed condition statement for non-LREAL
Degrees (DEG) on page 773Added support for LINT, LREAL, USINT, UINT, UDINT
File Arithmetic and Logic (FAL) on page 488Added support for LINT, LREAL, USINT, UINT, UDINT
Convert to Integer (FRD) on page 769Added support for LINT, LREAL, USINT, UINT, UDINT
Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
operands converting to LREAL.
and ULINT data types.
Publication 1756-RM003V-EN-P - November 2020 3
Summary of changes
Topic Name
Reason
Is Infinity (IsINF)on page 294
New instruction.
Is Not a Number (IsNAN) on page 296
New instruction.
Less Than or Equal To (LEQ)on page 306
Updated the String Compare Flow Chart.
Less Than (LES) on page 298
Updated the String Compare Flow Chart.
Added FBD Function element.
Not Equal To (NEQ)on page 333
Updated the String Compare Flow Chart.
Added FBD Function element.
Added FBD Function element.
Added FBD Function element.
and ULINT data types.
Added FBD Function element.
Added support for IsINF and IsNAN.
File Search and Compare (FSC) on page 513Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Added support for logical operators &&, ||, ^^, and !.
Added support for IsINF and IsNAN.
Greater Than or Equal To (GEQ) on page 286Updated the String Compare Flow Chart.
Greater Than (GRT) on page 278Updated the String Compare Flow Chart.
Natural Log (LN) on page 749Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Bitwise Not (NOT) on page 425Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Bitwise Inclusive Or (OR) on page 432Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Added FBD Function element.
Radian (RAD) on page 779Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Added FBD Function element.
Sine (SIN) on page 729Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Tangent (TAN) on page 735Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Convert to BCD (TOD)on page 764Added support for LINT, LREAL, USINT, UINT, UDINT
Truncate (TRN) on page 785Added support for LINT, LREAL, USINT, UINT, UDINT
and ULINT data types.
Valid operators on page 341Added support for logical operators &&, ||, ^^, and !.
Determine Controller Memory Information on
page 182
Added a note to indicate that this section is not
applicable to CompactLogix 5380, CompactLogix
5480, ControlLogix 5580, Compact GuardLogix 5380,
and GuardLogix 5580 controllers.
4 Publication 1756-RM003V-EN-P - November 2020
Logix5000 Controllers General
Logix5000 Controllers Advanced Process
Logix5000 Controllers Motion Instructions
Add (ADD)
Attach to Equipment Phase (PATT)
Motion Apply Axis Tuning (MAAT)
Analog Alarm (ALMA)
Attach to Equipment Sequence (SATT)
Motion Apply Hookup Diagnostics (MAHD)
Arc Tangent (ATN, ATAN)
Derivative (DERV)
Motion Axis Fault Reset (MAFR)
ASCII Clear Buffer (ACL)
Detach from Equipment Sequence (SDET)
Motion Axis Home (MAH)
ASCII Handshake Lines (AHL)
Discrete 3-State Device (D3SD)
Motion Axis Jog (MAJ)
ASCII Read Line (ARL)
Enhanced PID (PIDE)
Motion Axis Position Cam (MAPC)
ASCII Test for Buffer Line (ABL)
Enhanced Select (ESEL)
Motion Axis Stop (MAS)
ASCII Write (AWT)
Equipment Phase Clear Failure (PCLF)
Motion Axis Time Cam (MATC)
ASCII Write Append (AWA)
Equipment Phase Command (PCMD)
Motion Axis Shutdown (MASD)
Bit Field Distribute (BTD)
Equipment Phase External Request (PXRQ)
Motion Axis Shutdown Reset (MASR)
Bit Field Distribute with Target (BTDT)
Equipment Phase Failure (PFL)
Motion Calculate Cam Profile (MCCP)
(POVR)
(MCTO)
Identifier (SASI)
Orientation (MCTPO)
Boolean AND (BAND)
Equipment Sequence command (SCMD)
Motion Change Dynamics (MCD)
Clear (CLR)
Integrator (INTG)
Motion Coordinated Stop (MCS)
Compare (CMP)
Internal Model Control (IMC)
Motion Coordinated Transform (MCT)
Convert to BCD (TOD)
JK Flip-Flop (JKFF)
Motion Direct Drive Off (MDF)
Convert to Integer (FRD)
Lead-Lag (LDLG)
Motion Direct Drive On (MDO)
Cosine (COS)
Maximum Capture (MAXC)
Motion Disarm Output Cam (MDOC)
Count down (CTD)
Modular Multivariable Control (MMC)
Motion Disarm Watch (MDW)
Instruction Locator
Use this locator to find the applicable Logix5000 controllers instruction
manual for each instruction.
Instructions Reference Manual 1756RM003
Control and Drives and Equipment Phase
and Sequence Instructions Reference
Manual 1756-RM006
Reference Manual MOTION-RM002
Absolute Value (ABS) Alarm (ALM) Master Driven Coordinated Control (MDCC)
Always False (AFI) Coordinated Control (CC) Motion Arm Output Cam (MAOC)
Arc Cosine (ACS, ACOS) D Flip-Flop (DFF) Motion Arm Registration (MAR)
Arc Sine (ASN, ASIN) Deadtime (DEDT) Motion Arm Watch (MAW)
ASCII Chars in Buffer (ACB) Detach from Equipment Phase (PDET) Motion Axis Gear (MAG)
Structured Text Attributes ...................................................................... 940
16 Publication 1756-RM003V-EN-P - November 2020
Studio 5000 environment
Preface
This manual provides a programmer with details about the available General,
Motion, Process, and Drives instruction set for a Logix-based controller.
If you design, program, or troubleshoot safety applications that use
GuardLogix controllers, refer to the
Instruction Set Safety Reference Manual, publication 1756-RM095.
This manual is one of a set of related manuals that show common procedures
for programming and operating Logix 5000 controllers.
GuardLogix Safety Application
For a complete list of common procedures manuals, refer to the
Logix 5000
Controllers Common Procedures Programming Manual, publication 1756PM001.
The term Logix 5000 controller refers to any controller based on the Logix
5000 operating system.
The Studio 5000 Automation Engineering & Design Environment® combines
engineering and design elements into a common environment. The first
element is the Studio 5000 Logix Designer® application. The Logix Designer
application is the rebranding of RSLogix 5000® software and will continue to
be the product to program Logix 5000™ controllers for discrete, process,
batch, motion, safety, and drive-based solutions.
Publication 1756-RM003V-EN-P - November 2020 17
The Studio 5000® environment is the foundation for the future of
Rockwell Automation® engineering design tools and capabilities. The Studio
5000 environment is the one place for design engineers to develop all
elements of their control system.
Preface
Resource
Description
http://ab.rockwellautomation.com
and other certification details.
Additional resources
Legal Notices
These documents contain additional information concerning related
Rockwell Automation products.
Industrial Automation Wiring and Grounding
Guidelines, publication 1770-4.1
Product Certifications webpage, available at
Provides general guidelines for installing a Rockwell
Automation industrial system.
Provides declarations of conformity, certificates,
View or download publications at
http://www.rockwellautomation.com/literature
. To order paper copies of
technical documentation, contact the local Rockwell Automation distributor
or sales representative.
Rockwell Automation publishes legal notices, such as privacy policies, license
agreements, trademark disclosures, and other terms and conditions on the
Legal Notices
page of the Rockwell Automation website.
End User License Agreement (EULA)
You can view the Rockwell Automation End-User License Agreement ("EULA")
by opening the License.rtf file located in your product's install folder on your
hard drive.
18 Publication 1756-RM003V-EN-P - November 2020
Open Source Licenses
The software included in this product contains copyrighted software that is
licensed under one or more open source licenses. Copies of those licenses are
included with the software. Corresponding Source code for open source
packages included in this product are located at their respective web site(s).
Alternately, obtain complete Corresponding Source code by contacting
Rockwell Automation via the Contact form on the Rockwell Automation
website:
us/contact/contact.page
Please include "Open Source" as part of the request text.
A full list of all open source software used in this product and their
corresponding licenses can be found in the OPENSOURCE folder. The default
http://www.rockwellautomation.com/global/about-
Preface
installed location of these licenses is C:\Program Files (x86)\Common
Use the alarm instructions to monitor and control alarm conditions.
The Logix-based alarm instructions instructions integrate alarming between
the RSView® SE applications and Logix 5000™ controllers.
Available Instructions
Ladder Diagram
ALMDALMAASO
Function Block
ALMDALMA
Structured Text
ALMDALMAASO
Providing alarming for any discrete Boolean value
for a ladder diagram, function block, or structured
Providing level and rate-of-change alarming for
any analog signal for ladder diagram, function
block, diagram and structured text,
Issuing a specified operation to all alarm
Digital Alarm (ALMD)
instruction.
Analog Alarm (ALMA)
instruction.
Alarm Set Operation (ASO)
Publication 1756-RM003V-EN-P - November 2020 21
See also
Array (File)/Misc Instructions on page 477
ASCII Conversion Instructions on page 853
Chapter 1 Alarm Instructions
Analog Alarm (ALMA)
This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers. Controller differences are noted where applicable.
The ALMA instruction provides level and rate-of-change alarming for any
analog signal.
Ladder Diagram
22 Publication 1756-RM003V-EN-P - November 2020
Operand
Type
Format
Description
ALMA
ALARM_ANALOG
Structure
ALMA structure
SINT
Function Block
Chapter 1 Alarm Instructions
Structured Text
ALMA (ALMA,In,ProgAckAll,ProgDisable,ProgEnable)
Operands
Ladder Diagram
In REAL
DINT
INT
ProgAckAll BOOL Tag
ProgDisable BOOL Tag
ProgEnable BOOL Tag
Tag
Immediate
Immediate
Immediate
Immediate
The alarm input value, which is
compared with alarm limits to
detect the alarm condition.
On transition from False to True,
acknowledges all alarm
conditions that require
acknowledgement.
When True, disables alarm (does
not override Enable Commands).
When True, enables alarm (takes
precedence over Disable
commands).
Publication 1756-RM003V-EN-P - November 2020 23
Chapter 1 Alarm Instructions
Operand
Type
Format
Description
Operand
Type
Format
Description
SINT
require acknowledgement.
Immediate
override Enable Commands).
Input Parameter
Data Type
Description
Default is set.
Copied from instruction operand.
Function Block
ALMA tag ALARM_ANALOG structure ALMA structure
Structured Text
ALMA ALARM_ANALOG Structure ALMA structure
In REAL
DINT
INT
Tag
Immediate
The alarm input value, which is
compared with alarm limits to detect
the alarm condition.
ProgAckAll BOOL Tag
Immediate
ProgDisable BOOL Tag
ProgEnable BOOL Tag
Immediate
On transition from False to True,
acknowledges all alarm conditions that
When True, disables alarm (does not
When True, enables alarm (takes
precedence over Disable commands).
See Structured Text Syntax for more information on the syntax of expressions
within the structured text.
ALMA Structure
Input Parameters
EnableIn BOOL Ladder Diagram:
Corresponds to the rung state. If false, the instruction does not execute
and outputs are not updated.
Structured Text:
If false, the instruction does not execute and outputs are not updated.
Default is set.
Function Block:
If false, the instruction does not execute and outputs are not updated.
24 Publication 1756-RM003V-EN-P - November 2020
In REAL The alarm input value, which is compared with alarm limits to detect the
InFault BOOL Bad health indicator for the input. The user application may set InFault to
indicate the input signal has an error. When set, the instruction sets
InFaulted (Status.1). When cleared to false, the instruction clears InFaulted
to false (Status.1). In either case, the instruction continues to evaluate In
for alarm conditions.
HHEnabled BOOL High High alarm condition detection. Set to true to enable detection of the
High High alarm condition. Clear to false to make detection unavailable for
the High High alarm condition.
Default is set.
HEnabled BOOL High alarm condition detection. Set to true to enable detection of the High
alarm condition. Clear to false to make detection unavailable for the High
alarm condition.
LEnabled BOOL Low alarm condition detection. Set to true to enable detection of the Low
alarm condition. Clear to false to make detection unavailable for the Low
alarm condition.
LLEnabled BOOL Low Low alarm condition detection. Set to true to enable detection of the
Low Low alarm condition. Clear to false to make detection unavailable for
the Low Low alarm condition.
AckRequired BOOL Specifies whether alarm acknowledgment is required. When set to true,
acknowledgment is required. When cleared to false, acknowledgment is
not required and HHAcked, HAcked, LAcked, LLAcked, ROCPosAcked, and
ROCNegAcked are always set to true
Default is true.
ProgAckAll BOOL Set to true by the user program to acknowledge all alarm conditions.
Takes effect only if any alarm condition is unacknowledged. Requires a
false-to-true transition.
Default is false.
Ladder Diagram:
Copied from the instruction operand.
Structured Text:
OperAckAll BOOL Set to true by the operator interface to acknowledge all alarm conditions.
Takes effect only if any alarm condition is unacknowledged. The alarm
instruction clears this parameter to false.
HHProgAck BOOL High High program acknowledge. Set to true by the user program to
acknowledge a High High condition. Takes effect only if the alarm
condition is unacknowledged. Requires a false -to-true transition.
Default is false.
HHOperAck BOOL High High operator acknowledge. Set to true by the operator interface to
acknowledge a High High condition. Takes effect only if the alarm
condition is unacknowledged. The alarm instruction clears this parameter
to false.
Publication 1756-RM003V-EN-P - November 2020 25
Chapter 1 Alarm Instructions
Input Parameter
Data Type
Description
Default is false.
Default is false.
Default is false.
Default is false.
Default is false.
Default is false.
Default is false.
Default is cleared.
Default is false.
HProgAck BOOL High program acknowledge. Set to true by the user program to
acknowledge a High condition. Takes effect only if the alarm condition is
unacknowledged. Requires a false-to-true transition.
HOperAck BOOL High operator acknowledge. Set to true by the operator interface to
acknowledge a High condition. Takes effect only if the alarm condition is
unacknowledged. The alarm instruction clears this parameter to false.
LProgAck BOOL Low program acknowledge. Set to true by the user program to
acknowledge a Low condition. Takes effect only if the alarm condition is
unacknowledged. Requires a false-to-true transition.
Default is false.
LOperAck BOOL Low operator acknowledge. Set to true by the operator interface to
acknowledge a Low condition. Takes effect only if the alarm condition is
unacknowledged. The alarm instruction clears this parameter to false.
LLProgAck BOOL Low Low program acknowledge. Set to true by the user program to
acknowledge a Low Low condition. Takes effect only if the alarm
condition is unacknowledged. Requires a false-to-true transition.
LLOperAck BOOL Low Low operator acknowledge. Set to true by the operator interface to
acknowledge a Low Low condition. Takes effect only if the alarm
condition is unacknowledged. The alarm instruction clears this parameter
false.
Default is false.
ROCPosProgAck BOOL Positive rate of change program acknowledge. Set to true by the user
program to acknowledge a positive rate-of-change condition. Requires a
false-to-true transition while the alarm condition is unacknowledged.
ROCPosOperAck BOOL Positive rate of change operator acknowledge. Set to true by the operator
interface to acknowledge a positive rate-of-change condition. Requires a
false-to-true transition while the alarm condition is unacknowledged. The
alarm instruction sets this parameter to false.
ROCNegProgAck BOOL Negative rate of change program acknowledge. Set to true by the user
program to acknowledge a negative rate-of-change condition. Requires a
false-to-true transition while the alarm condition is unacknowledged.
Default is false.
ROCNegOperAck BOOL Negative rate of change operator acknowledge. Set to true by the operator
interface to acknowledge a negative rate-of-change condition. Requires a
false-to-true transition while the alarm condition is unacknowledged. The
alarm instruction clears this parameter to false.
ProgSuppress BOOL Set to true by the user program to suppress the alarm.
OperSuppress BOOL Set to true by the operator interface to suppress the alarm. The alarm
instruction clears this parameter to false.
ProgUnsuppress BOOL Set to true by the user program to unsuppress the alarm. Takes
precedence over Suppress commands.
Default is false.
26 Publication 1756-RM003V-EN-P - November 2020
Input Parameter
Data Type
Description
Default is false.
again. It becomes unacknowledged when the shelve duration ends.
Unshelve commands take precedence over Shelve commands.
Unshelve commands take precedence over Shelve commands.
Unshelve commands take precedence over Shelve commands.
Default is false.
Chapter 1 Alarm Instructions
OperUnsuppress BOOL Set to true by the operator interface to unsuppress the alarm. Takes
precedence over Suppress commands. The alarm instruction sets this
parameter to false.
HHOperShelve BOOL High-high operator shelve. Set to true by the operator interface to shelve
or reshelve a high-high condition. Requires a false-to-true transition. The
alarm instruction clears this parameter to false.
Default is false.
Unshelve commands take precedence over Shelve commands.
Shelving an alarm postpones alarm processing. It is like suppressing an
alarm, except that shelving is time limited. If an alarm is acknowledged
while it is shelved, it remains acknowledged even if it becomes active
HOperShelve BOOL High operator shelve. Set to true by the operator interface to shelve or
reshelve a high condition. Requires a transition from false in one program
scan to true in the next program scan. The alarm instruction clears this
parameter to false.
Default is false.
Unshelve commands take precedence over Shelve commands.
LOperShelve BOOL Low operator shelve. Set to true by the operator interface to shelve or
reshelve a low condition. Requires a transition false in one program scan
to true in the next program scan. The alarm instruction clears this
parameter to false.
Default is false.
LLOperShelve BOOL Low-low operator shelve. Set to true by the operator interface to shelve or
reshelve a low-low condition. Requires a transition from false in one
program scan to true in the next program scan. The alarm instruction
clears this parameter to false.
Default is false.
Unshelve commands take precedence over Shelve commands.
ROCPosOperShelve BOOL Positive rate-of-change operator shelve. Set to true by the operator
interface to shelve or reshelve a positive rate-of-change condition.
Requires a transition from false in one program scan to true in the next
program scan. The alarm instruction clears this parameter to false.
Default is false.
ROCNegOperShelve BOOL Negative rate-of-change operator shelve. Set to true by the operator
interface to shelve or reshelve a negative rate-of-change condition.
Requires a transition from false in one program scan to true in the next
program scan. The alarm instruction clears this parameter to false.
Default is false.
ProgUnshelveAll BOOL Set to true by the user program to unshelve all conditions on this alarm. If
both shelve and unshelve are true, unshelve commands take precedence
over shelve commands.
HHOperUnshelve BOOL High-high operator unshelve. Set to true by the operator interface to
unshelve a high-high condition. The alarm instruction clears this
parameter to false. If both shelve and unshelve are true, unshelve
commands take precedence over shelve commands.
Default is false.
Publication 1756-RM003V-EN-P - November 2020 27
Chapter 1 Alarm Instructions
Input Parameter
Data Type
Description
Default is false.
Default is false.
Default is false.
Default is false.
Default is false.
ProgEnable
BOOL
Copied from the instruction operand.
Default is false.
Default is false.
Default is true.
HOperUnshelve BOOL High operator unshelve. Set to true by the operator interface to unshelve a
high condition. The alarm instruction clears this parameter to false. If
both shelve and unshelve are true, unshelve commands take precedence
over shelve commands.
LOperUnshelve BOOL Low operator unshelve. Set to true by the operator interface to unshelve a
low condition. The alarm instruction clears this parameter to false. If both
shelve and unshelve are true, unshelve commands take precedence over
shelve commands.
Default is false.
LLOperUnshelve BOOL Low-low operator unshelve. Set to true by the operator interface to
unshelve a low-low condition. The alarm instruction clears this parameter
to false. If both shelve and unshelve are true, unshelve commands take
precedence over shelve commands.
ROCPosOperUnshelve BOOL Positive rate-of-change operator unshelve. Set to true by the operator
interface to unshelve a positive rate-of-change condition. The alarm
instruction clears this parameter to false. If both shelve and unshelve are
set, unshelve commands take precedence over shelve commands.
ROCNegOperUnshelve BOOL Negative rate-of-change operator unshelve. Set to true by the operator
interface to unshelve a negative rate-of-change condition. The alarm
instruction clears this parameter to false. If both shelve and unshelve are
true, unshelve commands take precedence over shelve commands.
ProgDisable BOOL Copied from the instruction operand.
OperDisable BOOL Set to true by the operator interface to disable the alarm. The alarm
instruction clears this parameter to false.
OperEnable BOOL Set to true by the operator interface to enable the alarm. Takes
precedence over Disable command. The alarm instruction clears this
parameter false.
AlarmCountReset BOOL Set to true by the operator interface to reset the alarm counts for all
conditions. The alarm instruction clears this parameter to false.
HHMinDurationEnable BOOL High-high minimum duration enable. Set to true to enable minimum
duration timer when detecting the high-high condition.
Default is true.
HMinDurationEnable BOOL High minimum duration enable. Set to true to enable minimum duration
timer when detecting the high condition.
Default is true.
LMinDurationEnable BOOL Low minimum duration enable. Set to true to enable minimum duration
timer when detecting the low condition.
28 Publication 1756-RM003V-EN-P - November 2020
LLMinDurationEnable BOOL Low-low minimum duration enable. Set to true to enable minimum
duration timer when detecting the low-low condition.
Default is true.
LLSeverity DINT Severity of the Low Low alarm condition. This does not affect processing
of alarms by the controller, but can be used for sorting and filtering
functions at the alarm subscriber.
Valid = 1...1000 (1000 = most severe; 1 = least severe).
MinDurationPRE DINT Minimum duration preset (milliseconds) for an alarm level condition to
remain true before the condition is marked as InAlarm and alarm
notification is sent to clients. The controller collects alarm data as soon
as the alarm condition is detected; so no data is lost while waiting to meet
the minimum duration. Does not apply to rate-of-change conditions or to
conditions for which minimum duration detection is disabled.
MinDurationPRE only applies to the first excursion from normal in either
direction. For example, once the High condition times out, the High High
condition becomes active immediately, while a Low condition waits for
the timeout period.
Valid = 0...2147483647.
Default = 0.
ShelveDuration DINT Time duration (in minutes) for which a shelved alarm will be shelved.
Minimum time is one minute. Maximum time is defined by
MaxShelveDuration.
MaxShelveDuration DINT Maximum time duration (in minutes) for which an alarm can be shelved.
Publication 1756-RM003V-EN-P - November 2020 29
Chapter 1 Alarm Instructions
Input Parameter
Data Type
Description
Default = 0.0.
Default = 0.0.
Default = 500.
Default = 0.0.
Deadband REAL Deadband for detecting that High High, High, Low, and Low Low alarm
levels have returned to normal.
A non-zero Deadband can reduce alarm condition chattering if the In
value is continually changing but remaining near the level condition
threshold. The Deadband value does not affect the transition to the
InAlarm (active) state. Once a level condition is active, but before the
condition returns to the inactive (normal) state, the In value must either:
drop below the threshold minus the deadband (for High and High High
conditions).
OR
rise above the threshold plus the deadband (for Low and Low Low
conditions).
The Deadband is not used to condition the Minimum Duration time
measurement.
Valid = 0 = Deadband < Span from first enabled Low alarm to the first
enabled High alarm.
Default = 0.0.
ROCPosLimit REAL Limit for an increasing rate-of-change in units per second. Detection is
enabled for any value > 0.0 if ROCPeriod is also > 0.0.
Valid = 0.0...maximum possible float.
ROCPosSeverity DINT Severity of the increasing rate-of-change condition. This does not affect
processing of alarms by the controller, but can be used for sorting and
filtering functions at the alarm subscriber.
Valid = 1...1000 (1000 = most severe; 1 = least severe).
Default = 500.
ROCNegLimit REAL Limit for a decreasing rate-of-change in units per second. Detection is
enabled for any value > 0.0 if ROCPeriod is also > 0.0.
Valid = 0.0...maximum possible float.
ROCNegSeverity DINT Severity of the decreasing rate-of-change condition. This does not affect
processing of alarms by the controller, but can be used for sorting and
filtering functions at the alarm subscriber.
Valid = 1...1000 (1000 = most severe; 1 = least severe).
ROCPeriod REAL Time period in seconds for calculation (sampling interval) of the rate of
change value. Each time the sampling interval expires, a new sample of In
is stored, and ROC is re-calculated. Instead of an enable bit like other
conditions in the analog alarm, the rate-of-change detection is enabled by
putting any non-zero value in the ROCPeriod.
Valid = 0.0...32767.0
Output Parameters
These output parameters are common to ladder logic.
30 Publication 1756-RM003V-EN-P - November 2020
Output Parameter
Data Type
Description
Cleared to false when no Low condition exists.
Active. Cleared to false when no Low Low condition exists.
positive rate-of-change condition exists.
negative rate-of-change condition exists.
acknowledged.
Cleared to false when a High condition is not acknowledged.
rate-of-change condition is not acknowledged.
negative rate-of-change condition is not acknowledged.
acknowledged, or both.
Chapter 1 Alarm Instructions
AnyInAlarmUnack BOOL Combined alarm active and acknowledged status. Set to true when any
alarm condition is detected and unacknowledged. Cleared to false when
all alarm conditions are inactive, acknowledged, or both.
HHInAlarm BOOL High High alarm condition status. Set to true when a High High condition
is Active. Cleared to false when no High High condition exists.
HInAlarm BOOL High alarm condition status. Set to true when a High condition is Active.
Cleared to false when no High condition exists.
LInAlarm BOOL Low alarm condition status. Set to true when a Low condition is Active.
LLInAlarm BOOL Low Low alarm condition status. Set to true when a Low Low condition is
ROCPosInAlarm BOOL Positive rate-of-change alarm condition status. Set to true when a
positive rate-of-change condition exists. Cleared to false when no
ROCNegInAlarm BOOL Negative rate-of-change alarm condition status. Set to true when a
negative rate-of-change condition exists. Cleared to False when no
ROC REAL Calculated rate-of-change of the In value. This value is updated when
the instruction is scanned following each elapsed ROCPeriod. The ROC
value is used to evaluate the ROCPosInAlarm and ROCNegInAlarm
conditions.
ROC = (current sample of In – previous sample of In) / ROCPeriod
HHAcked BOOL High High condition acknowledged status. Set to true when a High High
condition is acknowledged. Always set to true when AckRequired is
cleared to false. Cleared to false when a High High condition is not
HAcked BOOL High condition acknowledged status. Set to true when a High condition is
acknowledged. Always set to true when AckRequired is cleared to false.
LAcked BOOL Low condition acknowledged status. Set to true when a Low condition is
acknowledged. Always set to true when AckRequired is cleared to false.
Cleared to false when a Low condition is not acknowledged.
LLAcked BOOL Low Low condition acknowledged status. Set to true when a Low Low
condition is acknowledged. Always true when AckRequired is cleared to
false. Cleared to false when a Low Low condition is not acknowledged.
ROCPosAcked BOOL Positive rate-of-change condition acknowledged status. Set to true
when a positive rate-of-change condition is acknowledged. Always true
when AckRequired is cleared to false. Cleared to false when a positive
ROCNegAcked BOOL Negative rate-of-change condition acknowledged status. Set to true
when a negative rate-of-change condition is acknowledged. Always set
to true when AckRequired is cleared to false. Cleared to false when a
HHInAlarmUnack BOOL Combined High High condition active and unacknowledged status. Set to
true when the High High condition is active (HHInAlarm is true) and
unacknowledged. Cleared to false when the High High condition is
inactive, acknowledged, or both.
HInAlarmUnack BOOL Combined High condition active and unacknowledged status. Set to true
when the High condition is active (HInAlarm is true) and
unacknowledged. Cleared to false when the High condition is inactive,
Publication 1756-RM003V-EN-P - November 2020 31
Chapter 1 Alarm Instructions
Output Parameter
Data Type
Description
both.
inactive, acknowledged, or both.
positive rate-of-change condition is inactive, acknowledged, or both.
acknowledged, or both.
suppressed. Cleared to false when the alarm is not suppressed.
unshelved.
shelved. Cleared to false when high condition is unshelved.
shelved. Cleared to false when low condition is unshelved.
is shelved. Cleared to false when low-low condition is unshelved.
positive rate-of-change condition is unshelved.
MinDurationACC
DINT
Not Used. Value is always 0.
active state.
maximum count value.
active state.
LInAlarmUnack BOOL Combined Low condition active and unacknowledged status. Set to true
when the Low condition is active (LInAlarm is true) and unacknowledged.
Cleared to false when the Low condition is inactive, acknowledged, or
LLInAlarmUnack BOOL Combined Low Low condition active and unacknowledged status. Set to
true when the Low Low condition is active (LLInAlarm is true) and
unacknowledged. Cleared to false when the Low Low condition is
ROCPosInAlarmUnack BOOL Combined positive rate-of-change condition active and unacknowledged
status. Set to true when the positive rate-of-change condition is active
(ROCPosInAlarm is true) and unacknowledged. Cleared to false when the
ROCNegInAlarmUnack BOOL Combined negative rate-of-change condition active and
unacknowledged status. Set to true when the negative rate-of-change
condition is active (ROCNegInAlarm is true) and unacknowledged.
Cleared to false when the negative rate-of-change condition is inactive,
Suppressed BOOL Suppressed status of the alarm. Set to true when the alarm is
HHShelved BOOL High-high condition shelved status. Set to true when a high-high
condition is shelved. Cleared to false when high-high condition is
HShelved BOOL High condition shelved status. Set to true when a high condition is
LShelved BOOL Low condition shelved status. Set to true when a low condition is
LLShelved BOOL Low-low condition shelved status. Set to true when a low-low condition
ROCPosShelved BOOL Positive rate-of-change condition shelved status. Set to true when a
positive rate-of-change condition is shelved. Cleared to false when
ROCNegShelved BOOL Negative rate-of-change condition shelved status. Set to true when a
negative rate-of-change condition is shelved. Cleared to false when
negative rate-of-change condition is unshelved.
Disabled BOOL Disabled status of the alarm. Set to true when the alarm is unavailable
(disabled). Cleared to false when the alarm is enabled.
Commissioned BOOL The commissioned bit is not used.
HHInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value
exceeded the High High condition limit for the most recent transition to
the active state.
HHAlarmCount DINT The number of times the High High condition has been activated. If the
maximum value is reached, the counter leaves the value at the
maximum count value.
HInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value
exceeded the High condition limit for the most recent transition to the
HAlarmCount DINT The number of times the High condition has been activated. If the
LInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value
32 Publication 1756-RM003V-EN-P - November 2020
maximum value is reached, the counter leaves the value at the
exceeded the Low condition limit for the most recent transition to the
Output Parameter
Data Type
Description
the active state.
maximum count value.
transition to the active state.
at the maximum count value.
condition alarm time.
RetToNormalTime
LINT
Timestamp of alarm returning to a normal state.
shelved the timestamp is set to current time.
Chapter 1 Alarm Instructions
LAlarmCount DINT The number of times the Low condition has been activated. If the
maximum value is reached, the counter leaves the value at the
maximum count value.
LLInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value
exceeded the Low Low condition limit for the most recent transition to
LLAlarmCount DINT The number of times the Low Low condition has been activated. If the
maximum value is reached, the counter leaves the value at the
ROCPosInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value
exceeded the positive-rate-of-change condition limit for the most recent
ROCPosInAlarmCount DINT The number of times the positive rate-of-change condition has been
activated. If the maximum value is reached, the counter leaves the value
ROCNegInAlarmTime LINT Timestamp when the ALMA instruction detected that the In value
exceeded the negative-rate-of-change condition limit for the most
recent transition to the active state.
ROCNegAlarmCount DINT The number of times the negative rate-of-change condition has been
activated. If the maximum value is reached, the counter leaves the value
at the maximum count value.
AckTime LINT Timestamp of most recent condition acknowledgment. If the alarm does
not require acknowledgment, this timestamp is equal to most recent
AlarmCountResetTime LINT Timestamp indicating when the alarm count was reset.
ShelveTime LINT Timestamp indicates when an alarm condition was shelved the last time.
Set by controller when alarm condition is shelved. Alarm conditions can
be shelved and unshelved many times. Each time alarm condition is
UnshelveTime LINT Timestamp indicating when all alarm conditions are going to be
unshelved. Value is set only when no alarm condition is shelved yet. The
timestamp is determined as sum of the ShelveDuration time period and
current time. If an alarm condition is unshelved programmatically or by
an operator and no other alarm condition is shelved, then value is set to
the current time.
Publication 1756-RM003V-EN-P - November 2020 33
Chapter 1 Alarm Instructions
Output Parameter
Data Type
Description
InstructFault
Status.1 = InFaulted
X
X
Status.2 = SeverityInv
X
X
AlarmLimitsInv
ROCPosLimitInv
ROCNegLimitInv
If severity >1000, the instruction uses Severity = 1000.
fault is cleared, no new level conditions can be detected.
enabled high alarm.
= 0.0, which makes rate-of-change detection unavailable.
Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
InstructFault (Status.0) BOOL Instruction error conditions exist. This is not a minor or major controller
error. Check the remaining status bits to determine what occurred.
InFaulted (Status.1) BOOL User program has set InFault to indicate bad quality input data. Alarm
continues to evaluate In for alarm conditions.
SeverityInv (Status.2) BOOL Alarm severity configuration is invalid.
If severity <1, the instruction uses Severity = 1.
AlarmLimitsInv (Status.3) BOOL Alarm Limit configuration is invalid (for example, LLimit < LLLimit). If
invalid, the instruction clears all level conditions active bits. Until the
DeadbandInv (Status.4) BOOL Deadband configuration is invalid. If invalid, the instruction uses
Deadband = 0.0.
Valid = 0 = Deadband < Span from first enabled low alarm to the first
34 Publication 1756-RM003V-EN-P - November 2020
ROCPosLimitInv (Status.5) BOOL Positive rate-of-change limit invalid. If invalid, the instruction uses
ROCPosLimit = 0.0, which makes positive rate-of-change detection
unavailable.
ROCNegLimitInv (Status.6) BOOL Negative rate-of-change limit invalid. If invalid, the instruction uses
ROCNegLimit = 0.0, which makes negative rate-of-change detection
unavailable.
ROCPeriodInv (Status.7) BOOL Rate-of-change period invalid. If invalid, the instruction uses ROCPeriod
Overflow
(Status.8)
BOOL The Overflow bit is set to true when an overflow condition is detected.
The overflow bit is cleared to false when the overflow condition has been
corrected.
Applies to CompactLogix 5380, CompactLogix 5480, ControlLogix 5580,
Controllers
Affected Math Status Flags
controllers
GuardLogix 5370, GuardLogix 5570 controllers
A minor fault will occur if:
Fault Type
Fault Code
Chapter 1 Alarm Instructions
Connect a button to the OperShelve tag
The alarm instruction only processes the OperShelve tag on transition from
cleared to set to prevent unwanted reshelving of the alarm. For example, if an
operator presses a push button to shelve the alarm while the ProgUnshelve tag
is set, the alarm is not shelved because the ProgUnshelve tag takes
precedence. To shelve the alarm, the operator can release and press the push
button again once ProgUnshelve is cleared.
The input value is INF or NAN for CompactLogix 5370,
ControlLogix 5570, Compact GuardLogix 5370,
GuardLogix 5570 controllers only.
See Math Status Flags.
4 4
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for arrayindexing faults.
Publication 1756-RM003V-EN-P - November 2020 35
Analog Alarm State Diagrams
These illustrations show the manner in which an analog alarm responds to
changing alarm conditions and operator commands.
Chapter 1 Alarm Instructions
36 Publication 1756-RM003V-EN-P - November 2020
Chapter 1 Alarm Instructions
Publication 1756-RM003V-EN-P - November 2020 37
Chapter 1 Alarm Instructions
38 Publication 1756-RM003V-EN-P - November 2020
Chapter 1 Alarm Instructions
Analog Alarm Timing Diagrams
These timing diagrams show the sequence of analog alarm operations.
Publication 1756-RM003V-EN-P - November 2020 39
Chapter 1 Alarm Instructions
Level Conditions Behavior Acknowledge
40 Publication 1756-RM003V-EN-P - November 2020
Level Conditions Behavior No Acknowledge
Chapter 1 Alarm Instructions
Publication 1756-RM003V-EN-P - November 2020 41
Chapter 1 Alarm Instructions
ROC Conditions Behavior Acknowledge
42 Publication 1756-RM003V-EN-P - November 2020
Condition/State
Action Taken
Rung-condition-in is false
Rung-condition-out is cleared to false.
The instruction executes
ROC Conditions Behavior No Acknowledge
Chapter 1 Alarm Instructions
Execution
Ladder Diagram
Prescan Rung-condition-out is cleared to false.
All of the ALMA structure parameters are cleared
All alarm conditions are acknowledged.
All operator requests are cleared
All timestamps are cleared
All delivery flags are cleared.
Rung-condition-in is true Rung-condition-out is set to true
Postscan Rung-condition-out is cleared to false
Publication 1756-RM003V-EN-P - November 2020 43
Chapter 1 Alarm Instructions
Condition/State
Action Taken
Postscan
Tag.EnableOut is cleared to false
Condition/State
Action Taken
Function Block
Prescan Tag.EnableOut is cleared to false.
All of the ALMA structure parameters are cleared
All alarm conditions are acknowledged.
All operator requests are cleared
All timestamps are cleared
All delivery flags are cleared.
Tag.EnableIn is false Tag.EnableOut is cleared to false
Tag.EnableIn is true The instruction executes
Tag.EnableOut is set to true
Instruction first run N/A
Instruction first scan N/A
Structured Text
In Structured Text, EnableIn is always true during normal scan. Therefore, if
the instruction is in the control path activated by the logic it will execute.
Prescan See Prescan in the Ladder Diagram table.
Normal Execution See Rung-condition-in is true in the Ladder
Diagram table.
Postscan See Postscan in the Ladder Diagram table.
Examples
Ladder Diagram
44 Publication 1756-RM003V-EN-P - November 2020
Chapter 1 Alarm Instructions
Function Block
An example of an ALMA instruction in Function Block is shown below. In this
example, the Tank 32 Level Transmitter (Tank32LT) is monitored for alarm
conditions. The Tank32LevelAck tag can be used to acknowledge all conditions
of this alarm.
Structured Text
In this example, the Tank 32 Level Transmitter (Tank32LT) is monitored for
alarm conditions. The Tank32LevelAck tag can be used to acknowledge all
conditions of this alarm.
ALMA(Tank32Level,Tank32LT,Tank32LevelAck,0, 0);
See also
Structured Text Syntax on page 915
Math Status Flags on page 887
Index Through Arrays on page 898
Publication 1756-RM003V-EN-P - November 2020 45
Chapter 1 Alarm Instructions
Digital Alarm (ALMD)
This information applies to the CompactLogix 5370, ControlLogix 5570,
ALMD tag ALARM_DIGITAL Structure ALMD structure
ProgAck BOOL Tag
On transition from false to true, acknowledges alarm (if
Chapter 1 Alarm Instructions
ProgReset BOOL Tag
ProgDisable BOOL Tag
ProgEnable BOOL Tag
MinDurationPRE DINT Immediate Specifies how long the alarm condition must be met before it is
MinDurationACC DINT Immediate Indicates the current accumulator value for the alarm’s MinDuration
On transition from false to true, resets alarm (if resetting is required).
When True, disables alarm (does not override Enable Commands).
When True, enables alarm (takes precedence over Disable commands).
Function Block
ALMD tag ALARM_DIGITAL structure ALMD structure
Structured Text
ALMD tag ALARM_DIGITAL Structure ALMD structure
ProgAck BOOL Tag
On transition from false to true, acknowledges alarm (if
Publication 1756-RM003V-EN-P - November 2020 47
ProgReset BOOL Tag
ProgDisable BOOL Tag
Immediate
ProgEnable BOOL Tag
Immediate
MinDurationPRE DINT Immediate Specifies how long the alarm condition must be met before it is
MinDurationACC DINT Immediate Indicates the current accumulator value for the alarm’s MinDuration
On transition from false to true, resets alarm (if resetting is required).
When True, disables alarm (does not override Enable Commands).
When True, enables alarm (takes precedence over Disable commands).
reported (milliseconds).
timer.
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Chapter 1 Alarm Instructions
Input Parameter
Data Type
Description
No effect. The instruction always executes.
Default is false (good health).
Default is true.
A latched alarm can only be reset when the alarm condition is false.
Copied from the instruction operand.
Default is false.
EnableIn BOOL Ladder Diagram:
In BOOL The digital signal input to the instruction.
InFault BOOL Bad health indicator for the input. The user application may set InFault to indicate the input
ALMD Structure
Input Parameters
Corresponds to the rung state. Does not affect processing.
Function Block:
If cleared to false, the instruction does not execute and outputs are not updated.
If set, the instruction executes.
Default is true.
Structured Text:
Default is false.
Ladder Diagram:
Follows the rung condition. Set to true if the rung condition is true. Cleared to false if the rung
condition is false.
Structured Text:
Copied from instruction operand.
signal has an error. When set, the instruction sets InFaulted (Status.1). When cleared to false,
the instruction clears the InFaulted (Status.1) to false. In either case, the instruction continues
to evaluate In for alarm conditions.
Condition BOOL Specifies how alarm is activated. When Condition is set to true, the alarm condition is
activated when In is set to true. When Condition is cleared to false, the alarm condition is
activated when In is Cleared to false.
AckRequired BOOL Specifies whether alarm acknowledgment is required. When set to true, acknowledgment is
required. When cleared to false, acknowledgment is not required and Acked is always set to
true.
Default is true.
Latched BOOL Specifies whether the alarm is latched. Latched alarms remain InAlarm when the alarm
condition becomes false, until a Reset command is received. When set to true, the alarm is
latched. When cleared to false, the alarm is unlatched.
Default is false.
ProgAck BOOL Set to true by the user program to acknowledge the alarm. Takes effect only if the alarm is
unacknowledged. Requires a false-to-true transition.
Default is false.
Ladder Diagram:
Copied from the instruction operand.
Structured Text:
OperAck BOOL Set to true by the operator interface to acknowledge the alarm. Takes effect only if the alarm
is unacknowledged. The instruction clears this parameter.
48 Publication 1756-RM003V-EN-P - November 2020
Input Parameter
Data Type
Description
Copied from the instruction operand.
Default is false.
Default is false.
Default is false.
duration ends provided the alarm is still active at that moment.
For more information on shelving an alarm, see the description for the OperShelve parameter.
For more information on shelving an alarm, see the description for the OperShelve parameter.
Copied from the instruction operand.
Chapter 1 Alarm Instructions
ProgReset BOOL Set to true by the user program to reset the latched alarm. Takes effect only if the latched
alarm is InAlarm and the alarm condition is false. Requires a false-to-true transition.
Default is false.
Ladder Diagram:
Copied from the instruction operand.
Structured Text:
OperReset BOOL Set to true by the operator interface to reset the latched alarm. Takes effect only if the latched
alarm is InAlarm and the alarm condition is false. The alarm instruction clears this parameter
to false.
Default is false.
ProgSuppress BOOL Set to true by the user program to suppress the alarm.
Default is false.
OperSuppress BOOL Set to true by the operator interface to suppress the alarm. The alarm instruction clears this
parameter to false.
ProgUnsuppress BOOL Set to true by the user program to unsuppress the alarm. Takes precedence over Suppress
commands.
OperUnsuppress BOOL Set to true by the operator interface to unsuppress the alarm. Takes precedence over
Suppress commands. The alarm instruction clears this parameter to false.
OperShelve BOOL Set to true by the operator interface to shelve or reshelve the alarm. Requires a transition from
false in one program scan to true in the next program scan. The alarm instruction clears this
parameter to false.
Default is false.
Unshelve commands take precedence over Shelve commands.
Shelving an alarm postpones alarm processing. It is like suppressing an alarm, except that
shelving is time limited. If an alarm is acknowledged while it is shelved, it remains
acknowledged even if it becomes active again. It becomes unacknowledged when the shelve
ProgUnshelve BOOL Set to true by the user program to unshelve the alarm. Takes precedence over Shelve
commands.
Default is false.
OperUnshelve BOOL Set to true by the operator interface to unshelve the alarm. The alarm instruction clears this
parameter to false. Takes precedence over Shelve commands.
Default is cleared.
ProgDisable BOOL Set to true by the user program to disable the alarm.
Default is false.
Ladder Diagram:
Copied from the instruction operand.
Structured Text:
OperDisable BOOL Set to true by the operator interface to disable the alarm. The alarm instruction clears this
parameter to true.
Default is false.
Publication 1756-RM003V-EN-P - November 2020 49
Chapter 1 Alarm Instructions
Input Parameter
Data Type
Description
Copied from the instruction operand.
Default is false.
Default is false.
sequence-of-events input module.
Default = 500.
Default = 0.
Output Parameter
Data
Type
Description
EnableOut
BOOL
Enable output.
not active (normal status).
Acked is always set to true when AckRequired is cleared to false.
inactive, acknowledged, or both.
ProgEnable BOOL Set to true by the user program to enable the alarm. Takes precedence over a Disable
OperEnable BOOL Set to true by the operator interface to enable the alarm. Takes precedence over Disable
AlarmCountReset BOOL Set to true by the operator interface to reset the alarm count to zero. The alarm instruction
UseProgTime BOOL Specifies whether to use the controller’s clock or the ProgTime value to timestamp alarm state
ProgTime LINT If UseProgTime is set to true, this value is used to provide the timestamp value for all events.
command.
Default is false.
Ladder Diagram:
Copied from the instruction operand.
Structured Text:
command. The alarm instruction clears this parameter to false.
clears this parameter to false.
Default is false.
change events. When set to true, the ProgTime value provides timestamp. When cleared to
false, the controller’s clock provides timestamp.
This lets the application apply timestamps obtained from the alarm source, such as a
Severity DINT Severity of the alarm. This does not affect processing of alarms by the controller, but can be
used for sorting and filtering functions at the alarm subscriber.
Valid = 1...1000 (1000 = most severe; 1 = least severe).
MinDurationPRE DINT Minimum duration preset (milliseconds) for the alarm condition to remain true before the alarm
is marked as InAlarm and alarm notification is sent to clients. The controller collects alarm
data as soon as the alarm condition is detected; so no data is lost while waiting to meet the
minimum duration.
Valid = 0...2147483647.
ShelveDuration DINT Length of time in minutes to shelve an alarm. Shelving an alarm postpones alarm processing. It
is like suppressing an alarm, except that shelving is time limited. If an alarm is acknowledged
while it is shelved, it remains acknowledged even if it becomes active again. It becomes
unacknowledged when the shelve duration ends (provided the alarm is still active at that time).
Minimum time is one minute. Maximum time is defined by MaxShelveDuration.
MaxShelveDuration DINT Maximum time duration in minutes for which an alarm can be shelved. For more information on
shelving an alarm, see the description for the ShelveDuration parameter.
Output Parameters
InAlarm BOOL Alarm active status. Set to true when the alarm is active. Cleared to false when the alarm is
Acked BOOL Alarm acknowledged status. Set to true when the alarm is acknowledged. Cleared to false
InAlarmUnack BOOL Combined alarm active and acknowledged status. Set to true when the alarm is active
50 Publication 1756-RM003V-EN-P - November 2020
when the alarm is not acknowledged.
(InAlarm is true) and unacknowledged (Acked is false). Cleared to false when the alarm is
Output Parameter
Data
Description
duration ends.
the alarm is enabled.
false when the alarm is decommissioned. Currently always set to true.
MinDurationACC
DINT
Not used. Value is always 0.
reached, the counter leaves the value at the maximum count value.
InAlarmTime
LINT
Timestamp of alarm detection.
timestamp is equal to alarm time.
RetToNormalTime
LINT
Timestamp of alarm returning to a normal state.
AlarmCountResetTime
LINT
Timestamp indicating when the alarm count was reset.
For more information on shelving an alarm, see the description for the Shelved parameter.
For more information on shelving an alarm see the description for the Shelved parameter.
remaining status bits to determine what occurred.
(Status.1)
Chapter 1 Alarm Instructions
Type
Suppressed BOOL Suppressed status of the alarm. Set to true when the alarm is suppressed. Cleared to
falsewhen the alarm is not suppressed.
Shelved BOOL Shelved status of the alarm. Set to true when alarm is shelved. Cleared to false when alarm is
unshelved.
Shelving an alarm postpones alarm processing. It is like suppressing an alarm, except that
shelving is time limited. If an alarm is acknowledged while it is shelved, it remains
acknowledged even if it becomes active again. It becomes unacknowledged when the shelve
Disabled BOOL Disabled status of the alarm. Set to true when the alarm is not enabled. Cleared to false when
Commissioned BOOL Commissioned status of the alarm. Set to true when the alarm is commissioned. Cleared to
AlarmCount DINT Number of times the alarm has been activated (InAlarm is set). If the maximum value is
AckTime LINT Timestamp of alarm acknowledgment. If the alarm does not require acknowledgment, this
ShelveTime LINT Timestamp indicating when the alarm was shelved the last time. This value is set by
controller when alarm is shelved. Alarm can be shelved and unshelved many times. Each time
the alarm is shelved, the timestamp is set to the current time.
UnshelveTime LIN Timestamp indicating when the alarm is going to be unshelved. This value is set every time
the alarm is shelved (even if the alarm has already been shelved). The timestamp is
determined by adding the ShelveDuration to the current time. If the alarm is unshelved
programmatically or by an operator, then the value is set to the current time.
InstructFault (Status.0) BOOL Instruction error conditions exist. This is not a minor or major controller error. Check the
InFaulted
BOOL User program has set InFault to indicate bad quality input data. Alarm continues to evaluate
In for alarm condition.
SeverityInv
(Status.2)
BOOL Alarm severity configuration.
If severity <1, the instruction uses Severity = 1.
If severity >1000, the instruction uses Severity = 1000.
Publication 1756-RM003V-EN-P - November 2020 51
Chapter 1 Alarm Instructions
Digital Alarms State Diagrams
52 Publication 1756-RM003V-EN-P - November 2020
Digital Alarm Timing Diagrams
Chapter 1 Alarm Instructions
ALMD Alarm Acknowledge Required and Latched
Publication 1756-RM003V-EN-P - November 2020 53
Chapter 1 Alarm Instructions
ALMD Alarm Acknowledge Required and Not Latched
ALMD Alarm Acknowledge Not Required and Latched
54 Publication 1756-RM003V-EN-P - November 2020
Chapter 1 Alarm Instructions
ALMD Alarm Acknowledge Not Required and Not Latched
Connect a button to the OperShelve tag
To prevent unwanted reshelving of the alarm, the alarm instruction only
processes the OperShelve tag if it transitions from false to true between one
program scan and the next. If an operator presses a push button to shelve the
alarm while the ProgUnshelve tag is true, the alarm is not shelved because the
ProgUnshelve tag takes precedence. However, because program scans
complete in milliseconds, the operator may still be holding down the push
button so that the OperShelve tag remains true over several program scans
even though the ProgUnshelve tag has been cleared to false. This means that
the alarm is not shelved.
To shelve the alarm, the operator can release and press the button again
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for arrayindexing faults.
Publication 1756-RM003V-EN-P - November 2020 55
Chapter 1 Alarm Instructions
Condition/State
Action Taken
The instruction executes.
The instruction executes.
Postscan
Rung bit is cleared to false.
Condition/State
Action Taken
All timestamps are cleared
Tag.EnableIn is false
Tag.EnableOut is cleared to false
Tag.EnableOut is set to true
Condition/State
Action Taken
Prescan
See Prescan in the Ladder Diagram table.
Normal Execution
See Rung-condition-in is true in the Ladder Diagram table.
Prescan EnableOut is cleared to false to false
Rung-condition-in is false Rung is cleared to false.
Rung-condition-in is true Rung is set to true.
Execution
Ladder Diagram
The InAlarm output is cleared to false
The Shelved output is cleared to false
The Acked ouput is set to true.
All alarm conditions are acknowledged.
All operator requests are cleared
All timestamps are cleared
The In parameter is cleared to false
The In parameter is set to true
Function Block
Prescan Tag.EnableOut is cleared to false.
The InAlarm output is cleared to false
The Shelved output is cleared to false
The Acked ouput is set to true
All operator requests are cleared
Tag.EnableIn is true The instruction executes
Instruction first run N/A
Instruction first scan N/A
Postscan Tag.EnableOut is cleared to false.
Structured Text
Postscan See Postscan in the Ladder Diagram table.
56 Publication 1756-RM003V-EN-P - November 2020
Example
Ladder Diagram
Function Block
Chapter 1 Alarm Instructions
Structured Text
An example of an ALMD instruction in Structured Text is shown below. In this
example, two motor failure signals are combined such that if either one
occurs, a motor fault alarm is activated. The Motor101Ack tag can be used to
acknowledge the alarm.
Motor101FaultConditions := Motor101Overtemp OR Motor101FailToStart;
The .LastState structure member is modified by a user application program.
Alarm Set Operation (ASO)
Index Through Arrays on page 898
This information applies to the Compact GuardLogix 5380, CompactLogix
5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580
controllers.
The Alarm Set Operation instruction issues a specified operation to all alarm
conditions of the specified alarm set. The Alarm Set Operation instruction is
used to initiate asynchronous execution of an alarm operation for all alarm
conditions of the specified alarm set. The instruction iterates through alarm
conditions of the specified alarm set and sets an internal flag requesting the
operation execution for each of the conditions. The internal flags have the
same purpose and priority as the existing user accessible Progxxx bits and will
be processed for all the alarm conditions of the specified alarm set during the
next periodic evaluation of each particular alarm condition from the set.
Available Languages
Ladder Diagram
Function Block Diagram
This instruction is not available in Function Block Diagram.
Structured Text
ASO (Alarm Set, Alarm Set Control, Operation)
Operands
Unexpected operation may occur if:
• The same tag (ALARM_SET_CONTROL) is used as a parameter for more than one
instruction invocation.
•
58 Publication 1756-RM003V-EN-P - November 2020
the controller mode from Program to Run for the changes to take effect.
Operand
Data Type
Format
Description
operated on by this instruction.
same priority as ProgXXX flags.
Condition/State
Action Taken
Prescan
The instruction clears all ALARM_SET structure members.
Rung-condition -in is false
The instruction clears .EnableOut and .LastState structure members.
always set to true.
ATTENTION: The Alarm Set Control structure contains internal state information. If any of the
configuration operands are changed while in run mode, accept the pending edits and cycle
Chapter 1 Alarm Instructions
The following table provides operands used for configuring the instruction.
Alarm Set ALARM_SET AlarmSet The ALARM_SET structure represents alarm conditions that are
Alarm Set Control ALARM_SET_CONTROL tag This data type contains three BOOL flags:
• EnableIn
• EnableOut
• LastState
The instruction reacts to the edge (transition of .EnableIn from
false to true) instead of the level.
EnableOut is always set to .EnableIn.
The request to perform the instruction operation have the
Operation
immediate This operand can be selected from the list or entered as an
None specific to this instruction. See Index Through Arrays for arrayindexing faults.
Execution
Rung-condition-in is true If .LastState is false then the instruction initiates the operation and sets
Postscan The instruction clears all ALARM_SET structure members.
Publication 1756-RM003V-EN-P - November 2020 59
.LastState structure member to true. The .EnableOut structure member is
Chapter 1 Alarm Instructions
Operation
The Alarm Set Operation instruction initiates asynchronous execution of one
of the following alarm operations on the specified alarm set:
• Acknowledge
• Reset
• Enable
• Disable
• Unshelve
• Suppress
• Unsuppress
• ResetAlarmCount
The instruction iterates through all alarm conditions which are included in
the specified alarm set or in the nested alarm sets to set an internal flag
representing the request to perform the required operation on a particular
alarm condition. The operation is initiated for all alarm conditions which are
iterated by the instruction with the following exceptions:
• Alarm Conditions which are configured not to support alarm
operations
• Alarm Conditions which are configured as not used
When an alarm operation is initiated for a particular alarm condition by the
instruction, the operation is performed during the next alarm periodic
evaluation of the alarm condition.
When the instruction is called multiple times for the same Alarm Set to
initiate contradictory alarm operations, the last requested operation is always
applied to all alarm conditions in the Alarm Set. The alarm operations
initiated for the Alarm Set may be applied to the conditions before the last
requested operation is performed.
When an Alarm Condition is periodically evaluated, the requests to perform
particular alarm operations have the same priority as the requests to perform
alarm operations initiated via user accessible Progxxx flags. It means that if a
request to perform an alarm operation is generated by the instruction, then it
is handled as if the corresponding Progxxx flag is set and the same rules used
to resolve conflicting requests specified for ProgXXX flags are used to resolve
conflicts between the instruction requests and requests made via Progxxx
flags.
The Alarm Set Operation instruction initiates the required alarm operation
only when it detects the transition of .EnableIn value from false to true. In
order to detect the transition, .LastState structure member is used to store
.EnableIn value from the previous instruction execution. See the Execution
section above.
60 Publication 1756-RM003V-EN-P - November 2020
conditions, then the execution time of the ASO instruction can increase significantly.
Tip: If the Alarm set provided as the instruction parameter contains an excessive number of alarm
See also
Alarm Instructions on page 21
Index Through Arrays (on page 898)
Chapter 1 Alarm Instructions
Publication 1756-RM003V-EN-P - November 2020 61
XIC
XIO
OTE
OTL
OTU
ONS
OSR
OSF
If you want to:
Use this instruction:
Enable outputs when a bit is set
XIC
Enable outputs when a bit is cleared
XIO
set a bit
OTE
clear bit (retentive)
OTU
goes true
set a bit for one scan each time a rung goes true
OSR
false
set in function block
cleared in function block
Bit Instructions
Examine If Closed (XIC)
Chapter 2
Bit Instructions
Use he bit (relay-type) instructions to monitor and control the status of bits,
such as input bits or timer-control word bits.
Available Instructions
Ladder Diagram
Function Block and Structured Text
OSRIOSFI
set a bit (retentive) OTL
Enable outputs for one scan each time a rung
set a bit for one scan each time the rung goes
set a bit for one scan each time the input bit is
set a bit for one scan each time the input bit is
ONS
OSF
OSRI
OSFI
Publication 1756-RM003V-EN-P - November 2020 63
See also
Compare Instructions on page 265
Compute/Math Instructions on page 343
Chapter 2 Bit Instructions
Operand
Data
Type
Format
Description
Addressing for examples.
This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The XIC instruction examines the data bit to set or clear the rung condition.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
This instruction is not available in structured text.
Operands
Ladder Diagram
Data bit BOOL tag Bit to be tested. There are various operand
addressing modes possible for the data bit, see Bit
64 Publication 1756-RM003V-EN-P - November 2020
Affects Math Status Flags
No
Condition/State
Action Taken
Rung-condition-in is false
Set Rung-condition-out to Rung-condition-in
If DataBit is false, rung-condition-out is cleared to false.
Postscan
N/A
Chapter 2 Bit Instructions
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Prescan N/A
Rung-condition-in is true If DataBit is true, rung-condition-out is set to true.
Example 1
Ladder Diagram
If Limit_Switch_1 is true, the next instruction is enabled.
Example 2
Ladder Diagram
Publication 1756-RM003V-EN-P - November 2020 65
If S:V is true (generated by MOV), the next instruction is enabled.
Chapter 2 Bit Instructions
Examine If Open (XIO)
Example 3
Ladder Diagram
XIC Access LINT Number
Axis_04 is an AXIS_CIP_DRIVE tag.
Test_Axis_00 is an Alias for Axis_04.
The AXIS_CIP_DRIVE type has a LINT member called CIPAxisFaults.
BusUndervoltageULFault is a bit member of CIPAxisFaults.
Test_Axis_00.BusUndervoltageULFault is bit 34 of CIPAxisFaults. The bit 34
value is 0x400000000.
If Test_Axis_00.BusUndervoltageULFault is true, this enables the next
instruction.
See also
Bit Instructions on page 63
Bit Addressing on page 899
Index Through Arrays on page 898
This information applies to the CompactLogix 5370, ControlLogix 5570,
The OSF instruction sets the output bit for one scan when rung-condition-in
transitions from true to false.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
This instruction is not available in structured text.
Operands
Unexpected operation may occur if:
• Output tag operands are overwritten.
• Members of a structure operand are overwritten.
•
Except when specified, structure operands are shared by multiple instructions.
Ladder Diagram
Storage Bit BOOL tag Stores the rung-condition-in from
when the instruction was last
executed.
There are various operand addressing
modes possible for the storage bit, see
Bit Addressing for examples.
Output Bit BOOL tag Bit to be modified.
72 Publication 1756-RM003V-EN-P - November 2020
Condition/State
Action Taken
Chapter 2 Bit Instructions
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Prescan The storage bit is cleared to false to prevent an
invalid trigger during the first program scan.
The output bit is cleared to false.
Rung-condition-in is false Set Rung-condition-out to Rung-condition-in.
See OSF Flow Chart (False).
Rung-condition-in is true Set Rung-condition-out to Rung-condition-in.
The storage bit is set to true.
The output bit is cleared to false.
Postscan N/A
OSF Flow Chart (False)
Publication 1756-RM003V-EN-P - November 2020 73
Chapter 2 Bit Instructions
One Shot Falling with Input
Example
Ladder Diagram
This example shows how an OSF can be used to make one or more
instructions edge-triggered. Each time Limit_Switch_01 transitions from true
to false the OSF will set Output_bit_02 to true. Any instruction conditioned by
Output_bit_02 will be enabled and, since Output_bit_02 is only true for one
scan, will execute once per transition.
(OSFI)
See also
Bit Instructions on page 63
Bit Addressing on page 899
Index Through Arrays on page 898
This information applies to the CompactLogix 5370, ControlLogix 5570,
The OSR instruction sets the output bit for one scan when rung-condition-in
transitions from false to true.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
This instruction is not available in structured text.
Operands
Unexpected operation may occur if:
• Output tag operands are overwritten.
• Members of a structure operand are overwritten.
Ladder Diagram
78 Publication 1756-RM003V-EN-P - November 2020
Bit Addressing for examples.
Output Bit
BOOL
tag
Bit to be modified.
Condition/State
Action Taken
The output bit is cleared to false.
Storage Bit BOOL tag Stores the rung-condition-in from
when the instruction was last
executed.
There are various operand addressing
modes possible for the storage bit, see
Chapter 2 Bit Instructions
Description
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Publication 1756-RM003V-EN-P - November 2020 79
Prescan The storage bit is set to true to prevent an invalid trigger during the
first program scan.
Rung-condition-in is false Set Rung-condition-out to Rung-condition-in
The storage bit is cleared to false.
The output bit is cleared to false.
Chapter 2 Bit Instructions
Rung-condition-in is true Set Rung-condition-out to Rung-condition-in
See OSR Flow Chart (True).
Postscan N/A
OSR Flow Chart (True)
Example
Ladder Diagram
This example shows how an OSR can be used to make one or more
instructions edge-triggered. Each time Limit_Switch_01 transitions from
false to true the OSR will set Output_bit_02 to true. Any instruction
80 Publication 1756-RM003V-EN-P - November 2020
One Shot Rising with Input
(OSRI)
conditioned by Output_bit_02 will be enabled and, since Output_bit_02 is
only true for one scan, will execute once per transition.
Chapter 2 Bit Instructions
See also
Bit Instructions on page 63
Bit Addressing on page 899
Index Through Arrayson page 898
This information applies to the CompactLogix 5370, ControlLogix 5570,
Except when specified, structure operands are shared by multiple instructions.
Operand
Data Type
Format
Description
Chapter 2 Bit Instructions
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The OTE instruction sets or clears the data bit based on rung condition.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
This instruction is not available in structured text.
Operands
Unexpected operation may occur if:
• Output tag operands are overwritten.
• Members of a structure operand are overwritten.
•
Ladder Diagram
Data bit BOOL tag Bit to be modified. There are
various operand addressing
modes possible for the data bit,
see Bit Addressing for examples.
Publication 1756-RM003V-EN-P - November 2020 85
Chapter 2 Bit Instructions
Condition/State
Action Taken
Postscan
The data bit is cleared to false.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Prescan The data bit is cleared to false
Rung-condition-in is false Set Rung-condition-out to Rung-condition-in.
The data bit is cleared to false
Rung-condition-in is true Set Rung-condition-out to Rung-condition-in.
The data bit is set to true.
Example
Ladder Diagram
When switch is true, the OTE instruction sets Light_01 to true. When switch is
false, the OTE instruction clears Light_01 to false.
See also
Structured Text Syntax on page 915
Bit Instructions on page 63
Bit Addressing on page 899
86 Publication 1756-RM003V-EN-P - November 2020
Index Through Arrays on page 898
IMPORTANT
• Except when specified, structure operands are shared by multiple instructions.
Operand
Data Type
Format
Description
examples.
Output Latch (OTL)
Chapter 2 Bit Instructions
This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers. Controller differences are noted where applicable.
The OTL instruction sets (latches) the data bit.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
This instruction is not available in structured text.
Operands
Unexpected operation may occur if:
• Output tag operands are overwritten.
• Members of a structure operand are overwritten.
Ladder Diagram
Data bit BOOL tag Bit to be modified. There are
various operand addressing
modes possible for the data
bit, see Bit Addressing for
Publication 1756-RM003V-EN-P - November 2020 87
Chapter 2 Bit Instructions
Condition/State
Action Taken
The data bit is set to true.
Postscan
N/A
Description
When the rung condition is true, the OTL instruction sets the data bit to true.
The data bit remains true until it is cleared, typically by an OTU instruction.
When the rung condition is changed to false, the OTL instruction does not
change the status of the data bit.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
For Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480,
ControlLogix 5580, and GuardLogix 5580 controllers, if the operand is an
indirect array reference and the subscript is out of range, then the controller
does not generate a major fault when the OTL instruction is false.
Execution
Ladder Diagram
Prescan N/A
Rung-condition-in is false Set Rung-condition-out to Rung-
condition-in.
Rung-condition-in is true Set Rung-condition-out to Rung-
condition-in.
88 Publication 1756-RM003V-EN-P - November 2020
Example
Ladder Diagram
Output Unlatch (OTU)
When enabled, the OTL instruction turns the light on.
Chapter 2 Bit Instructions
See also
Structured Text Syntax on page 915
Bit Instructions on page 63
Bit Addressing on page 899
Index Through Arrays on page 898
This information applies to the CompactLogix 5370, ControlLogix 5570,
The OTU instruction clears (unlatches) the data bit.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
Publication 1756-RM003V-EN-P - November 2020 89
This instruction is not available in structured text.
Chapter 2 Bit Instructions
IMPORTANT
Operand
Data Type
Format
Description
Rung-condition-in is false
Set Rung-condition-out to Rung-condition-in
The data bit is cleared to false.
Operands
Unexpected operation may occur if:
• Output tag operands are overwritten.
• Members of a structure operand are overwritten.
•
Except when specified, structure operands are shared by multiple instructions.
Ladder Diagram
Data bit BOOL tag Bit to be modified. There are
various operand addressing
modes possible for the data
bit, see Bit Addressing for
examples.
Description
When the rung condition is true, the OTU instruction clears the data bit to
false. When the rung condition is changed to false, the OTU instruction does
not change the status of the data bit.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan N/A
Rung-condition-in is true Set Rung-condition-out to Rung-condition-in
90 Publication 1756-RM003V-EN-P - November 2020
Postscan N/A
Example
Ladder Diagram
When enabled, the OTU instruction clears Light_02.
See also
Bit Instructions on page 63
Bit Addressing on page 899
Index Through Arrays on page 898
Chapter 2 Bit Instructions
Publication 1756-RM003V-EN-P - November 2020 91
TON
TOF
RTO
CTU
CTD
RES
If you want to
Use this instruction
time how long a timer is enabled
TON
time how long a timer is disabled
TOF
accumulate time
RTO
built-in reset in function block
with built-in reset in function block
function block
count up
CTU
Timer and Counter
Instructions
Chapter 3
Timer and Counter Instructions
Timers and counters control operations based on time or the number of
events.
Available Instructions
Ladder Diagram
Function Block and Structured Text
TONRTOFRRTORCTUD
time how long a timer is enabled with
time how long a timer is disabled
accumulate time with built-in reset in
count down CTD
count up and count down in function
block
reset a timer or counter RES
The time base is 1 msec for all timers. For example, a 2 second timer’s .PRE
value should be 2000.
TONR
TOFR
RTOR
CTUD
Publication 1756-RM003V-EN-P - November 2020 93
See also
Compute/Math Instructionson page 343
Chapter 3 Timer and Counter Instructions
IMPORTANT
Count Down (CTD)
Compare Instructions on page 265
Bit Instructions on page 63
ASCII String Instructions on page 833
ASCII Conversion Instructions on page 853
This information applies to the CompactLogix 5370, ControlLogix 5570,
The CTD instruction counts downward each time the rung-condition-in
transitions from false to true.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
This instruction is not available in structured text.
Operands
94 Publication 1756-RM003V-EN-P - November 2020
Unexpected operation may occur if:
• Output tag operands are overwritten.
• Members of a structure operand are overwritten.
•
Except when specified, structure operands are shared by multiple instructions.
Operand
Data Type
Format
Description
Accum
DINT
immediate
Value of Counter.ACC.
Mnemonic
Data Type
Description
executed.
operation is complete.
instruction indicates it is done.
Chapter 3 Timer and Counter Instructions
Ladder Diagram
Counter COUNTER tag Counter structure
Preset DINT immediate Value of Counter.PRE.
COUNTER Structure
.CD BOOL The countdown enable bit contains rung-
condition-in when the instruction was last
.DN BOOL The done bit when clear indicates the counting
.OV BOOL The overflow bit when set indicates the counter
incremented past the upper limit of 2,147,483,647.
.UN BOOL The underflow when set indicates the counter
decremented past the lower limit of -2,147,483,648.
.PRE DINT The preset value specifies the value which the
accumulated value must reach before the
.ACC DINT The accumulated value specifies the number of
transitions the instruction has counted.
Description
The CTD instruction is typically used with a CTU instruction that references
the same counter structure.
When rung-condition-in is set to true and .CD is false, .ACC will be
decremented by one. When rung-condition-in is false, .CD will be cleared to
false.
Publication 1756-RM003V-EN-P - November 2020 95
Chapter 3 Timer and Counter Instructions
Condition/State
Action Taken
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for arrayindexing faults.
Execution
Ladder Diagram
Prescan The .CD bit is set to true to prevent invalid decrements during the first
program scan.
Rung-condition-in is false Set Rung-condition-out to Rung-condition-in
See CTD Flow Chart (False)
Rung-condition-in is true Set Rung-condition-out to Rung-condition-in
See CTD Flow Chart (True)
Postscan N/A
96 Publication 1756-RM003V-EN-P - November 2020
CTD Flow Chart (False)
Chapter 3 Timer and Counter Instructions
Publication 1756-RM003V-EN-P - November 2020 97
Chapter 3 Timer and Counter Instructions
CTD Flow Chart (True)
98 Publication 1756-RM003V-EN-P - November 2020
Count Up (CTU)
Example
Ladder Diagram
Chapter 3 Timer and Counter Instructions
A conveyor brings parts into a buffer zone. Each time a part enters,
limit_switch_3 is enabled and counter_2 increments by 1. Each time a part
leaves, limit_switch_4 is enabled and counter_2 decrements by 1. If there are
100 parts in the buffer zone (counter_2.dn is true), conveyor_A turns on and
stops the conveyor from bringing in any more parts until the buffer has room
for more parts.
See also
Index Through Arrays on page 898
Counter Instructions on page 93
This information applies to the CompactLogix 5370, ControlLogix 5570,