Ladder Programming Manual - Framework

Transcription

FT9Y-B1382FT1ASeriesLadder Programming Manual

SAFETY PRECAUTIONS Read the SmartAXIS Pro/Lite User’s Manual to make sure of correct operation before starting installation, wiring, operation, maintenance, andinspection of the SmartAXIS. All SmartAXIS modules are manufactured under IDEC’s rigorous quality control system, but users must add a backup or failsafe provision to thecontrol system when using the SmartAXIS in applications where heavy damage or personal injury may be caused in case the SmartAXIS shouldfail. In this user’s manual, safety precautions are categorized in order of importance to Warning and Caution:WarningWarning notices are used to emphasize that improper operation may cause severe personal injury or death. The SmartAXIS is not designed for use in medical equipment, nuclear power, railways, aviation, passenger vehicle equipment, or similarapplications requiring a high degree of reliability and safety. The SmartAXIS cannot be used for such applications. When using the SmartAXIS in applications not described above that require a high degree of reliability in terms of functionality and precision,appropriate measures such as failsafe mechanisms and redundant mechanisms must be taken for a system containing the SmartAXIS. Emergency stop and interlocking circuits must be configured outside the SmartAXIS. If relays or transistors in the SmartAXIS output circuits should fail, outputs may remain in the on or off state. For output signals which maycause serious accidents, configure monitor circuits outside the SmartAXIS. The SmartAXIS self-diagnostic function may detect internal circuit or program errors, stop programs, and turn outputs off. Configure circuits sothat the system containing the SmartAXIS is not jeopardized when outputs turn off. Turn off power to the SmartAXIS before installation, removal, wiring, maintenance, and inspection of the SmartAXIS. Failure to turn power offmay cause electrical shocks or fire hazard. Special expertise is required to install, wire, program, and operate the SmartAXIS. People without such expertise must not use the SmartAXIS. Install the SmartAXIS according to the instructions described in SmartAXIS Pro/Lite user's manual. Improper installation will result in falling,failure, or malfunction of the SmartAXIS.CautionCaution notices are used where inattention might cause personal injury or damage to equipment. The SmartAXIS is designed for installation in a cabinet. Do not install the SmartAXIS outside a cabinet. Install the SmartAXIS in environments described in SmartAXIS Pro/Lite user's manual. If the SmartAXIS is used in places where the SmartAXISis subjected to high-temperature, high-humidity, condensation, corrosive gases, excessive vibrations, and excessive shocks, then electricalshocks, fire hazard, or malfunction will result. The environment for using the SmartAXIS is “Pollution degree 2.” Use the SmartAXIS in environments of pollution degree 2 (according to IEC60664-1). While moving or transporting prevent the SmartAXIS from falling, otherwise damage or malfunction of the SmartAXIS will result. Wiring must use lead sizes that are appropriate for the applied voltage and current. Terminal screws must be tightened with the prescribedtightening torque. Prevent metal fragments and pieces of wire from dropping inside the SmartAXIS housing. Put a cover on the SmartAXIS modules duringinstallation and wiring. Ingress of such fragments and chips may cause fire hazard, damage, or malfunction. Use a power supply of the rated value. Use of the wrong power supply may cause fire hazard. Use an IEC 60127-approved fuse on the power line outside the SmartAXIS. This is required when equipment containing the SmartAXIS isdesigned for use in Europe. Use an IEC 60127-approved fuse on the output circuit. This is required when equipment containing the SmartAXIS is designed for use in Europe. Use an EU-approved circuit breaker. This is required when equipment containing the SmartAXIS is destined for Europe. Make sure of safety before starting and stopping the SmartAXIS or when operating the SmartAXIS to force outputs on or off. Incorrect operationof the SmartAXIS may cause machine damage or accidents. Do not connect the ground wire directly to the SmartAXIS. Connect a protective ground to the cabinet containing the SmartAXIS using an M4 orlarger screw. This is required when equipment containing the SmartAXIS is designed for use in Europe. Do not disassemble, repair, or modify the SmartAXIS modules. The SmartAXIS contains electronic parts and batteries. When disposing of the SmartAXIS, do so in accordancewith national and local regulations.SMARTAXIS LADDER PROGRAMMING MANUAL FT9Y-B1382Preface-1

