Download MELSEC-Q Programming/Structured
Transcript
MELSEC-Q Programming/Structured Programming Manual (Process Control Instructions) SAFETY PRECAUTIONS (Always read these cautions before using the product) Before using MELSEC-Q series programmable controllers, please read the manuals included with each product and the relevant manuals introduced in those manuals carefully, and pay full attention to safety to handle the product correctly. Make sure that the end users read the manuals included with each product, and keep the manuals in a safe place for future reference. 1 CONDITIONS OF USE FOR THE PRODUCT (1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions; i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or serious accident; and ii) where the backup and fail-safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT. (2) The PRODUCT has been designed and manufactured for the purpose of being used in general industries. MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT, WARRANTY, TORT, PRODUCT LIABILITY) FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE OPERATED OR USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS, PRECAUTIONS, OR WARNING CONTAINED IN MITSUBISHI'S USER, INSTRUCTION AND/OR SAFETY MANUALS, TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT. ("Prohibited Application") Prohibited Applications include, but not limited to, the use of the PRODUCT in; • Nuclear Power Plants and any other power plants operated by Power companies, and/or any other cases in which the public could be affected if any problem or fault occurs in the PRODUCT. • Railway companies or Public service purposes, and/or any other cases in which establishment of a special quality assurance system is required by the Purchaser or End User. • Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as Elevator and Escalator, Incineration and Fuel devices, Vehicles, Manned transportation, Equipment for Recreation and Amusement, and Safety devices, handling of Nuclear or Hazardous Materials or Chemicals, Mining and Drilling, and/or other applications where there is a significant risk of injury to the public or property. 2 INTRODUCTION Thank you for purchasing the Mitsubishi MELSEC-Q series programmable controllers. Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance of the Q series programmable controller to handle the product correctly. When applying the program examples introduced in this manual to an actual system, ensure the applicability and confirm that it will not cause system control problems. Remark In this manual, instructions are written in three programming languages: ladder diagram for Simple projects, structured ladder/FBD and structured text language for Structured projects. Please use GX Works2 with the version 1.98C or later for Structured projects. 3 CONTENTS CONTENTS SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONDITIONS OF USE FOR THE PRODUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RELEVANT MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CHAPTER 1 OVERVIEW 10 1.1 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.2 PID Control Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3 Forward Operation and Reverse Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.4 PID Control Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.4.1 Proportional operation (P operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 1.4.2 Integral operation (I operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.4.3 Derivative operation (D operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 1.4.4 PID operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 CHAPTER 2 STRUCTURE AND COMBINATIONS OF PROCESS CONTROL INSTRUCTIONS 2.1 2.2 2.3 19 Structure of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 How to Specify Data in Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.1 In the case of bit data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 2.2.2 In the case of word (16-bit) data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 2.2.3 In the case of double word (32-bit) data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 2.2.4 In the case of real number data (floating-point) data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 2.2.5 Operation errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 2.2.6 Execution conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 2.2.7 Number of steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 2.2.8 Index modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Basic Loop Types Available by Combinations of Process Control Instructions . . . . . . . . . . . . . 23 CHAPTER 3 DATA USED FOR PROCESS CONTROL INSTRUCTIONS AND HOW TO SPECIFY DATA 25 3.1 Process Control Instructions and Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.2 Local Work Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3 Data Used for Process Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.3.1 Loop memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 3.3.2 Input data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 3.3.3 Block memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 3.3.4 Operation constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 3.3.5 Loop tag memory allocation contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 CHAPTER 4 HOW TO EXECUTE PROCESS CONTROL INSTRUCTIONS 4 1 2 3 4 8 9 34 4.1 Execution Cycle and Control Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.2 Concept of Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 CHAPTER 5 EXECUTION CONDITION SWITCHING AND FUNCTIONS 5.1 Execution Condition Switching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.1.1 5.2 36 Loop RUN/STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.2.1 Tracking function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 5.2.2 Cascade loop tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 5.2.3 Loop selector tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 CHAPTER 6 INSTRUCTIONS 39 6.1 How to Read the Instruction List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 6.2 List of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.2.1 I/O control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 6.2.2 Control operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 6.2.3 Compensation operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 6.2.4 Arithmetic operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 6.2.5 Comparison operation instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 6.2.6 Auto tuning instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 CHAPTER 7 HOW TO READ INSTRUCTION DETAILS 51 CHAPTER 8 I/O CONTROL INSTRUCTIONS 55 8.1 S.IN Analog Input Processing . . . . . . . . . . . . . . . . . . . . .55 8.2 S.OUT1 Output Processing-1 with Mode Switching . . . . . . .60 8.3 S.OUT2 Output Processing-2 with Mode Switching . . . . . . .66 8.4 S.MOUT Manual Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.5 S.DUTY Time Proportioning . . . . . . . . . . . . . . . . . . . . . . . . . .75 8.6 S.BC Batch Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 8.7 S.PSUM Pulse Integration . . . . . . . . . . . . . . . . . . . . . . . . . . .85 CHAPTER 9 CONTROL OPERATION INSTRUCTIONS 90 9.1 S.PID Basic PID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 9.2 S.2PID 2-degree-of-freedom PID Control . . . . . . . . . . . . . .98 9.3 S.PIDP Position Type PID Control . . . . . . . . . . . . . . . . . . .106 9.4 S.SPI Sample PI Control . . . . . . . . . . . . . . . . . . . . . . . . .115 9.5 S.IPD I-PD Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 9.6 S.BPI Blend PI control . . . . . . . . . . . . . . . . . . . . . . . . . . .130 9.7 S.R Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137 9.8 S.PHPL High/Low Limit Alarm . . . . . . . . . . . . . . . . . . . . . . .142 9.9 S.LLAG Lead-Lag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148 9.10 S.I Integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 9.11 S.D Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152 9.12 S.DED Dead Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154 9.13 S.HS High Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157 5 9.14 S.LS Low Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159 9.15 S.MID Middle Value Selection . . . . . . . . . . . . . . . . . . . . .161 9.16 S.AVE Average Value . . . . . . . . . . . . . . . . . . . . . . . . . . . .164 9.17 S.LIMT High/Low Limiter . . . . . . . . . . . . . . . . . . . . . . . . . .166 9.18 S.VLMT1 Variation Rate Limiter 1 . . . . . . . . . . . . . . . . . . . . .168 9.19 S.VLMT2 Variation Rate Limiter 2 . . . . . . . . . . . . . . . . . . . . .171 9.20 S.ONF2 2-position ON/OFF . . . . . . . . . . . . . . . . . . . . . . . . .173 9.21 S.ONF3 3-position ON/OFF . . . . . . . . . . . . . . . . . . . . . . . . .179 9.22 S.DBND Dead Band . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185 9.23 S.PGS Program Setter . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 9.24 S. SEL Loop Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192 9.25 S.BUMP Bumpless Transfer . . . . . . . . . . . . . . . . . . . . . . . . .198 9.26 S.AMR Analog Memory . . . . . . . . . . . . . . . . . . . . . . . . . . .201 CHAPTER 10 COMPENSATION OPERATION INSTRUCTIONS 10.1 S.FG Function Generator . . . . . . . . . . . . . . . . . . . . . . . .203 10.2 S.IFG Inverse Function Generator . . . . . . . . . . . . . . . . . .205 10.3 S.FLT Standard Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . .207 10.4 S.SUM Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210 10.5 S.TPC Temperature/Pressure Correction . . . . . . . . . . . . .212 10.6 S.ENG Engineering Value Conversion . . . . . . . . . . . . . . .215 10.7 S.IENG Inverse Engineering Value Conversion . . . . . . . . .217 CHAPTER 11 ARITHMETIC OPERATION INSTRUCTIONS 219 11.1 S.ADD Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219 11.2 S.SUB Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 11.3 S.MUL Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 11.4 S.DIV Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225 11.5 S.SQR Square Root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227 11.6 S.ABS Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . .229 CHAPTER 12 COMPARISON OPERATION INSTRUCTIONS 231 12.1 S. > Compare Greater Than . . . . . . . . . . . . . . . . . . . . .231 12.2 S. < Compare Less Than . . . . . . . . . . . . . . . . . . . . . . .233 12.3 S. = Compare Equal Than . . . . . . . . . . . . . . . . . . . . . . .235 12.4 S. >= Compare Greater Or Equal . . . . . . . . . . . . . . . . . .237 12.5 S. <= Compare Less Or Equal . . . . . . . . . . . . . . . . . . . .239 CHAPTER 13 AUTO TUNING 13.1 S. AT1 6 203 241 Auto tuning instruction . . . . . . . . . . . . . . . . . . . . . .244 CHAPTER 14 ERROR CODES 251 14.1 List of Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 APPENDIX 253 Appendix 1Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Appendix 2Loop Tag Memory List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Appendix 2.1PID control (SPID), 2-degree-of-freedom PID control (S2PID), sample PI control (SSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257 Appendix 2.2I-PD control (SIPD), blend PI control (SBPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .259 Appendix 2.3Manual output (SMOUT), monitor (SMON) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261 Appendix 2.4Manual output with monitor (SMWM), PIDP control (SPIDP). . . . . . . . . . . . . . . . . . . . .262 Appendix 2.52 position ON/OFF control (SONF2), 3 position ON/OFF control (SONF3) . . . . . . . . . .264 Appendix 2.6Batch counter (SBC). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265 Appendix 2.7Ratio control (SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266 Appendix 3Operation Processing Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 Appendix 3.1Operation processing time of each instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268 Appendix 3.2Operation processing time of 2-degree-of-freedom PID control loop . . . . . . . . . . . . . . .271 INDEX 273 INSTRUCTION INDEX 275 REVISIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 7 RELEVANT MANUALS Manual number Manual name (model code) QCPU User's Manual (Hardware Design, Maintenance and Inspection) Specifications of the CPU modules, power supply modules, base units, extension cables, memory cards, SD memory cards, extended SRAM cassettes, and batteries, information on how to establish a system, maintenance and inspection, and troubleshooting SH-080483ENG (13JR73) (Sold separately) Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explanation, Program Fundamentals) SH-080808ENG Functions, methods, and devices for programming (Sold separately) MELSEC-Q/L Programming Manual (Common Instruction) (13JZ28) SH-080809ENG How to use sequence instructions, basic instructions, and application instructions (Sold separately) (13JW10) MELSEC-Q/L/QnA Programming Manual (SFC) System configuration, performance specifications, functions, programming, debugging, and error codes for SFC (MELSAP3) programs SH-080041 (13JF60) (Sold separately) MELSEC-Q/L Programming Manual (MELSAP-L) SH-080076 Programming methods, specifications, and functions for SFC (MELSAP-L) programs (Sold separately) MELSEC-Q/L/F Structured Programming Manual (Fundamentals) (13JF61) SH-080782ENG Methods and languages for structured programming (Sold separately) (13JW06) MELSEC-Q/L Structured Programming Manual (Common Instructions) Specifications and functions of common instructions, such as sequence instructions, basic instructions, and application instructions, that can be used in structured programs (13JW07) (Sold separately) 8 SH-080783ENG TERMS Unless otherwise specified, this manual uses the following terms. Term Description QnPHCPU A generic term for the Q02PHCPU, Q06PHCPU, Q12PHCPU, and Q25PHCPU QnPRHCPU A generic term for the Q12PRHCPU and Q25PRHCPU Instructions are written in three programming languages: ladder diagram for Simple projects, structured ladder/FBD and structured text language for Structured projects. To write instructions other than comparison operation instructions in the structured ladder/FBD or structured text language, use "_" instead of ".". For the comparison operation instructions, use the following instruction symbols. Instruction Ladder diagram S.> Comparison operation instruction Structured ladder/FBD and structured text language S_GT S.< S_LT S.= S_EQ S.>= S_GE S.<= S_LE 9 CHAPTER 1 OVERVIEW This manual describes the process control instructions equipped for the CPU module. 1.1 Features The process control instructions have the following features. (1) Use of floating-point data Capable of handling floating-point type real number data, the instructions can perform wide-range and accurate operations. (2) Increased efficiency of system adjustment Micro-blocked process control instructions are combined to perform PID control. This enables actions to be confirmed on a process control instruction basis, ensuring efficient system adjustment. Example) Process control instructions used to carry out 2-degree-of-freedom PID control Use each instruction common table. Loop tag memory setting Operation constant setting K1 T0 Execution command T0 PLS M0 M0 CALL P1 RST T0 FEND P1 Always executed Process control instruction 1 (Input instruction) FLT D0 R0 Microblock S.IN R0 R100 R200 R1000 S.IN instruction EMOV R100 R20 Microblock Process control instruction 2 (Upper lower limit alarm instruction) S.PHPL instruction S.PHPL Set value (SV) R20 R120 R220 R1000 EMOV R120 R40 Process value (PV) Process control instruction 3 Microblock (2-degree-of-freedom PID S.2PID instruction control instruction) S.2PID R40 R140 R240 R1000 R300 EMOV R140 R60 Process control instruction 4 (Output instruction) Microblock S.OUT1 R60 R160 R260 R1000 S.OUT1 instruction INT R160 D1 RET 10 (3) Free combination of process control instructions for application to a wide range of control As an option, a process control instruction can be inserted in a loop that links process control instructions. Add the square root operation instruction (S.SQR) to perform the square root operation of an input signal to provide an 1 output signal as shown below. FIC 2 Regulator 3 4 FE flow meter Liquid 3 Diaphragm valve [Example of adding square root operation instruction (S.SQR) to process control instructions] 6 Loop tag memory setting 7 Operation constant setting Added as option Process control instruction Normal ON (Square root operation S.SQR instruction) instruction S.2PID instruction R0 EM0V R100 R100 R200 SD1506 R40 1.1 Normal ON S.2PID R40 R140 R240 R1000 R300 Features Process control instruction (2-degree-of-freedom PID control instruction) 8 S.SQR (4) Automatic detection of various alarms A system can be configured safely since various alarms are detected automatically in the system. 11 (5) PID algorithm using a velocity type incomplete differential format Partial differential has the following advantages over the complete differential format. (a) The differential gain is 1/ and the limit value can be set. (b) The output contains time amplitude, so the system actually responds to the operation edge so the derivative operation makes the movement valid. Deviation DV PID Manipulated variable Time(t) 12 1.2 PID Control Overview 1 PID control is applied to the process control of flow rate, speed, air volume, temperature, tension, compounding or like. In the following application, a value of a control target system can be kept at a set value with PID control. Process control instructions are used 2 Subdivided (micro-blocked) processings of PID control 3 Manual MV Set value SV PV PID operation Automatic MV MV D/A converter module 4 Controlled system 3 A/D converter module Sensor 6 PID control compares the value measured in the detection section (process value: PV) with the preset value (set value: SV) and adjust the output value (manipulated value: MV) to eliminate the difference between the process value and set value. In PID control, proportional operation (P), integral operation (I) and derivative operation (D) are combined to calculate the manipulated value that will make the process value equal to the set value fast and precisely. 7 8 • If the difference between the process value and set value is large, the manipulated value is increased to make it close to the set value fast. • When the difference between the process value and set value has reduced, the manipulated value is decreased to make it 1.2 equal to the set value slowly and precisely. PID Control Overview 13 1.3 Forward Operation and Reverse Operation (1) Forward operation is the action that increases the manipulated value when the process value increases more than the set value. (2) Reverse operation is the action that increases the manipulated value when the process value is decreasing more than the set value. (3) Forward operation and reverse operation make the manipulated value larger as the difference between the set value and the process value becomes larger. (4) The following figure shows an example of process control in forward operation and reverse operation. Temperature Temperature Set value Process value Set value Time Forward operation (for air conditioning) 14 Process value Time Reverse operation (for heating) 1.4 PID Control Details This section explains "proportional operation", "integral operation" and "derivative operation" performed for PID control using 1 the process control instructions. 1.4.1 2 Proportional operation (P operation) 3 This section explains the control method using proportional operation. (1) Proportional operation is the action that compares the deviation (DV, difference between the set value and the process value) to find the manipulated value (MV). 4 (2) The proportional term is given by: 3 MV = KP • DV KP is a proportional gain constant. Deviation (3) The proportional operation in the case of a step response with a constant deviation will be as follows. 6 DV 7 Manipulated value Time 8 K P DV Time 1.4 PID Control Details 1.4.1 Proportional operation (P operation) (4) The manipulated value fluctuates between -10 and 110%. As KP increases, the manipulated value for the constant deviation also increases. (5) Offset occurs in proportional operation. 15 1.4.2 Integral operation (I operation) This section explains the control method using integral operation. (1) Integral operation is the operation that continuously changes the manipulated value to eliminate deviation when there is deviation. This operation can eliminate the offset that occurs during control performed by a proportional operation. (2) The time required for adjusting the manipulated value of the integral operation to the manipulated value of the proportional operation after the deviation is detected is called integral time (TI). (a) Increasing the integral time decreases the effect of integration. (It will take time to stabilize.) (b) Decreasing the integral time increases the effect of integration. However, since the integral operation will be stronger, hunting may become greater. Deviation (3) The integral operation in the case of a step response with a constant deviation will be as follows. DV Time Manipulated value Proportional operation integral operation manipulated value Integral operation manipulated value KP DV Manipulated value in the proportional operation TI Time (4) The integral operation is used as the PI operation that is combined with the proportional operation or as the PID operation that is combined with the proportional operation and the derivative operation. Control cannot be carried out by merely performing the integral operation. 16 1.4.3 Derivative operation (D operation) 1 This section explains the control method using the derivative operation. (1) The derivative operation is an operation that adds the proportional manipulated value to the change speed to eliminate deviation when a deviation has occurred. 2 The derivative operation can prevent large changes in the object control from disturbances. (2) The time required for adjusting the manipulated value of the derivative operation to the manipulated value of the 3 proportional operation after the deviation is detected is called derivative time (TD). Increasing the derivative time makes the derivative operation stronger. 4 Deviation (3) The derivative operation in the case of a step response with a constant deviation will be as follows. 3 DV Time Manipulated value 6 7 K P DV Manipulated value for proportional operation 8 TD Time (4) The derivative operation can be used as PD operation in combination with a proportional operation or as a PID operation in combination with the proportional operation and integral operation. Control cannot be carried out by merely performing the derivative operation. 1.4 PID Control Details 1.4.3 Derivative operation (D operation) 17 1.4.4 PID operation This section explains the control operation using combinations of proportional operation (P operation), integral operation (I operation), and derivative operation (D operation). (1) The PID operation controls the calculated manipulated value using (P + I + D) operation. Deviation (2) The PID operation in the case of a step response with a constant deviation will be as follows. Manipulated value Time PID operation PI operation I operation P operation D operation Time 18 CHAPTER 2 2.1 STRUCTURE AND COMBINATIONS OF PROCESS CONTROL INSTRUCTIONS 1 2 Structure of Instructions The instructions that can be used by the process control instructions can be divided into the "instruction part" and "device part". 3 The instruction part and device part are as follows. • Instruction part.......This shows the functions for these instructions. • Device part.............This shows the data required for operations and the storage destination of the stored operation results. 4 4 The device part is classified as the source device and destination device. (1) Source (S) 6 The source stores the data used for operation. (a) In the process control instruction, specify the head device that stores the source data. (b) Data must have been stored in the specified device until the process control instruction is executed. (c) Changing the source data allows you to change the data used in that instruction. 7 (2) Destination (D) Destination is where the data is stored after operation. (a) (b) 8 Sets the device for which the data will be stored in the destination. Depending on the instruction used, data used for operation must also be stored in the destination before start of the operation. 2.1 19 Structure of Instructions For the structure of instructions used in structured programs, refer to the MELSEC-Q/L Structured Programming Manual (Common Instructions). 2.2 How to Specify Data in Devices The following 4 types of data can be used by the process control instructions. Data that can be used by the process control instructions Bit data Numeric data Integer data Word data Double word data Real number data (floating-point data) 2.2.1 In the case of bit data Bit data is handled on a single bit basis. The CPU module uses a word device for alarm condition or selection on a single bit basis. By specifying the bit number of the word device, you can use the 1/0 of the specified bit number as bit data. b15 b0 Word device 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1 in each bit can be used as ON, or 0 as OFF. Specify the bit of the word device in the form of " Word device . Bit No. ". (Specify the bit number in hexadecimal.) For example, specify the bit 5 (b5) of D0 as D0.5, and the bit 10 (b10) of D0 as D0.A. However, you cannot specify the bits of the timer (T), retentive timer (ST), counter (C) and index register (Z). (Example: You cannot specify Z0.0.) 2.2.2 In the case of word (16-bit) data Word data is the 16-bit numeric data that is used for the loop tag memory bit pack contents and operation constants, etc. • Decimal constant........................K-32768 to K32767 • Hexadecimal constant................H0000 to HFFFF Example) For the loop tag memory ALM (standard value setting 4000H) ALM 0 1 0 4 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2.3 In the case of double word (32-bit) data 1 Double word data is 32-bit numeric data. • Decimal constant......................K-2147483648 to K2147483647 • Hexadecimal constant..............H00000000 to HFFFFFFFF 2 When using double word data, specify the word device to be used in the lower-order 16 bits. The 32-bit data is stored into the (specified word device number) and ((specified word device number) + 1). 3 Example) When D10 is specified for double word data, D10 and D11 are used. 2.2.4 D11 D10 (BW1)H (BW1)L 4 In the case of real number data (floating-point) data 4 The data required for operations and the operation results are 32-bit floating-point data. 6 Floating-point data is displayed as follows using 2 word devices. 1. [Fixed-point part] × 2 [Exponent part] 7 The bit configuration when the floating-point data is expressed internally and its meaning are as follows. 8 b31 b30 to b23 b22 to b16 b15 b23 to b30 Exponent to b0 b0 to b22 Mantissa • Fixed-point part sign This shows the fixed-point part sign in b31. 0: Positive 1: Negative • Exponent part This shows the 2n's n and b23 to b30. The n from b23 to b30's BIN value is as follows. b23 to b30 n FFH FEH FDH Non-numeric 127 data 126 81H 2 80H 1 7FH 0 7EH -1 02H 01H 00H Non-numeric -125 -126 data • Fixed-point part This shows the value of XXXXXX... in the 23 bits, b0 to b22, when 1.XXX XXX... is represented in binary. • The real number setting range is 0, ± 2-126 |value| < ± 2128. • To represent 0, set 0 in all of b0 to b31. 21 2.2 How to Specify Data in Devices 2.2.3 In the case of double word (32-bit) data b31 Sign 2.2.5 Operation errors Operation errors caused by process control instructions are stored in the following remote register. For errors other than operation errors, refer to the error codes listed in the QCPU User's Manual (Hardware Design, Maintenance and Inspection). (The error code is stored in SD0.) Remark (1) The following errors (other than operation errors) are also stored in the special register. • Error code 4002..........The name of the specified instruction is incorrect. • Error code 4003..........The number of devices used in the process control instruction is incorrect. • Error code 4004..........A device that cannot be used in the instruction is specified. • Error code 4100..........The instruction cannot process the data. (2) For the error code 4100, the detailed information is stored in special register (SD1502 and SD1503). Values in SD1502 and SD1503 are set to 0 when other than the process control instruction operation error. For details, refer to Page 251, CHAPTER 14. 2.2.6 Execution conditions The process control instructions are instructions that are executed while the input condition is ON. 2.2.7 Number of steps The number of process control instruction steps differs depending upon the number of instruction characters, the device used, and whether or not an indirect setting is valid. The basic number of steps for the extension instruction are as follows. Number of steps in process control instruction = 2 + *1 number of instruction characters*1 + number of devices 2 The number of characters is calculated by adding 1 when the number is odd. (For example when rounding up the results of a division.) S.IN The "S." of the instruction code is not included in the number of characters. R0 R100 R200 1Step 1Step R1000 7Step 1Step 1Step 1Step 2+2/2+4=7Step For details, refer to the MELSEC-Q/L Structured Programming Manual (Common Instructions). 2.2.8 Index modification Index modification available for the process control instructions is the same as the one available for the basic instructions of the CPU module. 22 2.3 Basic Loop Types Available by Combinations of Process Control Instructions Loop type Structure SET 2-degree-of-freedom PID control (S2PID) Application S.IN S.PHPL S.OUT1 S.IN S.PHPL S.DUTY (SPID) S.IN S.PHPL PIDP control (SPIDP) Sample PI control (SSPI) S.OUT1 Blend PI control (SBPI) Ratio control (SR) 2-position ON/OFF control (SONF2) S.PHPL S.DUTY Used for general PID control. (Position S.IN S.PHPL S.PIDP OUTPUT S.PHPL S.OUT1 S.IN S.PHPL S.IPD SET S.OUT1 OUTPUT MV S.BPI S.OUT1 OUTPUT PV S.IN S.PHPL SV SET S.OUT2 OUTPUT S.IN S.PHPL long period of time. S.ONF2 to the other varying value. Depending on the sign (positive/ MV negative) of a deviation, operation to PV INPUT period of time and may be constant in a the ratio of the given manipulated value MV S.R varied. Control is performed to keep constant SV SET given impact when the set value is manipulated value may vary in a short PV S.PHPL control cycle and the output is kept Used for a process where the SV S.IN period of control execution time in each the operation end and process are not MV OUTPUT turn the manipulated value ON or OFF is performed. 3-position ON/OFF control outputs 3-position ON/OFF control (SONF3) SV SET signals of three areas in response to MV the process value to carry out control. PV INPUT S.IN S.PHPL S.ONF3 OUTPUT This control can suppress the sudden variation of the manipulated value. Batch counter (SBC) A valve or like is controlled ON/OFF in INPUT S.PSUM S.BC OUTPUT 7 8 constant after that. Used to make slow response so that PV INPUT1 OUTPUT SV SET control cycle. Used for a process that has long dead PI control is executed for only the MV S.SPI Conducts PID operation for each time. SV S.IN 6 type) MV PV INPUT OUTPUT SV SET INPUT control cycle. MV S.PID a process of batch preparation for a tank or like. 23 Basic Loop Types Available by Combinations of Process Control Instructions (SIPD) S.IN 4 type) 2.3 I-PD control Used for general PID control. (velocity OUTPUT Conducts PID operations for each PV INPUT 4 OUTPUT SV SET INPUT control cycle. MV S.PID PV INPUT 3 SV PV SET of-freedom). (velocity type) Conducts PID operations for each MV S.2PID SET INPUT OUTPUT SV PV PID control Used for general PID control (2-degree- MV S.2PID SET INPUT 2 SV PV INPUT 1 Loop type Structure Program setting device (SPGS) Manual output S.PGS (SMOUT) S.MOUT Selector (SSEL) 24 previously set value time change. This manually operates the operation OUTPUT terminal end. This inputs the process value and PV INPUT S.IN S.PHPL Manual output with monitor (SMWM) OUTPUT MV Monitor (SMON) Application This is output in accordance with the MV OUTPUT PV INPUT S.IN S.PHPL S.MOUT detects process errors such as upper/ lower limit alarms. This inputs the process value and MV OUTPUT conducts manual operation while checking that no errors occur. INPUT1 INPUT2 S.SEL OUTPUT This is used to select signals. CHAPTER 3 DATA USED FOR PROCESS CONTROL INSTRUCTIONS AND HOW TO SPECIFY DATA 1 2 3.1 Process Control Instructions and Data Structure 3 This section explains the data structure (data flow) used for process control instructions. (a) Configuration when using loop tag 4 1) The loop units have common storage areas that show the control information. This collection of common information is called a loop tag and the storage memory is called the loop tag memory. 2) By monitoring the loop tag, you can monitor and tune the loop (control unit). 6 [Block diagram] 6 Loop tag memory S.IN Process control instruction S.PHPL Output Process control instruction Input Operation constant 1 Block memory 1 S.2PID Output Process control instruction Input Operation constant 2 Block memory 2 S.OUT1 Output Process control instruction 7 Output Input Operation constant 3 Block memory 3 8 Operation constant 4 Block memory 4 3.1 Process Control Instructions and Data Structure 25 (b) Loop tag memory and operation constant locations in ladder diagram [Ladder diagram] Use name instruction common table. Loop tag memory (96 words) Loop tag memory setting Instruction used Operation constant setting Standard value setting Item K1 T0 Execution command T0 PLS M0 M0 CALL P1 RST T0 Data type BIN16bit +0 8H BIN16bit ALM 4000H BIN16bit INH 4000H +1 MODE +3 +4 BIN16bit +10 S.PHPL PV 0.0 Real number +12 S.OUT1 MV 0.0 Real number +14 S.2PID SV 0.0 Real number +16 S.2PID DV 0.0 Real number +18 S.OUT1 MH 100.0 Real number +20 S.OUT1 ML 0.0 Real number +22 S.PHPL RH 100.0 Real number FEND P1 Normal execution FLT D0 S.IN R0 R0 R100 R200 R1000 EMOV R100 R20 S.PHPL R20 R120 R220 R1000 EMOV R120 R40 S.2PID R40 R140 R240 R1000 R300 EMOV R140 R60 S.OUT1 R60 R160 R260 R1000 +46 S.2PID CT 1.0 Real number +48 S.OUT1 DML 100.0 Real number +50 S.2PID DVL 100.0 Real number +52 S.2PID P 1.0 Real number +54 S.2PID I 10.0 Real number +56 S.2PID D 0.0 Real number +58 S.2PID GW 0.0 Real number +60 S.2PID GG Real number +62 S.OUT1 MVP 1.0 0.0 +64 S.2PID 0.0 Real number +66 S.2PID 1.0 Real number +90 0.0 Real number +92 0.0 Real number +94 0.0 Real number Real number INT R160 D1 RET The symbols in the ladder diagram mean the following. Instruction name S.IN S.PHPL S.2PID R0 R20 R40 R60 2) Block memory head device R100 R120 R140 R160 3) Operation constant head device R200 R220 R240 R260 1) Input data head device Start contact Instruction name 1) 2) 3) 4) 5) 4) Loop tag memory head device 5) Set value head device 26 S.OUT1 R1000 –– –– R300 –– 3.2 Local Work Memory Local work memory is used as a temporary storage area in process control instruction operation. (The memory is used for 1 each micro block.) 2 The following instructions use the local work memory. Instruction Remarks 3 S.LLAG (Lead-Lag) S.D (Derivative) S.DED (Dead time) The system stores the midway operation results. S.FLT (Standard filter) (For system use only) 4 S.AT1 (Auto tuning) S.FG (Function generator) The user stores the coordinate values (Xn, Yn) of a function S.IFG (Inverse function generator) generator. Operations are performed based on these values. 6 S.BUMP (Bumpless transfer) 6 [Block diagram] Input data setting Operation constant setting 7 Data for operation Process control instruction execution Data after operation Local work memory 8 Operation result Block memory 3.2 [Ladder diagram] Operation constant setting Normal ON S.LLAG R0 R100 R20 R200 S.LLAG (Lead-Lag) Input data head device Block memory head device R0 R100 Operation constant head device Local work memory head device R20 R200 Local Work Memory Instruction name The application of the local work memory changes depending on the used instruction. Refer to the explanation section of the corresponding instruction. 27 3.3 Data Used for Process Control Instructions The following data are used for the process control instructions. • • • • • Loop tag memory Input data Block memory Operation constant Local work memory 3.3.1 Page 28, Section 3.3.1 Page 29, Section 3.3.2 Page 30, Section 3.3.3 Page 30, Section 3.3.4 Page 27, Section 3.2 Loop memory (1) Loop memory (a) The loop memory is an area that stores the data used commonly by the process control instructions specified as the loop type. The loop memory also has an area that stores the data used by the CPU module system during process control instruction execution. (b) The loop memory has the "loop tag memory" and "loop tag past value memory" areas. (c) The loop memory consists of 128 words (word device: 128 points). When setting the loop memory areas, specify the device that can occupy 128 words consecutively. Loop memory Specified device +0 +95 +96 +127 Loop tag memory 96word Loop tag past value memory (Usage possible on the user's side.) 32word (2) Loop tag memory (a) The loop tag memory is an area that stores the data used commonly by the process control instructions specified as the loop type indicated in Page 23, Section 2.3. (b) The loop tag memory consists of 96 words. (c) Refer to Page 257, Appendix 2 (Loop tag memory list) for the applications of the area used by the process control instructions in the loop tag memory. 28 (3) Loop tag past value memory (a) The loop tag past value memory is an area used by the CPU module system at the time of process control 1 instruction execution. The user cannot write data to this memory during run. If the user writes data to the loop tag past value memory during run, normal operation cannot be performed. 2 (b) The loop tag past value memory is a 32-word area after the loop tag memory. (c) At the start of the process control instruction, write "0" to the loop tag past value memory. 3.3.2 3 Input data 4 (1) Input data is variable data given to each process control instruction. (2) The input data uses the block word of the block memory that stores the operation result of the process control instruction executed previously. Process control instruction S.IN Input data Process control instruction Operation result Block word 6 S.PHPL Input data Block bit 6 Operation result Block word Block bit 7 Block memory* Transferred by user *For the block memory, refer to Page 30, Section 3.3.3. 8 (3) The application of the input data changes depending on the used instruction. Refer to the explanation section of the corresponding instruction. 3.3 Data Used for Process Control Instructions 3.3.2 Input data 29 3.3.3 Block memory The block memory is an area that stores the output information of the corresponding process control instruction. The block memory has "block words" and "block bits". The application of the block memory changes depending on the used instruction. Refer to the explanation section of the corresponding instruction. Block memory Specified device number 0 1 Block word (2 words) 2 Block bit 2 words are used when real number is stored into block word. As block bit, each bit of one word is used to store ON/OFF data. (1) Block word (BW) (a) The block word is an area that stores the operation result of the process control instruction. (b) As the input data of the next process control instruction linked by the loop, the data stored in the block word is used. Process control instruction S.IN Input data Process control instruction Operation result S.PHPL Block word Operation result Block word Input data Block bit Block bit Transferred by user (2) Block bit (BB) The block bit is an area that stores the corresponding alarm data at process control instruction execution. As the block bits, 16 bits of b0 to b15 are represented as BB1 to BB16. The b0 (BB1) in the block bits stores "1" if any of b1 to b15 (BB2 to BB16) on each instruction stores an alarm data. b12 b15 Block bit 3.3.4 B B 1 6 B B 1 5 B B 1 4 B B 1 3 b8 B B 1 2 B B 1 1 B B 1 0 B B 9 b0 b4 B B 8 B B 7 B B 6 B B 5 B B 4 B B 3 B B 2 B B 1 Operation constant (1) The operation constant is an area that stores the data used by only one process control instruction. (2) The application of the operation constant changes depending on the used instruction. Refer to the explanation section of the corresponding instruction. 30 3.3.5 Loop tag memory allocation contents 1 The loop tag memory allocation contents are shown below. Instructions used in loop tag After setting some values are changed by Abbreviated name the numbers from the operation results. of each item (Highlighted areas) Show the number of words from the loop tag header Instruction used Item Offset Setting range Standard value setting 2 3 Data type 0 MODE 0 to FFFFH 8H BIN16bit 3 ALM 0 to FFFFH 4000H BIN16bit 4 INH 0 to FFFFH 4000H BIN16bit S.PHPL 10 PV RL to RH 0.0 Real number S.OUT1 12 MV -10 to 110 0.0 Real number S.2PID 14 SV RL to RH 0.0 Real number S.2PID 16 DV -110 to 110 0.0 Real number S.OUT1 18 MH -10 to 110 100.0 Real number S.OUT1 20 ML -10 to 110 0.0 Real number S.PHPL 22 RH -999999 to 999999 100.0 Real number S.PHPL 24 RL -999999 to 999999 0.0 Real number S.PHPL 26 PH RL to RH 100.0 Real number S.PHPL 28 PL RL to RH 0.0 Real number S.PHPL 30 HH RL to RH 100.0 Real number S.PHPL 32 LL RL to RH 0.0 Sets the offset position for each instruction Real number S.IN 38 0 to 1 0.2 Real number S.PHPL 40 HS 0 to 999999 0.0 Real number S.PHPL 42 CTIM 0 to 999999 S.PHPL 44 DPL 0 to 100 S.2PID 46 CT 0 to 999999 S.OUT1 48 DML S.2PID 50 S.2PID 0.0 Real number 100.0 Real number 1.0 Real number 0 to 100 100.0 Real number DVL 0 to 100 100.0 Real number 52 P 0 to 999999 1.0 Real number S.2PID 54 I 0 to 999999 10.0 Real number S.2PID 56 D 0 to 999999 0.0 Real number S.2PID 58 GW 0 to 100 0.0 Real number S.2PID 60 GG 0 to 999999 1.0 Real number S.OUT1 62 MVP -999999 to 999999 0.0 Real number S.2PID 64 0 to 1 0.0 Real number S.2PID 66 0 to 1 1.0 Real number 4 6 6 7 8 3.3 Data Used for Process Control Instructions 3.3.5 Loop tag memory allocation contents 1 For PID control (S2PID loop) All commonly set in the same loop tag (1) Shows the contents of the bit pack using the loop tag data. (a) ALM b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 S P A D M L A O O P A S E A H H A L L A P H A P L A D P P A D P N A D V L A M H A M L A The standard value setting 4000H is shown when manual operation is conducted using the loop step status. Use 0000H 31 S: Stored by the system U: Set by the user Flag Name Abbreviation Description establishment conditions Shows the loop stop status. Changes the loop mode to manual. Stop alarm SPA Conducts stop alarm processing for the output value (BW) and alarm U signal. Conducts the change rate limiter for the input data and outputs the Output change rate limit alarm DMLA change rate alarm. (For the output change upper limit value/control S value). Output open alarm Shows that it has changed to open status when the operation output OOPA Sensor alarm signal has become disconnected, etc. SEA Sensor error alarm S S Checks the upper limit value of the process equipment upper limit, and Upper upper limit alarm HHA outputs an alarm if the process value is higher than the upper limit S value. Lower lower limit alarm LLA Upper limit alarm PHA Lower limit alarm PLA Positive direction change rate Checks the lower limit value of the process equipment lower limit, and outputs an alarm if the process value is lower than the lower limit value. Checks the upper limit value of the process value, and outputs an alarm if the process value is higher than the upper limit value. Checks the lower limit value of the process value, and outputs an alarm if the process value is lower than the lower limit value. Outputs an alarm if the change rate is higher than the upward trend DPPA alarm Negative direction change rate change rate range. Outputs an alarm if the change rate is lower than the downward trend DPNA alarm change rate range. S S S S S Conducts an error check and then outputs an alarm if over. In addition, Deviation large alarm if the error check determines that the deviation is completely less than DVLA the warning value and the error is reduced by a set value from the S warning value then the deviation large alarm will be released. Output upper limit alarm MHA Output lower limit alarm MLA Conducts a check using the upper/lower limiter and if the limiter results are larger than the input upper limit value an alarm is output. A check is conducted by an upper/lower limiter and if the limiter results are smaller than the input lower limit value an alarm is output. S S (a) (b) INH This prohibits alarm detection for each item. In addition, the alarms prohibited by INH are not detected. (The INH bits 0 to 11 correspond to the bits 0 to 11 of ALM.) b15 b14 b13 b12 b11 b10 b9 b8 b7 E R R I T R K F D M L I O O P I S E I H H I L L I b6 b5 b4 b3 b2 b1 b0 P H I P L I D P P I D P N I D V L I M H I M L I Trucking flag (We ask the user not touch this.) All alarm detection prohibited 32 (c) MODE The process control instructions have the following operation modes that satisfy the following operations in a system connected to an operator station, programmable controller, host computer, machine side operation panel and like. b15 b14 b13 b12 b11 b10 b9 b8 b7 C S V C M V C C B C A B b6 b5 b4 b3 b2 b1 b0 C M B C A S A U T M A N L C C L C A 2 L C M 3 For MODE make one of them a 1 bit only flag 1. Operation mode Description MAN • Manual operation from OPS (MANUAL) • SV and MV can be set. AUT (AUTOMATIC) • Automatic operation • SV can be set. • MV cannot be set. CAS • Cascade operation (CASCADE) • SV and MV cannot be set. CMV (COMPUTER MV) CSV (COMPUTER SV) CMB (COMPUTER MANUAL BACK UP) CAB (COMPUTER AUTOMATIC BACK UP) CCB (COMPUTER CASCADE BACK UP) LCM (LOCAL MANIPULATED) (LOCAL AUTOMATIC) LCC (LOCAL CASCADE) Application 4 Monitoring and control from operator station are performed. 6 Loop operation from host computer can be 6 performed and operation mode is controlled and • Automatic SV setting from host computer monitored at operator station. 7 • Manual operation backup when host computer is abnormal • Automatic operation backup when host computer is abnormal • Cascade operation backup when host During loop control by host computer, backup is provided by predetermined operator station 8 when computer fails. computer is abnormal • Local manual operation • Local automatic operation • Local cascade operation At startup of plant, operation and startup are performed by loop display or like from other than operator station and operation mode is monitored by operator station. 33 3.3 Data Used for Process Control Instructions 3.3.5 Loop tag memory allocation contents LCA • Automatic MV setting from host computer 1 CHAPTER 4 4.1 HOW TO EXECUTE PROCESS CONTROL INSTRUCTIONS Execution Cycle and Control Cycle (1) Execution cycle (a) An execution cycle is an interval at which the process control instruction is executed. (b) There are the following methods to execute the process control instruction in each execution cycle. 1) Method using timer A timer is used to measure the execution cycle and the process control instruction is executed when the timer times out. 2) Method using interrupt programs Any of interrupt programs of I28 to I31 is run in each execution cycle. 3) Method using fixed scan execution type program A fixed scan execution type program is run in each execution cycle. (c) Specify in the special registers (SD1500, SD1501) the value of the execution cycle used for the process control instruction as a real number. (2) Control cycle (a) A control cycle is an interval in which PID control is performed for an instruction such as S.2PID (2-degree-offreedom PID). As the control cycle, specify an integral multiple of the execution cycle. The S.2PID or similar instruction counts the execution cycle in each execution cycle and starts PID operation when the specified control cycle is reached. (b) Specify in the loop tag memory (See Page 28, Section 3.3.1) the control cycle used for the S.2PID or similar instruction. The S.2PID or similar instruction uses the value of the control cycle specified in the loop tag memory to perform PID control. Example) When monitoring is performed at intervals of 1s in 2-degree-of-freedom PID control and PID control is carried out at intervals of 5s. 0 1 3 2 5 4 6 7 8 9 10 11 12 13 14 15 16 17 18 (s) Execution cycle 1s 1s 1s 1s 1s 5s 5s 5s Control cycle (Execution cycle) N S.2PID instruction performs processing at intervals of 5s. When the control cycle is set to an integral multiple of the execution cycle, monitoring such as a PV check can be performed in each execution cycle. 34 4.2 Concept of Program 1 [Program example using S.2PID instruction at execution cycle of 1s] 2 Loop tag memory setting Loop tag memory setting Operation constant setting Operation constant setting Setting of data for S.IN, S.PHPL, S.2PID and S.OUT1 3 Execution command (1s) K10 T0 Execution cycle measurement 4 T0 PLS M0 6 M0 MOV U0\GO D0 Input data (PV) setting Import of data (PV) from A/D converter module or like 6 CALL P1 7 RST T0 MOV D1 U2\G0 MV output Output of MV from D/A converter module or like 8 FEND P1 SM400 FLT D0 R0 4.2 R0 R100 R200 R1000 Concept of Program S.IN EMOV R100 R20 S.PHPL R20 R120 R220 R1000 Process control instruction designation S.IN instruction S.PHPL instruction S.2PID instruction S.OUT1 instruction EMOV R120 R40 S.2PID R40 R140 R240 R1000 R300 EMOV R140 R60 S.OUT1 R60 R160 R260 R1000 INT R160 D1 RET 35 CHAPTER 5 5.1 EXECUTION CONDITION SWITCHING AND FUNCTIONS Execution Condition Switching 5.1.1 Loop RUN/STOP If any loop component such as a detector or operation end other than the programmable controller fails, each loop can be run/ stopped to perform the maintenance of the corresponding loop. The "SPA" bit of the alarm detection (ALM) is used to run/stop the corresponding loop. (1) Basic operation during loop STOP (a) Output status hold (The S.2PID instruction is output = 0) (b) Alarm No detection (Process alarm) (c) 36 Make the control mode MAN. 5.2 Functions 5.2.1 1 Tracking function 2 The tracking function includes the "bumpless function" and "output limiter processing". (1) Bumpless function The bumpless function prevents manipulated value (MV) output stepping changes when switching from the automatic 3 mode to manual mode and continuously controls MV output. (2) Output limiter processing function The output limiter processing function limits the upper limit and lower limit of the manipulated value (MV) output by the 4 PID operation during the automatic mode. This output limiter processing function is only valid in the automatic mode and is not executed for manual data. In addition, when the parameter tracking function execution validity is set to not valid when in the automatic mode the output limiter processing function will not execute. 5.2.2 5 6 Cascade loop tracking The process control loops that comprise a cascade loop use the manipulated value (MV) of a primary loop (Loop 0) as the set value (SV) of a secondary loop (Loop 1). 7 Tracking is performed to prevent the sudden variation of the set value (SV) when the operation mode of the secondary loop (Loop 1) is changed. 8 (1) The cascade PID loop Tracking processing is shown in the diagram below. [Processing concept diagram] SV 5.2 Functions 5.2.1 Tracking function PID PV1 Loop 0 Trucking data transmission MV SV Trucking bit (TRK: 1) PID PV2 Loop 1 MV (a) In cascade operation, the manipulated value (MV) of Loop 0 is transferred to the set value (SV) of Loop 1. (b) When cascade operation is not performed, the set value (SV) of Loop 1 is transferred to the manipulated value (MV) of Loop 0. (Tracking to the source specified as the input terminal of the set value (SV) of Loop 1) 37 (2) Make the following settings to perform tracking. (Tracking is performed when the operation mode is switched to other than CAS, CSV or CCB.) For 2-degree-of-freedom PID (S.2PID), set the following operation constant items to specify tracking. Setting item Tracking bit (TRK) Set value pattern (SVPTN) 5.2.3 Setting 1 (Tracking performed) Set value pattern Set value Used 0 (Set value is upper loop MV.) 0 (E2 is used) Loop selector tracking Tracking is performed under the following conditions. • The operation mode is any of MAN, CMB, CMV and LCM and the tracking bit (TRK) is 1 • When the operation mode is any of AUT, CAS, CAB, CCB, CSV, LCA and LCC The tracking bit (TRK) is 1 and BB1 of BB is 1 Manipulated value (MV) Loop tag memory Process value (PV1) S.IN S.PHPL S.2PID S.OUT1 Loop 0 S.IN S.PHPL E1 S.SEL Loop 1 Process value (PV2) Tracking S.2PID Loop tag memory S.OUT1 E2 Manipulated value (MV) Example) When the S.SEL instruction uses the input value E1 and E1 uses the upper loop (loop 0) MV, the S.SEL instruction's MV is trucked to loop 0's MV. The setting that conducts Tracking is shown below. Operation constant Tracking bit Set value pattern 1 S2 +4 +5 1 0 1 0 0 0: Tracking not performed. 1: Tracking performed. Input value selection 0: E1 is selected. 1: E2 is selected. Input value (E1) use 0: E1 is used. 1: E1 is not used. Input value (E2) use 0: E2 is used. 1: E2 is not used. Input value (E1) pattern 0: E1 is upper loop MV. 1: E1 is not upper loop MV. Input value (E2) pattern 0: E2 is upper loop MV. 1: E2 is not upper loop MV. 38 CHAPTER 6 INSTRUCTIONS 1 6.1 How to Read the Instruction List 2 Process control instructions are classified into six categories: I/O control instructions, control operation instructions, compensation operation instructions, arithmetic operation instructions, comparison operation instructions, and auto tuning instructions. 3 4 4 6 I/O control instruction 1) 2) 3) 4) 5) 6) 7) 7 8) 1) Instructions are classified by their application. 8 2) An instruction symbol used in the program 3) A written format in the ladder diagram S.OUT2 S1 D1 S2 D2 6.1 How to Read the Instruction List Shows the destination side. Shows the source side. Shows the instruction symbol. Destination: Shows the destination of the data after operation. Source: Stores the data before the operation. 4) A written format in the structured ladder/FBD Shows the instruction symbol. Inputs the execution condition of an instruction. S_OUT2 EN ENO S1 d1 S2 d2 Shows the source side. Outputs an execution status. Shows the destination side. 39 5) A written format in the structured text language Outputs an execution status. Inputs the execution condition of an instruction. ENO:=S_OUT2 (EN, s1, s2, d1, d2) Shows the destination side. Shows the source side. Shows the instruction symbol. 6) Details of processing performed by the instruction 7) The number of steps in the instruction. For details, refer to Page 22, Section 2.2.7. 8) Pages to be referred to 40 6.2 List of Instructions 1 6.2.1 I/O control instructions 2 Category Instruction Symbol symbol S.IN steps Reference 3 S1 D1 S2 D2 Conducts the input data (PV) Upper/ S_IN S.IN Processing details Number of EN ENO s1 d1 s2 d2 lower limit check, input limiter processing, engineering value 7 Page 55 4 ENO:=S_IN(EN,s1,s2,d1,d2); S.OUT1 S1 D1 S2 D2 Calculates the MV (0 to 100%) from the S_OUT1 S.OUT1 4 conversion, and digital filter processing. EN 6 input data (MV), processes the upper ENO and lower limit and Change rate limiter s1 d1 processing, and conducts output on time s2 d2 conversion. 8 Page 60 7 ENO:=S_OUT1(EN,s1,s2,d1,d2); S.OUT2 S_OUT2 I/O control instruction S.OUT2 8 S1 D1 S2 D2 Performs change rate, upper/lower limiter processing and output on time s1 d1 conversion from the input data (MV). s2 d2 8 Page 66 8 Page 71 8 Page 75 ENO:=S_OUT2(EN,s1,s2,d1,d2); S.MOUT S1 D1 S2 D2 S_MOUT S.MOUT EN Reads the MV of the loop tag memory ENO s1 d1 s2 d2 and performs output conversion and alarm clear processing. ENO:=S_MOUT(EN,s1,s2,d1,d2); S.DUTY S1 D1 S2 D2 S_DUTY S.DUTY EN Changes the ON/OFF rate within a ENO s1 d1 s2 d2 given cycle in proportion to the input data (0 to 100%) and outputs the result. ENO:=S_DUTY(EN,s1,s2,d1,d2); 41 6.2 List of Instructions 6.2.1 I/O control instructions ENO EN Category Instruction Symbol symbol Number of steps Reference S1 D1 S2 D2 S.BC S_BC S.BC Processing details Compares the input data with the set EN ENO s1 d1 s2 d2 value and outputs bit data as soon as 7 Page 81 8 Page 85 the input data reaches the set value. ENO:=S_BC(EN,s1,s2,d1,d2); I/O control instruction S1 D1 S2 D2 S.PSUM S_PSUM S.PSUM EN ENO s1 d1 s2 d2 Integrates the number of input pulses and outputs the result. ENO:=S_PSUM(EN,s1,s2,d1,d2); 6.2.2 Category Control operation instructions Instruction Symbol symbol S.PID Processing details Number of steps Reference S1 D1 S2 D2 S3 Conducts process value derivative type PID operations. (Incomplete derivative) S_PID S.PID EN ENO Performs SV setting processing, s1 d1 tracking processing, gain Kp operation s2 d2 processing, PID operation and deviation s3 9 Page 90 9 Page 98 9 Page 106 check. ENO:=S_PID(EN,s1,s2,s3,d1,d2); S.2PID S1 D1 S2 D2 S3 Performs 2-degree-of-freedom PID operation (incomplete derivative). S_2PID Control operation S.2PID instruction EN ENO Performs SV setting processing, s1 d1 tracking processing, gain Kp operation s2 d2 processing, 2-degree-of-freedom PID s3 operation and deviation check. ENO:=S_2PID(EN,s1,s2,s3,d1,d2); S.PIDP S1 D1 S2 D2 S3 S.PIDP Performs SV setting processing, tracking processing, gain Kp operation S_PIDP EN Performs position type PID operation. processing, PID operation, deviation ENO s1 d1 s2 d2 s3 check and operation mode judgment. According to the result, performs change rate, upper/lower limiter and output on time conversion or performs ENO:=S_PIDP(EN,s1,s2,s3,d1,d2); 42 alarm clear processing and output on time conversion. Category Instruction Symbol symbol Processing details Number of steps Reference 1 S1 D1 S2 D2 S3 S.SPI Judges between the operating time and hold time, and if it is the operating time, S_SPI S.SPI EN ENO performs SV setting processing, s1 d1 tracking processing, gain Kp operation s2 d2 processing, SPI operation and deviation s3 9 Page 115 check. 3 ENO:=S_SPI(EN,s1,s2,s3,d1,d2); S1 D1 S2 D2 S3 S.IPD Performs I-PD operation. S_IPD S.IPD 2 4 Performs SV setting processing, EN ENO s1 d1 s2 d2 s3 tracking processing, gain Kp operation 9 Page 122 processing, IPD operation and deviation 4 check. ENO:=S_IPD(EN,s1,s2,s3,d1,d2); S.BPI 6 S1 D1 S2 D2 S3 Performs blend PI operation. S_BPI S.BPI Performs SV setting processing, EN ENO s1 d1 s2 d2 s3 Control tracking processing, gain Kp operation 9 Page 130 processing, BPI operation and deviation check. 8 ENO:=S_BPI(EN,s1,s2,s3,d1,d2); operation instruction S.R S1 D1 S2 D2 S3 S_R Performs engineering value conversion, EN ENO s1 d1 s2 d2 tracking processing, change rate limiter 8 Page 137 8 Page 142 8 Page 148 and ratio operation on the input data. s3 ENO:=S_R(EN,s1,s2,s3,d1,d2); S.PHPL S1 D1 S2 D2 S_PHPL S.PHPL EN Conducts an Upper limit value/lower ENO s1 d1 s2 d2 limit value check of the PV output by the S.IN instruction. ENO:=S_PHPL(EN,s1,s2,d1,d2); S.LLAG S1 D1 S2 D2 S_LLAG S.LLAG EN Conducts lead-lag compensation for ENO s1 d1 s2 d2 input data and outputs the operation results. ENO:=S_LLAG(EN,s1,s2,d1,d2); 43 6.2 List of Instructions 6.2.2 Control operation instructions S.R 7 Category Instruction Symbol symbol Number of steps Reference S1 D1 S2 D2 S.I S_I S.I Processing details EN Conducts integral operations on the ENO s1 d1 s2 d2 input data and outputs the operation 7 Page 150 7 Page 152 8 Page 154 7 Page 157 7 Page 159 8 Page 161 results. ENO:=S_I(EN,s1,s2,d1,d2); S1 D1 S2 D2 S.D S_D S.D EN Conducts Derivative operations on the ENO s1 d1 s2 d2 input data and outputs the operation results. ENO:=S_D(EN,s1,s2,d1,d2); S.DED S1 D1 S2 D2 S_DED S.DED Control EN ENO s1 d1 s2 d2 Delays the input data by the specified dead time and then outputs it. ENO:=S_DED(EN,s1,s2,d1,d2); operation S.HS instruction S1 D1 S2 D2 S_HS S.HS EN ENO s1 d1 s2 d2 Outputs the maximum value among the input data. ENO:=S_HS(EN,s1,s2,d1,d2); S.LS S1 D1 S2 D2 S_LS S.LS EN ENO s1 d1 s2 d2 Outputs the minimum value among the input data. ENO:=S_LS(EN,s1,s2,d1,d2); S1 D1 S2 D2 S.MID S_MID S.MID EN Outputs the middle value between the ENO s1 d1 s2 d2 ENO:=S_MID(EN,s1,s2,d1,d2); 44 maximum value and minimum value among the input data. Category Instruction Symbol symbol Processing details Number of steps Reference 1 S1 D1 S2 D2 S.AVE S_AVE S.AVE EN ENO s1 d1 s2 d2 Calculates and outputs the average value of the input data. 8 Page 164 3 ENO:=S_AVE(EN,s1,s2,d1,d2); S.LIMT S1 D1 S2 D2 4 S_LIMT S.LIMT 2 EN ENO s1 d1 s2 d2 Limits the output value with hysteresis. 8 Page 166 4 ENO:=S_LIMT(EN,s1,s2,d1,d2); S.VLMT1 6 S1 D1 S2 D2 S_VLMT1 S.VLMT1 Control EN ENO s1 d1 s2 d2 Limits the varying speed of the output value. 9 Page 168 8 ENO:=S_VLMT1(EN,s1,s2,d1,d2); operation S.VLMT2 instruction 7 S1 D1 S2 D2 S_VLMT2 ENO s1 d1 s2 d2 Limits the varying speed of the output value. 9 Page 171 9 Page 173 9 Page 179 ENO:=S_VLMT2(EN,s1,s2,d1,d2); S.ONF2 S1 D1 S2 D2 S3 Performs two-position ON/OFF control. S_ONF2 S.ONF2 EN Performs SV setting processing, ENO s1 d1 s2 d2 s3 tracking processing, MV compensation, MV output and two-position ON/OFF control. ENO:=S_ONF2(EN,s1,s2,s3,d1,d2); S.ONF3 S1 D1 S2 D2 S3 Performs three-position ON/OFF control. S_ONF3 S.ONF3 EN ENO Performs SV setting processing, s1 d1 tracking processing, MV compensation, s2 d2 MV output and three-position ON/OFF s3 control. ENO:=S_ONF3(EN,s1,s2,s3,d1,d2); 45 6.2 List of Instructions 6.2.2 Control operation instructions S.VLMT2 EN Category Instruction Symbol symbol Processing details Number of steps Reference S1 D1 S2 D2 S.DBND S_DBND S.DBND EN ENO s1 d1 s2 d2 Provides a dead band and performs output processing. 8 Page 185 8 Page 187 9 Page 192 8 Page 198 8 Page 201 ENO:=S_DBND(EN,s1,s2,d1,d2); S1 D1 S2 D2 S.PGS S_PGS S.PGS EN ENO s1 d1 s2 d2 Provides a control output according to the SV and MV pattern. ENO:=S_PGS(EN,s1,s2,d1,d2); S1 D1 S2 D2 S3 S.SEL Outputs the value selected by the S_SEL Control operation S.SEL instruction selection signal out of the input data in EN ENO s1 d1 s2 d2 s3 the automatic mode, or outputs the MV of the loop tag memory in the manual mode. ENO:=S_SEL(EN,s1,s2,s3,d1,d2); S.BUMP S1 D1 S2 D2 Brings the output value closer to the S_BUMP S.BUMP EN output set value from the output control ENO value gradually when the mode select s1 d1 signal is switched from manual to s2 d2 automatic. ENO:=S_BUMP(EN,s1,s2,d1,d2); S.AMR S1 D1 S2 D2 S_AMR S.AMR EN ENO s1 d1 s2 d2 ENO:=S_AMR(EN,s1,s2,d1,d2); 46 Increases or decreases the output value at the fixed rate. 6.2.3 Compensation operation instructions 1 Category Instruction Symbol symbol S.FG steps Reference 2 S1 D1 S2 D2 S_FG S.FG Processing details Number of Outputs the value that follows the EN ENO s1 d1 s2 d2 function generator pattern whose input 7 Page 203 data is specified. 4 ENO:=S_FG(EN,s1,s2,d1,d2); S.IFG S1 D1 S2 D2 S_IFG S.IFG 3 4 Outputs the value that follows the EN ENO s1 d1 s2 d2 inverse function generator pattern 8 Page 205 whose input data is specified. 6 ENO:=S_IFG(EN,s1,s2,d1,d2); S_FLT S.FLT Compensa- 7 S1 D1 S2 D2 S.FLT Outputs the average value of n pieces EN ENO s1 d1 s2 d2 of data sampled at the specified data 8 Page 207 8 Page 210 8 Page 212 8 Page 215 collection intervals. 8 ENO:=S_FLT(EN,s1,s2,d1,d2); tion operation S.SUM S1 D1 S2 D2 S_SUM S.SUM EN ENO s1 d1 s2 d2 Integrates the input data and outputs the result. ENO:=S_SUM(EN,s1,s2,d1,d2); S.TPC S1 D1 S2 D2 S_TPC S.TPC Makes temperature/pressure EN ENO s1 d1 s2 d2 correction to the input data and outputs the result. ENO:=S_TPC(EN,s1,s2,d1,d2); S.ENG S1 D1 S2 D2 S_ENG S.ENG EN ENO s1 d1 s2 d2 Converts the input data into an engineering value. ENO:=S_ENG(EN,s1,s2,d1,d2); 47 6.2 List of Instructions 6.2.3 Compensation operation instructions instruction Category Instruction Symbol symbol S.IENG tion operation S.IENG instruction EN Number of steps Reference S1 D1 S2 D2 S_IENG Compensa- Processing details Reversely converts the input data from ENO s1 d1 s2 d2 the engineering value and outputs the 8 Page 217 result. ENO:=S_IENG(EN,s1,s2,d1,d2); 6.2.4 Category Arithmetic operation instructions Instruction Symbol symbol Processing details Number of steps Reference S1 D1 S2 D2 S.ADD S_ADD S.ADD EN ENO s1 d1 s2 d2 Adds the input data with coefficients. 8 Page 219 8 Page 221 8 Page 223 8 Page 225 ENO:=S_ADD(EN,s1,s2,d1,d2); S.SUB S1 D1 S2 D2 S_SUB S.SUB Arithmetic EN ENO s1 d1 s2 d2 Subtracts the input data with coefficients. ENO:=S_SUB(EN,s1,s2,d1,d2); operation instruction S1 D1 S2 D2 S.MUL S_MUL S.MUL EN ENO s1 d1 s2 d2 Multiplies the input data with coefficients. ENO:=S_MUL(EN,s1,s2,d1,d2); S.DIV S1 D1 S2 D2 S_DIV S.DIV EN ENO s1 d1 s2 d2 ENO:=S_DIV(EN,s1,s2,d1,d2); 48 Divides the input data with coefficients. Category Instruction Symbol symbol S.SQR Processing details Number of steps Reference 1 S1 D1 S2 D2 S_SQR S.SQR Arithmetic EN ENO s1 d1 s2 d2 Outputs the square root ( ) of the input data. 8 Page 227 3 ENO:=S_SQR(EN,s1,s2,d1,d2); operation instruction S1 D1 S2 D2 S.ABS 4 S_ABS S.ABS 2 EN ENO s1 d1 s2 d2 Outputs the absolute value of the input data. 8 Page 229 4 ENO:=S_ABS(EN,s1,s2,d1,d2); 6.2.5 Category 6 Comparison operation instructions Instruction Symbol symbol S. Processing details Number of steps Reference S1 D1 S2 D2 7 8 S_GT S. > EN ENO d1 s2 d2 the result of comparison. 7 Page 231 7 Page 233 7 Page 235 ENO:=S_GT(EN,s1,s2,d1,d2); S. S_LT Comparison operation S1 D1 S2 D2 S. < instruction EN ENO s1 d1 s2 d2 Compares the input data and outputs the result of comparison. ENO:=S_LT(EN,s1,s2,d1,d2); S1 D1 S2 D2 S. S_EQ S. = EN ENO s1 d1 s2 d2 Compares the input data and outputs the result of comparison. ENO:=S_EQ(EN,s1,s2,d1,d2); 49 6.2 List of Instructions 6.2.5 Comparison operation instructions s1 Compares the input data and outputs Category Instruction Symbol symbol S. Processing details Number of steps Reference S1 D1 S2 D2 S_GE S. >= Comparison EN ENO s1 d1 s2 d2 Compares the input data and outputs the result of comparison. 7 Page 237 7 Page 239 ENO:=S_GE(EN,s1,s2,d1,d2); operation S. instruction S1 D1 S2 D2 S_LE S. <= EN ENO s1 d1 s2 d2 Compares the input data and outputs the result of comparison. ENO:=S_LE(EN,s1,s2,d1,d2); 6.2.6 Category Auto tuning instructions Instruction Symbol symbol S.AT1 Processing details Number of steps Reference S1 D1 S2 D2 D3 S_AT1 Auto Tuning Instruction S.AT1 EN s1 s2 ENO d1 d2 d3 ENO:=S_AT1(EN,s1,s2,d1,d2,d3); 50 Performs auto tuning and makes the initial setting of the PID constants. 9 Page 244 CHAPTER 7 HOW TO READ INSTRUCTION DETAILS 1 This chapter explains the page layout for chapters that describe instruction details (Chapter 8 to 13). The descriptions in this chapter are for explanation purpose only, and are different from the actual pages. 2 3 1) 4 2) 4 3) 6 4) 7 8 5) 6) 51 1) A section number, instruction name, and instruction symbol 2) A written format in the ladder diagram and execution conditions Execution condition During on Symbol shown on the reference page 3) Written formats in the structured ladder/FBD and structured text language 4) Explanations of the setting data. In Structured projects, replace the setting data S1 and D1 with s1 and d1. For details on data types, refer to the MELSEC-Q/L/F Structured Programming Manual (Fundamentals). 5) A list of available devices. Devices with are available. Devices are classified as shown below. Setting data Internal devices (System, User) Bit Applicable devices*1 X, Y, M, L, SM, F, B, SB, FX, FY*2 *1: *2: *3: *4: Word T, ST, C, D, W, SD, SW, R, ZR FD, @ J \ Bit Word J \X J \Y J \W J \B J \SW J \SB Intelligent function module Index register Zn Constant*4 Others*4 U \G U \G Z K, H , E, $ P, I, J, U, DX, DY, N, BL, TR, BL \ S,V For the description for the individual devices, refer to the User's Manual (Function Explanation, Program Fundamentals) for the CPU module used. FX and FY can be used only for bit data, and FD only for word data. Usable with the CC-Link IE Controller Network, CC-Link IE Field Network, MELSECNET/H, and MELSECNET/10 Devices which can be set are recorded in the "Constant" and the "Other" columns. 6) The function of the instruction 52 Link direct device *3 File register R, ZR 1 7) 2 3 4 4 6 8) 7 8 7) The processing flow of the instruction 8) List of control data. S and U in the Set by column means: • S: Stored by the system • U: Set by the user 53 9) 10) 9) Processing details of the instruction 10) Error conditions and error codes For errors other than described here, refer to the QCPU User's Manual (Hardware Design, Maintenance and Inspection). 54 S.IN CHAPTER 8 I/O CONTROL INSTRUCTIONS 1 8.1 S.IN Analog Input Processing 8.1 S.IN 2 Ladder diagram 3 Start contact S.IN S.IN S1 D1 S2 D2 Structured text language 4 ENO:=S_IN(EN,s1,s2,d1,d2); 4 Structured ladder/FBD S_IN EN ENO s1 d1 s2 d2 6 Input argument Output argument Setting EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of real data type (0..7) ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices R, ZR J \ U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Bit Word Constant Other S.IN Bit 8 8.1 data 7 Function Converts the input value (E1) of the device specified in specified in D1 S1 into an engineering value, and stores the result into the device . Also performs the range check, input limiter processing and digital filter processing of the input value (E1) at this time. 55 S.IN Set Data Block diagram The processing block diagram of the S.IN instruction is shown below. (The numerals (1) to (5) in the diagram indicate the order of the processing.) HH, H, L, LL (1) NMAX, NMIN EMAX, EMIN (2) (3) E1 Range check RUN(SPA (5) Loop stop judgment Input limiter 0) (4) Engineering value reverse conversion Digital filter BW Upper limit alarm STOP(SPA 1) Lower limit alarm AND BB2 AND BB3 BB1 OR SPA SEA (5) ERRI SEI MAN MODE Last BW Loop stop processing All OFF Set Data (1) Data specified in S.IN instruction Specified position Input data S1 +0 +1 D1 +0 +1 Symbol Recommended range *1 Name +2 56 by -999999 to 999999 –– Real number –– U BW Output value (-999999 to 999999) % Real number –– S –– S BB2 BB3 *1 Set value Input value BB1 memory Standard E1 BB Block Unit Data format –– Alarm b15 b12 limit alarm limit alarm b4 b0 B B B B 3 2 Input upper Input lower b8 B B 1 –– BIN 16bit (0: Without alarm) (1: With alarm) The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. S.IN Specified position S2 +0 +1 +2 +3 +4 +5 +6 +7 Operation constant +8 +9 +10 +11 +12 +13 +14 +15 Symbol Recommended range *1 Name Unit Data format Engineering EMAX conversion -999999 to 999999 % -999999 to 999999 % -999999 to 999999 –– upper limit Engineering EMIN conversion lower limit NMAX NMIN Input upper limit Input lower limit -999999 to 999999 –– -999999 to 999999 –– -999999 to 999999 –– -999999 to 999999 –– -999999 to 999999 –– Upper limit HH range error occurrence Upper limit H range error return Lower limit L range error return Lower limit LL range error occurrence Real number Real number Real number Real number Real number Real number Real number Real number Standard Set value by 100.0 U 0.0 U 100.0 U 0.0 U 110.0 U 100.0 U 4 0.0 U 6 -10.0 U 8H S/U 0H S/U 0H S/U 0.2 U 0 to FFFFH D1 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 1 2 3 4 7 8 0 to FFFFH b15 ALM Alarm b4 b0 –– detection *2 BIN 16bit SEA (0: Without alarm) (1: With alarm) S.IN SPA 0: Loop RUN 1: Loop STOP Loop tag memory b8 S E A 0 to FFFFH Alarm +4 INH detection inhibition b15 b12 E R R I b8 S E I b4 b0 –– BIN 16bit 0: Alarm enable 1: Alarm inhibit *1 *2 +38 Filter +39 coefficient 0 to 1 8.1 +3 b12 S P A –– Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 57 S.IN Set Data contents Processing (1) Range check (a) A range check is performed on the input value (E1). An alarm is output if the input value (E1) exceeds the upper/lower limit value. Range check Range check result (alarm output) Condition BB2 E1 HH Upper limit check 1 E1 H H < E1 < HH E1 LL Lower limit check *1 *1 BB3 BB1, SEA –– 1 *1 0 –– 0 Last value –– Last value –– 1 *1 1 *1 E1 L –– 0 0 LL < E1 < L –– Last value Last value When SEI or ERRI in the alarm detection inhibition (INH) is set to 1, SEA, BB1, BB2 and BB3 show 0 since the alarm is prohibited. (b) Last value hold processing When a range excess occurs (BB1 = 1) in the range check, whether operation will be continued unchanged or the S.IN instruction will be terminated is judged depending on whether SM1500 is ON or OFF. 1) When SM1500 is OFF (not in the hold mode), "(2) Input limiter processing" is performed if a range excess occurs (BB1 = 1). 2) When SM1500 is ON (in the hold mode), the following processing is performed and the S.IN instruction is terminated if a range excess occurs (BB1 = 1). • BW retains the last value. • Error information is set in BB. (2) Input limiter processing Upper/lower limiter setting is made on the input value (E1). Condition NMAX E1 NMIN NMIN NMIN < E1 < NMAX 58 Result (T1) E1 NMAX E1 S.IN (3) Engineering value reverse conversion The result (T1) of the input limiter is converted reversely from the engineering value according to the following 1 expression. T2 EMAX T2 (EMAX EMIN) T1 NMIN NMAX NMIN 2 EMIN 3 EMIN NMIN NMAX T1 4 (4) Digital filter The input value (E1) is digitally filtered according to the following expression. The digital filter is used to reduce noise. BW=T2 + 4 × (Previous BW value - T2) (5) Loop stop processing 6 (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.IN instruction. 1) BW retains the last value. 7 2) SEA of the alarm detection (ALM) are turned to 0. 3) The operation mode (MODE) is changed to MAN. 4) BB1 to BB3 of BB are turned to 0. 8 (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(1) Range check". Operation Error 8.1 In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error definition QnPHCPU S.IN Error code QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , D1 , S2 , D2 are either a non-numeric or non- When HH < H, L < LL, or NMAX < NMIN 59 S.OUT1 8.2 S.OUT1 Output Processing-1 with Mode Switching 8.2 S.OUT1 Ladder diagram Start contact S.OUT1 S.OUT1 S1 D1 Structured ladder/FBD S2 D2 Structured text language S_OUT1 EN Input argument Output argument Setting d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit ENO:=S_OUT1(EN,s1,s2,d1,d2); ENO s1 Word R, ZR J Bit \ U Word Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other Function Calculates the manipulated value (MV) by performing input addition processing from the input value (E1 = MV) of the device specified in S1 , and stores the result into the device specified in D1 . Also performs the change rate, upper/lower limiter, reset windup and output conversion processings of the calculated manipulated value (MV) at this time. 60 S.OUT1 Set Data Block diagram 1 The processing block diagram of the S.OUT1 instruction is shown below. (The numerals (1) to (6) in the diagram indicate the order of the processing.) MH, ML, DML (1) E1 Mode judgment RUN(SPA (6) Loop stop judgment AUT (2) or like Input addition processing 0) STOP(SPA 1) MV (3) MVP (4) Change rate, upper/lower limiter 2 NMAX, NMIN 3 (5) Reset windup Output conversion processing BW 4 MAN or like Alarm clear processing 4 Upper limit alarm Lower limit alarm Change rate alarm 6 SPA ERRI MHI AND BB2 ERRI MLI AND BB3 ERRI DMLI AND BB4 7 8 8.2 MHA S.OUT1 MLA DMLA TRKF OR BB1 MODE (6) All OFF MAN Loop stop processing Last BW All OFF 61 S.OUT1 Set Data (1) Data specified in S.OUT1 instruction Specified position Input data S1 +0 +1 D1 +0 +1 Symbol E1 BW Recommended range *1 Name Input value ( MV) Output value -999999 to 999999 % (-999999 to 999999) –– BB BB1 Block BB2 memory +2 BB3 BB4 S2 Operation constant +0 +1 +2 +3 Unit Data format Real number by –– U –– S –– S 100.0 U 0.0 U 8H S/U 4000H S/U 4000H S/U 0.0 S/U Alarm Output upper b15 b12 b8 b4 limit alarm Output lower limit alarm Output change b0 B B 4 B B B B 3 2 B B 1 –– BIN 16bit (0: Without alarm) (1: With alarm) rate alarm conversion -999999 to 999999 –– -999999 to 999999 –– upper limit Output NMIN number Set value –– Output NMAX Real Standard conversion lower limit Real number Real number 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 0 to FFFFH b12 b15 +3 ALM Alarm detection b8 D M L A S P A b4 S E A b0 M M H L A A –– SPA BIN 16bit 0: Loop RUN 1: Loop STOP DMLA, SEA, MHA, MLA Loop tag memory (0: Without alarm) *2 (1: With alarm) 0 to FFFFH b15 Alarm +4 INH detection inhibition E R R I b12 T R K F b8 D M L I TRKF (0: Without tracking) (1: With tracking) b4 b0 M M H L I I –– BIN 16bit ERRI, DMLI, MHI, MLI 0: Alarm enable 1: Alarm inhibit +12 +13 *1 *2 62 MV Manipulated value -10 to 110 % Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) S.OUT1 Specified position D2 +18 +19 +20 +21 +48 Loop tag memory *2 +49 +54 +55 +62 +63 Symbol MH Recommended range *1 Name Output upper limit value Output lower ML limit value Unit Data format -10 to 110 % -10 to 110 % 0 to 100 % Output change DML rate limit value Integral I constant 0 to 999999 s (-999999 to 999999) % Used by the system as a work area. –– MV inside MVP operation value Real number Standard Set value by 100.0 U 0.0 U 100.0 U Real number Real number Real number memory *2 D2 +116 –– –– 10.0 U 0.0 S 4 S 4 Real number –– 2 3 Loop tag past value 1 –– *3 *1 *2 *3 6 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The application of the loop tag past value memory are indicated below. Specified position 7 Description Alarm detection 2 (ALM2) b15 D2 b12 +116 b8 b4 b0 M L A 2 8 M H A 2 MHA2,MLA2 (0: Without alarm) (1: With alarm) 8.2 When control is to be started from the initial status, the data must be cleared with the sequence program. S.OUT1 (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) Mode judgment Either of the following processings is performed depending on the operation mode (MODE). (a) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM (alarm clear processing) 1) MHA, MLA and DMLA of the alarm detection (ALM) are turned to 0. 2) MHA2 and MLA2 of the alarm detection 2 (ALM2) are turned to 0. 3) BB1 to BB4 of BB are turned to 0. 4) The tracking flag (TRKF) of the alarm detection inhibition (INH) is turned to 1. 5) "(5) Output conversion processing" is performed and the instruction is terminated. (b) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC, "(2) Input addition processing" is performed. However, when SEA of the alarm detection (ALM) is 1 and SM1501 is ON (with hold), BB1 to BB4 are turned to 0 and the S.OUT1 instruction is terminated. 63 S.OUT1 (2) Input addition processing The temporary MV (T) is calculated on the basis of the input value (E1 = MV). (a) When the tracking flag (TRKF) of the alarm detection inhibition (INH) is 1, the following processing is performed. 1) The manipulated value (MV) is stored into the MV internal operation value (MVP). 2) The input value (E1) is changed to 0. ( MV = 0) 3) The tracking flag (TRKF) of the alarm detection inhibition (INH) is turned to 0. 4) The temporary MV (T) is calculated with the following expression. T = E1 + MVP MVP = T (b) When the tracking flag (TRKF) of the alarm detection inhibition (INH) is 0, the temporary MV (T) is calculated with the following expression. T = E1 + MVP MVP = T (3) Change rate, upper/lower limiter The change rate and upper/lower limits are checked for the input value (E1 = MV), and the data after the limiter processing and an alarm are output. (a) The change rate limiter performs the following operation and outputs the result of the operation to BB4 and DMLA. *1 Condition BB4, DMLA |T - MV| DML 0 Result (T1) T (T - MV) > DML 1 *1 MV + DML (T - MV) < - DML 1 *1 MV - DML When DMLI or ERRI in the alarm detection inhibition (INH) is set to 1, DMLA and BB4 show 0 since the alarm is prohibited. (b) The upper/lower limiter performs the following operation and outputs the result of the operation to BB2, BB3, MHA, MLA, MHA2, and MLA2. Condition T1 > MH T1 < ML ML T1 MH *2 *3 64 BB3, MLA, MLA2 0 1 *3 0 BB2, MHA, MHA2 1 *2 MV MH 0 ML 0 T1 When MHI or ERRI in the alarm detection inhibition (INH) is set to 1, MHA and BB2 show 0 since the alarm is prohibited. However, even if MHI and/or ERRI in the alarm detection inhibition (INH) is set to 1, MHA2 holds 1. When MLI or ERRI in the alarm detection inhibition (INH) is set to 1, MLA and BB3 show 0 since the alarm is prohibited. However, even if MLI and/or ERRI in the alarm detection inhibition (INH) is set to 1, MLA2 holds 1. S.OUT1 (4) Reset windup If the manipulated value (MV) exceeds the upper/lower limit value, the following operation is performed to return it to the 1 upper/lower limit value and enable immediate response when the deviation is inverted. However, when the integral constant (T1) is 0, the reset windup processing is not performed. Condition Operation expression When T1 > MH, T TI 1 MVP T (MH TI T) T When T1 < ML, T TI 1 MVP T (ML TI T) T 2 3 (5) Output conversion In the output conversion, the output value is calculated from the following formula. BW NMAX NMIN 100 MV 4 NMIN (6) Loop stop processing 4 (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.OUT1 instruction. 1) BW retains the last value. 6 2) DMLA, MHA and MLA of the alarm detection (ALM) are turned to 0. 3) MHA2 and MLA2 of the alarm detection 2 (ALM2) are turned to 0. 4) The operation mode (MODE) is changed to MAN. 7 5) BB1 to BB4 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. 8 A loop run performs "(1) Mode judgment". (7) Hold processing Used to specify whether the output value will be held or not by the S.OUT1 instruction at sensor error occurrence (detected by the S.IN instruction). A hold processing is performed when the value is determined as RUN at "Loop stop judgement". 8.2 Use SM1501 to select whether the manipulated value (MV) will be held or not at sensor alarm occurrence. S.OUT1 • SM1501 = OFF: Manipulated value (MV) will not be held. • SM1501 = ON: Manipulated value (MV) will be held. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- 65 S.OUT2 8.3 S.OUT2 Output Processing-2 with Mode Switching 8.3 S.OUT2 Ladder diagram Start contact S.OUT2 S.OUT2 S1 D1 Structured ladder/FBD S2 D2 Structured text language S_OUT2 EN Input argument Output argument Setting d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit ENO:=S_OUT2(EN,s1,s2,d1,d2); ENO s1 Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other Function Converts the input value (E1 = MV) of the device specified in in D1 S1 into an output, and stores the result into the device specified . Also performs the change rate, upper/lower limiter processing and output conversion processing of the input value at this time. 66 S.OUT2 Set Data Block diagram 1 The processing block diagram of the S.OUT2 instruction is shown below. (The numerals (1) to (4) in the diagram indicate the order of the processing.) MH, ML, DML 2 NMAX, NMIN MV E1 (1) (2) Mode judgment RUN(SPA 0) (4) Loop stop judgment AUT or like MAN or like STOP(SPA 1) 3 (3) Output conversion processing Change rate, upper/lower limiter BW 4 Alarm clear processing 4 Upper limit alarm Lower limit alarm Change rate alarm 6 SPA ERRI MHI AND BB2 ERRI MLI AND BB3 ERRI DMLI AND BB4 7 8 8.3 MHA S.OUT2 MLA DMLA OR BB1 MODE (4) All OFF MAN Last BW Loop stop processing All OFF 67 S.OUT2 Set Data (1) Data specified in S.OUT2 instruction Specified position Input data S1 D1 Symbol Recommended range *1 Name +0 +1 E1 Input value(MV) +0 +1 BW Output value Unit Data format Standard Set value by –– U -999999 to 999999 % Real number (-999999 to 999999) –– Real number –– S –– BIN 16bit –– S BB Block memory Alarm BB2 Output upper limit alarm BB3 Output lower limit alarm BB4 Output change rate alarm +2 S2 Operation constant BB1 b15 b12 b8 b4 b0 B B 4 B B B B 3 2 B B 1 (0: Without alarm) (1: With alarm) +0 +1 NMAX Output conversion upper limit -999999 to 999999 –– Real number 100.0 U +2 +3 NMIN Output conversion lower limit -999999 to 999999 –– Real number 0.0 U –– BIN 16bit 8H S/U –– BIN 16bit 4000H S/U –– BIN 16bit 4000H S/U 0 to FFFFH D2 +1 MODE Operation mode b15 b12 b8 C S V b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M 0 to FFFFH b12 b15 S P A +3 ALM Alarm detection Loop tag memory *2 b8 D M L A b4 S E A b0 M M H L A A SPA 0: Loop RUN 1: Loop STOP DMLA, SEA, MHA, MLA (0: Without alarm) (1: With alarm) 0 to FFFFH +4 INH Alarm detection inhibition b15 b12 E R R I b8 D M L I b4 b0 M M H L I I 0: Alarm enable 1: Alarm inhibit *1 *2 68 +12 +13 MV Manipulated value -10 to 110 % Real number 0.0 S/U +18 +19 MH Output upper limit value -10 to 110 % Real number 100.0 U +20 +21 ML Output lower limit value -10 to 110 % Real number 0.0 U +48 +49 DML % Real number 100.0 U Output change 0 to 100 rate limit value The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) S.OUT2 Set Data contents Processing 1 (1) Mode judgment Either of the following processings is performed depending on the operation mode (MODE). 2 (a) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM (alarm clear processing) 1) MHA, MLA and DMLA of the alarm detection (ALM) are turned to 0. 2) BB1 to BB4 of BB are turned to 0. 3 3) "(3) Output conversion processing" is performed and the S.OUT2 instruction is terminated. (b) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC, "(2) Change rate, upper/ lower limiter" is performed. However, when SEA of the alarm detection (ALM) is 1 and SM1501 is ON (with hold), BB1 to BB4 are turned to 0 4 and the S.OUT2 instruction is terminated. (2) Change rate, upper/lower limiter The change rate and upper/lower limits are checked for the input value (E1), and the data after the limiter processing and 4 an alarm are output. (a) The change rate limiter performs the following operation and outputs the result of the operation to BB4 and DMLA. Condition BB4, DMLA |E1 - MV| DML 0 (E1 - MV) > DML *1 6 E1 *1 MV + DML 1 *1 MV - DML 1 (E1 - MV) < - DML Result (T1) 7 When DMLI or ERRI in the alarm detection inhibition (INH) is set to 1, DMLA and BB4 show 0 since the alarm is prohibited. (b) The upper/lower limiter performs the following operation and outputs the result of the operation to BB2, BB3, MHA 8 and MLA. Condition BB3, MLA T1 > MH 0 1 ML T1 MH 0 1 MV MH 0 ML 0 T1 When MHI or ERRI in the alarm detection inhibition (INH) is set to 1, MHA and BB2 show 0 since the alarm is prohibited. When MLI or ERRI in the alarm detection inhibition (INH) is set to 1, MLA and BB3 show 0 since the alarm is prohibited. (3) Output conversion In the output conversion, the output value is calculated from the following formula. BW NMAX NMIN 100 MV NMIN 69 S.OUT2 *2 *3 *3 *2 8.3 T1 < ML BB2, MHA S.OUT2 (4) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.OUT2 instruction. 1) BW retains the last value. 2) DMLA, MHA and MLA of the alarm detection (ALM) are turned to 0. 3) The operation mode (MODE) is changed to MAN. 4) BB1 to BB4 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(1) Mode judgment". (5) Hold processing Used to specify whether the output value will be held or not by the S.OUT2 instruction at sensor error occurrence (detected by the S.IN instruction). A hold processing is performed when the value is determined as RUN at "Loop stop judgement". Use SM1501 to select whether the manipulated value (MV) will be held or not at sensor alarm occurrence. • SM1501 = OFF: Manipulated value (MV) will not be held. • SM1501 = ON: Manipulated value (MV) will be held. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 70 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- QnPHCPU QnPRHCPU S.MOUT 8.4 S.MOUT Manual Output 8.4 S.MOUT 1 Ladder diagram 2 Start contact S.MOUT S.MOUT S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_MOUT(EN,s1,s2,d1,d2); 4 S_MOUT EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Dummy device*1 : Real data type S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Operation constant start device : Real data type D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data ENO s1 Word R, ZR J Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 8.4 *1 6 S.MOUT Function Converts the manipulated value (MV) specified in D2 into an output, and stores the result into the device specified in D1 . 71 S.MOUT Set Data Block diagram The processing block diagram of the S.MOUT instruction is shown below. (The numerals (1) to (3) in the diagram indicate the order of the processing.) NMAX, NMIN MV (2) (1) Mode judgment RUN(SPA 0) (3) Loop stop judgment MAN or like AUT or like Output conversion Last BW STOP(SPA 1) (3) SPA MODE 72 MAN Loop stop processing Last BW BW S.MOUT Set Data 1 (1) Data specified in S.MOUT instruction Specified position Block memory D1 S2 Operation constant Symbol Recommended range *1 Name Unit Data format Standard Set value by –– S Output value (-999999 to 999999) –– Real number NMAX Output conversion upper limit -999999 to 999999 –– Real number 100.0 U NMIN Output conversion lower limit -999999 to 999999 –– Real number 0.0 U –– BIN 16bit 8H S/U +0 +1 BW +0 +1 +2 +3 2 3 4 0 to FFFFH D2 +1 MODE Operation mode b15 b12 b8 C S V b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M 6 0 to FFFFH Loop tag b15 memory *2 +3 ALM Alarm detection b12 b8 b4 b0 S P A –– BIN 16bit % Real number 4000H S/U 0.0 U SPA 0: Loop RUN 1: Loop STOP +12 +13 *1 -10 to 110 8 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) S.MOUT Set Data contents Processing (1) Mode judgment Either of the following processings is performed depending on the operation mode (MODE). (a) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM 1) The manipulated value (MV) is used as the output value (BW). 2) "(2) Output conversion processing" is performed. (b) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC, BW retains the last value. (2) Output conversion In the output conversion, the output value is calculated from the following formula. BW NMAX NMIN 100 MV 7 8.4 *2 Manipulated value MV 4 NMIN 73 S.MOUT (3) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.MOUT instruction. 1) BW retains the last value. 2) The operation mode (MODE) is changed to MAN. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(1) Mode judgment". Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 74 When the values of number S2 , D2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.DUTY 8.5 S.DUTY Time Proportioning 8.5 S.DUTY 1 Ladder diagram 2 Start contact S.DUTY S.DUTY S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_DUTY(EN,s1,s2,d1,d2); 4 S_DUTY EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Real data type device*1 S2 : Dummy ENO : Execution result : Bit D1 : Operation constant start device : Array of any 16-bit data (0..1) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data ENO s1 Word : Any 16-bit data J R, ZR Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 8.5 *1 6 Calculates the manipulated value (MV) by performing input addition processing from the input value (E1 = MV) of the device specified in S1 . Turns ON/OFF the device specified in D1 in proportion to the manipulated value (MV). The ON/OFF time is a value on the assumption that the time specified as the control output cycle (CTDUTY) is 100%. The ON/OFF time is changed in each execution cycle. Also performs the change rate, upper/lower limiter and reset windup of the calculated manipulated value (MV) at this time. Manipulated value 70 50 30 Time Output Value (BW) (Device specified in ON D1 ) OFF 50 70 30 70 50 30 75 S.DUTY Function S.DUTY Set Data Block diagram The processing block diagram of the S.DUTY instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) MH, ML, DML MV (1) AUT or like (2) E1 Mode judgment RUN(SPA=0) (7) Loop stop judgment STOP (SPA=1) Input addition processing (3) MVP (4) Change rate, upper/lower limiter CTDUTY (5) Reset windup (6) Output ON time conversion Output conversion BW MAN or like Alarm clear processing Upper limit alarm Lower limit alarm Change rate alarm SPA ERRI MHI AND BB2 ERRI MLI AND BB3 ERRI DMLI AND BB4 MHA MLA DMLA TRKF OR MODE (7) All OFF MAN 76 Last BW Loop stop processing All OFF BB1 S.DUTY Set Data 1 (1) Data specified in S.DUTY instruction Specified position Input data S1 +0 +1 Symbol E1 Recommended range *1 Name Input value ( MV) -999999 to 999999 % BW BW1 Real number Standard Set value by –– U –– b15 D1 +0 Unit Data format b12 b8 b4 3 b0 B W 1 Output bit –– BIN 16Bit –– S (0: OFF) (1: ON) Block BB memory BB1 BB2 +1 BB3 limit alarm Output BB4 b15 b12 b8 b4 change rate b0 B B 4 Output lower limit alarm B B B B 3 2 B B 1 –– BIN 16Bit –– S (0: Without alarm) (1: With alarm) 0 to FFFFH MODE Operation b15 6 7 alarm D2 +1 4 4 Alarm Output upper 2 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16Bit 8H S/U 4000H S/U 4000H S/U 0.0 S/U 8 0 to FFFFH b12 b15 ALM Alarm detection b4 S E A b0 M M H L A A –– SPA BIN 16Bit 0: Loop RUN 1: Loop STOP Loop tag DLMA, SEA, MHA, MLA memory *2 (0: Without alarm) (1: With alarm) 0 to FFFFH b15 Alarm +4 INH detection inhibition E R R I b12 T R K F b8 D M L I TRKF (0: Without tracking) (1: With tracking) b4 b0 M M H L I I –– BIN 16Bit ERRI, DMLI, MHI, MLI 0: Alarm enable 1: Alarm inhibit +12 +13 *1 *2 MV Manipulated value -10 to 110 % Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 77 S.DUTY +3 b8 D M L A 8.5 S P A S.DUTY Specified position D2 +18 +19 +20 +21 +48 Loop tag memory *2 +49 +54 +55 +62 +63 +68 +69 Loop tag Recommended range *1 Name Output upper MH limit value Output lower ML limit value Unit Data format -10 to 110 % -10 to 110 % 0 to 100 % 0 to 999999 s (-999999 to 999999) % Output DML change rate limit value Integral I constant MV inside MVP operation value CTDUTY Control output cycle 0 to 999999 Note that CTDUTY T 32767 s Real number Real number Real number Real number Real number Real number –– memory Set value by 100.0 U 0.0 U 100.0 U 10.0 U 0.0 S 1.0 U –– Used by the system as a work area. –– –– –– S +121 *1 *2 *3 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position Description Alarm detection 2 (ALM2) b15 D2 b12 b8 +116 b4 b0 M L A 2 M H A 2 MHA2,MLA2 (0: Without alarm) (1: With alarm) +118 Control output cycle counter initial preset flag +119 Control output cycle counter*4 +120 Output counter +121 Output ON counter *4 When control is to be started from the initial status, the data must be cleared with the sequence program. The control output cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 78 Standard D2 +116 past value *2 *3 Symbol S.DUTY Set Data contents Processing 1 (1) Mode judgment Either of the following processings is performed depending on the operation mode (MODE). 2 (a) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM (alarm clear processing) 1) MHA, MLA and DMLA of the alarm detection (ALM) are turned to 0. 2) MHA2 and MLA2 of the alarm detection 2 (ALM2) are turned to 0. 3 3) BB1 to BB4 of BB are turned to 0. 4) The tracking flag (TRKF) of the alarm detection inhibition (INH) is turned to 1. 5) "(5) Output ON time conversion processing" is performed. 4 (b) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC, "(2) Input addition processing" is performed. However, when SEA of the alarm detection (ALM) is 1 and SM1501 is ON (with hold), BB1 to BB4 are turned to 0 and the S.DUTY instruction is terminated. 4 (2) Input addition processing The temporary MV (T) is calculated on the basis of the input value (E1 = MV). (a) When the tracking flag (TRKF) of the alarm detection inhibition (INH) is 1, the following processing is performed. 6 1) The manipulated value (MV) is stored into the MV internal operation value (MVP). 7 2) The input value (E1) is changed to 0. ( MV = 0) 3) The tracking flag (TRKF) of the alarm detection inhibition (INH) is turned to 0. 4) The temporary MV (T) is calculated with the following expression. 8 T = E1 + MVP MVP = T (b) When the tracking flag (TRKF) of the alarm detection inhibition (INH) is 0, the temporary MV (T) is calculated with the following expression. 8.5 T = E1 + MVP MVP = T The change rate and upper/lower limits are checked for a difference between the temporary MV (T) and manipulated value (MV), and the data after the limiter processing and an alarm are output. (a) The change rate limiter performs the following operation and outputs the result of the operation to BB4 and DMLA. Condition BB4, DMLA Result (T1) |T - MV| DML 0 T (T - MV) > DML (T - MV) < - DML *1 1 *1 MV + DML 1 *1 MV - DML When DMLI or ERRI in the alarm detection inhibition (INH) is set to 1, DMLA and BB4 show 0 since the alarm is prohibited. (b) The upper/lower limiter performs the following operation and outputs the result of the operation to BB2, BB3, MHA, MLA, MHA2, and MLA2.. Condition T1 > MH T1 < ML ML T1 MH *2 *3 BB3, MLA, MLA2 0 1 *3 0 BB2, MHA, MHA2 1 *2 MV MH 0 ML 0 T1 When MHI or ERRI in the alarm detection inhibition (INH) is set to 1, MHA and BB2 show 0 since the alarm is prohibited. However, even if MHI and/or ERRI in the alarm detection inhibition (INH) is set to1, MHA2 holds 1. When MLI or ERRI in the alarm detection inhibition (INH) is set to 1, MLA and BB3 show 0 since the alarm is prohibited. However, even if MLI and/or ERRI in the alarm detection inhibition (INH) is set to1, MLA2 holds 1. 79 S.DUTY (3) Change rate, upper/lower limiter S.DUTY (4) Reset windup If the manipulated value (MV) exceeds the upper/lower limit value, the following operation is performed to return it to the upper/lower limit value and enable immediate response when the deviation is inverted. However, when the integral constant (T1) is 0, the reset windup processing is not performed. Condition Operation expression When T1 > MH, T TI 1 MVP T (MH TI T) T When T1 < ML, T TI 1 MVP T (ML TI T) T (5) Output ON time conversion processing (a) When the control output cycle (CTDUTY) is reached, the output ON counter is calculated with the following expression. At this time, the output counter is cleared (to 0). Output ON Counter CTDUTY T 1 100 MV The output ON counter rounds off a fraction to no decimal places. (b) When the control output cycle (CTDUTY) is not reached, the output counter is incremented by 1 and "(6) Output conversion processing" is performed. (6) Output conversion processing In the output conversion processing, the following processing is performed. Condition BW Output counter < output ON counter 1 (ON) Output counter output ON counter 0 (OFF) (7) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.DUTY instruction. 1) BW is output at the last ON/OFF rate. 2) DMLA, MHA and MLA of the alarm detection (ALM) are turned to 0. 3) MHA2 and MLA2 of the alarm detection 2 (ALM2) are turned to 0. 4) The operation mode (MODE) is changed to MAN. 5) BB1 to BB4 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(1) Mode judgment". (8) Hold processing Used to specify whether the output value will be held or not by the S. DUTY instruction at sensor error occurrence (detected by the S.IN instruction). A hold processing is performed when the value is determined as RUN at "Loop stop judgement". Use SM1501 to select whether the manipulated value (MV) will be held or not at sensor alarm occurrence. • SM1501 = OFF: Manipulated value (MV) will not be held. • SM1501 = ON: Manipulated value (MV) will be held. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When CTDUTY < 0 or the execution cycle (SD1500) < 0 80 QnPHCPU QnPRHCPU S.BC 8.6 S.BC Batch Counter 8.6 S.BC 1 Ladder diagram 2 Start contact S.BC S.BC S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_BC(EN,s1,s2,d1,d2); 4 S_BC EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Any 32-bit data device*1 S2 : Dummy ENO : Execution result : Bit D1 : Operation constant start device : Array of any 16-bit data (0..1) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data ENO s1 Word R, ZR : Any 16-bit data J Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 8.6 *1 6 S.BC Function Compares the input value (E1) with the set value 1 (SV1)/set value 2 (SV2), and outputs bit data as soon as the input value (E1) reaches the set value 1 (SV1)/set value 2 (SV2). Also performs the upper limit check processing, change rate check processing and output conversion processing of the input value (E1) at this time. 81 S.BC Set Data (1) Data specified in S.BC instruction Specified position Input data S1 +0 +1 Symbol E1 Recommended range *1 Name Input value 0 to 2147483647 –– BW BW1 Output1 b12 b8 b4 (0: OFF) (1: ON) Alarm b15 BB BB1 +1 BB2 BB3 32Bit Set value by –– U –– S –– S 4000H S/U 4000H S/U 0 U 0 U 0 U 0.0 U 0 U b0 B B W W 2 1 Output2 Block memory BIN Standard –– b15 D1 +0 BW2 Unit Data format –– BIN 16Bit –– b12 b8 b4 alarm Change rate alarm b0 B B B B 3 2 Upper limit B B 1 –– BIN 16Bit (0: Without alarm) (1: With alarm) 0 to FFFFH b15 D2 +3 ALM b12 b8 b4 P H A Alarm detection b0 D P P A –– BIN 16Bit PHA, DPPA (0: Without alarm) (1: With alarm) 0 to FFFFH Alarm +4 INH detection inhibition Loop tag +14 +15 +16 +17 +26 +27 +42 +43 +44 +45 *2 82 b12 b8 E R R I b4 P H I b0 D P P I –– BIN 16Bit 0: Alarm enable 1: Alarm inhibit memory *2 *1 b15 SV1 Set value1 0 to 2147483647 –– SV2 Set value2 0 to 2147483647 –– 0 to 2147483647 –– Upper limit PH alarm set value Change rate CTIM alarm check 0 to 999999 Note that time DPL Change rate alarm value 0 to 2147483647 CTIM T 32767 s –– BIN 32Bit BIN 32Bit BIN 32Bit Real number BIN 32Bit The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) S.BC Specified position Loop tag Symbol Recommended range *1 Name Unit Data format Standard Set value by –– S D2 +124 past value –– memory *2 *3 –– Used by the system as a work area. –– –– 2 +127 *1 *2 *3 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 3 Description 4 +124 Change rate monitor counter initial preset flag +125 Change rate monitor counter*4 +126 +127 *4 1 Xn-m 4 When control is to be started from the initial status, the data must be cleared with the sequence program. The change rate monitor counter rounds off the data to the nearest whole number. 6 (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 7 Set Data contents Processing (1) Upper limit check processing In the upper limit check processing, the following operation is performed and the result of the operation is output to BB2 and PHA. Condition E1 > PH Others BB2, PHA 1 *1 0 When PHI or ERRI in the alarm detection inhibition (INH) is set to 1, PHA and BB2 show 0 since the alarm is prohibited. 8.6 *1 8 S.BC 83 S.BC (2) Change rate check processing Performs a change rate alarm check during the change rate alarm check time (CTIM) specified in the loop tag memory. The change rate alarm check compares the change of the input value (E1) with the change rate alarm value (DPL) in each execution cycle ( T). Condition BB3, DPPA (Xn - Xn-m) DPL 1 *2 Others *2 0 When DPPI or ERRI of the alarm detection inhibition (INH) is 1, DPPA and BB3 turn to 0 since the alarm is prohibited. The change rate alarm counter (m) is calculated with the following expression. Change rate alarm counter (m) CTIM T The change rate alarm counter (m) varies from 1 to m. However, when the change rate alarm counter (m) = 0, no processing is performed. Example) When the change rate alarm counter (m) = 4, processing is perform as shown below. Xn DPL Input value (E1) Xn-4 Xn-5 Xn-3 Xn-2 Xn-1 Xn-m Xn-m DPL Xn-6 Xn-7 Xn-8 DPL Xn-12 Xn-m Xn-11 Xn-10 Xn-9 Execution cycle CTIM Change rate alarm (BB3, DPPA) (3) Output conversion processing In the output conversion processing, the following operation is performed and the result of the operation is stored into BW1 and BW2. Condition BW1 BW2 E1 < 0 0 0 0 E1 < SV1 0 –– E1 SV1 1 –– 0 E1 < SV2 –– 0 E1 SV2 –– 1 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When the execution cycle (SD1500) < 0 When the change rate alarm check time (CTIM) < 0 84 QnPHCPU QnPRHCPU S.PSUM 8.7 S.PSUM Pulse Integration 8.7 S.PSUM 1 Ladder diagram 2 Start contact S.PSUM S.PSUM S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_PSUM(EN,s1,s2,d1,d2); 4 S_PSUM EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) : Array of any 16-bit data (0..4) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 32-bit data (0..1) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data ENO s1 Word R, ZR J 7 \ Bit 6 Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 8.7 Integrates the input value (E1) of the device specified in S1 , and stores the result into the device specified in D1 S.PSUM Function . The integration upper limit value and integration pattern can be used to select whether the integrated value will be returned to 0 or retained at the upper limit value if the output value exceeds the integration upper limit value. The integration start signal and integration hold signal can be used to start and suspend the integration of the input value. 85 S.PSUM (1) Operation performed when the integration pattern is set to "integrated value returns to 0 when the integration upper limit value is exceeded" Integration start Reset signal (e1) Start Reset Start Integration hold Hold cancel signal (e2) Reset Hold Hold cancel Hold When e1 turns OFF e2 should also turn OFF. Hold cancel Input value (E1) Ring counter upper limit value 0 Ring counter lower limit value Output value (BW) Integration upper limit value HILMT 0 (2) Operation performed when the integration pattern is set to " integrated value is retained at the integration upper limit value when the upper limit value is exceeded" Integration start Reset signal (e1) Integration hold Hold cancel signal (e2) Input value (E1) Ring counter upper limit value 0 Ring counter lower limit value Output value (BW) integration upper limit value HILMT 0 86 Start Reset Start Reset Hold Hold cancel Hold When e1 turns OFF e2 should also turn OFF. Hold cancel S.PSUM Set Data 1 (1) Data specified in S.PSUM instruction Specified position Symbol Recommended range *1 Name Unit Data Standard Set format value by –– U Use the ring counter of 16 bits or more. • 16-bit ring counter 00000000H S1 +0 +1 0000FFFFH 00000000H • 24-bit ring counter E1 00000000H Input value 00FFFFFFH 00000000H pulse • 32-bit ring counter 00000000H FFFFFFFFH BIN 32Bit 2 3 4 00000000H Set 32767 (7FFFH) or less as a pulse increment at each instruction execution. Input data e –– b15 b12 b8 b4 +2 e1 e2 D1 Block memory Integration start signal 0: Integration stop/reset 1: Integration start –– U BW1 Output value (Integer (0 to 2147483647) part) –– BIN 32Bit –– S +2 +3 BW2 Output value (Fraction (0 to 2147483647) part) –– BIN 32Bit –– S +0 W Weight per pulse 1 to 999 –– BIN 16Bit 1 U +1 U Unit conversion constant 1, 10, 100, 1000 –– BIN 16Bit 1 U +2 +3 HILMT Integration upper limit value 1 to 2147483647 –– BIN 32Bit 21474836 47 U –– BIN 16Bit 0 U +10 +11 Integration pattern 1: SUM1 Integration value (Integer part) (0 to 2147483647) –– BIN 32Bit 0 S SUM2 Integration value (Fraction part) (0 to 2147483647) –– BIN 32Bit 0 S Loop tag memory *2 +12 +13 Returns to 0 when the integration upper limit value (HILMT) is exceeded. Retains the integration upper limit value when the integration upper limit value (HILMT) is exceeded. 6 7 +0 +1 +4 SUMPTN *2 BIN 16Bit Integration hold signal 0: Integration hold cancel 1: Integration hold 0: *1 –– The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 87 8 S.PSUM Operation constant Integration hold signal e 1 8.7 S2 Integration start signal 4 b0 e 2 S.PSUM Specified position Symbol Name –– –– Recommended range *1 Unit Data Standard Set format value by –– –– S Loop tag past value D2 +116 memory +117 Used by the system as a work area. –– *2 *3 *1 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. *2 *3 Specified position D2 +116 +117 Description E1n-1 (Last input value) When control is to be started from the initial status, the data must be cleared with the sequence program. Set Data contents Processing (1) Upper limit check processing In the upper limit check processing, the following operation is performed and the result of the operation is output to BB2 and PHA. e1 e2 Input value increment (T1) 0 0 –– 0 1 –– 1 0 E1 - E1n-1 1 1 –– (2) Integrated value operation processing In the integrated value operation processing, the following processing is performed for the input value increment (T1). e1 e2 0 0 0 1 Integration value (Integer part) (T2), Integration value (Fraction part) (T3) T2 = 0 T3 = 0 T2 = 0 T3 = 0 *1 T4 = quotient of {(T1 × W) / U} <integer part> 1 0 T5 = remainder of {(T1 × W) / U} <fraction part> T2 = SUM1 + T4 + [quotient of {(SUM2 + T5) / U}] <integer part> T3 = remainder of {(SUM2 + T5) / U} <fraction part> 1 *1 88 1 T2 = SUM1 T3 = SUM2 At an integration stop/reset (e1 = 0), processing is performed on the assumption that integration hold is canceled (e2 = 0). S.PSUM (3) Output conversion In the output conversion, the following processing is performed for the integrated value (T2, T3). SUMPTN Condition T2 HILMT 0 Others T2 HILMT 1 Others BW1, SUM1 1 BW2, SUM2 BW1 = remainder of T2 / HILMT BW2 = T3 SUM1 = remainder of T2 / HILMT SUM2 = T3 BW1 = T2 BW2 = T3 SUM1 = T2 SUM2 = T3 BW1 = HILMT BW2 = 0 SUM1 = HILMT SUM2 = 0 BW1 = T2 BW2 = T3 SUM1 = T2 SUM2 = T3 2 3 4 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code 4100 Error definition QnPHCPU 4 QnPRHCPU When an operation error occurs 6 7 8 8.7 S.PSUM 89 S.PID CHAPTER 9 9.1 S.PID CONTROL OPERATION INSTRUCTIONS Basic PID 9.1 S.PID Ladder diagram Start contact S.PID S.PID S2 D1 S1 Structured ladder/FBD D2 S3 Structured text language S_PID EN ENO s1 d1 s2 d2 ENO:=S_PID(EN,s1,s2,s3,d1,d2); s3 Input argument EN : Execution condition S1 : Input data start device : Bit : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..6) S3 : When set value (E2) is used: Set value start device : Real data type When set value (E2) is not used: Dummy device*1 Output argument Setting ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– S3 –– –– *1 Constant Other Special register SD1506 can be specified as a dummy device. Function Performs PID operation when the specified control cycle is reached. (PID operation is of velocity type/process value derivative type (incomplete derivative type).) Also performs SV setting processing, tracking processing, gain (Kp) operation processing and deviation check processing at this time. 90 S.PID Set Data Block diagram 9 The processing block diagram of the S.PID instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) 2 RL, RH DV GW, GG P, I, D, MTD, CT DVL, DVLS E1 (1) (2) (3) E2 Tracking processing SV setting processing (When used) (7) CT (4) Gain Kp operation processing Deviation check PID operation BW 4 When in control cycle AND Control cycle judgment (6) 3 (5) BB1 RUN(SPA=0) Loop stop judgment STOP(SPA=1) 6 When not in control cycle BW=0 7 (6) SPA MODE 4 BW=0 MAN Loop stop processing OFF 8 ERRI∩DVLI DVLA 9.1 S.PID 91 S.PID Set Data (1) Data specified in S.PID instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol E1 BW Recommended range *1 Name Input value Output value ( MV) -999999 to 999999 –– (-999999 to 999999) –– BB b15 +2 BB1 Real number Real number Standard Set value by –– U –– S –– S 8.0 U 2.0 U 0 U 0 U 3 U –– Block memory Unit Data format b12 b8 b4 b0 B B 1 Deviation large alarm –– BIN 16bit (0: Without alarm) (1: With alarm) S2 +0 +1 +2 +3 MTD Derivative gain 0 to 999999 –– Deviation DVLS large alarm 0 to 100 % hysteresis +4 PN +5 TRK Operation Operation 0: Reverse operation mode 1: Forward operation Tracking 0: Not trucked bit 1: Trucked –– –– b15 +6 SVPTN b12 b8 92 b4 Real number BIN 16bit BIN 16bit b0 Set value –– pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. *2 *3 number 0 to 3 constant *1 Real BIN 16bit Set value used*2 0: E2 is used. 1: E2 is not used. The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). S.PID Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 8H S/U 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 9 2 0 to FFFFH b12 b15 +3 ALM b8 b4 S P A Alarm b0 D M M V H L L A A A detection SPA DVLA,MHA,MLA 0:Loop RUN (0:Without alarm) 1:Loop STOP (1:With alarm) –– BIN 16bit 4000H S/U 3 4 0 to FFFFH Alarm +4 INH detection inhibition b15 E R R I b12 b8 b4 T R K F 4 b0 D M M V H L L I I I TRKF –– (0 : Without tracking) BIN 16bit 4000H S/U 6 (1 : With tracking) ERRI, DVLI, MHI, MLI Loop 0 : Alarm enable tag 1 : Alarm inhibit memory *2 +14 +15 +16 +17 +22 +23 +46 +47 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 *1 *2 Set value RL to RH –– DV Deviation (-110 to 110) % -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering RL value lower limit CT DVL P I D GW Control cycle Deviation limit value Gain Integral constant Derivative constant Gap width 0 to 999999 Note that CT T 32767 s 0 to 100 % 0 to 999999 –– 0 to 999999 s 0 to 999999 s 0 to 100 % Real number Real number Real number Real number Real number Real number Real number Real number Real number Real number 0.0 U 0.0 S 100.0 U 0.0 U 1.0 U 100.0 U 1.0 U 10.0 U 0.0 U 0.0 U 8 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 93 S.PID +25 SV 9.1 +24 7 S.PID Specified position D2 +60 +61 Loop tag memory *2 +62 +63 Loop tag D2 +116 Set value *4 S3 *3 Gap gain Unit Data format 0 to 999999 –– (-999999 to 999999) % Used by the system as a work area. –– -10 to 110 % MV Inside MVP operation value –– memory *2 *3 *2 GG Recommended range *1 Name Real number Real number Standard Set value by 1.0 U 0.0 S –– S 0.0 U +96 past value *1 Symbol +0 +1 –– E2 Set value –– Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter*5 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 Bn-1 (Last value) PVn (Process value) PVn-1 (Last process value) PVn-2 (Process value before last) DVn-1 (Last deviation value) Alarm detection 2 (ALM2) b15 +116 b12 b8 b4 b0 M L A 2 M H A 2 MHA2,MLA2 (0: Without alarm) (1: With alarm) *4 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 94 S.PID Set Data contents Processing 9 (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression 2 and then "(2) Tracking processing" is performed. SVn 3 RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. 4 (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking processing" is performed. (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to 4 calculate SVn'. SVn' 100 (SVn RH RL 6 RL) (b) When all of the following conditions hold, tracking processing is performed. 1) The tracking bit (TRK) of the operation constant is 1. 7 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. 8 E2=SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. (3) Gain (Kp) operation processing Condition 9.1 (a) The deviation (DV) is calculated under the following condition. Operation expression DV=E1 - SVn' Reverse operation(PN=0) DV=SVn' - E1 S.PID Forward operation(PN=1) (b) The output gain (K) is calculated under the following condition. Condition Operation expression When |DV| GW K=GG When |DV| > GW K 1 (1 GG) GW |DV| 95 S.PID (4) PID operation PID operation is performed with the following operation expression. Item Operation expression When forward operation (PN=1) MD×TD MD×CT+TD Bn-1 + Bn When reverse operation (PN=0) Bn-1 + MD×TD MD×CT+TD KP {(DVn BW ( MV) DVn-1) × {(PVn - 2PVn-1 + PVn-2) - × { - (PVn - 2PVn-1 + PVn-2) CT TI DVn CT×Bn-1 } TD CT×Bn-1 } TD Bn} KP: K × Gain (P), MD: Derivative gain (MTD) TI: Integral constant (I), TD: Derivative constant (D) In the following case, however, note that special processing will be performed. Condition QnPHCPU/QnPRHCPU (First 5 digits of QnPHCPU/QnPRHCPU (First 5 digits of the serial No. : 07031 or earlier) the serial No. : 07032 or later) Bn = 0 In either of the following cases 1, 2 (However, the loop tag 1. Derivative constant (D) = 0 (TD = 0) 2. Operation mode (MODE) is any of MAN, LCM and CMV past value memory is set.) In any of the following cases 1, 2, 3 In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 1. 2. When either of MHA or MLA is turned 2. to 1 Integral constant (I) = 0 (TI = 0) When either of MHA2 or MLA2 is turned to 1 CT DVn 0) TI When either of MHA or MLA is turned (MVP > MH) and ( 3. Processing to 1 CT DVn 0) TI When either of MHA2 or MLA 2 is (MVP > MH) and ( 3. CT TI DVn 0 turned to 1 CT (MVP < ML) and ( TI DVn 0) (MVP < ML) and ( CT TI DVn 0) (5) Deviation check A deviation check is made under the following condition and the result of the check is output to DVLA of the alarm detection (ALM) and the deviation large alarm (BB1) of the block memory. Condition Result *1 DVL < |DV| DVLA = BB1 = 1 (DVL - DVLS) < |DV| DVL DVLA = BB1 = Last value status hold *1 |DV| (DVL-DVLS) DVLA = BB1 = 0 *1 When DVLI or ERRI in the alarm detection inhibition (INH) is set to 1, DVLA and BB1 show 0 since the alarm is prohibited. (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.PID instruction. 1) BW is turned to 0. 2) DVLA of the alarm detection (ALM) is turned to 0. 3) The operation mode (MODE) is changed to MAN. 4) BB1 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(7) Control cycle judgment". 96 S.PID (7) Control cycle judgment (a) If the specified control cycle is not reached, BW ( MV) is turned to 0 and the S.PID instruction is terminated. 9 (b) When the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error 2 In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU 3 QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- 4 When CT < 0 or the execution cycle (SD1500) < 0 4 6 7 8 9.1 S.PID 97 S.2PID 9.2 S.2PID 2-degree-of-freedom PID Control 9.2 S.2PID Ladder diagram Start contact S.2PID S.2PID S1 S2 D1 Structured ladder/FBD D2 S3 Structured text language S_2PID EN ENO s1 d1 s2 d2 ENO:=S_2PID(EN,s1,s2,s3,d1,d2); s3 Input argument EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..6) S3 : When set value (E2) is used: Set value start device : Real data type ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) When set value (E2) is not used: Dummy device*1 Output argument Setting Internal devices data Bit Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– S3 –– –– *1 Constant Other Special register SD1506 can be specified as a dummy device. Function Performs 2-degree-of-freedom PID operation when the specified control cycle is reached. Also performs SV setting processing, tracking processing, gain (Kp) operation processing and deviation check processing at this time. 98 S.2PID Set Data Block diagram 9 The processing block diagram of the S.2PID instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) RL, RH DV 2 GW, GG P, I, D, MTD, CT DVL, DVLS E1 (2) (1) (3) E2 SV setting processing (When used) Tracking processing Deviation check BW 4 Control cycle judgment (6) 3 (5) When in control cycle (7) CT (4) 2-degree-offreedom PID operation Gain Kp operation processing AND BB1 RUN(SPA=0) Loop stop judgment STOP(SPA=1) 6 When not in control cycle BW=0 7 (6) SPA MODE 4 BW=0 MAN Loop stop processing OFF 8 ERRI∩DVLI DVLA 9.2 S.2PID 99 S.2PID Set Data (1) Data specified in S.2PID instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol E1 BW Recommended range *1 Name Input value Output value ( MV) -999999 to 999999 % (-999999 to 999999) % BB b15 +2 BB1 Real number Real number Standard Set value by –– U –– S –– S 8.0 U 2.0 U 0 U 0 U 3 U –– Block memory Unit Data format b12 b8 b4 b0 B B 1 Deviation large alarm –– BIN 16Bit (0: Without alarm) (1: With alarm) S2 +0 +1 +2 +3 MTD Derivative gain 0 to 999999 –– Deviation large DVLS alarm 0 to 100 % hysteresis +4 PN +5 TRK Operation 0: Reverse operation mode 1: Forward operation Tracking bit Operation –– 0: Not tracked –– 1: Tracked Real number Real number BIN 16bit BIN 16bit 0 to 3 constant b15 +6 SVPTN b12 b8 *2 *3 100 b0 Set value –– pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. *1 b4 BIN 16bit Set value used*2 0: E2 is used. 1: E2 is not used. The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). S.2PID Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 8H S/U 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 9 2 0 to FFFFH +3 ALM Alarm b15 b12 S P A detection b8 b4 b0 D M M V H L L A A A D M L A SPA DVLA,DMLA,MHA,MLA 0:Loop RUN (0:Without alarm) 1:Loop STOP (1:With alarm) –– BIN 16bit 3 4000H S/U 4 0 to FFFFH Alarm +4 INH detection inhibition b15 E R R I b12 T R K F b8 b4 D M L I 4 b0 D M M V H L L I I I –– TRKF (0 : Without tracking) BIN 16bit 4000H S/U (1 : With tracking) 7 ERRI, DMLI, DVLI, MHI, MLI 0 : Alarm enable Loop tag 1 : Alarm inhibit memory *2 +14 +15 +16 +17 +23 +25 +46 +47 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 *2 Set value RL to RH –– DV Deviation (-110 to 110) % -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering RL value lower limit CT DVL P I D GW Control cycle Deviation limit value Gain Integral constant Derivative constant Gap width 0 to 999999 Note that CT T 32767 s 0 to 100 % 0 to 999999 –– 0 to 999999 s 0 to 999999 s 0 to 100 % Real number Real number Real number Real number Real number Real number Real number Real number Real number Real number 0.0 U 0.0 S 100.0 U 0.0 U 1.0 U 100.0 U 1.0 U 10.0 U 0.0 U 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 101 8 S.2PID +24 SV 9.2 +22 *1 6 S.2PID Specified position D2 +60 +61 +62 +63 Loop tag memory *2 Symbol GG Gap gain MV inside MVP operation value freedom +65 parameter Set value *4 *1 *2 *3 –– (-999999 to 999999) % 0 to 1 –– 0 to 1 –– Used by the system as a work area. –– -10 to 110 % *5 freedom parameter *6 Real number Real number Real number Real number Standard Set value by 1.0 U 0.0 S 0.0 U 1.0 U –– S 0.0 U +96 past value *3 0 to 999999 2 degree-of- +67 memory *2 Unit Data format 2 degree-of- +64 +66 Loop tag Recommended range *1 Name –– –– E2 Set value –– +116 S3 +0 +1 Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter *7 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 Bn-1 (Last value) PVn (Process value) PVn-1 (Last process value) PVn-2 (Process value before last) DVn-1 (Last deviation value) DVn-2 (Deviation value before last) Dn-1 (Last value) Alarm detection 2 (ALM2) b15 +116 b12 b8 b4 b0 M L A 2 M H A 2 MHA2,MLA2 (0: Without alarm) (1: With alarm) *4 *5 *6 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) Increasing decreases the manipulated value variation relative to the set value change. (It will take time to stabilize.) Decreasing increases the manipulated value variation relative to the set value change. However, since a compensation operation will be stronger, hunting may become greater. Increasing decreases the effect of derivative on the set value change. Decreasing 102 increases the effect of derivative on the set value change. S.2PID *7 The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 9 Set Data contents Processing 2 (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression 3 and then "(2) Tracking processing" is performed. SVn 4 RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking 4 processing" is performed. 6 (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. SVn' 100 RH RL (SVn 7 RL) (b) When all of the following conditions hold, tracking processing is performed. 8 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. E2=SVn' When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. S.2PID (3) Gain (Kp) operation processing (a) The deviation (DV) is calculated under the following condition. Condition Operation expression Forward operation (PN=1) DV=E1 - SVn' Reverse operation (PN=0) DV=SVn' - E1 (b) The output gain (K) is calculated under the following condition. Condition Operation expression When |DV| GW K=GG When |DV| > GW K 1 (1 9.2 (c) GG) GW |DV| 103 S.2PID (4) 2-degree-of-freedom PID operation 2-degree-of-freedom PID operation is performed with the following operation expression. Item Operation expression Bn Bn-1 + Cn MD×TD MD×CT+TD When forward operation (PN=1) PVn - PVn-1 When reverse operation (PN=0) - (PVn - PVn-1) × {(DVn - 2DVn-1 + DVn-2) - CT×Bn-1 } TD CT×Dn-1 } TD When forward operation (PN=1) Dn-1 + MD×TD MD×CT+TD × {(PVn - 2PVn-1 + PVn-2) - When reverse operation (PN=0) Dn-1 + MD×TD MD×CT+TD × { - (PVn - 2PVn-1 + PVn-2) - Dn CT×Dn-1 } TD s BW ( MV) KP: K × Gain (P), MD: Derivative gain (MTD) TI: Integral constant (I), TD: Derivative constant (D) In the following case, however, note that special processing will be performed. Condition QnPHCPU/QnPRHCPU (First 5 digits of QnPHCPU/QnPRHCPU (First 5 digits of the serial No. : 07031 or earlier) the serial No. : 07032 or later) Bn = 0, Dn = 0 In either of the following cases 1, 2 1. Derivative constant (D) = 0 (TD = 0) 2. Operation mode (MODE) is any of MAN, LCM and CMV In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 2. When either of MHA or MLA is turned to 1 CT DVn 0) TI When either of MHA or MLA is turned to 1 (MVP < ML) and ( CT TI DVn 0) (However, the loop tag past value memory is set.) In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 2. When either of MHA2 or MLA2 is turned to 1 (MVP > MH) and ( 3. Processing CT DVn 0) TI When either of MHA2 or MLA 2 is turned to 1 (MVP > MH) and ( 3. (MVP < ML) and ( CT TI DVn CT TI DVn 0 0) (5) Deviation check A deviation check is made under the following condition and the result of the check is output to DVLA of the alarm detection (ALM) and the deviation large alarm (BB1) of the block memory. Condition Result DVL < |DV| DVLA = BB1 =1 *1 (DVL - DVLS) < |DV| DVL DVLA = BB1 = Last value status hold *1 |DV| (DVL-DVLS) DVLA = BB1 = 0 *1 104 When DVLI or ERRI in the alarm detection inhibition (INH) is set to 1, DVLA and BB1 show 0 since the alarm is prohibited. S.2PID (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. 9 A loop stop performs the following processing and terminates the S.2PID instruction. 1) BW is turned to 0. 2) DVLA of the alarm detection (ALM) is turned to 0. 2 3) The operation mode (MODE) is changed to MAN. 4) BB1 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. 3 A loop run performs "(7) Control cycle judgment". (7) Control cycle judgment (a) If the specified control cycle is not reached, BW ( MV) is turned to 0 and the S.2PID instruction is terminated. (b) When the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error 4 4 In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU 6 When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- 7 When CT < 0 or the execution cycle (SD1500) < 0 8 9.2 S.2PID 105 S.PIDP 9.3 S.PIDP Position Type PID Control 9.3 S.PIDP Ladder diagram Start contact S.PIDP S.PIDP S1 D1 Structured ladder/FBD S2 D2 S3 Structured text language S_PIDP EN ENO:=S_PIDP(EN,s1,s2,s3,d1,d2); ENO s1 d1 s2 d2 s3 Input argument EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..10) S3 : When set value (E2) is used: Set value start device : Real data type ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) When set value (E2) is not used: Dummy device*1 Output argument Setting Internal devices data Bit Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– S3 –– –– *1 Constant Other Special register SD1506 can be specified as a dummy device. Function Performs position type PID operation when the specified control cycle is reached. Also performs SV setting processing, tracking processing, gain (Kp) operation processing, deviation check processing and operation mode (MODE) judgment at this time. Performs change rate, upper/lower limiter and output processings or alarm clear processing and output conversion according to the result of the judgment. 106 S.PIDP Set Data Block diagram 9 The processing block diagram of the S.PIDP instruction is shown below. (The numerals (1) to (10) in the diagram indicate the order of the processing.) DV RH, RL GW,GG P, I, D, MTD, CT MH, ML, DML DVL, DVLS MV 2 NMIN, NMAX E1 (1) E2 (2) SV setting processing (When used) (3) (4) Gain K p operation processing Tracking processing (5) PID operation (7) Change rate, upper/lower limiter Deviation check 3 (8) Output conversion BW (6) (10) Control RUN(SPA 0) cycle judgment CT When in control cycle When not in control cycle (9) Loop stop judgment 4 Other than MAN, CMB Mode judgment CMV, LCM MAN, CMB CMV, LCM BB2 AND RUN(SPA 0) Alarm clear processing STOP(SPA 1) (9) 6 All OFF Upper limit alarm Lower limit alarm Change rate alarm Last BW 7 Loop stop MAN processing All OFF SPA MODE ERRI 4 (6) 8 DVLI DVLA ERRI MHI ERRI DMLI AND BB4 AND BB5 MHA MLA DMLA OR BB1 107 S.PIDP MLI BB3 9.3 ERRI AND S.PIDP Set Data (1) Data specified in S.PIDP instruction Specified position Input data S1 D1 Symbol Recommended range *1 Name Set value by –– U +0 +1 E1 Input value -999999 to 999999 % +0 +1 BW Output value (-999999 to 999999) –– Real number –– S –– BIN 16bit –– S +2 S2 Standard Real number BB Block memory Unit Data format –– BB1 Alarm BB2 Deviation large alarm BB3 Output upper limit alarm BB4 Output lower limit alarm BB5 Output change rate alarm b15 b12 b8 b4 B B B B B B 5 4 3 b0 B B B B 2 1 (0: Without alarm) (1: With alarm) +0 +1 MTD Derivative gain 0 to 999999 –– Real number 8.0 U +2 +3 DVLS Deviation large alarm hysteresis 0 to 100 % Real number 2.0 U +4 PN Operation mode 0: Reverse operation 1: Forward operation –– BIN 16bit 0 U +5 TRK Tracking bit 0: Not trucked 1: Trucked –– BIN 16bit 0 U –– BIN 16bit 3 U 0 to 3 b15 Operation constant +6 SVPTN b12 b8 *2 *3 108 b0 Set value pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. *1 b4 Set value used*2 0: E2 is used. 1: E2 is not used. +7 +8 NMAX Output conversion upper limit -999999 to 999999 –– Real number 100.0 U +9 +10 NMIN Output conversion lower limit -999999 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). S.PIDP Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 8H S/U 0 to FFFFH D2 +1 MODE Operation mode b15 b12 b8 C S V b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 9 2 0 to FFFFH +3 ALM Alarm detection b15 b12 D M L A b0 D M M V H L L A A A SPA 0:Loop RUN 1:Loop STOP DVLA,DMLA,MHA,MLA (0:Without alarm) (1:With alarm) S P A b8 b4 3 –– BIN 16bit 4000H S/U 4 4 00 to FFFFH +4 INH Alarm detection inhibition Loop tag *2 b8 b4 D M L I b0 D M M V H L L I I I TRKF (0 : Without tracking) (1 : With tracking) ERRI, DMLI, DVLI, MHI, MLI 0 : Alarm enable 1 : Alarm inhibit –– BIN 16bit 6 4000H S/U 7 8 +12 +13 MV Manipulated value -10 to 110 % Real number 0.0 S/U +14 +15 SV Set value RL to RH –– Real number 0.0 U +16 +17 DV Deviation (-110 to 110) % Real number 0.0 S +18 +19 MH Output upper limit value -10 to 110 % Real number 100.0 U +20 +21 ML Output lower limit value -10 to 110 % Real number S.PIDP *1 b12 T R K F 9.3 memory *2 b15 E R R I 0.0 U +22 +23 RH Engineering value upper limit -999999 to 999999 –– Real number 100.0 U +24 +25 RL Engineering value lower limit -999999 to 999999 –– Real number 0.0 U +46 +47 CT Control cycle 0 to 999999 Note that s Real number 1.0 U +48 +49 DML Output change rate limit value 0 to 100 % Real number 100.0 U +50 +51 DVL Deviation limit value 0 to 100 % Real number 100.0 U CT T 32767 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 109 S.PIDP Specified position D2 Loop tag memory *2 Loop tag past value memory *2 *3 Set value *4 *1 *2 *3 D2 Symbol Recommended range *1 Name Unit Data format Standard Set value by 1.0 U +52 +53 P Gain 0 to 999999 –– Real number +54 +55 I Integral constant 0 to 999999 s Real number 10.0 U +56 +57 D Derivative constant 0 to 999999 s Real number 0.0 U +58 +59 GW Gap width 0 to 100 % Real number 0.0 U +60 +61 GG Gap gain 0 to 999999 –– Real number 1.0 U –– –– Used by the system as a work area. –– –– –– S -10 to 110 % Real number 0.0 U +96 +116 S3 +0 +1 E2 Set value The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter *5 +100 In-1 (Last value) +101 +102 Bn-1 (Last value) +103 +104 PVn (Process value) +105 +106 PVn-1 (Last process value) +107 Alarm detection 2 (ALM2) b15 +116 b12 b8 b4 b0 M L A 2 M H A 2 MHA2,MLA2 (0: Without alarm) (1: With alarm) *4 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 110 S.PIDP Set Data contents Processing 9 (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression 2 and then "(2) Tracking processing" is performed. SVn 3 RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking 4 processing" is performed. 4 (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. SVn' 100 (SVn RH RL 6 RL) (b) When all of the following conditions hold, tracking processing is performed. 7 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. 8 E2=SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. (3) Gain (Kp) operation processing Operation expression Forward operation (PN=1) DV=E1 - SVn' Reverse operation (PN=0) DV=SVn' - E1 S.PIDP Condition 9.3 (a) The deviation (DV) is calculated under the following condition. (b) The output gain (K) is calculated under the following condition. Condition Operation expression When |DV| GW K=GG When |DV| > GW K 1 (1 GG) GW |DV| 111 S.PIDP (4) PID operation PID operation is performed with the following operation expression. Item Bn Operation expression When forward operation (PN = 1) When reverse operation (PN = 0) Bn-1 M D TD MD CT TD {(PVn PVn-1) Bn-1 M D TD MD CT TD { CT TI In In-1 T Kp×(DVn + In + Bn) (PVn PVn-1) CT Bn-1 } TD CT Bn-1 } TD DVn KP: K × Gain (P), MD: Derivative gain (MTD) TI: Integral constant (I), TD: Derivative constant (D) In the following case, however, note that special processing will be performed. Condition QnPHCPU (First 5 digits of the serial No. QnPHCPU (First 5 digits of the serial No. : 07031 or earlier) : 07032 or later) Bn = 0 (However, the loop tag past value memory is set.) In either of the following cases 1, 2 1. Derivative constant (D) = 0 (TD = 0) 2. Operation mode (MODE) is any of MAN, LCM and CMV In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 2. When MHA is turned to 1 3. In any of the following cases 1, 2, 3, 4 1. Integral constant (I) = 0 (TI = 0) 2. When MHA2 is turned to 1 CT DVn 0 TI When MLA is turned to 1 3. CT TI 4. DVn 0 –– Processing CT DVn 0 TI When MLA2 is turned to 1 CT TI DVn In-1 = MV - (DVn + Bn) Kp 0 CT DVn 0 TI When operating mode (MODE) is any of MAN, LCM, and CMV. All the following conditions 1, 2, 3 are satisfied 1. When b0 of SD1508 is turned to 1 2. When tracking flag (TRKF) in alarm detection inhibition (INH) is turned to 1. 3. When operating mode (MODE) is other than MAN, LCM, and CMV. TRKF=0 (5) Deviation check A deviation check is made under the following condition and the result of the check is output to DVLA of the alarm detection (ALM) and the deviation large alarm (BB2) of the block memory. Condition Result *1 DVL < |DV| DVLA=BB2=1 (DVL - DVLS) < |DV| DVL DVLA=BB2=Last value status hold *1 |DV| (DVL - DVLS) DVLA=BB2=0 *1 112 When DVLI or ERRI in the alarm detection inhibition (INH) is set to 1, DVLA and BB2 show 0 since the alarm is prohibited. S.PIDP (6) Mode judgment Either of the following processings is performed depending on the operation mode (MODE) setting. (a) 9 When the operation mode (MODE) is any of MAN, CMB, CMV and LCM (alarm clear processing) 1) MHA, MLA and DMLA of the alarm detection (ALM) are turned to 0. 2) MAH2 and MLA2 of the alarm detection 2 (ALM2) are turned to 0. 2 3) BB3 to BB5 of BB are turned to 0. 4) Data of BB2 is transferred to BB1 of BB. (BB1 = BB2) 5) "(8) Output conversion processing" is performed and the S.PIDP instruction is terminated. (b) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC, "(7) Change rate, upper/ 3 lower limiter" is executed. (7) Change rate, upper/lower limiter The change rate and upper/lower limits are checked for the input value (E1), and the data after the limiter processing and 4 an alarm are output. (a) The change rate limiter performs the following operation and outputs the result of the operation to BB5 and DMLA. Condition *1 BB5, DMLA T1 |T - MV| DML 0 T (T - MV) > DML 1 *1 MV + DML (T - MV) < - DML 1 *1 MV - DML 4 6 When DMLI or ERRI in the alarm detection inhibition (INH) is set to 1, DMLA and BB5 show 0 since the alarm is prohibited. (b) The upper/lower limiter performs the following operation and outputs the result of the operation to BB3, BB4, MHA, 7 MLA, MHA2 and MLA2. *2 BB4, MLA, MLA2 BB3, MHA, MHA2 MV T1 > MH 0 1 *2 MH T1 < ML 1 *3 0 ML ML T1 MH 0 0 T1 8 When MHI or ERRI in the alarm detection inhibition (INH) is set to 1, MHA and BB3 show 0 since the alarm is prohibited. However, even if MHI and/or ERRI in the alarm detection inhibition (INH) is set to 1, MHA2 holds 1. When MLI or ERRI in the alarm detection inhibition (INH) is set to 1, MLA and BB4 show 0 since the alarm is prohibited. However, even if MLI and/or ERRI in the alarm detection inhibition (INH) is set to 1, MLA2 holds 1. S.PIDP (8) Output conversion In the output conversion, the output value is calculated from the following formula. BW NMAX NMIN 100 MV 9.3 *3 Condition NMIN (9) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.PIDP instruction. 1) BW retains the last value. 2) DVLA, MHA, MLA and DMLA of the alarm detection (ALM) are turned to 0. 3) MHA2 and MLA2 of the alarm detection 2 (ALM2) are turned to 0. 4) The operation mode (MODE) is changed to MAN. 5) BB1 to BB5 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(10) Control cycle judgement". (10) Control cycle judgment (a) When the specified control cycle is not reached, " (6) mode judgement" as T = MV is performed. (b) When the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored into SD0. 113 S.PIDP Error code Error definition When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- When CT < 0 or the execution cycle (SD1500) < 0 114 QnPHCPU QnPRHCPU S.SPI 9.4 S.SPI Sample PI Control 9.4 S.SPI 9 Ladder diagram 2 Start contact S.SPI S.SPI S1 D1 Structured ladder/FBD S2 D2 S3 Structured text language 3 ENO:=S_SPI(EN,s1,s2,s3,d1,d2); 4 S_SPI EN ENO s1 d1 s2 d2 s3 Input argument 4 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..4) S3 : When set value (E2) is used: Set value start device : Real data type 6 When set value (E2) is not used: Dummy device*1 Output argument Setting ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit J R, ZR Word \ Bit U Word Zn \G –– –– –– S2 –– –– D2 –– –– S3 –– –– *1 Other Special register SD1506 can be specified as a dummy device. Function Performs normal PI operation during operating time (ST). Judges between operating time (ST) or hold time (HT), and if it is the operating time, performs SV setting processing, tracking processing, gain (Kp) operation processing, SPI operation and deviation check. MV t ST HT STHT ST HT STHT ST 8 S.SPI –– Constant 9.4 S1 D1 7 HT STHT 115 S.SPI Set Data Block diagram The processing block diagram of the S.SPI instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) RL, RH DV GW, GG P, I DVL, DVLS E1 (1) E2 (When used) (2) SV setting processing (3) Tracking processing (7) ST STHT (4) Gain Kp operation processing (5) Deviation check SPI operation Operating time Operating time monitor (6) AND RUN(SPA=0) Loop stop judgment STOP(SPA=1) Hold time BW=0 (6) SPA MODE ERRI∩DVLI DVLA 116 BW MAN Loop stop processing BW=0 OFF BB1 S.SPI Set Data 9 (1) Data specified in S.SPI instruction Specified position Input data S1 D1 Symbol +0 +1 E1 +0 +1 BW Recommended range *1 Name Input value Output value ( MV) BB1 Set value by –– U -999999 to 999999 % (-999999 to 999999) % Real number –– S –– BIN 16bit –– S b12 b8 b4 B B 1 Deviation large alarm 0 to 100 % Real number DVLS +2 PN Operation mode 0: Reverse operation 1: Forward operation –– +3 TRK Tracking bit 0: Not trucked 1: Trucked –– b15 SVPTN b12 b8 U BIN 16bit 0 U BIN 16bit 0 U b0 6 7 8 –– BIN 16bit 3 U Set value used*2 0: E2 is used. 1: E2 is not used. 9.4 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). 117 S.SPI *2 *3 b4 Set value pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. *1 2.0 0 to 3 Operation constant 4 4 Deviation large alarm hysteresis +0 +1 +4 3 b0 (0: Without alarm) (1: With alarm) S2 2 –– b15 +2 Standard Real number BB Block memory Unit Data format S.SPI Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 0 to FFFFH D2 +1 MODE Operation mode –– BIN 16Bit 8H S/U –– BIN 16Bit 4000H S/U TRKF (0 : Without tracking) (1 : With tracking) ERRI, DVLI, MHI, MLI 0 : Alarm enable 1 : Alarm inhibit –– BIN 16Bit 4000H S/U b15 b12 b8 C S V b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M 0 to FFFFH +3 ALM Alarm detection b12 b15 b8 b4 S P A b0 D M M V H L L A A A SPA 0:Loop RUN 1:Loop STOP DVLA,MHA,MLA (0:Without alarm) (1:With alarm) 00 to FFFFH b4 b0 D M M V H L L I I I Alarm detection inhibition +14 +15 SV Set value RL to RH –– Real number 0.0 U +16 +17 DV Deviation (-110 to 110) % Real number 0.0 S +22 +23 RH Engineering value upper limit -999999 to 999999 –– Real number 100.0 U -999999 to 999999 –– 0.0 U +24 +25 118 b8 INH memory *2 *2 b12 T R K F +4 Loop tag *1 b15 E R R I RL Engineering value lower limit +46 +47 ST +50 +51 DVL +52 +53 Operating time 0 to 999999 Note that CT T 32767 Real number s Real number 0.0 U Deviation limit value 0 to 100 % Real number 100.0 U P Gain 0 to 999999 –– Real number 1.0 U +54 +55 I Integral constant 0 to 999999 s Real number 10.0 U +56 +57 STHT Sample cycle 0 to 999999 Note that s Real number 0.0 U +58 +59 GW Gap width 0 to 100 % Real number 0.0 U STHT T 32767 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) S.SPI Specified position D2 Loop tag memory *2 Loop tag past value D2 memory *2 *3 Set value *4 *1 *2 *3 Symbol Recommended range *1 Name Unit Data format Standard Set value by 1.0 U 9 +60 +61 GG Gap gain 0 to 999999 –– Real number +62 +63 MVP MV inside operation value (-999999 to 999999) % Real number 0.0 S 2 Used by the system as a work area. –– –– –– –– 3 -10 to 110 % Real number 0.0 U 4 +96 –– –– +116 S3 +0 +1 E2 Set value The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description 4 6 +96 Control cycle counter initial preset flag +97 Sample counter*5 +98 Operation counter*5 7 +99 Hold counter +100 DVn-1 (Last deviation value) +101 8 Alarm detection 2 (ALM2) b15 b12 b8 b4 +116 b0 M L A 2 M H A 2 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The sample counter and operation counter round off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression and then "(2) Tracking processing" is performed. SVn RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking processing" is performed. 119 S.SPI *4 9.4 MHA2,MLA2 (0: Without alarm) (1: With alarm) S.SPI (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. SVn' 100 (SVn RH RL RL) (b) When all of the following conditions hold, tracking processing is performed. 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. E2=SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. (3) Gain (Kp) operation processing (a) The deviation (DV) is calculated under the following condition. Condition Operation expression Forward operation(PN = 1) DV = E1 - SVn' Reverse operation(PN = 0) DV = SVn' - E1 (b) The output gain (K) is calculated under the following condition. Condition Operation expression When |DV| GW K = GG When |DV| > GW K 1 (1 GG) GW |DV| (4) SPI operation SPI operation is performed with the following operation expression. Condition Operation expression KP {(DVn DVn-1) BT TI During operating time (ST) BW DVn} During hold time (STHT - ST) BW = 0 (loop tag past value memory is not set.) KP: K × Gain (P), TI: Integral constant (I), BT: Execution cycle ( T) In the following case, however, note that special processing will be performed. Condition QnPHCPU/QnPRHCPU (First 5 digits of QnPHCPU/QnPRHCPU (First 5 digits of the serial No. : 07031 or the serial No. : 07032 or later) In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 2. When either of MHA or MLA is turned to 1 In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 2. When either of MHA2 or MLA2 is turned to 1 CT DVn 0 TI When either of MHA or MLA is turned CT DVn 0 TI 3. When either of MHA2 or MLA 2 is turned (MVP > MH) and 3. to 1 CT (MVP < ML) and TI 120 (MVP > MH) and to 1 DVn 0 (MVP < ML) and CT TI DVn 0 Processing CT TI DVn 0 S.SPI (5) Deviation check A deviation check is made under the following condition and the result of the check is output to DVLA of the alarm 9 detection (ALM) and the deviation large alarm (BB1) of the block memory. Condition Result DVL < |DV| DVLA = BB1 = 1 *1 (DVL - DVLS) < |DV| DVL DVLA = BB1 = Last value status hold *1 |DV| (DVL - DVLS) DVLA = BB1 = 0 *1 2 When DVLI or ERRI of the alarm detection inhibition (INH) is 1, DVLA and BB1 turn to 0 since the alarm is inhibited. 3 (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.SPI instruction. 4 1) BW is turned to 0. 2) DVLA of the alarm detection (ALM) is turned to 0. 3) The operation mode (MODE) is changed to MAN. 4 4) BB1 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(7) Operating time/hold time check judgment ". 6 (7) Operating time/hold time check judgment Whether it is the operating time (ST) or hold time (HT = STHT - ST) is judged and the following processing is performed. (a) Operating time (ST) SV setting processing, tracking processing, gain (Kp) operation processing, PI operation (operating time) and 7 deviation check are performed. (b) Hold time (HT = STHT - ST) 8 Tracking processing, SPI operation (hold time) and deviation check are performed. Under the following condition, however, the hold time is set to 0 and continuous PI control is carried out. STHT T ST T 9.4 When the integer part of STHT is 0, no processing is performed. ( MV also remains unchanged.) T S.SPI Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs When the values of normalized number 4100 S1 , S2 , D2 are either a non-numeric or non- When the execution cycle ( T) < 0 When the operating time (ST) < 0 When the sample counter < 0 121 S.IPD 9.5 S.IPD I-PD Control 9.5 S.IPD Ladder diagram Start contact S.IPD S.IPD D1 S1 Structured ladder/FBD S2 D2 S3 Structured text language S_IPD EN ENO:=S_IPD(EN,s1,s2,s3,d1,d2); ENO s1 d1 s2 d2 s3 Input argument EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..6) S3 : When set value (E2) is used: Set value start device : Real data type ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) When set value (E2) is not used: Dummy device*1 Output argument Setting Internal devices data Bit Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– S3 –– –– *1 Constant Other Special register SD1506 can be specified as a dummy device. Function Performs I-PD control when the specified control cycle is reached. Also performs SV setting processing, tracking processing, gain (Kp) operation processing and deviation check at this time. 122 S.IPD Set Data Block diagram 9 The processing block diagram of the S.IPD instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) RL, RH DV 2 GW, GG P, I, D, CT, MTD DVL, DVLS E1 (1) (2) SV setting processing (When used) Gain Kp operation processing Tracking processing Deviation check IPD operation BW 4 Control cycle judgment (6) 3 (5) When in control cycle (7) CT (4) (3) E2 AND BB1 RUN(SPA=0) Loop stop judgment STOP(SPA=1) 6 When not in control cycle BW=0 7 (6) SPA MODE 4 BW=0 MAN Loop stop processing OFF 8 ERRI∩DVLI DVLA 9.5 S.IPD 123 S.IPD Set Data (1) Data specified in S.IPD instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol E1 BW Recommended range *1 Name Input value Output value ( MV) -999999 to 999999 % (-999999 to 999999) % BB b15 +2 BB1 Real number Real number Standard Set value by –– U –– S –– S 8.0 U 2.0 U 0 U 0 U 3 U –– Block memory Unit Data format b12 b8 b4 b0 B B 1 Deviation –– large alarm BIN 16bit (0: Without alarm) (1: With alarm) S2 +0 +1 +2 +3 MTD Derivative gain 0 to 999999 –– Deviation DVLS large alarm 0 to 100 % hysteresis +4 PN +5 TRK Operation Operation 0: Reverse operation mode 1: Forward operation Tracking 0: Not trucked bit 1: Trucked –– –– b15 +6 SVPTN b12 b8 124 b4 Real number BIN 16bit BIN 16bit b0 Set value –– pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. *2 *3 number 0 to 3 constant *1 Real BIN 16bit Set value used*2 0: E2 is used. 1: E2 is not used. The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). S.IPD Specified position Symbol Recommended range *1 Name Unit Data Standard Set format value by 8H S/U 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 2 0 to FFFFH +3 ALM Alarm b12 b15 b8 b4 S P A detection 9 b0 D M M V H L L A A A SPA DVLA,MHA,MLA 0:Loop RUN (0:Without alarm) 1:Loop STOP (1:With alarm) –– BIN 16bit 4000H S/U 3 4 00 to FFFFH Alarm +4 INH detection inhibition b15 E R R I b12 b8 b4 T R K F 4 b0 D M M V H L L I I I –– TRKF (0 : Without tracking) BIN 16bit 4000H S/U 6 (1 : With tracking) 7 ERRI, DVLI, MHI, MLI Loop 0 : Alarm enable tag memory *2 1 : Alarm inhibit +14 +15 +16 +17 +22 +25 +46 +47 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 *1 *2 RL to RH –– DV Deviation (-110 to 110) % -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering RL value lower limit CT DVL P I D GW Control cycle Deviation limit value Gain Integral constant Derivative constant Gap width 0 to 999999 Note that CT T 32767 s 0 to 100 % 0 to 999999 –– 0 to 999999 s 0 to 999999 s 0 to 100 % Real number Real number Real number Real number Real number Real number Real number Real number Real number Real number 0.0 U 0.0 S 100.0 U 0.0 U 1.0 U 100.0 U 1.0 U 10.0 U 0.0 U 0.0 U 8 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 125 S.IPD +24 Set value 9.5 +23 SV S.IPD Specified position D2 +60 +61 Loop tag memory *2 +62 +63 Loop tag D2 *3 Set value *4 *1 *2 *3 Recommended range *1 Name GG Gap gain Unit Data format 0 to 999999 –– (-999999 to 999999) % Used by the system as a work area. –– -10 to 110 % MV inside MVP operation value Real number Real number Standard Set value by 1.0 U 0.0 S –– S 0.0 U +96 past value memory *2 Symbol –– –– –– +116 S3 +0 +1 E2 Set value Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter*5 +102 +103 +104 +105 +106 +107 +108 +109 Bn-1 (Last value) PVn (Process value) PVn-1 (Last process value) PVn-2 (Process value before last) Alarm detection 2 (ALM2) b15 +116 b12 b8 b4 b0 M L A 2 M H A 2 MHA2,MLA2 (0: Without alarm) (1: With alarm) *4 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The counrol cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 126 S.IPD Set Data contents Processing 9 (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression 2 and then "(2) Tracking processing" is performed. SVn 3 RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. 4 (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking processing" is performed. 4 (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. SVn' 100 (SVn RH RL 6 RL) (b) When all of the following conditions hold, tracking processing is performed. 7 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. 8 E2 = SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. 9.5 (3) Gain (Kp) operation processing (a) The deviation (DV) is calculated under the following condition. Operation expression DV = E1 - SVn' Reverse operation (PN = 0) DV = SVn' - E1 S.IPD Condition Forward operation (PN = 1) (b) The output gain (K) is calculated under the following condition. Condition Operation expression When |DV| GW K = GG When |DV| > GW K 1 (1 GG) GW |DV| 127 S.IPD (4) I-PD operation I-PD operation is performed with the following operation expression. Item Operation expression When forward operation (PN = 1) Bn-1 M D TD MD CT TD When reverse operation (PN = 0) Bn-1 M D TD MD CT TD When forward operation (PN = 1) KP { CT TI DVn (PVn PVn-1) Bn} When reverse operation (PN = 0) KP { CT TI DVn (PVn PVn-1) Bn} Bn BW ( MV) {(PVn 2PVn-1 PVn-2) { CT Bn-1 } TD CT (PVn 2PVn-1 PVn-2) Bn-1 } TD KP: K × Gain (P), MD: Derivative gain (MTD) TI: Integral constant (I), TD: Derivative constant (D) In the following case, however, note that special processing will be performed. Condition QnPHCPU/QnPRHCPU (First 5 digits of QnPHCPU/QnPRHCPU (First 5 digits of the serial No. : 07031 or the serial No. : 07032 or later) Bn = 0 In either of the following cases 1, 2 (However, the loop tag 1. Derivative constant (D) = 0 (TD = 0) 2. Operation mode (MODE) is any of MAN, LCM and CMV past value memory is set.) In any of the following cases 1, 2, 3 In any of the following cases 1, 2, 3 1. Integral constant (I) = 0 (TI = 0) 1. 2. When either of MHA or MLA error is 2. turned to 1 Integral constant (I) = 0 (TI = 0) When either of MHA2 or MLA2 is turned to 1 CT DVn 0) TI When either of MHA or MLA error is (MVP > MH) and ( 3. Processing turned to 1 CT DVn 0) TI When either of MHA2 or MLA 2 is (MVP > MH) and ( 3. CT TI DVn 0 turned to 1 (MVP < ML) and ( CT TI DVn 0) (MVP < ML) and ( CT TI DVn 0) (5) Deviation check A deviation check is made under the following condition and the result of the check is output to DVLA of the alarm detection (ALM) and the deviation large alarm (BB1) of the block memory. Condition Result *1 DVL < |DV| DVLA = BB1 = 1 (DVL - DVLS) < |DV| DVL DVLA = BB1 = Last value status hold *1 |DV| (DVL - DVLS) DVLA = BB1 = 0 *1 When DVLI or ERRI in the alarm detection inhibition (INH) is set to 1, DVLA and BB1 show 0 since the alarm is prohibited. (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.IPD instruction. 1) BW is turned to 0. 2) DVLA of the alarm detection (ALM) is turned to 0. 3) The operation mode (MODE) is changed to MAN. 4) BB1 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(7) Control cycle judgment". 128 S.IPD (7) Control cycle judgment (a) If the specified control cycle is not reached, BW ( MV) is turned to 0 and the S.IPD instruction is terminated. (b) When the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error 9 2 In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 3 are either a non-numeric or non- 4 When CT < 0 or the execution cycle (SD1500) < 0 4 6 7 8 9.5 S.IPD 129 S.BPI 9.6 S.BPI Blend PI control 9.6 S.BPI Ladder diagram Start contact S.BPI S.BPI S1 D1 Structured ladder/FBD S2 D2 S3 Structured text language S_BPI EN ENO s1 d1 s2 d2 ENO:=S_BPI(EN,s1,s2,s3,d1,d2); s3 Input argument EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..4) S3 : When set value (E2) is used: Set value start device : Real data type ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) When set value (E2) is not used: Dummy device*1 Output argument Setting Internal devices R, ZR J \ U Zn \G data Bit S1 –– –– D1 –– –– Word Bit Word S2 –– –– D2 –– –– S3 –– –– *1 Constant Other Special register SD1506 can be specified as a dummy device. Function Performs BPI operation when the specified control cycle is reached. Also performs SV setting processing, tracking processing, gain (Kp) operation processing and deviation check at this time. 130 S.BPI Set Data Block diagram 9 The processing block diagram of the S.BPI instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) 2 RL, RH DV GW, GG P, I, CT DVL, DVLS 3 E1 (1) E2 SV setting processing (When used) Gain Kp operation processing Tracking processing (5) Deviation check BPI operation Control cycle judgment (6) BW When in control cycle (7) CT (4) (3) (2) AND BB1 4 RUN(SPA=0) Loop stop judgment STOP(SPA=1) 6 When not in control cycle 7 BW=0 (6) SPA MODE 4 BW=0 MAN Loop stop processing OFF 8 ERRI∩DVLI DVLA 9.6 S.BPI 131 S.BPI Set Data (1) Data specified in S.BPI instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol E1 BW Recommended range *1 Name Input value Output value ( MV) -999999 to 999999 % (-999999 to 999999) % BB b15 +2 BB1 Real number Real number Standard Set value by –– U –– S –– S 2.0 U 0 U 0 U 3 U –– Block memory Unit Data format b12 b8 b4 b0 B B 1 Deviation –– large alarm BIN 16bit (0: Without alarm) (1: With alarm) S2 +0 +1 Deviation DVLS large alarm 0 to 100 % hysteresis +2 PN +3 TRK Operation 0: Reverse operation mode 1: Forward operation Tracking 0: Not trucked bit 1: Trucked –– –– constant b15 +4 SNPTN b12 b8 132 b4 BIN 16bit BIN 16bit b0 Set value –– pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. *2 *3 number 0 to 3 Operation *1 Real BIN 16bit Set value used*2 0: E2 is used. 1: E2 is not used. The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). S.BPI Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 8H S/U 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 9 2 0 to FFFFH +3 ALM Alarm b12 b15 b8 b4 S P A detection b0 D M M V H L L A A A SPA DVLA,MHA,MLA 0:Loop RUN (0:Without alarm) 1:Loop STOP (1:With alarm) –– BIN 16bit 3 4000H S/U 4 00 to FFFFH Alarm +4 INH detection inhibition b15 E R R I b12 b8 b4 T R K F 4 b0 D M M V H L L I I I –– TRKF (0 : Without tracking) BIN 16bit 4000H S/U (1 : With tracking) Loop 7 ERRI, DVLI, MHI, MLI tag 6 0 : Alarm enable 1 : Alarm inhibit memory *2 +14 +15 +16 +17 +22 +25 +46 +47 +50 +51 +52 +53 +54 +55 +56 +57 *1 *2 RL to RH –– DV Deviation (-110 to 110) % -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering RL value lower limit CT DVL P I Control cycle Deviation limit value Gain Integral constant 0 to 999999 Note that CT T 32767 s 0 to 100 % 0 to 999999 –– 0 to 999999 s (-999999 to 999999) % DV cumulative SDV value ( DV) Real number Real number Real number Real number Real number Real number Real number Real number Real number 0.0 U 0.0 S 100.0 U 0.0 U 1.0 U 100.0 U 1.0 U 10.0 U 0.0 S The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 133 8 S.BPI +24 Set value 9.6 +23 SV S.BPI Specified position D2 +58 Loop tag +59 Memory *2 +60 +61 Loop tag D2 *3 Set value *4 *1 *2 *3 Recommended range *1 Name Unit Data format GW Gap width 0 to 100 % GG Gap gain 0 to 999999 –– –– –– Used by the system as a work area. –– -10 to 110 % Real number Real number Standard Set value by 0.0 U 1.0 U –– S 0.0 U +96 past value Memory *2 Symbol –– +99 S3 +0 +1 E2 Set value Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter*5 +98 CT +99 TI *4 *5 DVI When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression and then "(2) Tracking processing" is performed. SVn RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking processing" is performed. 134 S.BPI (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. SVn' 100 (SVn RH RL 9 RL) 2 (b) When all of the following conditions hold, tracking processing is performed. 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. E2 = SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. 4 (3) Gain (Kp) operation processing (a) The deviation (DV) is calculated under the following condition. Condition 4 Operation expression Forward operation (PN = 1) DV = E1 - SVn' Reverse operation (PN = 0) DV = SVn' - E1 6 (b) The output gain (K) is calculated under the following condition. Condition Operation expression When |DV| GW K = GG When |DV| > GW K 1 (1 7 GG) GW |DV| (4) BPI operation 8 BPI operation is performed with the following operation expression. Condition Operation expression BW ( MV) KP BW (DVn CT TI DVI) 9.6 Kp: K × Gain (P), BT: Execution cycle, TI: Integral constant (I), DVI: Cumulative value of DVn, DVn: Deviation S.BPI In the following case, however, note that special processing will be performed. Condition Processing In either of the following cases 1, 2 1. Integral constant (I) = 0 (TI = 0) 2. Either MLA or MHA of alarm detection (ALM) is 1 1. Integral constant (I) 0 (TI 0) CT TI DVI last value unchanged CT TI DVI CT TI ( DVI DVn) 135 S.BPI (5) Deviation check A deviation check is made under the following condition and the result of the check is output to DVLA of the alarm detection (ALM) and the deviation large alarm (BB1) of the block memory. Condition Result *1 DVL |DV| DVLA = BB1 = 1 (DVL - DVLS) < |DV| DVL DVLA = BB1 = Last value status hold *1 |DV| (DVL - DVLS) DVLA = BB1 = 0 *1 When DVLI or ERRI in the alarm detection inhibition (INH) is set to 1, DVLA and BB1 show 0 since the alarm is prohibited. (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.BPI instruction. 1) BW is turned to 0. 2) DVLA of the alarm detection (ALM) is turned to 0. 3) The operation mode (MODE) is changed to MAN. 4) BB1 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(7) Control cycle judgment". (7) Control cycle judgment (a) If the specified control cycle is not reached, BW is turned to 0 and the S.BPI instruction is terminated. (b) When the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- When CT < 0 or the execution cycle (SD1500) < 0 136 QnPHCPU QnPRHCPU S.R 9.7 S.R Ratio 9.7 S.R 9 Ladder diagram 2 Start contact S.R S.R S1 D1 S2 Structured ladder/FBD D2 S3 Structured text language 3 ENO:=S_R(EN,s1,s2,s3,d1,d2); 4 S_R EN ENO s1 d1 s2 d2 s3 Input argument 4 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..1) S3 : When set value (E2) is used: Set value start device : Real data type 6 When set value (E2) is not used: Dummy device*1 Output argument Setting ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit J R, ZR Word \ Bit U Word Zn \G –– –– –– S2 –– –– D2 –– –– S3 –– –– *1 Other Special register SD1506 can be specified as a dummy device. Function Performs rate operation when the specified control cycle is reached. Also performs operation mode (MODE) judgment, engineering value conversion, tracking processing and change rate limiter processing at this time. SPR SPR: Set value Rn Rn: Rate current value DR: Change rate limit value DR t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 8 S.R –– Constant 9.7 S1 D1 7 Control cycle 137 S.R Set Data Block diagram The processing block diagram of the S.R instruction is shown below. (The numerals (1) to (6) in the diagram indicate the order of the processing.) RMIN, RMAX DR BIAS Rn E1 (1) (6) E2 Engineering value conversion (When used) (2) Tracking processing (3) Change rate limiter Ratio operation Other than CAS, CCB, CSV CAS, CCB, CSV (5) (6) Control cycle Control cycle judgment CT (4) Mode judgment RUN(SPA 0) Loop stop judgment STOP(SPA 1) When not in control cycle (4) SPA MODE 138 Last BW MAN Loop stop processing BW S.R Set Data 9 (1) Data specified in S.R instruction Specified position Input data S1 Block memory D1 S2 Symbol Recommended range *1 Name Unit Data format Standard Set value by –– U +0 +1 E1 Input value -999999 to 999999 % Real number +0 +1 BW Output value (-999999 to 999999) % Real number –– S Tracking bit 0: Not trucked 1: Trucked –– BIN 16bit 0 U +0 TRK Operation constant +1 SVPTN b12 b8 b4 b0 Set value pattern –– Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. BIN 16bit 3 U D2 +1 MODE Operation mode b12 b8 C S V b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 7 8H S/U 8 0 to FFFFH b15 +3 ALM Alarm detection b0 –– BIN 16bit 4000H S/U S.R *2 *3 *4 b4 SPA 0: Loop RUN 1: Loop STOP memory *4 *1 b8 9.7 Loop tag b12 S P A 4 6 Set value used*2 0: E2 is used. 1: E2 is not used. 0 to FFFFH b15 3 4 0 to 3 b15 2 +14 +15 SPR Set value -999999 to 999999 –– Real number 0.0 U +16 +17 BIAS Bias -999999 to 999999 % Real number 0.0 U +46 +47 CT Control cycle 0 to 999999 Note that s Real number 1.0 U +50 +51 DR Change rate limit value 0 to 999999 –– Real number 100.0 U CT T 32767 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 139 S.R Specified position D2 Loop tag memory *2 Loop tag past value D2 memory *2 *3 Set value *4 *1 *2 *3 Symbol Recommended range *1 Name Unit Data format Standard Set value by +52 +53 RMAX Rate upper limit value -999999 to 999999 –– Real number 100.0 U +54 +55 RMIN Rate lower limit value -999999 to 999999 –– Real number 0.0 U +56 +57 Rn Rate current value (-999999 to 999999) –– Real number 0.0 S Used by the system as a work area. –– –– –– S -10 to 110 % Real number 0.0 U +96 –– –– +99 S3 +0 +1 E2 Set value The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter*5 +98 Rn-1 (Last value) +99 *4 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) Tracking processing (a) When all of the following conditions hold, tracking processing is performed. 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. E2 = 100 RMAX-RMIN (SPR-RMIN) (b) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. 140 S.R (2) Change rate limiter In the change rate limiter, the following operation is performed and the result of the operation is stored into the current 9 rate value (Rn). Condition Operation expression (SPR - Rn) DR Rn = Rn-1 + DR (SPR - Rn) - DR Rn = Rn-1 - DR |SPR - Rn| < DR Rn = SPR 2 (3) Rate operation 3 Rate operation is performed with the following operation expression. BW Rn RMIN RMAX RMIN E1 BIAS 4 (4) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.R instruction. 4 1) BW retains the last value. 2) The operation mode (MODE) is changed to MAN. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. 6 A loop run performs "(5) Control cycle judgment". (5) Control cycle judgment (a) When the specified control cycle is not reached, BW is retained and the S.R instruction is terminated. 7 (b) When the specified control cycle is reached, "(6) Mode judgment" is performed. (6) Mode judgment Either of the following processings is performed depending on the operation mode (MODE) setting. 8 (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is made with the following expression and then "(2) Change rate limiter" is performed. RMAX RMIN 100 E2 RMIN 9.7 SPR conversion being made. (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(1) Tracking processing" is executed. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When CT < 0 or the execution cycle (SD1500) < 0 141 S.R 2) When the set value (E2) is not specified, "(2) Change rate limiter" is performed without engineering value S.PHPL 9.8 S.PHPL High/Low Limit Alarm 9.8 S.PHPL Ladder diagram Start contact S.PHPL S.PHPL S1 D1 Structured ladder/FBD S2 D2 Structured text language S_PHPL EN Input argument Output argument Setting d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type Bit device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data ENO:=S_PHPL(EN,s1,s2,d1,d2); ENO s1 Word R, ZR : Real data type J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Special register SD1506 can be specified as a dummy device. Function Performs a high/low limit check on the input value (E1) and provides an alarm output. 142 Constant Other S.PHPL Set Data Block diagram 9 The processing block diagram of the S.PHPL instruction is shown below. (The numerals (1) to (5) in the diagram indicate the order of the processing.) RL, RH LL HH PL HS PH 2 PV DPL, CTIM (1) LL' HH' PL' (2) E1 3 (4) Engineering value reverse conversion Engineering value conversion PH' 4 (3) Change rate check Upper/lower limit check Upper limit alarm Positive Lower limit alarm Upper upper limit alarm Negative BW 4 BB2 AND 6 Lower lower limit alarm RUN(SPA 0) (5) Loop stop judgment BB3 AND STOP(SPA 1) 7 AND SPA 8 AND (5) BW OFF BB4 AND PHI ERRI PLI ERRI HHI ERRI LLI ERRI DPPI ERRI DPNI S.PHPL BB5 AND ERRI 9.8 Loop stop processing OR BB1 PHA PLA HHA LLA DPPA DPNA 143 S.PHPL Set Data (1) Data specified in S.PHPL instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol Recommended range *1 Name E1 Input value -999999 to 999999 % BW Output value (-999999 to 999999) % BB BB1 BB2 BB3 Block memory Unit Data format BB4 number Real number Set value by –– U –– S –– S 8H S/U 4000H S/U 4000H S/U 0.0 S 100.0 U 0.0 U –– Alarm Upper limit alarm Lower limit alarm b15 b12 b8 b4 B B 5 Positive +2 Real Standard direction change rate alarm b0 B B 4 B B B B 3 2 B B 1 –– (0: Without alarm) (1: With alarm) BIN 16bit Negative BB5 direction change rate alarm 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 0 to FFFFH b15 +3 ALM b12 S P A Alarm b8 b4 H L H L A A detection SPA 0: Loop RUN 1: Loop STOP Loop P P H L A A D P P A b0 D P N A –– BIN 16bit Other (0: Without alarm) (1: With alarm) 0 to FFFFH tag memory *2 Alarm +4 INH detection inhibition b15 b12 E R R I b8 H L H L I I b4 P P D D H L P P I I P N I I b0 –– BIN 16bit 0: Alarm enable 1: Alarm inhibit +10 +11 +22 +23 +24 +25 *1 *2 144 PV Process value (RL to RH) –– -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering RL value lower limit Real number Real number Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) S.PHPL Specified position Symbol PH +27 +45 Loop tag *3 *1 *2 *3 limit alarm LL –– RL to RH –– limit alarm RL to RH –– value Upper/lower HS limit alarm 0 to 999999 % hysteresis Change rate CTIM alarm Check time Change rate DPL alarm value CTIM 0 to 999999 Note that T 32767 s 0 to 100 % Used by the system as a work area. –– Real number Real number Real number Real number Real number Standard Set value by 100.0 U 0.0 U 100.0 U 0.0 U –– –– 2 3 4 0.0 U 4 Real number Real number 0.0 U 100.0 U 6 –– –– S 7 +127 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position Description Change rate monitor counter initial preset flag +125 Change rate monitor counter*4 +127 S.PHPL +126 8 9.8 D2 +124 *4 9 D2 +124 past value memory *2 RL to RH Lower lower +41 +44 –– value +40 +43 alarm value HH +31 +42 RL to RH Upper upper +30 +33 Lower limit PL +29 +32 alarm set value +28 memory *2 Unit Data format Upper limit D2 +26 Loop tag Recommended range *1 Name E1n-m When control is to be started from the initial status, the data must be cleared with the sequence program. The change rate monitor counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) Engineering value reverse conversion The following operations are performed to match the upper limit alarm value (PH), lower limit alarm value (PL), upper upper limit alarm value (HH) and lower lower limit alarm value (LL) ranges with the input value (E1). PH' 100 (PH RH RL RL), PL' 100 (PL RH RL RL) HH' 100 (HH RH RL RL), LL' 100 (LL RH RL RL) 145 S.PHPL (2) Upper/lower limit check The upper/lower limit checks of the input value (E1) are made under the following conditions. Check item Condition Upper limit check Lower limit check Upper Upper limit check Lower lower limit check *1 *2 *3 *4 ALM BB2 *1 E1 > PH' PHA = 1 E1 PH' - HS PHA = 0 Others PHA: Last value is status hold *1 E1 < PL' PLA = 1 E1 PL' + HS PLA = 0 1 PLA: Last value is status hold E1 > HH' HHA = 1 *3 BB3 –– 0 –– Hold *1 –– –– 1 *2 *2 Others *1 *2 –– 0 –– Hold *2 –– –– E1 HH' - HS HHA = 0 –– –– Others HHA: Last value is status hold *3 –– –– E1 < LL' LLA = 1 *4 –– –– E1 LL' + HS LLA = 0 –– –– Others LLA: Last value is status hold *4 –– –– When PHI or ERRI in the alarm detection inhibition (INH) is set to 1, PHA and BB2 show 0 since the alarm is prohibited. When PLI or ERRI in the alarm detection inhibition (INH) is set to 1, PLA and BB3 show 0 since the alarm is prohibited. When HHI or ERRI in the alarm detection inhibition (INH) is set to 1, HHA show 0 since the alarm is prohibited. When LLI or ERRI in the alarm detection inhibition (INH) is set to 1, LLA show 0 since the alarm is prohibited. (3) Change rate check (a) A change rate check is performed for the time specified in CTIM. The number of change rate checks to be made is found by the following expression. m CTIM T m varies from 1 to m. However, when m = 0 (integer part), no processing is performed. For example, when m = 4, the processing is performed as shown below. (a) Zero time E1n E1n-4 (b) One time E1n+1 E1n (c) Two time E1n+2 E1n (d) Three time E1n+3 E1n (e) Four time E1n+4 E1n E1n DPL E1n 1 2 E1n E1n a b c d 3 E1n 4 t e Execution cycle CTIM (b) The change of the input data is compared with the change rate alarm value (DPL) in each execution cycle ( T). Check item Change rate check *1 *2 146 Condition ALM E1n+m - E1n DPL DPPA = 1 *1 BB4 BB5 1 *1 –– Others DPPA = 0 0 –– E1n+m - E1n - DPL DPNA = 1 *2 –– 1 *2 Others DPNA = 0 –– 0 When DPPI or ERRI in the alarm detection inhibition (INH) is set to 1, DPPA and BB4 show 0 since the alarm is prohibited. When DPNI or ERRI in the alarm detection inhibition (INH) is set to 1, DPNA and BB5 show 0 since the alarm is prohibited. S.PHPL (4) Engineering value conversion Engineering value conversion is made with the following expression. PV 9 RH RL E1 RL 100 (5) Loop stop processing 2 (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.PHPL instruction. 1) Engineering value reverse conversion is performed with the following expression. BW 100 (PV RH RL 3 RL) 2) BB1 to BB5 of BB are turned to 0. 4 3) DPNA, DPPA, LLA, HHA, PLA and PHA of the alarm detection (ALM) are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(1) Engineering value reverse conversion". 4 Operation Error 6 In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of number S1 , D2 7 are either a non-numeric or non-normalized When the execution cycle (SD1500) < 0 8 When DPL < -DPL When CTIM < 0 9.8 S.PHPL 147 S.LLAG 9.9 S.LLAG Lead-Lag 9.9 S.LLAG Ladder diagram Start contact S.LLAG S.LLAG S1 D1 Structured ladder/FBD D2 S2 Structured text language S_LLAG EN Input argument Output argument Setting d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Loop tag memory start device : Real data type Internal devices data Bit ENO:=S_LLAG(EN,s1,s2,d1,d2); ENO s1 Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other Function Performs lead-lag operation according to the lag time and lead time settings of the operation constants and the actuating signal (e1). Output Value (BW) T2 T1 Lea-lag compensation Input Value (E1) t 1 T2S 1 T1S t Output Value (BW) T2 T1 t 148 S.LLAG Set Data 9 (1) Data specified in S.LLAG instruction Specified position S1 +0 +1 Symbol Recommended range *1 Name E1 Input value -999999 to 999999 b12 b15 Input data +2 % b8 b4 Real number Standard Set value by –– U b0 e 1 Actuating e1 Unit Data format –– signal BIN 16bit 3 –– U 0: With lead-lag compensation 1: Without lead-lag compensation Block D1 +0 memory +1 S2 +0 Operation +1 constant +2 +3 Local work D2 +0 *2 +1 memory *1 *2 BW 4 Output value (-999999 to 999999) % T1 Delay time 0 to 999999 s T2 Lead time 0 to 999999 s Last Input E1n-1 Used by the system as a work area. value 2 –– Real number Real number Real number Real number –– S 1.0 U 1.0 U –– S The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. When control is to be started from the initial status, the data must be cleared with the sequence program. (2) Execution cycle ( T) 4 6 7 8 Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing Condition BW (Output value) 1 T1 T × {T2 × (E1 - E1n-1) + T1 × (BW Last value) + However, when T1 + e1 = 1 S.LLAG BW = e1 = 0 9.9 The S.LLAG instruction instructs the following operation. T × E1} T = 0, BW = 0 BW = E1 (Input value is output unchanged) Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , D1 , S2 , D2 are either a non-numeric or non- When the execution cycle (SD1500, SD1501) < 0 When the lag time (T1) < 0 or the lead time (T2) < 0 149 S.I 9.10 S.I Integral 9.10 S.I Ladder diagram Start contact S.I S.I S1 D1 Structured ladder/FBD S2 D2 Structured text language S_I EN Input argument Output argument Setting d1 s2 d2 Bit ENO:=S_I(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR J Bit \ U Word Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Constant Special register SD1506 can be specified as a dummy device. Function Performs integral operation according to the operation control signal (e1). Input Value (E1) Output Value (BW) 1 TS t 150 t Other S.I Set Data 9 (1) Data specified in S.I instruction Specified position S1 +0 +1 Symbol Recommended range *1 Name E1 Input value -999999 to 999999 b15 Input data +2 b12 –– b8 b4 Real number Standard Set value by –– U –– BIN 16bit –– U 4 0: With integral operation 1: Without integral operation Block memory D1 S2 Operation constant *1 +0 +1 BW Output value (-999999 to 999999) +0 +1 T Integral time 0 to 999999 +2 +3 Ys Output initial value -999999 to 999999 2 3 b0 e 1 Operation control signal e1 Unit Data format –– Real number –– S s Real number 1.0 U –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. (2) Execution cycle ( T) 4 6 7 Set the execution cycle in SD1500 and SD1501 as real numbers. 8 Set Data contents Processing The S.I instruction performs the following operation. e1 T 0 BW = Yn = 0 0 BW = Yn-1 1 –– BW = Ys E1: Current input value, T T 9.10 S.I 0 BW E1 + Yn - 1 T: Execution cycle, Yn: Current output value, Yn-1: Last output value Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , D1 , S2 are either a non-numeric or non- 151 S.D 9.11 S.D Derivative 9.11 S.D Ladder diagram Start contact S.D S.D S1 D1 Structured ladder/FBD S2 D2 Structured text language S_D EN Input argument Output argument Setting d1 s2 d2 Bit ENO:=S_D(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Loop work memory start device : Real data type Internal devices data ENO s1 Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Function Executes derivative operation according to the operation control signal (e1). Output Value (BW) Input Value (E1) TS 1 TS t 152 t Other S.D Set Data 9 (1) Data specified in S.D instruction Specified position S1 +0 +1 Symbol E1 Recommended range *1 Name Input value -999999 to 999999 b12 b15 Input data +2 b8 b4 Standard Set value by –– U –– Real number –– BIN 16bit –– Real number –– S b0 e 1 Operation control signal e1 Unit Data format 3 –– U 0: With derivative operation 1: Without derivative operation Block memory D1 S2 Operation constant +0 +1 BW +0 +1 +2 +3 Local work D2 +0 *2 +1 memory *1 *2 4 Output value (-999999 to 999999) T Derivative time 0 to 999999 s Real number 1.0 U Ys Output initial value -999999 to 999999 –– Real number 0.0 U Last input value Used by the system as a work area. –– Real number –– S E1n-1 2 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. When control is to be started from the initial status, the data must be cleared with the sequence program. 4 6 7 (2) Execution cycle ( T) 8 Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing e1 0 BW BW = T T+ T Note that T + 1 E1: Current input value, 9.11 S.D The S.D instruction performs the following operation. (Yn-1-E1n-1+E1) T = 0, BW = 0. BW = Ys T: Execution cycle, Yn: Last output value, Yn-1: Last output value Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , D1 , S2 , D2 are either a non-numeric or non- 153 S.DED 9.12 S.DED Dead Time 9.12 S.DED Ladder diagram Start contact S.DED S.DED S1 S2 D1 Structured ladder/FBD D2 Structured text language S_DED EN Input argument Output argument Setting d1 s2 d2 Bit ENO:=S_DED(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) S2 : Operation constant start device : Array of any 16-bit data (0..5) ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop work memory start device : Array of any 16-bit data (0..100) Internal devices data ENO s1 Word J R, ZR \ Bit U Word Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Function Outputs the input value (E1) with a delay of dead time according to the setting of the operation control signal (e1). SN E1, Y1 SN E1 Y1 Ys ST1 ST2 ST3 ST4 ST5 ST6 ST7 e1 BB1 SN1 SN2 SN3 Dead time table SN: Sampling count ST: Data collection interval 154 E1: Input value Ys: Output initial value Other S.DED Set Data 9 (1) Data specified in S.DED instruction Specified position S1 +0 +1 Symbol E1 Recommended range *1 Name Input value -999999 to 999999 b15 Input data +2 e1 Unit Data format b12 b8 b4 –– Real number –– BIN 16bit –– Real number Standard value Set by –– U b0 e 1 Operation control signal 3 –– U 0: With dead time 1: Without dead time D1 +0 +1 BW Output value 4 (-999999 to 999999) BB Block memory +2 BB1 –– S 4 –– b15 b12 b8 b4 b0 B B 1 Data sufficiency bit –– BIN 16bit –– S 6 1.0 U 7 0 U 0.0 U 0 U (0: Data sufficiency) (1: Data insufficiency) S2 Operation constant Data collection 0 to 999999 Interval +2 SN Sampling count 0 to 48 –– BIN 16bit +3 +4 Ys Output initial value -999999 to 999999 –– Real number –– BIN 16bit b15 +5 OCHG +5 +6 : +2SN +1 +2SN +2 *1 *2 *3 b0 O C H G s 0: E1 when e1 turned from 1 to 0 is output up to SN times. 1: Ys is output up to SN times. Real number *3 Dead time table number of stored data +2 memory *2 b4 32767 Cycle counter +1 +3 +4 b8 ST T Last value input (e1') D2 +0 Local work output switching b12 Note that –– Dead time table 1 Used by the system as a work area. –– –– –– S Dead time table 2 : Dead time table SN The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. When control is to be started from the initial status, the data must be cleared with the sequence program. The cycle counter rounds off the data to the nearest whole number. 155 8 9.12 S.DED ST +0 +1 2 S.DED (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) The S.DED instruction performs the following operation. e1 OCHG Dead time 1 0/1 None BW E1 Up to SN times 0 1 Later than SN Oldest data *1 times ST × SN 0 Up to SN times 1 0 *1 YS Later than SN Oldest data *1 times 0/1 0 E1 when e1 turns from 1 to 0 Oldest data *1 ST × SN The oldest date is the E1 after the SNth time. • When the dead time table date is not filled, BB1 is turned 1. • When SN = 0, BB1 = 0 and BW = E1. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs When the values of number 4100 S1 , S2 are either a non-numeric or non-normalized When the sampling count is other than 0 to 48 When the execution cycle ( T) < 0 When the data collection intervals (ST) < 0 156 QnPHCPU QnPRHCPU S.HS 9.13 S.HS High Selector 9.13 S.HS 9 Ladder diagram 2 Start contact S.HS S.HS S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_HS(EN,s1,s2,d1,d2); 4 S_HS EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..32) device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR : Real data type J Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.13 S.HS *1 6 Function Outputs the maximum value of the input values 1 (E1) to n (En). 157 S.HS Set Data (1) Data specified in S.HS instruction Specified position S1 Input data Recommended range *1 Name +0 n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 En Input value n BW Output value +2n-1 +2n D1 Symbol +0 +1 Input count *1 BB1 to BB16 Set value by –– U 1 to 16 –– -999999 to 999999 –– Real number –– U (Maximum value of E1 to En) –– Real number –– S –– BIN 16bit –– S –– b15 +2 Standard BIN 16bit BB Block memory Unit Data format b12 b8 B B B B B B B B B B B B B B B B 16 15 14 13 12 11 10 9 Output selection b4 B B B B 8 7 B B B B B B 6 5 4 b0 B B B B 3 2 B B 1 (0: The corresponding input value is not the maximum value) (1: The corresponding input value is the maximum value) The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) High selector processing The maximum value of the input values 1 (E1) to n (En) is stored into BW. Also, any of BB1 to BB16 of BB corresponding to the maximum value is turned to 1. Input value Bit turned to 1 at maximum value E16 E15 E14 to E2 E1 BB16 BB15 BB14 to BB2 BB1 (a) If there are two or more maximum values, the bits corresponding to the maximum values are all turned to 1. (b) If there is only one input 1) When only E1 is used as the input value • E1 is stored into BW. • BB1 of BB is turned to 1. • BB2 to BB16 of BB are turned to 0. 2) Only one of E2 to E16 is used as the input value • The input values of E2 to E16 and the data of E1 are used to perform processing. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code 4100 158 Error definition When the value of S1 is either a non-numeric or non-normalized number When not 1 number of inputs (n) 16 QnPHCPU QnPRHCPU S.LS 9.14 S.LS Low Selector 9.14 S.LS 9 Ladder diagram 2 Start contact S.LS S.LS S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_LS(EN,s1,s2,d1,d2); 4 S_LS EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..32) device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR : Real data type J Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.14 S.LS *1 6 Function Outputs the minimum value of the input values 1 (E1) to n (En). 159 S.LS Set Data (1) Data specified in S.LS instruction Specified position S1 Input data Recommended range *1 Name +0 n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 En Input value n BW Output value +2n-1 +2n D1 Symbol +0 +1 Input count *1 +2 Set value by –– U 1 to 16 –– -999999 to 999999 –– Real number –– U (Minimum value of E1 to En) –– Real number –– S –– BIN 16bit –– S –– b15 BB1 to BB16 Standard BIN 16bit BB Block memory Unit Data format b12 b8 B B B B B B B B B B B B B B B B 16 15 14 13 12 11 10 9 Output selection b4 B B B B 8 7 B B B B B B 6 5 4 b0 B B B B 3 2 B B 1 (0: The corresponding input value is not the minimum value) (1: The corresponding input value is the minimum value) The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Low selector processing The minimum value of the input values 1 (E1) to n (En) is stored into BW. Also, any of BB1 to BB16 of BB corresponding to the minimum value is turned to 1. Input value Bit turned to 1 at minimum value E16 E15 E14 to E2 E1 BB16 BB15 BB14 to BB2 BB1 (a) If there are two or more minimum values, the bits corresponding to the minimum values are all turned to 1. (b) If there is only one input 1) When only E1 is used as the input value • E1 is stored into BW. • BB1 of BB is turned to 1. • BB2 to BB16 of BB are turned to 0. 2) Only one of E2 to E16 is used as the input value • The input values of E2 to E16 and the data of E1 are used to perform processing. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code 4100 160 Error definition When the value of S1 is either a non-numeric or non-normalized number When not 1 number of inputs (n) 16 QnPHCPU QnPRHCPU S.MID 9.15 S.MID Middle Value Selection 9.15 S.MID 9 Ladder diagram 2 Start contact S.MID S.MID D1 S1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_MID(EN,s1,s2,d1,d2); 4 S_MID EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..32) device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR : Real data type J Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.15 S.MID *1 6 Function Outputs the middle value between the maximum value and minimum value among the input value 1 (E1) to input value n (En). 161 S.MID Set Data (1) Data specified in S.MID instruction Specified position Symbol +0 n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 +2n-1 +2n En Input value n +0 +1 BW Output value S1 Input data D1 Recommended range *1 Name Input count *1 Set value by –– U 1 to 16 –– -999999 to 999999 –– Real number –– U (Middle value between maximum value and minimum value) –– Real number –– S –– BIN 16bit –– S –– b15 +2 Standard BIN 16bit BB Block memory Unit Data format BB1 to BB16 b12 b8 B B B B B B B B B B B B B B B B 16 15 14 13 12 11 10 9 Output selection b4 B B B B 8 7 b0 B B B B B B 6 5 4 B B 1 B B B B 3 2 (0: The corresponding input value is not the intermediate value) (1: The corresponding input value is the intermediate value) The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Middle value selector processing The middle value of the input values 1 (E1) to n (En) is stored into BW. Also, any of BB1 to BB16 of BB corresponding to the middle value is turned to 1. Input value Bit turned to 1 at middle value E16 E15 E14 to E2 E1 BB16 BB15 BB14 to BB2 BB1 (a) If there are an even number of inputs, the smaller value of the middle values is stored. (b) If there are two or more middle values, the bits corresponding to the middle values are all turned to 1. Remark The middle value is selected as described below. (1) The input value 1 (E1) to input value n (En) are rearranged in order of increasing value. (If there are the same input values, they are arranged in order of increasing input number.) (2) The middle value among the rearranged values is selected. Example) When the input data are 2, 5, 1, 4 and 3, the middle value is selected as described below. Input data Rearranged data E1 E2 E3 E4 E5 2 5 1 4 3 Rearrangement E3 E1 E5 E4 E2 1 2 3 4 5 In the above case, the middle value is "3" and BB5 turns to 1. 162 S.MID Operation Error 9 In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code 4100 Error definition When the value of S1 QnPHCPU QnPRHCPU is either a non-numeric or non-normalized number 2 When not 1 number of inputs (n) 16 3 4 4 6 7 8 9.15 S.MID 163 S.AVE 9.16 S.AVE Average Value 9.16 S.AVE Ladder diagram Start contact S.AVE S.AVE S1 D1 Structured ladder/FBD S2 D2 Structured text language S_AVE EN Input argument Output argument Setting d1 s2 d2 Bit ENO:=S_AVE(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..32) device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR : Real data type J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Special register SD1506 can be specified as a dummy device. Function Calculates and outputs the average value of the input value 1 (E1) to n (En). 164 Constant Other S.AVE Set Data 9 (1) Data specified in S.AVE instruction Specified position n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 +2n-1 +2n En Input value n +0 +1 BW Output value Input data *1 Recommended range *1 Name +0 S1 Block memory Symbol D1 Input count Unit Data format 1 to 16 –– BIN 16bit Standard Set value by –– U 2 3 -999999 to 999999 –– (Average value of E1 to En) –– Real number –– Real number –– U 4 S The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. 4 6 Set Data contents Processing 7 (1) Calculation of average value The average value of the input value 1 (E1) to n (En) is calculated. As the denominator (N), the value specified as the number of inputs (n) is used. BW E1 E2 E3 N 8 En Operation Error Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the value of S1 is either a non-numeric or non-normalized number When not 1 number of inputs (n) 16 165 9.16 S.AVE In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. S.LIMT 9.17 S.LIMT High/Low Limiter 9.17 S.LIMT Ladder diagram Start contact S.LIMT S.LIMT S1 D1 Structured ladder/FBD D2 S2 Structured text language S_LIMT EN Input argument Output argument Setting ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of real data type (0..3) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data Bit ENO:=S_LIMT(EN,s1,s2,d1,d2); R, ZR Word J \ Bit U Word Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Constant Special register SD1506 can be specified as a dummy device. Function The upper and lower limit limiter is applied to the output value by adding a hysteresis. BW HILMT HILMT LOLMT LOLMT HS2 HS1 HILMT HS1 LOLMT HS2 LOLMT Upper limit alarm BB1 Lower limit alarm BB2 166 HILIMT X1 Other S.LIMT Set Data 9 (1) Data specified in S.LIMT instruction Specified position Input data S1 D1 Symbol Recommended range *1 Name *2 –– U Input value -999999 to 999999 % +0 +1 BW Output value (-999999 to 999999) % Real number –– S –– BIN 16bit –– S -999999 to 999999 % Real number 100.0 U -999999 to 999999 % Real number 0.0 U BB2 *1 by E1 +2 Operation constant Set value +0 +1 BB1 S2 Standard Real number BB Block memory Unit Data format 2 3 –– b15 Upper limit alarm b12 b8 b4 b0 B B 2 Lower limit alarm B B 1 (0: Without alarm) (1: With alarm) Upper limit 4 +0 +1 HILMT +2 +3 LOLMT +4 +5 HS1 Upper limit hysteresis 0 to 999999 % Real number 0.0 U +6 +7 HS2 Lower limit hysteresis 0 to 999999 % Real number 0.0 U value*2 Lower limit value*2 4 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Make setting to satisfy HILMT LOLMT. 6 7 8 Set Data contents Processing Condition BW BB1 9.17 S.LIMT (1) The S.LIMT instruction performs the following operation. BB2 E1 HILMT HILMT 1 0 (LOLMT + HS2) < E1 < (HILMT - HS1) E1 0 0 E1 LOLMT LOLMT Other than above (hysteresis section) E1 0 1 Last value Last value Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs When HS1 < 0 or HS2 < 0 4100 When the values of number S1 , S2 are either a non-numeric or non-normalized When LOLMT > HILMT 167 S.VLMT1 9.18 S.VLMT1 Variation Rate Limiter 1 9.18 S.VLMT1 Ladder diagram Start contact S.VLMT1 S.VLMT1 S1 S2 D1 Structured ladder/FBD D2 Structured text language S_VLMT1 EN Input argument Output argument Setting d1 s2 d2 Bit ENO:=S_VLMT1(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of real data type (0..3) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR J Bit \ U Word Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Constant Special register SD1506 can be specified as a dummy device. Function Limits the varying speed of the output value. Input Input Hysteresis Hysteresis t Output 1 0 t BB1 BW Output 1 0 BB2 BW t (Positive Direction) 168 (Negative Direction) t Other S.VLMT1 Set Data 9 (1) Data specified in S.VLMT1 instruction Specified position Input data S1 D1 Symbol Recommended range *1 Name +0 E1 +1 Input value -999999 to 999999 % Real number +0 BW +1 Output value (-999999 to 999999) % Real number BB Block memory Operation constant Set value by –– U –– S 2 3 BB1 BB2 Negative direction restriction alarm b15 b12 b8 b4 4 b0 B B 2 B B 1 –– BIN 16bit –– S 4 (0: Without alarm) (1: With alarm) 6 +0 V1 +1 Positive direction limit value 0 to 999999 %/s Real number 100.0 U +2 V2 +3 Negative direction limit value 0 to 999999 %/s Real number 100.0 U 7 +4 HS1 +5 Positive direction hysteresis 0 to 999999 % Real number 0.0 U 8 +6 HS2 +7 Negative direction hysteresis 0 to 999999 % Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) The S.VLMT1 instruction performs the following operation. Input (E1 - BW) Positive direction When E1 BW Negative direction When E1 < BW BW BB1 BB2 1 0 (E1 - BW) (V1 × T) BW = BW + V1 × (E1 - BW) < (V1 × T - HS1) BW = E1 0 0 BW = E1 Last value Last value Others T (BW - E1) (V2 × T) BW = BW - V2 × 0 1 (BW - E1) < (V2 × T - HS2) BW = E1 0 0 BW = E1 Last value Last value Others T 169 9.18 S.VLMT1 *1 Standard –– Positive direction restriction alarm +2 S2 Unit Data format S.VLMT1 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , S2 When HS1 < 0 or HS2 < 0 170 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.VLMT2 9.19 S.VLMT2 Variation Rate Limiter 2 9.19 S.VLMT2 9 Ladder diagram 2 Start contact S.VLMT2 S.VLMT2 S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_VLMT2(EN,s1,s2,d1,d2); 4 S_VLMT2 EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of real data type (0..3) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word R, ZR J Bit 7 \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.19 S.VLMT2 *1 6 Function Limits the varying speed of the output value. E1(BW) Input value E1 Output value BW BB1 BB2 171 S.VLMT2 Set Data (1) Data specified in S.VLMT2 instruction Specified position Input data S1 D1 Symbol Recommended range *1 Name Operation constant *1 Set value by –– U +0 +1 E1 Input value -999999 to 999999 % +0 +1 BW Output value (-999999 to 999999) % Real number –– S –– BIN 16Bit –– S –– BB1 Positive direction restriction alarm BB2 Negative direction restriction alarm +0 +1 V1 Positive direction limit value 0 to 999999 %/s Real number 100.0 U +2 +3 V2 Negative direction limit value 0 to 999999 %/s Real number 100.0 U +4 +5 HS1 Positive direction hysteresis 0 to 999999 % Real number 0.0 U +6 +7 HS2 Negative direction hysteresis 0 to 999999 % Real number 0.0 U +2 S2 Standard Real number BB Block memory Unit Data format b15 b12 b8 b4 b0 B B 2 B B 1 (0: Without alarm) (1: With alarm) The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) The S.VLMT2 instruction performs the following operation. Condition Positive direction When E1 BW Negative direction When E1 < BW BW BB1 BB2 (E1 - BW) (V1× T) BW = BW 1 0 (E1 - BW) < (V1× T - HS1) BW = E1 0 0 Others BW = BW Last value Last value (BW - E1) (V2× T) BW = BW 0 1 (BW - E1) < (V2× T - HS2) BW = E1 0 0 Others BW = BW Last value Last value Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , S2 When HS1 < 0 or HS2 < 0 172 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.ONF2 9.20 S.ONF2 2-position ON/OFF 9.20 S.ONF2 9 Ladder diagram 2 Start contact S.ONF2 S.ONF2 D1 S1 Structured ladder/FBD S2 D2 S3 Structured text language 3 ENO:=S_ONF2(EN,s1,s2,s3,d1,d2); 4 S_ONF2 EN ENO s1 d1 s2 d2 s3 Input argument 4 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..2) S3 : When set value (E2) is used: Set value start device : Real data type 6 When set value (E2) is not used: Dummy device*1 Output argument Setting ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit Word R, ZR J Bit \ Word U Zn \G –– –– –– –– S2 –– –– D2 –– –– S3 –– –– *1 Constant Other 8 9.20 S.ONF2 S1 D1 7 Special register SD1506 can be specified as a dummy device. Function Performs 2-position ON/OFF control (ON/OFF of one contact) when the specified control cycle is reached. Also performs SV setting processing, tracking processing, MV compensation and MV output processing at this time. 173 S.ONF2 Set Data Block diagram The processing block diagram of the S.ONF2 instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) RL, RH HSO DV MV E1 (1) E2 (2) SV setting processing (When used) (3) Tracking processing MV compensation (7) When in control cycle CT Control cycle judgment (6) MV output 2-position ON/OFF control Mode judgment STOP(SPA 1) BW (5) When not in control cycle RUN(SPA 0) Loop stop judgment (4) MAN, CMB, CMV, LCM Other than MAN, CMB, CMV, LCM (6) SPA MODE 174 Last BW MAN Loop stop processing BB1 S.ONF2 Set Data 9 (1) Data specified in S.ONF2 instruction Specified position Input data S1 D1 Symbol Recommended range *1 Name Set value by –– S/U +0 +1 E1 Input value -999999 to 999999 % +0 +1 BW Output value (-999999 to 999999) % Real number –– S –– BIN 16bit –– S 0 U 0 U +2 BB1 b12 PN +1 TRK b8 b4 b0 B B 1 Operation result (0: |BW| (1: |BW| +0 2 3 –– b15 S2 Standard Real number BB Block memory Unit Data format 50 50 4 ) ) Operation mode 0: Reverse operation 1: Forward operation –– BIN 16bit Tracking bit 0: Without tracking 1: With tracking –– BIN 16bit 4 6 0 to 3 b15 Operation constant +2 SVPTN b12 b8 b4 b0 Set value pattern *3 Set value pattern 0: E2 is upper loop MV. 1: E2 is not upper loop MV. 7 –– BIN 16bit 3 U –– BIN 16bit 8H S/U –– BIN 16bit 4000H S/U 8 used*2 Set value 0: E2 is used. 1: E2 is not used. 0 to FFFFH +1 MODE Operation mode Loop tag b15 b12 b8 C S V b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M 0 to FFFFH b15 memory *4 +3 ALM Alarm detection b12 S P A b8 b4 b0 SPA 0: Loop RUN 1: Loop STOP *1 *2 *3 *4 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 175 9.20 S.ONF2 D2 S.ONF2 Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 4000H S/U 0 to FFFFH b15 D2 Loop tag memory *2 +4 Alarm detection inhibit INH b12 b8 b4 b0 T R K F –– BIN 16Bit TRKF (0: Without tracking) (1: With tracking) +12 +13 MV Manipulated value -10 to 110 % Real number 0.0 S/U +14 +15 SV Set value RL to RH –– Real number 0.0 U +16 +17 DV Deviation (-110 to 110) % Real number 0.0 S +18 +19 HS0 Hysteresis 0 to 999999 –– Real number 0.0 U +22 +23 RH Engineering value upper limit -999999 to 999999 –– Real number 100.0 U +24 +25 RL Engineering value lower limit -999999 to 999999 –– Real number 0.0 U +46 +47 CT Control cycle 0 to 999999 Note that s Real number 1.0 U Loop tag past value +96 memory *2 +97 –– –– CT T 32767 Used by the system as a work area. –– –– –– S -10 to 110 % Real number 0.0 S/U *3 Set value *4 S3 +0 +1 *1 *2 *3 E2 Set value The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter*5 *4 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 176 S.ONF2 Set Data contents Processing 9 (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression 2 and then "(2) Tracking processing" is performed. SVn 3 RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. 4 (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking processing" is performed. 4 (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. 100 RH RL SVn' 6 (SVn RL) (b) When all of the following conditions hold, tracking processing is performed. 7 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 8 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. E2 = SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. After the deviation (DV) is calculated from the input value (E1) and the set value after tracking processing (SVn'), the MV compensation value (MV') is calculated. (a) Calculation of deviation (DV) The deviation (DV) is calculated under the following condition. Condition DV Forward operation (PN = 1) E1 - SVn' Reverse operation (PN = 0) SVn' - E1 (b) Calculation of MV compensation value (MV') The MV compensation value (MV')is calculated under the following condition. Condition MV' DV HS0 100% DV - HS0 0% - HS0 < DV < HS0 Last value (BW value) 177 9.20 S.ONF2 (3) MV compensation S.ONF2 (4) MV output The manipulated value (MV(BW)) is calculated under the following condition. Condition BW CMV, MAN, CMB, LCM BW = MVn BW = MV' CSV, CCB, CAB, CAS, AUT, LCC, LCA MVn = BW (5) 2-position ON/OFF control BB1 of BB is output under the following condition. Condition BB1 |BW| 50% 1 |BW| < 50% 0 (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.ONF2 instruction. 1) BW and BB1 retain the last values. 2) The operation mode (MODE) is changed to MAN. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(7) Control cycle judgment". (7) Control cycle judgment (a) If the specified control cycle is not reached 1) When the operation mode (MODE) is any of CSV, CCB, CAB, CAS, AUT, LCC and LCA, BW is retained and the S.ONF2 instruction is terminated. 2) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM, BW is made equal to MV and the processing of "(5) 2-position ON/OFF control" is performed. (b) If the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When CT < 0 or the execution cycle (SD1500) < 0 When HS0 < -HS0 178 QnPHCPU QnPRHCPU S.ONF3 9.21 S.ONF3 3-position ON/OFF 9.21 S.ONF3 9 Ladder diagram 2 Start contact S.ONF3 S.ONF3 S1 D1 Structured ladder/FBD S2 D2 S3 Structured text language 3 ENO:=S_ONF3(EN,s1,s2,s3,d1,d2); 4 S_ONF3 EN ENO s1 d1 s2 d2 s3 Input argument 4 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..2) S3 : When set value (E2) is used: Set value start device : Real data type 6 When set value (E2) is not used: Dummy device*1 Output argument Setting ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices data Bit Word R, ZR J Bit \ Word U Zn \G –– –– –– –– S2 –– –– D2 –– –– S3 –– –– *1 Constant Other 8 9.21 S.ONF3 S1 D1 7 Special register SD1506 can be specified as a dummy device. Function Performs 3-position ON/OFF control (ON/OFF of two contact) when the specified control cycle is reached. Also performs SV setting processing, tracking processing, MV compensation and MV output processing at this time. 179 S.ONF3 Set Data Block diagram The processing block diagram of the S.ONF3 instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) RL, RH HSO HS1 DV MV E1 (1) E2 (2) SV setting processing (When used) Tracking processing MV compensation (7) When in control cycle CT Control cycle judgment (6) MV output 3-position ON/OFF control Mode judgment STOP(SPA 1) BW (5) When not in control cycle RUN(SPA 0) Loop stop judgment (4) (3) MAN, CMB, CMV, LCM Other than MAN, CMB, CMV, LCM (6) Last BW SPA MODE 180 MAN Loop stop processing BB1 BB2 S.ONF3 Set Data 9 (1) Data specified in S.ONF3 instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol Recommended range *1 Name E1 Input value -999999 to 999999 % BW Output value (-999999 to 999999) % BB BB1 Block b12 b8 b4 S2 B B 2 PN +1 TRK Real number by –– U –– S 2 3 4 result B B 1 –– +0 number Set value b0 Operation +2 BB2 Real Standard –– b15 memory Unit Data format Operation result Output value BB2 1 0 25%BW<75% 0 0 BW75% 0 1 0: Reverse operation mode 1: Forward operation Tracking bit 16bit –– S BB1 BW<25% Operation BIN 6 –– 0: Without tracking –– 1: With tracking BIN 16bit BIN 16bit 0 U 0 U 3 U 8H S/U 4000H S/U 0 to 3 b15 Operation b12 b8 b4 4 7 8 b0 constant SVPTN Set value –– pattern Set value pattern*3 0: E2 is upper loop MV. 1: E2 is not upper loop MV. BIN 16bit Set value used*2 0: E2 is used. 1: E2 is not used. 0 to FFFFH D2 +1 MODE Operation b15 b12 Loop tag 0 to FFFFH memory *4 b15 +3 ALM Alarm b8 C S V mode b12 S P A detection b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M b8 b4 –– BIN 16bit b0 –– BIN 16bit SPA 0: Loop RUN 1: Loop STOP *1 *2 *3 *4 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Specify whether the set value (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the set value (E2). The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 181 9.21 S.ONF3 +2 S.ONF3 Specified position Symbol Recommended range *1 Name Standard Set value by 4000H S/U 0.0 S/U 0.0 U 0.0 S 0.0 U 0.0 U 100.0 U 0.0 U Real number 1.0 U Unit Data format 0 to FFFFH b15 Alarm D2 +4 +12 +13 +14 +15 Loop tag +16 memory +17 *2 +18 +19 +20 +21 +22 +23 +24 +25 +46 +47 Loop tag past value memory *2 D2 INH detection inhibit Manipulated MV value b12 b8 b4 b0 T R K F –– TRKF (0: Without tracking) (1: With tracking) -10 to 110 % SV Set value RL to RH –– DV Deviation (-110 to 110) % HS0 Hysteresis 0 0 to 999999 –– HS1 Hysteresis 1 0 to 999999 –– -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering value lower RL limit CT Control cycle BIN 16Bit 0 to 999999 Note that CT T 32767 s Real number Real number Real number Real number Real number Real number Real number +96 –– –– Used by the system as a work area. –– –– –– S -10 to 110 % Real number 0.0 U +97 *3 Set value *4 *1 *2 *3 S3 +0 +1 E2 Set value The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position D2 Description +96 Control cycle counter initial preset flag +97 Control cycle counter*5 *4 *5 When control is to be started from the initial status, the data must be cleared with the sequence program. The set value (E2) becomes valid when the set value pattern (SVPTN) is set to "E2 is used". When using the MV of the upper loop as the set value (E2), specify the device where the manipulated value (MV) of the upper loop is set (offset + 12: MV). When not using E2 as the set value, make sure to specify a dummy device. (Special register SD1506 can be specified as a dummy device.) The control cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 182 S.ONF3 Set Data contents Processing 9 (1) SV setting processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of CAS, CCB and CSV 1) When the set value (E2) is specified, engineering value conversion is performed with the following expression 2 and then "(2) Tracking processing" is performed. SVn 3 RH RL E2 RL 100 2) When the set value (E2) is not specified, "(2) Tracking processing" is performed without the engineering value conversion being performed. (b) When the operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC, "(2) Tracking 4 processing" is performed. 4 (2) Tracking processing (a) The set value (SV) is converted reversely from the engineering value with the following operation expression to calculate SVn'. SVn' 100 (SVn RH RL 6 RL) (b) When all of the following conditions hold, tracking processing is performed. 7 1) The tracking bit (TRK) of the operation constant is 1. 2) The set value (E2) is used. 3) The operation mode (MODE) is any of MAN, AUT, CMV, CMB, CAB, LCM, LCA and LCC. 8 E2 = SVn' (c) When the set value (E2) is the manipulated value (MV) of the upper loop, the tracking flag (TRKF) of the alarm detection inhibition (INH) in the upper loop turns to 1. (3) MV compensation compensation value (MV') is calculated. (a) Calculation of deviation (DV) The deviation (DV) is calculated under the following condition. Condition DV Forward operation (PN = 1) E1 - SVn' Reverse operation (PN = 0) SVn' - E1 (b) Calculation of MV compensation value (MV') The MV compensation value (MV')is calculated under the following condition. Condition MV' DV (HS1 + HS0) 100% DV - (HS1 + HS0) 0% ( - HS1 + HS0) < DV < (HS1 - HS0) 50% Other than above Last value (BW value) (4) MV output The manipulated value (MV(BW)) is calculated under the following condition. Condition CMV, MAN, CMB, LCM CSV, CCB, CAB, CAS, AUT, LCC, LCA BW BW = MVn BW = MV' MVn = BW 183 9.21 S.ONF3 After the deviation (DV) is calculated from the input value (E1) and the set value after tracking processing (SVn'), the MV S.ONF3 (5) 3-position ON/OFF control BB1 and BB2 of BB are output under the following condition. BB1 BB2 BW 75% 25% BW < 75% Condition 1 0 0 0 BW < 25% 0 1 (6) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.ONF3 instruction. 1) BW, BB1 and BB2 retain the last values. 2) The operation mode (MODE) is changed to MAN. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(7) Control cycle judgment". (7) Control cycle judgment (a) If the specified control cycle is not reached 1) When the operation mode (MODE) is any of CSV, CCB, CAB, CAS, AUT, LCC and LCA, BW is retained and the S.ONF3 instruction is terminated. 2) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM, BW is made equal to MV and the processing of "(5) 3-position ON/OFF control" is performed. (b) If the specified control cycle is reached, "(1) SV setting processing" is performed. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs When HS0 < 0 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When CT < 0 or the execution cycle (SD1500) < 0 When (HS1 + HS0) < 0 When HS1 < 0 184 QnPHCPU QnPRHCPU S.DBND 9.22 S.DBND Dead Band 9.22 S.DBND 9 Ladder diagram 2 Start contact S.DBND S.DBND D1 S1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_DBND(EN,s1,s2,d1,d2); 4 S_DBND EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word J R, ZR 7 \ Bit Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.22 S.DBND *1 6 Function Provides a dead band and performs output processing. Output (BW) D1 D2 2 D1 D1: Dead band upper limit D2 D2: Dead band lower limit D2 D1 Input E1 BB1 1 0 185 S.DBND Set Data (1) Data specified in S.DBND instruction Specified position Input S1 data +0 +1 D1 +0 +1 Symbol Recommended range *1 Name E1 Input value -999999 to 999999 % BW Output value (-999999 to 999999) % BB b15 +2 BB1 Real number Real number Standard Set value by –– U –– S –– S 100.0 U 0 U –– Block memory Unit Data format b12 b8 b4 b0 B B 1 Dead band –– action BIN 16bit (0: Outside the dead band range) (1: Within the dead band range) Operation +0 +1 constant +2 S2 +3 *1 D1 D2 Dead band upper limit Dead band lower limit -999999 to 999999 –– -999999 to 999999 –– Real number Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.DBND instruction performs the following processing. Condition BW BB1 D2 E1 D1 D2 D1 2 1 (E1 < D2) or (E1 > D1) E1 0 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 186 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.PGS 9.23 S.PGS Program Setter 9.23 S.PGS 9 Ladder diagram 2 Start contact S.PGS S.PGS S1 S2 D1 Structured ladder/FBD D2 Structured text language 3 ENO:=S_PGS(EN,s1,s2,d1,d2); 4 S_PGS EN Input argument Output argument Setting ENO s1 d1 s2 d2 4 EN : Execution condition : Bit S1 : Dummy device : Real data type device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices R, ZR : Real data type J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.23 S.PGS *1 Word 6 Function Provides a control output according to the SV and MV pattern. As the output types of the S.PGS instruction, there are three types of the "hold type", "return type" and "cyclic type". • Hold type : Output is provided with the SV10 value held. • Return type : The set value (SV) is set to 0 and the last value is output as the manipulated value (MV). • Cyclic type : After SV1 to SV10 have been processed, processing is restarted from SV1 and the output is provided. MVPGS MV5, MV6 MV3, MV4 MV7, MV8 MV1, MV2 MV9, MV10 SV1 SV2 SV3 SV4 SV5 SV6 SV7 SV8 SV9 SV10 SV 187 S.PGS Set Data Block diagram The processing block diagram of the S.PGS instruction is shown below. (The numerals (2) to (5) in the diagram indicate the order of the processing.) MV, MV1 to MV16 SV, SV1 to SV16 (3) TYPE MV PGS ML, MH (4) (5) MV PGS Operation SV count-up Output processing BW OR RUN(SPA 0) BB1 BB2 PTNO. BB3 (2) Loop stop judgment STOP(SPA 1) SPA MHA MLA MODE (2) All OFF MAN 188 Loop stop processing Last BW All OFF S.PGS Set Data 9 (1) Data specified in S.PGS instruction Specified position D1 +0 +1 Symbol BW Recommended range *1 Name Output value (-999999 to 999999) % BB BB1 Block memory +2 BB2 BB3 Unit Data format Real number Standard Set value by –– S –– Alarm b15 b12 b8 b4 limit alarm Output lower limit alarm 3 b0 B B B B 3 2 Output upper B B 1 –– BIN 16bit –– S (0: Without alarm) (1: With alarm) 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M 2 4 4 –– BIN 16bit 8H S/U 6 0 to FFFFH b15 +3 ALM b12 b8 b4 S P A Alarm b0 M M H L A A detection SPA 0: Loop RUN 1: Loop STOP –– BIN 16bit 4000H S/U MHA, MLA (0: Without alarm) (1: With alarm) 7 8 0 to FFFFH Alarm +4 INH detection inhibition memory *2 b12 b8 E R R I b4 b0 M M H L I I –– BIN 16bit 4000H S/U 0 U 0.0 S/U 0.0 S/U 0 U 100.0 U 0: Alarm enable 1: Alarm inhibit Number of +10 PTNO operation constant 0 to 16 –– -10 to 110 % 0 to 999999 s BIN 16bit polygon points +12 +13 +14 +15 MV SV Manipulated value Set value Real number Real number 0: Hold type operation +16 TYPE Operation type (When operation mode is AUT or CAB) 1: Return type operation –– BIN 16bit (When operation mode is AUT or CAB) +18 +19 *1 *2 MH Output upper limit value -10 to 110 % Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 189 9.23 S.PGS Loop tag b15 S.PGS Specified position Symbol +20 +21 +22 +23 Loop tag +52 memory *2 +53 +54 +55 +84 +85 *1 *2 ML SV1 SV16 MV1 MV16 Recommended range *1 Name Output lower limit value Unit Data format -10 to 110 % 0 to 999999 s -10 to 110 % Real number Standard Set value by 0.0 U 0.0 U 0.0 U Setting time 1 Setting time Real number 16 Setting output 1 Setting output Real number 16 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) Output type The output type is determined by the combination of the operation mode (MODE) and operation type (TYPE) as indicated below. Operation mode (MODE) Operation type (TYPE) MAN, CMB, CMV, LCM, LCA, LCC AUT, CAB CAS, CCB, CSV Operation –– Operation stopped at current SV and MV 0 Hold type operation 1 Return type operation –– Cyclic type operation (2) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.PGS instruction. 1) BW retains the last value. 2) MHA and MLA of the alarm detection (ALM) are turned to 0. 3) The operation mode (MODE) is changed to MAN. 4) BB1 to BB3 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(3) SV count-up processing". 190 S.PGS (3) SV count-up processing SV count-up is performed with the following expression in each execution cycle. SV' = SV + 9 T (4) MVPGS operation Type Hold Return Mode Cyclic AUT, CAB SV < SV1 2 CAS, CCB, CSV MV1 MVPGS MVn - MVn-1 × (SV’ - SVn-1) + MVn-1 SVn - SVn-1 SVn-1 SV < SVn operation Mode change Processing when MAN MAN 3 Not moved SV Last value 0 0 MV Last value Last value MV1 SV' > SVn After SV is set, mode Restart method is changed from Mode is changed Automatic restart from MAN to AUT. MAN to AUT. 4 4 (5) Output processing Condition Manual Automatic MAN, CMB, CMV, LCM, LCA, LCC AUT, CAB, CAS, CCB, CSV BW BB2, MHA BB3, MLA BW BB2, MHA BB3, MLA MVPGS > MH MVn 0 0 MVn = MH 1 *1 0 MVPGS < ML MVn 0 0 MVn = ML 0 1 *2 Others MVn 0 0 MVn = MVPGS 0 0 *1 *2 6 7 When MHI or ERRI in the alarm detection inhibition (INH) is set to 1, MHA and BB2 show 0 since the alarm is prohibited. When MLI or ERRI in the alarm detection inhibition (INH) is set to 1, MLA and BB3 show 0 since the alarm is prohibited. 8 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the value of D2 is either a non-numeric or non-normalized number When PTNO < 0 or 16 < PTNO 191 9.23 S.PGS Error code S. SEL 9.24 S. SEL Loop Selector 9.24 S. SEL Ladder diagram Start contact S.SEL S.SEL S1 S2 D1 Structured ladder/FBD D2 S3 Structured text language S_SEL EN ENO s1 d1 s2 d2 ENO:=S_SEL(EN,s1,s2,d1,d2); s3 Input argument Output argument Setting EN : Execution condition : Bit S1 : Input data 1 start device : Real data type S2 : Operation constant start device : Array of any 16-bit data (0..5) S3 : Input data 2 start device : Real data type ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Loop tag memory start device : Array of any 16-bit data (0..127) Internal devices R, ZR J \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– S3 –– –– Word Bit Word Constant Other Function Provides an output in the specified mode (automatic mode/manual mode). • In the automatic mode, the input value 1 (E1) or input value 2 (E2) selected by the selection signal (e1) is output. • In the manual mode, the manipulated value (MV) is output. 192 S. SEL Set Data Block diagram 9 The processing block diagram of the S. SEL instruction is shown below. (The numerals (1) to (7) in the diagram indicate the order of the processing.) 2 RH, RL SLNO PV, PV1 to PV2 RH, RL NMAX, NMIN MV INH TRK 3 e1 (1) (2) Engineering value conversion E1 E2 (3) E1/E2 selection processing (4) Mode check Change rate, upper/lower limiter Alarm output processing 4 MAN or like (5) (3) RUN(SPA 0) Output conversion processing Alarm clear (6) Tracking processing BW 4 (7) STOP(SPA 1) Loop stop judgment All OFF BB1 6 OR 7 SPA MHA BB2 BB3 MLA 8 BB4 DMLA (7) MAN Loop stop processing 9.24 S. SEL MODE All OFF All OFF 193 S. SEL Set Data (1) Data specified in S. SEL instruction Specified position Input data S1 1 +0 +1 D1 +0 +1 Symbol Recommended range *1 Name E1 Input value 1 -999999 to 999999 % BW Output value (-999999 to 999999) –– BB BB1 Block +2 BB2 BB3 BB4 S2 +0 +1 +2 +3 +4 b12 b8 Output upper limit alarm Output change B B 1 –– number –– U –– S BIN 16bit –– S 100.0 U 0.0 U (0: Without alarm) (1: With alarm) rate alarm conversion -999999 to 999999 –– -999999 to 999999 –– Output conversion lower limit TRK Real by b0 B B B B B B 4 3 2 limit alarm Output lower b4 upper limit NMIN number Set value Alarm Output NMAX Real Standard –– b15 memory Unit Data format Tracking bit 0: Without tracking 1: With tracking b15 Real number Real number –– BIN 16it 0 U –– BIN 16bit 1EH U b0 Operation constant Input value selection 0: E1 1: E2 +5 SVPTN Set value pattern *2 Input value 1 (E1) used 0: Used 1: Not used *3 Input value 2 (E2) used 0: Used 1: Not used *4 Input value 1 (E1) pattern *5 0: E1 is upper loop MV 1: E1 is not upper loop MV Input value 2 (E2) pattern *6 0: E2 is upper loop MV 1: E2 is not upper loop MV *1 *2 *3 *4 *5 *6 194 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Select E1 or E2 for the input value. Specify whether the input value 1 (E1) is to be used or not. Specify whether the input value 2 (E2) is to be used or not. Specify whether the MV of the upper loop is to be used or not as the input value 1 (E1). Specify whether the MV of the upper loop is to be used or not as the input value 2 (E2). S. SEL Specified position Symbol Recommended range *1 Name Unit Data format Standard Set value by 8H S/U 0 to FFFFH D2 +1 MODE Operation b15 b12 b8 C S V mode b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M –– BIN 16bit 9 2 0 to FFFFH b15 +3 ALM b12 S P A Alarm b8 b4 D M L A detection b0 M M H L A A SPA 0: Loop RUN 1: Loop STOP –– BIN 16bit 3 4000H S/U DMLA, MHA, MLA (0: Without alarm) (1: With alarm) 4 0 to FFFFH Alarm +4 INH detection inhibition b15 b12 E R R I b8 b4 D M L I 4 b0 M M H L I I –– BIN 16bit 4000H S/U 6 0: Alarm enable 1: Alarm inhibit +10 +11 +12 +13 Loop tag memory *2 +14 +15 +16 +17 +18 +19 +21 +22 +23 +24 +25 MV PV1 PV2 MH ML Selection value Manipulated value Process value 1 Process value 2 Output upper limit value Output lower limit value RL to RH –– -10 to 110 % RL to RH –– RL to RH –– -10 to 110 % -10 to 110 % -999999 to 999999 –– -999999 to 999999 –– Engineering RH value upper limit Engineering RL value lower limit b15 +26 SLNO Selection No. Real number Real number Real number Real number Real number Real number Real number Real number 0.0 S 0.0 S/U 0.0 S 0.0 S 100.0 U 0.0 U 100.0 U 0.0 U 0 S 100.0 U 0.0 U b0 Input value 1 (E1) 0: Not selected 1: Selected –– BIN 16bit Input value 2 (E2) 0: Not selected 1: Selected +48 +49 Input data 2 S3 +0 +1 *1 *2 DML E2 Output change rate limit value Input value 2 0 to 100 % -999999 to 999999 % Real number Real number The data of the item where the recommended range values are indicated within the parentheses is stored by the system. The user cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 195 7 8 9.24 S. SEL +20 PV S. SEL Set Data contents Processing (1) Engineering value conversion Engineering value conversion is performed with the following expression. PVn RH RL En RL 100 (2) Input value 1 (E1) or input value 2 (E2) selection processing Whether the input value 1 (E1) or input value 2 (E2) will be used is selected depending on the e1 setting of the set value pattern (SVPTN). • e1 = 0: Input value 1 (E1) is used PV = PV1 • e1 = 1: Input value 2 (E2) is used PV = PV2 SLN0: The bit corresponding to the input value 1 (E1) or input value 2 (E2) is turned to 1. (3) Mode check The following processing is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM 1) "(5) Output conversion processing" is performed. 2) MHA, MLA and DMLA of the alarm detection (ALM) are turned to 0. 3) BB1 to BB4 of BB are turned to 0. (b) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC 1) Engineering value reverse conversion is performed with the following expression. T= 100 RH-RL (PV-RL) 2) "(4) Change rate, upper/lower limiter" is performed. (4) Change rate, upper/lower limiter Change rate and upper/lower limit value checks are performed on the input value 1 (E1) or input value 2 (E2). (a) Change rate limiter Condition T' BB4, DMLA |T - MVn| DML T' = T (T - MVn) > DML T' = MVn + DML 1 *1 (T - MVn) < - DML T' = MVn - DML 1 *1 *1 0 When DMLI or ERRI in the alarm detection inhibition (INH) is set to 1, DMLA and BB4 show 0 since the alarm is inhibited. (b) Upper/lower limiter BB2, MHA BB3, MLA T' > MH Condition MVn = MH 1 *2 0 T' < ML MVn = ML 0 1 *3 ML T' MH MVn = T' 0 0 *2 *3 196 MV When MHI or ERRI in the alarm detection inhibition (INH) is set to 1, MHA and BB2 show 0 since the alarm is inhibited. When MLI or ERRI in the alarm detection inhibition (INH) is set to 1, MLA and BB3 show 0 since the alarm is inhibited. S. SEL (5) Output conversion processing Engineering value conversion is performed with the following expression. BW NMAX NMIN 100 9 MVn NMIN (6) Tracking processing (a) When all of the following conditions hold, the operation result is output to the input value 1 (E1) or input value 2 2 (E2). 1) The operation mode (MODE) is any of MAN, CMB, CMV and LCM. 3 2) The tracking bit (TRK) is 1. En = MVn (b) When all of the following conditions hold, the operation result is output to the input value 1 (E1) or input value 2 (E2). 4 1) The operation mode (MODE) is any of AUT, CAS, CAB, CCB, CSV, LCA and LCC. 2) The tracking bit (TRK) is 1. 4 3) BB1 of BB is 1 En = MVn (7) Loop stop processing 6 (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S.SEL instruction. 1) BW retains the last value. 7 2) DMLA, MHA and MLA of the alarm detection (ALM) are turned to 0. 3) The operation mode (MODE) is changed to MAN. 8 4) BB1 to BB4 of BB are turned to 0. (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(1) Engineering value conversion ". In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , D1 , S2 , D2 are either a non-numeric or non- 197 9.24 S. SEL Operation Error S.BUMP 9.25 S.BUMP Bumpless Transfer 9.25 S.BUMP Ladder diagram Start contact S.BUMP S.BUMP S1 D1 Structured ladder/FBD S2 D2 Structured text language S_BUMP EN Input argument Output argument Setting d1 s2 d2 Bit ENO:=S_BUMP(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..4) S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Local work memory start device : Array of real data type (0..1) Internal devices data ENO s1 Word R, ZR J Bit \ Word U Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other Function Brings the output value (BW) closer to the output set value (E1) from the output control value (E2) at the fixed rate when the operation mode is switched from the manual mode to the automatic mode. Brings the output value (BW) closer to the output set value (E1) with a primary delay when the output value (BW) falls within the range specified as the delay zone (a) relative to the output set value (E1). 198 S.BUMP Set Data 9 (1) Data specified in S. BUMP instruction Specified position S1 Input data Block memory D1 S2 Operation constant D2 Local work memory *2 *1 *2 Symbol Recommended range *1 Name Unit Data format Standard Set value by –– U +0 +1 E1 Output set value +2 +3 E2 Output control value -999999 to 999999 % Real number –– U +4 e1 Mode switching signal 0: Manual mode 1: Automatic mode –– BIN 16Bit –– U +0 +1 BW Output value (-999999 to 999999) % Real number –– S +0 +1 T Delay time 0 to 999999 s Real number 1.0 U +2 +3 a Delay zone 0 to 999999 % Real number 1.0 U +0 +1 Xq 1.0 +2 +3 Real number Xp Initial deviation value -999999 to 999999 % Real number Used by the system as a work area. –– 2 3 4 4 6 S 7 Deviation The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 8 (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. (1) Either of the following processings is performed depending on the mode select signal (e1) setting of the input data. (a) In the manual mode (e1 = 0), the output value (BW), initial deviation value (Xg) and deviation (Xp) are calculated with the following expressions. • BW = output control value (E2) • Xq = output control value (E2) - output set value (E1) • Xp = output control value (E2) - output set value (E1) (b) In the automatic mode (e1 = 1), the output value is calculated with the following expression. Condition Xp |Xp| a |Xp| > a Xp Xp' T Xq T Xp BW = E1 + Xp BW On the assumption that |Xp| • BW = E1 • Xp = Xp' However, when T T T T Xp' BW = E1 + Xp T |Xq| T On the assumption that |Xp| 10-4 • BW = E1 • Xp = Xp' T in the automatic mode, BW = E1, Xp = Xp' 199 9.25 S.BUMP Set Data contents Processing S.BUMP Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 200 When the values of normalized number S1 , S2 , D2 are either a non-numeric or non- QnPHCPU QnPRHCPU S.AMR 9.26 S.AMR Analog Memory 9.26 S.AMR 9 Ladder diagram 2 Start contact S.AMR S1 S.AMR Structured ladder/FBD D2 S2 D1 Structured text language 3 ENO:=S_AMR(EN,s1,s2,d1,d2); 4 S_AMR EN Input argument Output argument Setting d1 s2 d2 Bit 4 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..6) S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices data ENO s1 Word J R, ZR 7 \ Bit U Word Zn \G S1 –– –– D1 –– –– S2 –– –– D2 –– –– Constant Other 8 Special register SD1506 can be specified as a dummy device. 9.26 S.AMR *1 6 Function Increases or decreases the output value at the fixed rate. d1 1s E1 e1 E2 1s E3 d2 0 1 e2 1 0 t e3 1 201 S.AMR Set Data (1) Data specified in S.AMR instruction Specified position S1 +0 +1 +2 +3 +4 Input +5 data Symbol E1 Output addition value Unit Data format -999999 to 999999 –– -999999 to 999999 –– -999999 to 999999 –– Output E2 subtraction value E3 e1 +6 Recommended range *1 Name e2 Output set value number Real number Real number Set value by –– U –– U –– U –– U –– S 1.0 U 1.0 U Operation b15 select signal b12 b8 b4 b0 e 3 Output e 2 e 1 addition signal –– Output e3 Real Standard e1 e2 0: Manual mode 1: Automatic mode subtraction e3 0: Not added 1: Added BIN 16Bit 0: Not subtracted 1: Subtracted signal Block D1 +0 memory +1 S2 +0 Operation +1 constant +2 +3 *1 BW d1 d2 Output value Output upper limit value Output lower limit value (-999999 to 999999) –– 0 to 999999 –– 0 to 999999 –– Real number Real number Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing (1) Either of the following processings is performed depending on the settings of the operation select signal (e1), output addition signal (e2) and output subtraction signal (e3). (a) In the manual mode (e1 = 0), BW = E3. (b) In the automatic mode (e1 = 1), any of the operations in the following table is performed depending on the settings of the output addition signal (e2) and output subtraction signal (e3). e2 e3 1 0 0 1 1 1 0 0 BW BW = BW + |E1| × T On the assumption that d1 BW: BW = d1 BW = BW - |E2| × T On the assumption that BW d2: BW = d2 BW = BW Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 202 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.FG CHAPTER 10 COMPENSATION OPERATION 1 INSTRUCTIONS 10.1 S.FG 10 Function Generator 10.1 S.FG 3 Ladder diagram Start contact S.FG S.FG S1 D1 Structured ladder/FBD S2 4 D2 Structured text language S_FG EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_FG(EN,s1,s2,d1,d2); 6 EN : Execution condition S1 : Input data start device : Real data type S2 : Operation constant start device : Any 16-bit data ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Local work memory start device : Array of real data type (0..95) Internal devices R, ZR : Bit J \ U Zn \G Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word 8 Constant Other 10.1 S.FG data Word 7 Function In response to the input value (E1), outputs the value following the function generator pattern that consists of n pieces of polygon points specified as the operation constants. Y (X2,Y2) Output (BW) (X3,Y3) (X1,Y1) (X4,Y4) X Input (E1) 203 S.FG Set Data (1) Data specified in S.FG instruction Specified position Symbol +0 Input data S1 Block D1 +0 +1 Operation S2 constant +0 –– U BW Output value (-999999 to 999999) –– Real number –– S 0 to 48 –– 0 U -999999 to 999999 –– –– U SN +4 memory +7 +4SN-4 +4SN-3 +4SN-2 +4SN-1 *1 by Real number +3 +6 Set value –– +2 work Standard -999999 to 999999 +1 +5 Data format Input value D2 +0 Local Unit E1 +1 memory Recommended range *1 Name X1 Y1 X2 Y2 Xn Yn Number of polygon points BIN 16Bit Polygon point coordinates Polygon point coordinates Polygon point coordinates Polygon point Real number coordinates Polygon point coordinates Polygon point coordinates The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.FG instruction performs the following operation. Condition Output value (BW) E1 X1 BW = Y1 Xi-1 < E1 Xi (i = 2 to n) BW Xn < E1 BW = Yn Yi Xi Yi Xi 1 1 (E1 Xi 1) Yi 1 (2) When n = 0 there is no processing. (3) When Xi-1 > Xi, the value is cut off to n = i-1 (Data after that is ignored.) When there are multiple Yi for the same Xi, the lowest i is selected. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When (SN < 0) or (SN > 48) 204 QnPHCPU QnPRHCPU S.IFG 10.2 S.IFG Inverse Function Generator 10.2 S.IFG 1 Ladder diagram 10 Start contact S.IFG S.IFG S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_IFG(EN,s1,s2,d1,d2); 4 S_IFG EN Input argument Output argument Setting ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Any 16-bit data ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Local work memory start device : Array of real data type (0..95) Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Bit 6 Word Constant Other 8 In response to the input value (E1), outputs the value following the inverse function generator pattern that consists of n pieces of polygon points specified as the operation constants. Y (X3,Y3) (X4,Y4) (X2,Y2) Input (E1) (X1,Y1) Output (BW) X 205 10.2 S.IFG Function S.IFG Set Data (1) Data specified in S.IFG instruction Specified position Symbol +0 Input data S1 Block D1 +0 +1 Operation S2 constant +0 –– U BW Output value (-999999 to 999999) –– Real number –– S 0 to 48 –– 0 U -999999 to 999999 –– –– U SN +4 memory +7 +4SN-4 +4SN-3 +4SN-2 +4SN-1 *1 by Real number +3 +6 Set value –– +2 work Standard -999999 to 999999 +1 +5 Data format Input value D2 +0 Local Unit E1 +1 memory Recommended range *1 Name X1 Y1 X2 Y2 Xn Yn Number of polygon points BIN 16Bit Polygon point coordinates Polygon point coordinates Polygon point coordinates Polygon point Real number coordinates Polygon point coordinates Polygon point coordinates The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.IFG instruction performs the following operation. Condition Output value (BW) E1 Y1 BW=X1 Yi-1 < E1 Yi (i = 2 to n) BW Yn < E1 BW=Xn Xi Yi Xi Yi 1 1 (E1 Yi 1 ) Xi 1 (2) When n = 0 there is no processing. (3) When Yi-1 > Yi, the value is cut off to n = i-1 (Data after that is ignored.) When there are multiple Xi for the same Yi, the lowest i is selected. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , D2 are either a non-numeric or non-normalized When (SN < 0) or (SN > 48) 206 QnPHCPU QnPRHCPU S.FLT 10.3 S.FLT Standard Filter 10.3 S.FLT 1 Ladder diagram 10 Start contact S.FLT S.FLT S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_FLT(EN,s1,s2,d1,d2); 4 S_FLT EN Input argument Output argument Setting ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type : Array of any 16-bit data (0..2) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Local work memory start device : Array of any 16-bit data (0..103) Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Bit 6 Word Constant Other 8 Stores SN pieces of input values (E1) sampled at the data collection intervals (ST) into the dead time table, and outputs the average of those SN pieces of data. 207 10.3 S.FLT Function S.FLT Set Data (1) Data specified in S.FLT instruction Specified position Input data S1 +0 +1 D1 +0 +1 Symbol Recommended range *1 Name E1 Input value -999999 to 999999 –– BW Output value (-999999 to 999999) –– BB b15 +2 BB1 Real number Real number Standard Set value by –– U –– S –– S 1.0 U 0 U –– S –– S –– S –– S –– S –– –– –– S –– Block memory Unit Data format b12 b8 b4 b0 B B 1 Data sufficiency bit –– BIN 16Bit (0: Data sufficiency) (1: Data insufficiency) S2 Operation +0 +1 Data ST D2 +0 +1 SN memory *2 SN' +3 i +4 n1 +5 n2 +7 +8 +9 +10 +11 +2SN+6 +2SN+7 *1 *2 *3 Sampling count 0 to 48 –– collection –– interval +2 +6 s Last data ST' Local work 0 to 999999 interval constant +2 collection –– 1 2 SN Last sampling –– count Cycle Used by the system as a work area. counter*3 Number of –– stored data Store –– –– –– number BIN 16Bit Real number BIN 16Bit BIN 16Bit BIN 16Bit BIN 16Bit –– –– Dead time table 1 Dead time table 2 Used by the system as a work area. –– Real number Dead time table SN The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The cycle counter rounds off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. 208 –– Real S.FLT Set Data contents Processing 1 (1) The data update cycle is ST . (The decimal is rounded down.) T (2) The data sufficiency bit (BB1) turns to 0 when the dead time table is filled with SN pieces of data. 10 It turns to 1 when the dead time table is not filled. 3 • Until the dead time table is filled with data, the average of the data provided until then is output. • Processed using ST = n × T. (n is an integral) 4 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , S2 , D2 6 are either a non-numeric or non- 7 When (SN < 0) or (SN > 48) When the execution cycle < 0 When ST < 0 8 10.3 S.FLT 209 S.SUM 10.4 S.SUM Summation 10.4 S.SUM Ladder diagram Start contact S.SUM S.SUM S1 D1 Structured ladder/FBD S2 D2 Structured text language S_SUM EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_SUM(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) S2 : Operation constant start device : Array of any 16-bit data (0..4) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Word Bit Word Special register SD1506 can be specified as a dummy device. Function Integrates and outputs the input value (E1) when the integration start signal (e1) turns from 0 to 1. 210 Constant Other S.SUM Set Data 1 (1) Data specified in S.SUM instruction Specified position S1 +0 +1 Symbol E1 Recommended range *1 Name Input value -999999 to 999999 –– e Real number Standard Set value by –– U –– b15 Input data +2 Unit Data format b12 b8 b4 3 b0 e 1 Integration e1 –– start signal BIN 16Bit –– U –– S 0.0 U 0.0 U 1 U 0: Integration not executed 1: Integration executed Block D1 +0 memory +1 S2 +0 +1 +2 Operation +3 constant BW Output value Input ILC low cut value A Initial value (-999999 to 999999) –– -999999 to 999999 –– -999999 to 999999 –– 1: /Second +4 RANGE Input range 2: /Minute –– 3: /Hour *1 10 Real number Real number Real number BIN 16Bit 4 6 7 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. 8 (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as real numbers. Set Data contents Processing 10.4 S.SUM (1) The S.SUM instruction performs the following processing. e1 E1 0 –– 1 Output (BW) The initial value (A) of the operation constant is output. E1 ILC The last value is output unchanged. E1 > ILC BW E1 T T Last value (2) The T value used for the operation changes depending on the input range (RANGE) setting. • When RANGE = 1, T = 1 • When RANGE = 2, T = 60 • When RANGE = 3, T = 3600 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition QnPHCPU QnPRHCPU When an operation error occurs 4100 When the values of normalized number S1 , D1 , S2 are either a non-numeric or non- When the RANGE setting is other than 1 to 3 211 S.TPC 10.5 S.TPC Temperature/Pressure Correction 10.5 S.TPC Ladder diagram Start contact S.TPC S.TPC S1 D1 Structured ladder/FBD S2 D2 Structured text language S_TPC EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_TPC(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..6) S2 : Operation constant start device : Array of real data type (0..4) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Any 16-bit data Internal devices R, ZR J \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Word Bit Word Special register SD1506 can be specified as a dummy device. Function The input value (E1) is subject to temperature/pressure correction (temperature or pressure) and output. 212 Constant Other S.TPC Set Data 1 (1) Data specified in S.TPC instruction Specified position S1 Symbol +0 E1 +1 +2 E2 +3 +4 E3 +5 Input data Recommended range *1 Name Differential pressure Measurement temperature Measured -999999 to 999999 –– -999999 to 999999 –– -999999 to 999999 pressure –– e e1 b15 E2 use flag b12 b8 b4 D1 +0 memory BW +1 Set value by –– U –– U –– U Real number Real number Real number e 2 10 3 4 b0 e 1 –– e2 Standard –– +6 Block Unit Data format BIN –– U –– S 6 0.0 U 7 273.15 U 0.0 U 10332.0 U 16Bit 0: Unused 1: Used E3 use flag Output value (-999999 to 999999) –– -999999 to 999999 °C -999999 to 999999 °C -999999 to 999999 –– -999999 to 999999 –– Real number Design S2 +0 +1 TEMP temperatureT' (Engineering Real number value) +2 Operation B1 +3 constant Bias (Temperature) Real number Design +4 +5 PRES pressureP' (Engineering Real number 8 value) +7 *1 B2 Bias (Pressure) Real number The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.TPC instruction calculates the temperature/pressure correction value with the following expression. BW = E1 × A1 × A2 (2) A1 and A2 use the values calculated with the following expressions. Input E2 E3 Used Used Not used Used Used Not used Not used Not used A1 T' E2 A2 B1 B1 1.0 T' E2 B1 B1 1.0 E3 P' B2 B2 E3 P' B2 B2 1.0 1.0 213 10.5 S.TPC +6 S.TPC Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 214 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.ENG 10.6 S.ENG Engineering Value Conversion 10.6 S.ENG 1 Ladder diagram 10 Start contact S.ENG S.ENG S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_ENG(EN,s1,s2,d1,d2); 4 S_ENG EN Input argument Output argument Setting ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 10.6 S.ENG *1 Word 6 Function The input value (E1) is output by the engineering conversion. Input Value (E1) [ Output Value (BW) ] 100 80 4 3 ENG 20 0 t 4 1 (RH) (RL) 0 1 t 215 S.ENG Set Data (1) Data specified in S.ENG instruction Specified position Input data Block memory S1 D1 S2 Operation constant *1 Symbol Recommended range *1 Name Unit Data format Standard Set value by –– U +0 +1 E1 Input value -999999 to 999999 % Real number +0 +1 BW Output value (-999999 to 999999) –– Real number –– S +0 +1 RH Engineering value upper limit -999999 to 999999 –– Real number 100.0 U +2 +3 RL Engineering value lower limit -999999 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.ENG instruction performs the following operation. BW RH RL 100 E1 RL (E1 0 to 100%) Operation Error In the following cases, the error flag (SM) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 216 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.IENG 10.7 S.IENG Inverse Engineering Value Conversion 10.7 S.IENG 1 Ladder diagram 10 Start contact S.IENG S.IENG S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 ENO:=S_IENG(EN,s1,s2,d1,d2); 4 S_IENG EN Input argument Output argument Setting ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 10.7 S.IENG *1 Word 6 Function The input value (E1) is converted to % value and output. Input Value (E1) Output Value (BW) [m3/h] [ 20 16 5 0 IENG t ] 100 80 20 0 (RH) (RL) 25 0 t 217 S.IENG Set Data (1) Data specified in S.IENG instruction Specified Symbol Position Input data Block memory S1 D1 S2 Operation constant *1 Recommended range *1 Name Unit Data Standard Set format value by –– U +0 +1 E1 Input value -999999 to 999999 –– Real number +0 +1 BW Output value (-999999 to 999999) % Real number –– S +0 +1 RH Engineering value upper limit -999999 to 999999 –– Real number 100.0 U +2 +3 RL Engineering value lower limit -999999 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.IENG instruction performs the following operation. BW 100 RH RL (E1 RL) (%) (2) Make setting to satisfy RH > RL. (3) If RH RL, the processing is executed unchanged but engineering value reverse conversion is not performed. (4) If RH = RL, BW = 0. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 218 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.ADD CHAPTER 11 11.1 S.ADD ARITHMETIC OPERATION INSTRUCTIONS 1 2 Addition 11.1 S.ADD 11 Ladder diagram Start contact S.ADD S.ADD S1 D1 Structured ladder/FBD S2 D2 Structured text language S_ADD EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_ADD(EN,s1,s2,d1,d2); 6 EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..10) S2 : Operation constant start device : Array of any 16-bit data (0..12) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J \ U S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Bit Word Constant Other 11.1 S.ADD Bit Word 8 Zn \G data 7 Special register SD1506 can be specified as a dummy device. Function The input value (El to En) data is added by attaching a coefficient. 219 S.ADD Set Data (1) Data specified in S.ADD instruction Specification Symbol position Data Standard Set format value by –– U 0 to 5 –– -999999 to 999999 –– Real number –– U Output value (-999999 to 999999) –– Real number –– S n Number of coefficients 0 to 5 –– BIN 16Bit 0 U +1 +2 K1 Coefficient 1 +3 +4 K2 Coefficient 2 -999999 to 999999 –– Real number 1.0 U +2n-1 +2n Kn Coefficient n +2n+1 +2n+2 B Bias -999999 to 999999 –– Real number 0.0 U +0 n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 +2n-1 +2n En Input value n +0 +1 BW +0 Input data D1 S2 Operation constant *1 Unit BIN 16Bit S1 Block memory Recommended range*1 Name Input count The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.ADD instruction performs the following operation. BW = (K1 × E1) + (K2 × E2) … + (Kn × En) + B (2) When n is 0, BW = B. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number When not n = 0 to 5 220 S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.SUB 11.2 S.SUB Subtraction 11.2 S.SUB 1 Ladder diagram 2 Start contact S.SUB S.SUB S1 D1 Structured ladder/FBD S2 D2 Structured text language 11 S_SUB EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_SUB(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..10) S2 : Operation constant start device : Array of any 16-bit data (0..12) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 11.2 S.SUB *1 Word 6 Function The input value (E1 to En) data is subtracted by attaching a coefficient. 221 S.SUB Set Data (1) Data specified in S.SUB instruction Specification Symbol position Data Standard Set format value by –– U 0 to 5 –– -999999 to 999999 –– Real number –– U Output value (-999999 to 999999) –– Real number –– S n Number of coefficients 0 to 5 –– BIN 16Bit 0 U +1 +2 K1 Coefficient 1 +3 +4 K2 Coefficient 2 -999999 to 999999 –– Real number 1.0 U +2n-1 +2n Kn Coefficient n +2n+1 +2n+2 B Bias -999999 to 999999 –– Real number 0.0 U +0 n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 +2n-1 +2n En Input value n +0 +1 BW +0 Input data D1 S2 Operation constant *1 Unit BIN 16Bit S1 Block memory Recommended range*1 Name Input count The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.SUB instruction instructs the following operation. BW = (K1 × E1) - (K2 × E2) … - (Kn × En) + B (2) When n is 0, BW = B. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number When not n = 0 to 5 222 S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.MUL 11.3 S.MUL Multiplication 11.3 S.MUL 1 Ladder diagram 2 Start contact S.MUL S.MUL S1 D1 Structured ladder/FBD S2 D2 Structured text language 11 S_MUL EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_MUL(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..10) S2 : Operation constant start device : Array of any 16-bit data (0..12) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 11.3 S.MUL *1 Word 6 Function The input value (E1 to En) data is multiplied by attaching a coefficient. 223 S.MUL Set Data (1) Data specified in S.MUL instruction Specification Symbol position Data Standard Set format value by –– U 0 to 5 –– -999999 to 999999 –– Real number –– U Output value (-999999 to 999999) –– Real number –– S n Number of coefficients 0 to 5 –– BIN 16Bit 0 U +1 +2 K1 Coefficient 1 +3 +4 K2 Coefficient 2 -999999 to 999999 –– Real number 1.0 U +2n-1 +2n Kn Coefficient n +2n+1 +2n+2 B Bias -999999 to 999999 –– Real number 0.0 U +0 n +1 +2 E1 Input value 1 +3 +4 E2 Input value 2 +2n-1 +2n En Input value n +0 +1 BW +0 Input data D1 S2 Operation constant *1 Unit BIN 16Bit S1 Block memory Recommended range*1 Name Input count The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.MUL instruction performs the following operation. BW = (K1 × E1) × (K2 × E2) … × (Kn × En) + B (2) When n is 0, BW = B. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number When not n = 0 to 5 224 S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.DIV 11.4 S.DIV Division 11.4 S.DIV 1 Ladder diagram 2 Start contact S.DIV S.DIV S1 D1 Structured ladder/FBD S2 D2 Structured text language 11 S_DIV EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_DIV(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Array of real data type (0..1) S2 : Operation constant start device : Array of real data type (0..5) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 11.4 S.DIV *1 Word 6 Function Divides the input value 1 (E1) by the input value 2 (E2). 225 S.DIV Set Data (1) Data specified in S.DIV instruction Specification Symbol position Data Standard Set format value by –– U -999999 to 999999 –– Real number +0 +1 E1 +2 +3 E2 Input value 2 (Denominator) -999999 to 999999 –– Real number –– U +0 +1 BW Output value (-999999 to 999999) –– Real number –– S +0 +1 A Coefficient 1 -999999 to 999999 –– Real number 1.0 U +2 +3 K1 Coefficient 2 -999999 to 999999 –– Real number 1.0 U +4 +5 K2 Coefficient 3 -999999 to 999999 –– Real number 1.0 U +6 +7 B1 Bias 1 -999999 to 999999 –– Real number 0.0 U +8 +9 B2 Bias 2 -999999 to 999999 –– Real number 0.0 U +10 +11 B3 Bias 3 -999999 to 999999 –– Real number 0.0 U Input data D1 S2 Operation constant *1 Unit Input value 1 (Minute) S1 Block memory Recommended range*1 Name The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.DIV instruction performs the following operation. BW A K1 K2 E1 B1 E2 B2 B3 (2) When the denominator is 0, BW = B3. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 226 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.SQR 11.5 S.SQR Square Root 11.5 S.SQR 1 Ladder diagram 2 Start contact S.SQR S.SQR S1 D1 Structured ladder/FBD S2 D2 Structured text language 11 S_SQR EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_SQR(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Real data type S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Real data type D2 : Dummy device*1 : Real data type Internal devices R, ZR J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 11.5 S.SQR *1 Word 6 Function The of input value (El) is output. When the input value is negative, 0 is output. 227 S.SQR Set Data (1) Data specified in S.SQR instruction Specification Symbol position S1 Input data Block memory D1 S2 Operation constant *1 Recommended range*1 Name Unit Data Standard Set format value by –– U +0 +1 E1 Input value 0 to 999999 –– Real number +0 +1 BW Output value (0 to 999999) –– Real number –– S +0 +1 OLC Output low cut value 0 to 999999 –– Real number 0.0 U +2 +3 K Coefficient 0 to 999999 –– Real number 10.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.SQR instruction performs the following operation. BW K (E1) (2) When K (E1) 0LC, BW = 0. Also, when (E1 < 0), BW = 0. Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 228 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S.ABS 11.6 S.ABS Absolute Value 11.6 S.ABS 1 Ladder diagram 2 Start contact S.ABS S.ABS S1 D1 Structured ladder/FBD S2 D2 Structured text language 11 S_ABS EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_ABS(EN,s1,s2,d1,d2); EN : Execution condition : Bit S1 : Input data start device : Real data type device*1 S2 : Dummy ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices R, ZR : Real data type J 7 \ U Zn \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Bit Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 11.6 S.ABS *1 Word 6 Function The input value (E1) absolute value is output. Input (E1) 0 Output (BW) t ABS 0 t BB1 BB2 229 S.ABS Set Data (1) Data specified in S.ABS instruction Specification Symbol position Input data S1 D1 Recommended range*1 Name Unit value Set by E1 Input value -999999 to 999999 –– Real number –– U +0 +1 BW Output value (0 to 999999) –– Real number –– S –– BIN 16Bit –– S –– b15 b12 b8 b4 Judgment of input value (E1) sign +2 b0 B B 2 BB1 BB2 *1 Standard +0 +1 BB Block memory Data format When E1 When E1 When E1 0: BB1 0: BB2 0: BB1 1 1 BB2 B B 1 0 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) The S.ABS instruction performs the following operation. BW = |E1| (2) The sign of the input value 1 (E1) is judged and the result is output to BB1 and BB2. E1 Status BB1 BB2 E1 > 0 1 0 E1 < 0 0 1 E1 = 0 0 0 Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code 4100 230 Error definition When the value of S1 is either a non-numeric or non-normalized number QnPHCPU QnPRHCPU S. > CHAPTER 12 COMPARISON OPERATION 1 INSTRUCTIONS 12.1 S. > 2 Compare Greater Than 12.1 S. > 3 Ladder diagram StartContact S.> S.> S1 D1 Structured ladder/FBD S2 12 D2 Structured text language S_GT EN Input argument Output argument Setting ENO s1 d1 s2 d2 ENO:=S_GT(EN,s1,s2,d1,d2); 6 EN : Execution condition : Bit S1 : Input data start device : Array of real data type (0..1) S2 : Operation constant start device : Array of real data type (0..1) ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices R, ZR J \ U Zn \G Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– *1 Word Bit Word 8 Constant Other 12.1 S. > data 7 Special register SD1506 can be specified as a dummy device. Function Compares the input value 1 (E1) and input value 2 (E2) and outputs the result of comparison. 231 S. > Set Data (1) Data specified in S. > instruction Specified Symbol position S1 Input data D1 Recommended range *1 Name Data format Standard Set value by +0 +1 E1 Input value 1 -999999 to 999999 –– Real number –– U +2 +3 E2 Input value 2 -999999 to 999999 –– Real number –– U +0 +1 BW Output value (The same value as the input value 1 (E1) is stored) –– Real number –– S –– BIN 16Bit –– S BB Block memory Unit –– b15 +2 BB1 b12 b8 b4 b0 B B 1 Comparison output (The result of comparison between E1 and E2 is stored.) S2 Operation constant *1 +0 +1 K Set value -999999 to 999999 –– Real number 0.0 U +2 +3 HS Hysteresis 0 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Compares the input value 1 (E1) with the input value 2 (E2), and outputs the result of the comparison to BB1 of the block memory. Condition BB1 E1 > (E2 + K) 1 E1 (E2 + K - HS) 0 (E2 + K - HS) < E1 (E2 + K) Last value is output Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , S2 are either a non-numeric or non-normalized When the hysteresis value is negative 232 QnPHCPU QnPRHCPU S. < 12.2 S. < Compare Less Than 12.2 S. < 1 Ladder diagram 2 StartContact S.< S.< S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 S_LT EN Input argument Output argument Setting ENO:=S_LT(EN,s1,s2,d1,d2); ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Array of real data type (0..1) : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices R, ZR J U Zn \G Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 12.2 S. < *1 Bit 6 7 \ data Word 12 Function Compares the input value 1 (E1) and input value 2 (E2) and outputs the result of comparison. 233 S. < Set Data (1) Data specified in S. < instruction Specified Symbol position S1 Input data D1 Recommended range *1 Name Data format Standard Set value by +0 +1 E1 Input value 1 -999999 to 999999 –– Real number –– U +2 +3 E2 Input value 2 -999999 to 999999 –– Real number –– U +0 +1 BW Output value (The same value as the input value 1 (E1) is stored) –– Real number –– S –– BIN 16Bit –– S BB Block memory Unit –– b15 +2 BB1 b12 b8 b4 b0 B B 1 Comparison output (The result of comparison between E1 and E2 is stored.) S2 Operation constant *1 +0 +1 K Set value -999999 to 999999 –– Real number 0.0 U +2 +3 HS Hysteresis 0 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Compares the input value 1 (E1) with the input value 2 (E2), and outputs the result of the comparison to BB1 of the block memory. Condition BB1 E1 < (E2 + K) 1 E1 (E2 + K + HS) 0 (E2 + K) E1 < (E2 + K + HS) Last value is output Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , S2 are either a non-numeric or non-normalized When the hysteresis value is negative 234 QnPHCPU QnPRHCPU S. = 12.3 S. = Compare Equal Than 12.3 S. = 1 Ladder diagram 2 StartContact S.= S.= S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 S_EQ EN Input argument Output argument Setting ENO:=S_EQ(EN,s1,s2,d1,d2); ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Array of real data type (0..1) : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices R, ZR Zn U \G Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 12.3 S. = *1 Bit 6 7 J \ data Word 12 Function Compares the input value 1 (E1) and input value 2 (E2) and outputs the result of comparison. 235 S. = Set Data (1) Data specified in S. = instruction Specified Symbol position S1 Input data D1 Recommended range *1 Name *1 Set value by Input value 1 -999999 to 999999 –– Real number –– U +2 +3 E2 Input value 2 -999999 to 999999 –– Real number –– U +0 +1 BW Output value (The same value as the input value 1 (E1) is stored) –– Real number –– S –– BIN 16Bit –– S –– Real number 0.0 U +2 S2 Standard E1 –– b15 Operation constant Data format +0 +1 BB Block memory Unit BB1 +0 +1 K b12 b8 b4 b0 B B 1 Comparison output (The result of comparison between E1 and E2 is stored.) Set value -999999 to 999999 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Compares the input value 1 (E1) with the input value 2 (E2), and outputs the result of the comparison to BB1 of the block memory. Condition BB1 E1 = (E2 + K) 1 E1 0 (E2 + K) Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 236 When the values of number S1 , S2 are either a non-numeric or non-normalized QnPHCPU QnPRHCPU S. >= 12.4 S. >= Compare Greater Or Equal 12.4 S. >= 1 Ladder diagram 2 Start contact S.>= S.>= S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 S_GE EN Input argument Output argument Setting ENO:=S_GE(EN,s1,s2,d1,d2); ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Array of real data type (0..1) : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices R, ZR Zn U \G Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 12.4 S. >= *1 Bit 6 7 J \ data Word 12 Function Compares the input value 1 (E1) and input value 2 (E2) and outputs the result of comparison. 237 S. >= Set Data (1) Data specified in S. >= instruction Specification Symbol position S1 +0 Input +1 data +2 +1 Data format Standard Set value by Input value 1 -999999 to 999999 –– Real number –– U E2 Input value 2 -999999 to 999999 –– Real number –– U BW Output value –– Real number –– S –– S (The same value as the input value 1 (E1) is stored) BB –– Block b15 memory Unit E1 +3 D1 +0 Recommended range *1 Name +2 BB1 b12 b8 b4 b0 B B 1 Comparison output –– BIN 16Bit (The result of comparison between E1 and E2 is stored.) S2 +0 Operation +1 constant +2 +3 *1 K Set value -999999 to 999999 –– Real number 0.0 U HS Hysteresis 0 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Compares the input value 1 (E1) with the input value 2 (E2), and outputs the result of the comparison to BB1 of the block memory. Condition BB1 E1 (E2 + K) 1 E1 < (E2 + K - HS) 0 (E2 + K - HS) E1 < (E2 + K) Last value is output Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , S2 are either a non-numeric or non-normalized When the hysteresis value is negative 238 QnPHCPU QnPRHCPU S. <= 12.5 S. <= Compare Less Or Equal 12.5 S. <= 1 Ladder diagram 2 Start contact S.<= S.<= S1 D1 Structured ladder/FBD S2 D2 Structured text language 3 S_LE EN Input argument Output argument Setting ENO:=S_LE(EN,s1,s2,d1,d2); ENO s1 d1 s2 d2 EN : Execution condition : Bit S1 : Input data start device : Array of real data type (0..1) : Array of real data type (0..1) S2 : Operation constant start device ENO : Execution result : Bit D1 : Block memory start device : Array of any 16-bit data (0..2) D2 : Dummy device*1 : Real data type Internal devices R, ZR Zn U \G Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– Word Constant Other 8 Special register SD1506 can be specified as a dummy device. 12.5 S. <= *1 Bit 6 7 J \ data Word 12 Function Compares the input value 1 (E1) and input value 2 (E2) and outputs the result of comparison. 239 S. <= Set Data (1) Data specified in S. <= instruction Specification Symbol position S1 +0 Input +1 data +2 +3 D1 +0 +1 Recommended range *1 Name Data format Standard Set value by E1 Input value 1 -999999 to 999999 –– Real number –– U E2 Input value 2 -999999 to 999999 –– Real number –– U BW Output value –– Real number –– S –– S (The same value as the input value 1 (E1) is stored) BB –– Block b15 memory Unit +2 BB1 b12 b8 b4 b0 B B 1 Comparison output –– BIN 16Bit (The result of comparison between E1 and E2 is stored.) S2 +0 Operation +1 constant +2 +3 *1 K Set value -999999 to 999999 –– Real number 0.0 U HS Hysteresis 0 to 999999 –– Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. Set Data contents Processing (1) Compares the input value 1 (E1) with the input value 2 (E2), and outputs the result of the comparison to BB1 of the block memory. Condition BB1 E1 (E2 + K) 1 E1 > (E2 + K + HS) 0 (E2 + K) < E1 (E2 + K + HS) Last value is output Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the values of number S1 , S2 are either a non-numeric or non-normalized When the hysteresis value is negative 240 QnPHCPU QnPRHCPU CHAPTER 13 AUTO TUNING 1 Auto tuning is designed to make the initial setting of the PID constants. The auto tuning of the CPU module can be used for processes that can be approximated with a primary delay plus dead time represented by the following expression. 2 Example) Process with relatively slow response such as temperature adjustment 3 K -Ls 1+Ts e K: Gain, T: Time constant, L: Dead time, s: Laplace operator 4 Auto tuning can be used for the loop that uses the S. PID or S. 2PID instruction. 13 Auto tuning is performed in the ZN process: stepped response process of Ziegler and Nichols. [Outline of stepped response process] With no control operation being performed, change the manipulated value (MV) step by step and look how the process value (PV) varies. 1) When the manipulated value (MV) is changed step by step, the process value (PV) begins to vary slowly. 6 Soon, the PV will vary faster, then vary slowly again, and finally settle at a fixed value. 2) Draw a tangent line at the place where the process value (PV) varies fastest, and find the points of intersection A, B where this tangent line crosses the horizontal axis corresponding to the first process value ( process value ( 0) and last 7 1). This provides the equivalent dead time (L) and equivalent time constant (T) as shown below. 3) From the equivalent time constant (T) and maximum process value width (Y), calculate the maximum slope (response speed) R = Y/T. Apply the equivalent dead time (L) and maximum slope (R) to the Ziegler and Nichols' adjustment rule, and calculate the proportional gain Kp (P), integral constant TI (I) and derivative constant TD (D). Manipulated value for auto tuning AT1MV X Process value PV ( ) B 1 Maximum slope R (response speed) Y T Maximum measurement width Y A 0 Equivalent dead time L Equivalent time constant T Time (s) 241 8 Auto tuning procedure Start Since the PID constants are overwritten at completion of auto tuning, record the PID constants as required. Set the loop tag and operation constants necessary for auto tuning. Change the operation mode (MODE) of the tuning target loop to Manual (MAN). Make sure that the process of the tuning target is stable. (Adjust the MV so that the process is stabilized as required.) Disconnect the S.2PID/S.PID instruction of the tuning target loop and connect the S.AT1 instruction to where the S.2PID/S.PID instruction was located. Turn the auto tuning start signal (e1) to Start (1). (Auto tuning in execution) Auto Tuning Completed (BB16) turns to Completed (1) at end of auto tuning. Turn the auto tuning start signal (e1) to End (0). (Auto Tuning Completed (BB16) turns to Not completed (0).) Check the PID constants stored in the loop tag. Disconnect the S.AT1 instruction of the tuning target loop and connect the S.2PID/S.PID instruction to where the S.AT1 instruction was located. Make fine adjustment during normal operation. End 242 (1) Time chart from auto tuning start until normal completion Auto tuning start 1 Auto tuning start signal e1 Auto tuning completion 2 Auto tuning completion BB16 3 Various Alarm BB1 to BB8 Manipulated value MV MV MV + AT1STEPMV MV 4 PID constants are set. (2) Time chart from auto tuning start until stop due to alarm occurrence 13 Auto tuning start Auto tuning start signal e1 6 Auto tuning suspension Auto tuning completion BB16 7 Alarm Occurrence Various Alarm BB1 to BB8 Manipulated value MV MV MV + AT1STEPMV 8 MV PID constants are not set. 243 S. AT1 13.1 S. AT1 Auto tuning instruction 13.1 S. AT1 Ladder diagram Start contact S.AT1 S.AT1 S1 D1 Structured ladder/FBD S2 D2 D3 Structured text language S_AT1 EN ENO:=S_AT1(EN,s1,s2,d1,d2,d3); ENO s1 d1 s2 d2 d3 Input argument Output argument Setting EN : Execution condition : Bit S1 : Input data start device : Array of any 16-bit data (0..2) S2 : Operation constant start device : Any 16-bit data ENO : Execution result : Bit : Any 16-bit data D1 : Block memory start device D2 : Loop tag memory start device : Array of any 16-bit data (0..127) D3 : Local work memory start device : Array of any 16-bit data (0..21) Internal devices R, ZR J \ Zn U \G data Bit S1 –– –– D1 –– –– S2 –– –– D2 –– –– D3 –– –– Word Bit Word Function Performs auto tuning and makes the initial setting of the PID constants. 244 Constant Other S. AT1 Set Data 1 (1) Data specified in S. AT1 instruction Specified Symbol position S1 +0 +1 E1 Recommended range *1 Name Input value -999999 to 999999 b15 Input data +2 e1 b12 b8 b4 Unit Data format % Real number Standard Set value by –– U b0 e 1 Auto tuning –– start signal BIN 16bit 3 0 U 0: Stop/end 1: Start BB BB1 BB2 BB3 BB4 Block memory D1 +0 BB5 BB6 BB7 BB8 BB16 constant S2 +0 PN 4 –– Alarm 13 Input upper limit alarm Input lower limit alarm Output upper limit alarm Output lower b15 b12 b8 b4 B B B B B B B B 8 7 6 5 B B 16 B B B B 2 1 –– limit alarm Out time alarm Operation 6 b0 B B B B 4 3 BB16 (0: Incomplete) (1: Complete) BB1 to BB8 (0: Without alarm) (1: With alarm) BIN 16bit –– S 8 mode alarm Identification alarm Auto tuning completion Operation 0: Reverse operation mode 1: Forward operation –– BIN 16bit 0 U 8H S/U 4000H S/U 0 to FFFFH D2 +1 MODE Operation b15 b12 +3 ALM mode memory Alarm detection *2 +12 +13 +18 +19 +20 +21 *1 *2 MV MH ML Manipulated value Output upper limit value Output lower limit value b8 C S V b15 Loop tag 7 b12 S P A b4 b0 C C C C C A M L L L M C A M A U A C C C V B B B S T N C A M b8 H H A b4 –– 16bit b0 L P P L H L A A A –– SPA 0: Loop RUN 1: Loop STOP BIN HHA, LLA, PHA, PLA (0: Without alarm) (1: With alarm) BIN 16bit -10 to 110 % Real number 0.0 S/U -10 to 110 % Real number 100.0 U -10 to 110 % Real number 0.0 U The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) 245 13.1 S. AT1 Operation 2 S. AT1 Specified position Symbol D2 +52 P +53 +54 +56 Loop tag +71 memory *2 +72 +73 Integral constant Derivative D +57 +70 Gain I +55 constant AT1 manipulated MV value for AT1 AT1ST AT1 Unit 0 to 999999 –– 0 to 999999 s 0 to 999999 s -100 to 100 % Step STEP +74 Recommended range *1 Name Sampling cycle for AT1 Time-out time +75 TOUT1 for AT1 0 to 999999 Note that 0 to 999999 Note that 0 to 999999 Note that AT1ST T 32767 AT1TOUT1 T s 32767 s 32767 s Data Standard Set format value by 1.0 S/U 10.0 S/U 0.0 S/U 0.0 U 1.0 U 100.0 U 10.0 U –– S Real number Real number Real number Real number Real number Real number After +76 AT1 maximum +77 TOUT2 slope time-out AT1TOUT2 T Real number time for AT1 Local work memory *3 *1 *2 *3 D3 +0 –– System area Used by the system as a work area. –– –– +21 The data of the item(s) where the values within the recommended range are given in the parentheses are stored by the system. Users cannot set the data. The loop tag memory and loop tag past value memory occupy a total of 128 words. (Refer to Page 28, Section 3.3.1 for details.) The applications of the loop tag past value memory are indicated below. Specified position S3 contents +0 Sampling cycle counter initial preset flag +1 Sampling cycle counter*4 +2 Time-out time counter initial preset flag +3 Time-out time counter*4 +4 After maximum slope time-out time counter initial preset flag +5 After maximum slope time-out time counter*4 +6 Step manipulated value preset flag +7 Counter from auto tuning start +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 *4 Auto tuning start-time PV0 PVn-1 (Last process value) Maximum slope value Maximum slope-time counter Maximum slope-time PV R (Response speed) L (Equivalent dead time) When control is to be started from the initial status, the data must be cleared with the sequence program. The sampling cycle counter, time-out time counter, and after maximum slope time-out time counter round off the data to the nearest whole number. (2) Execution cycle ( T) Set the execution cycle in SD1500 and SD1501 as a real number. 246 S. AT1 Set Data contents Processing 1 (1) Start signal judgement processing Any of the following processings is performed depending on the statuses of the auto tuning start signal (e1) and auto tuning completed (BB16). e1 BB16 2 Processing BB1 to BB8 of BB are turned to 0. When the stepped manipulated value preset flag is 1, the following 0 0 3 processing is performed. MV = MV - AT1STEPMV The S. AT1 instruction is terminated. 1 0 0 1 1 1 4 "(2) Loop stop processing" is performed. BB16 of BB is turned to 0. The S. AT1 instruction is terminated. The S. AT1 instruction is terminated. 13 (2) Loop stop processing (a) Setting 1 in SPA of the alarm detection (ALM) selects a loop stop. A loop stop performs the following processing and terminates the S. AT1 instruction. 6 1) The auto tuning completed (BB16) is turned to 1. 2) When the stepped manipulated value preset flag is 1, the following processing is performed. 7 MV = MV - AT1STEPMV (b) Setting 0 in SPA of the alarm detection (ALM) selects a loop run. A loop run performs "(3) Mode judgement processing". 8 (3) Mode judgement processing Either of the following processings is performed depending on the operation mode (MODE) setting. (a) When the operation mode (MODE) is any of AUT, CAB, CAS, CCB, CSV, LCA and LCC, the following processing is performed and the S. AT1 instruction is terminated. 13.1 S. AT1 1) The operation mode alarm (BB7) is turned to 1. 2) The auto tuning completed (BB16) is turned to 1. 3) When the stepped manipulated value preset flag is 1, the following processing is performed. MV = MV - AT1STEPMV (b) When the operation mode (MODE) is any of MAN, CMB, CMV and LCM, "(4) Input check processing" is performed. (4) Input check processing Either of the following processings is performed depending on the alarm detection (ALM) setting. (a) If either of PHA and HHA of the alarm detection (ALM) is 1, the following processing is performed and the S. AT1 is terminated. 1) The input upper limit alarm (BB3) is turned to 1. 2) The auto tuning completed (BB16) is turned to 1. (b) If either of PLA and LLA of the alarm detection (ALM) is 1, the following processing is performed and the S. AT1 is terminated. 1) The input lower limit alarm (BB3) is turned to 1. 2) The auto tuning completed (BB16) is turned to 1. (5) Time-out judgement processing Whether the auto tuning processing has reached the AT1 time-out time (AT1TOUT1) or not is judged. (a) If the AT1 time-out time (AT1TOUT1) is reached, the following processing is performed and the S. AT1 is terminated. 1) The time-out alarm (BB6) is turned to 1. 2) The auto tuning completed (BB16) is turned to 1. (b) If the AT1 time-out time (AT1TOUT1) is not reached, "(6) After maximum slope time-out judgment processing" is performed. 247 S. AT1 (6) After maximum slope time-out judgment processing Whether the auto tuning processing has reached the AT1 after maximum slope time-out time (AT1TOUT2) or not is judged. However, if the after maximum slope time-out time counter initial preset flag is 0, the processing in (c) is performed. (a) If the AT1 after maximum slope time-out time (AT1TOUT2) is reached, "(10) Identification processing" is performed. (b) If the AT1 after maximum slope time-out time (AT1TOUT2) is not reached, "(7) Stepped manipulated value set processing" is performed. (c) If the after maximum slope time-out time counter initial preset flag is 0, "(7) Stepped manipulated value set processing" is performed. (7) Stepped manipulated value set processing Whether the stepped manipulated value is "set (1)" or "not set (0)" is judged from the stepped manipulated value preset flag. (a) If the stepped manipulated value preset flag is 0, the following processing is performed and the S. AT1 is terminated. 1) The AT1 stepped manipulated value (AT1STEPMV) is added to the manipulated value (MV). T1 = MV + AT1STEPMV In the upper/lower limiter, the following operation is performed and the result of the operation is output to BB4 and BB5. Result Condition T1 > MH BB4 1 BB5 0 Processing after upper/lower BB16 1 T1 < ML 0 1 1 ML T1 MH 0 0 0 limiter MV Original MV unchanged Original MV S. AT1 instruction is terminated. unchanged T1 The processing in 2) and later is performed. 2) The stepped manipulated value preset flag is turned to 1. 3) The counter from auto tuning start is cleared to 0. 4) The input value (E1) is stored into the auto tuning start-time PV0. 5) The input value (E1) is stored into the last process value (PVn-1). 6) The maximum slope value, maximum slope-time counter, maximum slope-time PV, response speed (R) and equivalent dead time (L) are cleared to 0. (b) If the stepped manipulated value preset flag is 1 "(8) Sampling cycle judgement processing" is performed. (8) Sampling cycle judgment processing Whether the sampling cycle is reached or not is judged from the AT1 sampling cycle (AT1ST). (a) If the sampling cycle is not reached, the S. AT1 instruction is terminated. (b) If the sampling cycle is reached, "(9) Response waveform observation processing" is performed. 248 S. AT1 (9) Response waveform observation processing The following processing is performed for the input value (E1). 1 (a) Response waveform observation 1) The counter from auto tuning start is incremented. 2) The following processing is performed according to the input value (E1) and last process value (PVn-1). Reverse operation (PN = 0) T2 = E1 - PVn-1 Forward operation (PN = 1) 2 3) The input value (E1) is stored into the last process value (PVn-1). 3 (b) Maximum slope value Depending on the slope (T2), the following processing is performed and the S. AT1 instruction is terminated. 1) If reverse operation is performed (PN = 0) and AT1 stepped manipulated value (AT1STEPMV) 0 or forward operation is performed (PN = 1) and AT1 stepped manipulated value (AT1STEPMV) < 0 Condition 4 Processing • Maximum slope value = slope (T2) Maximum slope value slope (T2) 13 • Maximum slope-time counter = counter from auto tuning start • Maximum slope-time PV = input value (E1) • After maximum slope time-out count value is reset and count is restarted. Maximum slope value > Slope(T2) Maximum slope value remains unchanged from the last value. 2) If forward operation is performed (PN = 1) and AT1 stepped manipulated value (AT1STEPMV) 0 or reverse 6 operation is performed (PN = 0) and AT1 stepped manipulated value (AT1STEPMV) = 0 Condition Processing 7 • Maximum slope value = slope (T2) Maximum slope value Slope(T2) • Maximum slope-time counter = counter from auto tuning start • Maximum slope-time PV = input value (E1) 8 • After maximum slope time-out count value is reset and count is restarted. Maximum slope value < Slope(T2) Maximum slope value remains unchanged from the last value. (10) Identification processing Using the maximum slope value, the following processing is performed. 1) The response speed for calculation (R') and response speed (R) are calculated with the following expression. R' Maximum slope value(%) AT1ST(s) , R |R'| (/s) 100 2) If R = 0, the following processing is performed and the S. AT1 instruction is terminated. The identification alarm (BB8) is turned to 1. The auto tuning completed (BB16) is turned to 1. When the stepped manipulated value preset flag is 1, the following processing is performed. MV = MV - AT1STEPMV (b) Equivalent dead time 1) The segment (b) made by the Y axis and the equivalent dead time (L) provided when the tangent line is drawn at the response speed for calculation (R') are calculated with the following expression. b = (maximum slope-time PV) - R' × (maximum slope counter) × AT1ST L (Auto tuning start-time PV0)-b R' 2) If L 0, the following processing is performed and the S. AT1 instruction is terminated. The identification alarm (BB8) is turned to 1. The auto tuning completed (BB16) is turned to 1. When the stepped manipulated value preset flag is 1, the following processing is performed. MV = MV - AT1STEPMV 249 13.1 S. AT1 (a) Response speed S. AT1 (11) PID constant calculation processing The response speed (R), equivalent dead time (L) and AT1 stepped manipulated value (AT1STEPMV) are assigned to the adjustment rule to calculate the PID constants. (a) Control system The control system is selected according to the integral constant TI (I) and derivative constant TD (D). Integral constant TI (I) Derivative constant TD (D) TI 0 –– TI > 0 Control method Proportional control (P operation) only TD 0 PI control (PI operation) TD > 0 PID control (PID operation) (b) Adjustment rule The ZN process: adjustment rule based on the stepped response of Ziegler and Nichols is used. Control Rate example gain Kp (P) method Integral constant TI (I) Derivative constant TD (D) P 1 R L |AT1STEPMV| 100 0 0 PI 0.9 R L |AT1STEPMV| 100 3.33 × L 0 PID 1.2 R L |AT1STEPMV| 100 2×L 0.5 × L (c) PID constant storage The following processing is performed and the S. AT1 instruction is terminated. 1) The PID constants are stored into the gain (P), integral constant (I) and derivative constant (D). 2) The auto tuning completed (BB16) is turned to 1. 3) The AT1 stepped manipulated value (AT1STEPMV) is subtracted from the manipulated value (MV), and the result is stored into the manipulated value (MV). MV = MV - AT1STEPMV Operation Error In the following cases, the error flag (SM0) turns ON and the error code is stored in SD0. Error code Error definition When an operation error occurs 4100 When the value of S1 is either a non-numeric or non-normalized number When AT1ST < 0, AT1TOUT1 < 0 or AT1TOUT2 < 0 When the execution cycle (SD1500) < 0 250 QnPHCPU QnPRHCPU CHAPTER 14 ERROR CODES 1 This chapter describes the definitions of the errors that will occur in the CPU module and the compensation operation to be taken for the errors. 14.1 2 List of Error Codes 3 There is the following process control instruction error. Definition Applicable CPU module Error code 4 4100 4 When the operation target data is out of the recommended range When the operation target data is a non-numeric or non- QnPHCPU/QnPRHCPU normalized number When an error occurs midway through operation When the above error occurs, the following information is stored in SD1502 and SD1503. 14 • SD1502: Detailed error code that occurred in a process control instruction • SD1503: Processing number of the instruction that an error occurred 7 Codes of errors that occur in process control instructions (The corresponding error code is stored in SD1502.) Detailed error Error code Error definition code stored in Cause 8 Processing SD1502 There is either a non-numeric or non-normalized number. (The number is negative.) 4100 Numerical value error (The value is out of the range.) 2 constant, loop tag memory, loop tag 3 Tried to divide by 0. 4 5 An overflow occurred. 6 The value is not an integer. Set data, such as operation past value memory or execution Check/correct the set data. cycle, has a problem. 251 14.1 List of Error Codes Sign error 1 Processing numbers of each instruction (The number is stored in SD1503.) Processing numbers stored in SD1503 Instruction 1 2 3 S. IN Range check Input limiter Engineering value reverse conversion S. OUT1 Input addition processing Change rate, upper/lower limiter Reset windup Change rate, upper/lower limiter S. OUT2 S. DUTY Input addition processing Change rate, upper/lower limiter 4 Digital Filter Output conversion 5 6 7 8 Output conversion Reset windup S. BC Change rate check S. PSUM Integration Output value operation conversion Output ON time conversion S. PID Control cycle judgment SV setting processing Tracking processing Gain (Kp) operation PID operation Deviation check S. 2PID Control cycle judgment SV setting processing Tracking processing Gain (Kp) operation PID operation PID operation PID operation 1) *1 2) *2 3) *3 S. PIDP Control cycle judgment SV setting processing Tracking processing Gain (Kp) operation PIDP operation Deviation check Change rate, upper/ lower limiter Output conversion S. SPI Operation time monitor SV setting processing Tracking processing Gain (Kp) operation SPI operation Deviation check S. IPD Control cycle judgment SV setting processing Tracking processing Gain (Kp) operation IPD operation Deviation check S. BPI Control cycle judgment SV setting processing Tracking processing Gain (Kp) operation BPI operation Deviation check S. R Control cycle judgment Engineering value conversion Tracking processing Change rate limiter Ratio operation S. PHPL Engineering value reverse conversion Upper/lower limit check Change rate check Engineering value conversion Loop stop S. ONF2 Control cycle judgment SV setting processing Tracking processing MV compensation 2-position ON/ OFF control S. ONF3 Control cycle judgment SV setting processing Tracking processing MV compensation 3-position ON/ OFF control S. PGS Operation constant check SV count up MVPGS operation Output processing S. SEL Engineering value conversion Engineering value reverse conversion Change rate, upper/ lower limiter Output conversion S. AT1 Input check Step manipulated value set Sampling cycle judgment Identification processing PID constant calculation *1 *2 *3 Time out judgment Response waveform observation Indicates the operation processing of Bn or Cn. Indicates the operation processing of Dn. Indicates the operation processing of MV. Processing No. 1 is stored if an error occurs in the instruction that is not indicated in the above table. 252 Deviation check APPENDIX 1 Appendix 1 Program Example 2 In the following program, the operation mode at power-on is in manual mode. When X10 turns ON, the mode switches to automatic mode and the module starts PID control. 3 X10 0 MOVP H10 R1001 Changes operation mode to AUTO. MOVP H0 R1003 Changes Alarm Detection (ALM) to 0. SM402 CALL P0 5 8 10 12 14 16 21 X1 X2 X2 SET SM1500 Sets last value hold processing. RST SM1500 Resets last value hold processing. SET SM1501 Sets output value hold processing. RST SM1501 Resets output value hold processing. K1 T0 Match with the time set for the execution cycle. X0 T0 PLS M0 P1 6 A 8 M0 CALL P1 Jumps to P1 label when M0 is ON. RST T0 Changes T0 data to 0 when M0 turns ON. FEND Indicates the end of sequence program where SM402 is OFF. R0 Converts D0 value into real number and stores it into R0. 31 1 Jumps to P0 label when SM402 is ON. Appendix 1Program Example 24 X1 4 SM400 FLT D0 32 S.IN R0 R100 R200 R1000 EMOV R100 R20 S.PHPL R20 R120 R220 R1000 EMOV R120 R40 S.PID R40 R140 R240 R1000 R300 S.OUT1 R60 Sets each head device of S.IN instruction. Transfers R100 value of S.IN instruction to R20 of S.PHPL. Sets each head device of S.PHPL instruction. Transfers R120 value of S.PHPL instruction to R40 of S.PID. Sets each head device of S.PID instruction. EMOV R140 R60 Transfers R140 value of S.PID instruction to R60 of S.OUT1. R160 R260 R1000 Sets each head device of S.OUT1 instruction. INT R160 D1 Converts R160, R161 real number into binary. 253 81 RET End of subroutine program 82 FEND Main routine program end P0 83 SM400 EMOV E0.1 SD1500 Sets execution cycle to 0.1s. FMOV H0 R100 K100 Clears S.IN, S.PHPL. S.PID, S.OUT1 output values to 0. FMOV H0 R1000 K128 Clears loop tag to 0. MOV H1 R1000 MOV H8 R1001 MOV H7C7 R1002 MOV H0 R1003 MOV H0 R1004 EMOV E0 R1010 EMOV E0 R1012 EMOV E0 R1014 Default value setting of loop tag EMOV E0 R1016 EMOV E100 R1018 EMOV E0 R1020 EMOV E100 R1022 EMOV E0 R1024 EMOV E100 R1026 EMOV E0 R1028 EMOV E100 R1030 254 151 SM400 EMOV E0 R1032 1 EMOV E100 R1034 EMOV E0 R1036 2 EMOV E0.2 R1038 EMOV E0 R1040 EMOV E0 R1042 3 4 EMOV E100 R1044 EMOV E1 1 R1046 Default value setting of loop tag EMOV E100 R1048 6 EMOV E100 R1050 R1052 EMOV E10 R1054 EMOV E0 R1056 EMOV E0 R1058 EMOV E1 R1060 EMOV E0 R1062 A 8 Appendix 1Program Example EMOV E1 255 216 SM400 EMOV E100 R200 EMOV E0 R202 EMOV E100 R204 EMOV E0 R206 Operation constant setting of S.IN instruction EMOV E110 R208 EMOV E100 R210 EMOV E0 R212 EMOV E-10 R214 249 264 SM400 SM400 EMOV E8 R240 EMOV E2 R242 MOV H0 R244 MOV H0 R245 MOV H3 R246 Operation constant setting of S.PID instruction EMOV E100 R260 Operation constant setting of S.OUT1 instruction EMOV E0 256 R262 273 RET 274 END End of subroutine program Appendix 2 Loop Tag Memory List 1 Appendix 2.1 PID control (SPID), 2-degree-of-freedom PID control (S2PID), sample PI control (SSPI) 2 Data storage Instruction used Offset Item Name Recommended range Unit SPID S2PID +0 1 S. PHPL S. OUT1/S. DUTY ALM*1 Alarm detection 0 to FFFFH 4 INH*1 Alarm detection inhibition 0 to FFFFH –– –– S/U S/U S/U S/U –– –– 6 –– –– –– –– –– –– 7 –– –– –– –– –– –– 8 –– –– –– –– –– –– 9 –– –– –– –– –– –– 10 11 12 13 18 19 20 22 23 S. PHPL/S. PID/ 24 S. 2PID/S. SPI 25 26 27 28 29 30 31 32 33 PV Process value (RL to RH) –– S S MV Manipulated value -10 to 110 % S/U S/U SV Set value RL to RH –– U U DV Deviation (-110 to 110) % S S MH Output upper limit value -10 to 110 % U U ML Output lower limit value -10 to 110 % U U -999999 to 999999 –– U U -999999 to 999999 –– U U –– U U –– U U –– U U –– U U Engineering value upper RH limit Engineering value lower RL limit PH Upper limit alarm set value PL Lower limit alarm value HH LL 34 35 36 37 42 43 44 45 S. PID/S. 2PID/ 46 S. SPI 47 RL to RH PL < PH Upper upper limit alarm RL to RH value PH HH Lower lower limit alarm RL to RH value LL PL –– –– –– –– –– –– –– –– –– –– –– 0 to 1 –– U U 0 to 999999 % U U 0 to 999999 s U U 0 to 100 % U U 0 to 999999 s U (Set CT) U (Set ST) Filter coefficient 39 41 PL < PH –– 38 40 RL to RH HS CTIM DPL CT/ST Upper/lower limit alarm hysteresis Change rate alarm check time Change rate alarm value Control cycle/Operation time 257 3 4 1 6 A 8 Appendix 2Loop Tag Memory List Appendix 2.1PID control (SPID), 2-degree-of-freedom PID control (S2PID), sample PI control (SSPI) 21 S. 2PID/S. SPI S. PHPL –– –– S. PHPL/S. PID/ S. PHPL S/U –– 17 S. PHPL S/U –– –– –– S. SPI S. IN –– –– 16 S. PHPL –– –– –– S. PID/S. 2PID/ S. PHPL –– –– 5 15 S. PHPL 0 to FFFFH 3 S. SPI S. PHPL Operation mode –– –– 14 S. OUT1/S. DUTY MODE*1 –– 2 S. PID/S. 2PID/ S. OUT1/S. DUTY –– SSPI Data storage Instruction used Offset Item Name Recommended range Unit SPID S2PID S. OUT1/S.DUTY 48 49 S. PID/S. 2PID/ 50 S. SPI 51 S. PID/S. 2PID/ 52 S. SPI 53 S. PID/S. 2PID/ S. SPI/S. OUT1/ S. DUTY 54 55 S. PID/S. 2PID/ 56 S. SPI 57 S. PID/S. 2PID/ 58 S. SPI 59 S. PID/S. 2PID/ 60 S. SPI 61 S. PID/S. 2PID/ S. SPI/S. OUT1/S. DUTY S. 2PID S. 2PID S. DUTY *1 *2 258 62 63 DML Output change rate limit 0 to 100 % U U Deviation limit value 0 to 100 % U U P Gain 0 to 999999 –– U U I*2 Integral constant 0 to 999999 s U U 0 to 999999 s DVL D/STHT value Derivative constant/ Sample cycle (D Setting) U (STHT Setting) Gap width 0 to 100 % U U GG Gap gain 0 to 999999 –– U U MV inside operation value (-999999 to 999999) % S S 0 to 1 –– U –– 0 to 1 –– U –– s U –– MVP 2Degree-of-freedom 65 parameter 66 2Degree-of-freedom 67 parameter 69 U GW 64 68 SSPI CTDUTY Control output cycle MODE, ALM, and INH are shared among the instructions. The following instructions share the same value in I. • S. PID instruction and S. OUT1 instruction • S. PID instruction and S. DUTY instruction • S. 2PID instruction and S. OUT1 instruction • S. 2PID instruction and S. DUTY instruction • S. SPI instruction and S. OUT1 instruction 0 to 999999 Appendix 2.2 Instruction used Item Name Recommended range Unit +0 –– –– –– –– –– –– –– S/U S/U –– –– –– S. IPD/S. BPI –– 3 ALM*1 S. OUT1 S. OUT1 S/U –– –– –– –– –– –– –– –– –– –– –– –– 8 –– –– –– –– –– –– 9 –– –– –– –– –– –– 10 11 12 13 14 16 17 18 19 20 21 27 28 29 30 31 32 33 Process value (RL to RH) –– S S MV Manipulated value -10 to 110 % S/U S/U SV Set value RL to RH –– U U DV Deviation (-110 to 110) % S S MH Output upper limit value -10 to 110 % U U ML Output lower limit value -10 to 110 % U U -999999 to 999999 –– U U -999999 to 999999 –– U U –– U U –– U U –– U U –– U U Engineering value upper RH limit Engineering value lower RL limit PH Upper limit alarm set value PL Lower limit alarm value HH LL 35 36 37 42 43 44 45 46 47 RL to RH PL < PH Upper upper limit alarm RL to RH value PH HH Lower lower limit alarm RL to RH value LL PL –– –– –– –– –– –– –– –– –– –– –– 0 to 1 –– U U 0 to 999999 % U U 0 to 999999 s U U Filter coefficient 39 41 PL < PH –– 38 40 RL to RH HS CTIM Upper/lower limit alarm hysteresis Change rate alarm check time DPL Change rate alarm value 0 to 100 % U U CT Control cycle 0 to 999999 s U U 259 2 3 4 1 6 A 8 Appendix 2Loop Tag Memory List Appendix 2.2I-PD control (SIPD), blend PI control (SBPI) 26 PV 34 S. IPD/S. BPI S/U S/U 7 25 S. PHPL S/U –– 6 24 S. PHPL –– 0 to FFFFH –– S. BPI S. PHPL 0 to FFFFH Alarm detection inhibition –– S. PHPL/S. IPD/ S. IN Alarm detection –– 23 S. PHPL –– –– S. BPI S. PHPL –– –– 22 S. PHPL 0 to FFFFH SBPI –– S. PHPL/S. IPD/ S. PHPL INH *1 Operation mode SIPD 5 15 S. IPD/S. BPI MODE*1 2 4 S. OUT1 1 Data storage Offset 1 S. PHPL I-PD control (SIPD), blend PI control (SBPI) Instruction used Offset 48 S. OUT1 49 50 S. IPD/S. BPI 51 52 S. IPD/S. BPI 53 S. IPD/S. BPI 54 S. OUT1 55 56 S. IPD/S. BPI 57 58 S. IPD/S. BPI 59 60 S. IPD/S. BPI 61 S. IPD/S. OUT1 *1 *2 260 62 63 Item DML Name Output change rate limit value Recommended range Unit Data storage SIPD SBPI 0 to 100 % U U DVL Deviation limit value 0 to 100 % U U P Gain 0 to 999999 –– U U I*2 Integral constant 0 to 999999 s U U Derivative constant/ D:0 to 999999 s U –– DV cumulative value SDV:-999999 to 999999 % –– S GW Gap width 0 to 100 % U U GG Gap gain 0 to 999999 –– U U MVP MV inside operation value (-999999 to 999999) % S –– D/SDV MODE, ALM, and INH are shared among the instructions. The following instructions share the same value in I. • S. IPD instruction and S. OUT1 instruction • S. BPI instruction and S. OUT1 instruction Appendix 2.3 Manual output (SMOUT), monitor (SMON) 1 Instruction used Offset Item Name Setting/Store range Unit +0 –– –– –– –– –– –– –– S/U S/U 1 S. PHPL S. MOUT MODE*1 –– –– –– –– ALM*1 Alarm detection 0 to FFFFH –– S/U S/U 4 INH*1 Alarm detection inhibition 0 to FFFFH –– –– S/U –– –– –– –– –– –– –– –– –– –– –– –– 7 –– –– –– –– –– –– 8 –– –– –– –– –– –– 9 –– –– –– –– –– –– 10 11 12 13 PV Process value (RL to RH) –– –– S MV Manipulated value -10 to 110 % U –– 18 19 20 21 S. PHPL 22 23 24 25 26 27 28 29 30 31 32 33 –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– -999999 to 999999 –– –– U -999999 to 999999 –– –– U –– –– U –– –– U –– –– U –– –– U Engineering value upper RH limit Engineering value lower RL limit PH PL LL 35 36 37 S. PHPL S. PHPL 40 41 42 43 44 45 46 47 *1 RL to RH PL < PH Upper upper limit alarm RL to RH value PH HH Lower lower limit alarm RL to RH value LL PL –– –– –– –– –– –– –– –– –– –– –– 0 to 1 –– –– U 0 to 999999 % –– U 0 to 999999 s –– U 0 to 100 % –– U –– –– –– Filter coefficient 39 S. PHPL PL < PH –– 38 S. IN RL to RH value Lower limit alarm value HH 34 Upper limit alarm set Upper/lower limit alarm HS hysteresis CTIM DPL –– Change rate alarm check time Change rate alarm value –– –– MODE, ALM, and INH are shared among the instructions. 261 2 3 4 1 6 A 8 Appendix 2Loop Tag Memory List Appendix 2.3Manual output (SMOUT), monitor (SMON) S. PHPL –– 6 17 S. PHPL –– 5 16 S. PHPL 0 to FFFFH SMON 3 15 S. PHPL Operation mode SMOUT 2 14 S. PHPL Data storage Appendix 2.4 Manual output with monitor (SMWM), PIDP control (SPIDP) Instruction used Item Name Recommended range Unit +0 –– –– –– –– –– –– –– S/U S/U 1 S. PHPL S. MOUT/S. PIDP S. PIDP S. PIDP S. PIDP S. PHPL/S. PIDP S. PHPL/S. PIDP S. PHPL S. PHPL S. PHPL S. PHPL *1 MODE –– ALM*1 Alarm detection 0 to FFFFH 4 INH*1 Alarm detection inhibition 0 to FFFFH S. PIDP 262 –– –– –– –– S/U S/U –– S/U S/U –– –– –– –– –– 6 –– –– –– –– –– –– 7 –– –– –– –– –– –– 8 –– –– –– –– –– –– 9 –– –– –– –– –– –– 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 PV Process value (RL to RH) –– S S MV Manipulated value -10 to 110 % U S/U SV Set value RL to RH –– –– U DV Deviation (-110 to 110) % –– S MH Output upper limit value -10 to 110 % –– U ML Output lower limit value -10 to 110 % –– U -999999 to 999999 –– U U -999999 to 999999 –– U U –– U U –– U U –– U U –– U U Engineering value upper RH limit Engineering value lower RL limit PH Upper limit alarm set value PL Lower limit alarm value HH LL 37 S. PHPL –– SPIDP –– 36 S. PHPL –– SMWM 5 35 S. PHPL 0 to FFFFH 3 34 S. IN Operation mode 2 15 S. PIDP Data storage Offset 42 43 44 45 46 47 RL to RH PL < PH Upper upper limit alarm RL to RH value PH HH Lower lower limit alarm RL to RH value LL PL –– –– –– –– –– –– –– –– –– –– –– 0 to 1 –– U U 0 to 999999 % U U 0 to 999999 s U U Filter coefficient 39 41 PL < PH –– 38 40 RL to RH HS CTIM Upper/lower limit alarm hysteresis Change rate alarm check time DPL Change rate alarm value 0 to 100 % U U CT Control cycle 0 to 999999 s –– U Instruction used S. PIDP S. PIDP S. PIDP S. PIDP S. PIDP S. PIDP S. PIDP *1 Offset 48 49 50 51 52 53 54 55 56 57 58 59 60 61 Item DML Name Output change rate limit value Recommended range Unit Data storage SMWM SPIDP 0 to 100 % –– U DVL Deviation limit value 0 to 100 % –– U P Gain 0 to 999999 –– –– U I Integral constant 0 to 999999 s –– U D Derivative constant 0 to 999999 s –– U GW Gap width 0 to 100 % –– U GG Gap gain 0 to 999999 –– –– U 1 2 3 4 1 MODE, ALM, and INH are shared among the instructions. 6 A 8 Appendix 2Loop Tag Memory List Appendix 2.4Manual output with monitor (SMWM), PIDP control (SPIDP) 263 Appendix 2.5 2 position ON/OFF control (SONF2), 3 position ON/OFF control (SONF3) Instruction used Item Name Recommended range Unit +0 –– –– –– –– –– –– –– S/U S/U –– –– –– 1 –– 3 ALM*1 S.ONF2/S.ONF3 –– –– –– –– 7 –– –– –– –– –– –– 8 –– –– –– –– –– –– 9 –– –– –– –– –– –– 12 13 14 16 17 18 19 27 28 29 30 31 32 33 PV Process value (RL to RH) –– S S MV Manipulated value -10 to 110 % S/U S/U SV Set value RL to RH –– U U DV Deviation (-110 to 110) % S S HSO Hysteresis 0 to 999999 –– U U HS1 Hysteresis 0 to 999999 –– –– U -999999 to 999999 –– U U -999999 to 999999 –– U U –– U U –– U U –– U U –– U U limit Engineering value lower RL limit PH PL LL 36 37 41 42 S.PHPL 43 44 S.PHPL 45 S.ONF2/S.ONF3 *1 46 47 PL < PH RL to RH PL < PH Upper upper limit alarm RL to RH value PH HH Lower lower limit alarm RL to RH value LL PL –– –– –– –– –– –– –– –– –– –– –– 0 to 1 –– U U 0 to 999999 % U U 0 to 999999 s U U Filter coefficient 39 40 RL to RH value –– 38 S.PHPL Upper limit alarm set Lower limit alarm value HH 35 264 Engineering value upper RH 34 S.IN S/U –– 26 S.PHPL S/U S/U –– 25 S.PHPL S/U –– –– 24 S.PHPL –– 0 to FFFFH –– 23 S.PHPL 0 to FFFFH Alarm detection inhibition –– 22 S.PHPL Alarm detection –– 21 S.PHPL –– –– 20 S.ONF3 –– –– 15 S.ONF2/S.ONF3 0 to FFFFH SONF3 6 11 S.ONF2/S.ONF3 INH *1 Operation mode SONF2 5 10 S.ONF2/S.ONF3 MODE*1 2 4 S.PHPL Data storage Offset HS CTIM Upper/lower limit alarm hysteresis Change rate alarm check time DPL Change rate alarm value 0 to 100 % U U CT Control cycle 0 to 999999 s U U MODE, ALM, and INH are shared among the instructions. Appendix 2.6 Batch counter (SBC) 1 Instruction used Offset Item Name Recommended range Unit +0 –– –– –– –– –– –– S/U 1 S. PSUM –– –– –– Alarm detection 0 to FFFFH –– S/U 4 INH*1 Alarm detection inhibition 0 to FFFFH –– S/U –– –– –– –– –– 6 –– –– –– –– –– 7 –– –– –– –– –– 8 –– –– –– –– –– 9 –– –– –– –– –– (0 to 2147483647) –– S (0 to 2147483647) –– S 10 12 13 17 SUM1 SUM2 U SV2 Set value 2 0 to 2147483647 –– U 22 23 24 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 S. BC 45 46 47 *1 –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– U Upper limit alarm set PH value 0 to 2147483647 –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– –– s U –– U –– –– CTIM DPL –– Change rate alarm check time Change rate alarm value –– 0 to 999999 0 to 2147483647 –– 2 3 4 1 6 A 8 Appendix 2Loop Tag Memory List Appendix 2.6Batch counter (SBC) 25 29 part) –– 21 28 Integration value (Fraction 0 to 2147483647 20 27 part) Set value 1 19 26 Integration value (Integer SV1 18 S. BC –– 5 16 S. BC –– 0 to FFFFH ALM*1 15 S. BC Operation mode 3 14 S. BC MODE*1 SBC 2 11 S. PSUM Data storage MODE, ALM, and INH are shared among the instructions. 265 Appendix 2.7 Instruction used Item Name Recommended range Unit +0 –– –– –– –– –– –– S/U –– –– S. R S. R S. OUT2 S. OUT2 S. PHPL S. PHPL S. PHPL S. PHPL S. PHPL S. PHPL MODE*1 2 –– 3 *1 4 S. OUT2 ALM INH *1 S. R 266 –– Alarm detection 0 to FFFFH –– S/U Alarm detection inhibition 0 to FFFFH –– S/U –– –– –– –– –– –– –– –– –– 7 –– –– –– –– –– 8 –– –– –– –– –– 9 –– –– –– –– –– 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 PV Process value (RL to RH) –– S MV Manipulated value -10 to 110 % S/U SPR Set value -999999 to 999999 –– U BIAS Bias -999999 to 999999 % U MH Output upper limit value -10 to 110 % U ML Output lower limit value -10 to 110 % U -999999 to 999999 –– U -999999 to 999999 –– U –– U –– U –– U –– U Engineering value upper RH limit Engineering value lower RL limit PH PL LL 42 43 44 45 46 47 PL < PH RL to RH PL < PH Upper upper limit alarm RL to RH value PH HH Lower lower limit alarm RL to RH value LL PL –– –– –– –– –– –– –– –– –– 0 to 1 –– U 0 to 999999 % U 0 to 999999 s U Filter coefficient 39 41 RL to RH value –– 38 40 Upper limit alarm set Lower limit alarm value HH 37 S. PHPL –– –– 36 S. PHPL 0 to FFFFH 6 35 S. PHPL Operation mode SR 5 34 S. IN Data storage Offset 1 S. PHPL Ratio control (SR) HS CTIM Upper/lower limit alarm hysteresis Change rate alarm check time DPL Change rate alarm value 0 to 100 % U CT Control cycle 0 to 999999 s U Instruction used S. OUT2 Offset 48 49 50 S. R 51 52 S. R 53 54 S. R 55 56 S. R 57 *1 Item DML Name Output change rate limit value Recommended range Unit Data storage SR 0 to 100 % U DR Change rate limit value 0 to 999999 –– U RMAX Ratio upper limit value -999999 to 999999 –– U RMIN Ratio lower limit value -999999 to 999999 –– U Rn Ratio current value (-999999 to 999999) –– S 1 2 3 4 MODE, ALM, and INH are shared among the instructions. 1 6 A 8 Appendix 2Loop Tag Memory List Appendix 2.7Ratio control (SR) 267 Appendix 3 Operation Processing Time Appendix 3.1 Operation processing time of each instruction The operation processing time of each instruction is indicated in the table on this page and later. Since the operation processing time changes depending on the setting conditions, refer to the value in the table as the guideline of the processing time. Instruction Condition Processing time(µs) S.IN Condition where ALM does not turn ON during loop run 69 S.OUT1 Condition where ALM does not turn ON during loop run in AUT mode 47 S.OUT2 Condition where ALM does not turn ON during loop run in AUT mode 37 S.MOUT Executed during loop run in MAN mode 27 S.DUTY S.BC S.PSUM Execution cycle = 1, Control output cycle = 10 Condition where ALM does not turn ON during loop run in AUT mode Condition where ALM does not turn ON during loop run in AUT mode Integration start signal = ON Integration hold signal = OFF 55 29 23 Set value pattern = 3(Without cascade) Tracking bit = 0 S.PID Execution cycle = Control cycle = 1 Integral constant 0 Derivative constant 104 0 Condition where ALM does not turn ON during loop run in AUT mode Set value pattern = 3(Without cascade) Tracking bit = 0 S.2PID Execution cycle = Control cycle = 1 Integral constant 0 Derivative constant 136 0 Condition where ALM does not turn ON during loop run in AUT mode Set value pattern = 3(Without cascade) Tracking bit = 0 S.PIDP Execution cycle = Control cycle = 1 Integral constant 0 Derivative constant 119 0 Condition where ALM does not turn ON during loop run in AUT mode Set value pattern = 3(Without cascade) Tracking bit = 0 S.SPI Operating time = Sample cycle (ST = STHT) Integral constant 87 0 Condition where ALM does not turn ON during loop run in AUT mode Set value pattern = 3(Without cascade) Tracking bit = 0 S.IPD Execution cycle = Control cycle = 1 Integral constant Derivative constant 0 0 Condition where ALM does not turn ON during loop run in AUT mode 268 101 Instruction Condition Processing time(µs) Set value pattern = 3(Without cascade) 1 Tracking bit = 0 S.BPI Execution cycle = Control cycle = 1 Integral constant 75 0 Condition where ALM does not turn ON during loop run in AUT mode 2 Set value pattern = 3(Without cascade) S.R Tracking bit = 0 Execution cycle = Control cycle = 1 58 3 Executed during loop run in AUT S.PHPL S.LLAG S.I S.D Condition where ALM does not turn ON during loop run in AUT mode Input data = 50, With lead-lag guarantee Lead time = 1, Delay time = 1 Input data = 50, Integral time = 1 Output initial value = 0 Input data = 50, Derivative time = 1 Output initial value = 0 100 30 4 23 27 1 17 6 Input data = 50 Operation control signal 0 S.DED 1 Data collection interval = 1 Sampling count = 10 Output initial value = 0 Initial output switching = 0 S.HS S.LS S.MID S.AVE Input number = 5 Input data = 50, 100, 150, 200, 250 Input number = 5 Input data = 50, 100, 150, 200, 250 Input number = 5 Input data = 50, 100, 150, 200, 250 Input number = 2, Input data = 50, 100 A 29 32 8 69 24 Input data = 50 Lower limit value = 0 Appendix 3Operation Processing Time Appendix 3.1Operation processing time of each instruction Upper limit value = 100 S.LIMT 30 Upper limit hysteresis = 0 Lower limit hysteresis = 0 Input data = 50 Positive direction limit value = 100 S.VLMT1 Negative direction limit value = 100 38 Positive direction hysteresis = 0 Negative direction hysteresis = 0 Input data = 50 Positive direction limit value = 100 S.VLMT2 Negative direction limit value = 100 27 Positive direction hysteresis = 0 Negative direction hysteresis = 0 Input data = 10 Set value pattern = 3(Without cascade) S.ONF2 Tracking bit = 0 52 Execution cycle = Control cycle = 1 Executed during loop run in MAN mode Input data = 10 Set value pattern = 3(Without cascade) S.ONF3 Tracking bit = 0 59 Execution cycle = Control cycle = 1 Executed during loop run in MAN mode Input data = 50 S.DBND Dead band upper limit = 100, Dead band lower limit = 0 26 Input range = 1 269 Instruction Condition Processing time(µs) Number of operation constant polygon points = 16 Operation type = 0(Hold type) S.PGS Execution cycle = 1 86 Set value = 10 Condition where ALM does not turn ON during loop run in AUT mode Set value pattern = 18H(E1, E2 Used, Without cascade) S.SEL Tracking bit = 0 68 Condition where ALM does not turn ON during loop run in AUT mode Output set value = 0, Output control value = 50 S.BUMP Mode selection signal = 1 18 Delay time = 1, Delay zone = 1 Output addition value = 50, Output subtraction value = 50 S.AMR Output set value = 0, Output signal = 1 Output addition signal = 1, Output subtraction signal = 0 25 Output upper limit value = 50, Output lower limit value = 0 S.FG Input data = 50, Number of polygon points = 2 S.IFG Polygon coordinates (30, 40), (60, 70) S.FLT Input data = 50, Data collection interval = 1 Sampling count = 10 33 40 Input data = 50 S.SUM Input low cut value = 0, Initial value = 0 25 Input range = 1 Both temperature and pressure are corrected. Differential pressure = 100, Measurement temperature = 300 S.TPC Measured pressure = 10000, Design temperature = 0 Bias (Temperature) = 273.15 39 Design pressure = 0 Bias pressure = 10332.0 S.ENG Input data = 50, Engineering value upper limit = 100 S.IENG Engineering value lower limit = 0 S.ADD S.SUB S.MUL S.DIV S.SQR S.ABS S.> S.< S.= S.>= S.<= Input number = 2, Input data = 50, 100 Number of coefficients = 2, Coefficient = 1, 1, Bias = 0 Input number = 2, Input data = 50, 100 Number of coefficients = 2, Coefficient = 1, 1, Bias = 0 Input number = 2, Input data = 50, 100 Number of coefficients = 2, Coefficient = 1, 1, Bias = 0 Input data = 50, 100 Coefficient = 1, 1, 1, Bias = 0, 0, 0 Input data = 50 Output low cut value = 0, Coefficient = 10 Input data = 50 Input data = 50, 100 Set value = 0, Hysteresis = 0 Input data = 50, 100 Set value = 0, Hysteresis = 0 Input data = 50, 100 Set value = 0 Input data = 50, 100 Set value = 0, Hysteresis = 0 Input data = 50, 100 Set value = 0, Hysteresis = 0 25 25 26 24 27 34 17 22 19 18 22 19 Set value pattern = 3(Without cascade) S.AT1 Tracking bit = 0 Execution cycle = 1 Executed during loop run in MAN mode 270 67 Appendix 3.2 Operation processing time of 2-degree-of-freedom PID control loop 1 This section gives an example of the operation constant of each instruction and the processing times taken when actual values are stored into the loop tag memory. 2 (1) Conditions • Loop type: S2PID 3 • Used instructions: S.IN, S.PHPL, S.2PID, S.OUT1 (2) Operation constants (a) S.IN instruction Name Item 4 Setting Engineering conversion upper limit Engineering conversion lower limit EMAX EMIN 100.0 0.0 Input upper limit Input lower limit NMAX NMIN 100.0 0.0 Upper limit range error occurrence HH 95.0 Upper limit range error return Lower limit range error return H L 80.0 20.0 Lower limit range error occurrence LL 5.0 1 6 A (b) S.PHPL instruction: Without operation constant (c) S.2PID instruction Name Item Setting Derivative gain Deviation large alarm hysteresis MTD DVLS Operation mode Tracking bit PN TRK 0 0 Set value pattern SVPTN 3 Output conversion upper limit Output conversion lower limit Item NMAX NMIN Appendix 3Operation Processing Time Appendix 3.2Operation processing time of 2-degree-of-freedom PID control loop (d) S.OUT1 instruction Name 8 4.0 3.0 Setting 100.0 0.0 271 (3) Loop tag memory Offset Item Name Recommended range +0 –– –– –– +1 MODE +2 –– +3 +4 ALM INH Operation mode –– –– Alarm detection 0 to FFFFH Alarm detection inhibition 0 to FFFFH 0 10H 0 0 0 +5 +6 –– –– –– –– –– –– 0 0 +7 +8 –– –– –– –– –– –– 0 0 –– +9 +10 PV –– Process value RL to RH 0 0.0 +12 +14 MV SV Manipulated value Set value -10 to 110 RL to RH 0.0 55.0 +16 +18 DV MH Deviation Output upper limit value -110 to 110 -10 to 110 7 100.0 +20 +22 ML RH Output lower limit value Engineering value upper limit -10 to 110 -999999 to 999999 0.0 100.0 +24 +26 RL PH Engineering value lower limit Upper limit alarm set value -999999 to 999999 RL to RH 0.0 80.0 +28 +30 PL HH Lower limit alarm value Upper limit alarm value RL to RH RL to RH 20.0 90.0 +32 +34 LL Lower limit alarm value –– RL to RH 10.0 0 –– +36 +38 –– –– –– –– Filter coefficient 0 to 1 –– 0 0.0 +40 +42 HS CTIM Upper/lower limit alarm hysteresis Change rate alarm check time 0 to 999999 0 to 999999 3.0 8.0 +44 +46 DPL CT Change rate alarm value Control cycle 0 to 100 0 to 999999 30.0 1.0 +48 +50 DML DVL Output change rate limit value Deviation limit value 0 to 100 0 to 100 100.0 25.0 +52 +54 P I Gain Integral constant 0 to 999999 0 to 999999 3.0 8.0 +56 D Derivative constant 0 to 999999 5.0 +58 +60 GW GG Gap width Gap gain 0 to 100 0 to 999999 15.0 2.0 +62 +64 MVP MV inside operation value 2-degree-of-freedom parameter -999999 to 999999 0 to 1 0.25 0.0 2-degree-of-freedom parameter 0 to 1 1.0 +66 (4) Processing time (a) Processing times of used instructions Instruction S.IN For QnPHCPU 69µs S.PHPL 100µs S.2PID 136µs S.OUT1 47µs (b) Processing time of loop type Instruction S2PID 272 0 to FFFFH Setting For QnPHCPU 352µs INDEX 0 to 9 9 E 2-degree-of-freedom PID Control (S.2PID) . . . . . . . 98 2-position ON/OFF (S.ONF2) . . . . . . . . . . . . . . . . 173 3-position ON/OFF (S.ONF3) . . . . . . . . . . . . . . . . 179 10 Engineering Value Conversion (S.ENG) . . . . . . . .215 Execution cycle . . . . . . . . . . . . . . . . . . . . . . . . . . .34 11 F A Absolute Value (S.ABS) . . . . . . Addition (S.ADD) . . . . . . . . . . Alarm detection (ALM) . . . . . . . Alarm detection inhibition (INH) ALM(Alarm detection) . . . . . . . Analog Input Processing (S.IN) . Analog Memory (S.AMR) . . . . . AUT (AUTOMATIC). . . . . . . . . Auto tuning instruction (S. AT1) Average Value (S.AVE) . . . . . . . . . . . . . . . . . . . . 229 . . . . . . . . . . . . . . 219 . . . . . . . . . . . . . . . 31 . . . . . . . . . . . . . . . 32 . . . . . . . . . . . . . . . 30 . . . . . . . . . . . . . . . 55 . . . . . . . . . . . . . . 201 . . . . . . . . . . . . . . . 33 . . . . . . . . . . . . . . 244 . . . . . . . . . . . . . . 164 Forward Operation . . . . . . . . . . . . . . . . . . . . . . . . 14 Function Generator (S.FG) . . . . . . . . . . . . . . . . . .203 H HHA (Upper upper limit alarm) . . . . . . . . . High Selector (S.HS) . . . . . . . . . . . . . . . . High/Low Limit Alarm (S.PHPL) . . . . . . . . High/Low Limiter (S.LIMT) . . . . . . . . . . . . HOW TO READ INSTRUCTION DETAILS . . . . . . . .32 . . . . . .157 . . . . . .142 . . . . . .166 . . . . . . .51 I B Basic PID (S.PID) . . . . . . . . . Batch Counter (S.BC) . . . . . . Blend PI control . . . . . . . . . . Block memory. . . . . . . . . . . . Bumpless function . . . . . . . . . Bumpless Transfer (S.BUMP) I operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . INH (Alarm detection inhibition) . . . . . . . . . . . . . Input data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Integral (S.I) . . . . . . . . . . . . . . . . . . . . . . . . . . . Integral operation (I operation) . . . . . . . . . . . . . . Inverse Engineering Value Conversion (S.IENG) . Inverse Function Generator (S.IFG) . . . . . . . . . . I-PD Control (S.IPD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 . . . . . . . . . . . . . . . . 81 . . . . . . . . . . . . . . . 130 . . . . . . . . . . . . . . . . 30 . . . . . . . . . . . . . . . . 37 . . . . . . . . . . . . . . . 198 . .16 . .32 . . 29 .150 . .16 .217 .205 .122 C CAB (COMPUTER AUTOMATIC BACK UP) . . CAS (CASCADE) . . . . . . . . . . . . . . . . . . . . . Cascade loop . . . . . . . . . . . . . . . . . . . . . . . . CCB (COMPUTER CASCADE BACK UP) . . . . CMB (COMPUTER MANUAL BACK UP) . . . . . CMV (COMPUTER MV). . . . . . . . . . . . . . . . . Compare Equal Than (S. =) . . . . . . . . . . . . . . Compare Greater Or Equal (S. >=) . . . . . . . . . Compare Greater Than (S. >) . . . . . . . . . . . . . Compare Less Or Equal (S. <=) . . . . . . . . . . . Compare Less Than (S. <) . . . . . . . . . . . . . . . Control cycle . . . . . . . . . . . . . . . . . . . . . . . . CSV (COMPUTER SV) . . . . . . . . . . . . . . . . . . . . . 33 . . . . 33 . . . . 37 . . . . 33 . . . . 33 . . . . 33 . . . 235 . . . 237 . . . 231 . . . 239 . . . 233 . . . . 34 . . . . 33 D D operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Data Used for Process Control Instructions . . . . . . . 28 Dead Band (S.DBND) . . . . . . . . . . . . . . . . . . . . . 185 Dead Time (S.DED) . . . . . . . . . . . . . . . . . . . . . . 154 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Derivative operation (D operation). . . . . . . . . . . . . . 17 Deviation large alarm (DVLA) . . . . . . . . . . . . . . . . . 32 Division (S.DIV) . . . . . . . . . . . . . . . . . . . . . . . . . 225 DMLA (Output change rate limit alarm) . . . . . . . . . . 32 DPNA (Negative direction change rate alarm) . . . . . 32 DPPA (Positive direction change rate alarm) . . . . . . 32 DVLA (Deviation large alarm) . . . . . . . . . . . . . . . . . 32 12 L LCA (LOCAL AUTOMATIC) . . . LCC (LOCAL CASCADE). . . . . LCM (LOCAL MANIPULATED) . Lead-Lag (S.LLAG) . . . . . . . . . List of Error Codes . . . . . . . . . LLA(Lower lower limit alarm) . . Local Work Memory . . . . . . . . Loop memory . . . . . . . . . . . . . Loop selector . . . . . . . . . . . . . Loop Selector (S. SEL) . . . . . . Loop tag past value memory . . Loop Types . . . . . . . . . . . . . . Low Selector (S.LS) . . . . . . . . Lower limit alarm (PLA) . . . . . . Lower lower limit alarm(LLA) . . . . . . . . . . . . . . . . . 33 . . . . . . . . . . . . . . .33 . . . . . . . . . . . . . . .33 . . . . . . . . . . . . . .148 . . . . . . . . . . . . . .251 . . . . . . . . . . . . . . .32 . . . . . . . . . . . . . . .27 . . . . . . . . . . . . . . . 28 . . . . . . . . . . . . . . .38 . . . . . . . . . . . . . .192 . . . . . . . . . . . . . . .29 . . . . . . . . . . . . . . .23 . . . . . . . . . . . . . .159 . . . . . . . . . . . . . . . 32 . . . . . . . . . . . . . . .32 M MAN (MANUAL) . . . . . . . . . . . Manual Output (S.MOUT) . . . . MHA (Output upper limit alarm). Middle Value Selection (S.MID) MLA (Output lower limit alarm) . MODE (Operation mode) . . . . . Multiplication (S.MUL) . . . . . . . . . . . . . . . . . . . . . .33 . . . . . . . . . . . . . . .71 . . . . . . . . . . . . . . .32 . . . . . . . . . . . . . .161 . . . . . . . . . . . . . . .32 . . . . . . . . . . . . . . .33 . . . . . . . . . . . . . .223 273 10 15 15 I N T Negative direction change rate alarm (DPNA) . . . . . 32 Temperature/Pressure Correction (S.TPC) . Time Proportioning(S.DUTY) . . . . . . . . . . . Tracking flag (TRKF) . . . . . . . . . . . . . . . . Tracking function . . . . . . . . . . . . . . . . . . . TRKF (Tracking flag) . . . . . . . . . . . . . . . . O OOPA (Output open alarm) . . . . . . . . . . . . . . . . . . 32 Operation constant . . . . . . . . . . . . . . . . . . . . . . . . 30 Operation mode (MODE) . . . . . . . . . . . . . . . . . . . 33 Operation Processing Time . . . . . . . . . . . . . . . . . 268 Output change rate limit alarm (DMLA) . . . . . . . . . . 32 Output limiter processing function . . . . . . . . . . . . . 37 Output lower limit alarm (MLA) . . . . . . . . . . . . . . . 32 Output open alarm (OOPA) . . . . . . . . . . . . . . . . . . 32 Output Processing-1 with Mode Switching (S.OUT1) 60 Output Processing-2 with Mode Switching (S.OUT2) 66 Output upper limit alarm (MHA) . . . . . . . . . . . . . . . 32 P . . . . . 212 . . . . . . 75 . . . . . . 32 . . . . . . 37 . . . . . . 32 U Upper limit alarm (PHA) . . . . . . . . . . . . . . . . . . . . 32 Upper upper limit alarm (HHA) . . . . . . . . . . . . . . . . 32 V Variation Rate Limiter 1 (S.VLMT1) . . . . . . . . . . . 168 Variation Rate Limiter 2 (S.VLMT2) . . . . . . . . . . . 171 Z P operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 PHA (Upper limit alarm) . . . . . . . . . . . . . . . . . . . . 32 PID operation . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 PLA (Lower limit alarm). . . . . . . . . . . . . . . . . . . . . 32 Position Type PID Control (S.PIDP) . . . . . . . . . . . 106 Positive direction change rate alarm (DPPA) . . . . . . 32 Program Example . . . . . . . . . . . . . . . . . . . . . . . 253 Program Setter (S.PGS) . . . . . . . . . . . . . . . . . . . 187 Proportional operation (P operation) . . . . . . . . . . . . 15 Pulse Integration (S.PSUM) . . . . . . . . . . . . . . . . . 85 R Ratio (S.R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Reverse Operation . . . . . . . . . . . . . . . . . . . . . . . . 14 S S2PID (2-degree-of-freedom PID control) . . . Sample PI Control (S.SPI). . . . . . . . . . . . . . SBC (Batch counter) . . . . . . . . . . . . . . . . . SBPI (Blend PI control) . . . . . . . . . . . . . . . . SEA (Sensor alarm) . . . . . . . . . . . . . . . . . . Sensor alarm (SEA) . . . . . . . . . . . . . . . . . . SIPD (I-PD control) . . . . . . . . . . . . . . . . . . SMON (Monitor). . . . . . . . . . . . . . . . . . . . . SMOUT (Manual output) . . . . . . . . . . . . . . . SMWM (Manual output with monitor) . . . . . . SONF2 (2 position ON/OFF control) . . . . . . . SONF3 (3 position ON/OFF control) . . . . . . . SPA (Stop alarm) . . . . . . . . . . . . . . . . . . . . SPGS (Program setting device) . . . . . . . . . . SPID (PID control) . . . . . . . . . . . . . . . . . . . SPIDP (PIDP control) . . . . . . . . . . . . . . . . . Square Root (S.SQR) . . . . . . . . . . . . . . . . . SR (Ratio control) . . . . . . . . . . . . . . . . . . . SSEL (Selector) . . . . . . . . . . . . . . . . . . . . . SSPI (Sample PI control) . . . . . . . . . . . . . . stepped response process . . . . . . . . . . . . . Stop alarm (SPA) . . . . . . . . . . . . . . . . . . . . Subtraction (S.SUB) . . . . . . . . . . . . . . . . . . Summation (S.SUM) . . . . . . . . . . . . . . . . . 274 . . 23,257 . . . . 115 . . 23,265 . . 23,259 . . . . . 32 . . . . . 32 . . 23,259 . . 24,261 . . 24,261 . . 24,262 . . 23,264 . . 23,264 . . . . . 32 . . . . . 24 . . 23,257 . . 23,262 . . . . 227 . . 23,266 . . . . . 24 . . 23,257 . . . . 241 . . . . . 32 . . . . 221 . . . . 210 ZN process . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 INSTRUCTION INDEX 9 S 10 S. < . . . . . S. <= . . . . S. = . . . . . S. > . . . . . S. >= . . . . S. AT1 . . . S. SEL . . . S.2PID . . . S.ABS . . . S.ADD . . . S.AMR . . . S.AVE . . . S.BC . . . . S.BPI . . . . S.BUMP . . S.D . . . . . S.DBND . . S.DED . . . S.DIV. . . . S.DUTY . . S.ENG . . . S.FG . . . . S.FLT . . . S.HS . . . . S.I . . . . . . S.IENG . . S.IFG . . . . S.IN . . . . . S.IPD . . . . S.LIMT . . . S.LLAG . . S.LS . . . . S.MID . . . S.MOUT . S.MUL . . . S.ONF2 . . S.ONF3 . . S.OUT1 . . S.OUT2 . . S.PGS . . . S.PHPL . . S.PID . . . . S.PIDP . . S.PSUM . . S.R . . . . . S.SPI . . . . S.SQR . . . S.SUB . . . S.SUM . . . S.TPC . . . S.VLMT1 . S.VLMT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 11 12 10 15 15 I 275 REVISIONS *The manual number is given on the bottom left of the back cover. Print date *Manual number Apr., 2002 SH (NA)-080316E-A First edition Revision Jun., 2004 SH (NA)-080316E-B Manual name change QnPHCPU Programming Manual (Process Control Instructions) QnPHCPU/QnPRHCPU Programming Manual (Process Control Instructions) Term change DVL: Change rate limit value Deviation limit value Partial addition About Manuals, Section 2.2.1, 2.2.3, 3.3.5, Chapter 7, Section 8.5, 9.18, 9.21, 10.1, 10.2, Appendix 2.3, Appendix 2.7 Addition Generic terms and abbreviations used in this manual May, 2005 SH (NA)-080316E-C Correction CONTETNTS, Section 3.2, 6.2.3, 8.2, 8.5, 9.1, 9.2, 9.3, 9.4, 9.5, 9.8, 10.1, 10.2 May, 2008 SH (NA)-080316E-D Revision due to the addition of Process CPU Addition module Q02PHCPU, Q06PHCPU Partial correction GENERIC TERM AND ABBREVIATIONS USED IN THIS MANUAL, Section 9.18 Apr., 2009 SH (NA)-080316E-E Feb., 2013 SH (NA)-080316E-F Partial correction SAFETY CAUTIONS, ABOUT MANUALS, Section 8.1, Appendix 1 Descriptions related to the structured ladder/FBD and structured text language are added. Sep., 2013 SH (NA)-080316E-G Manual name change QnPHCPU/QnPRHCPU Programming Manual (Process Control Instructions) MELSEC-Q Programming/Structured Programming Manual (Process Control Instructions) Correction Chapter 1, Section 2.2.1, 2.2.4, 2.2.5, 2.2.8, 3.3.1, 3.3.3, CHAPTER 7 to 14, Appendix 2, Appendix 3.1, Appendix 3.2 Japanese Manual Version SH-080265-G This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual. © 2002 MITSUBISHI ELECTRIC CORPORATION 276 WARRANTY Please confirm the following product warranty details before using this product. 1. Gratis Warranty Term and Gratis Warranty Range If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company. However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning, maintenance, or testing on-site that involves replacement of the failed module. [Gratis Warranty Term] The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place. Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs. [Gratis Warranty Range] (1) The range shall be limited to normal use within the usage state, usage methods and usage environment, etc., which follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution labels on the product. (2) Even within the gratis warranty term, repairs shall be charged for in the following cases. 1. Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design. 2. Failure caused by unapproved modifications, etc., to the product by the user. 3. When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided. 4. Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced. 5. Failure caused by external irresistible forces such as fires or abnormal voltages, and Failure caused by force majeure such as earthquakes, lightning, wind and water damage. 6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. 7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user. 2. Onerous repair term after discontinuation of production (1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued. Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc. (2) Product supply (including repair parts) is not available after production is discontinued. 3. Overseas service Overseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at each FA Center may differ. 4. Exclusion of loss in opportunity and secondary loss from warranty liability Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user by Failures of Mitsubishi products, special damages and secondary damages whether foreseeable or not, compensation for accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user, maintenance of on-site equipment, start-up test run and other tasks. 5. Changes in product specifications The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice. 277 Microsoft, Windows, Windows Vista, Windows NT, Windows XP, Windows Server, Visio, Excel, PowerPoint, Visual Basic, Visual C++, and Access are either trademarks of registered trademarks of Microsoft Corporation in the United States and other countries. Intel, Pentium, and Celeron are trademarks of Intel Corporation in the United States and other countries. Ethernet is a registered trademark of Xerox Corporation. The SD and SDHC logos are either registered trademarks or trademarks of SD-3C, LLC. All other company names and product names used in this manual are either trademarks or registered trademarks of their respective companies. 278 SH (NA)-080316E-G SH(NA)-080316E-G(1309)MEE MODEL: QNPHCPU-P-PROCE-E MODEL CODE: 13JF67 HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission. Specifications subject to change without notice.