IDEC microsmart pentra Programming Manual

Ft1a series
Table of Contents

Advertisement

Quick Links

FC9Y-B1382
FT1A
SERIES
Ladder Programming Manual

Advertisement

Table of Contents
loading

Summary of Contents for IDEC microsmart pentra

  • Page 1 FC9Y-B1382 FT1A SERIES Ladder Programming Manual...
  • Page 2: Safety Precautions

     inspection 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 the  control system when using the SmartAxis in applications where heavy damage or personal injury may be caused in case the SmartAxis should fail.
  • Page 3: About This Manual

    SmartAxis is a trademark of IDEC Corporation. IMPORTANT INFORMATION Under no circumstances shall IDEC Corporation be held liable or responsible for indirect or consequential damages resulting from the use of or the application of IDEC PLC components, individually or in combination with other equipment.
  • Page 4: Related Manuals

    ELATED ANUALS The following manuals related to the SmartAxis are available. Refer to them in conjunction with this manual. Type No. Manual Name Description Describes product specifications, installation and wiring instructions, instructions for FT1A Series Pro/Lite basic programming operations and special functions, device and instruction lists, FT9Y-B1378 User’s Manual communication functions, and troubleshooting procedures for the SmartAxis Pro/Lite...
  • Page 5 AMES AND BBREVIATIONS SED IN THIS ANUAL Model Names Name Used in this Manual Description (Detailed Type No.) SmartAxis Name for the FT1A programmable logic controllers. General name for modules with no LCD. SmartAxis Lite (FT1A-B12RA, FT1A-B12RC, FT1A-B24RA, FT1A-B24RC, FT1A-B40RKA, FT1A-B40RSA, FT1A-B40RC, FT1A-B48KA, FT1A-B48SA, FT1A-B48KC, FT1A-B48SC) General name for modules with LCD.
  • Page 6 Preface-5 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 7: Table Of Contents

    ABLE OF ONTENTS Safety Precautions..........................Preface-1 About This Manual..........................Preface-2 Related Manuals..........................Preface-3 Names and Abbreviations Used in this Manual ..................Preface-4 Operation Basics HAPTER Start WindLDR ............................1-1 PLC Selection .............................. 1-2 Create Ladder Program ..........................1-3 Save Project..............................1-6 Simulate Operation............................
  • Page 8: Hapter

    MOVN (Move Not)............................6-5 IMOV (Indirect Move)..........................6-6 IMOVN (Indirect Move Not) ......................... 6-8 BMOV (Block Move) ............................ 6-9 IBMV (Indirect Bit Move) ..........................6-10 IBMVN (Indirect Bit Move Not)........................6-12 NSET (N Data Set) .............................6-13 NRS (N Data Repeat Set)..........................6-14 XCHG (Exchange) ............................6-15 TCCST (Timer/Counter Current Value Store) ....................6-16 Data Comparison Instructions HAPTER...
  • Page 9 CVDT (Convert Data Type)........................11-19 DTDV (Data Divide) ..........................11-21 DTCB (Data Combine) ..........................11-22 SWAP (Data Swap)..........................11-23 Calendar Comparison Instructions HAPTER WEEK (Weekly Timer)..........................12-1 YEAR (Yearly Timer) ..........................12-11 Program Branching Instructions HAPTER LABEL (Label) ............................14-1 LJMP (Label Jump) ............................
  • Page 10 File Data Processing Instructions HAPTER FIFOF (FIFO Format)..........................23-1 FIEX (First-In Execute) ..........................23-3 FOEX (First-Out Execute)..........................23-3 NDSRC (N Data Search) ..........................23-5 Clock Instructions HAPTER TADD (Time Addition) ..........................24-1 TSUB (Time Subtraction) ..........................24-5 HTOS (HMS to Sec)............................24-9 STOH (Sec to HMS)..........................24-10 HOUR (Hour Meter) ..........................24-11 User Communication Instructions HAPTER TXD (Transmit)............................25-1...
  • Page 11: Operation Basics

    1: O PERATION ASICS Introduction This chapter describes basic procedures for operating WindLDR, software required for programming and maintenance of the SmartAxis Pro/Lite series. Note: SmartAxis Touch series use WindO/I-NV3 for programming. See the “FT1A Series Touch User’s Manual” for instructions for programming and basic operation of WindO/I-NV3 with the Touch series.
  • Page 12: Plc Selection

    1: O PERATION ASICS PLC Selection Before programming a user program on WindLDR, select a PLC type. Select Configuration from the WindLDR menu bar, then select PLC Type. The PLC Selection dialog box appears. SmartAxis CPU Module PLC Selection Option Type No.
  • Page 13: Create Ladder Program

    1: O PERATION ASICS Create Ladder Program This section describes the procedure for creating a simple ladder program in WindLDR. Note: See “INSTRUCTIONS REFERENCE” on page 4-1 for details on basic and advanced instructions. Sample User Program Create a simple program using WindLDR. The sample program performs the following operation: When only input I0 is turned on, output Q0 is turned on....
  • Page 14 1: O PERATION ASICS Edit User Program Rung by Rung Start the user program with the LOD instruction by inserting a NO contact of input I0. From the WindLDR menu bar, select Home > Basic > A (Normally Open). Move the mouse pointer to the first column of the first line where you want to insert a NO contact, and click the left mouse button.
  • Page 15 1: O PERATION ASICS Enter I0 in the Tag Name field, and click OK. A NO contact of input I0 is programmed in the first column of the first ladder line. Next, program the ANDN instruction by inserting a NC contact of input I1. From the WindLDR menu bar, select Home >...
  • Page 16: Save Project

    1: O PERATION ASICS When completed, the ladder program looks like below. To insert a new ladder line without creating a new rung, press the down arrow key when the cursor is on the last line or press the right arrow key when the cursor is at the right-most column of the last line.
  • Page 17: Simulate Operation

    1: O PERATION ASICS Simulate Operation Before downloading the user program, you can simulate the operation on the WindLDR screen without connecting the SmartAxis. From the WindLDR menu bar, select Online > Simulation. The Simulation screen appears. To change an input status, place the mouse pointer on the input and right-click the mouse. In the pop-up menu, select Set or Reset to set or reset the input.
  • Page 18: Monitor Operation

    1: O PERATION ASICS Note: The Download dialog box can also be opened by selecting Home > Download. Note: When downloading a user program, all values and selections in the Function Area Settings are also downloaded to the SmartAxis. For details on function settings, see “Chapter 5 Special Functions”...
  • Page 19 3: D EVICE DDRESSES Introduction This chapter describes device addresses available for the SmartAxis to program basic and advanced instructions. Special internal relays and special data registers are also described. The SmartAxis is programmed using devices such as inputs, outputs, remote inputs, remote outputs, internal relays, timers, counters, shift registers, and data registers.
  • Page 20: Device Addresses

    3: D EVICE DDRESSES Special Internal Relays Special internal relays M8000 through M8177 are used for controlling the CPU operation and communication and for indicating the CPU statuses. All special internal relays cannot be used as destinations of advanced instructions. Internal relays M300 through M335 are used to read input device statuses of the IOREF (I/O refresh) instruction.
  • Page 21 3: D EVICE DDRESSES Device Description Power OFF Read/Write Address Stopped M8055 Comparison Output Reset Cleared Cleared Read/Write M8056 Gate Input Maintained Cleared Read/Write M8057 High-speed Counter (Group 4/I5) Reset Input Maintained Cleared Read/Write M8060 Comparison ON Status Maintained Cleared Read M8061 Overflow...
  • Page 22 3: D EVICE DDRESSES Device Description Power OFF Read/Write Address Stopped M8144 Timer Interrupt Status (ON: Allowed, OFF: Prohibited) Cleared Cleared Read M8145- — Reserved — ― ― ― M8147 M8150 Comparison Result Greater Than Maintained Cleared Read M8151 Comparison Result Less Than Maintained Cleared Read...
  • Page 23 3: D EVICE DDRESSES M8000 Start Control M8000 is used to control the operation of the CPU. The CPU stops operation when M8000 is turned off while the CPU is running. M8000 can be turned on or off using the WindLDR Online menu. When a stop or reset input is designated, M8000 must remain on to control the CPU operation using the stop or reset input.
  • Page 24 3: D EVICE DDRESSES M8022 User Communication Receive Instruction Cancel Flag (Port 2) When M8022 is turned on, all RXD2 instructions ready for receiving user communication through port 2 are disabled. M8023 User Communication Receive Instruction Cancel Flag (Port 3) When M8023 is turned on, all RXD3 instructions ready for receiving user communication through port 3 are disabled.
  • Page 25 3: D EVICE DDRESSES M8120 Initialize Pulse 1 scan time When the CPU starts operation, M8120 turns on for a period of one scan. M8120 Start M8121 1-sec Clock 500 ms 500 ms While M8001 (1-sec clock reset) is off, M8121 generates clock pulses in 1-sec increments, with a duty ratio of 1:1 (500 ms on M8121 and 500 ms off).
  • Page 26: Special Data Registers

    3: D EVICE DDRESSES Special Data Registers Caution Do not change the data of reserved special data registers, otherwise the SmartAxis may not operate correctly.  Special Data Register Device Addresses Device Address Description Updated See Page D8000 Quantity of Inputs When I/O initialized 3-11 D8001...
  • Page 27 3: D EVICE DDRESSES Device Address Description Updated See Page D8048-D8049 — Reserved — — — D8050 High Word Current Value / Frequency Every scan Measurement Value (I0) D8051 Low Word High-speed D8052 High Word Counter Preset Value — D8053 Low Word (Group 1/I0) D8054...
  • Page 28 3: D EVICE DDRESSES Device Address Description Updated See Page D8114 D8115 Connection 2 Connected IP Address Every 1 sec D8116 D8117 D8118 D8119 Connection 3 Connected IP Address Every 1 sec D8120 D8121 D8122-D8129 — Reserved — — — D8130 Connection 1 Connected Port Number Every 1 sec...
  • Page 29 3: D EVICE DDRESSES D8000 Quantity of Inputs The total of input points provided on the CPU module is stored to D8000. D8001 Quantity of Outputs The total of output points provided on the CPU module is stored to D8001. D8002 CPU Module Type Information Information about the CPU module type is stored to D8002.
  • Page 30 3: D EVICE DDRESSES D8027-D8028 Slave Number The slave number is stored to D8027 and D8028 when the communication mode of port 2 and 3 is maintenance communication or Modbus RTU slave. The slave number can be specified with either a constant or a data register in the function area settings. When data register is specified, the slave number can be changed by storing the slave number in D8027 and D8028.
  • Page 31 3: D EVICE DDRESSES D8040-D8047 Analog Input Value The analog input values (0 to 10 VDC) to the analog input terminals are converted to digital values (0 to 1000) and stored to the corresponding special data registers. D8040=AI0, D8041=AI1, D8042=AI2, D8043=AI3, D8044=AI4, D8045=AI5, D8046=AI6, D8047=AI7 D8050-D8073, D8134-D8145 High-speed Counter These special data registers are used with the high-speed counter function and the frequency measurement function.
  • Page 32 3: D EVICE DDRESSES D8105 RS232C DSR Input Control Signal Option (Port 2 and Port 3) Special data register D8105 is used to control data flow between the SmartAxis RS232C port 2 and port 3 and the remote terminal depending on the DSR (data set ready) signal sent from the remote terminal. D8105 Port 3 Port 2...
  • Page 33: Basic Instruction List

    4: I NSTRUCTIONS EFERENCE Introduction SmartAxis instructions are divided into basic instructions, which perform sequencing, and advanced instructions, which perform moves, comparisons, Boolean computations, binary arithmetic operations, bit shifts, and other operations. Basic Instruction List Symbol Name Function See Page Basic Vol.
  • Page 34 4: I NSTRUCTIONS EFERENCE Symbol Name Function See Page Basic Vol. Master Control Set Starts a master control 7-28 Basic Vol. Parallel connection of NO contact Basic Vol. OR LOD Or Load Parallel connection of circuit blocks Basic Vol. Or Not Parallel connection of NC contact Basic Vol.
  • Page 35: Advanced Instruction List

    4: I NSTRUCTIONS EFERENCE Advanced Instruction List Valid Data Type Group Symbol Name See Page No Operation 4-14 Move MOVN Move Not IMOV Indirect Move IMOVN Indirect Move Not BMOV Block Move Move IBMV Indirect Bit Move 3-10 IBMVN Indirect Bit Move Not 3-12 NSET N Data Set...
  • Page 36 4: I NSTRUCTIONS EFERENCE Valid Data Type Group Symbol Name See Page HTOB Hex to BCD BTOH BCD to Hex HTOA Hex to ASCII ATOH ASCII to Hex BTOA BCD to ASCII ATOB ASCII to BCD 8-12 ENCO Encode 8-15 Data Conversion DECO Decode...
  • Page 37 4: I NSTRUCTIONS EFERENCE Valid Data Type Group Symbol Name See Page Degree to Radian 17-1 Radian to Degree 17-2 Sine 17-3 Cosine 17-4 Trigonometric Function Tangent 17-5 ASIN Arc Sine 17-6 ACOS Arc Cosine 17-7 ATAN Arc Tangent 17-8 LOGE Natural Logarithm 18-1...
  • Page 38: Advanced Instruction Applicable Cpu Modules

    4: I NSTRUCTIONS EFERENCE Advanced Instruction Applicable CPU Modules Applicable advanced instructions depend on the type of CPU modules as listed in the table below. FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A- Group Symbol Touch MOVN IMOV IMOVN BMOV Move IBMV IBMVN NSET XCHG TCCST...
  • Page 39 4: I NSTRUCTIONS EFERENCE FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A- Group Symbol Touch HTOB BTOH HTOA ATOH BTOA ATOB ENCO Data Conversion DECO BCNT CVDT DTDV DTCB SWAP WEEK Week Programmer YEAR Interface X (Note) X (Note) X (Note) X (Note) X (Note) X (Note) X (Note)
  • Page 40 4: I NSTRUCTIONS EFERENCE FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A- Group Symbol Touch PULS1 PULS2 PULS3 PULS4 PWM1 PWM2 PWM3 Pulse PWM4 RAMP1 RAMP2 ZRN1 ZRN2 ARAMP1 ARAMP2 DTML DTIM Dual / Teaching DTMH Timer DTMS TTIM Trigonometric Function ASIN ACOS ATAN LOGE LOG10...
  • Page 41: Structure Of An Advanced Instruction

    4: I NSTRUCTIONS EFERENCE Structure of an Advanced Instruction Opcode Source Device Destination Device The opcode is a symbol to identify the advanced instruction. Opcode Repeat Cycles Data Type Specifies the word (W), integer (I), double word (D), long (L), or MOV(W) S1 R D1 R...
  • Page 42: Data Types For Advanced Instructions

    4: I NSTRUCTIONS EFERENCE Data Types for Advanced Instructions When using move, data comparison, binary arithmetic, Boolean computation, bit shift/rotate, data conversion, and coordinate conversion instructions, data types can be selected from word (W), integer (I), double word (D), long (L), or float (F). For other advanced instructions, the data is processed in units of 16-bit word.
  • Page 43 4: I NSTRUCTIONS EFERENCE Floating-Point Data Format The SmartAxis can specify the floating-point data type (F) for advanced instructions. Like the double word (D) and long integer (L) data types, the floating-point data type also uses two consecutive data registers to execute advanced instructions. The SmartAxis supports the floating-point data based on the single storage format of the IEEE (The Institute of Electrical and Electronics Engineers) Standard 754.
  • Page 44 4: I NSTRUCTIONS EFERENCE 32-bit Data Storage When the double-word (D) or long (L) data type is selected, the data is stored in the consecutive devices in the following manner according to the 32-bit data storage setting configured in Function Area Settings under Device Settings. For applicable devices and instructions, see Chapter 5 "Special Functions”...
  • Page 45 4: I NSTRUCTIONS EFERENCE User Program Execution Errors When an advanced instruction is executed, a user program execution error occurs when any of the following conditions are met. the result of the adavnced instruction is invalid  source or destination device that is indirectly specified in the advanced instruction is out of the valid device range ...
  • Page 46: Discontinuity Of Device Areas

    4: I NSTRUCTIONS EFERENCE Discontinuity of Device Areas Each device area is discrete and does not continue, for example, from input to output or from output to internal relay. In addition, special internal relays M8000 through M8177 are in a separate area from internal relays M0 through M1277. Data registers D0 through D999, non-retentive data registers D1000 through D1999, and special data registers D8000 through D8199 are in separate areas and do not continue with each other.
  • Page 47: Basic Instruction List

    5: B ASIC NSTRUCTIONS Introduction This chapter describes programming of the basic instructions, available devices, and sample programs. All basic instructions are available on all FT1A SmartAxis CPU modules. Basic Instruction List Symbol Name Function Page Series connection of NO contact AND LOD And Load Series connection of circuit blocks...
  • Page 48 5: B ASIC NSTRUCTIONS Symbol Name Function Page TMHO 10-ms Off-delay Timer Subtracting 10-ms off-delay timer (0 to 655.35 sec) 5-11 1-sec Timer Subtracting 1-sec timer (0 to 65535 sec) TMLO 1-sec Off-delay Timer Subtracting 1-sec off-delay timer (0 to 65535 sec) 5-11 1-ms Timer Subtracting 1-ms timer (0 to 65.535 sec)
  • Page 49: Lod (Load) And Lodn (Load Not)

    5: B ASIC NSTRUCTIONS LOD (Load) and LODN (Load Not) The LOD instruction starts the logical operation with a NO (normally open) contact. The LODN instruction starts the logical operation with a NC (normally closed) contact. A total of eight LOD and/or LODN instructions can be programmed consecutively. Valid Devices Ladder Diagram Instruction...
  • Page 50: Set And Rst (Reset)

    5: B ASIC NSTRUCTIONS Examples: LOD (Load), OUT (Output), and NOT Program List Ladder Diagram Timing Chart Instruction Data OUTN Program List Ladder Diagram Instruction Data Program List Ladder Diagram Instruction Data LODN Program List Ladder Diagram Instruction Data OUTN Program List Ladder Diagram Instruction...
  • Page 51: And And Andn (And Not)

    5: B ASIC NSTRUCTIONS AND and ANDN (And Not) The AND instruction is used for programming a NO contact in series. The ANDN instruction is used for programming a NC contact in series. The AND or ANDN instruction is entered after the first set of contacts. Program List Ladder Diagram Timing Chart...
  • Page 52: And Lod (Load)

    5: B ASIC NSTRUCTIONS AND LOD (Load) The AND LOD instruction is used to connect, in series, two or more circuits starting with the LOD instruction. The AND LOD instruction is the equivalent of a “node” on a ladder diagram. When using WindLDR, the user needs not program the AND LOD instruction.
  • Page 53: Bps (Bit Push), Brd (Bit Read), And Bpp (Bit Pop)

    5: B ASIC NSTRUCTIONS BPS (Bit Push), BRD (Bit Read), and BPP (Bit Pop) The BPS (bit push) instruction is used to save the result of bit logical operation temporarily.  The BRD (bit read) instruction is used to read the result of bit logical operation which was saved temporarily. The BPP (bit pop) instruction is used to restore the result of bit logical operation which was saved temporarily.
  • Page 54: Tml, Tim, Tmh, And Tms (Timer)

    5: B ASIC NSTRUCTIONS TML, TIM, TMH, and TMS (Timer) Four types of timedown timers are available; 1-sec timer TML, 100-ms timer TIM, 10-ms timer TMH, and 1-ms timer TMS. A total of 100 (FT1A-12) or 200 (other FT1A series) on- and off-delay timers can be programmed in a user program. Each timer must be allocated to a unique number T0 through T199.
  • Page 55 5: B ASIC NSTRUCTIONS Timer Circuit The preset value 0 through 65535 can be designated using a data register D0 through D999 or D1000 through D1999; then the data of the data register becomes the preset value. Directly after the TML, TIM, TMH, or TMS instruction, the OUT, OUTN, SET, RST, TML, TIM, TMH, TMS, TMLO, TIMO, TMHO, or TMSO instruction can be programmed.
  • Page 56 5: B ASIC NSTRUCTIONS Timer Counting Error Every timer instruction operation is individually based on asynchronous 16-bit reference timers. Therefore, an error occurs depending on the status of the asynchronous 16-bit timer when the timer instruction is executed. Use of the TMS (1-ms timer) is recommended as often as possible to make sure that the advance error is reduced to the minimum.
  • Page 57: Tmlo, Timo, Tmho, And Tmso (Off-Delay Timer)

    5: B ASIC NSTRUCTIONS TMLO, TIMO, TMHO, and TMSO (Off-Delay Timer) Four types of timedown off-delay timers are available; 1-sec off-delay timer TMLO, 100-ms off-delay timer TIMO, 10-ms off-delay timer TMHO, and 1-ms off-delay timer TMSO. A total of 100 (FT1A-12) or 200 (other FT1A series) on- and off-delay timers can be programmed in a user program.
  • Page 58: Cnt, Cdp, And Cud (Counter)

    5: B ASIC NSTRUCTIONS CNT, CDP, and CUD (Counter) Three types of counters are available; adding (up) counter CNT, dual-pulse reversible counter CDP, and up/down selection reversible counter CUD. A total of 100 (FT1A-12) or 200 (other FT1A series) counters can be programmed in a user program. Each counter must be allocated to a unique number C0 through C199.
  • Page 59 5: B ASIC NSTRUCTIONS CDP (Dual-Pulse Reversible Counter) The dual-pulse reversible counter CDP has up and down pulse inputs, so the three inputs are required. The circuit for a dual-pulse reversible counter must be programmed in the following order: preset input, up-pulse input, down-pulse input, the CDP instruction, and a counter number C0 through C199, followed by a counter preset value from 0 to 65535.
  • Page 60 5: B ASIC NSTRUCTIONS CUD (Up/Down Selection Reversible Counter) The up/down selection reversible counter CUD has a selection input to switch the up/down gate, so the three inputs are required. The circuit for an up/down selection reversible counter must be programmed in the following order: preset input, pulse input, up/ down selection input, the CUD instruction, and a counter number C0 through C199, followed by a counter preset value from 0 to 65535.
  • Page 61: Cntd, Cdpd, And Cudd (Double-Word Counter)

    5: B ASIC NSTRUCTIONS CNTD, CDPD, and CUDD (Double-Word Counter) Three types of double-word counters are available; adding (up) counter CNTD, dual-pulse reversible counter CDPD, and up/down selection reversible counter CUDD. A total of 50 (FT1A-12) or 100 (other FT1A series) double-word counters can be programmed in a user program.
  • Page 62 5: B ASIC NSTRUCTIONS CDPD (Double-Word Dual-Pulse Reversible Counter) The double-word dual-pulse reversible counter CDPD has up and down pulse inputs, so the three inputs are required. The circuit for a double-word dual-pulse reversible counter must be programmed in the following order: preset input, up-pulse input, down- pulse input, the CDPD instruction, and a counter number C0 through C198, followed by a counter preset value from 0 to 4,294,967,295.
  • Page 63 5: B ASIC NSTRUCTIONS CUDD (Double-Word Up/Down Selection Reversible Counter) The double-word up/down selection reversible counter CUDD has a selection input to switch the up/down gate, so the three inputs are required. The circuit for a double-word up/down selection reversible counter must be programmed in the following order: preset input, pulse input, up/down selection input, the CUDD instruction, and a counter number C0 through C198, followed by a counter preset value from 0 to 4,294,967,295.
  • Page 64 5: B ASIC NSTRUCTIONS Changing, Confirming, and Clearing Preset Values for Timers and Counters Preset values for timers and counters can be changed by selecting Online > Monitor > Monitor, followed by Online > Custom > New Custom Monitor on WindLDR for transferring a new value to the SmartAxis CPU module RAM as described on preceding pages.
  • Page 65: Cc= And Cc≥ (Counter Comparison)

    5: B ASIC NSTRUCTIONS CC= and CC≥ (Counter Comparison) The CC= instruction is an equivalent comparison instruction for counter current values. This instruction will constantly compare current values to the value that has been programmed in. When the counter value equals the given value, the desired output will be initiated.
  • Page 66 5: B ASIC NSTRUCTIONS Examples: CC= and CC≥ (Counter Comparison) Ladder Diagram 1 Program List Reset Instruction Data Pulse CC>= CC³ Timing Chart Reset Input I0 Pulse Input I1 • • • Output Q0 is on when counter C2 current value is 5. Output Q1 is turned on when counter C2 current Output Q0 value reaches 3 and remains on until counter C2 is...
  • Page 67: Dc= And Dc≥ (Data Register Comparison)

    5: B ASIC NSTRUCTIONS DC= and DC≥ (Data Register Comparison) The DC= instruction is an equivalent comparison instruction for data register values. This instruction will constantly compare data register values to the value that has been programmed in. When the data register value equals the given value, the desired output will be initiated.
  • Page 68 5: B ASIC NSTRUCTIONS Examples: DC= and DC≥ (Data Register Comparison) Ladder Diagram 1 Program List Instruction Data MOV(W) S1 – D1 – MOV(W) D10 – – DC>= DC³ Timing Chart Input I1 D10 Value D2 Value Output Q0 is on when data register D2 value is 5. Output Q1 is on when data register D2 value is 3 Output Q0 or more.
  • Page 69: Sfr And Sfrn (Forward And Reverse Shift Register)

    5: B ASIC NSTRUCTIONS SFR and SFRN (Forward and Reverse Shift Register) SmartAxis CPU modules have a shift register consisting of 128 bits which are allocated to R0 through R127. Any number of available bits can be selected to form a train of bits which store on or off status. The on/off data of constituent bits is shifted in the forward direction (forward shift register) or in the reverse direction (reverse shift register) when a pulse input is turned on.
  • Page 70 5: B ASIC NSTRUCTIONS Program List Ladder Diagram Reset Instruction Data Pulse Data Timing Chart Reset Input I0 One scan or more is required Pulse Input I1 Data Input I2 R0/Q0 R1/Q1 R2/Q2 R3/Q3 Program List Ladder Diagram Reset Instruction Data Pulse Data...
  • Page 71 5: B ASIC NSTRUCTIONS Reverse Shift Register (SFRN) For reverse shifting, use the SFRN instruction. When SFRN instructions are programmed, two addresses are always required. The SFRN instructions are entered, followed by a shift register number selected from appropriate device addresses. The shift register number corresponds to the lowest bit number in a string.
  • Page 72 5: B ASIC NSTRUCTIONS Bidirectional Shift Register A bidirectional shift register can be created by first programming the SFR instruction as detailed in the Forward Shift Register section on page 5-23. Next, the SFRN instruction is programed as detailed in the Reverse Shift Register section on page 5-25. Program List Ladder Diagram Reset...
  • Page 73: Sotu And Sotd (Single Output Up And Down)

    5: B ASIC NSTRUCTIONS SOTU and SOTD (Single Output Up and Down) The SOTU instruction “looks for” the transition of a given input from off to on. The SOTD instruction looks for the transition of a given input from on to off. When this transition occurs, the desired output will turn on for the length of one scan. The SOTU or SOTD instruction converts an input signal to a “one-shot”...
  • Page 74: Mcs And Mcr (Master Control Set And Reset)

    5: B ASIC NSTRUCTIONS MCS and MCR (Master Control Set and Reset) The MCS (master control set) instruction is usually used in combination with the MCR (master control reset) instruction. The MCS instruction can also be used with the END instruction, instead of the MCR instruction. When the input preceding the MCS instruction is off, the MCS is executed so that all inputs to the portion between the MCS and the MCR are forced off.
  • Page 75 5: B ASIC NSTRUCTIONS Multiple Usage of MCS instructions Program List Ladder Diagram Instruction Data This master control circuit will give priority to I1, I3, and I5, in that order. When input I1 is off, the first MCS is executed so that subsequent inputs I2 through I6 are forced off. When input I1 is on, the first MCS is not executed so that the following program is executed according to the actual input statuses of I2 through I6.
  • Page 76: Jmp (Jump) And Jend (Jump End)

    5: B ASIC NSTRUCTIONS JMP (Jump) and JEND (Jump End) The JMP (jump) instruction is usually used in combination with the JEND (jump end) instruction. At the end of a program, the JMP instruction can also be used with the END instruction, instead of the JEND instruction. without These instructions are used to proceed through the portion of the program between the JMP and the JEND processing.
  • Page 77: End

    5: B ASIC NSTRUCTIONS Program List Ladder Diagram Instruction Data JEND JEND This jump circuit will give priority to I1, I3, and I5, in that order. When input I1 is on, the first JMP is executed so that subsequent output statuses of Q0 through Q2 are held. When input I1 is off, the first JMP is not executed so that the following program is executed according to the actual input statuses of I2 through When I1 is off and I3 is on, the second JMP is executed so that subsequent output statuses of Q1 and Q2 are held.
  • Page 78: Restriction On Ladder Programming

    5: B ASIC NSTRUCTIONS Restriction on Ladder Programming Due to the structure of WindLDR, the following ladder diagram cannot be programmed — a closed circuit block is formed by vertical lines, except for right and left power rails, and the closed circuit block contains one or more prohibited instructions shown in the table below.
  • Page 79: Mov (Move)

    6: M NSTRUCTIONS Introduction Data can be moved using the MOV (move), MOVN (move not), IMOV (indirect move), or IMOVN (indirect move not) instruction. The moved data is 16- or 32-bit data, and the repeat operation can also be used to increase the quantity of data moved. In the MOV or MOVN instruction, the source and destination device are designated by S1 and D1 directly.
  • Page 80 6: M NSTRUCTIONS Examples: MOV Data Type: Word D10  M0 MOV(W) S1 – D1 – When input I2 is on, the data in data register D10 designated by source device S1 is moved to 16 internal relays starting with M0 designated by destination device D1. 12345 M0 through M7, M10 through M17 The data in the source data register is converted into 16-bit binary data, and the...
  • Page 81 6: M NSTRUCTIONS Repeat Operation in the Move Instructions Repeat Source Device When the S1 (source) is designated with repeat, devices as many as the repeat cycles starting with the device designated by S1 are moved to the destination. As a result, only the last of the source devices is moved to the destination. Data Type: Word ...
  • Page 82 6: M NSTRUCTIONS Data Type: Double Word  Source (Repeat = 3) Destination (Repeat = 3) MOV(D) S1 R D1 R Data Type: Float  When a source data does not comply with the normal floating-point format in any repeat operation, a user program execution error occurs, and the source data is not moved to the destination.
  • Page 83: Movn (Move Not)

    6: M NSTRUCTIONS MOVN (Move Not) S1 NOT  D1 When input is on, 16- or 32-bit data from device designated by S1 is inverted bit by bit MOVN(*) S1(R) D1(R) and moved to device designated by D1. ***** ***** Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 84: Imov (Indirect Move)

    6: M NSTRUCTIONS IMOV (Indirect Move) S1 + S2  D1 + D2 IMOV(*) S1(R) D1(R) When input is on, the values contained in devices designated by S1 ***** ***** ***** ***** and S2 are added to determine the source of data. The 16- or 32-bit data so determined is moved to destination, which is determined by the sum of values contained in devices designated by D1 and D2.
  • Page 85 6: M NSTRUCTIONS Example: IMOV Data Type: Word  IMOV(W) S1 – D1 – D20 C10  D10 + D25 Source device S1 and destination device D1 determine the type of device. Source device S2 and destination device D2 are the offset values to determine the source and destination devices. 6450 If the current value of counter C10 designated by source device S2 is 4, the source data is determined by adding the offset to data register D20 designated by source device S1:...
  • Page 86: Imovn (Indirect Move Not)

    6: M NSTRUCTIONS IMOVN (Indirect Move Not) S1 + S2 NOT  D1 + D2 IMOVN(*) S1(R) D1(R) When input is on, the values contained in devices designated by S1 ***** ***** ***** ***** and S2 are added to determine the source of data. The 16- or 32-bit data so determined is inverted and moved to destination, which is determined by the sum of values contained in devices designated by D1 and D2.
  • Page 87: Bmov (Block Move)

    6: M NSTRUCTIONS BMOV (Block Move) S1, S1+1, S1+2, ... , S1+N–1  D1, D1+1, D1+2, ... , D1+N–1 BMOV(W) When input is on, N blocks of 16-bit word data starting with device designated by S1 ***** ***** ***** are moved to N blocks of destinations, starting with device designated by D1. N-W specifies the quantity of blocks to move.
  • Page 88: Ibmv (Indirect Bit Move)

    6: M NSTRUCTIONS IBMV (Indirect Bit Move) S1 + S2  D1 + D2 IBMV S1(R) D1(R) When input is on, the values contained in devices designated by S1 ***** ***** ***** ***** and S2 are added to determine the source of data. The 1-bit data so determined is moved to destination, which is determined by the sum of values contained in devices designated by D1 and D2.
  • Page 89 6: M NSTRUCTIONS D10 5 D20 + 12 IBMV S1 – D1 – SOTU Since source device S1 is a data register and the value of source device Bit 15 14 13 12 11 10 S2 is 5, the source data is bit 5 of data register D10 designated by source device S1.
  • Page 90: Ibmvn (Indirect Bit Move Not)

    6: M NSTRUCTIONS IBMVN (Indirect Bit Move Not) S1 + S2 NOT  D1 + D2 IBMVN S1(R) D1(R) When input is on, the values contained in devices designated by S1 ***** ***** ***** ***** and S2 are added to determine the source of data. The 1-bit data so determined is inverted and moved to destination, which is determined by the sum of values contained in devices designated by D1 and D2.
  • Page 91: Nset (N Data Set)

    6: M NSTRUCTIONS NSET (N Data Set) S1, S2, S3, ... , Sn  D1, D2, D3, ... , Dn ..NSET(*) When input is on, N blocks of 16- or 32-bit data in devices designated by S1, ***** ***** ***** ***** S2, S3, ...
  • Page 92: Nrs (N Data Repeat Set)

    6: M NSTRUCTIONS NRS (N Data Repeat Set) S1  D1, D2, D3, ... , Dn–1 NRS(*) When input is on, 16- or 32-bit data designated by S1 is set to N blocks of ***** ***** ***** destinations, starting with device designated by D1. N blocks of 16-/32-bit data First 16-/32-bit data Source data for repeat set...
  • Page 93: Xchg (Exchange)

    6: M NSTRUCTIONS XCHG (Exchange) Word data type: D1  D2 D1·D1+1  D2, D2+1 XCHG(*) Double-word data type: ***** ***** When input is on, the 16- or 32-bit data in devices designated by D1 and D2 are exchanged with each other.
  • Page 94: Tccst (Timer/Counter Current Value Store)

    6: M NSTRUCTIONS TCCST (Timer/Counter Current Value Store) S1  D1 TCCST(*) S1(R) D1(R) When input is on, 16- or 32-bit data designated by S1 is read out and stored to the ***** ***** current value of device designated by D1. Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 95: Cmp= (Compare Equal To)

    7: D OMPARISON NSTRUCTIONS Introduction Data can be compared using data comparison instructions, such as equal to, unequal to, less than, greater than, less than or equal to, and greater than or equal to. When the comparison result is true, an output or internal relay is turned on. The repeat operation can also be used to compare more than one set of data.
  • Page 96 7: D OMPARISON NSTRUCTIONS Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A-Touch Valid Devices Device Function Constant Repeat Repeat Result Logical AND or OR operation — — — — — — — — — S1 (Source 1) Data to compare 1-99 S2 (Source 2) Data to compare...
  • Page 97 7: D OMPARISON NSTRUCTIONS Data Type: Integer  CMP>=(I) S1 – S2 – D1 – –3 Q1 turned on –4 –3 Q1 turned off Data Type: Double Word  CMP>=(D) S1 – S2 – D1 – D50·D51 23456789 D60·D61 12345678 Q2 turned on 23456789 34567890...
  • Page 98 7: D OMPARISON NSTRUCTIONS Repeat Operation in the Data Comparison Instructions The following examples are described using the CMP instruction of the word and double word data types. Repeat operation for all other data comparison instructions and other data types is the same as the following examples. When the repeat operation is enabled, repeated comparison results of CMP instructions can be selected from AND or OR operation, and the result is outputted to an output or internal relay.
  • Page 99 7: D OMPARISON NSTRUCTIONS Repeat Source and Destination Devices When S1, S2 (source), and D1 (destination) are designated to repeat, source devices (as many as the repeat cycles, starting with the devices designated by S1 and S2) are compared with each other. The comparison results are set to destination devices (as many as the repeat cycles, starting with the device designated by D1).
  • Page 100: Icmp>= (Interval Compare Greater Than Or Equal To)

    7: D OMPARISON NSTRUCTIONS ICMP>= (Interval Compare Greater Than or Equal To)    Data type W or I: D1 on    Data type D, L, F: S1·S1+1 S2·S2+1 S3·S3+1 D1 on ICMP>=(*) When input is on, the 16- or 32-bit data designated by S1, S2, and S3 are ***** ***** *****...
  • Page 101 7: D OMPARISON NSTRUCTIONS Example: ICMP>= D10  D11  D12  Q1 goes on ICMP>=(W) SOTU When input I0 is turned on, data of data registers D10, D11, and D12 designated by source devices S1, S2, and S3 are compared. When the condition is met, internal relay Q1 designated by destination device D1 is turned on.
  • Page 102: Lc= (Load Compare Equal To)

    7: D OMPARISON NSTRUCTIONS LC= (Load Compare Equal To) Data type W or I: S1 = S2 Data type D, L, or F: S1·S1+1 = S2·S2+1 LC=(*) This instruction constantly compares 16- or 32- bit data designated by S1 and S2. When S1 data is equal ***** ***** to S2 data, the output to the following instructions is turned on.
  • Page 103 7: D OMPARISON NSTRUCTIONS Valid Data Types W (word) When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is designated, 16 points (word or integer data type) or 32 points (double-word or long data type) are used. I (integer) D (double word) When a word device such as T (timer), C (counter), or D (data register) is designated, 1 point (word or integer...
  • Page 104 7: D OMPARISON NSTRUCTIONS 7-10 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 105: Add (Addition)

    8: B INARY RITHMETIC NSTRUCTIONS Introduction The binary arithmetic instructions make it possible for the user to program computations using addition, subtraction, multiplication, and division. For addition and subtraction devices, internal relay M8003 is used to carry or to borrow. The ROOT instruction can be used to calculate the square root of the value stored in one or two data registers.
  • Page 106 8: B INARY RITHMETIC NSTRUCTIONS Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A-Touch Valid Devices Device Function Constant Repeat S1 (Source 1) Data for calculation 1-99 S2 (Source 2) Data for calculation 1-99 D1 (Destination 1) Destination to store results —...
  • Page 107 8: B INARY RITHMETIC NSTRUCTIONS Examples: ADD Data Type: Word  This example demonstrates the use of a carry signal from special internal relay M8003 to set an alarm signal. D2 + 500  D2 ADD(W) S1 – S2 – D1 –...
  • Page 108 8: B INARY RITHMETIC NSTRUCTIONS Examples: MUL Data Type: Word  MUL(W) S1 – S2 – D1 – 300000  D30·D31 (01F4h) (0258h) (000493E0h) When input I1 is on, data of D10 is multiplied by data of D20, and the result is set to D30 and D31. (0004h) 37856 (93E0h)
  • Page 109 8: B INARY RITHMETIC NSTRUCTIONS Examples: DIV Data Type: Word  ÷ DIV(W) S1 – S2 – D1 – Quotient Remainder When input I2 is on, data of D10 is divided by data of D20. The quotient is set to D30, and the remainder is set to D31.
  • Page 110 8: B INARY RITHMETIC NSTRUCTIONS Repeat Operation in the ADD and SUB Instructions Source devices S1 and S2 and destination device D1 can be designated to repeat individually or in combination. When destination device D1 is not designated to repeat, the final result is set to destination device D1. When repeat is designated, consecutive devices as many as the repeat cycles starting with the designated device are used.
  • Page 111 8: B INARY RITHMETIC NSTRUCTIONS Repeat Source and Destination Devices Data Type: Word and Integer  When S1 (source) and D1 (destination) are designated to repeat, different results are set to 3 devices starting with D1. S1 (Repeat = 3) S2 (Repeat = 0) D1 (Repeat = 3) ADD(W)
  • Page 112 8: B INARY RITHMETIC NSTRUCTIONS Repeat Operation in the MUL Instruction Since the MUL (multiplication) instruction uses two destination devices, the result is stored to destination devices as described below. Source devices S1 and S2 and destination device D1 can be designated to repeat individually or in combination. When destination device D1 is not designated to repeat, the final result is set to destination device D1 and D1+1.
  • Page 113 8: B INARY RITHMETIC NSTRUCTIONS Repeat Source and Destination Devices When S1 (source) and D1 (destination) are designated to repeat, different results are set to 3 devices starting with D1·D1+1. Data Type: Word and Integer  S1 (Repeat = 3) S2 (Repeat = 0) D1 (Repeat = 3) MUL(W)
  • Page 114 8: B INARY RITHMETIC NSTRUCTIONS Repeat Operation in the DIV Instruction Since the DIV (division) instruction (except the float data type) uses two destination devices, the quotient and remainder are stored as described below. Source devices S1 and S2 and destination device D1 can be designated to repeat individually or in combination.
  • Page 115 8: B INARY RITHMETIC NSTRUCTIONS Repeat Two Source Devices Data Type: Word and Integer  When S1 and S2 (source) are designated to repeat, the final result is set to destination devices D1 and D1+1. S1 (Repeat = 3) S2 (Repeat = 3) D1 (Repeat = 0) DIV(W) S1 R...
  • Page 116 8: B INARY RITHMETIC NSTRUCTIONS Repeat All Source and Destination Devices Data Type: Word and Integer  When all devices are designated to repeat, different results are set to 6 devices starting with D1. S1 (Repeat = 3) S2 (Repeat = 3) D1 (Repeat = 3) DIV(W) S1 R...
  • Page 117: Inc (Increment)

    8: B INARY RITHMETIC NSTRUCTIONS INC (Increment) Data type W or I: S/D + 1  S/D S/D·S/D+1 + 1  S/D·S/D+1 Data type D or L: INC(*) ***** When input is on, one is added to the 16- or 32-bit data designated by device S/D and the result is stored to the same device.
  • Page 118: Root (Root)

    8: B INARY RITHMETIC NSTRUCTIONS ROOT (Root) Data type W:  ROOT(*) When input is on, the square root of device designated by S1 is extracted ***** ***** and is stored to the destination designated by D1. The square root is calculated to two decimals, omitting the figures below the second place of decimals, and multiplied by 100.
  • Page 119: Sum (Sum)

    8: B INARY RITHMETIC NSTRUCTIONS SUM (Sum) Calculate the total of designated data, depending on the calculation option. SUM(*) ADD: ADD/XOR ***** ***** ***** When input is on, N blocks of 16- or 32-bit data starting at device designated by S1 are added and the result is stored to device designated by D1.
  • Page 120 8: B INARY RITHMETIC NSTRUCTIONS Carry and Borrow In advanced instructions involving D (double word), L (long), or F (floating point) data, special internal relay M8003 (carry and borrow) is turned on when the execution of the instruction results in the following value. Data Type M8003 Execution Result...
  • Page 121 8: B INARY RITHMETIC NSTRUCTIONS Data Type: Integer  –500 –4566 SUM(I) SOTU D100·D101 (FE0Ch) (FFFFEE2Ah) D100 (0019h) –4095 (F001h) (0004h) Data Type: Double Word  100000 1000000 SUM(D) SOTU D0·D1 D100·D101 (000186A0h) (000F4240h) D100 200000 D2·D3 (00030D40h) 300000 D4·D5 (000493E0h) 400000 D6·D7...
  • Page 122 8: B INARY RITHMETIC NSTRUCTIONS 8-18 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 123: Andw (And Word)

    9: B OOLEAN OMPUTATION NSTRUCTIONS Introduction Boolean computations use the AND, OR, and exclusive OR statements as carried out by the ANDW, ORW, and XORW instructions in the word or double-word data type, respectively. ANDW (AND Word) S1 · S2  D1 ANDW(*) S1(R) S2(R)
  • Page 124 9: B OOLEAN OMPUTATION NSTRUCTIONS Valid Devices Device Function Constant Repeat S1 (Source 1) Data for computation 1-99 S2 (Source 2) Data for computation 1-99 D1 (Destination 1) Destination to store results — — 1-99 For the valid device address range, see pages 6-1 and 6-2 (Basic Vol.). Internal relays M0 through M1277 can be designated as D1.
  • Page 125 9: B OOLEAN OMPUTATION NSTRUCTIONS Repeat Operation in the ANDW, ORW, and XORW Instructions Source devices S1 and S2 and destination device D1 can be designated to repeat individually or in combination. When destination device D1 is not designated to repeat, the final result is set to destination device D1. When repeat is designated, consecutive devices as many as the repeat cycles starting with the designated device are used.
  • Page 126 9: B OOLEAN OMPUTATION NSTRUCTIONS Repeat Source and Destination Devices Data Type: Word  When S1 (source) and D1 (destination) are designated to repeat, different results are set to 3 devices starting with D1. S1 (Repeat = 3) S2 (Repeat = 0) D1 (Repeat = 3) ANDW(W) S1 R...
  • Page 127: Sftl (Shift Left)

    10: S HIFT OTATE NSTRUCTIONS Introduction Bit shift instructions are used to shift the data string starting with source device S1 to the left or right by 1 to 15 bits as designated. The data string can be 1 to 65535 bits. The result is set to the source device S1 and a carry (special internal relay M8003). The LSB or MSB is filled with 0 or 1 as designated.
  • Page 128 10: S HIFT OTATE NSTRUCTIONS Examples: SFTL N_B = 16 bits  M8120 is the initialize pulse special internal relay. MOV(W) S1 – D1 – When the CPU starts operation, the MOV (move) instruction sets 43690 M8120 43690 to data register D10. SFTL Bits Each time input I0 is turned on, 16-bit data of data register D10 is...
  • Page 129: Sftr (Shift Right)

    10: S HIFT OTATE NSTRUCTIONS SFTR (Shift Right) S1  CY SFTR Bits When input is on, N_B-bit data string starting with source device S1 is ***** ***** ***** shifted to the right by the quantity of bits designated by device Bits. The result is set to source device S1, and the last bit status shifted out is set to a carry (special internal relay M8003).
  • Page 130 10: S HIFT OTATE NSTRUCTIONS Example: SFTR Data Type: Word  M8120 is the initialize pulse special internal relay. MOV(W) S1 – D1 – When the CPU starts operation, the MOV (move) instruction sets M8120 29 to data register D10. SFTR Bits Each time input I0 is turned on, 16-bit data of data register D10...
  • Page 131: Bcdls (Bcd Left Shift)

    10: S HIFT OTATE NSTRUCTIONS BCDLS (BCD Left Shift) When input is on, the 32-bit binary data designated by S1 is converted into 8 BCD digits, shifted to the left by the quantity of digits designated by S2, and converted back to 32-bit BCDLS binary data.
  • Page 132 10: S HIFT OTATE NSTRUCTIONS Example: BCDLS M8120 is the initialize pulse special internal relay. MOV(W) S1 – D1 – When the CPU starts operation, the MOV (move) instructions set 123 and 4567 to data M8120 registers D10 and D11, respectively. MOV(W) S1 –...
  • Page 133: Wsft (Word Shift)

    10: S HIFT OTATE NSTRUCTIONS WSFT (Word Shift) When input is on, N blocks of 16-bit word data starting with device designated by D1 are shifted up to the next 16-bit positions. At the same time, the data designated by WSFT device S1 is moved to device designated by D1.
  • Page 134: Rotl (Rotate Left)

    10: S HIFT OTATE NSTRUCTIONS ROTL (Rotate Left) When input is on, 16- or 32-bit data of the designated source device S1 is rotated to the left by the ROTL(*) bits quantity of bits designated by device bits. ***** The result is set to the source device S1, and the last bit status rotated out is set to a carry (special internal relay M8003).
  • Page 135 10: S HIFT OTATE NSTRUCTIONS Example: ROTL Data Type: Word  M8120 is the initialize pulse special internal relay. MOV(W) S1 – D1 – When the CPU starts operation, the MOV (move) instruction sets 40966 to data register 40966 M8120 D10.
  • Page 136: Rotr (Rotate Right)

    10: S HIFT OTATE NSTRUCTIONS ROTR (Rotate Right) When input is on, 16- or 32-bit data of the designated source device S1 is rotated to the right by the quantity of bits designated by device bits. ROTR(*) bits ***** The result is set to the source device S1, and the last bit status rotated out is set to a carry (special internal relay M8003).
  • Page 137 10: S HIFT OTATE NSTRUCTIONS Example: ROTR Data Type: Word  M8120 is the initialize pulse special internal relay. MOV(W) S1 – D1 – When the CPU starts operation, the MOV (move) instruction sets 13 to data register M8120 D20. ROTR(W) bits Each time input I1 is turned on, 16-bit data of data register D20 is rotated to the right by...
  • Page 138 10: S HIFT OTATE NSTRUCTIONS 10-12 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 139: Data Conversion Instructions

    11: D ONVERSION NSTRUCTIONS Introduction Data conversion instructions convert data format among binary, BCD, and ASCII. The ENCO (encode), DECO (decode), and BCNT (bit count) instructions processes bit device data. The ALT (alternate output) instruction turns on and off an output each time an input button is pressed. The CVDT (convert data type) instruction converts data types among W (word), I (integer), D (double word), L (long), and F (float).
  • Page 140 11: D ONVERSION NSTRUCTIONS Examples: HTOB Data Type: Word  Binary HTOB(W) SOTU (0000h) (0000h) 1234 4660 (04D2h) (1234h) 9999 39321 (270Fh) (9999h) Data Type: Double Word  Binary HTOB(D) SOTU (0000h) (0000h) (0000h) (0000h) 4660 (00BCh) (1234h) 24910 22136 (614Eh) (5678h) 1525...
  • Page 141: Btoh (Bcd To Hex)

    11: D ONVERSION NSTRUCTIONS BTOH (BCD to Hex) S1  D1 BTOH(*) When input is on, the BCD data designated by S1 is converted into 16- or 32-bit binary data and ***** ***** stored to the destination designated by device D1. Valid values for the source device are 0 through 9999 (BCD) for the word data type, and 0 through 9999 9999 (BCD) for the double-word data type.
  • Page 142 11: D ONVERSION NSTRUCTIONS Examples: BTOH Data Type: Word  Binary BTOH(W) SOTU (0000h) (0000h) 4660 1234 (1234h) (04D2h) 39321 9999 (9999h) (270Fh) Data Type: Double Word  Binary BTOH(D) SOTU (0000h) (0000h) (0000h) (0000h) 4660 (1234h) (00BCh) 22136 24910 (5678h) (614Eh) 39321...
  • Page 143: Htoa (Hex To Ascii)

    11: D ONVERSION NSTRUCTIONS HTOA (Hex to ASCII) S1 D1, D1+1, D1+2, D1+3 HTOA(W) When input is on, the 16-bit binary data designated by S1 is read from the lowest digit ***** ***** ***** as many as the quantity of digits designated by S2, converted into ASCII data, and stored to the destination starting with the device designated by D1.
  • Page 144 11: D ONVERSION NSTRUCTIONS Examples: HTOA Quantity of Digits: 4  Binary ASCII HTOA(W) 4660 SOTU (1234h) (0031h) (0032h) (0033h) (0034h) Quantity of Digits: 3  Binary ASCII HTOA(W) 4660 SOTU (1234h) (0032h) (0033h) (0034h) Quantity of Digits: 2  Binary ASCII HTOA(W)
  • Page 145: Atoh (Ascii To Hex)

    11: D ONVERSION NSTRUCTIONS ATOH (ASCII to Hex) S1, S1+1, S1+2, S1+3  D1 ATOH(W) When input is on, the ASCII data designated by S1 as many as the quantity of digits ***** ***** ***** designated by S2 is converted into 16-bit binary data, and stored to the destination designated by device D1.
  • Page 146 11: D ONVERSION NSTRUCTIONS Examples: ATOH Quantity of Digits: 4  ASCII Binary ATOH(W) 4660 SOTU (0031h) (1234h) (0032h) (0033h) (0034h) Quantity of Digits: 3  ASCII Binary ATOH(W) SOTU (0031h) (0123h) (0032h) (0033h) Quantity of Digits: 2  ASCII Binary ATOH(W) SOTU...
  • Page 147: Btoa (Bcd To Ascii)

    11: D ONVERSION NSTRUCTIONS BTOA (BCD to ASCII) Word data type: S1  D1, D1+1, D1+2, D1+3, D1+4 S1·S1+1  D1, D1+1, D1+2, ... , D1+9 Double-word data type: BTOA(*) When input is on, the 16- or 32-bit binary data designated by S1 is converted into ***** ***** *****...
  • Page 148 11: D ONVERSION NSTRUCTIONS Examples: BTOA(W) Quantity of Digits: 5  Binary ASCII BTOA(W) SOTU 12345 (3039h) (0031h) (0032h) (0033h) (0034h) (0035h) Quantity of Digits: 4  ASCII Binary BTOA(W) SOTU 12345 (3039h) (0032h) (0033h) (0034h) (0035h) Quantity of Digits: 3 ...
  • Page 149 11: D ONVERSION NSTRUCTIONS Examples: BTOA(D) Quantity of Digits: 10  ASCII Binary BTOA(D) SOTU 1234567890 D10·D11 (499602D2h) (0031h) (0032h) (0033h) (0034h) (0035h) (0036h) (0037h) (0038h) (0039h) (0030h) Quantity of Digits: 6  Binary ASCII BTOA(D) SOTU 1234567890 D10·D11 (499602D2h) (0035h) (0036h) (0037h)
  • Page 150: Atob (Ascii To Bcd)

    11: D ONVERSION NSTRUCTIONS ATOB (ASCII to BCD) Word data type: S1, S1+1, S1+2, S1+3, S1+4  D1 S1, S1+1, S1+2, ... , S1+9  D1·D1+1 Double-word data type: ATOB(*) ***** ***** ***** When input is on, the ASCII data designated by S1 as many as the quantity of digits designated by S2 is converted into BCD, and converted into 16- or 32-bit binary data.
  • Page 151 11: D ONVERSION NSTRUCTIONS Examples: ATOB(W) Quantity of Digits: 5  ASCII Binary ATOB(W) SOTU 12345 (0031h) (3039h) (0032h) (0033h) (0034h) (0035h) Quantity of Digits: 4  ASCII Binary ATOB(W) SOTU 1234 (0031h) (04D2h) (0032h) (0033h) (0034h) Quantity of Digits: 3 ...
  • Page 152 11: D ONVERSION NSTRUCTIONS Examples: ATOB(D) Quantity of Digits: 10  ASCII Binary ATOB(D) SOTU 1234567890 D20·D21 (499602D2h) (0031h) (0032h) (0033h) (0034h) (0035h) (0036h) (0037h) (0038h) (0039h) (0030h)  Quantity of Digits: 6 ASCII Binary ATOB(D) SOTU 123456 D20·D21 (0031h) (0001E240h) (0032h) (0033h)
  • Page 153: Enco (Encode)

    11: D ONVERSION NSTRUCTIONS ENCO (Encode) When input is on, a bit which is on is sought. The search begins at S1 until the first point which is ENCO set (on) is located. The quantity of points from S1 to the first set point (offset) is stored to the Bits ***** *****...
  • Page 154: Deco (Decode)

    11: D ONVERSION NSTRUCTIONS DECO (Decode) When input is on, the values contained in devices designated by S1 and D1 are added to determine the destination, and the bit so determined is turned on. DECO ***** ***** Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40...
  • Page 155: Bcnt (Bit Count)

    11: D ONVERSION NSTRUCTIONS BCNT (Bit Count) When input is on, bits which are on are sought in an array of consecutive bits starting at the point designated by source device S1. Source device S2 designates the quantity BCNT of bits searched. The quantity of bits which are on is stored to the destination ***** ***** *****...
  • Page 156: Alt (Alternate Output)

    11: D ONVERSION NSTRUCTIONS ALT (Alternate Output) When input is turned on, output, internal relay, or shift register bit designated by D1 is turned on and remains on after the input is turned off. SOTU ***** When input is turned on again, the designated output, internal relay, or shift register bit is turned off.
  • Page 157: Cvdt (Convert Data Type)

    11: D ONVERSION NSTRUCTIONS CVDT (Convert Data Type) S1  D1 When input is on, the data type of the 16- or 32-bit data designated by S1 is converted CVDT S1(R) D1(R) * TO * and stored to the destination designated by device D1. ***** ***** Data types can be designated for the source and destination, separately...
  • Page 158 11: D ONVERSION NSTRUCTIONS Examples: CVDT Data Type: Either S1 or D1 is not F (float)  Unless F (float) data type is selected for both source and destination, only the integral number is moved, omitting the fraction. Device Data Type Value CVDT S1 –...
  • Page 159: Dtdv (Data Divide)

    11: D ONVERSION NSTRUCTIONS DTDV (Data Divide) S1  D1, D1+1 DTDV(W) When input is on, the 16-bit binary data designated by S1 is divided into upper and lower bytes. ***** ***** The upper byte data is stored to the destination designated by device D1. The lower byte data is stored to the device next to D1.
  • Page 160: Dtcb (Data Combine)

    11: D ONVERSION NSTRUCTIONS DTCB (Data Combine) S1, S1+1  D1 DTCB(W) When input is on, the lower-byte data is read out from 2 consecutive sources starting with device ***** ***** designated by S1 and combined to make 16-bit data. The lower byte data from the first source device is moved to the upper byte of the destination designated by device D1, and the lower byte data from the next source device is moved to the lower byte of the destination.
  • Page 161: Swap (Data Swap)

    11: D ONVERSION NSTRUCTIONS SWAP (Data Swap) S1  D1 When input is on, upper and lower byte- or word-data of a word- or double-word-data SWAP(*) S1(R) D1(R) designated by S1 are exchanged, and the result is stored to destination designated by ***** ***** Applicable CPU Modules...
  • Page 162 11: D ONVERSION NSTRUCTIONS 11-24 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 163: Week (Weekly Timer)

    12: C ALENDAR OMPARISON NSTRUCTIONS Introduction The calendar comparison instructions turn output on or off in a specified interval. WEEK (Weekly Timer) The WEEK instruction compares the specified day of the week, ON time, and OFF time with the current time and outputs that result. WEEK When the input is on, the output specified by D1 is turned on when the day of the *****...
  • Page 164 12: C ALENDAR OMPARISON NSTRUCTIONS Settings There are two methods to configure the day of the week and the time for the WEEK instruction. Specify the method on the Device tab with Data register settings. Configuring the day of the week and the time as fixed settings  ...
  • Page 165 12: C ALENDAR OMPARISON NSTRUCTIONS 4. S3 (source 3): Number of parameter tabs This setting configures the number of parameter tabs. When this value is increased or decreased, the number of parameter tabs displayed on the dialog box increases or decreases. 6 bytes of the user program region are used for each parameter tab. For the settings, see "Parameter tab"...
  • Page 166 12: C ALENDAR OMPARISON NSTRUCTIONS 2. OFF settings This section configures the day of the week and the time to turn off the output. The output is turned off at the specified time for the specified day of the week. Setting Description Range...
  • Page 167 12: C ALENDAR OMPARISON NSTRUCTIONS To configure the days of the week and the time by specifying data registers The day of the week and the time for the ON/OFF settings are configured according to the values stored in the specified data registers.
  • Page 168 12: C ALENDAR OMPARISON NSTRUCTIONS 3. S2 (source 2): Initialization input This setting specifies the device to initialize the days of the week and the times stored in the data register region that starts from S1 (source 1). The values configured on the parameter tabs are stored in the data registers by turning on the initialization input. This setting is only used when indirectly specifying the settings for the WEEK instruction with data registers.
  • Page 169 12: C ALENDAR OMPARISON NSTRUCTIONS Data Register Allocation If indirectly specifying the settings for the WEEK instruction with data registers, the settings are allocated to the data registers are follows. Storage destination Data size (word) R (Read)/W (Write) Setting Start address+0 Day of the week Start address+1 P 1 tab...
  • Page 170 12: C ALENDAR OMPARISON NSTRUCTIONS Examples: WEEK [To turn on output Q0 Monday to Friday each week from 8:30 to 17:15] Parameter tab Configure the tab as shown above and set D1 to Q0. Ladder program WEEK M8125 [To turn on output Q0 Tuesday, Wednesday, and Saturday each week from 20:30 to 1:15 the next day] Parameter tab Configure the tab as shown above and set D1 to Q0.
  • Page 171 12: C ALENDAR OMPARISON NSTRUCTIONS [To turn on output Q0 Monday, Wednesday, and Friday each week from 6:00 to 9:00, 15:00 to 18:00, and 22:00 to 0:00 the next day] Parameter tab Configure the settings using three tabs. On P 1 tab, configure the output to turn on Monday, Wednesday, and Friday from 6:00 to 9:00. On P 2 tab, configure the output to turn on Monday, Wednesday, and Friday from 15:00 to 18:00.
  • Page 172 12: C ALENDAR OMPARISON NSTRUCTIONS Ladder program WEEK M8125 [To indirectly specify the settings with data registers] This example describes turning on output Q0 Monday to Friday each week from 8:30 to 17:15 as an example. Select the Data register settings check box and set S1 to D0 and S2 to M0. Parameter tab Data register allocation The settings on the P 1 tab are allocated to data registers D0 to D2 as shown in the table below.
  • Page 173: Year (Yearly Timer)

    12: C ALENDAR OMPARISON NSTRUCTIONS YEAR (Yearly Timer) The YEAR instruction compares the specified date with the current date and outputs that result. With this instruction you can specify special dates within a YEAR one year period. ***** ***** ***** ***** When the input is on, the output specified by D1 is turned on when the date specified by the ON settings matches the current date.
  • Page 174 12: C ALENDAR OMPARISON NSTRUCTIONS Settings There are two methods to configure dates for the YEAR instruction. Specify the method on the Device tab with Data register settings. Configure the dates as a fixed setting  The dates for the ON/OFF settings are uniquely determined. The dates for the ON/OFF settings cannot be changed while the SmartAxis is running.
  • Page 175 12: C ALENDAR OMPARISON NSTRUCTIONS 4. S3 (source 3): Number of parameter tabs This setting configures the number of parameter tabs. When this value is increased or decreased, the number of parameter tabs displayed on the dialog box increases or decreases. 10 bytes of the user program region are used for each parameter tab. For the settings, see "Parameter tab"...
  • Page 176 12: C ALENDAR OMPARISON NSTRUCTIONS 3. ON settings This section configures the date to turn on the output. The output is turned on at 0:00 on the configured date. Setting Description Range Year Specifies the year to turn on the output. 2000 to 2099 Month Specifies the month to turn on the output.
  • Page 177 12: C ALENDAR OMPARISON NSTRUCTIONS Preview  The preview shows the ON/OFF state for the output based on the settings configured on the parameter tabs in a calendar. The dates that are set to ON are highlighted in orange. Three months are shown at one time. Setting Description Year...
  • Page 178 12: C ALENDAR OMPARISON NSTRUCTIONS To configure the dates by specifying data registers The dates for the ON/OFF settings are configured according to the values stored in the specified data registers. The dates for the ON/OFF settings can be changed while the SmartAxis is running. Device tab ...
  • Page 179 12: C ALENDAR OMPARISON NSTRUCTIONS 4. S3 (source 3): Number of parameter tabs This setting configures the number of parameter tabs. This setting is shared in common with "To configure the dates as a fixed setting". See "4. S3 (source 3): Number of parameter tabs"...
  • Page 180 12: C ALENDAR OMPARISON NSTRUCTIONS Data Register Allocation The settings configured on the parameter tabs are allocated to the data registers as follows. Storage R (Read)/ Data size (word) Setting destination W (Write) Start address+0 Year ON setting Start address+1 Month, Day or Day of the week P 1 tab Start address+2...
  • Page 181 12: C ALENDAR OMPARISON NSTRUCTIONS Example day of the week settings [When configured to turn on the output on January 1st] January 1st Reserved Month setting Reserved Day setting Month setting: 0001 = 1 Day setting: 00001 = 1 The value of the data register is 100000001 (binary) = 257 (decimal). [When configured to turn on the output on December 31st] December 31st Reserved...
  • Page 182 12: C ALENDAR OMPARISON NSTRUCTIONS Timing Chart when the Input Turns On during the Configured Interval When the input turns on or off during the interval between the ON settings and the OFF settings, and when the input is turns on or off after 0:00 on the date configured by the ON settings when pulse output is enabled, the timing chart is as follows.
  • Page 183 12: C ALENDAR OMPARISON NSTRUCTIONS When pulse output is enabled  The input is judged to be on or off at 0:00 on the date of the ON settings and the output is turned on. The current date is not compared with the ON settings when the input is turned on.
  • Page 184 12: C ALENDAR OMPARISON NSTRUCTIONS Examples: YEAR To configure the dates as fixed settings  [To turn on Q0 from 0:00 on September 1, 2011, to 0:00 on June 25, 2013] 2011 2012 2013 2014 ON date : 2011/09/01 OFF date : 2013/06/25 Yearly : OFF 6/25...
  • Page 185 12: C ALENDAR OMPARISON NSTRUCTIONS [To turn on output Q0 from 0:00 on August 12 to 0:00 on August 15 every year] 2009 2010 2011 2012 ON date : 2000/08/12 OFF date : 2099/08/15 Yearly : ON 8/12 8/15 8/12 8/15 8/12 8/15...
  • Page 186 12: C ALENDAR OMPARISON NSTRUCTIONS [To turn on output Q0 only on the 2nd Monday of each month from 2000 to 2099] *** January February March April ON date : 2000/**/2nd Monday OFF date : 2099/**/2nd Monday + 1 day Yearly : OFF Monthly : ON...
  • Page 187 12: C ALENDAR OMPARISON NSTRUCTIONS To configure the dates by specifying data registers  [To turn on Q0 from 0:00 on September 1, 2011, to 0:00 on June 25, 2013] 2011 2012 2013 2014 ON date : 2011/09/01 OFF date : 2013/06/25 Yearly : OFF 6/25...
  • Page 188 12: C ALENDAR OMPARISON NSTRUCTIONS 12-26 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 189: Label (Label)

    14: P ROGRAM RANCHING NSTRUCTIONS Introduction The program branching instructions reduce execution time by making it possible to bypass portions of the program whenever certain conditions are not satisfied. The basic program branching instructions are LABEL and LJMP, which are used to tag an address and jump to the address which has been tagged.
  • Page 190 14: P ROGRAM RANCHING NSTRUCTIONS Example: LJMP and LABEL The following example demonstrates a program to jump to three different portions of program depending on the input. When input I0 is on, program execution jumps to label 0. LJMP When input I1 is on, program execution jumps to label 1. LJMP LJMP When input I2 is on, program execution jumps to label 2.
  • Page 191: Lcal (Label Call)

    14: P ROGRAM RANCHING NSTRUCTIONS LCAL (Label Call) When input is on, the address with label 0 through 255 designated by S1 is called. When input is off, no call LCAL takes place, and program execution proceeds with the next instruction. ***** The LCAL instruction calls a subroutine, and returns to the main program after the branch is executed.
  • Page 192 14: P ROGRAM RANCHING NSTRUCTIONS Correct Structure for Calling Subroutine When a LCAL instruction is executed, the remaining program instructions on the same rung may not be executed upon return, if input conditions are changed by the subroutine. After the LRET instruction of a subroutine, program execution begins with the instruction following the LCAL instruction, depending on current input condition.
  • Page 193: Djnz (Decrement Jump Non-Zero)

    14: P ROGRAM RANCHING NSTRUCTIONS DJNZ (Decrement Jump Non-zero) When input is on, the value stored in the data register designated by S1 is decremented by one DJNZ and is checked. If the resultant value is not 0, program execution jumps to address with label 0 ***** ***** through 255 designated by S2.
  • Page 194 14: P ROGRAM RANCHING NSTRUCTIONS Example: DJNZ and LABEL The following example demonstrates a program to store consecutive values 1000 through 1049 to data registers D100 through D149, respectively. M8120 is the initialize pulse special internal relay. MOV(W) S1 – D1 –...
  • Page 195: Ioref (I/O Refresh)

    15: R EFRESH NSTRUCTIONS Introduction This chapter describes the refresh instructions to update the status of input contacts, external output , and the current value of the high-speed counter to the latest value during the ladder scan. IOREF (I/O Refresh) When input is on, 1-bit I/O data designated by source device S1 is refreshed immediately regardless of the IOREF scan time.
  • Page 196 15: R EFRESH NSTRUCTIONS Example: IOREF The following example demonstrates a program to transfer the input I0 status to output Q0 using the IOREF instruction. Input I2 Basic Vol.) is designated as an interrupt input. For the interrupt input function, see page 5-34 ( M8120 is the initialize pulse special internal relay.
  • Page 197: Hscrf (High-Speed Counter Refresh)

    15: R EFRESH NSTRUCTIONS HSCRF (High-speed Counter Refresh) When input is on, the HSCRF instruction refreshes the high-speed counter current values in special data registers in HSCRF real time. The current values of six high-speed counters HSC1 through HSC6 are usually updated in every scan. The HSCRF can be used in any place in the ladder diagram where you want to read the updated high-speed counter current value.
  • Page 198 15: R EFRESH NSTRUCTIONS 15-4 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 199: Di (Disable Interrupt)

    16: I NTERRUPT ONTROL NSTRUCTIONS Introduction The DI or EI instruction disables or enables interrupt inputs and timer interrupt individually. DI (Disable Interrupt) When input is on, interrupt inputs and timer interrupt designated by source device S1 are disabled. EI (Enable Interrupt) When input is on, interrupt inputs and timer interrupt designated by source device S1 are enabled.
  • Page 200 16: I NTERRUPT ONTROL NSTRUCTIONS Programming WindLDR In the Disable Interrupt (DI) or Enable Interrupt (EI) dialog box, click the check box on the left of Interrupt Inputs I0 through I7 or Timer Interrupt to select source device S1. The example below selects interrupt inputs I2, I3, and timer interrupt for the DI instruction, and a 22 will be shown as source device S1.
  • Page 201 16: I NTERRUPT ONTROL NSTRUCTIONS Example: DI and EI The following example demonstrates a program to disable and enable interrupt inputs and timer interrupt selectively. For the Basic Vol.) interrupt input and timer interrupt functions, see pages 5-34 and 5-36 ( .
  • Page 202 16: I NTERRUPT ONTROL NSTRUCTIONS 16-4 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 203: Xyfs (Xy Format Set)

    17: C OORDINATE ONVERSION NSTRUCTIONS Introduction The coordinate conversion instructions convert one data point to another value, using a linear relationship between values of X and Y. (X2, Y2) (X1, Y1) (X0, Y0) XYFS (XY Format Set) When input is on, the format for XY conversion is set. The XY ..
  • Page 204: Cvxty (Convert X To Y)

    17: C OORDINATE ONVERSION NSTRUCTIONS 65535 32767 Valid Coordinates 65535 –32768 65535 Valid Data Types W (word) When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is designated as Xn or Yn, 16 points are used.
  • Page 205: Cvytx (Convert Y To X)

    17: C OORDINATE ONVERSION NSTRUCTIONS D1 (Destination to store results) The conversion result of the Y value is stored to the destination. Data Type Word Integer S2 (X value) 0 to 65535 0 to 65535 D1 (Y value) 0 to 65535 –32768 to 32767 65535 32767...
  • Page 206 17: C OORDINATE ONVERSION NSTRUCTIONS D1 (Destination to store results) The conversion result of the X value is stored to the destination. Data Type Word Integer S2 (Y value) 0 to 65535 –32768 to 32767 D1 (X value) 0 to 65535 0 to 65535 65535 32767...
  • Page 207 17: C OORDINATE ONVERSION NSTRUCTIONS Example: Linear Conversion The following example demonstrates setting up two coordinate points to define the linear relationship between X and Y. The two points are (X0, Y0) = (0, 0) and (X1, Y1) = (8000, 4000). Once these are set, there is an X to Y conversion, as well as a Y to X conversion.
  • Page 208 17: C OORDINATE ONVERSION NSTRUCTIONS Example: Overlapping Coordinates In this example, the XYFS instruction sets up three coordinate points, which define two different linear relationships between X and Y. The three points are: (X0, Y0) = (0, 100), (X1, Y1) = (100, 0), and (X2, Y2) = (300, 100). The two line segments define overlapping coordinates for X.
  • Page 209: Average Instructions

    18: A VERAGE NSTRUCTIONS Introduction Average instructions are instructions that average the specified data. AVRG (Average) When input is on, sampling data designated by device S1 is AVRG(*) processed according to sampling conditions designated by ***** ***** ***** ***** ***** devices S2 and S3.
  • Page 210 18: A VERAGE NSTRUCTIONS Valid Data Types W (word) When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is designated as the source, 16 points (word or integer data type) or 32 points (double-word or long data type) are used. I (integer) D (double word) When a word device such as T (timer), C (counter), or D (data register) is designated as the source, 1 point...
  • Page 211: Puls (Pulse Output)

    19: P ULSE UTPUT NSTRUCTIONS Introduction The pulse output instructions output pulses of the specified frequency from the pulse output ports. PULS (Pulse Output) The PULS instructions output pulses of the specified frequency from the specified pulse output ports. PULS When the input is on, pulses are output according to the control register settings ***** *****...
  • Page 212 19: P ULSE UTPUT NSTRUCTIONS Settings Device tab  1. Select instruction This item selects the PULS instruction to use from PULS1, PULS2, PULS3, or PULS4. The pulse output, configurable operation modes, and enabling/disabling pulse counting varies based on the instruction. Instruction Pulse output Configurable operation mode...
  • Page 213 19: P ULSE UTPUT NSTRUCTIONS 3. S2 (source 2): Initialization input S2 specifies the initialization input. When the initialization input is turned on, the initial values configured in the WindLDR PULS instruction dialog box, on the Setting tab, are stored in the control registers. An external input (I0 to I35) (Note) or an internal relay (M0 to M1277) can be specified.
  • Page 214 19: P ULSE UTPUT NSTRUCTIONS 7. Pulse counting This setting enables or disables pulse counting. Supported instruction Pulse counting PULS1 PULS2 PULS3 PULS4 Pulses are continuously output while 0: Disable pulse counting the input is on. The number of pulses specified by the 1: Enable pulse counting —...
  • Page 215 19: P ULSE UTPUT NSTRUCTIONS Examples: PULS PULS1 instruction (pulse counting enabled) timing chart [PULS1 instruction, S1 is specified as D200, D1 is specified as internal relay M50] PULS D200 PULS1 instruction input PULS1 instruction input Output pulse D200 frequency Preset value D203, D204 Output pulse...
  • Page 216 19: P ULSE UTPUT NSTRUCTIONS PULS2 instruction (pulse counting disabled) timing chart [PULS2 instruction, S1 is specified as D100, D1 is specified as internal relay M200] PULS D100 D200 M200 PULS2 instruction input PULS2 instruction input Output pulse D100 frequency Output pulse Pulse output ON M200...
  • Page 217 19: P ULSE UTPUT NSTRUCTIONS Sample program This section describes an example program that outputs 5,000 pulses each at 200 Hz and then 60,000 pulses each at 500 Hz from output Q14 Turn on initialization input (M0) M8120 MOV(W) S1 - D1 - Store 50 (500 Hz) in frequency (D0) SOTU...
  • Page 218: Pwm (Variable Duty Cycle Pulse Output)

    19: P ULSE UTPUT NSTRUCTIONS PWM (Variable Duty Cycle Pulse Output) The PWM instructions output pulses at the specified frequency and duty cycle from the output port. When the input is on, pulses are output according to the control register settings ***** ***** *****...
  • Page 219 19: P ULSE UTPUT NSTRUCTIONS Settings Device tab  1. Select instruction This item selects the PWM instruction to use from PWM1, PWM2, PWM3, or PWM4. The pulse output, pulse duty cycle (ON ratio), and enabling/disabling pulse counting varies based on the instruction. Instruction Pulse output Pulse duty cycle (ON ratio)
  • Page 220 19: P ULSE UTPUT NSTRUCTIONS 4. D1 (destination 1): Operation status D1 specifies the starting number of the internal relays to use with the PWM instructions. Starting from the specified internal relay, 3 sequential internal relays are used. The range of available internal relay numbers is M0 to M1270. The first digit of the internal relay number must be set to 0. Storage Function Setting...
  • Page 221 19: P ULSE UTPUT NSTRUCTIONS 8. Preset value When counting pulses, this setting specifies the number of pulses to output. 9. Current value The number of pulses that were output is stored in this data register. The current value is updated when the PWM instruction is executed at each scan.
  • Page 222 19: P ULSE UTPUT NSTRUCTIONS Examples: PWM PWM1 instruction (pulse counting enabled) timing chart [PWM1 instruction, S1 is specified as D200, D1 is specified as internal relay M50] D200 PWM1 instruction input PWM1 instruction input Pulse width ratio D201 Preset value D202, D203 Output pulse Pulse output ON...
  • Page 223 19: P ULSE UTPUT NSTRUCTIONS PWM2 instruction (pulse counting disabled) timing chart [PWM2 instruction, S1 is specified as D100, D1 is specified as internal relay M200] D100 D200 M200 PWM2 instruction input PWM2 instruction input Pulse width ratio D101 Output pulse Pulse output ON M200 Pulse output complete M201...
  • Page 224 19: P ULSE UTPUT NSTRUCTIONS Sample program This section describes an example program that outputs a pulse with the pulse width ratio of 30% when I0 is off and a pulse with the pulse width ratio of 60% when I0 is on. Turn on initialization input (M0) M8120 MOV(W)
  • Page 225: Ramp (Trapezoidal Control)

    19: P ULSE UTPUT NSTRUCTIONS RAMP (Trapezoidal Control) The RAMP instruction outputs pulses with a frequency change function. When the input is on, pulses of the initial pulse frequency specified by S1 are RAMP output, and then the pulse frequency is increased by a fixed ratio until it reaches ***** ***** *****...
  • Page 226 19: P ULSE UTPUT NSTRUCTIONS Settings Device tab  1. Select instruction This item selects the RAMP instruction to use from RAMP1 or RAMP2. The reversible control mode that can be selected varies based on the instruction. For limitations due to the combination of instruction, reversible control mode, and the pulse output mode, see "9. Reversible control enable"...
  • Page 227 19: P ULSE UTPUT NSTRUCTIONS 3. S2 (source 2): Initialization input S2 specifies the initialization input. When the initialization input S2 is turned on, the initial values configured in the WindLDR RAMP instruction dialog box, on the Setting tab, are stored in the control registers. An external input (I0 to I35) (Note) or an internal relay (M0 to M1277) can be specified.
  • Page 228 19: P ULSE UTPUT NSTRUCTIONS 6. Steady pulse frequency This setting specifies the steady pulse frequency after the pulse frequency is increased. For operation mode 0, set the frequency in the range of 1 to 10,000 (increments of 1 Hz). For operation mode 1, set the frequency in the range of 20 to 10,000 (increments of 10 Hz).
  • Page 229 19: P ULSE UTPUT NSTRUCTIONS 12. Current value The number of pulses output from the pulse output port is stored in this data register.  The current value is updated when the RAMP instruction is executed at each scan. 13. Error status If a configuration error occurs when the RAMP instruction input changes from off to on, M8004 (user program execution error) is turned on and this register is set to the error code.
  • Page 230 19: P ULSE UTPUT NSTRUCTIONS Examples: RAMP RAMP1 instruction (reversible control disabled) timing chart [RAMP1 instruction, S1 is specified as D200, D1 is specified as internal relay M50] RAMP D200 PAMP instruction input RAMP instruction input Pulse output port Pulse output ON Pulse output complete Pulse output status When the RAMP instruction input is on, pulses are output according to the settings configured by the control registers.
  • Page 231 19: P ULSE UTPUT NSTRUCTIONS RAMP1 instruction (reversible control enabled, single-pulse output mode) timing chart [RAMP1 instruction, S1 is specified as D200, D1 is specified as internal relay M50] RAMP D200 RAMP instruction input RAMP instruction input Control direction D203 0 (Forward) 1 (Reverse) Output pulse...
  • Page 232 19: P ULSE UTPUT NSTRUCTIONS RAMP1 instruction (reversible control enabled, dual-pulse output mode) timing chart [RAMP1 instruction, S1 is specified as D200, D1 is specified as internal relay M50] RAMP D200 RAMP instruction input RAMP instruction input Forward pulse Reverse pulse Control direction D203 0 (Forward)
  • Page 233 19: P ULSE UTPUT NSTRUCTIONS Sample program [To output 48,000 pulses with the frequency change function (reversible control disabled) from Q14] Turn on initialization input (M0) M8120 RAMP When the RAMP instruction input (I0) turns on, pulse output starts M100 Function Device address Setting value...
  • Page 234 19: P ULSE UTPUT NSTRUCTIONS [To output 100,000 pulses with the frequency change function (reversible control by single-pulse output) from Q14] When the RAMP instruction input (I0) changes from off to on, pulse output starts. When I1 is off, the reversible control signal (Q15) turns off (forward)....
  • Page 235 19: P ULSE UTPUT NSTRUCTIONS [To output 1,000,000 pulses with the frequency change function (reversible control by dual-pulse output)] When the RAMP instruction input (I0) changes from off to on, pulse output starts. For forward when I1 is off, pulses (CW) are output from Q14....
  • Page 236: Zrn (Zero Return)

    19: P ULSE UTPUT NSTRUCTIONS ZRN (Zero Return) The ZRN instruction outputs pulses while the proximity signal is off. When the input is on, pulses of the initial pulse frequency specified by S1 and S1+1 are output until the proximity signal specified by S3 turns on. ***** ***** *****...
  • Page 237 19: P ULSE UTPUT NSTRUCTIONS Settings Device tab  1. Select instruction This item selects the ZRN instruction to use from ZRN1 or ZRN2. The output differs by the instruction. Instruction Pulse output ZRN1 ZRN2 2. S1 (source 1): Control register S1 specifies the starting number of the data registers to use with the ZRN1 or ZRN2 instruction....
  • Page 238 19: P ULSE UTPUT NSTRUCTIONS 4. S3 (source 3): Proximity signal S3 specifies the proximity signal. Specify either an external input or an internal relay. The external input can be specified as (I0 to I35) or the internal relay can be specified as (M0 to M1277). An interrupt is used to read the proximity signal.
  • Page 239 19: P ULSE UTPUT NSTRUCTIONS 8. Creep operation mode This setting selects the range of frequencies to output from the two modes. Creep operation mode 0: 1 Hz to 10 kHz (increments of 1 Hz) 1: 200 Hz to 100 kHz (increments of 10 Hz) 9.
  • Page 240 19: P ULSE UTPUT NSTRUCTIONS Examples: ZRN ZRN1 instruction timing chart [ZRN1 instruction, S1 is specified as data register D200, S3 is specified as external input I2, D1 is specified as internal relay M10] D200 ZRN nstruction input Initial speed Creep speed Output pulse ZRN1 instruction input...
  • Page 241 19: P ULSE UTPUT NSTRUCTIONS Sample program [To perform a zero return operation with proximity signal I3, initial pulse frequency 3 kHz, and creep pulse frequency 800 Hz] Turn on initialization input (M0) M8120 Pulse output ON relay off M100 Pulse output complete relay off M101 When the ZRN1 instruction input turns on, pulse output...
  • Page 242: Aramp (Ramp With Table)

    19: P ULSE UTPUT NSTRUCTIONS ARAMP (RAMP with Table) The ARAMP instructions output pulses with the frequency change function according to the information in the frequency table. ARAMP When the input is on, pulses are output according to the frequency ***** ***** *****...
  • Page 243 19: P ULSE UTPUT NSTRUCTIONS Valid Devices Device Function Constant Repeat S1 (Source 1) Control register — — — — — — — — S2 (Source 2) Initialization input — — — — — — — S3 (Source 3) Interrupt input —...
  • Page 244 19: P ULSE UTPUT NSTRUCTIONS Settings Device tab  1. Select instruction This item selects the ARAMP instruction to use from ARAMP1 or ARAMP2. The reversible control mode that can be selected varies based on the instruction. For limitations due to the combination of instruction, reversible control mode, and the pulse output mode, see "8. Reversible control enable"...
  • Page 245 19: P ULSE UTPUT NSTRUCTIONS Step 2 (6 words) Storage destination Function Setting Reference Mode 0: 1 to 10,000 (increments of 1 Hz) "13. Steady pulse Starting number+8 Steady pulse frequency Mode 1: 20 to 10,000 (increments of 10 Hz) frequency"...
  • Page 246 19: P ULSE UTPUT NSTRUCTIONS 5. D1 (destination 1): Monitor register D1 specifies the starting number of the data registers to use with ARAMP1 or ARAMP2. Starting from the specified number, 9 continuous words of data registers are used. The range of available data register numbers is D0 to D991 and D1000 to D1991. The contents of the monitor registers are read-only.
  • Page 247 19: P ULSE UTPUT NSTRUCTIONS 6. D2 (destination 2): Operation status D2 specifies the starting number of the internal relays to use with the ARAMP1 and ARAMP2 instructions. Starting from the specified internal relay, 5 sequential internal relays are used. The range of available internal relay numbers is M0 to M1270.
  • Page 248 19: P ULSE UTPUT NSTRUCTIONS 8. Reversible control enable This setting enables or disables reversible control and selects the reversible control method from the following reversible control modes. Reversible control enable 0: Reversible control disabled 1: Reversible control (single-pulse output) 2: Reversible control (dual-pulse output) There are two modes for the pulse output mode: single-pulse output mode and dual-pulse output mode.
  • Page 249 19: P ULSE UTPUT NSTRUCTIONS ARAMP step settings  12. Step numbers This option selects the step number to configure. 13. Steady pulse frequency This setting specifies the frequency at the steady output state before or after changing the frequency. For mode 0, set this value in the range of 1 to 10,000 (increments of 1 Hz).
  • Page 250 19: P ULSE UTPUT NSTRUCTIONS Preview  The preview shows the operation with the content configured on the Table tab. 18. Max This setting configures the maximum value for the graph. The range of values that can be entered depends on the selected mode.
  • Page 251 19: P ULSE UTPUT NSTRUCTIONS Examples: ARAMP ARAMP1 instruction (reversible control disabled) timing chart [ARAMP1 instruction, S1 is specified as data register D200, S2 is specified as internal relay M0, S3 is disabled, D1 is specified as data register D0, D2 is specified as internal relay M50] ARAMP D200 ARAMP instruction...
  • Page 252 19: P ULSE UTPUT NSTRUCTIONS ARAMP1 instruction (single-pulse output reversible control enabled) timing chart [ARAMP1 instruction, S1 is specified as data register D200, S2 is specified as internal relay M0, S3 is disabled, D1 is specified as data register D0, D2 is specified as internal relay M50] ARAMP D200 ARAMP instruction...
  • Page 253 19: P ULSE UTPUT NSTRUCTIONS ARAMP1 instruction (dual-pulse output reversible control enabled) timing chart [40-I/O type, ARAMP1 instruction, S1 is specified as data register D200, S2 is specified as internal relay M0, S3 is disabled, D1 is specified as data register D0, D2 is specified as internal relay M50] ARAMP D200 ARAMP instruction...
  • Page 254 19: P ULSE UTPUT NSTRUCTIONS Sample program This section describes an example program that outputs pulses as shown below with the frequency change function (reversible control disabled) using the following settings. The pulses are output from Q14. 10 kHz Step 1 Step 2 Step 3 Preset value 4,000...
  • Page 255 19: P ULSE UTPUT NSTRUCTIONS Step 1 settings Function Device address Setting value Details Steady pulse frequency 100 Hz Frequency change time 2000 2,000 ms Preset value D4, D5 4000 Preset value=4,000 Control direction Forward Forward Timing of change After After Next step number Step 2...
  • Page 256 19: P ULSE UTPUT NSTRUCTIONS This section describes an example program that outputs pulses as shown below with the frequency change function (single-pulse output reversible control enabled) using the following settings. The pulses are output from Q14. 100 kHz Step 1 Step 2 Step 3 Step 4...
  • Page 257 19: P ULSE UTPUT NSTRUCTIONS Basic settings Function Device address Setting value Details Operation mode — Mode 1 200 Hz to 100 kHz Reversible control enable — Single-pulse output — The number of steps — — Start number — Step 1 Interrupt number 0=No interrupt step Step 1 settings...
  • Page 258 19: P ULSE UTPUT NSTRUCTIONS Step 2 settings Function Device address Setting value Details Steady pulse frequency 200 Hz Frequency change time 3000 3,000 ms Preset value D10, D11 5000 Preset value=5,000 Control direction Forward Forward=0 Timing of change After After=2 Next step number Step 3...
  • Page 259 19: P ULSE UTPUT NSTRUCTIONS This section describes an example program that outputs pulses as shown below with the frequency change function (single-pulse output reversible control disabled) using the following settings. The pulses are output from Q14. Interrupt Step 100 kHz Step 1 Step 2 Step 3...
  • Page 260 19: P ULSE UTPUT NSTRUCTIONS Basic settings Function Device address Setting value Details Operation mode — Mode 1 200 Hz to 100 kHz Reversible control enable — Disable — The number of steps — — Start number — Step 1 Interrupt number Step 6 Step 1 settings...
  • Page 261 19: P ULSE UTPUT NSTRUCTIONS Step 3 settings Function Device address Setting value Details Steady pulse frequency 5000 50 kHz Frequency change time 8000 8,000 ms Preset value D16, D17 1000000 Preset value=1,000,000 Control direction Forward — Timing of change After —...
  • Page 262 19: P ULSE UTPUT NSTRUCTIONS Step 6 settings Function Device address Setting value Details Steady pulse frequency 200 Hz Frequency change time 5000 5000 ms Preset value D33, D34 2000 Preset value=2,000 Control direction Forward Forward=0 Timing of change Before Before=0 Next step number Step 0 (end)
  • Page 263: Dtml (1-Sec Dual Timer)

    20: D EACHING IMER NSTRUCTIONS Introduction Dual timer instructions generate ON/OFF pulses of required durations from a designated output, internal relay, or shift register bit. Four dual timers are available and the ON/OFF duration can be selected from 1 ms up to 65535 sec. Teaching timer instruction measures the ON duration of the start input for the teaching timer instruction and stores the measured data to a designated data register, which can be used as a preset value for a timer instruction.
  • Page 264 20: D EACHING IMER NSTRUCTIONS Valid Devices Device Function Constant S1 (Source 1) ON duration — — — — — — 0-65535 S2 (Source 2) OFF duration — — — — — — 0-65535 D1 (Destination 1) Dual timer output —...
  • Page 265: Ttim (Teaching Timer)

    20: D EACHING IMER NSTRUCTIONS TTIM (Teaching Timer) While input is on, the ON duration is measured in units of 100 ms and the measured value is stored to a TTIM data register designated by destination device D1. ***** When the input is off, D1 turns off. The measured time range is 0 through 6553.5 sec.
  • Page 266 20: D EACHING IMER NSTRUCTIONS 20-4 FC5A M ’ FC9Y-B1273 ICRO MART ANUAL...
  • Page 267: Trigonometric Function Instructions

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS Introduction Trigonometric function instructions are used for conversion between radian and degree values, conversion from radian value to sine, cosine, and tangent, and also calculation of arc sine, arc cosine, and arc tangent values. RAD (Degree to Radian) ...
  • Page 268: Deg (Radian To Degree)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS DEG (Radian to Degree)  S1·S1+1 rad  180/  D1·D1+1° DEG(F) When input is on, the radian value designated by source device S1 is converted into a degree ***** ***** value and stored to the destination designated by device D1. Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 269: Sin (Sine)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS SIN (Sine) sin S1·S1+1  D1·D1+1 SIN(F) When input is on, the sine of the radian value designated by source device S1 is stored to the ***** ***** destination designated by device D1. Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40...
  • Page 270: Cos (Cosine)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS COS (Cosine) cos S1·S1+1  D1·D1+1 COS(F) When input is on, the cosine of the radian value designated by source device S1 is stored to the ***** ***** destination designated by device D1. Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40...
  • Page 271: Tan (Tangent)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS TAN (Tangent) tan S1·S1+1  D1·D1+1 TAN(F) When input is on, the tangent of the radian value designated by source device S1 is stored to the ***** ***** destination designated by device D1. Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40...
  • Page 272: Asin (Arc Sine)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS ASIN (Arc Sine) asin S1·S1+1  D1·D1+1 rad ASIN(F) When input is on, the arc sine of the value designated by source device S1 is stored in radians to ***** ***** the destination designated by device D1. The S1·S1+1 value must be within the following range: -1.0 ...
  • Page 273: Acos (Arc Cosine)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS ACOS (Arc Cosine) acos S1·S1+1  D1·D1+1 rad ACOS(F) When input is on, the arc cosine of the value designated by source device S1 is stored in radians ***** ***** to the destination designated by device D1. The S1·S1+1 value must be within the following range: -1.0 ...
  • Page 274: Atan (Arc Tangent)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS ATAN (Arc Tangent) atan S1·S1+1  D1·D1+1 rad ATAN(F) When input is on, the arc tangent of the value designated by source device S1 is stored in radians ***** ***** to the destination designated by device D1. Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 275: Loge (Natural Logarithm)

    22: L OGARITHM OWER NSTRUCTIONS Introduction This chapter describes logarithm and power instructions which are used to calculate logarithm or powered values of source devices. LOGE (Natural Logarithm) S1·S1+1  D1·D1+1 LOGE(F) When input is on, the natural logarithm of the binary data designated by source device S1 is ***** ***** stored to the destination designated by device D1.
  • Page 276: Log10 (Common Logarithm)

    22: L OGARITHM OWER NSTRUCTIONS LOG10 (Common Logarithm) S1·S1+1  D1·D1+1 LOG10(F) When input is on, the common logarithm of the binary data designated by source device S1 is ***** ***** stored to the destination designated by device D1. Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40...
  • Page 277: Exp (Exponent)

    22: L OGARITHM OWER NSTRUCTIONS EXP (Exponent) S1·S1+1  D1·D1+1 EXP(F) When input is on, e is raised to the power S1·S1+1 designated by source device S1 and is stored ***** ***** to the destination designated by device D1. e (base of natural logarithm) = 2.7182818 Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 278: Pow (Power)

    22: L OGARITHM OWER NSTRUCTIONS POW (Power) S2·S2+1 S1·S1+1  D1·D1+1 POW(F) When input is on, data designated by source device S1 is raised to the power S2·S2+1 ***** ***** ***** designated by source device S2 and the operation result is stored to the destination designated by device D1.
  • Page 279: File Data Processing Instructions

    23: F ROCESSING NSTRUCTIONS Introduction File data processing instructions implement the first-in first-out (FIFO) data structure. FIFOF (FIFO Format) instructions initialize the FIFO data files storing the data. FIEX (First-In Execute) instructions store new data to the FIFO data files, and FOEX (First-Out Execute) instructions retrieve the stored data from the FIFO data files.
  • Page 280 23: F ROCESSING NSTRUCTIONS Destination Device D1 (FIFO Data File) FIFO data files are initialized when corresponding FIFOF instructions are executed. FIFO data file is placed in the area starting with the device designated by D1 and occupies as many as S1S2+2 data registers. The size of each record is equal to S1. S1-1 records of data can be stored in an FIFO data file using FIEX instructions.
  • Page 281: Fiex (First-In Execute)

    23: F ROCESSING NSTRUCTIONS FIEX (First-In Execute) When input is on, the data stored in data registers starting with the device designated by S1 is stored to the FIEX(W) corresponding FIFO data file. ***** Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A-Touch Valid Devices...
  • Page 282 23: F ROCESSING NSTRUCTIONS Valid Data Types W (word) When a D (data register) is designated as the destination, data registers as many as the value stored in device S1 of the corresponding FIFOF instruction are used. I (integer) — D (double word) —...
  • Page 283: Ndsrc (N Data Search)

    23: F ROCESSING NSTRUCTIONS NDSRC (N Data Search) When input is on, a value specified by device S1 is sought. Data registers are NDSRC(*) searched, starting with the data register designated by device S2. Device S3 ***** ***** ***** ***** specifies the quantity of 1-word or 2-word blocks of data registers to search, depending on the data type.
  • Page 284 23: F ROCESSING NSTRUCTIONS Examples: NDSRC The following examples demonstrate the NDSRC instruction to search data of three different data types. Data Type: Word  NDSRC(W) D100 D200 1234 1234 Search Offset D100 1 (match) 1234 D101 Offset of first match Result D200 D102...
  • Page 285: Tadd (Time Addition)

    24: C LOCK NSTRUCTIONS Introduction TADD (time addition) and TSUB (time subtraction) instructions perform addition or subtraction of two time data, respectively. The data can be selected from time (hour, minute, and second) or date/time (year, month, day, day of week, hour, minute, and second).
  • Page 286 24: C LOCK NSTRUCTIONS Mode 0 When mode 0 is selected, time data (hour, minute, and second) stored in 3 data registers starting with source device S2 are added to the time data (hour, minute, and second) stored in 3 data registers starting with source device S1. The results are stored to 3 data registers starting with destination device D1.
  • Page 287 24: C LOCK NSTRUCTIONS Examples: TADD The following examples demonstrate the TADD instruction to add time data in two different modes. Mode 0  TADD SOTU Source 1 Source 2 Destination 1 (Hour) (Hour) (Hour) (Minute) (Minute) (Minute) (Second) (Second) (Second) When the result exceeds 23:59:59, the resultant hour data is subtracted by 24, turning on special internal relay M8003 (carry).
  • Page 288 24: C LOCK NSTRUCTIONS When the result exceeds 23:59:59, the resultant hour data is subtracted by a multiple of 24 and the day data is incremented. Source 1 Destination 1 D8008 D200 (Year) (Year) D8009 D201 (Month) (Month) D8010 D202 (Day) (Day) D8011...
  • Page 289: Tsub (Time Subtraction)

    24: C LOCK NSTRUCTIONS TSUB (Time Subtraction) S1 – S2  D1, CY TSUB When input is on, time data designated by source device S2 are subtracted from date/ Mode ***** time data designated by source device S1, depending on the selected mode. The result is stored to destination device D1 and borrow (M8003).
  • Page 290 24: C LOCK NSTRUCTIONS Mode 0 When mode 0 is selected, time data (hour, minute, and second) stored in 3 data registers starting with source device S2 are subtracted from the time data (hour, minute, and second) stored in 3 data registers starting with source device S1. The results are stored to 3 data registers starting with destination device D1.
  • Page 291 24: C LOCK NSTRUCTIONS Examples: TSUB The following examples demonstrate the TSUB instruction to subtract time data in two different modes. Mode 0  TSUB SOTU Source 1 Source 2 Destination 1 (Hour) (Hour) (Hour) – (Minute) (Minute) (Minute) (Second) (Second) (Second) When the result is less than 00:00:00, the resultant hour data is added with 24, turning on special internal relay M8003 (borrow).
  • Page 292 24: C LOCK NSTRUCTIONS When the result is less than 00:00:00, the resultant hour data is added with a multiple of 24 and the day data is decremented. Source 1 Destination 1 D8008 D200 (Year) (Year) D8009 D201 (Month) (Month) D8010 D202 (Day)
  • Page 293: Htos (Hms To Sec)

    24: C LOCK NSTRUCTIONS HTOS (HMS to Sec) Hours, minutes, seconds  Seconds HTOS When input is on, time data in hours, minutes, and seconds designated by source device S1 is ***** ***** converted into seconds. The result is stored to destination device D1. Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 294: Stoh (Sec To Hms)

    24: C LOCK NSTRUCTIONS STOH (Sec to HMS) Seconds  Hours, minutes, seconds STOH When input is on, time data in seconds designated by source device S1 is converted into hours, ***** ***** minutes, and seconds. The result is stored to destination device D1. Applicable CPU Modules FT1A-12 FT1A-24...
  • Page 295: Hour (Hour Meter)

    24: C LOCK NSTRUCTIONS HOUR (Hour Meter) S1  D1  D2 HOUR While input is on, the ON duration of the input is measured. The measured ***** ***** ***** ***** time value (hour, minute, and second) is stored to 3 consecutive data registers designated by destination device D1 and compared with the preset value designated by source device S1.
  • Page 296 24: C LOCK NSTRUCTIONS Examples: HOUR The following examples demonstrate the HOUR instruction to measure the input ON duration value in hours, minutes, and seconds and to compare the value in two different ways.  Source Device S1: Data Register D0·D1·D2 «...
  • Page 297: User Communication Instructions

    25: U OMMUNICATION NSTRUCTIONS Introduction User communication instructions convert data to the specified data type and transmit and receive that data. The user communication instructions can be used on expansion communication ports or Ethernet port. To perform user communication with external devices connected on the expansion communication ports, use the TXD (user communication transmit) instruction and RXD (user communication receive) instruction.
  • Page 298 25: U OMMUNICATION NSTRUCTIONS User Communication Transmit Instruction Dialog Box in WindLDR Selections and Devices in Transmit Instruction Dialog Box Transmit instruction Type Receive instruction Port Port 2 - Port 3 Transmit user communication from port 2 (TXD2) through port 3 (TXD3) Enter the data to transmit in this area.
  • Page 299 25: U OMMUNICATION NSTRUCTIONS Example: The following example shows two methods to enter 3-byte ASCII data “1” (31h), “2” (32h), “3” (33h). (1) Constant (Character) (2) Constant (Hexadecimal) Designating Data Register as S1 When a data register is designated as source device S1, conversion type and transmit digits must also be designated. The data stored in the designated data register is converted and a designated quantity of digits of the resultant data is transmitted.
  • Page 300 25: U OMMUNICATION NSTRUCTIONS Transmit Digits (Bytes) After conversion, the transmit data is taken out in specified digits. Possible digits depend on the selected conversion type. Example: D10 stores 010Ch (268) (1) Binary to ASCII conversion, Transmit digits = 2 Transmitted data ASCII data “0”...
  • Page 301 25: U OMMUNICATION NSTRUCTIONS BCC (Block Check Character) Block check characters can be appended to the transmit data. The start position for the BCC calculation can be selected from the first byte through the 15th byte. The BCC can be 1 or 2 digits. 15th 16th 17th...
  • Page 302 25: U OMMUNICATION NSTRUCTIONS Conversion Type The BCC calculation result is converted or not according to the designated conversion type as described below: Example: BCC calculation result is 0041h. (1) Binary to ASCII conversion ASCII data Note: On WindLDR, Modbus ASCII is defaulted to “4”...
  • Page 303: Rxd (Receive)

    25: U OMMUNICATION NSTRUCTIONS Transmit Data Byte Count The data register next to the device designated for transmit status stores the byte count of data transmitted by the TXD instruction. When BCC is included in the transmit data, the byte count of the BCC is also included in the transmit data byte count. Example: Data register D100 is designated as a device for transmit status.
  • Page 304 25: U OMMUNICATION NSTRUCTIONS User Communication Receive Instruction Dialog Box in WindLDR Selections and Devices in Receive Instruction Dialog Box Transmit instruction Type Receive instruction Port Port 2 - Port 3 Receive user communication to port 2 (RXD2) through port 3 (RXD3) Enter the receive format in this area.
  • Page 305 25: U OMMUNICATION NSTRUCTIONS Designating Data Register as S1 When a data register is designated as source device S1, receive digits and conversion type must also be designated. The received data is divided into blocks of specified receive digits, converted in a specified conversion type, and stored to the designated data registers.
  • Page 306 25: U OMMUNICATION NSTRUCTIONS Repeat Cycles When a data register is designated to repeat, the received data is divided and converted in the same way as specified, and the converted data is stored to consecutive data registers as many as the repeat cycles. Example: Received data of 6 bytes is divided into 2-digit blocks, converted in ASCII to Binary, and stored to data registers starting at D20.
  • Page 307 25: U OMMUNICATION NSTRUCTIONS While a RXD instruction without a start delimiter is executed, any incoming data is processed continuously according to the receive format. Only one instruction each of RXD2 through RXD3 without a start delimiter can be executed at a time. If start inputs to two or more RXD instructions without a start delimiter are turned on simultaneously, one at the smallest address is executed and the corresponding completion output is turned on.
  • Page 308 25: U OMMUNICATION NSTRUCTIONS Examples: Multi-byte Start Delimiter Multi-byte start delimiter is determined in the structure of the Receive Format. The following examples show how multi-byte start delimiter is determined. Constants are followed by data register, skip, or BCC  Const Receive Format etc.
  • Page 309 25: U OMMUNICATION NSTRUCTIONS D400 Const Receive Format S1 (01h) Start Delimiter D402 Const Const Skip Receive Format S1 (01h) (02h) Start Delimiter D404 Const Const Const Const Const Receive Format S1 (01h) (02h) (03h) (04h) (05h) Start Delimiter Example: Using Multi-byte Start Delimiter The following example shows the advantages of using a multi-byte start delimiter rather than a single-byte start delimiter.
  • Page 310 25: U OMMUNICATION NSTRUCTIONS Multi-byte start delimiter  First two bytes can be configured as a multi-byte start delimiter. The incoming data is processed according to the receive format only when the first two bytes of the incoming data match the start delimiter. Therefore, only the incoming data sent to slave station 1 is processed.
  • Page 311 25: U OMMUNICATION NSTRUCTIONS (3) When a RXD instruction with end delimiter ETX (03h) and one-byte BCC is executed **** h D100 Incoming data When D100 is designated as the first data register “1” “2” D101 **** h (31h) (32h) (03h) Code End delimiter...
  • Page 312 25: U OMMUNICATION NSTRUCTIONS Start delimiter of incoming data does not match the receive format  Const Incoming Data (02h) (xxh) (FFh) (xxh) (0Dh) RXD instruction keeps waiting for valid incoming data, Const Const Const Receive status: and completes data receiving after receiving valid data Receive Format (05h) (FFh)
  • Page 313 25: U OMMUNICATION NSTRUCTIONS BCC (Block Check Character) The SmartAxis has an automatic BCC calculation function to detect a communication error in incoming data. If a BCC code is designated in the receive format of a RXD instruction, the SmartAxis calculates a BCC value for a specified starting position through the position immediately preceding the BCC and compares the calculation result with the BCC code in the received incoming data.
  • Page 314 25: U OMMUNICATION NSTRUCTIONS Conversion Type The BCC calculation result can be converted or not according to the designated conversion type as described below: Example: BCC calculation result is 0041h. (1) Binary to ASCII conversion “4” “1” Note: On WindLDR, Modbus ASCII is defaulted to 0041h (34h) (31h)
  • Page 315 25: U OMMUNICATION NSTRUCTIONS Example 2: BCC is calculated for the first byte through the sixth byte using the ADD format, converted in binary to ASCII, and compared with the BCC code appended to the seventh and eighth bytes of the incoming data. Incoming Data “1”...
  • Page 316 25: U OMMUNICATION NSTRUCTIONS Receive Status Designate a data register, D0-D1998, as a device to store the receive status information including a receive status code and a user communication error code. Receive Status Code Receive Status Description Status Code From turning on the start input for a RXD instruction to read the receive format, until Preparing data receive the RXD instruction is enabled by an END processing From enabling the RXD instruction by an END processing, until incoming data is...
  • Page 317: Etxd (User Communication Transmit Over Ethernet)

    25: U OMMUNICATION NSTRUCTIONS ETXD (User Communication Transmit over Ethernet) The ETXD instruction converts transmission data to the specified data type and sends it ETXD to the external device connected over Ethernet. ***** ***** ***** Applicable CPU Modules FT1A-12 FT1A-24 FT1A-40 FT1A-48 FT1A-Touch...
  • Page 318 25: U OMMUNICATION NSTRUCTIONS 25-22 FT1A S ’ FT9Y-B1382 MART ANUAL...
  • Page 319: Dlog (Data Log)

    26: D NSTRUCTIONS Introduction The data log instructions save the log data for the specified devices to the SD memory card. DLOG (Data Log) The DLOG instruction saves the values of the specified devices in the specified data format as a CSV file on the SD memory card. DLOG When the input is on, the date and time and the values of the specified devices *****...
  • Page 320 26: D NSTRUCTIONS Notes:  The number of DLOG instructions that can be programmed in a user program is 48. However, make sure that the folder name specified by the DLOG instruction is not duplicated with the folder names specified by the other DLOG instructions. When the folders are duplicated, log data with a mixed format is output to the same CSV file.
  • Page 321 26: D NSTRUCTIONS 2. D1 (destination 1): Completion output Specify the device turned on when writing log data to SD card and the execution of the DLOG instruction are completed. This device is turned on regardless of the success or failure of writing log data to the SD memory card. 3.
  • Page 322 26: D NSTRUCTIONS 9. Logging data size The amount of memory that the DLOG instruction uses for the current log settings is shown. The amount of memory used increases when a device to log the data is added. You can register up to a maximum of 64 devices (the total amount of memory must be less than or equal to 1,024 bytes).
  • Page 323 26: D NSTRUCTIONS CSV File Output Format and File Format Configuration The CSV file output format is as follows. You can change the separating character for each data and the decimal symbol for floating point numbers that are output to the CSV files on the Function Area Settings dialog box. Output format ...
  • Page 324 26: D NSTRUCTIONS Examples: DLOG When M0 is turned on, the decimal values of D0 through D5 (data type W (word)) and D10 (data type F (floating point)) are saved in a CSV file on the "RESULT" folder on the SD memory card every 10 seconds. Output example Time D0000...
  • Page 325 26: D NSTRUCTIONS Configure the Settings tab. Enter "RESULT" in S1 (Folder Name) (3).  Configure D0 to output the decimal value of D0 to the CSV files with the data type W (word) (4).  Set the repeat to 6 to output the values of D0 through D5 to the CSV files (5). Configure D10 to output the decimal value of D10 to the CSV files with the data type F (float) (6).
  • Page 326: Trace (Data Trace)

    26: D NSTRUCTIONS TRACE (Data Trace) The TRACE instruction saves the values for the previous number of scans for the specified device in the specified data format as a CSV file on the SD memory card. TRACE When the input is turned on, the date and time and the values of the previous ***** ***** *****...
  • Page 327 26: D NSTRUCTIONS Notes: The maximum number of TRACE instructions that can be programmed in a user program is three. Make sure that the folder name specified  by the TRACE instruction is not duplicated with the folder names specified by the other TRACE instructions. When the folders are duplicated, trace data with a mixed format is output to the same CSV file.
  • Page 328 26: D NSTRUCTIONS 2. D1 (destination 1): Completion output Specifies the device turned on when writing trace data to SD card and the execution of the TRACE instruction are completed. This device is turned on regardless of the success or failure of writing trace data to the SD memory card. 3.
  • Page 329 26: D NSTRUCTIONS 8. Repeat The data in consecutive devices as many as the specified repeat starting from the specified device address are output to the SD memory card. For example, when the display type of D10 is DEC(W) and the repeat is set to 8, the data is output to SD memory card as follows.
  • Page 330 26: D NSTRUCTIONS File format configuration procedure From the WindLDR menu bar, select Configuration > Cartridges. Under Data Log and Trace (CSV File Output), configure the separating character and the decimal symbol. The separating characters and the decimal symbols that are contained in the CSV file vary by country and region. You can select the symbols to use from the following:...
  • Page 331 26: D NSTRUCTIONS Configuration Procedure  1. Insert the instructions in the Ladder editor. TRACE SOTU RESULT M100 D100 CMP<>(W) S1 - S2 - D1 - SOTU D100 M100 2. Configure the TRACE instruction. Configure the Devices tab. Designate M100 as D1 (Completion Output) (1). ...
  • Page 332 26: D NSTRUCTIONS Operation Description  When M0 is turned on, the TRACE instruction is executed one time. When the TRACE instruction is executed, the data of D0 through D5 and D10 in the previous 20 scans is output to a CSV file on the SD memory card as decimal values along with the date and time of the execution.
  • Page 333: Execution Times For Instructions

    PPENDIX Execution Times for Instructions Execution times for basic and advanced instructions of the SmartAxis are listed below. Repeat is not designated for any device. Execution Time (μs) Instruction Device and Condition SmartAXIS Pro / Lite SmartAXIS Touch — LOD, LODN Using data register —...
  • Page 334 PPENDIX Execution Time (μs) Instruction Device and Condition SmartAXIS Pro / Lite SmartAXIS Touch TCCST (W) D  T TCCST (D) D  T ≤ ≥ CMP (=, <>, <, >, ) (W, I) D  D  M ≤ ≥...
  • Page 335 PPENDIX Execution Time (μs) Instruction Device and Condition SmartAXIS Pro / Lite SmartAXIS Touch HTOA D  D ATOH D  D BTOA D  D ATOB D  D ENCO M  D, 16 bits DECO D  M BCNT M ...
  • Page 336 PPENDIX Execution Time (μs) Instruction Device and Condition SmartAXIS Pro / Lite SmartAXIS Touch F  F F  F FIFOF — FIEX — FOEX — NDSRC (W, I) D, D, D  D NDSRC (D, L) D, D, D  D NDSRC (F) D, D, D ...
  • Page 337: Breakdown Of End Processing Time

    PPENDIX Breakdown of END Processing Time The END processing time depends on the SmartAxis settings and system configuration. The maximum values for the END processing time are as follows. Item Condition Execution Time Housekeeping (built-in I/O service) FT1A-x24x xx.x µs Instruction Bytes The quantities of bytes of basic and advanced instructions are listed below.
  • Page 338 PPENDIX Advanced Instruction Qty of Bytes Advanced Instruction Qty of Bytes IOREF MOV, MOVN 12 to 16 HSCRF IMOV, IMOVN IBMV, IBMVN 16 to 24 BMOV 12 to 16 XYFS 20 to 268 NSET 12 to 1540 CVXTY, CVYTX 16 to 20 12 to 20 AVRG 16 to 24...
  • Page 339 NDEX DTMS 20-1 100-ms EI 16-1 clock M8122 3-7 ENCO 11-15 dual timer 20-1 ERXD 25-21 10-ms ETXD 25-21 clock M8123 3-7 EXP 22-3 dual timer 20-1 FIEX 23-3 1-ms dual timer 20-1 FIFOF 23-1 1-sec FOEX 23-3 clock HOUR 24-11 M8121 3-7 HSCRF 15-3 reset M8001 3-5...
  • Page 340 NDEX SUM 8-15 data SWAP 11-23 read error flag M8014 3-5 TADD 24-1 write flag M8020 3-5 TAN 21-5 write/adjust error flag M8013 3-5 TCCST 6-16 carry 4-13 TRACE 26-8 (Cy) and borrow (Bw) M8003 3-5 TSUB 24-5 and borrow 8-16 TTIM 20-3 or borrow signals 8-2 TXD 25-1...
  • Page 341 NDEX Y to X 17-3 discontinuity of device areas 4-14 coordinate conversion instructions 17-1, 18-1 DIV 8-1 COS 21-4 division 8-1 cosine 21-4 DJNZ 14-5 counter double-word adding (up) counter 5-12 adding counter CNTD 5-15 and shift register in master control circuit 5-29 counter 5-15 comparison instructions 5-19 data move in data registers 6-2...
  • Page 342 NDEX return 14-3 gate input M8031, M8035, M8041, M8045 3-6 LC< 7-8 refresh 15-3 LC<= 7-8 reset input M8032, M8036, M8042, M8046 3-6 LC<> 7-8 HMS to sec 24-9 LC= 7-8 HOUR 24-11 LC> 7-8 hour meter 24-11 LC>= 7-8 HSCRF 15-3 LCAL 14-3 HTOA 11-5...
  • Page 343 NDEX 1-sec timer 5-11 reset timer 5-11 input 5-23 opcode 4-9 restore timer/counter preset values 5-18 operation restriction on ladder programming 5-32 basics 1-1 reverse optional cartridge information D8031 3-12 shift register 5-25 OR and ORN instructions 5-5 reversible control 19-18, 19-38 OR LOD instruction 5-6 ROOT 8-14 OR word 9-1...
  • Page 344 NDEX subnet mask D8308-D8311, D8334-D8337 3-13 port 7 M8170 3-7 subroutine 14-4 ports 4-6 M8145-M8147 3-6 subtraction 8-1 program SUM 8-15 execution error sum 8-15 M8004 3-5 SWAP 11-23 user program execution error 4-13 system verification of incoming data 25-15 program version version D8029 3-12...

Table of Contents