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).
Rockwell Automation recognizes that some of the terms that are currently used in our industry and in this
publication are not in alignment with the movement toward inclusive language in technology. We are
proactively collaborating with industry peers to find alternatives to such terms and making changes to our
products and content. Please excuse the use of such terms in our content while we implement these changes.
Global changes
None for this release.
Bit Shift Right (BSR) Equipment Phase Override Command (POVR) Motion Calculate Slave Values (MCSV)
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)
Count up (CTU) Moving Average (MAVE) Motion Group Shutdown (MGSD)
Count up/down CTUD Moving Standard Deviation (MSTD) Motion Group Shutdown Reset (MGSR)
Data Transition (DTR) Multiplexer (MUX) Motion Group Stop (MGS)
Degrees (DEG) Notch Filter (NTCH) Motion Group Strobe Position (MGSP)
Chapter 1
Process Control Instructions Process Control Instructions .................................................................... 19
Alarm (ALM) ...............................................................................................20
Discrete 3-State Device (D3SD) ................................................................ 25
Discrete 2-State Device (D2SD) .................................................................39
Deadtime (DEDT) .......................................................................................47
Function Generator (FGEN) ...................................................................... 53
Lead-Lag (LDLG)........................................................................................ 58
Enhanced PID (PIDE) ................................................................................63
Position Proportional (POSP)................................................................... 94
Ramp/Soak (RMPS) ..................................................................................102
Scale (SCL) ................................................................................................ 116
Split Range Time Proportional (SRTP) ...................................................120
Totalizer (TOT) ......................................................................................... 127
Coordinated Control (CC) ....................................................................... 136
CC Function Block Configuration .................................................... 167
CC Function Block Model Initialization........................................... 168
CC Function Block Tuning ................................................................ 168
CC Function Block Tuning Errors .................................................... 169
CC Function Block Tuning Procedure .............................................. 169
Internal Model Control (IMC) ................................................................. 169
IMC Function Block Configuration .................................................. 185
IMC Function Block Model Initialization ........................................ 186
IMC Function Block Tuning .............................................................. 186
IMC Function Block Tuning Errors .................................................. 187
IMC Function Block Tuning Procedure ........................................... 187
Modular Multivariable Control (MMC) .................................................. 187
MMC Function Block Configuration ............................................... 220
MMC Function Block Model Initialization ...................................... 221
MMC Function Block Tuning ........................................................... 222
Use an MMC Function Block for Splitter Control .......................... 222
MMC Function Block Tuning Errors ................................................223
MMC Function Block Tuning Procedure .........................................223
Current SP................................................................................................ 224
Use the Coordinated Control Function Block to Control .............. 224
CV High/Low Limiting ............................................................................ 226
Chapter 2
PlantPAx PlantPAx instructions.............................................................................. 235
Process Analog HART (PAH) ................................................................... 236
Process Analog Input (PAI) ...................................................................... 251
Process Dual Sensor Analog Input (PAID) ............................................ 278
Process Multi Sensor Analog Input (PAIM) ...........................................293
Process Analog Output (PAO) .................................................................. 314
Process Analog Output feedback processing ................................... 345
Process Boolean Logic (PBL).................................................................... 354
Process Command Source (PCMDSRC) .................................................368
Process Command Source operating model .................................... 377
Process Deadband Controller (PDBC) .................................................... 379
Process Discrete Input (PDI) ................................................................... 396
Process Discrete Output (PDO) ............................................................... 412
Process Dosing (PDOSE) ......................................................................... 436
Process Analog Fanout (PFO) .................................................................. 467
Process High or Low Selector (PHLS) .....................................................478
Process Interlocks (PINTLK) ...................................................................487
Process Lead Lag Standby Motor Group (PLLS) .................................... 497
Motor Sort Algorithm for Process Lead Lag Standby Motor Group
(PLLS) instructions ............................................................................524
Process Motor (PMTR) .............................................................................526
Process Motor (PMTR) Command Source .......................................558
Process Permissives (PPERM) ................................................................ 560
Process Proportional + Integral + Derivative (PPID).............................568
Process Pressure/Temperature Compensated Flow (PPTC) ................. 651
Process Restart Inhibit (PRI) ...................................................................659
Process Run Time and Start Counter (PRT) ...........................................665
Chapter 3
Drives Drives Instructions .................................................................................. 759
Integrator (INTG) .................................................................................... 759
Proportional + Integral (PI) ..................................................................... 765
Pulse Multiplier (PMUL) .......................................................................... 776
S-Curve (SCRV) ........................................................................................ 783
Second-Order Controller (SOC) .............................................................. 791
Up/Down Accumulator (UPDN) ............................................................. 800
HMI Button Control (HMIBC) ............................................................... 804
Chapter 4
Filter Filter Instructions ....................................................................................809
Derivative (DERV)....................................................................................809
High Pass Filter (HPF) ............................................................................. 813
Low Pass Filter (LPF) ................................................................................ 818
Notch Filter (NTCH) ................................................................................ 824
Second-Order Lead Lag (LDL2) .............................................................. 829
Chapter 5
Select_Limit Instructions Select/Limit Instructions ........................................................................ 837
Enhanced Select (ESEL) .......................................................................... 838
High/Low Limit (HLL) .............................................................................845
Multiplexer (MUX) .................................................................................. 849
Rate Limiter (RLIM) ................................................................................ 852
Select (SEL) ...............................................................................................856
Selected Negate (SNEG) ..........................................................................859
Selected Summer (SSUM) ...................................................................... 862
Chapter 6
Statistical Instructions Statistical Instructions ............................................................................ 869
Moving Average (MAVE) ......................................................................... 869
Maximum Capture (MAXC) ....................................................................875
Minimum Capture (MINC) .....................................................................879
Moving Standard Deviation (MSTD) ..................................................... 882
Chapter 7
Logical and Move Logical and Move Instructions ............................................................... 887
D Flip-Flop (DFF) ..................................................................................... 887
JK Flip-Flop (JKFF) ................................................................................... 890
Reset Dominant (RESD) ..........................................................................893
Set Dominant (SETD) ............................................................................. 896
Chapter 8
Equipment Phase Instructions Equipment Phase Instructions ............................................................... 901
Attach to Equipment Phase (PATT) ........................................................902
Detach from Equipment Phase (PDET) ................................................. 906
Equipment Phase Clear Failure (PCLF) ................................................. 909
Equipment Phase Command (PCMD) .................................................... 912
Equipment Phase External Request (PXRQ).......................................... 918
Equipment Phase Failure (PFL) ...............................................................927
Equipment Phase New Parameters (PRNP) ...........................................932
Equipment Phase Override Command (POVR) ..................................... 935
Equipment Phase Paused (PPD) ............................................................. 939
Phase State Complete (PSC) .................................................................... 943
Chapter 9
Equipment Sequence Equipment Sequence instructions ......................................................... 949
Attach to Equipment Sequence (SATT) .................................................. 949
Detach from Equipment Sequence (SDET)............................................ 953
Equipment Sequence Assign Sequence Identifier (SASI)..................... 955
Equipment Sequence Clear Failure (SCLF) ............................................958
Equipment Sequence command (SCMD) .............................................. 961
Equipment Sequence Diagram instructions .........................................965
Equipment Sequence Override (SOVR)..................................................965
Guidelines for SATT instructions............................................................969
Guidelines for SCMD instructions .........................................................969
Guidelines for SOVR instructions.......................................................... 970
Result codes for SATT instructions ........................................................ 970
Result codes for SCLF instructions ......................................................... 971
Result codes for SCMD instructions .......................................................972
Result codes for SOVR instructions ........................................................ 973
SASI instruction examples ...................................................................... 973
SATT instruction examples...................................................................... 974
SCLF instruction examples ...................................................................... 974
SCMD instruction examples ................................................................... 975
SDET instruction examples ..................................................................... 976
SOVR instruction examples..................................................................... 976
Chapter 10
Function Block Attributes Choose the Function Block Elements ..................................................... 979
Latching Data ...........................................................................................980
Function Block Responses to Overflow Conditions .............................. 981
Order of Execution .................................................................................. 982
Timing Modes ...........................................................................................985
Program/Operator Control ..................................................................... 988
Function Block States............................................................................... 991
Chapter 11
Structured Text Programming Structured Text Syntax............................................................................ 993
Structured Text Components: Comments............................................. 994
Structured Text Components: Assignments ..........................................995
Specify a non-retentive assignment .................................................996
Assign an ASCII character to a string data member ....................... 997
Structured Text Components: Expressions ........................................... 997
Use arithmetic operators and functions ......................................... 998
Use bitwise operators.........................................................................999
Use logical operators ....................................................................... 1000
Use relational operators .................................................................. 1001
Structured Text Components: Instructions ........................................ 1002
Structured Text Components: Constructs ...........................................1003
Character string literals ........................................................................ 1004
String Types ......................................................................................1005
CASE_OF .................................................................................................1005
FOR_DO ..................................................................................................1007
IF_THEN ................................................................................................. 1010
REPEAT_UNTIL ..................................................................................... 1013
WHILE_DO............................................................................................. 1015
Structured Text Attributes..................................................................... 1017
Chapter 12
Common Attributes for Common Attributes ................................................................................1019
Advanced Process Control and Math Status Flags....................................................................................1019
Drives Instructions Immediate values ....................................................................................1021
Data Conversions ................................................................................... 1022
Elementary data types ............................................................................ 1025
Floating Point Values ............................................................................. 1027
Index Through Arrays ............................................................................1029
Index
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.
Rockwell Automation recognizes that some of the terms that are currently
used in our industry and in this publication are not in alignment with the
movement toward inclusive language in technology. We are proactively
collaborating with industry peers to find alternatives to such terms and
making changes to our products and content. Please excuse the use of such
terms in our content while we implement these changes.
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.
Instructions
Available Instructions
Ladder Diagram
Not available
Control discrete devices, such as high/low/off feeders that have three D3SD
possible states (e.g., fast/slow/off, forward/stop/reverse, etc.).
Perform a delay of a single input. You select the amount of deadtime DEDT
delay.
Convert an input based on a piece-wise linear function. FGEN
Provide a phase lead-lag compensation for an input signal. LDLG
Regulate an analog output to maintain a process variable at a certain PIDE
setpoint, using a PID algorithm.
Raise/lower or open/close a device, such as a motor-operated valve, by POSP
pulsing open or close contacts.
Provide for alternating ramp and soak periods to follow a temperature RMPS
profile.
Convert an unscaled input value to a floating point value in engineering SCL
units.
Take the 0-100% output of a PID loop and drive heating and cooling SRTP
digital output contacts with a periodic pulse.
See also
Filter Instructions on page 809
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
HLimit REAL The high alarm limit for the input.
Valid = any real value
Default = maximum positive value
LLimit REAL The low alarm limit for the input.
Valid = any real value
Default = maximum negative value
LLLimit REAL The low-low alarm limit for the input.
Valid = any real value
Default = maximum negative value
Deadband REAL The alarm deadband for the high-high to low-low limits
Valid = any real value 0.0
Default = 0.0
ROCPosLimit REAL The rate-of-change alarm limit in units per second for a positive
(increasing) change in the input. Set ROCPosLimit = 0 to disable
ROC positive alarming. If invalid, the instruction assumes a value
of 0.0 and sets the appropriate bit in Status.
Valid = any real value 0.0
Default = 0.0
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 1019
Structured Text Syntax on page 993
Function Block Faceplate Controls on page 1030
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
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,
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;
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
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.
CommandStatus Output State
Command0Status is true Out0 = Out0State0
Out1 = Out1State0
Out2 = Out2State0
Command0Status is true and Stop and clear the fault timer.
FB0 = FB0State0 and Device0State is set to true
FB1 = FB1State0 and
FB2 = FB2State0 and
FB3 = FB3State0
Command1Status is true Out0 = Out0State1
Out1 = Out1State1
Out2 = Out2State1
Command1Status is true and Stop and clear the fault timer.
FB0 = FB0State1 and Device1State is set to true
FB1 = FB1State1 and
FB2 = FB2State1 and
FB3 = FB3State1
Command2Status is true Out0 = Out0State2
Out1 = Out1State2
Out2 = Out2State2
Command2Status is true and Stop and clear the fault timer.
FB0 = FB0State2 and Device2State is set to true
FB1 = FB1State2 and
FB2 = FB2State2 and
FB3 = FB3State2
See also
Common Attributes on page 1019
Structured Text Syntax on page 993
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.
ProgCommand BOOL Used to determine CommandStatus when the device is
in Program control. When true, the device is
commanded to the 1 state; when false, the device is
commanded to the 0 state.
Default is false.
Oper0Req BOOL Operator state 0 request. Set by the operator interface
to place the device in the 0 state when the device is in
Operator control.
Default is false.
Oper1Req BOOL Operator state 1 request. Set by the operator interface to
place the device in the 1 state when the device is in
Operator control.
Default is false.
State0Perm BOOL State 0 permissive. Unless in Hand or Override mode,
this input must be set for the device to enter the 0 state.
This input has no effect for a device already in the 0
state.
Default is true.
State1Perm BOOL State 1 permissive. Unless in the Hand or Override mode,
this input must be set for the device to enter the 1 state.
This input has no effect for a device already in the 1
state.
Default is true.
FB0 BOOL The first feedback input available to the D2SD
instruction.
Default is false.
FB1 BOOL The second feedback input available to the D2SD
instruction.
Default is false.
HandFB BOOL Hand feedback input. This input is from a field
hand/off/auto station and it shows the requested state
of the field device. When true, the field device is being
requested to enter the 1 state; when false, the field
device is being requested to enter the 0 state.
Default is false.
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.
Instruction first scan Set EnableOut to true.
ModeAlarm and 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 cleared and OverrideOnInit is set, clear Hand and set
Override (Override mode).
If ProgHandReq is set, set Hand and clear Override (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.
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 1019
Structured Text Syntax on page 993
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
RTSTimeStamp DINT Module time stamp value for real time
sampling mode.
Valid = 0 to 32,767ms
Default = 0
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:
StorageArray Size Needed = Maximum Deadtime (secs) / DeltaT (secs)
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 1019
Structured Text Syntax on page 993
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.
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 1019
Structured Text Syntax on page 993
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
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
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
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.
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
simulate a process gain, and you could enter a Bias to simulate an ambient
condition.
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 979
Common Attributes on page 1019
Structured Text Syntax on page 993
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
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
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
UseRatio BOOL Allow ratio control permissive. Set to true to enable ratio control when in Cascade/Ratio
mode.
Default is false.
RatioProg REAL Ratio program multiplier. Ratio and RatioOper are set equal to this value when in Program
control. If RatioProg < RatioLLimit or > RatioHLimit, the instruction sets the appropriate bit
in Status and limits the value used for Ratio.
Valid = RatioLLimit to RatioHLimit
Default = 1.0
RatioOper REAL Ratio operator multiplier. Ratio is set equal to this value when in Operator control. If
RatioOper < RatioLLimit or > RatioHLimit, the instruction sets the appropriate bit in Status
and limits the value used for Ratio.
Valid = RatioLLimit to RatioHLimit
Default = 1.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.
SPLAlarm BOOL SP low alarm indicator.
Set to true when the SP < SPLLimit.
PVPercent REAL PV expressed in percent of span.
PVPercent = ((PV- PVEUMin) x 100) / PVSpan
PV Span calculation: PVSpan = (PVEUMax - PVEUMin)
E REAL Process error. Difference between SP and PV, scaled in PV units.
EPercent REAL The error expressed as a percent of span.
InitPrimary BOOL Initialize primary loop command. Set to true when not in Cascade/Ratio mode or when
CVInitializing is true. This signal is normally used by the CVInitReq input of a primary PID
loop.
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.
When ControlAction is set, the calculated value of EPercent and
PVPIDPercent is negated before being used by the control algorithm.
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.
integral The integral term is calculated using Error. Set IGain = 0 to disable integral control.
Also, setting PGain = 0 when DependIndepend is set will disable integral control.
derivative The derivative term is calculated using:
• PV when PVEDerivative is set or
• Error when PVEDerivative is cleared
Set DGain = 0 to disable derivative control. Also, setting PGain = 0 when
DependIndepend is set will disable derivative control.
Derivative smoothing is enabled when DSmoothing is set and disabled when
DSmoothing is cleared. Derivative smoothing causes less CV output "jitter" as a result
of a noisy PV signal but also limits the effectiveness of high derivative gains.
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:
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
The PIDE equations above are representative of the algorithms used by the
PIDE instruction. You can substitute the change in error values for the change
in PV (in percent of span) for the proportional and derivative terms by
manipulating the parameters PVEProportional and PVEDerivative. By
default, the PIDE instruction uses the change in error for the proportional
term and the change in PV for the derivative term. This eliminates large
derivative spikes on changes in setpoint.
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.
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.
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
instruction then opens the steam valve to compensate for the drop in
temperature.
Function Block
Structured Text
PrimaryLoop.PV := Local:1:I.CH0Data;
PrimaryLoop.CVInitReq := SecondaryLoop.InitPrimary;
PrimaryLoop.CVInitValue := SecondaryLoop.SP;
PrimaryLoop.WindupHIn := SecondaryLoop.WindupHOut;
PrimaryLoop.WindupLIn := SecondaryLoop.WindupLOut;
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.
To set up a pair of cascaded PIDE instructions, set the AllowCasRat input
parameter in the secondary loop. This allows the secondary loop to be placed
into Cascade/Ratio mode. Next, wire the CVEU from the primary loop into the
SPCascade parameter on the secondary loop. The SPCascade value is used as the
SP on the secondary loop when the secondary loop is placed into
Cascade/Ratio mode. The engineering unit range of the CVEU on the primary
loop should match the engineering unit range of the PV on the secondary
loop. This lets the primary loop scale its 0-100% value of CV into the matching
engineering units used for the setpoint on the secondary loop.
The PIDE instruction supports several other features to more effectively
support cascade control. Wire the InitPrimary output on the secondary loop
into the CVInitReq input on the primary loop and wire the SP output of the
secondary into the CVInitValue input on the primary. This sets the CVEU value
of the primary loop equal to the SP of the secondary loop when the secondary
loop leaves Cascade/Ratio mode. This allows a bumpless transfer when you
place the secondary loop back into Cascade/Ratio mode. Also, wire the
WindupHOut and WindupLOut outputs on the secondary loop into the
WindupHIn and WindupLIn inputs on the primary loop. This causes the
primary loop to stop increasing or decreasing, as appropriate, its value of
CVEU if the secondary loop hits a SP limit or CV limit and eliminates any
windup on the primary loop if these conditions occur.
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
automatically adjust the rate of reactant B addition. In this example, reactant
A is often called the "uncontrolled" flow since it is not controlled by the PIDE
instruction. Reactant B is then called the "controlled" flow.
Function Block
Structured Text
PIDE_01.PV := ControlledFlow;
PIDE_01.SPCascade := UncontrolledFlow;
PIDE(PIDE_01);
Local:2:O.Ch0Data := PIDE_01.CVEU;
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
PVROCN-1 PVROCN-1 = PV
ElapsedROCPeriod ElapsedROCPeriod = 0
Once PVROC has been calculated, the PV ROC alarms are determined as
follows:
(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.
(1)
When ZCOff is cleared, ZCDeadband > 0, error has crossed zero for the first
time, (i.e. En >= 0 and En-1 < 0 or when En <= 0 and En-1 > 0), and | En | <=
ZCDeadband, the instruction sets ZCDeadbandOn.
(2)
On the transition to Auto or Cascade/Ratio mode, the instruction sets En-1 =
En.
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.
(1) During instruction first scan, the instruction clears the alarm outputs.
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.
(2) When in Auto or Cascade/Ratio mode or when in Manual mode and
CVManLimiting is set, the instruction limits the change of CV.
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 Manual
SPLimitsInv is true 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 979
Function Block Faceplate Controls on page 1030
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
Description
The POSP instruction usually receives the desired position setpoint from a
PID instruction output.
CycleTime = 0
OpenRate = 0
SPPercent is invalid
CycleTime = 0
CloseRate = 0
SPPercent is invalid
OpenOut and CloseOut will not be pulsed if SPPercent equals
PositionPercent. Both OpenTime and CloseTime will be cleared to 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.
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);
Publication 1756-RM006M-EN-P - March 2022 101
Chapter 1 Process Control Instructions
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 1019
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
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
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.
Input Parameter Data Description
Type
EnableIn BOOL Enable input. If false, the instruction does not execute and outputs
are not updated.
Default is true.
PV REAL The scaled analog temperature signal input to the instruction.
Valid = any float
Default = 0.0
PVFault BOOL Bad health indicator of PV. If true, the input is invalid, the
instruction is placed in Program Hold or Operator Manual mode,
and the instruction sets the appropriate bit in Status.
Default is false.
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.
SoakDeadband REAL Guaranteed soak deadband. Specify the amount in engineering
units that the PV is allowed to differ from the output when
GuarSoak is on. If this value is invalid, the instruction sets
SoakDeadband = 0.0 and the instruction sets the appropriate bit
in Status.
Valid = any float 0.0
Default = 0.0
CurrentSegProg DINT Current segment program. The user program writes a requested
value for the CurrentSeg into this input. This value is used if the
ramp/soak is in Program Manual mode. If this value is invalid, the
instruction sets the appropriate bit in Status.
Valid = 0 to NumberOfSegs-1
Default = 0
OutProg REAL Output program. The user program writes a requested value for
the Out into this input. This value is used as the Out when the
ramp/soak is in Program Manual mode.
Valid = any float
Default = 0.0
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.
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.
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.
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.
In this example, the AutoclaveRSSoakValue, AutoclaveRSSoakTime, and
AutoclaveRSRampValue arrays are REAL arrays with 10 elements to allow up
to a 10 segment RMPS profile.
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.
When transitioning from Operator control to Program control while the
ProgAutoReq, ProgManualReq, and ProgHoldReq inputs are false, the mode is
determined as follows:
If the instruction was in Operator Auto mode, then the transition is to
Program Auto mode.
If the instruction was in Operator Manual mode, then the transition is to
Program Manual mode.
When transitioning from Program control to Operator control while the
OperAutoReq and OperManualReq inputs are false, the mode is determined
as follows:
If the instruction was in Program Auto mode, then the transition is to
Operator Auto mode.
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.
(5) When returning to Auto mode, the instruction determines if ramping or
soaking resumes. What to do next depends on the values of Out,
SoakTimeLeft, and the SoakValue of the current segment. If Out = SoakValue
for the current segment, and SoakTimeLeft = 0, then the current segment has
completed and the next segment starts.
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 positive if Out < target SoakValue of the current segment. If the
ramp equation calculates a new Out which exceeds the target SoakValue, the
Out is set to the target SoakValue.
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
complete, SoakTimeLeft is decreased to reflect the time in minutes remaining
for the current segment. SoakTimeLeft = 0 when SoakTime expires.
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 1019
Structured Text Syntax on page 993
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
Limiting BOOL Limiting selector. If true, Out is limited to
between InEUMin and InEUMax.
Default is false.
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,
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 1019
Structured Text Syntax on page 993
Split Range Time This information applies to the CompactLogix 5370, ControlLogix 5570,
Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380,
Proportional (SRTP) 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
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
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.
Description
The length of the SRTP pulse is proportional to the PID output. The
instruction parameters accommodate heating and cooling applications.
CoolTime is the amount of time within CycleTime that the cool output is to be
turned on.
The instruction controls heat and cool outputs using these rules:
• Set HeatOut to true if HeatTime the internal cycle time
accumulator. Clear HeatOut to false when the internal cycle timer >
HeatTime.
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 HeatOut and CoolOut are cleared to false.
HeatTimePercent and CoolTimePercent 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.
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 1019
Structured Text Syntax on page 993
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.
Description
This instruction typically totals the amount of a material added over time,
based on a flow signal.
The TOT instruction supports:
• Time base selectable as seconds, minutes, hours, or days.
• You can specify a target value and up to two pre-target values.
Pre-target values are typically used to switch to a slower feed rate.
Digital flags announce the reaching of the target or pre-target values.
• A low flow input cutoff that you can use to eliminate negative
totalization due to slight flow meter calibration inaccuracies when the
flow is shut off.
• Operator or program capability to start/stop/reset.
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 Total is set to ResetValue.
OldTotal is cleared to 0.0.
ProgOper is cleared to false.
Instruction first scan All operator request inputs are cleared to false. If
ProgValueReset is true then all program request inputs
are cleared to 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.
Operating Modes
The following diagram shows how the TOT instruction changes between
Program control and Operator control.
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 979
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.
• 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)
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 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 Default = 0.0
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.
Description
Coordinated Control is a flexible model-based algorithm that can be used in
various configurations, for example:
• Three control variables are used to control one process variable
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:
• CV1 is feed forward;
• CV2 is cooling;
• CV3 heating.
Since CV1 is in Manual mode, CV3 target value as the lowest priority goal
cannot be accomplished. PV will be maintained at the setpoint by using CV3,
and at the same time CV2 will be driven to its target value (2nd priority goal).
If the operator changes the CV1 manual value, the control variable will take
the change into account when calculating new CV3 and CV2.
M1 CV1 - PV First order lag with deadtime model
M2 CV2 - PV First order lag with deadtime model
M3 CV3 - PV First order lag with deadtime model
T Target Response
C3 Model based algorithm to control PV by using CV3
Y1, Y2, Y3 Model outputs of M1, M2, M3
Y PV prediction
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 1019
CC Function Block Starting with the default configuration, configure the following parameters:
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
function block predicts the influence of the Manual CV values on the PV by
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.
See also
CC Function Block Tuning Procedure on page 169
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.
Structure
Input Data Type Description Valid and Default Values
Parameters
EnableIn BOOL Enable Input. If False, the function block Default=TRUE
will not execute and outputs are not
updated.
PV REAL Scaled process variable input. This value Valid = any float
is typically read from an analog input Default = 0.0
module.
PVFault BOOL PV bad health indicator. If PV is read from Default = FALSE
an analog input, then PVFault will normally FALSE = Good Health
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 value Valid = PVEUMin < PVEUMax
of PV and SP that corresponds to 100% ≤ maximum positive float
span of the Process Variable. If PVEUMax Default = 100.0
≤ PVEUMin, set bit in Status.
PVUEMin REAL Minimum scaled value for PV. The value of Valid = maximum negative
PV and SP that corresponds to 0% span float ≤ PVEUMin < PVEUMax
of the Process Variable. If PVEUMax ≤ Default = 0.0
PVEUMin, set bit in Status.
SPProg REAL SP Program value, scaled in PV units. SP Valid = SPLLimit to SPHLimit
is set to this value when in Program Default = 0.0
control.
If value of SPProg or SPOper < SPLLimit or
> SPHLimit, set bit in Status and limit
value used for SP.
SPOper REAL SP Operator value, scaled in PV units. SP Valid = SPLLimit to SPHLimit
set to this value when in Operator Default = 0.0
control.
If value of SPProg or SPOper < SPLLimit or
> SPHLimit, set bit in Status and limit
value used for SP.
SPCascade REAL SP Cascade value, scaled in PV units. If Valid = SPLLimit to SPHLimit
CascadeRatio mode and UseRatio is Default = 0.0
FALSE, then SP is set to this value,
typically this will be CVEU of a primary
loop. If CascadeRatio mode and UseRatio
is TRUE, then SP is set to this value times
Ratio.
If value of SPCascade < 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.
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 232
IMC Function Block Tuning on page 186
IMC Function Block Follow these steps to create a basic IMC configuration.
See also
IMC Function Block Tuning on page 186
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.
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 variable.
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.
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 187
IMC Function Block Tuning Errors on page 187
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.
CVManLimiting BOOL Limit CV(n), where (n) can be 1, 2, or 3, in Manual Default = FALSE
mode. If Manual mode and CVManLimiting is
TRUE, CV(n) will be limited by the CV(n)HLimit and
CV(n)LLimit values.
CV1EUMax REAL Maximum value for CV1EU. The value of CV1EU Valid = any float
that corresponds to 100% CV1. Default = 100.0
If CVEUMax = CVEUMin, set bit in Status.
CV2EUMax REAL Maximum value for CV2EU. The value of CV2EU Valid = any float
that corresponds to 100% CV2. Default = 100.0
If CVEUMax = CVEUMin, set bit in Status.
CV3EUMax REAL Maximum value for CV3EU. The value of CV3EU Valid = any float
that corresponds to 100% CV3. Default = 100.0
If CVEUMax = CVEUMin, set bit in Status.
CV1EUMin REAL Minimum value of CV1EU. The value of CV1EU that Valid = any float
corresponds to 0% CV1. Default = 0.0
If CVEUMax = CVEUMin, set bit in Status.
CV2EUMin REAL Minimum value of CV2EU. The value of CV2EU Valid = any float
that corresponds to 0% CV2. Default = 0.0
If CVEUMax = CVEUMin, set bit in Status.
CV3EUMin REAL Minimum value of CV3EU. The value of CV3EU Valid = any float
that corresponds to 0% CV3. Default = 0.0
If CVEUMax = CVEUMin, set bit in Status.
CV1PV1ProcessGain BOOL Used only for Autotuning. Sign of the process Default = FALSE
Sign 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).
CV2PV1ProcessGain BOOL Used only for Autotuning. Sign of the process Default = FALSE
Sign gain (Delta PV1/Delta CV2).
• 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
PV1).
CV3PV1ProcessGain BOOL Used only for Autotuning. Sign of the process Default = FALSE
Sign gain (Delta PV1/Delta CV3).
• 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
PV1).
CV1PV2ProcessGain BOOL Used only for Autotuning. Sign of the process Default = FALSE
Sign gain (Delta PV2/Delta CV1).
• Set to indicate a negative process gain
(increase in output causes a decrease in PV2).
• Reset to indicate a positive process gain
(increase in output causes an increase in
PV2).
CV1PV2ProcessGain BOOL Used only for Autotuning. Sign of the process Default = FALSE
Sign gain (Delta PV2/Delta CV2).
• Set to indicate a negative process gain
(increase in output causes a decrease in PV2).
• Reset to indicate a positive process gain
(increase in output causes an increase in
PV2).
CV1PV2ProcessGain BOOL Used only for Autotuning. Sign of the process Default = FALSE
Sign gain (Delta PV2/Delta CV3).
• Set to indicate a negative process gain
(increase in output causes a decrease in PV2).
• Reset to indicate a positive process gain
(increase in output causes an increase in
PV2).
ProcessType DINT Process type selection for both PV1 and PV2 Default = 0
(1=Integrating, 0=non-integrating)
CV1PV1ModelGain REAL The internal model gain parameter for CV1 - PV1. Valid = maximum negative
Enter a positive or negative gain depending on float −> maximum positive
process direction. float
If CV1PV1ModelGain = INF or NAN, set bit in Default = 0.0
Status.
CV3PV1ModelInit BOOL Internal model initialization switch for CV3 - PV1. Default = FALSE
Refer to Function Block Attributes.
CV1PV2ModelInit BOOL Internal model initialization switch for CV1 - PV2. Default = FALSE
Refer to Function Block Attributes.
CV2PV2ModelInit BOOL Internal model initialization switch for CV2 - PV2. Default = FALSE
Refer to Function Block Attributes.
CV3PV2ModelInit BOOL Internal model initialization switch for CV3 - PV2. Default = FALSE
Refer to Function Block Attributes.
PV1Factor REAL Non-integrating model approximation factor for Default = 100
PV1. Only used for integrating process types.
PV2Factor Non-integrating model approximation factor for Default = 100
PV2. Only used for integrating process types.
The following table describes the output parameters in the MMC function
block.
Description
The MMC is a flexible model-based algorithm that can be used in two basic
configuration modes:
• Three control variables used to control two interacting process
variables
• Two control variables used to control two interacting process variables
Following is an MMC function block splitter example configuration.
Item Description
M11 Internal model CV1 - PV1
M21 Internal model CV2 - PV1
M31 Internal model CV3 - PV1
M12 Internal model CV1 - PV2
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.
Refer to Refer to Function Block Attributes.for more details including
definitions and general behavior for all Function Block instructions.
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.
EnableIn is true .EnableIn and .EnableOut bits are set to true.
The instruction's main algorithm will be executed and outputs will
be updated.
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.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 230
Instruction First Scan on page 228
MMC Function Block Starting with the default configuration, configure the following parameters.
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.
The function block variables are ready to be put on-line in either auto or
Manual mode. For tuning, the default settings will be used.
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
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.
Set the CVROCPosLimit and CVROCNegLimit to limit the CV rate of change.
Rate limiting is not imposed when control variable is in Manual mode unless
CVManLimiting is set.
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
See also
MMC Function Block Tuning Procedure on page 223
MMC Function Block Tuning Errors on page 223
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)
The MMC calculates CV1, CV2, and CV3 so that the control goals are
accomplished in the following order of importance:
1. Control PV1 to SP1 (PV1 is always considered more important than
PV2)
2. Control PV2 to SP2
3. Control CV3 to its target value
CV1 is selected as the most active control for PV1 and CV2 as the most active
for PV2. If either CV1 or CV2 saturates or is put in Manual mode, the control
variable will use CV3 to maintain PV1 and PV2 at the setpoints.
See also
Module Multivariable Control ( MMC) on page 187
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%
See also
CC Function Block Tuning on page 168
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
CV is less than CVLLimit
CV is greater than or equal to CVLLimit
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
If CVLAlarm is set
CV = 100
CV from windup algorithm
CVHAlarm
CVLAlarm
CV limited to 0 to 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.
See also
Processing Faults on page 232
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 988
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)
See also
Execution on page 228
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.
• Enhanced PID on page 63
• Current SP on page 224
• SP High/Low Limiting on page 234
SP High/Low Limiting The high-to-low alarming algorithm compares SP to the SPHLimit and
SPLLimit alarm limits. SPHLimit cannot be greater than PVEUmaximum and
SPLLimit cannot be less than PVEUMin.
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.
Monitor one discrete condition, such as from a Process Discrete Input (PDI)
channel of a discrete input module.
Send one primary analog output signal to multiple Process Analog Fanout (PFO)
secondary users or devices.
Select the highest or the lowest of up to six Process High or Low Selector (PHLS)
incoming controlled variables (CVs) and send the
selected CV as output.
Collect, or sum up, the interlock conditions that stop Process Interlocks (PINTLK)
or de-energize a running or energized piece of
equipment.
Control a parallel group of motors, such as a set of Process Lead Lag Standby Motor Group (PLLS)
pumps with a common intake source and
discharge destination.
Monitor and control a fixed single-speed, Process Motor (PMTR)
two-speed, or reversing motor.
Collect, or sum up, the permissive conditions that Process Permissives (PPERM)
allow a piece of equipment to energize.
Manipulate the Control Variable (CV) in regulatory Process Proportional + Integral + Derivative (PPID)
control loops in response to Process Variable (PV)
readings and Setpoint (SP, the target PV) settings.
Calculate a flow at standard temperature and Process Pressure/Temperature Compensated Flow
pressure. (PPTC)
Prevent large motors from starting repeatedly. Process Restart Inhibit (PRI)
Record the total run time and number of instances Process Run Time and Start Counter (PRT)
the motor or other equipment starts.
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 operated Process Valve (PVLV)
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 759
Filter Instructions on page 809
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:
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 instruction.
ControlPlantPAx Control
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.
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).
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_HARTData PAX_HART_DEVI Visible Required InOut HART data from I/O module assembly.
CE:I:0
Ref_DiagTable P_HART_CODE_ Visible Required InOut Lookup table for diagnostic bit number (to message
DESC_STATUS[2 and status).
]
Ref_UnitsTable RAC_CODE_DES Visible Required InOut Lookup table for units of measure code (to units
CRIPTION[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_Stru HART "static" data, such as device scale range, analog signal units of measure, and device
ct:I:O 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
ChDataAtSignal20 REAL The value provided by the I/O module analog channel when a 20.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
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.
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;
PAI(TI_301, 0);
See also
Data Conversions on page 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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.
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.
BusObj BUS_OBJ tag Bus component
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
Alarms
Discrete tag-based alarms are defined for these members.
Member Alarm Name Description
Sts_HiDev Alm_HiDev Raised when the amount by which the PV exceeds the setpoint or
reference is above the High Deviation threshold while the associated
gate is opened (Inp_HiDevGate = 1). The threshold, deadband, and
gate delay are set in alarm configuration.
Sts_LoDev Alm_LoDev Raised when the amount by which the PV exceeds the setpoint or
reference is below the Low Deviation threshold while the associated
gate is opened (Inp_LoDevGate = 1). Since the threshold is a negative
number, this is the amount the PV falls below the setpoint or
reference. The threshold, deadband, and gate delay are set in alarm
configuration.
Sts_HiRoC Alm_HiRoC Raised when the amount by which the absolute value of PV rate of
change exceeds High Rate of Change limit while the associated gate
is opened (Inp_HiRoCGate = 1). The threshold, deadband, and gate
delay are set in alarm configuration.
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Access alarm elements using this format:
[email protected]
• There is a Program command that enables to Reset all alarms of the
instruction (Alarm Set) at the same time.
• There are Operator commands that enable to Reset, and
Reset&Acknowledge all alarms of the instruction (Alarm Set) at the
same time.
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:
• Monitors one analog input channel for the following conditions:
• Invalid configuration of the instruction (scaling configuration
error)
• I/O channel fault
• I/O module fault
• Input not-a-number (floating-point exception)
• Raw input out of range
• Input stuck (unchanging)
• Out of specification (uncertain) – reported from the device
• Function check (substitute PV entered manually) - reported from
the device
• Maintenance required - reported from the device
• For each condition, takes these actions:
• Pass the PV through unchanged
• Use the last good PV value
• Apply a configured replacement PV value
• Scales the input value from raw (input card) units to engineering
(display) units:
• Linear scaling (optional)
• Square root characterized scaling (optional).
Tip: Square root characterized scaling is typically used with orifice plates or other
pressure-differential elements for flow measurement when the transmitter does not provide
square root characterization. The square root scaling in the instruction works with
pressure differential to provide positive or negative flow values.
• Filters PV (optional) to reduce signal noise.
• Monitors PV Source, PV Quality and PV out-of-range condition.
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.
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.
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 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
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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.
• Input Source and Quality monitoring for uncertain or bad input for
each sensor, transmitter, or input, plus monitoring of each signal for
out-of-range condition. If one PV is bad, failed, or out or range, the
other PV is automatically selected.
• Warning alarm if the difference between the two sensor PVs exceeds a
configured limit.
• Warning alarm if only one PV has good quality.
• Warning alarm if neither PV has good quality; for example, if both are
uncertain.
• Failure alarm if both PVs are bad; for example, each PV has bad quality
(Inp_PVABad or Inp_PVBBad) or is outside the configured failure
range.
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
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.
Default is true.
Inp_PVAData REAL PV signal from sensor or input A (PV units). Valid = any float.
Default is 0.0.
Inp_PVASrcQ SINT Input source and quality, from channel A object, if available (enumeration).
Default is 0.
Inp_PVANotify SINT Related PV 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.
Default is 0.
Inp_SmartDvcASts DINT Current code provided by SMART Device on Inp_PVAData. 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_PVBData REAL PV signal from sensor or input B (PV units). Valid = any float.
Default is 0.0.
Inp_PVBSrcQ SINT Input source and quality, from channel B object, if available (enumeration).
Default is 0.
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
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:
[email protected]
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.
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.
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.
Rung-condition-in is false Rung-condition-out is cleared to false.
All commands that are automatically cleared on each execution are cleared and
ignored.
PSet_Owner and Val_Owner are set to 0.
Latched alarms are reset.
Clear Bus Object commands and HMI Bus Object Index
Execute Bus command on receipt for Disable, Enable, Suppress, Unsuppress all
alarms.
Execute Bus command status propagation.
Internal timers are reset.
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
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.
The Inp_PVAData and Inp_PVBData parameters are connected to the values
from the two analog transmitters. The fault status of each of these sensors is
tied to the bad input of the instruction (for example, Inp_PVABad). The
output parameters Val, Sts_PVBad and Sts_PVUncertain, can then be
connected to the Inp_PVData, Inp_PVUncertain and Inp_ChanFault for
control.
Ladder Diagram
Structured Text
PAI(AIT_201A);
PAI(AIT_201B);
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 1022
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.
The PAIM instruction provides:
• Configuration to use between two and eight input signals.
• Input Source and Quality monitoring of inputs, plus monitoring of
each signal for out of range condition. Rejection from the PV
calculation of inputs that are out of range, flagged as bad, infinite, or
not a number (floating-point exception values).
• Calculation of the average (mean) or median of the inputs in use as the
PV value.
• Selectable rejection from the PV calculation of inputs that are outside
tau standard deviations from the mean, with a minimum of four
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 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.
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).
Out_SmartDvcSts DINT Not Visible Not Required Output Status code of a SMART device provided by
Inp_SmartDvcASts or Inp_SmartDvcBSts or
Inp_SmartDvcCSts or Inp_SmartDvcDSts or
Inp_SmartDvcESts or Inp_SmartDvcFSts or
Inp_SmartDvcGSts or Inp_SmartDvcHSts. Highest
status code selected.
Val_NumPVs DINT Not Visible Not Required Output Number of PVs that are currently used in calculating
Val_CalcPV.
Sts_Initialized BOOL Not Visible Not Required Output 1 = Instruction is initialized. Use Inp_InitializeReq to
reinitialize.
Sts_SmartDvcDiagAvailable BOOL Not Visible Not Required Output 1 = Diagnostics of a SMART device is currently
available. Typically used to indicate one of the
devices requires action to keep operating as
expected.
Sts_PVBad BOOL Not Visible Not Required Output 1 = At least one input channel PV is bad quality or out
of range.
Sts_PVUncertain BOOL Not Visible Not Required Output 1 = At least one input channel PV value is uncertain
quality.
Sts_PVAReject BOOL Visible Not Required Output 1 = Input A rejected, not used to calculate PV.
Sts_PVBReject BOOL Visible Not Required Output 1 = Input B rejected, not used to calculate PV.
Sts_PVCReject BOOL Visible Not Required Output 1 = Input C rejected, not used to calculate PV.
Sts_PVDReject BOOL Not Visible Not Required Output 1 = Input D rejected, not used to calculate PV.
Sts_PVEReject BOOL Not Visible Not Required Output 1 = Input E rejected, not used to calculate PV.
Sts_PVFReject BOOL Not Visible Not Required Output 1 = Input F rejected, not used to calculate PV.
Sts_PVGReject BOOL Not Visible Not Required Output 1 = Input G rejected, not used to calculate PV.
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:
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.
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.
The Inp_PVAData, Inp_PVBData, and Inp_PVCData parameters are
connected to the values from the three analog transmitters. The fault status of
each sensor is tied to the bad input of the PAIM (for example, Inp_PVABad).
The output parameters Val, Sts_PVBad and Sts_PVUncertain, can then be
connected to the Inp_PVData, Inp_PVUncertain and Inp_ChanFault for
control.
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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.
The PAO instruction:
• 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.
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_DeviceFault BOOL Indicates the device fault (overload, etc.).
0 = The device is good,
1 = The device is bad, causing fault.
This input sets Sts_DeviceFault (if the device is not virtual) which raises Device alarm (if the device is not
virtual).
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:
[email protected]
The Program commands for each alarm enable users to Acknowledge,
Suppress, Unsupress and Unshelve the Alarm. These commands are
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.
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;
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;
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 345
Data Conversions on page 1022
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:
• Instruction is not in virtual, Closed limit switch is used and activated.
• Instruction is not in virtual, Open limit switch used and not activated,
Closed limit switch not used.
• Instruction is in virtual and Val_Pos ≤ Cfg_MaxClosedPos.
• No limit switch in use and Val_Pos ≤ Cfg_MaxClosedPos.
Instruction logic used in processing of feedback from limit switches and
device/actuator confirmed position is shown in this diagram.
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 instruction uses three parameters associated with assumed behavior of
the device or actuator, rate at which the device moves when opening
Cfg_OpenRate, rate at which the device moves when closing Cfg_CloseRate,
and delay Cfg_DeadTime in device or actuator reaction when the device or
actuator is commanded to open or close. If the device or actuator responds to
the Open/Close pulse with delay, e.g. due to stiction, compensate for the delay
by entering Cfg_DeadTime. Uncompensated delay results in steady state
position error.
IMPORTANT Failure to set correct values for Cfg_OpenRate, Cfg_CloseRate, and Cfg_DeadTime can result
in undesired moves of the device or actuator.
The pulsing logic provides functionality of a position control loop. Pulse width
is calculated for a cycle.
For Val_Dev /DIAGRAM_PATH_SPECIFIER>0 open pulse time is calculated
as:
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.
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.
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
• Device is not at the end of travel, or limit switch is not being used, for
the target direction of travel.
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.
The PBL Instruction can record its current state:
• After a change in output state.
• On Operator or Program command.
• Based on a logic loopback input.
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.
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.
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_0 BOOL Logic input 0.
Default is false.
Inp_1 BOOL Logic input 1.
Default is false.
Inp_2 BOOL Logic input 2.
Default is false.
Inp_3 BOOL Logic input 3.
Default is false.
Inp_4 BOOL Logic input 4.
Default is false.
Inp_5 BOOL Logic input 5.
Default is false.
Inp_6 BOOL Logic input 6.
Default is false.
Inp_7 BOOL Logic input 7.
Default is false.
Inp_Hold BOOL 1 = Hold previous states in snapshot; 0 = Pass live states to snapshot.
Default is false.
Inp_Reset BOOL 1 = Reset snapshot latch, show live states.
Default is false.
Cfg_UseInpHold BOOL 1 = Use Inp_Hold to snap state; 0 = Use Cmds or Output transition to snap.
Default is false.
Cfg_UsePCmd BOOL 1 = Enable snapshot on PCmd_Snap 0 --> 1 (edge).
Default is true.
Cfg_UseOCmd BOOL 1 = Enable snapshot on OCmd_Snap 0 --> 1 (edge).
Default is true.
Cfg_UseOut01 BOOL 1 = Enable snapshot on Output 0 --> 1 (rising edge).
Default is true.
Cfg_UseOut10 BOOL 1 = Enable snapshot on Output 1 --> 0 (falling edge).
Default is false.
Cfg_TimestampOnSnap BOOL 1 = Generate a timestamp when snapshot occurs.
Default is false.
Operation
The PBL instruction:
• Provides up to eight Boolean inputs and eight logic gates.
• Each gate has four inputs. Each input can be enabled or disabled and
can be normal or inverted. Each enabled gate input can be linked to a
source, which is an instruction input or the result of a preceding gate
• Use one of these methods to configure the eight gates:
• Logical AND: The gate's output is true if all of the enabled gate
inputs, after configured inversions, are true. An AND gate can have
up to four inputs enabled.
Implementation
Use the PBL instruction in these situations:
Configuration
A maximum of eight gates can be configured using these tags:
Cfg_GateFunc[M] – This configuration is an array which defines the
gate function. M = the gate number, 0-7.
• 1 = Logical AND Gate
Examples:
• Cfg_GateSrc1Mask.0 = 1 input pin 1 of gate 0 is enabled
• Cfg_GateSrc2Mask.1 = 1 input pin 2 of gate 1 is enabled
• Cfg_GateSrc3Mask.3 = 1 input pin 3 of gate 3 is enabled
• Cfg_GateSrc4Mask.0 = 1 input pin 4 of gate 0 is enabled
Each gate input pin can be normal or inverted.
Cfg_GateSrc#Invert: This configuration is a SINT value which inverts
an input. # = the input pin number (1-4).
Examples:
• Cfg_GateSrc1Invert.0 = 1 input pin 1 of gate 0 is inverted.
• Cfg_GateSrc2Invert.2 = 1 input pin 2 of gate 2 is inverted
• Cfg_GateSrc3Invert.3 = 1 input pin 3 of gate 3 is inverted
• Cfg_GateSrc4Invert.6 = 1 input pin 4 of gate 6 is inverted
Each enabled gate input pin can be linked to a source, either an instruction
input or the result of a preceding gate.
Cfg_GateSrc#Ptr[M] - This configuration is an array that defines the
source for the input pin on each gate. Where # = the input pin number
(1-4), and M = the gate number (0-7). A value of 0-7 represents an
instruction input. A value of 8-15 represents the result of a preceding
gate. Tip: A gate can only be used as an input into another gate with a
higher gate value.
Examples:
• Cfg_GateSrc1Ptr[0] = 2 states that Inp_2 is configured in Gate 0 on
pin 1.
• Cfg_GateSrc2Ptr[0] = 3 states that Inp_3 is configured in Gate 0 on
pin 2.
• Cfg_GateSrc3Ptr[2] = 8 states that Gate 0 result is configured
in Gate 2 on pin 3.
• Cfg_GateSrc4Ptr[7] = 12 states that Gate 4 result is configured
in Gate 7 on pin 4.
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.
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.
In this example, there is a motor with three RTDs measuring temperature of
the windings. To prevent damage to the windings, the motor must be
interlocked if:
• Any of the windings are above the high-high temperature limit.
• The majority of the windings are above the high temperature limit.
PBL performs this function. The output of this logic feeds the interlock of the
motor elsewhere in logic.
Ladder Diagram
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;
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 1022
Index Through Arrays on page 1029
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.
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.
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.
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_InitializeReq BOOL 1 = Request to initialize the instruction. The instruction is normally initialized in
instruction first run. Use this request when re-initialization is needed. The instruction
clears this operand automatically.
Default is true.
Inp_Hand 1 = Acquire Hand (typically permanently set to local),
0 = Release Hand.
BOOL Default is false.
Inp_Ovrd 1 = Acquire Override (higher priority program logic),
0 = Release Override.
BOOL Default is false.
Inp_ExtInh 1 = Inhibit External acquisition,
0 = Allow External acquisition.
BOOL Default is true.
Cfg_HasOper 1 = Operator (unlocked) exists, can be selected.
BOOL Default is true.
Cfg_HasOperLocked 1 = Operator Locked exists, can be selected.
BOOL Default is true.
Cfg_HasProg 1 = Program (unlocked) exists, can be selected.
BOOL Default is true.
Cfg_HasProgLocked 1 = Program Locked exists, can be selected.
BOOL Default is true.
Cfg_HasExt 1 = External exists, can be selected.
BOOL Default is false.
Cfg_HasMaint 1 = Maintenance exists, can be selected.
BOOL Default is true.
Cfg_HasMaintOoS 1 = Maintenance Out of Service exists, can be selected.
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.
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 the Program 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)
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.
Initialization
The instruction is normally initialized in the instruction first run.
Re-initialization can be requested any time by setting Inp_InitializeReq = 1.
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.
Rung-condition-in is false The instruction is put Out of Service if Inp_Hand=0. The output is de-energized.
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).
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.
See also
Index Through Arrays on page 1029
Structured Text Syntax on page 993
Function Block Faceplate Controls on page 1030
Data Conversions on page 1022
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.
See also
Process Command Source (PCMDSRC)
PlantPAx instructions on page 235
Process Deadband This information applies to the ControlLogix 5380P and 5580P controllers.
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
BusObj BUS_OBJ tag Bus component
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.
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:
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.
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 1022
Index Through Arrays on page 1029
Process Discrete Input (PDI) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Discrete Input (PDI) instruction monitors a discrete (true or
false) input, and checks for alarm conditions. Use the PDI instruction to
process a signal from a channel of a discrete input module. Use the PDI
instruction with any discrete (BOOL) signal.
The PDI instruction provides these capabilities:
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:
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.
The alarm is generated when the Inp_PVData (process variable) input is
different from the Inp_Target (target) input. The Target indicates the normal
condition. For example, a flow switch should indicate flow when a pump is
running and should not indicate flow when a pump is stopped. The pump run
status is used as the Target input, and when the switch does not match the
target (within the allotted time), the Alarm (Flow Loss / Switch Failure) is
generated.
Debouncing
A bounce is a reversal of state that occurs immediately after a deliberate
transition. When filtering bounces you should acknowledge the very first
transition as early as possible and ignore subsequent changes until the end of
a hold-off period. Use Cfg_Debouncing to specify the hold-off period in
seconds.
For example, as soon as the Input PV changes state from 0 to 1, the output
changes to 1 and will not then follow the Input PV back to 0 until the
Cfg_Debounce time has expired. If Cfg_Debounce is set to 1 second, the
output remains at 1 for at least 1 second. After 1 second, if the Input PV was
then 0, the output would change to 0 and would remain at 0 for at least 1
second.
This illustration shows the Debounce operation.
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.
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.
Postscan See Postscan 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 1022
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.
The PDO instruction:
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.
Inp_Hand BOOL 1 = Acquire Hand (typically permanently set to local),
0 = Release Hand.
Default is false.
Inp_Ovrd BOOL 1 = Acquire Override (higher priority program logic),
0 = Release Override
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:
[email protected]
The PDO instruction handles alarm conditions described by these four use
cases and conditions:
• 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.
426 Publication 1756-RM006M-EN-P - March 2022
Chapter 2 PlantPAx
• 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.
When Virtualization is active, the output of the discrete output holds at 0,
virtual feedback of a device is provided and I/O faults are ignored. Setting of
Cfg_VirtualFdbkTime operand delays the echo of the On/Off status of the
device. Manipulate the instruction to operate as if a working discrete output is
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.
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)
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.
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
sequence. The status of the sequence is connected to the Inp_IntlkOK operand
so that the output to the vent filter heater jacket is always off when the skid is
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
Process Dosing (PDOSE) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Dosing (PDOSE) instruction controls an ingredient addition that
uses a flow meter to measure the quantity of ingredient added. The flow
meter can be an analog flow meter (signal proportional to flow), a pulse
generating flow meter (pulse count proportional to quantity delivered), or a
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.
Inp_Reset BOOL Not Visible Not Required Input 1 = Reset shed latches and cleared alarms.
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.
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:
[email protected]
[email protected]
The PDOSE instruction handles alarm conditions described by these use cases
and conditions:
• 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.
• Above high limit - raised when the flow rate exceeds the High Flow
Rate limit, for a configured period of time.
• Below low limit - raised when the flow rate falls short of the Low Flow
Rate limit, for a configured period of time.
• 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.
• 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.
• 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.
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 PDOSE
instruction.
Operation
This diagram illustrates the functionality of the PDOSE instruction:
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.
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.
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.
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.
Postscan See Postscan 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 1022
Index Through Arrays on page 1029
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.
The Process Analog Fanout (PFO) instruction:
• Receives an input-controlled variable (CV) from a primary PID loop or
analog output.
• Applies rate-of-change limiting to the input signal.
• Calculates outputs for up to eight secondary devices. Each secondary
output has its own ratio (slope) and offset (intercept) from the
rate-limited primary input. The ratios and offsets are configured
values.
• Applies minimum and maximum clamping limits to each output
(secondary) CV.
• Provides for initialization of each of its secondary CV outputs based on
a request bit and a requested value from the secondary. When a
particular output CV comes out of initialization, it is ramped from the
initialization value to its calculated value using a configured takeup
rate.
• Provides for initialization of the primary when all secondaries have
requested initialization. The initialization value sent to the primary
can be a fixed, configured value or a calculated value based on the CV1
(Output 1) requested initialization value, accounting for the CV1 gain
and offset. Thus CV1 is the priority output.
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.
Inp_CV1InitializationVal REAL Initialization value from downstream block #1 (Out 1 engineering units). Valid = any float.
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.
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.
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 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 1022
Index Through Arrays on page 1029
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.
To avoid problems with ever-decreasing or ever-increasing output, offset the
tracking value by an amount equal to the upstream PID/PIDE gain time’s
error value.
Use the PHLS instruction to implement an Override Select control strategy.
An Override Select strategy provides control of a primary process variable
while allowing other process variables to override the output on the final
control element, which avoids exceeding constraints.
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.Inp_InitializeReq := NOT(P50_Motor.Sts_RunningFwd AND
P50_Motor.Sts_Available);
PHLS(PHLS);
See also
Data Conversions on page 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
Process Interlocks (PINTLK) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Interlocks (PINTLK) instruction collects, or sums up, the
interlock conditions that stop or de-energize a running or energized piece of
equipment. This instruction can also help prevent equipment from starting or
being energized. Interlocks are always evaluated to de-energize equipment.
For permissive conditions that must be made to start the equipment, but are
ignored once the equipment is running, use the Process Permissive (PPERM)
instruction.
The PINTLK instruction provides:
• Interlock input OK check: Each input is compared with its configured
OK state. If the input is not in its OK state, it raises an interlock
condition unless bypassed.
• Interlock Condition Latching: If the input is configured as latched, the
interlock condition is latched until reset, unless the latch defeat input
is true. If the input is not configured as latched, the interlock condition
clears when the input returns to it’s OK state.
• Interlock Bypass: If the input is configured as able to be bypassed and
interlocks are bypassed, the input does not raise an interlock
condition, even if it is not in its OK state. If the input is configured as
not able to be bypassed or if interlocks are not bypassed, the input
raises an interlock condition. Engineering configures which interlocks
are allowed to be bypassed. Maintenance chooses which inputs to
bypass from the interlocks that are allowed by engineering.
• First Out: If no interlock conditions are raised (OK to run), the first
interlock condition to be raised is marked as the first out. If multiple
interlock conditions are raised in the same scan, they are all marked as
first out.
• Latch Defeat: A latch defeat function reduces the number of operator
actions that are required to start equipment. The latch defeat input is
set when the equipment is not running. When the latch defeat input is
true, the latched configuration of inputs is ignored, and all interlock
conditions clear when their corresponding inputs are in their OK
states. This action saves the operator from having to reset before
starting the equipment. When the equipment starts, the latch defeat
input is turned off. Then, if an interlock condition configured as
latched shuts down the equipment, it remains latched until reset.
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_STATUS tag Reference interlock bank status.
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.
Public Input Members Data Type Description
Enable Input - System Defined Parameter
BOOL
EnableIn Default is true.
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
BOOL
operand automatically.
Inp_InitializeReq Default is true.
Interlock condition 00, de-energize if not in configured OK state.
BOOL
Inp_Intlk00 Default is false.
Interlock condition 01, de-energize if not in configured OK state.
BOOL
Inp_Intlk01 Default is false.
Interlock condition 02, de-energize if not in configured OK state.
BOOL
Inp_Intlk02 Default is false.
Interlock condition 03, de-energize if not in configured OK state.
BOOL
Inp_Intlk03 Default is false.
Interlock condition 04, de-energize if not in configured OK state.
BOOL
Inp_Intlk04 Default is false.
Interlock condition 05, de-energize if not in configured OK state.
BOOL
Inp_Intlk05 Default is false.
Interlock condition 06, de-energize if not in configured OK state.
BOOL
Inp_Intlk06 Default is false.
Interlock condition 07, de-energize if not in configured OK state.
BOOL
Inp_Intlk07 Default is false.
Interlock condition 08, de-energize if not in configured OK state.
BOOL
Inp_Intlk08 Default is false.
Interlock condition 09, de-energize if not in configured OK state.
BOOL
Inp_Intlk09 Default is false.
Interlock condition 10, de-energize if not in configured OK state.
BOOL
Inp_Intlk10 Default is false.
SINT Operator command confirmation required. Represents the type of command confirmation
required. 0 = None, 1 = Command confirmation required, 2 = Performer e-signature
required, 3 = Performer and approver e-signature required.
Cfg_CnfrmReqd Default is 0.
Program command to reset latched interlocks.
BOOL
PCmd_Reset Default is false.
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:
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.
Postscan See Postscan 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 1022
Index Through Arrays on page 1029
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
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.
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_PermOK BOOL Visible Not Required Input 1 = Start permissives OK, group can start.
Default is true.
Inp_NBPermOK BOOL Visible Not Required Input 1 = Non-bypassable start permissives OK, group can
start.
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_STAND Visible Required InOut Motor interface array (link to 2 to 30 motors).
BY_MOTOR[30]
BusObj BUS_OBJ Visible Optional InOut Bus component.
Alarms
Discrete tag-based alarms are defined for these members.
Operation
This diagram illustrates the functionality of the PLLS instruction:
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.
The PLLS instruction uses an array of structures of the type
P_LEAD_LAG_STANDBY_Motor to interface to the motors. Each interface
element in the array provides the signals that are required between the PLLS
instruction and one motor. Configuration data for the motor is also provided
in the array. This data includes Priority and Preference values that can be used
to affect the sorting of the motors. A Maintenance out of service flag that
removes a motor from consideration in the sort is also included. The interface
also includes a user sort value that can be used, for example, to push motors
up or down the sort based on accumulated runtime or other criteria.
These images show an example of the ladder logic for transferring commands
and motor status for one motor.
The process for forwarding each of the commands (PCmd_Lock,
PCmd_Unlock, PCmd_Start, and PCmd_Stop) is:
• Test the appropriate bit in the interface to see if it is set.
• If the bit is set, the bit is cleared and the corresponding program
command on the motor is set.
• 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_Lock:=MyNG_PLLS_Motors[1].PCmd_Lock;
MyNG_PLLS_Motor02.PCMD_Unlock:=MyNG_PLLS_Motors[1].PCmd_Unloc
k;
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 524
Data Conversions on page 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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:
instructions • Out of service bit
• Status value
• Priority value
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,
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.
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.
Inp_AlarmData BOOL Not Visible Not Required Input 1=Intelligent motor controller has a Warning or Alarm. See
controller display or manual.
Default is false.
Inp_FaultedData BOOL Not Visible Not Required Input 1=Intelligent motor controller has Faulted. See controller
display or manual.
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.
Sts_Running1 BOOL Visible Not Required Output 1 = Motor requested to run and is confirmed running
forward.
Sts_Running2 BOOL Not Visible Not Required Output 1 = Motor requested to run and is confirmed running
reverse.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_Ctrl_Set RAC_ITF_DVC_PWR Visible Required InOut Discrete Power Automation Device Object Settings
DISCRETE_SET Interface.
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
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.
Members Data Type Description
Enumerated state value:
0=Unused
1=Initializing
2=Disconnected
3=Disconnecting,
4=Connecting,
5=Idle,
6=Configuring,
eState DINT 7=Available
FirstWarning RAC_UDT_EVENT First Warning
FirstFault RAC_UDT_EVENT First Fault
eCmdFail DINT Enumerated command failure code
bSts INT Status (Bit Overlay)
Physical BOOL 1=Operating as a physical device
Virtual BOOL 1=Operating as a virtual device
Connected BOOL Connected Status
Available BOOL Available Status
Warning BOOL Warning
Faulted BOOL Faulted
Ready BOOL 1=Device is active (Power Structure Active)
Active BOOL 1=Device is active (Power Structure Active)
CmdDir BOOL Command direction; 1=Reverse, 0=Forward
ActDir BOOL Actual direction; 1=Reverse, 0=Forward
CmdSpd BOOL 1 = Motor is Commanded to run fast 0 = slow
Fast BOOL Fast speed selected (two-speed device)
Slow BOOL Slow speed selected (two-speed device)
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
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.
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:
[email protected]
The PMTR instruction uses these alarms:
• 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).
Operation
This diagram illustrates functionality of the PMTR instruction:
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.
When Virtualization is active, the outputs of the PMTR instruction hold at 0,
virtual feedback of a working device is provided, and I/O faults are ignored.
The setting of Cfg_VirtualFdbkTime operand determines the time delay
between a command to start or stop the device and the echo of the running or
stopped status. Manipulate the instruction to operate as if a working motor is
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.
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:
• Operator, through the HMI
• Program, through logic connected to the block
• External, through logic connected to the block
• Override, through logic connected to the block
• Maintenance, through the HMI
• Out of Service
• Hand (assumes the block has no control of the motor, so aligns with
the actual motor status in order to achieve bumpless transfer from
Hand back to one of the other command sources)
The PMTR instruction has two aspects, which can be kept by a particular
command source whenever the command source selection is Operator,
Program or External. Either or both of the aspects can be kept at any given
time, or can follow the selection of the PCMDSRC. The aspects are:
• Start1 and Start2 commands
• Jog1 and Jog2 commands
The Jog commands cannot be kept by the Program command source.
The PMTR instruction supports virtualization. When selected to Virtual, the
instruction provides status to the operator and other blocks as if a working
motor were connected while keeping the outputs to the physical motor
de-energized (zero). When selected to Physical, the instruction monitors and
controls the physical motor device. Use Virtualization to provide off-process
functional testing of higher-level control strategies or simulation for operator
training.
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
that must be OK for the motor to start but which are ignored once the motor
This illustration shows the relationship between a PMTR instance and its
associated Power Discrete Device Object.
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 558
Index Through Arrays on page 1029
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
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.
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.
Inp_Perm16 BOOL Permissive condition 16, OK to energize if in configured OK state.
Default is true.
Inp_Perm17 BOOL Permissive condition 17, OK to energize if in configured OK state.
Default is true.
Inp_Perm18 BOOL Permissive condition 18, OK to energize if in configured OK state.
Default is true.
Operation
This diagram illustrates the functionality of the PPERM 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.
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.
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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 CV is typically used as a cascade setpoint for a secondary, or inner, control
loop or is sent to an Analog Output channel on an IO card.
The PPID instruction integrates functions of the existing PID, PIDE, and
P_PIDE AOI into a single built-in instruction and adds additional features.
The PPID instruction:
• Calculates CV with velocity PID algorithm. Velocity algorithm is also
known as incremental algorithm. Velocity algorithm computes the CV
value by summing ∆PTerm, ∆ITerm, ∆DTerm, ∆FF, and CV from the
previous execution of the instruction. When Inp_UseCVPrev is set, CV
previous is set equal to Inp_CVPrev. When Inp_UseFFPrev is set,
previous FF is set equal to Inp_FFPrev. This lets you preset CV to a
specified value before output CV value is computed, CV = CV previous
+ ∆PTerm + ∆ITerm + ∆DTerm + ∆FF. Velocity form of the PID
algorithm supports bumpless transfer in parameter change.
• Provides an option to suppress bumpless transfer in gain change.
When this option is selected the PID calculation behaves as a position
PID algorithm where control action changes with loop error and not
error change.
• Uses a two degrees of freedom PID formula for calculating CV with
proportional PTerm action derived from weighted SP and PV
difference (b*SP-PV), integral ITerm action derived from control error
(SP-PV), and derivative DTerm action derived from change in
weighted SP and PV difference (c*SP-PV). The change in weight
setting in run-time is bumpless.
• Uses an error-squared (option) algorithm with CV more aggressive
when error rises. The use of error square is restricted to PTerm.
• Provides Direct/Reverse action (option). The action is Direct when CV
rises with PV increase (Cfg_CtrlAction=1). The action is Reverse if CV
decreases with PV increase (Cfg_CtrlAction=0).
• Allows deviation deadband. CV is not sensitive to loop error variation
when within the band around zero error. Configured band levels allow
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
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.
Mark the alarm as used or unused and set standard configuration members of
the discrete tag-based alarm. Access alarm elements using this format:
[email protected].
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
data type REAL are in engineering units. Variables without prefix of data type
REAL are in % of span.
Ts [second] is a current period of PID algorithm execution, i.e. time elapsing
from the previous scan of the PPID instruction.
d is a one-scan delay operator. For example:
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,
–
Contribution of derivative term if Cfg_UseDSmooting=0, Cfg_Dependent=0
and Cfg_GainBumpless=0.
dD(k) = Cfg_DGain(k) * ∆Ec(k) – Cfg_DGain(k–1) * ∆Ec(k–1)
Feedforward term.
The windup prevention mechanism monitors the internal CV value and drives
the integral term. The windup prevention mechanism uses these rules:
• If the internal CV is above the currently applied upper limit, do not
integrate upward.
• If the internal CV is within the currently applied limits, integrate but
do not violate limits.
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 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.
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 target and ramp time entry is permitted (ORdy_SPTarget=1,
ORdy_SPRampTime=1) and Val_SPTarget copied to Val_SPSet if:
• Setpoint ramp wizard is permitted (Cfg_HasSPRamp=1), and
Program/Operator/External setting is not tracked (Cfg_SetTrack=0),
or
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.
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.
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:
• The current command source is Operator (Sts_Oper=1) and the
configuration is set to follow the command source (Cfg_eKeepCV=0),
or
• the command source is Operator/Program/External and the
configuration keeps the CV for Operator (Cfg_eKeepCV=1),
• or the command source is Maintenance (Sts_Maint=1).
The loop mode is owned by Operator if:
Owned by Program
The CV is owned by Program if:
• The current owner is Program (Sts_Prog=1) and the configuration is
set to follow the command source (Cfg_eKeepCV=0), or
• the owner is Operator/Program/External and the configuration keeps
the CV for Program (Cfg_eKeepCV=2).
The loop mode is owned by Program if:
• The current owner is Program (Sts_Prog=1) and the configuration is
set to follow the command source (Cfg_eKeepLM=0), or
• the owner is Operator/Program/External and the configuration keeps
the loop mode for Program (Cfg_eKeepLM=2).
The Ratio is owned by Program if:
• The current owner is Program (Sts_Prog=1) and the configuration is
set to follow the command source (Cfg_eKeepRatio=0), or
• the owner is Operator/Program/External and the configuration keeps
the Ratio for Program (Cfg_eKeepRatio=2).
The SP is owned by Program if:
• The current owner is Program (Sts_Prog=1) and the configuration is
set to follow the command source (Cfg_eKeepSP=0), or
• the owner is Operator/Program/External and the configuration keeps
the SP for Program (Cfg_eKeepSP=2).
Owned by External
The CV is owned by External if:
• The current owner is External (Sts_Ext=1) and the configuration is set
to follow the command source (Cfg_eKeepCV=0), or
• the owner is Operator/Program/External and the configuration keeps
the CV for External (Cfg_eKeepCV=3).
The Loop mode is owned by External if:
• The current owner is External (Sts_Ext=1) and the configuration is set
to follow the command source (Cfg_eKeepLM=0), or
• the owner is Operator/Program/External and the configuration keeps
the loop mode for External (Cfg_eKeepLM=3).
The Ratio is owned by External if:
• The current owner is External (Sts_Ext=1) and the configuration is set
to follow the command source (Cfg_eKeepRatio=0), or
• the owner is Operator/Program/External and the configuration keeps
the Ratio for External (Cfg_eKeepRatio=3).
The SP is owned by External if:
• The current owner is Program (Sts_Prog=1) and the configuration is
set to follow the command source (Cfg_eKeepSP=0), or
• the owner is Operator/Program/External and the configuration keeps
the SP for External (Cfg_eKeepSP=3).
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:
• SP clamping limits are invalid (Sts_ErrSPLim=1), or
• PV limits used in scaling are invalid (Sts_ErrPVEU=1, Max<=Min).
The failure occurs because SP is derived from PV if the loop mode is Ratio, or
ratio clamping limits are invalid when the loop mode is Ratio
(Sts_ErrRatioLim=1 & Cfg_HasRatio=1 & loop mode is Cascade).
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:
• Selected SP is clamped at high limit (Sts_SPHiClamped=1), or
• CV is clamped at high limit (Sts_CVHiClamped=1) if the PPID is
configured for reverse control action (Cfg_CtrlAction=0), or
• CV is clamped at low limit (Sts_CVLoClamped=1) if the PPID is
configured for direct control action (Cfg_CtrlAction=1).
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.
Inner loop is available for cascade control (Sts_CascAvailable=1) when in
Cascade mode, not in the first scan, and generally ready for control.
Inner loop is available for external control (Sts_ExtAvailable=1) when in
External 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.
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
Ladder Diagram
Structured Text
LI_30.Inp_PVData := LI_30_raw;
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;
LIC_31.Inp_CVIOFault := SZ_31.Sts_IOFault OR SZ_31.Sts_DeviceFault;
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.
To set up a pair of cascaded PPID instructions, set the Cfg_HasCasc input
parameter in the inner loop. This allows the inner loop to be placed into
Cascade/Ratio mode. Next, wire the Val_CVOut from the outer loop into the
Inp_CascSP parameter on the inner loop. The Inp_CascSP value is used as the
SP on the inner loop when the inner loop is placed into Cascade/Ratio mode.
The engineering unit range of the Val_CVOut on the outer loop should match
the engineering unit range of the PV on the inner loop. This lets the outer loop
scale its 0-100% value of CV into the matching engineering units used for the
setpoint on the inner loop.
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
output of the inner into the Inp_CVTrack input on the outer. This sets the
Val_CVOut value of the outer loop to track the SP of the inner loop when the
inner loop is not in Cascade/Ratio mode. This allows a bumpless transfer
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.
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 example is shown in FBD.
At CV=0 (Val_CVOut=0), both valves are closed. When the CV is positive, the
pressurizing valve is open and the vent valve is kept closed. If the PPID
instruction is configured with CV scaling limits Cfg_CVEUMax=100 and
Cfg_CVEUMin=-100, then at CV=100 the pressurizing valve is wide open.
When the CV is negative, the vent valve is open and the pressurizing valve is
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 1029
Structured Text Syntax on page 993
Function Block Faceplate Controls on page 1030
Data Conversions on page 1022
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_COMPENSATE tag Data structure required for proper operation of the instruction.
D
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.
Inp_DPAct REAL Actual (measured) differential pressure. Valid = any float.
Default is 0.0.
Inp_FAct REAL Actual (measured) uncompensated flow in volumetric 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.
The PPTC instruction:
• Takes as its primary input either a volumetric flow rate or a differential
pressure across a flow element, such as an orifice plate or pitot tube.
When a differential pressure is used, the PPTC instruction allows
configuration of the volumetric flow rate for a given differential
pressure.
• Accepts a temperature in common units (Fahrenheit or Celsius
degrees) or in absolute units (Rankine degrees or Kelvins).
• Accepts a pressure in common units (PSIG, kPa Gauge, or MPa Gauge)
or in absolute units (PSIA, kPa Absolute, MPa Absolute).
• Has user-configurable standard conditions, such as 14.696 PSIA and 60
°F, or 101.325 kPa and 0 °C.
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
Ladder Diagram
Structured Text
TI101.Inp_PVData:=I_TE101;
TI101.Inp_PVUncertain:=I_TE101_Flt;
PAI(TI101);
PI101.Inp_PVData:=I_PE101;
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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.
Equipment is confirmed Stopped
Inp_Stopped BOOL Default is false.
Equipment is Starting, indicating a start attempt
Inp_Starting BOOL Default is false.
Equipment is confirmed Running
Inp_Running BOOL Default is true.
Time within which three starts are allowed if cold (hr)
Cfg_ThreeColdStarts REAL Default is 0.0.
Time for cold motor to wait after 1st start failure before ready to start (hr)
Cfg_FirstFailCold REAL Default is 0.0.
Time for cold motor to wait after 2nd and subsequent start failure before ready (hr)
Cfg_SubseqFailCold REAL Default is 0.2.
Time for hot motor to wait after 1st start failure before ready to start (hr)
Cfg_FirstFailHot REAL Default is 0.0.
Time for hot motor to wait after 2nd and subsequent start failure before ready (hr)
Cfg_SubseqFailHot REAL Default is 0.2.
Time for hot motor to run so it can immediately restart after stop (hr)
Cfg_HotRestartOK REAL Default is 0.0.
Time for hot motor to wait after stop if stopped before Hot Restart OK time (hr)
Cfg_RestartHot REAL Default is 0.0.
Time for a stopped hot motor to become cold (hr)
Cfg_HotToCold REAL Default is 0.7.
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_InitializeReq BOOL Default is true.
Operation
The PRI instruction provides these capabilities:
• Provides a rule-based state model for restarts and is not intended to
model or monitor the motor heating.
• Display of the time before ready state; the time is displayed in minutes
and seconds and is configurable. The ready state is also displayed
independently of the time.
• Ready status is determent by the cold ready to start time (First start)
and the hot ready to start time.
• The cold ready to start time will be determent by the cold first fail time
and the cold subsequent fail time.
• The hot ready to start time will be determent by the hot first fail time,
the cold subsequent fail time and the hot restart delay time.
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.
Inp_Running is connected to the Motor Running status tag
(A100_MR_001.Sts_Running) that comes from the Sts_Running output of the
P_Motor instruction instance for this motor (A100_MR_001). Inp_Starting is
connected to the Motor Starting status tag (A100_MR_001.Sts_Starting) that
comes from the Sts_Starting output of the P_Motor instruction instance for
this motor (A100_MR_001). Inp_Stopped is connected to the Motor Stopped
status tag (A100_MR_001.Sts_Stopped) that comes from the Sts_Stopped
output of the P_Motor instruction instance for this motor (A100_MR_001).
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
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
Implementation
This illustration shows normal implementation with the input condition
mapped to Inp_Running and Inp_Starting on a separate branch.
This illustration shows the implementation with the input condition mapped
to the PRT instruction by 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 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.
Instruction first run 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.
Rung-condition-in is false EnableIn False is treated the same as Motor Stopped: Commands are still
processed, total run time is held (RTO), the Starts counter is prepared for the next
start (.CU clears on CTU with AFI), and the Current Run Time is cleared (TON
false).
Command Processing:
• This object has no Command Source and
• Commands are accepted regardless of Source. Commands should be
restricted to authorized personnel (typically at a maintenance level).
• PCmd_ClearTotHrs: Program Command to Clear Total Runtime Hours
• MCmd_ClearTotHrs: Maintenance Command to Clear Total Runtime Hours
• PCmd_ClearStarts: Program Command to Clear Count of Starts
• MCmd_ClearStarts: Maintenance Command to Clear Count of Starts
• PCmd_ClearMaxHrs: Program Command to Clear Maximum Single Run Hours
• MCmd_ClearMaxHrs: Maintenance Command to Clear Maximum Single Run
Hours
• The number of starts is directly reported as an integer Value.
• The current hours working register is cleared, but the Value is left in place for
display until the next run begins.
• The Total Running Time is reported as a REAL number of Hours. (This will
always be in completed tenths of an hour, like a mechanical hours counter.)
Rung-condition-in is true Set rung-condition-out to rung-condition-in.
The instruction executes.
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.
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.
Inp_Runnung is connected to the Motor Running status tag
(A100_MR_001.Sts_Running) that comes from the Sts_Running output of the
P_Motor instruction instance for this motor (A100_MR_001). Inp_Starting is
connected to the Motor Starting status tag (A100_MR_001.Sts_Starting) that
comes from the Sts_Starting output of the P_Motor instruction instance for
this motor (A100_MR_001).
Finally, A100_MR_001_RT.Val_TotRunHrs is the output tag that will indicate
the total running hours of A100_MR_001. There is also current running hours
(A100_MR_001_RT.Val_CurRunHrs) of the motor and maximum running
hours (A100_MR_001_RT.Val_MaxRunHrs) of the motor available.
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 1022
Index Through Arrays on page 1029
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:
• Free water at the bottom of the tank, given a product/water interface
level.
• Thermal expansion of the tank shell, given the coefficient of linear
expansion of the shell material and product and ambient
temperatures.
• A floating tank roof, given the product density is provided.
The Process Tank Strapping Table (PTST) instruction is a calculation function,
between blocks.
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 Control P_TANK_STRAPPING_TABLE tag Data structure required for proper operation of instruction.
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.
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.
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
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
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
The InOut tag Cfg_CalTbl of the PTST instruction is modified to point to the
new array MyP_StrapTbl_CalTable to provide the instruction with the
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 1022
Index Through Arrays on page 1029
Structured Text Syntax on page 993
Function Block Faceplate Controls on page 1030
Process Valve (PVLV) This information applies to the ControlLogix 5380P and 5580P controllers.
The Process Valve (PVLV) instruction operates a two-position, single-solenoid
operated valve, a dual-solenoid operated valve, or a motor-operated valve in
various modes, monitoring for fault conditions. It also monitors
hand-operated two-position valves. It is a built-in analogy of the existing
PlantPAx P_ValveSO, P_ValveMO, and P_ValveHO add-on instructions in the
Rockwell Automation Library of Process Objects.
The PVLV instruction:
• Allows ownership of the valve through the PCMDSRC instruction.
• Provides for configuration of the de-energized state of the valve: Fail
Position 2 (energize to Position 1), Fail Position 1 (energize to Position
2) or Fail Last Position.
• Allows a valve to be set to Position 2 or Position 1. If the valve is so
equipped, monitor Position 2/Position 1 limit switch feedback to verify
that the valve is Position 2 or Position 1. Whether the valve has each of
the feedback limit switches can be configured at the engineer level.
Whether to use each of the feedback limit switches can be configured
at the Maintenance level.
• Stops the motion of a Motor-operated Valve. Also provides a Stop
Output, which is typically used to break the valve motor seal-in circuit
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
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. 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.
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_Available BOOL Not Visible Not Required Output 1 = Valve available for control by automation
(Program).
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
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. 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.
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.
Sts_TransitStall Alm_TransitStall Raised when the valve has and is using both Position 2 and Position 1 position
feedback, an attempt is made to Position 2 or Position 1 the valve, and the position
feedback indicates that the valve moved off the original position but did not reach
the target position within the configured transit stall time.
Sts_TripFail Alm_TripFail Raised when the valve has and is using the optional trip feature, an attempt is made
to trip the valve, and the limit switch feedbacks show that the valve did not reach the
configured tripped position (Position 2 or Position 1) within the configured fail to trip
time.
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:
[email protected]
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:
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 outputs of the PVLV instruction hold at 0,
virtual feedback of a working device is provided and I/O faults are ignored.
Manipulate the instruction to operate as if a working valve is 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.
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;
MyPVLV.Inp_Pos2FdbkData:=MyPVLV_ZSO;
MyPVLV_Coil:=MyPVLV.Out_Pos2Data;
See also
Process Valve (PVLV) Command Source on page 706
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
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.
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.
The PVLVS instruction records these statistics:
• Amount of time in the current state (closed, opening, opened, closing,
stopped/other)
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.
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 1022
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.
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.
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.
Inp_ReadyData BOOL Not Visible Not Required Input 1 = Drive is ready to run.
Default is true.
Inp_RunningData BOOL Not Visible Not Required Input 1 = Drive is running (active).
Default is false.
Inp_CommandDirData BOOL Not Visible Not Required Input 1 = Drive is commanded forward, 0 = drive is
commanded reverse.
Default is true.
Inp_ActualDirData BOOL Not Visible Not Required Input 1 = Drive is running forward, 0 = drive is running
reverse.
Default is true.
Inp_AcceleratingData BOOL Not Visible Not Required Input 1 = Drive is accelerating.
Default is false.
Inp_DeceleratingData BOOL Not Visible Not Required Input 1 = Drive is decelerating.
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_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).
Out_DatalinkData REAL Not Visible Not Required Output Auxiliary signal (datalink) output in drive (raw) units.
Out_RunData BOOL Not Visible Not Required Output 1 = Start/Run Drive, 0 = Stop Drive (for held starter
type).
Out_StopData BOOL Not Visible Not Required Output 1 = Stop Drive, 0 = drive left in current state.
Out_StartData BOOL Not Visible Not Required Output 1 = Start Drive, 0 = drive left in current state.
Out_ClearFaultData BOOL Not Visible Not Required Output 1 = Attempt to clear Drive Fault.
Out_FwdData BOOL Not Visible Not Required Output 1 = Set drive direction to Forward.
Out_RevData BOOL Not Visible Not Required Output 1 = Set drive direction to Reverse.
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.
Val_SpeedRef REAL Visible Not Required Output Speed Reference (target) to drive.
Val_SpeedFdbk REAL Visible Not Required Output Speed Feedback (actual) from drive.
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.
Public InOut Members Data Type FBD Default FBD Wiring Usage Description
Visibility required
Ref_Ctrl_Set RAC_ITF_DVC_P Visible Required InOut Velocity Automation Device Object Settings Interface.
WRVELOCITY_S
ET
Ref_Ctrl_Cmd RAC_ITF_DVC_P Visible Required InOut Velocity Automation Device Object Command
WRVELOCITY_C Interface.
MD
Ref_Ctrl_Sts RAC_ITF_DVC_P Visible Required InOut Velocity Automation Device Object Status Interface.
WRVELOCITY_ST
S
BusObj BUS_OBJ Visible Required InOut Bus component.
Ref_FaultCodeList RAC_CODE_DES Visible Required InOut Fault Code to Fault Description lookup table for
CRIPTION[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
interface with the variable speed drive device. This structure handles
settings, such as the speed reference, sent to the drive.
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.
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.
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
shown, or may be NULL. If NULL, other pins on the instruction are used to
link the necessary data.
Members Data Type Description
eState DINT Enumerated state of the device object:
0 = Unused,
1 = Initializing,
2 = Disconnected,
3 = Disconnecting,
4 = Connecting,
5 = Idle,
6 = Configuring,
7 = Available.
FirstWarning RAC_ITF_EVENT First warning.
FirstFault RAC_ITF_EVENT First fault.
eCmdFail DINT Enumerated command failure code.
Speed REAL Actual Speed (Hz).
bSts INT Status (Bit Overlay):
Physical BOOL 1 = Operating as a physical device.
Virtual BOOL 1 = Operating as a virtual device.
Connected BOOL 1 = Connected and communicating.
Available BOOL 1 = Device is configured and can be operated.
Warning BOOL 1 = Device has a warning.
Faulted BOOL 1 = Device is faulted.
Ready BOOL 1 = Device is ready to be activated.
Active BOOL 1 = Device is active (power structure active, drive running).
ZeroSpeed BOOL 1 = Motor is at zero speed (not rotating).
ObjCtrl BOOL 0 = Object has control of this device, 1 = Object does not have control of this device (for
example, local HIM or I/O has control).
CmdDir BOOL Commanded direction: 1 = Reverse, 0 = Forward
ActDir BOOL Actual (rotation) direction: 1 = Reverse, 0 = Forward
Accelerating BOOL 1 = Motor is accelerating.
Decelerating BOOL 1 = Motor is decelerating.
AtSpeed BOOL 1 = Motor actual speed has reached speed reference.
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.
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
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.
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 Event timestamp (64-bit microseconds format).
EventTime_D DINT[7] Event timestamp (year, month, day, hour, minute, second, microsecond format).
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:
[email protected]
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.
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 752
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.
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.
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:
• Operator, through the HMI
• Program, through logic connected to the block
• External, through logic connected to the block
• Override, through logic connected to the block
• Maintenance, through the HMI
• Out of Service
• Hand (assumes the block has no control of the drive, so aligns with the
actual drive status in order to achieve bumpless transfer from Hand
back to one of the other command sources)
The PVSD instruction has four aspects, which can be kept by a particular
command source whenever the command source selection is Operator,
Program or External. Any or all of the aspects can be kept at any given time,
or can follow the selection of the PCMDSRC. The aspects are:
• The Speed Reference setting
• Start (forward and reverse) commands
• Jog (forward and reverse) commands
• The Output Datalink setting
The Jog commands cannot be kept by the Program command source.
The PVSD instruction supports virtualization. When selected to Virtual, the
instruction provides status to the operator and other blocks as if a working
drive were connected while keeping the outputs to the physical drive
de-energized (zero). When selected to Physical, the instruction monitors and
controls the physical variable speed drive device. Use Virtualization to provide
off-process functional testing of higher-level control strategies or simulation
for operator training.
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
HMIBC
See also
Filter Instructions on page 809
Logical and Move Instructions on page 887
Integrator (INTG) 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
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
Initialize BOOL Request to initialize control algorithm. Output
= InitialValue as long as Initialize is set.
Valid = any float
Default = 0.0
InitialValue REAL The initial value for instruction. Output =
InitialValue as long as Initialize is set.
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.
The INTG instruction executes this control algorithm when Initialize is
cleared and DeltaT > 0.
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.
This characteristic of the integrator - continually driving in a specific
direction while any input to the function is present or holding at any level
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 979
Common Attributes on page 1019
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
PI tag PROP_INT structure PI structure
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
ShapeKpMinus REAL The negative Kp shaping gain multiplier. Used when In is < 0. If invalid, the
instruction clamps ShapeKpMinus 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
KpInRange REAL The proportional gain shaping range. Defines the range of In (error) over which
the proportional gain increases or decreases as a function of the ratio of | In | /
KpInRange. When | In | > KpInRange, the instruction calculates the change in
proportional error using entered the Kp shaping gain x (In - KpInRange). If
invalid, the instruction clamps KpInRange at the limits and sets the appropriate
bit in Status. Not used when NonLinearMode is cleared.
Valid = any float > 0.0
Default = maximum positive float
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.
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 instruction calculates the value for Out using these equations:
Value Equation
Kp shaping gain multiplier
Kp input ratio
Kp ratio
Proportional output
Wld ratio
Integral output
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
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
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 1019
Structured Text Syntax on page 993
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 Relative mode, the instruction’s output is the differentiation of the input
from scan to scan, multiplied by the (Multiplier/100,000). In Relative mode,
the instruction saves any remainder after the divide operation in a scan and
adds it back in during the next scan. In this manner, position information is
not lost over the course of the operation.
In the Absolute mode, the instruction can scale an input, such as position,
without losing any information from one scan to the next.
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."
Secondly, while in this mode of operation, the PMUL instruction also
compensates for "rollover" values of binary data originating from a feedback
module. For example, a resolver feedback module may have 12 bits of
resolution, represented as a binary value, with sign, ranging from -2048 to
2047. In terms of raw data coming from the feedback module, the rotation of
the feedback device might be represented as shown below:
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.
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
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 1019
Structured Text Syntax on page 993
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.
You can configure the SCRV instruction to produce an S-Curve profile or a
Ramp profile for a step input.
S-Curve Profile
To produce an S-Curve profile, set JerkRate such that (JerkRate * DeltaT) <
AccelRate and/or DecelRate.
In S-Curve profile mode, the SCRV instruction ensures that the rate never
changes more than the specified JerkRate. The algorithm used to produce the
S-Curve profile is designed to produce a smooth, symmetric S-Curve for a step
input. A trapezoidal integration of Out is incorporated to facilitate this. As a
result, changes in Rate will be less than JerkRate during portions of the
profile.
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.
The following diagram illustrates how the instruction modifies Out.
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.
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 1019
Structured Text Syntax on page 993
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
WLead REAL Second order lead 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.
Out REAL The calculated output of the algorithm.
HighAlarm BOOL The maximum limit alarm indicator. Set when the
calculated value for Out HighLimit and the
output is clamped at HighLimit.
LowAlarm BOOL The minimum limit alarm indicator. Set when the
calculated value for Out LowLimit and the
output is clamped at LowLimit.
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
instruction is designed to execute in a task where the scan rate remains
constant.
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.
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.
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 SOC instruction is a specialized function block that is used in applications
where energy is transferred between two sections through a spring-mass
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:
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 979
Common Attributes on page 1019
Structured Text Syntax on page 993
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
InPlus REAL The input added to the accumulator.
Valid = any float
Default = 0.0
InMinus REAL The input subtracted from the
accumulator.
Valid = any float
Default = 0.0
Hold BOOL The hold input request for the
instruction. When Hold is set and
Initialize is cleared, Out is held.
Default is cleared.
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 1019
Structured Text Syntax on page 993
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.
Each Logix controller supports up to 256 HMIBC tags and up to 32 PanelView
5500 HMI's to simultaneously communicate and control the instruction.The
HMIBC instruction goes active and enables its output when a PanelView 5500
HMI device initiates a button control operation associated with the instance
tag of the instruction.
IMPORTANT A PanelView 5500 module is required to use the HMIBC instruction.
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.
Tag.EnableIn is true The instruction does not execute.
Instruction first scan N/A
Instruction first run N/A
Postscan N/A
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 1029
Filter
Available Instructions
Ladder Diagram
This instruction is not available in Ladder Diagram
See also
Drives Instructions on page 759
Logical and Move Instructions on page 887
Process Control Instructions on page 19
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
ByPass BOOL Request to bypass the algorithm. When
ByPass is true, the instruction sets Out = In.
Default is false.
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);
PI_01.In := Speed_Reference - Speed_feedback;
PI_01.Kp := Proportional_Gain;
PI_01.Wld := Integral_Gain;
PI(PI_01);
regulator_out := DERV_01.Out + PI_01.Out;
See also
Function Block Attributes on page 979
Common Attributes on page 1019
Structured Text Syntax on page 993
High Pass Filter (HPF) 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 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.
The HPF instruction uses these equations:
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
1st order filter
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 1019
Structured Text Syntax on page 993
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.
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.
The LPF instruction uses these equations:
When: The instruction uses this Laplace transfer function:
Order = 1
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.
Postscan See Postscan 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 979
Common Attributes on page 1019
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
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.
The NTCH instruction uses this equation:
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
Function Block
Structured Text
NTCH_01.In := frequency_input;
NTCH_01.WNotch := center_frequency;
NTCH_01.QFactor := Notch_width_depth;
NTCH(NTCH_01);
Notch_output := NTCH_01.Out;
See also
Common Attributes on page 1019
Structured Text Syntax on page 993
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
Order REAL Order of the filter. Selects the first or
second order filter algorithm. If invalid,
the instruction sets the appropriate bit
to true in Status and uses Order = 2.
Valid = 1 to 2
Default = 2
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
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.
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 979
Common Attributes on page 1019
Structured Text Syntax on page 993
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 809
Logical and Move Instructions on page 887
Process Control Instructions on page 19
Enhanced Select (ESEL) 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 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
In2Fault BOOL Bad health indicator for In2. If In2 is read from
an analog input, then In2Fault 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
In3Fault BOOL Bad health indicator for In3. If In3 is read from
an analog input, then In3Fault 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
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.
(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
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 979
Common Attributes on page 1019
Structured Text Syntax on page 993
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.
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
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 1019
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
Selector DINT The selector input to the instruction. This
input determines which of the inputs (1-8) is
moved into Out. If this value is invalid
(which includes 0), the instruction sets the
appropriate bit in Status and holds Out at
its current value.
Valid = 1 to 8
Default = 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
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.
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 1019
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
DecRate REAL Maximum output decrement rate in
per-second units. If invalid, the instruction
sets DecRate = 0.0 and sets the
appropriate bit in Status.
Valid = any float 0.0
Default = 0.0
ByPass BOOL Request to bypass the algorithm. When
true, Out = In.
Default is false.
Structured Text
Operand Type Format Description
RLIM tag RATE_LIMITER structure RLIM structure
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 1019
Structured Text Syntax on page 993
Select (SEL) 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 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.
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
SelectorIn BOOL The input that selects between In1
and In2.
Default is cleared.
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.
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 Out n-1 is set to 0.
Postscan N/A
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 1019
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
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 1019
Structured Text Syntax on page 993
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.
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 1019
Structured Text Syntax on page 993
Statistical Instructions
Statistical Instructions
The Statistical instructions include these instructions:
Available Instructions
Ladder Diagram
Not available
See also
Filter Instructions on page 809
Logical and Move Instructions on page 887
Drives Instructions on page 759
Select/Limit Instructions on page 837
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.
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
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
UseWeights BOOL Averaging scheme input to the instruction. When set, the
instruction uses the weighted method to calculate the
Out. When cleared, the instruction uses the uniform
method to calculate Out.
Default is cleared.
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
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
UseWeights BOOL Averaging scheme input to the instruction. When set, the
instruction uses the weighted method to calculate the
Out. When cleared, the instruction uses the uniform
method to calculate Out.
Default is cleared.
See Structured Text Syntax for more information on the syntax of expressions
within structured text.
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.
You can make runtime changes to the NumberOfSamples parameter. If you
increase the number, the instruction incrementally averages new data from
the current sample size to the new sample size. If you decrease the number,
the instruction recalculates the average from the beginning of the sample
array to the new NumberOfSamples value.
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.
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 979
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.
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 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 1019
Structured Text Syntax on page 993
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.
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;
result := MINCTag.Out;
See also
Common Attributes on page 1019
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
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 and
Average at their current values. 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 sets Out = 0.0 and Average = In,
except when InFault is set, in which case, the
instruction holds both Out and Average at their
current values. When Initialize transitions from
set to cleared, the instruction initializes the
standard deviation 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 and Average
value. When SampleEnable is cleared and
Initialize is cleared, the instruction holds Out and
Average at their current values.
Default is cleared.
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 the
instruction holds Out and Average at their
current values. When NumberOfSamples
becomes valid again, the instruction initializes
the standard deviation algorithm and continues
executing.
Valid = 1 to size of the storage array
Default = 1
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.
You can make runtime changes to the NumberOfSamples parameter. If you
increase the number, the instruction incrementally processes new data from
the current sample size to the new sample size. If you decrease the number,
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 1019
Structured Text Syntax on page 993
Available Instructions
Function Block
Not available
Structured Text
DFF JKFF RESD SETD
See also
Filter Instructions on page 809
Drives Instructions on page 759
Process Control Instructions on page 19
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.
The DFF instruction sets the Q output to the state of the D input on a cleared
to set transition of the Clock input. The QNot output is set to the opposite
state of the Q output.
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.
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
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).
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;
DFF_03.Clock := clock_input;
DFF(DFF_03);
q_output := DFF_03.Q;
qNot_output := DFF_03.QNot;
See also
Common Attributes on page 1019
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.
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.
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 1019
Structured Text Syntax on page 993
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.
Reset 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 Out bit is set to false. OutNot 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 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 1019
Structured Text Syntax on page 993
Set Dominant (SETD) This instruction applies to the CompactLogix 5370, ControlLogix 5570, and
ControlLogix 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.
Reset 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 Out bit is set to true. OutNot is cleared 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, 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 1019
Structured Text Syntax on page 993
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 that it PSC
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 of POVR
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 965
Attach to Equipment Phase This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
(PATT) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the PATT instruction to take ownership of an equipment phase to either:
• Prevent another program or FactoryTalk Batch software from
commanding an equipment phase.
• Make sure another program or FactoryTalk Batch software does not
already own an equipment phase.
The PATT instruction lets a program take ownership of an equipment phase.
• Ownership is optional. As long as an equipment phase has no owners,
any sequencer (program in the controller, FactoryTalk Batch software)
can command an equipment phase.
• FactoryTalk Batch software always takes ownership of an equipment
phase.
• Once a sequencer owns an equipment phase, no other sequencer can
command the equipment phase.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
• In a Structured Text routine, insert a condition for the instruction to
cause it to execute only on a transition.
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 Equipment phase to own.
phase
Result DINT immediate To let the instruction return a code
tag 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
Each PATT instruction tries to take ownership of an equipment phase.
If the Result of a PATT instruction = 0 or 24582 (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 Ownership = 3 (The program owns both equipment phases as shown
by bits 0 and 1), then
Done = 1. (This signals the sequence to go to the next step.)
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 901
Index Through Arrays on page 1029
Detach from Equipment This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Phase (PDET) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the PDET instruction to relinquish ownership of an equipment phase.
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.
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
If Step.6 = 1 (step 6 in the sequence) then
Each PDET instruction relinquishes ownership of the phases that the
sequence owned.
Each Ownership bit = 0. (In the Ownership tag, each equipment phase is
assigned a bit.)
Done = 1. (This signals the sequence to go to the next step.)
Structured Text
See also
Equipment Phase Instructions on page 901
Equipment Phase Clear This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Failure (PCLF) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, 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.
• Use only a PCLF instruction to clear the failure code of an equipment
phase.
• A CLR instruction, MOV instruction, or assignment (:=) does not change
the failure code of an equipment phase.
Make sure the equipment phase does not have other owners when using the
PCLF instruction. The PCLF instruction will not clear the failure code if Logix
Designer, HMI, FactoryTalk Batch software, or another program owns the
equipment phase.
• High priority HMI ownership is specific only to the CompactLogix
5370 and ControlLogix 5570 controllers.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
• In a Structured Text routine, insert a condition for the instruction to
cause it to execute only on a transition.
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.
Example
Ladder Diagram
If Drain_Tank_Restart = 1 (restart the Drain_Tank equipment phase) then
Clear the failure code of the Drain_Tank equipment phase
Change the state of the Drain_Tank equipment phase to restarting via
the restart command.
Drain_Tank_Restart = 0;
Structured Text
(*If Drain_Tank_Restart = on, then
Clear the failure code for the Drain_Tank equipment phase.
Restart the Drain_Tank equipment phase.
Turn off Drain_Tank_Restart.*)
If Drain_Tank_Restart Then
PCLF(Drain_Tank);
PCMD(Drain_Tank,Restart,0);
Drain_Tank_Restart := 0;
End_If;
See also
Equipment Phase Instructions on page 901
Equipment Phase Command This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
(PCMD) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
The PCMD instruction transitions an equipment phase to the next state or
sub-state.
Use the PCMD instruction to change the state or sub-state of an equipment
phase.
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.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
• In a Structured Text routine, insert a condition for the instruction to
cause it to execute only on a transition.
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.
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 different
equipment phase 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 its
tag 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 901
Equipment Phase External This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Request (PXRQ) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the PXRQ instruction to initiate communication with FactoryTalk® Batch
software.
IMPORTANT When the PXRQ instruction is used in an Equipment Sequence, only the Download All (1000)
request and the Upload All (2000) request are supported. All other PXRQ instruction requests
are ignored.
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 value Type of request.
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 901
Index Through Arrays on page 1029
Equipment Phase Failure This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
(PFL) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the PFL instruction as an optional method to signal a failure for an
equipment phase.
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 phase.
tag 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.
Prioritize failure The PFL instruction sets the failure code only to a value greater than its current value.
codes. • For example, if a PFL instruction sets the failure code = 102, another PFL instruction can only set
the failure code > 102.
• Make sure to assign higher values to exceptions that require higher priority in their handling.
Otherwise, a lower priority exception may overwrite a more critical exception.
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 a CLR
failure code, use or MOV will not change the failure code.
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.
Example
Ladder Diagram
In the prestate routine of an equipment phase...
If the Drain_Valve.FaultAlarm = 1 (The valve did not go to the commander
state.) then
Structured Text
In the prestate routine of an equipment phase...
See also
Equipment Phase Instructions on page 901
Index Through Arrays on page 1029
Equipment Phase New This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Parameters (PRNP) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the PRNP instruction to clear the NewInputParameters bit of an
equipment phase.
The PRNP instruction clears the NewInputParameters bit of the equipment
phase.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
• In a Structured Text routine, insert a condition for the instruction to
cause it to execute only on a transition.
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.
EnableIn is false No action taken.
EnableIn is true The instruction executes.
Example
Ladder Diagram
Structured Text
See also
Equipment Phase Instructions on page 901
Index Through Arrays on page 1029
Equipment Phase Override This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Command (POVR) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the POVR instruction to give a Hold, Stop, or Abort command to an
equipment phase, regardless of ownership.
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 code
tag 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 901
Index Through Arrays on page 1029
Equipment Phase Paused This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
(PPD) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the PPD instruction to set up breakpoints within the logic of an
equipment phase.
Pausing an equipment phase requires configuring break points by coding a
PPD instruction in a phase's state routine logic. The phase state routine
pauses when the PPD instruction executes and the phase receives a command
to pause at its next opportunity.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
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 Phase 4 91
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 901
Index Through Arrays on page 1029
Phase State Complete (PSC) This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, 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.
The PSC instruction signals the completion of a phase state routine.
In the running state routine, use the PSC instruction to transition the
equipment phase to the complete state.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
• In a Structured Text routine, insert a condition for the instruction to
cause it to execute only on a transition.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
PSC( );
Operands
Ladder Diagram
None
Structured Text
None
Enter the parentheses ( ) after the instruction mnemonic, even though there
are no operands.
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
And PSCTest.Running Then
PSC();
End_if;
See also
Equipment Phase Instructions on page 901
Index Through Arrays on page 1029
Equipment Phase Override Command (POVR) on page 935
Equipment Sequence
See also
Equipment Sequence Diagram instructions on page 965
SATT on page 949, SDET on page 953
SCMD on page 961, SCLF on page 958
SOVR on page 965, SASI on page 955
Attach to Equipment This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Sequence (SATT) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the Attach to Equipment Sequence (SATT) instruction to take ownership
of an Equipment Sequence. An Equipment Sequence may be commanded by a
program if the program either owns the Equipment Sequence or the
Equipment Sequence has no owners. A tag must be assigned to store the
result code of an SATT instruction.
Available Languages
Ladder Diagram
Structured Text:
SATT(Sequence Name, Result)
Operands
Ladder Diagram
Operand Data Type Format Description
Sequence Name SEQUENCE name of the Equipment Sequence that you want to change to own (attach)
Equipment Sequence to command.
Result DINT Tag For the instruction to return a success or failure code, enter a
DINT tag where the result code is to be stored. Otherwise, enter
0.
Structured Text
The operands are the same as for the Ladder Diagram.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays[1] for operand
related faults.
Execution
At instruction execution, the SATT instruction attempts to take ownership of
the Equipment Sequence.
Ladder Diagram
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true • The instruction executes
• The rung-condition-out is set to true
Postscan No action taken
Structured Text
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes
Postscan No action taken
Example
Structured Text
if (AttachControl) then
SATT(Make_Product_101, Result);
end_if
See also
Guidelines for SATT instructions on page 969
Detach from Equipment This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Sequence (SDET) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the Detach from Equipment Sequence (SDET) instruction to relinquish
ownership of an Equipment Sequence. After a program executes an 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.
This is a transitional instruction. Follow these steps when using it:
• In ladder logic, insert an instruction to toggle the rung-condition-in
from false to true each time the instruction should execute.
• In a Structured Text routine, insert a condition for the instruction to
cause it to execute only on a transition.
Available Languages
Ladder diagram
Structured text
SDET(Sequence Name)
Operands
Ladder Diagram
Operand Data Type Format Description
Sequence Name SEQUENCE Name of the Equipment Sequence for which which to detach.
Equipment Sequence
Structured Text
The operands are the same as for the Ladder Diagram.
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 No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes
Scan of structured text The instruction tries to relinquish ownership of the specified Equipment
Sequence
Structured Text
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true No instruction executes
Instruction execution The instruction tries to relinquish ownership of the specified Equipment
Sequence
Postscan No action taken
Example
Ladder Diagram
Structured Text
if (DetachControl) then
SDET(Make_Product_101);
end_if
See also
SDET instruction examples on page 976
Equipment Sequence Instructions on page 949
Equipment Sequence Assign This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Sequence Identifier (SASI) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
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
following prerequisites are met:
• The controller is online.
• The Equipment Sequence is in the IDLE state.
Available Languages
Ladder Diagram
Structured Text
SASI(Sequence Name, Sequence Id, Result)
Operands
Ladder Diagram
Operand Data Type Format Description
Sequence Name SEQUENCE name of the Equipment Sequence to which you want to assign an identifier.
Equipment
Sequence
Structured Text
The operands are the same as for the Ladder Diagram.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays[1] for operand
related faults.
Execution
At instruction execution, the SASI instruction attempts to assign a string
identifier to the specified Equipment Sequence.
Ladder Diagram
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes
Postscan No action taken
Structured Text
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Example
Ladder Diagram
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
Structured Text
if (SasiControl) then
SASI(Make_Product_101, IdString, Result);
end_if
See also
SASI instruction examples on page 973
Equipment Sequence Instructions on page 949
Equipment Sequence Clear This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Failure (SCLF) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the Equipment Sequence Clear Failure (SCLF) instruction to clear the
failure code of an Equipment Sequence. Keep the following in mind when
using the SCLF instruction:
• The Equipment Sequence cannot have other owners when you use the
SCLF instruction. The SCLF instruction does not clear the failure code
if the Logix Designer application, FactoryTalk Batch software, or
another program owns the Equipment Sequence.
• An Equipment Sequence refuses a RESUME command until it is
cleared of failures.
This is a transitional instruction. Follow these steps when using it:
Available Languages
Ladder diagram
Structured text
SCLF(Sequence Name, Result)
Operands
Ladder Diagram
Operand Data Type Format Description
Sequence Name SEQUENCE name of the Equipment Sequence to clear failure code.
Equipment Sequence
Result DINT Tag For an instruction to return a success or failure code, enter a
DINT tag where the result code is to be stored. Otherwise, enter
0.
Structured Text
The operands are the same as for the Ladder Diagram.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays[1] for operand
related faults.
Execution
At instruction execution, the SCLF instruction attempts to clear the failure
code of the specified Equipment Sequence.
Ladder Diagram
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes
Postscan No action taken
Structured Text
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes
Postscan No action taken
Example
Ladder Diagram
Structured Text
if (CommandControl) then
SCLF(Make_Product_101, Result);
end_if
See also
Result codes for SCLF instructions on page 971
SDET instruction examples on page 976
Equipment Sequence Instructions on page 949
Equipment Sequence This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
command (SCMD) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the Equipment Sequence command (SCMD) instruction to change the
state of an Equipment Sequence. The SCMD instruction can send the
following commands to an Equipment Sequence: START, RESTART, HOLD,
STOP, ABORT, RESET, PAUSE, RESUME, and AUTOPAUSE. The calling
program must either be attached as owner to the Equipment Sequence or
there is no owner of the Equipment Sequence before the SCMD instruction
can run. Use the SATT instruction to attach to an Equipment Sequence. In
addition, the Equipment Sequence must be in the correct state (see chart
below) for the command to execute successfully.
Like the SCMD instruction, the Equipment Sequence Override instruction
(SOVR) also changes the state of an Equipment Sequence, but it changes the
state regardless of ownership. If the SCMD instruction must execute
regardless of ownership, use an SOVR instruction instead of an SCMD
instruction.
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
SCMD(Sequence Name, Sequence Command, Result)
Operands
Ladder Diagram
Operand Data Type Format Description
Sequence Name SEQUENCE Name of the Equipment Equipment Sequence to perform the command.
Sequence
Command Command Enum Enumeration of the command Command to send to the Equipment Sequence. Send one of
these commands: START, RESTART, HOLD, STOP, ABORT,
RESET, PAUSE, RESUME, or AUTOPAUSE.
Result DINT Tag For an instruction to return a success or failure code, enter
a DINT tag where the result code is stored. Otherwise, enter
0.
Structured Text
The operands are the same as for the Ladder Diagram.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for operand
related faults.
Execution
At instruction execution, the SCMD instruction commands the specified
Equipment Sequence.
Ladder Diagram
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes.
Postscan No action taken
Structured Text
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes.
Postscan No action taken
Example
Ladder Diagram
Structured Text
if (CommandControl) then
SCMD(Make_Product_101, Start, Result);
end_if
See also
SCMD instruction examples on page 975
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 949
Equipment Sequence This instruction applies to the Compact GuardLogix 5370 and Compact
GuardLogix 5380, CompactLogix 5370, CompactLogix 5380, and
Override (SOVR) CompactLogix 5480, ControlLogix 5570 and ControlLogix 5580, and
GuardLogix 5570 and GuardLogix 5580 controllers.
Use the Equipment Sequence Override (SOVR) instruction to send a HOLD,
STOP, or ABORT command to an Equipment Sequence, regardless of
ownership.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
SOVR(SequenceName, Sequence Command, Result)
Operands
Ladder Diagram
Operand Data Type Format Description
Sequence Name SEQUENCE Name of the Equipment Equipment Sequence to perform the command.
Sequence
Command Command Enum Name of the command Command to send to the Equipment Sequence. Send one of
these commands: HOLD, STOP, or ABORT
Result DINT Tag For an instruction to return a success or failure code, enter
a DINT tag whhere the result code is to be stored.
Otherwise, enter 0.
Structured Text
The operands are the same as the Ladder Diagram.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays[1] for operand
related faults.
Execution
At instruction execution, the SOVR instruction attempts to command the
specified Equipment Sequence.
Ladder Diagram
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes.
Postscan No action taken
Structured Text
Condition Action Taken
Prescan No action taken
Rung-condition-in is false No action taken
Rung-condition-in is true The instruction executes
Postscan No action taken
Example
Ladder Diagram
Structured Text
if (OverrideControl) then
SOVR(Make_Product_101, Abort, Result);
end_if
See also
Guidelines for SOVR instructions on page 970
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 be
program to command it. 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 ownership. To relinquish ownership, use a Detach from Equipment
Sequence (SDET) instruction.
Avoid making unnecessary command requests if the Unnecessary command requests can flood the event processing
equipment sequence is generating sequence events. buffers and cause you to miss significant events.
Use the Result code to verify ownership, and include Use the Result operand to get a code that shows the success or
steps that should take place if the attachment fails failure of the SATT instruction.
because the Equipment Sequence is owned by On each execution, the SATT instruction tries to take ownership
another program or by the operator. of the Equipment Sequence. When a program or 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 949
Result codes for SATT instructions on page 970
Equipment Sequence Instructions on page 949
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 to a Limit the execution of the SCMD instruction to a single scan. Each command applies to only a
single scan. 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 owned Both Equipment Sequences and Equipment Phases must be owned to be commanded. The
by the program to command it. 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 961
Equipment Sequence Instructions on page 949
When should I use an SOVR instruction instead of an SCMD
instruction? on page 977
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 an
owners. 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 to a Limit the execution of the SOVR instruction to a single scan. Each command applies to only a
single scan. 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 you to
requests if the Equipment Sequence is miss significant events.
generating sequence events.
See also
Equipment Sequence Override command on page 965
Result codes for SOVR instructions on page 973
When should I use an SOVR instruction instead of an SCMD
instruction? on page 977
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.
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.
• If ownership conflicts or other errors are not likely, enter 0 in the
Result operand.
• If ownership conflicts or other errors are likely, enter a DINT tag in the
Result operand. The DINT tag stores a code for the result of the
execution of the instruction.
See also
Attach to Equipment Sequence on page 949
Equipment Sequence Instructions on page 949
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.
• If ownership conflicts or other errors are not likely, enter 0 in the
Result operand.
• If ownership conflicts or other errors are likely, enter a DINT tag in the
Result operand. The DINT tag stores a code for the result of the
execution of the instruction.
See also
Equipment Sequence Clear Failure on page 958
Equipment Sequence Instructions on page 949
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.
• If ownership conflicts or other errors are not likely, enter 0 in the
Result operand.
• If ownership conflicts or other errors are likely, enter a DINT tag in the
Result operand. The DINT tag stores a code for the result of the
execution of the instruction.
See also
Equipment Sequence command on page 961
Equipment Sequence Instructions on page 949
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.
• If ownership conflicts or other errors are not likely, enter 0 in the
Result operand.
• If ownership conflicts or other errors are likely, enter a DINT tag in the
Result operand. The DINT tag stores a code for the result of the
execution of the instruction.
See also
Equipment Sequence Override command on page 965
Equipment Sequence Instructions on page 949
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 955
Equipment Sequence Instructions on page 949
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
SATT (Make_Product_101, Result);
end_if;
See also
Attach to Equipment Sequence on page 949
Guidelines for SATT instructions on page 969
SCLF instruction examples The following examples show the SCLF instruction as it appears in a ladder
diagram and in structured text.
See also
Equipment Sequence Clear Failure on page 958
Equipment Sequence Instructions on page 949
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
SCMD (Make_Product_101), Hold, Result);
end_if;
See also
Equipment Sequence command on page 961
Guidelines for SCMD instructions on page 969
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 953
Attach to Equipment Sequence on page 949
Equipment Sequence instructions on page 949
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);
end_if;
See also
Equipment Sequence command on page 961
Guidelines for SCMD instructions on page 969
Equipment Sequence Instructions on page 949
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 961
Equipment Sequence Override command on page 965
Guidelines for SCMD instructions on page 969
Equipment Sequence Instructions on page 949
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 979
Latching Data on page 980
Order of Execution on page 982
Function Block Responses to Overflow Conditions on page 981
Timing Modes on page 985
Program/Operator Control on page 988
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)
Perform an operation on an input value or values and produce an output Function block
value or values.
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:
• verify a function block routine
• verify a project that contains a function block routine
• download a project that contains a function block routine
You define execution order by wiring function blocks together and indicating
the data flow of any feedback wires, if necessary.
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:
1. The controller latches all data values in IREFs.
2. The controller executes the other function blocks in the order
determined by how they are wired.
3. The controller writes outputs in OREFs.
Timing Modes
These process control and drives instructions support different timing modes.
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 (Status.30) BOOL Invalid RTSTimeStamp value.
Program/Operator Control
The following instructions support the concept of Program/Operator control.
• Enhanced Select (ESEL)
• Totalizer (TOT)
• Enhanced PID (PIDE)
• Ramp/Soak (RMPS)
• Discrete 2-State Device (D2SD)
• Discrete 3-State Device (D3SD)
Likewise, constantly setting the ProgProgReq can ‘lock’ the instruction into
Program control. This is useful for automatic startup sequences when you
want the program to control the action of the instruction without worrying
about an operator inadvertently taking control of the instruction.
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.
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.
• Structured text is not case sensitive.
• Use tabs and carriage returns (separate lines) to make your structured
text easier to read. They have no effect on the execution of the
structured text.
Structured text is not case sensitive. Structured text can contain these
components.
Term Definition Examples
Assignment Use an assignment statement to assign values to tags. The := operator is the tag := expression;
assignment operator.
Terminate the assignment with a semi colon ‘;.’
Expression An expression is part of a complete assignment or construct statement. An expression
evaluates to a number (numerical expression), a String (string expression), or to a true or
false state (BOOL expression)
Tag Expression A named area of the memory where data is stored (BOOL, SINT, INT, DINT, REAL, String). value1
Immediate A constant value 4
Expression
See also
Structured Text Components: Assignments on page 995
Structured Text Components: Expressions on page 997
Structured Text Components: Instructions on page 1002
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.
For example:
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 literal
(CompactLogix 5380, CompactLogix (CompactLogix 5380, CompactLogix 5480,
5480, ControlLogix 5580, Compact ControlLogix 5580, Compact GuardLogix 5380, and
GuardLogix 5380, and GuardLogix 5580 GuardLogix 5580 controllers only).
controllers only).
; Ends the assignment
The tag retains the assigned value until another assignment changes the
value.
The expression can be simple, such as an immediate value or another tag
name, or the expression can be complex and include several operators and
functions, or both. Refer to Expressions for more information.
See also
Assign an ASCII character to a string data member on page 997
Specify a non-retentive assignment on page 996
Structured Text Components: Expressions on page 997
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:
• Enters the Run mode
• Leaves the step of an SFC if you configure the SFC for Automatic reset.
This applies only if you embed the assignment in the action of the step
or use the action to call a structured text routine by using a JSR
instruction.
A non-retentive assignment has this syntax:
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 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
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
5580 controllers only). 5380, and GuardLogix 5580 controllers(
only)
See also
Assign an ASCII character to a string data member on page 997
Structured Text Components: Assignments on page 995
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 997
Character string literals on page 1004
See also
Use arithmetic operators and functions on page 998
Use relational operators on page 1001
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 specification overtravel_POS := ABS(overtravel);
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 are position := adjustment + ABS((sensor1 +
REAL tags and your specification says: ‘Find the absolute value of the sensor2)/2);
average of sensor1 and sensor2, add the adjustment, and store the
result in position.’
See also
Structured Text Components: Expressions on page 997
Use bitwise operators Bitwise operators manipulate the bits within a value based on two values.
The following provides an overview of the bitwise operators.
For Use this operator Optimal data type
bitwise AND &, AND DINT
bitwise OR OR DINT
bitwise exclusive OR XOR DINT
bitwise complement NOT DINT
See also
Structured Text Components: Expressions on page 997
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
See also
Structured Text Components: Expressions on page 997
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
See also
Structured Text Components: Expressions on page 997
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.
For example, the ABL instruction is a transitional instruction in ladder
diagram. In this example, the ABL instruction only executes on a scan when
tag_xic transitions from cleared to set. The ABL instruction does not execute
when tag_xic stays set or when tag_xic clears.
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
See also
IF_THEN on page 1010
Publication 1756-RM006M-EN-P - March 2022 1003
Chapter 11 Structured Text Programming
CASE_OF on page 1005
FOR_DO on page 1007
WHILE_DO on page 1015
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.
Tip: 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.
1d String of length one or character CHAR containing the “single quote” '$''
character
1e String of length one or character CHAR containing the “double quote” '"'
character
1f Support of two character combinations '$R$L'
1g Support of a character representation with ‘$’ and two hexadecimal '$0A'
characters
Tip: The newline character provides an implementation-independent means of defining the end of a line of
data for both physical and file I/O; for printing, the effect is that of ending a line of data and resuming
printing at the beginning of the next line.
The $' combination is only valid inside single quoted string literals.
See also
Structured Text Components: Assignments on page 995
String Types Store ASCII characters in tags that use a string type data type to:
• Use the default STRING data type, which stores up to 82 characters
• Create a new string type that stores less or more characters
To create a new string type, refer to the Logix 5000 Controllers ASCII Strings
Programming Manual publication 1756-PM013.
See also
Character string literals on page 1004
Operands
CASE numeric_expression OF
selector1: statement;
selectorN: statement; ELSE
Structured Text
Operand Type Format Enter
Numeric_ SINT INT DINT REAL Tag expression Tag or expression that evaluates to a
expression number
(numeric expression)
Selector SINT INT DINT REAL Immediate Same type as numeric_expression
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:
Enters the RUN mode.
Leaves the step of an SFC if configuring the SFC for Automatic reset. This
applies only embedding the assignment in the action of the step or using the
action to call a structured text routine via a JSR instruction.
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
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 determines
Immediate 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 diagram 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 about an SIZE(Inventory,0,Inventory_Items);
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;
An array of the above structure contains an element for each different item in
your inventory. You want to search the array for a specific product (use its bar Exit;
End_if;
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.
The table summarizes different combinations of IF, THEN, ELSIF, and ELSE.
If And Use this construct
Doing something if or when conditions are true Do nothing if conditions are false IF_THEN
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 false IF_THEN_ELSIF_ELSE
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 :
Enters the RUN mode.
Leaves the step of an SFC if you configure the SFC for Automatic reset. (This
applies only if you embed the assignment in the action of the step or use the
action to call a structured text routine via a JSR instruction.)
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 high IF Sugar.Low & Sugar.High THEN
(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;
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 then pos := -1;
determines if the conditions are true before executing the statements again. REPEAT
This differs from the WHILE_DO loop because the WHILE_DO The WHILE_DO loop pos := pos + 2;
evaluates its conditions first.
UNTIL ((pos = 101) OR (structarray[pos].value = targetvalue))
If the conditions are true, the controller then executes the statements within the
end_repeat;
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, each element_number := 0;
element holds one character.) Stop when you reach the carriage return. SIZE(SINT_array, 0, SINT_array_size);
Initialize Element_number to 0. Repeat
Count the number of elements in SINT_array (array that contains the ASCII String_tag.DATA[element_number] := SINT_array[element_number];
characters) and store the result in SINT_array_size (DINT tag).
element_number := element_number + 1;
Set String_tag[element_number] = the character at
String_tag.LEN := element_number;
SINT_array[element_number].
Add 1 to element_number. This lets the controller check the next character in If element_number = SINT_array_size then
SINT_array. exit;
Set the Length member of String_tag = element_number. (This records the end_if;
number of characters in String_tag so far.) Until SINT_array[element_number] = 13
If element_number = SINT_array_size, then stop. (You are at the end of the end_repeat;
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 true, the pos := 0;
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 conditions
are true before executing the statements again. The statements in a String_tag.DATA[pos] := SINT_array[pos];
REPEAT_UNTIL loop are always executed at least once. The statements in a end_while;
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, each element_number := 0;
element holds one character.) Stop when you reach the carriage return. SIZE(SINT_array, 0, SINT_array_size);
Initialize Element_number to 0. While SINT_array[element_number] <> 13 do
Count the number of elements in SINT_array (array that contains the ASCII String_tag.DATA[element_number] := SINT_array[element_number];
characters) and store the result in SINT_array_size (DINT tag).
element_number := element_number + 1;
If the character at SINT_array[element_number] = 13 (decimal value of the
String_tag.LEN := element_number;
carriage return), then stop.
Set String_tag[element_number] = the character at If element_number = SINT_array_size then
SINT_array[element_number]. exit;
Add 1 to element_number. This lets the controller check the next character in end_if;
SINT_array. end_while;
Set the Length member of String_tag = element_number. (This records 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.)
See also
Structured Text Components: Assignments on page 995
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 1019
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 ladder
CompactLogix 5480, 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 types,
ControlLogix 5570, Compact but are not tags, and flag aliases are not applicable.
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 goes to • The first time a program is scanned after the controller goes to Run
Run mode 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 that owns
• When a routine is called from an SFC Action and the step that that Action is first scanned.
owns that Action is first scanned. Use this flag to initialize data for use in later scans. It is also referred to as
Use the first scan flag to initialize data for use in later scans. It is the first pass bit.
also referred to as the first pass bit.
S:N The controller sets the negative flag when the result of a math or The controller sets the negative flag when the result of a math or logical
Negative flag logical operation is a negative value. Use this flag as a quick test for operation is a negative value. Use this flag as a quick test for a negative
a negative value. 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 or The controller sets the zero flag when the result of a math or logical
Zero flag logical operation is zero. Use this flag as a quick test for a zero operation is zero. Use this flag as a quick test for a zero value.
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 the For example, adding 1 to a SINT generates an overflow when the value
value goes from 127 through -128. 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 INT For example, if you try to store the value 123456 to a SINT or INT tag.
tag.
Use the overflow flag to verify the result of an operation is still in Use the overflow flag to check that the result of an operation is still in
range. range.
If the data being stored is a string type, S:V is set if the string is too A minor fault is generated anytime an overflow flag is set.
large to fit into the destination tag. 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 operation
Carry flag operation resulted in the generation of a carry out of the most 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.
S:MINOR The controller sets the minor fault flag when there is at least one The controller sets the minor fault flag when there is at least one minor
Minor fault flag minor program fault. program fault.
Use the minor fault tag to test if a minor fault occurred. This bit only Use the minor fault flag to test if a minor fault occurred and take
triggers by programming faults, such as overflow. It is not triggered appropriate action. This bit is triggered only by programming faults, such
by a battery fault. The bit clears at the beginning of every scan. as overflow. It is not triggered by a battery fault. The bit clears at the
Tip: If applicable, explicitly set S:MINOR with an OTE or OTL beginning of every scan.
instruction. Tip: If applicable, explicitly set S:MINOR with an OTE or OTL instruction.
CompactLogix 5380, Expressions do not set status flags based on the results of math operations. If expressions overflow:
CompactLogix 5480, • A minor fault generates if the controller is configured to generate minor faults.
ControlLogix 5580, • A major fault (type 4, code 20) generates because the resulting value is out of range.
Compact GuardLogix
5380, and
GuardLogix 5580
controllers
CompactLogix 5370, Expressions set status flags based on the results of math operations. If an array subscript is an expression, the expression and the instruction
ControlLogix 5570, could generate minor faults.
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:
• The same data type.
• An intermediate data type:
• All function block instructions support one data type operand only.
• If mixing data types or use tags that are not the optimal data type,
the controller converts the data according to these rules:
• Operands are converted according to the ranking of data types
from SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT,
REAL, and LREAL with ranking from 1 (the lowest) to 10 (the
highest).
Tip: To reduce the time and memory for converting data, use the same data type for all
the operands of an instruction.
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 by 2#1111_1111_1111_1111_1111_1111_1111_1111 (-1)
sign-extension
Converts to this value by 2#0000_0000_0000_0000_1111_1111_1111_1111 (65535)
zero-fill
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
REAL 4-byte floating-point number -3.4028235E38 to -1.1754944E-38
(negative values)
and
0.0
and
1.1754944E-38 to 3.4028235E38
(positive values)
LREAL 8-byte floating-point number -1.7976931348623157E308 to
-2.2250738585072014E-308
(negative values)
and
0.0
and
2.2250738585072014E-308 to
1.7976931348623157E308
(positive values)
See also
Math Status Flags on page 1019
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.
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.
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.
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:
Definition Example Description
Variable0 variable0.42 This example references the bit 42 of variable0.
defined as LINT
has 64 bits
variable1 variable1.2 This example references the bit 2 of variable1.
defined as DINT
has 32 bits
variable2 variable2.15 This example references the bit 15 of variable2.
defined as INT
has 16 bits
variable3 variable3.[4] This example references bit 4 of variable3.
defined as SINT
holds 8 bits
variable4 variable4.DN This example references the DN bit of variable4.
defined as COUNTER structure
has 5 status bits
MyVariable defined as BOOL[100] MyVariable[(MyIndex AND NOT 7) / 8].[MyIndex This example references a bit within a BOOL array.
MyIndex defined as SINT AND 7]
MyArray defined as BOOL[20] MyArray[3] This example references the bit 3 of MyArray.
See also
Index Through Arrays on page 1029
See also
Faceplate Control Properties Dialog - General Tab on page 1031
Faceplate Control Properties Dialog - Display Tab on page 1032
Faceplate Control Properties Dialog - Font Tab on page 1033
Faceplate Control Properties Dialog - LocaleTab on page 1035
Faceplate Control Use this tab to define/modify how the control operates.
Parameters
Communication
Select RSLinx Classic OPC Server or FactoryTalk Linx. If you select RSLinx
Classic OPC Server, you must also specify:
• whether to launch remotely
• the access path to the remote machine
If you select FactoryTalk Linx FactoryTalk, you must also specify the
FactoryTalk Area
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 1032
Faceplate Control Properties Dialog - Font Tab on page 1033
Faceplate Control Use this tab to define how the faceplate control will appear on your screen.
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 1031
Faceplate Control Properties Dialog - Font Tab on page 1033
Faceplate Control Properties Dialog - LocaleTab on page 1035
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 1031
Faceplate Control Properties Dialog - Display Tab on page 1032
Faceplate Control Properties Dialog - LocaleTab on page 1035
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 1031
Faceplate Control Properties Dialog - Display Tab on page 1032
R
ramp/soak (RMPS) 102
reset dominant (RESD) 893
Result Codes for Equipment Sequence
Instructions 970, 971, 972, 973
RLIM 852
S
scale (SCL) 116
S-Curve (SCRV) 783
second-order controller (SOC) 791
SEL 856
selected negate (SNEG) 859
selected summer (SSUM) 862
set dominant (SETD) 896
SOC 791
SRTP 120
T
totalizer (TOT) 127
U
UPDN 800
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 find rok.auto/pcdc
(PCDC) 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