Logix 5000 Advanced Process Control and Drives Instructions: Reference Manual
Logix 5000 Advanced Process Control and Drives Instructions: Reference Manual
Logix 5000 Advanced Process Control and Drives Instructions: Reference Manual
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.
IMPORTANT Identifies information that is critical for successful application and understanding of the product.
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
for Personal Protective Equipment (PPE).
Global changes
None for this release.
Bit Shift Right (BSR) Equipment Phase Override Command Motion Calculate Slave Values (MCSV)
(POVR)
Bitwise And (AND) Equipment Phase Paused (PPD) Motion Coordinated Transform with Orientation
(MCTO)
Bitwise (NOT) Equipment Sequence Assign Sequence Motion Calculate Transform Position (MCTP)
Identifier (SASI)
Bitwise (OR) Equipment Sequence Clear Failure (SCLF) Motion Calculate Transform Position with
Orientation (MCTPO)
Boolean AND (BAND) Equipment Sequence command (SCMD) Motion Change Dynamics (MCD)
Boolean Exclusive OR (BXOR) Equipment Sequence Override (SOVR) Motion Coordinated Change Dynamics (MCCD)
Boolean NOT (BNOT) Function Generator (FGEN) Motion Coordinated Circular Move (MCCM)
Boolean OR (BOR) High Pass Filter (HPF) Motion Coordinated Linear Move (MCLM)
Break (BRK) High/Low Limit (HLL) Motion Coordinated Shutdown (MCSD)
Breakpoints (BPT) HMI Button Control (HMIBC) Motion Coordinated Shutdown Reset (MCSR)
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)
Copy File (COP), Synchronous Copy File (CPS) Low Pass Filter (LPF) Motion Direct Start (MDS)
Cosine (COS) Maximum Capture (MAXC) Motion Disarm Output Cam (MDOC)
Compute (CPT) Minimum Capture (MINC) Motion Disarm Registration (MDR)
Count down (CTD) Modular Multivariable Control (MMC) Motion Disarm Watch (MDW)
Chapter 1
Process Control Instructions Process Control Instructions .................................................................... 17
Alarm (ALM) ............................................................................................... 18
Discrete 3-State Device (D3SD) ................................................................ 24
Discrete 2-State Device (D2SD)................................................................ 38
Deadtime (DEDT) ...................................................................................... 48
Function Generator (FGEN) ......................................................................54
Lead-Lag (LDLG)........................................................................................ 60
Enhanced PID (PIDE) ................................................................................65
Position Proportional (POSP)................................................................... 99
Ramp/Soak (RMPS) .................................................................................. 107
Scale (SCL) ................................................................................................ 122
Split Range Time Proportional (SRTP) ................................................... 126
Totalizer (TOT) ......................................................................................... 134
Coordinated Control (CC) ....................................................................... 143
CC Function Block Configuration ....................................................180
CC Function Block Model Initialization........................................... 181
CC Function Block Tuning ................................................................ 181
CC Function Block Tuning Errors .................................................... 182
CC Function Block Tuning Procedure .............................................. 182
Internal Model Control (IMC) ................................................................. 182
IMC Function Block Configuration ................................................. 200
IMC Function Block Model Initialization ........................................201
IMC Function Block Tuning ..............................................................201
IMC Function Block Tuning Errors ................................................. 202
IMC Function Block Tuning Procedure .......................................... 202
Modular Multivariable Control (MMC) ................................................. 203
MMC Function Block Configuration ................................................ 241
MMC Function Block Model Initialization ...................................... 243
MMC Function Block Tuning ............................................................ 243
Use an MMC Function Block for Splitter Control ...........................244
MMC Function Block Tuning Errors ................................................244
MMC Function Block Tuning Procedure .........................................244
Current SP.................................................................................................245
Use the Coordinated Control Function Block to Control ...............245
CV High/Low Limiting............................................................................. 247
Chapter 2
PlantPAx PlantPAx instructions .............................................................................. 257
Process Analog HART (PAH) ...................................................................259
Process Analog Input (PAI) ...................................................................... 274
Process Dual Sensor Analog Input (PAID) ............................................ 304
Process Multi Sensor Analog Input (PAIM) ........................................... 321
Process Analog Output (PAO) .................................................................. 344
Process Analog Output feedback processing ................................... 377
Process Boolean Logic (PBL).................................................................... 387
Process Command Source (PCMDSRC) ................................................ 403
Process Command Source operating model .................................... 413
Process Deadband Controller (PDBC) .................................................... 414
Process Discrete Input (PDI) ................................................................... 432
Process Discrete Output (PDO) .............................................................. 448
Process Dosing (PDOSE) ......................................................................... 474
Process Analog Fanout (PFO) ................................................................. 509
Process High or Low Selector (PHLS) ..................................................... 521
Process Interlocks (PINTLK) ................................................................... 531
Process Lead Lag Standby Motor Group (PLLS) ....................................542
Motor Sort Algorithm for Process Lead Lag Standby Motor Group
(PLLS) instructions ............................................................................ 572
Process Motor (PMTR) ............................................................................. 574
Process Motor (PMTR) Command Source ...................................... 609
Process Permissives (PPERM) ................................................................. 611
Process Proportional + Integral + Derivative (PPID)............................ 620
Process Pressure/Temperature Compensated Flow (PPTC) ................ 707
Process Restart Inhibit (PRI) ................................................................... 715
Process Run Time and Start Counter (PRT) ...........................................722
Chapter 3
Drives Drives Instructions ................................................................................. 823
Integrator (INTG) ................................................................................... 823
Proportional + Integral (PI) .................................................................... 830
Pulse Multiplier (PMUL) ......................................................................... 840
S-Curve (SCRV) ....................................................................................... 848
Second-Order Controller (SOC) ..............................................................856
Up/Down Accumulator (UPDN)..............................................................865
HMI Button Control (HMIBC) ............................................................... 870
Chapter 4
Filter Filter Instructions .................................................................................... 875
Derivative (DERV) ................................................................................... 875
High Pass Filter (HPF) .............................................................................879
Low Pass Filter (LPF) ............................................................................... 885
Notch Filter (NTCH)................................................................................ 890
Second-Order Lead Lag (LDL2) .............................................................. 896
Chapter 5
Select_Limit Instructions Select/Limit Instructions ....................................................................... 903
Enhanced Select (ESEL) ......................................................................... 903
High/Low Limit (HLL) ............................................................................. 912
Multiplexer (MUX) ................................................................................... 916
Rate Limiter (RLIM) ................................................................................. 919
Select (SEL) ...............................................................................................923
Selected Negate (SNEG) ......................................................................... 926
Selected Summer (SSUM) ...................................................................... 930
Chapter 6
Statistical Instructions Statistical Instructions ............................................................................ 935
Moving Average (MAVE) ......................................................................... 935
Maximum Capture (MAXC) ................................................................... 942
Minimum Capture (MINC) .....................................................................946
Moving Standard Deviation (MSTD) ......................................................949
Chapter 7
Logical and Move Logical and Move Instructions ............................................................... 955
D Flip-Flop (DFF) ..................................................................................... 955
JK Flip-Flop (JKFF) .................................................................................... 959
Reset Dominant (RESD) ......................................................................... 962
Set Dominant (SETD) .............................................................................. 965
Chapter 8
Equipment Phase Instructions Equipment Phase Instructions ...............................................................969
Attach to Equipment Phase (PATT) ....................................................... 970
Detach from Equipment Phase (PDET) .................................................. 975
Equipment Phase Clear Failure (PCLF) ..................................................978
Equipment Phase Command (PCMD)................................................... 980
Equipment Phase External Request (PXRQ) .........................................987
Equipment Phase Failure (PFL)............................................................... 997
Equipment Phase New Parameters (PRNP) ......................................... 1001
Equipment Phase Override Command (POVR) .................................. 1004
Equipment Phase Paused (PPD) .......................................................... 1008
Phase State Complete (PSC) .................................................................. 1012
Chapter 9
Equipment Sequence Equipment Sequence instructions ....................................................... 1019
Attach to Equipment Sequence (SATT) ................................................ 1019
Detach from Equipment Sequence (SDET) ......................................... 1021
Equipment Sequence Assign Sequence Identifier (SASI)................... 1023
Equipment Sequence Clear Failure (SCLF) .......................................... 1025
Equipment Sequence command (SCMD) ............................................ 1027
Equipment Sequence Diagram instructions ....................................... 1031
Equipment Sequence Override (SOVR)................................................ 1031
Guidelines for SATT instructions.......................................................... 1033
Guidelines for SCMD instructions ....................................................... 1034
Guidelines for SOVR instructions......................................................... 1035
Result codes for SATT instructions ....................................................... 1036
Result codes for SCLF instructions ....................................................... 1036
Result codes for SCMD instructions ..................................................... 1037
Result codes for SOVR instructions ...................................................... 1038
SASI instruction examples .................................................................... 1038
SATT instruction examples.................................................................... 1039
SCLF instruction examples................................................................... 1040
SCMD instruction examples ................................................................ 1040
SDET instruction examples ................................................................... 1041
SOVR instruction examples .................................................................. 1041
Chapter 10
Function Block Attributes Choose the Function Block Elements ................................................... 1043
Latching Data ......................................................................................... 1044
Function Block Responses to Overflow Conditions ............................ 1045
Order of Execution ................................................................................. 1046
Timing Modes .........................................................................................1050
Program/Operator Control.................................................................... 1052
Function Block States............................................................................. 1055
Chapter 11
Structured Text Programming Structured Text Syntax.......................................................................... 1057
Structured Text Components: Comments........................................... 1058
Structured Text Components: Assignments ........................................ 1059
Specify a non-retentive assignment .............................................. 1060
Assign an ASCII character to a string data member ..................... 1061
Structured Text Components: Expressions ......................................... 1061
Use arithmetic operators and functions ........................................ 1063
Use bitwise operators ...................................................................... 1064
Use logical operators ........................................................................ 1064
Use relational operators .................................................................. 1065
Structured Text Components: Instructions ......................................... 1066
Structured Text Components: Constructs ........................................... 1067
Character string literals .........................................................................1068
String Types ...................................................................................... 1069
CASE_OF ................................................................................................. 1069
FOR_DO .................................................................................................. 1071
IF_THEN ................................................................................................. 1074
REPEAT_UNTIL ..................................................................................... 1077
WHILE_DO ............................................................................................ 1080
Structured Text Attributes.....................................................................1082
Chapter 12
Common Attributes for Common Attributes ............................................................................... 1083
Advanced Process Control and Math Status Flags................................................................................... 1083
Immediate values ................................................................................... 1085
Drives Instructions
Data Conversions ...................................................................................1086
Elementary data types............................................................................1089
Floating Point Values ............................................................................. 1092
Index Through Arrays ............................................................................ 1094
Publication 1756-RM006L-EN-P - September 2020 13
Table of Contents
This manual is one of a set of related manuals that show common procedures
for programming and operating Logix 5000 controllers.
For a complete list of common procedures manuals, refer to the Logix 5000
Controllers Common Procedures Programming Manual, publication 1756-
PM001.
The term Logix 5000 controller refers to any controller based on the Logix
5000 operating system.
Studio 5000 environment 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.
Purpose of this manual This manual provides a programmer with details about each available
instruction for a Logix-based controller. This manual also gives you guidance
and examples to use equipment phase instructions to transition to different
state, handle faults, set up break points, and so forth.
Legal Notices 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.
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
installed location of these licenses is C:\Program Files (x86)\Common
Files\Rockwell\Help\FactoryTalk Services Platform\Release
Notes\OPENSOURCE\index.htm.
Instructions
Available Instructions
Ladder Diagram
Not available
See also
Filter Instructions on page 875
Alarm (ALM) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
ALM(ALM_tag)
Operands
Function Block
Operand Type Format Description
ALM tag ALARM structure ALM structure
Structured Text
Operand Type Format Description
ALM tag ALARM structure ALM structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
ALARM Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does not execute and
outputs are not updated.
Default is true.
In REAL The analog signal input.
Valid = any float
Default = 0.0
HHLimit REAL The high-high alarm limit for the input.
Valid = any real value
Default = maximum positive value
Description
The ALM instruction provides alarm indicators for high-high, high, low, low-
low, rate-of-change positive, and rate-of-change negative. An alarm deadband
is available for the high-high to low-low alarms. A user-defined period for
performing rate-of-change alarming is also available.
Rate-of-change Alarm
The rate-of-change (ROC) alarm compares the change of the input over the
ROCPeriod to the rate-of-change limits. The ROCPeriod provides a type of
deadband for the rate-of-change alarm. For example, define an ROC alarm
limit of 2OF/second with a period of execution of 100 ms. If you use an analog
input module with a resolution of 1OF, every time the input value changes, an
ROC alarm is generated because the instruction calculates an effective rate of
10°F/second. However, enter an ROCPeriod of 1 sec and the instruction only
generates an alarm if the rate truly exceeds the 2OF/second limit.
The ROC alarm calculates the rate-of-change as:
The instruction performs this calculation when the ROCPeriod expires. Once
the instruction calculates the ROC, it determines alarms as:
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan Rung-condition-in bits are cleared to false.
Rung-condition-in is false Rung-condition-in bits are cleared to false.
Rung-condition-in is true Rung-condition-in bits are set to true.
The instruction executes.
Postscan Rung-condition-in bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Rung-condition-in is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The ALM instruction is typically used either with analog input modules (such
as 1771 I/O modules) that do not support on-board alarming, or to generate
alarms on a calculated variable. In this example, an analog input from a 1771-
IFE module is first scaled to engineering units using the SCL instruction. The
Out of the SCL instruction is an input to the ALM instruction to determine
whether to set an alarm. The resulting alarm output parameters could then be
used in your program and/or viewed on an operator interface display.
Function Block
Structured Text
SCL_01.IN := Input0From1771IFE;
SCL(SCL_01);
ALM_01.IN := SCL_01.Out;
ALM(ALM_01);
See also
Common Attributes on page 1083
Discrete 3-State Device This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(D3SD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The D3SD instruction controls a discrete device having three possible states,
such as fast/slow/off or forward/stop/reverse.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
D3SD(D3SD_tag)
Operands
Structured Text
Operand Type Format Description
D3SD tag DISCRETE_3STATE structure D3SD structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Function Block
Operand Type Format Description
D3SD tag DISCRETE_3STATE structure D3SD structure
DISCRETE_3STATE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
Prog0Command BOOL Program state 0 command. This input
determines the device state when the
device is in Program control. If true,
the device is commanded to the 0
state.
Default is false.
Prog1Command BOOL Program state 1 command. This input
determines the device state when the
device is in Program control. If true,
the device is commanded to the 1
state.
Default is false.
Prog2Command BOOL Program state 2 command. This input
determines the device state when the
device is in Program control. If true,
the device is commanded to the 2
state.
Default is false.
Oper0Req BOOL Operator state 0 request. Set to true by
the operator interface to place the
device into the 0 state when the
device is in Operator control.
Default is false.
Oper1Req BOOL Operator state 1 request. Set true by
the operator interface to place the
device into the 1 state when the device
is in Operator control.
Default is false.
Description
The D3SD instruction controls a discrete device having three possible states,
such as fast/slow/off or forward/stop/reverse. Typical discrete devices of this
nature include feeder systems, and reversible motors.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes
Instruction first run Set ProgOper to Operator Mode.
Set Command0Status to True.
Set Command1Status to False.
Set Command2Status to False.
Instruction first scan The fault timer is cleared.
ModeAlarm is cleared to false.
All the operator request inputs are cleared to false.
If ProgValueReset is true, all the program request inputs
are cleared to false.
When OverrideOnInit is true, ProgOper is cleared to
false(Operator control).
If ProgHandReq is false and OverrideOnInit is true, Hand is
cleared to false and Override is set to true (Override mode).
If ProgHandReq is true, Hand is set to true and Override is
cleared to false(Hand mode).
Postscan EnableIn and EnableOut bits are cleared to false.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
The D3SD instruction is typically used to control 3-state devices such as
high/low/off feed systems. In this example, the D3SD instruction controls a
feed system consisting of a pair of solenoid valves adding vegetable oil to a
batch tank. One of the valves is on a large diameter feed pipe into the batch
tank, and the other valve is plumbed in parallel on a small diameter feed pipe.
When oil is first added, the D3SD instruction is commanded to the fast feed
state (state 2) where both valves are opened. When the oil added approaches
the target amount, the D3SD instruction is commanded to the slow feed state
(state 1) where the "large valve" is closed and the "small valve" is kept open.
When the target is reached, the D3SD instruction is commanded to go to the
off state (state 0) and both valves are closed. As long as the D3SD instruction is
in Program control, the valves open according to the CloseOilFeed,
SlowOilFeed, and FastOilFeed inputs. The operator can also take Operator
control of the feed system if necessary. The solenoid valves in this example
have limit switches which indicate when the valves are fully closed or opened.
These switches are wired into the FB0, FB1, FB2, and FB3 feedback inputs.
This allows the D3SD instruction to generate a FaultAlarm if the solenoid
valves do not reach their commanded states within the configured FaultTime.
Function Block
Structured Text
OilFeedController.Prog0Command := ClosedOilFeed;
OilFeedController.Prog1Command := SlowOilFeed;
OilFeedController.Prog1Command := FastOilFeed;
OilFeedController.FB0 := SmallOilValveClosed;
OilFeedController.FB1 := SmallOilValveOpened;
OilFeedController.FB2 := LargeOilValveClosed;
OilFeedController.FB3 := LargeOilValveOpened;
D3SD(OilFeedController);
SmallOilValve := OilFeedController.Out0;
LargeOilValve := OilFeedController.Out1;
When Override is set, it takes precedence over Program and Operator control.
The following table describes how the Override mode affects the commanded
state.
Override Override State Description
true 2 Command0Status is cleared to false
Command1Status is cleared to false
Command2Status is set to true
true 1 Command0Status is cleared to false
Command1Status is set to true
Command2Status is cleared to false
true 0 Command0Status is set to true
Command1Status is cleared to false
Command2Status is cleared to false
When Hand is true, it takes precedence over Program and Operator control.
The following table describes how the Hand mode affects the commanded
state.
Hand HandFB0 HandFB1 HandFB2 Description
true false false true Command0Status is cleared to false
Command1Status is cleared to false
Command2Status is set to true
true false true false Command0Status is cleared to false
Command1Status is set to true
Command2Status is cleared to false
true true false false Command0Status is set to true
Command1Status is cleared to false
Command2Status is cleared to false
If more than one HandFB input is true, the instruction sets the appropriate
bit in Status and, if Hand is true, the instruction holds the previous state.
Output State
The D3SD output state is based on the state of the command status.
See also
Common Attributes on page 1083
Discrete 2-State Device This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(D2SD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The D2SD instruction controls a discrete device which has only two possible
states (such as on/off or open/closed).
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
D2SD(D2SD_tag)
Operands
There are data conversion rules for mixed data types within an instruction.
See Data Conversion.
Structured Text
Operand Type Format Description
D2SD tag DISCRETE_2STATE Structure D2SD structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Function Block
Operand Type Format Description
D2SD tag DISCRETE_2STATE Structure D2SD structure
DISCRETE_2STATE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does not
execute and outputs are not updated.
Default is true.
Description
The D2SD instruction controls a discrete device which has only two possible
states (such as on/off or open/closed). Typical discrete devices of this nature
include motors, pumps, and solenoid valves.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run Set ProgOper to Operator Mode. Set CommandStatus to False.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
SD instruction is typically used to control on-off or open-close devices such as
pumps or solenoid valves. In this example, the D2SD instruction controls a
solenoid valve adding corn syrup to a batch tank. As long as the D2SD
instruction is in Program control, the valve opens when the AddSyrup input is
set. The operator can also take Operator control of the valve to open or close it
if necessary The solenoid valve in this example has limit switches that indicate
when the valve is fully closed or opened. These switches are wired into the FB0
and FB1 feedback inputs. This allows the D2SD instruction to generate a
FaultAlarm if the solenoid valve does not reach the commanded state within
the configured FaultTime.
Function Block
Structured Text
SyrupController.ProgCommand := AddSyrup;
SyrupController.FB0 := SyrupValveClosedLimitSwitch;
SyrupController.FB1 := SyrupValveOpenedLimitSwitch;
D2SD(SyrupController);
SyrupValve := SyrupController.Out;
Output State
The D2SD output state is based on the state of the command status.
CommandStatus Output State
false If OutReverse is false, Out is cleared to false
If OutReverse is true, Out is set to true
true If OutReverse is false, Out is set to rue
If OutReverse is true, Out is cleared to false
false and The fault timer is stopped and cleared to 0
FB0 = FB0State0 and Device0State is set to true
FB1 = FB1State0
true and The fault timer is stopped and cleared to 0
FB0 = FB0State1 and Device1State is set to true
FB1 = FB1State1
See also
Common Attributes on page 1083
Deadtime (DEDT) 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 DEDT instruction performs a delay of a single input. You select the
amount of deadtime delay.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
DEDT(DEDT_tag,storage);
Operands
Structured Text
Operand Type Format Description
DEDT tag DEADTIME structure DEDT structure
storage REAL array deadtime buffer
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Function Block
Operand Type Format Description
DEDT tag DEADTIME structure DEDT structure
storage REAL array deadtime buffer
DEADTIME Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
In REAL The analog signal input to the
instruction.
Valid = any float
Default = 0.0
InFault BOOL Bad health indicator for the input. If the
input value is read from an analog input,
then InFault is controlled by fault status
on the analog input. If true, InFault
indicates the input signal has an error,
the instruction sets the appropriate bit
in Status, the control algorithm is not
executed, and Out is held.
Default is false.
false = good health
Deadtime REAL Deadtime input to the instruction. Enter
the deadtime in seconds. If this value is
invalid, the instruction assumes a value
of zero and sets the appropriate bit in
Status.
Valid = 0.0 to (StorageArray size *
DeltaT)
Default = 0.0
Gain REAL Gain input to the instruction. The value
of In is multiplied by this value. This
allows simulation of a process gain.
Valid = any float
Default = 1.0
Bias REAL Bias input to the instruction. The value
of In multiplied by the Gain is added to
this value. This allows simulation of an
ambient condition.
Valid = any float
Default = 0.0
TimingMode DINT Selects timing execution mode.
0 = Period mode
1 = oversample mode
2 = real time sampling mode
Valid = 0 to 2
Default = 0
For more information about timing
modes, see Function Block Attributes.
OversampleDT REAL Execution time for oversample mode.
Valid = 0 to 4194.303 seconds
Default = 0
RTSTime DINT Module update period for real time
sampling mode
Valid = 1 to 32,767ms
Default = 1
Description
The DEDT instruction uses a data buffer to store delayed data, thereby
allowing any length deadtime desired. The DEDT instruction is designed to
execute in a task where the scan rate remains constant.
To use the DEDT instruction, create a storage array to store the deadtime
buffer to hold the samples of (In x Gain) + Bias. The storage array should be
large enough to hold the largest desired deadtime, using this formula:
If the Deadtime is invalid, the instruction sets an appropriate Status bit and
sets Out = (In x Gain) + Bias.
The deadtime buffer functions as a first-in, first-out buffer. Every time the
deadtime algorithm executes, the oldest value in the deadtime buffer is moved
into Out. The remaining values in the buffer shift downward and the value
((In x Gain) + Bias) is moved to the beginning of the deadtime buffer. A new
value that is placed in the deadtime buffer appears in the Out after Deadtime
seconds.
When InFault transitions from true to false, the instruction sets all values in
the deadtime buffer equal to In x Gain + Bias.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
In this example, the DEDT instruction simulates a deadtime delay in a
simulated process. The output of the PIDE instruction is passed through a
deadtime delay and a first-order lag to simulate the process. The array
DEDT_01array is a REAL array with 100 elements to support a deadtime of up
to 100 samples. For example, if this routine executes every 100 msec, the array
would support a deadtime of up to 10 seconds.
Function Block
See also
Common Attributes on page 1083
Function Generator (FGEN) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
FGEN(FGEN_tag,X1,Y1,X2,Y2);
Operands
Function Block
Operand Type Format Description
FGEN tag FUNCTION_ structure FGEN structure
GENERATOR
X1 REAL array X-axis array, table one. Combine with the Y-axis array, table
one to define the points of the first piece-wise linear curve.
Valid = any float
Y1 REAL array Y-axis array, table one. Combine with the X-axis array, table
one to define the points of the first piece-wise linear curve.
Valid = any float
X2 REAL array (optional)
X-axis array, table two. Combine with the Y-axis array, table
two to define the points of the second piece-wise linear
curve.
Valid = any float
Y2 REAL array (optional)
Y-axis array, table two. Combine with the X-axis array, table
two to define the points of the second piece-wise linear
curve.
Valid = any float
Structured Text
Operand Type Format Description
FGEN tag FUNCTION_ structure FGEN structure
GENERATOR
X1 REAL array X-axis array, table one. Combine with the Y-axis array, table
one to define the points of the first piece-wise linear curve.
Valid = any float
Y1 REAL array Y-axis array, table one. Combine with the X-axis array, table
one to define the points of the first piece-wise linear curve.
Valid = any float
X2 REAL array (optional)
X-axis array, table two. Combine with the Y-axis array, table
two to define the points of the second piece-wise linear
curve.
Valid = any float
Y2 REAL array (optional)
Y-axis array, table two. Combine with the X-axis array, table
two to define the points of the second piece-wise linear
curve.
Valid = any float
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
FUNCTION_GENERATOR Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does not
execute and outputs are not updated.
Default is true.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
XY1Size DINT Number of points in the piece-wise linear curve to
use from table one. If the value is less than one and
Select is cleared, the instruction sets the appropriate
bit in Status and the output is not changed.
Valid = 1 to (smallest of X1 and Y1 array sizes)
Default = 1
XY2Size DINT Number of points in the piece-wise linear curve to
use from table two. If the value is less than one and
Select is set, the instruction sets the appropriate bit
in Status and the output is not changed.
Valid = 0 to (smallest of X2 and Y2 array sizes)
Default = 0
Select BOOL This input determines which table to use. When
cleared, the instruction uses table one; when set, the
instruction uses table two.
Default is cleared.
Description
The following illustration shows how the FGEN instruction converts a twelve-
segment curve.
The Select input determines which table to use for the instruction. When the
instruction is executing on one table, you can modify the values in the other
table. Change the state of Select to execute with the other table.
Before calculating Out, the X axis parameters are scanned. If they are not
sorted in ascending order, the appropriate bit in Status is set and Out remains
Major/Minor Fault
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition Function Block Action
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true. The instruction
executes.
Instruction first run N/A
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are set to true. The instruction
executes.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
Example 1
In this example, the FGEN instruction characterizes a flow signal which is
then totalized using a TOT instruction. The FGEN_01X1 and FGEN_01Y1
arrays are REAL arrays of 10 elements each to support up to a 9 segment curve.
You can use arrays of any size to support a curve of any desired number of
segments.
Example 2
This example passes optional parameters to FGEN instruction.
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Lead-Lag (LDLG) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
LDLG(LDLG_tag);
Operands
Function Block
Operand Type Format Description
LDLG tag LEAD_LAG Structure LDLG structure
Structured Text
Operand Type Format Description
LDLG tag LEAD_LAG Structure LDLG structure
LEAD_LAG Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute
and outputs are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Initialize BOOL Request to initialize filter control algorithm. When
Initialize is set, Out = (In x Gain) + Bias.
Default = cleared
Lead REAL The lead time in seconds. Set Lead = 0.0 to disable the
lead control algorithm. If Lead < 0.0, the instruction sets
the appropriate bit in Status and limits Lead to 0.0. If
Lead > maximum positive float, the instruction sets the
appropriate bit in Status.
Valid = any float 0.0
Default = 0.0
Lag REAL The lag time in seconds. The minimum lag time is
DeltaT/2. If Lag < DeltaT/2, the instruction sets the
appropriate bit in Status and limits Lag to DeltaT/2. If
Lag > maximum positive float, the instruction sets the
appropriate bit in Status.
Valid = any float DeltaT/2
Default = 0.0
Gain REAL The process gain multiplier. This value allows the
simulation of a process gain. The In signal is multiplied
by this value. I = (In x Gain) + Bias
Valid = any float
Default = 1.0
Bias REAL The process offset level. This value allows the
simulation of an ambient condition. This value is
summed with the results of the multiplication of In times
Gain. I = (In x Gain) + Bias
Valid = any float
Default = 0.0
TimingMode DINT Selects timing execution mode.
0 = Periodic rate
1 = Oversample mode
2 = Real-time sampling mode
Valid = 0 to 2
Default = 0
For more information about timing modes, see Function
Block Attributes.
OversampleDT REAL Execution time for oversample mode.
Valid = 0 to 4194.303 seconds
Default = 0
Description
The LDLG instruction supports one lead and lag in series. The instruction also
allows configurable gain and bias factors. The LDLG instruction is designed to
execute in a task where the scan rate remains constant.
The LDLG instruction uses this equation:
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value and sets the Math overflow status flag.
When the value computed for the output becomes valid, the instruction
initializes the internal parameters and sets Out = (In x Gain) + Bias.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition Function Block Action
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Execute "Out = (In * Gain) + Bias".
Recalculate Lead/Lag coefficients.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The LDLG instruction in this example adds a first-order lag to a simulated
process. Optionally, you could enter a Gain on the LDLG instruction to
Function Block
Structured Text
DEDT_01.In := SimulatedLoop.CVEU;
DEDT(DEDT_01,DEDT_01_array);
LDLG_01.In := DEDT_01.Out;
LDLG(LDLG_01);
SimulatedLoop.PV := LDLG_01.Out;
PIDE(SimulatedLoop);
See also
Function Block Attributes on page 1043
Enhanced PID (PIDE) 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 PIDE instruction provides enhanced capabilities over the standard PID
instruction. The instruction uses the velocity form of the PID algorithm. The
gain terms are applied to the change in the value of error or PV, not the value
of error or PV.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
PIDE(PIDE_tag);
Operands
Function Block
Operand Type Format Description
PIDE tag PID_ENHANCED structure PIDE structure
autotune tag PIDE_AUTOTUNE structure (optional)
autotune structure
Structured Text
Operand Type Format Description
PIDE tag PID_ENHANCED structure PIDE structure
PIDE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does not execute and outputs are not
updated.
Default is true.
PV REAL Scaled process variable input. This value is typically read from an analog input
module.
Valid = any float
Default = 0.0
PVFault BOOL PV bad health indicator. If PV is read from an analog input, then PVFault is
normally controlled by the analog input fault status. When PVFault is true, it
indicates the input signal has an error.
Default is false = "good health"
PVEUMax REAL Maximum scaled value for PV. The value of PV and SP which corresponds to 100
percent span of the Process Variable.
Valid = PVEUMin < PVEUMax maximum positive float
Default = 100.0
PVEUMin REAL Minimum scaled value for PV. The value of PV and SP which corresponds to 0
percent span of the Process Variable.
Valid = maximum negative float PVEUMin < PVEUMax
Default = 0.0
SPProg REAL SP program value, scaled in PV units. SP is set to this value when in Program
control and not Cascade/Ratio mode. If the value of SPProg < SPLLimit or >
SPHLimit, the instruction sets the appropriate bit in Status and limits the value
used for SP.
Valid = SPLLimit to SPHLimit
Default = 0.0
SPOper REAL SP operator value, scaled in PV units. SP is set to this value when in Operator
control and not Cascade/Ratio mode. If the value of SPOper < SPLLimit or >
SPHLimit, the instruction sets the appropriate bit in Status and limits the value
used for SP.
Valid = SPLLimit to SPHLimit
Default = 0.0
SPCascade REAL SP Cascade value, scaled in PV units. If CascadeRatio is true and UseRatio is false,
then SP = SPCascade. This is typically the CVEU of a primary loop. If CascadeRatio
and UseRatio are true, then SP = (SPCascade x Ratio). If the value of SPCascade <
SPLLimit or > SPHLimit, set the appropriate bit in Status and limit the value used
for SP.
Valid = SPLLimit to SPHLimit
Default = 0.0
SPHLimit REAL SP high limit value, scaled in PV units. If SPHLimit > PVEUMax, the instruction sets
the appropriate bit in Status.
Valid = SPLLimit to PVEUMax
Default = 100.0
SPLLimit REAL SP low limit value, scaled in PV units. If SPLLimit < PVEUMin, the instruction sets
the appropriate bit in Status. If SPHLimit < SPLLimit, the instruction sets the
appropriate bit in Status and limits SP using the value of SPLLimit.
Valid = PVEUMin to SPHLimit
Default = 0.0
CVROCAlarm BOOL CV rate of change alarm indicator. Set to true when the calculated rate of change
for CV exceeds CVROCLimit.
SP REAL Current setpoint value. The value of SP is used to control CV when in Auto or
Cascade/ Ratio mode.
SPPercent REAL The value of SP expressed in percent of span of PV.
SPPercent = ((SP - PVEUMin) x 100) / PVSpan
PV Span calculation: PVSpan = (PVEUMax - PVEUMin)
SPHAlarm BOOL SP high alarm indicator.
Set to true when the SP > SPHLimit.
Description
The PID algorithm regulates the CV output in order to maintain the PV at the
SP when the instruction executes in Cascade/Ratio or Auto modes.
The following table describes how the instruction calculates the PID terms.
PID Term Method of Calculation
proportional The proportional term is calculated using:
• PV when PVEProportional is set or
• Error when PVEProportional is cleared
Set PGain = 0 to disable proportional control.
Computing CV
The PID control algorithm computes the value for CV by summing Delta
PTerm, Delta ITerm, Delta
DTerm, and CV from the previous execution of the instruction, for example
CVn-1. When CVsetPrevious is set,
CVn-1 is set equal to CVPrevious. This lets you preset CVn-1 to a specified value
before computing the value of CV.
CalculatedCV = CVn-1 + D PTerm + DITerm + DDTerm
PIDE Algorithms
The PIDE instruction uses a velocity form PID algorithm similar to that used
in most DCS systems. Some advantages to a velocity form algorithm include:
• Bumpless adaptive gain changes – You can change gains on the fly
without initializing the algorithm.
• Multi-loop control schemes – You can implement cross limiting
between loops by manipulating the CVn-1 term.
This form of the algorithm changes the proportional gain into a controller
gain. By changing the controller gain, you change the action of all three terms
(proportional, integral, and derivative) at the same time, where:
PIDE term: Description:
CV Control variable
E Error in percent of span
∆t Update time in seconds used by the loop
Kc Controller gain
TI Integral time constant in minutes per repeat a larger value
of T1 causes a slower integral response
It takes T1 minutes for the integral term to repeat the action
of the proportional term in response to a step change in
error.
TD Derivative time in constant in minutes
You can convert the gains used between the different PIDE algorithm forms
using these equations:
Each algorithm provides identical control with the appropriate gains. Some
people prefer the independent gains style because they can manipulate
individual gains without affecting the other terms. Others prefer the
dependent gains style because they can, at least to a certain extent, change
just the controller gain and cause an overall change in the aggressiveness of
the PID loop without changing each gain separately.
The PIDE autotuner is installed with the application, but you need an
activation key to enable it. The autotuner is only supported in function block
programming; it is not available in ladder diagram or structured text
programming.
Use the Autotune tab to specify and configure the autotune tag for a PIDE
block.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan If CVFault and CVEUSpanlnv are set,see Processing Faults later in this
instruction.
If CVFault and CVEUSpanlnv are cleared:
1. CVInitializing is set
2. If PVFault is set, PVSpanlnv and SPlimitsInv are cleared. See Processing
Faults in this instruction.
3. The PID control algorithm is not executed.
4. The instruction sets CVEU = CVInitValue and CV = corresponding
percentage.
5. When CVInitializing and Manual AfterInit are set, the instructions
misables auto and cascade/ratio modes. If the current mode is not
Override or Hand mode, the instruction changes to manual ode.If
ManualAfterInit is cleared, the mode is not changed.
CVEu = CVInitValue
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
The CVInitValue normally comes from the analog output’s readback value.
The CVInitReq value normally comes from the "In Hold" status bit on the
analog output controlled by CVEU. The initialization procedure is performed
to avoid a bump at startup in the output signal being sent to the field device.
When using cascaded PID loops, the primary PID loop can be initialized when
the secondary loop is initialized or when the secondary loop leaves the
Cascade/Ratio mode. In this case, move the state of the InitPrimary output
and SP output from the secondary loop to the CVInitReq input and
CVInitValue input on the primary loop.
The instruction does not initialize and the CVEU and CV values are not
updated if CVFault or CVEUSpanInv is set.
Examples
Example 1
The easiest way to implement a PIDE instruction is to create a function block
routine in a program in a periodic task. The default timing mode for the PIDE
instruction is periodic. When the PIDE instruction is used in a periodic task
and in periodic timing mode, it automatically uses the periodic task's update
rate as its delta t update time. All you need to do is wire the process variable
analog input into the PV parameter on the PIDE instruction and wire the
CVEU out of the PIDE instruction into the controlled variable analog output.
Optionally, you can wire the analog input’s fault indicator (if one is available)
into the PVFault parameter on the PIDE instruction. This forces the PIDE into
Manual mode when the analog input is faulted and stops the PIDE CVEU
output from winding up or down when the PV signal is not available.
Function Block
Structured Text
PIDE_01.PV := Local:1:I.Ch0Data;
PIDE_01.PVFault := Local:1:I.Ch0Fault;
PIDE(PIDE_01);
Local:2:)O.Ch0Data :=PIDE_01.CVEU;
Example 2
Cascade control is useful when externally-caused upsets to the controlled
variable occur often, which then cause upsets to the process variable you are
trying to control. For example, try to control the temperature of liquid in a
tank by varying the amount of steam fed into a heating jacket around the
tank. If the steam flow suddenly drops because of an upstream process, the
temperature of the liquid in the tank eventually drops and the PIDE
In this example, a cascaded loop provides better control by opening the steam
valve when the steam flow drops before the liquid temperature in the tank
drops. To implement a cascaded loop, use a PIDE instruction to control the
steam valve opening based on a process variable signal from a steam flow
transmitter. This is the secondary loop of the cascaded pair. A second PIDE
instruction (called the primary loop) uses the liquid temperature as a process
variable and sends its CV output into the setpoint of the secondary loop. In
this manner, the primary temperature loop asks for a certain amount of steam
flow from the secondary steam flow loop. The steam flow loop is then
responsible for providing the amount of steam requested by the temperature
loop in order to maintain a constant liquid temperature.
Function Block
Structured Text
PrimaryLoop.PV := Local:1:I.CH0Data;
PrimaryLoop.CVInitReq := SecondaryLoop.InitPrimary;
PIDE(PrimaryLoop);
SecondaryLoop.PV := Local:1:I.Ch1Data;
SecondaryLoop.SPCascade := PrimaryLoop.CVEU;
PIDE(SecondaryLoop);
Local:2:O.Ch0Data:= SecondaryLoop.CVEU;
For a cascaded pair of loops to work correctly, the secondary loop must have a
faster process response than the primary loop. This is because the secondary
loop’s process must be able to compensate for any upsets before these upsets
affect the primary loop’s process. In this example, if steam flow drops, the
steam flow must be able to increase as a result of the secondary controller’s
action before the liquid temperature is affected.
Example 3
Ratio control is typically used to add a fluid in a set proportion to another
fluid. For example, if you want to add two reactants (say A and B) to a tank in a
constant ratio, and the flow rate of reactant A may change over time because
of some upstream process upsets, you can use a ratio controller to
To perform ratio control with a PIDE instruction, set the AllowCasRat and
UseRatio input parameters. Wire the uncontrolled flow into the SPCascade
input parameter. When in Cascade/Ratio mode, the uncontrolled flow is
multiplied by either the RatioOper (when in Operator control) or the RatioProg
(when in Program control) and the resulting value is used by the PIDE
instruction as the setpoint.
Function Block
Structured Text
PIDE_01.PV := ControlledFlow;
PIDE_01.SPCascade := UncontrolledFlow;
PIDE(PIDE_01);
Local:2:O.Ch0Data := PIDE_01.CVEU;
The following diagram shows how the PIDE instruction changes between
Program control and Operator control.
Operating Modes
The PIDE instruction supports the following PID modes.
PID Operating Mode Description
Cascade/Ratio While in Cascade/Ratio mode the instruction computes the change in CV. The instruction regulates CV to
maintain PV at either the SPCascade value or the SPCascade value multiplied by the Ratio value. SPCascade
comes from either the CVEU of a primary PID loop for cascade control or from the "uncontrolled" flow of a
ratio-controlled loop.
Select Cascade/Ratio mode using either OperCasRatReq or ProgCasRatReq:
Set OperCasRatReq to request Cascade/Ratio mode. Ignored when ProgOper, ProgOverrideReq, ProgHandReq,
OperAutoReq, or OperManualReq is set, or when AllowCasRat is cleared.
Set ProgCasRatReq to request Cascade/Ratio mode. Ignored when ProgOper or AllowCasRat is cleared or when
ProgOverrideReq, ProgHandReq, ProgAutoReq, or ProgManualReq is set.
Auto While in Auto mode the instruction computes the change in CV. The instruction regulates CV to maintain PV at
the SP value. If in program control, SP = SPProg; if in Operator control, SP = SPOper.
Select Auto mode using either OperAutoReq or ProgAutoReq:
Set OperAutoReq to request Auto mode. Ignored when ProgOper, ProgOverrideReq, ProgHandReq, or
OperManualReq is set.
Set ProgAutoReq to request Auto mode. Ignored when ProgOper is cleared or when ProgOverrideReq,
ProgHandReq, or ProgManualReq is set.
Manual While in Manual mode the instruction does not compute the change in CV. The value of CV is determined by
the control. If in Program control, CV = CVProg; if in Operator control, CV = CVOper.
Select Manual mode using either OperManualReq or ProgManualReq:
Set OperManualReq to request Manual mode. Ignored when ProgOper, ProgOverrideReq, or ProgHandReq is set.
Set ProgManualReq to request Manual mode. Ignored when ProgOper is cleared or when ProgOverrideReq or
ProgHandReq is set.
Cascade/Ratio SP
The cascade/ratio SP is based on the UseRatio and ProgOper values.
Current SP
The current SP is based on the Cascade/Ratio mode, the PVTracking value,
auto mode, and the ProgOper value.
SP High/Low Limiting
The high-to-low alarming algorithm compares SP to the SPHLimit and
SPLLimit alarm limits. SPHLimit cannot be greater than PVEUMax and
SPLLimit cannot be less than PVEUMin.
PV High/Low Alarming
The high-high to low-low alarming algorithm compares PV to the PV alarm
limits and the PV alarm limits plus or minus the PV alarm deadband
(1) During instruction first scan, the instruction clears all the PV alarm
outputs. The instruction also clears the PV alarm outputs and disables the
alarming algorithm when PVFaulted is set.
PV Rate-of-Change Alarming
PV rate-of-change (ROC) alarming compares the change in the value of PV
over the PVROCPeriod against the PV positive and negative rate-of-change
limits. The PVROCPeriod provides a type of deadband for the rate-of-change
alarm. For example, if you use a ROC alarm limit of 2°F/second with a period
of execution of 100 ms, and an analog input module with a resolution of 1°F,
then every time the input value changes, a ROC alarm is generated because
the instruction sees a rate of 10°F/second. However, by entering a
PVROCPeriod of at least 1 sec, the ROC alarm is only generated if the rate truly
exceeds the 2°F/second limit.
The ROC calculation is only performed when the PVROCPeriod has expired.
The rate-of-change is calculated as:
PVROCN-1 PVROCN-1 = PV
ElapsedROCPeriod ElapsedROCPeriod = 0
(1) During instruction first scan, the instruction clears the PV ROC alarm
outputs. The instruction also clears the PVROC alarm outputs and disables the
PV ROC alarming algorithm when PVFaulted is set.
(1) PVPIDPercent and Deviation are internal parameters used by the PID
control algorithm.
(1) During instruction first scan, the instruction clears the deviation alarm
outputs. The instruction also clears the deviation alarm outputs and disables
the alarming algorithm when PVFaulted or PVSpanInv is set.
The instruction disables the zero crossing algorithm and clears ZCDeadband
under these conditions:
• during instruction first scan
• ZCDeadband ≤ 0
• Auto or Cascade/Ratio is not the current mode
• PVFaulted is set
• PVSpanInv is set
Feedforward Control
Compute CV by summing CV from the zero crossing algorithm with ∆FF. The
value of ∆FF = FF – FFn-1. When FFSetPrevious is set, FFn-1=FFPrevious. This
lets you preset FFn-1 to a specified value before the instruction calculates the
value of ∆FF.
CV Windup Limiting
Limit the CV such that its value cannot increase when WindupHIn is set or
decrease when WindupLIn is set. These inputs are typically the WindupHOut
or WindupLOut outputs from a secondary loop. The WindupHIn and
WindupLIn inputs are ignored if CVInitializing, CVFault, or CVEUSpanInv is
set.
CV Percent Limiting
The following diagram illustrates how the instruction determines CV percent
limiting.
CV High/Low Limiting
The instruction always performs alarming based on CVHLimit and CVLLimit.
Limit CV by CVHLimit and CVLLimit when in auto or cascade/ratio mode.
When in manual mode, limit CV by CVHLimit and CVLLimit when
CVManLimiting is set. Otherwise limit CV by 0 and 100 percent.
(1) During instruction first scan, the instruction clears the alarm outputs.
CV Rate-of-Change Limiting
The PIDE instruction limits the rate-of-change of CV when in Auto or
Cascade/Ratio mode or when in Manual mode and CVManLimiting is set. A
value of zero disables CV rate-of-change limiting.
The CV rate-of-change is calculated as:
(1) During instruction first scan, the instruction clears the alarm output. The
instruction also clears the alarm output and disables the CV rate-of-change
algorithm when CVInitializing is set.
(4) During instruction first scan, the instruction clears the windup outputs.
The instruction also clears the windup outputs and disables the CV windup
algorithm when CVInitializing is set or if either CVFaulted or CVEUSpanInv
is set.
The SP and CV limits operate independently. A SP high limit does not prevent
CV from increasing in value. Likewise, a CV high or low limit does not prevent
SP from increasing in value.
(6) The instruction clears WindupHOut when SPHAlarm is cleared, and not
(ControlAction is cleared and CVHAlarm is set), and not (ControlAction is set
and CVLAlarm is set).
The SP and CV limits operate independently. A SP low limit does not prevent
CV from increasing in value. likewise a CV low or high limit does not prevent
SP from increasing in value.
(8) The instruction clears WindupLOut when SPLAlarm is cleared and not
(ControlAction is cleared and CVLAlarm is set) and not (ControlAction is set
and CVHAlarm is set).
Processing Faults
The following table describes how the instruction handles execution faults:
Fault Condition Action
CVFaulted is true or Instruction is not initialized, CVInitializing is cleared to false
CVEUSpanInv is true Compute PV and SP percent, calculate error, update internal parameters for EPercent and
PVPIDPercent
PID control algorithm is not executed
Disable the Auto and Cascade/Ratio modes. If Override or Hand is not the current mode, set to
Manual mode.
Set CV to value determined by Program or Operator control and mode (Manual, Override, or
Hand).
PVFaulted is true Disable the Auto and Cascade/Ratio modes. If Override or Hand is not the current mode, set to
Manual mode
PV high-low, PV rate-of-change, and deviation high-low alarm outputs are cleared to false
PID control algorithm is not executed
Set CV to value by determined by Program or Operator control and mode (Manual, Override, or
Hand).
PVSpanInv is true or Disable the Auto and Cascade/Ratio modes. If Override or Hand is not the current mode, set to
SPLimitsInv is true Manual mode
Do not compute PV and SP percent
PID control algorithm is not executed
Set CV to value by determined by Program or Operator control and mode (Manual, Override, or
Hand).
RatioLimitsInv is true and If not already in Hand or Override, set to Manual model
CasRat is true and Disable the Cascade/Ratio mode
UseRatio is true Set CV to value determined by Program or Operator control and mode (Manual, Override, or
Hand).
TimingModeInv is true or If not already in Hand or Override, set to Manual mode
RTSTimeStampInv is true or
DeltaTInv is true
See also
Function Block Attributes on page 1043
Position Proportional This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(POSP) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
POSP(POSP_tag)
Operands
Function Block
Operand Type Format Description
POSP tag POSITION_PROP Structure POSP structure
Structured Text
Operand Type Format Description
block tag POSITION_PROP Structure POSP structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
POSITION_PROP Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does not
execute and outputs are not updated.
Default is true.
Description
The POSP instruction usually receives the desired position setpoint from a
PID instruction output.
If any of the following conditions exist, OpenOut is not pulsed and OpenTime
= 0.
OpenFB is true or PositionPercent 100
CycleTime = 0
OpenRate = 0
SPPercent is invalid
The CloseOut is pulsed whenever SP < Position feedback. When this occurs,
the instruction sets OpenTime = 0 and the duration for which CloseOut is to
be turned on is calculated as:
CloseRate = 0
SPPercent is invalid
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to
false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to
false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan OpenTime and CloseTime are cleared to 0.0.
Postscan EnableIn and EnableOut bits are cleared to
false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function
Block table.
Postscan See Postscan in the Function Block table.
Examples
Example 1
In this example, the POSP instruction opens or closes a motor-operated valve
based on the CVEU output of the PIDE instruction. The actual valve position
is wired into the Position input and optional limit switches, which show if the
valve is fully opened or closed, are wired into the OpenedFB and ClosedFB
inputs. The OpenOut and CloseOut outputs are wired to the open and close
contacts on the motor-operated valve.
Function Block
Structured Text
FlowController.PV := WaterFlowRate;
PIDE(FlowController);
FlowValve.SP := FlowController.CVEU;
FlowValve.Position := FlowValvePosition;
FlowValve.OpenedFB := FlowValveOpened;
FlowValve.ClosedFB := FlowValveClosed;
POSP(FlowValve);
OpenFlowValveContact := FlowValve.OpenOut;
CloseFlowValveContact := FlowValve.CloseOut;
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Ramp/Soak (RMPS) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
RMPS(RMPS_tag,RampValue,SoakValue,SoakTime);
Operands
Function Block
Operand Type Format Description
RMPS tag RAMP_SOAK structure RMPS structure
RampValue REAL array Ramp Value array. Enter a ramp value
for each segment (0 to NumberOfSegs-
1). Ramp values are entered as time in
minutes or as a rate in units/minute.
The TimeRate parameter reflects which
method is used to specify the ramp. If a
ramp value is invalid, the instruction
sets the appropriate bit in Status and
changes to Operator Manual or Program
Hold mode. The array must be at least
as large as NumberOfSegs.
Valid = 0.0 to maximum positive float
Structured Text
Operand Type Format Description
RMPS tag RAMP_SOAK structure RMPS structure
RampValue REAL array Ramp Value array. Enter a ramp value
for each segment (0 to NumberOfSegs-
1). Ramp values are entered as time in
minutes or as a rate in units/minute.
The TimeRate parameter reflects which
method is used to specify the ramp. If a
ramp value is invalid, the instruction
sets the appropriate bit in Status and
changes to Operator Manual or Program
Hold mode. The array must be at least
as large as NumberOfSegs.
Valid = 0.0 to maximum positive float
SoakValue REAL array Soak Value array. Enter a soak value for
each segment (0 to NumberOfSegs-1).
The array must be at least as large as
NumberOfSegs.
Valid = any float
SoakTime REAL array Soak Time array. Enter a soak time for
each segment (0 to NumberOfSegs-1).
Soak times are entered in minutes. If a
soak value is invalid, the instruction
sets the appropriate bit in Status and
changes to Operator Manual or Program
Hold mode. The array must be at least
as large as NumberOfSegs.
Valid = 0.0 to maximum positive float
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
RMPS Structure
Specify a unique RMPS structure for each instruction.
Default is cleared.
RampDeadband REAL Guaranteed ramp deadband. Specify the amount in
engineering units that PV is allowed to differ from the output
when GuarRamp is on. If this value is invalid, the instruction
sets RampDeadband = 0.0 and the instruction sets the
appropriate bit in Status.
Valid = any float 0.0
Default = 0.0
GuarSoak BOOL Guaranteed soak. If true and the instruction is in auto, the
soak timer is cleared if the PV differs from the Output by
more than SoakDeadband.
Default is false.
Description
The RMPS instruction is typically used to provide a temperature profile in a
batch heating process. The output of this instruction is typically the input to
the setpoint of a PID loop.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
The following table shows the ending control based on the Manual, Auto, and
Hold mode requests.
Control at Oper Oper Prog Prog Prog Man Prog First Control at End
Start of Auto Man Auto Man Hold Hold Value Run of First Scan
First Scan Req Req Req Req Req AftInit Reset
Example
In this example, the RMPS instruction drives the setpoint of a PIDE
instruction. When the PIDE instruction is in Cascade/Ratio mode, the output
of the RMPS instruction is used as the setpoint. The PV to the PIDE
instruction can be optionally fed into the PV input of the RMPS instruction if
you want to use guaranteed ramping and/or guaranteed soaking.
Function Block
(1) You can lock the instruction in Operator control by leaving ProgOperReq to
true.
(2) You can lock the instruction in Program control by leaving ProgProgReq to
true while ProgOperReq is false.
If the instruction was in Program Manual or Program Hold mode, then the
transition is to Operator Manual mode.
Program Control
The following diagram shows how the RMPS instruction operates when in
Program control.
(1) In single (non-cyclic) execution, you must toggle ProgAutoReq from false
to true if one execution of the ramp/soak profile is complete and you want
another execution of the ramp/soak profile.
(2) When the instruction is configured for single execution, and the Auto
mode Ramp-Soak profile completes, the instruction transitions to Hold mode.
(3) The instruction is placed in Hold mode if PVFaulted is true or any of the
following inputs are invalid: NumberOfSegs, CurrentSegProg, or
SoakTimeProg.
The following table describes the possible Program modes.
Mode Description
Program Auto Mode While in Auto mode, the instruction sequentially executes the ramp/ soak profile.
Program Manual Mode While in Manual mode the user program directly controls the instruction’s Out. The CurrentSegProg,
SoakTimeProg, and OutProg inputs are transferred to the CurrentSeg, SoakTimeLeft, and Out outputs.
When the instruction is placed in auto mode, the ramp/soak function resumes with the values last input
from the user program. CurrentSegProg and SoakTimeProg are not transferred if they are invalid.
To facilitate a "bumpless" transition into Manual mode, the CurrentSegProg, SoakTimeProg, and OutProg
inputs are continuously updated to the current values of CurrentSeg, SoakTimeLeft, and Out when
ProgValueReset is set and the instruction is not in Program Manual mode.
Program Hold Mode While in Hold mode, the instruction’s outputs are maintained at their current values. If in this mode when
ProgOperReq is set to change to Operator control, the instruction changes to Operator Manual mode.
Operator Control
The following diagram shows how the RMPS instruction operates when in
Operator control.
(1) When the instruction is configured for Single Execution, and the Auto
mode ramp/soak profile completes, the instruction transitions to manual
mode.
(2) The instruction is placed in Manual mode if PVFaulted is true or any of the
following inputs are invalid: NumberOfSegs, CurrentSegOper, or
SoakTimeOper.
The following table describes the possible Operator modes.
Mode Description
Operator Auto Mode While in Auto mode, the instruction sequentially executes the ramp/ soak profile.
Operator Manual Mode While in Manual mode the operator directly controls the instruction’s Out. The CurrentSegOper,
SoakTimeOper, and OutOper inputs are transferred to the CurrentSeg, SoakTimeLeft, and Out outputs.
When the instruction is placed in Auto mode, the ramp/soak function resumes with the values last input
from the operator. CurrentSegOper and SoakTimeOper are not transferred if they are invalid.
To facilitate a "bumpless" transition into Manual mode, the CurrentSegOper, SoakTimeOper, and OutOper
inputs are continuously updated to the current values of CurrentSeg, SoakTimeLeft, and Out whenever the
instruction is not in Operator Manual mode.
(1) The Ramp is complete when Out = SoakValue. If, during ramp execution,
Out > SoakValue, Out is limited to SoakValue.
(2) Soaking is complete when Out is held for the amount of time specified in
the current segment’s SoakTime. If the segment executed was not the last
segment, CurrentSeg increments by one.
(3) Soaking has completed for the last programmed segment and the
instruction is configured for cyclic execution. The instruction sets CurrentSeg
= 0.
(4) Soaking has completed for the last programmed segment and the
instruction is configured for single execution.
Ramping
The ramp cycle ramps Out from the previous segment’s SoakValue to the
current segment’s SoakValue. The time in which the ramp is traversed is
defined by the RampValue parameters.
Ramping is negative if Out > the target SoakValue of the current segment. If
the ramp equation calculates a new Out which is less than the target
SoakValue, the Out is set to the target SoakValue.
Each segment has a ramp value. You have the option of programming the
ramp in units of time or rate. All segments must be programmed in the same
units. The following table describes the ramping options:
Parameter Description
Time-based ramping TimeRate is set to true for time-based ramping (in minutes)
The rate of change for the current segment is calculated and either added or subtracted to Out until Out reaches
the current segment’s soak value. In the following equation, DeltaT is the elapsed time in minutes since the
instruction last executed.
Where RampStart is the value of Out at the start of the Current Segment.
Rate-based ramping TimeRate is cleared to false for rate-based ramping (in units/minute)
The programmed rate of change is either added or subtracted to Out until Out reaches the current segment’s soak
value. In the following equation, DeltaT is the elapsed time in minutes since the instruction last executed.
Guaranteed Ramping
Set the input GuarRamp to true to enable guaranteed ramping. When
enabled, the instruction monitors the difference between Out and PV. If the
difference is outside of the programmed RampDeadband, the output is left
unchanged until the difference between PV and Out are within the deadband.
The output GuarRampOn is set to true whenever Out is held due to
guaranteed ramping being in effect.
Soaking
Soaking is the amount of time the block output is to remain unchanged until
the next ramp-soak segment is started. The soak cycle holds the output at the
SoakValue for a programmed amount of time before proceeding to the next
segment. The amount of time the output is to soak is programmed in the
SoakTime parameters.
Each segment has a SoakValue and SoakTime. Soaking begins when Out is
ramped to the current segment’s SoakValue. SoakTimeLeft represents the
time in minutes remaining for the output to soak. During ramping,
SoakTimeLeft is set to the current segment’s SoakTime. Once ramping is
Guaranteed Soaking
Set the input GuarSoak to true to enable guaranteed soaking. When enabled,
the instruction monitors the difference between Out and PV. If the difference
is outside of the SoakDeadband, timing of the soak cycle is suspended and the
internal soak timer is cleared. When the difference between Out and PV
returns to within the deadband, timing resumes. The output GuarSoakOn is
set to true when timing is held due to guaranteed soaking being in effect.
See also
Common Attributes on page 1083
Scale (SCL) 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 SCL instruction converts an unscaled input value to a floating point value
in engineering units.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
SCL(SCL_tag)
Operands
Function Block
Operand Type Format Description
SCL tag SCALE Structure SCL structure
Structured Text
Operand Type Format Description
SCL tag SCALE Structure SCL structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
SCALE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does
not execute and outputs are not updated.
Default is true.
In REAL The analog signal input.
Valid = any float
Default = 0.0
InRawMax REAL The maximum value attainable by the input
to the instruction. If InRawMax
InRawMin, the instruction sets the
appropriate bit in Status and stops updating
the output.
Valid = InRawMax > InRawMin
Default = 0.0
InRawMin REAL The minimum value attainable by the input
to the instruction. If InRawMin InRawMax,
the instruction sets the appropriate bit in
Status and stops updating the output.
Valid = InRawMin < InRawMax
Default = 0.0
InEUMax REAL The scaled value of the input corresponding
to InRawMax.
Valid = any real value
Default = 0.0
InEUMin REAL The scaled value of the input corresponding
to InRawMin.
Valid = any real value
Default = 0.0
Description
Use the SCL instruction with analog input modules that do not support
scaling to a full resolution floating point value.
For example, the 1771-IFE module is a 12-bit analog input module that
supports scaling only in integer values. If you use a 1771-IFE module to read a
flow of 0-100 gallons per minute (gpm), you typically do not scale the module
from 0-100 because that limits the resolution of the module. Instead, use the
SCL instruction and configure the module to return an unscaled (0-4095)
value, which the SCL instruction converts to 0-100 gpm (floating point)
without a loss of resolution. This scaled value could then be used as an input
to other instructions.
The SCL instruction uses this algorithm to convert unscaled input into a
scaled value:
Alarming
Once the instruction calculates Out, the MaxAlarm and MinAlarm are
determined as follows:
Limiting
Limiting is performed on Out when Limiting is set. The instruction sets Out =
InEUMax when In > InRawMax. The instruction sets Out = InEUMin when In
< InRawMin.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true
The instruction executes.
Instruction first run N/A
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The SCL instruction is typically used with analog input modules that do not
support on-board scaling to floating point engineering units. In this example,
the SCL instruction scales an analog input from a 1771-IFE module. The
instruction places the result in Out, which is used by an ALM instruction.
Function Block
Structured Text
SCL_01.In := Input0From1771IFE;
SCL(SCL_01);
ALM_01.In := SCL_01.Out;
ALM(ALM_01);
See also
Common Attributes on page 1083
Split Range Time This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
Proportional (SRTP)
126 Publication 1756-RM006L-EN-P - September 2020
Chapter 1 Process Control Instructions
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The SRTP instruction takes the 0-100% output of a PID loop and drives
heating and cooling digital output contacts with a periodic pulse. This
instruction controls applications such as barrel temperature control on
extrusion machines.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
SRTP(SRTP_tag)
Operands
Function Block
Operand Type Format Description
SRTP tag SPLIT_RANGE Structure SRTP structure
Structured Text
Operand Type Format Description
SRTP tag SPLIT_RANGE Structure SRTP structure
SPLIT_RANGE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does
not execute and outputs are not updated.
Default is true.
In REAL The analog signal input asking for heating or
cooling. This input typically comes from the
CVEU of a PID loop.
Valid = any float
CycleTime REAL The period of the output pulses in seconds. A
value of zero turns off both heat and cool
outputs. If this value is invalid, the
instruction assumes a value of zero and sets
the appropriate bit in Status.
Valid = any positive float
Default = 0.0
MaxHeatIn REAL Maximum heat input. This value specifies the
percentage of the In which will cause
maximum heating. This is typically 100% for
a heat/cool loop.
Valid = any float
Default = 100.0
MinHeatIn REAL Minimum heat input. Specify the percent of
In that represents the start of the heating
range and causes minimum heating. This is
typically 50% for a heat/cool loop.
Valid = any float
Default = 50.0
MaxCoolIn REAL Maximum cool input. Specify the percent of
In that causes maximum cooling. This is
typically 0% for a heat/cool loop.
Valid = any float
Default = 0.0
MinCoolIn REAL Minimum cool input. Specify the percent of
In that causes minimum cooling. This is
typically 50% for a heat/cool loop.
Valid = any float
Default = 50.0
MaxHeatTime REAL Maximum heat time in seconds. Specify the
maximum time in seconds that a heating
pulse can be on. If the instruction calculates
HeatTime to be greater than this value,
HeatTime is limited to MaxHeatTime. If
MaxHeatTime is invalid, the instruction
assumes a value of CycleTime and sets the
appropriate bit in Status.
Valid = 0.0 to CycleTime
Default = CycleTime
Description
The length of the SRTP pulse is proportional to the PID output. The
instruction parameters accommodate heating and cooling applications.
You can change CycleTime at any time. If CycleTime = 0, the internal timer is
cleared and HeatOut and CoolOut are cleared to false.
HeatTime is the amount of time within CycleTime that the heat output is to be
turned on.
The instruction controls heat and cool outputs using these rules:
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Example
In this example, a PIDE instruction executes in a slow, lower priority task
because it is a slow, temperature loop. The output of the PIDE instruction is a
controller-scoped tag because it becomes the input to an SRTP instruction.
The SRTP instruction executes in a faster, higher priority task so that the
pulse outputs are more accurate
Function Block
Place the PIDE instruction in a slow, lower priority task
Structured Text
Place the PIDE instruction in a slow, lower priority task.
BarrelTempLoop.PV := BarrelTemp;
PIDE(BarrelTempLoop);
LoopOutput := BarrelTempLoop.CVEU;
SRTP(SRTP_02);
ResistiveHeater := SRTP_02.HeatOut;
CoolingSolenoid := SRTP_02.CoolOut;
See also
Common Attributes on page 1083
Totalizer (TOT) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
TOT(TOT_tag)
Operands
Function Block
Operand Type Format Description
TOT tag TOTALIZER Structure TOT structure
Structured Text
Operand Type Format Description
TOT tag TOTALIZER Structure TOT structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
TOTALIZER Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does
not execute and outputs are not updated.
Default is true.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
InFault BOOL Bad health indicator of In. If true, it
indicates the input signal has an error, the
instruction sets the appropriate bit in
Status, the control algorithm is not
executed, and Total is not updated.
Default is false.
TimeBase DINT The timebase input. The time base of the
totalization based on the In engineering
units.
0 = Seconds
1 = Minutes
2 = Hours
3 = Days
For example, use TimeBase = minutes if In
has units of gal/min. If this value is invalid,
the instruction sets the appropriate bit in
Status and does not update the Total.
For more information about timing modes,
see Function Block Attributes.
Valid = 0 to 3
Default = 0
Description
This instruction typically totals the amount of a material added over time,
based on a flow signal.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Operating Modes
The following diagram shows how the TOT instruction changes between
Program control and Operator control.
• OldTotal = Total
• Total = ResetValue
Example
In this example, the TOT instruction meters a target quantity of water into a
tank and shuts off the flow once the proper amount of water has been added.
When the AddWater pushbutton is pressed, the TOT instruction resets and
starts totalizing the amount of water flowing into the tank. Once the Target
value is reached, the TOT instruction sets the TargetFlag output, which causes
the solenoid valve to close. For this example, the TOT instruction was "locked"
into Program Run by setting the ProgProgReq and ProgStartReq inputs. This
is done for this example because the operator never needs to directly control
the TOT instruction.
Function Block
Structured Text
TotalWaterFlow.In := WaterFlowRate;
TotalWaterFlow.ProgProgReq := 1;
TotalWaterFlow.ProgStartReq := 1;
TotalWaterFlow.ProgResetReq := AddWater;
TOT(TotalWaterFlow);
RESD_01.Set := AddWater;
RESD_01.Reset := TotalWaterFlow.TargetFlag;
RESD(RESD_01);
WaterSolenoidValve := RESD_01.Out;
See also
Function Block Attributes on page 1043
Common Attributes on page 1083
Coordinated Control (CC) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
CC(CC_tag);
Operands
Structured Text
Operands Type Format Description
CC tag COORDINATED_ CONTROL structure CC Structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
IMPORTANT Whenever an APC block detects a change in Delta Time (DeltaT), a ModelInit will be
performed. For this reason the blocks should only be run in one of the TimingModes in
which DeltaT will be constant.
Function Block
Operands Type Format Description
CC tag COORDINATED CONTROL structure CC Structure
Structure
Input Parameters Data Type Description Valid and Default Values
EnableIn BOOL Enable Input. If False, the Default=TRUE
function block will not execute
and outputs are not updated.
PV REAL Scaled process variable input. Valid = any float
This value is typically read from Default = 0.0
an analog input module.
PVFault BOOL PV bad health indicator. If PV is FALSE = Good Health
read from an analog input, then Default = FALSE
PVFault will normally be
controlled by the analog input
fault status.
If PVFault is TRUE, it indicates an
error on the input module, set bit
in Status.
PVUEMax REAL Maximum scaled value for PV. Valid = PVEUMin < PVEUMax ≤
The value of PV and SP that maximum positive float
corresponds to 100% span of the Default = 100.0
Process Variable.
If PVEUMax ≤ PVEUMin, set bit in
Status.
PVUEMin REAL Minimum scaled value for PV. Valid = maximum negative float
The value of PV and SP that ≤ PVEUMin < PVEUMax
corresponds to 0% span of the Default = 0.0
Process Variable.
If PVEUMax ≤ PVEUMin, set bit in
Status.
SPProg REAL SP Program value, scaled in PV Valid = SPLLimit to SPHLimit
units. SP is set to this value Default = 0.0
when the instruction is in
Program control.
SPOper REAL SP Operator value, scaled in PV Valid = SPLLimit to SPHLimit
units. SP set to this value when Default = 0.0
in Operator control.
If value of SPProg or SPOper <
SPLLimit or > SPHLimit, set bit in
Status and limit value used for
SP.
Description
Coordinated Control is a flexible model-based algorithm that can be used in
various configurations, for example:
In this example, CV1 is in Manual mode, CV2 is driven to its target value, and
CV3 is the active control. The following table describes this example in detail.
Name Description
CV1 Is in Manual mode
CV2 Is driven to its target value (CV2 = Target1stCV)
CV3 Is the active control (CV3 = Act1stCV)
This example could be a heat cooled system with a feed forward where:
If the operator changes the CV1 manual value, the control variable will take
the change into account when calculating new CV3 and CV2.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A.
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
Function Block
Structured Text
ccTag.PV := ccInput1;
ccTag.SPProg := ccInput2;
ccTag.CV1Prog := ccInput3;
ccTag.CV2Prog := ccInput4;
ccTag.CV3Prog := ccInput5;
CC(ccTag);
ccOutput1 := ccTag.CV1EU;
ccOutput2 := ccTag.CV2EU;
ccOutput3 := ccTag.CV3EU;
See also
Common Attributes on page 1083
CC Function Block Starting with the default configuration, configure the following parameters:
Configuration Parameter
PVEUMax
Description
Maximum scaled value for PV.
PVEUMin Minimum scaled value for PV.
SPHLimit SP high limit value, scaled in PV units.
PPLLimit SP low limit value, scaled in PV units.
CV1InitValue An initial value of the control variable CV1 output.
CV2InitValue An initial value of the control variable CV2 output.
CV3InitValue An initial value of the control variable CV3 output.
If you have the process models available, you can intuitively tune the CC
control variable by entering the following parameters:
Parameter Description
ModelGains Nonzero numbers (negative for direct acting control variable,
positive for reverse acting control variable)
ModelTimeConstants Always positive numbers
ModelDeadtimes Always positive numbers
ResponseTimeConstants Always positive numbers
Active 1st, 2nd and 3rd CV Specify the order in which CV's will be used to compensate for
PV - SP error.
Target 1st, 2nd and 3rd CV Specify the priorities in which CV's will be driven to their
respective target values.
CVTargetValues Specify to which values should the control variable drive the
individual CV's
TargetRespTC Specify the speed of CV's to approach the target values
The function block behaves in a defined way for any combination of CV Active
and Target lists and CV Auto-Manual modes. The function block attempts to
accomplish these goals in the following order of priorities:
1. Control PV to SP
2. Control Target1stCV to its target value
3. Control Target2ndCV to its target value
If any CV is put in Manual mode, the CC function block gives up the goal with
priority 3. If two CV's are in Manual mode, the CC function block is reduced to
an IMC, (single input, single output) control variable controlling the PV to its
setpoint.
In addition to this, however, the control variable reads the Manual CV values
from the CV's that are in Manual mode as feedforward signals. Then, the CC
For integrating process types (such as level control and position control),
internal nonintegrating models are used to approximate the integrating
process. The Factor parameter is used to convert the identified integrating
process models to nonintegrating internal models used for CV calculation.
This is necessary to provide for stable function block execution.
For example, modify the Model Gain for CV2 - PV model. Set the ModelInit2
parameter to TRUE to initialize the CV2 - PV internal model parameters and
for the new model gain to take effect.
CC Function Block Tuning The function block is equipped with an internal tuner (modeler). The purpose
of the tuner is to identify the process model parameters and to use these
parameters as internal model parameters (gain, time constant, and
deadtime). The tuner also calculates an optimal response time constant. Set
the tuner by configuring the following parameters for each CV - PV process.
ProcessType Integral (level, position control) or nonintegrating (flow, pressure control)
ProcessGainSign Set to indicate a negative process gain (increase in output causes a decrease in PV); reset to indicate a positive
process gain (increase in output causes an increase in PV).
ResponseSpeed Slow, medium, or fast, based on control objective.
NoiseLevel An estimate of noise level on PV-low, medium, or high-such that the tuner can distinguish which PV change is a
random noise and which is caused by the CV step change.
StepSize A nonzero positive or negative number defining the magnitude of CV step change in either positive or negative
direction, respectively.
PVTuneLimit (only for integrating process type) in PV engineering units, defines how much of PV change that is caused by CV
change to tolerate before aborting the tuning test due to exceeding this limit.
You can copy these parameters to the ModelGain, ModelTC, and ResponseTC,
respectively, by setting the AtuneUseModel bit. The control variable will
See also
CC Function Block Tuning Procedure on page 182
CC Function Block Tuning If an error occurs during the tuning procedure, the tuning is aborted, and an
appropriate AtuneStatus value is set. Also, a user can abort the tuning by
Errors setting the AtuneAbort parameter.
After an abort, the CV will assume its value before the step change, and the
GainTuned, TCTuned, DTTuned, and RespTCTuned parameters are not
updated. The AtuneStatus parameter identifies the reason for the abort.
Internal Model Control (IMC) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
IMC(IMC_tag);
Operands
Function Block
Operands: Type: Format Description:
IMC tag INTERNAL MODEL CONTROL Structure IMC Structure
Structured Text
Operands: Type: Format Description:
IMC tag INTERNAL MODEL CONTROL Structure IMC Structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
IMPORTANT Whenever an APC block detects a change in Delta Time (DeltaT), a ModelInit will be
performed. For this reason the blocks should only be run in one of the TimingModes in
which DeltaT will be constant.
• TimingMode = 0 (Periodic) while executing these function blocks in a Periodic Task
• TimingMode = 1 (Oversample)
In either case, if the Periodic Task time is dynamically changed, or the OversampleDT
is dynamically changed, the block will perform a ModelInit.
The following TimingMode setting are not recommended due to jitter in DeltaT:
• TimingMode = 0 (Periodic) while executing these function blocks in a Continuous or
Event Task
• TimingMode = 2 (RealTimeSample)
Structure
Input Data Type Description Valid and Default Values
Parameters
EnableIn BOOL Enable Input. If False, the function Default=TRUE
block will not execute and outputs are
not updated.
PV REAL Scaled process variable input. This Valid = any float
value is typically read from an analog Default = 0.0
input module.
PVFault BOOL PV bad health indicator. If PV is read Default = FALSE
from an analog input, then PVFault will FALSE = Good Health
normally be controlled by the analog
input fault status.
If PVFault is TRUE, it indicates an error
on the input module, set bit in Status.
PVUEMax REAL Maximum scaled value for PV. The Valid = PVEUMin <
value of PV and SP that corresponds to PVEUMax ≤ maximum
100% span of the Process Variable. If positive float
PVEUMax ≤ PVEUMin, set bit in Status. Default = 100.0
PVUEMin REAL Minimum scaled value for PV. The Valid = maximum negative
value of PV and SP that corresponds to float ≤ PVEUMin < PVEUMax
0% span of the Process Variable. If Default = 0.0
PVEUMax ≤ PVEUMin, set bit in Status.
SPProg REAL SP Program value, scaled in PV units. Valid = SPLLimit to
SP is set to this value when in Program SPHLimit
control. Default = 0.0
If value of SPProg or SPOper <
SPLLimit or > SPHLimit, set bit in
Status and limit value used for SP.
Description
The following illustration shows the IMC function block configuration.
The function block then calculates the CV value (CVHLimit, CVLLimit, and
rate of change limits are imposed) and the PV prediction.
The IMC function block can be used in place of a PID function block with the
advantage over the PID control variable when controlling processes with large
deadtimes.
For an integrating process type (such as level control and position control), an
internal nonintegrating model is used to approximate the integrating process.
The Factor parameter is used to convert the identified integrating-process
model to a nonintegrating internal model that is used for CV calculation. This
is necessary to provide for stable IMC execution.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
Function Block
Structured Text
imcTag.PV := imcInput1;
imcTag.SPProg := imcInput2;
imcTag.CVProg := imcInput3;
IMC(imcTag);
imcOutput1 := imcTag.CVEU;
See also
Processing Faults on page 254
IMC Function Block Follow these steps to create a basic IMC configuration.
2. If you have the process model available, you can intuitively tune the
IMC control variable by entering the following four parameters.
Parameter Description
Model Gain A nonzero number (negative for direct acting control variable. positive for reverse acting
control variable).
Model Time Constant Always a positive number.
Model Deadtime Always a positive number.
Response Time Constant Always a positive number - used to tune the response of the IMC control variable. A smaller
number gives a faster response.
At this point, you have completed the basic configuration. You did not
configure the built-in tuner. The control variable is ready to be put
online in either Auto or Manual mode. For tuning, use the default
settings. Refer to IMC Function Block Tuning.
3. If you do not know the process model, you need to identify the model
and tune the control variable by using the built-in tuner (modeler) for
the control variable to operate correctly in the Auto mode.
See also
IMC Function Block Tuning on page 201
For example, if you modify the IMC function block Model Gain for CV - PV, set
the ModelInit parameter to TRUE to initialize the CV - PV internal model
parameters and for the new model gain to take effect.
IMC Function Block Tuning The function block is equipped with an internal tuner (modeler). The purpose
of the tuner is to identify the process model parameters and to use these
parameters as internal model parameters (gain, time constant, and
deadtime). The tuner also calculates an optimal response-time constant.
Set the tuner by configuring the following parameters.
The tuner is started by setting the AtuneStart bit. You can stop the tuning by
setting the AtuneAbort bit. After the tuning is completed successfully, the
GainTuned, TCTuned, DTTuned, and RespTCTuned parameters are updated
with the tuning results, and the AtuneStatus code is set to indicate complete.
You can copy these parameters to the ModelGain, ModelTC, and ResponseTC,
respectively, by setting the AtuneUseModel bit. The function block will
automatically initialize the internal variables and continue normal operation.
It will automatically reset the AtuneUseModel bit.
See also
IMC Function Block Tuning Procedure on page 202
IMC Function Block Tuning If an error occurs during the tuning procedure, the tuning is aborted, and the
AtuneStatus bit is set. You can abort the tuning by setting the AtuneAbort bit.
Errors
After an abort, the CV will assume its value before the step change, and the
GainTuned, TCTuned, DTTuned, and RespTCTuned parameters are not
updated. The AtuneStatus parameter identifies the reason for the abort.
IMC Function Block Tuning Follow these steps to configure the tuner.
The MMC instruction controls two process variables to their setpoints using
up to three control variables. The MMC instruction calculates the control
variables (CV1, CV2, and CV3) in the auto mode based on the PV1 -SP1, PV2 -
SP2 deviation, internal model, and tuning.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
MMC(MMC_tag);
Operands
Function Block
Operands: Type Format Description
MMC tag MODULAR MULTIVARIABLE CONTROL structure MMC Structure
Structured Text
Operands: Type Format Description
MMC tag MODULAR MULTIVARIABLE CONTROL structure MMC Structure
Structure
The following table describes the input parameters in the MMC function
block.
Input Data Description Values
Parameters Type
EnableIn BOOL Enable Input. If False, the function block will Default=TRUE
not execute and outputs are not updated.
PV1 REAL Scaled process variable input 1. This value is Valid = any float
typically read from an analog input module. Default = 0.0
PV2 REAL Scaled process variable input 2. This value is Valid = any float
typically read from an analog input module. Default = 0.0
PV1Fault BOOL PV1 bad health indicator. If PV1 is read from Default = FALSE
an analog input, then PV1Fault will normally
be controlled by the analog input fault
status. If PVFault is TRUE, it indicates an
error on the input module, set bit in
Status.FALSE = Good Health
PV2Fault BOOL PV2 bad health indicator. If PV2 is read from Default = FALSE
an analog input, then PV2Fault will normally
be controlled by the analog input fault
status. If PVFault is TRUE, it indicates an
error on the input module, set bit in
Status.FALSE = Good Health
PV1EUMax REAL Maximum scaled value for PV1. The value of Valid = PV1EUMin <
PV1 and SP1 that corresponds to 100% span PV1EUMax <= maximum
of the Process Variable. If PV1EUMax ≤ positive float
PV1EUMin, set bit in Status. Default = 100.0
CV1PV1ProcessGai BOOL Used only for Autotuning. Sign of the process Default = FALSE
nSign gain (Delta PV1/Delta CV1).
• Set to indicate a negative process gain
(increase in output causes a decrease in
PV1).
• Reset to indicate a positive process gain
(increase in output causes an increase in
P1V).
CV3PV1ModelInit BOOL Internal model initialization switch for CV3 - Default = FALSE
PV1. Refer to Function Block Attributes.
CV1PV2ModelInit BOOL Internal model initialization switch for CV1 - Default = FALSE
PV2. Refer to Function Block Attributes.
CV2PV2ModelInit BOOL Internal model initialization switch for CV2 - Default = FALSE
PV2. Refer to Function Block Attributes.
CV3PV2ModelInit BOOL Internal model initialization switch for CV3 - Default = FALSE
PV2. Refer to Function Block Attributes.
PV1Factor REAL Non-integrating model approximation factor Default = 100
for PV1. Only used for integrating process
types.
PV2Factor Non-integrating model approximation factor Default = 100
for PV2. Only used for integrating process
types.
The following table describes the output parameters in the MMC function
block.
Output Data Description Values
Parameters Type
EnableOut BOOL Indicates if instruction is enabled. Cleared to
false if any one of CV1EU, CV2EU or CV3EU
overflows.
CV1EU REAL Scaled control variable output for CV1. Scaled
by using CV1EUMax and CV1EUMin, where
CV1EUMax corresponds to 100% and CV1EUMin
corresponds to 0%. This output is typically
used to control an analog output module or a
secondary loop.
CV1EU = (CV1 * CV1EUSpan / 100) + CV1EUMin
CV1EU span calculation: CV1EUSpan =
(CV1EUMax – CV1EUMin)
CV2EU REAL Scaled control variable output for CV2. Scaled
by using CV2EUMax and CV2EUMin, where
CV2EUMax corresponds to 100% and
CV2EUMin corresponds to 0%. This output is
typically used to control an analog output
module or a secondary loop.
CV2EU = (CV2 * CV2EUSpan / 100) + CV2EUMin
CV2EU span calculation: CV2EUSpan =
(CV2EUMax – CV2EUMin)
CV3EU REAL Scaled control variable output for CV3. Scaled
by using CV3EUMax and CV3EUMin, where
CV3EUMax corresponds to 100% and
CV3EUMin corresponds to 0%. This output is
typically used to control an analog output
module or a secondary loop.
CV3EU = (CV3 * CV3EUSpan / 100) + CV3EUMin
CV3EU span calculation: CV3EUSpan =
(CV3EUMax − CV3EUMin)
CV1 REAL Control variable output for CV1. This value will
always be expressed as 0…100%. CV1 is
limited by CV1HLimit and CV1LLimit when in
Auto mode or in Manual mode if
CVManLimiting is TRUE; otherwise limited by 0
and 100%.
CV2 REAL Control variable output for CV2. This value will
always be expressed as 0…100%. CV2 is
limited by CV2HLimit and CV2LLimit when in
Auto mode or in Manual mode if
CVManLimiting is TRUE; otherwise limited by 0
and 100%.
Description
The MMC is a flexible model-based algorithm that can be used in two basic
configuration modes:
Item Description
M11 Internal model CV1 - PV1
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for Array-
Indexing Faults
Execution
Note that iin Structured Text, EnableIn is always true during a normal scan.
Therefore, if the instruction is in the control path activated by the logic, it will
execute.
All conditions below the shaded area can only occur during Normal Scan
mode.
Condition/State Action Taken
Prescan .EnableIn and .EnableOut bits are cleared to false.
Postscan .EnableIn and .EnableOut bits are cleared to false.
EnableIn is false .EnableIn and .EnableOut bits are cleared to false.
Instruction first run No state specific action taken.
Primary algorithm not executed, however will validate input
parameters.
Instruction first scan No state specific action taken.
Primary algorithm not executed, however will validate input
parameters.
Native Implementation
Platform Intrinsics/Main Function
ABRisc / ARM ABRisc assembly code
void FB_ModularMultivariableControl(UINT32
*pulArg0Ptr)
RCA MMC(instance)
void FB_ModularMultivariableControl(UINT32
*pulArg0Ptr)
SoftLogix (X86) void rts$MMC(UINT32 *pFbdBlock)
Example
Function Block
Structured Text
mmcTag.PV1 := mmcInput1;
mmcTag.PV2 := mmcInput2;
mmcTag.SP1Prog := mmcInput3;
mmcTag.SP2Prog := mmcInput4;
mmcTag.CV1Prog := mmcInput5;
mmcTag.CV2Prog := mmcInput6;
mmcTag.CV3Prog := mmcInput7;
MMC(mmcTag);
mmcOutput1 := mmcTag.CV1EU;
mmcOutput2 := mmcTag.CV2EU;
mmcOutput3 := mmcTag.CV3EU;
See also
Convert the PV and SP Values to Percent on page 252
MMC Function Block Starting with the default configuration, configure the following parameters.
Configuration
Parameter Description
PV1EUMax Maximum scaled value for PV1.
PV1EUMin Minimum scaled value for PV1.
PV2EUMax Maximum scaled value for PV2.
PV2EUMin Minimum scaled value for PV2.
SP1HLimit SP1 high limit value, scaled in PV units.
SP1LLimit SP1 low limit value, scaled in PV units.
SP2HLimit SP2 high limit value, scaled in PV units.
SP2LLimit SP2 low limit value, scaled in PV units.
CV1InitValue An initial value of the control variable CV1 output.
CV2InitValue An initial value of the control variable CV2 output.
CV3InitValue An initial value of the control variable CV3 output.
If you have the process models available, you can intuitively tune the MMC
function block by entering the following parameters. At this point, you have
completed the basic configuration. You did not configure the built-in tuner.
If you do not know the process models, you need to identify the models and
tune the function block by using the built-in tuner (modeler) for the function
block to operate correctly in the Auto mode.
Parameter Description
ModelGains Nonzero numbers (negative for direct acting control variable,
positive for reverse acting control variable)
ModelTimeConstants Always positive numbers
ModelDeadtimes Always positive numbers
RespTimeConstants Always positive numbers
Active 1st, 2nd and 3rd CV for PV1 and PV2 Specify the order in which CV's will be used to compensate for
PV - SP error.
TargetCV Specify which CV will be driven to its target value.
CVTargetValues Specify to which values should the control variable drive the
individual CV's if selected as the TargetCV.
TargetRespTC Specify the speed of CV's to approach the target values.
For integrating process types (such as level control and position control),
internal nonintegrating models are used to approximate the integrating
process. The Factor parameters are used to convert the identified integrating
process models to nonintegrating internal models used for CV calculation.
This is necessary to provide for stable MMC execution. The MMC function
block can handle any combinations of PV1 and PV2 that are integrating or
nonintegrating process types.
The function block uses first order lag with deadtime internal process models
and first order filters (total of up to 24 tuning parameters-6 models, 4
parameters each) to calculate the CV's. Each CV is calculated such that each
process variable (PV) follows a first order lag trajectory when approaching the
setpoint value.
Speed of response depends on the value of the response time constants. The
smaller the response time constants, the faster the control variable response
will be. The response time constants should be set such that the PV's reach the
setpoints in reasonable time based on the process dynamics. The larger that
the response time constants, the slower the control variable response will be,
but the control variable also becomes more robust.
In the Manual mode, the control variables (CV) are set equal to the operator-
entered Manual CV parameters. For the Manual to Auto mode bumpless
transfer and for safe operation of the control variable, the CV rate of change
limiters are implemented such that CV's cannot move from current states by
more than specified CV units at each scan.
For example, if you modify the model for CV2 - PV1 model, set the
CV2PV1ModelInit parameter to TRUE to initialize the CV2 - PV1 internal
model parameters and for the new model to take effect.
MMC Function Block Tuning The MMC function block is equipped with an internal tuner (modeler). The
purpose of the tuner is to identify the process model parameters and to use
these parameters as internal model parameters (gain, time constant, and
deadtime). The tuner also calculates an optimal response time constant.
Set the tuner by configuring the following parameters for each CV - PV
process.
ProcessType Integrating (level, position control) or nonintegrating (flow, pressure control)
ProcessGainSign Set to indicate a negative process gain (increase in output causes a decrease in PV);
reset to indicate a positive process gain (increase in output causes an increase in PV).
ResponseSpeed Slow, medium, or fast, based on control objective
NoiseLevel An estimate of noise level on PV-low, medium, or high-such that the tuner can
distinguish which PV change is a random noise and which is caused by the CV step
change
StepSize A nonzero positive or negative number defining the magnitude of CV step change in
either positive or negative direction, respectively
PVTuneLimit (only for integrating process type) in PV engineering units, defines how much of PV
change that is caused by CV change to tolerate before aborting the tuning test due to
exceeding this limit
You can copy these parameters to the ModelGain, ModelTC, ModelDT, and
RespTC, respectively, by setting the AtuneUseModel bit. The MMC function
block automatically initializes the internal variables and continue normal
operation. It automatically resets the AtuneUseModel bit.
See also
MMC Function Block Tuning Procedure on page 244
Use an MMC Function Block The following example describes using an MMC function block to control a
splitter. Refer to the MMC Function Block Splitter Example Configuration in
for Splitter Control Module Multivariable Control ( MMC).
Item Description
PV1 Top composition (more important)
PV2 Bottom composition (less important)
Active 1st CV for PV1 CV1 (reflux ratio)
Active 2nd CV for PV1 CV3 (pressure setpoint)
Active 3rd CV for PV1 CV2 (steam (flow)
Active 1st CV for PV2 CV2
Active 2nd CV for PV2 CV3
Active 3rd CV for PV2 CV1
TargetCV CV3 (pressure should be held constant if possible)
CV3Target 60% (of pressure range)
The MMC calculates CV1, CV2, and CV3 so that the control goals are
accomplished in the following order of importance:
See also
Module Multivariable Control ( MMC) on page 203
MMC Function Block Tuning If an error occurs during the tuning procedure, the tuning is aborted, and an
appropriate AtuneStatus bit is set. Also, a user can abort the tuning by setting
Errors the AtuneAbort parameter.
After an abort, the CV assumes its value before the step change, and the
GainTuned, TCTuned, DTTuned, and RespTCTuned parameters are not
updated. The AtuneStatus parameter identifies the reason for the abort.
MMC Function Block Tuning Follow these steps to configure the tuner.
Current SP The current SP is based on the Cascade/Ratio mode, the PVTracking value,
auto mode, and the ProgOper value.
Use the Coordinated Control This is an example of how you could use the Coordinated Control function
block to control the temperature in a process.
Function Block to Control
Name Description
PV Temperature
Act1stCV CV3 (high pressure steam)
Act2ndCV CV2 (cooling)
Act3rdCV CV1 (low pressure steam)
Target1stCV CV2
Target2ndCV CV3
Target3rdCV CV1
CV1Target 0%
This value is irrelevant since in the target list setup, CV1 has the lowest priority, and will assume the
steady state load to maintain PV at the setpoint.
CV2Target 0%
CV3Target 10%
The CC function block calculates CV1, CV2 and CV3 such that the control goals
are accomplished in the following order of importance:
1. Control PV to SP
2. Control CV2 to its target value
3. Control CV3 to its target value
At this point, you have completed the basic configuration. You did not
configure the built-in tuner. The control variable is ready to be put on-line in
either auto or Manual mode. For tuning, the default settings will be used.
Refer to CC Function Block Tuning.
If you do not know the process models, you need to identify the models and
tune the function block by using the built-in tuner (modeler) for the function
block to operate correctly in the Auto mode.
The function block uses first order lag with deadtime internal process models
and first order filters (total of up to twelve tuning parameters) to calculate the
CV's. Each CV is calculated such that the process variable (PV) follows a first
order lag trajectory when approaching the setpoint value.
Speed of response depends on the value of the response time constants. The
smaller the response time constants, the faster the control variable response
will be. The response time constants should be set such that the PV reaches the
setpoint in reasonable time based on the process dynamics. The larger the
response time constants are, the slower the control variable response will be,
but the control variable also becomes more robust. See the tuning section for
more details.
In the Manual mode, the control variables (CV) are set equal to the operator-
entered or program-generated CVnOper or CVnProg parameters. For the
Manual to Auto mode bumpless transfer and for safe operation of the control
variable, the CV rate of change limiters are implemented such that CV's
See also
CC Function Block Tuning on page 181
CV High/Low Limiting The instruction always performs alarming based on CVHLimit and CVLLimit.
Limit CV by CVHLimit and CVLLimit when in auto or cascade/ratio mode.
When in manual mode, limit CV by CVHLimit and CVLLimit when
CVManLimiting is set. Otherwise limit CV by 0 and 100%.
Item Description
CVHAlarm is cleared(1)
CVLAlarm is cleared(1)
CVHAlarm is set
CVLAlarm is set
CV is greater than CVHLimit
CV is less than or equal to CVHLimit
If CVHAlarm is set
CV = CVHLimit
If CVLAlarm is set
CV = CVLLimit
CV from 0 to 100% limit algorithm
CVHAlarm is set and auto or cascasde/ratio or
(manual and CVManLimiting is set)
CVLAlarm is set and auto or cascasde/ratio or
(manual and CVManLimiting is set).
CV limited to CV high/low limits.
(1) During instruction first scan, the instruction clears the alarm outputs.
CV Percent Limiting The following diagram illustrates how the instruction determines CV percent
limiting.
Item Description
CVHAlarm is cleared(1)
CVLAlarm is cleared(1)
CVHAlarm is set
CVLAlarm is set
CV is greater than 100
CV is less than or equal to 0
CV is less than 0
CV is greater than or equal to 0
If CVHAlarm is set
CV = 100
(1) During instruction first scan, the instruction clears the alarm outputs.
CV Rate-of-Change Limiting The PIDE instruction limits the rate-of-change of CV when in Auto or
Cascade/Ratio mode or when in Manual mode and CVManLimiting is set. A
value of zero disables CV rate-of-change limiting.
CV Windup Limiting Limit the CV such that its value cannot increase when WindupHIn is set or
decrease when WindupLIn is set. These inputs are typically the WindupHOut
or WindupLOut outputs from a secondary loop. The WindupHIn and
WindupLIn inputs are ignored if CVInitializing, CVFault, or CVEUSpanInv is
set.
Item Description
selected CV
WindupHIn
WindupLIn
if WindupHIn and CV is greater than CVn-1
CV = CVn-1
if WindupHIn and CV is less than CVn-1
CV = CVn-1
CV from windup algorithm
5. When CVInitializing and ManualAfterInit are set, the instruction disables auto and cascade/ratio modes.
If the current mode is not Override or Hand mode, the instruction changes to Manual mode. If
ManualAfterInit is cleared the mode is not changed.
6. All the operator request inputs are cleared.
7. If ProgValueReset set, all the program request inputs are cleared
8. All the PV high-low, PV rate-of-change, and deviation high-low alarm outputs are cleared.
9. If CVInitReq is cleared, CVInitializing is cleared.
Instruction first run ProgOper is cleared. ProgOper is cleared.
The instruction changes to manual mode. The instruction changes to manual mode.
EnableIn is cleared EnableOut is cleared, the instruction does nothing, and N/A
the outputs are not updated.
EnableIn is set The instruction executes. EnableIn is always set.
EnableOut is set. The instruction executes.
Postscan No action taken. No action taken.
See also
Processing Faults on page 254
Switch Between Program The PIDE instruction can be controlled by either a user program or an
operator interface. You can change the control mode at any time. Program
Control and Operator and
Control Operator control use the same ProgOper output. When ProgOper is set,
control is Program; when ProgOper is cleared, control is Operator.
The following diagram shows how the PIDE instruction changes between
Program control and Operator control.
See also
Program/Operator Control on page 1052
Operating Modes The Cascade/Ratio, Auto, and Manual modes can be controlled by a user
program when in Program control or by an operator interface when in
Operator control. The Override and Hand modes have a mode request input
that can only be controlled by a user program; these inputs operate in both
Program and Operator control.
Convert the PV and SP The instruction converts PV and SP to a percent and calculates the error
before performing the PID control algorithm. The error is the difference
Values to Percent between the PV and SP values. When ControlAction is set, the values of
EPercent, E, and PVPIDPercent are negated before being used by the PID
algorithm.
Primary Loop Control Primary loop control is typically used by a primary PID loop to obtain
bumpless switching and anti-reset windup when using Cascade/Ratio mode.
The primary loop control includes the initialize primary loop output and the
anti-reset windup outputs. The InitPrimary output is typically used by the
CVInitReq input of a primary PID loop. The windup outputs are typically used
by the windup inputs of a primary loop to limit the windup of its CV output.
Item Description
InitPrimary is cleared
WindupHOut is cleared(4)
WindupLOut is cleared(4)
InitPrimary is set(1)
WindupHOut is set
WindupLOut is set
CVInitializing is set or not Cascade/Ratio mode(2)
CVInitializing is cleared and Cascade/Ration mode(3)
SHPAlarm is set or appropriate Cv alarm(5)
SHPAlarm is cleared and no CV alarm(6)
PVSpanInv is set or • Disable the Auto and Cascade/Ratio modes. If Override or Hand is not the current mode, set to
SPLimitsInv is set Manual mode.
• Do not compute PV and SP percent.
• PID control algorithm is not executed.
• Set CV to value by determined by Program or Operator control and mode (Manual, Override, or
Hand).
RatioLimitsInv is set and • If not already in Hand or Override, set to Manual mode.
CasRat is set and • Disable the Cascade/Ratio mode.
UseRatio is set • Set CV to value determined by Program or Operator control and mode (Manual, Override, or Hand).
TimingModeInv is set or • If not already in Hand or Override, set to Manual mode.
RTSTimeStampInv is set
or DeltaTInv is set
See also
Execution on page 250
Select the Control Variable Once the PID algorithm has been executed, select the CV based on program or
operator control and the current PID mode.
Update the CVOper and If not in the Operator Manual mode, the PIDE instruction sets CVOper = CV.
This obtains bumpless mode switching from any control to the Operator
CVProg Values Manual mode.
Select the Setpoint Once the instruction determines program or operator control and the PID
mode, the instruction can obtain the proper SP value.
PlantPAx
PlantPAx instructions The PlantPAx built-in instructions monitor and process discrete and analog
inputs and outputs for controlling devices.
Available Instructions
PVSD
Generate outputs to provide data and alarms on Process Deadband Controller (PDBC)
deadbands and thresholds.
Calculate the volume of product in an upright Process Tank Strapping Table (PTST)
cylindrical tank, given the level of the product
and the tank calibration table.
Operate a two-position, single-solenoid Process Valve (PVLV)
operated valve, a dual-solenoid operated valve,
or a motor-operated valve in various modes;
monitor hand-operated two-position valves.
Monitor a two-state (open and close) valve and Process Valve Statistics (PVLVS)
record statistics for stroke times and stroke
counts.
See also
Drives Instructions on page 823
Filter Instructions on page 875
Process Analog HART (PAH) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Analog HART (PAH) instruction is used to provide HART digital
data for an intelligent analog device alongside the analog input (PAI) or
analog output (PAO) instruction for that device. It provides:
• HART Dynamic Variables (PV, SV, TV and QV) values with engineering
units and variable status, and the digital value of the device’s analog
loop current (in milliamps DC).
• Analog range (min, at 4 mA, and max, at 20 mA).
• Analog units of measure.
• Device information such as Tag and Description text.
• Additional device status (HART “Command 48 additional status” bit
array).
• Lookup of diagnostic message and severity based on the Command 48
bits that are set (for the first three diagnostics found in the array).
• Additional status information received from the device via HART, such
as Field Device Status bits.
Available Languages
Ladder Diagram
Structured Text
PAH(PAH_tag, Ref_HARTData, Ref_DiagTable, Ref_UnitsTable)
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx P_ANALOG_HART tag Data structure required for proper operation of
ControlPlantPAx instruction.
Control
Ref_HARTData PAX_HART_DEVICE:I:0 tag HART device data for PlantPAx.
Ref_DiagTable P_HART_CODE_DESC_STATUS[2] tag Lookup table for diagnostic bit number (to message
and status).
Ref_UnitsTable RAC_CODE_DESCRIPTION[2] tag Lookup table for units of measure code (to units text).
P_ANALOG_HART Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableIn BOOL Not Visible Not Required Input Enable input. Ladder Diagram: Corresponds to the
rung condition.
Default is true.
Inp_InitializeReq BOOL Not Visible Not Required Input 1 = Request to initialize the instruction. The
instruction is normally initialized in instruction
first run. Use this request to re-initialize. The
instruction clears this operand automatically.
Default is true.
Cfg_HasHARTPV BOOL Not Visible Not Required Input 1 = Has a HART digital PV, display on faceplate; 0 =
HART digital PV not used.
Default is false.
Cfg_HasHARTSV BOOL Not Visible Not Required Input 1 = Has a HART digital SV, display on faceplate; 0 =
HART digital SV not used.
Default is false.
Cfg_HasHARTTV BOOL Not Visible Not Required Input 1 = Has a HART digital TV, display on faceplate; 0 =
HART digital TV not used.
Default is false.
Cfg_HasHARTQV BOOL Not Visible Not Required Input 1 = Has a HART digital QV, display on faceplate; 0 =
HART digital QV not used.
Default is false.
Cfg_UseHARTVarSts BOOL Not Visible Not Required Input 1 = Use HART Communication Status to generate
SrcQ, 0 = assume good.
Default is true.
Cfg_UseHARTText BOOL Not Visible Not Required Input 1 = Use text received from HART device, 0 = use
extended properties for text.
Default is false.
Cfg_HARTPVDecPlcs SINT Not Visible Not Required Input Number of decimal places for HART PV display.
Valid = 0,1,2,3,4,5,6.
Default is 2.
Cfg_HARTSVDecPlcs SINT Not Visible Not Required Input Number of decimal places for HART SV display.
Valid = 0,1,2,3,4,5,6.
Default is 2.
Cfg_HARTTVDecPlcs SINT Not Visible Not Required Input Number of decimal places for HART TV display.
Valid = 0,1,2,3,4,5,6.
Default is 2.
Cfg_HARTQVDecPlcs SINT Not Visible Not Required Input Number of decimal places for HART QV display.
Valid = 0,1,2,3,4,5,6.
Default is 2.
Cfg_HasMoreObj BOOL Not Visible Not Required Input 1 = Tells HMI an object with more information is
available for navigation.
Default is false.
Cfg_HasNav BOOL Not Visible Not Required Input 1 = Tells HMI a related analog input or output
object is available for navigation.
Default is false.
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output This output state always reflects EnableIn input
state.
Val_HARTPV REAL Visible Not Required Output Digital HART PV value in PV engineering units
(after Substitution, if used).
Val_HARTSV REAL Visible Not Required Output Digital HART SV value in SV engineering units
(after Substitution, if used).
Val_HARTTV REAL Visible Not Required Output Digital HART TV value in TV engineering units
(after Substitution, if used).
Val_HARTQV REAL Visible Not Required Output Digital HART QV value in QV engineering units
(after Substitution, if used).
Val_HARTLoopCurrent REAL Visible Not Required Output Digital HART value for Loop Current in milliamps.
Val_InpRawMinFromHART REAL Not Visible Not Required Output Analog input unscaled signal minimum from
HART module (in module units).
Val_InpRawMaxFromHART REAL Not Visible Not Required Output Analog input unscaled signal maximum from
HART module (in module units).
Val_PVEUMinFromHART REAL Not Visible Not Required Output Analog input scaled range minimum from HART
device (in engineering units).
Val_PVEUMaxFromHART REAL Not Visible Not Required Output Analog input scaled range maximum from HART
device (in engineering units).
Sts_eHARTDiagCode1 INT Not Visible Not Required Output HART Diagnostic Code #1 (bit number in
Command 48, 255 = none).
Sts_eHARTDiagCode2 INT Not Visible Not Required Output HART Diagnostic Code #2 (bit number in
Command 48, 255 = none).
Sts_eHARTDiagCode3 INT Not Visible Not Required Output HART Diagnostic Code #3 (bit number in
Command 48, 255 = none).
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_HARTData PAX_HART_DE Visible Required InOut HART data from I/O module assembly.
VICE:I:0
Ref_DiagTable P_HART_CODE Visible Required InOut Lookup table for diagnostic bit number (to
_DESC_STATU message and status).
S[2]
Ref_UnitsTable RAC_CODE_DE Visible Required InOut Lookup table for units of measure code (to units
SCRIPTION[2] text).
PAX_HART_DEVICE:I:O Structure
The PAX_HART_DEVICE:I:O structure is the input assembly subtype used by
Highly-Integrated HART I/O modules to provide all the HART data required
for this instruction:
Members Data Type Description
RunMode BOOL Always 0, not used by this instruction
ConnectionFaulted BOOL The network connection to the I/O module has been lost
DiagnosticActive BOOL I/O module has at least one diagnostic available
DiagnosticSequenceCount SINT This count increments each time the diagnostic information from the I/O module
changes. It counts to +127, then loops back to -128, skipping zero.
CurrentSaturated BOOL The analog signal has reached its minimum or maximum value and does not
represent the actual process variable
CurrentFixed BOOL The analog signal has been fixed by command and does not represent the actual
process variable
MoreStatusAvailable BOOL At least one Command 48 (additional device status) bit is set and diagnostics
should be displayed
CurrentMismatch BOOL I/O module reports digital value for loop current and actual analog loop current
disagree significantly
ConfigurationChanged BOOL Device reports configuration data (scaling, text, units) have changed
Malfunction BOOL Device reports malfunction detected
LoopCurrent CHANNEL_AI:I:O HART digital value for device analog loop current (mA DC)
PV CHANNEL_AI_HART:I:O HART dynamic Primary Variable with units and status
SV CHANNEL_AI_HART:I:O HART dynamic Secondary Variable with units and status
TV CHANNEL_AI_HART:I:O HART dynamic Tertiary Variable with units and status
QV CHANNEL_AI_HART:I:O HART dynamic Quaternary Variable with units and status
Static AB_5000_HART_Static_Str HART "static" data, such as device scale range, analog signal units of measure, and
uct:I:O device text strings for description and tag name
ChDataAtSignal4 REAL The value provided by the I/O module analog channel when a 4.0 mA DC signal is
received, provided for scaling use by an associated PAI or PAO instruction
P_HART_CODE_DESC_STATUS Structure
The P_HART_CODE_DESC_STATUS structure is used to look up the
diagnostic text and device status associated with a particular Command 48
diagnostic bit. The device provides a 200-bit (25 byte) array of data, where
each bit set indicates a particular diagnostic condition. An array of members
of this type is used to allow the instruction to display a text description and
status for a given bit.
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
shown, or may be NULL. If NULL, the diagnostic bit lookup function is not
performed.
Members Data Type Description
Code DINT Diagnostic code. This is the diagnostic bit number (0 to 199) in the array of 200 bits
returned in HART Command 48 (Additional Device Status), or -1 if no diagnostic bit
is set.
Desc STRING_32 Diagnostic text.
bSts SINT Device Status (bitmapped):
.0 = Information
.1 = Maintenance Required
.2 = Off Specification
.3 = Function Check
.4 = Failed
RAC_CODE_DESCRIPTION[x] Structure
The RAC_CODE_DESCRIPTION[x] structure is an array of engineering unit
code numbers and corresponding engineering units text pairs, used as a
lookup table. The instruction searches the table for the engineering units
code received from the device and displays the corresponding engineering
unit text for the variable. This parameter links the instruction to an external
tag that contains necessary data for the instruction to operate. The external
tag must be of the data type shown, or may be NULL. If NULL, the unit code
lookup function is not performed.
Members Data Type Description
Code DINT Code for which to look up Description.
Desc STRING Description for given Code.
Operation
This diagram illustrates functionality of the PAH instruction:
Virtualization
Use virtualization for instruction testing and operator training. Command
virtual operation using program command PCmd_Virtual or maintenance
command MCmd_Virtual. After finishing virtual operation, use program
command PCmd_Physical or maintenance command MCmd_Physical to
return to normal physical device operation.
When Virtualization is active, the output dynamic variable (PV, SV, TV, QV)
values of the PAH instruction are set using Virtual value settings
(Set_VirtualPV, etc.) and I/O faults are ignored. Manipulate the instruction to
operate as if a working HART process device were present.
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Instruction flagged for initialization on first scan / first run
Instruction first run Internal data such as pointers and timers are initialized
Rung-condition-in is false Set rung-condition-out to rung-condition-in.
The instruction executes. HART data, units and status are provided.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes. HART data, units and status are provided.
Postscan Rung-condition-out is cleared to false.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
In the following example, the PAH instruction is used alongside a PAI
(Process Analog Input) instruction. The PAI provides processing for the
analog (4 to 20 mA DC) signal from the HART analog input module, and the
PAH instruction provides processing for the digital HART data overlaid upon
the analog signal, received from the same field device. As a result, an analog
real-time signal is provided for closed-loop control (not shown), and four
digital dynamic variables are provided for additional process monitoring.
Ladder Diagram
Structured Text
PAH(TI_301_Dvc, ProMag400_I:I.PAxDevice, HART_DiagTable_Flow,
HART_EUTable_Generic);
TI_301.Cfg_InpRawMin:=TI_301_Dvc.Val_InpRawMinFromHART;
TI_301.Cfg_InpRawMax:=TI_301_Dvc.Val_InpRawMaxFromHART;
TI_301.Cfg_PVEUMin:=TI_301_Dvc.Val_PVEUMinFromHART;
TI_301.Cfg_PVEUMax:=TI_301_Dvc.Val_PVEUMaxFromHART;
TI_301.Inp_PVData:=TI_301_Inp_PVData;
TI_301.Inp_ModFault:=TI_301_Inp_ModFault;
TI_301.Inp_ChanFault:=TI_301_Inp_ChanFault;
TI_301.Inp_PVUncertain:=TI_301_Inp_PVUncertain;
See also
Data Conversions on page 1086
Index Through Arrays on page 1094
Process Analog Input (PAI) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Analog Input (PAI) instruction monitors an analog input and
checks for alarm conditions. Use the PAI instruction to process a signal from a
channel of an analog input module. Use the PAI instruction with any analog
(REAL) signal.
The PAI instruction:
Available Languages
Ladder Diagram
Structured Text
PAI(PAI tag, BusObj);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_ANALOG_INPUT tag Data structure required for proper
operation of the instruction.
P_ANALOG_INPUT Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, or hidden, members are used in HMI faceplates and are
not programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input. Ladder Diagram: Corresponds to the rung condition.
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in instruction first
run. Use this request to re-initialize. The instruction clears this operand automatically.
Default is true.
Inp_PVData REAL PV signal from sensor or input (PV units). Valid = any float.
Default is 4.0.
Inp_SmartDvcSts DINT Current code provided by SMART device on Inp_PVData. The code is copied to Out_SmartDvcSts
allowing a user to monitor the device status on HMI for diagnostic lookup purposes. Valid = 0 to
maximum positive number.
Default is 0.
Inp_SmartDvcDiagAvailable BOOL 1 = SMART Device diagnostics is available. Typically used to indicate device requires action to
keep operating as expected.
Default is false.
Inp_ModFault BOOL 1 = I/O module failure or module communication status bad,
0 = OK.
Default is false.
Inp_ChanFault BOOL 1 = I/O channel fault or failure,
0 = OK.
Default is false.
Inp_OutOfSpec BOOL 1 = PV out of specification (PV uncertain, from device).
Default is false.
Inp_FuncCheck BOOL 1 = Function check (PV substituted, from device).
Default is false.
Inp_MaintReqd BOOL 1 = Maintenance required (from device).
Default is false.
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
PAITag.@Alarms.AlarmName.AlarmElement
These diagrams show how Fail, High High, High, Low, Low Low, High
Deviation, Low Deviation and High Rate of Change alarm conditions are
calculated in the PAI instruction.
Operation
The PAI instruction:
Virtualization
Use virtualization for instruction testing and operator training. Set the
Inp_Virtual operand to 1 to enable virtualization. After finishing
virtualization, set the Inp_Virtual operand to 0 to return to normal operation.
Virtualization enables processing the virtual input instead of normal (scaled)
input PV. The instruction has operand (Set_VirtualPV) for entering virtual PV
in EU. When the instruction is not in Virtual, the virtual PV setting
(Set_VirtualPV) tracks the selected PV for bumpless transfer into Virtual.
Initialization
The instruction is normally initialized in the instruction first run. Re-
initialization can be requested any time by setting Inp_InitializeReq = 1. For
proper initialization, when adding the instruction while performing an online
edit of the code, make sure that Inp_InitializeReq = 1, the default value.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
The state of using raw input or maintenance substitute PV is not modified and
persists through a controller powerup or PROG-to-RUN transition.
Instruction first run All commands that are automatically cleared each execution are cleared and
ignored.
Filter is initialized. Internal timers are reset.
The instruction executes normally.
Rung-condition-in is false Set rung-condition-out to rung-condition-in.
The instruction shows a status of IO fault (Sts_IOFault). The calculation of the
scaled input PV value (Val_InpPV) is executed to indicate to the operator the
actual input value, even though the primary PV (Val) is not updated (holds last
value).
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Example
The following example shows the processing of raw analog input by the PAI
instruction. The raw input value (Local:1:I.Ch0Data) from the analog input
card is used as the raw input value (Inp_PVData) for the PAI instruction. The
final output process value (Feedwater_Flow) is the fully converted, scaled, and
filtered analog value that is propagated through the system. The instruction
also uses the Channel Fault and Module Fault parameters taken from the
same analog input module as the process value. The Inp_ChanFault is the tag
value for the channel (Local:1:I.Ch0Fault). The Inp_ModFault is the tag value
for the Local:1:I.AnalogGroupFault tag, which is set when any bits in the
Channel Fault word are set.
Ladder Diagram
Structured Text
FI_103.Inp_PVData := Local:1:I.Ch0Data;
FI_103.Inp_ModFault := Local:1:I.AnalogGroupFault;
FI_103.Inp_ChanFault := Local:1:I.Ch0Fault;
PAI(FI_103);
Feedwater_Flow := FI_103.Out;
See also
Data Conversions on page 1086
Process Dual Sensor Analog This information applies to the ControlLogix 5380P and 5580P controllers.
Input (PAID) The Process Dual Sensor Analog Input (PAID) instruction monitors one
analog Process Variable (PV) by using two analog input signals, from sources
such as dual sensors, dual transmitters, and dual input channels. The PAID
instruction monitors conditions of the channels and reports configured PV
quality. The PAID instruction has functions for input selection, averaging,
and failure detection. Additional functions, such as for filtering and alarming,
are done by a downstream PAI block.
The PAID Instruction provides:
• Selection of the sensor or input A value, the sensor or input B value, the
average of the two, the lesser of the two, or the greater of the two as the
PV value.
Available Languages
Ladder Diagram
Structured Text
PAID (PAIDTag, 0);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_ANALOG_INPUT_DUAL tag Data structure required for proper operation of instruction.
BusObj BUS_OBJ tag Bus component
P_ANALOG_INPUT_DUAL Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
BUS_OBJ Structure
Members Data Type Description
Inp_Cmd DINT Input to assert commands
Out_Cmd DINT Resultant commands
Inp_CmdLLH DINT Input for level normally high commands
Out_CmdLLH DINT Resultant line level high commands
Inp_Sts DINT Input to assert status
Out_Sts DINT Resultant status
Inp_CmdAck DINT Input to assert a command acknowledgement
Out_CmdAck DINT Resultant command acknowledgements
Inp_SeverityMax DINT Input: maximum alarm severity
Out_SeverityMax DINT Resultant of maximum alarm severity
Cfg_CmdMask DINT Propagation mask for commands
Cfg_CmdLLHMask DINT Propagation mask for line level high commands
Cfg_StsMask DINT Propagation mask for status
Ref_Index DINT Bus array index
Operation
This diagram illustrates the functionality of the PAID instruction:
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_Fail Alm_Fail Raised when the two sensor PVs are bad or out of range.
Sts_Diff Alm_Diff Raised when a high signal difference is detected between the two sensors PVs
exceeds a configured limit.
Sts_NoneGood Alm_NoneGood Raised when neither PV has good quality (for example, if both are uncertain).
Sts_OneGood Alm_OneGood Raised when only one PV has a good quality.
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Access alarm elements using this format:
PAIDTag.@Alarms.AlarmName.AlarmElement
There are Program, Operator, and External commands that enable the Reset
and Reset & Acknowledge of all alarms of the instruction (Alarm Set) at the
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• More Information
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out clears to false.
Instruction first run All commands that are automatically cleared on each execution are
cleared and ignored.
PSet_Owner and Val_Owner are set to 0.
The instruction executes normally.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
This example uses the PAID instruction to monitor one analog Process
Variable (PV) using two analog input signals (dual sensors, dual transmitters).
The PAID instruction allows you to select one sensor, the other sensor, or the
average, minimum or maximum of either sensors. If difference between the
two input signals exceeds a configured limit, an Alarm is generated.
In this example, an application uses two analog sensors (A, B). The average of
these analogs is used elsewhere in logic to control a separate application
element.
Ladder Diagram
Structured Text
PAI(AIT_201A);
AY_201.Inp_PVAData := AIT_201A.Val;
AY_201.Inp_PVASrcQ := AIT_201A.SrcQ;
AY_201.Inp_PVANotify := AIT_201A.Sts_eNotify;
AY_201.Inp_PVBData := AIT_201B.Val;
AY_201.Inp_PVBSrcQ := AIT_201B.SrcQ;
AY_201.Inp_PVBNotify := AIT_201B.Sts_eNotify;
PAID(AY_201,0);
AI_201.Inp_PVData := AY_201.Val;
AI_201.Inp_ChanFault := AY_201.Sts_PVBad;
AI_201.Inp_PVUncertain := AY_201.Sts_PVUncertain;
PAI(AI_201);
See also
Data Conversions on page 1086
Index Through Arrays on page 1094
Structured Text Syntax on page 1057
Function Block Faceplate Controls on page 1095
Process Multi Sensor Analog This information applies to the ControlLogix 5380P and 5580P controllers.
Input (PAIM) The Process Multi Sensor Analog Input (PAIM) instruction monitors one
analog process variable (PV) by using up to eight analog input signals from
sources such as sensors, transmitters, and input channels. The PAIM
instruction has functions for input selection, averaging, and failure detection.
Additional functions, such as filtering and alarming, are done by a
downstream PAI block.
Available Languages
Ladder Diagram
Structured Text
PAIM (PAIMTag, 0);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_ANALOG_INPUT_MULTI tag Data structure required for proper operation of instruction.
BusObj BUS_OBJ tag Bus component
P_ANALOG_INPUT_MULTI Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output Enable Output - System Defined Parameter
Val REAL Visible Not Required Output Selected analog PV (including substitute PV, if
used) (PV units).
Val_PVA REAL Visible Not Required Output Analog value (actual) from input A (PV units).
Val_PVB REAL Visible Not Required Output Analog value (actual) from input B (PV units).
Val_PVC REAL Visible Not Required Output Analog value (actual) from input C (PV units).
Val_PVD REAL Not Visible Not Required Output Analog value (actual) from input D (PV units).
Val_PVE REAL Not Visible Not Required Output Analog value (actual) from input E (PV units).
Val_PVF REAL Not Visible Not Required Output Analog value (actual) from input F (PV units).
Val_PVG REAL Not Visible Not Required Output Analog value (actual) from input G (PV units).
Val_PVH REAL Not Visible Not Required Output Analog value (actual) from input H (PV units).
Val_InpPV REAL Not Visible Not Required Output Selected PV (PV units).
Val_PVEUMin REAL Not Visible Not Required Output Minimum of PV range = Min (Cfg_PVEUMin,
Cfg_PVEUMax) (PV units).
Val_PVEUMax REAL Not Visible Not Required Output Maximum of PV range = Max (Cfg_PVEUMin,
Cfg_PVEUMax) (PV units).
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
BusObj BUS_OBJ Visible Required InOut Bus component
BUS_OBJ Structure
Members Data Type Description
Inp_Cmd DINT Input to assert commands
Out_Cmd DINT Resultant commands
Inp_CmdLLH DINT Input for level normally high commands
Out_CmdLLH DINT Resultant line level high commands
Inp_Sts DINT Input to assert status
Out_Sts DINT Resultant status
Inp_CmdAck DINT Input to assert a command acknowledgment
Out_CmdAck DINT Resultant command acknowledgments
Inp_SeverityMax DINT Input: maximum alarm severity
Out_SeverityMax DINT Resultant of maximum alarm severity
Cfg_CmdMask DINT Propagation mask for commands
Cfg_CmdLLHMask DINT Propagation mask for line level high commands
Cfg_StsMask DINT Propagation mask for status
Ref_Index DINT Bus array index
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm name Description
Sts_Fail Alm_Fail Raised when the two sensor PVs are bad or out of range.
Sts_AnyReject Alm_AnyReject Raised when any inputs configured to be used are rejected.
Sts_MinGood Alm_MinGood Raised when the number of unrejected input is equal to the minimum number required
to be good, meaning the next input failure results in a PV failure.
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Access alarm elements using this format:
There are Program, Operator, and External commands that enable the Reset
and Reset & Acknowledge of all alarms of the instruction (Alarm Set) at the
same time. This diagram shows how the commands interact with the PAIM
instruction.
Operation
This diagram illustrates the functionality of the PAIM instruction:
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• More Information
• Selected Analog PV engineering units – Units of Val member,
Val.@Units.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out clears to false.
Instruction first run All commands that are automatically cleared on each execution are
cleared and ignored.
PSet_Owner and Val_Owner are set to 0.
Ensure the constants for the Thompson Tau test logic have not been
zeroed out.
The instruction executes normally.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
The example uses the PAIM instruction to monitor one analog Process
Variable (PV) by using up to eight analog input signals (sensors, transmitters).
The PAIM instruction allows you to display a temperature, pressure, level, or
other PV on a user interface or use the PV in control logic, and the following
apply:
• Have three or more sensors for that PV, for example, six
thermocouples.
• Calculate a PV with the mean or median of the sensor input values.
The example uses the PAIM instruction to average multiple sensors for a
single PV. In this example, an application uses three analog sensors (A, B, C).
The average of these analogs is used elsewhere in logic to control a separate
application element.
Ladder Diagram
Structured Text
PAI(AIT_301A);
PAI(AIT_301C);
AY_301.Inp_PVAData := AIT_301A.Val;
AY_301.Inp_PVASrcQ := AIT_301A.SrcQ;
AY_301.Inp_PVANotify := AIT_301A.Sts_eNotify;
AY_301.Inp_PVBData := AIT_301B.Val;
AY_301.Inp_PVBSrcQ := AIT_301B.SrcQ;
AY_301.Inp_PVBNotify := AIT_301B.Sts_eNotify;
AY_301.Inp_PVCData := AIT_301C.Val;
AY_301.Inp_PVCSrcQ := AIT_301C.SrcQ;
AY_301.Inp_PVCNotify := AIT_301C.Sts_eNotify;
PAIM(AY_301);
AI_301.Inp_PVData := AY_301.Val;
AI_301.Inp_ChanFault := AY_301.Sts_PVBad;
AI_301.Inp_PVUncertain := AY_301.Sts_PVUncertain;
PAI(AI_301);
See also
Data Conversions on page 1086
Process Analog Output This information applies to the ControlLogix 5380P and 5580P controllers.
(PAO) The Process Analog Output (PAO) instruction drives an analog output and
checks for alarm conditions. Use the PAO instruction for a channel of an
analog output module. Use the PAO instruction with any analog (REAL)
signal.
• Monitors one analog output channel for I/O fault input and raises
alarm on an I/O fault.
• Operates in Hand, Out of Service, Maintenance, Override, Program,
and Operator modes.
Available Languages
Ladder Diagram
Structured Text
PAO(PAO tag, BusObj);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_ANALOG_OUTPUT tag Data structure required for proper operation of instruction.
BusObj BUS_OBJ tag Bus component
P_ANALOG_OUTPUT Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, or hidden, members are used in HMI faceplates and are
not programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input. Ladder Diagram: Corresponds to the rung condition.
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in instruction first
run. Use this request to re-initialize. The instruction clears this operand automatically.
Default is true.
Inp_OwnerCmd DINT Owner device command.
0 = None,
Inp_OwnerCmd.10 = Operator Lock,
Inp_OwnerCmd.11 = Operator Unlock,
Inp_OwnerCmd.12 = Program Lock, Inp_OwnerCmd.13 = Program Unlock,
Inp_OwnerCmd.14 = Acquire Maintenance,
Inp_OwnerCmd.15 = Release Maintenance,
Inp_OwnerCmd.16 = Acquire External,
Inp_OwnerCmd.17 = Release External.
Default is 0.
Inp_OpenedFdbkData BOOL Feedback from opened limit switch of the device. 1 = Device confirmed opened.
Default is false.
Inp_ClosedFdbkData BOOL Feedback from closed limit switch of the device. 1 = Device confirmed closed.
Default is false.
Inp_PosFdbk REAL Feedback from actual device position PV (CV engineering units). Valid any float.
Default is 0.0.
Inp_HandFdbk REAL CV feedback used in Hand source (CV engineering units). Valid any float.
Default is 0.0.
Inp_IntlkOK BOOL 1 = Bypassable and non-bypassable interlocks OK, analog output can be set.
Default is true.
Inp_NBIntlkOK BOOL 1 = Non-bypassable interlocks OK, analog output can be set if bypassable interlocks are bypassed.
Default is true.
Inp_IntlkAvailable BOOL 1 = Interlock availability OK.
Default is false.
Inp_IntlkTripInh BOOL 1 = Inhibit interlock trip status.
Default is false.
Inp_SmartDvcSts DINT Current code provided by SMART device on Inp_PosFdbk. The code is copied to Out_SmartDvcSts
allowing a user to monitor the device status on HMI for diagnostic lookup purposes. Valid = 0 to
maximum positive number.
Default is 0.
Inp_SmartDvcDiagAvailable BOOL 1 = SMART Device diagnostics is available. Typically used to indicate device requires action to keep
operating as expected.
Default is false.
Alarms
Discrete Logix Tag based alarms are defined for the following members.
Member Alarm Name Description
Sts_IOFault Alm_IOFault IO Failure.
Raised when the Inp_IOFault input is true. Use this input to indicate to the instruction that a
connection with the module is in fault. This input also indicates if a module reports field power
loss/no load/short circuit is occurring for its I/O. If the I/O Fault is configured as a shed fault,
the device is commanded Off and cannot be commanded to another state until reset. The
alarm condition is not raised when in Virtual.
Sts_DeviceFault Alm_DeviceFault Device Confirmed Failure.
Raised when the Inp_DeviceFault input is true. The Device fault alarm condition is not raised
when in Virtual.
Sts_Dev Alm_Dev Deviation alarm.
Raised when the difference between desired device position and actual device position is
greater than High limit or lower than Low limit., i.e. if the following is true:
((Val_CVOut-Val_Pos) > Cfg_HiDevLim) OR ((Val_CVOut-Val_Pos) < Cfg_LoDevLim)
Sts_IntlkTrip Alm_IntlkTrip Interlock Trip alarm.
Raised when an interlock not-OK condition causes the device to transition from the On state or
a pulsing state to the Off state.
If interlocks are not bypassed, a bypassable interlock or a non-bypassable interlock not-OK
condition initiates an interlock trip. If interlocks are bypassed, only a non-bypassable interlock
not-OK condition initiates an interlock trip.
Mark the alarm as used or unused and set standard configuration members of
the discrete Logix Tag based alarm. Access alarm elements using this format:
PAOTag.@Alarms.AlarmName.AlarmElement
There are also Program commands that enable users to Acknowledge, Reset,
Suppress and Unsuppress all alarms of the instruction or an alarm set at the
same time.
Operation
The following diagram illustrates the functionality of the PAO instruction:
The following diagram illustrates the functionality of the PAO instruction for
a pulsed device:
Virtualization
When Virtualization is active, the output of the analog output holds at zero
and I/O faults are ignored. Manipulate the instruction to operate as if a
Command Source
The instruction uses the following command sources. The command sources
are prioritized in order from highest to lowest in this table.
Command Source Description
Hand Logic outside the instruction owns control of the device. The
instruction tracks the state of the device for bumpless transfer
back to one of the other command sources.
(Highest Priority command source)
Out-of-Service The instruction is disabled and has no owner.
Maintenance Maintenance owns control of the device and supersedes Operator,
Program, and Override control. Operator commands and settings
from the HMI are accepted. Bypassable interlocks and permissives
are bypassed, and device timeout checks are not processed.
The core control model deals specifically with the arbitration of the source of
the commands and parameters currently being accepted by the receiving
function. More specifically, whether the source is:
The optional ability to lock into one control source or the other is required to
ensure that the other control source cannot acquire privilege when the
designer wants to prevent it.
Prog Power Up
Configuration allows the user to specify whether Operator or Program will be
the power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands will win when simultaneously asserted.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Sts_eSrc is set to 0. Sts_bSrc is set to 1 (never scanned).
Instruction first run All commands that are automatically cleared each execution
are cleared and ignored.
The Program/Operator selection is set based on the
configuration (Cfg_ProgPwrUp).
The Program or Operator lock selection is set to unlocked.
The Maintenance acquired/released state is not modified and
persists through a controller powerup or PROG-to-RUN
transition.
PSet_Owner and Sts_Owner are set to 0.
Rung-condition-in is false The instruction is put Out of Service if Inp_Hand=0. The output
is de-energized. All alarms are cleared.
Command source selection processing proceeds as normal
except that all ownership status bits (Sts_Maint, Sts_Ovrd,
Sts_Prog and Sts_Oper) are cleared to 0. Commands are still
received for Maintenance, Operator, and Program and are
processed behind the scenes, just as they are in Hand mode.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
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.
Condition/State Action Taken
Prescan See Prescan in the Ladder Diagram table.
Instruction first run See Instruction first run in the Ladder Diagram table.
EnableIn is true See Rung-condition-in is true in the Ladder Diagram table.
Postscan EnableIn and EnableOut bits are cleared to false.
Ladder Diagram
Structured Text
FCV_103.Inp_NBIntlkOK := NOT(TT_103.Sts_HiHi OR LT_103.Sts_LoLo);
FCV_103.Inp_IOFault := Local:0:I.Ch0Fault;
PAO(FCV_103, 0);
Local:1:O.Ch0Data := FCV_103.Out_CVData;
The analog output card is expecting an output in units of 4…20 mA; however,
the faceplate shows the value in terms of 0…100% open. Therefore, the scaling
parameters are set as follows. Cfg_CVEUMin=0, Cfg_CVEUMax=100,
Cfg_CVRawMin=4, Cfg_CVRawMax=20.
Ladder Diagram
Structured Text
PCV_110812.Inp_OpenedFdbkData := I_PSO110812;
PCV_110812.Inp_ClosedFdbkData := I_PSC110812;
PCV_110812.Inp_PosFdbk := I_PZV110812.Val;
PAO(PCV_110812, 0);
O_PV110812 := PCV_103.Out_CVData;
In this example, the field inputs for position feedback are wired (or
connected) to the instruction input Inp_PosFdbk. Out_CVOpenData and
Out_CVCloseData are connected to the field outputs going to the valve. The
The analog output is not used; however, the faceplate shows the value of
Val_CVOut in terms of 0…100% open, CV in engineering units. Therefore, the
scaling parameters are set as follows. Cfg_CVEUMin=0, Cfg_CVEUMax=100,
Cfg_CVRawMin=0 (default), Cfg_CVRawMax=100 (default)
Ladder Diagram
Structured Text
FCV_110813.PSet_CV := FIC_110813_Out;
FCV_110813.Inp_PosFdbk := I_FVZ110813;
PAO(FCV_110813, 0);
O_FYO110813 := FCV_110813.Out_CVOpenData;
O_FYC110813 := FCV_110813.Out_CVCloseData;
See also
Process Analog Output feedback processing on page 377
Data Conversions on page 1086
Process Analog Output The PAO instruction evaluates feedback signals from limit switches provided
by the device. The instruction reports device Open in one of these conditions:
feedback processing
• Instruction is in virtual and Open limit switch is used and activated.
• Instruction is not in virtual, Open limit switch is not used, Closed limit
is used but not activated.
• Instruction is in virtual, and Val_Pos > Cfg_MaxClosedPos.
• No limit switch in use and Val_Pos > Cfg_MaxClosedPos.
The instruction reports device Closed in one of these conditions:
These diagrams show logic involved in IO fault, device fault, and deviation out
of range alarm conditions:
Pulse Output
The PAO instruction can be used in connection with a pulse-driven device,
typically a valve, if the instruction is configured for pulse outputs
(Cfg_HasPulseOut=1). The instruction generates pulses with duration
modulated by the position error, difference (Val_Dev) between desired
position calculated by the instruction (Val_CVOut), and device confirmed
actual position (Val_Pos). Actual position is either provided by the device via
feedback (Inp_PosFdbk) or simulated by the instruction if the physical
feedback is not available or used.
Pulses are generated in cycles, one pulse per cycle. Pulses cannot be too short
and too long to minimize wear of the equipment, device, or actuator. These
time constraints are user defined as Cfg_MinOnTime and Cfg_MaxOnTime.
Cycle duration Cfg_CycleTime is also user defined.
The pulsing logic provides functionality of a position control loop. Pulse width
is calculated for a cycle.
When the device starts to move or reverses direction, the instruction delays
calculated Val_Pos by configured dead time (Cfg_DeadTime).
This figure demonstrates OpenTime for a cycle resulting from actual setting
of instruction parameters and a device or actuator responding to the
command with delay. The diagram shows two cases: delay ignored and delay
compensated.
Do not use the pulsing function of the instruction when position feedback is
not used, Val_Pos is calculated by the instruction, and configured rate
Cfg_OpenRate differs from physical rate of the device.
IMPORTANT Scan time of the instruction must be much shorter than Cfg_CycleTime. Failure to
follow this recommendation can result in undesired movement of the device or
actuator.
These figures show how larger scan time affects moves of the device or
actuator driven by instruction pulse outputs.
When not in virtual and when position feedback is not available, the
instruction relies on limit switch availability to reset the calculated position
when limits are reached. Val_Pos is set to Cfg_CVEUMax if Open limit switch
is activated and Closed limit switch is not active or not used. Val_Pos is set to
Cfg_CVEUMin if Closed limit switch is activated and Open limit switch is not
active or not used.
Bumping
The instruction can request the device to increment its position without
position feedback. The user requests a bump to pulse the output. The pulse
output is energized for configurable duration of time Cfg_BumpTime ≤
Cfg_CycleTime, as shown in the figure below.
The instruction is ready to execute bump open or bump close command when:
• Bump timer is greater than zero (zero disables the bump function),
and
• Position feedback is infinite, not a number, or there is an I/O fault, or
there is a device fault, and
• Device is in Operator or Maintenance mode, and
• Previous bump operation is not active, and
See also
Process Analog Output
Process Boolean Logic This information applies to the ControlLogix 5380P and 5580P controllers.
(PBL) The Process Boolean Logic with Snapshot (PBL) instruction executes up to
eight gates of configurable Boolean logic. Gate types available include AND,
OR, XOR (Exclusive-OR), Set/Reset, Select, and Majority. Each gate provides
up to four input conditions that are individually invertible using a
configuration setting.
Available Languages
Ladder Diagram
Structured Text
PBL(PBL tag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PBL P_BOOLEAN_LOGIC tag Data structure required for proper operation of instruction.
P_BOOLEAN_LOGIC Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are in separate tables after
public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input. Ladder Diagram: Corresponds to the rung condition.
Default is true.
Operation
The PBL instruction:
Implementation
Use the PBL instruction in these situations:
Configuration
A maximum of eight gates can be configured using these tags:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• State name strings for 0-state and 1-state
• More Information
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Resets the output on-delay and off-delay timers; clears the snapshot time
stamp and data; clears any commands received while controller was in
Program mode.
Instruction first run Resets the output on-delay and off-delay timers; clears the snapshot time
stamp and data; clears any commands received while controller was in
Program mode.
Rung-condition-in is false Clears output to false (off) and resets the output on-delay and off-delay
timers.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
This example uses the PBL instruction to perform advanced interlocking logic
that is based on the winding temperatures of a motor. This example navigates
the parameter settings to fully illustrate the example.
Ladder Diagram
• Cfg_GateFunc[1] = 2
• Cfg_GateFunc[5] = 6
• Cfg_GateFunc[6] = 2
• Cfg_GateSrc1Mask.1 = 1, Cfg_GateSrc1Ptr[1] = 0
• Cfg_GateSrc2Mask.1 = 1, Cfg_GateSrc2Ptr[1] = 2
• Cfg_GateSrc3Mask.1 = 1, Cfg_GateSrc3Ptr[1] = 4
Gate 5 is set up to look at the three high status inputs (Inp_1, Inp_4, and Inp_5)
by using these settings:
• Cfg_GateSrc1Mask.5 = 1, Cfg_GateSrc1Ptr[5] = 1
• Cfg_GateSrc2Mask.5 = 1, Cfg_GateSrc2Ptr[5] = 3
• Cfg_GateSrc3Mask.5 = 1, Cfg_GateSrc3Ptr[5] = 5
Lastly, Gate 6 is set up to look at the outputs of gates 1 and 5 by using these
settings:
• Cfg_GateSrc1Mask.6 = 1, Cfg_GateSrc1Ptr[6] = 9
• Cfg_GateSrc2Mask.6 = 1, Cfg_GateSrc2Ptr[6] = 13
Cfg_OutSrcPtr needs to be set to 14 to take the output from Gate 6 and make it
the output (Out_Live) of the PBL block. The on-delay time is then set to 5
seconds to prevent spurious trips of the output (Cfg_OnDly = 5).
Lastly, the descriptions provide documentation on the faceplate. In this
example, these are the description settings:
• Out_Live.@State0 = OK
• Out_Live.@State1 = Tripped
• Inp_0.@Label = Winding A Hi-Hi Temp
• Inp_1.@Label = Winding A Hi Temp
• Inp_2.@Label = Winding B Hi-Hi Temp
• Inp_3.@Label = Winding B Hi Temp
• Inp_4.@Label = Winding C Hi-Hi Temp
• Inp_5.@Label = Winding C Hi Temp
This diagram illustrates the functionality of the example:
Structured Text
TI1_P50.Inp_PVData := I_TE1_P50;
TI1_P50.Inp_PVUncertain := (CAF_117[12] OR Local_12_I_CH0Fault);
PAI(TI1_P50);
TI2_P50.Inp_PVData := I_TE2_P50;
TI2_P50.Inp_PVUncertain := (CAF_117[12] OR Local_12_I_CH1Fault);
PAI(TI2_P50);
TI3_P50.Inp_PVData := I_TE3_P50;
TI3_P50.Inp_PVUncertain := (CAF_117[12] OR Local_12_I_CH2Fault);
PAI(TI3_P50);
TI1_P50.Sts_HiHi := NG_PBL.Inp_0;
TI1_P50.Sts_Hi := NG_PBL.Inp_1;
TI2_P50.Sts_HiHi := NG_PBL.Inp_2;
TI2_P50.Sts_Hi := NG_PBL.Inp_3;
TI3_P50.Sts_HiHi := NG_PBL.Inp_4;
TI3_P50.Sts_Hi := NG_PBL.Inp_5;
PBL(NG_PBL);
See also
Data Conversions on page 1086
Process Command Source This information applies to the ControlLogix 5380P and 5580P controllers.
(PCMDSRC) The Process Command Source (PCMDSRC) instruction selects the command
source for a device.
• Hand
• Out-of-Service
• Maintenance
• Override
• External
• Program locked
• Program
• Operator locked
• Operator
Available Languages
Ladder Diagram
Structured Text
PCMDSRC (PCMDSRC tag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_COMMAND_SOURCE tag Data structure required for proper
operation of the instruction.
P_COMMAND_SOURCE Structure
Input Members Data Type Description
EnableIn Enable input.
Ladder Diagram:
Corresponds to the rung condition.
BOOL Default is true.
Operation
The instruction uses these command sources. The command sources are
prioritized in order from highest to lowest in this table.
Command Source Description
Hand Hardwired logic or other logic outside the instruction controls the device. The instruction tracks the state of the device for
bumpless transfer back to one of the other command sources.
(Highest priority command source)
Out-of-Service The instruction is disabled and has no owner.
Maintenance Maintenance controls the device and supersedes Operator, Program, External and Override control. Operator commands and
settings from the HMI are accepted.
Override Priority logic controls the device and supersedes Operator, Program and External control. Override Input (Inp_Ovrd) is
accepted.
The core control model arbitrates the source of the commands and
parameters that the receiving function accepts. The core control model
determines if the source is:
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other command sources
may be present in the model but act as overriding command sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program is the
power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
Initialization
The instruction is normally initialized in the instruction first run. Re-
initialization can be requested any time by setting Inp_InitializeReq = 1. For
proper initialization, when adding the instruction while performing an online
edit of the code, make sure that Inp_InitializeReq = 1 (default value).
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out clears to false.
Sts_eSrc is set to 0. Sts_bSrc is set to 0.
Instruction first run All commands that are automatically cleared on each execution are cleared
and ignored.
The Program/Operator selection is set based on the configuration
(Cfg_ProgPwrUp).
The Program or Operator lock selection is set to unlocked.
The Maintenance acquired/released state is not modified and persists
through a controller powerup or PROG-to-RUN transition.
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.
Condition/State Action Taken
Prescan See Prescan in the Ladder Diagram table.
Instruction first run See Instruction first run in the Ladder Diagram table.
EnableIn is true See Rung-condition-in is true in the Ladder Diagram table.
Postscan EnableIn and EnableOut bits are cleared to false.
See also
Index Through Arrays on page 1094
Process Command Source The core control model for the Process Command Source (PCMDSRC)
instruction consists of these control sources:
operating model
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other control sources may
be present in the model but act as overriding control sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program is the
power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
• Out-of-Service
• In-Service
• Hand
See also
Process Command Source (PCMDSRC)
PlantPAx instructions on page 257
Process Deadband This information applies to the ControlLogix 5380P and 5580P controllers.
• A Raise output, which is activated when the PV is less than the entered
Raise threshold, and a Lower output, which is activated when the PV is
greater than the entered Lower threshold.
• Q and Q-Not outputs. Q is set when the PV falls below the Raise
threshold and cleared when the PV rises above the Lower threshold; Q-
Not is the inverse of Q.
• High and Low Deviation alarms with configurable thresholds and
deadbands. These alarms can provide notification that the PV is
approaching an out-of-control condition.
• Alarms for High PV Rate of Change Increasing and High PV Rate of
Change Decreasing. These alarms can provide notification that the PV
is changing faster than expected.
Available Languages
Ladder Diagram
Structured Text
PDBC(PDBCTag, 0);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_DEADBAND tag PDBC structure
P_ DEADBAND Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
Enable input. Ladder Diagram: Corresponds to the rung condition.
EnableIn BOOL Default is true.
Use this request when reinitializing.
Inp_InitializeReq BOOL Default is true.
Process variable being controlled (engineering units). Valid = Any float.
Inp_PV REAL Default is 0.0.
Input source and quality from channel object, if available (enumerator). Valid = 0 to 32.
Inp_PVSrcQ SINT Default is 0.
Related process variable object alarm priority and acknowledgement status.
0 = Not in alarm, acknowledged,
1 = Not in alarm, unacknowledged or reset required,
2 = Low severity alarm, acknowledged,
3 = Low severity alarm, unacknowledged,
4 = Medium severity alarm, acknowledged,
5 = Medium severity alarm, unacknowledged,
6 = High severity alarm, acknowledged,
7 = High severity alarm, unacknowledged,
8 = Urgent severity alarm, acknowledged,
9 = Urgent severity alarm, unacknowledged.
Inp_PVNotify SINT Default is 0.
1 = Process variable or input/output communications status bad, 0 = Process variable
and input/output communications healthy.
Inp_PVBad BOOL Default is false.
Override command: 0 = No command, 1 = Raise, 2 = Lower, 3 = None, 4 = Manual, 5 =
Auto.
Inp_OvrdCmd SINT Default is 0.
Override mode raise setpoint (engineering units). Valid = Any float.
Inp_OvrdRaiseSP REAL Default is 0.0.
Override mode lower setpoint (engineering units). Valid = Any float.
Inp_OvrdLowerSP REAL Default is 0.0.
The gate input used for high deviation status detection. 1 = The corresponding analog
input threshold monitoring is enabled. 0 = detection is disabled and the corresponding
status output is forced off.
Inp_HiDevGate BOOL Default is false.
The gate input used for low deviation status detection. 1 = The corresponding analog
input threshold monitoring is enabled. 0 = detection is disabled and the corresponding
status output is forced off.
Inp_LoDevGate BOOL Default is false.
The gate input used for high rate of change (increasing) status detection. 1 = The
corresponding analog input threshold monitoring is enabled. 0 = detection is disabled
and the corresponding status output is forced off.
Inp_HiRoCIncrGate BOOL Default is false.
BUS_OBJ Structure
Members Data Type Description
Inp_Cmd DINT Input to assert commands
Out_Cmd DINT Resultant commands
Inp_CmdLLH DINT Input for level normally high commands
Out_CmdLLH DINT Resultant line level high commands
Inp_Sts DINT Input to assert status
Out_Sts DINT Resultant status
Inp_CmdAck DINT Input to assert a command acknowledgement
Out_CmdAck DINT Resultant command acknowledgements
Inp_SeverityMax DINT Input: maximum alarm severity
Out_SeverityMax DINT Resultant of maximum alarm severity
Cfg_CmdMask DINT Propagation mask for commands
Cfg_CmdLLHMask DINT Propagation mask for line level high commands
Cfg_StsMask DINT Propagation mask for status
Ref_Index DINT Bus array index
Operation
This diagram illustrates the functionality of the PDBC instruction:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• More Information
• Number of decimal places
• Output Units
• Input Units
• Allow Navigation Object Tag Name Output
• Allow Navigation Object Tag Name Input
Implementation
This illustration shows normal implementation with the input condition
mapped to Inp_PV on a separate branch. This approach controls an analog
process variable (PV), such as temperature, level or pressure, between upper
and lower control limits by triggering one or two discrete outputs.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Sts_eSrc is set to 0. Sts_bSrc is set to 0.
Instruction first scan See Instruction first run in the Function Block Diagram table.
EnableIn is false EnableOut is cleared to false.
The instruction is put Out of Service if Inp_Hand=0. The output is set to
Interlock CV and all alarm conditions are cleared.
Latched alarms are reset.
Command source selection processing proceeds except that Program and
Operators commands are ignored and cleared and all ownership status
bits (Sts_Maint, Sts_Ovrd, Sts_Ext, Sts_Prog and Sts_Oper) are cleared to 0.
When rung-condition-in becomes true, the Program/Operator selection is
set based on the configuration (Cfg_ProgPwrUp).
EnableIn is true EnableOut is set to true.
The instruction executes.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
In this example, tag TI1_P50 is the temperature value monitored by the PDBC
instruction. This tag provides a real indication of analog PV value.
Inp_PV is connected to the analog values tag (TI1_P50.Val) that comes from
the Value output of the PAI instruction instance.
Ladder Diagram
Structured Text
PDBC01.Inp_PV := TI1_P50.Out;
PDBC(PDBC_01, 0);
See also
Data Conversions on page 1086
Process Discrete Input (PDI) This information applies to the ControlLogix 5380P and 5580P controllers.
Available Languages
Ladder Diagram
Structured Text
PDI(PDI tag, BusObj);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PDI P_DISCRETE_INPUT tag Data structure required for
proper operation of
instruction.
BusObj BUS_OBJ tag Bus component. May be
null.
P_DISCRETE_INPUT Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, or hidden, members are used in HMI faceplates and are
not programmatically accessible. Private members are listed in separate tables
after public members.
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_TgtDisagree Alm_TgtDisagree Target Disagree status.
Sts_IOFault Alm_IOFault I/O Fault status (not generated when PV Substitution is
active).
Mark the alarm as used or unused and set standard configuration members of
the discrete Logix Tag based alarm. Access alarm elements using this format:
PDITag.@Alarms.AlarmName.AlarmElement
There are Program, Operator, and External commands that enable the Reset
and Reset & Acknowledge of all alarms of the instruction (Alarm Set) at the
same time. This diagram shows how the commands interact with the
instruction.
Operation
The Gate function provides the ability to raise an abnormal condition (alarm
condition) when another condition is true. For example, a high vibration
switch should only generate an alarm when the associated motor is running
long enough to stabilize. The Inp_Gate input must be set to 1 (its default value)
and the tag-based alarm for Sts_TgtDisagree enabled for alarm to occur. The
alarm will not occur until the Inp_Gate input has been set for the Gate Delay
(Cfg_GateDly) time.
Virtualization
Virtualization in PDI provides a virtual 0-state or 1-state input (Set_VirtualPV)
that processes like an input. Use virtualization for instruction testing and
operator training. Use PCmd_Virtual or MCmd_Virtual to enable
virtualization. After finishing virtualization, use PCmd_Physical or
MCmd_Physical to return to normal (physical device) operation.
Initialization
The instruction is normally initialized in the instruction first run. Re-
initialization can be requested any time by setting Inp_InitializeReq = 1. For
proper initialization, when adding the instruction while performing an online
edit of the code, make sure that Inp_InitializeReq = 1, the default value.
• Description
• State name strings for 0-state and 1-state
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• More Information
Implementation
This illustration shows normal implementation with the input condition
mapped to Inp_PVData on a separate branch.
This illustration shows the implementation with the input condition mapped
to the PDI instruction using the rung-condition-in.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
The state of using raw input or maintenance substitute PV is not modified and
persists through a controller powerup or PROG-to-RUN transition.
The state of the physical/virtual selection persists through a control power or
PROG-to-Run transition.
Instruction first run All commands that are automatically cleared each execution are cleared and
ignored.
The instruction executes normally.
Rung-condition-in is false Rung-condition-out is cleared to false.
The instruction executes normally, except it uses the inverse of the Inp_PVData
signal for processing.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Example
In this example, tag I_VSH_P50 is the digital process value monitored by the
PDI instruction. This tag provides a Boolean indication of High Vibration. The
bad quality indication for the value of the process variable (Inp_ChanFault)
comes from the connection status indication on the input module.
Inp_Target is defaulted to 1 indicating that the normal condition for
I_VSH_P50 is also 1, and tag comments confirm that 1=OK for this process
value. Inp_Gate is connected to the Motor Running status tag (P50_Running)
that comes from the Sts_Running output of the P_Motor instruction instance
for this motor (P50_Motor). The gate delay is configured to give the motor
sufficient time after starting to settle into full normal speed run before
enabling the high vibration indication (Sts_TgtDisagree) and alarm. The tag-
based alarm for Target Disagree status (Sts_TgtDisagree) applies On Delay
timing so the alarm will not raise until after delay time has expired.
Finally, P50_HighVibr is the output tag that indicates the status of I_VSH_P50
with appropriate gate delays based on whether the motor is running.
Ladder Diagram
Structured Text
VAH_50.Inp_PV_Data := I_VSH_P50;
VAH_50.Inp_ChanFault := CAF_117[5];
VAH_50.Inp_Gate := P50_Running;
PDI(VAH_50);
P50_HighVibr := VAH_P50.Sts_TgtDisagree;
See also
Data Conversions on page 1086
Process Discrete Output This information applies to the ControlLogix 5380P and 5580P controllers.
(PDO) The Process Discrete Output (PDO) instruction drives a discrete (true / false)
output, monitors discrete inputs serving as feedbacks from a device driven by
the discrete output, and checks for alarm conditions. Use the PDO instruction
for a channel of a discrete output module. Use the PDO instruction with any
discrete (BOOL) signal.
• Controls one discrete output, with configurable text labels for the On
and Off states of the output.
Available Languages
Ladder Diagram
Structured Text
PDO(PDO tag, BusObj);
Operands
Important: 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_DISCRETE_OUTPUT tag Data structure required for proper
operation of instruction.
BusObj BUS_OBJ tag Bus component. May be null.
P_DISCRETE_OUTPUT Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, or hidden, members are used in HMI faceplates and are
not programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input.
Ladder Diagram:
Corresponds to the rung condition.
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in instruction first
run. Use this request to re-initialize. The instruction clears this operand automatically.
Default is true.
Inp_OwnerCmd DINT Owner device command.
0 = None,
Inp_OwnerCmd.10 = Operator Lock,
Inp_OwnerCmd.11 = Operator Unlock,
Inp_OwnerCmd.12 = Program Lock,
Inp_OwnerCmd.13 = Program Unlock,
Inp_OwnerCmd.14 = Acquire Maintenance,
Inp_OwnerCmd.15 = Release Maintenance,
Inp_OwnerCmd.16 = Acquire External,
Inp_OwnerCmd.17 = Release External,
Inp_OwnerCmd.29 = Echo.
Default is 0.
Inp_OnFdbkData BOOL On feedback from device. 1 = Device confirmed On.
Default is false.
Inp_OffFdbkData BOOL Off feedback from device. 1 = Device confirmed Off.
Default is false.
Inp_IOFault BOOL Indicates the IO data is inaccurate.
0 = The IO data is good,
1 = The IO data is bad, causing fault.
This input sets Sts_IOFault, if the device is not virtual, which raises IOFault Alarm.
Default is false.
Inp_PermOK BOOL 1 = On permissives OK, device can turn On.
Default is true.
Inp_NBPermOK BOOL 1 = Non-bypassable On permissives OK, device can turn On.
Default is true.
Inp_IntlkOK BOOL 1 = Interlocks OK, device can turn On and stay On.
Default is true.
Inp_NBIntlkOK BOOL 1 = Non-bypassable interlocks OK, device can turn On and stay On.
Default is true.
Inp_IntlkAvailable BOOL 1 = Interlock Availability OK.
Default is false.
Inp_IntlkTripInh BOOL 1 = Inhibit Interlock Trip Status
Default is false.
Inp_RdyReset BOOL 1 = Related object, reset by this object, is ready to be reset.
Default is false.
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_IOFault Alm_IOFault IO Failure.
Raised when the Inp_IOFault input is true. Use this input to indicate to the instruction that a
connection with the module is in fault. This input also indicates if a module reports field power loss/no
load/short circuit is occurring for its I/O. If the I/O Fault is configured as a shed fault, the device is
commanded Off and cannot be commanded to another state until reset.
Sts_OnFail Alm_OnFail Device failed to turn on (On Feedback not confirmed within configured period of time).
Raised when the device is commanded On, but the device feedback does not confirm that the device is
actually On within the configured failure time (Cfg_OnFailTime). If the Failure is configured as a shed
fault, the device is commanded Off and cannot be commanded On until reset.
Sts_OffFail Alm_OffFail Device failed to turn off (Off Feedback not confirmed within configured period of time).
Raised when the device is commanded Off, but the device feedback does not confirm that the device
is actually Off within the configured failure time (Cfg_OffFailTime).
Sts_IntlkTrip Alm_IntlkTrip Interlock Trip alarm.
Raised when an interlock not-OK condition causes the device to transition from the On state or a
pulsing state to the Off state.
If interlocks are not bypassed, a bypassable interlock or a non-bypassable interlock not-OK condition
initiates an interlock trip. If interlocks are bypassed, only a non-bypassable interlock not-OK condition
initiates an interlock trip.
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Access alarm elements using this format:
PDOTag.@Alarms.AlarmName.AlarmElement
• I/O Fault Status - raised when the I/O Fault input is true. This input
usually indicates to the instruction that I/O data is inaccurate and
cannot be trusted for use in the application. If the I/O Fault is
configured as a shed fault, the device is commanded Off and cannot be
commanded to another state until reset.
• Interlock Trip Status - if interlocks are not bypassed, a bypassable
interlock or a non-bypassable interlock not-OK condition initiates an
interlock trip. If interlocks are bypassed, only a non-bypassable
interlock ’not OK’ condition initiates an interlock trip.
• Off Feedback Fail Status - raised when the device is commanded Off,
but the device feedback does not confirm that the device is actually Off
within the configured failure time.
• On Feedback Fail Status - raised when the device is commanded On,
but the device feedback does not confirm that the device is actually On
within the configured failure time. If the Failure is configured as a
shed fault, the device is commanded Off and cannot be commanded
On until reset.
There are Program, Operator, and External commands that enable the Reset
and Reset & Acknowledge of all alarms of the instruction (Alarm Set) at the
same time. This diagram shows how the commands interact with the PDO
instruction.
Operation
The following diagram illustrates functionality of the PDO instruction:
Virtualization
Use virtualization for instruction testing and operator training. Set the
Inp_Virtual operand to 1 to enable virtualization. After finishing
virtualization, set the Inp_Virtual operand to 0 to return to normal operation.
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• Path to an object with more information
• Target state 0
• Target state 1
• Transition state 0
• Transition state 1
• Command button off
• Command button on
• Command button pulse off
Command Source
The instruction uses these command sources. The command sources are
prioritized in order from highest to lowest in this table.
Command Source Description
Hand Hardwired logic or other logic outside the instruction controls the device. The instruction tracks the state of the device for
bumpless transfer back to one of the other command sources.
(Highest priority command source)
Out-of-Service The instruction is disabled and has no owner.
Maintenance Maintenance controls the device and supersedes Operator, Program, External and Override control. Operator commands and
settings from the HMI are accepted.
Override Priority logic controls the device and supersedes Operator, Program and External control. Override Input (Inp_Ovrd) is
accepted.
External External logic (e.g. field pilot control or upstream SCADA) controls the device. External commands (XCmd_) are accepted.
Program locked Program logic controls the device. Program commands (PCmd_) are accepted. Operator cannot take control from the
Program. Override cannot take control from theProgram unless Cfg_OvrdOverLock = 1.
Program Program logic controls the device. Program commands (PCmd_) are accepted.
Operator locked The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted. Program cannot take control
from Operator. Override cannot take control from Operator unless Cfg_OvrdOverLock = 1.
Operator The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted.
(Lowest priority command source)
The core control model arbitrates the source of the commands and
parameters that the receiving function accepts. The core control model
determines if the source is:
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other control sources may
be present in the model but act as overriding control sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program will be
the power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
• Out-of-Service
• In-Service
• Hand
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Sts_eSrc is set to 0. Sts_bSrc is set to 0.
Instruction first run All commands that are automatically cleared on each execution are
cleared and ignored.
Inp_OvrdCmd is set to 0 (no command).
The Program/Operator selection is set based on the configuration
(Cfg_ProgPwrUp).
The Program or Operator lock selection is set to unlocked.
The Maintenance acquired/released state is not modified and persists
through a controller powerup or PROG-to-RUN transition.
PSet_Owner and Val_Owner are set to 0.
If feedback is provided, Out_CVData and Sts_Out are set accordingly or
cleared otherwise.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Ladder Diagram table.
Instruction first run See Instruction first run in the Ladder Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
Use the PDO instruction to control a heating jacket on a vent filter. The
heating jacket is being used in this case to keep the vent filter dry when there
is potential for condensate buildup. The vent filter heater jacket does not
provide the feedback on its status. In normal operating conditions, the vent
filter heater jacket is being commanded on or off by the control sequence
configured in the controller. Always command the vent filter off on interlock
associated with the status of the controlling sequence of the heating jacket.
The controlling sequence issues a single bit for the desired state of the vent
filter heater. The operand PCmd_On is connected to this bit to command the
vent filter heater on and off. The operand Cfg_PCmdOnAsLevel is set to 1,
indicating that the instruction acts upon PCmd_On based on value (level)
instead of acting only on transition to true (edge) so that PCmd_On can be
used to command both the On and Off states. The controlling sequence could
be written to set the command bits PCmd_On and PCmd_Off directly (for
example, by using structured text within an SFC), in which case
Cfg_PCmdOnAsLevel could be left at its default of 0 to cause the instruction to
clear the commands once they have been acted upon. The operand
Cfg_ProgNormal is set to 1 to indicate that the normal operating state of the
controller is Program, meaning it is normally commanded by the control
Ladder Diagram
Structured Text
JV9010.Inp_IntlkOK := Status_OK;
JV9010.PCmd_On := YV9010;
PDO(JV9010, 0);
O_JV9010 := JV9010.Out_CVData;
See also
Data Conversions on page 1086
Process Dosing (PDOSE) This information applies to the ControlLogix 5380P and 5580P controllers.
• Provide inputs for rate (flow rate or quantity per time) and quantity
(total or pulse count).
• Use a pulse count as the Quantity process variable (PV), with
configurable rollover count.
• Totalize the flow rate PV to determine the quantity delivered when the
flowmeter provides a rate signal but no quantity.
• Calculate the flow rate given the quantity by differentiating with
respect to time when the meter provides a total or pulse count but no
rate. If the rate PV is calculated from an input quantity, the PDOSE
instruction uses a first-order, lag filter on the calculated rate PV signal
to reduce the impact of jitter, scan time, quantization error, or input
signal noise.
• Provide a low rate cutoff function, used to ignore flow rate values near
zero to deal with noise or zero calibration error in the rate signal.
• Use a flowmeter with built-in totalizer. Forwards the totalizer clear
command to the flowmeter and checks that the flowmeter's total was
reset.
• Provide outputs to control associated equipment, such as pumps and
valves, to start and stop flow.
• Monitor the status of controlled equipment, such as pumps and valves.
• Monitor rate or quantity input communication status and provide
indication of uncertain or bad rate PV or quantity PV.
• Provide program or operator entry of a quantity to deliver (setpoint)
and calculate the quantity remaining to deliver and percent complete
during delivery.
• Provide program or operator entry of high and low tolerance limits.
Lets the program or operator initiate a tolerance check after delivery is
complete. Provides a warning if under tolerance and lets the operator
bump the flow to make up the shortage. The bump can be set up as a
timed bump or as an operator jog-like function. Provides an alarm if
over tolerance and inhibits further flow.
• Automatically switch to a lower dribble flow rate as the quantity
delivered approaches setpoint. Provides operator or program entry of
the dribble quantity. Provides run, dribble, and stop outputs to
controlled equipment.
• Use a preact value to stop flow to account for material in the pipe, time
for equipment to stop, and delays in measurement, scan,
communication, and so forth. Provides operator or program entry of
Available Languages
Ladder Diagram
Structured Text
PDOSE (PDOSE tag, Inp_QtyPV, Inp_RatePV, BusObj);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_DOSING tag Data structure required for proper operation of instruction.
Inp_QtyPV REAL tag Quantity from weigh scale or flowmeter (EU or pulse count).
Inp_RatePV REAL tag Flow rate from flowmeter (EU/Time, see Cfg_RateTime).
BusObj BUS_OBJ tag Bus component.
P_DOSING Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableIn BOOL Not Visible Not Required Input Enable Input - System Defined Parameter
Default is true.
Inp_InitializeReq BOOL Not Visible Not Required Input 1 = Request to initialize the instruction. The
instruction is normally initialized in instruction
first run. use this request when reinitialization is
needed. The instruction clears this operand
automatically.
Default is true.
Inp_OwnerCmd DINT Not Visible Not Required Input Owner device command. 0 = None,
Inp_OwnerCmd.10 = Operator lock,
Inp_OwnerCmd.11 = Operator unlock,
Inp_OwnerCmd.12 = Program lock,
Inp_OwnerCmd.13 = Program unlock,
Inp_OwnerCmd.14 = acquire Maintenance,
Inp_OwnerCmd.15 = release Maintenance,
Inp_OwnerCmd.16 = acquire External,
Inp_OwnerCmd.17 = release External.
Default is 0.
Inp_RatePVBad BOOL Not Visible Not Required Input 1 = Rate PV input quality = Bad (Fail).
Default is false.
Inp_RatePVUncertain BOOL Not Visible Not Required Input 1 = Rate PV input quality = Uncertain.
Default is false.
Inp_QtyPVBad BOOL Not Visible Not Required Input 1 = Quantity PV input quality = Bad (Fail).
Default is false.
Inp_QtyPVUncertain BOOL Not Visible Not Required Input 1 = Quantity PV input quality = Uncertain.
Default is false.
Inp_RunFdbk BOOL Visible Not Required Input 1 = Controlled equipment is delivering (running).
Default is false.
Inp_DribbleFdbk BOOL Not Visible Not Required Input 1 = Controlled equipment is delivering at dribble.
Default is false.
Inp_StopFdbk BOOL Visible Not Required Input 1 = Controlled equipment is confirmed stopped.
Default is false.
Inp_CtrldEqpFault BOOL Not Visible Not Required Input Controlled equipment object or I/O status 0 = Ok, 1
= Fail.
Default is false.
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output Enable Output - System Defined Parameter
Out_ClearTot BOOL Visible Not Required Output 1 = Reset external totalizer (e.g. onboard
flowmeter).
Out_RunTot BOOL Visible Not Required Output 1 = Run External totalizer (e.g. onboard
flowmeter).
Out_RunFlow BOOL Visible Not Required Output 1 = Deliver at full (fast) flow.
Out_StopFlow BOOL Visible Not Required Output 1 = Stop delivery equipment.
Out_DribbleFlow BOOL Visible Not Required Output 1 = Deliver at dribble (slow) flow.
Out_Reset BOOL Not Visible Not Required Output 1 = Reset command has been received and
accepted.
Out_OwnerSts DINT Not Visible Not Required Output Status of command source, owner command
handshake and ready status.
0 = None,
.10 = Operator lock,
.11 = Operator unlock,
.12 = Program lock,
.13 = Program unlock,
.14 = Acquire Maintenance,
.15 = Release Maintenance,
.16 = Acquire External,
.17 = Release External,
.18 = Has Maintenance,
.19 = External Override lock,
.20 = Has External,
.21 = Has Operator,
.22 = Has Program,
.30 = Not ready.
Sts_Initialized BOOL Not Visible Not Required Output 1 = Instruction is initialized. use Inp_InitializeReq
to reinitialize.
Sts_CalcQty BOOL Not Visible Not Required Output 1 = Integrate Inp_RatePV to get quantity, 0 = Use
Inp_QtyPV.
Sts_CalcRate BOOL Not Visible Not Required Output 1 = Differentiate Inp_QtyPV to get rate, 0 = Use
Inp_RatePV.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Inp_QtyPV REAL Visible Required InOut Quantity from weigh scale or flowmeter
(Engineering Units or pulse count). Valid = 0.0 to
maximum positive float.
Inp_RatePV REAL Visible Required InOut Flow rate from flowmeter (Engineering
Units/time, see Cfg_RateTime). Valid = 0.0 to
2147483.0 seconds.
BusObj BUS_OBJ Visible Required InOut Bus component
BUS_OBJ Structure
Use InOut parameters to link the Instruction to external tags that contain
necessary data for the instruction to operate. These external tags must be of
the data type shown, or NULL. All public InOut parameters for this instruction
may be NULL.
Members Data Type Description
Inp_Cmd DINT Input to assert commands
Out_Cmd DINT Resultant commands
Inp_CmdLLH DINT Input for level normally high commands
Out_CmdLLH DINT Resultant line level high commands
Inp_Sts DINT Input to assert status
Out_Sts DINT Resultant status
Inp_CmdAck DINT Input to assert a command acknowledgement
Out_CmdAck DINT Resultant command acknowledgements
Inp_SeverityMax DINT Input: maximum alarm severity
Out_SeverityMax DINT Resultant of maximum alarm severity
Cfg_CmdMask DINT Propagation mask for commands
Cfg_CmdLLHMask DINT Propagation mask for line level high commands
Cfg_StsMask DINT Propagation mask for status
Ref_Index DINT Bus array index
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_EqpFault Alm_EqpFault Equipment fault. Raised when the Inp_CtrldEqpFault input is true, or when equipment feedback
signals fail to track the commanded state of the equipment within the configured time. If an
equipment fault is configured as a shed fault, the flow is stopped and a reset is required to resume
flow.
Sts_HiFlowRate Alm_HiFlowRate Above high limit. Raised when the flow rate exceeds the High Flow Rate limit, for a configured period
of time.
Sts_LoFlowRate Alm_LoFlowRate Below low limit. Raised when the flow rate falls short of the Low Flow Rate limit, for a configured
period of time.
Sts_OverTol Alm_OverTol Above over tolerance limit. Raised when the tolerance check is performed and the quantity
delivered exceeds the setpoint by more than the High Tolerance threshold.
Sts_UnderTol Alm_UnderTol Below under tolerance limit. Raised when the tolerance check is performed and the quantity
delivered falls short of the setpoint by more than the Low Tolerance threshold.
Sts_ZeroFault Alm_ZeroFault Zero fault. Raised if the dosing fails to clear, or if the dosing is cleared but then registers flow
before flow is commanded to start.
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Access alarm elements using this format:
Tag.@Alarms.AlarmName.AlarmElement
The PDOSE instruction handles alarm conditions described by these use cases
and conditions:
Operation
This diagram illustrates the functionality of the PDOSE instruction:
• OCmd _Bump
• OCmd_CheckTol
• OCmd_ClearTot
• OCmd_StartFlow
• OCmd_StartTot
Virtualization
Use virtualization for instruction testing and operator training. Use
PCmd_Virtual or MCmd_Virtual to enable virtualization. After finishing
virtualization, use PCmd_Physical or MCmd_Physical to return to normal
(physical device) operation.
When Virtualization is active, the instruction treats the object as virtual. The
instruction acts as normal but the output is kept de-energized. The
instruction can emulate a rate at which to dribble and a rate at which to
deliver when running in virtual.
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
Command Source
The instruction uses these command sources. The command sources are
prioritized in order from highest to lowest in this table.
Command Source Description
Hand Hardwired logic or other logic outside the instruction controls the device. The instruction tracks the state of the device for
bumpless transfer back to one of the other command sources.
This is the highest priority command source.
Out-of-Service The instruction is disabled and has no owner.
Maintenance Maintenance controls the device and supersedes Operator, Program, External and Override control. Operator commands and
settings from the HMI are accepted.
Override Priority logic controls the device and supersedes Operator, Program and External control. Override Input (Inp_Ovrd) is
accepted.
External External logic (e.g. field pilot control or upstream SCADA) controls the device. External commands (XCmd_) are accepted.
Program locked Program logic controls the device. Program commands (PCmd_) are accepted. Operator cannot take control from the
Program. Override cannot take control from theProgram unless Cfg_OvrdOverLock = 1.
Program Program logic controls the device. Program commands (PCmd_) are accepted.
Operator locked The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted. Program cannot take control
from Operator. Override cannot take control from Operator unless Cfg_OvrdOverLock = 1.
Operator The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted.
This is the lowest priority command source.
The core control model arbitrates the source of the commands and
parameters that the receiving function accepts. The core control model
determines if the source is:
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other control sources may
be present in the model but act as overriding control sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program is the
power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
• Out-of-Service
• In-Service
• Hand
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Any commands that are received before first scan are
discarded.
Instruction first run Any commands received before first scan are discarded.
Rung-condition-in is false Any commands that are received are discarded. All
alarms are cleared. The command source is reported as
Program Out of Service. The displayed rate is zeroed.
Outputs to controlled equipment are de-energized.
Other output parameters (values and status) hold their
last value.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Example
This example shows an input from a flowmeter (I_PDT_2) connected to a
P_AInAdv block for the conversion of differential pressure to flow. The PV
representing flow (Val from P_AInAdv) is the input for the PDOSE instruction
(Inp_RatePV). The Sts_PVBad for the flow value is also used by the PDOSE
instruction (Inp_RatePVBad). The outputs of the PDOSE instruction
(Out_RunFlow and Out_DribbleFLow) are used as inputs to a two-speed
motor (P_Motor2Spd). RunFlow and DribbleFlow are connected to
PCmd_RunFast and PCmd_RunSlow, respectively. The status outputs of the
motor for stopped (Sts_Stopped), running slow (Sts_RunningSlow), and
running fast (Sts_RunningFast) are connected back to the PDOSE block as
inputs Inp_StopFdbk, Inp_DribbleFdbk, and Inp_RunFdbk.
Ladder Diagram
Structured Text
FI_01.Inp_PVData:=I_PDT_2;
PAI(FI_01,0);
FQIC_01.Inp_RatePVBad:=FI_01.Sts_PVBad;
PDOSE(FQIC_01, 0, FI_01.Val, 0);
PMTR_01.PCmd_Start1:=FQIC_01.Out_DribbleFlow;
PMTR_01.PCmd_Start2:=FQIC_01.Out_RunFlow;
PMTR(PMTR_01, 0, 0, 0, 0, 0);
FQIC_01.Inp_DribbleFdbk:=PMTR_01.Sts_Running1;
FQIC_01.Inp_RunFdbk:=PMTR_01.Sts_Running2;
FQIC_01.Inp_StopFdbk:=PMTR_01.Sts_Stopped;
See also
Data Conversions on page 1086
Process Analog Fanout This information applies to the ControlLogix 5380P and 5580P controllers.
(PFO) The Analog Fanout (PFO) instruction sends one primary analog output signal
to multiple secondary users or devices. Each secondary output has
configurable gain, offset, and clamping limits.
Available Languages
Ladder Diagram
Structured Text
PFO (PFO tag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_ANALOG_FANOUT tag Data structure required for proper operation of instruction.
P_ANALOG_FANOUT Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input. Ladder Diagram: Corresponds to the rung condition.
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in
instruction first run. Use this request when reinitialization is needed. The instruction
clears this operand automatically.
Default is true.
Inp_CV REAL Input CV from upstream block's output (engineering units).
Default is 0.0.
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• CV Units
• Output CV Label CV1
• Output CV Label CV2
• Output CV Label CV3
• Output CV Label CV4
• Output CV Label CV5
• Output CV Label CV6
• Output CV Label CV7
• Output CV Label CV8
• CV1 EU (Engineering Units)
• CV2 EU
• CV3 EU
• CV4 EU
• CV5 EU
• CV6 EU
• CV7 EU
• CV8 EU
• Allow Navigation Object Tag Name Input CV
• Allow Navigation Object Tag Name CV1
• Allow Navigation Object Tag Name CV2
• Allow Navigation Object Tag Name CV3
• Allow Navigation Object Tag Name CV4
• Allow Navigation Object Tag Name CV5
• Allow Navigation Object Tag Name CV6
• Allow Navigation Object Tag Name CV7
• Allow Navigation Object Tag Name CV8
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run The instruction executes normally.
Rung-condition-in is false Rung-condition-out is cleared to false.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Example
In this example, the PFO instruction to implement a split range PID control
strategy to control temperature of a processing vessel. The heat exchanger to
the vessel jacket is fed by a steam valve to heat or a glycol valve to cool. One
PID controls the temperature. The example assumes that the relative process
gain between each valve and the temperature is the same.
Ladder Diagram
Structured Text
TI0921.Inp_PVData:=I_TE0921;
PAI(TI0921);
TIC0921.PV:= TI0921.Val;
TIC0921.PVFault:=TI0921.Sts_PVUncertain;
PIDE(TIC0921);
TY0921.Inp_CV:=TIC0921.CVEU;
TIC0921.CVInitReq:=TY0921.Out_CVInitializeReq;
TIC0921.CVInitValue:=TY0921.Out_CVInitializationVal;
O_TV0921A:=TY0921.Out_CV1;
O_TV0921B:=TY0921.Out_CV2;
PFO(TY0921);
See also
Data Conversions on page 1086
Index Through Arrays on page 1094
Process High or Low This information applies to the ControlLogix 5380P and 5580P controllers.
Selector (PHLS) The Process High or Low Selector (PHLS) instruction selects the highest or
the lowest of up to six incoming controlled variables (CVs). The instruction
sends the selected CV as output and flags the unselected CVs to track the
selected CV.
Available Languages
Ladder Diagram
Structured Text
PHLS(PHLSTag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PHLS P_HIGH_LOW_SELECT tag PHLS structure
Alarms
The PHLS instruction does not have any alarms.
Virtualization
The PHLS instruction does not have any virtualization capability.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run All configurations has input, use input and input offset are cleared.
All previous feedback, loop error, gain values is set to 0.
The instruction executes normally.
Rung-condition-in is false Rung-condition-out is cleared to false.
All configurations has input, use input and input offset are cleared.
All previous feedback, loop error, gain values is set to 0.
The instruction is kept in its last state.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
The example uses the PHLS instruction to implements part of the pressure
control strategy. In this case, two PIDE instructions are used as inputs. The
PIDE instructions are for Suction Pressure Override Control and Discharge
Pressure Control. The PIDE output values CV (CV to final control element)
and E (Loop Error) are used as inputs to the PHLS instruction.
This example also shows PHLS inputs for Initial Value (Inp_InitializeVal) and
initialization request (Inp_InitializeReq). In this case, the Initial Value is
taken from the speed reference to the pump motor drive. The Initialization
In this example the instruction initialization request flag is set based on the
motor’s running and availability status.
Ladder Diagram
Structured text
PIDE(PIDE_01);
PIDE(PIDE_02);
PHLS.Inp_1 := PIDE_01.CV;
PHLS.Inp_E1 := PIDE_01.E;
PHLS.Inp_2 := PIDE_02.CV;
PHLS.Inp_E2 := PIDE_02.E;
PHLS.Inp_InitializeVal := P50_Motor.Val_SpeedRef;
PHLS(PHLS);
See also
Data Conversions on page 1086
Process Interlocks (PINTLK) This information applies to the ControlLogix 5380P and 5580P controllers.
Available Languages
Ladder Diagram
Structured Text
PINTLK (PINTLK tag, Ref_IntlkBankSts);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx P_INTERLOCK tag Data structure required for proper operation of instruction.
Ref_IntlkBankSts P_INTERLOCK_BANK_STATU tag Reference interlock bank status.
S
P_INTERLOCK Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
P_INTERLOCK_BANK_STATUS Structure
Members Data Type Description
Val_FirstUpIndex INT Index number of first up interlock.
Val_FirstUpBankID INT Bank ID number of first up interlock.
Val_BankMap DINT Map of interlock banks detected.
Val_BankSts DINT Map of interlock banks statuses.
Inp_Reset BOOL 1 = Reset trip and first up.
Inp_BypActive BOOL 1 = Interlock bypassing is currently active.
Inp_LatchDefeat BOOL 1 = Do not latch.
Inp_Available BOOL 1 = Available from preceding equipment.
Sts_BankIDError BOOL 1 = Duplicate or invalid bank ID.
Sts_IntlkOK BOOL Interlocks bypassable interlock status (1 = all interlocks OK to energize).
Sts_NBIntlkOK BOOL Interlocks non-bypassable interlock status (1=all non-bypassable interlocks OK to
energize).
Sts_IntlkTripInh BOOL 1 = Interlock trip inhibit – stops equipment but does not trip.
Sts_Available BOOL Availability status.(1 = Available).
Sts_FirstUpDetect BOOL 1=First up interlock detected.
Sts_RdyReset BOOL 1=A latched interlock (returned to OK) is ready to be reset.
Sts_PrevIntlkOK BOOL Previous interlocks bypassable interlock status (1 = all interlocks OK to energize).
Sts_PrevNBIntlkOK BOOL Previous interlocks non-bypassable interlock status (1 = all non-bypassable
interlocks OK to energize).
Operation
This diagram illustrates the functionality of the PINTLK instruction:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• Input Conditional Text
• Navigation Path
• Interlock Type
• More Information
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run The instruction executes normally.
Rung-condition-in is false Rung-condition-out is cleared to false.
If this instruction is off-scan, then set the summary interlock OK status
bits to false.
Only set individual interlock bypasses for conditions that are configured
for bypassing. All the MSets for inputs that are NOT bypassable will be
cleared.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Example
This example uses the PINTLK instruction to concentrate the interlock
conditions that allow the functioning of the refiner plates that are used for
grinding wood as part of the pulp manufacturing process.
Ladder Diagram
Structured Text
P182_Motor_INTLK.Inp_BypActive := P182_Motor.Sts_BypActive;
P182_Motor_INTLK.Inp_Intlk00 := Zone_1_Light_Curtain;
P182_Motor_INTLK.Inp_Intlk01 := Coolant_Pressure_OK;
PINTLK(P182_Motor_INTLK, 0);
P182_Motor.Inp_IntlkOK := P182_Motor_INTLK.Sts_IntlkOK;
P182_Motor.Inp_NBIntlkOK := P182_Motor_INTLK.Sts_NBIntlkOK;
PMTR(P182_Motor,P182_CtrlSet,P182_CtrlCmd,P182_CtrlSts, 0, 0);
See also
Data Conversions on page 1086
Process Lead Lag Standby This information applies to the ControlLogix 5380P and 5580P controllers.
Motor Group (PLLS) The Process Lead Lag Standby Motor Group (PLLS) instruction provides
control of a parallel group of motors, such as a set of pumps with a common
intake source and discharge destination. The number of motors to run
Available Languages
Ladder Diagram
Structured Text
PLLS (PLLS tag, Ref_Motors tag, BusObj tag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
This table describes the PLLS configuration operands.
Operand Type Format Description
PlantPAx Control P_LEAD_LAG_STANDBY tag Data structure required for proper operation of instruction.
Ref_Motors P_LEAD_LAG_STANDBY_MOTOR tag Motor interface array.
BusObj BUS_OBJ tag Bus component.
P_LEAD_LAG_STANDBY Structure
Use InOut parameters to link the instruction to external tags that contain
necessary data for the instruction to operate. These external tags must be of
the data type shown.
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableIn BOOL Not Visible Not Required Input Enable Input. Ladder Diagram. Corresponds to the
rung-condition-in.
Default is true.
Inp_InitializeReq BOOL Not Visible Not Required Input 1 = Request to initialize the instruction. The
instruction is normally initialized in instruction
first run. Use this request when reinitialization is
needed. The instruction clears this operand
automatically.
Default is true.
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output Enable Output. This output state always reflects
EnableIn input state.
Val_Demand DINT Visible Not Required Output Number of motors requested to run.
Val_RotateRank DINT Not Visible Not Required Output Motor rank (0 = Lead, etc.) which will be demoted
on rotate.
Val_RotateID DINT Not Visible Not Required Output Motor number which will be demoted on rotate.
Sts_eCmd SINT Not Visible Not Required Output Group command 0 = None, 1 = Stop, 2 = Start.
Sts_Fdbk SINT Not Visible Not Required Output Group Feedback 0...31 = Number of motors
actually running.
Sts_eSts INT Not Visible Not Required Output Group confirmed status: 0 = ?,
1 = Stopped,
2 = Running,
3 = Stopping,
4 = Decreasing,
5 = Increasing.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_Motors P_LEAD_LAG_STAN Visible Required InOut Motor interface array (link to 2 to 30 motors).
DBY_MOTOR[30]
BusObj BUS_OBJ Visible Optional InOut Bus component.
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_CantStart Alm_CantStart Motor can’t start alarm.
Raised when there are not enough motors available to start to satisfy the entered demand. Too
many motors are faulted or stopped in a mode other than program.
Sts_CantStop Alm_CantStop Motor can’t stop alarm.
Raised when there are not enough motors available to stop to satisfy the entered demand. Too
many motors are running in a mode other than program.
Sts_IntlkTrip Alm_IntlkTrip Interlock Trip alarm.
Raised when the motor is running and an interlock not-OK condition causes the motor to stop.
If interlocks are not bypassed, a bypassable interlock or a non-bypassable interlock not-OK
condition initiates an interlock trip. If interlocks are bypassed, only a non-bypassable interlock
not-OK condition initiates an interlock trip.
Tag.@Alarms.AlarmName.AlarmElement
There are Program commands for each Alarm that are available to
Acknowledge, Suppress, Unsupress and Unshelve the Alarm. These
Operation
This diagram illustrates the functionality of the PLLS instruction:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
Implementation
An operator or other logic determines the demand for motors. The PLLS
instruction determines which motors to run to meet demand. For the PLLS
instruction to start and stop motors in the group, they must be available. A
motor is available when it has no faults and is in Program Mode.
The PLLS instruction uses a sorting algorithm to deal with motors that are not
available. If a motor is running and not available (perhaps running in
Operator Mode), the motor is forced to the top of the sort. If a motor is
stopped and not available (perhaps faulted), the motor is forced to the bottom
of the sort. The motors that are available to start and stop are controlled to
meet the demand. If the demand cannot be met because of unavailable
motors, a status/alarm is provided.
These images show an example of the ladder logic for transferring commands
and motor status for one motor.
• Next, the motor logic is executed. The motor logic uses the program
commands to control the physical motor. The motor logic also receives
feedback from the motor.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Any commands received before first scan are discarded. The motor is de-
energized and treated as if it were commanded to stop.
Instruction first run Any commands received before first scan are discarded. The motor is de-
energized and treated as if it were commanded to stop.
Rung-condition-in is false Handled the same as if the group is disabled by command. The motor
outputs are de-energized, and the group is shown as disabled on the HMI.
The mode is shown as No mode. All alarms are cleared.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
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.
Condition/State Action Taken
Prescan Any commands received before first scan are discarded. The motor is de-
energized and treated as if it were commanded to stop.
Instruction first run Any commands received before first scan are discarded. The motor is de-
energized and treated as if it were commanded to stop.
EnableIn is true EnableOut is set to true.
The instruction executes.
Postscan EnableIn and EnableOut bits are cleared to false.
Example
This example shows a PLLS instruction being used to control three process
motors.
Ladder Diagram
Structured Text
MyNG_PLLS_Motor01.PCMD_Start1:=MyNG_PLLS_Motors[0].PCmd_Start;
MyNG_PLLS_Motor01.PCMD_Stop:=MyNG_PLLS_Motors[0].PCmd_Stop;
MyNG_PLLS_Motor01.PCMD_Lock:=MyNG_PLLS_Motors[0].PCmd_Lock;
MyNG_PLLS_Motor01.PCMD_Unlock:=MyNG_PLLS_Motors[0].PCmd_Unloc
k;
PMTR(MyNG_PLLS_Motor01,0,0,0,0,0);
MyNG_PLLS_Motors[0].Sts_Available:=MyNG_PLLS_Motor01.Sts_Available;
MyNG_PLLS_Motors[0].Sts_Starting:=MyNG_PLLS_Motor01.Sts_Starting1;
MyNG_PLLS_Motors[0].Sts_Running:=MyNG_PLLS_Motor01.Sts_Running1;
MyNG_PLLS_Motors[0].Sts_Stopped:=MyNG_PLLS_Motor01.Sts_Stopped;
MyNG_PLLS_Motors[0].Sts_Stopping:=MyNG_PLLS_Motor01.Sts_Stopping;
MyNG_PLLS_Motor02.PCMD_Start1:=MyNG_PLLS_Motors[1].PCmd_Start;
MyNG_PLLS_Motor02.PCMD_Stop:=MyNG_PLLS_Motors[1].PCmd_Stop;
MyNG_PLLS_Motor02.PCMD_Unlock:=MyNG_PLLS_Motors[1].PCmd_Unloc
k;
PMTR(MyNG_PLLS_Motor02,0,0,0,0,0);
MyNG_PLLS_Motors[1].Sts_Available:=MyNG_PLLS_Motor02.Sts_Available;
MyNG_PLLS_Motors[1].Sts_Starting:=MyNG_PLLS_Motor02.Sts_Starting1;
MyNG_PLLS_Motors[1].Sts_Running:=MyNG_PLLS_Motor02.Sts_Running1;
MyNG_PLLS_Motors[1].Sts_Stopped:=MyNG_PLLS_Motor02.Sts_Stopped;
MyNG_PLLS_Motors[1].Sts_Stopping:=MyNG_PLLS_Motor02.Sts_Stopping;
MyNG_PLLS_Motor03.PCMD_Start1:=MyNG_PLLS_Motors[2].PCmd_Start;
MyNG_PLLS_Motor03.PCMD_Stop:=MyNG_PLLS_Motors[2].PCmd_Stop;
MyNG_PLLS_Motor03.PCMD_Lock:=MyNG_PLLS_Motors[2].PCmd_Lock;
MyNG_PLLS_Motor03.PCMD_Unlock:=MyNG_PLLS_Motors[2].PCmd_Unloc
k;
PMTR(MyNG_PLLS_Motor03,0,0,0,0,0);
MyNG_PLLS_Motors[2].Sts_Available:=MyNG_PLLS_Motor03.Sts_Available;
MyNG_PLLS_Motors[2].Sts_Starting:=MyNG_PLLS_Motor03.Sts_Starting1;
MyNG_PLLS_Motors[2].Sts_Running:=MyNG_PLLS_Motor03.Sts_Running1;
MyNG_PLLS_Motors[2].Sts_Stopped:=MyNG_PLLS_Motor03.Sts_Stopped;
MyNG_PLLS_Motors[2].Sts_Stopping:=MyNG_PLLS_Motor03.Sts_Stopping;
PLLS(MyNG_PLLS,MyNG_PLS_Motors,0);
See also
Motor Sort Algorithm for Process Lead Lag Standby Motor Group
(PLLS) instructions on page 572
Motor Sort Algorithm for To determine the order in which the motors (pumps) are started when using a
Process Lead Lag Standby Motor Group (PLLS) instruction, signed integer bit
Process Lead Lag Standby patterns for each motor are sorted by numeric value. During sorting, bit
Motor Group (PLLS) patterns are evaluated in this order:
If multiple motors are out of service, bits 5…30 determine their position at the
bottom of the list.
Out of service motors are not commanded and are not counted as running
even if actually running.
The highest priority value has a pattern of 11111 (31), the next highest priority
value is 11110 (30), and so forth.
If this priority is not to be used for the sort, set the priority value to zero for
every motor.
The highest user-input value has a pattern of 11111111 (255), the next highest
user-input value is 11111110 (254), and so forth.
If this value is not to be used for the sort, set the value to zero for every motor.
If all motors have the same value, these bits do not affect the sort; the next set
of bits become the determining factor in the sort.
The highest preference value has a pattern of 11111 (31), the next preference
value is 11110 (30), and so forth.
If this value is not to be used for the sort, set the value to zero for every motor.
If all motors have the same value, these bits do not affect the sort; the next set
of bits become the determining factor in the sort.
These bits are next in the order of precedence for determining the order of the
motors in the array list. The value of these bits corresponds to the value of the
current position of the motor in the list, and the value is established by the
PLLS instruction. There is no user entry for this field.
• Lead motor - 11111 (31)
• First Lag motor - 11110 (30)
• Second Lag motor - 11101 (29) and so on
The Status value, Priority value, User-input value, and Preference value must
be equal for all motors for the Current Position to be a determining factor in
the sort.
See also
Process Lead Lag Standby Motor Group (PLLS)
Process Motor (PMTR) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Motor (PMTR) instruction monitors and controls a fixed single-
speed, two-speed, or reversing motor using a full-voltage contactor or
intelligent motor controller (soft starter). The motor can be run or jogged,
including jogging reverse or jogging fast, as configured by the user. The
interface to the hardware motor controller can be through a Device Object
Interface or through individual pins. The object is a configurable, built-in
combination of the existing PlantPAx P_Motor (single speed), P_Motor2Spd
(two speed), P_MotorRev (reversing), and P_MotorHO (hand-operated or
monitor-only) Add-on instructions in the Rockwell Automation Library of
Process Objects.
Use the PMTR instruction to:
Available Languages
Ladder Diagram
Structured Text
PMTR (PMTRTag, Ref_Ctrl_Set tag, Ref_Ctrl_Cmd tag, Ref_Ctrl_Sts tag,
BusObj tag, Ref_FaultCodeList tag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_MOTOR_DISCRETE tag Data structure required for proper operation of instruction.
Ref_Ctrl_Set RAC_ITF_DVC_PWRDISCRETE_ tag Power Discrete Device Object Settings Interface.
SET
Ref_Ctrl_Cmd RAC_ITF_DVC_PWRDISCRETE_ tag Power Discrete Device Object Command Interface.
CMD
Ref_Ctrl_Sts RAC_ITF_DVC_PWRDISCRETE_ tag Power Discrete Device Object Status Interface.
STS
BusObj BUS_OBJ tag Bus component.
Ref_FaultCodeList RAC_CODE_DESCRIPTION[x] tag Fault Code to Fault Description lookup table for intelligent motor controller.
P_MOTOR_DISCRETE Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableIn BOOL Not Visible Not Required Input Enable Input - System Defined Parameter
Default is true.
Inp_InitializeReq BOOL Not Visible Not Required Input 1 = Request to initialize the instruction. The instruction
is normally initialized in instruction first run. Use this
request when reinitialization is needed. The instruction
clears this operand automatically.
Default is true.
Inp_OwnerCmd DINT Not Visible Not Required Input Owner device command.
0 = None,
.10 = Operator Lock,
.11 = Operator Unlock,
.12 = Program Lock,
.13 = Program Unlock,
.14 = Acquire Maintenance,
.15 = Release Maintenance,
.16 = Acquire External,
.17 = Release External,
.29 = Echo.
Default is 0.
Inp_LastFaultCodeData DINT Not Visible Not Required Input Most recent intelligent motor controller Fault Code
(enumeration).
Default is 0.
Inp_ReadyData BOOL Not Visible Not Required Input 1=Intelligent motor controller is ready to run.
Default is true.
Inp_1RunFdbkData BOOL Not Visible Not Required Input 1=Motor is Running Forward or Slow.
Default is false.
Inp_2RunFdbkData BOOL Not Visible Not Required Input 1=Motor is Running Reverse or Fast.
Default is false.
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output Enable Output - System Defined Parameter
Out_Run1Data BOOL Not Visible Not Required Output 1=Start/Run Motor Forward or Slow, 0=Stop Motor
(for held starter type).
Out_Run2Data BOOL Not Visible Not Required Output 1=Start/Run Motor Reverse or Fast, 0=Stop Motor
(for held starter type).
Out_Start1Data BOOL Not Visible Not Required Output 1=Start Motor Forward or Slow, 0=Motor left in
current state.
Out_Start2Data BOOL Not Visible Not Required Output 1=Start Motor Reverse or Fast, 0=Motor left in
current state.
Out_StopData BOOL Not Visible Not Required Output 1=Stop Motor, 0=Motor left in current state.
Out_ClearFaultData BOOL Not Visible Not Required Output 1=Attempt to clear Fault on intelligent motor
controller.
Out_HornData BOOL Not Visible Not Required Output 1 = Sound audible prior to commanded motor
start.
Out_Reset BOOL Not Visible Not Required Output 1 = Reset command has been received and
accepted.
Out_OwnerSts DINT Not Visible Not Required Output Status of command source, owner command
handshake and ready status.
0 = None,
.10 = Operator Lock,
.11 = Operator Unlock,
.12 = Program Lock,
.13 = Program Unlock,
.14 = Acquire Maintenance,
.15 = Release Maintenance,
.16 = Acquire External,
.17 = Release External,
.18 = Has Maintenance,
.19 = External Override Lock,
.20 = Has External,
.21 = Has Operator,
.22 = Has Operator Locked,
.23 = Has Program,
.24 = Has Program Locked,
.29 = Echo,
.30 = Not Ready.
Sts_Initialized BOOL Not Visible Not Required Output 1 = Instruction is initialized. Use Inp_InitializeReq
to reinitialize.
Sts_Stopped BOOL Visible Not Required Output 1 = Motor requested to stop and is confirmed
stopped.
Sts_Starting1 BOOL Visible Not Required Output 1 = Motor requested to run forward and awaiting
run feedback.
Sts_Starting2 BOOL Not Visible Not Required Output 1 = Motor requested to run reverse and awaiting
run feedback.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_Ctrl_Set RAC_ITF_DVC_PW Visible Required InOut Discrete Power Automation Device Object
RDISCRETE_SET Settings Interface.
Ref_Ctrl_Cmd RAC_ITF_DVC_PW Visible Required InOut Discrete Power Automation Device Object
RDISCRETE_CMD Command Interface.
Ref_Ctrl_Sts RAC_ITF_DVC_PW Visible Required InOut Discrete Power Automation Device Object
RDISCRETE_STS Status Interface.
BusObj BUS_OBJ Visible Required InOut Bus component
Ref_FaultCodeList RAC_CODE_DESCR Visible Required InOut Fault Code to Fault Description lookup table for
IPTION[1] intelligent motor controller.
RAC_ITF_DVC_PWRDISCRETE_SET Structure
The RAC_ITF_DVC_PWRDISCRETE_SET structure is the first of three
structures exchanged with the associated Power Discrete Device Object to
interface with the intelligent motor control device. This structure handles
settings, such as the Command Inhibit, sent to the motor controller.
This parameter is used to link the instruction to an external tag that contains
necessary data for the instruction to operate. The external tag must be of the
data type shown, or may be NULL. If NULL, other pins on the instruction are
used to link the necessary data.
Members Data Type Description
InhibitCmd BOOL 1=Inhibit user Commands from external sources; 0=AllowControl
InhibitSet BOOL 1=Inhibit user Settings from external sources; 0=Allow
RAC_ITF_DVC_PWRDISCRETE_CMD Structure
The RAC_ITF_DVC_PWRDISCRETE_CMD structure is the second of three
structures exchanged with the associated Power Discrete Device Object to
interface with the intelligent motor control device. This structure handles
commands, such as the start, stop, direction, and speed, sent to the motor
controller. It is an InOut parameter configured as optional (May Be Null).
This parameter is used to link the instruction to an external tag that contains
necessary data for the instruction to operate. The external tag must be of the
data type shown, or may be NULL. If NULL, other pins on the instruction are
used to link the necessary data.
Members Data Type Description
bCmd INT Commands (Bit Overlay)
Physical BOOL Operate as a physical device
Virtual BOOL Operate as a virtual device
ResetWarn BOOL Reset Warning Status
ResetFault BOOL Reset Fault Status
Activate BOOL Activate Output Power Structure
Deactivate BOOL DeActivate Output Power Structure
CmdDir BOOL Command Direction; 0=Forward, 1=Reverse
Jog BOOL Jog Command
Fast BOOL Fast speed of a two-speed device
Slow BOOL Slow Speed of a two-speed device
RAC_ITF_DVC_PWRDISCRETE_STS Structure
The RAC_ITF_DVC_PWRDISCRETE_STS structure is the third of three
structures exchanged with the associated Power Discrete Device Object to
interface with the intelligent motor control device. This structure handles
status, such as the run feedback, connection status, commanded and actual
direction, received from the motor controller. It is an InOut parameter
configured as optional (May Be Null).
This parameter is used to link the instruction to an external tag that contains
necessary data for the instruction to operate. The external tag must be of the
data type shown, or may be NULL. If NULL, other pins on the instruction are
used to link the necessary data.
BUS_OBJ Structure
The BUS_OBJ structure is used to link the motor to other devices and
instructions in a complex control strategy, typically into a hierarchy. A Bus
Object rolls up status and alarm information from lower level devices to
higher level control and fans out commands from higher level control to lower
level devices, and items link to the bus by referencing a single member of the
BUS_OBJ array associated with the bus.
This parameter is used to link the instruction to an external tag that contains
necessary data for the instruction to operate. The external tag must be of the
data type shown, or may be NULL. If NULL, the Bus functions of this
instruction are not available.
Members Data Type Description
Inp_Cmd DINT Input to assert commands
Out_Cmd DINT Resultant commands
Inp_CmdLLH DINT Input for level normally high commands
Out_CmdLLH DINT Resultant line level high commands
Inp_Sts DINT Input to assert status
Out_Sts DINT Resultant status
RAC_CODE_DESCRIPTION[x] Structure
The RAC_CODE_DESCRIPTION[x] structure is an array of intelligent motor
controller fault code number and fault code description pairs, used as a
lookup table. The instruction searches the table for the fault code received
from the motor controller and displays the corresponding fault description
text.
This parameter is used to link the instruction to an external tag that contains
necessary data for the instruction to operate. The external tag must be of the
data type shown, or may be NULL. If NULL, the fault code lookup function is
not performed. Fault descriptions will only be shown if provided through the
Device Object Status interface.
Members Data Type Description
Code DINT Code for which to look up Description
Desc STRING Description for given Code
RAC_EVENTStructure
RAC_EVENTstructures are used by the FirstFault and FirstWarning members
in the RAC_ITF_DVC_PWRDISCRETE_STS structure. These items hold the
event data received from the intelligent motor controller for the first fault and
first warning records in the motor controller event history.
Members Data Type Description
1 = Status
2 = Warning
3 = Fault
Type DINT 4 ...n = User
ID DINT User definable event ID
Category DINT User definable category (Electrical,Mechanical,Materials,Utility,etc.)
Action DINT User definable event action code
Value DINT User definable event value or fault code
Message STRING Event message text
EventTime_L LINT Timestamp
EventTime_D DINT[7] Timestamp (Y,M,D,h,m,s,us)
Alarms
Discrete Logix tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_FailToStart Alm_FailToStart Motor failed to start within the allotted time when commanded to start
Sts_FailToStop Alm_FailToStop Motor failed to stop within the allotted time when commanded to stop
Sts_IntlkTrip Alm_IntlkTrip Motor stopped by an Interlock Not OK
Sts_IOFault Alm_IOFault Motor communication with controller failed
Sts_MotorFault Alm_MotorFault The motor controller is reporting it has a fault condition
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Use this format to access alarm elements:
Tag.@Alarms.AlarmName.AlarmElement
• Raises the Fail to Start alarm when the motor is commanded to start
but run feedback is not received within the configured failure time.
• Raises the Fail to Stop alarm when the motor is commanded to stop
but run feedback does not drop within the configured failure time.
• Raises the Interlock Trip alarm when the motor is running and an
interlock not-OK condition causes the motor to stop. If interlocks are
not bypassed, a bypassable interlock or a non-bypassable interlock not-
OK condition initiates an interlock trip. If interlocks are bypassed, only
a non-bypassable interlock not-OK condition initiates an interlock trip.
• Raises the I/O Fault alarm when I/O communication with the motor
controller or other I/O device is lost. For the Power Discrete Device
interface, this is detected when the Ref_Ctrl_Sts.Connected bit goes
false (to 0). For the discrete signal interface, used when Ref_Ctrl_Sts
is NULL, this is detected when Inp_IOFault goes true (to 1).
• Raises the Motor Fault alarm when the motor controller reports a
faulted condition. For the Power Discrete Device interface, this is
detected when the Ref_Ctrl_Sts.Faulted bit goes true (to 1). For the
discrete signal interface, which is used when Ref_Ctrl_Sts is NULL,
this is detected when Inp_Faulted goes true (to 1).
Program, Operator, and External commands enable the Reset of latched
alarms, and Reset & Acknowledge of all alarms of the instruction (Alarm Set)
at the same time. This diagram shows how the commands interact with the
PMTR instruction.
Operation
This diagram illustrates functionality of the PMTR instruction:
• OCmd_Jog1
• OCmd_Jog2
Virtualization
Use virtualization for instruction testing and operator training. Command to
virtual operation using program command PCmd_Virtual or maintenance
command MCmd_Virtual. After finishing virtual operation, use program
command PCmd_Physical or maintenance command MCmd_Physical to
return to normal physical device operation.
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
Implementation
The PMTR instruction monitors and controls a discrete motor. The start, stop
and jog commands to the motor can come from a variety of sources,
determined by an embedded instance of PCMDSRC. Available command
sources are:
The PMTR instruction supports interlocks, conditions that must be OK for the
motor to run and which stop the motor if not OK, and permissives, conditions
The PMTR instruction supports a bus for forwarding commands (fanout) and
gathering status (rollup) in a hierarchy of objects. Refer to the Bus Object for
more information on the commands and status (including alarm status) sent
on the bus.
The PMTR instruction optionally supports the ability to look up the text to
display for the most recent intelligent motor controller fault code, given a
provided fault code lookup table. This table is an array of Code and
Description pairs and is searched whenever the last fault code from the motor
controller changes.
The PMTR instruction interface to the physical motor can be through a Power
Discrete Device Object interface or by connecting individual motor controller
signals to input and output pins of the instruction. Details on the Power
Discrete Device Object interface are given below. Three interface tags are
used, provided as InOut Parameters. These tags provide motor Settings,
motor Commands, such as start forward, jog reverse and stop, and retrieve
motor Status, such as connected, active (running), commanded direction and
speed, actual direction and speed, warning, faulted, and extended motor
controller warning and fault information.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing
faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Any commands received before first scan are discarded. The motor is de-
energized and treated as if it were commanded to stop.
Instruction first run Any commands received before first scan are discarded. The motor state
is evaluated and the instruction aligns with the current state of the motor,
as if the Hand command source were selected.
Rung-condition-in is false Handled the same as if the motor is taken Out of Service by command. The
motor outputs are de-energized, and the motor Command Source is shown
as Program Out of Service on the HMI. All alarms are cleared. The rung-
condition-out continues as false.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
Ladder Diagram
Structured Text
PMTR(MyNG_PMTR, MyNG_PMTR_Ref_Ctrl_Set,
MyNG_PMTR_Ref_Ctrl_Cmd, MyNG_PMTR_Ref_Ctrl_Sts, MyNG_Bus[23], 0)
See also
Process Motor (PMTR) Command Source on page 609
Process Motor (PMTR) The Process Motor (PMTR) instruction uses these command sources. The
command sources are prioritized in order from highest to lowest in this table.
Command Source
Command Source Description
Hand Hardwired logic or other logic outside the instruction controls the device. The instruction tracks the state of the device for
bumpless transfer back to one of the other command sources.
This is the highest priority command source.
Out-of-Service The instruction is disabled and accepts no device commands.
Maintenance Maintenance controls the device and supersedes Operator, Program, External and Override control. Operator commands and
settings from the HMI are accepted.
Override Priority logic controls the device and supersedes Operator, Program and External control. Override Input (Inp_Ovrd) is
accepted.
External External logic (for exapmle, field pilot control or upstream SCADA) controls the device. External commands (XCmd_) are
accepted.
Program locked Program logic controls the device. Program commands (PCmd_) are accepted. Operator cannot take control from the
Program. Override cannot take control from theProgram unless Cfg_OvrdOverLock = 1.
Program Program logic controls the device. Program commands (PCmd_) are accepted.
Operator locked The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted. Program cannot take control
from Operator. Override cannot take control from Operator unless Cfg_OvrdOverLock = 1.
Operator The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted.
This is the lowest priority command source.
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other control sources may
be present in the model but act as overriding control sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program is the
power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
• Out-of-Service
• In-Service
• Hand
See also
Process Motor (PMTR)
Process Permissives This information applies to the ControlLogix 5380P and 5580P controllers.
(PPERM) The Process Permissives (PPERM) instruction collects, or sums up, the
permissive conditions that allow a piece of equipment to energize. In most
cases, permissive conditions must be true to energize equipment. Once the
equipment is energized, permissives are ignored.
The PPERM instruction provides:
• Permissive input OK Check. Evaluates the inputs. If all inputs are in
the configured OK state, the instruction sets the All Permissives OK
status to true.
• Permissive bypass. Evaluates the non-permissive inputs to bypass. If
all inputs are in their configured OK state, the instruction sets the All
Non-Bypassable Permissives OK status to true.
• Summary status. Summarizes its 32 permissive input conditions into
two primary status bits:
• Sts_PermOK. Indicates all permissive conditions are clear, or ready
to energize.
• Sts_NBPermOK. Indicates all permissive conditions that cannot be
bypassed are clear, or ready to energize after bypassing permissive
conditions.
Available Languages
Ladder Diagram
Structured Text
PPERM (PPERM tag);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_PERMISSIVE tag Data structure required for proper operation of instruction.
P_PERMISSIVE Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable Input - System Defined Parameter
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in
instruction first run. Use this request when reinitializing. The instruction clears this
operand automatically.
Default is true.
Inp_Perm00 BOOL Permissive condition 00, OK to energize if in configured OK state.
Default is true.
Inp_Perm01 BOOL Permissive condition 01, OK to energize if in configured OK state.
Default is true.
Inp_Perm02 BOOL Permissive condition 02, OK to energize if in configured OK state.
Default is true.
Inp_Perm03 BOOL Permissive condition 03, OK to energize if in configured OK state.
Default is true.
Inp_Perm04 BOOL Permissive condition 04, OK to energize if in configured OK state.
Default is true.
Inp_Perm05 BOOL Permissive condition 05, OK to energize if in configured OK state.
Default is true.
Inp_Perm06 BOOL Permissive condition 06, OK to energize if in configured OK state.
Default is true.
Inp_Perm07 BOOL Permissive condition 07, OK to energize if in configured OK state.
Default is true.
Inp_Perm08 BOOL Permissive condition 08, OK to energize if in configured OK state.
Default is true.
Inp_Perm09 BOOL Permissive condition 09, OK to energize if in configured OK state.
Default is true.
Inp_Perm10 BOOL Permissive condition 10, OK to energize if in configured OK state.
Default is true.
Inp_Perm11 BOOL Permissive condition 11, OK to energize if in configured OK state.
Default is true.
Inp_Perm12 BOOL Permissive condition 12, OK to energize if in configured OK state.
Default is true.
Inp_Perm13 BOOL Permissive condition 13, OK to energize if in configured OK state.
Default is true.
Inp_Perm14 BOOL Permissive condition 14, OK to energize if in configured OK state.
Default is true.
Inp_Perm15 BOOL Permissive condition 15, OK to energize if in configured OK state.
Default is true.
Operation
This diagram illustrates the functionality of the PPERM instruction:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run The instruction executes normally.
Rung-condition-in is false Rung-condition-out is cleared to false.
If this instruction is off-scan, then set the summary Permissive OK status
bits to false.
Only set individual permissive bypasses for conditions that are configured
for bypassing. All the MSets for inputs that are NOT bypassable will be
cleared.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
Ladder Diagram
Structured Text
P182_Motor_1Perm.Inp_BypActive := P182_Motor.Sts_BypActive;
PPERM(P182_Motor_1Perm);
P182_Motor.Inp_1PermOK := P182_Motor_1Perm.Sts_PermOK;
P182_Motor.Inp_1NBPermOK := P182_Motor_1Perm.Sts_NBPermOK;
P182_Motor.Inp_Hand := E300_P182:I.OperatorStationLocalLEDReadback;
P182_Motor.XCmd_Start1 := E300_P182:I.Pt03Data;
P182_Motor.XCmd_Start2 := E300_P182:I.Pt04Data;
P182_Motor.XCmd_Stop := NOT(E300_P182:I.Pt05Data);
P182_Motor.XCmd_Acq := E300_P182:I.Pt02Data;
PMTR_ci(P182_Motor,P182_CtrlSet,P182_CtrlCmd,P182_CtrlSts);
See also
Data Conversions on page 1086
Process Proportional + This information applies to the ControlLogix 5380P and 5580P controllers.
Integral + Derivative (PPID) Use the Process Proportional + Integral + Derivative (PPID) instruction to
manipulate the Control Variable (CV) in regulatory control loops in response
to Process Variable (PV) readings and Setpoint (SP, the target PV) settings.
The PPID instruction integrates functions of the existing PID, PIDE, and
P_PIDE AOI into a single built-in instruction and adds additional features.
Available Languages
Ladder Diagram
Structured Text
PPID(PPID tag, BusObj);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_PID tag Data structure required for proper operation of instruction.
BusObj BUS_OBJ tag Bus component. May be null.
P_PID Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, or hidden, members are used in HMI faceplates and are
not programmatically accessible. Private members are listed in separate tables
after public members.
Public input member Data Default Value Description
Type
EnableIn BOOL True Enable input.
Ladder Diagram:
Corresponds to the rung condition.
Default is true.
Inp_InitializeReq BOOL True 1 = Request to initialize the instruction. The instruction is normally initialized in
instruction first run. Use this request to re-initialize. When Inp_InitializeReq = 1,
power up configuration values are used. The instruction clears this operand
automatically.
Default is true.
Inp_OwnerCmd DINT 0 Owner device command:
0 = None,
Inp_OwnerCmd.10 = Operator Lock,
Inp_OwnerCmd.11 = Operator Unlock,
Inp_OwnerCmd.12 = Program Lock,
Inp_OwnerCmd.13 = Program Unlock,
Inp_OwnerCmd.14 = Acquire Maintenance,
Inp_OwnerCmd.15 = Release Maintenance,
Inp_OwnerCmd.16 = Acquire External,
Inp_OwnerCmd.17 = Release External,
Inp_OwnerCmd.29 = Echo.
Default is 0.
Inp_PV REAL 0.0 Process Variable (PVEU).
Valid any float.
Default is 0.0.
Inp_CascSP REAL 0.0 SP in Cascade loop mode, independent PV in Ratio loop mode (PVEU).
Valid any float.
Default is 0.0.
Inp_FF REAL 0.0 FeedForward term (CVEU).
Valid any float between -(Cfg_CVEUMax-Cfg_CVEUMin) and (Cfg_CVEUMax-
Cfg_CVEUMin).
Default is 0.0.
Inp_FFPrev REAL 0.0 Previous scan FeedForward (CVEU) when Inp_UseFFPrev = 1.
Valid any float between -(Cfg_CVEUMax-Cfg_CVEUMin) and (Cfg_CVEUMax-
Cfg_CVEUMin).
Default is 0.0.
Inp_CVTrack REAL 0.0 CV to track if Cfg_UseCVTrack = 1 or if Inp_InnerAvailable = 0 (CVEU).
Valid any float.
Default is 0.0.
Inp_CVInitialVal PVREAL 0.0 Value to initialize the CV to per request Inp_UseCVInitialVal=1 (CVEU).
Valid any float.
Default is 0.0.
Inp_CVPrev REAL 0.0 Previous scan CV, Val_CVOut (CVEU).
Valid any float between Cfg_CVEUMin and Cfg_CVEUMax.
Default is 0.0.
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_Fail Alm_Fail Instruction Failure.
Raised when the PPID instruction reports an Instruction Fault. The Fault is reported under any of these
conditions:
• Setpoint (SP) bad quality, Sts_SPBad = 1,
• Process variable (PV) bad quality, Sts_PVBad = 1,
• Control variable (CV) bad quality, Sts_CVBad = 1,
• Hand feedback (HandFdbk) bad quality, Sts_HandFdbkBad = 1.
Sts_IntlkTrip Alm_IntlkTrip Interlock Trip alarm.
Raised when non-bypassable interlocks are not OK or bypassable interlocks are not OK when not bypassed.
NAND(Inp_NBIntlkOK,(OR(Inp_IntlkOK,Stst_BypActive))).
Sts_HiHiDev Alm_HiHiDev High-High Deviation.
Raised when the amount by which the PV exceeds the setpoint or reference is above the High-High
Deviation threshold. The threshold, deadband, gating, and timing are set in configuration.
Sts_HiDev Alm_HiDev High Deviation.
Raised when the amount by which the PV exceeds the setpoint or reference is above the High Deviation
threshold. The threshold, deadband, gating, and timing are set in configuration.
Sts_LoDev Alm_LoDev Low Deviation.
Raised when the amount by which the PV exceeds the setpoint or reference is below the Low Deviation
threshold. (Since the threshold is a negative number, this reading is the amount the PV falls below the
setpoint or reference.) The threshold, deadband, gating, and timing are set in configuration.
Sts_LoLoDev Alm_LoLoDev Low-Low Deviation.
Raised when the amount by which the PV exceeds the setpoint or reference is below the Low-Low Deviation
threshold. (Since the threshold is a negative number, this reading is the amount the PV falls below the
setpoint or reference.) The threshold, deadband, gating, and timing are set in configuration.
There are Program, Operator, and External commands that enable the Reset
and Reset & Acknowledge of all alarms of the instruction (Alarm Set) at the
same time. This diagram shows how alarm condition interact with alarm
command.
Operation
In principle the PID core algorithm calculates CV with a formula configured
for dependent gains,
The following section uses exact tag names from P_PID structure. Variables
without a prefix, such as SP, PV, CVPrev, CVTrack, FF, FFPrev, and CtrlAction,
are internal variables used in calculation. Variables with prefix Inp_, Val_, of
Variables entering the PID formula must be in percent of span so the PID
gains do not depend on engineering units used for PV and CV. Scaling of
these parameters is calculated as Perc=min(100,max(0,(EU-EUMin)/(EUMax-
EUMin)*100)).
• Val_SP,
• Inp_PV,
• Inp_CVPrev,
• Inp_CVTrack,
• Cfg_CVHiLim,
• Cfg_LoLim,
• Cfg_CVRoCIncrLim,
• Cfg_CVRoCDecrLim
Scaling of Inp_FF and Inp_FFPrev is calculated as Perc=min(100,max(-
100,(EU-EUMin)/(EUMax-EUMin)*100)).
Reverse/Direct control action affects loop error sign that will be used in
further calculations:
Feedforward term.
The windup prevention mechanism monitors the internal CV value and drives
the integral term. The windup prevention mechanism uses these rules:
Deviation deadband
CV is not sensitive to loop error variation when within the band around zero
error. Configured band levels allow for additional hysteresis. Deadband level
for PV approaching SP (Cfg_DevDBEnter) may be set lower than deadband
level for PV going away from SP (Cfg_DevDB). Active deadband status
(Sts_DevDBAct) is set for PV within deadband. An option to stop CV moves or
just stop the integration while leaving proportional and derivative action live
when in deadband is provided (Cfg_UseIntegDevDB).
SP handling
The PPID instruction checks the setpoint for validity before the SP value is
provided to the PID algorithm for processing. SP fails if:
SP value holds, shed to the current SP value and the status flag is set
(Sts_SPHeld=1), if:
• Interlock trips and the follow up action is to leave the value unchanged
(Cfg_IntlkTripSPAction=1), or
• SP fails and the instruction is configured to follow with the setpoint
not changed (Cfg_SPFailSPAction=1), or
• PV fails and the instruction is configured to follow with the setpoint
not changed (Cfg_PVFailSPAction=1), or
SP value sets to the current PV value (Val_SPSet=Val_PV) and the status flag is
set (Sts_SPShedPV=1) if:
• Interlock trips and the follow up action is to leave the value unchanged
(Cfg_IntlkTripSPAction=3), or
• SP fails and the instruction is configured to follow with the setpoint
not changed (Cfg_SPFailSPAction=3), or
• CV fails and the instruction is configured to follow with the setpoint
not changed (Cfg_CVFailSPAction=3) and higher shed priority is not
applied (Sts_IntlkSP=0 & Sts_SPHeld=0) and PV is good
(Sts_PVBad=0).
If SP is not from shed and SP clamping limits are valid, other sources for SP
value are checked.
If the loop is not Cascade and Program has SP, PSet_SP is used.
If the loop is not Cascade and External has SP, XSet_SP is used.
If the loop is not Cascade and Override is selected, Inp_OvrdSP is used.
SP ramp wizard
SP ramp wizard allows Operator/Program/External/Override to enter the SP
target and time to reach target (ramp time) and calculate SP moves to reach
entered target in entered time when starting from current SP when the
wizard is commanded to start. Ramping characteristic is defined by the SP
ramp target (SPTarget) and SP ramp time (SPRampTime) as described below.
SP ramping
Setpoint ramping prevents both CV spikes and bumps by eliminating sudden
setpoint changes. Although setpoint ramping can be an advantage for single
loop control or for the primary (outer) controller of a cascade configuration,
neither setpoint ramping nor proportional-on-PV should be used on the
secondary (inner) controller of a cascade loop, as that would degrade the
responsiveness of the secondary loop.
SP scaling
If PV scaling limits are valid (Sts_ErrPVEU=0) SP in PVEU is scaled to percent
used in PID calculation, SP = (SPEU-Cfg_PVEUMin)/(Cfg_PVEUMax-
Cfg_PVEUMin)×100.
CV handling
CV selection in Manual
In Manual loop mode, if CV clamping limits are valid, the CV is selected from
the active source (Program/ Operator/ External/ Override). If Program has
CV, PSet_CV is selected, and so on. The PPID instruction is ready for OSet_CV
(ORdy_CV=1) under the following conditions: operator entry is not configured
for tracking in Program/Operator/External (Cfg_SetTrack=0), or command
source is Hand or Override and operator entry is not configured for tracking
in Hand or Override (Cfg_SetTrackOvrdHand=0).
CV shed
Val_CVSet holds the last good CV value and the CV value replacement status is
set (Sts_CVHeld=1) when
• Interlock trips and CV action is configured for last good CV value
(Cfg_IntlkTripCVAction=1), or
• SP fails and follow up action on CV is configured for last good CV value
(Cfg_SPFailCVAction=1) and the loop mode is Auto or Cascade or SP
did not fail in previous scan (SP fail rising edge), or
• PV fails and follow up action on CV is configured for last good CV
value (Cfg_PVFailCVAction=1) and the loop mode is Auto or Cascade or
PV did not fail in previous scan (PV fail rising edge), or
• PV substituted at PAI (Inp_PVSrcQ=18) and the loop mode is Auto or
Cascade, or
• CV fails and follow up action on CV is configured for last good CV
value (Cfg_CVFailCVAction=1) and the loop mode is Auto or Cascade or
CV did not fail in previous scan (CV fail rising edge).
For Sts_CVHeld=1 the CV is not updated.
Note: When PV, CV, or SP fails, the last good CV value stays at output, but it can be still overwritten
in Manual loop mode.
CV clamping
If CV clamping limits are valid (Sts_ErrCVLim=0) and the loop mode is not
Manual, or is Manual but the configuration is set not to skip CV clamping
(Cfg_SkipCVManLim=0), the calculated or set value of CV (CVSet) is clamped
at Cfg_CVHiLim and Cfg_CVLoLim. The corresponding status bits
(Sts_CVHiClamped, Sts_CVLoClamped, and Sts_CVClamped) are set if the CV
is clamped.
CV output in percent
CVOut, which is calculated in Auto/Cascade or entered from various sources
in Manual, is scaled to percent and made available as Val_CVOutPercent.
Val_CVOutPercent=0 if CV scaling limits are invalid.
This diagram shows the main steps in CV processing.
Interlock handling
Maintenance commands to bypass or check bypassable interlocks are
processed. Interlock bypassing is active if requested (MCmd_Bypass=1). The
bypassing request remains active (Sts_Bypass=1) until a maintenance
command to check bypassable alarms (MCmd_Check=1) is received.
Bypassing is active (Sts_BypActive=1) if requested (Sts_Bypass=1), or in
Maintenance (Sts_Maint=1), or in Override (Sts_Ovrd) if the instruction is
configured for bypassing interlocks in Override (Cfg_OvrdIntlk). If an
Interlock is NOT OK (bypassable or not), and if any action is configured on the
Interlock, the Interlock NOT OK latch is shed.
If the loop mode was not zero for Power up (Cfg_PwrUpLM) and multiple loop
modes were set internally, the instruction makes sure only one loop mode is
set at a time, using this order of priority: Manual, then Auto, then Cascade. If
the Powerup loop mode is 0, the loop mode, CV, and SP are left in their last
(powerdown) states. Once initialization is complete the initialization request
is cleared and the instruction is reported initialized (Sts_Initialized = 1).
The PPID instruction ensures a valid number of decimal places for PV and CV
display in the HMI. Cfg_xxDecPlcs =2 if an invalid number is entered. The
PPID instruction ensures valid action on SP/PV/CV fail. Cfg_SPFailSPAction =
1, Cfg_PVFailPVAction = 1, and Cfg_CVFailCVAction = 1 for any invalid
number entered. The PPID instruction ensures valid Keep configuration on
eKeepLM, CV, Ratio and SP. Cfg_eKeepxx = 0 (follows command source) if an
invalid value is entered.
Owned by Operator
The CV is owned by Operator if:
Owned by Program
The CV is owned by Program if:
Owned by External
The CV is owned by External if:
PPID statuses
PV bad status
The Process variable fails in case of invalid PV scaling limits, and the PV is
reported bad at source via Inp_PVBad input or quality index Inp_PVSrcQ. The
PV cannot be used in PID calculations if the source quality is bad. The PV is
also treated as failing if the PV is live but reported uncertain or just off-spec
and the PPID is configured for treating this situation as unacceptable
(Cfg_PVFailTrigger=1 or 2).
SP bad status
Setpoint fails if:
CV bad status
CV is bad if:
• Inp_CVIOFault=1, or
• CV clamping limits are invalid (Sts_ErrCVLim=1), or
• CV scaling limits are invalid (Sts_ErrCVEU=1),or
Windup status
Windup status High (Sts_WindupHi) is set if:
Active status
Status CV active (Sts_Active) is set if Val_CVOut is greater than
Cfg_MaxInactiveCV. The HMI graphic symbol, for example, valve open, is
shown for Sts_Active=1, and the inactive HMI graphic symbol, for example,
valve closed, is shown when Sts_Active=0.
Available statuses
The PPID instruction is available (Sts_Available=1) to other objects when in
Program mode, not in the first scan, and generally ready for control.
This diagram shows the conditions required for the instruction to be generally
ready for control.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• Path to an object with more information
• Path to an object providing Cascade SP
• Path to an object providing PV
• Path to an object consuming CV
• PV/SP engineering units
• CV engineering units
Command source
The instruction uses these command sources. The command sources are
prioritized in order from highest to lowest in this table.
Command source Description
Hand Hardwired logic or other logic outside the instruction owns control of the device. The instruction tracks the state of the
device for bumpless transfer back to one of the other command sources.
While in Hand mode the PID algorithm does not compute the change in CV.
Val_CVOut = Inp_HandFdbk (Inp_Tieback), regardless of the control mode. Hand mode is typically used to indicate that
control of the final control element was taken over by a field hand/auto station.
Set Inp_Hand to request hand mode. This value is usually read as a digital input from a hand/auto station.
(Highest Priority command source)
Out-of-Service The instruction is disabled and has no owner.
Maintenance Maintenance owns control of the device and supersedes Operator, Program, External and Override control. Operator
commands and settings from the HMI are accepted. Bypassable interlocks are bypassed, and device timeout checks are not
processed.
Override Priority logic owns control of the device and supersedes Operator, Program and External control. Override Input
(Inp_OvrdCmd) is accepted. If so configured, bypassable interlocks are bypassed.
External External logic owns control of the device. External commands (XCmd_) are accepted.
Program locked Program logic owns control of the device. Program commands (PCmd_) are accepted. Operator cannot take from Program.
Override cannot take from Program unless Cfg_OvrdOverLock = 1.
Program Program logic owns control of the device. Program commands (PCmd_) are accepted.
Operator locked The Operator owns control of the device. Operator commands (OCmd_) from the HMI are accepted. Program cannot take
from Operator. Override cannot take from Operator unless Cfg_OvrdOverLock = 1.
Operator The Operator owns control of the device. Operator commands (OCmd_) from the HMI are accepted.
(Lowest Priority command source)
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
The PID algorithm is only scanned at the configured execution rate
Cfg_ExecTime. Configuring the instruction for execution period = 0.0
(default) or for a period shorter than the instruction scan time has no effect
and the PID algorithm executes every scan. For the real execution period
check Val_ExecTime.
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Sts_eSrc is set to 0. Sts_bSrc is set to 0.
Instruction first run All commands that are automatically cleared each execution are cleared
and ignored.
The Program/Operator selection is set based on the configuration
(Cfg_ProgPwrUp).
The Program or Operator lock selection is set to unlocked.
Loop mode is set according to configuration (Cfg_PwrUpLM). Initial value pf
SP and CV are set according to Cfg_SPPwrUp and Cfg_CVPwrUp and
selected loop mode. If Cfg_PwrUpLM=0 (no change), SP and CV initial
values are equal to values from last scan (e.g. before power down).
PSet_Owner and Sts_Owner are set to 0.
Rung-condition-in is false The instruction is put Out of Service if Inp_Hand=0. The output is de-
energized. All alarms are cleared.
Command source selection processing proceeds as normal except that all
ownership status bits (Sts_Maint, Sts_Ovrd, Sts_Ext, Sts_Prog and Sts_Oper)
are cleared to 0. When rung-condition-in becomes true, the instruction
takes into account the commands received and sets the active command
source accordingly.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Ladder Diagram table.
Instruction first run See Instruction first run in the Ladder Diagram table.
EnableIn is true See Rung-condition-in is true in the Ladder Diagram table.
Postscan EnableIn and EnableOut bits are cleared to false.
Examples
If the pump motor, the device driven by SZ_31, is in failure (M31_Fail=1), the
loop is also open and both SZ_31 and LIC_31 should follow the actual device
status to avoid any bump when put back in control. Actual motor rpm is
measured, the rpm raw signal is scaled to engineering units by analog input
instruction SI_31, and scaled value of rpm (SI_31.Val) is wired as a feedback
signal to SZ_31.Inp_PosFdbk.
If service personnel have the pump motor in hand mode (M31_Hand=1), actual
speed is provided separately in the M31_Fdbk tag, wired to
SZ_31.Inp_HandFdbk.
Finally update the alarm notification for the PPID and propagate the highest
severity notification from SZ_31 upstream. Wire SZ_31.Sts_eNotifyAll to
LIC_31.Inp_CVNotify.
Ladder Diagram
Structured Text
LI_30.Inp_PVData := LI_30_raw;
LI_30.Inp_ModFault := LevelAnalogModuleFault;
LI_30.Inp_OutOfSpec := LevelOutOfSpec;
PAI(LI_30,0);
LIC_31.Inp_PV := LI_30.Val;
LIC_31.Inp_CVTrack := SZ_31.Val_CVOut;
LIC_31.Inp_PVSrcQ := LIC_31.Inp_PVSrcQ;
LIC_31.Inp_PVNotify := LI_30.Sts_eNotifyAll;
LIC_31.Inp_CVNotify := SZ_31.Sts_eNotifyAll;
LIC_31.PSet_SP := LIC_31_SP;
LIC_31.Inp_WindupHi := SZ_31.Sts_WindupHi;
LIC_31.Inp_WindupLo := SZ_31.Sts_WindupLo;
PPID(LIC_31,0);
SI_31.Inp_PVData := SI_31_raw;
PAI(SI_31,0);
SZ_31.PSet_CV := LIC_31.Val_CVOut;
SZ_31.Inp_PosFdbk := SI_31.Val;
SZ_31.Inp_HandFdbk := M31_Fdbk;
SZ_31.Inp_DeviceFault := M31_Fail;
SZ_31.Inp_Hand := M31_Hand;
PAO(SZ_31,0);
SZ_31_raw := SZ_31.Out_CVData;
In this example, a cascaded loop provides better control by opening the steam
valve when the steam flow drops before the liquid temperature in the tank
drops. To implement a cascaded loop, use a PPID instruction to control the
steam valve opening based on a process variable signal from a steam flow
transmitter. This is the inner loop of the cascaded pair. A second PPID
instruction (called the outer or primary loop) uses the liquid temperature as a
process variable and sends its CV output into the setpoint of the inner loop. In
this manner, the outer temperature loop asks for a certain amount of steam
flow from the inner steam flow loop. The steam flow loop is then responsible
for providing the amount of steam requested by the temperature loop in order
to maintain a constant liquid temperature.
For a cascaded pair of loops to work correctly, the inner loop must have a
faster process response than the primary loop. This is because the inner loop’s
process must be able to compensate for any upsets before these upsets affect
the outer loop’s process. In this example, if steam flow drops, the steam flow
must be able to increase as a result of the inner controller’s action before the
liquid temperature is affected.
The PPID instruction has several other features to more effectively support
cascade control. Wire the Sts_CascAvailable output on the inner loop PPID
into the Inp_InnerAvailable input on the outer loop PPID and wire the Val_SP
The example is shown in FBD in two versions, with minimum wiring and
extended wiring. The extended wiring shows passing alarm notification
between outer and inner PID and makes signal quality input pins visible for
immediate use in the application.
To perform ratio control with a PPID instruction, set the Cfg_HasCasc and
Cfg_HasRatio input parameters. Wire the uncontrolled flow into the
Inp_CascSP input parameter. When in Cascade/Ratio mode, the uncontrolled
flow is multiplied by either the OSet_Ratio, when in Operator control, or the
PSet_Ratio, when in Program control, and the resulting value is used by the
PPID instruction as the setpoint.
The example is shown in FBD.
In this example, the dominant load in the system is oil flow rate, caused by
changes in demand at the combustion furnace where the oil is being used as
fuel. Adapting this control system to include feedforward requires installing
an oil flow transmitter and a gain/bias function providing feedforward action
to the PID controller maintaining temperature. With feedforward control
action in place, the steam flow rate immediately changes with oil flow rate,
preemptively compensating for the increased or decreased heat demand of
the oil. The time constant of the process with regard to steam flow changes is
greater than the time constant of the process with regard to oil flow changes.
Oil flow is a wild variable. The feedforward control system can only
manipulate the steam valve position in response to oil flow. The best method
to help control it is to speed up the time constant of the steam flow variable,
which the system can influence. The solution is to wire the output of the user-
specified lead function FY_32 to Inp_FF of the PPID.
Now, when the oil flow rate to this heat exchanger suddenly increases, the
lead function will add a surge to the feedforward signal, quickly opening the
steam valve and sending a surge of steam to the exchanger to help overcome
the naturally sluggish response of the oil temperature to changes in steam
flow. The feedforward action won’t be perfect with this lead function added,
but it will be substantially better than if there was no dynamic compensation
added to the feedforward signal.
The Primary loop is the station discharge pressure. Suction pressure and
motor current are Override loops. The low-select picks the lowest CV to send
to the drive speed reference. Suction pressure and motor current loops’
setpoints are set to the constraint threshold (where to start acting). When a
constraint is approached, that loop’s error gets small, its output drops, and it
is selected. The selected CV is fed back to all three loops. The control scheme
takes the advantage of using Inp_CVTrack for tracking final CV.
See also
Index Through Arrays on page 1094
Process This information applies to the ControlLogix 5380P and 5580P controllers.
Available Languages
Ladder Diagram
Structured Text
PPTC(PPTC_01);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_PRESS_TEMP_COMPENSA tag Data structure required for proper operation of the instruction.
TED
P_PRESS_TEMP_COMPENSATED Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input. Ladder Diagram: Corresponds to the rung-condition-in.
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in
instruction first run. Use this request when reinitialization is needed. The instruction
clears this operand automatically.
Default is true.
Inp_TAct REAL Actual (measured) temperature, can be absolute or common units. Valid = any float.
Default is 0.0.
Inp_PAct REAL Actual (measured) pressure, can be absolute or common units. Valid = any float.
Default is 0.0.
Operation
The PPTC instruction is intended as a calculation function only, between
other blocks. If a faceplate or alarms are needed, the calculated output from
the instruction can be sent to a PAI (analog input) instruction for alarming
and display.
Virtualization
Virtualization is not applicable to the PPTC instruction.
Initialization
The instruction is normally initialized in the instruction first run. Re-
initialization can be requested any time by setting Inp_InitializeReq = 1. For
proper initialization, when adding the instruction while performing an online
edit of the code, make sure that Inp_InitializeReq = 1, the default value.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run The instruction executes normally.
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.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
In this example, the PPTC instruction to determine the flow rate of
compressed nitrogen at a standard pressure and flow. This can provide a
more accurate measurement for custody transfer or control calculations
where there is variability in environmental conditions and the flow
transmitter is not capable of performing the compensation.
In this case, the PPTC instruction measures flow from a dp-transmitter. The
transmitter provides the controller with a value that has been scaled to
volumetric flow but not compensated for environmental temperature and
pressure. We also have temperature and pressure measurements from where
the flow is measured. In this example, the desired standard pressure and flow
is 0 psig and 15 °C.
Ladder Diagram
Structured Text
TI101.Inp_PVData:=I_TE101;
TI101.Inp_PVUncertain:=I_TE101_Flt;
PAI(TI101);
PI101.Inp_PVUncertain:=I_PE101_Flt;
PAI(PI101);
FI101.Inp_PVData:=I_FE101;
FI101.Inp_PVUncertain:=I_FE101_Flt;
PAI(FI101);
FY101A.Inp_Tact:=TI101.Val;
FY101A.Inp_Pact:=PI101.Val;
FY101A.Inp_Fact:=FI101.Val;
PPTC(FY101A);
FI101.Inp_PVData:=FY101A.Out_Flow;
FI101.Inp_PVUncertain:=FY101A.Sts_Err;
PAI(FI101);
See also
Data Conversions on page 1086
Index Through Arrays on page 1094
Structured Text Syntax on page 1057
Function Block Faceplate Controls on page 1095
Process Restart Inhibit This information applies to the ControlLogix 5380P and 5580P controllers.
(PRI) Use the Process Restart Inhibit instruction for Large Motor (PRI) instruction
to prevent large motors from starting repeatedly. The high starting current
for a large motor causes heating. Continual starts or start attempts in a short
period overheat the motor windings and damage the motor.
The PRI instruction provides a rule-based state model for restarts. Do not use
the instruction to model or monitor heating and replace sensor-based motor
monitoring devices. Use the instruction to avoid overstressing a motor.
Available Languages
Ladder Diagram
Structured Text
PRI (PRI tag);
Operands
IMPORTANT Unexpected operation may occur if one of the Cold or Hot timers are set to 0.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_RESTART_INHIBIT tag PRI structure
P_RESTART_INHIBIT_INPUT Structure
Public members are standard (visible) Tag members that are
programmatically accessible. Private (hidden) members are used in HMI
faceplates and are not programmatically accessible. Private members are
listed in separate tables after public members.
Public Input Members Data Type Description
Enable Input - System Defined Parameter
EnableIn BOOL Default is true.
Operation
The PRI instruction provides these capabilities:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
Implementation
This illustration shows normal implementation with the input condition
mapped to Inp_Running, Inp_Starting, and Inp_Stopped on a separate
branch.
This illustration shows the implementation with the input condition mapped
to the PRI instruction using the rung-condition-in. When the rung-condition-
in is false (EnableIn is false) the instruction executes normally. To use the
rung-condition-in mapping method, set Inp_Running to 1, its default value.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run The instruction executes normally.
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.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
In this example, tag A100_MR_001 is the motor value monitored by the PRI
instruction.
Finally, PRI_01 is the output tag that will indicate the status of A100_MR_001
with appropriate delays and number of running and starts/attempts based on
whether the motor is allowed to start again.
Ladder Diagram
Structured Text
PRI_01.Inp_Stopped := A100_MR_001.Sts_Stopped;
PRI_01.Inp_Starting := A100_MR_001.Sts_Stopped;
PRI_01.Inp_Running := A100_MR_001.Sts_Running;
PRI(PRI_01);
See also
Data Conversions on page 1086
Process Run Time and Start This information applies to the ControlLogix 5380P and 5580P controllers.
Counter (PRT) The Process Run Time and Start Counter (PRT) instruction records the total
run time and number of instances the motor or other equipment starts. The
PRT is a software implementation of the mechanical hour meter that displays
the total motor runtime. Maintenance personnel use the run time and
equipment start variables to create a maintenance schedule for the applicable
equipment.
Available Languages
Ladder Diagram
Structured Text
PRT(PRT_01);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PRT P_RUN_TIME tag PRT structure
P_RUN_TIME Structure
Public Input Members Data Description
Type
EnableIn BOOL Enable Input – System Defined Parameter.
Inp_Starting BOOL 1 = Equipment is starting.
Default = false.
Inp_Running BOOL 1 = Equipment is confirmed running.
Default = true.
PCmd_ClearStarts BOOL Program Command to clear count of starts. The instruction clears this operand automatically.
Default = false.
PCmd_ClearMaxHrs BOOL Program Command to clear the maximum, continuous runtime for any start. The instruction
clears this operand automatically.
Default = false.
PCmd_ClearTotHrs BOOL Program Command to clear the total run time. The instruction clears this operand automatically.
Default = false.
Operation
The PRT instruction:
• Accumulates and displays the total running time for the associated
equipment.
• Accumulates and displays the count of starts or start attempts for the
associated equipment.
• Shows the amount of run time since the last start, or the length of the
current run. This total is held after the equipment is stopped, until the
next start, when it is reset to zero.
• Shows the maximum amount of time for any single run; this is the
highest value achieved by the previous total.
• Allows maintenance personnel, but not operators, to clear individually
the total run time, starts count, or maximum single run time. This lets
the times be reset when the motor or other equipment is serviced,
rebuilt or replaced.
This diagram illustrates the functionality of the PRT instruction:
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
Implementation
This illustration shows normal implementation with the input condition
mapped to Inp_Running and Inp_Starting on a separate branch.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Total run time, Maximum run time and starts count are retained through a
power cycle. Current run time is reset (internally only, Val_CurHours is
maintained for display).
All Prog, Maint, commands that are automatically cleared each execution
are cleared.
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.
Condition/State Action Taken
Prescan See Prescan in the Ladder Diagram table.
Instruction first run See Instruction first run in the Ladder Diagram table.
EnableIn is true See Rung-condition-in is true in the Ladder Diagram table.
Postscan EnableIn and EnableOut bits are cleared to false.
Example
In the following example, tag A100_MR_001 is the motor value monitored by
the PRT instruction. This tag provides a Boolean indication of motor run time
value.
Ladder Diagram
Structured Text
PRT_01.Inp_Starting:=A100_MR_001.Sts_Starting;
PRT_01.Inp_Running:=A100_MR_001.Sts_Running;
PRT(PRT_01);
See also
Data Conversions on page 1086
Process Tank Strapping This information applies to the ControlLogix 5380P and 5580P controllers.
Table (PTST) The Process Tank Strapping Table (PTST) instruction calculates the volume of
product in an upright cylindrical tank, given the level of the product and the
tank calibration table. The instruction can compensate for:
Available Languages
Ladder Diagram
Structured Text
PTST(PTST_tag, Cfg_CalTbl);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx P_TANK_STRAPPING_TABLE tag Data structure required for proper operation of instruction.
Control
Cfg_CalTbl P_STRAPPING_TABLE_ROW tag Tank calibration table, level to volume.
P_TANK_STRAPPING_TABLE Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable input. Ladder Diagram: Corresponds to the rung-condition-in.
Default is true.
P_STRAPPING_TABLE_ROW Structure
Members Data Description
Type
Major REAL Number of major units (feet, meters). Valid = 0.0 to maximum positive float.
Minor REAL Number of minor units (inches, centimeters, or millimeters). Valid = 0.0 to maximum positive
float.
Volume REAL Tank volume (oil barrels, gallons, liters) at given level (feet, inches). Valid = 0.0 to maximum
positive float.
Operation
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• More Information
• Gross volume units
• Free water volume units
• Raw volume units
• Calculated tank temperature units
• Correction for tank temperature units
• Floating roof adjustments volume units
• Temperature for tank calibration units
• Temperature for API units
• Level units
• Volume units
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Instruction first run All internal statuses and calculations are reset.
The instruction executes normally.
Rung-condition-in is false Rung-condition-out is cleared to false.
Calculation values is not updated (holds last value).
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The
instruction executes when it is in the control path activated by the logic.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
In this example, the PTST instruction calculates the volume of product in a
storage tank based on the measured storage tank level and storage tank
strapping table information. There is no floating roof and no compensation
for displacement. There are no adjustments based on temperature to account
for thermal expansion of the tank.
Ladder Diagram
The measured storage tank level connects to the PTST instruction by using the
input Inp_Level. The level is in units of feet. The storage tank is four feet tall.
In this example, data is in six-inch increments. The strapping table has nine
rows:
Level (ft-in.) Volume (barrels)
0-00 3.1
0-06 136.6
1-00 264.2
1-06 402.7
2-00 541.4
2-06 692.7
3-00 844.1
3-06 990.8
4-00 1137.5
Structured Text
MyPTST.Inp_Level := MyLevel.Val;
MyVolume.Inp_PVUncertain := MyLevel.Sts_PVUncertain;
MyVolume.Inp_PVData := MyPTST.Val_TotObsVol;
PAI(MyLevel);
PTST(MyPTST,MyP_StrapTbl_CalTable);
PAI(MyVolume);
See also
Data Conversions on page 1086
Process Valve (PVLV) This information applies to the ControlLogix 5380P and 5580P controllers.
Available Languages
Ladder Diagram
Structured Text
PVLV(PVLVTag, BusObj);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx P_VALVE_DISCRETE tag Data structure required for proper operation of instruction.
ControlPlantPAx
Control
BusObj BUS_OBJ tag Bus component
P_VALVE_DISCRETE Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output Enable output. This output state always reflects
EnableIn input state.
Out_Pos1Data BOOL Not Visible Not Required Output 1 = Activate to move valve to Position 1.
Out_Pos2Data BOOL Visible Not Required Output 1 = Activate to move valve to Position 2.
Out_StopData BOOL Not Visible Not Required Output 1 = Break seal-in circuit in actuator to stop valve
motion.
Out_TripData BOOL Not Visible Not Required Output 1 = Trip valve to safe/fail state.
Out_HornData BOOL Not Visible Not Required Output 1 = Sound audible prior to commanded valve
start.
Out_Reset BOOL Not Visible Not Required Output 1 = Reset command has been received and
accepted.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
BusObj BUS_OBJ Visible Required InOut Bus component
BUS_OBJ Structure
The BUS_OBJ structure is used to link the valve to other devices and
instructions in a complex control strategy, typically into a hierarchy. A Bus
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
shown, or may be NULL. If NULL, the Bus functions of this instruction are not
available.
Members Data Type Description
Inp_Cmd DINT Input to assert commands
Out_Cmd DINT Resultant commands
Inp_CmdLLH DINT Input for level normally high commands
Out_CmdLLH DINT Resultant line level high commands
Inp_Sts DINT Input to assert status
Out_Sts DINT Resultant status
Inp_CmdAck DINT Input to assert a command acknowledgement
Out_CmdAck DINT Resultant command acknowledgements
Inp_SeverityMax DINT Input: maximum alarm severity
Out_SeverityMax DINT Resultant of maximum alarm severity
Cfg_CmdMask DINT Propagation mask for commands
Cfg_CmdLLHMask DINT Propagation mask for line level high commands
Cfg_StsMask DINT Propagation mask for status
Ref_Index DINT Bus array index
Alarms
Discrete Logix tag-based alarms are defined for these members:
Member Alarm Name Description
Sts_AcuatorFault Alm_AcuatorFault Raised if the Inp_ActuatorFault input is true. This alarm is provided for use by
valves that generate a fault contact, such as actuator motor overload trip.
Sts_FullStall Alm_FullStall Raised when the valve has and is using Position 2 and/or Position 1 limit
switches, an attempt is made to Position 2 or Position 1 the valve, and the limit
switches indicate that the valve did not move from its original position at all
within the configured time.
Sts_IOFault Alm_IOFault Raised when the Inp_IOFault input is true. This input is usually used to indicate
to the instruction that a communication failure has occurred for its I/O. If the
I/O Fault is configured as a shed fault, the valve is commanded to Stop motion
and cannot be commanded to either position until reset.
Sts_IntlkTrip Alm_IntlkTrip Raised when the valve is energized and an interlock Not-OK condition causes
the valve to be de-energized. If interlocks are not bypassed, a bypassable
interlock or a non-bypassable interlock Not-OK condition initiates an interlock
trip. If interlocks are bypassed, only a non-bypassable interlock Not-OK
condition initiates an interlock trip.
Sts_LossPos1 Alm_LossPos1 Raised when the valve has reached the confirmed Position 1 state and the
Position 1 confirmation feedback is lost.
Sts_LossPos2 Alm_LossPos2 Raised when the valve has reached the confirmed Position 2 state and the
Position 2 confirmation feedback is lost.
Mark the alarm as used or unused and set standard configuration members of
the discrete Logix tag-based alarm. Use this format to access alarm elements:
Tag.@Alarms.AlarmName.AlarmElement
Program, Operator, and External commands reset latched alarms, and reset
and acknowledge all alarms of the instruction (Alarm Set) at the same time.
This diagram shows how the commands interact with the PVLV instruction.
Operation
This diagram illustrates the functionality of the PVLV instruction:
• OCmd_ContPulse
Virtualization
Use virtualization for instruction testing and operator training. Use
PCmd_Virtual or MCmd_Virtual to enable virtualization. After finishing
virtualization, use PCmd_Physical or MCmd_Physical to return to normal
(physical device) operation.
Initialization
The instruction is normally initialized in the instruction first run. Request re-
initialization by setting Inp_InitializeReq = 1. For proper initialization, when
adding the instruction while performing an online edit of the code, make sure
that Inp_InitializeReq = 1, the default value.
• Description
• Label for graphic symbol
• Display Library for HMI Faceplate call-up
• Instruction name
• Area name
• URL link
• More Information
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Any commands received before first scan are discarded. The valve is de-
energized and treated as if it were commanded to safe position.
Instruction first run Any commands received before first scan are discarded. The valve state is
evaluated and the instruction aligns with the current state of the valve, as
if the Hand command source were selected.
Rung-condition-in is false Handled the same as if the valve is taken Out of Service by command. The
valve outputs are de-energized, and the valve Command Source is shown
as Program Out of Service on the HMI. All alarms are cleared. The rung-
condition-out continues as false.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
Ladder Diagram
Structured Text
MyPVLV.Inp_Pos1FdbkData:=MyPVLV_ZSC;
PVLV(MyPVLV, 0);
MyPVLV_Coil:=MyPVLV.Out_Pos2Data;
See also
Process Valve (PVLV) Command Source on page 767
Index Through Arrays on page 1094
Process Valve (PVLV) The Process Valve (PVLV) instruction uses these command sources. The
command sources are prioritized in order from highest to lowest in this table.
Command Source
Command Source Description
Hand Hardwired logic or other logic outside the instruction controls the device. The instruction tracks the state of the device for
bumpless transfer back to one of the other command sources.
This is the highest priority command source.
Out-of-Service The instruction is disabled. Drive commands and settings from any source are not accepted.
Maintenance Maintenance controls the device and supersedes Operator, Program, External and Override control. Operator commands and
settings from the HMI are accepted.
Override Priority logic controls the device and supersedes Operator, Program and External control. Override Input (Inp_Ovrd) is
accepted.
External External logic (for example, field pilot control or upstream SCADA) controls the device. External commands (XCmd_) are
accepted.
Program locked Program logic controls the device. Program commands (PCmd_) are accepted. Operator cannot take control from the
Program. Override cannot take control from theProgram unless Cfg_OvrdOverLock = 1.
Program Program logic controls the device. Program commands (PCmd_) are accepted.
Operator locked The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted. Program cannot take control
from Operator. Override cannot take control from Operator unless Cfg_OvrdOverLock = 1.
Operator The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted.
This is the lowest priority command source.
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other control sources may
be present in the model but act as overriding control sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program is the
power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
• Out-of-Service
• In-Service
• Hand
See also
Process Valve (PVLV)
Process Valve Statistics This information applies to the ControlLogix 5380P and 5580P controllers.
(PVLVS) The Process Valve Statistics Object (PVLVS) instruction monitors a two-state
(open and close) valve and records statistics for stroke times and stroke
counts to aid in planning maintenance or diagnosing valve and actuator
problems. The PVLVS instruction is designed to work with the PVLV
(solenoid, motor, and hand operated) valve instruction.
Available Languages
Ladder Diagram
Structured Text
PVLVS (PVLVS_01);
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_VALVE_STATISTICS tag Data structure required for proper
operation of the instruction.
P_VALVE_STATISTICS Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type Description
EnableIn BOOL Enable Input - System Defined Parameter
Default is true.
Inp_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in
instruction first run. Use this request when reinitialization is needed. The instruction
clears this operand automatically.
Inp_Closed BOOL 1 = Device is confirmed Closed.
Default is false.
Inp_Opened BOOL 1 = Device is confirmed Opened.
Default is false.
Inp_StopOther BOOL 1 = Device is confirmed Stopped / Other.
Default is false.
Cfg_HasStopOther BOOL 1 = Device has Stopped or other state(s) to be monitored.
Default is false.
Cfg_SlowOpenTime REAL Maximum time Opening (seconds) before raising Sts_SlowOpen. Valid = 0.0 to 2147483.0
seconds.
Default is 10.0.
Cfg_SlowCloseTime REAL Maximum time Closing (seconds) before raising Sts_SlowClose. Valid = 0.0 to 2147483.0
seconds.
Default is 10.0.
PCmd_ClearTotTimes BOOL Program command to clear total time statistics.
Default is false.
PCmd_ClearMaxTimes BOOL Program command to clear maximum time statistics.
Default is false.
PCmd_ClearStrokeCounts BOOL Program command to clear stroke count statistics.
Default is false.
PCmd_ClearSlowCounts BOOL Program command to clear device slow count statistics.
Default is false.
PCmd_ClearMAvgs BOOL Program command to clear moving average stroke times.
Default is false.
Operation
These diagrams illustrate the functionality of the PVLVS instruction:
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Rung-condition-out is cleared to false.
Total times, stroke counts and slow counts are maintained
through a power cycle. Current times are cleared.
The internal state is set to unknown. When an input shows the
valve in a known condition, the main logic transitions to the
corresponding state.
Instruction first run All commands that are automatically cleared each execution
are cleared and ignored.
The instruction executes normally.
Rung-condition-in is false Set rung-condition-out to rung-condition-in.
If this instruction is on a false rung, or if EnableIn is false in
FBD, Total times, stroke counts, and slow counts are
maintained, but Current times are cleared.
The internal state is set to unknown.
Copies the current time of the previous state to its last time
and resets the current time (and accumulated 10ths of hours, if
applicable).
The internal state is set to unknown (disabled).
When normal execution (Logic routine) is resumed, when an
input shows the valve in a known condition, a transition to the
corresponding state occurs.
Should scan all the retentive timers FALSE to stop them.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan Rung-condition-out is cleared to false.
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.
Condition/State Action Taken
Prescan See Prescan in the Ladder Diagram table.
Instruction first run See Instruction first run in the Ladder Diagram table.
EnableIn is true See Rung-condition-in is true in the Ladder Diagram table.
Postscan EnableIn and EnableOut bits are cleared to false.
Example
This section shows how the PVLVS instruction collects statistics on a motor-
operated valve. In this example, the motor-operated valve is controlled by
using the PVLVS instruction. By naming the PVLVS instance tag the same as
the PVLV tag plus ValveStats, the PVLVS instance tag is automatically linked
at the HMI to the valve instance. In this example, the motor-operated valve is
opened, closed, or the motor could stop moving while in travel before
reaching either position. Statistics for all of these three states can be tracked
by using the PVLVS instruction. In this example, the parameters Inp_Closed,
Inp_Opened, and Inp_StopOther are connected to the parameters Sts_Closed,
Sts_Opened, and Sts_Stopped of the PVLV instruction. The PVLVS instruction
keeps track of completed strokes, plus open and close strokes that are slower
than expected. The parameters Cfg_SlowOpenTime and Cfg_SlowCloseTime
are set to 10, to indicate that any transition longer than 10 seconds is
considered slow.
Ladder Diagram
Structured Text
PVLVMO_ValveStat.Inp_Closed := PVLVMO.Sts_Closed;
PVLVMO_ValveStat.Inp_Opened := PVLVMO.Sts_Opened;
PVLVMO_ValveStat.Inp_StopOther := PVLVMO.Sts_Stopped;
PVLVS (PVLVMO_ValveStat);
See also
Data Conversions on page 1086
Process Variable Speed This information applies to the ControlLogix 5380P and 5580P controllers.
Drive (PVSD) The Process Variable Speed Drive (PVSD) instruction monitors and controls a
variable speed motor using an AC (variable frequency) or DC drive. Use the
instruction to run or jog the motor, forward or reverse. The drive interface can
be through a Device Object Interface or through individual pins. The object is
a built-in version of the existing P_VSD add-on instruction in the Rockwell
Automation Library of Process Objects.
Use the PVSD instruction to:
Available Languages
Ladder Diagram
Structured Text
PVSD(PlantPAx Control, Ref_Ctrl_Set, Ref_Ctrl_Cmd, Ref_Ctrl_Sts, BusObj,
Ref_FaultCodeList)
Operands
IMPORTANT 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.
There are data conversion rules for mixing numeric data types within an
instruction. See Data Conversions.
Configuration Operands
Operand Type Format Description
PlantPAx Control P_VARIABLE_SPEED_DRIVE tag Data structure required for proper operation of
instruction.
Ref_Ctrl_Set RAC_ITF_DVC_PWRVELOCITY_SET tag Velocity Automation Device Object Settings Interface.
Ref_Ctrl_Cmd RAC_ITF_DVC_PWRVELOCITY_CMD tag Velocity Automation Device Object Command Interface.
Ref_Ctrl_Sts RAC_ITF_DVC_PWRVELOCITY_STS tag Velocity Automation Device Object Status Interface.
BusObj BUS_OBJ tag Bus component.
Ref_FaultCodeList RAC_CODE_DESCRIPTION[x] tag Fault Code to Fault Description lookup table for
intelligent motor controller.
P_VARIABLE_SPEED_DRIVE Structure
Public members are standard, visible tag members that are programmatically
accessible. Private, hidden members are used in HMI faceplates and are not
programmatically accessible. Private members are listed in separate tables
after public members.
Public Input Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableIn BOOL Not Visible Not Required Input Enable Input - System Defined Parameter
Default is true.
Inp_InitializeReq BOOL Not Visible Not Required Input 1 = Request to initialize the instruction. The
instruction is normally initialized in instruction
first run. Use this request when reinitialization is
needed. The instruction clears this operand
automatically.
Default is true.
Inp_OwnerCmd DINT Not Visible Not Required Input Owner device command.
0 = None,
.10 = Operator Lock,
.11 = Operator Unlock,
.12 = Program Lock,
.13 = Program Unlock,
.14 = Acquire Maintenance,
.15 = Release Maintenance,
.16 = Acquire External,
.17 = Release External,
.29 = Echo.
Default is 0.
Inp_SpeedFdbkData REAL Not Visible Not Required Input Speed feedback in drive (raw) units (example: 0 to
32767 in drive units represents 0 to max
frequency).
Default is 0.0.
Inp_DatalinkData REAL Not Visible Not Required Input Auxiliary signal (datalink) input in drive (raw)
units.
Default is 0.0.
Inp_LastFaultCodeData DINT Not Visible Not Required Input Most recent drive fault code (enumeration).
Default is 0.
Public Output Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
EnableOut BOOL Not Visible Not Required Output Enable Output - System Defined Parameter
Out_SpeedRefData REAL Not Visible Not Required Output Speed reference in drive (raw) units (example: 0
to 32767 in drive units represents 0 to max
frequency).
Sts_ErrSpeedRefLim BOOL Not Visible Not Required Output 1 = Error in Config: Speed Ref Limit Min > Max.
Sts_ErrSpeedRefEU BOOL Not Visible Not Required Output 1 = Error in Config: Speed Ref EU Min = Max.
Sts_ErrSpeedRefRaw BOOL Not Visible Not Required Output 1 = Error in Config: Speed Ref Raw Min = Max.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_Ctrl_Set RAC_ITF_DVC_ Visible Required InOut Velocity Automation Device Object Settings
PWRVELOCITY Interface.
_SET
Ref_Ctrl_Cmd RAC_ITF_DVC_ Visible Required InOut Velocity Automation Device Object Command
PWRVELOCITY Interface.
_CMD
Ref_Ctrl_Sts RAC_ITF_DVC_ Visible Required InOut Velocity Automation Device Object Status
PWRVELOCITY Interface.
_STS
BusObj BUS_OBJ Visible Required InOut Bus component.
Ref_FaultCodeList RAC_CODE_DE Visible Required InOut Fault Code to Fault Description lookup table for
SCRIPTION[1] intelligent motor controller.
RAC_ITF_DVC_PWRVELOCITY_SET Structure
The RAC_ITF_DVC_PWRVELOCITY_SET structure is the first of three
structures exchanged with the associated Power Velocity Device Object to
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
shown, or may be NULL. If NULL, other pins on the instruction are used to
link the necessary data.
Members Data Type Description
InhibitCmd BOOL 1 = Inhibit user Commands from external sources, 0 = Allow Commands.
InhibitSet BOOL 1 = Inhibit user Settings from external sources, 0 = Allow Settings.
Speed REAL Speed reference (Hz). Valid = 0.0 to maximum drive frequency.
RAC_ITF_DVC_PWRVELOCITY_CMD Structure
The RAC_ITF_DVC_PWRVELOCITY_CMD structure is the second of three
structures exchanged with the associated Power Velocity Device Object to
interface with the variable speed drive device. This structure handles
commands, such as start, stop and jog, sent to the drive. It is an InOut
parameter configured as optional (May Be Null).
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
shown, or may be NULL. If NULL, other pins on the instruction are used to
link the necessary data.
RAC_ITF_DVC_PWRVELOCITY_STS Structure
The RAC_ITF_DVC_PWRVELOCITY_STS structure is the third of three
structures exchanged with the associated Power Velocity Device Object to
interface with the variable speed drive device. This structure handles status,
such as the speed feedback, active status, commanded and actual direction,
received from the drive. It is an InOut parameter configured as optional
(May Be Null).
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
BUS_OBJ Structure
The BUS_OBJ structure links the variable speed drive to other devices and
instructions in a complex control strategy, typically into a hierarchy. A Bus
Object rolls up status and alarm information from lower level devices to
higher level control and fans out commands from higher level control to lower
level devices, and items link to the bus by referencing a single member of the
BUS_OBJ array associated with the bus.
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
shown, or may be NULL. If NULL, the Bus functions of this instruction are not
available.
RAC_CODE_DESCRIPTION[x] Structure
The RAC_CODE_DESCRIPTION[x] structure is an array of drive fault code
number and fault code description pairs, used as a lookup table. The
instruction searches the table for the fault code received from the drive and
displays the corresponding fault description text.
This parameter links the instruction to an external tag that contains necessary
data for the instruction to operate. The external tag must be of the data type
shown, or may be NULL. If NULL, the fault code lookup function is not
performed. Fault descriptions will only be shown if provided through the
Device Object Status interface.
Members Data Type Description
Code DINT Code for which to look up Description.
Desc STRING Description for given Code.
RAC_EVENTStructure
RAC_EVENTstructures are used by the FirstFault and FirstWarning members
in the RAC_ITF_DVC_PWRVELOCITY_STS structure. These items hold the
event data received from the drive for the first drive fault and first drive
warning records in the drive event history.
Members Data Type Description
Type DINT Event type:
1 = Status,
2 = Warning,
3 = Fault,
4 ...n = User.
ID DINT User-definable event ID.
Alarms
Discrete Logix tag-based alarms are defined for these members:
Member Alarm Name Description
Sts_FailToStart Alm_FailToStart Drive failed to start within the allotted time when commanded to start.
Sts_FailToStop Alm_FailToStop Drive failed to stop within the allotted time when commanded to stop.
Sts_IntlkTrip Alm_IntlkTrip Drive stopped by an Interlock Not OK.
Sts_IOFault Alm_IOFault Drive communication with controller failed.
Sts_DriveFault Alm_DriveFault The variable speed drive is reporting it has a fault condition.
Mark the alarm as used or unused and set standard configuration members of
the discrete Logix Tag based alarm. Use this format to access alarm elements:
Tag.@Alarms.AlarmName.AlarmElement
• Raises the Fail to Start alarm when the drive is commanded to start but
run feedback is not received within the configured failure time.
• Raises the Fail to Stop alarm when the drive is commanded to stop but
run feedback does not drop within the configured failure time.
• Raises the Interlock Trip alarm when the motor is running and an
interlock not-OK condition causes the motor to stop. If interlocks are
not bypassed, a bypassable interlock or a non-bypassable interlock not-
OK condition initiates an interlock trip. If interlocks are bypassed, only
a non-bypassable interlock not-OK condition initiates an interlock trip.
• Raises the I/O Fault alarm when I/O communication with the variable
speed drive is lost. For the Power Velocity Device interface, this is
detected when the Ref_Ctrl_Sts.Connected bit goes false (to 0). For
the discrete signal interface, used when Ref_Ctrl_Sts is NULL, this is
detected when Inp_IOFault goes true (to 1).
• Raises the Drive Fault alarm when the drive reports a drive faulted
condition. For the Power Velocity Device interface, this is detected
when the Ref_Ctrl_Sts.Faulted bit goes true (to 1). For the discrete
signal interface, which is used when Ref_Ctrl_Sts is NULL, this is
detected when Inp_Faulted goes true (to 1).
Program, Operator, and External commands reset latched alarms, and reset
and acknowledge all alarms of the instruction (Alarm Set) at the same time.
This diagram shows how the commands interact with the PVSD instruction.
Operation
This diagram illustrates functionality of the PVSD instruction:
The second diagram illustrates the handling of the drive speed reference
(setpoint) and drive speed feedback:
The third diagram illustrates the handling of the optional input datalink and
output datalink functions:
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition/State Action Taken
Prescan Any commands received before first scan are discarded. The motor is de-
energized and treated as if it were commanded to stop.
Instruction first run Any commands received before first scan are discarded. The motor state
is evaluated and the instruction aligns with the current state of the motor,
as if the Hand command source were selected.
Rung-condition-in is false Handled the same as if the motor is taken Out of Service by command. The
motor outputs are de-energized, and the motor Command Source is shown
as Program Out of Service on the HMI. All alarms are cleared. The rung-
condition-out continues as false.
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
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.
Condition/State Action Taken
Prescan See Prescan in the Function Block Diagram table.
Instruction first run See Instruction first run in the Function Block Diagram table.
EnableIn is true See EnableIn is true in the Function Block Diagram table.
Postscan See Postscan in the Function Block Diagram table.
Example
In the following example, the first three reference (InOut parameter) tags are
used to interface to a Power Velocity Device object, provided by Commercial
Engineering. These tags provide the Speed Reference setting to the drive,
the various activate (start), deactivate (stop), and clear fault commands to the
drive, and drive status from the drive, including status such as active
(running), actual speed, commanded and actual direction, and fault and
warning information and test. The next InOut parameter links this drive to
a bus of related devices, control modules, equipment modules and unit(s) in a
hierarchy used to fan out commands and roll up status and alarm information
for use in complex control strategies and sequences.
In this example, the Fault Code List parameter is not used because the textual
fault information is received from the Power Velocity Device object, and no
lookup from a fault code is required in this instance.
Ladder Diagram
Structured Text
PVSD(MyNG_PVSD, MyNG_PVSD_Ctrl_Set, MyNG_PVSD_Ctrl_Cmd,
MyNG_PVSD_Ctrl_Sts, MyNG_Bus[19], 0)
See also
Process Variable Speed Drive (PVSD) Command Source on page 816
Process Variable Speed The Process Variable Speed Drive (PVSD) instruction uses these command
sources. The command sources are prioritized in order from highest to
Drive (PVSD) Command lowest.
Source
Command Source Description
Hand Hardwired logic or other logic outside the instruction controls the device. The instruction tracks the state of the device for
bumpless transfer back to one of the other command sources.
This is the highest priority command source.
Out-of-Service The instruction is disabled. Drive commands and settings from any source are not accepted.
Maintenance Maintenance controls the device and supersedes Operator, Program, External and Override control. Operator commands and
settings from the HMI are accepted.
Override Priority logic controls the device and supersedes Operator, Program and External control. Override Input (Inp_Ovrd) is
accepted.
External External logic (for example, field pilot control or upstream SCADA) controls the device. External commands (XCmd_) are
accepted.
Program locked Program logic controls the device. Program commands (PCmd_) are accepted. Operator cannot take control from the
Program. Override cannot take control from theProgram unless Cfg_OvrdOverLock = 1.
Program Program logic controls the device. Program commands (PCmd_) are accepted.
Operator locked The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted. Program cannot take control
from Operator. Override cannot take control from Operator unless Cfg_OvrdOverLock = 1.
Operator The Operator controls the device. Operator commands (OCmd_) from the HMI are accepted.
This is the lowest priority command source.
The core control model arbitrates the source of the commands and
parameters that the receiving function accepts. The core control model
determines if the source is:
• Oper
• OperLocked
• Prog
• ProgLocked
The control model defaults to this configuration. Other control sources may
be present in the model but act as overriding control sources, acting
independent of the base Operator/Program state machine.
Prog Power Up
Configuration allows the user to specify whether Operator or Program is the
power-up default.
Prog Priority
Configuration allows the user to specify whether Operator or Program
commands take priority when simultaneously asserted.
• External
• Override
• Maintenance
• Out-of-Service
• In-Service
• Hand
Implementation
The PVSD instruction monitors and controls a variable speed drive. The
speed reference and the start, stop and jog commands to the drive can come
from a variety of sources, determined by an embedded instance of PCMDSRC.
Available command sources are:
The PVSD instruction supports interlocks, conditions that must be OK for the
motor to run and which stop the motor if not OK, and permissives, conditions
that must be OK for the motor to start but which are ignored once the motor
is running. Bypassable permissives and interlocks can be bypassed for
maintenance, while non-bypassble interlocks and permissives are always
evalutated.
The PVSD instruction supports a bus for forwarding commands (fanout) and
gathering status (rollup) in a hierarchy of objects. Refer to the Bus Object for
more information on the commands and status (including alarm status) sent
on the bus.
The PVSD instruction optionally supports the ability to look up the text to
display for the most recent drive fault code, given a provided fault code lookup
table. This table is an array of Code and Description pairs and is searched
whenever the last fault code from the drive changes.
The PVSD instruction’s interface to the physical drive can be through a Power
Velocity Device Object interface or by connecting individual drive signals to
input and output pins of the instruction. Details on the Power Velocity Device
Object interface are given below. Three interface tags are used, provided as
InOut Parameters. These tags provide drive Settings, such as the Speed
Reference, drive Commands, such as start forward, jog reverse and stop, and
retrieve drive Status, such as connected, active (running), commanded
direction, actual direction, accelerating, decelerating, at speed, warning,
faulted, and extended drive warning and fault information.
This illustration shows the relationship between a PVSD instance and its
associated Power Velocity Device Object.
See also
Process Variable Speed Drive (PVSD)
Drives
Available Instructions
Ladder Diagram
Not available
See also
Filter Instructions on page 875
Logical and Move Instructions on page 955
Integrator (INTG) This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
INTG(INTG_tag);
Operands
Function Block
Operand Type Format Description
INTG tag INTEGRATOR Structure INTG structure
INTEGRATOR Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction
does not execute and outputs are not
updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Structured Text
Operand Type Format Description
INTG tag INTEGRATOR Structure INTG structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The INTG instruction is designed to execute in a task where the scan rate
remains constant.
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value. The internal parameters are not
updated. In each subsequent scan, the output is computed using the internal
parameters from the last scan when the output was valid.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
In many applications an integral gain component is included in the closed
loop regulator design in order to eliminate or minimize error in the system
being regulated. A straight proportional-only regulator will not tend to drive
error in the system to zero. A regulator that uses proportional and integral
gain, however, tends to drive the error signal to zero over a period of time. The
INTG instruction uses the following equation to calculate its output.
In the chart below, the input to the block moves from 0 to +200 units. During
this period, the output of the block integrates to 2800 units. As In changes
from +200 units to 0 units, Out maintains at 2800 units. When In transitions
from 0 to -300 units, Out slowly integrates down to -1400 units until In
transitions back to 0. Finally, as In moves from 0 to +100, Out integrates back
to 0 where In is set to 0 coincidentally with Out reaching 0.
The following example shows how the INTG instruction can be used. In many
instances, the HighLimit and LowLimit inputs limit the total percentage of
control that the integral gain element might have as a function of the
regulator’s total output. The HoldHigh and HoldLow inputs, on the other
hand, can be used to prevent the output from moving further in either the
positive or negative direction. The HoldHigh and HoldLow inputs prevent the
INTG instruction from "winding-up" in a direction which is already beyond
the limits of the controlled variable.
Function Block
This example is the minimal legal programming of the INTG function block
and is only used to show the neutral text and generated code for this
instruction. This is for internal purposes only and is not a testable case.
Structured Text
INTG_01.In := Input_Value;
INTG_01.Initialize := Initialize_flag;
INTG_01.InitialValue := Int_Init_Val;
INTG_01.IGain := I_Gain;
INTG_01.HighLimit := Int_saturate_high;
INTG_01.LowLimit := Int_saturate_low;
INTG_01.HoldHigh :=HAlarm_Status;
INTG_01.HoldLow := LAlarm_Status;
INTG(INTG_01);
See also
Function Block Attributes on page 1043
Common Attributes on page 1083
Proportional + Integral (PI) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
PI(PI_tag);
Operands
Function Block
Operand Type Format Description
PI tag PROP_INT structure PI structure
Structured Text
Operand Type Format Description
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
PROP_INT Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs are
not updated.
Default is set.
In REAL The process error signal input. This is the difference between setpoint
and feedback.
Valid = any float
Default = 0.0
Initialize BOOL The instruction initialization command. When set, Out and internal
integrator are set equal to the value of InitialValue.
Default is cleared.
InitialValue REAL The initial value input. When Initialize is set, Out and integrator are set to
the value of InitialValue. The value of InitialValue is limited using HighLimit
and LowLimit.
Valid = any float
Default = 0
Kp REAL The proportional gain. This affects the calculated value for both the
proportional and integral control algorithms. If invalid, the instruction
clamps Kp at the limits and sets the appropriate bit in Status.
Valid = any float > 0.0
Default = minimum positive float
Wld REAL The lead frequency in radians/second. This affects the calculated value of
the integral control algorithm. If invalid, the instruction clamps Wld at the
limits and sets the appropriate bit in Status.
Valid = see the Description section below for valid ranges
Default = 0.0
HighLimit REAL The high limit value. This is the maximum value for Out. If HighLimit
LowLimit, the instruction sets HighAlarm and LowAlarm, sets the
appropriate bit in Status, and sets Out = LowLimit.
Valid = LowLimit < HighLimit maximum positive float
Default = maximum positive float
LowLimit REAL The low limit value. This is the minimum value for Out. If HighLimit
LowLimit, the instruction sets HighAlarm and LowAlarm, sets the
appropriate bit in Status, and sets Out = LowLimit.
Valid = maximum negative float LowLimit < HighLimit
Default = maximum negative float
HoldHigh BOOL The hold high command. When set, the value of the internal integrator is
not allowed to increase in value.
Default is cleared.
HoldLow BOOL The hold low command. When set, the value of the internal integrator is
not allowed to decrease in value.
Default is cleared.
ShapeKpPlus REAL The positive Kp shaping gain multiplier. Used when In is 0. If invalid,
the instruction clamps ShapeKpPlus at the limits and sets the appropriate
bit in Status. Not used when NonLinearMode is cleared.
Valid = 0.1 to 10.0
Default = 1.0
DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used
by the control algorithm to calculate the process output.
Status DINT Status of the function block.
InstructFault BOOL The instruction detected one of the following execution errors. This is
(Status.0) not a minor or major controller error. Check the remaining status bits to
determine what occurred.
KpInv (Status.1) BOOL Kp < minimum or Kp > maximum.
WldInv (Status.2) BOOL Wld < minimum or Wld > maximum.
HighLowLimsInv BOOL HighLimit LowLimit.
(Status.3)
ShapeKpPlusInv BOOL ShapeKpPlus < minimum or ShapeKpPlus > maximum.
(Status.4)
ShapeKpMinusInv BOOL ShapeKpMinus < minimum or ShapeKpMinus > maximum.
(Status.5)
KpInRangeInv BOOL KpInRange < minimum or KpInRange > maximum.
(Status.6)
ShapeWldPlusInv BOOL ShapeWldPlus < minimum or ShapeWldPlus > maximum.
(Status.7)
ShapeWldMinusInv BOOL ShapeWldMinus < minimum or ShapeWldMinus > maximum.
(Status.8)
WldInRangeInv BOOL WldInRange < minimum or WldInRange > maximum.
(Status.9)
TimingModeInv BOOL Invalid TimingMode.
(Status.27) For more information about timing modes, see Function Block Attributes.
RTSMissed BOOL Only used in real time sampling mode. Set when
(Status.28) ABS | DeltaT - RTSTime | > 1 (.001 second).
RTSTimeInv BOOL Invalid RTSTime value.
(Status.29)
RTSTimeStampInv BOOL Invalid RTSTimeStamp value.
(Status.30)
DeltaT (Status.31) BOOL Invalid DeltaT value.
Description
The PI instruction uses the position form of the PI algorithm. This means the
gain terms are applied directly to the input signal, rather than to the change in
the input signal. The PI instruction is designed to execute in a task where the
scan rate remains constant.
In the non-linear algorithm, the proportional and integral gains vary as the
magnitude of the input signal changes. The PI instruction supports two non-
linear gain modes: linear and parabolic. In the linear algorithm, the gains vary
linearly as the magnitude of input changes. In the parabolic algorithm, the
gains vary according to a parabolic curve as the magnitude of input changes.
The PI instruction calculates Out using this equation:
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value and sets the math overflow status flag.
The internal parameters are not updated. In each subsequent scan, the output
is computed using the internal parameters from the last scan when the output
was valid.
The following diagram illustrates the maximum and minimum gain curves
that represent the parabolic and linear gain equations.
The instruction calculates the value for Out using these equations:
Kp input ratio
Kp ratio
Proportional output
Wld input
Wld ratio
Integral output
Limiting
The instruction stops the ITerm windup based on the state of the hold inputs.
Condition Action
The instruction also stops integrator windup based on the HighLimit and
LowLimit values.
Condition Action
Integrator > HighLimit Integrator = HighLimit
Integrator > LowLimit Integrator = LowLimit
The instructions limits the value of Out based on the HighLimit and LowLimit
values.
Condition Action
HighLimit LowLimit Out = LowLimit
ITerm = LowLimit
HighLowLimsInv is set
HighAlarm is set
LowAlarm is set
WldInput = 0
Out HighLimit Out = HighLimit
ITerm = ITerm n-1
HighAlarm is set
ITerm > HighLimit ITerm = HighLimit
Out LowLimit Out = LowLimit
ITerm = ITerm n-1
LowAlarm is set
ITerm < LowLimit ITerm = LowLimit
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition Action Taken
Prescan EnableIn and EnableOut are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to
false.
Tag.EnableIn is true EnableIn and EnableOut bit is set to true.
The instruction executes.
Instruction first run Out n-1 = 0
The algorithm used to calculate Out will not be
executed.
Instruction first scan Out n-1 = 0
The algorithm used to calculate Out will not be
executed.
Postscan EnableIn and EnableOut bits are cleared to
false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Example
The PI instruction is a regulating instruction with proportional and integral
gain components. The integral gain component is set by the user in
radians/sec; this sets the basic frequency response of the PI regulator. The
proportional gain sets the overall gain of the block, including the proportional
AND integral gain of the block.
Function Block
Structured Text
Reference_Select.In1 := Master_Machine_Ref;
Reference_Select.Select1 := Master_Machine_Select;
Reference_Select.In2 := Section_Jog;
Reference_Select.Select2 := Jog_Select;
SSUM(Reference_Select);
S_Curve.In := Reference_Select.Out;
S_Curve.AccelRate := accel_rate;
S_Curve.DecelRate := accel_rate;
SCRV(S_Curve);
PMUL_01.In := Resolver_Feedback;
PMUL_01.WordSize := 12;
PMUL_01.Multiplier := 100000;
PMUL(PMUL_01);
Speed_Feedback := PMUL_01.Out;
Velocity_Error := S_Curve.Out - Speed_Feedback;
PI_01.In := Velocity_Error;
PI_01.Initialize := Enable_Regulator;
PI_01.Kp := Velocity_Proportional_Gain;
PI_01.Wld := Velocity_Integral_Gain;
PI(PI_01);
Torque_Reference := PI_01.Out;
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Pulse Multiplier (PMUL) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
PMUL(PMUL_tag);
Operands
Function Block
Operand Type Format Description
PMUL tag PULSE_MULTIPLIER Structure PMUL structure
Structured Text
Operand Type Format Description
PMUL tag PULSE_MULTIPLIER Structure PMUL structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
PULSE_MULTIPLIER Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
In DINT The analog input signal to the instruction.
Valid = any DINT
Default = 0
Initialize BOOL The initialize input. When set, Out is held at 0.0 and all the internal registers are set to 0. On a set to cleared
transition of initialize, Inn-1 = InitialValue (not valid for Absolute mode). When cleared, the instruction executes
normally.
InitialValue DINT The initial value input. On a set to cleared transition of initialize, Inn-1 = InitialValue
Valid= any DINT
Default = 0.
Mode BOOL The mode input. Set to enable Relative mode. Clear to enable Absolute mode.
Default is set.
WordSize DINT The word size in bits. Specify the number of bits to use when computing (Inn-Inn-1) in Relative mode.
WordSize is not used in Absolute mode.
When the change in In is greater than 1/2 * 2(Wordsize-1), Out changes sign.
When WordSize is invalid,Out is held and the instruction sets the appropriate bit in Status.
Valid = 2 to 32
Default = 14
Multiplier DINT The multiplier. Divide this value by 100,000 to control the ratio of In to Out. If invalid, the instruction limits the
value and sets the appropriate bit in Status.
Valid = -1,000,000 to 1,000,000
Default = 100,000
Description
The PMUL instruction operates in Relative or Absolute mode.
In the Absolute mode, the instruction can scale an input, such as position,
without losing any information from one scan to the next.
Out = INT_Out
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition Function Block Action
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Inn-1 = In. Outn-1 =0. Reminder = 0.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
Example 1
The most common use of the PMUL instruction is in the relative mode of
operation. In this mode, the PMUL instruction serves several purposes. First,
in the relative mode, the PMUL instruction differentiates the information that
it receives at its input from scan to scan. As data is received, the instruction
outputs the difference of the input from one scan to the next. This means that
if In = 500 at scan "n", and then In = 600 at scan "n+1", Out = 100 at scan "n+1."
In this example, as the value of the feedback data moves from 2047 to -2048,
the effective change in position is equivalent to a jump of 4095 counts in
position. In reality, however, this change in position is only 1 part in 4096 in
terms of the rotation of the resolver feedback device. By understanding the
true word size of the data that is being input from the feedback module, the
PMUL instruction views the data in a rotary fashion as shown in the following
diagram:
By knowing the word size of the data that is input to this block, the PMUL
instruction differentiates an output of 1 count as the input to the block moves
from 2047 to -2048, instead of the mathematically calculated 4095.
Tip: When applying this block, it is important to note that the feedback data should not change by
more than one-half of the word size from one scan to the next, if rotational direction is to be
properly differentiated.
The third attribute of the pulse multiplier block is that it retains the fractional
components from one scan to the next of any remainders that exist as a result
of the Multiplier/100,000 scaling factor. As each execution of the block is
completed, the remainder from the previous scan is added back into the total
of the current value so that all counts or "pulses" are ultimately accounted for
and no data is lost in the system. The output of the block, Out always yields a
whole number in a floating point data type.
Function Block
Structured Text
MUL_02.In := Position_feedback;
PMUL_02.Initalize := Initialize_Position;
PMUL_02.WordSize := 12;
PMUL_02.Multiplier := 25000;
PMUL(PMUL_02);
UPDN_02.Initialize := Initialize_Position;
UPDN_02.InPlus := PMUL_02.Out;
UPDN(UPDN_02);
Total_Position := UPDN_02.Out;
Example 2
In this electronic line shaft application, motor A’s feedback acts as a master
reference which motor B needs to follow. Motor A’s feedback is aliased to
"Position_feedback." Motor B’s feedback is aliased to "Follower_Position." Due
to the multipliers of both instructions being a ratio of 1/4, motor B needs to
rotate once for every four revolutions of Motor A in order to maintain an
accumulated value of zero in the UPDN accumulator. Any value other than
zero on the output of the UPDN instruction is viewed as Position_error and
can be regulated and driven back out to motor B in order to maintain a phase-
lock between the two motors.
Function Block
Structured Text
PMUL_02.In := Position_feedback;
PMUL_02.Initalize := Initialize_Position;
PMUL_02.WordSize := 12;
PMUL_02.Multiplier := 25000;
PMUL(PMUL_02);
PMUL_03.In := Follower_Position;
PMUL_03.Initalize := Initialize_Position;
PMUL_03.WordSize := 12;
PMUL_03.Multiplier := 100000;
PMUL(PMUL_03);
UPDN_02.Initialize := Initialize_Position;
UPDN_02.InPlus := PMUL_02.Out;
UPDN_02.InMinus := PMUL_03.Out;
UPDN(UPDN_02);
Position_error := UPDN_02.Out;
See also
Common Attributes on page 1083
S-Curve (SCRV) 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 SCRV instruction performs a ramp function with an added jerk rate. The
jerk rate is the maximum rate of change of the rate used to ramp output to
input.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
SCRV(SCRV_tag);
Operands
Function Block
Operand Type Format Description
SCRV tag S_CURVE Structure SCRV structure
Structured Text
Operand Type Format Description
SCRV tag S_CURVE Structure SCRV structure
See Structured Text Syntax for more information of the syntax of expressions
within structured text.
S_CURVE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Initialize BOOL The Initialize input to the instruction. When set, the instruction holds Out = InitialValue
Default is cleared.
InitialValue REAL Initial value of S-Curve. When Initialize is set, Out = InitialValue.
Valid = any float
Default = 0.0
AbsAlgRamp BOOL Ramp type. If set, the instruction functions as an absolute value ramp. If cleared, the instruction functions as
an algebraic ramp.
Default is set
AccelRate REAL Acceleration rate in input units per second2. A value of zero prevents Out form accelerating. When AccelRate
< 0, the instruction assumes AccelRate = 0 and sets the appropriate bit in Status.
Valid = 0.0 to maximum positive float
Default = 0.0
DecelRate REAL Deceleration rate in input units per second2. A value of zero prevents Out form decelerating. When the
DecelRate < 0, the instruction assumes DecelRate = 0 and sets the appropriate bit in Status.
Valid = 0.0 to maximum positive float
Default = 0.0
JerkRate REAL Deceleration rate in input units per second2. A value of zero prevents Out form decelerating. When the
DecelRate < 0, the instruction assumes DecelRate = 0 and sets the appropriate bit in Status.
Valid = 0.0 to maximum positive float
Default = 0.0
HoldMode BOOL S-Curve hold mode parameter. This parameter is used with the HoldEnable parameter. If HoldMode is set
when HoldEnable is set and Rate = 0, the instruction holds Out constant. In this situation, the instruction holds
Out as soon as HoldEnable is set, the JerkRate is ignored, and Out produces a "corner" in its profile. If
HoldMode is cleared when HoldEnable is set, the instruction uses the JerkRate to bring Out to a constant
value. Out is held when Rate = 0. Do not change HoldMode once HoldEnable is set because the instruction will
ignore the change.
Default is cleared.
HoldEnable BOOL S-Curve hold enable parameter. When set, Out is held. When cleared, Out moves from its current value until it
equals In.
Default is cleared.
TimingMode DINT Selects timing execution mode.
0 = periodic mode
1 = oversample mode
2 = real time sampling mode
For more information about timing modes, see Function Block Attributes.
Valid = 0 to 2
Default = 0
OversampleDT REAL Execution time for oversample mode.
Valid = 0 to 4194.303 seconds
Default = 0
RTSTime DINT Module update period for real time sampling mode
Valid = 1 to 32,767ms
Default = 1
RTSTimeStamp DINT Module time stamp value for real time sampling mode.
Valid = 0 to 32,767ms
Default = 0
Description
The primary requirement of the SCRV instruction is to ensure that the rate
never changes by more than the specified jerk rate.
S-Curve Profile
To produce an S-Curve profile, set JerkRate such that (JerkRate * DeltaT) <
AccelRate and/or DecelRate.
When a step change occurs on the input, rate is increased to the programmed
AccelRate or DecelRate. The AccelRate or DecelRate is maintained until a
point at which rate must begin decreasing in order for the output to reach
input when rate reaches zero.
For very small step changes, the SCRV instruction will not attempt to produce
an 'S' profile. In this mode the entire step will be output and Rate will reflect
the change in output. This behavior will occur if Out = In and the next step
change to In can be output with a rate less than or equal to the programmed
JerkRate.
Ramp Profile
To produce a Ramp profile, set JerkRate such that (JerkRate * DeltaT)
AccelRate and/or DecelRate.
In Ramp Profile mode, the SCRV instruction always produces a rate of change
equal to the programmed AccelRate or DecelRate until the difference between
Out and In requires less then AccelRate or DecelRate to reach endpoint.
HoldMode = 0 operates the same as HoldMode = 1. When HoldEnable is set,
Out is immediately held and Rate becomes zero.
(1)
When Initialize is set, the instruction sets the following:
Outn = InitialValue
Outn-1 = Outn
Raten = 0
Raten-1 = 0
(2)
When HoldMode is cleared, Out is moving toward In, and HoldEnable is
set, the rate begins decreasing towards zero at the jerk rate. Due to the
JerkRate, Out is held at whatever value it had when the rate reached zero.
When the Out is finally held constant, it has a value that is different from the
value it had the instant that HoldEnable was set.
When HoldMode is set, Out is moving toward In, and HoldEnable is set, the
rate is immediately set to zero. Out is held at whatever value it had when
HoldEnable was set.
Reducing the JerkRate during a transition might cause Out to overshoot the
In. If overshoot occurs, it is the result of enforcing the entered JerkRate. You
can avoid an overshoot by decreasing JerkRate in small steps while tuning or
by changing JerkRate while Out = In (not during a transition).
The time that is required for Out to equal a change in the input is a function of
AccelRate, JerkRate, and the difference between In and Out.
region 2
region 3
When:
the SCRV block does not reach the AccelRate or DecelRate. The Out does the
following:
where:
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition Function Block Action
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bit bits are set to true
The instruction executes.
Instruction first run N/A
Instruction first scan Clear previous scan data.
Postscan EnableIn and EnableOut bits are cleared to false
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
In most coordinated drive applications, a master reference commands line
speed for an entire group of drives. As various references are selected, the
drives cannot be presented with "step" changes in speed reference because
differences in load inertia, motor torque, and tuning would not allow the
individual drive sections to react in a coordinated manner. The SCRV
instruction is designed to ramp and shape the reference signal to the drive
sections so that acceleration, deceleration, and jerk, (derivative of
acceleration,) are controlled. This instruction provides a mechanism to allow
the reference to the drives to reach the designated reference setpoint in a
manner that eliminates excessive forces and excessive impact on connected
machinery and equipment.
Function Block
Structured Text
SSUM_01.In1 := Master_reference;
SSUM_01.Select1 := master_select;
SSUM_01.In2 := Jog_reference;
SSUM_01.Select2 := jog_select;
SSUM(SSUM_01);
select_out := SSUM_01.Out;
SCRV_01.In := select_out;
SCRV_01.AccelRate := accel;
SCRV_01.DecelRate := accel;
SCRV_01.JerkRate := jerk_rate;
SCRV(SCRV_01);
scurve_out := SCRV_01.Out
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Second-Order Controller This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(SOC) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The SOC instruction is designed for use in closed loop control systems in a
similar manner to the PI instruction. The SOC instruction provides a gain
term, a first order lag, and a second order lead.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
SOC(SOC_tag);
Operands
Function Block
Operand Type Format Description
SOC tag SEC_ORDER_CONTROLLER Structure SOC structure
SEC_ORDER_CONTROLLER Structure
Input
Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute
and outputs are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Initialize BOOL The instruction initialization command. When set, Out and
internal integrator are set equal to the value of InitialValue.
Default is cleared.
InitialValue REAL The initial value input. When Initialize is set, Out and
integrator are set to the value of InitialValue. The value of
InitialValue is limited using HighLimit and LowLimit.
Valid = any float
Default = 0.0
Gain REAL The proportional gain for the instruction. If the value is out
of range, the instruction limits the value and sets the
appropriate bit in Status.
Valid = any float > 0.0
Default = minimum positive float
WLag REAL First order lag corner frequency in radians/second. If the
value is out of range, the instruction limits the value and
sets the appropriate bit in Status.
Valid = see the Description section below for valid ranges
Default = 0.0
Data
Output Parameter Type Description
EnableOut BOOL Indicates if instruction is enabled. Cleared to
false if Out overflows.
Structured Text
Operand Type Format Description
SOC tag SEC_ORDER_CONTROLLER structure SOC structure
See Structured Text Syntax for more information of the syntax of expressions
within structured text.
Description
The SOC instruction provides a gain term, a first order lag, and a second order
lead. The frequency of the lag is adjustable and the frequency and damping of
the lead is adjustable. The zero pair for the second order lead can be complex
(damping is less than unity) or real (damping to unity). The SOC
Parameter Limitations
The following SOC parameters have these limits on valid values.
Parameter Limit
WLead
Whenever the value computed for the output is invalid or NAN, the
instruction sets Out = the invalid value. The internal parameters are not
updated. In each subsequent scan, the output is computed using the internal
parameters from the last scan when the output was valid.
Limiting
The instruction stops wind-up based on state of the Hold inputs.
If: Then:
HoldHigh is set and Integrator > Integrator n-1 Integrator = Integratorn-1
The instruction also stops integrator windup based on the HighLimit and
LowLimit values.
If: Then:
Integrator > IntegratorHighLimit Integrator = IntegratorHighLimit
where:
The instruction also limits the value of Out based on the HighLimit and
LowLimit values.
If: Then:
HighLimit LowLimit Out = LowLimit
Integrator = IntegratorLowLimit
HighLowLimsInv is set
HighAlarm is set
LowAlarm is set
Out HighLimit Out = HighLimit
IntegratorLowLimitn-1
HighAlarm is set
Out LowLimit Out = LowLimit
Integrator = Integratorn-1
LowAlarm is set
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bit is set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan The internal parameters and Out are set to 0. Force
recalculation of equation coefficients.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The SOC instruction is a specialized function block that is used in applications
where energy is transferred between two sections through a spring-mass
system. Typically in these types of applications, the frequency response of the
process itself can be characterized as shown in the bode diagram A below:
The SOC instruction implements a first order lag filter followed by a PID
controller to implement a transfer function with an integration, a second
order zero, (lead,) and a first order pole (lag.) With this instruction, PID
tuning is simplified because the regulating terms are arranged so that you
have WLead and ZLead as inputs to the SOC instruction, rather than Kp, Ki,
and Kd values. The transfer function for the SOC instruction is:
Using the SOC instruction, PID tuning is simplified because the regulating
terms can be arranged so that you have WLead and ZLead as inputs to the
SOC instruction, rather than Kp, Ki, and Kd values. In this manner, the corner
frequencies of the controller/regulator are easier to adjust and setup against
the real world process. During startup, the natural frequency of the system
and the damping factor can be measured empirically or on-site. Afterward,
the parameters of the regulator can be adjusted to match the characteristics of
the process, allowing more gain and more stable control of the final process.
In the system above, if Wlead is set equal to the system natural frequency, and
if Wlag is set substantially above the desired crossover frequency, (> 5 times
crossover), the resulting system response would look like the following:
Tune damping factor, Zlead, so that it cancels out any of the overshoot in the
system.
Move WLag out far enough past the system crossover frequency (>5 times)
and begin increasing overall Gain to achieve
Function Block
Structured Text
SOC_01.In := Process_Error;
SOC_01.Initialize := Regulator_Enable_Not;
SOC_01.Gain := Gain;
SOC_01.WLag := Lag_Radians_per_sec;
SOC_01.WLead := Lead_radians_per_sec;
SOC_01.ZetaLead := Damping_Factor;
SOC_01.HighLimit := Max_Out;
SOC_01.LowLimit := Min_Out;
SOC(SOC_01);
SOC_Out := SOC_01.Out;
See also
Function Block Attributes on page 1043
Up/Down Accumulator This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(UPDN) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The UPDN instruction adds and subtracts two inputs into an accumulated
value.
Available Languages
Ladder Diagram
This instruction is not available for ladder diagram diagram.
Function Block
Structured Text
UPDN(UPDN_tag)
Operands
Function Block
Operand Type Format Description
UPDN tag UP_DOWN_ACCUM Structure UPDN structure
UPDN Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the
instruction does not execute and
outputs are not updated.
Default is set.
Initialize BOOL The initialize input request for the
instruction. When Initialize is set,
the instruction sets Out and the
internal accumulator to InitialValue.
Default is cleared.
InitialValue REAL The initialize value of the
instruction.
Valid = any float
Default = 0.0
Structured Text
Operand Type Format Description
UPDN tag UP_DOWN_ACCUM Structure UPDN structure
See Structured Text Syntax for more information of the syntax of expressions
within structured text.
Description
The UPDN instruction follows these algorithms.
Condition Action
Hold is cleared AccumValuen = AccumValue n-1 + InPlus - InMinus
and Out = AccumValuen
Initialize is
cleared
Hold is set and AccumValuen = AccumValuen-1
Initialize is Out = AccumValuen
cleared
Initialize is set AccumValuen = InitialValue
Out = AccumValuen
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run Internal accumulator is set to zero.
Instruction first scan N/A
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The UPDN instruction integrates counts from one scan to the next. This
instruction can be used for simple positioning applications or for other types
of applications where simple integration is required to create an accumulated
value from a process’s differentiated feedback signal. In the example below,
Initial_Position is set to zero, while Differential_Position_Plus and
Differential_Position_Minus take varying values over a period of time. With
this instruction, InPlus and InMinus could also accept negative values.
Function Block
The derivative instruction calculates the amount of change of a signal over
time in per-second units. This instruction is often used in closed loop control
to create a feed forward path in the regulator to compensate for processes that
have a high degree of inertia.
Structured Text
UPDN_01.Initialize := Initialize_Position;
UPDN_01.InitialValue := Initial_Position;
UPDN_01.InPlus := Differential_Position_Plus;
UPDN_01.InMinus := Differential_Position_Minus;
UPDN(UPDN_01);
Position_Integrated := UPDN_01.Out;
See also
Common Attributes on page 1083
HMI Button Control (HMIBC) 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.
Use the HMI Button Control (HMIBC) instruction with a PanelView 5500
Human Machine Interface (HMI) to enable operators to initiate machine
control operations, such as jogging a motor or enabling a valve, with a high
degree of accuracy and determinism. The HMIBC instruction also provides
built-in communications diagnostics that permit the instruction to
automatically reset if the communications from the controlling HMI become
unavailable.
To function, the Logix controller I/O configuration must include all of the
PanelView 5500 HMIs that need to interact with the HMIBC instruction.
Additionally, the application created for each PanelView 5500 HMI must
include button actions configured to reference each tag associated with the
HMIBC instructions.
ATTENTION: Execute this instruction at least once per scan, and do not jump over.
Available Language
Ladder Diagram
Function Block
Tip: For the HMIBC tag, use only the Out parameter, and optionally, the ProgFB parameter in
Function Block diagrams.
Structured Text
HMIBC (HMIBC tag)
Operands
These operands are located on the instruction.
Operand Type Format Description
HMIBC tag HMIBC tag Goes active when the data bit
is set
HMIBC Structure
Input parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does not
execute.
Prog FB BOOL Program Feedback. This value is not processed
by the instruction, but transmitted to all
registered HMI devices. The purpose or
meaning of this value is user defined. For
example, use this to determine if the expected
action actually executes when pressing the
button and displays that status on the HMI
device.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-
indexing faults.
Execution
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true The rung-condition-out is set to true if any HMI device
buttons control operation associated with the instruction
instance tag are pressed. Otherwise, rung-condition-out
is set to false.
Postscan The rung-condition-out is set to false.
Function Block
Condition/State Action Taken
Prescan N/A
Tag.EnableIn is false The instruction does not execute.
Structured Text
Condition/State Action Taken
Prescan The instruction executes.
Normal Execution The instruction executes.
Postscan The instruction executes.
Examples
Ladder Diagram
Function Block
The following example shows the HMIBC instruction as it appears in a
function block diagram.
Structured Text
HMIBC (HMIBC_Conv);
IF(((Auto AND Run_Conv) Or (NOT Auto AND HMIBC_Conv.Out)) AND NOT
Conv_Fault)
THEN Conv_Motor: = 1;
ELSE Conv_Motor : = 0;
END_IF;
See also
Index Through Arrays on page 1094
Filter
Available Instructions
Ladder Diagram
This instruction is not available in Ladder Diagram
See also
Drives Instructions on page 823
Logical and Move Instructions on page 955
Derivative (DERV) 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.
Available Languages
Ladder Diagram
This instruction is not available for ladder diagram.
Function Block
Structured Text
DERV(DERV_tag);
Operands
Function Block
Operand Type Format Description
DERV tag DERIVATIVE structure DERV structure
DERIVATIVE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
In REAL The analog signal input to the
instruction.
Valid = any float
Default = 0.0
Gain REAL Derivative multiplier
Valid = any float
Default = 1.0
Structured Text
Operand Type Format Description
DERV tag DERIVATIVE structure DERV structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The DERV instruction supports a bypass input that lets you stop calculating
the derivative and pass the signal directly to the output.
When Bypass is The instruction uses this equation
Cleared and DeltaT > 0
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Structured Text: NA
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Recalculate coefficients.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
This example is the minimal legal programming of the DERV function block
and is only used to show the neutral text and generated code for this
instruction. This is for internal purposes only and is not a testable case.
Function Block
Structured Text
DERV_01.In := Speed_Reference;
DERV_01.Gain := Feedforward_Gain;
DERV(DERV_01);
See also
Function Block Attributes on page 1043
Common Attributes on page 1083
High Pass Filter (HPF) This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
The HPF instruction provides a filter to attenuate input frequencies that are
below the cutoff frequency.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
HPF(HPF_tag);
Operands
Function Block
Operand Type Format Description
HPF tag FILTER_HIGH_PASS structure HPF structure
Structured Text
Operand Type Format Description
HPF tag FILTER_HIGH_PASS Structure HPF structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The HPF instruction uses the Order parameter to control the sharpness of the
cutoff. The HPF instruction is designed to execute in a task where the scan
rate remains constant.
Order = 2
Order = 3
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value. When the value computed for the
output becomes valid, the instruction initializes the internal parameters and
sets Out = In.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Recalculate coefficients.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The HPF instruction attenuates signals that occur below the configured cutoff
frequency. This instruction is typically used to filter low frequency "noise" or
disturbances that originate from either electrical or mechanical sources. You
can select a specific order of the filter to achieve various degrees of
attenuation. Note that higher orders increase the execution time for the filter
instruction.
The following graphs illustrate the effect of the various orders of the filter for
a given cutoff frequency. For each graph, ideal asymptotic approximations are
given with gain and frequency in logarithmic scales. The actual response of
the filter approaches these curves but does not exactly match these curves.
This example is the minimal legal programming of the HPF function block
and is only used to show the neutral text and generated code for this
instruction. This is for internal purposes only and is not a testable case.
Filter Graph
Function Block
Structured Text
HPF_01.In := Velocity_Feedback;
HPF_01.WLead := Cutoff_frequency;
HPF_01.Order := 2;
HPF(HPF_01);
filtered_velocity_output := HPF_01.Out
See also
Common Attributes on page 1083
Low Pass Filter (LPF) 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 LPF instruction provides a filter to attenuate input frequencies that are
above the cutoff frequency.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
LPF(LPF_tag);
Operands
Function Block
Operand Type Format Description
LPF tag FILTER_LOW_PASS Structure LPF structure
FILTER_LOW_PASS Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If false, the instruction does
not execute and outputs are not updated.
Default is true.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Initialize BOOL Request to initialize filter control
algorithm. When true, the instruction sets
Out = In.
Default is false.
WLag REAL The lag frequency in radians/second. If
WLag < minimum or WLag > maximum,
the instruction sets the appropriate bit in
Status and limits WLag.
Valid = see Description section below for
valid ranges
Default = 0.0
Order REAL Order of the filter. Order controls the
sharpness of the cutoff. If Order is invalid,
the instruction sets the appropriate bit in
Status and uses Order = 1.
Valid = 1 to 3
Default = 1
TimingMode DINT Selects timing execution mode.
0 = Period mode
1 = Oversample mode
2 = Real-time sampling mode
For more information about timing
modes, see Function Block Attributes.
Valid = 0 to 2
Default = 0
OversampleDT REAL Execution time for oversample mode.
Valid = 0 to 4194.303 seconds
Default = 0
RTSTime DINT Module update period for real time
sampling mode
Valid = 1 to 32,767ms
Default = 1
RTSTimeStamp DINT Module time stamp value for real time
sampling mode.
Valid = 0 to 32,767ms
Default = 0
Structured Text
Operand Type Format Description
LPF tag FILTER_LOW_PASS structure LPF structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The LPF instruction uses the Order parameter to control the sharpness of the
cutoff. The LPF instruction is designed to execute in a task where the scan rate
remains constant.
Order = 2
Order = 3
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value. When the value computed for the
output becomes valid, the instruction initializes the internal parameters and
sets Out = In.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Recalculate coefficients.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Example
The LPF instruction attenuates signals that occur above the configured cutoff
frequency. This instruction is typically used to filter out high frequency "noise"
or disturbances that originate from either electrical or mechanical sources.
You can select a specific order of the filter to achieve various degrees of
attenuation. Note that higher orders increase the execution time for the
instruction.
The following graphs illustrate the effect of the various orders of the filter for
a given cutoff frequency. For each graph, ideal asymptotic approximations are
given with gain and frequency in logarithmic scales. The actual response of
the filter approaches these curves but does not exactly match these curves.
This example is the minimal legal programming of the LPF function block and
is only used to show the neutral text and generated code for this instruction.
This is for internal purposes only and is not a testable case.
Filter Graph
1st order filter
Function Block
Structured Text
LPF_01.In := Velocity_Feedback;
LPF_01.WLag := Cutoff_frequency;
LPF(LPF_01);
filtered_velocity_output := LPF_01.Out;
See also
Function Block Attributes on page 1043
Common Attributes on page 1083
Structured Text Syntax on page 1057
Notch Filter (NTCH) 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 NTCH instruction provides a filter to attenuate input frequencies that are
at the notch frequency.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
NTCH(NTCH_tag);
Operands
Function Block
Operand Type Format Description
NTCH tag FILTER_NOTCH Structure NTCH structure
FILTER_NOTCH Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the
instruction does not execute and
outputs are not updated.
Default is true.
In REAL The analog signal input to the
instruction.
Valid = any float
Default = 0.0
Initialize BOOL Request to initialize filter control
algorithm. When true, the
instruction sets Out = In.
Default is false.
WNotch REAL The filter center frequency in
radians/second. If WNotch <
minimum or WNotch > maximum,
the instruction sets the appropriate
bit in status and limits WNotch.
Valid = see Description section
below for valid ranges
Default = maximum positive float
Structured Text
Operand Type Format Description
NTCH tag FILTER_NOTCH structure NTCH structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The NTCH instruction uses the Order parameter to control the sharpness of
the cutoff. The QFactor parameter controls the width and the depth ratio of
the notch. The NTCH instruction is designed to execute in a task where the
scan rate remains constant.
where i is the Order operator with these parameters limits (where DeltaT is in
seconds):
Parameter Limitations
WNotch second order
LowLimit
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value. When the value computed for the
output becomes valid, the instruction initializes the internal parameters and
sets Out = In.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to
false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to
false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Example
The NTCH instruction attenuates a specific resonance frequency. Typically,
these resonance frequencies are directly in the range of response being
regulated by the closed loop control system. Often, they are generated by loose
mechanical linkages that cause backlash and vibration in the system.
Although the best solution is to correct the mechanical compliance in the
machinery, the notch filter can be used to soften the effects of these signals in
the closed loop regulating scheme.
The following diagram shows the ideal gain curve over a frequency range for a
specific center frequency and Q factor. As increases, the notch becomes wider
and shallower. As decreases; the notch becomes deeper and narrower. The
instruction may be set for an order of 2 or an order of 4. Higher orders take
more execution time.
This example is the minimal legal programming of the NTCH function block
and is only used to show the neutral text and generated code for this
instruction. This is for internal purposes only and is not a testable case.
Function Block
Structured Text
NTCH_01.In := frequency_input;
NTCH_01.WNotch := center_frequency;
NTCH_01.QFactor := Notch_width_depth;
NTCH(NTCH_01);
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Second-Order Lead Lag This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(LDL2) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The LDL2 instruction provides a filter with a pole pair and a zero pair. The
frequency and damping of the pole and zero pairs are adjustable. The pole or
zero pairs can be either complex (damping less than unity) or real (damping
greater than or equal to unity).
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
LDL2(LDL2_tag);
Operands
Function Block
Operand Type Format Description
LDL2 tag LEAD_LAG_SEC_ORDER Structure LDL2 structure
LEAD_LAG_SEC_ORDER Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
In REAL The analog signal input to the
instruction.
Valid = any float
Default = 0.0
Initialize BOOL Request to initialize filter control
algorithm. When true, the instruction
sets Out = In.
Default is cleared.
WLead REAL The lead corner frequency in
radians/second. If WLead < minimum
or WLead > maximum, the instruction
sets the appropriate bit to true in
Status and limits WLead. If the
WLag:WLead ratio > maximum ratio,
the instruction sets the appropriate
bit in Status to true and limits WLag
Valid = see Description section below
for valid ranges.
Default = 0.0
WLag REAL The lag corner frequency in
radians/second. If WLag < minimum
or WLag > maximum, the instruction
sets the appropriate bit to true in
Status and limits WLag. If the
WLag:WLead ratio > maximum ratio,
the instruction sets the appropriate
bit to true in Status and limits WLag.
Valid = see Description section below
for valid ranges
Default = 0.0
ZetaLead REAL Second order lead damping factor.
Only used when Order = 2. If ZetaLead
< minimum or ZetaLead > maximum,
the instruction sets the appropriate
bit to true in Status and limits
ZetaLead.
Valid = 0.0 to 4.0
Default = 0.0
ZetaLag REAL Second order lag-damping factor.
Only used when Order = 2. If ZetaLag
< minimum or ZetaLag > maximum,
the instruction sets the appropriate
bit to true in Status and limits
ZetaLag.
Valid = 0.05 to 4.0
Default = 0.05
Structured Text
Operand Type Format Description
LDL2 tag LEAD_LAG_SEC_ORDER structure LDL2 structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The LDL2 instruction filter is used in reference forcing and feedback forcing
control methodologies. The LDL2 instruction is designed to execute in a task
where the scan rate remains constant.
Order = 2
Whenever the value computed for the output is invalid, NAN, or INF, the
instruction sets Out = the invalid value. When the value computed for the
output becomes valid, the instruction initializes the internal parameters and
sets Out = In.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Recalculate coefficients.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The LDL2 instruction can attenuate between two frequencies or can amplify
between two frequencies, depending on how you configure the instruction.
Since the Lead and Lag frequencies can be set to values that are larger or
smaller than each other, this instruction may behave as a Lead-Lag block, or,
as a Lag-Lead block, depending on which frequency is configured first. Note
that higher orders increase the execution time for the filter instruction.
This example is the minimal legal programming of the LDL2 function block
and is only used to show the neutral text and generated code for this
instruction. This is for internal purposes only and is not a testable case.
Filter Graph
1st order lead-lag
(wLead < wLag)
Function Block
Structured Text
LDL2_01.In := frequency_input;
LDL2_01.WLead :=
Lead_frequency;
LDL2_01.WLag := Lag_frequency;
LDL2(LDL2_01);
Lead_lag_output := LDL2_01.Out;
See also
Function Block Attributes on page 1043
Select_Limit Instructions
Select/Limit Instructions
The Select/Limit instructions include these instructions:
Available Instructions
Ladder Diagram
This instruction is not available in Ladder Diagram.
See also
Filter Instructions on page 875
Enhanced Select (ESEL) This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
The ESEL instruction lets you select one of as many as six inputs. Selection
options include:
• Manual select (by operator or by program)
• High select
• Low select
• Median select
• Average (mean) select
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
ESEL(ESEL_tag);
Operands
Function Block
Operand Type Format Description
ESEL tag SELECT_ENHANCED Structure ESEL structure
SELECT_ENHANCED Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction does
not execute and outputs are not updated.
Default is true.
In1 REAL The first analog signal input to the
instruction.
Valid = any float
Default = 0.0
In2 REAL The second analog signal input to the
instruction.
Valid = any float
Default = 0.0
In3 REAL The third analog signal input to the
instruction.
Valid = any float
Default = 0.0
In4 REAL The fourth analog signal input to the
instruction.
Valid = any float
Default = 0.0
In5 REAL The fifth analog signal input to the
instruction.
Valid = any float
Default = 0.0
In6 REAL The sixth analog signal input to the
instruction.
Valid = any float
Default = 0.0
In1Fault BOOL Bad health indicator for In1. If In1 is read
from an analog input, then In1Fault is
normally controlled by the fault status on
the analog input. If all the InnFault inputs
are true, the instruction sets the
appropriate bit in Status, the control
algorithm is not executed, and Out is not
updated.
Default = false
InsFaulted (Status.1) BOOL InnFault inputs for all the used Inn inputs
are true.
InsUsedInv (Status.2) BOOL Invalid InsUsed value.
SelectorModeInv (Status.3) BOOL Invalid SelectorMode value.
ProgSelectorInv (Status.4) BOOL Invalid ProgSelector value.
OperSelectorInv (Status.5) BOOL Invalid OperSelector value.
Structured Text
Operand Type Format Description
ESEL tag SELECT_ENHANCED structure ESEL structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The ESEL instruction operates as follows:
Condition Action
SelectorMode = 0 (manual select) or Out = In[OperSelector]
Override is true, ProgOper is false and SelectedIn = OperSelector
OperSelector is not equal to 0
SelectorMode = 0 (manual select) or Out = In[ProgSelector]
Override is true, ProgOper is true and SelectedIn = ProgSelector
ProgSelector is not equal to 0
SelectorMode = 1 (high select) and Out = maximum of In[InsUsed]
Override is false SelectedIn = index to the maximum input value
SelectorMode = 2 (low select) and Out = minimum of In[InsUsed]
Override is false SelectedIn = index to the minimum input value
SelectorMode = 3 (median select) and Out = median of In[InsUsed]
Override is false SelectedIn = index to the median input value
SelectorMode = 4 (average select) and Out = average of In[InsUsed]
Override is false SelectedIn = 0
For SelectorMode 1 through 4, a bad health indication for any of the inputs
causes that bad input to be disregarded in the selection. For example, if
SelectorMode = 1 (high select) and if In6 had the highest value but had bad
health, then the next highest input with good health is moved into the output.
For high or low select mode, if two inputs are equal and are high or low, the
instruction outputs the first found input. For median select mode, the median
value always represents a value selected from the available inputs. If more
than one value could be the median, the instruction outputs the first found
input.
(1) You can lock the instruction in Operator control mode by leaving
ProgOperReq true.
(2) You can lock the instruction in Program control mode by leaving
ProgProgReq true while ProgOperReq is false.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes
Instruction first run The instruction is set to Operator control.
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
This ESEL instruction selects In1, In2, or In3, based on the SelectorMode. In
this example, SelectorMode = 1, which means high select. The instruction
determines which input value is the greatest and sets Out = greatest In.
Function Block
Structured Text
ESEL_01.In1 := analog_input1;
ESEL_01.In2 := analog_input2;
ESEL_01.In3 := analog_input3;
ESEL_01.SelectorMode := 1;
ESEL(ESEL_01);
selected_value := ESEL_01.Out;
See also
Function Block Attributes on page 1043
High/Low Limit (HLL) 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 HLL instruction limits an analog input between two values. You can select
high/low, high, or low limits.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
HLL(HLL_tag);
Operands
Function Block
Operand Type Format Description
HLL tag HL_LIMIT structure HLL structure
HL_LIMIT Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
In REAL The analog signal input to the
instruction.
Valid = any float
Default = 0.0
HighLimit REAL The high limit for the Input. If
SelectLimit = 0 and HighLimit
LowLimit, the instruction sets the
appropriate bit in Status and sets Out
= LowLimit.
Valid = HighLimit > LowLimit
Default = 0.0
LowLimit REAL The low limit for the Input. If
SelectLimit = 0 and LowLimit
HighLimit, the instruction sets the
appropriate bit in Status and sets Out
= LowLimit.
Valid = LowLimit < HighLimit
Default = 0.0
SelectLimit DINT Select limit input. This input has three
settings:
0 = Use both limits
1= Use high limit
2 = Use low limit
If SelectLimit is invalid, the instruction
assumes SelectLimit = 0 and sets the
appropriate bit in Status.
Valid = 0 to 2
Default = 0
Structured Text
Operand Type Format Description
HLL tag HL_LIMIT structure HLL structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The HLL instruction determines the value of the Out using these rules:
Selection Condition Action
SelectLimit = 0 In < HighLimit and Out = In
(use high and low limits) In > LowLimit
In HighLimit Out = HighLimit
In LowLimit Out = LowLimit
HighLimit LowLimit Out = LowLimit
SelectLimit = 1 In < HighLimit Out = In
(use high limit only) In HighLimit Out = HighLimit
SelectLimit = 2 In > LowLimit Out = In
(use low limit only) In LowLimit Out = LowLimit
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Example
This HLL instruction limits In between two values and sets HighAlarm or
LowAlarm, if needed when In is outside the limits. The instruction sets Out =
limited value of In.
Function Block
Structured Text
HLL_01.In := value;
HLL_01.HighLimit := high_limit;
HLL_01.LowLimit := low_limit;
HLL(HLL_01);
limited_value := HLL_01.Out;
high_alarm := HLL_01.HighAlarm;
low_alarm := HLL_01.LowAlarm;
See also
Common Attributes on page 1083
Multiplexer (MUX) 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 MUX instruction selects one of eight inputs based on the selector input.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
This instruction is not available in ladder diagram.
Operands
Function Block
Operand Type Format Description
Block tag MULTIPLEXER Structure MUX structure
MUX Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction
does not execute and outputs are not
updated.
Default is set.
In1 REAL The first analog signal input to the
instruction.
Valid = any float
Default = 0.0
In2 REAL The second analog signal input to the
instruction.
Valid = any float
Default = 0.0
In3 REAL The third analog signal input to the
instruction.
Valid = any float
Default = 0.0
In4 REAL The fourth analog signal input to the
instruction.
Valid = any float
Default = 0.0
In5 REAL The fifth analog signal input to the
instruction.
Valid = any float
Default = 0.0
In6 REAL The sixth analog signal input to the
instruction.
Valid = any float
Default = 0.0
In7 REAL The seventh analog signal input to the
instruction.
Valid = any float
Default = 0.0
In8 REAL The eighth analog signal input to the
instruction.
Valid = any float
Default = 0.0
Description
Based on the Selector value, the MUX instruction sets Out equal to one of
eight inputs.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition Action
Example
Function Block
This MUX instruction selects In1, In2, or In3, In4, In5, In6, In7, or In8 based
on the Selector. The instruction sets Out = Inn, which becomes an input
parameter for function_block_C. For example, if select_value = 2, the
instruction sets Out = analog_input2.
See also
Common Attributes on page 1083
Rate Limiter (RLIM) 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 RLIM instruction limits the amount of change of a signal over time.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
RLIM(RLIM_tag);
Operands
Function Block
Operand Type Format Description
RLIM tag RATE_LIMITER structure RLIM structure
RATE_LIMITER Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
In REAL The analog signal input to the
instruction.
Valid = any float
Default = 0.0
IncRate REAL Maximum output increment rate in
per-second units. If invalid, the
instruction sets IncRate = 0.0 and sets
the appropriate bit in Status.
Valid = any float 0.0
Default = 0.0
Structured Text
Operand Type Format Description
RLIM tag RATE_LIMITER structure RLIM structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The RLIM instruction provides separate increment and decrement rates in
per-second units. The ByPass input lets you stop rate limiting and pass the
signal directly to the output.
Condition Action
ByPass is true Outn = Inn
Outn-1 = Inn
ByPass is false and
DeltaT > 0
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true
The instruction executes.
Instruction first run N/A
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
Function Block
The RLIM instruction limits In by IncRate. If analog_input1 changes at a rate
greater than the IncRate value, the instruction limits In. The instruction sets
Out = rate limited value of In.
Structured Text
RLIM_01.In := analog_input1;
RLIM_01.IncRate := value;
RLIM(RLIM_01);
rate_limited := RLIM_01.Out;
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Select (SEL) This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
The SEL instruction uses a digital input to select one of two inputs.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
This instruction is not available in structured text.
Operands
Function Block
Operand Type Format Description
SEL tag SELECT structure SEL structure
SELECT Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If cleared, the
instruction does not execute and
outputs are not updated.
Default is set.
Description
The SEL instruction operates as follows:
Condition Action
SelectorIn is set Out = In2
SelectorIn is cleared Out = In1
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are
cleared to false.
Example
The SEL instruction selects In1 or In2 based on SelectorIn. If SelectorIn is set,
the instruction sets Out = In2. If SelectorIn is cleared, the instruction sets Out
= In1. Out becomes an input parameter for function_block_C.
Function Block
See also
Common Attributes on page 1083
Selected Negate (SNEG) 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 SNEG instruction uses a digital input to select between the input value
and the negative of the input value.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
SNEG(SNEG_tag);
Operands
Function Block
Operand Type Format Description
SNEG tag SELECTABLE_NEGATE Structure SNEG structure
SNEG Structure
Input Parameter Data Type Description
Structured Text
Operand Type Format Description
SNEG tag SELECTABLE_NEGATE Structure SNEG structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The SNEG instruction operates as follows:
Condition Action
NegateEnable is true Out = - In
NegateEnable is false Out = In
Major/Minor faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Example
The negate_enable input determines whether to negate In or not. The
instruction sets Out = In if NegateEnable is false. The instruction sets Out = -
In if NegateEnable is true.
Function Block
Structured Text
SNEG_01.In := analog_input1;
SNEG_01.NegateEnable := negate_enable;
SNEG(SNEG_01);
output_value := SNEG_01.Out;
See also
Common Attributes on page 1083
Selected Summer (SSUM) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
SSUM(SSUM_tag);
Operands
Function Block
Operand Type Format Description
SSUM tag SELECTED_SUMMER Structure SSUM structure
SELECTABLE_SUMMER Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If false, the instruction
does not execute and outputs are not
updated.
Default is true.
In1 REAL The first input to be summed.
Valid = any float
Default = 0.0
Gain1 REAL Gain for the first input.
Valid = any float
Default = 1.0
Select1 BOOL Selector signal for the first input.
Default is false.
In2 REAL The second input to be summed.
Valid = any float
Default = 0.0
Gain2 REAL Gain for the second input.
Valid = any float
Default = 1.0
Select2 BOOL Selector signal for the second input.
Default is false.
In3 REAL The third input to be summed.
Valid = any float
Default = 0.0
Gain3 REAL Gain for the third input.
Valid = any float
Default = 1.0
Select3 BOOL Selector signal for the third input.
Default is false.
In4 REAL The fourth input to be summed.
Valid = any float
Default = 0.0
Gain4 REAL Gain for the fourth input.
Valid = any float
Default = 1.0
Select4 BOOL Selector signal for the fourth input.
Default is false.
In5 REAL The fifth input to be summed.
Valid = any float
Default = 0.0
Structured Text
Operand Type Format Description
SSUM tag SELECTED_SUMMER Structure SSUM structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The SSUM instruction operates as follows:
Condition Action
No In is selected Out = Bias
One or more In are selected For all n where Selectn is true
Out = ∑ (Inn x Gainn) + Bias
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
The values of select1 and select 2 determine whether to select analog_input1
and analog_input2, respectively. The instruction then adds the selected inputs
and places the result in Out.
Function Block
Structured Text
SSUM_01.In1 := analog_input1;
SSUM_01.Select1 := select1;
SSUM_01.In2 := analog_input2;
SSUM_01.Select2 := select2;
SSUM(SSUM_01);
selected_add := SSUM_01.Out;
See also
Common Attributes on page 1083
Statistical Instructions
Statistical Instructions
The Statistical instructions include these instructions:
Available Instructions
Ladder Diagram
Not available
See also
Filter Instructions on page 875
Moving Average (MAVE) 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 MAVE instruction calculates a time average value for the In signal. This
instruction optionally supports user-specified weights.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
MAVE(MAVE_tag,storage,weight);
Operands
Function Block
Operand Type Format Description
MAVE tag MOVING_AVERAGE structure MAVE structure
storage REAL array Holds the moving average
samples. This array must be
at least as large as
NumberOfSamples.
MOVING_AVERAGE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not
execute and outputs are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
InFault BOOL Bad health indicator for the input. If In is read from
an analog input, then InFault is normally controlled by
fault status on the analog input. When set, InFault
indicates the input signal has an error, the
instruction sets the appropriate bit in Status, and the
instruction holds Out at its current value. When
InFault transitions from set to cleared, the instruction
initializes the averaging algorithm and continues
executing.
Default is cleared.
Initialize BOOL Initialize input to the instruction. When set, the
instruction holds Out = In, except when InFault is set,
in which case, the instruction holds Out at its current
value. When Initialize transitions from set to cleared,
the instruction initializes the averaging algorithm and
continues executing.
Default is cleared.
SampleEnable BOOL Enable for taking a sample of In. When set, the
instruction enters the value of In into the storage
array and calculates a new Out value. When
SampleEnable is cleared and Initialize is cleared, the
instruction holds Out at its current value.
Default is set.
NumberOfSamples DINT The number of samples to be used in the calculation.
If this value is invalid, the instruction sets the
appropriate bit in Status and holds Out at its current
value. When NumberOfSamples becomes valid again,
the instruction initializes the averaging algorithm and
continues executing.
Valid = 1 to (minimum size of StorageArray or
WeightArray, if used)
Default = 1
Structured Text
Operand Type Format Description
MAVE tag MOVING_AVERAGE structure MAVE structure
storage REAL array Holds the moving average
samples. This array must be
at least as large as
NumberOfSamples.
weight REAL array (optional)
Used for weighted averages.
This array must be at least
as large as
NumberOfSamples. Element
[0] is used for the newest
sample; element [n] is used
for the oldest sample.
MOVING_AVERAGE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not
execute and outputs are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Description
The MAVE instruction calculates a weighted or non-weighted moving average
of the input signal. The NumberOfSamples specifies the length of the moving
average span. At every scan of the block when Sample Enable is set, the
instruction moves the value of In into the storage array and discards the
oldest value. Each Inn has a user-configured Weightn, which is used if
UseWeights is set.
Condition Action
Weighted averaging method
UseWeights is set.
The instruction will not place an invalid In value (NAN or ± INF) into the
storage array. When In is invalid, the instruction sets Out = In and logs an
overflow minor fault, if this reporting is enabled. When In becomes valid, the
instruction initializes the averaging algorithm and continues executing.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
Each scan, the instruction places input_value in array storage. The instruction
calculates the average of the values in array storage, optionally using the
weight values in array weight, and places the result in Out.
Function Block
Structured Text
MAVE_01.In := input_value;
MAVE(MAVE_01,storage,weight);
output_value := MAVE_01.Out;
See also
Function Block Attributes on page 1043
Maximum Capture (MAXC) 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 MAXC instruction retains the maximum value of the input over time and
allows the user to re-establish a maximum as needed.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
MAXC(MAXC_tag);
Operands
Function Block
Operand Type Format Description
MAXC tag MAXIMUM_CAPTURE Structure MAXC structure
MAXIMUM_CAPTURE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs
are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Reset BOOL Request to reset control algorithm. The instruction sets Out =
ResetValue as long as Reset is set.
Default is cleared.
ResetValue REAL The reset value for the instruction. The instruction sets Out =
ResetValue as long as Reset is set.
Valid = any float
Default = 0.0
Structured Text
Operand Type Format Description
MAXC tag MAXIMUM_CAPTURE Structure MAXC structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The MAXC instruction executes this algorithm:
Condition Action
Reset is set LastMaximum = Reset value
Out = LastMaximum
Reset is cleared If In > LastMaximum then update LastMaximum.
Out = LastMaximum.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Set request to initialize the Maximum value with the current input.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
If Reset is set, the instruction sets Out=ResetValue. If Reset is cleared, the
instruction sets Out=In when In> LastMaximum. Otherwise, the instruction
sets Out= LastMaximum.
Function Block
Structured Text
MAXCTag.In := input_value;
MAXCTag.Reset := reset_input;
MAXCTag.ResetValue := reset_value;
MAXC(MAXCTag);
result := MAXCTag.Out;
See also
Common Attributes on page 1083
Minimum Capture (MINC) 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 MINC instruction retains the minimum value of the input over time and
allows the user to re-establish a minimum as needed.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block
Structured Text
MINC(MINC_tag);
Operands
Function Block
Operand Type Format Description
MINC tag MINIMUM_CAPTURE structure MINC structure
MINIMUM_CAPTURE Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs
are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Reset BOOL Request to reset control algorithm. The instruction sets Out =
ResetValue as long as Reset is set.
Default is cleared.
ResetValue REAL The reset value for the instruction. The instruction sets Out =
ResetValue as long as Reset is set.
Valid = any float
Default = 0.0
Structured Text
Operand Type Format Description
MINC tag MINIMUM _CAPTURE structure MINC structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The MINC instruction executes this algorithm:
Condition Action
Reset is set LastMinimum = ResetValue
Out = ResetValue
Reset is cleared If In < LastMinimum then update LastMinimum.
Out = LastMinimum.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run N/A
Instruction first scan Set request to initialize the Maximum value with the current input.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Examples
If Reset is set, the instruction set Out=ResetValue. If Reset is cleared, the
instruction set Out=In when In < LastMinimum. Otherwise, the instruction
sets Out= LastMinimum.
Function Block
Structured Text
MINCTag.In := input_value;
MINCTag.Reset := reset_input;
MINCTag.ResetValue := reset_value;
MINC(MINCTag);
result := MINCTag.Out;
See also
Common Attributes on page 1083
Moving Standard Deviation This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
(MSTD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix
5580 controllers.
The MSTD instruction calculates a moving standard deviation and average for
the In signal.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
MSTD(MSTD_tag, StorageArray);
Operands
Function Block
Operand Type Format Description
block tag MOVING_STD_DEV structure MSTD structure
StorageArray REAL array Holds the In samples. This
array must be at least as
large as NumberOfSamples.
MOVING_STD_DEV Structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does
not execute and outputs are not updated.
Default is set.
In REAL The analog signal input to the instruction.
Valid = any float
Default = 0.0
Structured Text
Operand Type Format Description
block tag MOVING_STD_DEV structure MSTD structure
StorageArray REAL array Holds the In samples. This
array must be at least as
large as
NumberOfSamples.
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The MSTD instruction supports any input queue length. Each scan, if
SampleEnable is set, the instruction enters the value of In into a storage array.
When the storage array is full, each new value of In causes the oldest entry to
be deleted.
Out
The instruction will not place an invalid In value (NAN or INF) into the
storage array. When In is invalid, the instruction sets Out = In, sets Average =
In, and logs an overflow minor fault, if this reporting is enabled. When In
becomes valid, the instruction initializes the standard deviation algorithm
and continues executing.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run Initialize the previous Output and Average.
Instruction first scan Initialize Out to zero.
Initialize Average to Input
Initialize the instruction algorithm.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
Each scan that SampleEnable is set, the instruction places the value of In into
array storage, calculates the standard deviation of the values in array storage,
and places the result in Out. Out becomes an input parameter for
function_block_C.
Function Block
Structured Text
MSTD_01.In := input_value;
MSTD_01.SampleEnable := enable_sample;
MSTD(MSTD_01,storage);
deviation := MSTD_01.Out;
See also
Common Attributes on page 1083
Available Instructions
Function Block
Not available
Structured Text
DFF JKFF RESD SETD
See also
Filter Instructions on page 875
Drives Instructions on page 823
D Flip-Flop (DFF) 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.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
DFF(DFF_tag);
Operands
Function Block
Operand Type Format Description
DFF tag FLIP_FLOP_D structure DFF structure
FLIP_FLOP_D Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If cleared, the
instruction does not execute and
outputs are not updated.
Default is set.
D BOOL The input to the instruction.
Default is cleared.
Structured Text
Operand Type Format Description
DFF tag FLIP_FLOP_D structure DFF structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
When Clear is set, the instructions clears Q and sets QNot. Otherwise, if Clock
is set and Clockn-1 is cleared, the instruction sets Q=D and sets QNot = NOT
(D).
The instruction sets Clockn-1 = Clock state every scan.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Example
When Clock goes from cleared to set, the DFF instruction sets Q = D. When
Clear is set, Q is cleared. The DFF instruction sets QNot to the opposite state
of Q.
Function Block
Structured Text
DFF_03.D := d_input;
DFF_03.Clear := clear_input;
See also
Common Attributes on page 1083
JK Flip-Flop (JKFF) 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 JKFF instruction complements the Q and QNot outputs when the Clock
input transitions from cleared to set.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
JKFF(JKFF_tag);
Operands
Function Block
Operand Type Format Description
JKFF tag FLIP_FLOP_JK Structure JKFF structure
FLIP_FLOP_JK Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If cleared, the
instruction does not execute and
outputs are not updated.
Default is set.
Clear BOOL Clear input to the instruction. If set,
the instruction
clears Q and sets QNot.
Clock BOOL Clock input to the instruction.
Default is cleared.
Structured Text
Operand Type Format Description
JKFF tag FLIP_FLOP_JK Structure JKFF structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
When Clear is set, the instructions clears Q and sets QNot. Otherwise, if Clock
is set and Clockn-1 is cleared, the instruction toggles Q and QNot.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run Clockn-1 is set to 1.
Qn-1 is cleared to 0.
Instruction first scan Previous input Clock states is set to True.
Previous output Q state is False.
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block
table.
Postscan See Postscan in the Function Block table.
Examples
When Clock goes from cleared to set, the JKFF instruction toggles Q. If Clear
is set, Q is always cleared. The JKFF instruction sets QNot to the opposite state
of Q.
Function Block
Structured Text
JKFF_01.Clear := clear_input;
JKFF_01.Clock := clock_input;
JKFF(JKFF_01);
q_output := JKFF_01.Q;
qNot_output := JKFF_01.QNot;
See also
Common Attributes on page 1083
Structured Text Syntax on page 1057
Reset Dominant (RESD) 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 RESD instruction uses Set and Reset inputs to control latched outputs.
The Reset input has precedence over the Set input.
Available Languages
Ladder Diagram
This instruction is not available for ladder diagram.
Function Block
Structured Text
RESD(RESD_tag);
Operands
Function Block
Operand Type Format Description
RESD tag DOMINANT_RESET structure RESD structure
DOMINANT_RESET Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If cleared, the instruction
does not execute and outputs are not
updated.
Default is set.
Set BOOL Set input to the instruction.
Default is cleared.
Clear BOOL Reset input to the instruction.
Default is cleared.
Structured text
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
Description
The Reset Dominant instruction uses the Set and Reset input parameters to
control latched output parameters Out and OutNot. The Reset input has
precedence over the Set input.
Out will be latched true whenever the Set input parameter is set true. Setting
the Reset parameter to true will override the current state of Out, setting Out
to false.
When Reset returns to false, Out will be latched to the current state of the Set
input parameter. OutNot will be set to the opposite state of Out.
Major/Minor Faults
None specific to this instruction. See Common Attributes for fault related
attributes.
Execution
Function Block
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run Previous Out is set to False.
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
When Set is true and Reset is false, Out is set true. When Reset is true, Out is
cleared. The Reset input has precedence over the Set input. The RESD
instruction sets OutNot to the opposite state of Out.
Function Block
Structured Text
RESD_01.Set := set_input;
RESD_01.Reset := reset_input;
RESD(RESD_01);
out_output := RESD_01.Out;
outNot_output := RESD_01.OutNot;
See also
Common Attributes on page 1083
Set Dominant (SETD) 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 SETD instruction uses Set and Reset inputs to control latched outputs.
The Set input has precedence over the Reset input.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
SETD(SETD_tag);
Operands
Function Block
Operand Type Format Description
SETD tag DOMINANT_SET structure SETD structure
Structured text
Operand Type Format Description
SETD tag DOMINANT_SET structure SETD structure
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
DOMINANT_SET Structure
Input Data Type Description
Parameter
EnableIn BOOL Enable input. If cleared, the instruction does not
execute and outputs are not updated.
Default is set.
Set BOOL Set input to the instruction.
Default is cleared.
Clear BOOL Reset input to the instruction.
Default is cleared.
Description
The Set Dominant instruction uses the Set and Reset input parameters to
control latched output parameters Out and OutNot. The Set input has
precedence over the Reset input.
Out will be latched true whenever the Set input parameter is set true. Setting
the Reset parameter to true will set Out to false only if the Set input is false.
OutNot will be set to the opposite state of Out.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related
faults.
Execution
Condition/State Action Taken
Prescan EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run Previous Out is set to True.
Instruction first scan N/A
Postscan EnableIn and EnableOut bits are cleared to false
Structured Text
Condition/State Action Taken
Prescan See Prescan in the Function Block table.
Normal Execution See Tag.EnableIn is true in the Function Block table.
Postscan See Postscan in the Function Block table.
Example
When Set is true, Out is set true. When Set is false and Reset is true, Out is
cleared. The Set input has precedence over the Reset input. The SETD
instruction sets OutNot to the opposite state of Out.
Function Block
Structured Text
SETD_01.Set := set_input;
SETD_01.Reset := reset_input;
SETD(SETD_01);
out_output := SETD_01.Out;
outNot_output := SETD_01.OutNot;
See also
Common Attributes on page 1083
Available Instructions
Function Block
These instructions are not available in function block.
If want to: Use this instruction:
Signal an equipment phase that the state routine is complete to indicate PSC
that it should go to the next state
Change the state or substate of an equipment phase PCMD
Give a Hold, Stop, or Abort command to an equipment phase, regardless POVR
of ownership
Signal a failure for an equipment phase PFL
Clear the failure code of an equipment phase PCLF
Initiate communication with FactoryTalk Batch software. PXRQ
See also
Equipment Sequence Diagram instructions on page 1031
Attach to Equipment Phase This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
(PATT) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Use the PATT instruction to take ownership of an equipment phase to either:
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PATT(Phase_Name,Result);
Operands
Ladder Diagram
Operand Type Format Description
Phase Name PHASE Name of the Equipment phase to own.
equipment phase
Result DINT immediate To let the instruction return a
tag code for its success or failure,
enter a DINT tag in which to
store the result code. Otherwise,
enter 0.
Structured Text
The operands are the same as those for the Ladder Diagram PATT instruction.
Major/Minor Faults
None. See Index Through Arrays for operand-related faults.
Execution
For 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. All
Conditions below the thick solid line can only occur during Normal Scan
mode.
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes as described above.
Example
Ladder Diagram
If Step.1 = 1 (first step in the sequence) then
Structured Text
Number Description
At the first step in the sequence, the Take_Ownership action tries to take ownership of two
equipment phases that the sequence uses.
Action_009 checks that the program owns the equipment phases. If the Result of each PATT
instruction = 0 or 24282 (the program owns the equipment phase), then a bit within the
Ownership tag = 1. (In the Ownership tag, each equipment phase is assigned a bit.)
If the Ownership = 3 (The program owns both equipment phases as shown by bits 0 and 1.),
then the SFC goes to the next step.
See also
Equipment Phase Instructions on page 969
Detach from Equipment This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
Phase (PDET) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
After a program executes a PDET instruction, the program no longer owns the
equipment phase. This frees the equipment phase for ownership by another
program or by FactoryTalk Batch software. Use the PDET instruction only if
the program previously took ownership of an equipment phase via an Attach
to Equipment Phase (PATT) instruction.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PDET(Phase_Name);
Operands
Ladder Diagram
Operand Type Format Description
Phase Name PHASE Name of the Equipment phase no
equipment phase longer to own.
Structured Text
The operands are the same as those for the Ladder Diagram PDET instruction.
Major/Minor Faults
None. See Index Through Arrays for operand-related faults.
Execution
For 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.
Example
Ladder Diagram
If Step.6 = 1 (step 6 in the sequence) then
Structured Text
See also
Equipment Phase Instructions on page 969
Equipment Phase Clear This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
Failure (PCLF) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Use the PCLF instruction to clear the failure code of an equipment phase.
The PCLF instruction clears the failure code for an equipment phase.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PCLF(Phase_Name);
Operands
Ladder Diagram
Operand Type Format Description
Phase Name PHASE Name of the Equipment phase whose failure
equipment phase code to clear.
Structured Text
The operands are the same as those for the Ladder Diagram PCLF instruction.
Major/Minor Faults
None. See Index Through Arrays below for operand-related faults.
Execution
For Structured Text, EnableIn is always true during normal scan. Therefore, if
the instruction is in the control path activated by the logic, it executes.
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes as described above.
Example
Ladder Diagram
If Drain_Tank_Restart = 1 (restart the Drain_Tank equipment phase) then
Structured Text
(*If Drain_Tank_Restart = on, then
PCLF(Drain_Tank);
PCMD(Drain_Tank,Restart,0);
Drain_Tank_Restart := 0;
End_If;
See also
Equipment Phase Instructions on page 969
Index Through Arrays on page 1094
Equipment Phase Command This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
(PCMD) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
In the running state routine, use the PSC instructions to transition the
equipment phase to the complete state. For more information about Paused
functionality, please see the PPD phase instruction.
Tip: The PPD instruction is necessary for using pause functionality.
Number Description
Command
Some states need a command to go to the next state. If the equipment phase is in the idle state,
a start command transitions the equipment phase to the running state. Once in the running
state, the equipment phase executes its running state routine.
Other states use a Phase State Complete (PSC) instruction to go to the next state. If the
equipment phase is in the holding state, a PSC instruction transitions the equipment phase to
the held state. Once in the held state, the equipment phase needs a restart command to go to
the restarting state.
Sub-state
Use Auto Pause, Pause, and Resume to test and debug a state routine. The sub-states require
the Equipment Phase Paused (PPD) instruction to create breakpoints in the logic.
Use the auto pause, pause, and resume commands to step through the breakpoints.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PCMD (PhaseName,Command,Result);
Operands
Ladder Diagram
Operand Type Format Description
Phase Name PHASE Name of the Equipment phase to change to a
equipment phase different state.
Command command Command Command to send to the equipment
enumeration value phase to change its state. For
available commands, refer to the
illustration above.
Result DINT immediate To let the instruction return a code for
tag its success or failure, enter a DINT tag
in which to store the result code.
Otherwise, enter 0.
Structured Text
The operands are the same as those for the Ladder Diagram PCMD
instruction.
Tip: High priority HMI ownership is specific only to CompactLogix 5370 and ControlLogix 5570
controllers.
Major/Minor Faults
None. See Index Through Arrays for operand-related faults.
Execution
For 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. All
conditions below the think solid line can only occur during Normal Scan
mode.
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes as described above.
Example 1
Ladder Diagram
Number Description
If ProcedureB_Stepindex = 20 (the routine is at step 20)
And this is the transition to step 20 (the ONS instruction signals that the EQU instruction went from false to true.)
Then
Change the state of the Add_Water equipment phase to running via the start command.
If ProcedureB_Stepindex = 20 (the routine is at step 20)
And the Add_Water equipment phase is complete (Add_Water.Complete = 1)
Then
Change the state of the Add_Water equipment phase to resetting via the reset command. Advance to step 30.
Structured Text
Number Description
When the SFC enters Add_Water_Step, change ADD_Water equipment phase to running via the start command, The P1
qualifier limits this to the first scan of the step.
Before the SFC leaves Add_Water_Step (Add_Water_Complete = 1), change Add_Water equipment phase to resetting via
the reset command. The P0 qualifier limits this to the last scan of the step.
Example 2
Ladder Diagram
Number Description
If ProcedureB_Stepindex = 30 (the routine is at step 30)
And this is the transition to step 30 (the ONS instruction signals that the EQU instruction went from false to true.)
Then
Change the state of the Add_Water equipment phase to running via the start command.
Verify that the command was successful and store the result code in PCMD_Result[1] [DINT Tag].
Structured Text
Number Description
When the SFC enters Add_Ingredient_Step
• Change Add_Ingredient equipment phase to running via the start commend.
• Verify that the command was successful and store the result code in PCDM_Result[2] (DINT tag).
The P1 qualifier limits this to the first scan of the step.
See also
Equipment Phase Instructions on page 969
Index Through Arrays on page 1094
Equipment Phase Paused (PPD)
Equipment Phase External This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
Request (PXRQ) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PXRQ (Phase_Instruction, External_Request, Data_Value);
Operands
Ladder Diagram
Operand Type Format Description
Phase Instruction PHASE_INSTRUCTION tag Tag that controls the operation.
External Request request enumeration Type of request.
value
Data Value DINT array tag Parameters of the request.
Structured Text
The operands are the same as those for the Ladder Diagram PXRQ
instruction.
Timing Diagram
...
...
...
Send a message (and optional data) to Send Message to Linked DINT[0] message ID
another phase and wait for the phase to Phase and Wait DINT[1] Number of phases to receive
receive the message message
DINT[2] Message Value
...
Wait to receive a message from another Receive Message From DINT[0] message ID
phase Linked Phase
DINT[1] Message Value
...
Major/Minor Faults
None. See Index Through Arrays for operand-related faults.
Execution
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes.
Example
Ladder Diagram
Structured Text
See also
Equipment Phase Instructions on page 969
Equipment Phase Failure This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
(PFL) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
The PFL instruction sets the value of the failure code for an equipment phase.
Use the instruction to signal a specific failure for an equipment phase, such as
a specific device has faulted. The PFL instruction sets the failure code only to a
value greater than its current value.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PFL (Failure_Code);
Operands
Ladder Diagram
Operand Type Format Description
Failure_Code DINT immediate Value to set the failure code for the equipment
tag phase.
If a negative failure code given, it evaluates as 0.
Structured Text
The operands are the same as those for the Ladder Diagram PFL instruction.
Number Description
Prestate routine
Current state routine
Use the progress routine to continuously monitor the health of an equipment phase as it
progresses through its states.
Number Description
When creating an equipment phase, the Logix Designer
application creates a tag for the status of the equipment
phase.
controller scope
Name = phase_name
PHASE data type
The PFL instruction writes its value to the failure member for
the equipment phase.
To clear the Use a PCLF instruction to clear the failure code of an equipment phase. Instructions such as
failure code, a CLR or MOV will not change the failure code.
use a PCLF
instruction.
Major/Minor Faults
A major fault will occur if: Fault type Fault code
Instruction is called from outside an Equipment Phase 4 91
program.
Execution
For 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. All
conditions below the thick solid line can only occur during Normal Scan
mode.
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes as described above.
Example
Ladder Diagram
In the prestate routine of an equipment phase...
Change the state of the Drain_Tank equipment phase to holding via the hold
command.
Structured Text
In the prestate routine of an equipment phase...
See also
Equipment Phase Instructions on page 969
Equipment Phase New This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
Parameters (PRNP) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Number Description
When FactoryTalk Batch software has new parameters for an equipment
phase, it sets the NewInputParameters bit for the phase.
After downloading the parameters, use the PRNP instruction to clear the bit.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PRNP ( );
Operands
Ladder Diagram
None
Structured Text
None
Enter the parentheses ( ) after the instruction mnemonic, even though there
are no operands.
Major/Minor Faults
None. See Index Through Arrays for operand-related faults.
Execution
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
Example
Ladder Diagram
Structured Text
Enable_PXRQ = 1 (Let the PXRQ instruction execute the next time new
input parameters are available.)
See also
Equipment Phase Instructions on page 969
Index Through Arrays on page 1094
Equipment Phase Override This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
Command (POVR) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
POVR (PhaseName, Command, Result);
Operands
Ladder Diagram
Operand Type Format Description
Phase Name phase Name of the Equipment phase to change to a
equipment phase different state
Command command Name of the One of these commands for the
command equipment phase:
• Hold
• Stop
• Abort
Result DINT immediate To let the instruction return a
tag code for its success or failure,
enter a DINT tag in which to
store the result code. Otherwise,
enter 0.
Structured Text
The operands are the same as those for the Ladder Diagram POVR
instruction.
Major/Minor Faults
None. See Index Through Arrays for operand-related faults.
Execution
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes.
Example
Number Description
The equipment program watches for the these faults:
• Faulted axis
• Jammed material
If there is a fault, then
Local_Interface.Equipment_Faults_Cleared = 0. This tag is an alias for the controller-scoped tag Shear_1.
The prestate routine of the equipment phase watches for the equipment program to signal a fault.
• If Interface_To_Equipment.Equipment_Faults_Cleared=0 then there is a fault.
• Both Interface_To_Equipment and Local_Interface as aliases for Shear_1, so they have the same values.
If there is a fault, then
Give the Shear_One_Phase equipment phase the abort command. The POVR instruction makes sure the command
works, even if someone has manual control of the equipment phase through Logix Designer software.
The PFL instruction sets the failure code for Shear_One_Phase = 333.
The Fault_Strobe keeps these actions to a single scan.
Ladder Diagram
Example 2
Structured Text
If NOT Equipment_Faults_Cleared And NOT Fault_Strobe then
POVR(POVRTest,Abort, 0);
PFL(333);
end_if;
Fault_Strobe := NOT Equipment_Faults_Cleared;
See also
Equipment Phase Instructions on page 969
Equipment Phase Paused This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
(PPD) Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PPD( );
Operands
Ladder Diagram
None
Structured Text
None
Enter the parentheses ( ) after the instruction mnemonic, even though there
are no operands.
Major/Minor Faults
A major fault occurs if: Fault type Fault code
Instruction is called from outside an Equipment 4 91
Phase program.
Execution
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes.
Example
Ladder Diagram
See also
Equipment Phase Instructions on page 969
Phase State Complete (PSC) This instruction applies to the CompactLogix 5370 and CompactLogix 5380,
ControlLogix 5570 and ControlLogix 5580, Compact GuardLogix 5370 and
Compact GuardLogix 5380, and GuardLogix 5570 and GuardLogix 5580
controllers.
Use the PSC instruction to signal an equipment phase that the state routine is
complete to indicate that it should go to the next state.
In the running state routine, use the PSC instruction to transition the
equipment phase to the complete state.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PSC( );
Operands
Ladder Diagram
None
Structured Text
None
Remember that the PSC instruction does not stop the current scan of a routine. When the PSC instruction
executes, the controller scans the
rest of the routine and then
transitions the equipment phase
to the next state. The PSC
instruction does not terminate the
execution of the routine.
Do not use a PSC instruction in a prestate routine. Use the PSC instruction only to
signal the transition from one
state to another.
Major/Minor Faults
A major fault will occur if: Fault type Fault code
Instruction is called from outside an equipment phase 4 91
program.
Execution
In structured text, instructions execute each time they are scanned. To limit
the scan of an instruction, use a qualifier of an SFC action, a structured text
construct, or both.
Condition/State Action Taken
Prescan No action taken.
Postscan No action taken.
EnableIn is false No action taken.
EnableIn is true The instruction executes.
Examples
Ladder Diagram
Structured Text
If TagEnableRunning
PSC();
End_if;
See also
Equipment Phase Instructions on page 969
Equipment Sequence
See also
Equipment Sequence Diagram instructions on page 1031
SATT on page 1019, SDET on page 1021
Attach to Equipment Use the Attach to Equipment Sequence (SATT) instruction to take ownership
of an Equipment Sequence. An Equipment Sequence must be owned by a
Sequence (SATT) program before the program can command it. A tag must be assigned to store
the result code of an SATT instruction.
The SATT instruction returns one of five result codes. Result code 0 indicates
that the SATT instruction ran successfully. The other four codes indicate that
the instruction did not run successfully and provide additional information
about the reason for the instruction failure.
Available Languages
Ladder Diagram
Function Block
This language is not available for this instruction.
Structured Text:
SATT(SequenceName,Result)
Operands
The SATT instruction uses the following operands.
Operand Type Format Description
Sequence Name Sequence name of the Equipment Equipment Sequence that you want to change to own
Sequence (attach) to command (for example, Make_Product_101).
Result DINT immediate To let the instruction return a code for its success or
tag failure, enter a DINT tag in which the result code is stored.
Otherwise, enter 0.
Major/Minor Faults
The SATT instruction cannot trigger a fault, so there are no fault conditions
for this instruction.
Execution
The following table describes the execution steps for SATT instructions.
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true • The instruction executes.
• The rung-condition-out is set to true.
Scan of structured text No action taken
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan The rung-condition-out is set to false.
Structured Text
Condition Action Taken
Prescan No action taken.
Rung-condition-in is false No action taken.
Rung-condition-in is true No action taken.
Scan of structured text In structured text, instructions execute each time they are
scanned. To limit the scan of an instruction, use a qualifier of an
SFC action or a structured text construct.
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan No action taken.
See also
Guidelines for SATT instructions on page 1033
Result codes for SATT instructions on page 1036
Detach from Equipment Use the Detach from Equipment Sequence (SDET) instruction to relinquish
ownership of an Equipment Sequence. After a program executes an SDET
Sequence (SDET) instruction, the program no longer owns the Equipment Sequence. The
Equipment Sequence is then available for ownership by another program or
by FactoryTalk Batch software. Use the SDET instruction only if the program
previously took ownership of an Equipment Sequence through an Attach to
Equipment Sequence (SATT) instruction.
Available Languages
Ladder diagram
Function Block
This instruction is not available in Function Block.
Structured text
SDET(SequenceName)
Operands
The SDET instruction uses the following operand.
Operand Type Format Description
Sequence Name Sequence name of the Equipment Equipment Sequence for which you want to relinquish
Sequence ownership.
Major/Minor Faults
The SDET instruction cannot trigger a fault, so there are no fault conditions
for this instruction.
Execution
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Structured Text
Condition Action Taken
Prescan No action taken.
Rung-condition-in is false No action taken.
Rung-condition-in is true No action taken.
Scan of structured text In structured text, instructions execute each time they are
scanned. To limit the scan of an instruction, use a qualifier of an
SFC action or a structured text construct that includes a condition,
such as if, then, or else
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan No action taken.
See also
SDET instruction examples on page 1041
Equipment Sequence Assign Use the Assign Sequence Identifier (SASI) instruction to assign a sequence ID
to the Equipment Sequence. You can only set the sequence ID when the
Sequence Identifier (SASI) following prerequisites are met:
• The controller is online.
• The Equipment Sequence is in the IDLE state.
• You have taken ownership of the Equipment Sequence.
The sequence ID can be up to 82 characters in length, using the following
printable ASCII characters:
Available Languages
Ladder Diagram
Function Block
This instruction is not available in Function Block.
Structured Text
SASI(SequenceName,SequenceID,SequenceIDValue,Result)
Operands
The SASI instruction uses the following operands.
Operand Type Format Description
Sequence Name Sequence name of the Equipment Equipment Sequence to which you want to assign an
Sequence identifier.
Sequence ID STRING tag Enter a STRING tag in which the identifier is stored, or a
quoted string containing up to 82 characters.
Result DINT immediate To let the instruction return a code for its success or
tag failure, enter a DINT tag in which the result code is stored.
Otherwise, enter 0.
Major/Minor Faults
The SASI instruction cannot trigger a fault, so there are no fault conditions
for this instruction.
Execution
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true • The instruction executes.
• The rung-condition-out is set to true.
Scan of structured text No action taken
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan The rung-condition-out is set to false.
Structured Text
Condition Action Taken
Prescan No action taken.
Rung-condition-in is false No action taken.
Rung-condition-in is true No action taken.
Scan of structured text In structured text, instructions execute each time they are
scanned. To limit the scan of an instruction, use a qualifier of an
SFC action or a structured text construct.
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan No action taken.
See also
SASI instruction examples on page 1038
Equipment Sequence Clear Use the Equipment Sequence Clear Failure (SCLF) instruction to clear the
failure code of an Equipment Sequence. Keep the following in mind when
Failure (SCLF) using the SCLF instruction.
Available Languages
Ladder diagram
Function Block
Not available
Structured text
SCLF(SequenceName)
Operands
The SCLF instruction uses the following operands.
Operand Type Format Description
Sequence Name Sequence name of the Equipment Equipment Sequence for which you want to clear a failure
Sequence code.
Result DINT Immediate tag For an instruction to return a success or failure code,
enter a DINT tag where the result code is stored.
Otherwise, enter 0.
Major/Minor Faults
The SCLF instruction cannot trigger a fault, so there are no fault conditions
for this instruction.
Execution
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true The instruction executes.
The rung-condition-out is set to true.
Scan of structured text No action taken
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan The rung-condition-out is set to false.
Structured Text
Condition Action Taken
Prescan No action taken.
Rung-condition-in is false No action taken.
Rung-condition-in is true No action taken.
Scan of structured text In structured text, instructions execute each time they are
scanned. To limit the scan of an instruction, use a qualifier of an
SFC action or a structured text construct that includes a condition,
such as if, then, or else
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan No action taken.
See also
Result codes for SCLF instructions on page 1036
SDET instruction examples on page 1041
Equipment Sequence Use the Equipment Sequence command (SCMD) instruction to change the
state of an Equipment Sequence. The SCMD instruction can send the
command (SCMD) following commands to an Equipment Sequence: START, RESTART, HOLD,
STOP, ABORT, and RESET. The program must attach to an Equipment
Sequence before the SCMD instruction can run. Use the SATT instruction to
attach to an Equipment Sequence.
Available Languages
The SCMD instruction is available in the following languages.
Ladder Diagram
Function Block
This instruction is not available in Function Block.
Structured Text
SCMD(SequenceName,Command,Result)
Supported Operands
The SCMD instruction uses the following operands.
Operand Type Format Description
Sequence Name Sequence Name of the Equipment Equipment Sequence to change to a different state.
Sequence For example, Make_Product_101.
Command Command Name of the command Command to send to the Equipment Sequence and
change state. Send one of these commands: START,
RESTART, HOLD, STOP, ABORT, or RESET.
Result DINT Immediate tag For an instruction to return a success or failure code,
enter a DINT tag where the result code is stored.
Otherwise, enter 0.
Execution
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true The instruction executes.
The rung-condition-out is set to true.
Scan of structured text No action taken
Instruction execution The instruction tries to take ownership of the specified Equipment
Sequence.
Postscan The rung-condition-out is set to false.
Structured Text
Condition Action Taken
Prescan No action taken.
Rung-condition-in is false No action taken.
Rung-condition-in is true No action taken.
Scan of structured text In structured text, instructions execute each time they are
scanned. To limit the scan of an instruction, use a qualifier of an
SFC action or a structured text construct.
See also
SCMD instruction examples on page 1040
Use an SOVR instruction instead of an SCMD instruction on page 1042
Equipment Sequence The following table describes the Equipment Sequence Diagram instructions.
Diagram instructions
Icon Icon Name Description
Add Step and Transition Pair Use Add Step and Transition Pair to add a step and transition pair.
Although added as a pair, you can select and edit each element separately.
Add Disconnected Step Use the Add Disconnected Step to add a step without adding a
transition.
Add Disconnected Transition Use Add Disconnected Transition to add a transition without adding
a step.
Add Simultaneous Divergence Use Add Simultaneous Divergence to create a branch where all
linked steps execute simultaneously.
Add Selective Divergence Use Add Selective Divergence to create a divergence for a
selective branch. In a selective divergence, only one of multiple paths is
executed--the path containing the transition that first evaluates as TRUE.
Add Simultaneous Convergence Use Add Simultaneous Convergence to merge simultaneous
execution paths back together.
Add Selective Convergence Use Add Selective Convergence to merge selective divergent paths
back into one execution path in the selective branch.
See also
Equipment Sequence instructions on page 1019
Equipment Sequence Use the Equipment Sequence Override (SOVR) instruction to send a HOLD,
STOP, or ABORT command to an Equipment Sequence, regardless of
Override (SOVR) ownership.
IMPORTANT The SOVR instruction is intended for emergencies only. Control Engineers should use
caution when deciding to use it.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in Function Block.
Structured Text
SOVR(SequenceName,Command,Result)
Operands
The SOVR instruction uses the following operands.
Operand Type Format Description
Sequence Name Sequence Name of the Equipment Equipment Sequence to change to a different state.
Sequence For example, Make_Product_101.
Command Command Name of the command Command to send to the Equipment Sequence and
change state. Use one of these commands:
• HOLD
• STOP
• ABORT
Result DINT Immediate tag For an instruction to return a success or failure code,
enter a DINT tag where the result code is stored.
Otherwise, enter 0.
Major/Minor Faults
The SOVR instruction cannot trigger a fault, so there are no fault conditions
for this instruction.
Execution
Ladder Diagram
Condition Action Taken
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true The instruction executes.
The rung-condition-out is set to true.
Scan of structured text No action taken
Instruction execution The instruction commands the Equipment Sequence to the
specified state.
Postscan The rung-condition-out is set to false.
Structured Text
Condition Action Taken
Prescan No action taken.
Rung-condition-in is false No action taken.
Rung-condition-in is true No action taken.
Scan of structured text In structured text, instructions execute each time they are
scanned. To limit the scan of an instruction, use a qualifier of an
SFC action or a structured text construct that includes a condition,
such as if, then, or else.
Instruction execution The instruction commands the Equipment Sequence to the
specified state. The SOVR instruction sends one of the following
commands: HOLD, STOP, or ABORT.
Postscan No action taken.
See also
Guidelines for SOVR instructions on page 1035
Guidelines for SATT Keep the following guidelines in mind when using the Attach to Equipment
Sequence (SATT) instruction.
instructions
Guideline Details
Remember that the Logix Designer application Ownership makes sure that a program can command the
overrides ownership of the Equipment Sequence. Equipment Sequence, and it locks out any other
sequencers.
The Equipment Sequence must be owned by the Both Equipment Sequences and Equipment Phases must
program to command it. be owned to be commanded. The ownership commands are
Attach (SATT) and Detach (SDET).
Internal sequencers (programs), external sequencers
(FactoryTalk Batch), and operators use an Attach
instruction to command an Equipment Sequence.
When the sequence is done, relinquish To relinquish ownership, use a Detach from Equipment
ownership. Sequence (SDET) instruction.
Avoid making unnecessary command requests if Unnecessary command requests can flood the event
the equipment sequence is generating sequence processing buffers and cause you to miss significant
events. events.
Use the Result code to verify ownership, and Use the Result operand to get a code that shows the
include steps that should take place if the success or failure of the SATT instruction.
attachment fails because the Equipment On each execution, the SATT instruction tries to take
Sequence is owned by another program or by the ownership of the Equipment Sequence. When a program or
operator. operator owns an Equipment Sequence, another execution
of the SATT instruction fails and produces result code
24582. When you use the SATT instruction, either:
• Limit its execution to a single scan to avoid the 24582
result code.
• Include the following in your conditions for ownership:
result code = 24582.
See also
Attach to Equipment Sequence on page 1019
Guidelines for SCMD Keep the following guidelines in mind when using the Equipment Sequence
Command (SCMD) instruction. The SCMD instruction can send the following
instructions commands: START, RESTART, HOLD, STOP, ABORT, and RESET.
Guideline Details
Limit execution of the SCMD instruction Limit the execution of the SCMD instruction to a single scan. Each command applies
to a single scan. to only a specific state or states. Once the Equipment Sequence changes state, the
command is no longer valid. To limit execution, use methods such as:
• Run the SCMD instruction within a P1 Pulse (Rising Edge) or P0 Pulse (Falling Edge)
action.
• Place a one-shot instruction before the SCMD instruction.
• Run the SCMD instruction and then advance to the next step.
The Equipment Sequence must be Both Equipment Sequences and Equipment Phases must be owned to be
owned by the program to command it. commanded. The ownership commands are Attach (SATT) and Detach (SDET).
Internal sequencers (programs), external sequencers (FactoryTalk Batch), and
operators use an Attach instruction to command an Equipment Sequence.
See also
Equipment Sequence command (SCMD) on page 1027
Guidelines for SOVR Use the Equipment Sequence Override (SOVR) instruction to send a HOLD,
STOP, or ABORT command to an Equipment Sequence, regardless of
instructions ownership.
IMPORTANT The SOVR instruction is intended for emergencies only. Control Engineers should use
caution when deciding to use it.
Keep the following guidelines in mind when using the Equipment Sequence
Override (SOVR) instruction.
Guideline Details
Make sure you want to override other Under most circumstances, use the SCMD instruction to programmatically command
owners. an Equipment Sequence. However, use the SOVR instruction to command an
Equipment Sequence under the following conditions:
• When you are giving the HOLD, STOP, or ABORT command, and the command must
always execute under all ownership circumstances.
• If the HOLD, STOP, or ABORT command must execute even when you have manual
control of the Equipment Sequence through the Logix Designer application or when
another program, such as the FactoryTalk Batch software, owns the Equipment
Sequence.
Limit execution of the SOVR instruction Limit the execution of the SOVR instruction to a single scan. Each command applies to
to a single scan. only a specific state or states. Once the Equipment Sequence changes state, the
command is no longer valid. To limit execution, use methods such as:
• Run the SOVR instruction within a P1 Pulse (Rising Edge) or P0 Pulse (Falling Edge)
action.
• Place a one-shot instruction before the SOVR instruction.
• Run the SOVR instruction and then advance to the next step.
Avoid making unnecessary command Unnecessary command requests can flood the event processing buffers and cause
requests if the Equipment Sequence is you to miss significant events.
generating sequence events.
See also
Equipment Sequence Override command on page 1031
Result codes for SOVR instructions on page 1038
Result codes for SATT When a tag is assigned to store the result of an Attach to Equipment
Sequence (SATT) instruction, the instruction returns one of the following
instructions codes when it runs.
Code (Dec) Description
0 The command was successful.
24579 The Equipment Sequence cannot be commanded for the following reason:
The program successfully attached to the Equipment Sequence, but it cannot command the sequence
because Logix Designer, a higher priority application, has overridden ownership.
24582 The program already owns the Equipment Sequence.
24593 One of the following already owns the equipment phase.
• An external sequencer such as FactoryTalk Batch software.
• Another program in the controller.
24594 The Equipment Sequence is unscheduled, inhibited, or in a task that is inhibited.
Use the Result operand to get a code that shows the success or failure of the
SATT instruction. The Result operand should contain either 0 or a DINT tag,
depending on whether ownership conflicts or other errors are likely to occur.
See also
Attach to Equipment Sequence on page 1019
Result codes for SCLF When a tag is assigned to store the result of an Equipment Sequence Clear
Failure (SCLF) instruction, the instruction returns one of the following codes
instructions when it executes.
Code (Dec) Description
0 The command was successful.
48 The command was not executed because it was not possible at the time to generate an event to record
the command.
• If the command was an ABORT command, the ABORT command is still executed even if the event could
not be generated.
• This code only occurs if event generation has been enabled in the Equipment Sequence Properties -
Configuration tab.
24578 The command is not valid for the current state of the Equipment Sequence. For example, if the
Equipment Sequence is stopped, then a stop command is not valid.
24594 The Equipment Sequence is unscheduled, inhibited, or in a task that is inhibited.
Use the Result operand to get a code that shows the success or failure of the
SCLF instruction. The Result operand should contain either 0 or a DINT tag,
depending on whether ownership conflicts or other errors are likely to occur.
See also
Equipment Sequence Clear Failure on page 1025
Result codes for SCMD When a tag is assigned to store the result of an Equipment Sequence
command (SCMD) instruction, the instruction returns one of the following
instructions codes when it runs.
Code (Dec) Description
0 The command was successful.
48 The command was not executed because it was not possible at the time to generate an event to record
the command.
• If the command was an ABORT command, the ABORT command is still executed even if the event could
not be generated.
• This code only occurs if event generation has been enabled in the Equipment Sequence Properties -
Configuration tab.
24577 The command is not valid.
24578 The command is not valid for the current state of the Equipment Sequence. For example, if the
Equipment Sequence is in the running state, then a start command is not valid.
24579 The Equipment Sequence cannot be commanded for the following reason:
• The program successfully attached to the Equipment Sequence, but it cannot command the sequence
because Logix Designer, a higher priority application, has overridden ownership.
24582 Attachment to the Equipment Sequence failed because the sequence was previously attached to one of
the following users:
• An external sequencer, such as FactoryTalk Batch software, has ownership.
• Another program in the controller (an internal sequencer) has ownership.
• An operator using the Sequence Manager ActiveX Controls has ownership.
24580 The caller of the instruction is attached, but is not the current owner of the Equipment Sequence. A
higher priority owner, such as Logix Designer, is commanding the Equipment Sequence.
24594 The Equipment Sequence is unscheduled, inhibited, or in a task that is inhibited.
24604 An equal or higher priority command is being processed.
24631 Too many sequence parameter or step tags are defined per step, so events cannot be handled and the
START command failed.
Use the Result operand to get a code that shows the success or failure of the
SCMD instruction. The Result operand should contain either 0 or a DINT tag,
depending on whether ownership conflicts or other errors are likely to occur.
See also
Equipment Sequence command on page 1027
Result codes for SOVR When a tag is assigned to store the result of an Equipment Sequence Override
(SOVR) instruction, the instruction returns one of the following codes when it
instructions executes.
Code (Dec) Description
0 The command was successful.
48 The command was not executed because it was not possible at the time to generate an event to record
the command.
• If the command was an ABORT command, the ABORT command is still executed even if the event could
not be generated.
• This code only occurs if event generation has been enabled in the Equipment Sequence Properties -
Configuration tab.
24577 The command is not valid.
24578 The command is not valid for the current state of the Equipment Sequence. For example, if the
Equipment Sequence is stopped, then a stop command is not valid.
24594 The Equipment Sequence is unscheduled, inhibited, or in a task that is inhibited.
Use the Result operand to get a code that shows the success or failure of the
SOVR instruction. The Result operand should contain either 0 or a DINT tag,
depending on whether ownership conflicts or other errors are likely to occur.
See also
Equipment Sequence Override command on page 1031
SASI instruction examples The following example shows the SASI instruction as it appears in a ladder
diagram and in structured text.
Tip: The Sequence ID parameter can be a STRING tag in which the identifier is stored, or a quoted
string containing up to 82 characters.
See also
Equipment Sequence Assign Sequence Identifier on page 1023
SATT instruction examples The following examples show the SATT instruction as it appears in a Ladder
Diagram and in Structured Text.
Ladder Diagram
Structured Text
if (AttachControl) then
See also
Attach to Equipment Sequence on page 1019
SCLF instruction examples The following examples show the SCLF instruction as it appears in a ladder
diagram and in structured text.
end_if;
See also
Equipment Sequence Clear Failure on page 1025
SCMD instruction examples The following examples show the Equipment Sequence command (SCMD)
instruction as it appears in a Ladder Diagram and in Structured Text.
Ladder Diagram
Structured Text
if (HoldControl) then
end_if;
See also
Equipment Sequence command on page 1027
SDET instruction examples The following examples show the SDET instruction as it appears in a ladder
diagram and in structured text.
Ladder Diagram
Structured Text
if (DetachControl) then
SDET (Make_Product_101);
end_if;
See also
Detach from Equipment Sequence on page 1021
Attach to Equipment Sequence on page 1019
Equipment Sequence instructions on page 1019
SOVR instruction examples The following examples show the SOVR instruction as it appears in a Ladder
Diagram and in Structured Text.
Ladder Diagram
Structured Text
if (StopControl) then
SOVR (Make_Product_101, Stop, Results);
See also
Equipment Sequence command on page 1027
Guidelines for SCMD instructions on page 1034
When should I use an SOVR Under most circumstances, use the SCMD instruction to programmatically
command an Equipment Sequence. However, use the SOVR instruction to
instruction instead of an command an Equipment Sequence under the following conditions:
SCMD instruction? • When you are giving the HOLD, STOP, or ABORT command, and the
command must always execute under all ownership circumstances.
• If the HOLD, STOP, or ABORT command must execute even when you
have manual control of the Equipment Sequence through the Logix
Designer application or when another program, such as the
FactoryTalk Batch software, owns the Equipment Sequence.
For example, suppose your equipment checks for jammed material. If there is
a jam, you always want the equipment to abort. In that case, use the SOVR
instruction. This way, the equipment aborts even if you have manual control
through the Logix Designer application.
See also
Equipment Sequence command on page 1027
Click a topic below for more information on issues that are unique to function
block programming. Review this information to make sure you understand
how your function block routines will operate.
See also
Choose the Function Block Elements on page 1043
Use the following table to help you choose your function block elements:
If you want to supply a value from an input device or tag Then use a input reference (IREF)
Send a value to an output device or tag Output reference (OREF)
The function block moves the input references into the block structure. If
necessary, the function block converts those input references to REAL values.
The function block executes and moves the results into the output references.
Again, if necessary, the function block converts those result values from REAL
to the data types for the output references.
Latching Data
If you use an IREF to specify input data for a function block instruction, the
data in that IREF is latched for the scan of the function block routine. The
IREF latches data from program-scoped and controller-scoped tags. The
controller updates all IREF data at the beginning of each scan.
In this example, the value of tagA is stored at the beginning of the routine’s
execution. The stored value is used when Block_01 executes. The same stored
value is also used when Blcock_02 executes. If the value of tagA changes
during execution of the routine, the stored value of tagA in the IREF does not
change until the next execution of the routine.
This example is the same as the one above. The value of tagA is stored only
once at the beginning of the routine’s execution. The routine uses this stored
value throughout the routine.
You can use the same tag in multiple IREFs and an OREF in the same routine.
Because the values of tags in IREFs are latched every scan through the routine,
all IREFs will use the same value, even if an OREF obtains a different tag value
during execution of the routine.
In this example, if tagA has a value of 25.4 when the routine starts executing
this scan, and Block_01 changes the value of tagA to 50.9, the second IREF
wired into Block_02 will still use a value of 25.4 when Block_02 executes this
scan. The new tagA value of 50.9 will not be used by any IREFs in this routine
until the start of the next scan.
Order of Execution
The Logix Designer programming application automatically determines the
order of execution for the function blocks in a routine when you:
If function blocks are not wired together, it does not matter which block
executes first. There is no data flow between the blocks
If you wire the blocks sequentially, the execution order moves from input to
output. The inputs of a block require data to be available before the controller
can execute that block. For example, block 2 has to execute before block 3
because the outputs of block 2 feed the inputs of block 3.
Execution order is only relative to the blocks that are wired together. The
following example is fine because the two groups of blocks are not wired
together. The blocks within a specific group execute in the appropriate order
in relation to the blocks in that group.
Resolve a Loop
To create a feedback loop around a block, wire an output pin of the block to an
input pin of the same block. The following example is OK. The loop contains
only a single block, so execution order does not matter.
If a group of blocks are in a loop, the controller cannot determine which block
to execute first. In other words, it cannot resolve the loop.
To identify which block to execute first, mark the input wire that creates the
loop (the feedback wire) with the Assume Data Available indicator. In the
following example, block 1 uses the output from block 3 that was produced in
the previous execution of the routine.
The Assume Data Available indicator defines the data flow within the loop. The
arrow indicates that the data serves as input to the first block in the loop.
Do not mark all the wires of a loop with the Assume Data Available indicator.
Summary
In summary, a function block routine executes in this order:
Timing Modes
These process control and drives instructions support different timing modes.
• DEDT • LDLG • RLIM
• DERV • LPF • SCRV
• HPF • NTCH • SOC
• INTG • PI • TOT
• LDL2 • PIDE
Time-based instructions require a constant value for DeltaT in order for the
control algorithm to properly calculate the process output. If DeltaT varies, a
discontinuity occurs in the process output. The severity of the discontinuity
depends on the instruction and range over which DeltaT varies.
Input Parameters
Input Parameter Data Type Description
TimingMode DINT Selects timing execution mode.
Value: Description:
0 Periodic mode
1 Oversample mode
2 Real time sampling mode
Valid = 0 to 2
Default = 0
When TimingMode = 0 and task is periodic, periodic timing is enabled and DeltaT is
set to the task scan rate. When TimingMode = 0 and task is event or continuous,
periodic timing is enabled and DeltaT is set equal to the elapsed time span since the
last time the instruction was executed.
When TimingMode = 1, oversample timing is enabled and DeltaT is set to the value of
the OversampleDT parameter. When TimingMode = 2, real time sampling timing is
enabled and DeltaT is the difference between the current and previous time stamp
values read from the module associated with the input.
If TimingMode invalid, the instruction sets the appropriate bit in Status.
OversampleDT REAL Execution time for oversample timing. The value used for DeltaT is in seconds. If
TimingMode = 1, then OversampleDT = 0.0 disables the execution of the control
algorithm. If invalid, the instruction sets DeltaT = 0.0 and sets the appropriate bit in
Status.
Valid = 0 to 4194.303 seconds
Default = 0.0
RTSTime DINT Module update period for real time sampling timing. The expected DeltaT update
period is in milliseconds. The update period is normally the value that was used to
configure the module’s update time. If invalid, the instruction sets the appropriate bit
in Status and disables RTSMissed checking.
Valid = 1…32,767ms
Default = 1
RTSTimeStamp DINT Module time stamp value for real time sampling timing. The time stamp value that
corresponds to the last update of the input signal. This value is used to calculate
DeltaT. If invalid, the instruction sets the appropriate bit in Status, disables execution
of the control algorithm, and disables RTSMissed checking.
Valid =0…32,767ms (wraps from 32767 to 0)
1 count = 1 millisecond
Default = 0
Output Parameters
Output Parameter Data Type Description
DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate
the process output.
Periodic: DeltaT = task scan rate if task is Periodic task, DeltaT = elapsed time since previous instruction
execution if task is Event or Continuous task
Oversample: DeltaT = OversampleDT
Real Time Sampling: DeltaT = (RTSTimeStampn - RTSTimeStampn-1)
Status DINT Status of the function block.
TimingModeInv (Status.27) BOOL Invalid TimingMode value.
RTSMissed (Status.28) BOOL Only used in real time sampling mode. Set when ABS | DeltaT - RTSTime | > 1 (.001 second).
RTSTimeInv (Status.29) BOOL Invalid RTSTime value.
RTSTimeStampInv BOOL Invalid RTSTimeStamp value.
(Status.30)
DeltaTInv (Status.31) BOOL Invalid DeltaT value.
Program/Operator Control
The following instructions support the concept of Program/Operator control.
Operator control takes precedence over Program control if both input request
bits are set. For example, if ProgProgReq and ProgOperReq are both set, the
instruction goes to Operator control.
The Program request inputs take precedence over the Operator request
inputs. This provides the capability to use the ProgProgReq and ProgOperReq
inputs to ‘lock’ an instruction in a desired control.
For example, let’s assume that a Totalizer instruction will always be used in
Operator control, and your user program will never control the running or
stopping of the Totalizer. In this case, you could wire a literal value of 1 into
the ProgOperReq. This would prevent the operator from ever putting the
Totalizer into Program control by setting the OperProgReq from an operator
interface device.
Likewise, constantly setting the ProgProgReq can ‘lock’ the instruction into
Program control. This is useful for automatic startup sequences when you
In this example, you have the program set the ProgProgReq input during the
startup, and then clear the ProgProgReq input once the startup was complete.
Once the ProgProgReq input is cleared, the instruction remains in Program
control until it receives a request to change. For example, the operator could
set the OperOperReq input from a faceplate to take over control of that
instruction.
Program request inputs are not normally cleared by the instruction because
these are normally wired as inputs into the instruction. If the instruction
clears these inputs, the input would just get set again by the wired input.
These are the issues that are unique with structured text programming.
Review the following topics to make sure you understand how your structured
text programming executes.
Structured Text Syntax Structured text is a textual programming language that uses statements to
define what to execute.
See also
Structured Text Components: Assignments on page 1059
Structured Text To make your structured text easier to interpret, add comments to it.
Components: Comments • Comments let you use plain language to describe how your structured
text works.
• Comments do not affect the execution of the structured text.
that spans more than one line (*start of comment. . .end of comment*)
/*start of comment. . .end of comment*/
For example:
Format Example
//comment At the beginning of a line
//Check conveyor belt direction
IF conveyor_direction THEN...
At the end of a line
ELSE //If conveyor isn’t moving, set alarm light
light := 1;
END_IF;
Structured Text Use an assignment to change the value stored within a tag. An assignment
has this syntax:
Components: Assignments
tag := expression;
where:
Component Description
Tag Represents the tag that is getting the new value; the tag must be a BOOL, SINT, INT,
DINT, STRING, or REAL.
Tip: The STRING tag is applicable to CompactLogix 5380, CompactLogix 5480,
ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
:= Is the assignment symbol
Expression Represents the new value to assign to the tag
If tag is this data type Use this type of expression
BOOL BOOL
SINT Numeric
INT
DINT
REAL
STRING String type, including string tag and string
(CompactLogix 5380, CompactLogix literal
5480, ControlLogix 5580, Compact (CompactLogix 5380, CompactLogix 5480,
GuardLogix 5380, and GuardLogix ControlLogix 5580, Compact GuardLogix 5380,
5580 controllers only). and GuardLogix 5580 controllers only).
; Ends the assignment
See also
Assign an ASCII character to a string data member on page 1061
Specify a non-retentive The non-retentive assignment is different from the regular assignment
described above in that the tag in a non-retentive assignment is reset to zero
assignment each time the controller:
where:
Component Description
tag Represents the tag that is getting the new value; the tag must be a BOOL,
SINT, INT, DINT, STRING, or REAL.
Tip: The STRING tag is applicable toCompactLogix 5380, CompactLogix 5480,
ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580
controllers only.
[:=] Is the non-retentive assignment symbol.
expression Represents the new value to assign to the tag.
If tag is this data type Use this type of expression
BOOL BOOL
SINT Numeric
See also
Assign an ASCII character to a string data member on page 1061
Structured Text Components: Assignments on page 1059
To add or insert a string of characters to a string tag, use either of these ASCII
string instructions:
To Use this instruction
Add characters to the end of a string CONCAT
Insert characters into a string INSERT
See also
Structured Text Components: Expressions on page 1061
See also
Use arithmetic operators and functions on page 1063
Use arithmetic operators Combine multiple operators and functions in arithmetic expressions.
The table provides examples for using arithmetic operators and functions.
Use this format Example
For this situation Write
value1 operator value2 If gain_4 and gain_4_adj are DINT tags and your specification says: gain_4_adj := gain_4+15;
‘Add 15 to gain_4 and store the result in gain_4_adj’"
operator value1 If alarm and high_alarm are DINT tags and your specification says: alarm:= -high_alarm;
‘Negate high_alarm and store the result in alarm.’
function(numeric_expression) If overtravel and overtravel_POS are DINT tags and your overtravel_POS := ABS(overtravel);
specification says: ‘Calculate the absolute value of overtravel and
store the result in overtravel_POS.’
value1 operator (function((value2+value3)/2) If adjustment and position are DINT tags and sensor1 and sensor2 position := adjustment + ABS((sensor1
are REAL tags and your specification says: ‘Find the absolute value +
of the average of sensor1 and sensor2, add the adjustment, and sensor2)/2);
store the result in position.’
See also
Structured Text Components: Expressions on page 1061
Use bitwise operators Bitwise operators manipulate the bits within a value based on two values.
This is an example.
Use this format Example
For this situation Use
value1 operator value2 If input1, input2, and result1 are DINT tags and your specification result1 := input1 AND input2;
says: "Calculate the bitwise result of input1 and input2. Store the
result in result1."
See also
Structured Text Components: Expressions on page 1061
Use logical operators Use logical operators to verify if multiple conditions are true or false. The
result of a logical operation is a BOOL value.
If the comparison is The result is
true 1
false 0
expression1 XOR expression2 If photoeye1 and photoeye2 are BOOL tags and your specification IF photoeye1 XOR photoeye2
says: "If: THEN...
photoeye1 is on while photoeye2 is off or
photoeye1 is off while photoeye2 is on
then..."
BOOLtag := expression1 & If photoeye1 and photoeye2 are BOOL tags, open is a BOOL tag, and open := photoeye1 & photoeye2;
expression2 your specification says: "If photoeye1 and photoeye2 are both on, set
open to true"
See also
Structured Text Components: Expressions on page 1061
Use relational operators Relational operators compare two values or strings to provide a true or false
result. The result of a relational operation is a BOOL value.
If the comparison is The result is
True 1
False 0
• When the two strings are sorted as in a telephone directory, the order
of the strings determines which one is greater.
See also
Structured Text Components: Expressions on page 1061
Structured Text Structured text statements can also be instructions. A structured text
instruction executes each time it is scanned. A structured text instruction
Components: Instructions within a construct executes every time the conditions of the construct are
true. If the conditions of the construct are false, the statements within the
construct are not scanned. There is no rung-condition or state transition that
triggers execution.
This differs from function block instructions that use EnableIn to trigger
execution. Structured text instructions execute as if EnableIn is always set.
This also differs from ladder diagram instructions that use rung-condition-in
to trigger execution. Some ladder diagram instructions only execute when
rung- condition-in toggles from false to true. These are transitional ladder
diagram instructions. In structured text, instructions execute when they are
scanned unless pre-conditioning the execution of the structured text
instruction.
END_IF;
The ABL instruction will execute every scan that tag_xic is set, not just when
tag_xic transitions from cleared to set.
If you want the ABL instruction to execute only when tag_xic transitions from
cleared to set, you have to condition the structured text instruction. Use a one-
shot to trigger execution.
osri_1.InputBit := tag_xic;
OSRI(osri_1);
IF (osri_1.OutputBit) THEN
ABL(0,serial_control);
END_IF;
Components: Constructs If
Doing something if or when specific conditions occur
Use this construct
IF. . . THEN
Selecting what to do based on a numerical value CASE. . . OF
Doing something a specific number of times before doing anything else FOR. . . DO
Continuing doing something when certain conditions are true WHILE. . . DO
Continuing doing something until a condition is true REPEAT. . . UNTIL
• GOTO
• REPEAT
Logix Designer application will not let you use them as tag names or
constructs.
See also
IF_THEN on page 1074
Character string literals Character string literals include single byte or double byte encoded
characters. A single-byte string literal is a sequence of zero or more characters
that are prefixed and terminated by the single quote character ('). In single
byte character strings, the three-character combination of the dollar sign ($)
followed by two hexadecimal digits is interpreted as the hexadecimal
representation of the eight-bit character code as shown in the following table.
Tips: • Character string literals are only applicable to the CompactLogix 5380,
CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and
GuardLogix 5580 controllers.
• Studio 5000 only supports single byte characters.
See also
Structured Text Components: Assignments on page 1059
String Types Store ASCII characters in tags that use a string type data type to:
See also
Character string literals on page 1068
Operands
CASE numeric_expression OF
selector1: statement;
Structured Text
Operand Type Format Enter
Numeric_ SINT INT DINT Tag expression Tag or expression that evaluates to a
expression REAL number
(numeric expression)
Selector SINT INT DINT Immediate Same type as numeric_expression
REAL
IMPORTANT If using REAL values, use a range of values for a selector because a REAL value is
more likely to be within a range of values than an exact match of one, specific value.
Description
The syntax is described in the table.
Major/Minor Faults
None
Example
If you want this Enter this structured text
If recipe number = 1 then Ingredient A outlet 1 = open (1) Ingredient B CASE recipe_number OF
outlet 4 = open (1) 1:
Ingredient_A.Outlet_1 :=1; Ingredient_B.Outlet_4 :=1;
If recipe number = 2 or 3 then 2,3:
Ingredient_A.Outlet_4 :=1; Ingredient_B.Outlet_2 :=1;
Ingredient A outlet 4 = open (1)
Ingredient B outlet 2 = open (1)
If recipe number = 4, 5, 6, or 7 then Ingredient A outlet 4 = open (1) 4 to 7: Ingredient_A.Outlet_4 :=1; Ingredient_B.Outlet_2 :=1;
Ingredient B outlet 2 = open (1)
If recipe number = 8, 11, 12, or 13 then Ingredient A outlet 1 = open (1) 8,11…13
Ingredient B outlet 4 = open (1) Ingredient_A.Outlet_1 :=1; Ingredient_B.Outlet_4 :=1;
Otherwise all outlets = closed (0) ELSE
Ingredient_A.Outlet_1 [:=]0; Ingredient_A.Outlet_4 [:=]0; Ingredient_B.Outlet_2 [:=]0;
Ingredient_B.Outlet_4 [:=]0;
END_CASE;
The [:=] tells the controller to also clear the outlet tags whenever the controller
does the following:
FOR_DO Use the FOR_DO loop to perform an action a number of times before doing
anything else.
When enabled, the FOR instruction repeatedly executes the Routine until the
Index value exceeds the Terminal value. The step value can be positive or
negative. If it is negative, the loop ends when the index is less than the
terminal value.. If it is positive, the loop ends when the index is greater than
the terminal value.
Each time the FOR instruction executes the routine, it adds the Step size to
the Index.
Do not loop too many times in a single scan. An excessive number of
repetitions causes the controller watchdog to timeout and causes a major
fault.
Operands
FOR count:= initial_value TO
final_value BY increment DO
<statement>;
END_FOR;
Operand Type Format Description
count SINT INT DINT Tag Tag to store count position as the FOR_DO
executes
initial_ value SINT INT DINT Tag expression Must evaluate to a number
Immediate Specifies initial value for count
final_ value SINT INT DINT Tag expression Specifies final value for count, which
Immediate determines when to exit the loop
increment SINT INT DINT Tag expression (Optional) amount to increment count each time
Immediate through the loop
If you don’t specify an increment, the count
increments by 1.
IMPORTANT Do not iterate within the loop too many times in a single scan.
The controller does not execute other statements in the routine until it completes the
loop.
A major fault occurs when completing the loop takes longer than the watchdog timer
for the task.
Consider using a different construct, such as IF_THEN.
Description
The syntax is described in the table.
This diagrams illustrates how a FOR_DO loop executes, and how an EXIT
statement leaves the loop early.
The FOR_DO loop executes a specific number of times. To stop the loop before the count reaches the last value, use
an EXIT statement.
Major/Minor Faults
A major fault will occur if Fault type Fault code
The construct loops too long. 6 1
Example 1
If performing the following, Enter this structured text
Clear bits 0…31 in an array of BOOLs: For subscript:=0 to 31 by 1 do
Initialize the subscript tag to 0. array[subscript] := 0;
Clear i . For example, when subscript = 5, clear array[5]. End_for;
Add 1 to subscript.
If subscript is ≤ to 31, repeat 2 and 3.
Otherwise, stop.
Example 2
If performing the following, Enter this structured text
A user-defined data type (structure) stores the following information SIZE(Inventory,0,Inventory_Items);
about an item in your inventory: For position:=0 to Inventory_Items - 1 do
• Barcode ID of the item (String data type) If Barcode = Inventory[position].ID then
• Quantity in stock of the item (DINT data type)
Quantity := Inventory[position].Qty;
Exit;
End_if;
An array of the above structure contains an element for each different End_for;
item in your inventory. You want to search the array for a specific
product (use its bar code) and determine the quantity that is in stock.
1. Get the size (number of items) of the Inventory array and store the
result in
2. Inventory_Items (DINT tag).
Initialize the position tag to 0.
3. If Barcode matches the ID of an item in the array, then:
Set the Quantity tag = Inventory[position].Qty. This produces the quantity
in stock of the item.
Stop.
Barcode is a string tag that stores the bar code of the item for which you
are searching. For example, when
position = 5, compare Barcode to Inventory[5].ID.
4. Add 1 to position.
5. If position is ≤ to (Inventory_Items -1), repeat 3 and 4. Since element
numbers start at 0, the last element is 1 less than the number of
elements in the array.
Otherwise, stop.
Operands
IF bool_expression THEN
<statement>;
Operand Type Format Enter
Bool_ BOOL Tag expression BOOL tag or expression that evaluates to a BOOL
expression value
(BOOL expression)
Description
The syntax is described in the table.
To select from several possible groups of statements, add one or more ELSIF
statements.
Each ELSIF represents an alternative path.
Specify as many ELSIF paths as you need.
The controller executes the first true IF or ELSIF and skips the rest of the
ELSIFs and the ELSE.
To do something when all of the IF or ELSIF conditions are false, add an ELSE
statement.
The table summarizes different combinations of IF, THEN, ELSIF, and ELSE.
If And Use this construct
Doing something if or when conditions are Do nothing if conditions are false IF_THEN
true Do something else if conditions are false IF_THEN_ELSE
Selecting alternative statements or groups of Do nothing if conditions are false IF_THEN_ELSIF
statements based on input conditions Assign default statements if all conditions are IF_THEN_ELSIF_ELSE
false
Major/Minor Faults
None.
Examples
Example 1
IF…THEN
If performing this Enter this structured text
IF rejects > 3 then IF rejects > 3 THEN
Example 2
IF_THEN_ELSE
If performiing this Enter this structured text
If conveyor direction contact = forward (1) then IF conveyor_direction THEN
light = off light := 0;
Otherwise light = on ELSE
light [:=] 1;
END_IF;
The [:=] tells the controller to clear light whenever the controller does the
following :
Example 3
IF…THEN…ELSIF
If performing this Enter this structured text
If sugar low limit switch = low (on) and sugar high limit switch = not IF Sugar.Low & Sugar.High THEN
high
(on) then
inlet valve = open (on) Sugar.Inlet [:=] 1;
Until sugar high limit switch = high (off ) ELSIF NOT(Sugar.High) THEN
Sugar.Inlet := 0;
END_IF;
The [:=] tells the controller to clear Sugar.Inlet whenever the controller does
the following :
Example 4
IF…THEN…ELSIF…ELSE
If performing this Enter this structured text
If tank temperature > 100 IF tank.temp > 200 THEN
then pump = slow pump.fast :=1; pump.slow :=0; pump.off :=0;
If tank temperature > 200 ELSIF tank.temp > 100 THEN
then pump = fast pump.fast :=0; pump.slow :=1; pump.off :=0;
Otherwise pump = off ELSE
pump.fast :=0; pump.slow :=0; pump.off :=1;
END_IF;
Operands
REPEAT
<statement>;
Structured Text
Operand Type Format Enter
bool_ BOOL Tag expression BOOL tag or expression that evaluates to a BOOL
expression value
(BOOL expression)
IMPORTANT Do not iterate within the loop too many times in a single scan.
The controller does not execute other statements in the routine until it completes the
loop.
A major fault occurs when completing the loop takes longer than the watchdog timer
for the task.
Consider using a different construct, such as IF_THEN.
Description
The syntax is:
The following diagrams show how a REPEAT_UNTIL loop executes and how
an EXIT statement leaves the loop early.
While the bool_expression is false, the controller executes only the statements
within the REPEAT_UNTIL loop.
To stop the loop before the conditions are false, use an EXIT statement.
Fault Conditions
A major fault will occur if Fault type Fault code
Example 1
If performing the following, Enter this structured text
The REPEAT_UNTIL loop executes the statements in the construct and pos := -1;
then determines if the conditions are true before executing the REPEAT
statements again. This differs from the WHILE_DO loop because the pos := pos + 2;
WHILE_DO The WHILE_DO loop evaluates its conditions first.
UNTIL ((pos = 101) OR (structarray[pos].value = targetvalue))
If the conditions are true, the controller then executes the statements
end_repeat;
within the loop. The statements in a REPEAT_UNTIL loop are always
executed at least once. The statements in a WHILE_DO loop might never
be executed.
Example 2
If performing the following, Enter this structured text
Move ASCII characters from a SINT array into a string tag. (In a SINT array, element_number := 0;
each element holds one character.) Stop when you reach the carriage SIZE(SINT_array, 0, SINT_array_size);
return. Repeat
Initialize Element_number to 0. String_tag.DATA[element_number] := SINT_array[element_number];
Count the number of elements in SINT_array (array that contains the ASCII
element_number := element_number + 1;
characters) and store the result in SINT_array_size (DINT tag).
String_tag.LEN := element_number;
Set String_tag[element_number] = the character at
If element_number = SINT_array_size then
SINT_array[element_number].
Add 1 to element_number. This lets the controller check the next exit;
character in end_if;
SINT_array. Until SINT_array[element_number] = 13
Set the Length member of String_tag = element_number. (This records end_repeat;
the number of characters in String_tag so far.)
If element_number = SINT_array_size, then stop. (You are at the end of
the array and it does not contain a carriage return.)
If the character at SINT_array[element_number] = 13 (decimal value of
the carriage return), then stop.
WHILE_DO Use the WHILE_DO loop to continue performing an action while certain
conditions are true.
Operands
WHILE bool_expression DO
<statement>;
Structured Text
Operand Type Format Description
bool_expression BOOL tag BOOL tag or expression that
expression evaluates to a BOOL value
IMPORTANT Do not iterate within the loop too many times in a single scan.
The controller does not execute any other statements in the routine until it completes
the loop.
A major fault occurs when completing the loop takes longer than the watchdog timer
for the task.
Consider using a different construct, such as IF_THEN.
Description
The syntax is:
The following diagrams illustrate how a WHILE_DO loop executes, and how
an EXIT statement leaves the loop early.
While the bool_expression is true, the controller To stop the loop before the conditions are true, use an EXIT statement.
executes only the statements within the WHILE_DO loop.
Fault Conditions
A major fault will occur if Fault type Fault code
the construct loops too long 6 1
Example 1
If performing the following, Enter this structured text
The WHILE_DO loop evaluates its conditions first. If the conditions are pos := 0;
true, the controller then executes the statements within the loop. While ((pos <= 100) & structarray[pos].value <> targetvalue)) do
This differs from the REPEAT_UNTIL loop because the REPEAT_UNTIL loop pos := pos + 2;
executes the statements in the construct and then determines if the
String_tag.DATA[pos] := SINT_array[pos];
conditions are true before executing the statements again. The
end_while;
statements in a REPEAT_UNTIL loop are always executed at least once.
The statements in a WHILE_DO loop might never be executed.
Example 2
If performing the following, Enter this structured text
Move ASCII characters from a SINT array into a string tag. (In a SINT array, element_number := 0;
each element holds one character.) Stop when you reach the carriage SIZE(SINT_array, 0, SINT_array_size);
return. While SINT_array[element_number] <> 13 do
Initialize Element_number to 0. String_tag.DATA[element_number] := SINT_array[element_number];
Count the number of elements in SINT_array (array that contains the ASCII
element_number := element_number + 1;
characters) and store the result in SINT_array_size (DINT tag).
String_tag.LEN := element_number;
If the character at SINT_array[element_number] = 13 (decimal value of
the carriage return), then stop. If element_number = SINT_array_size then
exit;
end_if;
See also
Structured Text Components: Assignments on page 1059
Follow the guidelines in this chapter for the common attributes for the
Advanced Process Control and Drives Instructions.
Common Attributes For more information on attributes that are common to the Logix 5000™
instructions, click any of the topics below.
Math Status Flags on page 1083
Immediate Values on page 1085
Math Status Flags Follow the guidelines in this topic for Math Status Flags.
Description
Controllers Description
CompactLogix 5380, A set of Math Status Flags for accessing directly with instructions. These flags are only updated in
CompactLogix 5480, ladder diagram routines, and are not tags, and flag aliases are not applicable.
ControlLogix 5580,
Compact GuardLogix
5380, and GuardLogix
5580 controllers
CompactLogix 5370, A set of Math Status Flags for accessing directly with instructions. These flags are updated in all routine
ControlLogix 5570, types, but are not tags, and flag aliases are not applicable.
Compact GuardLogix
5370, and GuardLogix
5570 controllers
Status Flags
Status Flag Description Description
(For CompactLogix 5380, CompactLogix 5480, (For CompactLogix 5370, ControlLogix 5570, Compact
ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5370, and GuardLogix 5570 controllers)
GuardLogix 5580 controllers)
S:FS The first scan flag is set by the controller: The first scan flag is set by the controller:
First scan flag • The first time a program is scanned after the controller • The first time a program is scanned after the controller goes to
goes to Run mode Run mode
• The first time a program is scanned after the program is • The first time a program is scanned after the program is
uninhibited uninhibited
• When a routine is called from an SFC Action and the step • When a routine is called from an SFC Action and the Step that
that owns that Action is first scanned. owns that Action is first scanned.
Use the first scan flag to initialize data for use in later scans. Use this flag to initialize data for use in later scans. It is also
It is also referred to as the first pass bit. referred to as the first pass bit.
S:N The controller sets the negative flag when the result of a math The controller sets the negative flag when the result of a math or
Negative flag or logical operation is a negative value. Use this flag as a logical operation is a negative value. Use this flag as a quick test for
quick test for a negative value. a negative value.
Using S:N is more efficient than using the CMP instruction.
S:Z The zero flag is set by the controller when the result of a math The controller sets the zero flag when the result of a math or logical
Zero flag or logical operation is zero. Use this flag as a quick test for a operation is zero. Use this flag as a quick test for a zero value.
zero value.
The zero flag clears at the start of executing an instruction
capable of setting this flag.
S:V The controller sets the overflow flag when: The controller sets the overflow flag when:
Overflow flag • The result of a math operation results in an overflow. • The result of a math operation results in an overflow.
For example, adding 1 to a SINT generates an overflow when For example, adding 1 to a SINT generates an overflow when the
the value goes from 127 through -128. value goes from 127…-128.
• The destination tag is too small to hold the value. • The destination tag is too small to hold the value.
For example, if you try to store the value 123456 to a SINT or For example, if you try to store the value 123456 to a SINT or INT
INT tag. tag.
Use the overflow flag to verify the result of an operation is still
in range. Use the overflow flag to check that the result of an operation is still
If the data being stored is a string type, S:V is set if the string in range.
is too large to fit into the destination tag. A minor fault is generated anytime an overflow flag is set.
Tip: If applicable, set S:V with an OTE or OTL instruction. Tip: If applicable,set S:V with an OTE or OTL instruction.
Click Controller Properties > Advanced tab > Report
Overflow Faults to enable or disable reporting overflow
faults.
If an overflow occurs while evaluating an array subscript, a
minor fault is generated and a major fault is generated to
indicate the index is out of range.
S:C The controller sets the carry flag when the result of a math The controller sets the carry flag when the result of a math
Carry flag operation resulted in the generation of a carry out of the most operation resulted in the generation of a carry out of the most
significant bit. significant bit.
Only the ADD and SUB instructions, and not the + and –
operators, with integer values affect this flag.
CompactLogix Expressions do not set status flags based on the results of math operations. If expressions overflow:
5380, • A minor fault generates if the controller is configured to generate minor faults.
CompactLogix • A major fault (type 4, code 20) generates because the resulting value is out of range.
5480, ControlLogix
5580, Compact
GuardLogix 5380,
and GuardLogix
5580 controllers
CompactLogix Expressions set status flags based on the results of math operations. If an array subscript is an expression, the expression and the
5370, ControlLogix instruction could generate minor faults.
5570, Compact
GuardLogix 5370,
and GuardLogix
5570 controllers
Tip: If an array subscript is too large (out of range), a major fault (type 4, code 20) generates.
Immediate values When you enter an immediate value (constant) in decimal format (for
example, -2, 3) the controller stores the value by using 32 bits. If you enter a
value in a radix other than decimal, such as binary or hexadecimal, and do not
specify all 32 bits, the controller places a zero in the bits that you do not specify
(zero-fill).
IMPORTANT Zero-fill of immediate binary, octal or hexadecimal values less than 32 bits.
Data Conversions Data conversions occur when mixing data types in programming.
When programming: Conversions can occur when you:
Ladder Diagram Mix data types for the parameters within one
Structured Text Instruction or expression.
Function Block Wire two parameters that have different data types
Instructions execute faster and require less memory if all the operands of the
instruction use:
Sign-extension The value of the leftmost bit (the sign of the value) into each bit position to the left of the existing bits
until there are 32 or 64 bits.
Zero-fill Zeroes to the left of the existing bits until there are 32 or 64 bits.
Logical instructions use zero fill. All other instructions use sign-extension
The following example shows the results of converting a value using sign-
extension and zero-fill.
This value 2#1111_1111_1111_1111 (-1)
Converts to this value 2#1111_1111_1111_1111_1111_1111_1111_1111 (-1)
by sign-extension
Converts to this value 2#0000_0000_0000_0000_1111_1111_1111_1111 (65535)
by zero-fill
If you use a SINT or INT tag and an immediate value in an instruction that
converts data by sign-extension, use one of these methods to handle
immediate values.
Create a tag for each operand and use the same data type throughout the
instruction. To assign a constant value, either:
The following examples show two ways to mix an immediate value with an
INT tag. Both examples check the bits of a 1771 I/O module to determine if all
the bits are on. Since the input data word of a 1771 I/O module is an INT tag, it
is easiest to use a 16-bit constant value.
IMPORTANT Mixing an INT tag with an immediate value
Since remote_rack_1:I.Data[0] is an INT tag, the value to check it against is also
entered as an INT tag.
Elementary data types The controller supports the elementary data types defined in IEC 1131-3
defined data types. The elementary data types are:
Data type Description Range
BOOL 1-bit boolean 0 = cleared
1 = set
SINT 1-byte integer -128 to 127
INT 2-byte integer -32,768 to 32,767
DINT 4-byte integer -2,147,483,648 to 2,147,483,647
REAL 4-byte floating-point number -3.402823E38 to -1.1754944E-38
(negative values)
and
0
and
1.1754944E-38 to 3.402823E38
(positive values)
LINT 8-byte integer 0 to 32,535,129,599,999,999
Note: The LINT data type has limited
use on CompactLogix 5370, ControlLogix
5570, Compact GuardLogix 5370, and
GuardLogix 5570 controllers. They can
be used only with copy (COP, CPS)
instructions, the CST/WallClock Time
attribute, time synchronization, and
Add-On Instructions.
USINT 1-byte unsigned integer 0 to 255
UINT 2-byte unsigned integer 0 to 65,535
UDINT 4-byte unsigned integer 0 to 4,294,967,295
ULINT 8-byte unsigned integer 0 to 18,446,744,073,709,551,615
See also
Math Status Flags on page 1083
Floating Point Values 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.
Logix controllers handle floating point values according to the IEEE 754
standard for floating-point arithmetic. This standard defines how floating
point numbers are stored and calculated. The IEEE 754 standard for floating
point math was designed to provide speed and the ability to handle very large
numbers in a reasonable amount of storage space.
A REAL tag stores a single-precision, normalized floating-point number.
An LREAL tag stores a double-precision, normalized floating-point number.
Not all decimal values can be exactly represented in this standard format,
which results in a loss of precision. For example, if you subtract 10 from 10.1,
you expect the result to be 0.1. In a Logix controller, the result could very well
be 0.10000038. In this example, the difference between 0.1 and 0.10000038 is
.000038%, or practically zero. For most operations, this small inaccuracy is
insignificant. To put things in perspective, if you were sending a floating
point value to an analog output module, there would be no difference in the
output voltage for a value being sent to the module that differs by .000038%.
Do not use floating point math for money values or for totalizer functions.
Use INT or DINT values, scale the values up, and keep track of the decimal
place (or use one INT or DINT value for dollars, and a second INT or DINT
value for cents).
Totalizer Examples
The precision of the REAL data type affects totalization applications such that
errors occur when adding very small numbers to very large numbers.
For example, add 1 to a number over a period of time. At some point the add
will no longer affect the result because the running sum is much greater than
1, and there are not enough bits to store the entire result. The add stores as
many upper bits as possible and discards the remaining lower bits.
To work around this, do math on small numbers until the results get large.
Then, transfer them to another location for additional large-number math.
For example:
• x is the small incremented variable.
• y is the large incremented variable.
• z is the total current count that can be used anywhere.
• x = x+1;
• if x = 100,000;
• {
• y = y + 100,000;
• x = 0;
• }
• z = y + x;
Or another example:
• x = x + some_tiny_number;
• if (x >= 100)
• {
• z = z + 100;
• x = x - 100; // there might be a tiny remainder
• }
Index Through Arrays To dynamically change the array element that your logic references, use tag or
expression as the subscript to point to the element. This is similar to indirect
addressing in PLC-5 logic. Use these operators in an expression to specify an
array subscript:
Tip:
• Logix Designer allows subscripts that are extended data type tags only, and does not support
subscript expressions that have extended data types.
• All available integer elementary data types can be used as a subscript index. Only use SINT, INT,
and DINT tags with operators to create a subscript expression.
Operator Description
+ add
- subtract/negate
* multiply
/ divide
AND AND
FRD BCD to integer
NOT complement
OR OR
TOD integer to BCD
SQR square root
XOR exclusive OR
For example:
Definitions Example Description
my_list defined as DINT[10] my_list[5] This example references element 5 in the
array. The reference is static because the
subscript value remains constant.
my_list defined as DINT[10] MOV the value 5 into position This example references element 5 in the
position defined as DINT my_list[position] array. The reference is dynamic because the
logic can change the subscript by changing
the value of position.
my_list defined as DINT[10] MOV the value 2 into position This example references element 7 (2+5) in
position defined as DINT MOV the value 5 into offset the array. The reference is dynamic because
offset defined as DINT my_list[position+offset] the logic can change the subscript by
changing the value of position or offset.
Tip: When entering an array subscript, make sure it is within the boundaries of the specified array.
Instructions that view arrays as a collection of elements generate a major fault (type 4, code 20) if
a subscript exceeds its corresponding dimension.
Bit Addressing Bit addressing is used access a particular bit within a larger container. Larger
containers include any integer, structure or BOOL array. For example:
See also
Index Through Arrays on page 1094
See also
Faceplate Control Properties Dialog - General Tab on page 1097
Faceplate Control Properties Dialog - Display Tab on page 1097
Faceplate Control Properties Dialog - Font Tab on page 1098
Faceplate Control Properties Dialog - LocaleTab on page 1100
Faceplate Control Use this tab to define/modify how the control operates.
Communication
Select RSLinx Classic OPC Server or FactoryTalk Linx. If you select RSLinx
Classic OPC Server, you must also specify:
Tag
Enter the name of a specific function block instruction to connect with this
control.
Update Rate
Enter the Update Rate of the control in seconds. You can click the arrows to
increment this value in 0.25 second increments. The default value is 1.00
second.
See also
Faceplate Control Properties Dialog - Display Tab on page 1097
Faceplate Control Properties Dialog - Font Tab on page 1098
Faceplate Control Use this tab to define how the faceplate control will appear on your screen.
Parameters
Background Color
This button indicates the color of the faceplate’s background. Click the button
to change this color. The default color is light gray.
Show Frame
Check or uncheck this box, depending on whether or not you wish to display a
3-dimensional frame around this control. Using this option allows you to
separate the control from other items that may appear on your display. This
option is checked, by default.
OK
Click this button to accept your edits and close the Faceplate Control
Properties dialog.
Cancel
Click this button to cancel your edits and close the Faceplate Control
Properties dialog.
Apply
Click this button to apply your edits and continue editing in the Faceplate
Control Properties dialog.
See also
Faceplate Control Properties Dialog - General Tab on page 1097
Faceplate Control Use this tab to define the fonts that appear on the faceplates. From here, you
can configure a ControlFont to be used in the main part of the faceplate, and a
Properties Dialog - Font Tab MinorFont to be used in scales and other minor portions of the faceplate.
Parameters
Property Name
Choose the font you want to configure from the pull-down menu. Choose
from ControlFont or MinorFont; the default is ControlFont.
Font
Choose the font you wish to use for the control from the list of available fonts.
The default font is Arial.
Style
Choose the style you wish to use for the control from the pull-down menu. The
default style is Regular.
Size
Enter the point size you wish to use for this font. The default size of the
ControlFont is 10.5 points; the default size of the MinorFont is 8.25 points.
Strikeout
Check this box if you want to use the strikeout effect, which draws a line
through the font. This option is unchecked, by default.
Underline
Check this box if you want to use the underline effect, which draws a line
below the font. This option is unchecked, by default.
OK
Click this button to accept your edits and close the Faceplate Control
Properties dialog.
Cancel
Click this button to cancel your edits and close the Faceplate Control
Properties dialog.
Apply
Click this button to apply your edits and continue editing in the Faceplate
Control Properties dialog.
See also
Faceplate Control Properties Dialog - General Tab on page 1097
Faceplate Control Use this tab to define the language requirements for the faceplates.
Properties Dialog -
LocaleTab Parameters
Locale
Choose the language you want to use from the pull-down menu. Choose from:
• English
• Portuguese
• French
• Italian
• German
• Spanish
OK
Click this button to accept your edits and close the Faceplate Control
Properties dialog.
Cancel
Click this button to cancel your edits and close the Faceplate Control
Properties dialog.
Apply
Click this button to apply your edits and continue editing in the Faceplate
Control Properties dialog.
See also
Faceplate Control Properties Dialog - General Tab on page 1097
E I
IMC 178
enhanced select (ESEL) 895
INTG 817
Equipment diagram instructions 1022
equipment phase 961, 970, 972, 979, 989, J
993, 996, 1000, 1004
equipment phase clear failure - PCLF JKFF 951
970
equipment phase command - PCMD L
972
LDL2 887
equipment phase external request -
LDLG 59
PXRQ 979
LPF 876
equipment phase failure - PFL 989
equipment phase instructions 961 M
equipment phase new parameters -
PRNP 993 MAVE 927
equipment phase override command - MAXC 934
POVR 996 MINC 937
equipment phase paused - PPD 1000 MMC 198
phase state complete (PSC) 1004 MSTD 940
Equipment Sequence Instruction examples MUX 907
1029, 1030, 1031, 1032
Equipment Sequence Instructions 1011, N
1013, 1015, 1017, 1019, 1022
NTCH 882
F P
Faceplate Control Properties dialog 1085,
PATT 962
1086, 1087, 1088
PCLF 970
R
ramp/soak (RMPS) 105
reset dominant (RESD) 954
Result Codes for Equipment Sequence
Instructions 1026, 1027, 1028, 1029
RLIM 911
S
scale (SCL) 119
S-Curve (SCRV) 841
second-order controller (SOC) 849
SEL 915
selected negate (SNEG) 918
selected summer (SSUM) 921
set dominant (SETD) 956
SOC 849
SRTP 123
T
totalizer (TOT) 130
U
UPDN 858
Literature Library Find installation instructions, manuals, brochures, and technical data publications. rok.auto/literature
Product Compatibility and Download Center Get help determining how products interact, check features and capabilities, and rok.auto/pcdc
(PCDC) find associated firmware.
Documentation feedback
Your comments help us serve your documentation needs better. If you have any suggestions on how to improve our content, complete the form at
rok.auto/docfeedback.
Rockwell Automation maintains current product environmental information on its website at rok.auto/pec.
Allen-Bradley, expanding human possibility, Logix, Rockwell Automation, and Rockwell Software are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.
Rockwell Otomayson Ticaret A.Ş. Kar Plaza İş Merkezi E Blok Kat:6 34752, İçerenkÖy, İstanbul, Tel: +90 (216) 5698400 EEE YÖnetmeliğine Uygundur