ABOUT THIS MANUALThis user’s manual describes basic and advanced instructions and the usage of software for SmartAXIS ladder programming.Chapter 1: Operation BasicsGeneral information about simple operating procedures from creating a user program using WindLDR on a computer to monitoringthe SmartAXIS operation.Chapter 2: Ladder Program Monitoring on the SmartAXISMonitoring the ladder program in the SmartAXIS.Chapter 3: Device AddressesDevice addresses available for the SmartAXIS to program basic and advanced instructions. Special internal relays and special dataregisters are also described.Chapter 4: Instructions ReferenceList of all basic and advanced instructions and general rules of using advanced instructions, terms, data types, and formats usedfor advanced instructions.Chapter 5: Basic InstructionsProgramming of the basic instructions, available devices, and sample programs.Chapter 6 through Chapter 26:Detailed descriptions for advanced instructions.AppendixAdditional information about execution times and byte sizes for instructions.IndexAlphabetical listing of key words.Publication historyMarch 2013 First EditionTrademarksSmartAXIS is a trademark of IDEC Corporation.IMPORTANT INFORMATIONUnder no circumstances shall IDEC Corporation be held liable or responsible for indirect or consequential damages resulting fromthe use of or the application of IDEC PLC components, individually or in combination with other equipment.All persons using these components must be willing to accept responsibility for choosing the correct component to suit theirapplication and for choosing an application appropriate for the component, individually or in combination with other equipment.All diagrams and examples in this manual are for illustrative purposes only. In no way does including these diagrams andexamples in this manual constitute a guarantee as to their suitability for any specific application. To test and approve allprograms, prior to installation, is the responsibility of the end user.Preface-2SMARTAXIS LADDER PROGRAMMING MANUAL FT9Y-B1382

RELATED MANUALSThe following manuals related to the SmartAXIS are available. Refer to them in conjunction with this manual.Type No.Manual NameDescriptionFT9Y-B1378SmartAXIS Pro/LiteUser’s ManualDescribes product specifications, installation and wiring instructions, instructions forbasic programming operations and special functions, device and instruction lists,communication functions, and troubleshooting procedures for the SmartAXIS Pro/Lite series.FT9Y-B1382SmartAXISLadder Programming Manual(this manual)Describes basic operations for ladder programming, instructions for editing andmonitoring ladders on the SmartAXIS, available devices and instruction lists, anddetails of each instruction.FT9Y-B1390SmartAXIS TouchUser’s ManualDescribes product specifications, installation and wiring instructions, instructions forsetting basic programming actions and special functions, device and instruction lists,communication functions, and troubleshooting procedures for the Touch series.WindLDR HelpDescribes usage instructions for WindLDR, programming software for the SmartAXISPro/Lite series.WindO/I-NV3 HelpDescribes programming for the SmartAXIS Touch series, and usage instructions forthe WindO/I-NV3 configuration software.SMARTAXIS LADDER PROGRAMMING MANUAL FT9Y-B1382Preface-3

