Allen-Bradley LOGIX 5000 Reference Manual
Allen-Bradley LOGIX 5000 Reference Manual

Allen-Bradley LOGIX 5000 Reference Manual

Controllers advanced process control and drives and equipment phase and sequence instructions
Hide thumbs Also See for LOGIX 5000:
Table of Contents

Advertisement

Reference Manual
Logix 5000 Advanced Process Control and Drives and
Equipment Phase and Sequence Instructions
1756 ControlLogix, 1756 GuardLogix, 1769 CompactLogix, 1769 Compact GuardLogix, 1789
SoftLogix, 5069 CompactLogix, Emulate 5570

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LOGIX 5000 and is the answer not in the manual?

Questions and answers

Summary of Contents for Allen-Bradley LOGIX 5000

  • Page 1 Reference Manual Logix 5000 Advanced Process Control and Drives and Equipment Phase and Sequence Instructions 1756 ControlLogix, 1756 GuardLogix, 1769 CompactLogix, 1769 Compact GuardLogix, 1789 SoftLogix, 5069 CompactLogix, Emulate 5570...
  • Page 2 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). Allen-Bradley, Rockwell Software, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc. Trademarks not belonging to Rockwell Automation are property of their respective companies.
  • Page 3 Summary of changes This manual includes new and updated information. Use these reference tables to locate changed information. Global changes None for this release. New or enhanced features Subject Reason Common Attributes page 537 Added link to the Elementary Data Types topic Immediate values page 540 Added Integer Immediate Values and Floating Point...
  • Page 5 Instruction Locator Use this locator to find the applicable Logix5000 controllers instruction manual for each instruction. Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Absolute Value (ABS)
  • Page 6 Instruction Locator Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Convert to BCD (TOD) Lead-Lag (LDLG) Motion Direct Drive Off (MDF) Convert to Integer (FRD) Low Pass Filter (LPF) Motion Direct Drive On (MDO)
  • Page 7 Instruction Locator Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Less Than or Equal to (LEQ) LIFO Load (LFL) LIFO Unload (LFU) License Validation (LV) Limit (LIM)
  • Page 8 Instruction Locator Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Sequencer Load (SQL) Sequencer Output (SQO) Sine (SIN) Square Roost (SQR/SQRT) String Concatenate (CONCAT) String Delete (DELETE)
  • Page 9: Table Of Contents

    Table of contents Preface Studio 5000 environment....................15 Additional resources ......................16 Purpose of this manual ...................... 16 Legal Notices ........................16 Chapter 1 Process Control Instructions Process Control Instructions ................... 19 Alarm (ALM) ........................20 Discrete 3-State Device (D3SD) ..................26 Discrete 2-State Device (D2SD) ..................
  • Page 10 Table of contents CV Windup Limiting ..................... 253 Execution ........................... 254 Switch Between Program Control and Operator Control ......254 Operating Modes ...................... 255 Convert the PV and SP Values to Percent ............257 Primary Loop Control .................... 257 Processing Faults ....................... 259 Select the Control Variable ..................
  • Page 11 Table of contents Chapter 5 Statistical Instructions Statistical Instructions ..................... 381 Moving Average (MAVE) ....................382 Maximum Capture (MAXC) ..................388 Minimum Capture (MINC) ..................392 Moving Standard Deviation (MSTD) ................. 395 Chapter 6 Logical and Move Logical and Move Instructions ..................401 D Flip-Flop (DFF) ......................
  • Page 12 Table of contents Result codes for SCMD instructions ................483 Result codes for SOVR instructions ................484 SASI instruction examples ..................... 485 SATT instruction examples ................... 486 SCLF instruction examples .................... 486 SCMD instruction examples ..................487 SDET instruction examples ................... 487 SOVR instruction examples ...................
  • Page 13 Table of contents Chapter 11 Common Attributes for Common Attributes ......................537 Math Status Flags ......................537 Advanced Process Control Immediate values ......................540 and Drives Instructions Data Conversions ......................541 Elementary data types ...................... 545 LINT data types ....................... 548 Floating Point Values ......................
  • Page 15: Preface

    Controllers Common Procedures Programming Manual, publication 1756- PM001 The term Logix 5000 controller refers to any controller based on the Logix 5000 operating system. Studio 5000 environment The Studio 5000 Automation Engineering & Design Environment® combines engineering and design elements into a common environment. The first element is the Studio 5000 Logix Designer®...
  • Page 16: Additional Resources

    Preface These documents contain additional information concerning related Rockwell Additional resources Automation products. Resource Description Industrial Automation Wiring and Grounding Guidelines Provides general guidelines for installing a Rockwell publication 1770-4.1 Automation industrial system. Product Certifications webpage, available Provides declarations of conformity, certificates, and other http://ab.rockwellautomation.com certification details.
  • Page 17 Directory, FactoryTalk Security, FactoryTalk Services Platform, FactoryTalk View, FactoryTalk View SE, FLEX Ex, FlexLogix, FLEX I/O, Guard I/O, High Performance Drive, Integrated Architecture, Kinetix, Logix5000, Logix 5000, Logix5550, MicroLogix, DeviceNet, EtherNet/IP, PLC-2, PLC-3, PLC-5, PanelBuilder, PowerFlex, PhaseManager, POINT I/O, PowerFlex, Rockwell...
  • Page 18 Preface procedure, or process described, nor do they provide directions for meeting every possible contingency during installation, operation, or maintenance. This product’s implementation may vary among users. This document is current as of the time of release of the product; however, the accompanying software may have changed since the release.
  • Page 19: Process Control Instructions

    Chapter 1 Process Process Control The Process Control instructions include these instructions: Instructions Available Instructions Ladder Diagram Not available Function Block and Structured Text PIDE RMPS POSP SRTP LDLG FGEN DEDT D2SD D3SD If you want to Use this instruction Provide alarming for any analog signal.
  • Page 20: Alarm (Alm)

    Chapter 1 Process Control Instructions Take the 0-100% output of a PID loop and drive heating and cooling SRTP digital output contacts with a periodic pulse. Provide a time-scaled accumulation of an analog input value, such as a volumetric flow. Control a single process variable by maintaining a single controller output.
  • Page 21 Process Control Instructions Chapter 1 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.
  • Page 22 Chapter 1 Process Control Instructions 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. REAL The analog signal input. Valid = any float Default = 0.0 HHLimit REAL...
  • Page 23 Process Control Instructions Chapter 1 Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if ROC overflows. HHAlarm BOOL The high-high alarm indicator. Default = false HAlarm BOOL The high alarm indicator. Default = false LAlarm BOOL The low alarm indicator.
  • Page 24 Chapter 1 Process Control Instructions 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 F/second with a period of execution of 100 ms.
  • Page 25 Process Control Instructions Chapter 1 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.
  • Page 26: Discrete 3-State Device (D3Sd)

    Chapter 1 Process Control Instructions SCL(SCL_01); ALM_01.IN := SCL_01.Out; ALM(ALM_01); See also Common Attributes page 537 Structured Text Syntax page 508 Function Block Faceplate Controls page 552 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.
  • Page 27 Process Control Instructions Chapter 1 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...
  • Page 28 Chapter 1 Process Control Instructions DISCRETE_3STATE Structure Input Parameter Data Description Type EnableIn BOOL Enable input. If false, the instruction does not execute and outputs are not updated. Default is true. Prog0Command BOOL Program state 0 command. This input determines the device state when the device is in Program control.
  • Page 29 Process Control Instructions Chapter 1 Input Parameter Data Description Type HandFB1 BOOL Hand feedback state 1. This input from a field hand/off/auto station shows the requested state of the field device. True indicates the field device is being requested to enter the 1 state; false indicates the field device is being requested to enter some other state.
  • Page 30 Chapter 1 Process Control Instructions Input Parameter Data Description Type Out2State0 BOOL Output 2 state 0 input. This value determines the value of Output2 when the device is in the 0 state. Default is false. Out2State1 BOOL Output 2 state 1 input. This value determines the value of Output2 when the device is in the 1 state.
  • Page 31 Process Control Instructions Chapter 1 Input Parameter Data Description Type FB3State2 BOOL Feedback 3 state 2 input. This value determines the expected value of FB3 when the device is in the 2 state. Default is false. ProgProgReq BOOL Program program request. Set to true by the user program to request Program control.
  • Page 32 Chapter 1 Process Control Instructions Command1Status BOOL Device state 1 command status. True when the device is being commanded to the 1 state; false when the device is being commanded to some other state. Command2Status BOOL Device state 2 command status. True when the device is being commanded to the 2 state;...
  • Page 33 Process Control Instructions Chapter 1 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. Affects Math Status Flags Major/Minor Faults None specific to this instruction.
  • Page 34 Chapter 1 Process Control Instructions 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.
  • Page 35 Process Control Instructions Chapter 1 Function Block Structured Text OilFeedController.Prog0Command := ClosedOilFeed; OilFeedController.Prog1Command := SlowOilFeed; OilFeedController.Prog1Command := FastOilFeed; OilFeedController.FB0 := SmallOilValveClosed; OilFeedController.FB1 := SmallOilValveOpened; OilFeedController.FB2 := LargeOilValveClosed; OilFeedController.FB3 := LargeOilValveOpened; D3SD(OilFeedController); SmallOilValve := OilFeedController.Out0; LargeOilValve := OilFeedController.Out1; Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 36 Chapter 1 Process Control Instructions Switch Between Program Control and Operator Control The following diagram shows how the D3SD instruction changes between Program control and Operator control. (1) The instruction remains in Operator control mode when ProgOperReq is true. Commanded State in Program Control The following table shows how the D3SD instruction operates when in Program control.
  • Page 37 Process Control Instructions Chapter 1 Commanded State in Operator Control The following table shows how the D3SD instruction operates when in Operator control. State1 Oper0Req Oper1Req Oper2Req State0 Perm Perm State2 Perm Description false false true either either true Command0Status is cleared to false Command1Status is cleared to false Command2Status is set to true false...
  • Page 38 Chapter 1 Process Control Instructions Override Override State Description true Command0Status is cleared to false Command1Status is cleared to false Command2Status is set to true true Command0Status is cleared to false Command1Status is set to true Command2Status is cleared to false true Command0Status is set to true Command1Status is cleared to false...
  • Page 39 Process Control Instructions Chapter 1 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...
  • Page 40 Chapter 1 Process Control Instructions If there is no fault present, FaultAlarm is cleared to false if one of the following conditions is met: • Command0Status is true and Device0State is true • Command1Status is true and Device1State is true •...
  • Page 41: Discrete 2-State Device (D2Sd)

    Process Control Instructions Chapter 1 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).
  • Page 42 Chapter 1 Process Control Instructions 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...
  • Page 43 Process Control Instructions Chapter 1 FaultTime REAL Fault time value. Configure the value in seconds of the time to allow the device to reach a newly commanded state. Set FaultTime = 0 to disable the fault timer. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
  • Page 44 Chapter 1 Process Control Instructions ProgOperReq BOOL Program operator request. Set to true by the user program to request Operator control. Holding this true locks the instruction into Operator control. Default is false. ProgOverrideReq BOOL Program override request. Set to true by the user program to request the device to enter Override mode.
  • Page 45 Process Control Instructions Chapter 1 Hand BOOL Hand mode. True when the device is in the Hand mode. Status DINT Status of the function block. InstructFault (Status.0) BOOL The instruction detected one of the following execution errors. This is not a minor or major controller error. Check the remaining status bits to determine what occurred.
  • Page 46 Chapter 1 Process Control Instructions 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.
  • Page 47 Process Control Instructions Chapter 1 Structured Text SyrupController.ProgCommand := AddSyrup; SyrupController.FB0 := SyrupValveClosedLimitSwitch; SyrupController.FB1 := SyrupValveOpenedLimitSwitch; D2SD(SyrupController); SyrupValve := SyrupController.Out; Switch Between Program Control and Operator Control The following diagram shows how the D2SD instruction changes between Program control and Operator control. (1) The instruction remains in Operator control mode when ProgOperReq is true.
  • Page 48 Chapter 1 Process Control Instructions Commanded State in Program Control The following diagram shows how the D2SD instruction operates when in Program control. Commanded State in Operator Control The following diagram shows how the D2SD instruction operates when in Operator control. If both Oper0Req and Oper1Req are true: •...
  • Page 49 Process Control Instructions Chapter 1 Hand Mode or Override Mode The following table describes how the D2SD instruction determines whether to operate in Hand or Override mode. FaultAlarm and ProgHandReq ProgOverrideReq OverrideOnFault Description true either either Hand mode Hand is set to true Override is cleared to false false true...
  • Page 50 Chapter 1 Process Control Instructions Fault Alarm Conditions The D2SD instruction checks for these fault alarm conditions. Fault alarm condition resulting from Rules Device state was commanded to change, but the Start the fault timer when CommandStatus CommandStatus feedback did not indicate that the desired state Set FaultAlarm when faulttimer is done and FaultTime >...
  • Page 51: Deadtime (Dedt)

    Process Control Instructions Chapter 1 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.
  • Page 52 Chapter 1 Process Control Instructions 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 InFault BOOL...
  • Page 53 Process Control Instructions Chapter 1 Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the deadtime algorithm. DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate the process output.
  • Page 54 Chapter 1 Process Control Instructions The deadtime buffer functions as a first-in, first-out buffer. Every time the deadtime algorithm executes, the oldest value in the deadtime buffer is moved into Out. The remaining values in the buffer shift downward and the value ((In x Gain) + Bias) is moved to the beginning of the deadtime buffer.
  • Page 55 Process Control Instructions Chapter 1 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.
  • Page 56: Function Generator (Fgen)

    Chapter 1 Process Control Instructions Function Block See also Common Attributes page 537 Structured Text Syntax page 508 This information applies to the CompactLogix 5370, ControlLogix 5570, Function Generator (FGEN) Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers.
  • Page 57 Process Control Instructions Chapter 1 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 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 REAL array...
  • Page 58 Chapter 1 Process Control Instructions Structured Text Operand Type Format Description FGEN tag FUNCTION_ structure FGEN structure GENERATOR 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 REAL array...
  • Page 59 Process Control Instructions Chapter 1 Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false on overflow REAL Output of the instruction. Status DINT Status of the function block. InstructFault (Status.0) BOOL Instruction generated a fault. XY1SizeInv (Status.1) BOOL Size of table 1 is invalid or not compatible with the array...
  • Page 60 Chapter 1 Process Control Instructions Before calculating Out, the X axis parameters are scanned. If they are not sorted in ascending order, the appropriate bit in Status is set and Out remains unchanged. Also, if XY1Size or XY2Size is invalid, the instruction sets the appropriate bit in Status and leaves Out unchanged.
  • Page 61 Process Control Instructions Chapter 1 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.
  • Page 62: Lead-Lag (Ldlg)

    Chapter 1 Process Control Instructions 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. The LDLG instruction provides a phase lead-lag compensation for an input signal. This instruction is typically used for feedforward PID control or for process simulations.
  • Page 63 Process Control Instructions Chapter 1 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 Initialize BOOL...
  • Page 64 Chapter 1 Process Control Instructions Output Parameter Data Type Description EnableOut BOOL Enable output. REAL The calculated output of the algorithm. Math status flags are used for this output. DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate the process output.
  • Page 65 Process Control Instructions Chapter 1 When the value computed for the output becomes valid, the instruction initializes the internal parameters and sets Out = (In x Gain) + Bias. Math Status Flags Major/Minor Faults None specific to this instruction. See Common Attributes for operand-related faults.
  • Page 66 Chapter 1 Process Control Instructions 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 page 491 Common Attributes page 537 Structured Text Syntax page 508 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 67: Enhanced Pid (Pide)

    Process Control Instructions Chapter 1 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.
  • Page 68 Chapter 1 Process Control Instructions 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.
  • Page 69 Process Control Instructions Chapter 1 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...
  • Page 70 Chapter 1 Process Control Instructions CVInitValue REAL CVEU initialization value, scaled in CVEU units. When CVInitializing is true, CVEU = CVInitValue and CV equals the corresponding percentage value. CVInitValue comes from the feedback of the analog output controlled by CVEU or from the setpoint of a secondary loop.
  • Page 71 Process Control Instructions Chapter 1 CVROCLimit REAL CV rate of change limit, in percent per second. Rate of change limiting is only used when in Auto or Cascade/Ratio modes or Manual mode if CVManLimiting is true. Enter 0 to disable CV ROC limiting. If CVROCLimit < 0, the instruction sets the appropriate bit in Status and disables CV ROC limiting.
  • Page 72 Chapter 1 Process Control Instructions IGain REAL Integral gain. When the independent form of the PID algorithm is selected, enter the integral gain in units of 1/minutes into this value. When the dependent PID algorithm is selected, enter the integral time constant in units of minutes/repeat into this value. Enter 0 to disable the integral control.
  • Page 73 Process Control Instructions Chapter 1 PVROCPosLimit REAL PV positive rate of change alarm limit. The limit value for a positive (increasing) change in PV, scaled in PV units per seconds. Enter 0.0 to disable positive PVROC alarm checking. If PVROCPosLimit < 0.0, the instruction sets the appropriate bit in Status and disables positive PVROC checking.
  • Page 74 Chapter 1 Process Control Instructions ManualAfterInit BOOL Manual mode after initialization request. When true, the instruction is placed in Manual mode when CVInitializing is true, unless the current mode is Override or Hand. When ManualAfterInit is false, the instruction’s mode is not changed, unless requested to do Default is false.
  • Page 75 Process Control Instructions Chapter 1 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...
  • Page 76 Chapter 1 Process Control Instructions 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...
  • Page 77 Process Control Instructions Chapter 1 DevHAlarm BOOL Deviation high alarm indicator. Set to true when (SP + DevHLimit). Cleared to false when PV < (SP + DevHLimit - DevDeadband) DevLAlarm BOOL Deviation low alarm indicator. Set to true when (SP - DevLLimit). Cleared to false when PV >...
  • Page 78 Chapter 1 Process Control Instructions RatioLimitsInv BOOL RatioLLimit < 0 or RatioHLimit < RatioLLimit. (Status1.11) CVProgInv BOOL CVProg < 0 or CVProg > 100, or CVProg < CVLLimit or CVProg > CVHLimit (Status1.12) when CVManLimiting is true. The instruction limits the value for CV. CVOperInv BOOL CVOper <...
  • Page 79 Process Control Instructions Chapter 1 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.
  • Page 80 Chapter 1 Process Control Instructions Independent Gains Form In this form of the algorithm, each term of the algorithm (proportional, integral, and derivative) has a separate gain. Changing one gain only affects that term and not any of the others, where: PIDE term: Description: Control variable...
  • Page 81 Process Control Instructions Chapter 1 PIDE term: Description: Proportional gain Integral gain in min a larger value of K causes a faster integral response. Derivative gain in minutes Determining Which Algorithm to Use The PIDE equations above are representative of the algorithms used by the PIDE instruction.
  • Page 82 Chapter 1 Process Control Instructions Autotuning the PIDE Instruction The Logix Designer application PIDE autotuner provides an open-loop autotuner built into the PIDE instruction. You can autotune from PanelView terminal or any other operator interface devices, as well as the Logix Designer application. The PIDE block has an Autotune Tag (type PIDE_AUTOTUNE) that you specify for those PIDE blocks that you want to autotune.
  • Page 83 Process Control Instructions Chapter 1 Instruction first run 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.
  • Page 84 Chapter 1 Process Control Instructions 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.
  • Page 85 Process Control Instructions Chapter 1 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.
  • Page 86 Chapter 1 Process Control Instructions 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(PrimaryLoop); SecondaryLoop.PV := Local:1:I.Ch1Data; SecondaryLoop.SPCascade := PrimaryLoop.CVEU; PIDE(SecondaryLoop); Local:2:O.Ch0Data:= SecondaryLoop.CVEU; For a cascaded pair of loops to work correctly, the secondary loop must have a faster process response than the primary loop.
  • Page 87 Process Control Instructions Chapter 1 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.
  • Page 88 Chapter 1 Process Control Instructions Function Block Structured Text PIDE_01.PV := ControlledFlow; PIDE_01.SPCascade := UncontrolledFlow; PIDE(PIDE_01); Local:2:O.Ch0Data := PIDE_01.CVEU; Switching Between Program Control and Operator Control The PIDE instruction can be controlled by either a user program or an operator interface.
  • Page 89 Process Control Instructions Chapter 1 The following diagram shows how the PIDE instruction changes between Program control and Operator control. (1) The instruction remains in Operator control mode when ProgOperReq is set. Operating Modes The PIDE instruction supports the following PID modes. PID Operating Description Mode...
  • Page 90 Chapter 1 Process Control Instructions Hand While in Hand mode the PID algorithm does not compute the change in CV. CV = HandFB, 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. Select Hand mode using ProgHandReq: Set ProgHandReq to request hand mode.
  • Page 91 Process Control Instructions Chapter 1 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.
  • Page 92 Chapter 1 Process Control Instructions Updating the SPOper and SPProg Values The PIDE instruction makes SPOper = SP or SPProg = SP to obtain bumpless control switching between Program and Operator control or when switching from Cascade/Ratio mode. 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.
  • Page 93 Process Control Instructions Chapter 1 PV Rate-of-Change Alarming PV rate-of-change (ROC) alarming compares the change in the value of PV over the PVROCPeriod against the PV positive and negative rate-of-change limits. The PVROCPeriod provides a type of deadband for the rate-of-change alarm. For example, if you use a ROC alarm limit of 2°F/second with a period of execution of 100 ms, and an analog input module with a resolution of 1°F, then every time the input value changes, a ROC alarm is generated because the instruction sees a rate...
  • Page 94 Chapter 1 Process Control Instructions Converting the PV and SP Values to Percent The instruction converts PV and SP to a percent and calculates the error before performing the PID control algorithm. The error is the difference between the PV and SP values.
  • Page 95 Process Control Instructions Chapter 1 The high-high to low-low alarming algorithm compares the deviation to deviation alarm limits and the deviation alarm limits plus or minus the deadband. (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.
  • Page 96 Chapter 1 Process Control Instructions On the transition to Auto or Cascade/Ratio mode, the instruction sets En-1 = The instruction disables the zero crossing algorithm and clears ZCDeadband under these conditions: • during instruction first scan • ZCDeadband ≤ 0 •...
  • Page 97 Process Control Instructions Chapter 1 Selecting the Control Variable Once the PID algorithm has been executed, select the CV based on program or operator control and the current PID mode. CV Windup Limiting Limit the CV such that its value cannot increase when WindupHIn is set or decrease when WindupLIn is set.
  • Page 98 Chapter 1 Process Control Instructions 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.
  • Page 99 Process Control Instructions Chapter 1 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: where DeltaT is in seconds.
  • Page 100 Chapter 1 Process Control Instructions Updating the CVOper and CVProg Values If not in the Operator Manual mode, the PIDE instruction sets CVOper = CV. This obtains bumpless mode switching from any control to the Operator Manual mode. 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.
  • Page 101 Process Control Instructions Chapter 1 (4) During instruction first scan, the instruction clears the windup outputs. The instruction also clears the windup outputs and disables the CV windup algorithm when CVInitializing is set or if either CVFaulted or CVEUSpanInv is set. (5) The instruction sets WindupHOut when SPHAlarm is set, or when ControlAction is cleared and CVHAlarm is set, or when ControlAction is set and CVLAlarm is set.
  • Page 102: Position Proportional (Posp)

    Chapter 1 Process Control Instructions PVSpanInv is true or Disable the Auto and Cascade/Ratio modes. If Override or Hand is not the current mode, set to SPLimitsInv is true Manual mode Do not compute PV and SP percent PID control algorithm is not executed Set CV to value by determined by Program or Operator control and mode (Manual, Override, or Hand).
  • Page 103 Process Control Instructions Chapter 1 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.
  • Page 104 Chapter 1 Process Control Instructions POSITION_PROP Structure Input Parameter Data Type Description EnableIn BOOL Enable input. If false, the instruction does not execute and outputs are not updated. Default is true. REAL Setpoint. This is the desired value for the position. This value must use the same engineering units as Position.
  • Page 105 Process Control Instructions Chapter 1 MinOnTime REAL Minimum time in seconds that an open or close pulse can be on. If OpenTime or CloseTime is calculated to be less than this value, they are set to zero. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
  • Page 106 Chapter 1 Process Control Instructions Description The POSP instruction usually receives the desired position setpoint from a PID instruction output. Scaling the Position and Setpoint Values The PositionPercent and SPPercent outputs are updated each time the instruction is executed. If either of these values is out of range (less than 0% or greater than 100%), the appropriate bit in Status is set, but the values are not limited.
  • Page 107 Process Control Instructions Chapter 1 Producing Output Pulses The following diagram shows the three primary states of the POSP instruction. Calculating Open and Close Pulse Times OpenOut is pulsed whenever SP > Position feedback. When this occurs, the instruction sets CloseTime = 0 and the duration for which OpenOut is to be turned on is calculated as: If OpenTimen-1 <...
  • Page 108 Chapter 1 Process Control Instructions SPPercent is invalid The CloseOut is pulsed whenever SP < Position feedback. When this occurs, the instruction sets OpenTime = 0 and the duration for which CloseOut is to be turned on is calculated as: If CloseTimen-1 <...
  • Page 109 Process Control Instructions Chapter 1 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.
  • Page 110 Chapter 1 Process Control Instructions Function Block Structured Text FlowController.PV := WaterFlowRate; PIDE(FlowController); FlowValve.SP := FlowController.CVEU; FlowValve.Position := FlowValvePosition; FlowValve.OpenedFB := FlowValveOpened; FlowValve.ClosedFB := FlowValveClosed; POSP(FlowValve); OpenFlowValveContact := FlowValve.OpenOut; CloseFlowValveContact := FlowValve.CloseOut; See also Common Attributes page 537 Structured Text Syntax page 508 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 111: Ramp/Soak (Rmps)

    Process Control Instructions Chapter 1 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. The RMPS instruction provides for a number of segments of alternating ramp and soak periods.
  • Page 112 Chapter 1 Process Control Instructions 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.
  • Page 113 Process Control Instructions Chapter 1 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.
  • Page 114 Chapter 1 Process Control Instructions 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.
  • Page 115 Process Control Instructions Chapter 1 ProgOperReq BOOL Program operator request. Set to true by the user program to request Operator control. Holding this true locks the instruction in Operator control. Default is false. ProgAutoReq BOOL Program auto mode request. Set to true by the user program to request the ramp/soak to enter Auto mode.
  • Page 116 Chapter 1 Process Control Instructions Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The output of the ramp/soak instruction. CurrentSeg DINT Current segment number. Displays the current segment number in the ramp/soak cycle.
  • Page 117 Process Control Instructions Chapter 1 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.
  • Page 118 Chapter 1 Process Control Instructions 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. Initial Mode Applied on Instruction First Scan The following table shows the ending control based on the program request inputs.
  • Page 119 Process Control Instructions Chapter 1 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.
  • Page 120 Chapter 1 Process Control Instructions Switching Between Program Control and Operator Control The RMPS instruction can be controlled by either a user program or through an operator interface. Control can be changed at any time. (1) You can lock the instruction in Operator control by leaving ProgOperReq to true.
  • Page 121 Process Control Instructions Chapter 1 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.
  • Page 122 Chapter 1 Process Control Instructions 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.
  • Page 123 Process Control Instructions Chapter 1 Executing the Ramp/Soak Profile The following diagram illustrates how the RMPS instruction executes the ramp/soak profile. (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.
  • Page 124 Chapter 1 Process Control Instructions 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.
  • Page 125: Scale (Scl)

    Process Control Instructions Chapter 1 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.
  • Page 126 Chapter 1 Process Control Instructions 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.
  • Page 127 Process Control Instructions Chapter 1 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...
  • Page 128 Chapter 1 Process Control Instructions 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 <...
  • Page 129 Process Control Instructions Chapter 1 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.
  • Page 130: Split Range Time Proportional (Srtp)

    Chapter 1 Process Control Instructions 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.
  • Page 131 Process Control Instructions Chapter 1 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. REAL The analog signal input asking for heating or cooling.
  • Page 132 Chapter 1 Process Control Instructions MinHeatTime REAL Minimum heat time in seconds. Specify the minimum time in seconds that a heating pulse can be on. If the instruction calculates HeatTime to be less than this value, HeatTime is set to zero. If MinHeatTime is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
  • Page 133 Process Control Instructions Chapter 1 MaxHeatTimeInv (Status.2) BOOL Invalid MaxHeatTime value. The instruction uses the CycleTime value. MinHeatTimeInv (Status.3) BOOL Invalid MinHeatTime value. The instruction uses zero. MaxCoolTimeInv (Status.4) BOOL Invalid MaxCoolTime value. The instruction uses the CycleTime value. MinCoolTimeInv (Status.5) BOOL Invalid MinCoolTime value.
  • Page 134 Chapter 1 Process Control Instructions CoolTime is the amount of time within CycleTime that the cool output is to be turned on. If CoolTime < MinCoolTime, set CoolTime = 0. If CoolTime > MaxCoolTime, limit CoolTime = MaxCoolTime. CoolTimePercent is the percentage of CycleTime that the CoolOut pulse is true. The instruction controls heat and cool outputs using these rules: •...
  • Page 135 Process Control Instructions Chapter 1 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.
  • Page 136 Chapter 1 Process Control Instructions Function Block Place the PIDE instruction in a slow, lower priority task Place the SRTP instruction in a faster, higher priority task. Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 137: Totalizer (Tot)

    Process Control Instructions Chapter 1 Structured Text Place the PIDE instruction in a slow, lower priority task. BarrelTempLoop.PV := BarrelTemp; PIDE(BarrelTempLoop); LoopOutput := BarrelTempLoop.CVEU; Place the SRTP instruction in a faster, higher priority task. SRTP_02.In := LoopOutput; SRTP(SRTP_02); ResistiveHeater := SRTP_02.HeatOut; CoolingSolenoid := SRTP_02.CoolOut;...
  • Page 138 Chapter 1 Process Control Instructions 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.
  • Page 139 Process Control Instructions Chapter 1 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 InFault BOOL...
  • Page 140 Chapter 1 Process Control Instructions LowInCutoff REAL The instruction low input cutoff input. When the In is at or below the LowInCutoff value, totalization ceases. Valid = any float Default = 0.0 ProgProgReq BOOL Program program request. Set to true to request Program control.
  • Page 141 Process Control Instructions Chapter 1 TimingMode DINT Selects timing execution mode. 0 = Period mode 1 = Oversample mode 2 = Real time sampling mode For more information about timing modes, see Function Block Attributes. Valid = 0 to 2 Default = 0 OversampleDT REAL...
  • Page 142 Chapter 1 Process Control Instructions Status DINT Status of the function block. InstructFault (Status.0) BOOL The instruction detected one of the following execution errors. This is not a minor or major controller error. Check the remaining status bits to determine what occurred. InFaulted (Status.1) BOOL In value faulted.
  • Page 143 Process Control Instructions Chapter 1 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.
  • Page 144 Chapter 1 Process Control Instructions Operating Modes The following diagram shows how the TOT instruction changes between Program control and Operator control. (1) The instruction remains in operator control mode when ProgOperReq is true. The following diagram shows how the TOT instruction changes between Run and Stop modes.
  • Page 145 Process Control Instructions Chapter 1 All operator request inputs are cleared to false at the end of each scan. If ProgValueReset is true, all program request inputs are cleared to false at the end of each scan. Resetting the TOT Instruction When ProgResetReq transitions to true while ProgOper is true, the following happens: •...
  • Page 146 Chapter 1 Process Control Instructions Determining if Target Values Have Been Reached Once the totalization has been calculated, these rules determine whether the target or pre-target values have been reached: • TargetFlag is true when Total Target • TargetDev1Flag is true when Total (Target - TargetDev1) •...
  • Page 147: Coordinated Control (Cc)

    Process Control Instructions Chapter 1 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 page 491 Common Attributes page 537 Structured Text Syntax page 508 Coordinated...
  • Page 148 Chapter 1 Process Control Instructions 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.
  • Page 149 Process Control Instructions Chapter 1 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: •...
  • Page 150 Chapter 1 Process Control Instructions SPLLimit REAL SP low limit value, scaled in PV units. Valid = PVEUMin to SPHLimit If SPLLimit < PVEUMin, or SPHLimit < Default = 0.0 SPLLimit, set bit in Status and limit SP by using the value of SPLLimit. CV1Fault BOOL Control variable 1 bad health...
  • Page 151 Process Control Instructions Chapter 1 CV1InitValue REAL CV1EU initialization value, scaled in Valid = any float CV1EU units. When CV1Initializing is Default = 0.0 TRUE set CV1EU equal to CV1InitValue and CV1 to the corresponding percentage value. CV1InitValue will normally come from the feedback of the analog output controlled by CV1EU or from the setpoint of a secondary loop.
  • Page 152 Chapter 1 Process Control Instructions CV2Oper REAL CV2 Operator-Manual value. CV2 is set Valid = 0.0…100.0 to this value when in Operator control Default = 0.0 and Manual mode. If not Operator- Manual mode, set CV2Oper to the value of CV2 at the end of each function block execution.
  • Page 153 Process Control Instructions Chapter 1 CV1TrackValue REAL CV1 track value. When CVTrackReq is Valid = 0.0…100.0 enabled and the CC function block is in Default = 0.0 Manual mode, the CV1TrackValue will be ignored, and the CC internal model will update its historical data with the CV1Oper or CV1Prog value.
  • Page 154 Chapter 1 Process Control Instructions CV3TrackValue REAL CV3 track value. When CVTrackReq is Valid = 0.0…100.0 enabled and the CC function block is in Default = 0.0 Manual mode, the CV3TrackValue will be ignored, and the CC internal model will update its historical data with the CV3Oper or CV3Prog value.
  • Page 155 Process Control Instructions Chapter 1 CV1HLimit REAL CV1 high limit value. This is used to Valid = CV1LLimit < CV1HLimit ≤ 100.0 set the CV1HAlarm output. It is also Default = 100.0 used for limiting CV1 when in Auto mode or in Manual if CVManLimiting is TRUE.
  • Page 156 Chapter 1 Process Control Instructions CV1ROCPosLimit REAL CV1 rate of change limit, in percent Valid = 0.0 to maximum positive float per second. Rate of change limiting is Default = 0.0 only used when in Auto mode or in Manual mode if CVManLimiting is TRUE.
  • Page 157 Process Control Instructions Chapter 1 CV1HandFB REAL CV1 HandFeedback value. CV1 set to Valid = 0.0…100.0 this value when in Hand mode and Default = 0.0 CV1HandFBFault is FALSE (good health). This value would typically come from the output of a field mounted hand/auto station and would be used to generate a bumpless transfer out of Hand mode.
  • Page 158 Chapter 1 Process Control Instructions CV2Target REAL Target value for CV2. Valid = 0.0…100.0 Default = 0.0 CV3Target REAL Target value for CV3. Valid = 0.0…100.0 Default = 0.0 CV1WindupHIn BOOL CV1Windup high request. When TRUE, Default = FALSE CV1 will not be allowed to increase in value.
  • Page 159 Process Control Instructions Chapter 1 CV3ProcessGainSign BOOL Used only for Autotuning. Sign of the Default = FALSE process gain (Delta PV/Delta CV3). 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).
  • Page 160 Chapter 1 Process Control Instructions Target1stCV DINT The CV with top priority to be driven Valid = 1-3 to its target value. Default = 1 1=CV1, 2=CV2, 3=CV3 Target2ndCV DINT The CV with second highest priority to Valid = 1-3 be driven to its target value.
  • Page 161 Process Control Instructions Chapter 1 ProgCV2AutoReq BOOL Program-Auto mode request for CV2. Default = FALSE Set TRUE by the user program to request Auto mode. If value of CV2HandFB < 0 or > 100, set unique Status bit and limit value used for CV2.
  • Page 162 Chapter 1 Process Control Instructions ProgCV1HandReq BOOL Program-Hand mode request for CV1. Default = FALSE Set TRUE by the user program to request Hand mode. This value will usually be read as a digital input from a hand/auto station. ProgCV2HandReq BOOL Program-Hand mode request for CV2.
  • Page 163 Process Control Instructions Chapter 1 OperCV3ManualReq BOOL Operator-Manual mode request for Default = FALSE CV3. Set TRUE by the operator interface to request Manual mode. The function block resets this parameter to FALSE. ProgValueReset BOOL Reset Program control values. Default = FALSE When TRUE, the Prog_xxx_Req inputs are reset to FALSE.
  • Page 164 Chapter 1 Process Control Instructions CV1ResponseSpeed DINT Desired speed of closed loop response Range: 0…2 for CV1. Default=1 Slow response: ResponseSpeed=0 Medium response: ResponseSpeed=1 Fast response: ResponseSpeed=2. If ResponseSpeed is less than 0, Slow response is used. If ResponseSpeed is greater than 2, Fast response is used.
  • Page 165 Process Control Instructions Chapter 1 AtuneCV1UseModel BOOL Use Autotune model request for CV1. Default = FALSE Set True to replace the current model parameters with the calculated Autotune model parameters. The function block resets the input parameter to FALSE. AtuneCV2UseModel BOOL Use Autotune model request for CV2.
  • Page 166 Chapter 1 Process Control Instructions CV2EU REAL Scaled control variable output for CV2. Scaled by using CV2EUMax and CV2EUMin, where CV2EUMax corresponds to 100% and CV2EUMin corresponds to 0%. This output is typically used to control an analog output module or a secondary loop. CV2EU = (CV2 * CV2EUSpan / 100) + CV2EUMin CV2EU span calculation: CV2EUSpan...
  • Page 167 Process Control Instructions Chapter 1 CV1Initializing BOOL Initialization mode indicator for CV1. Set TRUE when CV1InitReq or function blockFirstScan are TRUE, or on a TRUE to FALSE transition of CV1Fault (bad to good). CV1Initializing is set FALSE after the function block has been initialized and CV1InitReq is no longer TRUE.
  • Page 168 Chapter 1 Process Control Instructions CV1ROCNegAlarm BOOL CV1 rate of change alarm indicator. TRUE when the calculated rate of change for CV1 exceeds CV1ROCNegLimit. CV2ROCNegAlarm BOOL CV2 rate of change alarm indicator. TRUE when the calculated rate of change for CV2 exceeds CV2ROCNegLimit.
  • Page 169 Process Control Instructions Chapter 1 CV3WindupHOut BOOL CV3 Windup high indicator. TRUE when either a SP high or CV3 high/low limit has been reached. This signal will typically be used by the WindupHIn input to limit the windup of the CV3 output on a primary loop.
  • Page 170 Chapter 1 Process Control Instructions CV1Hand BOOL Hand mode indicator for CV1. TRUE when CV1 in the Hand mode. CV2Hand BOOL Hand mode indicator for CV2. TRUE when CV2 in the Hand mode. CV3Hand BOOL Hand mode indicator for CV3. TRUE when CV3 in the Hand mode.
  • Page 171 Process Control Instructions Chapter 1 CV1RespTCTunedM REAL The calculated value of the control variable time constant in medium response speed for CV1 after tuning is completed. CV2RespTCTunedM REAL The calculated value of the control variable time constant in medium response speed for CV2 after tuning is completed.
  • Page 172 Chapter 1 Process Control Instructions AtuneCV1Fault BOOL CV1 Autotune has generated any of the following faults. AtuneCV2Fault BOOL CV2 Autotune has generated any of the following faults. AtuneCV3Fault BOOL CV3 Autotune has generated any of the following faults. AtuneCV1PVOutOfLimit BOOL Either PV or the deadtime-step ahead prediction of PV exceeds PVTuneLimit during CV1...
  • Page 173 Process Control Instructions Chapter 1 AtuneCV1StepSize0 BOOL CV1StepSizeUsed = 0 at start of CV1 Autotuning. When True, CV1 Autotuning is not started. AtuneCV2StepSize0 BOOL CV2StepSizeUsed = 0 at start of CV2 Autotuning. When True, CV2 Autotuning is not started. AtuneCV3StepSize0 BOOL CV3StepSizeUsed = 0 at start of CV3 Autotuning.
  • Page 174 Chapter 1 Process Control Instructions AtuneCV2Changed BOOL CV2Oper is changed when in Operation control or CV2Prog is changed when in Program control or CV2 becomes high/low or ROC limited during CV2 Autotuning. When True, CV2 Autotuning is aborted. AtuneCV3Changed BOOL CV3Oper is changed when in Operation control or CV3Prog is changed when in Program control or...
  • Page 175 Process Control Instructions Chapter 1 Status3CV3 DINT Additional bit mapped CV3 status for the function block. A value of 0 indicates that no faults have occurred. InstructFault BOOL The function block has generated a fault. Indicates state of bits in Status1, Status2, and Status3CV(n), where (n) can be 1, 2, or 3.
  • Page 176 Chapter 1 Process Control Instructions CV2ProgInv BOOL CV2Prog < 0 or > 100, or < CV2LLimit or > CV2HLimit when CVManLimiting is TRUE. Limit value used for CV2. CV3ProgInv BOOL CV3Prog < 0 or > 100, or < CV3LLimit or > CV3HLimit when CVManLimiting is TRUE.
  • Page 177 Process Control Instructions Chapter 1 CV2ROCLimitInv BOOL CV2ROCLimit < 0, disables CV2 ROC limiting. CV3ROCLimitInv BOOL CV3ROCLimit < 0, disables CV3 ROC limiting. CV1HandFBInv BOOL CV1HandFB < 0 or > 100. Limit value used for CV1. CV2HandFBInv BOOL CV2HandFB < 0 or > 100. Limit value used for CV2.
  • Page 178 Chapter 1 Process Control Instructions The following illustration is an example of the Coordinated Control closed loop configuration. 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 Is in Manual mode...
  • Page 179 Process Control Instructions Chapter 1 Affects Math Status Flags 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.
  • Page 180 Chapter 1 Process Control Instructions 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; Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 181: Cc Function Block Configuration

    Process Control Instructions Chapter 1 See also Common Attributes page 537 CC Function Block Configuration page 181 Select the Control Variable page 259 Switch between Program control and Operator control page 254 Structured Text Syntax page 508 Function Block Attributes page 491 CC Function Block Starting with the default configuration, configure the following parameters:...
  • Page 182: Cc Function Block Model Initialization

    Chapter 1 Process Control Instructions 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.
  • Page 183: Cc Function Block Tuning

    Process Control Instructions Chapter 1 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.
  • Page 184: Cc Function Block Tuning Procedure

    Chapter 1 Process Control Instructions CC Function Block Tuning Follow these steps to configure the tuner. Procedure 1. Put all three CV parameters into Manual mode. 2. Set the AtuneStart parameter. The tuner starts collecting PV and CV data for noise calculation. 3.
  • Page 185 Process Control Instructions Chapter 1 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.
  • Page 186 Chapter 1 Process Control Instructions 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.
  • Page 187 Process Control Instructions Chapter 1 SPHLimit REAL SP high limit value, scaled in PV units. Valid = SPLLimit to PVEUMax If SPHLimit < SPLLimit or SPHLimit > Default = 100.0 PVEUMax, set bit in Status. SPLLimit REAL SP low limit value, scaled in PV units. Valid = PVEUMin to SPHLimit If SPLLimit <...
  • Page 188 Chapter 1 Process Control Instructions CVInitValue REAL CVEU initialization value, scaled in CVEU Valid = any float units. When CVInitializing is TRUE set CVEU Default = 0.0 equal to CVInitValue and CV to the corresponding percentage value. CVInitValue will normally come from the feedback of the analog output controlled by CVEU or from the setpoint of a secondary loop.
  • Page 189 Process Control Instructions Chapter 1 CVEUMin REAL Minimum value of CVEU. The value of CVEU Valid = any float that corresponds to 0% CV. If CVEUMax = Default = 0.0 CVEUMin, set bit in Status. CVHLimit REAL CV high limit value. This is used to set the Valid = CVLLimit <...
  • Page 190 Chapter 1 Process Control Instructions WindupHIn BOOL Windup high request. When TRUE, CV will Default = FALSE not be allowed to increase in value. This signal will typically be the WindupHOut output from a secondary loop. WinduplIn BOOL Windup low request. When TRUE, CV will Default = FALSE not be allowed to decrease in value.
  • Page 191 Process Control Instructions Chapter 1 ProgProgReq BOOL Program Program Request. Default = FALSE Set TRUE by the user program to request Program control. Ignored if ProgOperReq is TRUE. Holding this TRUE and ProgOperReq FALSE can be used to lock the function block into program control.
  • Page 192 Chapter 1 Process Control Instructions OperManualReq BOOL Operator-Manual mode request. Set TRUE Default = FALSE by the operator interface to request Manual mode. The function block will reset this parameter to FALSE. ProgValueReset BOOL Reset Program control values. When TRUE, Default = FALSE the Prog_xxx_Req inputs are reset to FALSE.
  • Page 193 Process Control Instructions Chapter 1 Factor REAL Non-integrating model approximation Default = 100 factor. Only used for integrating process types. AtuneStart BOOL Start Autotune request. Set True to initiate Default = FALSE auto tuning of the function block. Ignored when IMC is not in Manual mode. The function block will reset this parameter to FALSE.
  • Page 194 Chapter 1 Process Control Instructions CVROCNegAlarm REAL CV rate of change alarm indicator. TRUE when the calculated rate of change for CV exceeds CVROCNegLimit. REAL Current setpoint value. The value of SP is used to control CV when in the Auto, the CascadeRatio, or the PV Tracking mode, scaled in PV units.
  • Page 195 Process Control Instructions Chapter 1 Manual BOOL Manual mode indicator. TRUE when in the Manual mode. Override BOOL Override mode indicator. TRUE when in the Override mode. Hand BOOL Hand mode indicator. TRUE when in the Hand mode. DeltaT REAL Elapsed time between updates in seconds.
  • Page 196 Chapter 1 Process Control Instructions AtuneCVLimitsFau BOOL CVLimitsInv and CVManLimiting are True at Bit 5 of start of Autotuning or during Autotuning. AtuneStatus When True, Autotuning is not started or is aborted. AtuneCVInitFault BOOL CVInitializing is True at start of Autotuning Bit 6 of or during Autotuning.
  • Page 197 Process Control Instructions Chapter 1 RatioOperInv BOOL RatioOper < RatioLLimit or > RatioHLimit. Bit 11 of Status1 Limit value used for Ratio. CVProgInv BOOL CVProg < 0 or > 100, or < CVLLimit or > Bit 12 of Status1 CVHLimit when CVManLimiting is TRUE. Limit value used for CV.
  • Page 198 Chapter 1 Process Control Instructions Description The following illustration shows the IMC function block configuration. At each execution, the IMC function block compares the actual PV measurement with PV prediction. The result is called disturbance estimate, which is the effect of unmeasured process disturbances combined with the modeling imprecision.
  • Page 199 Process Control Instructions Chapter 1 For an integrating process type (such as level control and position control), an internal nonintegrating model is used to approximate the integrating process. The Factor parameter is used to convert the identified integrating-process model to a nonintegrating internal model that is used for CV calculation.
  • Page 200 Chapter 1 Process Control Instructions Examples Function Block Structured Text imcTag.PV := imcInput1; imcTag.SPProg := imcInput2; imcTag.CVProg := imcInput3; IMC(imcTag); imcOutput1 := imcTag.CVEU; See also Processing Faults page 259 IMC Function Block Tuning page 202 Common Attributes page 537 Structured Text Syntax page 508 Function Block Attributes page 491...
  • Page 201: Imc Function Block Configuration

    Process Control Instructions Chapter 1 IMC Function Block Follow these steps to create a basic IMC configuration. Configuration 1. Starting with the default configuration, configure the following parameters. Parameter Description PVEUMax Maximum scaled value for PV. PVEUMin Minimum scaled value for PV. SPHLimit SP high limit value, scaled in PV units.
  • Page 202: Imc Function Block Model Initialization

    Chapter 1 Process Control Instructions For the Manual to Auto mode bumpless transfer and for safe operation of the control variable, the CV rate of change limiter is implemented such that the CV cannot change from its current state any faster than the rate of change limit parameter specified.
  • Page 203: Imc Function Block Tuning Errors

    Process Control Instructions Chapter 1 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).
  • Page 204: Imc Function Block Tuning Procedure

    Chapter 1 Process Control Instructions IMC Function Block Tuning Follow these steps to configure the tuner. Procedure 1. Put the CV into Manual mode. 2. Set the AtuneStart parameter. The tuner starts collecting PV and CV data for noise calculation. 3.
  • Page 205 Process Control Instructions Chapter 1 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 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 206 Chapter 1 Process Control Instructions Structure The following table describes the input parameters in the MMC function block. Input Parameters Data Description Values Type EnableIn BOOL Enable Input. If False, the function block will not Default=TRUE execute and outputs are not updated. REAL Scaled process variable input 1.
  • Page 207 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type SP2Oper REAL SP2 Operator value, scaled in PV units. SP2 set to Valid = SP2LLimit to this value when Operator control. SP2HLimit If value of SP2Prog or SP2Oper < SP2LLimit or > Default = 0.0 SP2HLimit, set bit in Status and limit value used for SP.
  • Page 208 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type CV1InitReq BOOL CV1 initialization request. While TRUE, set CV1EU Default = FALSE to the value of CV1InitValue. This signal will normally be controlled by the In Hold status on the analog output module controlled by CV1EU or from the InitPrimary output of a secondary loop.
  • Page 209 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type CV2Prog REAL CV2 Program-Manual value. CV2 is set to this Valid = 0.0 through 100.0 value when in Program control and Manual Default = 0.0 mode. CV3Prog REAL CV3 Program-Manual value. CV3 is set to this Valid = 0.0 through 100.0 value when in Program control and Manual Default = 0.0...
  • Page 210 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type CV3OverrideValue REAL CV3 Override value. CV3 set to this value when in Valid = 0.0 through 100.0 Override mode. Default = 0.0 This value should correspond to a safe state output of the loop.
  • Page 211 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type CV3HLimit REAL CV3 high limit value. This is used to set the Valid = CV3LLimit < CV3HAlarm output. It is also used for limiting CV3 CV3HLimit ≤ 100.0 when in Auto mode or in Manual if Default = 100.0 CVManLimiting is TRUE.
  • Page 212 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type CV1ROCNegLimit REAL CV1 rate of change limit, in percent per second. Valid = 0.0 to maximum Rate of change limiting is only used when in Auto positive float mode or in Manual mode if CVManLimiting is Default = 0.0 TRUE.
  • Page 213 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type CV2HandFBFault BOOL CV2HandFB value bad health indicator. If the Default = FALSE CV2HandFB value is read from an analog input, then CV2HandFBFault will normally be controlled by the status of the analog input channel. If CV2HandFBFault is TRUE, it indicates an error on the input module, set bit in Status.
  • Page 214 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type CV1PV1ProcessGain BOOL Used only for Autotuning. Sign of the process gain Default = FALSE Sign (Delta PV1/Delta CV1). • Set to indicate a negative process gain (increase in output causes a decrease in PV1). •...
  • Page 215 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type CV3PV1ModelGain REAL The internal model gain parameter for CV3 - PV1. Valid = maximum negative Enter a positive or negative gain depending on float −> maximum positive process direction. float If CV3PV1ModelGain = INF or NAN, set bit in Default = 0.0...
  • Page 216 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type CV1PV2ModelDT REAL The internal model deadtime for CV1 - PV2 in Valid = 0.0 to maximum seconds. positive float Default = 0.0 CV2PV2ModelDT REAL The internal model deadtime for CV2 - PV2 in Valid = 0.0 to maximum seconds.
  • Page 217 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type TargetRespTC REAL Determines the speed with which the control Valid = 0.0 to maximum variables approach the target values. positive float Default = 0.0 PVTracking BOOL SP track PV request. Default = FALSE Set TRUE to enable SP to track PV.
  • Page 218 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type ProgCV1ManualReq BOOL Program-Manual mode request for CV1. Default = FALSE • Set TRUE by the user program to request Manual mode. • When ProgValueReset is TRUE, the function block resets the input to FALSE. ProgCV2ManualReq BOOL Program-Manual mode request for CV2.
  • Page 219 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type OperProgReq BOOL Operator Program Request. Default = FALSE • Set TRUE by the operator interface to request Program control. The function block resets this parameter to FALSE. OperOperReq BOOL Operator Operator Request.
  • Page 220 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type RTSTime DINT Module update period for Real Time Sampling Valid = 0 through 32,767 mode. 1 count = 1 ms RTSTimeStamp DINT Module time stamp value for Real Time Sampling Valid = 0 through 32,767 mode.
  • Page 221 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type CV2PV1ResponseSp DINT Desired speed of closed loop response for CV2 Range: 0…2 PV1. Default=1 • Slow response: ResponseSpeed=0 • Medium response: ResponseSpeed=1 • Fast response: ResponseSpeed=2 If ResponseSpeed is less than 0, Slow response is used.
  • Page 222 Chapter 1 Process Control Instructions Input Parameters Data Description Values Type 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.
  • Page 223 Process Control Instructions Chapter 1 Input Parameters Data Description Values Type AtuneCV3PV2UseM BOOL Use Autotune model request for CV3 - PV2. Set Default = FALSE odel True to replace the current model parameters with the calculated Autotune model parameters. The function block resets the input parameter to FALSE.
  • Page 224 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type REAL Control variable output for CV1. This value will always be expressed as 0…100%. CV1 is limited by CV1HLimit and CV1LLimit when in Auto mode or in Manual mode if CVManLimiting is TRUE; otherwise limited by 0 and 100%.
  • Page 225 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type CV3ROCPosAlarm BOOL CV3 rate of change alarm indicator. TRUE when the calculated rate of change for CV3 exceeds CV3ROCPosLimit. CV1ROCNegAlarm BOOL CV1 rate of change alarm indicator. TRUE when the calculated rate of change for CV1 exceeds CV1ROCNegLimit.
  • Page 226 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type REAL Process2 error. Difference between SP2 and PV2, scaled in PV2 units. E1Percent REAL The error expressed as a percent of span for process E2Percent REAL The error expressed as a percent of span for process CV1WindupHOut BOOL CV1 Windup high indicator.
  • Page 227 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type CV3WindupLOut BOOL CV3 Windup low indicator. CV3WindupLOut is set to true when • SP1LAlarm or SP2LAlarm is true or • ModelGain is positive and CV3LAlarm is true or • ModelGain is negative and CV3HAlarm is true. This signal will typically be used by the WindupLIn input to limit the windup of the CV3 output on a primary loop.
  • Page 228 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type CV2PV2GainTuned REAL The calculated value of the internal model gain for CV2 - PV2 after tuning is completed. CV3PV2GainTuned REA: The calculated value of the internal model gain for CV3 - PV2 after tuning is completed.
  • Page 229 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type CV2PV1RespTCTun REAL The calculated value of the control variable time constant in medium response speed for CV2 - PV1 after tuning is completed. CV3PV1RespTCTun REAL The calculated value of the control variable time constant in medium response speed for CV3 - PV1 after tuning is completed.
  • Page 230 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type AtuneCV2PV1Abor BOOL Set True when auto tuning for CV2 - PV1 has been aborted by user or due to errors that occurred during the auto tuning operation. AtuneCV3PV1Abor BOOL Set True when auto tuning for CV3 PV1 has been aborted by user or due to errors that occurred during the auto tuning operation.
  • Page 231 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type AtuneCV1PV1OutO BOOL Either PV1 or the deadtime-step ahead prediction Bit 1 of AtuneCV1PV1Status fLimit of PV1 exceeds PV1TuneLimit during CV1 - PV1 Autotuning. When True, CV1 - PV1 Autotuning is aborted.
  • Page 232 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type AtuneCV2PV1Limi BOOL CV2LimitsInv and CVManLimiting are True at start Bit 5 of AtuneCV2PV1Status tsFault of CV2 - PV1 Autotuning or during CV2 - PV1 Autotuning. When True, CV2 _PV1 Autotuning is not started or is aborted.
  • Page 233 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type AtuneCV3PV1Time BOOL Elapsed time is greater then PV1AtuneTimeLimit Bit 9 of AtuneCV3PV1Status since step test is started. When True, CV3 - PV1 Autotuning is aborted. AtuneCV1PV1NotS BOOL The PV1 is changed too much to Autotune for CV1 - Bit 10 of AtuneCV1PV1Status ettled PV1.
  • Page 234 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type AtuneCV2PV2Win BOOL CV2WindupHIn or CV2WindupLIn is True at start of Bit 3 of AtuneCV2PV2Status dupFault CV2 - PV2 Autotuning or during CV2 - PV2 Autotuning. When True, CV2 - PV2 Autotuning is not started or is aborted.
  • Page 235 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type AtuneCV1PV2Chan BOOL CV1Oper is changed when in Operator control or Bit 8 of AtuneCV1PV2Status CV1Prog is changed when in Program control or CV1 becomes high/low or ROC limited during CV1 - PV2 Autotuning.
  • Page 236 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type Status3CV3 DINT Additional bit mapped CV3 status for the function block. A value of 0 indicates that no faults have occurred. InstructFault BOOL The function block has generated a fault. Indicates Bit 0 of Status1 state of bits in Status1, Status2, and Status3CV(n), where (n) can be 1, 2, or 3.
  • Page 237 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type CV3HandFBFaulte BOOL CV3 HandFB value health bad. Bit 1 of Status3CV3 CV1ProgInv BOOL CV1Prog < 0 or > 100, or < CV1LLimit or > Bit 2 of Status3CV1 CV1HLimit when CVManLimiting is TRUE. Limit value used for CV1.
  • Page 238 Chapter 1 Process Control Instructions Output Data Description Values Parameters Type CV3HandFBInv BOOL CV3 HandFB < 0 or > 100. Limit value used for CV3. Bit 8 of Status3CV3 CV1PV1ModelGain BOOL CV1PV1ModelGain is 1.#QNAN or -1.#IND. (Not A Bit 9 of Status3CV1 Number), or ±...
  • Page 239 Process Control Instructions Chapter 1 Output Data Description Values Parameters Type CV2PV2RespTCInv BOOL Entered value for CV2-PV2 Response Time Constant Bit 16 of Status3CV2 < 0. CV3PV2RespTCInv BOOL Entered value for CV3 - PV2 Response Time Bit 16 of Status3CV3 Constant <...
  • Page 240 Chapter 1 Process Control Instructions Item Description Internal model CV1 - PV1 Internal model CV2 - PV1 Internal model CV3 - PV1 Internal model CV1 - PV2 Internal model CV2 - PV2 Internal model CV3 - PV2 Target response C11, C22 Model-predictive function blocks (IMC) currently controlling PV1 and PV2 to SP1 and SP2, respectively Y11, Y21, Y31, Y12, Y22,...
  • Page 241 Process Control Instructions Chapter 1 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.
  • Page 242 Chapter 1 Process Control Instructions Example Function Block Structured Text mmcTag.PV1 := mmcInput1; mmcTag.PV2 := mmcInput2; mmcTag.SP1Prog := mmcInput3; mmcTag.SP2Prog := mmcInput4; mmcTag.CV1Prog := mmcInput5; mmcTag.CV2Prog := mmcInput6; mmcTag.CV3Prog := mmcInput7; MMC(mmcTag); mmcOutput1 := mmcTag.CV1EU; mmcOutput2 := mmcTag.CV2EU; mmcOutput3 := mmcTag.CV3EU; Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 243: Mmc Function Block Configuration

    Process Control Instructions Chapter 1 See also Convert the PV and SP Values to Percent page 257 Instruction First Scan page 254 Index Through Arrays page 551 Structured Text Syntax page 508 Function Block Attributes page 491 MMC Function Block Starting with the default configuration, configure the following parameters.
  • Page 244 Chapter 1 Process Control Instructions 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...
  • Page 245: Mmc Function Block Model Initialization

    Process Control Instructions Chapter 1 MMC Function Block Model A model initialization occurs: Initialization • During First Scan of the block • When the ModelInit request parameter is set • When DeltaT changes You may need to manually adjust the internal model parameters or the response time constants.
  • Page 246: Use An Mmc Function Block For Splitter Control

    Chapter 1 Process Control Instructions See also MMC Function Block Tuning Procedure page 247 MMC Function Block Tuning Errors page 246 Use an MMC Function The following example describes using an MMC function block to control a splitter. Refer to the MMC Function Block Splitter Example Configuration in Block for Splitter Control Module Multivariable Control ( MMC).
  • Page 247: Mmc Function Block Tuning Procedure

    Process Control Instructions Chapter 1 MMC Function Block Tuning Follow these steps to configure the tuner. Procedure 1. Put all three CV parameters into Manual mode. 2. Set the appropriate AtuneStart parameter. The tuner starts collecting PV and CV data for noise calculation. 3.
  • Page 248: Current Sp

    Chapter 1 Process Control Instructions 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.
  • Page 249 Process Control Instructions Chapter 1 Temperature Example Explanation Manipulating the PV at the setpoint is the top priority. The high pressure steam and cooling are selected as the most active actuators. At steady state, the same two controls should assume their target values: CV3 at 10% and CV2 at 0%. CV1 will assume any value needed to maintain PV at the setpoint;...
  • Page 250: Cv High/Low Limiting

    Chapter 1 Process Control Instructions Rate limiting is not imposed when control variable is in Manual mode unless CVManLimiting is set. See also CC Function Block Tuning page 183 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.
  • Page 251: Cv Percent Limiting

    Process Control Instructions Chapter 1 Item Description 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).
  • Page 252: Cv Rate-Of-Change Limiting

    Chapter 1 Process Control Instructions Item Description 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.
  • Page 253: Cv Windup Limiting

    Process Control Instructions Chapter 1 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.
  • Page 254: Execution

    Chapter 1 Process Control Instructions Execution Math status flags are set for the CV output. Condition Function Block Action Structured Text Action Prescan InstructionFirstScan is set InstructionFirstScan is set Instruction First Scan If CVFault and CVEUSpanInv are set, see Processing Faults. If CVFault and CVEUSpanInv are cleared: 1.
  • Page 255: Operating Modes

    Process Control Instructions Chapter 1 The following diagram shows how the PIDE instruction changes between Program control and Operator control. For more information on program and operator control, refer to Program/Operator Control. See also Program/Operator Control page 502 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.
  • Page 256 Chapter 1 Process Control Instructions 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.
  • Page 257: Convert The Pv And Sp Values To Percent

    Process Control Instructions Chapter 1 Convert the PV and SP Values to The instruction converts PV and SP to a percent and calculates the error before performing the PID control algorithm. The error is the difference between the PV Percent and SP values.
  • Page 258 Chapter 1 Process Control Instructions Item Description WindupLOut is cleared InitPrimary is set WindupHOut is set WindupLOut is set CVInitializing is set or not Cascade/Ratio mode CVInitializing is cleared and Cascade/Ration mode SHPAlarm is set or appropriate Cv alarm SHPAlarm is cleared and no CV alarm SPAlarm is set or appropriate CV alarm SPAlarm is cleared and no CV alarm 1.
  • Page 259: Processing Faults

    Process Control Instructions Chapter 1 8. The instruction clears WindupLOut when SPLAlarm is cleared and not (ControlAction is cleared and CVLAlarm is set) and not (ControlAction is set and CVHAlarm is set). Processing Faults The following table describes how the instruction handles execution faults: Fault Condition Action •...
  • Page 260: Update The Cvoper And Cvprog Values

    Chapter 1 Process Control Instructions 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 CVProg If not in the Operator Manual mode, the PIDE instruction sets CVOper = CV. This obtains bumpless mode switching from any control to the Operator Manual Values mode.
  • Page 261: Sp High/Low Limiting

    Process Control Instructions Chapter 1 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. Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 263: Drives Drives Instructions

    Chapter 2 Drives Drives Instructions The Drives instructions include the following information. Available Instructions Ladder Diagram Not available Function Block and Structured Text INTG PMUL SCRV UPDN HMIBC If you want to Use this instruction Execute an integral operation. INTG Execute a PI algorithm.
  • Page 264: Integrator (Intg)

    Chapter 2 Drives 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. The INTG instruction implements an integral operation. This instruction is designed to execute in a task where the scan rate remains constant.
  • Page 265 Drives Chapter 2 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 Initialize BOOL...
  • Page 266 Chapter 2 Drives RTSTimeStamp DINT Module time stamp value for real time sampling mode. Valid = 0 to 32,767ms Default = 0 Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the algorithm.
  • Page 267 Drives Chapter 2 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.
  • Page 268 Chapter 2 Drives 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.
  • Page 269 Drives Chapter 2 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.
  • Page 270: Proportional + Integral (Pi)

    Chapter 2 Drives See also Function Block Attributes page 491 Common Attributes page 537 Structured Text Syntax page 508 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.
  • Page 271 Drives Chapter 2 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 Data Type Description Parameter EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs are not updated. Default is set.
  • Page 272 Chapter 2 Drives Input Data Type Description Parameter 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.
  • Page 273 Drives Chapter 2 Input Data Type Description Parameter 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.
  • Page 274 Chapter 2 Drives Output Data Type Description Parameter RTSTimeStampInv BOOL Invalid RTSTimeStamp value. (Status.30) DeltaT (Status.31) BOOL Invalid DeltaT value. Description The PI instruction uses the position form of the PI algorithm. This means the gain terms are applied directly to the input signal, rather than to the change in the input signal.
  • Page 275 Drives Chapter 2 • High Limit = 0.7π/DeltaT • WldInput = In Operating in Non-Linear Mode In non-linear mode, the instruction uses the non-linear gain mode selected by ParabolicLinear to compute the actual proportional and integral gains. The gains specified by Kp and Wld are multiplied by 1.0 when In = 0. Separate proportional and integral algorithms increase or decrease the proportional or integral gain as the magnitude of error changes.
  • Page 276 Chapter 2 Drives The following diagram illustrates the maximum and minimum gain curves that represent the parabolic and linear gain equations. The instruction calculates the value for Out using these equations: Value Equation Kp shaping gain multiplier Kp input ratio Kp ratio Kps shaping gain Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 277 Drives Chapter 2 Proportional output Wld shaping gain Wld input Wld input ratio Wld ratio Wlds shaping gain Wlds limits Integral output Output Limiting The instruction stops the ITerm windup based on the state of the hold inputs. Condition Action Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 278 Chapter 2 Drives 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.
  • Page 279 Drives Chapter 2 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...
  • Page 280 Chapter 2 Drives PI Instruction: Linear Mode The following example shows the PI instruction used as a velocity regulator. In this example, velocity error is created by subtracting the velocity feedback signal (see the PMUL instruction example) from the system’s velocity reference (through the SCRV instruction).
  • Page 281: Pulse Multiplier (Pmul)

    Drives Chapter 2 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;...
  • Page 282 Chapter 2 Drives 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...
  • Page 283 Drives Chapter 2 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 (In ) in Relative mode.
  • Page 284 Chapter 2 Drives 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. Calculating the Output and Remainder The PMUL instruction uses these equations to calculate Out in either relative or absolute mode:...
  • Page 285 Drives Chapter 2 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.
  • Page 286 Chapter 2 Drives 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.
  • Page 287 Drives Chapter 2 value so that all counts or "pulses" are ultimately accounted for and no data is lost in the system. The output of the block, Out always yields a whole number in a floating point data type. Function Block Assuming Initial_Position = 0 and Multiplier = 2500 =>...
  • Page 288 Chapter 2 Drives the multipliers of both instructions being a ratio of 1/4, motor B needs to rotate once for every four revolutions of Motor A in order to maintain an accumulated value of zero in the UPDN accumulator. Any value other than zero on the output of the UPDN instruction is viewed as Position_error and can be regulated and driven back out to motor B in order to maintain a phase-lock between the two motors.
  • Page 289: S-Curve (Scrv)

    Drives Chapter 2 Position_error := UPDN_02.Out; See also Common Attributes page 537 Structured Text Syntax page 508 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.
  • Page 290 Chapter 2 Drives See Structured Text Syntax for more information of the syntax of expressions within structured text. S_CURVE Structure Input Data Description Parameter Type EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs are not updated. Default is set.
  • Page 291 Drives Chapter 2 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.
  • Page 292 Chapter 2 Drives 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.
  • Page 293 Drives Chapter 2 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.
  • Page 294 Chapter 2 Drives 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).
  • Page 295 Drives Chapter 2 region 3 When: the SCRV block does not reach the AccelRate or DecelRate. The Out does the following: where: Affects Math Status Flags Major/Minor Faults None specific to this instruction. See Common Attributes for operand-related faults. Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 296 Chapter 2 Drives 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.
  • Page 297 Drives Chapter 2 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 page 537 Structured Text Syntax...
  • Page 298: Second-Order Controller (Soc)

    Chapter 2 Drives 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.
  • Page 299 Drives Chapter 2 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 Initialize BOOL...
  • Page 300 Chapter 2 Drives Input Parameter Data Type Description 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...
  • Page 301 Drives Chapter 2 Output Parameter Data Type Description RTSTimeInv BOOL Invalid RTSTime value. (Satus.29) RTSTimeStampInv BOOL Invalid RTSTimeStamp value. (Status.30) DeltaT (Status.31) BOOL Invalid DeltaT value. 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.
  • Page 302 Chapter 2 Drives Parameter Limitations The following SOC parameters have these limits on valid values. Parameter Limit WLead where DeltaT is in seconds WLag where DeltaT is in seconds ZetaLead LowLimit = 0.0 HighLimit = 10.0 Whenever the value computed for the output is invalid or NAN, the instruction sets Out = the invalid value.
  • Page 303 Drives Chapter 2 where: The instruction also limits the value of Out based on the HighLimit and LowLimit values. Then: HighLimit LowLimit Out = LowLimit Integrator = IntegratorLowLimit HighLowLimsInv is set HighAlarm is set LowAlarm is set HighLimit Out = HighLimit IntegratorLowLimit HighAlarm is set LowLimit...
  • Page 304 Chapter 2 Drives Structured Text Condition/State Action Taken Prescan See Prescan in the Function Block table. Normal Execution See Tag.EnableIn is true in the Function Block table. Postscan See Postscan in the Function Block table. Example The SOC instruction is a specialized function block that is used in applications where energy is transferred between two sections through a spring-mass system.
  • Page 305 Drives Chapter 2 Its corresponding bode diagram is shown in Diagram B below. The SOC instruction can be used in a torque or tension regulating application where a load cell or force transducer is used as feedback and the output of the regulating scheme operates directly on the torque (current) minor loop of the drive.
  • Page 306 Chapter 2 Drives 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, (>...
  • Page 307 Drives Chapter 2 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 page 491 Common Attributes page 537...
  • Page 308: Up/Down Accumulator (Updn)

    Chapter 2 Drives 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.
  • Page 309 Drives Chapter 2 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.
  • Page 310 Chapter 2 Drives Description The UPDN instruction follows these algorithms. Condition Action Hold is cleared AccumValue = AccumValue + InPlus - InMinus Out = AccumValue Initialize is cleared Hold is set and AccumValue = AccumValue Initialize is Out = AccumValue cleared Initialize is set AccumValue...
  • Page 311 Drives Chapter 2 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.
  • Page 312: Hmi Button Control (Hmibc)

    Chapter 2 Drives 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 page 537 Structured Text Syntax...
  • Page 313 Drives Chapter 2 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.
  • Page 314 Chapter 2 Drives 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...
  • Page 315 Drives Chapter 2 Output parameter Data Type Description BOOL When EnableIn is true: Cleared to false when none of the registered HMI devices buttons are pressed. Set to true when at least one registered HMI button is pressed. When EnableIn is false : Cleared to false Default value is false.
  • Page 316 Chapter 2 Drives Condition/State Action Taken Postscan The instruction executes. Examples Ladder Diagram • An HMIBC instruction is an input instruction and cannot be placed on a rung by itself. • An HMIBC instruction is highlighted when active. Function Block The following example shows the HMIBC instruction as it appears in a function block diagram.
  • Page 317 Drives Chapter 2 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 page 551 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 319: Filter

    Chapter 3 Filter Filter Instructions The Filter instructions include these instructions: Available Instructions Ladder Diagram This instruction is not available in Ladder Diagram Function Block and Structured Text DERV LDL2 NTCH If you want to Use this instruction Calculate the amount of change of a signal over time in DERV per-second units.
  • Page 320: Derivative (Derv)

    Chapter 3 Filter 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. The DERV instruction calculates the amount of change of a signal over time in per-second units.
  • Page 321 Filter Chapter 3 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 Gain REAL...
  • Page 322 Chapter 3 Filter RTSMissed (Status.28) BOOL Only used in real time sampling mode. Set to true when ABS (DeltaT - RTSTime) > 1 millisecond. RTSTimeInv (Status.29) BOOL Invalid RTSTime value. RTSTimeStampInv BOOL Invalid RTSTimeStamp value. (Status.30) DeltaTInv (Status.31) BOOL Invalid DeltaT value. Structured Text Operand Type...
  • Page 323 Filter Chapter 3 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.
  • Page 324: High Pass Filter (Hpf)

    Chapter 3 Filter 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 page 491 Common Attributes page 537 Structured Text Syntax page 508 High Pass Filter (HPF)
  • Page 325 Filter Chapter 3 Operands Function Block Operand Type Format Description HPF tag FILTER_HIGH_PASS structure HPF 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. REAL The analog signal input to the instruction.
  • Page 326 Chapter 3 Filter Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the algorithm. DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate the process output.
  • Page 327 Filter Chapter 3 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: When: The instruction uses this transfer function: Order = 1...
  • Page 328 Chapter 3 Filter 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 Instruction first scan Recalculate coefficients.
  • Page 329 Filter Chapter 3 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...
  • Page 330: Low Pass Filter (Lpf)

    Chapter 3 Filter 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.
  • Page 331 Filter Chapter 3 FILTER_LOW_PASS 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 Initialize BOOL...
  • Page 332 Chapter 3 Filter Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled Cleared to false if Out overflows. REAL The calculated output of the algorithm. DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate the process output.
  • Page 333 Filter Chapter 3 The LPF instruction uses these equations: When: The instruction uses this Laplace transfer function: Order = 1 Order = 2 Order = 3 with these parameters limits (where DeltaT is in seconds): Parameter Limitations WLag first order LowLimit WLag second order LowLimit...
  • Page 334 Chapter 3 Filter 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.
  • Page 335 Filter Chapter 3 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...
  • Page 336: Notch Filter (Ntch)

    Chapter 3 Filter 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 page 491 Common Attributes page 537 Structured Text Syntax page 508 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.
  • Page 337 Filter Chapter 3 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. REAL The analog signal input to the instruction.
  • Page 338 Chapter 3 Filter Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the algorithm. DeltaT REAL Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate the process output.
  • Page 339 Filter Chapter 3 Parameter Limitations WNotch second order LowLimit WNotch fourth order LowLimit HighLimit QFactor LowLimit = 0.5 HighLimit = 100.0 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 = Affects Math Status Flags Major/Minor Faults...
  • Page 340 Chapter 3 Filter Example The NTCH instruction attenuates a specific resonance frequency. Typically, these resonance frequencies are directly in the range of response being regulated by the closed loop control system. Often, they are generated by loose mechanical linkages that cause backlash and vibration in the system. Although the best solution is to correct the mechanical compliance in the machinery, the notch filter can be used to soften the effects of these signals in the closed loop regulating scheme.
  • Page 341: Second-Order Lead Lag (Ldl2)

    Filter Chapter 3 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 page 537 Structured Text Syntax page 508 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...
  • Page 342 Chapter 3 Filter 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. REAL The analog signal input to the instruction.
  • Page 343 Filter Chapter 3 TimingMode DINT Selects timing execution mode. 0 = Periodic mode 1 = Oversample mode 2 = Real time sampling mode Valid = 0 to 2 Default = 0 RTSTimeStamp DINT Module time stamp value for real time sampling mode. Valid = 0 to 32,767ms Default = 0 Output Parameter...
  • Page 344 Chapter 3 Filter 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.
  • Page 345 Filter Chapter 3 WLead:WLag ratio If WLead > WLag, no limitations If WLag > WLead: • No minimum limitation for WLag:WLead • First order maximum for WLag:WLead = 40:1 and the instruction limits WLag to enforce this ratio • Second order maximum for WLag:WLead = 10:1 and the instruction limits WLag to enforce this ratio ZetaLead second order only LowLimit = 0.0...
  • Page 346 Chapter 3 Filter 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.
  • Page 347 Filter Chapter 3 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 page 491 Common Attributes page 537 Structured Text Syntax page 508 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 349: Select_Limit Instructions

    Chapter 4 Select_Limit Select/Limit Instructions The Select/Limit instructions include these instructions: Available Instructions Ladder Diagram This instruction is not available in Ladder Diagram. Function Block and Structured Text ESEL RLIM SNEG SSUM If you want to Use this instruction Select one of as many as six inputs. ESEL Limit an analog input between two values.
  • Page 350: Enhanced Select (Esel)

    Chapter 4 Select_Limit Instructions 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: •...
  • Page 351 Select_Limit Instructions Chapter 4 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.
  • Page 352 Chapter 4 Select_Limit Instructions 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.
  • Page 353 Select_Limit Instructions Chapter 4 ProgSelector DINT Program selector input. When the selector mode is manual select and the instruction is in Program control, ProgSelector determines which input (In1-In6) to move into Out. If ProgSelector = 0, the instruction does not update Out.
  • Page 354 Chapter 4 Select_Limit Instructions Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the algorithm. SelectedIn DINT Number of input selected. The instruction uses this value to display the number of the input currently being placed into the output.
  • Page 355 Select_Limit Instructions Chapter 4 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...
  • Page 356 Chapter 4 Select_Limit Instructions (2) You can lock the instruction in Program control mode by leaving ProgProgReq true while ProgOperReq is false. Affects Math Status Flags Major/Minor Faults None specific to this instruction. See Common Attributes for operand-related faults. Execution Function Block Condition/State Action Taken...
  • Page 357: High/Low Limit (Hll)

    Select_Limit Instructions Chapter 4 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 page 491 Common Attributes page 537 Structured Text Syntax page 508 Function Block Faceplate Controls page 552 High/Low Limit (HLL)
  • Page 358 Chapter 4 Select_Limit Instructions 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 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 359 Select_Limit Instructions Chapter 4 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 HighLimit REAL...
  • Page 360 Chapter 4 Select_Limit Instructions 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...
  • Page 361 Select_Limit Instructions Chapter 4 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.
  • Page 362: Multiplexer (Mux)

    Chapter 4 Select_Limit Instructions 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.
  • Page 363 Select_Limit Instructions Chapter 4 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. REAL The first analog signal input to the instruction. Valid = any float Default = 0.0 REAL The second analog signal input to the...
  • Page 364 Chapter 4 Select_Limit Instructions Output Parameter Data Type Description EnableOut BOOL Indicates if the instruction is enabled. Cleared on overflow. REAL The selected output of the algorithm. Math status flags are set for this output. Status DINT Status of the function block. InstructFault (Status.0) BOOL The instruction detected one of the following...
  • Page 365: Rate Limiter (Rlim)

    Select_Limit Instructions Chapter 4 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 = In , which becomes an input parameter for function_block_C. For example, if select_value = 2, the instruction sets Out = analog_input2.
  • Page 366 Chapter 4 Select_Limit Instructions 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 Parameter Data Type Description EnableIn BOOL Enable input. If false, the instruction does not execute and outputs are not updated. Default is true.
  • Page 367 Select_Limit Instructions Chapter 4 TimingMode DINT Selects timing execution mode. 0 = Period mode 1 = oversample mode 2 = real time sampling mode Valid = 0 to 2 Default = 0 OversampleDT REAL Execution time for oversample mode. Valid = 0 to 4194.303 seconds Default = 0 RTSTime DINT...
  • Page 368 Chapter 4 Select_Limit Instructions Structured Text Operand Type Format Description RLIM tag RATE_LIMITER structure RLIM structure See Structured Text Syntax for more information on the syntax of expressions within structured text. Description The RLIM instruction provides separate increment and decrement rates in per- second units.
  • Page 369 Select_Limit Instructions Chapter 4 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.
  • Page 370: Select (Sel)

    Chapter 4 Select_Limit Instructions 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.
  • Page 371 Select_Limit Instructions Chapter 4 SELECT 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. REAL The first analog signal input to the instruction. Valid = any float Default = 0.0 REAL The second analog signal input to...
  • Page 372 Chapter 4 Select_Limit Instructions 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.
  • Page 373: Selected Negate (Sneg)

    Select_Limit Instructions Chapter 4 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.
  • Page 374 Chapter 4 Select_Limit Instructions SNEG 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. Structured Text: No effect. The instruction executes. REAL The analog signal input to the instruction.
  • Page 375 Select_Limit Instructions Chapter 4 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.
  • Page 376: Selected Summer (Ssum)

    Chapter 4 Select_Limit Instructions See also Common Attributes page 537 Structured Text Syntax page 508 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.
  • Page 377 Select_Limit Instructions Chapter 4 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. REAL The first input to be summed. Valid = any float Default = 0.0 Gain1 REAL...
  • Page 378 Chapter 4 Select_Limit Instructions Gain6 REAL Gain for the sixth input. Valid = any float Default = 1.0 Select6 BOOL Selector signal for the sixth input. Default is false. REAL The seventh input to be summed. Valid = any float Default = 0.0 Gain7 REAL...
  • Page 379 Select_Limit Instructions Chapter 4 Affects Math Status Flags 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.
  • Page 380 Chapter 4 Select_Limit Instructions 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 page 537 Structured Text Syntax page 508 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 381: Statistical Instructions

    Chapter 5 Statistical Statistical Instructions The Statistical instructions include these instructions: Available Instructions Ladder Diagram Not available Function Block and Structured Text MAVE MAXC MINC MSTD If you want to Use this instruction Calculate a time average value. MAVE Find the maximum signal in time. MAXC Find the minimum signal in time.
  • Page 382: Moving Average (Mave)

    Chapter 5 Statistical Instructions 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.
  • Page 383 Statistical Instructions Chapter 5 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 InFault BOOL...
  • Page 384 Chapter 5 Statistical Instructions Output Data Type Description Parameter EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the algorithm. Status DINT Status of the function block. InstructFault BOOL The instruction detected one of the following execution (Status.0) errors.
  • Page 385 Statistical Instructions Chapter 5 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 InFault BOOL...
  • Page 386 Chapter 5 Statistical Instructions Output Data Type Description Parameter EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows. REAL The calculated output of the algorithm. Status DINT Status of the function block. InstructFault BOOL The instruction detected one of the following execution (Status.0) errors.
  • Page 387 Statistical Instructions Chapter 5 Initializing the Averaging Algorithm Certain conditions, such as instruction first scan and instruction first run, require the instruction to initialize the moving average algorithm. When this occurs, the instruction considers the sample StorageArray empty and incrementally averages samples from 1 to the NumberOfSamples value.
  • Page 388: Maximum Capture (Maxc)

    Chapter 5 Statistical Instructions 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;...
  • Page 389 Statistical Instructions Chapter 5 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.
  • Page 390 Chapter 5 Statistical Instructions 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 >...
  • Page 391 Statistical Instructions Chapter 5 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;...
  • Page 392: Minimum Capture (Minc)

    Chapter 5 Statistical Instructions 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.
  • Page 393 Statistical Instructions Chapter 5 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. REAL The analog signal input to the instruction. Valid = any float Default = 0.0 Reset BOOL...
  • Page 394 Chapter 5 Statistical Instructions 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.
  • Page 395: Moving Standard Deviation (Mstd)

    Statistical Instructions Chapter 5 MINCTag.ResetValue := reset_value; MINC(MINCTag); result := MINCTag.Out; See also Common Attributes page 537 Structured Text Syntax page 508 Moving Standard This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Deviation (MSTD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers.
  • Page 396 Chapter 5 Statistical Instructions 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...
  • Page 397 Statistical Instructions Chapter 5 Output Parameter Data Type Description EnableOut BOOL Indicates if instruction is enabled. Cleared to false if Out overflows REAL The calculated output of the algorithm. Average REAL The calculated average of the algorithm. Status DINT Status of the function block. InstructFault (Status.0) BOOL The instruction detected one of the following...
  • Page 398 Chapter 5 Statistical Instructions 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, the instruction re-calculates the standard deviation from the beginning of the sample array to the new NumberOfSamples value.
  • Page 399 Statistical Instructions Chapter 5 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.
  • Page 400 Chapter 5 Statistical Instructions Structured Text MSTD_01.In := input_value; MSTD_01.SampleEnable := enable_sample; MSTD(MSTD_01,storage); deviation := MSTD_01.Out; See also Common Attributes page 537 Structured Text Syntax page 508 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 401: Logical And Move

    Chapter 6 Logical and Move Logical and Move These instructions are used to perform logical operations on and move output data. Instructions Available Instructions Ladder Diagram and Structured Text JKFF RESD SETD Function Block Not available Structured Text JKFF RESD SETD See also Filter Instructions...
  • Page 402 Chapter 6 Logical and Move 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 Parameter Data Type Description EnableIn BOOL...
  • Page 403 Logical and Move Chapter 6 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).
  • Page 404: Jk Flip-Flop (Jkff)

    Chapter 6 Logical and Move 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 Function Block Structured Text DFF_03.D := d_input;...
  • Page 405 Logical and Move Chapter 6 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.
  • Page 406 Chapter 6 Logical and Move 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.
  • Page 407: Reset Dominant (Resd)

    Logical and Move Chapter 6 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 Function Block Structured Text JKFF_01.Clear := clear_input;...
  • Page 408 Chapter 6 Logical and Move 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.
  • Page 409 Logical and Move Chapter 6 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.
  • Page 410 Chapter 6 Logical and Move 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 page 537 Structured Text Syntax page 508 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 411: Set Dominant (Setd)

    Logical and Move Chapter 6 Set Dominant (SETD) This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. The SETD instruction uses Set and Reset inputs to control latched outputs. The Set input has precedence over the Reset input.
  • Page 412 Chapter 6 Logical and Move 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. BOOL Set input to the instruction. Default is cleared. Clear BOOL Reset input to the instruction.
  • Page 413 Logical and Move Chapter 6 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.
  • Page 415: Equipment Phase Equipment Phase Instructions

    Chapter 7 Equipment Phase Instructions Equipment Phase The Equipment Phase instructions include: Instructions Available Instructions Ladder Diagram and Structured Text PCMD POVR PCLF PXRQ PRNP PATT PDET 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 should go to the next state...
  • Page 416 Chapter 7 Equipment Phase Instructions Attach to Equipment Phase This instruction applies to the CompactLogix 5370 and CompactLogix 5380, ControlLogix 5570 and ControlLogix 5580, and Compact GuardLogix 5370 and (PATT) Compact GuardLogix 5380 controllers. Use the PATT instruction to take ownership of an equipment phase to either: •...
  • Page 417 Equipment Phase Instructions Chapter 7 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 for its success or failure, enter a DINT tag in which to store the result code.
  • Page 418 Chapter 7 Equipment Phase Instructions Avoid or plan for a result code = 24582. On each execution, the PATT instruction tries to take ownership of the equipment phase. Once a program owns an equipment phase, another execution of the PATT instruction produces a result code = 24582.
  • Page 419 Equipment Phase Instructions Chapter 7 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...
  • Page 420 Chapter 7 Equipment Phase Instructions Done = 1. (This signals the sequence to go to the next step.) Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 421: Detach From Equipment Phase (Pdet)

    Equipment Phase Instructions Chapter 7 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.
  • Page 422 Chapter 7 Equipment Phase Instructions 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...
  • Page 423 Equipment Phase Instructions Chapter 7 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.
  • Page 424: Equipment Phase Clear Failure (Pclf)

    Chapter 7 Equipment Phase Instructions Structured Text When the sequence executes, the Relinquish_Ownership action: • Relinquishes ownership of the equipment phase. • Clears the ownership flags (bits that the SFC set when it took ownership of the equipment phases). Using an action Qualifier of type P1 limits the action execution to the first scan of that step.
  • Page 425 Equipment Phase Instructions Chapter 7 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.
  • Page 426 Chapter 7 Equipment Phase Instructions 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;...
  • Page 427: Equipment Phase Command (Pcmd)

    Equipment Phase Instructions Chapter 7 This instruction applies to the CompactLogix 5370 and CompactLogix 5380, Equipment Phase ControlLogix 5570 and ControlLogix 5580, and Compact GuardLogix 5370 and Command (PCMD) Compact GuardLogix 5380 controllers. The PCMD instruction transitions an equipment phase to the next state or sub- state.
  • Page 428 Chapter 7 Equipment Phase Instructions 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.
  • Page 429 Equipment Phase Instructions Chapter 7 Guidelines for using the PCMD Instruction Guideline Details Limit execution of a PCMD Limit the execution of the PCMD instruction to a single scan. Each command instruction to a single scan. applies to only a specific state or states. Once the equipment phase changes state, the command is no longer valid.
  • Page 430 Chapter 7 Equipment Phase Instructions Anticipate ownership conflicts or other DINT tag, in which to store a code possible errors for the result of the execution of the instruction. Do not anticipate ownership conflicts or other possible errors Want to interpret the result code, refer to the Result Codes table below.
  • Page 431 Equipment Phase Instructions Chapter 7 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.
  • Page 432 Chapter 7 Equipment Phase Instructions 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.
  • Page 433: Equipment Phase External Request (Pxrq)

    Equipment Phase Instructions Chapter 7 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.
  • Page 434 Chapter 7 Equipment Phase Instructions 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 that controls the operation. External Request request enumeration value Type of request.
  • Page 435 Equipment Phase Instructions Chapter 7 • Diagnose the cause of an error If ER = 1, the error code gives diagnostic information. To interpret the error code, see PXRQ Error Codes. EXERR If ER = 1, the extended error code gives •...
  • Page 436 Chapter 7 Equipment Phase Instructions Configure the PXRQ Instruction Then configure the PXRQ instruction as follows: If want to: External Request Data Value Array Value Element Download all input parameters Download Input DINT[0] Parameters Download a single input parameter Download Input DINT[0] parameter ID Parameters...
  • Page 437 Equipment Phase Instructions Chapter 7 Number of phases to receive message DINT[1] DINT[2] Message Value DINT[3] Message Value 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...
  • Page 438 Chapter 7 Equipment Phase Instructions Download the low limit of an input parameter Download Batch Data DINT[0] The input parameter tag stores the low limit. Download the high limit of an input Download Batch Data DINT[0] parameter The input parameter tag stores the high limit.
  • Page 439 Equipment Phase Instructions Chapter 7 Upload a new container priority for the current Upload Container Binding DINT[0] parameter ID that has value binding Priority Download information regarding the Download Sufficient DINT[0] parameter ID in which to store availability of sufficient material Material the value In the result value:...
  • Page 440 Chapter 7 Equipment Phase Instructions Upload Material Manager DINT[1] Phase report ID (specify the Database Data phase report tag from which to upload) DINT[2] Material controller ID DINT[3] Attribute ID (specify the single attribute) Upload lot attribute Upload Material Manager DINT[0] Database Data DINT[1]...
  • Page 441 Equipment Phase Instructions Chapter 7 PXRQ Error Codes ERR (hex) EXERR (hex) Description Recommended Action 0000 The PXRQ instruction was aborted None before it sent the request to FactoryTalk Batch software. 0000 The PXRQ instruction was aborted None after it sent the request to FactoryTalk Batch software 0000 Two or more PXRQ instructions...
  • Page 442 Chapter 7 Equipment Phase Instructions 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 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 443: Equipment Phase Failure (Pfl)

    Equipment Phase Instructions Chapter 7 Structured Text See also Equipment Phase Instructions page 415 Index Through Arrays page 551 Equipment Phase Failure This instruction applies to the CompactLogix 5370 and CompactLogix 5380, ControlLogix 5570 and ControlLogix 5580, and Compact GuardLogix 5370 and (PFL) Compact GuardLogix 5380 controllers.
  • Page 444 Chapter 7 Equipment Phase Instructions 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);...
  • Page 445 Equipment Phase Instructions Chapter 7 Structured Text The operands are the same as those for the Ladder Diagram PFL instruction. Guidelines for using the PFL Instruction Guideline Details Put the PFL The PFL instruction sets the failure code for the equipment phase in which the instruction is put. There instruction in the is no operand to identify a specific equipment phase.
  • Page 446 Chapter 7 Equipment Phase Instructions To take action The PFL instruction writes its value to the Failure member of the PHASE tag for the equipment phase. when a failure occurs, monitor the Failure member of the PHASE tag. Number Description When creating an equipment phase, the Logix Designer application creates a tag for the status of the equipment phase.
  • Page 447 Equipment Phase Instructions Chapter 7 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...
  • Page 448: Equipment Phase New Parameters (Prnp)

    Chapter 7 Equipment Phase Instructions Structured Text In the prestate routine of an equipment phase... See also Equipment Phase Instructions page 415 Index Through Arrays page 551 Equipment Phase New This instruction applies to the CompactLogix 5370 and CompactLogix 5380, ControlLogix 5570 and ControlLogix 5580, and Compact GuardLogix 5370 and Parameters (PRNP) Compact GuardLogix 5380 controllers.
  • Page 449 Equipment Phase Instructions Chapter 7 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.
  • Page 450 Chapter 7 Equipment Phase Instructions Example Ladder Diagram Structured Text If PRNPTest.NewInputParameters = 1 (FactoryTalk Batch software has new input parameter for the equipment phase), then If Enable_PXRQ = 1 (Let the PXRQ instruction execute.) Or RQ_Control[0].PC = 0 (The PXRQ instruction is in process.), then Datavalues[0] = this set the PXRQ instruction for transfer of control.
  • Page 451: Equipment Phase Override Command (Povr)

    Equipment Phase Instructions Chapter 7 If RQ_Control[0].PC = 1 (The request is complete.), then ThisPhase.NewInputParameters = 0 via the PRNP instruction Otherwise Enable_PXRQ = 1 (Let the PXRQ instruction execute the next time new input parameters are available.) See also Equipment Phase Instructions page 415 Index Through Arrays...
  • Page 452 Chapter 7 Equipment Phase Instructions 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: •...
  • Page 453 Equipment Phase Instructions Chapter 7 POVR Result Codes If assigning a tag to store the result of a POVR instruction, the instruction returns one of these codes when it executes: Code (Dec) Description Successful command. 24577 Invalid command. 24578 Invalid command for the current state of the equipment phase. For example, if the equipment phase is in the stopping state, then a hold command is not valid.
  • Page 454 Chapter 7 Equipment Phase Instructions 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.
  • Page 455: Equipment Phase Paused (Ppd)

    Equipment Phase Instructions Chapter 7 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 page 415 Index Through Arrays page 551 Equipment Phase Paused This instruction applies to the CompactLogix 5370 and CompactLogix 5380, ControlLogix 5570 and ControlLogix 5580, and Compact GuardLogix 5370 and (PPD)
  • Page 456 Chapter 7 Equipment Phase Instructions 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.
  • Page 457 Equipment Phase Instructions Chapter 7 The Pause substate uses these three bits: • PauseEnabled: The PauseEnabled bit maintains the status of processing a Pause command. This is bit 0 of the Pause substate. When Paused is ON (1), execution of a PPD instruction pauses execution of the state routine's logic.
  • Page 458 Chapter 7 Equipment Phase Instructions Structured Text None Enter the parentheses ( ) after the instruction mnemonic, even though there are no operands. Guidelines for using the PPD Instruction Guideline Details Organize logic as a series of steps. PPD instructions (breakpoints) are easiest to use if the logic moves through defined steps, such as a state machine or SFC.
  • Page 459 Equipment Phase Instructions Chapter 7 Major/Minor Faults A major fault occurs if: Fault type Fault code Instruction is called from outside an Equipment Phase program. If an Add-On Instruction uses a PPD instruction, and a non-equipment phase program calls the Add-On Instruction, Logix Designer gives a warning. Check the Add-On Instruction for this instruction to disallow it.
  • Page 460: Phase State Complete (Psc)

    Chapter 7 Equipment Phase Instructions Equipment Phase Command page 427 Phase State Complete (PSC) This instruction applies to the CompactLogix 5370 and CompactLogix 5380, ControlLogix 5570 and ControlLogix 5580, and Compact GuardLogix 5370 and Compact GuardLogix 5380 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.
  • Page 461 Equipment Phase Instructions Chapter 7 Structured Text None Enter the parentheses ( ) after the instruction mnemonic, even though there are no operands. Guidelines for using the PSC Instruction Guideline Details Use the PSC instruction in each phase state routine that is added to an equipment phase. Without a PSC instruction, the equipment phase remains in the state and does not go to the next state.
  • Page 462 Chapter 7 Equipment Phase Instructions Major/Minor Faults A major fault will occur if: Fault type Fault code Instruction is called from outside an equipment phase program. If an Add-On Instruction used a PSC instruction and a non-equipment phase program calls the Add-On Instruction, Logix Designer gives a warning. Check the Add-On Instruction for this instruction and disallow it.
  • Page 463 Equipment Phase Instructions Chapter 7 Examples Ladder Diagram Structured Text If TagEnableRunning And PSCTest.Running Then PSC(); End_if; Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 464 Chapter 7 Equipment Phase Instructions See also Equipment Phase Instructions page 415 Index Through Arrays page 551 Equipment Phase Override Command (POVR) page 451 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 465: Equipment Sequence Equipment Sequence Instructions

    Chapter 8 Equipment Sequence Equipment Sequence The following table lists the command instructions for Equipment Sequences. The instructions are available for routines that use the Ladder Diagram and the instructions Structured Text programming languages. They are not available for use in routines that use the Function Block and the Sequential Function Chart programming languages.
  • Page 466 Chapter 8 Equipment Sequence Available Languages Ladder Diagram Function Block This language is not available for this instruction. Structured Text: SATT(SequenceName,Result) Operands The SATT instruction uses the following operands. Operand Type Format Description Sequence Name Sequence name of the Equipment Equipment Sequence that you want to change to Sequence own (attach) to command (for example,...
  • Page 467 Equipment Sequence Chapter 8 Execution The following table describes the execution steps for SATT instructions. Ladder Diagram Condition Action Taken Prescan The rung-condition-out is set to false. Rung-condition-in is false The rung-condition-out is set to false. • The instruction executes. Rung-condition-in is true •...
  • Page 468: Detach From Equipment Sequence (Sdet)

    Chapter 8 Equipment Sequence Detach from Equipment Use the Detach from Equipment Sequence (SDET) instruction to relinquish ownership of an Equipment Sequence. After a program executes an SDET Sequence (SDET) instruction, the program no longer owns the Equipment Sequence. The Equipment Sequence is then available for ownership by another program or by FactoryTalk Batch software.
  • Page 469 Equipment Sequence Chapter 8 Condition Action Taken Rung-condition-in is false The rung-condition-out is set to false. Rung-condition-in is true The instruction executes. The rung-condition-out is set to true. Scan of structured text No action taken Instruction execution The instruction tries to take ownership of the specified Equipment Sequence.
  • Page 470: Equipment Sequence Assign Sequence Identifier (Sasi)

    Chapter 8 Equipment Sequence Equipment Sequence Assign Use the Assign Sequence Identifier (SASI) instruction to assign a sequence ID to the Equipment Sequence. You can only set the sequence ID when the following Sequence Identifier (SASI) prerequisites are met: • The controller is online.
  • Page 471: Equipment Sequence Clear Failure (Sclf)

    Equipment Sequence Chapter 8 Major/Minor Faults The SASI instruction cannot trigger a fault, so there are no fault conditions for this instruction. Execution Ladder Diagram Condition Action Taken Prescan The rung-condition-out is set to false. Rung-condition-in is false The rung-condition-out is set to false. •...
  • Page 472 Chapter 8 Equipment Sequence • 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. •...
  • Page 473: Equipment Sequence Command (Scmd)

    Equipment Sequence Chapter 8 Execution Ladder Diagram Condition Action Taken Prescan The rung-condition-out is set to false. Rung-condition-in is false The rung-condition-out is set to false. Rung-condition-in is true The instruction executes. The rung-condition-out is set to true. Scan of structured text No action taken Instruction execution The instruction tries to take ownership of the specified Equipment...
  • Page 474 Chapter 8 Equipment Sequence 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. When a tag is assigned to store the result of an SCMD instruction, the instruction returns one of five result codes when it runs.
  • Page 475 Equipment Sequence Chapter 8 Valid command states for the SCMD instruction Use the SCMD instruction transitions to command an Equipment Sequence to another state. The SCMD instruction commands may only be processed in certain states. The following table lists the states in which commands are valid. Command Valid in these states START...
  • Page 476: Equipment Sequence Diagram Instructions

    Chapter 8 Equipment Sequence Condition Action Taken Postscan No action taken. See also SCMD instruction examples page 487 Use an SOVR instruction instead of an SCMD instruction page 489 Result codes for SCMD instructions page 483 Guidelines for SCMD instructions page 480 Equipment Sequence The following table describes the Equipment Sequence Diagram instructions.
  • Page 477 Equipment Sequence Chapter 8 SOVR instruction ran successfully. The other four codes indicate that the instruction did not run successfully and provide additional information about the reason for the instruction failure. Available Languages Ladder Diagram Function Block This instruction is not available in Function Block. Structured Text SOVR(SequenceName,Command,Result) Operands...
  • Page 478 Chapter 8 Equipment Sequence Execution Ladder Diagram Condition Action Taken Prescan The rung-condition-out is set to false. Rung-condition-in is false The rung-condition-out is set to false. Rung-condition-in is true The instruction executes. The rung-condition-out is set to true. Scan of structured text No action taken Instruction execution The instruction commands the Equipment Sequence to the specified state.
  • Page 479: Guidelines For Satt Instructions

    Equipment Sequence Chapter 8 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.
  • Page 480: Guidelines For Scmd Instructions

    Chapter 8 Equipment Sequence 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.
  • Page 481: Result Codes For Satt Instructions

    Equipment Sequence Chapter 8 Limit execution of the SOVR instruction to a Limit the execution of the SOVR instruction to a single scan. Each command single scan. applies to only a specific state or states. Once the Equipment Sequence changes state, the command is no longer valid.
  • Page 482: Result Codes For Sclf Instructions

    Chapter 8 Equipment Sequence See also Attach to Equipment Sequence page 465 Equipment Sequence Instructions page 465 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 when it instructions executes.
  • Page 483: Result Codes For Scmd Instructions

    Equipment Sequence Chapter 8 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 these codes when it runs. instructions Code (Dec) Description The command was successful. The command was not executed because it was not possible at the time to generate an event to record the command.
  • Page 484: Result Codes For Sovr Instructions

    Chapter 8 Equipment Sequence 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 The command was successful. The command was not executed because it was not possible at the time to generate an event to record the command.
  • Page 485: Sasi Instruction Examples

    Equipment Sequence Chapter 8 SASI instruction examples The following example shows the SASI instruction as it appears in a ladder diagram and in structured text. Ladder Diagram Example 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.
  • Page 486: Satt Instruction Examples

    Chapter 8 Equipment Sequence 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 (AttachControl) then SATT (Make_Product_101, Result); end_if; See also Attach to Equipment Sequence page 465 Guidelines for SATT instructions page 479...
  • Page 487: Scmd Instruction Examples

    Equipment Sequence Chapter 8 See also Equipment Sequence Clear Failure page 471 Equipment Sequence Instructions page 465 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 (HoldControl)
  • Page 488: Sovr Instruction Examples

    Chapter 8 Equipment Sequence Structured Text (DetachControl) then SDET (Make_Product_101); end_if; See also Detach from Equipment Sequence page 468 Attach to Equipment Sequence page 465 Equipment Sequence instructions page 465 SOVR instruction examples The following examples show the SOVR instruction as it appears in a Ladder Diagram and in Structured Text.
  • Page 489: When Should I Use An Sovr Instruction Instead Of An Scmd Instruction

    Equipment Sequence Chapter 8 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? •...
  • Page 491 Chapter 9 Function Block Attributes 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 page 492 Latching Data page 493...
  • Page 492: Function Block Attributes

    Chapter 9 Function Block Attributes Choose the Function To control a device, use these elements: Block Elements 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)
  • Page 493: Latching Data

    Function Block Attributes Chapter 9 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.
  • Page 494: Function Block Responses To Overflow Conditions

    Chapter 9 Function Block Attributes 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. Function Block Responses In general, the function block instructions that maintain history do not update history with...
  • Page 495: Order Of Execution

    Function Block Attributes Chapter 9 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 •...
  • Page 496 Chapter 9 Function Block Attributes 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.
  • Page 497 Function Block Attributes Chapter 9 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.
  • Page 498 Chapter 9 Function Block Attributes Resolve Data Flow Between Two Blocks If you use two or more wires to connect two blocks, use the same data flow indicators for all of the wires between the two blocks. Create a One Scan Delay To produce a one scan delay between blocks, use the Assume Data Available indicator.
  • Page 499: Timing Modes

    Function Block Attributes Chapter 9 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. •...
  • Page 500 Chapter 9 Function Block Attributes discontinuity occurs in the process output. The severity of the discontinuity depends on the instruction and range over which DeltaT varies. A discontinuity occurs if the following happens: • Instruction is not executed during a scan. •...
  • Page 501 Function Block Attributes Chapter 9 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.
  • Page 502: Program/Operator Control

    Chapter 9 Function Block Attributes Overview of Timing Modes The following diagram shows how an instruction determines the appropriate timing mode. Program/Operator Control The following instructions support the concept of Program/Operator control. • Enhanced Select (ESEL) • Totalizer (TOT) • Enhanced PID (PIDE) •...
  • Page 503 Function Block Attributes Chapter 9 Input Description .ProgProgReq A program request to go to Program control. .ProgOperReq A program request to go to Operator control. .OperProgReq An operator request to go to Program control. .OperOperReq An operator request to go to Operator control. To determine whether an instruction is in Program or Operator control, examine the ProgOper output.
  • Page 504 Chapter 9 Function Block Attributes control until it receives a request to change. For example, the operator could set the OperOperReq input from a faceplate to take over control of that instruction. The following example shows how to lock an instruction into Program control. Operator request inputs to an instruction are always cleared by the instruction when it executes.
  • Page 505: Function Block States

    Function Block Attributes Chapter 9 In this example, a rung of ladder logic in another routine is used to one-shot latch a ProgAutoReq to a PIDE instruction when a push button is pushed. When the TIC101AutoReq push button is pressed, one-shot latch ProgAutoReq for the PIDE instruction TIC101.
  • Page 506 Chapter 9 Function Block Attributes If the EnableIn parameter is not wired, the instruction always executes as normal and EnableIn remains set. If you clear EnableIn, it changes to set the next time the instruction executes. Rockwell Automation Publication 1756-RM006K-EN-P - November 2018...
  • Page 507: Structured Text Programming

    Chapter 10 Structured Text Programming 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 page 508 Structured Text Components: Comments page 509 Structured Text Components: Assignments page 510...
  • Page 508 Chapter 10 Structured Text Programming 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.
  • Page 509 Structured Text Programming Chapter 10 See also Structured Text Components: Assignments page 510 Structured Text Components: Expressions page 513 Structured Text Components: Instructions page 519 Structured Text Components: Constructs page 520 Structured Text Components: Comments page 509 Structured Text To make your structured text easier to interpret, add comments to it. Components: Comments •...
  • Page 510: Structured Text Components: Assignments

    Chapter 10 Structured Text Programming For example: Format Example //comment At the beginning of a line //Check conveyor belt direction IF conveyor_direction THEN... At the end of a line ELSE //If conveyor isn’t moving, set alarm light light := 1; END_IF;...
  • Page 511: Specify A Non-Retentive Assignment

    , publication 1756-PM001 You can also use Input and Output program parameters which automatically buffer the data during logix execution. See LOGIX 5000 Controllers Program Parameters Programming Manual , publication 1756-PM021 See also Assign an ASCII character to a string data member...
  • Page 512: Assign An Ascii Character To A String Data Member

    Chapter 10 Structured Text Programming Component Description Represents the tag that is getting the new value; the tag must be a BOOL, SINT, INT, DINT, STRING, or REAL. Tip: The STRING tag is applicable toCompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
  • Page 513: Structured Text Components: Expressions

    Structured Text Programming Chapter 10 To add or insert a string of characters to a string tag, use either of these ASCII string instructions: Use this instruction Add characters to the end of a string CONCAT Insert characters into a string INSERT See also Structured Text Components: Expressions...
  • Page 514: Use Arithmetic Operators And Functions

    Chapter 10 Structured Text Programming Numeric expression: An expression that calculates an integer or floating-point value. • A numeric expression uses arithmetic operators, arithmetic functions, and bitwise operators. For example, tag1+5. • Nest a numeric expression within a BOOL expression. For example, (tag1+5)>65.
  • Page 515 Structured Text Programming Chapter 10 Use this function Optimal data type Absolute value ABS (numeric_expression) DINT, REAL Arc cosine ACOS (numeric_expression) REAL Arc sine ASIN (numeric_expression) REAL Arc tangent ATAN (numeric_expression) REAL Cosine COS (numeric_expression) REAL Radians to degrees DEG (numeric_expression) DINT, REAL Natural log LN (numeric_expression)
  • Page 516: Use Bitwise Operators

    Chapter 10 Structured Text Programming Use bitwise operators Bitwise operators manipulate the bits within a value based on two values. The following provides an overview of the bitwise operators. Use this operator Optimal data type bitwise AND &, AND DINT bitwise OR DINT bitwise exclusive OR...
  • Page 517: Use Relational Operators

    Structured Text Programming Chapter 10 The table provides examples of using logical operators. Use this format Example For this situation BOOLtag If photoeye is a BOOL tag and your specification says: "If photoeye_1 is on IF photoeye THEN... then..." NOT BOOLtag If photoeye is a BOOL tag and your specification says: "If photoeye is off IF NOT photoeye THEN...
  • Page 518 Chapter 10 Structured Text Programming The table provides examples of using relational operators Use this format Example For this situation Write value1 operator value2 If temp is a DINT tag and your specification says: ‘If temp is IF temp<100 THEN... less than 100⋅...
  • Page 519: Structured Text Components: Instructions

    Structured Text Programming Chapter 10 Structured Text Structured text statements can also be instructions. A structured text instruction executes each time it is scanned. A structured text instruction within a construct Components: Instructions 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.
  • Page 520: Structured Text Components: Constructs

    Chapter 10 Structured Text Programming END_IF; Structured Text Program constructs alone or nest within other constructs. Components: Use this construct Constructs Doing something if or when specific conditions occur IF. . . THEN Selecting what to do based on a numerical value CASE.
  • Page 521: Character String Literals

    Structured Text Programming Chapter 10 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.
  • Page 522: String Types

    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...
  • Page 523: Case_Of

    Structured Text Programming Chapter 10 CASE_OF Use CASE_OF to select what to do based on a numerical value. 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 number expression...
  • Page 524 Chapter 10 Structured Text Programming Multiple, distinct values value1, value2, valueN : <statement> Use a comma (,) to separate each value. A range of values value1..valueN : <statement> Use two periods (..) to identify the range. Distinct values plus a range of values valuea, valueb, value1..valueN : <statement> The CASE construct is similar to a switch statement in the C or C++ programming languages.
  • Page 525: For_Do

    Structured Text Programming Chapter 10 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.
  • Page 526 Chapter 10 Structured Text Programming 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.
  • Page 527: If_Then

    Structured Text Programming Chapter 10 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;...
  • Page 528 Chapter 10 Structured Text Programming Description The syntax is described in the table. To use ELSIF or ELSE, follow these guidelines. To select from several possible groups of statements, add one or more ELSIF statements. Each ELSIF represents an alternative path. Specify as many ELSIF paths as you need.
  • Page 529 Structured Text Programming Chapter 10 Affects Math Status Flags Major/Minor Faults None. Examples Example 1 IF…THEN If performing this Enter this structured text IF rejects > 3 then IF rejects > 3 THEN conveyor = off (0) conveyor := 0; alarm = on (1) alarm := 1;...
  • Page 530: Repeat_Until

    Chapter 10 Structured Text Programming 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;...
  • Page 531 Structured Text Programming Chapter 10 Structured Text Operand Type Format Enter bool_ BOOL Tag expression BOOL tag or expression that evaluates to a BOOL value expression (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.
  • Page 532 Chapter 10 Structured Text Programming Affects Math Status Flags Fault Conditions A major fault will occur if Fault type Fault code The construct loops too long Example 1 If performing the following, Enter this structured text The REPEAT_UNTIL loop executes the statements in the construct and then pos := -1;...
  • Page 533: While_Do

    Structured Text Programming Chapter 10 Example 2 If performing the following, Enter this structured text Move ASCII characters from a SINT array into a string tag. (In element_number := 0; a SINT array, each element holds one character.) Stop when SIZE(SINT_array, 0, SINT_array_size);...
  • Page 534 Chapter 10 Structured Text Programming 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.
  • Page 535: Structured Text Attributes

    Structured Text Programming Chapter 10 Example 1 If performing the following, Enter this structured text The WHILE_DO loop evaluates its conditions first. If pos := 0; the conditions are true, the controller then executes While ((pos <= 100) & structarray[pos].value <> targetvalue)) do the statements within the loop.
  • Page 537: Common Attributes For Advanced Process Control And Drives Instructions

    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...
  • Page 538 Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions Status Flags Status Flag Description Description (For CompactLogix 5380, CompactLogix 5480, ControlLogix (For CompactLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 5370, ControlLogix controllers) 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers) S:FS The first scan flag is set by the controller:...
  • Page 539 Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 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 For example, adding 1 to a SINT generates an overflow when the value goes from 127 through -128.
  • Page 540: Immediate Values

    Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions Important: The math status flags are set based on the stored value. Instructions that normally do not affect math status flags might appear to affect math status flags if type conversion occurs from mixed data types for the instruction parameters.
  • Page 541: Data Conversions

    Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 Floating Point Immediate Values If you enter The controller stores Without any suffix REAL "L" LREAL 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...
  • Page 542 Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions 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...
  • Page 543 Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 Important: Mixing an INT tag with an immediate value Since remote_rack_1:I.Data[0] is an INT tag, the value to check it against first moves into int_0, also an INT tag. The EQU instruction then compares both tags.
  • Page 544 Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions Convert a DINT to an INT and a SINT This DINT value Converts to this smaller value 16#0001_0081 (65,665) INT: 16#0081 (129) SINT: 16#81 (-127) Convert REAL to SINT, INT, or DINT To convert a REAL value to an integer value, the controller rounds any fractional part and stores the bits that fit in the result data type.
  • Page 545: Elementary Data Types

    Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 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...
  • Page 546 Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions The REAL data type also stores infinity and NAN, but the software display differs based on the display format. Data type conversions When data types are mixed for operands within an instruction, some instructions automatically convert data to an optimal data type for that instruction.
  • Page 547 Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 -1.6 -1.5 -1.4 -2.5 Do not convert data to or from the BOOL data type. Important: The math status flags are set based on the value being stored. Instructions that normally do not affect math status keywords might appear to do so if type conversion occurs because of mixed data types for the instruction parameters.
  • Page 548: Lint Data Types

    Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions LINT data types LINT data type is a 64-bit integer. The LINT data type can be used in numerous instructions on Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, or GuardLogix 5580 controller however the LINT data type cannot be used in most instructions on CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570 controllers.
  • Page 549 Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 Controllers Data Type CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, REAL, LREAL Compact GuardLogix 5380, and GuardLogix 5580 controllers CompactLogix 5370, ControlLogix 5570, Compact GuardLogix REAL 5370, and GuardLogix 5570 controllers Denormalized numbers and -0.0 are treated as 0.0 If a computation results in a NAN value, the sign bit could be positive or negative.
  • Page 550 Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions • x is the small incremented variable. • y is the large incremented variable. • z is the total current count that can be used anywhere. • x = x+1; •...
  • Page 551: Index Through Arrays

    Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 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.
  • Page 552: Bit Addressing

    Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions 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.
  • Page 553: Faceplate Control Properties Dialog - General Tab

    Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 • Process Analog Input (PAI) • Process Analog Output (PAO) • Alarm (ALM) • Enhanced Select (ESEL) • Totalizer (TOT) • Ramp/Soak (RMPS) • Discrete 2-State Device (D2SD) • Discrete 3-State Device (D3SD) •...
  • Page 554: Faceplate Control Properties Dialog - Display Tab

    Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions • whether to launch remotely • the access path to the remote machine If you select FactoryTalk Linx FactoryTalk, you must also specify the FactoryTalk Area Enter the name of a specific function block instruction to connect with this control.
  • Page 555: Faceplate Control Properties Dialog - Font Tab

    Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 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.
  • Page 556: Faceplate Control Properties Dialog - Localetab

    Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions 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. Click this button to accept your edits and close the Faceplate Control Properties dialog.
  • Page 557: Ascii Character Codes

    Common Attributes for Advanced Process Control and Drives Instructions Chapter 11 • English • Portuguese • French • Italian • German • Spanish 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.
  • Page 558 Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions [ctrl-I] HT [ctrl-J] LF $l ($0A) [ctrl-K] VT [ctrl-L] FF [ctrl-M] CR $r ($0D) [ctrl-N] SO [ctrl-O] SI [ctrl-P] DLE [ctrl-Q] DC1 [ctrl-R] DC2 [ctrl-S] DC3 [ctrl-T] DC4 [ctrl-U] NAK [ctrl-V] SYN [ctrl-W] ETB [ctrl-X] CAN...
  • Page 559 Index latching data 493 order of execution 495 program/operator control 502 ALM 20 timing modes 499 CC 147 HLL 357 HPF 324 DEDT 51 derivative (DERV) 320 IMC 184 DFF 401 INTG 264 discrete 2-state device (D2SD) 41 discrete 3-state device (D3SD) 26 JKFF 404 enhanced select (ESEL) 350 Equipment diagram instructions 476...
  • Page 560 Index PIDE 67 PMUL 281 POSP 102 POVR 451 PPD 455 PRNP 448 PSC 460 PXRQ 433 ramp/soak (RMPS) 111 reset dominant (RESD) 407 Result Codes for Equipment Sequence Instructions 481, 482, 483, 484 RLIM 365 scale (SCL) 125 S-Curve (SCRV) 289 second-order controller (SOC) 298 SEL 370 selected negate (SNEG) 373...
  • Page 561 Rockwell Automation support Rockwell Automation provides technical information on the web to assist you in using its products. http://www.rockwellautomation.com/support you can find technical and application notes, sample code, and links to software service packs. You can also visit our Support Center at https://rockwellautomation.custhelp.com for software updates, support chats and forums, technical information, FAQs, and to sign up for product notification updates.

Table of Contents

Save PDF