IDEC MICROSmart FC6A Series Ladder Programming Manual

IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

B-1726(7)
FC6A SERIES
Ladder Programming Manual

Advertisement

Table of Contents
loading

Summary of Contents for IDEC MICROSmart FC6A Series

  • Page 1 B-1726(7) FC6A SERIES Ladder Programming Manual...
  • Page 2: Safety Precautions

    • maintenance, and inspection of the FC6A Series MICROSmart. All FC6A Series MICROSmart 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 FC6A Series MICROSmart in applications where heavy damage or personal injury may be caused, in case the FC6A Series MICROSmart should fail.
  • Page 3: About This Manual

    Read this manual to ensure the correct understanding of the entire functions of the FC6A Series MICROSmart. IDEC Corporation makes the latest product manual PDFs available on our website at no additional cost. Please download the latest product manual PDFs from our website.
  • Page 4 • * This product has not been certified for use on the bridge or deck. For details on applicable standards and EU directives, please contact the dealer where purchased or check the IDEC website. 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 5: About The Warranty Of The Products

    Products will be repaired free of charge. If such failure or defects should occur, please offer them to the distributor, dealer or IDEC CORPORATION with the materials in which the date of purchase is specified.
  • Page 6: Related Manuals

    ELATED ANUALS The following manuals related to the FC6A Series MICROSmart are available. Refer to them in conjunction with this manual. Type No. Manual Name Description Describes product specifications, installation and wiring instructions, instructions for FC6A Series MICROSmart FC9Y-B1722 basic programming operations and special functions, device and instruction lists, and User’s Manual troubleshooting procedures for the FC6A Series MICROSmart.
  • Page 7 AMES AND BBREVIATIONS SED IN THIS ANUAL Model Names Name Used in This Manual Type Number, Part Code, or Official Name FC6A Series MICROSmart FC6A Series MICROSmart FC6A-C16R1AE, FC6A-C16R1CE, FC6A-C16K1CE, FC6A-C16P1CE, FC6A-C24R1AE, FC6A-C24R1CE, FC6A-C24K1CE, FC6A-C24P1CE, All-in-One CPU module FC6A-C40R1AE, FC6A-C40R1CE, FC6A-C40K1CE, FC6A-C40P1CE, FC6A-C40R1DE, FC6A-C40K1DE, FC6A-C40P1DE FC6A-C40R1AEJ, FC6A-C40R1CEJ, FC6A-C40K1CEJ, FC6A-C40P1CEJ, CAN J1939 All-in-One CPU module...
  • Page 8 Preface-7 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 9: Table Of Contents

    ABLE OF ONTENTS Safety Precautions..........................Preface-1 About This Manual..........................Preface-2 About the Warranty of the Products....................Preface-4 Related Manuals..........................Preface-5 Names and Abbreviations Used in this Manual ..................Preface-6 Operation Basics HAPTER Start WindLDR ............................1-1 PLC Selection .............................. 1-2 Create Program ............................
  • Page 10: Hapter

    ABLE OF ONTENTS Move Instructions HAPTER MOV (Move) ............................... 5-1 MOVN (Move Not)............................5-5 IMOV (Indirect Move)..........................5-6 IMOVN (Indirect Move Not) ......................... 5-8 MOVC (Move Characters)..........................5-9 BMOV (Block Move) ...........................5-11 IBMV (Indirect Bit Move) ..........................5-12 IBMVN (Indirect Bit Move Not)........................5-14 NSET (N Data Set) .............................5-15 NRS (N Data Repeat Set)..........................5-16 XCHG (Exchange) ............................5-17...
  • Page 11 ABLE OF ONTENTS DECO (Decode) ............................10-16 BCNT (Bit Count)............................. 10-17 ALT (Alternate Output) ..........................10-18 CVDT (Convert Data Type)........................10-19 DTDV (Data Divide) ..........................10-21 DTCB (Data Combine) ..........................10-22 SWAP (Data Swap)..........................10-23 Week Programmer Instructions HAPTER WEEK (Weekly Timer)..........................11-3 YEAR (Yearly Timer) ..........................
  • Page 12 ABLE OF ONTENTS DTIM (100-ms Dual Timer).........................20-1 DTMH (10-ms Dual Timer)..........................20-1 DTMS (1-ms Dual Timer)..........................20-1 TTIM (Teaching Timer) ..........................20-3 Trigonometric Function Instructions HAPTER RAD (Degree to Radian) ..........................21-1 DEG (Radian to Degree) ..........................21-2 SIN (Sine) ..............................21-3 COS (Cosine) .............................21-4 TAN (Tangent)............................21-5 ASIN (Arc Sine) ............................21-6 ACOS (Arc Cosine) .............................21-7 ATAN (Arc Tangent)...........................21-8...
  • Page 13: Start Windldr

    This chapter describes basic procedures for operating WindLDR, programming and maintenance software for the FC6A Series MICROSmart. Start WindLDR ■ Windows 10 Click Start button and then > All Apps > IDEC Automation Organizer > WindLDR. ■ Windows 8 Click WindLDR in the tiles on the Start screen. ■ Windows 7 Click Start and then Programs >...
  • Page 14: 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. Select a PLC type in the selection box and the programming language to use. Click OK.
  • Page 15: Create Program

    1: O PERATION ASICS Create Program Create Ladder Program This section describes the operating procedure to create a ladder program in WindLDR. Note: For details about devices, see "Devices" on page 2-1. 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 16 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 17 1: O PERATION ASICS Enter I0 in the Tag Name field, and click OK. Notes: • To enter an NO contact from the right-click menu, right-click at the location to insert the NO contact, and on the right-click menu, click Basic Instructions (B), then A (Normally Open).
  • Page 18 1: O PERATION ASICS Double-click Output. The Out (Output) dialog box is displayed. Enter Q0 in the Tag Name field, and click OK. A NO output coil of output Q0 is programmed in the right-most column of the first ladder line. This completes programming for rung 1.
  • Page 19 1: O PERATION ASICS Convert Program The program can be checked whether it contains any user program syntax error. From the menu bar, select Home > Convert (Program group). When the instruction/FB symbols are connected correctly, the program conversion is completed successfully. If any error is found, the errors are listed on the Info Window.
  • Page 20: Save Project

    1: O PERATION ASICS Save Project This section describes the operating procedure to save the created ladder program as a project file. Save the current project with a new name. Click (application) button > Save As > WindLDR Project. Enter the file name in File name, specify the folder to save to, and click Save. This completes the procedure to save a project to a file.
  • Page 21: Simulate Operation

    1: O PERATION ASICS Simulate Operation This section describes the operating procedure to check the operation of the user program before transferring it to the FC6A Series MICROSmart. From the WindLDR menu bar, select Online > Simulation. The Simulation screen appears. Select and right-click the input contact you want to change, and on the right-click menu, click Set or Reset.
  • Page 22: Download Program

    1: O PERATION ASICS Download Program While WindLDR is running on a PLC, you can download the user program to the FC6A Series MICROSmart. User programs can be downloaded to the FC6A Series MICROSmart from WindLDR using USB or Ethernet. This section describes the operating procedure from configuring communication settings to downloading the user program using a USB connection as an example.
  • Page 23 1: O PERATION ASICS From the WindLDR menu bar, select Online > Download. The Download dialog box appears, then click OK. The user program is downloaded to the FC6A Series MICROSmart. Note: The Download dialog box can also be opened by selecting Home >...
  • Page 24: Monitor Operation

    1: O PERATION ASICS Monitor Operation Another powerful function of WindLDR is to monitor the PLC operation on the computer. The input and output statuses of the sample program can be monitored in the ladder diagram. From the WindLDR menu bar, select Online > Monitor > Monitor. When both inputs I0 and I1 are on, the ladder diagram on the monitor screen looks as follows: Rung 1: When both inputs I0 and I1 are on,...
  • Page 25: Windows Displayed In The Workspace

    1: O PERATION ASICS Windows Displayed in the Workspace This section describes how to change the position and display method of windows. Changing the position of windows You can change the display position of the window by dragging and dropping the title bar of the window or its tab to disable docking.
  • Page 26 1: O PERATION ASICS Note: When the mouse cursor gets close to a (Docking) icon while dragging the title bar or tab, the location to dock the window is displayed. Window docking location Drop the title bar or tab on the (Docking) icon to dock that window to WinidLDR’s left, right, top, or bottom frame or a separate window.
  • Page 27 1: O PERATION ASICS Changing the display method of windows If the workspace window is docked, you can change the widow to automatically hide and show only its tabs. • Click the (Auto Hide) icon to change the window to show only its tabs. Auto Hide icon Tabs •...
  • Page 28: Checking The Windldr Version Number

    1: O PERATION ASICS Checking the WindLDR Version Number This section describes how to check the WindLDR version. Click (application) button > WindLDR Options. The WindLDR Options dialog box appears. Click the Resources tab, and then click About. The About WindLDR dialog box appears. You can check the WindLDR version.
  • Page 29: Ladder Program Operation

    1: O PERATION ASICS Ladder Program Operation The FC6A Series MICROSmart performs the following operations to process ladder programs. The ON/OFF status of the input terminal (external input) is applied to the input The input device values are applied to the circuit.
  • Page 30: Start/Stop Operation

    1: O PERATION ASICS Start/Stop Operation This section describes how to run and stop the FC6A Series MICROSmart. Make sure of safety before starting and stopping the FC6A Series MICROSmart. Incorrect operation of the FC6A Series Caution MICROSmart may cause machine damage or accidents. Start/Stop Schematic You can start and stop FC6A Series MICROSmart operations by using WindLDR operations, FC6A Series MICROSmart operations, function switch operations, menu operations using an HMI module, by turning the FC6A Series MICROSmart on or off, or by using...
  • Page 31 1: O PERATION ASICS Click the Stop button to stop operation, then the start control special internal relay M8000 is turned off. The PLC operation can also be started and stopped while WindLDR is in the monitor mode. Select Online > Monitor > Monitor and click the Start or Stop button.
  • Page 32 1: O PERATION ASICS 1-20 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 33: Device Addresses

    2: D EVICES This chapter provides detailed descriptions of the allocations of devices such as inputs, outputs, internal relays, registers, timers, and counters that are used in the basic and advanced instructions, as well as details about the allocations of special internal relays and special data registers.
  • Page 34 2: D EVICES Plus CPU module Range (Points) Device Symbol Unit Plus 16-I/O Type Plus 32-I/O Type I0 - I7 I0 - I17 Inputs (8 points) (16 points) I30 - I307 (224 points) I310 - I627 (256 points) Expansion Inputs I630 - I643 (12 points) I1000 - I10597...
  • Page 35 2: D EVICES ■ Inputs (I), Expansion Inputs (I) Devices that input on/off information from external devices to the FC6A Series MICROSmart. ■ Outputs (Q), Expansion Outputs (Q) Devices that output on/off information from the FC6A Series MICROSmart to external devices. ■...
  • Page 36: Special Internal Relay

    2: D EVICES Special Internal Relay Special Internal Relay Device Addresses Do not write to data in the area marked as reserved in the special internal relays list. Otherwise the system may not operate Warning correctly. Note: R/W is an abbreviation for read/write. The notation for the R/W field is as follows.
  • Page 37 2: D EVICES Device When Power Description Address Stopped M8051 Comparison Output Reset Cleared Cleared M8052 Gate Input Maintained Cleared M8053 High-speed Counter (Group 2/I1) Reset Input Maintained Cleared M8054 Comparison ON Status Maintained Cleared M8055 Overflow Maintained Cleared M8056 —...
  • Page 38 2: D EVICES Device When Power Description Address Stopped M8123 10-ms Clock Operating Cleared M8124 Timer/Counter Preset Value Changed Maintained Cleared M8125 In-operation Output Cleared Cleared M8126 1 Scan ON After Run-Time Download Completes Cleared Cleared M8127 — Reserved — —...
  • Page 39 2: D EVICES Device When Power Description Address Stopped M8192 Interrupt Input I0 Edge Cleared Cleared M8193 Interrupt Input I3 Edge Cleared Cleared M8194 Interrupt Input I4 Edge On: Rising Edge Cleared Cleared Off: Falling Edge M8195 Interrupt Input I6 Edge Cleared Cleared M8196...
  • Page 40 2: D EVICES Device When Power Description Address Stopped M8304 J1939 Communication Bus Off Occurrence Output Cleared Cleared M8305 to — Reserved — — — — M8310 M8311 ESC+Key Input (Up) ESC+Key Input ( Cleared Cleared M8312 ESC+Key Input (Down) ESC+Key Input ( Cleared Cleared...
  • Page 41 2: D EVICES Device When Power Description Address Stopped M8384 User Communication Receive Instruction Cancel Flag (Port 25) Cleared Cleared M8385 User Communication Receive Instruction Cancel Flag (Port 26) Cleared Cleared M8386 User Communication Receive Instruction Cancel Flag (Port 27) Cleared Cleared M8387...
  • Page 42 2: D EVICES ■ M8013: Calendar/Clock Data Write/Adjust Error Flag When the clock writing or clock adjustment processing could not be executed normally, M8013 is turned on. It is turned off when the processing completes normally. ■ M8014: Calendar/Clock Data Read Error Flag When an error occurs while calendar/clock data is read from the internal clock to the special data registers (D8008 to D8021), M8014 is turned on.
  • Page 43 2: D EVICES M8380 = User Communication Receive Instruction Cancel Flag (Port 21) M8381 = User Communication Receive Instruction Cancel Flag (Port 22) M8382 = User Communication Receive Instruction Cancel Flag (Port 23) M8383 = User Communication Receive Instruction Cancel Flag (Port 24) M8384 = User Communication Receive Instruction Cancel Flag (Port 25) M8385 = User Communication Receive Instruction Cancel Flag (Port 26) M8386 = User Communication Receive Instruction Cancel Flag (Port 27)
  • Page 44 2: D EVICES ■ M8122: 100-ms Clock M8122 generates clock pulses in a 100 ms cycle, with a duty ratio of 1:1 50 ms 50 ms (50 ms on and 50 ms off). M8122 100 ms ■ M8123: 10-ms Clock M8123 generates clock pulses in a 10 ms cycle, with a duty ratio of 1:1 5 ms 5 ms...
  • Page 45 2: D EVICES ■ M8184: Change HMI Module Network Settings Trigger When M8184 is turned on, the values stored in D8437 to D8456 are set as the HMI module IP address. The IP address is not set just by changing the values of D8437 to D8456. For details on changing the HMI module network settings, see Chapter 3 "Network settings by HMI module special data registers"...
  • Page 46 2: D EVICES ■ M8212 to M8221, M8345 to M8354: Connection Status While connected to a network device via the maintenance communication server, user communication server/client, or Modbus TCP server/client, the connection status is turned on. While not connected to a network device, the connection status is turned off. M8212 = Connection 1 M8213 = Connection 2 M8214 = Connection 3...
  • Page 47 2: D EVICES ■ M8254: SD Memory Card Download/Upload Execution Completed Output M8254 is turned off when starting execution of the download from the SD memory card or the upload to the SD memory card, and when the download or upload has completed, it is turned on. ■...
  • Page 48: Special Data Register

    2: D EVICES Special Data Register Special Data Register Device Addresses Do not write to data in the area marked as reserved in the special data registers list. Otherwise the system may not operate Warning correctly. Note: R/W is an abbreviation for read/write. The notation for the R/W field is as follows.
  • Page 49 2: D EVICES Device Description Update Timing Address D8044 Slave Number (Port 8) ― D8045 Slave Number (Port 9) ― D8046 to — Reserved — ― ― D8051 D8052 J1939 Communication Error Code Every scan D8053 to — Reserved — ―...
  • Page 50 2: D EVICES Device Description Update Timing Address D8107 to — Reserved — ― ― D8119 D8120 Type ID/Status ― HMI Module Information D8121 System Software Version ― D8122 Type ID/Status ― Cartridge Slot 1 Information D8123 System Software Version ―...
  • Page 51 2: D EVICES Device Description Update Timing Address D8222 High Word Every scan Current Value/Frequency Measurement (I4) Current High-speed Value D8223 Low Word Every scan Counter D8224 High Word ― (Group 4/I4) Preset Value D8225 Low Word ― D8226 High Word Every scan Current Value/Frequency Measurement (I6) Current High-speed...
  • Page 52 2: D EVICES Device Description Update Timing Address D8271 Remote Host Number of Connection 4 (1 to 255) ― D8272 Remote Host Number of Connection 5 (1 to 255) ― D8273 Remote Host Number of Connection 6 (1 to 255) ―...
  • Page 53 2: D EVICES Device Description Update Timing Address D8342 Every 1 s D8343 Every 1 s CPU Module Ethernet Port 1 Preferred DNS Server (Current Value Read-only) D8344 Every 1 s D8345 Every 1 s D8346 Every 1 s D8347 Every 1 s CPU Module Ethernet Port 1 Alternate DNS Server (Current Value Read-only) D8348...
  • Page 54 2: D EVICES Device Description Update Timing Address D8396 Every 1 s D8397 Every 1 s HMI Module Default Gateway (Current Value Read-only) D8398 Every 1 s D8399 Every 1 s D8400 Every 1 s D8401 Every 1 s HMI Module Preferred DNS Server (Current Value Read-only) D8402 Every 1 s D8403...
  • Page 55 2: D EVICES Device Description Update Timing Address D8474 Type ID/Status ― Expansion Module Slot 3 Information D8475 System Software Version/Position Information ― D8476 Expansion Module Slot 4 Type ID/Status ― Information D8477 System Software Version/Position Information ― D8478 Type ID/Status ―...
  • Page 56 2: D EVICES Device Description Update Timing Address D8528 Type ID/Status ― Expansion Module Slot 30 Information D8529 System Software Version/Position Information ― D8530 Expansion Module Slot 31 Type ID/Status ― Information D8531 System Software Version/Position Information ― D8532 Type ID/Status ―...
  • Page 57 2: D EVICES Device Description Update Timing Address D8582 Type ID/Status ― Expansion Module Slot 57 Information D8583 System Software Version/Position Information ― D8584 Expansion Module Slot 58 Type ID/Status ― Information D8585 System Software Version/Position Information ― D8586 Type ID/Status ―...
  • Page 58 2: D EVICES Device Description Update Timing Address D8635 ― D8636 ― CPU Module Ethernet Port 2 Subnet Mask (Write-only) D8637 ― D8638 ― D8639 ― D8640 ― CPU Module Ethernet Port 2 Default Gateway (Write-only) D8641 ― D8642 ― D8643 ―...
  • Page 59 2: D EVICES Device Description Update Timing Address D8689 Every 1 s D8690 Every 1 s Connection 12 Connected IP Address D8691 Every 1 s D8692 Every 1 s D8693 Every 1 s D8694 Every 1 s Connection 13 Connected IP Address D8695 Every 1 s D8696...
  • Page 60 2: D EVICES Device Description Update Timing Address D8750 Slave Number (Port 25) ― D8751 Slave Number (Port 26) ― D8752 Slave Number (Port 27) ― D8753 Slave Number (Port 28) ― D8754 Slave Number (Port 29) ― D8755 Slave Number (Port 30) ―...
  • Page 61 2: D EVICES ■ D8022 to D8025: Scan Time Data D8022 through D8025 are special data registers for checking the scan time and configuring the constant scan time. For details on the scan time, see Chapter 5 "Constant Scan Time" in the "FC6A Series MICROSmart User’s Manual". ■...
  • Page 62 2: D EVICES ■ D8037: Number of Connected Expansion Modules The number of expansion modules connected to the CPU module (I/O modules, PID modules, and communication modules) is written to this register. ■ D8052: J1939 Communication Error Code When an error occurs in J1939 communication, the error code is written to this register. For details on J1939 communication error codes, see Chapter 8 "J1939 Communication Error Code (D8052)"...
  • Page 63 2: D EVICES ■ D8104, D8204, D8717, D8720, D8723, D8726, D8729, D8732: Control Signal Status (Port 1 to 33) The signal statuses of the DSR and DTR controls lines are written to this register. This register is updated in END processing when stopped and while running.
  • Page 64 2: D EVICES D8732 Port 30 Port 31 Port 32 Port 33 0 (00): DTR and DSR are both off. 1 (01): DTR is off and DSR is on. 2 (10): DTR is on and DSR is off. 3 (11): DTR and DSR are both on. ■...
  • Page 65 2: D EVICES D8727 Port 22 Port 23 Port 24 Port 25 D8730 Port 26 Port 27 Port 28 Port 29 D8733 Port 30 Port 31 Port 32 Port 33 0 (000): The DSR signal status is not used for FC6A Series MICROSmart transmission control. Use this status when DSR signal control is not required.
  • Page 66 2: D EVICES ■ D8106, D8206, D8719, D8722, D8725, D8728, D8731, D8734: RS232C DTR Output Control Signal Option (Port 1 to 33) This register is used when indicating the FC6A Series MICROSmart control status and the transmit/receive status to the connected device.
  • Page 67 2: D EVICES D8734 Port 30 Port 31 Port 32 Port 33 0 (00): The signal is on when the FC6A Series MICROSmart is set to run and off when stopped. While running, the signal is always on regardless of transmitting or receiving data. Set this value when it is necessary to indicate the run status.
  • Page 68 2: D EVICES ■ D8170, D8171, D8174, D8175, D8178, D8179: Analog I/O Cartridge I/O Analog I/O values for the analog cartridges are written to these registers. For the analog input type : The analog values input to the analog cartridge are converted to digital values and written to the registers.
  • Page 69 2: D EVICES It is 0 when no SD memory card has been inserted or if it is not recognized. ■ D8251: Read SD Memory Card Free Capacity This register indicates the free capacity of the SD memory card in megabytes. It is 0 when no SD memory card has been inserted or if it is not recognized.
  • Page 70 2: D EVICES D8760 Connection 9 Connection 10 Connection 11 Connection 12 D8761 Connection 13 Connection 14 Connection 15 Connection 16 Client connection (most significant bit = 0) • 0000: Unused 0001: User Communication 0010: Modbus TCP client 0100: User communication UDP Server connection (most significant bit = 1) •...
  • Page 71 2: D EVICES The meanings of the setting values are as follows. Setting Value IP Settings/DNS Settings Conform to function area settings. Enable DHCP. Conform to special data register (D8304 to D8323) settings. ■ D8304 to D8307: CPU Module Ethernet Port 1 IP Address (Write-only) These registers are used to write the CPU module's IP address.
  • Page 72 2: D EVICES ■ D8350 to D8381, D8677 to D8708: Connection Connected IP Address The IP address of the connected device that is being accessed through a connection is written as follows. Connection 1 Connected IP Address: For aaa.bbb.ccc.ddd D8350=aaa, D8351=bbb, D8352=ccc, D8353=ddd Connection 2 Connected IP Address: For aaa.bbb.ccc.ddd D8354=aaa, D8355=bbb, D8356=ccc, D8357=ddd Connection 3 Connected IP Address: For aaa.bbb.ccc.ddd...
  • Page 73 2: D EVICES ■ D8404 to D8407: HMI Module Alternate DNS Server (Current Value Read-only) The HMI module's alternate DNS server address is written to the special data registers as follows. Example: HMI module alternate DNS server: aaa.bbb.ccc.ddd D8404=aaa, D8405=bbb, D8406=ccc, D8407=ddd ■...
  • Page 74 2: D EVICES Upper Status Type ID Lower Position Information System Software Version Node Number Slot Number (0 to 10) (1 to 15) Upper Lower D8470, D8471 = Expansion Module Slot 1 Information D8472, D8473 = Expansion Module Slot 2 Information D8474, D8475 = Expansion Module Slot 3 Information D8476, D8477 = Expansion Module Slot 4 Information D8478, D8479 = Expansion Module Slot 5 Information...
  • Page 75 2: D EVICES Upper Lower D8548, D8549 = Expansion Module Slot 40 Information D8550, D8551 = Expansion Module Slot 41 Information D8552, D8553 = Expansion Module Slot 42 Information D8554, D8555 = Expansion Module Slot 43 Information D8556, D8557 = Expansion Module Slot 44 Information D8558, D8559 = Expansion Module Slot 45 Information D8560, D8561 = Expansion Module Slot 46 Information D8562, D8563 = Expansion Module Slot 47 Information...
  • Page 76 2: D EVICES Upper Status Type ID Lower Expansion Module Connection Information System Software Version Reserved Number of Connected Expansion Modules (0 to 15) Upper Lower D8598, D8599 = Expansion Interface Remote Slave Module (Unit 1) Slot Information D8600, D8601 = Expansion Interface Remote Slave Module (Unit 2) Slot Information D8602, D8603 = Expansion Interface Remote Slave Module (Unit 3) Slot Information D8604, D8605 = Expansion Interface Remote Slave Module (Unit 4) Slot Information D8606, D8607 = Expansion Interface Remote Slave Module (Unit 5) Slot Information...
  • Page 77 2: D EVICES ■ D8639 to D8642: CPU Module Ethernet Port 2 Default Gateway (Write-only) These registers are used to write the default gateway of Ethernet port 2 on the Plus CPU module. Default gateway: For aaa.bbb.ccc.ddd, write the following. D8639 = aaa, D8640 = bbb, D8641 = ccc, D8642 = ddd ■...
  • Page 78 2: D EVICES List of Type IDs and Status ■ Type ID Expansion module and HMI module Type ID Type No. Hexadecimal Binary 0x00 0000 0000 FC6A-N16B1, FC6A-N16B3 0x01 0000 0001 FC6A-R161, FC6A-T16K1, FC6A-T16P1, FC6A-T16K3, FC6A-T16P3 0x02 0000 0010 FC6A-N32B3 0x03 0000 0011 FC6A-T32K3, FC6A-T32P3...
  • Page 79: Basic Instruction List

    3: I NSTRUCTIONS EFERENCE Introduction This chapter provides a list of FC6A Series MICROSmart instructions and describes their functions. The 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...
  • Page 80 3: I NSTRUCTIONS EFERENCE Symbol Name Function See Page 10-ms Timer Subtracting 10-ms timer (0 to 655.35 s) TMHO 10-ms Off-delay Timer Subtracting 10-ms off-delay timer (0 to 655.35 s) 4-11 1-s Timer Subtracting 1-s timer (0 to 65,535 s) TMLO 1-s Off-delay Timer Subtracting 1-s off-delay timer (0 to 65,535 s)
  • Page 81: Advanced Instruction List

    3: I NSTRUCTIONS EFERENCE Advanced Instruction List Valid Data Type Group Symbol Name See Page No Operation 3-11 Move MOVN Move Not IMOV Indirect Move IMOVN Indirect Move Not MOVC Move Characters BMOV Block Move 5-11 Move IBMV Indirect Bit Move 5-12 IBMVN Indirect Bit Move Not...
  • Page 82 3: I NSTRUCTIONS EFERENCE Valid Data Type Group Symbol Name See Page HTOB Hex to BCD 10-1 BTOH BCD to Hex 10-3 HTOA Hex to ASCII 10-5 ATOH ASCII to Hex 10-7 BTOA BCD to ASCII 10-9 ATOB ASCII to BCD 10-12 ENCO Encode...
  • Page 83 3: I NSTRUCTIONS EFERENCE Valid Data Type Group Symbol Name See Page PID Control (FC5A compatible) 19-1 PID Control PIDA PID Control 19-3 PIDD PID with Derivative Decay 19-26 DTML 1-s Dual Timer 20-1 DTIM 100-ms Dual Timer 20-1 Dual / Teaching Timer DTMH 10-ms Dual Timer 20-1...
  • Page 84: Structure Of An Advanced Instruction

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

    3: 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 86 3: I NSTRUCTIONS EFERENCE Floating-Point Data Format The FC6A Series MICROSmart can specify floating-point data (F) for advanced instructions. Like double word (D) and long integer (L) data, floating-point data also uses two consecutive data registers to execute advanced instructions. The FC6A Series MICROSmart supports the floating-point data based on the single storage format of the IEEE (The Institute of Electrical and Electronics Engineers) Standard 754.
  • Page 87 3: I NSTRUCTIONS EFERENCE 32-bit Data Storage The 32-bit data for D (double word) and L (long word) is stored in devices according to the method selected in WindLDR under Device Settings in Function Area Settings. For applicable devices and instructions, see Chapter 5 "32-bit Data Storage Setting" in the "FC6A Series MICROSmart User’s Manual".
  • Page 88 3: 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 exceeds the valid device range •...
  • Page 89: Discontinuity Of Device Areas

    3: 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 M8997 are in a separate area from internal relays M0 through M7997 and M10000 through M21247.
  • Page 90: Device Addressing For Instruction Execution

    3: I NSTRUCTIONS EFERENCE Device Addressing for Instruction Execution This section provides an explanation about how source and destination devices used by instructions for the execution can be specified. There are two ways to specify the device to use: Direct Addressing and Indirect Addressing. Direct Addressing In direct addressing, source and destination devices are specified with the devices to use.
  • Page 91 3: I NSTRUCTIONS EFERENCE Index Registers 16 index registers (P0 to P15) can be used, and the data type of the index register is L (long). Example: LOD M10:P0 • P0=-3 • P0=5 This indirect addressing indicates M0005, which is 3 bits This indirect addressing indicates M0015, which is five bits behind of M0010.
  • Page 92: Basic Instructions

    3: I NSTRUCTIONS EFERENCE Example: MOV(D) 1234 D10:P0 • P0=-3 • P0=5 This indirect addressing indicates D0007, which is 3 words This indirect addressing indicates D0015, which is 5 words behind of D0010. ahead of D0010. MOV(D) S1 - D1 - MOV(D) S1 - D1 -...
  • Page 93 3: I NSTRUCTIONS EFERENCE Indirect Command Comments Addressing OR LOD — BPS, BRD, BPP — TML, TIM, TMH, TIMS, — Indirect addressing is not supported because unique numbers are allocated. TMLO, TIMO, TMHO, TIMSO CNT, CDP, CUD, — Indirect addressing is not supported because unique numbers are allocated. CNTD, CDPD, CUDD CC=, CC>=, DC=, DC>= —...
  • Page 94 3: I NSTRUCTIONS EFERENCE Indirect Instruction Comments Addressing CVDT DTDV DTCB SWAP WKTIM — WKTBL — WEEK — YEAR — — DISP — DGRD — LABEL — LJMP — LCAL — LRET — DJNZ — IOREF — HSCRF — FRQRF —...
  • Page 95 3: I NSTRUCTIONS EFERENCE Indirect Instruction Comments Addressing NDSRC — TADD — TSUB — HOUR — HTOS — STOH — DLOG — TRACE — SCRPT — Index registers cannot be used in scripts. SCALE — FLWA — FLWP — UMACRO —...
  • Page 96 3: I NSTRUCTIONS EFERENCE 3-18 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 97: Lod (Load) And Lodn (Load Not)

    4: B ASIC NSTRUCTIONS Introduction This chapter describes the basic instructions that perform sequence control. 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.
  • Page 98 4: B ASIC NSTRUCTIONS Multiple OUT and OUTN There is no limit to the number of OUT and OUTN instructions that can be programmed Ladder Diagram into one rung. Programming multiple outputs of the same output number is not recommended. However, Ladder Diagram if doing so, it is good practice to separate the outputs with the JMP/JEND set of instructions, or the MCS/MCR set of instructions.
  • Page 99: Set And Rst (Reset)

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

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

    4: B ASIC NSTRUCTIONS AND LOD (Load) The AND LOD instruction is used to connect, in a 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 does not need to program the AND LOD instruction.
  • Page 102: Bps (Bit Push), Brd (Bit Read), And Bpp (Bit Pop)

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

    4: B ASIC NSTRUCTIONS TML, TIM, TMH, and TMS (Timer) Four types of on-delay timers are available; 1-s timer TML, 100-ms timer TIM, 10-ms timer TMH, and 1-ms timer TMS. A total of 2,000 on- and off-delay timers can be programmed in a user program. Each timer must be allocated to a unique number T0 through T1999.
  • Page 104 4: B ASIC NSTRUCTIONS Note: Certain instructions can be programmed in a series after a timer instruction in WindLDR. These instructions are not automatically connected to the right power rail as shown in the above ladder diagram. (Refer to the below diagram.) For details, see "Timer Circuit"...
  • Page 105 4: B ASIC NSTRUCTIONS Timer Circuit The preset value 0 through 65,535 can be designated using a data register; 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 106 4: B ASIC NSTRUCTIONS Timer Counting Error Every timer instruction operation is individually based on asynchronous 16-bit reference timers. Therefore, an error can occur depending on the status of the asynchronous 16-bit timer when the timer instruction is executed. Use of a TMS (1-ms timer) is recommended to reduce advance errors.
  • Page 107: Tmlo, Timo, Tmho, And Tmso (Off-Delay Timer)

    4: B ASIC NSTRUCTIONS TMLO, TIMO, TMHO, and TMSO (Off-Delay Timer) Four types of on-delay off-delay timers are available; 1-s 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 2,000 on- and off-delay timers can be programmed in a user program. Each timer must be allocated to a unique number T0 through T1999.
  • Page 108: Cnt, Cdp, And Cud (Counter)

    4: 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 512 counters can be programmed in a user program. Each counter must be allocated to a unique number C0 through C511.
  • Page 109 4: 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 C511, followed by a counter preset value from 0 to 65,535.
  • Page 110 4: 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 C511, followed by a counter preset value from 0 to 65,535.
  • Page 111: Counter Circuit

    4: B ASIC NSTRUCTIONS Counter Circuit The preset value 0 through 65,535 can be designated using a data register D0 thorough D7999 or D10000 through D61999; then the data of the data register becomes the preset value. Directly after the CNT instruction, the OUT, OUTN, SET, RST, TML, TIM, TMH, or TMS instruction can be programmed. Ladder Diagram Program List Reset...
  • Page 112: Cntd, Cdpd, And Cudd (Double-Word Counter)

    4: 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 256 double-word counters can be programmed in a user program. Each double-word counter uses 2 consecutive devices starting with the allocated device, which can be C0 through C510.
  • Page 113 4: 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 C510, followed by a counter preset value from 0 to 4,294,967,295.
  • Page 114 4: 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 C510, followed by a counter preset value from 0 to 4,294,967,295.
  • Page 115 4: 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 FC6A Series MICROSmart RAM as described on preceding pages.
  • Page 116: Cc= And Cc>= (Counter Comparison)

    4: 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 117 4: 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 value reaches 3 and remains on until counter C2 is Output Q0...
  • Page 118: Dc= And Dc>= (Data Register Comparison)

    4: 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 119 4: 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 120: Sfr And Sfrn (Forward And Reverse Shift Register)

    4: B ASIC NSTRUCTIONS SFR and SFRN (Forward and Reverse Shift Register) FC6A Series MICROSmart have a shift register consisting of 256 bits which are allocated to R0 through R255. 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 121 4: B ASIC NSTRUCTIONS Ladder Diagram Program List Reset Instruction Data Pulse Data Timing Chart Reset Input I0 One or more scans are required Pulse Input I1 Data Input I2 R0/Q0 R1/Q1 R2/Q2 R3/Q3 Ladder Diagram Program List Reset Instruction Data Pulse Data...
  • Page 122 4: 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 123 4: 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 (SFR)" on page 4-24. Next, the SFRN instruction is programed as detailed in the "Reverse Shift Register (SFRN)" on page 4-26. Ladder Diagram Program List Reset...
  • Page 124: Sotu And Sotd (Single Output Up And Down)

    4: 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 125: Mcs And Mcr (Master Control Set And Reset)

    4: 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 126 4: B ASIC NSTRUCTIONS Multiple Usage of MCS instructions Ladder Diagram Program List 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 127: Jmp (Jump) And Jend (Jump End)

    4: 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 128: End

    4: B ASIC NSTRUCTIONS Ladder Diagram Program List 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 129: Restriction On Ladder Programming

    4: 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 130 4: B ASIC NSTRUCTIONS 4-34 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 131: Mov (Move)

    5: 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 132 5: M NSTRUCTIONS Examples: MOV Data Type: Word D10 → M0 MOV(W) S1 – D1 – When input I2 is on, data in data register D10 assigned by source device S1 is moved to 16 internal relays starting with M0 assigned by destination device D1. 12345 M0 through M7, M10 through M17 Data in the source data register is converted into 16-bit binary data, and the ON/...
  • Page 133 5: M NSTRUCTIONS Repeat Operation in the Move Instructions Repeat Source Device When the S1 (source) is set to repeat, as many devices 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. •...
  • Page 134 5: M NSTRUCTIONS • Data Type: Double Word Source (Repeat = 3) Destination (Repeat = 3) MOV(D) S1 R D1 R • Data Type: Float When the 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 135: Movn (Move Not)

    5: M NSTRUCTIONS MOVN (Move Not) S1 NOT → D1 When input is on, 16- or 32-bit data from device assigned by S1 is inverted bit by bit MOVN(*) S1(R) D1(R) and moved to device assigned by D1. ***** ***** Valid Devices Device Function...
  • Page 136: Imov (Indirect Move)

    5: M NSTRUCTIONS IMOV (Indirect Move) S1 + S2 → D1 + D2 IMOV(*) S1(R) D1(R) When input is on, the values contained in devices assigned by S1 and ***** ***** ***** ***** S2 are added together to determine the data source. The 16- or 32- bit data is then moved to the destination, which is determined by the sum of values contained in devices assigned by D1 and D2.
  • Page 137 5: 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.
  • Page 138: Imovn (Indirect Move Not)

    5: 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 assigned by S1 and ***** ***** ***** ***** S2 are added together to determine the data source. The 16- or 32-bit data is then inverted and moved to the destination, which is determined by the sum of values contained in devices assigned by D1 and D2.
  • Page 139: Movc (Move Characters)

    5: M NSTRUCTIONS MOVC (Move Characters) The MOVC instruction moves a character string with the specified character set. Ladder Diagram MOVC ***** ***** String size Operation When the input is on, a NULL terminator (0x00) (1 byte) is added to the character string specified by S1, and that data is sequentially transferred to the devices specified by D1 starting from the upper byte of the device.
  • Page 140 5: M NSTRUCTIONS ■S1 (source 1) setting (1) Input character string Specify a character string within a maximum length of 1,023 bytes, regardless of whether single-byte or double-byte characters are used. When multiple lines are entered, the line feed character (0D0Ah) is inserted between those lines. ■D1 (destination 1) setting (2) First DR Specify the first data register of the data registers where the character string is stored.
  • Page 141: Bmov (Block Move)

    5: 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 assigned by S1 are ***** ***** ***** moved to N blocks of destinations, starting with device assigned by D1.
  • Page 142: Ibmv (Indirect Bit Move)

    5: M NSTRUCTIONS IBMV (Indirect Bit Move) S1 + S2 → D1 + D2 IBMV S1(R) D1(R) When input is on, the values contained in devices assigned by S1 ***** ***** ***** ***** and S2 are added together to determine the source of data. The 1- bit data is then moved to the destination, which is determined by the sum of values contained in devices assigned by D1 and D2.
  • Page 143 5: 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 assigned by source device S1.
  • Page 144: Ibmvn (Indirect Bit Move Not)

    5: 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 assigned by S1 ***** ***** ***** ***** and S2 are together added to determine the data source. The 1-bit data is then inverted and moved to the destination, which is determined by the sum of values contained in devices assigned by D1 and D2.
  • Page 145: Nset (N Data Set)

    5: 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 assigned by S1, S2, ***** ***** ***** S3, ...
  • Page 146: Nrs (N Data Repeat Set)

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

    5: M NSTRUCTIONS XCHG (Exchange) Word data: D1 ↔ D2 Double-word data: D1·D1+1 → D2, D2+1 XCHG(*) ***** ***** When input is on, the 16- or 32-bit data in devices assigned by D1 and D2 are exchanged with each other. Valid Devices Device Function...
  • Page 148: Tccst (Timer/Counter Current Value Store)

    5: M NSTRUCTIONS TCCST (Timer/Counter Current Value Store) S1 → D1 TCCST(*) S1(R) D1(R) When input is on, 16- or 32-bit data assigned by S1 is displayed and stored to the ***** ***** current value of device assigned by D1. Valid Devices Device Function...
  • Page 149: Cmp= (Compare Equal To)

    6: 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 150 6: D OMPARISON NSTRUCTIONS 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 151 6: D OMPARISON NSTRUCTIONS Examples: CMP>= The following examples are described using the CMP≥ instruction. Data comparison operation for all other data comparison instructions is the same for the CMP≥ instruction. • Data Type: Word CMP>=(W) S1 – S2 – D1 –...
  • Page 152 6: D OMPARISON NSTRUCTIONS Repeat Operation in the Data Comparison Instructions The following examples use the CMP>= instruction of word and double word data. 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 output to an output or internal relay.
  • Page 153 6: 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 154: Icmp>= (Interval Compare Greater Than Or Equal To)

    6: 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 assigned by S1, S2, and S3 are ***** ***** *****...
  • Page 155 6: 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 assigned by source devices S1, S2, and S3 are compared. When the condition is met, internal relay Q1 assigned by destination device D1 is turned on.
  • Page 156: Lc= (Load Compare Equal To)

    6: 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 assigned by S1 and S2. When S1 data is equal to ***** ***** S2 data, the output to the following instructions is turned on.
  • Page 157 6: D OMPARISON NSTRUCTIONS Examples: LC Ladder Diagram 1 Program List Reset Data Instruction CNTD 100000 Pulse CNTD 100000 LC=(D) LC=(D) 99997 99997 LC>=(D) LC>=(D) 99996 99996 Timing Chart Reset Input I0 99995 99996 99997 99998 99999 100000 • • • Pulse Input I1 Output Q0 is on when counter C2 current value is 99,997.
  • Page 158 6: D OMPARISON NSTRUCTIONS 6-10 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 159: Add (Addition)

    7: B INARY RITHMETIC NSTRUCTIONS Introduction This chapter describes the arithmetic operation instructions that perform arithmetic based on specified data and store those results in devices. 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 160 7: B INARY RITHMETIC NSTRUCTIONS 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 — — 1-99 For valid device address ranges, see "Device Addresses" on page 2-1. Special internal relays cannot be designated as D1.
  • Page 161 7: 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 162 7: B INARY RITHMETIC NSTRUCTIONS Examples: MUL • Data Type: Word MUL(W) S1 – S2 – D1 – × 300000 D · (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 163 7: B INARY RITHMETIC NSTRUCTIONS Examples: DIV • Data Type: Word ÷ DIV(W) S1 – S2 – D1 – Quotient Remainder When input I2 is on, D10 data is divided by D20 data. The quotient is set to D30, and the remainder is set to D31. Note: Since the destination uses two word devices in the division operation of word data, data register such as D7999 cannot be used as destination device D1.
  • Page 164 7: B INARY RITHMETIC NSTRUCTIONS Repeat Operation in the ADD and SUB Instructions Source devices S1 and S2 and destination device D1 can be assigned to repeat individually or in combination. When destination device D1 is not set to repeat, the final result is set to destination device D1. When repeat is assigned, as many consecutive devices as the repeat cycles, starting with the designated device, are used.
  • Page 165 7: B INARY RITHMETIC NSTRUCTIONS Repeat Source and Destination Devices • Data Type: Word and Integer When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1. S1 (Repeat = 3) S2 (Repeat = 0) D1 (Repeat = 3) ADD(W)
  • Page 166 7: 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 assigned to repeat, the final result is set to destination device D1 and D1+1.
  • Page 167 7: B INARY RITHMETIC NSTRUCTIONS Repeat Source and Destination Devices When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1·D1+1. • Data Type: Word and Integer S2 (Repeat = 0) MUL(W) S1 R S2 –...
  • Page 168 7: B INARY RITHMETIC NSTRUCTIONS Repeat Operation in the DIV Instruction Since the DIV (division) instruction (except float data) uses two destination devices, the quotient and remainder are stored as described below. Source devices S1 and S2 and destination device D1 can be assigned to repeat individually or in combination. When destination device D1 is not assigned to repeat, the final result is set to destination device D1 (quotient) and D1+1 (remainder).
  • Page 169 7: B INARY RITHMETIC NSTRUCTIONS Repeat Two Source Devices • Data Type: Word and Integer When S1 and S2 (source) are assigned 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 170 7: B INARY RITHMETIC NSTRUCTIONS Repeat All Source and Destination Devices • Data Type: Word and Integer When all devices are assigned 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 171: Inc (Increment)

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

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

    7: B INARY RITHMETIC NSTRUCTIONS SUM (Sum) Calculates the total of assigned 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 assigned by S1 are added together and the result is stored to the device assigned by D1.
  • Page 174 7: 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 175 7: B INARY RITHMETIC NSTRUCTIONS • Data Type: Integer SUM(I) –4566 –500 SOTU D100·D101 D100 (FE0Ch) (FFFFEE2Ah) (0019h) –4095 (F001h) (0004h) • Data Type: Double Word SUM(D) 100000 1000000 SOTU D0·D1 D100·D101 D100 (000186A0h) (000F4240h) 200000 D2·D3 (00030D40h) 300000 D4·D5 (000493E0h) 400000 D6·D7...
  • Page 176: Rndm (Random)

    7: B INARY RITHMETIC NSTRUCTIONS RNDM (Random) Generates pseudorandom numbers. RNDM(W) When the input is on, a pseudorandom number is generated with the data specified by ***** ***** ***** S1 as the lower limit and the data specified by S2 as the upper limit, and that value is stored in D1.
  • Page 177: Andw (And Word)

    8: 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, respectively. ANDW (AND Word) S1 · S2 → D1 ANDW(*) S1(R) S2(R)
  • Page 178 8: 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 valid device address ranges, see "Device Addresses" on page 2-1. Special internal relays cannot be assigned as D1.
  • Page 179 8: B OOLEAN OMPUTATION NSTRUCTIONS Repeat Operation in the ANDW, ORW, and XORW Instructions Source devices S1 and S2 and destination device D1 can be assigned to repeat individually or in combination. When destination device D1 is not designated set to repeat, the final result is set to destination device D1. When repeat is assigned, consecutive devices as many as the repeat cycles starting with the designated device are used.
  • Page 180 8: B OOLEAN OMPUTATION NSTRUCTIONS Repeat Source and Destination Devices • Data Type: Word When S1 (source) and D1 (destination) are assigned 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 181: Sftl (Shift Left)

    9: 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 65,535 bits. The result is set to the source device S1 and special internal relay M8003 (carry or borrow).
  • Page 182 9: 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 43,690 to data register D10. SFTL Bits Each time input I0 is turned on, 16-bit data of data register D10 is...
  • Page 183: Sftr (Shift Right)

    9: 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 assigned 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 184 9: 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 185: Bcdls (Bcd Left Shift)

    9: S HIFT OTATE NSTRUCTIONS BCDLS (BCD Left Shift) When input is on, the 32-bit binary data assigned by S1 is converted into 8 BCD digits, shifted to the left by the quantity of digits assigned by S2, and converted back to 32-bit binary data. BCDLS ***** Valid values for each of S1 and S1+1 are 0 through 9,999.
  • Page 186 9: 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 4,567 to M8120 data registers D10 and D11, respectively. MOV(W) S1 –...
  • Page 187: Wsft (Word Shift)

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

    9: S HIFT OTATE NSTRUCTIONS ROTL (Rotate Left) When input is on, 16- or 32-bit data of the assigned source device S1 is rotated to the left by the ROTL(*) bits quantity of bits assigned 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 189 9: 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 40,966 to data register 40966 M8120 D10.
  • Page 190: Rotr (Rotate Right)

    9: S HIFT OTATE NSTRUCTIONS ROTR (Rotate Right) When input is on, 16- or 32-bit data of the assigned source device S1 is rotated to the right by the quantity of bits assigned by device bits. ROTR(*) bits ***** The result is set to the source device S1, and the last bit status rotated out is set to special internal relay M8003 (carry or borrow).
  • Page 191 9: 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 192 9: S HIFT OTATE NSTRUCTIONS 9-12 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 193: Htob (Hex To Bcd)

    10: D ONVERSION NSTRUCTIONS Introduction This chapter describes the data conversion instructions that convert data to the specified format. The ENCO (encode), DECO (decode), and BCNT (bit count) instructions processes bit device data. The ALT (alternate output) instruction turns an output on and off each time an input button is pressed. The CVDT (convert data) instruction converts data types among W (word), I (integer), D (double word), L (long), and F (float).
  • Page 194 10: 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 195: Btoh (Bcd To Hex)

    10: D ONVERSION NSTRUCTIONS BTOH (BCD to Hex) S1 → D1 BTOH(*) When input is on, the BCD data assigned by S1 is converted into 16- or 32-bit binary data and ***** ***** stored to the destination assigned by device D1. Valid values for the source device are 0 through 9,999 (BCD) for word data, and 0 through 99,999,999 (BCD) for double-word data.
  • Page 196 10: 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 197: Htoa (Hex To Ascii)

    10: 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 assigned by S1 is read from the lowest digit as ***** ***** ***** many times as the quantity of digits assigned by S2, converted into ASCII data, and stored to the destination starting with the device assigned by D1.
  • Page 198 10: 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 199: Atoh (Ascii To Hex)

    10: D ONVERSION NSTRUCTIONS ATOH (ASCII to Hex) S1, S1+1, S1+2, S1+3 → D1 ATOH(W) When input is on, the ASCII data, assigned by S1, is converted into 16-bit binary data. ***** ***** ***** The number of times is determined by the quantity of digits assigned by S2. The data is then stored to the destination assigned by device D1.
  • Page 200 10: 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 201: Btoa (Bcd To Ascii)

    10: D ONVERSION NSTRUCTIONS BTOA (BCD to ASCII) Word data: S1 → D1, D1+1, D1+2, D1+3, D1+4 Double-word data: S1·S1+1 → D1, D1+1, D1+2, ... , D1+9 BTOA(*) When input is on, the 16- or 32-bit binary data assigned by S1 is converted into BCD, ***** ***** *****...
  • Page 202 10: 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 Binary ASCII BTOA(W)
  • Page 203 10: 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 204: Atob (Ascii To Bcd)

    10: D ONVERSION NSTRUCTIONS ATOB (ASCII to BCD) Word data: S1, S1+1, S1+2, S1+3, S1+4 → D1 Double-word data: S1, S1+1, S1+2, ... , S1+9 → D1·D1+1 ATOB(*) ***** ***** ***** When input is on, the ASCII data assigned by S1 as many times as the quantity of digits assigned by S2 is converted into BCD, and converted into 16- or 32-bit binary data.
  • Page 205 10: 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 ASCII Binary ATOB(W)
  • Page 206 10: 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 207: Enco (Encode)

    10: D ONVERSION NSTRUCTIONS ENCO (Encode) When input is on, a search begins for the first bit that is set to on. The search begins at S1 until ENCO the first set (on) point is located. The number of points from S1 to the first set point (offset) is Bits ***** *****...
  • Page 208: Deco (Decode)

    10: D ONVERSION NSTRUCTIONS DECO (Decode) When input is on, the values contained in devices assigned by S1 and D1 are added together to determine the destination, and the bit is then turned on. DECO ***** ***** Valid Devices Device Function Constant Repeat...
  • Page 209: Bcnt (Bit Count)

    10: D ONVERSION NSTRUCTIONS BCNT (Bit Count) When input is on, a search begins for the total number of bits that are on an array of consecutive bits starting at the point assigned by source device S1. Source device S2 BCNT assigns the quantity of bits searched.
  • Page 210: Alt (Alternate Output)

    10: D ONVERSION NSTRUCTIONS ALT (Alternate Output) When input is turned on, output, internal relay, or shift register bit assigned by D1 is turned on and remains on after the input is turned off. SOTU ***** When input is turned on again, the assigned output, internal relay, or shift register bit is turned off. The ALT instruction must be used with a SOTU or SOTD instruction, otherwise the assigned output, internal relay, or shift register bit repeats to turn on and off in each scan.
  • Page 211: Cvdt (Convert Data Type)

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

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

    10: D ONVERSION NSTRUCTIONS DTCB (Data Combine) S1, S1+1 → D1 DTCB(W) When input is on, the lower-byte data is displayed from 2 consecutive sources starting with device ***** ***** assigned 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 assigned by device D1, and the lower byte data from the next source device is moved to the lower byte of the destination.
  • Page 215: Swap (Data Swap)

    10: 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) assigned by S1 are exchanged, and the result is stored to destination assigned by D1. ***** ***** Valid Devices...
  • Page 216 10: D ONVERSION NSTRUCTIONS 10-24 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 217 11: W ROGRAMMER NSTRUCTIONS This chapter describes the week programmer instructions that are used to turn outputs on and off on the specified days of the week or dates and times. WKTIM (Week Timer) Compares the specified day of the week, start time, and end time with the current time and outputs that result. WKTIM *...
  • Page 218 11: W ROGRAMMER NSTRUCTIONS Differences in the week programmer instructions There are four types of week programmer instructions: the WKTIM instruction, the WKTBL instruction, the WEEK instruction, and the YEAR instruction. The initial values of the WEEK and YEAR instructions, such as the day of the week, ON time, OFF time, and special dates, can be easily configured in the dialog box for the instruction.
  • Page 219: Week (Weekly Timer)

    11: W ROGRAMMER NSTRUCTIONS 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 220 11: W ROGRAMMER 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 Devices tab with Data register settings. • Configuring the day of the week and the time as fixed settings The day of the week and the time for the ON/OFF settings are uniquely determined.
  • Page 221 11: W ROGRAMMER NSTRUCTIONS 5. D1 (destination 1): Output This setting configures the output for the results when the configured day of the week and time and the current day of the week and time are compared. Setting Description Tag Name Specifies the tag name or the device address for each device.
  • Page 222 11: W ROGRAMMER NSTRUCTIONS Note: When the time is duplicated in the settings on other tabs, the settings on the tab with the larger tab number are valid. For example, if ON time is 8:00 and OFF time is 9:00 on the P 1 tab and ON time is 9:00 and OFF time is 10:00 on the P 2 tab, the 9:00 setting is duplicated on the two tabs and OFF time for the P 1 tab is disabled.
  • Page 223 11: W ROGRAMMER 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 224 11: W ROGRAMMER 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 225 11: W ROGRAMMER NSTRUCTIONS Data Register Allocation If indirectly specifying the settings for the WEEK instruction with data registers, the settings are allocated to the data registers as 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 226 11: W ROGRAMMER 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 while pulse output is enabled, the timing chart is as follows.
  • Page 227 11: W ROGRAMMER NSTRUCTIONS ■ When pulse output is enabled Setting details ON settings Sunday 0:00 Output WEEK Q0000 M0000 [When the input turns on before the day of the week and time specified by the ON settings] On Sunday at 0:00, input M0000 is on, so output Q0 turns on for one scan only on Sunday at 0:00. Day of the week Saturday Sunday...
  • Page 228 11: W ROGRAMMER 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. 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 229 11: W ROGRAMMER 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 230 11: W ROGRAMMER NSTRUCTIONS On P 3 tab, configure the output to turn on Monday, Wednesday, and Friday from 22:00 to 0:00 the next day. Configure the tabs as shown above and set D1 to Q0. WEEK M8125 11-14 FC6A S MICROS FC9Y-B1726 ERIES...
  • Page 231 11: W ROGRAMMER NSTRUCTIONS [To indirectly specify the settings with data registers] This example describes turning on output M0100 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 D0000 and S2 to M0000. 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 232: Year (Yearly Timer)

    11: W ROGRAMMER 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 (A "special date" is a date configured with ON/OFF settings *...
  • Page 233 11: W ROGRAMMER NSTRUCTIONS Settings There are two methods to configure dates for the YEAR instruction. Specify the method on the Devices 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 FC6A Series MICROSmart is running.
  • Page 234 11: W ROGRAMMER NSTRUCTIONS 5. D1 (destination 1): Output This setting configures the output for the results when the configured dates and the current date are compared. Setting Description Tag Name Specifies the tag name or the device address for each device. Device Address Shows the device address that corresponds to the tag name.
  • Page 235 11: W ROGRAMMER NSTRUCTIONS 4. OFF settings This section configures the date to turn off the output. The output is turned off at 0:00 on the configured date. Setting Description Range Year Specifies the year to turn off the output. 2000 to 2099 Month Specifies the month to turn off the output.
  • Page 236 11: W ROGRAMMER 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 237 11: W ROGRAMMER 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 FC6A Series MICROSmart is running. Note: When a special date in the ON/OFF settings is modified with the YEAR instruction input turned on, it is not reflected in the output operation until the current date and time match the changed special date.
  • Page 238 11: W ROGRAMMER NSTRUCTIONS 4. S3 (source 3): The 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 239 11: W ROGRAMMER NSTRUCTIONS Data Register Allocation The settings configured on the Parameter tabs are allocated to the data registers as follows. Storage destination Data size (word) R (Read)/W (Write) Setting Start address+0 Year ON setting Start address+1 Month, Day or Day of the week P 1 tab Start address+2 Year...
  • Page 240 11: W ROGRAMMER 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 241 11: W ROGRAMMER 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 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 242 11: W ROGRAMMER NSTRUCTIONS • When pulse output is enabled The input is determined 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. Settings P 1 tab ON settings July 2, 2012...
  • Page 243 11: W ROGRAMMER 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 244 11: W ROGRAMMER 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 8/12...
  • Page 245 11: W ROGRAMMER 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 : ON Monthly : ON Monday...
  • Page 246 11: W ROGRAMMER NSTRUCTIONS [To turn on output Q0 on the last day of every month between 2013 and 2020] January February March April ON date : 2013/**/end of month OFF date : 2020/**/end of month + 1 day Yearly : ON 31st 1st 28th/29th 1st...
  • Page 247 11: W ROGRAMMER NSTRUCTIONS • To configure the dates by specifying data registers [To turn on M100 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 248 11: W ROGRAMMER NSTRUCTIONS 11-32 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 249: Msg (Message)

    12: D ISPLAY NSTRUCTIONS Introduction This chapter describes the display instructions that display specified data on the HMI module LCD and external devices. MSG (Message) Displays the specified data on the HMI module LCD. ***** When the input is on, a message is displayed on the HMI module LCD according to the content configured in the MSG (Message) dialog box.
  • Page 250 12: D ISPLAY NSTRUCTIONS Settings For the MSG instruction settings, there are settings for the individual MSG instruction and settings that are common to all the MSG instructions. Note: Settings that are common to all the MSG instructions are modified in the Function Area Settings dialog box of WindLDR. For details, see "MSG Instruction Common Settings"...
  • Page 251 12: D ISPLAY NSTRUCTIONS 7. Special Data Special data such as the current date and time can be entered at the cursor position. Select the data to enter on the special data list window popped up when Special Data is pressed. Size of the area used on the LCD display varies based on the selected special data.
  • Page 252 12: D ISPLAY NSTRUCTIONS Insert Word Device The value of the specified word device can be displayed on the HMI module LCD. 1. Device Enter the device to display. Valid Devices W (word) TC, TP, CC, CP, D I (integer) D (double word) CC, CP, D L (long)
  • Page 253 12: D ISPLAY NSTRUCTIONS Floating Point Value Notation on LCD Whether or not F (float) LCD notation uses decimal notation or exponent notation is determined according to the single- precision floating point definition in IEEE 754 and the internal system function included in the CPU module. The IEEE 754 single precision format consists of three fields: a 23-bit fraction, f;...
  • Page 254 12: D ISPLAY NSTRUCTIONS Insert Bit Device Two different items of text can be switched between and displayed on the HMI module LCD according to the value of the specified bit device (when on/when off). 1. Device Enter the device to display. Valid Devices —...
  • Page 255 12: D ISPLAY NSTRUCTIONS Insert Text with Effect The specified text can be displayed on the HMI module LCD. [When scrolling is disabled] [When scrolling is enabled] 1. Display Option Configure the options to scroll, blink, or invert the specified text. For the scroll unit, scroll speed, and blinking speed, see "MSG Instruction Common Settings"...
  • Page 256 12: D ISPLAY NSTRUCTIONS Insert Bar Graph The value of the specified device can be displayed as a bar graph on the HMI module LCD. 1. Device Enter the device to display as a bar graph. Valid Devices W (word) TC, TP, CC, CP, D I (integer) D (double word)
  • Page 257 12: D ISPLAY NSTRUCTIONS 7. Blinking Settings Blink the bar graph when the value of the specified device exceeds the upper or lower limit. For the blinking speed, see "MSG Instruction Common Settings" on page 12-9. Blinking Settings Description Upper limit The bar graph is blinked when the value of the specified device is larger than the upper limit.
  • Page 258 Setting Items Setting Details Device M0000 Display Options All disabled (scroll, blink, invert) 1. Bit Device ON Text IDEC room temp is OFF Text IDEC outdoor temp is Text Now: 2. Text with Effect Display Options All disabled (scroll, blink, invert)
  • Page 259 Configure the parameters so that the room temperature is displayed when M0000 is on and the outdoor temperature is displayed when M0000 is off. Set Device to "M0000". Using the keyboard, enter "IDEC room temp is" as the ON Text and "IDEC outdoor temp is"...
  • Page 260 12: D ISPLAY NSTRUCTIONS After the settings are configured, click OK. The configured content is displayed on the LCD display area. Configuring the text with effect Select the six-column area from the start of the second row and click Text with Effect. Note: The text can also be entered directly on the LCD display area.
  • Page 261 12: D ISPLAY NSTRUCTIONS After the settings are configured, click OK. The configured content is displayed on the LCD display area. Configuring the word device Select the area at the ninth column on the second row and click Word Device. The Insert Word Device dialog box is displayed.
  • Page 262 12: D ISPLAY NSTRUCTIONS After the settings are configured, click OK. The configured content is displayed on the LCD display area. Configuring the special character Select the area at the 15th column on the second row and click Special Character. The Special Characters popup window is displayed.
  • Page 263 12: D ISPLAY NSTRUCTIONS Configuring the bar graph Select the entire area on the third line and click Bar Graph. The Insert Bar Graph popup window is displayed. Set Device to "D0002", Data Type to "Integer (I)", Max to "50", Min to "-20", and Origin to "0". Disable the blinking settings.
  • Page 264 12: D ISPLAY NSTRUCTIONS Configuring the special data Select the left edge of the fourth line and click Special Data. The Special Data window is poped up. Double-click on the Current date. I D E C r o om t e m p i s N o w : 2 8 °...
  • Page 265 12: D ISPLAY NSTRUCTIONS Modifying Device Values on the HMI Module The values of the word devices displayed on the HMI module LCD can be modified using the HMI module operation buttons. The values cannot be modified when the user program is stopped. [To modify the value of word device CP0] Line A monitor Plan: CPO...
  • Page 266 When scrolling a text shorter than or equal to the the LCD specified area on the LCD Text: "IDEC Corporation MICRO Smart" Text: "IDEC Corporation" I D E C C o r p o r a t i o n...
  • Page 267 When a text with effect is set to scroll, the text is displayed on the LCD of the HMI module as follows. Text: "IDEC Corporation" 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 5 6 7 8 1 2 5 6 7 8 1 2 IDEC Corporation.
  • Page 268: Disp (Display)

    12: D ISPLAY NSTRUCTIONS DISP (Display) Displays the specified data on a 7-segment display. When the input is on, the data specified by S1 is displayed DISP BCD4 ***** ***** on the 7-segment display. Display data can be 0 through 65535 (FFFFh). Quantity of digits: Data phase: 1 to 5 (decimal)
  • Page 269 12: D ISPLAY NSTRUCTIONS Operation Example To display the 4-digit current value of counter C010 on a 7-segment display (IDEC DD3S-F31N) connected to the transistor sink output module. When input I0 is on, the 4-digit current value of counter C10 DISP is displayed on 7-segment digital display units.
  • Page 270: Dgrd (Digital Read)

    12: D ISPLAY NSTRUCTIONS DGRD (Digital Read) When input is on, the setting values for the connected digital switch are stored in the device specified by D1. DGRD BCD4 ***** ***** ***** This instruction can be used to change preset values for timer and counter instructions using digital switches.
  • Page 271 NSTRUCTIONS Operation Example The following example demonstrates a program where digital switches (IDEC DFBN-031D-B) have been connected to the 16-I/O type transistor sink output module and those setting values are read into D0010. When input I5 is on, the 4-digit value from BCD digital switches is read to DGRD data register D10.
  • Page 272 12: D ISPLAY NSTRUCTIONS 12-24 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 273: Label (Label)

    13: P ROGRAM RANCHING NSTRUCTIONS Introduction This chapter describes the ladder program branching instructions that are used for branching program execution, looping ladder program execution, and creating ladder program subroutines. Ladder program instruction execution branches from the LJMP (label jump) instruction and the DJNZ (decrement jump non-zero) instruction to the location where the LABEL instruction has been entered.
  • Page 274 13: P ROGRAM RANCHING NSTRUCTIONS Example: LJMP and LABEL The following example demonstrates a program that jumps to three different portions of the program depending on the input. When input I0 is on, program execution jumps to label 0. LJMP LJMP When input I1 is on, program execution jumps to label 1.
  • Page 275: Lcal (Label Call)

    13: P ROGRAM RANCHING NSTRUCTIONS LCAL (Label Call) When input is on, the address with label 0 through 255 assigned 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 276 13: 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 277: Djnz (Decrement Jump Non-Zero)

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

    14: R EFRESH NSTRUCTIONS Introduction This chapter describes the refresh instructions that update the status of input contacts, external output , and the current value of the high-speed counter, to the latest value during a ladder scan. IOREF (I/O Refresh) When input is on, 1-bit I/O data assigned by source device S1 is refreshed immediately regardless of the IOREF scan time.
  • Page 280 14: R EFRESH NSTRUCTIONS Example: IOREF The following example demonstrates a program that transfers the input I0 status to output Q0 using the IOREF instruction. Input I3 is designated as an interrupt input. For the interrupt input function, see Chapter 5 "Functions and Settings" - "Interrupt Input" in the "FC6A Series MICROSmart User’s Manual".
  • Page 281: Hscrf (High-Speed Counter Refresh)

    14: R EFRESH NSTRUCTIONS HSCRF (High-speed Counter Refresh) When the input is on, the current values of the high-speed counters (select from group 1 to group 6) allocated to HSCRF special data registers are updated to the latest values. (The group number of the selected high-speed counter is displayed under the advanced instruction symbol.) The current values of six high-speed counters HSC1 through HSC6 are usually updated in every scan.
  • Page 282: Frqrf (Frequency Measurement Refresh)

    14: R EFRESH NSTRUCTIONS FRQRF (Frequency Measurement Refresh) When the input is on, the frequency measurement values (select from group 1 to group 6) allocated to special data registers are updated to the latest values. (The group number of the selected high-speed counter is displayed under FRQRF the advanced instruction symbol.) Before the measured results are reflected in special data registers, it takes a maximum of approximately 250 ms + the...
  • Page 283: Comrf (Communication Refresh)

    14: R EFRESH NSTRUCTIONS COMRF (Communication Refresh) Execute reading of received data and writing of send data for port 2 and 3 (communication port refresh) during user program processing. COMRF When implementing an application that requires a communication response from the communication cartridge in a time interval that is shorter than the scan time of FC6A Series MICROSmart, program it with the COMRF instruction.
  • Page 284 14: R EFRESH NSTRUCTIONS 14-6 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 285: Di (Disable Interrupt)

    15: I NTERRUPT ONTROL NSTRUCTIONS Introduction This chapter describes interrupt control instructions that prohibit and allow user interrupt operations (interrupt input, timer interrupt). DI (Disable Interrupt) When input is on, interrupt inputs and timer interrupt assigned by source device S1 are disabled. EI (Enable Interrupt) When input is on, interrupt inputs and timer interrupt assigned by source device S1 are enabled.
  • Page 286 15: I NTERRUPT ONTROL NSTRUCTIONS Programming WindLDR In the DI (Disable Interrupt) or EI (Enable Interrupt) dialog box, select the check box on the left of Interrupt Groups 1 through 6 or Timer Interrupt to select source device S1. The example below selects interrupt groups 2, 3, and timer interrupt for the DI instruction, and a 22 will be shown as source device S1.
  • Page 287 15: I NTERRUPT ONTROL NSTRUCTIONS Example: DI and EI The following example demonstrates a program that will disable and enable interrupt inputs and timer interrupt selectively. For the interrupt input and timer interrupt functions, see Chapter 5 "Functions and Settings" - "Interrupt Input" and "Timer Interrupt" in the "FC6A Series MICROSmart User’s Manual".
  • Page 288 15: I NTERRUPT ONTROL NSTRUCTIONS 15-4 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 289: Xyfs (Xy Format Set)

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

    16: C OORDINATE ONVERSION NSTRUCTIONS Note: The XYFS instruction cannot be used in an interrupt program. If used, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MICROSmart. For details about the user program execution errors, see "User Program Execution Errors"...
  • Page 291: Cvytx (Convert Y To X)

    16: C OORDINATE ONVERSION NSTRUCTIONS CVYTX (Convert Y to X) When input is on, the Y value assigned by device S2 is converted into the CVYTX(*) corresponding X value according to the linear relationship defined in the XYFS ***** ***** instruction.
  • Page 292 16: 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) = (8,000, 4,000). Once these are set, there is an X to Y conversion, as well as a Y to X conversion.
  • Page 293 16: 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 294 16: C OORDINATE ONVERSION NSTRUCTIONS 16-6 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 295: Avrg (Average)

    17: A VERAGE NSTRUCTIONS Introduction This chapter describes the average instructions that average the specified data. AVRG (Average) When input is on, sampling data assigned by device S1 is processed according to sampling conditions assigned by devices AVRG(*) S2 and S3. ***** ***** *****...
  • Page 296 17: 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 assigned as the source, 16 points (word or integer data) or 32 points (double-word or long data) are used. I (integer) D (double word) When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, 1 point (word...
  • Page 297: Puls (Pulse Output)

    18: P ULSE UTPUT NSTRUCTIONS Introduction This chapter describes the pulse output instructions that output pulses of a specified frequency from the pulse outputs. PULS (Pulse Output) The PULS instruction outputs pulses of the specified frequency from the pulse outputs with a fixed duty cycle. PULS When the input is on, pulses are output with a fixed duty cycle according to the *****...
  • Page 298 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select Mode Selects the configuration mode. FC6A Standard Mode or FC5A (except FC5A-D12X1E) Compatible Mode can be selected. Select FC5A (except FC5A-D12X1E) Compatible Mode to use the FC5A Series MICROSmart PULS instruction specification. When changing the PLC type from the FC5A/FC4A Series MICROSmart, FC5A (except FC5A-D12X1E) Compatible Mode is automatically selected.
  • Page 299 18: P ULSE UTPUT NSTRUCTIONS 3. S1 (source 1): Control register S1 specifies the first data register of the data registers to use with PULS1, PULS2, PULS3, or PULS4 instructions. Starting from the specified data register, 8 consecutive data registers are used. Specify the first data register so that the device range is not exceeded.
  • Page 300 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tab This tab configures the operation of the PULS instruction. 6. Output pulse frequency Specifies the pulse frequency. The output frequency error is ±5%. The setting differs by the CPU module type and the instruction. Configurable Range CPU Module Type Instruction...
  • Page 301 18: P ULSE UTPUT NSTRUCTIONS Examples: PULS PULS1 instruction (pulse counting enabled) timing chart [PULS1 instruction, S1 is specified as D0200, D1 is specified as internal relay M0050] PULS D0200 M0000 M0050 PULS1 instruction input PULS1 instruction input Output pulse D0200, D0201 frequency Preset value...
  • Page 302 18: P ULSE UTPUT NSTRUCTIONS PULS2 instruction (pulse counting disabled) timing chart [PULS2 instruction, S1 is specified as D0100, D1 is specified as internal relay M0200] PULS D0100 M0000 M0200 PULS2 instruction input PULS2 instruction input Output pulse D0101, D0100 frequency Output pulse Pulse output ON...
  • Page 303 18: 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 Q0 Turn on initialization input (M0000) M8120 M0000 MOV(D) S1 - D1 - SOTU...
  • Page 304: Pwm (Variable Duty Cycle Pulse Output)

    18: P ULSE UTPUT NSTRUCTIONS PWM (Variable Duty Cycle Pulse Output) The PWM instruction outputs pulses of the specified frequency and duty cycle from the output. When the input is on, pulses are output according to the control register settings ***** ***** *****...
  • Page 305 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select Mode Selects the configuration mode. FC6A Standard Mode, FC4A Compatible Mode, FC5A (except FC5A-D12X1E) Compatible Mode, or FC5A-D12X1E Compatible Mode can be selected. To use the PWM instruction with the FC4A Series MICROSmart, the FC5A Series MICROSmart, or the FC5A-D12 PWM instruction specification, select one of the FC compatibility modes.
  • Page 306 18: P ULSE UTPUT NSTRUCTIONS CAN J1939 All-in-One CPU module/Plus CPU module Configurable Range Instruction Pulse Output Frequency Duty Cycle *1*2 PWM1 *1*2 PWM2 15 Hz to 5 kHz (increments of 1 Hz) 0.1 to 100.0 (increments of 0.1%) *1*2 PWM3 *1*2 PWM4...
  • Page 307 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tab 6. Output pulse frequency Specifies the frequency of the pulses to output. The frequency is specified between 15 Hz and 5 kHz in 1 Hz increments. The pulse frequency error is within ±5%. 7.
  • Page 308 18: 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 M0050] D0200 M0000 M0050 PWM1 instruction input PWM1 instruction input Pulse width ratio D0201 Preset value D0202, D0203...
  • Page 309 18: P ULSE UTPUT NSTRUCTIONS PWM2 instruction (pulse counting disabled) timing chart [PWM2 instruction, S1 is specified as D0100, D1 is specified as internal relay M0200] D0100 M0000 M0200 PWM2 instruction input PWM2 instruction input Pulse width ratio D0101 Output pulse Pulse output ON M0200 Pulse output...
  • Page 310 18: 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 (M0000) M8120 M0000...
  • Page 311: Ramp (Trapezoidal Control)

    18: 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 312 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select Mode Selects the configuration mode. FC6A Standard Mode or FC5A (except FC5A-D12X1E) Compatible Mode can be selected. Select FC5A (except FC5A-D12X1E) Compatible Mode to use the FC5A Series MICROSmart PULS instruction specification. When changing the PLC type from the FC5A/FC4A Series MICROSmart, FC5A (except FC5A-D12X1E) Compatible Mode is automatically selected.
  • Page 313 18: P ULSE UTPUT NSTRUCTIONS 3. S1 (source 1): Control register S1 specifies the first data register of the data registers to use with RAMP1, RAMP2, RAMP3 or RAMP4 instructions. Starting from the specified data register, 12 consecutive data registers are used. Specify the first data register so that the device range is not exceeded.
  • Page 314 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tab 6. Steady pulse frequency This setting specifies the steady pulse frequency after the pulse frequency increases. The output frequency error is ±5%. The corresponding instruction and frequency differ by the CPU module type. Configurable Range CPU Module Type Instruction...
  • Page 315 18: P ULSE UTPUT NSTRUCTIONS S-shaped curve Frequency Steady pulse frequency Total number of pulses Initial pulse frequency Frequency decrease time Frequency increase time Notes: The S-shaped curve frequency change curve is approximated with a 3D function based on a setting value. The setting value of the •...
  • Page 316 18: P ULSE UTPUT NSTRUCTIONS 12. Absolute Position Mode When the target position is specified with preset count (13), pulses are output by automatically calculating the number of pulses and direction from the difference between the current position stored in the absolute position counter (D8240 to D8247) and the target position.
  • Page 317 18: P ULSE UTPUT NSTRUCTIONS RAMP1 instruction (reversible control disabled) timing chart RAMP1 instruction, S1 is specified as D0200, D1 is specified as internal relay M0050 RAMP D0200 M0000 M0050 PAMP instruction input RAMP instruction input Steady pulse frequency Initial pulse Frequency Frequency frequency...
  • Page 318 18: P ULSE UTPUT NSTRUCTIONS RAMP1 instruction (reversible control enabled, single-pulse output mode) timing chart RAMP1 instruction, S1 is specified as D0200, D1 is specified as internal relay M0050 RAMP D0200 M0000 M0050 RAMP instruction input RAMP instruction input Control direction D0203 0 (Forward) 1 (Reverse)
  • Page 319 18: P ULSE UTPUT NSTRUCTIONS RAMP1 instruction (reversible control enabled, dual-pulse output mode) timing chart RAMP1 instruction, S1 is specified as D0200, D1 is specified as internal relay M0050 RAMP D0200 M0000 M0050 RAMP instruction input RAMP instruction input Forward pulse Reverse pulse Control direction D0203...
  • Page 320 18: P ULSE UTPUT NSTRUCTIONS Example: To output 48,000 pulses with the frequency change function (reversible control disabled) from Q0 Turn on initialization input (M0000) M8120 M0000 When the RAMP instruction input (I0) turns on, pulse output RAMP starts D0000 M0000 M0100 I0000...
  • Page 321 18: P ULSE UTPUT NSTRUCTIONS To output 100,000 pulses with the frequency change function (reversible control by single-pulse output) from Q0 When the RAMP instruction input (I0) changes from off to on, pulse output starts. When I1 is off, the reversible control signal (Q2) turns off (forward).
  • Page 322 18: 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 Q0.
  • Page 323: Rampl (Linear Interpolation Control)

    18: P ULSE UTPUT NSTRUCTIONS RAMPL (Linear Interpolation Control) The RAMPL instruction outputs pulses with a frequency change function that operates simultaneously from two outputs, so that the trajectory of movement is linear. This instruction can be used with the Plus CPU module transistor output type and CAN J1939 All-in-One CPU module transistor output type.
  • Page 324 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Device tab (1) Select instruction Selects the RAMPL instruction to use from RAMPL12, RAMPL13, RAMPL14, RAMPL23, RAMPL24, and RAMPL34. The combination of pulse outputs will depend on the instruction. For details, see "(11) Reversible control" on page 18-32. (2) S1 (source 1): Control register S1 specifies the first data register of the data registers to use with the RAMPL12, RAMPL13, RAMPL14, RAMPL23, RAMPL24, or RAMPL34 instruction.
  • Page 325 18: P ULSE UTPUT NSTRUCTIONS Storage Function Setting Reference Destination Starting *1*2 Steady pulse frequency (high word) number+10 "(9) Steady pulse frequency" on 15 to 100,000 (increments of 1 Hz) page 18-32 Starting *1*2 Steady pulse frequency (low word) number+11 Starting *1*2 Initial pulse frequency (high word)
  • Page 326 18: P ULSE UTPUT NSTRUCTIONS (4) D1 (destination 1): Operation status D1 specifies the first internal relay of the internal relays to use with the RAMPL instruction. Starting from the specified internal relay, 4 sequential internal relays are used. Specify the first internal relay so that the device range is not exceeded. Storage Function Setting...
  • Page 327 18: P ULSE UTPUT NSTRUCTIONS (8) Error status Outputs the error code that corresponds to the content of an error when there is an error in the settings. If a configuration error occurs when the RAMPL 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 328 18: P ULSE UTPUT NSTRUCTIONS (10) (11) (12) (13) (14) (9) Steady pulse frequency The steady pulse frequency of each axis is calculated from the amount of movement to the target position and the combined steady pulse frequency, and this value is stored in the data registers. When the instruction is turned on, the steady pulse frequency is calculated and updated.
  • Page 329 18: P ULSE UTPUT NSTRUCTIONS Output Used X Axis Y Axis Command Operating Condition Reversible Reversible Pulse Output Pulse Output Control Output Control Output Reversible control: Single-pulse output mode RAMPL23 Reversible control: Dual-pulse output Q2, Q3 — Q4, Q5 — mode Reversible control: Single-pulse output mode...
  • Page 330 18: P ULSE UTPUT NSTRUCTIONS RAMPL12 Instruction (Reversible Control Enabled, Single-pulse Output) Timing Chart When data register D0200 is specified for S1 and internal relay M0050 is specified for D1 of the RAMPL12 instruction in order to move from the current position (0, 0) to the target position (2000, -1000) RAMPL D0200 M0000...
  • Page 331 18: P ULSE UTPUT NSTRUCTIONS RAMPL34 Instruction (Reversible Control Enabled, Dual-pulse Output) Timing Chart When data register D0200 is specified for S1 and internal relay M0050 is specified for D1 of the RAMPL34 instruction in order to move from the current position (2000, -1000) to the target position (-2000, -3000) RAMPL D0200 M0000...
  • Page 332: Zrn (Zero Return)

    18: P ULSE UTPUT NSTRUCTIONS ZRN (Zero Return) The ZRN instruction outputs pulses while monitoring multiple signals to perform a zero return. When the input is on, pulses are output according to the frequency ***** ***** ***** ***** change settings stored in the control register specified by S1. The pulse control information (output on/output complete/error) is stored in the internal relays specified by D2 as the operation status.
  • Page 333 18: P ULSE UTPUT NSTRUCTIONS Start monitoring the origin signal with the fall in the proximity signal The rise in the proximity signal is detected and the frequency [Hz] Frequency Frequency starts being decreased. increase time decrease time The fall in the proximity signal is detected and the origin signal Steady pulse frequency starts being monitored.
  • Page 334 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select Mode Selects the configuration mode. FC6A Standard Mode or FC5A (except FC5A-D12X1E) Compatible Mode can be selected. Select FC5A (except FC5A-D12X1E) Compatible Mode to use the FC5A Series MICROSmart ZRN instruction specification. When changing the PLC type from the FC5A/FC4A Series MICROSmart, FC5A (except FC5A-D12X1E) Compatible Mode is automatically selected.
  • Page 335 18: P ULSE UTPUT NSTRUCTIONS 3. S1 (source 1): Control register S1 specifies the first data register of the data registers to use with ZRN1, ZRN2, ZRN3 or ZRN4 instructions. Starting from the specified data register, 14 consecutive data registers are used. Specify the first data register so that the device range is not exceeded.
  • Page 336 18: P ULSE UTPUT NSTRUCTIONS 6. S4 (source 4): Origin Input S4 specifies the origin signal. The rise in the origin signal is detected and pulse output is stopped. An external input or an internal relay can be specified. When ZRN mode 0 is selected for 9. Zero return method, the origin signal is ignored, even when specified.
  • Page 337 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tab This tab configures the operation of the ZRN instruction functions. 9. ZRN Mode Select ZRN mode 0 or ZRN mode 1 for the zero return method according to the applicable system. Setting Description ZRN mode 0 The zero return is performed by monitoring only the proximity signal.
  • Page 338 18: P ULSE UTPUT NSTRUCTIONS 15. Deceleration time This setting specifies the time to decrease the pulse frequency. Set the time between 10 and 10,000 ms in increments of 1 ms. The first digit of the setting is handled as zero. For example, if 144 is entered, the set value is handled as 140 ms.
  • Page 339 18: P ULSE UTPUT NSTRUCTIONS ZRM Mode 0 (When Using Only the Proximity Signal) Timing Chart ZRN1 instruction, S1 is specified as data register D0200, S3 is specified as external input I2, D1 is specified as internal relay M0010 I0002 M0010 D0200 M0000...
  • Page 340 18: P ULSE UTPUT NSTRUCTIONS ZRM Mode 1 (When Using the Proximity Signal and Origin Signal) Timing Chart ZRN1 instruction, S1 is specified as data register D0200, S3 is specified as external input I2, D1 is specified as internal relay M0010 I0002 M0010 D0200...
  • Page 341 18: P ULSE UTPUT NSTRUCTIONS Example: To perform a zero return operation with proximity signal I2, initial pulse frequency 3 kHz, and creep pulse frequency 800 Hz Turn on initialization input (M0000) M8120 M0000 Pulse output ON (M0100) off M0100 Pulse output complete (M0101) off M0101 Pulse output status (M0102) off...
  • Page 342: Aramp (Ramp With Table)

    18: 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 A frequency change and target frequency are set for each step, and the pulse frequency is controlled through the combination of these steps.
  • Page 343 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select instruction This item selects which ARAMP instruction to use ("ARAMP1", "ARAMP2", "ARAMP3" or "ARAMP4"). The output, reversible control mode, and operation mode that can be selected differ by the instruction and CPU module type. For limitations based on the combination of instruction, reversible control mode, and the pulse output mode, see "8.
  • Page 344 18: P ULSE UTPUT NSTRUCTIONS 2. S1 (source 1): Control Register S1 specifies the first data register of the data registers to use with the ARAMP1, ARAMP2, ARAMP3 or ARAMP4 instruction. Starting from the specified data register, "2+8 x N (N: number of steps)" consecutive data registers are used. The range of data registers that can be specified depends on the number of steps.
  • Page 345 18: 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 ARAMP (Advanced Ramp) dialog box, on the Settings tab, are stored in the control registers. An external input or an internal relay can be specified. When the initialization input is on, the initial values are stored in the data registers with each scan.
  • Page 346 18: P ULSE UTPUT NSTRUCTIONS 5. D1 (destination 1): Monitor Register D1 specifies the first data register of the data registers to use with ARAMP1, ARAMP2, ARAMP3 or ARAMP4. Starting from the specified data register, 11 consecutive data registers are used. Specify the first data register so that the device range is not exceeded.
  • Page 347 18: P ULSE UTPUT NSTRUCTIONS Error status Outputs the error code that corresponds to the content of an error when there is an error in the settings. If a configuration error occurs when a step starts executing, a user program execution error will occur, and the error code 20 is stored in D8006.
  • Page 348 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tab 8. Reversible control enable This setting enables or disables reversible control and selects the reversible control method from the following modes. There are two modes for the pulse output mode: single-pulse and dual-pulse. They can be combined with reversible control as follows. (This is an example when ARAMP is used with the All-in-One CPU module.) Reversible Control Enable Operation...
  • Page 349 18: P ULSE UTPUT NSTRUCTIONS ■ Ramp Table tab 12. Step numbers This option selects the step number to configure. The output frequency error is ±5%. 13. Steady pulse frequency This setting specifies the frequency at the steady output state before or after changing the frequency. CPU Module Type Instruction Steady Pulse Frequency...
  • Page 350 18: P ULSE UTPUT NSTRUCTIONS Acceleration/deceleration control The frequency changes as shown in the following diagram according to the setting for the execution timing of the change. In the Before column, the frequency changes and then becomes steady. When the number of pulses in the preset value is output, the instruction transitions to the next step.
  • Page 351 18: P ULSE UTPUT NSTRUCTIONS ARAMP1 instruction (single-pulse output reversible control enabled) timing chart ARAMP1 instruction, S1 is specified as data register D0200, S2 is specified as internal relay M0000, S3 is disabled, D1 is specified as data register D0000, D2 is specified as internal relay M0050 ARAMP D0200 M0000...
  • Page 352 18: P ULSE UTPUT NSTRUCTIONS ARAMP1 instruction (dual-pulse output reversible control enabled) timing chart All-in-One CPU module, ARAMP1 instruction, S1 is specified as data register D0200, S2 is specified as internal relay M0000, S3 is disabled, D1 is specified as data register D0000, D2 is specified as internal relay M0050 ARAMP D0200 M0000...
  • Page 353 18: P ULSE UTPUT NSTRUCTIONS Sample program When outputting pulses as shown in the diagram below with the frequency change function (reversible control disabled) using the following settings The pulses are output from Q0. 10 kHz Step 1 Step 2 Step 3 Preset value 4,000 Preset value 4,000...
  • Page 354 18: P ULSE UTPUT NSTRUCTIONS Step 1 settings Function Device Address Setting Value Details Steady pulse frequency D0002, D0003 100 Hz Frequency change time D0005 2000 2,000 ms Preset value D0006, D0007 4000 Preset value=4,000 Control direction D0008 — — Acceleration/deceleration control D0008 Acceleration/deceleration later...
  • Page 355 18: P ULSE UTPUT NSTRUCTIONS Step 3 settings Function Device Address Setting Value Details Steady pulse frequency D0018, D0019 15 Hz Frequency change time D0021 4000 4,000 ms Preset value D0022, D0023 4000 Preset value=4,000 Control direction D0024 — — Acceleration/deceleration control D0024 Acceleration/deceleration later...
  • Page 356 18: P ULSE UTPUT NSTRUCTIONS Basic settings Function Device Address Setting Value Details Reversible control enable — Single-pulse output — Number of steps — — Start step number — Step 1 Interrupt step number D0000 — Step 1 settings Function Device Address Setting Value Details...
  • Page 357 18: P ULSE UTPUT NSTRUCTIONS Step 2 settings Function Device Address Setting Value Details Steady pulse frequency D0010, D0011 15 Hz Frequency change time D0013 3000 3,000 ms Preset value D0014, D0015 5000 Preset value=5,000 Control direction D0016 Forward Forward Acceleration/deceleration control D0016 Acceleration/deceleration later...
  • Page 358 18: P ULSE UTPUT NSTRUCTIONS Step 4 settings Function Device Address Setting Value Details Steady pulse frequency D0026, D0027 15 Hz Frequency change time D0029 3000 3,000 ms Preset value D0030, D0031 5000 Preset value=5,000 Control direction D0032 Reverse Reverse Acceleration/deceleration control D0032 Acceleration/deceleration first...
  • Page 359 18: P ULSE UTPUT NSTRUCTIONS When outputting pulses as shown in the diagram below with the frequency change function (single-pulse output reversible control disabled) using the following settings The pulses are output from Q0. Interrupt Step 100 kHz Step 1 Step 2 Step 3 Step 4...
  • Page 360 18: P ULSE UTPUT NSTRUCTIONS Basic settings Function Device Address Setting Value Details Reversible control enable — Disable — Number of steps — — Start step number — Step 1 Interrupt step number D0000 Step 6 Step 1 settings Function Device Address Setting Value Details...
  • Page 361 18: P ULSE UTPUT NSTRUCTIONS Step 2 settings Function Device Address Setting Value Details Steady pulse frequency D0010, D0011 10000 10,000 Hz Frequency change time D0013 5000 5,000 ms Preset value D0014, D0015 100000 Preset value=100,000 Control direction D0016 — —...
  • Page 362 18: P ULSE UTPUT NSTRUCTIONS Step 4 settings Function Device Address Setting Value Details Steady pulse frequency D0026, D0027 5000 5,000 Hz Frequency change time D0029 8000 8,000 ms Preset value D0030, D0031 1000000 Preset value=1,000,000 Control direction D0032 — —...
  • Page 363 18: P ULSE UTPUT NSTRUCTIONS Step 6 settings Function Device Address Setting Value Details Steady pulse frequency D0042, D0043 15 Hz Frequency change time D0045 5000 5000 ms Preset value D0046, D0047 30000 Preset value=30,000 Control direction D0048 — — Acceleration/deceleration control D0048 Acceleration/deceleration first...
  • Page 364: Abs (Set Absolute Position)

    18: P ULSE UTPUT NSTRUCTIONS ABS (Set Absolute Position) The ABS instruction initializes the absolute position counter for pulse output. ***** ***** ***** ***** Operation When the input is on, the values of special data registers D8240 to D8247 (absolute position counters) are updated to the initial values specified by S1.
  • Page 365 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select instruction This item selects which ABS instruction to use ("ABS1", "ABS2", "ABS3", or "ABS4"). The absolute position counter to be initialized differs with the instruction. Special Data Instructions that Update the Absolute Command Absolute Position Counter Description...
  • Page 366 18: P ULSE UTPUT NSTRUCTIONS 2. S1 (source 1): Initial Value Specifies the first data register of the devices that store the value for initialization or a constant. Starting from the specified data register, 2 continuous words of data registers are used. Specify the first data register so that the device range is not exceeded.
  • Page 367 18: P ULSE UTPUT NSTRUCTIONS Example: Return start D0000 M0000 I0000 ***** M0100 ***** M0050 Return complete M0101 Return Return Return start complete start M0050 M0101 M0050 After the power is turned on, the ZRN1 instruction is started and a zero return is performed. After the zero return operation completes, absolute position counter 1 is initialized to 100 with the ABS1 instruction.
  • Page 368: Jog (Jog Operation)

    18: P ULSE UTPUT NSTRUCTIONS JOG (JOG Operation) The JOG instruction output pulses with a frequency change. ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** Operation When the input is on and the JOG input specified by S3 is turned on, pulses of the initial pulse frequency specified by S1 are output, and then the pulse frequency is increased at a constant rate until it reaches the steady pulse frequency.
  • Page 369 18: P ULSE UTPUT NSTRUCTIONS Settings ■ Devices tab 1. Select instruction This item selects which JOG instruction to use ("JOG1", "JOG2", "JOG3", or "JOG4"). The output and reversible control mode that can be selected differ by the instruction and CPU module type. For limitations due to the combination of instruction, reversible control mode, and the pulse output mode, see "10.
  • Page 370 18: 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 JOG (JOG) dialog box, on the Settings tab, are stored in the control registers. An external input or an internal relay can be specified. When the initialization input is on, the initial values are stored in the data registers with each scan.
  • Page 371 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tab 6. Steady pulse frequency This setting specifies the steady pulse frequency after the pulse frequency is increased. Set between 15 and 100 kHz in 1 Hz increments. The output frequency error is within ±5%. For JOG3 and JOG4 with the All-in-One CPU module, set between 15 and 5 kHz in 1 Hz increments.
  • Page 372 18: P ULSE UTPUT NSTRUCTIONS Output Used CAN J1939 All-in-One CPU All-in-One CPU Module Command Operating Condition Module/Plus CPU Module Reversible Reversible Pulse Output Pulse Output Control Output Control Output Reversible control disabled — — JOG3 Reversible control Single-pulse output —...
  • Page 373 18: P ULSE UTPUT NSTRUCTIONS JOG1 Instruction (Reversible Control Disabled) Timing Chart With the All-in-One CPU module, JOG1 instruction, S1 is specified as D0200, D1 is specified as internal relay M0050 D0200 M0010 I0004 M0050 M0000 JOG instruction M0000 input I0004 JOG input Steady pulse frequency...
  • Page 374 18: P ULSE UTPUT NSTRUCTIONS Setting 18-78 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 375: Pulse Monitor

    18: P ULSE UTPUT NSTRUCTIONS Pulse Monitor Function Description This function monitors the pulses that the FC6A Series MICROSmart outputs from the output ports with the pulse output instructions and graphs the trajectory and waveform of each axis. The Pulse Monitor can be used only with the Plus CPU module. Notes: Data is accumulated in the PLC in order for WindLDR to acquire data at a regular interval.
  • Page 376 18: P ULSE UTPUT NSTRUCTIONS Pulse Monitor Dialog Box 1. Start Click this button to start the Pulse Monitor. WindLDR will acquire data from the PLC at a regular interval. 2. Stop Click this button to stop the Pulse Monitor. 3.
  • Page 377 18: P ULSE UTPUT NSTRUCTIONS 9. Scale Setting (Velocity) Select the scale of speed (Y-axis) on the waveform graph from Auto Scaling or Specify Scaling. Auto Scaling: The maximum value of the graph is automatically updated according to the maximum value of the data. Specify Scaling: Manually enter the maximum value of speed (Y-axis).
  • Page 378: Positioning Control

    18: P ULSE UTPUT NSTRUCTIONS Positioning Control This section provides an overview of positioning control as well as WindLDR settings, wiring diagrams, and practical examples. Positioning Control Overview Positioning control can be performed with the pulse output instructions. The All-in-One CPU module can simultaneously control up to two axes. The Plus CPU module and CAN J1939 All-in-One CPU module can simultaneously control up to four axes.
  • Page 379 18: P ULSE UTPUT NSTRUCTIONS Pulse Output Instruction Setting Items Reversible Control Enable Reversible control enable is the mode that controls the rotation direction of the motor. It can be used with the RAMP/RAMPL/ZRN/ ARAMP pulse output instructions. There are three modes for reversible control enable: disabled, single-pulse output mode, and dual-pulse output mode.
  • Page 380 18: P ULSE UTPUT NSTRUCTIONS Frequency Change Curve The frequency change curve is a function that controls the acceleration/deceleration frequency. It can be used with the RAMP pulse output instruction. There are two settings: straight line and S-shaped curve. The straight line setting accelerates and decelerates at a constant rate when starting and stopping, and this absorbs starting and stopping shocks.
  • Page 381 18: P ULSE UTPUT NSTRUCTIONS Practical Examples Example of Single Axis Control Using the RAMP Instruction ■ Application Single axis electric slider ■ System configuration diagram Electric slider specification is treated as 0.01 mm per pulse in this example. To learn the actual travel distance of the electric slider that will be used, check the electric slider specifications (travel distance per pulse).
  • Page 382 18: P ULSE UTPUT NSTRUCTIONS Specify absolute position mode: enabled 30,000 Number of pulses 20,000 30,000 (30 cm) (0 cm) (20 cm) Specify absolute position mode: disabled -10,000 Number of pulses 30,000 20,000 (0 cm) (20 cm) (30 cm) Distances in parentheses have been calculated at 0.01 mm per pulse. ■...
  • Page 383 18: P ULSE UTPUT NSTRUCTIONS ■ Assigned addresses Device Unit Range Description Zero return button Input Start movement button Stop movement button M10-M13 M50-M53 RAMP instruction operation status M100-M103 Internal relay M150-M153 M1000 Zero return bit M1001 Start movement bit M1002 Stop movement bit Special internal relay...
  • Page 384 18: P ULSE UTPUT NSTRUCTIONS ■ Ladder diagram Move stop TIM T0000 I0002 Return to origin Absolute Moving Returning to Position origin Counter 1 High SOTU LC < > (D) D8240 I0000 M1001 M1000 Move start Absolute Returning to ABS1 Moving Position origin...
  • Page 385 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tabs Point A → Point C Point C → Point B Point B → Point A ■ Pulse monitor window Trajectory Waveform FC6A S MICROS FC9Y-B1726 18-89 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 386 18: P ULSE UTPUT NSTRUCTIONS Example of Simultaneous Dual Axis Control Using the RAMPL Instruction ■ Application Dual axis electric slider ■ System configuration diagram Electric slider specification is treated as 0.01 mm per pulse in this example. To learn the actual travel distance of the electric slider that will be used, check the electric slider specifications (travel distance per pulse). FC6A Series MICROSmart Output Motor driver...
  • Page 387 18: P ULSE UTPUT NSTRUCTIONS ■ Wiring diagram Input terminals DC sink input wiring DC source input wiring FC6A Series MICROSmart FC6A Series MICROSmart Zero return Zero return Start Start Stop Stop 24V DC 24V DC input input External power supply External power supply 24V DC 24V DC...
  • Page 388 18: P ULSE UTPUT NSTRUCTIONS ■ Ladder diagram Move stop TIM T0000 I0002 Return to origin Absolute Absolute Moving Returning to Position Position origin Counter 1 High Counter 2 High SOTU LC < > (D) LC < > (D) D8240 D8242 I0000 M1001...
  • Page 389 18: P ULSE UTPUT NSTRUCTIONS ■ Settings tabs Common settings Point A → Point B X axis Y axis Point B → Point C X axis Y axis Point C → Point A X axis Y axis FC6A S MICROS FC9Y-B1726 18-93 ERIES...
  • Page 390 18: P ULSE UTPUT NSTRUCTIONS ■ Pulse monitor window Trajectory Waveform 18-94 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 391: Pid (Pid Control)

    19: PID C ONTROL NSTRUCTION Introduction This chapter describes the PID control instructions that perform auto tuning and PID control for temperature control and other purposes. PID (PID Control) Executes PID control and outputs that result. When auto tuning is performed, the optimal PID parameters (proportional gain, integral time, and derivative time) and control action are automatically calculated.
  • Page 392 Use Device Check and modify parameters Use a dedicated monitor screen Monitor Monitor in WindLDR Trend graph display FC5A Series FT1A Touch IDEC instruction compatibility MICROSmart PID instruction PID instruction 19-2 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER...
  • Page 393: Pida (Pid Control)

    19: PID C ONTROL NSTRUCTION PIDA (PID Control) The PID instruction executes PID control and outputs the result. When auto tuning is performed, the optimal PID parameters are calculated. When auto/manual mode is switched, the balance-less and bumpless function automatically operates to prevent rapid changes in the output manipulated variable.
  • Page 394 19: PID C ONTROL NSTRUCTION Settings The PIDA (PID Control) dialog box contains the Devices tab, Input tab, Control tab, and Output tab. The Devices tab configures the devices used with the PIDA instruction. The Input, Control, and Output tabs configure the initial values of the parameters for the PIDA instruction.
  • Page 395 19: PID C ONTROL NSTRUCTION 5. Device Allocation Click this button to display the Device Allocation dialog box. The table containing the data registers and internal relays and corresponding PIDA instruction settings is displayed in the dialog box (6). Click Allocate Comments (7) to set the content in the table as the comments of the devices. Device Allocation dialog box FC6A S MICROS...
  • Page 396 19: PID C ONTROL NSTRUCTION ■Input tab This tab configures the input parameters for the PIDA instruction. 1. Process Variable (S1+0) Configure the input for the PID control. The process variable is linearly converted and given to the PID control for the input value.
  • Page 397 19: PID C ONTROL NSTRUCTION 6. Sampling Period (S1+5) Set the cycle to execute the PID control. PID control will only be executed at the end of the scan. When the sampling period is set lower than the scan time, PID control is not executed with the set sampling period, it will be executed with the same period as the scan time.
  • Page 398 19: PID C ONTROL NSTRUCTION 10. Alarm Type Select the type of alarm action from the following. Type Action Example No Alarm Action Do not output an alarm. Set point: 200.0°C 5.0°C Alarm value: 5.0°C Turns ON the alarm output when process variable ≥ 2.0°C Hysteresis: 2.0°C (set point + alarm value).
  • Page 399 19: PID C ONTROL NSTRUCTION Type Action Example Turns ON the alarm output when (set point - alarm Set point: 200.0°C 5.0°C 5.0°C value) ≤ process variable ≤ (set point + alarm value). Alarm value: 5.0°C Turns OFF the alarm output when process variable ≥ Hysteresis: 2.0°C 2.0°C 2.0°C...
  • Page 400 19: PID C ONTROL NSTRUCTION Type Action Example Turns ON the alarm output when process variable ≤ Set point: 200.0°C 5.0°C (set point + alarm value). Alarm value: -5.0°C Turns OFF the alarm output when process variable ≥ Hysteresis: 2.0°C 2.0°C (set point + alarm value + hysteresis).
  • Page 401 19: PID C ONTROL NSTRUCTION 11. Alarm Value Set the value that will be the trigger condition for Alarm Type (10). The value to set differs by the alarm type. The content for the alarm value is as follows. Alarm Type Alarm Value Range When the process variable is current/voltage...
  • Page 402 19: PID C ONTROL NSTRUCTION ■Control tab This tab configures the control parameters for the PIDA instruction. 1. Control Mode (S1+6) Select PID (PID Control), P (Proportional Control), PI (PI Control) or PD (PD Control) according to the characteristics of the target application. For details about each control, see "PID Control"...
  • Page 403 19: PID C ONTROL NSTRUCTION 4. Proportional Band (S1+8) The proportional action changes the output proportional to the deviation between the set point and process variable. If the process variable is in the range of the proportional band, the control output (S3+6) turns on or in proportional to the deviation.
  • Page 404 19: PID C ONTROL NSTRUCTION ■Output tab This tab configures the output parameters for the PIDA instruction. 1. Output Manipulated Variable (analog value) (S1+19) Set the output for the PID control. The value can be selected as Analog Output or Data Register. The manipulated variable calculated with the PIDA instruction according to the output manipulated variable limit (6) setting is stored.
  • Page 405 19: PID C ONTROL NSTRUCTION 4. Maximum Value, 5. Minimum Value When Analog Output is specified for Output Manipulated Variable This setting is disabled. When Data Register is specified for Output Manipulated Variable A value that is the PIDA instruction output manipulated variable having undergone linear conversion in the range of maximum value (4) and minimum value (5) is stored in the set data register.
  • Page 406 19: PID C ONTROL NSTRUCTION This function is suitable for the control of high-temperature heaters (elements composed of molybdenum, tungsten, platinum, used at approximately 1,500 to 1,800°C) that burn out when rapidly energized. 11. Proportional Band Offset (S1+20) Sets the offset for the proportional band. The output manipulated variable (S1+1) can be increased or decreased by the value set as the proportional band offset.
  • Page 407 19: PID C ONTROL NSTRUCTION Storage Function Setting Details Destination Set a value between 1 and 65,535 (0.1 to 6553.5 seconds). S1+9 Integral time When integral time is 0, integral time is disabled. Set a value between 1 and 65,535 (0.1 to 6553.5 seconds). S1+10 Derivative time When derivative time is 0, derivative time is disabled.
  • Page 408 19: PID C ONTROL NSTRUCTION Storage Function Setting Details Destination Set the Alarm 3 action type. 0: No Alarm Action 1: Upper Limit Alarm 2: Lower Limit Alarm 3: Upper/Lower Limit Alarm 4: Upper/Lower Limit Range Alarm S1+22 Alarm 3 action 5: Process High Alarm 6: Process Low Alarm 7: Upper Limit Alarm with Standby...
  • Page 409 19: PID C ONTROL NSTRUCTION Operation status (S1+2) Indicates the PIDA instruction execution status or error status. It stores the status code. • X in the table indicates the elapsed time from the start of AT until the set point is reached. X is incremented by 1 every 10 minutes. 9 is stored if the elapsed time is equal to or longer than 90 minutes.
  • Page 410 19: PID C ONTROL NSTRUCTION Status Code Status Description Status Classification The action point for Alarm 5 with the set alarm value exceeded the process variable PID control control execution continues minimum value or maximum value. The action point for Alarm 6 with the set alarm value exceeded the process variable PID control execution continues minimum value or maximum value.
  • Page 411 19: PID C ONTROL NSTRUCTION S3: Control Relay Device Function Setting Details 0 (OFF): Reverse control action S3+0 Control action 1 (ON): Direct control action 0 (OFF): Auto S3+1 Auto/manual mode 1 (ON): Manual Output manipulated variable 0 (OFF): Disabled S3+2 limit enable 1 (ON): Enabled (operates with S1+14, 15 settings)
  • Page 412 19: PID C ONTROL NSTRUCTION Control output (S3+5) When PIDA instruction is in auto mode, the control output turns on and off according to the manipulated variable calculated by the PIDA instruction and the control period (S1+21). When PIDA instruction is in manual mode, the control output turns on and off according to the manual mode output manipulated variable (S1+17) and the control period.
  • Page 413 19: PID C ONTROL NSTRUCTION PID Control PID control performs adjustment operations to cancel the deviation between a single set point and the process variable that is present in normal temperature control. The types of PID control that can be used with the FC6A Series MICROSmart are as follows. ■Proportional control Proportional control outputs the manipulated variable in the proportional band that is proportional to the deviation between the set point and the process variable.
  • Page 414 19: PID C ONTROL NSTRUCTION ■PID control PID controls overshooting and hunting in Proportional control, corrects the offset in I (integral) control, and makes rapid temperature changes due to disturbances converge on the set point in a short amount of time in D (derivative) control. Ideal temperature control can be performed by using PID control.
  • Page 415 19: PID C ONTROL NSTRUCTION Process variable (PV) ≥ set point (SP) + AT bias setting value When the AT bias setting is set to 20°C, fluctuations will start when the process variable (PV) reaches a temperature 20°C higher than the set point (SP). 1.
  • Page 416: Pidd (Pid With Derivative Decay)

    19: PID C ONTROL NSTRUCTION PIDD (PID with Derivative Decay) Executes PID control and outputs that result. The PID control parameters stored in the control registers are handled as data type F (float), and fine adjustments can be made to the control parameters such as proportional gain, integral gain, and derivative gain. Multiple PIDD instructions can also be combined to execute the cascade control.
  • Page 417 19: PID C ONTROL NSTRUCTION Settings The PIDD (PID with Derivative Decay) dialog box contains the Device tab, Controller tab, and Tuning tab. The devices used with the PIDD instruction are configured in the Device tab. The initial values of the PIDD instruction parameters are configured in Controller and Tuning tabs. ■Device tab 1.
  • Page 418 19: PID C ONTROL NSTRUCTION ■Controller tab This tab is used to configure the control parameters of the PIDD instruction. To store the initial settings of the PIDD instruction that are set on the Controller tab in the control registers and control relays, turn on the initialization input for the corresponding PIDD instruction after the user program is downloaded to the FC6A Series MICROSmart.
  • Page 419 19: PID C ONTROL NSTRUCTION Process Variable (PV) (S1+0, S1+1) is the value of the input value of the specified analog input converted to the full scale in the range of PV Lower Range Value (S1+22, S1+23) to PV Upper Range Value (S1+24, S1+25). PV Upper Range Value (S1+24, S1+25) Full Scale of Analog Input...
  • Page 420 19: PID C ONTROL NSTRUCTION When Cascade Control - RSP (S1+4, S1+5) is selected The PIDD instruction becomes Cascade Control Mode. Cascade Control Mode Select (S3+3) will be on, Manual Mode Select (S3+1) will be off, and Auto Mode Select (S3+2) will be off. Store the set point in Remote Set Point (RSP) (S1+4, S1+5) in the range of 0.0 and 100.0%.
  • Page 421 19: PID C ONTROL NSTRUCTION 9. Output Manipulated Variable (MV) (S1+16, S1+17) If the Analog Value check box is selected, select Analog Output or Data Register to output the analog value. If the Analog Value check box is cleared, the analog value is not output. If the Digital Value check box is selected, Control Output (S3+14) turns on and off.
  • Page 422 19: PID C ONTROL NSTRUCTION When Digital Value is specified • For auto mode, Control Output (S3+14) turns on and off from Output Manipulated Variable (MV) (S1+16, S1+17) and Control Period (S1+64, S1+65). The on pulse width for the control period varies according to the output manipulated variable. •...
  • Page 423 19: PID C ONTROL NSTRUCTION ■Tuning tab This tab is used to configure the tuning parameters of the PIDD instruction. To store the initial values of the PIDD instruction that are set on the Tuning tab in the control registers and control relays, turn on the initialization input for the corresponding PIDD instruction after the user program is downloaded to the FC6A Series MICROSmart.
  • Page 424 19: PID C ONTROL NSTRUCTION 4. Disable Kd (Derivative) (S3+9) Select the Disable Kd (Derivative) check box to disable the derivative action. Derivative Action (S3+9) will be on. Clear the Disable Kd (Derivative) check box to enable the derivative action. Derivative Action (S3+9) will be off. 5.
  • Page 425 19: PID C ONTROL NSTRUCTION Modifiable Allocation Function Setting Details during Execution When the PIDD instruction is in Manual Mode, set the output manipulated variable between 0.0 and 100.0%. If the value of Manual Output Manipulated Variable is less than 0.0%, Manual Output Manipulated S1+14, S1+15 the instruction operates with 0.0.
  • Page 426 19: PID C ONTROL NSTRUCTION Modifiable Allocation Function Setting Details during Execution Set MV Low Limit between 0.0 and 100.0 (0.0 and 100.0%). If the value of MV Low Limit is less than 0.0 or greater than 100.0, the instruction operates with 0.0. If MV High Limit ≤ MV Low Limit, the S1+30, S1+31 MV Low Limit instruction operates with MV Low Limit as 0.0 and MV High Limit as...
  • Page 427 19: PID C ONTROL NSTRUCTION Error Status (S1+34, S1+35) Indicates the PIDD error status. Status Error Check Error Code Status Description Countermeasure Classification with WindLDR The analog input specified for Analog PID control Check the analog I/O module settings. Input is not configured. execution stops PV Upper Range Value or PV Lower PID control...
  • Page 428 19: PID C ONTROL NSTRUCTION Modifiable Storage Function Setting Details during Destination Execution Changes to 1 (ON) while PIDD instruction is in Cascade Control S3+6 Cascade Control Mode Active Mode. — Changes to 0 (OFF) when the mode is not Cascade Control Mode. 0 (OFF): PV tracking disabled S3+7 PV Tracking...
  • Page 429: Pid Monitor

    19: PID C ONTROL NSTRUCTION PID Monitor Function Description While PID control is executing, you can graphically monitor the PIDA/PIDD instruction parameters. From the PID Monitor dialog box, you can also directly change the values of data registers and internal relays that are being used by the PIDA/PIDD instructions, and check the operation of the PIDA/PIDD instructions while adjusting the PID control parameters.
  • Page 430 19: PID C ONTROL NSTRUCTION PID Monitor Dialog Box 2. 3. 4. 5. 1. Target Select the PIDA/PIDD instruction to monitor. All PIDA/PIDD instructions in the ladder program opened in WindLDR are displayed. The PIDA/PIDD instructions can be identified by the program name and line number in the main program or subroutine where the instructions are used.
  • Page 431 19: PID C ONTROL NSTRUCTION 8. Send Command When a PIDA instruction is selected, you can send commands to the FC6A Series MICROSmart to execute/stop AT for PID control and to switch manual/auto mode. Click this button to display a popup menu and click the menu to send the command. When a PIDD instruction is selected, you can send the following commands to the FC6A Series MICROSmart: Change PID control mode (manual/auto/cascade), enable/disable PV tracking, proportional gain dependent/independent, enable/disable derivative control, and enable/disable derivative decay.
  • Page 432 19: PID C ONTROL NSTRUCTION 9. Status indicators You can check the primary statuses for PID control with the colored indicators. When a PIDA instruction is selected, the indicators in the following table are displayed. Indicator Name Background Color Status Gray PID control stopped Green...
  • Page 433 19: PID C ONTROL NSTRUCTION 11. PID monitor table You can check the function name, current value, and device address for data registers and internal relays used by the PIDA/ PIDD instruction. The current values displayed in white cells can be changed. Showing/hiding items can be changed in the PID Monitor Settings dialog box.
  • Page 434 19: PID C ONTROL NSTRUCTION PID Monitor Settings Dialog Box 1. Parameter Settings (Chart) You can show or hide the parameters displayed on the trend graph in the PID Monitor dialog box, and also specify the colors. Select the check box for each item to show it, or clear the check box to hide it. The color of the button on the right side of each item is the display color for that item.
  • Page 435: Application Example

    19: PID C ONTROL NSTRUCTION Application Example This section describes an application example using the PIDA instruction. Note: You must change the settings according to the application's actual system configuration and operating status. The following two system configurations are described for applications that set the set point for the control target temperature to 200°C and perform PID control.
  • Page 436 19: PID C ONTROL NSTRUCTION Ladder program Process variable PID control (after conversion) Initialize Pulse Control action Set point enable input PIDA D0000 M8120 M0000 D0007 I0000 Analog input Alarm lamp Alarm 1 output status error PIDA error M0003 M0020 M0021 Q0001 Heater output...
  • Page 437 19: PID C ONTROL NSTRUCTION PIDA (PIDA control) instruction dialog box configuration procedure Use the default value for settings that are not described in this procedure. The Devices tab configures the devices used with the PIDA instruction. • Set S1 (Control Register) to D0000 (1). •...
  • Page 438 19: PID C ONTROL NSTRUCTION Click the Control tab and configure the items. • For Control Mode, select PID (PID Control) (1). • For Control Action, select Reverse Control Action (2). • For Set Point (SP), set 200.0 (3). Click the Output tab and configure the items. •...
  • Page 439 19: PID C ONTROL NSTRUCTION Use the Module Configuration Editor to configure the analog input for the analog I/O cartridge. On the Configuration tab, in the PLCs group, select Expansion Modules. Select FC6A-PJ2CP in the expansion modules and cartridges list and drag and drop it to the module configuration area. Click the FC6A-PJ2CP analog I/O cartridge that was interested in the module configuration area and click Configure.
  • Page 440 19: PID C ONTROL NSTRUCTION PID control via analog output System configuration FC6A-PJ2CP FC6A-PK2AV OUT0 B’ COM0(+) V0( - ) Alarm Lamp Thyristor Unit Analog input wiring differs by the thyristor unit and operation mode that is used. – Thermocouple Adjust the AC line power Heater with phase control.
  • Page 441 19: PID C ONTROL NSTRUCTION Ladder program Analog Status to Analog input the Analog I/O Cartridge status error PID control enable input CMP>=(W) S1 - S2 - D1 - D8172 M0020 I0000 Analog Status to Analog output the Analog I/O Cartridge status error CMP>=(W) S1 - S2 -...
  • Page 442 19: PID C ONTROL NSTRUCTION Note: The analog status for the analog I/O cartridge is as follows. • Analog input status error 0: Operating normally 1: Converting data 2: Initializing 5, 6: Wiring error 8 to 11: Analog I/O cartridge error •...
  • Page 443 19: PID C ONTROL NSTRUCTION PID instruction dialog box configuration procedure Use the default value for settings that are not described in this procedure. The Devices tab configures the devices used with the PID instruction. • Set S1 (Control Register) to D0000 (1). •...
  • Page 444 19: PID C ONTROL NSTRUCTION Click the Control tab and configure the items. • For Control Mode, select PID (PID Control) (1). • For Control Action, select Reverse Control Action (2). • For Set Point (SP), set 200.0 (3). Click the Output tab and configure the items. •...
  • Page 445 19: PID C ONTROL NSTRUCTION Use the Module Configuration Editor to configure the analog input for the analog I/O cartridge. On the Configuration tab, in the PLCs group, select Expansion Modules. Select FC6A-PJ2CP in the expansion modules and cartridges list and drag and drop it to the module configuration area. Click the FC6A-PJ2CP analog I/O cartridge that was interested in the module configuration area and click Configure.
  • Page 446 19: PID C ONTROL NSTRUCTION Select FC6A-PK2AV in the expansion modules and cartridges list and drag and drop it to the module configuration area. Click the FC6A-PK2AV analog I/O cartridge that was interested in the module configuration area and click Configure. The Analog Parameters Configuration (Cartridge Slot 2) dialog box is displayed.
  • Page 447: Dtml (1-S Dual Timer)

    20: D EACHING IMER NSTRUCTIONS Introduction This chapter describes the dual/teaching timer instructions that cyclically turn outputs on and off in the specified time interval. Four dual timers are available and the ON/OFF duration can be selected from 1 ms up to 65,535 s. 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 448 20: D EACHING IMER NSTRUCTIONS Valid Devices Device Function Constant S1 (Source 1) ON duration — — — — — — — 0-65,535 S2 (Source 2) OFF duration — — — — — — — 0-65,535 D1 (Destination 1) Dual timer output —...
  • Page 449: 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 assigned by destination device D1. ***** When the input is off, D1 turns off. The measured time range is 0 through 6,553.5 s.
  • Page 450 20: D EACHING IMER NSTRUCTIONS 20-4 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 451: Rad (Degree To Radian)

    21: T RIGONOMETRIC UNCTION NSTRUCTIONS Introduction This chapter describes the trigonometric function instructions that are used to calculate sine, cosine, and tangent from an angle. RAD (Degree to Radian) π S1·S1+1° × /180 → D1·D1+1 rad RAD(F) When input is on, the degree value assigned by source device S1 is converted into a radian value ***** ***** and stored to the destination assigned by device D1.
  • Page 452: 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 assigned by source device S1 is converted into a degree value ***** ***** and stored to the destination assigned by device D1. Valid Devices Device Function...
  • Page 453: 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 assigned by source device S1 is stored to the ***** ***** destination assigned by device D1. Valid Devices Device Function Constant...
  • Page 454: 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 assigned by source device S1 is stored to the ***** ***** destination assigned by device D1. Valid Devices Device Function Constant...
  • Page 455: 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 assigned by source device S1 is stored to the ***** ***** destination assigned by device D1. Valid Devices Device Function Constant...
  • Page 456: 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 assigned by source device S1 is stored in radians to ***** ***** the destination assigned by device D1. The S1·S1+1 value must be within the following range: -1.0 ≤...
  • Page 457: 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 assigned by source device S1 is stored in radians to ***** ***** the destination assigned by device D1. The S1·S1+1 value must be within the following range: -1.0 ≤...
  • Page 458: 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 assigned by source device S1 is stored in radians ***** ***** to the destination assigned by device D1. Valid Devices Device Function...
  • Page 459: Loge (Natural Logarithm)

    22: L OGARITHM OWER NSTRUCTIONS Introduction This chapter describes logarithm function and power function instructions that are are used to calculate logarithms and powers for specified data. LOGE (Natural Logarithm) S1·S1+1 → D1·D1+1 LOGE(F) When input is on, the natural logarithm of the binary data assigned by source device S1 is stored ***** ***** to the destination assigned by device D1.
  • Page 460: 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 assigned by source device S1 is ***** ***** stored to the destination assigned by device D1. Valid Devices Device Function Constant...
  • Page 461: 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 assigned by source device S1 and is stored to ***** ***** the destination assigned by device D1. e (base of natural logarithm) = 2.7182818 Valid Devices Device Function...
  • Page 462: 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 assigned by source device S1 is raised to the power S2·S2+1 ***** ***** ***** assigned by source device S2 and the operation result is stored to the destination assigned by device D1.
  • Page 463: Fifof (Fifo Format)

    23: F ROCESSING NSTRUCTIONS Introduction This chapter describes the file data processing instructions that handle the FIFO (first-in first-out) 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 464 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 465: 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 assigned by S1 is stored to the FIEX(W) corresponding FIFO data file. ***** Valid Devices Device Function Constant Repeat N (File Number) File number —...
  • Page 466 23: F ROCESSING NSTRUCTIONS Example: FIFOF, FIEX, and FOEX This program demonstrates a user program of the FIFOX, FIEX, and FOEX instructions to use an FIFO data file. File number: Quantity of data registers per record: Quantity of records: FIFO Data file: D100 through D113 (3×4+2 data registers) FIFO status outputs: M100 through M102...
  • Page 467: Ndsrc (N Data Search)

    23: F ROCESSING NSTRUCTIONS NDSRC (N Data Search) When input is on, a value specified by device S1 is searched for. Data registers are searched, starting with the data register assigned by device S2. NDSRC(*) Device S3 specifies the quantity of 1-word or 2-word blocks of data registers ***** ***** *****...
  • Page 468 23: F ROCESSING NSTRUCTIONS Examples: NDSRC The following examples demonstrate the NDSRC instruction that searches the 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 469: Tadd (Time Addition)

    24: C LOCK NSTRUCTIONS Introduction TADD (time addition) and TSUB (time subtraction) instructions add or subtract time data in two different modes. The data can be selected from time (hour, minute, and second) or date/time (year, month, day, day of week, hour, minute, and second). HTOS (HMS to s) and STOH (s to HMS) instructions perform conversion of time data between hours, minutes, seconds and seconds.
  • Page 470 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 471 24: C LOCK NSTRUCTIONS Examples: TADD The following examples demonstrate the TADD instruction that will 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 472 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 473: Tsub (Time Subtraction)

    24: C LOCK NSTRUCTIONS TSUB (Time Subtraction) S1 – S2 → D1, CY TSUB When input is on, time data assigned by source device S2 is subtracted from date/ Mode ***** time data assigned by source device S1, depending on the selected mode. The result is stored to destination device D1 and borrow (M8003).
  • Page 474 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 is 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 475 24: C LOCK NSTRUCTIONS Examples: TSUB The following examples demonstrate the TSUB instruction to that will 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)
  • Page 476 24: C LOCK NSTRUCTIONS When the result is less than 00:00:00, 24 is added to the result, and the day data is decremented. Source 1 Destination 1 D8008 D200 (Year) (Year) D8009 D201 (Month) (Month) D8010 D202 (Day) (Day) (Note) D8011 D203 (D of W)
  • Page 477: 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 assigned by source device S1 is ***** ***** converted into seconds. The result is stored to destination device D1. Valid Devices Device Function...
  • Page 478: Stoh (S To Hms)

    24: C LOCK NSTRUCTIONS STOH (S to HMS) Seconds → Hours, minutes, seconds STOH When input is on, time data in seconds assigned by source device S1 is converted into hours, ***** ***** minutes, and seconds. The result is stored to destination device D1. Valid Devices Device Function...
  • Page 479: 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 assigned by destination device D1 and compared with the preset value assigned by source device S1.
  • Page 480 24: C LOCK NSTRUCTIONS Examples: HOUR The following examples demonstrate the HOUR instruction that will 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 481: Dlog (Data Log)

    25: D NSTRUCTIONS Introduction This chapter describes the data log instructions that save the log data of specified devices to the SD memory card. The Plus CPU module can switch between two save methods: basic mode and advanced mode. In basic mode, the file name is automatically determined.
  • Page 482 25: D NSTRUCTIONS Notes: • When the FC6A Series MICROSmart is stopped and then set to run, the header is added and output to the CSV file when the DLOG instruction is first executed after it starts running. Header output can be selected for the Plus CPU module. Output example Time D0010...
  • Page 483 25: D NSTRUCTIONS Settings Notes: • The Options tab is displayed only with the Plus CPU module. • Items 12. to 18. can be set only in advanced mode. • Items 19. to 26. can be set in basic and advanced modes. 1.
  • Page 484 25: D NSTRUCTIONS 3. D2 (destination 2): Execution Status D2 specifies the first data register of the data registers to use in DLOG instruction. Starting from the specified data register, 2 continuous words of data registers are used. Specify the first data register so that the range of data registers is not exceeded.
  • Page 485 25: D NSTRUCTIONS File size ratio The data register stores the value calculated from the file size. The decimal part is rounded up. The file sizes set for the CSV file and external memory device are used. For how to set the file size for the external memory device, see Chapter 5 "Functions and Settings" in the "FC6A Series MICROSmart User's Manual".
  • Page 486 25: D NSTRUCTIONS Configuration Example 1 When the String is ABC,DEF, the Separating Character is Comma (,), and the number of repeats is 7 • Hexadecimal Stored Value Device Upper Byte Lower Byte ASCII Hexadecimal ASCII Hexadecimal D1000 0x41 0x42 D1001 0x43 Comma (,)
  • Page 487 The values are read in order starting from the set data register, and the data up to the NULL terminating character (0x00) or up to 80 characters is handled as base file name. Example: When D0100 is specified for the device address, the fixed value is "IDEC". Stored Value...
  • Page 488 25: D NSTRUCTIONS 14. Add Device value to File Name Select whether or not to add device values to the file name. Select this check box and a data register can be specified. Clear this check box and nothing can be specified. Specify the data registers containing the values to read and add to the file name.
  • Page 489 25: D NSTRUCTIONS 18. Store file path of csv file Select this check box to store the path of the CSV file. Specify the first data register of the data registers used for storage. The CSV data can be displayed in Web Page Editor by setting this data register in a trend bar or other component in Web Page Editor.
  • Page 490 25: D NSTRUCTIONS 21. Label of data column Specify the label of the data column of the CSV file header. Select from Device address, Tag name, or Comment. • Device address Time D 1000 D 1001 D 1002 D 1003 D 1004 D 1005 D 1006...
  • Page 491 25: D NSTRUCTIONS 25. First character of date and time Specify whether to use a space for the first character in the execution date and time format in the CSV file. Select from Add a space or Do not add a space. •...
  • Page 492 Stored Value Device Upper Byte Lower Byte Specify Base file name by Value of Device address: D0100 D0100 Device Address The text to set is "IDEC" D0101 D0102 NULL NULL Add Device value to File Name Device address: D0200 D0200: 123456...
  • Page 493 25: 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 in the "RESULT" folder on the SD memory card every 10 seconds. Output example Time D0000...
  • Page 494 25: D NSTRUCTIONS Configure the Settings tab. (3) Enter "RESULT" in S1 (Folder Name). (4) Configure D0000 to output the decimal value of D0000 to the CSV files with the data type W (word). (5) Set the repeat to 6 to output the values of D0000 through D0005 to the CSV files. (6) Configure D0010 to output the decimal value of D0010 to the CSV files with the data type F (float).
  • Page 495: Trace (Data Trace)

    25: 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 496 25: D NSTRUCTIONS Notes: • The TRACE instruction accumulates data while FC6A Series MICROSmart is running but does not accumulate data when FC6A Series MICROSmart is stopped. • Data is accumulated while FC6A Series MICROSmart is running even when the input to the TRACE instruction is off. •...
  • Page 497 25: D NSTRUCTIONS 2. D1 (destination 1): Completion Output Specifies the device that turns on when the transfer of trace data to SD card and the execution of the TRACE instruction are complete. This device turns on regardless of the success or failure of the transfer of trace data to the SD memory card. 3.
  • Page 498 25: D NSTRUCTIONS 5. Tag Name Enter tag names or device addresses to specify the devices to the CSV files. 6. Device Address When the devices are specified as tag names, the corresponding device addresses are shown. 7. Display Type Select the display type from the following table for each device for when the device values are output to the CSV file.
  • Page 499 25: D NSTRUCTIONS CSV File Output Format and File Format Configuration • Output format The CSV file output format is as follows. Triggered at:,2015/12/30 15:40:30 Scan,D0010,D0020,D0030,D0040,D0050,D0060,D0070,D0080 Old,1,9,17,25,33,41,49,57 ,2,10,18,26,34,42,50,58 ,3,11,19,27,35,43,51,59 ,4,12,20,28,36,44,52,60 ,5,13,21,29,37,45,53,61 ,6,14,22,30,38,46,54,62 ,7,15,23,31,39,47,55,63 New,8,16,24,32,40,48,56,64 ・ ・ ・ When the TRACE instruction is executed and the CSV file for the same date does not exist in the folder designated by S1, a new CSV file is created and the trace data is output as shown in above output format example.
  • Page 500 25: D NSTRUCTIONS • Configuration Procedure 1. Create the ladder program. TRACE SOTU RESULT M100 D100 CMP<>(W) S1 - S2 - D1 - SOTU D100 M100 2. Configure the TRACE instruction. Configure the Devices tab. (1) Designate M0100 as D1 (Completion Output). (2) Designate D0100 as D2 (Execution Status).
  • Page 501 25: 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 17 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 502 25: D NSTRUCTIONS 25-22 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 503: Scrpt (Script)

    26: S CRIPT Introduction This chapter describes the SCRPT instruction that calls and executes scripts from the ladder program. SCRPT (Script) Executes the specified script. Symbol SCRPT ***** ***** Operation When the input turns on, the script that corresponds to the script ID specified by S1 is executed. When the script is finished executing, the execution status and the execution time are stored in D1 and D1+1.
  • Page 504 26: S CRIPT Execution results The execution results (D1, D1+1) store the execution status and the execution time. Execution status Numeric Value Status Error Cause Normal termination — Arithmetic error Division by zero, floating point format error Script ID error The specified script does not exist Device access error Invalid device specified, device boundary exceeded...
  • Page 505: Script Function Overview

    26: S CRIPT Script Function Overview A script is a function for programming complicated processing with conditional branch, logical operations, arithmetic operations, and functions as text. The programmed scripts can be executed in a ladder program. For example, the logical AND operation is written as follows. Ladder diagram Script ←...
  • Page 506 26: S CRIPT Device List This section shows the devices that can be used in Script Editor and the device notation. This section describes available devices and its notation that can be used in the Script Editor dialog box. Note: The device ranges differ depending on each FC6A Series MICROSmart. Specify the devices within the device range of the selected FC6A Series MICROSmart.
  • Page 507: Script Programming And Management

    26: S CRIPT Script Programming and Management Script Registration Procedure This section describes the procedure to create and register a script. The registered script can be executed by specifying the script ID in the SCRPT instruction. On the Project Window, double-click Script Manager. Script Manager dialog box opens.
  • Page 508 26: S CRIPT Enter Script Name. The script name can be entered up to 40 single-byte alphanumeric characters. However, the following single-byte characters cannot be used: / \:*?"<>| Select Data Type. The script is executed with the selected data type. Note: In Script, write the program.
  • Page 509 26: S CRIPT Script Manager In the Script Manager dialog box, you can add scripts created in the Script Editor dialog box or delete registered scripts. 1. List of scripts Shows the list of registered scripts. Script ID: Shows the script ID of the registered scripts (1 to 255). Error: Shows OK if the registered script has no errors.
  • Page 510 26: S CRIPT Script Editor Script Editor is where you create new scripts and edit the scripts selected in Script Manager. (Description) 1. Script ID When creating a new script, enter the script ID (1 to 255). When editing an existing script, this shows the script ID that was set. 2.
  • Page 511 26: S CRIPT 7. Export Click this button to display the Save As dialog box so you can export the script program. If you select the location to save the script, enter a file name, and click Save, the current script is saved as a text file (*.txt). The saved script can be inserted with Import.
  • Page 512 26: S CRIPT 13. Function List Category: Shows the function category list. Function: Shows the list of functions in the selected category. Format: Shows a programming example of the selected function. Description: Shows a description of the selected function. Insert Format: Click this button to insert the content displayed in Format at the cursor position.
  • Page 513 26: S CRIPT Script Formatting Options Dialog Box This dialog box allows you to specify Font, Size, Tab indent, and Color used in the Script Editor Script text box. ■Font Enter or select the font name for text displayed in Script. ■Size Enter or select the size (pixels) of text displayed in Script.
  • Page 514: Programming Scripts

    26: S CRIPT Programming Scripts Format List This section describes the notation for control statements, operators, functions, data type designations, and other elements, and it also describes their operation. Except for comments, enter everything as single-byte characters. For specific programming examples, see "Script Programming Examples"...
  • Page 515 26: S CRIPT ■Halt and exit Format Description while ( if ( Process will be as follows while the conditional expression 1 is satisfied. Execution line 2 is continuously executed while the conditional expression 2 is not satisfied. break break; Once the conditional expression 2 is satisfied, the execution goes out of the loop by break (not executing execution line 2), and execution line 3 is executed.
  • Page 516 26: S CRIPT ■Bit operator Operator Format Description Calculates the logical product (AND) of each bit of Data types W (word), I (integer), D (double word), and L (long) can be used. F (float) & & cannot be used. Calculates the logical sum (OR) of each bit of Data types W (word), I (integer), D (double word), and L (long) can be used.
  • Page 517 26: S CRIPT Function Format Description Square root of is returned. Square root ROOT( • This can only be used for data type F (float). Sine of (-1 to +1) is returned. Sine Specify arbitrary formula to represent angle (units in radian) for argument SIN( •...
  • Page 518 26: S CRIPT Data comparison and copy Function Format Description : First device of comparison target 1 : First device of comparison target 2 : Range of comparison (in words) Values of device words and values of device for words Data compared.
  • Page 519 26: S CRIPT Character string operations When handling strings, the NULL terminating character (0x00) is the end of the string. The NULL terminating character is not included in the length of the string. Function Format Description : First device of copy source : First device that stores the source character string to copy : Copy start position (0 to 127) STRCUT(...
  • Page 520 26: S CRIPT Other This section describes definitions for constant, device, temporary device, and comment. ■Constant Constant can be defined as decimal or hexadecimal number. Sample definition of decimal numbers Define the numeric value directly. 1234 Define the negative number with a "-" (minus) symbol at the beginning. -1234 12.34 Decimal number can be defined for real numbers (float).
  • Page 521: Script Programming Examples

    26: S CRIPT Script Programming Examples This section describes script programming examples for control statements, arithmetic operators, and functions, as well as their operations. 1. Control Statements Example 1.1 Conditional branch Script if ([D0100]) [D0102] = 100; Operation Description If the value of D0100 is not 0, then 100 is stored in D0102. Example 1.2 Conditional branch Script...
  • Page 522 26: S CRIPT Example 1.5 Conditional branch Script if ([D0100] == 0) [D0102] = 0x1234; else if ([D0100] == 1) [D0102] = 0x5678; else [D0102] = 0x9999; Operation Description If the value of D0100 is 0, then 0x1234 is stored in D0102. If the value of D0100 is 1, then 0x5678 is stored in D0102.
  • Page 523 26: S CRIPT Example 1.8 Iteration Script [D0100] = 0; [D0102] = 3; [D0103] = 5; while ([D0100] == 0) [D0102] = [D0102] + 1; if ([D0103] == [D0102]) SET([M0000]); break; Operation Description While the value of D0100 is 0, the while statement is repeated. Inside the while statement, if the values of D0102 and D0103 are equal, the while statement will terminate, and after [M0000] changes to 1, execution breaks out of the while statement.
  • Page 524 26: S CRIPT Example 1.10 Decimal to octal conversion using a while statement Script // Convert a decimal value to octal // - For example, convert 10 (dec) to 12 (oct), 16 (dec) to 20 (oct) // - Convert a value to octal up to 4 digits max @1 = 0;...
  • Page 525 26: S CRIPT Example 1.12 Conditional branch with switch using the default statement Script switch ([D0100]) case 0: [D0102] = 0x1234; break; case 1: [D0102] = 0x5678; break; default: [D0102] = 0x9999; break; Operation Description If the value of D0100 is 0, then 0x1234 is stored in D0102. If the value of D0100 is 1, then 0x5678 is stored in D0102.
  • Page 526 26: S CRIPT 2. Relational Operators Example 2.1 Equal to Script if ([D0100] == [D0102]) [D0103] = 0x100; Operation Description If the value of D0100 is equal to the value of D0102, then 0x100 is stored in D0103. Example 2.2 Not equal to Script if ([D0100] != [D0102])
  • Page 527 26: S CRIPT 3. Logical Operators Example 3.1 Logical AND Script if (([D0100] == [D0200]) && ([D0300] == [D0400] + [D0500])) [D0600] = 100; Operation Description If the value of D0100 is equal to the value of D0200, and if the value of D0300 is equal to the value of D0400 and D0500 added together, then 100 is stored in D0600.
  • Page 528 26: S CRIPT 4. Arithmetic Operators Example 4.1 Addition Script [D0300] = [D0100] + [D0200]; Operation Description The values of D0100 and D0200 are added together and the result is stored in D0300. Example 4.2 Subtraction Script [D0300] = [D0100] - [D0200]; Operation Description The value of D0200 is subtracted from the value of D0100 and the result is stored in D0300.
  • Page 529 26: S CRIPT 5. Bitwise Operators Example 5.1 Logical AND Script if ([D0000.01] & [D0001.01]) SET([D0002.01)]); else RST([D0002.01]); Operation Description If the bitwise logical AND operation on the value of D0000.01 and the value of D0001.01 is 1, D0002.01 is changed to 1. If the bitwise logical AND operation on the value of D0000.01 and the value of D0001.01 is 0, D0002.01 is changed to 0.
  • Page 530 26: S CRIPT Example 5.5 Inversion Script if (([D0000.01] & ~[D0001.01]) | [D0002.01]) SET([D0003.01]); else RST([D0003.01]); Operation Description If the bitwise logical OR operation on the value of D0002.01 and the result of the bitwise logical AND operation on the value of D0000.01 and the inverted result of the value of D0001.01 is 1, then D0003.01 is changed to 1.
  • Page 531 26: S CRIPT 6. Bit Functions Example 6.1 Set a bit Script SET([D0000.01]); Operation Description Turns D0000.01 to 1. The result is the same as [D0000.01] = 1 Example 6.2 Reset a bit Script RST([D0000.01]); Operation Description Turns D0000.01 to 0. The result is the same as [D0000.01] = 0 Example 6.3 Invert a bit...
  • Page 532 26: S CRIPT Example 7.4 Natural logarithm Script [D0010] = LOGE([D0020]); Operation Description Calculates the natural logarithm of the value of D0020 and the result is stored in D0010. Only the data type F (float) can be used. Example 7.5 Common logarithm Script [D0010] = LOG10([D0020]);...
  • Page 533 26: S CRIPT Example 7.10 Tangent Script [D0010] = TAN([D0020]); Operation Description Calculates the tangent of the radian value of D0020 and stores the result in D0010. Only the data type F (float) can be used. Example 7.11 Arcsine Script [D0010] = ASIN([D0020]);...
  • Page 534 26: S CRIPT Data type conversions Example 7.16 Convert BCD to binary Script [D0200] = BCD2BIN([D0100]); Operation Description Converts the BCD value in D0100 to a binary value and stores it in D0200. For example, if the BCD value 10 (16 as a binary value) is stored in D0100, 10 (binary value) is stored in D0200. Example 7.17 Convert binary to BCD Script [D0200] = BIN2BCD([D0100]);...
  • Page 535 26: S CRIPT Converting -12345 (when the data type is I (integer)) Stored Value Device Device Stored Value Upper Byte Lower Byte D0200 -12345 D0100 '-' = 0x2D '1' = 0x31 D0101 '2' = 0x32 '3' = 0x33 D0102 '4' = 0x34 '5' = 0x35 D0103 0x00...
  • Page 536 26: S CRIPT Setting the string "1234" (when the data type is W (word)) Stored Value Device Upper Byte Lower Byte Device Stored Value D0200 '1' = 0x31 '2' = 0x32 D0100 1234 D0201 '3' = 0x33 '4' = 0x34 D0202 0x00 0x00...
  • Page 537 26: S CRIPT Data comparison and copying Example 7.22 Word-unit data comparison Script [D0000] = MEMCMP([D0100], [D0200], 10); Operation Description Compares the values of 10 words from D0100 (up to D0109) with the values of 10 words from D0200 (up to D0209). If the value for each is entirely equal, 1 is stored in D0000.
  • Page 538 26: S CRIPT Example 7.25 Bit-unit data copy Script MEMCPY([D0200.00], [D0100.02], 10); Operation Description Copies the third bit of 10 words from D0100 (up to D0109) to the bit state for 10 bits of devices from D0200 (up to D0209). Copy each 1st bit of D0200 3rd bit of D0100...
  • Page 539 26: S CRIPT String Operations Strings are set as continuous data registers of 1 word or more. 2 bytes of data are 1 word and they are set from upper byte to lower byte in order. Set 00h at the end of the string. Example 7.29 Copy a string Script STRCUT([D0100], [D0200], 2, 3);...
  • Page 540 26: S CRIPT Example 7.30 Count a string Script [D0100] = STRLEN([D0200]); Operation Description Finds the length (character count) of the string starting from D0200 and stores the result in D0100. Note: The NULL terminating character (0x00) is the end of the string. (The terminating character is not included in the string length.) Device Stored Value Device...
  • Page 541 26: S CRIPT Example 7.32 Search a string Script [D0000] = STRSTR([D0100], [D0200]); Operation Description Searches for the search string "DEFG" that starts from D0200 in the string to be searched "ABCDEFGHIJKLMNO" that starts from D0100 and stores the position of the occurrence of the string in D0000. If not found, -1 is stored in D0000. If "?"...
  • Page 542 26: S CRIPT When searching for "?" as any single-byte character Search string String to be searched Search result Device Stored Value Device Stored Value Device Stored Value Position 'E' = 0x45 'A' = 0x41 Upper Byte Upper Byte D0200 D0100 D0000 '?' = 0x3F...
  • Page 543 26: S CRIPT Indirect assignment Example 7.33 Indirect read Script [D0200] = OFFSET([D0010],[D0020]); Operation Description When the value of D0020 is 8, the value of D0018, the device 8 words from D0010, is read and stored in D0200. D0010 0000 D0020 0008 D0200...
  • Page 544: Important Notes

    26: S CRIPT Important Notes This section describes important notes when programming scripts. Important Notes Regarding While Definition ■Define so the execution does not go into an infinite loop. The execution expression is repeatedly executed while the conditional expression is satisfied. However, it will go into an infinite loop when the conditional expression is satisfied continually.
  • Page 545: About The Priority Of The Operator

    26: S CRIPT About the Priority of the Operator Operators are processed in the order from the left in each line. When multiple operations are combined, the operators are processed in the following priorities. Priority Operator High ! ~ - (Negative number) * / % + - (Subtraction) <<...
  • Page 546 26: S CRIPT 26-44 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 547: Scale (Convert Analog Input)

    27: F ALCULATION NSTRUCTIONS This chapter describes the flow calculation instructions that output flow volume and the accumulated flow volume. SCALE (Convert Analog Input) This instruction scales the analog input value according to the coordinates between two specified points and outputs that result. Symbol SCALE(*) S1 *****...
  • Page 548 27: F ALCULATION NSTRUCTIONS Dead Band Function The dead band function filters minute changes in the value input to the SCALE instruction. The SCALE instruction always retains the following two values. Output value: The result of scaling the input value with each scan Output value (dead band): The result of filtering the input value with the dead band The fluctuation range to perform filtering is set as the dead band.
  • Page 549 27: F ALCULATION NSTRUCTIONS Example 1: When the dead band is enabled When the dead band (S2+6, S2+7) is 100 and initial value of the output value (dead band) (D1+2, D1+3) is 0, the operation in regard to the output value (D1+0, D1+1) is as follows. Output Value (dead Absolute Value of the Difference Output Value (dead band)
  • Page 550 27: F ALCULATION NSTRUCTIONS Example 2: When the dead band is disabled When the dead band (S2+6, S2+7) is 0 and initial value of the output value (dead band) (D1+2, D1+3) is 0, the output value (D1+0, D1+1) is stored in the output value (dead band) (D1+2, D1+3) with each scan. Output Value (dead band) Cycle Output Value (D1+0, D1+1)
  • Page 551 27: F ALCULATION NSTRUCTIONS Settings The SCALE (Scale Analog Value) dialog box contains the Devices tab and the Settings tab. The Devices tab configures the devices used with the SCALE instruction. The Settings tab configures the initial values of the SCALE instruction parameters.
  • Page 552 27: F ALCULATION NSTRUCTIONS (4) D1 (Destination 1): Output Register Specify the data register that will store the output value, the output value (dead band), and the amount of output change. 6 continuous words are used starting from the specified data register. Storage Function Setting...
  • Page 553 27: F ALCULATION NSTRUCTIONS ■ Settings tab (1) Data Type Select the data type of the input value (S1) as "W (word)" or "I (integer)". (2) Initial Value Configure the initial values of the functions that will be stored in the control registers when the initialization input is on. For the range of initial values, see "S2: Control registers"...
  • Page 554 27: F ALCULATION NSTRUCTIONS Operation Example To convert an analog input value from 0 to 4,095 to 0 to 65,535 Create the following ladder program. SCALE(*) S1 D0000 D0050 M8120 D0150 M0050 M0000 (1) Specify D0000, where the analog input value is stored, for S1. (2) Initialize the settings with the initialize pulse, and when M0000 turns on, the calculation is performed with the SCALE instruction.
  • Page 555: Flwa (Analog Flow Totalizer)

    27: F ALCULATION NSTRUCTIONS FLWA (Analog Flow Totalizer) This instruction samples the instantaneous flow (volume per unit of time) and stores the accumulated flow volume (the volume of a material that has passed through for an arbitrary period) to a log. Symbol FLWA S1 *****...
  • Page 556 27: F ALCULATION NSTRUCTIONS Log Output Function Overview When the input is on, if the log execution input (S3) is turned on, the logged data (D2) is updated regardless of the enable totalizer input (S2) on/off status. The maximum amount of logged data is 35 items. When the enable totalizer input is off, totalization is paused.
  • Page 557 27: F ALCULATION NSTRUCTIONS Function Descriptions ■ Totalizer Function Starting Totalization This section describes the operation from turning on the input to starting totalization. Input Enable totalizer input (S2) Flow rate (S1+0, S1+1) Sampling period Accumulated flow volume work area (D1+4, D1+5) Accumulated time work area (D1+6, D1+7)
  • Page 558 27: F ALCULATION NSTRUCTIONS Ending Totalization To end totalization by turning off the input This section describes the end operation for totalization when ending totalization by turning off the input. Input Enable totalizer input (S2) Flow rate (S1+0, S1+1) Sampling period Accumulated flow volume work area (D1+4, D1+5)
  • Page 559 27: F ALCULATION NSTRUCTIONS ■ Log Output Function Log output When the input is on This section describes the log output operation when the input is on. Input Enable totalizer input (S2) Log execution input (S3) Sampling period Flow rate (S1+0, S1+1) Accumulated flow volume work area (D1+4, D1+5)
  • Page 560 27: F ALCULATION NSTRUCTIONS Settings The FLWA (Analog Flow Totalizer) dialog box contains the Devices tab and the Settings tab. ■ Devices tab Settings Description Tag name Specifies the tag name or the device address for the device. Device address Shows the device address that corresponds to the tag name.
  • Page 561 27: F ALCULATION NSTRUCTIONS (5) D2 (Destination 2): Logged Data Specify the device to store the data that is logged. A maximum of 212 continuous words are used starting from the set device. Note: The number of data registers that are used for logged data changes according to the maximum amount of logged data. The number of data registers used for logged data is 2+6×the maximum amount of logged data.
  • Page 562 27: F ALCULATION NSTRUCTIONS ■ Settings tab (1) Flow Rate Unit Select the time unit for flow rate that will be stored in the flow rate (S1+0, S1+1) from the following. "Second", "Minute", "Hour", "Days" (2) Sampling Period Specifies the time interval to sample the flow rate in 0.1 s increments. The range is 0.1 to 6,553.5.
  • Page 563 27: F ALCULATION NSTRUCTIONS Operation Example Configuration Example Devices tag Item Description Comments S1 (flow rate) D0010 The value of the analog input value converted to the flow rate. S2 (enable totalizer input) M0050 S3 (log execution input) M0100 WEEK instruction output. Set to turn on for one scan every day at 00:00. D1 (status) D0150 D2 (logged data)
  • Page 564: Flwp (Pulse Flow Totalizer)

    27: F ALCULATION NSTRUCTIONS FLWP (Pulse Flow Totalizer) This instruction monitors a counter that measures the number of pulses and calculates the flow rate at a fixed cycle. It also stores the accumulated flow volume (the amount that flowed for an arbitrary period) to a log. Symbol FLWP(*) *****...
  • Page 565 27: F ALCULATION NSTRUCTIONS Totalizer Function Overview When the input is on, if the enable totalizer input (S2) is turned on, totalization starts. When the enable totalizer input is on, the amount that the flow counter (S1+0, S1+1) increased is added to the accumulated flow volume work area with each scan.
  • Page 566 27: F ALCULATION NSTRUCTIONS Function Descriptions ■ Flow Rate Function Starting the Flow Rate Calculation This section describes the operation from turning on the input to starting the flow rate calculation. Input Enable totalizer input (S2) Flow counter (S1+0, S1+1) Flow rate Flow rate Flow rate...
  • Page 567 27: F ALCULATION NSTRUCTIONS Pausing the Flow Rate Calculation This section describes the operation from turning on the input to pausing the flow rate calculation. Input Enable totalizer input (S2) Flow counter (S1+0, S1+1) Flow rate Flow rate Flow rate update cycle update cycle update cycle...
  • Page 568 27: F ALCULATION NSTRUCTIONS ■ Totalizer Function Starting and Pausing Totalization This section describes the operation from turning on the input to starting and pausing totalization. Input Enable totalizer input (S2) Flow counter (S1+0, S1+1) Accumulated flow volume work area (system work area) Accumulated time work area (system work area)
  • Page 569 27: F ALCULATION NSTRUCTIONS ■ Log Output Function Log output When the input is on This section describes the log output operation when the input is on. Input Enable totalizer input (S2) Log execution input (S3) Flow counter (S1+0, S1+1) Accumulated flow volume work area (system work area) Accumulated time work area...
  • Page 570 27: F ALCULATION NSTRUCTIONS Settings The FLWP (Pulse Flow Totalizer) dialog box contains the Devices tab and the Settings tab. ■ Devices tab Settings Description Tag name Specifies the tag name or the device address for the device. Device address Shows the device address that corresponds to the tag name.
  • Page 571 27: F ALCULATION NSTRUCTIONS (4) D1 (Destination 1): Status Stores the status including the flow rate and the error during FLWP instruction execution. 16 continuous words are used starting from the set device. Storage Function Description Destination D1+0 Stores the flow rate calculated every second. The flow rate unit F (float) Flow rate D1+1...
  • Page 572 27: F ALCULATION NSTRUCTIONS ■ Settings tab (1) Data Type Select the flow counter data type as "Word (W)" or "Double (D)". The initial value is "Double (D)". Word (W): S1+0 is handled as the flow counter. Double (D): S1+0 and S1+1 are handled as the flow counter. (2) Counter Type Select the operation type for the flow counter that samples the pulses as "Free Run"...
  • Page 573 27: F ALCULATION NSTRUCTIONS Operation Example Configuration Example Devices tag Item Description Comments S1 (Flow Counter) D8120 G1 high-speed counter measurement value. S2 (Enable Totalizer Input) M0050 S3 (Log Execution Input) M0100 WEEK instruction output. Set to turn on for one scan every day at 00:00. D1 (Status) D0150 D2 (Logged Data)
  • Page 574 27: F ALCULATION NSTRUCTIONS 27-28 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 575: Umacro (User-Defined Macro)

    28: U DEFINED ACRO NSTRUCTION This chapter describes the instruction that executes registered user-defined macros. A user-defined macro is a ladder program that has been registered with an arbitrary number and name, and that can be used multiple times within the main program. For creating user-defined macros, see "User-defined macro registration procedure" on page 28-6.
  • Page 576 28: U DEFINED ACRO NSTRUCTION Local Devices Local devices are the devices that can be used within the user-defined macro instruction only. By using local devices, you do not have to change the devices used in the user-defined macro when you re-use the user-defined macro in other projects. Item Definition Symbol...
  • Page 577 28: U DEFINED ACRO NSTRUCTION Operation Example The following ladder program will execute the UMACRO instruction when main program input I0000 is turned on. When the UMACRO instruction is executed, user-defined macro name 0 will be executed. A0001 will operate as I0001 in the user-defined macro because A1 of the UMACRO instruction has been set to I0001. Therefore, the MOV instruction will be executed when I0001 is turned on.
  • Page 578 28: U DEFINED ACRO NSTRUCTION Argument settings dialog box Select a user-defined macro or edit the user-defined macro with the selected number. (1) User-defined Macro List Select a user-defined macro. Enter the name of the user-defined macro. (2) New Creates a new user-defined macro number. (3) Delete Deletes a registered user-defined macro.
  • Page 579 28: U DEFINED ACRO NSTRUCTION (9) Disable a password protection. The argument settings cannot be changed when protection is enabled. To change the argument settings, click this button and enter the password to disable protection. FC6A S MICROS FC9Y-B1726 28-5 ERIES MART ADDER...
  • Page 580 28: U DEFINED ACRO NSTRUCTION User-defined macro registration procedure This section describes the procedure to create and register a user-defined macro. A registered user-defined macro can be set and executed with the UMACRO instruction. Right-click User-defined Macro in the Project window and click New. The Argument settings dialog box will be displayed.
  • Page 581 28: U DEFINED ACRO NSTRUCTION Create a ladder program in the Editor for the created user-defined macro in the same manner as the main program and subroutines. The content of the argument devices (A1 to A100) configured in the Argument settings dialog box can be checked in the User-defined Macro Arguments Allocation List window and used in the ladder program as required.
  • Page 582 28: U DEFINED ACRO NSTRUCTION When the simulation and monitor are executed, the UMACRO instruction ID is displayed on the UMACRO instruction. UMACRO instruction IDs are assigned to identify the UMACRO instructions that have been set. Select and right-click a UMACRO instruction, and then click Show User-defined Macro on the right-click menu. The user-defined macro opens that has the number set for the UMACRO instruction.
  • Page 583 28: U DEFINED ACRO NSTRUCTION FC6A S MICROS FC9Y-B1726 28-9 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 584 28: U DEFINED ACRO NSTRUCTION 28-10 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 585: Ppendix

    PPENDIX Execution Times for Instructions Execution times for basic and advanced instructions of the FC6A Series MICROSmart are listed below. Repeat is not assigned for any device. Execution Time (μs) All-in-One CPU Module/ Instruction Device and Condition CAN J1939 All-in-One CPU Plus CPU Module Module ―...
  • Page 586 PPENDIX Execution Time (μs) All-in-One CPU Module/ Instruction Device and Condition CAN J1939 All-in-One CPU Plus CPU Module Module IMOV, IMOVN (D) D+D→D+D 18.8 IMOV (F) ― 13.9 7.00 MOVC ― ― ― BMOV D→D 16.1 + 1.2n 8.1 + 0.6n M+D→M+D 13.4 IBMV, IBMVN...
  • Page 587 PPENDIX Execution Time (μs) All-in-One CPU Module/ Instruction Device and Condition CAN J1939 All-in-One CPU Plus CPU Module Module RNDM D, D→D 6.84 3.42 M · M→D 6.08 3.04 ANDW, ORW, XORW (W) D · D→D ANDW, ORW, XORW (D) D ·...
  • Page 588 PPENDIX Execution Time (μs) All-in-One CPU Module/ Instruction Device and Condition CAN J1939 All-in-One CPU Plus CPU Module Module ― ― ― ARAMP ― ― ― ― ― ― ― ― ― ― ― ― PIDA ― ― ― PIDD ―...
  • Page 589: Breakdown Of End Processing Time

    PPENDIX Processing in One Scan While the FC6A Series MICROSmart is running, the FC6A Series MICROSmart performs operations repeatedly such as input refreshing, ladder program processing, and error checking. scan is the execution of all instructions from address zero to the END instruction. The time required for this execution is referred scan time to as one .
  • Page 590: Differences Between User-Defined Macros And Subroutines

    PPENDIX Differences between User-defined Macros and Subroutines User-defined macros and subroutines are both functions that group the processing used multiple times into a single unit, and then execute that processing with a call instruction, but they have the following differences. Item User-defined Macro Subroutine...
  • Page 591 PPENDIX ■Subroutine Main program LCAL I0000 LCAL I0001 Call LABEL Subroutine (Label number S1: 1) LRET FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 592: Instruction Size (Bytes

    PPENDIX Instruction Size (Bytes) The byte quantities for basic and advanced instructions are listed below. Used Data Size (Bytes) All-in-One CPU Module/ Plus CPU Module Basic CAN J1939 All-in-One CPU Module Instruction When Using Bits When Using Bits When Using Bit When Using Bit Specified in Data Specified in Data...
  • Page 593 PPENDIX Used Data Size (Bytes) Advanced Instruction All-in-One CPU Module/ Plus CPU Module CAN J1939 All-in-One CPU Module MOV (W, I) 16-20 16-28 MOVN (W, I) 16-20 16-28 MOV (D, L) 16-20 16-28 MOVN (D, L) 16-20 16-28 MOV (F) 16-20 16-28 IMOV, IMOVN (W)
  • Page 594 PPENDIX Used Data Size (Bytes) Advanced Instruction All-in-One CPU Module/ Plus CPU Module CAN J1939 All-in-One CPU Module ANDW, ORW, XORW (D) 16-28 16-28 SFTL, SFTR 16-24 16-40 BCDLS 12-16 12-24 WSFT 16-20 16-32 ROTL, ROTR (W) 12-16 12-20 HTOB (W) 12-20 12-24 BTOH (W)
  • Page 595 PPENDIX Used Data Size (Bytes) Advanced Instruction All-in-One CPU Module/ Plus CPU Module CAN J1939 All-in-One CPU Module PIDD 272-276 272-288 DTML, DTIM, DTMH 16-24 16-36 DTMS 16-24 16-36 TTIM 12-16 12-20 12-24 12-20 12-24 12-20 12-24 12-20 12-24 12-20 12-24 ASIN 12-20...
  • Page 596: User Program Execution Error

    PPENDIX User Program Execution Error This error indicates that invalid data is found during execution of a user program. When this error occurs, the ERR LED and special internal relay M8004 (user program execution error) are turned on. The detailed information of this error can be viewed from the error code stored in special data register D8006 (user program execution error code).
  • Page 597 PPENDIX User Program Execution Error Code Error Details (D8006) DLOG/TRACE is executed but the capacity of CSV file exceeds the maximum size of a day or the number of files exceeds the maximum number of a day. SD memory card is write protected. The result of execution using the SCRPT instruction is a value that indicates anything other than normal completion.
  • Page 598 PPENDIX A-14 FC6A S MICROS FC9Y-B1726 ERIES MART ADDER ROGRAMMING ANUAL...
  • Page 599 NDEX FIFOF 23-1 100-ms FOEX 23-3 dual timer 20-1 FRQRF 14-4 10-ms HOUR 24-11 dual timer 20-1 HSCRF 14-3 1-ms dual timer 20-1 HTOA 10-5 HTOB 10-1 dual timer 20-1 IBMV 5-12 32-bit Data Storage 3-9 IBMVN 5-14 About the Priority of the Operator 26-43 ICMP>= 6-6 ACOS 21-7 IMOV 5-6...
  • Page 600 NDEX XYFS 16-1 Carry/Borrow 2-9 Advanced instructions CC= and CC>= instructions 4-20 ARAMP 18-46 change DLOG 25-1 timer preset and current values 4-9 PULS 18-1 changing PWM 18-8 preset values for timers and counters 4-19 RAMP 18-15 Character string operations 26-17 WEEK 11-3 clear button 4-19 YEAR 11-16...
  • Page 601 NDEX CSV File 25-11, 25-19 program 1-10 current value DTCB 10-22 change DTDV 10-21 timer 4-9 DTIM 20-1 CVDT 10-19 DTMH 20-1 CVXTY 16-2 DTMS 20-1 CVYTX 16-3 dual/teaching timer instructions 20-1 dual-pulse reversible counter CDP 4-13 data combine 10-22 edit user program 1-4 comparison instructions 6-1 EI 15-1...
  • Page 602 NDEX IMOVN 5-8 logarithm/power instructions 22-1 INC 7-13 LOGE 22-1 increment 7-13 Logical operator 26-13, 26-25 indirect LRET 13-3 bit move 5-12 master bit move not 5-14 control instruction 4-29 move 5-6 MCS and MCR instructions 4-29 move not 5-8 Message (MSG) 12-1 Indirect Addressing 3-12 monitor...
  • Page 603 NDEX values SFTL 9-1 change timer 4-9 SFTR 9-3 changing 4-19 shift restoring 4-19 left 9-1 program branching register instructions 13-1 instructions 4-24 using with SOTU/SOTD instructions 13-2 right 9-3 using with timer instruction 13-2 shift/rotate instructions 9-1 programming simulate operation 1-9 DI or EI using WindLDR 15-2 SIN 21-3 Programming Scripts 26-12...
  • Page 604 NDEX trigonometric function instructions 21-1 TSUB 24-5 TTIM 20-3 UMACRO 28-1 counter CNT 4-12 up/down selection reversible counter CUD 4-14 User Program Execution Errors 3-10 User-defined Macro 28-1 Week Table (WKTBL) 11-1 Week Timer (WKTIM) 11-1 WindLDR programming DI or EI 15-2 quit 1-12 start 1-1, 1-3 Windows Displayed in the Workspace 1-13...

Table of Contents