NAMES AND ABBREVIATIONS USED IN THIS MANUALModel NamesName Used in this ManualDescription (Detailed Type No.)SmartAXISFT1A programmable logic controllers.SmartAXIS LiteModules without LCD.(FT1A-B12RA, FT1A-B12RC, FT1A-B24RA, FT1A-B24RC, FT1A-B40RKA, FT1A-B40RSA, FT1A-B40RC,FT1A-B48KA, FT1A-B48SA, FT1A-B48KC, FT1A-B48SC)SmartAXIS ProModules with LCD.(FT1A-H12RA, FT1A-H12RC, FT1A-H24RA, FT1A-H24RC, FT1A-H40RKA, FT1A-H40RSA, FT1A-H40RC,FT1A-H48KA, FT1A-H48SA, FT1A-H48KC, FT1A-H48SC)SmartAXIS TouchModules that extend the functionality of display.(FT1A-M12RA-W, FT1A-M12RA-B, FT1A-M12RA-S, FT1A-C12RA-W, FT1A-C12RA-B, FT1A-C12RA-S)12-I/O typeSmartAXIS Pro and Lite models with 12 I/O points.(FT1A-B12RA, FT1A-B12RC, FT1A-H12RA, FT1A-H12RC)24-I/O typeSmartAXIS Pro and Lite models with 24 I/O points.(FT1A-B24RA, FT1A-B24RC, FT1A-H24RA, FT1A-H24RC)40-I/O typeSmartAXIS Pro and Lite models with 40 I/O points.(FT1A-B40RKA, FT1A-B40RSA, FT1A-B40RC, FT1A-H40RKA, FT1A-H40RSA, FT1A-H40RC)48-I/O typeSmartAXIS Pro and Lite models with 48 I/O points.(FT1A-B48KA, FT1A-B48SA, FT1A-B48KC, FT1A-B48SC, FT1A-H48KA, FT1A-H48SA, FT1A-H48KC,FT1A-H48SC)AC power typeSmartAXIS Pro and Lite models with an AC power supply.(FT1A-B12RC, FT1A-H12RC, FT1A-B24RC, FT1A-H24RC, FT1A-B40RC, FT1A-H40RC, FT1A-B48KC,FT1A-B48SC, FT1A-H48KC, FT1A-H48SC)DC power typeSmartAXIS Pro and Lite models with a DC power supply.(FT1A-B12RA, FT1A-H12RA, FT1A-B24RA, FT1A-H24RA, FT1A-B40RKA, FT1A-H40RKA,FT1A-B40RSA, FT1A-H40RSA, FT1A-B48KA, FT1A-B48SA, FT1A-H48KA, FT1A-H48SA)Preface-4SMARTAXIS LADDER PROGRAMMING MANUAL FT9Y-B1382

TABLE OF CONTENTSSafety Precautions.About This Manual.Related Manuals.Names and Abbreviations Used in this Manual .CHAPTER 1:Operation BasicsCHAPTER 2:Ladder Program Monitoring on the SmartAXISCHAPTER 3:Device AddressesCHAPTER 4:CHAPTER 5:Preface-1Preface-2Preface-3Preface-4Start WindLDR . 1-1PLC Selection . 1-2Create Ladder Program . 1-3Save Project. 1-6Simulate Operation. 1-7Download Program . 1-7Monitor Operation . 1-8Quit WindLDR . 1-8Basic Operations . 2-1Ladder Program Monitor . 2-3Using the Ladder Program Monitor. 2-4Device Addresses . 3-1Special Internal Relays. 3-2Special Data Registers . 3-8Instructions ReferenceBasic Instruction List. 4-1Advanced Instruction List . 4-3Advanced Instruction Applicable SmartAXIS . 4-6Structure of an Advanced Instruction . 4-9Input Condition for Advanced Instructions. 4-9Source and Destination Devices. 4-9Using Timer or Counter as Source Device. 4-9Using Timer or Counter as Destination Device . 4-9Data Types for Advanced Instructions . 4-10Discontinuity of Device Areas . 4-14NOP (No Operation) . 4-14Basic InstructionsLOD (Load) and LODN (Load Not) . 5-1OUT (Output) and OUTN (Output Not). 5-1SET and RST (Reset) . 5-3AND and ANDN (And Not). 5-4OR and ORN (Or Not) . 5-4AND LOD (Load) . 5-5OR LOD (Load) . 5-5BPS (Bit Push), BRD (Bit Read), and BPP (Bit Pop). 5-6TML, TIM, TMH, and TMS (Timer) . 5-7TMLO, TIMO, TMHO, and TMSO (Off-Delay Timer) . 5-10CNT, CDP, and CUD (Counter). 5-11CNTD, CDPD, and CUDD (Double-Word Counter). 5-14CC and CC (Counter Comparison) . 5-18DC and DC (Data Register Comparison) . 5-20SFR and SFRN (Forward and Reverse Shift Register). 5-22SOTU and SOTD (Single Output Up and Down) . 5-26MCS and MCR (Master Control Set and Reset) . 5-27JMP (Jump) and JEND (Jump End) . 5-29END . 5-30FT1A SMARTAXIS USER’S MANUAL FT9Y-B1382I

Restriction on Ladder Programming.5-31CHAPTER 6:Move InstructionsCHAPTER 7:Data Comparison InstructionsCHAPTER 8:Binary Arithmetic InstructionsCHAPTER 9:Boolean Computation InstructionsCHAPTER 10:CHAPTER 11:IIMOV (Move) . 6-1MOVN (Move Not). 6-5IMOV (Indirect Move). 6-6IMOVN (Indirect Move Not) . 6-8BMOV (Block Move) . 6-9IBMV (Indirect Bit Move) .6-10IBMVN (Indirect Bit Move Not).6-12NSET (N Data Set) .6-13NRS (N Data Repeat Set).6-14XCHG (Exchange) .6-15TCCST (Timer/Counter Current Value Store) .6-16CMP (Compare Equal To) . 7-1CMP (Compare Unequal To). 7-1CMP (Compare Less Than) . 7-1CMP (Compare Greater Than). 7-1CMP (Compare Less Than or Equal To) . 7-1CMP (Compare Greater Than or Equal To) . 7-1ICMP (Interval Compare Greater Than or Equal To). 7-6LC (Load Compare Equal To). 7-8LC (Load Compare Unequal To) . 7-8LC (Load Compare Less Than). 7-8LC (Load Compare Greater Than) . 7-8LC (Load Compare Less Than or Equal To). 7-8LC (Load Compare Greater Than or Equal To) . 7-8ADD (Addition) . 8-1SUB (Subtraction) . 8-1MUL (Multiplication) . 8-1DIV (Division) . 8-1INC (Increment) .8-13DEC (Decrement).8-13ROOT (Root) .8-14SUM (Sum).8-15ANDW (AND Word) . 9-1ORW (OR Word) . 9-1XORW (Exclusive OR Word) . 9-1Shift / Rotate InstructionsSFTL (Shift Left) .10-1SFTR (Shift Right) .10-3BCDLS (BCD Left Shift).10-5WSFT (Word Shift).10-7ROTL (Rotate Left).10-8ROTR (Rotate Right) .10-10Data Conversion InstructionsHTOB (Hex to BCD) .11-1BTOH (BCD to Hex) .11-3HTOA (Hex to ASCII) .11-5ATOH (ASCII to Hex) .11-7BTOA (BCD to ASCII) .11-9ATOB (ASCII to BCD) .11-12FT1A SMARTAXIS USER’S MANUAL FT9Y-B1382

ENCO (Encode) . 11-15DECO (Decode) . 11-16BCNT (Bit Count). 11-17ALT (Alternate Output) . 11-18CVDT (Convert Data Type). 11-19DTDV (Data Divide) . 11-21DTCB (Data Combine) . 11-22SWAP (Data Swap). 11-23CHAPTER 12:CHAPTER 13:CHAPTER 14:CHAPTER 15:CHAPTER 16:CHAPTER 17:CHAPTER 18:CHAPTER 19:CHAPTER 20:CHAPTER 21:Week Programmer InstructionsWEEK (Weekly Timer). 12-1YEAR (Yearly Timer) . 12-11Display InstructionsMSG (Message) . 13-1Program Branching InstructionsLABEL (Label) . 14-1LJMP (Label Jump) . 14-1LCAL (Label Call) . 14-3LRET (Label Return) . 14-3DJNZ (Decrement Jump Non-zero) . 14-5Refresh InstructionsIOREF (I/O Refresh) . 15-1HSCRF (High-speed Counter Refresh) . 15-3Interrupt Control InstructionsDI (Disable Interrupt) . 16-1EI (Enable Interrupt) . 16-1Coordinate Conversion InstructionsXYFS (XY Format Set) . 17-1CVXTY (Convert X to Y) . 17-2CVYTX (Convert Y to X) . 17-3Average InstructionsAVRG (Average) . 18-1Pulse Output InstructionsPULS (Pulse Output) . 19-1PWM (Variable Duty Cycle Pulse Output). 19-8RAMP (Trapezoidal Control) . 19-15ZRN (Zero Return) . 19-26ARAMP (RAMP with Table) . 19-32Dual / Teaching Timer InstructionsDTML (1-sec Dual Timer) . 20-1DTIM (100-ms Dual Timer) . 20-1DTMH (10-ms Dual Timer) . 20-1DTMS (1-ms Dual Timer) .

SMARTAXIS LADDER PROGRAMMING MANUAL FT9Y-B1382 Preface-1 SAFETY PRECAUTIONS Read the SmartAXIS Pro/Lite User’s Manual to make sure of correct operation before starting installation, wiring, operation, maintenance, and inspection of the SmartAXIS. All SmartAXIS modules are manufactured u