PLC Die Micro Pman
PLC Die Micro Pman
FC6A SERIES
Warning Warning notices are used to emphasize that improper operation may cause severe personal injury or death.
• The FC6A Series MicroSmart is not designed for use in applications requiring a high degree of reliability and safety. The FC6A Series MicroSmart
should not be used for such applications.
• When using the FC6A Series MicroSmart in applications (not described above) that require a high degree of reliability in terms of functionality
and precision, appropriate measures such as failsafe mechanisms and redundant mechanisms must be taken for the system containing the
FC6A Series MicroSmart. The following are specific examples.
• Emergency stop and interlocking circuits must be configured outside the FC6A Series MicroSmart.
• If relays or transistors in the FC6A Series MicroSmart output circuits should fail, outputs may remain at on or off state. For output signals
which may cause serious accidents, configure monitor circuits outside the FC6A Series MicroSmart.
• The FC6A Series MicroSmart self-diagnostic function may detect internal circuit or program errors, stop programs, and turn outputs off.
Configure circuits so that the system containing the FC6A Series MicroSmart is not jeopardized when outputs turn off.
• Turn off power to the FC6A Series MicroSmart before installation, removal, wiring, maintenance, and inspection of the FC6A Series MicroSmart.
Failure to turn power off may cause electrical shocks or fire hazard.
• Special expertise is required to install, wire, program, and operate the FC6A Series MicroSmart. People without such expertise must not use the
FC6A Series MicroSmart.
• Install the FC6A Series MicroSmart according to the instructions described in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
Improper installation will result in falling, failure, or malfunction of the FC6A Series MicroSmart.
Caution Caution notices are used where inattention might cause personal injury or damage to equipment.
• The FC6A Series MicroSmart is designed for installation in a cabinet. Do not install the FC6A Series MicroSmart outside a cabinet.
• Install the FC6A Series MicroSmart in environments described in the "FC6A Series MicroSmart All-in-One Type User’s Manual". If the FC6A Series
MicroSmart is used in places where the FC6A Series MicroSmart is subjected to high-temperature, high-humidity, condensation, corrosive gases,
excessive vibrations, or excessive shocks, then electrical shocks, fire hazard, or malfunction will result.
• The environment for using the FC6A Series MicroSmart is "Pollution degree 2." Use the FC6A Series MicroSmart in environments of pollution
degree 2 (according to IEC 60664-1).
• Prevent the FC6A Series MicroSmart from falling while moving or transporting the FC6A Series MicroSmart, otherwise damage or malfunction of
the FC6A Series MicroSmart will result.
• Wiring must use lead sizes that are appropriate for the applied voltage and current. Terminal screws must be tightened with the prescribed
tightening torque.
• Prevent metal fragments and pieces of wire from dropping inside the FC6A Series MicroSmart housing. Put a cover on the FC6A Series
MicroSmart modules during installation and wiring. Ingress of such fragments and chips may cause fire hazard, damage, or malfunction.
• Use a power supply of the rated value. Use of a wrong power supply may cause fire hazard.
• Use an IEC 60127-approved fuse on the power line outside the FC6A Series MicroSmart. This is required when equipment containing the FC6A
Series MicroSmart is destined for Europe.
• Use an IEC 60127-approved fuse on the output circuit. This is required when equipment containing the FC6A Series MicroSmart is destined for
Europe.
• Use an EU-approved circuit breaker. This is required when equipment containing the FC6A Series MicroSmart is destined for Europe.
• Make sure of safety before starting and stopping the FC6A Series MicroSmart or when operating the FC6A Series MicroSmart to force outputs on
or off. Incorrect operation of the FC6A Series MicroSmart may cause machine damage or accidents.
• Do not connect the ground wire directly to the FC6A Series MicroSmart. Connect a protective ground to the cabinet containing the FC6A Series
MicroSmart using an M4 or larger screw. This is required when equipment containing the FC6A Series MicroSmart is destined for Europe.
• Do not disassemble, repair, or modify the FC6A Series MicroSmart modules.
• The FC6A Series MicroSmart contains electronic parts and batteries. When disposing of the FC6A Series
MicroSmart, do so in accordance with national and local regulations.
Publication history
December 2015: First Edition
December 2016: Second Edition
March 2017: Third Edition
Trademarks
FC6A Series MicroSmart is a trademark of IDEC Corporation.
IMPORTANT INFORMATION
Under no circumstances shall IDEC Corporation be held liable or responsible for indirect or consequential damages resulting from
the use of or the application of IDEC PLC components, individually or in combination with other equipment.
All persons using these components must be willing to accept responsibility for choosing the correct component to suit their
application and for choosing an application appropriate for the component, individually or in combination with other equipment.
All diagrams and examples in this manual are for illustrative purposes only. In no way does including these diagrams and
examples in this manual constitute a guarantee as to their suitability for any specific application. To test and approve all
programs, prior to installation, is the responsibility of the end user.
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 Type
FC6A-C40R1AE, FC6A-C40R1CE, FC6A-C40K1CE, FC6A-C40P1CE,
FC6A-C40R1DE, FC6A-C40R1DE, FC6A-C40K1DE, FC6A-C40P1DE
FC6A-C40R1AEJ, FC6A-C40R1CEJ, FC6A-C40K1CEJ, FC6A-C40P1CEJ,
CAN J1939 All-in-One Type
FC6A-C40R1DEJ, FC6A-C40K1DEJ, FC6A-C40P1DEJ
The general term for the model with 16 I/O points
16-I/O type
(FC6A-C16R1AE, FC6A-C16R1CE, FC6A-C16K1CE, FC6A-C16P1CE)
The general term for the model with 24 I/O points
24-I/O type
(FC6A-C24R1AE, FC6A-C24R1CE, FC6A-C24K1CE, FC6A-C24P1CE)
The general term for the model with 40 I/O points
(FC6A-C40R1AE, FC6A-C40R1CE, FC6A-C40K1CE, FC6A-C40P1CE,
40-I/O type FC6A-C40R1DE, FC6A-C40R1DE, FC6A-C40K1DE, FC6A-C40P1DE,
FC6A-C40R1AEJ, FC6A-C40R1CEJ, FC6A-C40K1CEJ, FC6A-C40P1CEJ,
CPU module
FC6A-C40R1DEJ, FC6A-C40K1DEJ, FC6A-C40P1DEJ)
AC power type FC6A-C16R1AE, FC6A-C24R1AE, FC6A-C40R1AE, FC6A-C40R1AEJ
FC6A-C16R1CE, FC6A-C24R1CE, FC6A-C40R1CE, FC6A-C16K1CE,
24V DC power type FC6A-C24K1CE, FC6A-C40K1CE, FC6A-C16P1CE, FC6A-C24P1CE,
DC power type FC6A-C40P1CE, FC6A-C40R1CEJ, FC6A-C40K1CEJ, FC6A-C40P1CEJ
FC6A-C40R1DE, FC6A-C40K1DE, FC6A-C40P1DE, FC6A-C40R1DEJ,
12V DC power type
FC6A-C40K1DEJ, FC6A-C40P1DEJ
FC6A-C16R1AE, FC6A-C16R1CE, FC6A-C24R1AE, FC6A-C24R1CE,
Relay output type FC6A-C40R1AE, FC6A-C40R1CE, FC6A-C40R1DE, FC6A-C40R1AEJ,
FC6A-C40R1CEJ, FC6A-C40R1DEJ
Transistor sink output FC6A-C16K1CE, FC6A-C24K1CE, FC6A-C40K1CE, FC6A-C40K1DE,
type FC6A-C40K1CEJ, FC6A-C40K1DEJ
Transistor output type
Transistor protection FC6A-C16P1CE, FC6A-C24P1CE, FC6A-C40P1CE, FC6A-C40P1DE,
source output type FC6A-C40P1CEJ, FC6A-C40P1DEJ
Expansion module Expansion I/O module, functional module
Expansion I/O module Input module, output module, mixed I/O module
Functional module Analog module, PID module
Analog input module, analog output module,
Analog module
mixed analog I/O module
HMI module, expansion interface module,
Option module
analog cartridge, communication cartridge
Cartridge Analog cartridge, communication cartridge
WindLDR WindLDR application software
USB maintenance cable (HG9Z-XCM42),
USB cable
USB Mini-B extension cable (HG9Z-XCE21)
CHAPTER 2: Devices
Device Addresses ........................................................................................................................................ 2-1
Special Internal Relay .................................................................................................................................. 2-3
Special Data Register................................................................................................................................. 2-13
APPENDIX
Execution Times for Instructions .................................................................................................................. A-1
Breakdown of END Processing Time ............................................................................................................. A-5
Differences between User-defined Macros and Subroutines ............................................................................ A-5
Instruction Bytes......................................................................................................................................... A-6
User Program Execution Error ...................................................................................................................... A-9
INDEX
Start WindLDR
■ Windows 8
Click WindLDR in the tiles on the Start screen.
■ Windows XP
From the Start menu of Windows, select Programs > Automation Organizer V2 > WindLDR > WindLDR.
WindLDR starts and a blank ladder editing screen appears with menus and tool bars shown on top of the screen.
PLC Selection
Before programming a user program on WindLDR, select a PLC type.
1. Select Configuration from the WindLDR menu bar, then select PLC Type.
The PLC Selection dialog box appears.
2. Select a PLC type in the selection box and the programming language to use.
3. Click OK.
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.
Note: One collection of a group of instructions that control output or advanced instructions is called a rung. WindLDR manages programs in rung
units. Function descriptions can be configured as rung comments for individual rungs.
Start WindLDR
From the Start menu of Windows, select Programs > Automation Organizer V2 > WindLDR > WindLDR.
WindLDR starts and a blank ladder editing screen appears with menus and tool bars shown on top of the screen.
1. From the WindLDR menu bar, select Home > Basic > A (Normally Open).
2. 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.
Note:
• 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).
• To enter an NO contact from the keyboard, press (A) to display the Coil Selection dialog box. Select A (Normally Open), and then
press (Enter).
A NO contact of input I0 is programmed in the first column of the first ladder line.
Next, program the ANDN instruction by inserting a NC contact of input I1.
5. From the WindLDR menu bar, select Home > Basic > B (Normally Closed).
6. Move the mouse pointer to the second column of the first ladder line where you want to insert a NC contact, and click the left
mouse button.
An NC contact of input I1 is programmed in the second column of the first ladder line.
At the end of the first ladder line, program the OUT instruction by inserting a NO coil of output Q0.
9. From the WindLDR menu bar, select Home > Basic > OUT (Output).
10. Move the mouse pointer to the third column of the first ladder line where you want to insert an output coil, and click the left
mouse button.
Note: Another method to insert an instruction (either basic or advanced) is to type the instruction symbol, OUT, where you want to insert the
instruction.
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.
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. Then, make corrections as necessary.
Info Window
Save Project
This section describes the operating procedure to save the created ladder program as a project file.
2. Enter the file name in File name, specify the folder to save to, and click Save.
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.
To quit simulation, from the WindLDR menu bar, select Online > Simulation.
Notes:
• You can also change the status of an input contact by double-clicking it.
• To quit simulation, from the WindLDR menu bar, once more select Online > Simulation > Simulation.
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.
Windows Computer
USB Cable
USB Port HG9Z-XCM42 USB Maintenance Cable
USB Port
(USB 2.0 Mini-B Connector)
Notes:
• In order for WindLDR to communicate with the FC6A Series MicroSmart via USB, a dedicated USB driver must be installed on the computer.
See Appendix "USB Driver Installation Procedure" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
• A user program is a combination of a ladder program and the setting details (Function Area Settings).
1. From the WindLDR menu bar, select Online > Set Up.
The Communication Settings dialog box is displayed.
The communication method is now set to USB. Next, download a user program.
3. 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.
When the following message appears, the download has completed successfully. Click OK.
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,
output Q0 is turned off.
Rung 2:
When both inputs I0 and I1 are on,
output Q1 is turned off.
Rung 3:
When both input I0 and I1 are on,
internal relay M10 is turned on.
M8121 is the 1-s clock special
internal relay.
While M10 is on, output Q2 flashes
in 1-s increments.
Exit WindLDR
This section describes the operating procedure to exit WindLDR.
When you have completed monitoring, you can exit WindLDR either directly from the monitor screen or from the editing screen. In
both cases, from the WindLDR application button, click Exit WindLDR.
You can check the WindLDR version. When finished, click OK.
Note: When using the FC6A Series MicroSmart, use version 8.0.0 or later of WindLDR.
If you are using a version of WindLDR that does not meet this condition, click Check for Updates on the Resources tab to obtain the latest
version of WindLDR.
Input Circuit
1: OFF
2: ON
Input Refresh
Repeat operations
One sequence of operations is set as one Processing other than the ladder
scan, and the time required is set as the processing is called the END
scan time. processing.
Output Circuit
Q1: OFF 1: OFF
Q2: ON 2: ON
Output Refresh
Notes:
• The delay time of the hardware is added to the actual input and output delay times.
For details on the hardware input/output delay times, see Chapter 2 "Product Specifications" in the "FC6A Series MicroSmart All-in-One Type
User’s Manual".
• The filter time differs depending on the input used.
• When the input is a CPU module input (I0 to I27)
See the input filter time configured in the WindLDR Function Area Settings. The initial value is 3 ms.
• When the input is an expansion input (I30 or greater)
There is no filter time.
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
the stop/reset input function by way of external input.
• For operations using WindLDR, see "Start/Stop Operation Using WindLDR" on page 1-15.
• For operations using the FC6A Series MicroSmart power supply, see "Start/Stop Operation Using the Power Supply" on page
1-16.
• For operations using the function switch, see Chapter 5 "Function Switch Configuration" in the "FC6A Series MicroSmart All-in-
One Type User’s Manual".
• For operations using an HMI module, see Chapter 7 "HMI Function" in the "FC6A Series MicroSmart All-in-One Type User’s
Manual".
• For the stop input settings, see Chapter 5 "Stop Input" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
• For the reset input settings, see Chapter 5 "Reset Input" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
The switch from start to stop is performed during the END processing of the user program, and the following functions are also
stopped when the user program is stopped. For details on END processing, see the "Breakdown of END Processing Time" on page
A-5.
High-speed counter/frequency measurement/user interrupt/catch input/timer interrupt/user communication/pulse output
• You can use M8025 (Maintain Outputs While Stopped) to select whether to maintain or clear the outputs while the CPU is
stopped.
For details on M8025 (Maintain Outputs While Stopped), see "M8025: Maintain Outputs While Stopped" on page 2-8.
• The current value of the timer instruction is reset.
For details on timer instructions, see "TML (1-s Timer)" on page 4-7".
Also, when you switch from stop to start, the device status is cleared or kept depending on Memory Backup in the Function
Area Settings. For details, see Chapter 5 "Memory Backup" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
1. Connect the computer to the FC6A Series MicroSmart, start WindLDR, and power up the FC6A Series MicroSmart.
2. Check that a stop input is not designated using Configuration > Run/Stop Control > Stop and Reset Inputs. See
Chapter 5 "Stop Input and Reset Input" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
Note: When a stop input is designated, the FC6A Series MicroSmart cannot be started or stopped by turning start control special internal relay
M8000 on or off.
4. Click the Start button to start operation, then the start control special internal relay M8000 is turned on.
5. 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.
Note: Special internal relay M8000 is a keep type internal relay and stores the status when power is turned off. M8000 retains its previous status
when power is turned on again. However, when the backup battery is dead, M8000 loses the stored status, and can be turned on or off as
programmed when the FC6A Series MicroSmart is powered up. The selection is made in Configuration > Run/Stop Control > Run/Stop
Selection at Memory Backup Error. See Chapter 5 "Run/Stop Selection at Keep Data Error" in the "FC6A Series MicroSmart All-in-One Type
User’s Manual".
The backup duration is approximately 30 days (typical) at 25°C after the backup battery is fully charged.
Start/Stop Operation Using the Power Supply
The FC6A Series MicroSmart can be started and stopped by turning power on and off.
Device Addresses
Range (Points)
Device Symbol Unit
16-I/O Type 24-I/O Type 40-I/O Type
*1 I0 - I10 I0 - I15 I0 - I27
Inputs I Bit
(9 points) (14 points) (24 points)
I30 - I187 I30 - I307
*1 (128 points) (224 points)
Expansion Input Relays I Bit
I190 - I507*2 I310 - I627*3
(256 points) (256 points)
Q0 - Q6 Q0 - Q11 Q0 - Q17
Output*1 Q Bit
(7 points) (10 points) (16 points)
Q30 - Q187 Q30 - Q307
*1*3 (128 points) (224 points)
Expansion Outputs Q Bit
Q190 - Q507*2 Q310 - Q627*3
(256 points) (256 points)
M0 - M7997
*1 (6,400 points)
Internal Relay M Bit
M10000 - M17497
(6,000 points)
M8000 - M8317
Special Internal Relay*1 M Bit
(256 points)
R0 - R255
Shift Register R Bit
(256 points)
T0 - T1023
Timer T Bit/Word
(1,024 points)
C0 - C511
Counter C Bit/Word
(512 points)
D0000 - D7999
(8,000 points)
Data Register D Bit/Word
D10000 to D55999
(46,000 points)
D8000 - D8499
Special Data Register D Bit/Word
(500 points)
*1 The least significant digit of the device address is an octal number (0 to 7).
*2 I190 to I507 and Q190 to Q507 are devices that can only be used when an expansion module (expansion interface side) is connected using the
expansion interface module.
*3 I310 to I627 and Q310 to Q627 are devices that can only be used when an expansion module (expansion interface side) is connected using the
expansion interface module.
■ Timer (T)
Timers used internally in the FC6A Series MicroSmart. There are three devices: Timer bits (symbol: T, unit: bit), timer preset
values (symbol: TP, unit: word), and timer current values (symbol: TC, unit: word).
These can be used as an on-delay timer or an off-delay timer. For details on timers (T), see "Using Timer or Counter as Source
Device" on page 3-6.
■ Counters (C)
Counters used internally in the FC6A Series MicroSmart. There are three devices: Counter bits (symbol: C, unit: bit), counter
preset values (symbol: CP, unit: word), and counter current values (symbol: CC, unit: word). These can be used as an adding
counter or a reversible counter. For details on counters (C), see "Using Timer or Counter as Source Device" on page 3-6.
• Although the device symbol for the data registers (D0000 to D7999, D10000 to D55999) and special data registers (D8000 to D8499) is the
same ("D"), the device characteristics are different. Special functions are assigned to each special data register.
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.
■ M8003: Carry/Borrow
When a carry (Cy) or borrow (Bw) results from executing an addition or subtraction instruction, M8003 is turned on. For details,
see "Carry and Borrow" on page 3-10".
■ M8007: Initialization Flag (When Data Link Master)/Stop Communication Flag (When Data Link Slave)
When data link master: When this flag is turned on in the run status, the data link is initialized just once to check the connection
status. Use this when the slave configured in the data link is powered at a timing slower than the
master.
When data link slave : This flag is turned on when communication from the master is interrupted for 10 s or longer. This flag is
turned off when communication can be normally received.
■ M8027 to M8032, M8034 to M8036, M8040 to M8046, M8051 to M8055, M8057 to M8063, M8130, M8131,
M8133 to M8136, M8161 to M8167: Special Internal Relays for High-speed Counter
Special internal relays used for the high-speed counter. For details, see Chapter 5 "High-Speed Counter" in the "FC6A Series
MicroSmart All-in-One Type User’s Manual".
M8027 to M8032, M8130, M8131, M8161, M8162 = High-speed counter (group 1/I0)
M8034 to M8036, M8133, M8165 = High-speed counter (group 3/I3)
M8040 to M8042, M8134, M8166 = High-speed counter (group 4/I4)
M8043 to M8046, M8135, M8136, M8163, M8164 = High-speed counter (group 5/I6)
M8051 to M8055 = High-speed counter (group 2/I1)
M8057 to M8063 = High-speed counter (group 6/I7)
M8120
Start
100 ms
10 ms
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.
Device
Description Update Timing R/W
Address
D8000 Quantity of Inputs When I/O initialized R
D8001 Quantity of Outputs When I/O initialized R
D8002 CPU Module Type Information Power-up R
D8003
— Reserved — ― -
D8004
D8005 General Error Code When error occurred R/W
D8006 User Program Execution Error Code When error occurred R
D8007 — Reserved — ― -
D8008 Year Every 500 ms R
D8009 Month Every 500 ms R
D8010 Day Every 500 ms R
Calendar/Clock Current Data
D8011 Day of the Week Every 500 ms R
(Read only)
D8012 Hour Every 500 ms R
D8013 Minute Every 500 ms R
D8014 Second Every 500 ms R
D8015 Year ― W
D8016 Month ― W
D8017 Day ― W
Calendar/Clock New Data
D8018 Day of the Week ― W
(Write only)
D8019 Hour ― W
D8020 Minute ― W
D8021 Second ― W
D8022 Constant Scan Time Preset Value (1 to 1,000 ms) ― W
D8023 Scan Time Current Value (ms) Every scan R
Scan Time Data
D8024 Scan Time Maximum Value (ms) At occurrence R
D8025 Scan Time Minimum Value (ms) At occurrence R
D8026 Communication Mode Information (Port 1 to Port 3) Every scan R
D8027
— Reserved — ― -
D8028
D8029 System Software Version Power-up R
D8030 Communication Adapter Information Power-up R
D8031 Optional Cartridge Connection Information Power-up R
D8032 Interrupt Input Jump Destination Label No. (I1) ― R/W
D8033 Interrupt Input Jump Destination Label No. (I3) ― R/W
D8034 Interrupt Input Jump Destination Label No. (I4) ― R/W
D8035 Interrupt Input Jump Destination Label No. (I6) ― R/W
D8036 Timer Interrupt Jump Destination Label No. ― R/W
D8037 Number of Connected I/O Modules When I/O initialized R
D8038 to
— Reserved — ― ―
D8051
D8052 J1939 Communication Error Code Every scan R/W
D8053 to
— Reserved — ― ―
D8055
D8056 Battery Voltage ― R
Device
Description Update Timing R/W
Address
D8057 Analog Volume (AI0) Every scan R
D8058 Built-in Analog Input (AI1) Every scan R
D8059 Analog Input Status AI0 Every scan R
D8060 Analog Input Status AI1 Every scan R
D8061 to
— Reserved — ― ―
D8066
D8067 Backlight ON Time ― R/W
D8068 — Reserved — ― ―
Slave 1 Communication Status/Error (When Data Link Master Mode)
D8069 When error occurred R
Slave Communication Status/Error (When Data Link Slave Mode)
D8070 Slave 2 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8071 Slave 3 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8072 Slave 4 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8073 Slave 5 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8074 Slave 6 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8075 Slave 7 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8076 Slave 8 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8077 Slave 9 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8078 Slave 10 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8079 Slave 11 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8080 Slave 12 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8081 Slave 13 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8082 Slave 14 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8083 Slave 15 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8084 Slave 16 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8085 Slave 17 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8086 Slave 18 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8087 Slave 19 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8088 Slave 20 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8089 Slave 21 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8090 Slave 22 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8091 Slave 23 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8092 Slave 24 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8093 Slave 25 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8094 Slave 26 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8095 Slave 27 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8096 Slave 28 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8097 Slave 29 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8098 Slave 30 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8099 Slave 31 Communication Status/Error (When Data Link Master Mode) When error occurred R
D8100 Slave Number (Port 1) ― R/W
D8101 — Reserved — ― ―
D8102 Slave Number (Port 2) ― R/W
D8103 Slave Number (Port 3) ― R/W
D8104 Control Signal Status (Port 1 to 3) Every scan R
When sending/
D8105 RS232C DSR Input Control Signal Option (Port 1 to 3) R
receiving data
When sending/
D8106 RS232C DTR Output Control Signal Option (Port 1 to 3) R
receiving data
D8107 to
— Reserved — ― ―
D8119
D8120 Type ID/Status ― R
HMI Module Information
D8121 System Software Version ― R
D8122 Type ID/Status ― R
Cartridge Slot 1 Information
D8123 System Software Version ― R
Device
Description Update Timing R/W
Address
D8124 Type ID/Status ― R
Cartridge Slot 2 Information
D8125 System Software Version ― R
D8126 Type ID/Status ― R
Cartridge Slot 3 Information
D8127 System Software Version ― R
D8128 to
— Reserved — ― ―
D8169
D8170 Analog Cartridge I/O AI2/AQ2 Every scan R
D8171 Analog Cartridge I/O AI3/AQ3 Every scan R
D8172 Analog Cartridge Status AI2/AQ2 Every scan R
D8173 Analog Cartridge Status AI3/AQ3 Every scan R
D8174 Analog Cartridge I/O AI4/AQ4 Every scan R
D8175 Analog Cartridge I/O AI5/AQ5 Every scan R
D8176 Analog Cartridge Status AI4/AQ4 Every scan R
D8177 Analog Cartridge Status AI5/AQ5 Every scan R
D8178 Analog Cartridge I/O AI6/AQ6 Every scan R
D8179 Analog Cartridge I/O AI7/AQ7 Every scan R
D8180 Analog Cartridge Status AI6/AQ6 Every scan R
D8181 Analog Cartridge Status AI7/AQ7 Every scan R
D8182 to
— Reserved — ― ―
D8191
D8192 High Word Current Value/Frequency Measurement (I1) Current Every scan R
D8193 Low Word Value Every scan R
High-speed
D8194 High Word ― R/W
Counter Preset Value
D8195 Low Word ― R/W
(Group 2/I1)
D8196 High Word ― R/W
Preset Value
D8197 Low Word ― R/W
D8198 High Word Current Value/Frequency Measurement (I7) Current Every scan R
D8199 Low Word Value Every scan R
High-speed
D8200 High Word ― R/W
Counter Preset Value
D8201 Low Word ― R/W
(Group 6/I7)
D8202 High Word ― R/W
Preset Value
D8203 Low Word ― R/W
D8204 to
— Reserved — ― ―
D8209
D8210 High Word Current Value/Frequency Measurement (I0) Current Every scan R
High-speed
D8211 Low Word Value Every scan R
Counter
D8212 High Word ― R/W
(Group 1/I0) Preset Value
D8213 Low Word ― R/W
D8214 Interrupt Input Jump Destination Label No. (I7) ― R/W
D8215 Interrupt Input Jump Destination Label No. (I0) ― R/W
D8216 High-speed High Word ― R/W
Counter Preset Value
D8217 (Group 1/I0) Low Word ― R/W
D8218 High Word Current Value/Frequency Measurement (I3) Current Every scan R
High-speed
D8219 Low Word Value Every scan R
Counter
D8220 High Word ― R/W
(Group 3/I3) Preset Value
D8221 Low Word ― R/W
D8222 High Word Current Value/Frequency Measurement (I4) Current Every scan R
High-speed
D8223 Low Word Value Every scan R
Counter
D8224 High Word ― R/W
(Group 4/I4) Preset Value
D8225 Low Word ― R/W
D8226 High Word Current Value/Frequency Measurement (I6) Current Every scan R
High-speed
D8227 Low Word Value Every scan R
Counter
D8228 High Word ― R/W
(Group 5/I6) Preset Value
D8229 Low Word ― R/W
Device
Description Update Timing R/W
Address
D8230
— Reserved — ― ―
D8231
D8232 High-speed High Word ― R/W
Counter Preset Value
D8233 (Group 5/I6) Low Word ― R/W
Device
Description Update Timing R/W
Address
D8304 ― W
D8305 ― W
CPU Module IP Address (Write-only)
D8306 ― W
D8307 ― W
D8308 ― W
D8309 ― W
CPU Module Subnet Mask (Write-only)
D8310 ― W
D8311 ― W
D8312 ― W
D8313 ― W
CPU Module Default Gateway (Write-only)
D8314 ― W
D8315 ― W
D8316 ― W
D8317 ― W
CPU Module Preferred DNS Server (Write-only)
D8318 ― W
D8319 ― W
D8320 ― W
D8321 ― W
CPU Module Alternate DNS Server (Write-only)
D8322 ― W
D8323 ― W
D8324 Every 1 s R
D8325 Every 1 s R
D8326 Every 1 s R
CPU Module MAC Address (Current Value Read-only)
D8327 Every 1 s R
D8328 Every 1 s R
D8329 Every 1 s R
D8330 Every 1 s R
D8331 Every 1 s R
CPU Module IP Address (Current Value Read-only)
D8332 Every 1 s R
D8333 Every 1 s R
D8334 Every 1 s R
D8335 Every 1 s R
CPU Module Subnet Mask (Current Value Read-only)
D8336 Every 1 s R
D8337 Every 1 s R
D8338 Every 1 s R
D8339 Every 1 s R
CPU Module Default Gateway (Current Value Read-only)
D8340 Every 1 s R
D8341 Every 1 s R
D8342 Every 1 s R
D8343 Every 1 s R
CPU Module Preferred DNS Server (Current Value Read-only)
D8344 Every 1 s R
D8345 Every 1 s R
D8346 Every 1 s R
D8347 Every 1 s R
CPU Module Alternate DNS Server (Current Value Read-only)
D8348 Every 1 s R
D8349 Every 1 s R
D8350 Every 1 s R
D8351 Every 1 s R
Connection 1 Connected IP Address
D8352 Every 1 s R
D8353 Every 1 s R
D8354 Every 1 s R
D8355 Every 1 s R
Connection 2 Connected IP Address
D8356 Every 1 s R
D8357 Every 1 s R
Device
Description Update Timing R/W
Address
D8358 Every 1 s R
D8359 Every 1 s R
Connection 3 Connected IP Address
D8360 Every 1 s R
D8361 Every 1 s R
D8362 Every 1 s R
D8363 Every 1 s R
Connection 4 Connected IP Address
D8364 Every 1 s R
D8365 Every 1 s R
D8366 Every 1 s R
D8367 Every 1 s R
Connection 5 Connected IP Address
D8368 Every 1 s R
D8369 Every 1 s R
D8370 Every 1 s R
D8371 Every 1 s R
Connection 6 Connected IP Address
D8372 Every 1 s R
D8373 Every 1 s R
D8374 Every 1 s R
D8375 Every 1 s R
Connection 7 Connected IP Address
D8376 Every 1 s R
D8377 Every 1 s R
D8378 Every 1 s R
D8379 Every 1 s R
Connection 8 Connected IP Address
D8380 Every 1 s R
D8381 Every 1 s R
D8382 Every 1 s R
D8383 Every 1 s R
D8384 Every 1 s R
HMI Module MAC Address (Current Value Read-only)
D8385 Every 1 s R
D8386 Every 1 s R
D8387 Every 1 s R
D8388 Every 1 s R
D8389 Every 1 s R
HMI Module IP Address (Current Value Read-only)
D8390 Every 1 s R
D8391 Every 1 s R
D8392 Every 1 s R
D8393 Every 1 s R
HMI Module Subnet Mask (Current Value Read-only)
D8394 Every 1 s R
D8395 Every 1 s R
D8396 Every 1 s R
D8397 Every 1 s R
HMI Module Default Gateway (Current Value Read-only)
D8398 Every 1 s R
D8399 Every 1 s R
D8400 Every 1 s R
D8401 Every 1 s R
HMI Module Preferred DNS Server (Current Value Read-only)
D8402 Every 1 s R
D8403 Every 1 s R
D8404 Every 1 s R
D8405 Every 1 s R
HMI Module Alternate DNS Server (Current Value Read-only)
D8406 Every 1 s R
D8407 Every 1 s R
D8408 to
— Reserved — ― ―
D8412
D8413 Time Zone Offset ― R/W
D8414 SNTP Operation Status ― R
D8415 SNTP Access Elapsed Time ― R
Device
Description Update Timing R/W
Address
D8416 to
— Reserved — ― ―
D8428
D8429 Connection No. ― R/W
D8430 Every 1 s R
D8431 HMI Module Connection Every 1 s R
Connected IP Address
D8432 Information Reference Every 1 s R
D8433 Every 1 s R
D8434 Connected Port No. Every 1 s R
D8435
— Reserved — ― ―
D8436
D8437 ― W
D8438 ― W
HMI Module IP Address (Write-only)
D8439 ― W
D8440 ― W
D8441 ― W
D8442 ― W
HMI Module Subnet Mask (Write-only)
D8443 ― W
D8444 ― W
D8445 ― W
D8446 ― W
HMI Module Default Gateway (Write-only)
D8447 ― W
D8448 ― W
D8449 ― W
D8450 ― W
HMI Module Preferred DNS Server (Write-only)
D8451 ― W
D8452 ― W
D8453 ― W
D8454 ― W
HMI Module Alternate DNS Server (Write-only)
D8455 ― W
D8456 ― W
D8457 EMAIL Instruction Detailed Error Information ― R
D8458 to
— Reserved — ― ―
D8469
D8470 Expansion Module Slot 1 Type ID/Status ― R
D8471 Information System Software Version ― R
D8472 Expansion Module Slot 2 Type ID/Status ― R
D8473 Information System Software Version ― R
D8474 Expansion Module Slot 3 Type ID/Status ― R
D8475 Information System Software Version ― R
D8476 Expansion Module Slot 4 Type ID/Status ― R
D8477 Information System Software Version ― R
D8478 Expansion Module Slot 5 Type ID/Status ― R
D8479 Information System Software Version ― R
D8480 Expansion Module Slot 6 Type ID/Status ― R
D8481 Information System Software Version ― R
D8482 Expansion Module Slot 7 Type ID/Status ― R
D8483 Information System Software Version ― R
D8484 Expansion Module Slot 8 Type ID/Status ― R
D8485 Information System Software Version ― R
D8486 Expansion Module Slot 9 Type ID/Status ― R
D8487 Information System Software Version ― R
D8488 Expansion Module Slot 10 Type ID/Status ― R
D8489 Information System Software Version ― R
D8490 Expansion Module Slot 11 Type ID/Status ― R
D8491 Information System Software Version ― R
Device
Description Update Timing R/W
Address
D8492 Expansion Module Slot 12 Type ID/Status ― R
D8493 Information System Software Version ― R
D8494 Expansion Module Slot 13 Type ID/Status ― R
D8495 Information System Software Version ― R
D8496 Expansion Module Slot 14 Type ID/Status ― R
D8497 Information System Software Version ― R
D8498 Expansion Module Slot 15 Type ID/Status ― R
D8499 Information System Software Version ― R
Port 1
Port 2
Port 3
0 (0000): Maintenance communication
1 (0001): User communication
2 (0010): Modbus RTU master
3 (0011): Modbus RTU slave
4 (0100): Data link communication
Port 2
0 (00): No communication cartridges
Port 3
1 (01): RS-232C communication cartridge
2 (10): RS-485 communication cartridge
3 (11): Free
Reserved=0
0: No optional cartridge
SD Memory Card
1: Has optional cartridge Cartridge Slot 1
Cartridge Slot 2
Cartridge Slot 3
■ D8032 to D8035, D8214, D8215: Interrupt Input Jump Destination Label No.
Jump destination label numbers for interrupt inputs are written to these registers. When using interrupt inputs, write the label
number that corresponds to the special data register that has been allocated to the interrupt input. For details on interrupt
inputs, see Chapter 5 "Interrupt Input" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
D8032 = I1
D8033 = I3
D8034 = I4
D8035 = I6
D8214 = I7
D8215 = I0
Port 1
Port 2
Port 3
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.
1 (001): When the DSR signal is on, the FC6A Series MicroSmart can transmit and receive.
ON
DSR signal
OFF
2 (010): When the DSR signal is off, the FC6A Series MicroSmart can transmit and receive.
ON
DSR signal
OFF
3 (011): When the DSR signal is on, transmission is possible (reception is always possible).
ON
DSR signal
OFF
This is normally called "busy control" and is used for transmission control for devices with a slow
processing speed such as printers.
(As viewed from the connected device, there is a limit on the data that can be input.)
4 (100): When the DSR signal is off, transmission is possible.
ON
DSR signal
OFF
Port 1
Port 2
Port 3
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.
Running Stopped Running
ON
DTR signal
OFF
ON
DTR signal
OFF
The system software version displays the version of the software written to the device.
For details on the type IDs and statuses, see "List of Type IDs and Statuses" on page 2-31.
■ D8192 to D8203, D8210 to D8213, D8216 to D8229, D8232 to D8237: High-speed Counter
These special data registers are used with the high-speed counter function and the frequency measurement function.
For details on high-speed counters, see Chapter 5 "High-Speed Counter" in the "FC6A Series MicroSmart All-in-One Type User’s
Manual".
D8210 to D8213, D8216, D8217 = High-speed counter (group 1/I0)
D8218 to D8221, D8234, D8235 = High-speed counter (group 3/I3)
D8222 to D8225, D8236, D8237 = High-speed counter (group 4/I4)
D8226 to D8229, D8232, D8233 = High-speed counter (group 5/I6)
D8192 to D8197 = High-speed counter (group 2/I1)
D8198 to D8203 = High-speed counter (group 6/I7)
D8278
Connection 1
Connection 2
Connection 3
Connection 4
D8279
Connection 5
Connection 6
Connection 7
Connection 8
• Client connection (most significant bit = 0)
0000: Unused
0001: User Communication
0010: Modbus TCP client
D8284
HMI Connection 1
HMI Connection 2
HMI Connection 3
HMI Connection 4
D8285
HMI Connection 5
HMI Connection 6
HMI Connection 7
HMI Connection 8
■ D8342 to D8345: CPU Module Preferred DNS Server (Current Value Read-only)
The CPU module's preferred DNS server address is written to the special data registers as follows.
Example: Preferred DNS server: aaa.bbb.ccc.ddd
D8342=aaa, D8343=bbb, D8344=ccc, D8345=ddd
■ D8346 to D8349: CPU Module Alternate DNS Server (Current Value Read-only)
The CPU module's alternate DNS server address is written to the special data registers as follows.
Example: Alternate DNS server: aaa.bbb.ccc.ddd
D8346=aaa, D8347=bbb, D8348=ccc, D8349=ddd
■ D8400 to D8403: HMI Module Preferred DNS Server (Current Value Read-only)
The HMI module's preferred DNS server address is written to the special data registers as follows.
Example: HMI module preferred DNS server: aaa.bbb.ccc.ddd
D8400=aaa, D8401=bbb, D8402=ccc, D8403=ddd
■ 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
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
D8480, D8481 = Expansion Module Slot 6 Information
D8482, D8483 = Expansion Module Slot 7 Information
D8484, D8485 = Expansion Module Slot 8 Information
D8486, D8487 = Expansion Module Slot 9 Information
D8488, D8489 = Expansion Module Slot 10 Information
D8490, D8491 = Expansion Module Slot 11 Information
D8492, D8493 = Expansion Module Slot 12 Information
D8494, D8495 = Expansion Module Slot 13 Information
D8496, D8497 = Expansion Module Slot 14 Information
D8498, D8499 = Expansion Module Slot 15 Information
For details on the type IDs and statuses, see "List of Type IDs and Statuses" on page 2-31.
Cartridge
Type ID
Type No.
Hexadecimal Binary
0x00 0000 0000 FC6A-PJ2A
0x01 0000 0001 FC6A-PK2AV
0x02 0000 0010 FC6A-PK2AW
0x03 0000 0011 FC6A-PJ2CP
0x06 0000 0110 FC6A-PC1
0x07 0000 0111 FC6A-PC3
0xFF 1111 1111 Not connected
■ Status
Status
Description
Hexadecimal Binary
0x00 0000 0000 Normal
Communication error (An error has occurred in the communication between the CPU module and an
0x81 1000 0001
expansion module, HMI module, or cartridge.)
0x82 1000 0010 Unknown device detected (A device other than the FC6A Series MicroSmart is connected.)
Device setting error (No device is connected or the connected device is different from that set in the
0x83 1000 0011
user program.)
0x84 1000 0100 Device writing error (The attempt to set the operation of the device failed.)
0x85 1000 0101 System update error (The system update failed.)
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 REP
(F) data.
I0 ***** ***** **
Source Device
Data Type Repeat The source device specifies the 16- or 32-bit data to be processed
Designation by the advanced instruction. Some advanced instructions require
two source devices.
Repeat Designation
Destination Device
Specifies whether repeat is used for the device or not.
The destination device specifies the 16- or 32-bit data to store the
Repeat Cycles result of the advanced instruction. Some advanced instructions
Specifies the quantity of repeat cycles: 1 through 99. require two destination devices.
• When a constant is set in WindLDR, it can be set as decimal or hexadecimal number. Prefix the number with "$" to set it as a hexadecimal
number.
Decimal Values and Hexadecimal Storage (Word, Integer, Double, and Long Data)
The following table shows hexadecimal equivalents which are stored in the CPU, as a result of addition and subtraction of the
decimal values shown:
Data Type Result of Addition Hexadecimal Storage Result of Subtraction Hexadecimal Storage
65,535 FFFF
0 0000 0 0000
Word 65,535 FFFF –1 (BW) FFFF
131,071 (CY) FFFF –65,535 (BW) 0001
–65,536 (BW) 0000
65,534 (CY) 7FFE 65,534 (BW) 7FFE
32,768 (CY) 0000 32,768 (BW) 0000
32,767 7FFF 32,767 7FFF
0 0000 0 0000
Integer –1 FFFF –1 FFFF
–32,767 8001 –32,767 8001
–32,768 8000 –32,768 8000
–32,769 (CY) FFFF –32,769 (BW) FFFF
–65,535 (CY) 8001 –65,535 (BW) 8001
4,294,967,295 FFFFFFFF
0 00000000 0 00000000
Double Word 4,294,967,295 FFFFFFFF –1 (BW) FFFFFFFF
8,589,934,591 (CY) FFFFFFFF –4,294,967,295 (BW) 00000001
–4,294,967,296 (BW) 00000000
4,294,967,294 (CY) 7FFFFFFE 4,294,967,294 (BW) 7FFFFFFE
2,147,483,648 (CY) 00000000 2,147,483,648 (BW) 00000000
2,147,483,647 7FFFFFFF 2,147,483,647 7FFFFFFF
0 00000000 0 00000000
Long –1 FFFFFFFF –1 FFFFFFFF
–2,147,483,647 80000001 –2,147,483,647 80000001
–2,147,483,648 80000000 –2,147,483,648 80000000
–2,147,483,649 (CY) FFFFFFFF –2,147,483,649 (BW) FFFFFFFF
–4,294,967,295 (CY) 80000001 –4,294,967,295 (BW) 80000001
31 30 23 22 0
s e[30:23] f[22:0]
The table below shows the correspondence between the values of the three constituent fields s, e, and f and the value represented
by the single storage format bit pattern. When any value out of the bit pattern is entered to the advanced instruction or when
execution of advanced instructions, such as division by zero, has produced any value out of the bit pattern, a user program
execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
Not Zero
Overflow Overflow
M8003 1 0 1 0 1 0 1
Word devices*1: The data storage when From Upper Word is selected under Device Settings
When D0 is specified as the source or destination device, the upper word is stored in D0 and the lower
word is stored in D1.
The data storage when From Lower Word is selected under Device Settings
When D0 is specified as the source or destination device, the lower word is stored in D0 and the upper
word is stored in D1.
Bit devices*1: The data storage when From Upper Word is selected under Device Settings
When R0 is specified as the source or destination device, the upper word is stored in R0 to R15 and the
lower word is stored in R16 to R31.
The data storage when From Lower Word is selected under Device Settings
When R0 is specified as the source or destination device, the lower word is stored in R0-R15 and the
upper word is stored in R16-R31.
*1 For bit devices and word devices, see "Devices" on page 2-1.
• source or destination device that is indirectly specified in the advanced instruction exceeds the valid device range
For example, the data in the source device does not comply with the normal floating-point format when the data type is Float (F).
For details about device ranges, see "Devices" on page 2-1.
When a user program execution error occurs, special internal relay M8004 turns on and the corresponding error code is stored in
special data register D8006. For details about the error codes, see Chapter 13 "User Program Execution Error" in the "FC6A Series
MicroSmart All-in-One Type User’s Manual".
• When the execution result is invalid, a value is stored in the destination device.
For details on stored values, see the descriptions of relevant instructions.
• If a user program execution error occurred during a repeat operation, the operation is canceled and the next repeat operation is executed.
M8004 is retained even when no further user program execution errors occur during subsequent repeat operations.
When a carry or borrow occurs, special internal relay M8003 (carry and borrow) turns on.
For example, when D0 has a value of FFFF (hex) and +1 is added using an INC instruction, the result is 10000 (hex), but when the
data type is Word (W), 0000 (hex) is stored in D0 and 1 is stored in M8003.
The internal relay ends at M7997. Since the MOV (move) instruction reads 16 internal
MOV(W) S1 – D1 – REP relays, the last internal relay exceeds the valid range, resulting in a user program
M8125 M7990 D0
syntax error.
This program results in a user program syntax error. The destination of the
MUL(W) S1 – S2 – D1 – REP MUL (multiplication) instruction requires two data registers D55999 and
I0 D100 D200 D55999 D56000. Since D56000 exceeds the valid range, a user program syntax error
occurs.
Advanced instructions execute operation only on the available devices in the valid area. If a user program syntax error is found
during programming, WindLDR rejects the program instruction and shows an error message.
The MOV (move) instruction sets data of data register D0 to 16 internal relays M7980
MOV(W) S1 – D1 R REP through M7997 in the first repeat cycle. The destination of the second cycle is the next
M8125 D0 M7980 2 16 internal relays M8000 through M8017, which are invalid, resulting in a user program
syntax error.
For details about repeat operations of each advanced instruction, see the following
chapters.
Details of the other advanced instructions are described in the following chapters.
Valid Devices
Ladder Diagram
Instruction I Q M T C R D
0-27 0-17
LOD 0-7997 0.0-7999.15
30-307 30-307 0-1023 0-511 0-225
LODN 10000-17497 10000.15-55999.15
310-627 310-627
The valid device range depends on the FC6A Series MicroSmart type. For details, see "Device Addresses" on page 2-1.
Specify the bit by inserting a "." between the data register number and the bit position.
Valid Devices
Ladder Diagram
Instruction I Q M T C R D
0-17
OUT 0-7997 0.0-7999.15
— 30-307 — — —
OUTN 10000-17497 10000.15-55999.15
310-627
The valid device range depends on the FC6A Series MicroSmart type. For details, see "Device Addresses" on page 2-1.
Specify the bit by inserting a "." between the data register number and the bit position.
Note: For restrictions on ladder programming of OUT and OUTN instructions, see "Restriction on Ladder Programming" on page 4-31.
There is no limit to the number of OUT and OUTN instructions that can be programmed Ladder Diagram
into one rung.
I1 I2 Q0
Q1
Q2
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. These instructions are detailed later in ON
this chapter.
I1 Q0
When the same output number is programmed more than once within one scan, the
output nearest to the END instruction is given priority for outputting. In the example on the OFF OFF
right, output Q0 is off.
I2 Q0
OFF
I3
END
ON
Q1 OFF
Q0 Q1 LODN Q0
OUT Q1
Instruction Data
T0 Q2 LOD T0
OUTN Q2
C1 Q10 LODN C1
OUT Q10
Instruction I Q M T C R D
0-17
SET 0-7997 0.0-7999.15
— 30-307 — — 0-225
RST 10000-17497 10000.15-55999.15
310-627
The valid device range depends on the FC6A Series MicroSmart type. For details, see "Device Addresses" on page 2-1.
Specify the bit by inserting a "." between the data register number and the bit position.
Note: For restrictions on ladder programming of SET and RST instructions, see "Restriction on Ladder Programming" on page 4-31.
When both inputs I0 and I1 are on, output Q0 is on. When either input I0 or I1 is off, output Q0 is off.
When input I0 is on and input I1 is off, output Q1 is on. When either input I0 is off or input I1 is on, output Q1 is off.
Valid Devices
Instruction I Q M T C R D
0-27 0-17
AND 0-7997 0.0-7999.15
30-307 30-307 0-1023 0-511 0-225
ANDN 10000-17497 10000.15-55999.15
310-627 310-627
The valid device range depends on the FC6A Series MicroSmart type. For details, see "Device Addresses" on page 2-1.
Specify the bit by inserting a "." between the data register number and the bit position.
Instruction Data ON
I0 OFF
I0 Q0 LOD I0
ON
OR I1 I1 OFF
OUT Q0
I1 LOD I0 ON
Q0 OFF
ORN I1
OUT Q1 ON
I0 Q1 Q1 OFF
I1
When either input I0 or I1 is on, output Q0 is on. When both inputs I0 and I1 are off, output Q0 is off.
When either input I0 is on or input I1 is off, output Q1 is on. When input I0 is off and input I1 is on, output Q1 is off.
Valid Devices
Instruction I Q M T C R D
0-27 0-17
OR 0-7997 0.0-7999.15
30-307 30-307 0-1023 0-511 0-225
ORN 10000-17497 10000.15-55999.15
310-627 310-627
The valid device range depends on the FC6A Series MicroSmart type. For details, see "Device Addresses" on page 2-1.
Specify the bit by inserting a "." between the data register number and the bit position.
I0 I2 Q0 LOD I0
LOD I2
OR I3
I3 ANDLOD
OUT Q0
Timing Chart
ON When input I0 is on and either input I2 or I3 is on,
I0 OFF
output Q0 is on.
ON
I2 OFF
When input I0 is off or both inputs I2 and I3 are off,
output Q0 is off.
ON
I3 OFF
ON
Q0 OFF
OR LOD (Load)
The OR LOD instruction is used to connect, in parallel, two or more circuits starting with the LOD instruction. The OR LOD
instruction is the equivalent of a “node” on a ladder diagram.
When using WindLDR, the user does not need to program the OR LOD instruction. The circuit in the ladder diagram shown below
is converted into OR LOD when the ladder diagram is compiled.
Timing Chart
ON When both inputs I0 and I1 are on or when both
I0 OFF
inputs I2 and I3 are on, output Q0 is on.
ON
I1 When either input I0 or I1 is off and either input I2 or
OFF
I3 is off, output Q0 is off.
ON
I2 OFF
ON
I3 OFF
ON
Q0 OFF
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.
When using WindLDR, the user does not need to program the BPS, BRD, and BPP instructions. The circuit in the ladder diagram
shown below is converted into BPS, BRD, and BPP when the ladder diagram is compiled.
Ladder Diagram
Program List
BPS Instruction Data
I0 I1 Q1 LOD I0
BPS
BRD AND I1
I2 Q2 OUT Q1
BRD
BPP AND I2
I3 Q3
OUT Q2
BPP
AND I3
OUT Q3
Timing Chart
ON
I0 OFF
ON
I1 OFF
ON
I2 OFF
ON
I3 OFF
ON
Q1 OFF
ON
Q2 OFF
ON
Q3 OFF
For details about device ranges, see "Device Addresses" on page 2-1.
To indirectly specify the value, specify it with a data register number, and specify the value of the data register in the range of 0 to 65,535.
Instruction Data ON
TML T0 I0 OFF
I0 4 LOD I0 4s
ON
TML T0 T0 OFF
4
I1 T0 Q0 LOD I1 ON
I1 OFF
AND T0
OUT Q0 ON
Q0 OFF
Instruction Data ON
TIM T1 I0 OFF
I0 20 LOD I0
ON 2s
TIM T1 T1 OFF
20
I1 T1 Q1 LOD I1 ON
I1 OFF
AND T1
OUT Q1 ON
Q1 OFF
Instruction Data ON
TMH T2 I0 OFF
I0 100 LOD I0 1s
ON
TMH T2 T2 OFF
100
I1 T2 Q2 LOD I1 ON
I1 OFF
AND T2
OUT Q2 ON
Q2 OFF
Instruction Data ON
TMS T3 I0 OFF
I0 500 LOD I0 0.5 s
ON
TMS T3 T3 OFF
500
I1 T3 Q3 LOD I1 ON
I1 OFF
AND T3
OUT Q3 ON
Q3 OFF
Timer Circuit
The preset value 0 through 65,535 can be designated using a data register D0 thorough D7999 or D10000 through D55999; 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.
I1 D10 Q0 LOD I1
Note: For restrictions on ladder programming of
TIM T5
timer instructions, see "Restriction on Ladder
D10
Programming" on page 4-31.
OUT Q0
• Countdown from the preset value is initiated when the operation result directly before the timer input is on.
• The timer output turns on when the current value (timed value) reaches 0.
• The current value returns to the preset value when the timer input is off.
• Timer preset and current values can be changed using WindLDR without downloading the entire program to the CPU again. From the
WindLDR menu bar, select Online > Monitor > Monitor, then Online > Custom > New Custom Monitor.
• If a timer preset value is changed during countdown, the timer remains unchanged for that cycle. The change will be reflected in the next
time cycle.
• If a timer preset value is changed to 0, then the timer stops operation, and the timer output is turned on immediately.
• If a current value is changed during countdown, the change becomes effective immediately.
• For data movement when changing, confirming, and clearing preset values, see "Changing, Confirming, and Clearing Preset Values for Timers
and Counters" on page 4-17. Preset values can also be changed and confirmed using the LCD screen and pushbuttons.
• WindLDR ladder diagrams show TP (timer preset value) and TC (timer current value) in advanced instruction devices.
• The timer instructions (TML, TIM, TMH, TMS) and off-delay timer instructions (TMLO, TIMO, TMHO, TMSO) 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" on page 3-10.
Timer Accuracy
Timer accuracy due to software configuration depends on three factors: timer input error, timer counting error, and timeout output
error. These errors are not constant but vary with the user program and other causes.
ON ON
Actual Input OFF
Actual Input OFF
Tie
ON ON
Input RAM OFF
Input RAM OFF
When the input turns on immediately before END processing, When the input turns on immediately after END processing, Tie is
Tie is almost 0. Then the timer input error is only Tet (behind almost equal to one scan time. Then the timer input error is Tie +
error) and is at its minimum. Tet = one scan time + Tet (behind error) and is at its maximum.
1 scan time
Notes: Advance error does not occur at the timer input and timeout output.
Tet + Tte = 1 scan time
Increment is 1 s (TML), 100 ms (TIM), 10 ms (TMH), or 1 ms (TMS).
The maximum advance error is: Increment – 1 scan time
The maximum behind error is: 3 scan times
The timer input error and timeout output error shown above do not include the input response time (behind error) and output response
time (behind error) caused by hardware.
TIMO (100-ms off-delay timer) T0 to T1023 0 to 6,553.5 s 100 ms Data registers: D0 to D7999
D10000 to D55999
TMHO (10-ms off-delay timer) T0 to T1023 0 to 655.35 s 10 ms
For details about device ranges, see "Device Addresses" on page 2-1.
To indirectly specify the value, specify it with a data register number, and specify the value of the data register in the range of 0 to 65,535.
Instruction Data ON
TMLO T0 I0 OFF
I0 4 LOD I0 4s
ON
TMLO T0 T0 OFF
4
I1 T0 Q0 LOD I1 ON
I1 OFF
AND T0
OUT Q0 ON
Q0 OFF
Instruction Data ON
TIMO T1 I0 OFF
I0 20 LOD I0 2s
ON
TIMO T1 T1 OFF
20
I1 T1 Q1 LOD I1 ON
I1 OFF
AND T1
OUT Q1 ON
Q1 OFF
Instruction Data ON
TMHO T2 I0 OFF
I0 100 LOD I0 1s
ON
TMHO T2 T2 OFF
100
I1 T2 Q2 LOD I1 ON
I1 OFF
AND T2
OUT Q2 ON
Q2 OFF
Instruction Data ON
TMSO T3 I0 OFF
I0 500 LOD I0 0.5 s
ON
TMSO T3 T3 OFF
500
I1 T3 Q3 LOD I1 ON
I1 OFF
AND T3
OUT Q3 ON
Q3 OFF
For details about device ranges, see "Device Addresses" on page 2-1.
To indirectly specify the value, specify it with a data register number, and specify the value of the data register in the range of 0 to 65,535.
Ladder Diagram Program List • A single counter number cannot be programmed more than once.
Reset • While the reset input is off, the counter counts the leading edges
CNT C0 Instruction Data
of pulse inputs and compares them with the preset value.
I0 5 LOD I0
• When the current value reaches the preset value, the counter
Pulse LOD I1
turns output on. The output stays on until the reset input is
CNT C0
I1 turned on.
5
LOD I2 • When the reset input changes from off to on, the current value is
AND C0 reset.
I2 C0 Q0
OUT Q0 • When the reset input is on, all pulse inputs are ignored.
• The reset input must be turned off before counting may begin.
Timing Chart • When power is off, the counter’s current value is held, and can
also be designated as “clear” type counters using Function Area
ON
Reset Input I0 Settings (see Chapter 5 "Memory Backup" in the "FC6A Series
OFF
1 2 3 4 5 6 MicroSmart All-in-One Type User’s Manual".).
ON
Pulse Input I1 OFF
••• • Counter preset and current values can be changed using
WindLDR without downloading the entire program to the CPU
ON
Counter C0 OFF
again. From the WindLDR menu bar, select Online > Monitor >
Monitor, then Online > Custom > New Custom Monitor.
ON
Input I2 Change the current value while the counter reset input is off.
OFF
• When the preset or current value is changed during counter
ON
Output Q0 OFF
operation, the change becomes effective immediately.
• When power is off, the preset values that were changed are
cleared and the original preset values are loaded.
• The preset value 0 through 65,535 can be designated using a data
register D0 thorough D7999 or D10000 through D55999; then the • For data movement when changing, confirming, and clearing
data of the data register becomes the preset value. preset values, see "Changing, Confirming, and Clearing Preset
Values for Timers and Counters" on page 4-17. Preset values can
• Directly after the CNT instruction, the OUT, OUTN, SET, RST, TML,
also be changed and confirmed using the LCD screen and
TIM, TMH, or TMS instruction can be programmed.
pushbuttons.
• WindLDR ladder diagrams show CP (counter preset value) and
CC (counter current value) in advanced instruction devices.
Reset
CNT C28 • The CNT instruction cannot be used in an interrupt program.
I0 D5 Q0 If used, a user program execution error will result, turning on
Pulse special internal relay M8004 and the ERR LED on the FC6A Series
MicroSmart. For details about the user program execution errors,
I1 see "User Program Execution Errors" on page 3-10.
Note: For restrictions on ladder programming of counter instructions, see "Restriction on Ladder Programming" on page 4-31.
Ladder Diagram Program List • A single counter number cannot be programmed more
Preset Input than once.
CUD C2 Instruction Data
• The preset input must be turned on initially so that the
I0 500 LOD I0 current value returns to the preset value.
Pulse Input
LOD I1
• The preset input must be turned off before counting may
LOD I2
I1 begin.
CUD C2
U/D Selection
500 • The up mode is selected when the up/down selection
LOD I3 input is on.
I2
AND C2 • The down mode is selected when the up/down selection
OUT Q2 input is off.
I3 C2 Q2 • The counter output is on only when the current value is 0.
• After the current value reaches 0 (counting down), it
Timing Chart changes to 65,535 on the next count down.
• After the current value reaches 65,535 (counting up), it
ON
Preset Input I0 changes to 0 on the next count up.
OFF
• When power is off, the counter’s current value is held, and
ON
Pulse Input I1 OFF
••• can also be designated as “clear” type counters using the
Function Area Settings (see Chapter 5 "Memory Backup"
U/D Selection ON
in the "FC6A Series MicroSmart All-in-One Type User’s
Input I2 OFF
Manual".).
Counter C2 Value 500 501 502 501 500 499 • • • 0 1 500 500
• Counter preset and current values can be changed using
WindLDR without downloading the entire program to the
ON
Counter C2 OFF CPU again. From the WindLDR menu bar, select Online >
Monitor > Monitor, then Online > Custom > New
Custom Monitor. Change the current value while the
counter preset input is off.
• When the preset or current value is changed during
counter operation, the change becomes effective
Valid Pulse Inputs
immediately.
The reset or preset input has priority over the pulse input. One
• When power is off, the changed preset values are cleared
scan after the reset or preset input has changed from on to off,
and the original preset values are loaded.
and the counter starts counting the pulse inputs as they change
• For data movement when changing, confirming, and
from off to on.
clearing preset values, see "Changing, Confirming, and
Clearing Preset Values for Timers and Counters" on page
4-17. Preset values can also be changed and confirmed
ON
Reset/Preset using the LCD screen and pushbuttons.
OFF
• WindLDR ladder diagrams show CP (counter preset value)
ON
Pulse and CC (counter current value) in advanced instruction
OFF
Valid Invalid Valid devices. The CUD instruction cannot be used in an
More than one scan interrupt program.
time is required.
• 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" on page 3-10.
Note: For restrictions on ladder programming of counter instructions, see "Restriction on Ladder Programming" on page 4-31.
For details about device ranges, see "Device Addresses" on page 2-1.
The preset value can be 0 through 4,294,967,295 and designated using a constant or a data register. If a data register is designated as the preset
value, two consecutive data registers are used.
Ladder Diagram Program List • Double-word counter instructions use two consecutive
Preset Input
counters, and counters cannot be used more than once in
CDPD C2 Instruction Data a user program.
I0 100000 LOD I0 • The preset input must be turned on initially so that the
Up Pulse
LOD I1 current value returns to the preset value.
LOD I2
I1 • The preset input must be turned off before counting may
CDPD C2
Down Pulse begin.
100000
LOD I3 • When the up and down pulses are on simultaneously, no
I2 pulse is counted.
AND C2
OUT Q1 • The counter output is on only when the current value is 0.
I3 C2 Q1 • After the current value reaches 0 (counting down), it
changes to 4,294,967,295 on the next count down.
• After the current value reaches 4,294,967,295 (counting
Timing Chart
up), it changes to 0 on the next count up.
ON
Preset Input I0 • When power is off, the counter’s current value is held, and
OFF
can also be designated as “clear” type counters using the
ON
Up Pulse I1 Function Area Settings (see Chapter 5 "Memory Backup"
OFF
in the "FC6A Series MicroSmart All-in-One Type User’s
ON Manual".).
Down Pulse I2 •••
OFF
• Counter preset and current values can be changed using
Counter C2 Value 100000 100001 100000 99999 ••• 0 1 100000 100000 WindLDR without downloading the entire program to the
CPU again. From the WindLDR menu bar, select Online >
ON
Counter C2 Monitor > Monitor, then Online > Custom > New
OFF
Custom Monitor. To change a counter preset value,
select DEC(D) in the pull-down list box.
• When the preset or current value is changed during
counter operation, the change becomes effective
immediately.
• When power is off, the changed preset values are cleared
and the original preset values are loaded.
• For data movement when changing, confirming, and
clearing preset values, see "Changing, Confirming, and
Clearing Preset Values for Timers and Counters" on page
4-17.
• WindLDR ladder diagrams show CP (counter preset value)
and CC (counter current value) in advanced instruction
devices. The CNPD 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" on page 3-10.
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. After changing the preset values temporarily, the changes can be written to the user program in the FC6A Series
MicroSmart ROM or cleared from the RAM.
When the power is off, the temporarily changed preset values in the RAM are cleared and the original preset values are loaded.
Confirm the changed preset values to store them in the ROM. The timer/counter preset values can be confirmed only when FC6A
Series MicroSmart is stopped.
To access the PLC Status dialog box from the WindLDR menu bar, select Online > Monitor > Monitor, then Online > Status.
Clear Button
After pressing the Clear or
Confirm button, the display
Confirm Button
changes to “Unchanged.”
Data movement when clearing changed preset values to restore original values
Changing preset values for timers and counters in the WindLDR FC6A Series MicroSmart
FC6A Series MicroSmart RAM does not automatically
ROM
update preset values in the user memory, ROM. This
is useful for restoring original preset values. When User Program
Original
the Clear button is pressed before pressing the User Program Clear RAM Preset
Confirm button, the changed timer/counter preset Values
values are cleared from the RAM and the original
preset values are loaded from the ROM to the RAM.
CC= C2 CC= C2
10 10
Q0
OUT Q0
Preset value to compare
• The CC= and CC>= instructions can be used repeatedly for different preset values.
• The comparison instructions only compare the current value. The status of the counter does not affect this function.
• The comparison instructions also serve as an implicit LOD instruction.
• The comparison instructions can be used with internal relays, which are ANDed or ORed at a separate program address.
• Like the LOD instruction, the comparison instructions can be followed by the AND and OR instructions.
I0 M0 Q0 I0
Timing Chart
ON
Reset Input I0 OFF
1 2 3 4 5 6 7 8 9 10
ON
Pulse Input I1 OFF
•••
Pulse LOD I6 ON
CNT C20 C20 (100) OFF
I6 500 ON
CC>= C20 Output Q2 OFF
CC>= C20
150 150
Q2 ON
OUT Q2 Output Q3 OFF
CC>= C20 CC>= C20
Output Q3 is on when counter C20 current value is
100 Q2 Q3 100
between 100 and 149.
ANDN Q2
OUT Q3 When the current value of C20 is between 150 and
500, Q2 is on.
DC= D2 DC= D2
50 Q0 50
OUT Q0
Preset value to compare
• The DC= and DC>= instructions can be repeated for different preset values.
• The comparison instructions also serve as an implicit LOD instruction.
• The comparison instructions can be used with internal relays, which are ANDed or ORed at a separate program address.
• Like the LOD instruction, the comparison instructions can be followed by the AND and OR instructions.
I0 M0 Q0 I0
4 4 10 10 5 5 3 3 7 3 5 2 2 2
D10 Value
0 4 10 10 5 5 3 3 3 3 5 2 2 2
D2 Value
Output Q0 is on when data register D2 value is 5.
ON
Output Q0 Output Q1 is on when data register D2 value is 3
OFF
or more.
ON
Output Q1 OFF
I2
Structural Diagram
Shift Direction
Reset
I0
Data
R0 R1 R2 R3
I2
Pulse
Reset Input
The reset input will cause the value of each bit of the shift register to return to zero. Initialize pulse special internal relay, M8120,
may be used to initialize the shift register at start-up.
Pulse Input
The pulse input triggers the data to shift. The shift is in the forward direction for a forward shift register and in reverse for a
reverse shift register. A data shift will occur upon the leading edge of a pulse; that is, when the pulse turns on. If the pulse has
been on and stays on, no data shift will occur.
Data Input
The data input is the information which is shifted into the first bit when a forward data shift occurs, or into the last bit when a
reverse data shift occurs.
Note: When power is turned off, the statuses of all shift register bits are normally cleared. It is also possible to maintain the statuses of shift
register bits by using the Function Area Settings as required. See Chapter 5 "Functions and Settings" - "Memory Backup" in the "FC6A Series
MicroSmart All-in-One Type User’s Manual".
Note: The SFR 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" on page 3-10.
Note: For restrictions on ladder programming of shift register instructions, see "Restriction on Ladder Programming" on page 4-31.
Ladder Diagram
Program List
Reset
SFR R0 Instruction Data
I0 4
LOD I0
Pulse
LOD I1
LOD I2
I1
SFR R0
Data
4
I2 LOD R0
OUT Q0
LOD R1
R0 Q0 OUT Q1
LOD R2
OUT Q2
R1 Q1 LOD R3
OUT Q3
R2 Q2
Timing Chart
R3 Q3 ON
Reset Input I0 OFF
One or more scans are required
ON
Pulse Input I1 OFF
ON
Data Input I2 OFF
ON
R0/Q0 OFF
ON
R1/Q1 OFF
ON
R2/Q2 OFF
ON
R3/Q3 OFF
R1 Q1
• The last bit status output can be programmed directly after the SFR
instruction. In this example, the status of bit R3 is read to output Q3.
• Each bit can be loaded using the LOD R# instruction.
• Any shift register bit can be turned on using the SET instruction.
S • Any shift register bit can be turned off using the RST instruction.
I0 R0 • The SET or RST instruction is actuated by any input condition.
R
I1 R3
R25 Q3
• The last bit status output can be programmed directly after the SFRN instruction. In this example, the status of bit R20 is read to output Q0.
• Each bit can be loaded using the LOD R# instructions.
• For details of reset, pulse, and data inputs, see "Forward Shift Register (SFR)" on page 4-22.
Structural Diagram
Shift Direction
Reset
I0
Data
R20 R21 R22 R23 R24 R25 R26
I2
Pulse
Note: Output is initiated only for those bits highlighted in bold print.
Note: When power is turned off, the statuses of all shift register bits are normally cleared. It is also possible to maintain the statuses of shift register
bits by using the Function Area Settings as required. See Chapter 5 "Functions and Settings" - "Memory Backup" in the "FC6A Series MicroSmart All-
in-One Type User’s Manual".
Note: The SFRN 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" on page 3-10.
Note: For restrictions on ladder programming of shift register instructions, see "Restriction on Ladder Programming" on page 4-31.
R24 Q1
R26 Q2
Structural Diagram
Forward Shifting
I1 I4
Data Data
R22 R23 R24 R25 R26 R27
I3 I6
Pulse Pulse
Last Bit: R22 # of Bits: 6
I2 I5
Reverse Shifting
Note: Output is initiated only for those bits highlighted in bold print.
Note: For restrictions on ladder programming of SOTU and SOTD instructions, see "Restriction on Ladder Programming" on page 4-31.
Timing Chart
ON
Input I0 OFF
ON
Output Q0 OFF
ON T T
Output Q1 OFF
T T
There is a special case when the SOTU and SOTD instructions are used between the MCS and MCR instructions (see "MCS and
MCR (Master Control Set and Reset)" on page 4-27). If input I2 to the SOTU instruction turns on while input I1 to the MCS
instruction is on, then the SOTU output turns on. If input I2 to the SOTD instruction turns off while input I1 is on, then the SOTD
output turns on. If input I1 turns on while input I2 is on, then the SOTU output turns on. However, if input I1 turns off while input
I2 is on, then the SOTD output does not turn on as shown below.
MCR
No Output No Output
Instruction Status
SOTU Rising edges (ON pulses) are not detected.
SOTD Falling edges (OFF pulses) are not detected.
OUT All are turned off.
OUTN All are turned on.
SET and RST All are held in current status.
Current values are reset to zero.
TML, TIM, TMH, and TMS
Timeout statuses are turned off.
Current values are held.
CNT, CDP, and CUD Pulse inputs are turned off.
Countout statuses are turned off.
Shift register bit statuses are held.
SFR and SFRN Pulse inputs are turned off.
The output from the last bit is turned off.
Instruction Data
MCS
I0 LOD I0
MCS
LOD I1
OUT Q0
I1 Q0 MCR
MCR
Timing Chart
ON
Input I0 OFF
ON
Input I1 OFF
ON
Output Q0 OFF
When input I0 is off, MCS is executed so that the subsequent input is forced off.
When input I0 is on, MCS is not executed so that the following program is
executed according to the actual input statuses.
Instruction Data
MCS
I1 LOD I1
MCS
LOD I2
I2 Q0 OUT Q0
LOD I3
MCS MCS
I3
LOD I4
OUT Q1
I4 Q1 LOD I5
MCS
MCS LOD I6
I5 OUT Q2
MCR
I6 Q2
MCR
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.
When I1 is on and I3 is off, the second MCS is executed so that subsequent inputs I4 through I6 are forced off.
When both I1 and I3 are on, the first and second MCSs are not executed so that the following program is executed according to
the actual input statuses of I4 through I6.
Ladder Diagram
When input I1 is on, the MCS is not executed so that the counter and shift register are executed according
MCS to the actual status of subsequent inputs I2 through I4.
I1
Reset When input I1 is off, the MCS is executed so that subsequent inputs I2 through I4 are forced off.
CNT C2
When input I1 is turned on while input I2 is on, the counter and shift register pulse inputs are turned on as
I3 10
shown below.
Pulse
I2
Reset
SFR R0
I3 4
Pulse Timing Chart
ON
Input I1 OFF
I2
Data ON
Input I2 OFF
I4
ON
Counter Pulse Input OFF
MCR
ON
Shift Register Pulse Input OFF
Instruction Status
SOTU Rising edges (ON pulses) are not detected.
SOTD Falling edges (OFF pulses) are not detected.
OUT and OUTN All are held in current status.
SET and RST All are held in current status.
Current values are held.
TML, TIM, TMH, and TMS
Timeout statuses are held.
Current values are held.
CNT, CDP, and CUD Pulse inputs are turned off.
Countout statuses are held.
Shift register bit statuses are held.
SFR and SFRN Pulse inputs are turned off.
The output from the last bit is held.
JEND
Timing Chart
ON
Input I0 OFF
ON
Input I1 OFF
ON
Output Q0 OFF
When input I0 is off, JMP is not executed so that the following program is
executed according to the actual input statuses.
Instruction Data
JMP
I1 LOD I1
JMP
LOD I2
I2 Q0 OUT Q0
LOD I3
JMP
JMP
I3
LOD I4
OUT Q1
I4 Q1 LOD I5
JMP
JMP LOD I6
I5 OUT Q2
JEND
I6 Q2
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
I6.
When I1 is off and I3 is on, the second JMP is executed so that subsequent output statuses of Q1 and Q2 are held.
When both I1 and I3 are off, the first and second JMPs are not executed so that the following program is executed according to the actual input
statuses of I4 through I6.
END
The END instruction is always required at the end of a program; however, it is not necessary to program the END instruction after
the last programmed instruction. WindLDR automatically appends the END instruction at the end of a program.
A scan is the execution of all instructions from address zero to the END instruction. The time required for this execution is referred
to as one scan time. The scan time varies with respect to program length, which corresponds to the address where the END
instruction is found.
During the scan time, program instructions are processed sequentially. This is why the output instruction closest to the END
instruction has priority over a previous instruction for the same output. No output is initiated until all logic within a scan is
processed.
Output occurs simultaneously, and this is the first part of the END instruction execution. The second part of the END instruction
execution is to monitor all inputs, also done simultaneously. Then program instructions are ready to be processed sequentially
once again.
I0 Q0 LOD I0
OUT Q0
LOD I1
I1 Q1 OUT Q1
END
END
Vertical Vertical
Line A Relay 2 Line B
OUT, OUTN, SET, RST, TML, TIM, TMH, TMS, TMLO, TIMO, TMHO, TMSO, CNT, CDP, CUD, CNTD, CDPD,
Prohibited Instructions
CUDD, SFR, SFRN, SOTU, SOTD
When converting the ladder program, an error message is shown, such as “TIM follows an invalid device.”
Error Detection
Conversion fails to create mnemonics and the program is not downloaded to the FC6A Series MicroSmart.
TIM T0 TIM T0
M0 M1 100 Q0 M0 M1 100
M2 M0 T0 Q0
M2
TIM T0 TIM T0
M0 M1 100 Q0 M0 M1 100
TIM T1 TIM T1
M2 50 M2 50
T0 Q0
T1
MOV (Move)
S1 → D1
MOV(*) S1(R) D1(R) REP When input is on, 16- or 32-bit data from device assigned by S1 is moved to device
***** ***** ** assigned by D1.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
Both internal relays M0 through M7997 and M10000 through M17497 and special internal relays can be designated as source devices.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
When F (float) data is selected, only data register and constant can be designated as S1, and only data register can be designated as D1.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors"
on page 3-10.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) X or destination, 16 points (word or integer data) or 32 points (double-word or long data) are used. When repeat is
D (double word) X assigned for a bit device, the quantity of device bits increases in 16- or 32-point increments.
L (long) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
F (float) X 1 point (word or integer data) or 2 points (double-word, long, or float data) are used. When repeat is assigned for
a word device, the quantity of device words increases in 1- or 2-point increments.
Examples: MOV
Data Type: Word
D10 → M0
MOV(W) S1 – D1 – REP When input I2 is on, data in data register D10 assigned by source device S1 is moved to
I2 D10 M0 16 internal relays starting with M0 assigned by destination device D1.
810 → D2
When input I0 is on, constant 810 assigned by source D0
MOV(W) S1 – D1 – REP
I0 810 D2 device S1 is moved to data register D2 assigned by D1
destination device D1. D2 810 810
Data move operation for integer data is the same as for word data.
810 → D2·D3
MOV(D) S1 – D1 – REP When input I0 is on, constant 810 assigned by source D0
I0 810 D2 device S1 is moved to data registers D2 and D3 assigned D1
by destination device D1.
D2 0 0
D3 810 810
Data move operation for the long data type is the same as for the double-word data type.
D10 → D2
When input I1 is on, data in data register D10 assigned D0
MOV(W) S1 – D1 – REP
I1 D10 D2 by source device S1 is moved to data register D2 D1
assigned by destination device D1. D2 930
D10 930
D10·D11 → D2·D3
When input I1 is on, data in data registers D10 and D11 D0
MOV(D) S1 – D1 – REP
I1 D10 D2 assigned by source device S1 is moved to data registers D1
D2 and D3 assigned by destination device D1. D2
D3
D10 Double-
word
D11 Data
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.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) First device address to move X X X X X X X X 1-99
D1 (Destination 1) First device address to move to — X X X X X — 1-99
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) X or destination, 16 points (word or integer data) or 32 points (double-word or long data) are used. When repeat is
D (double word) X set for a bit device, the quantity of device bits increases in 16- or 32-point increments.
L (long) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination, 1
F (float) — point (word or integer data) or 2 points (double-word or long data) are used. When repeat is set for a word device, the
quantity of device words increases in 1- or 2-point increments.
Examples: MOVN
M10 NOT → M50
MOVN(W) S1 – D1 – REP When input I0 is on, the 16 internal relays, starting with M10 assigned by source device
I0 M10 M50
S1, are inverted bit by bit and moved to 16 internal relays starting with M50 assigned by
destination device D1.
M10 through M17, M20 through M27 NOT M50 through M57, M60 through M67
The ON/OFF statuses of the 16 internal relays M10 through M17
MSB S1 LSB
Before inversion and M20 through M27 are inverted and moved to 16 internal
(M0027-M0010): 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 relays M50 through M57 and M60 through M67. M50 is the LSB
D1 (least significant bit), and M67 is the MSB (most significant bit).
MSB LSB
After inversion
(M0067-M0050): 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 0
810 NOT → D2
MOVN(W) S1 – D1 – REP When input I1 is on, decimal constant 810 assigned by source device S1 is converted into
I1 810 D2 16-bit binary data, and the ON/OFF statuses of the 16 bits are inverted and moved to
data register D2 assigned by destination device D1.
MSB S1 LSB
Before inversion (810): 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 D0
D1 D1
MSB LSB
After inversion (64725): 1 1 1 1 1 1 0 0 1 1 0 1 0 1 0 1 D2 64725 810
Valid Devices
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, S2, or D2, the device data is the timer/counter current value (TC or CC). When T (timer) or C (counter)
is used as D1, the device data is the timer/counter preset value (TP or CP) which can be 0 through 65,535.
When F (float) data is selected, only data register can be designated as S1 or D1.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart.
Source device S2 or destination device D2 does not have to be assigned. If S2 or D2 is not assigned, the source or destination device is determined
by S1 or D1 without offset.
Make sure that the source data determined by S1 + S2 and the destination data determined by D1 + D2 are within the valid device range. If the
derived source or destination device exceeds the valid device range, a user program execution error will result, turning on special internal relay
M8004 and the ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
W (word) X When S1 (source 1) is a word device and D1 (destination 1) is a Q, M, or R bit device, the data is transferred as
I (integer) — 16 points or 32 bits, depending on the data type. When repeat is assigned for a bit device, the quantity of device
D (double word) X bits increases in 16- or 32-point increments.
L (long) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
F (float) X 1 point (word data) or 2 points (double-word or float data) are used. When repeat is assigned for a word device,
the quantity of device words increases in 1- or 2-point increments.
Example: IMOV
• Data Type: Word
IMOV(W) S1 – S2 D1 – D2 REP
I0 D20 C10 D10 D25 D20
If the current value of counter C10 assigned by source device S2 is 4, the source data is determined by adding the D24 6450
offset value to data register D20 assigned by source device S1: D25 20
D(20 + 4) = D24
If data register D25 contains a value of 20, the destination is determined by adding the offset value to data register D30 6450
D10 assigned by destination device D1:
D20
IMOV(F) S1 – S2 D1 – D2 REP
I0 D20 D50 D10 D51 D21
D22·D23 2.73
D20 + D50 → D10 + D51
If data register D50 contains a value of 2, the source data is determined by adding the offset value to data register
D30·D31 2.73
D20 assigned by source device S1: D(20 + 2) = D22
If data register D51 contains a value of 20, the destination is determined by adding the offset value to data register
D50 2
D10 assigned by destination device D1: D(10 + 20) = D30
D51 20
As a result, when input I0 is on, the data in data registers D22·D23 is moved to data registers D30·D31.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, S2, or D2, the device data is the timer/counter current value (TC or CC). When T (timer) or C (counter)
is used as D1, the device data is the timer/counter preset value (TP or CP), 0 through 65,535.
Source device S2 or destination device D2 does not have to be assigned. If S2 or D2 is not assigned, the source or destination device is determined
by S1 or D1 without offset.
Make sure that the source data determined by S1 + S2 and the destination data determined by D1 + D2 are within the valid device range. If the
derived source or destination device exceeds the valid device range, a user program execution error will result, turning on special internal relay
M8004 and the ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
W (word) X When S1 (source 1) is a word device and D1 (destination 1) is a Q, M, or R bit device, the data is transferred as
I (integer) — 16 points or 32 bits, depending on the data type. When repeat is set for a bit device, the quantity of device bits
D (double word) X increases in 16- or 32-point increments.
L (long) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
F (float) — 1 point (word data) or 2 points (double-word data) are used. When repeat is assigned for a word device, the
quantity of device words increases in 1- or 2-point increments.
Example: IMOVN
D10 4
IMOVN(W) S1 – S2 D1 – D2 REP
I0 C10 D10 D30 D20
D19
C10 + D10 NOT → D30 + D20
D20 15
Source device S1 and destination device D1 determine the type of device. Source device S2 and destination device D2
D21
are the offset values used to determine the source and destination devices.
If the data of data register D10 assigned by source device S2 is 4, then the source data is determined by adding the
offset value to counter C10 assigned by source device S1: D45 59085
If data register D20 assigned by destination device D2 contains a value of 15, then the destination is determined by
adding the offset value to data register D30 assigned by destination device D1: C13
As a result, when input I0 is on, the current value of counter C14 is inverted and moved to data register D45. C15
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1 or N-W, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used
as D1, the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
Make sure that the last source data determined by S1+N–1 and the last destination data determined by D1+N–1 are within the valid device range.
If the derived source or destination device exceeds the valid device range, a user program execution error will result, turning on special internal relay
M8004 and the ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — N-W, or destination, 16 points (word data) are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, N-W, or
L (long) — destination, 1 point (word data) is used.
F (float) —
Example: BMOV
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2 or D2, the timer/counter current value (TC or CC) is displayed.
Make sure that the last source data determined by S1+S2 and the last destination data determined by D1+D2 are within the valid device range. If
the derived source or destination device exceeds the valid device range, a user program execution error will result, turning on special internal relay
M8004 and ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Source device S2 or destination device D2 does not have to be assigned. If S2 or D2 is not assigned, the source or destination device is determined
by S1 or D1 without offset.
Examples: IBMV
M10 + D10 → Q0 + C5
SOTU IBMV S1 – S2 D1 – D2 REP
I0 M10 D10 Q0 C5
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.
If the value of data register D10 assigned by source device S2 is 5, the M27 M20 M17 M15 M10
source data is determined by adding the offset value to internal relay M10
assigned by source device S1.
If the current value of counter C5 assigned by destination device D2 is 12, Q17 Q14 Q10 Q7 Q0
As a result, when input I0 is on, the ON/OFF status of internal relay M15 is moved to output Q14.
D10 + 5 → D20 + 12
SOTU IBMV S1 – S2 D1 – D2 REP
I0 D10 5 D20 12
Since source device S1 is a data register and the value of source device Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
S2 is 5, the source data is bit 5 of data register D10 assigned by source D10
device S1.
Bit 5
Since destination device D1 is a data register and the value of source
device D2 is 12, the destination is bit 12 of data register D20 assigned by
destination device D1.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
As a result, when input I0 is on, the ON/OFF status of data register D10 D20
bit 5 is moved to data register D20 bit 12.
Bit 12
M10 + 5 → Q0 + 9
SOTU IBMV S1 R S2 D1 R D2 REP Repeat = 3
I1 M10 5 Q0 9 3
Since source device S1 is internal relay M10 and the value of source M27 M20 M17 M15 M10
device S2 is 5, the source data is 3 internal relays starting with M15.
9th from Q0
D10 + 5 → D20 + 12
SOTU IBMV S1 R S2 D1 R D2 REP Repeat = 3
I2 D10 5 D20 12 3
Since source device S1 is data register D10 and the value of source Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
device S2 is 5, the source data is 3 bits starting with bit 5 of data register D10
D10.
Bit 5
Since destination device D1 is data register D20 and the value of
destination device D2 is 12, the destination is 3 bits starting with bit 12 of
data register D20.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
As a result, when input I2 is on, the ON/OFF statuses of data register D10 D20
bits 5 through 7 are moved to data register D20 bits 12 through 14.
Bit 12
Valid Devices
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2 or D2, the timer/counter current (TC or CC) value is displayed.
Make sure that the last source data determined by S1+S2 and the last destination data determined by D1+D2 are within the valid device range. If
the derived source or destination device exceeds the valid device range, a user program execution error will result, turning on special internal relay
M8004 and ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Source device S2 or destination device D2 does not have to be used. If S2 or D2 are not used, the source or destination device is determined by S1
or D1 without offset.
Examples: IBMVN
Source device S1 and destination device D1 determine the type of device. Source device S2 and destination device D2 are the offset values used to
determine the source and destination devices.
If the value of data register D10 assigned by source device S2 is 8, the source M37 M30 M27 M20
data is determined by adding the offset value to internal relay M20 assigned
by source device S1.
NOT 8th from M20
10th from Q0
As a result, when input I0 is on, the ON/OFF status of internal relay M30 is inverted and moved to output Q12.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP).
When F (float) data is selected, only data register and constant can be designated as S1, and only data register can be designated as D1.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart.
Make sure that the last destination data determined by D1+N-1 (word or integer data) or D1+2N-2 (double-word, long, or float data) is within the
valid device range. If the derived destination device exceeds the valid device range, a user program execution error will result, turning on special
internal relay M8004 and ERROR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on
page 3-10.
Example: NSET(F)
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
For the N-W, 1 word (16 bits) is always used without regard to the data type.
When T (timer) or C (counter) is used as N-W or S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used
as D1, the data is written in as a preset value (TP or CP).
When F (float) data is selected, only data register and constant can be designated as S1, and only data register can be designated as D1.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart.
Make sure that the last destination data determined by D1+N-1 (word or integer data) or D1+2N-2 (double-word, long, or float data) is within the
valid device range. If the derived destination device exceeds the valid device range, a user program execution error will result, turning on special
internal relay M8004 and ERROR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on
page 3-10.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) X or destination, 16 points (word or integer data) or 32 points (double-word or long data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) X 1 point (word or integer data) or 2 points (double-word, long, or float data) are used.
F (float) X
Example: NRS(F)
XCHG (Exchange)
Word data: D1 ↔ D2
XCHG(*) D1 D2 Double-word data: D1·D1+1 → D2, D2+1
***** *****
When input is on, the 16- or 32-bit data in devices assigned by D1 and D2 are exchanged with
each other.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1 or D2. Special internal relays cannot be designated as
D1 or D2.
W (word) X When a bit device such as Q (output), M (internal relay), or R (shift register) is assigned as the destination, 16
I (integer) — points (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as D (data register) is assigned as the destination, 1 point (word data) or 2 points
L (long) — (double-word data) are used.
F (float) —
Examples: XCHG
• Data Type: Word
When input I0 is turned on, data of data registers D21 D23 D23
and D24 assigned by devices D1 and D2 are exchanged D24 2000 D24 1000
with each other.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. T (timer) or C (counter) is used as D1, and the
data is written in as a current value (TP or CP).
Since the TCCST instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — 16 points (word data) or 32 points (double-word data) are used. When repeat is assigned for a bit device, the
D (double word) X quantity of device bits increases in 16- or 32-point increments.
L (long) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
F (float) — 1 point (word data) or 2 points (double-word data) are used. When repeat is assigned for a word device, the
quantity of device words increases in 1- or 2-point increments.
Example: TCCST
When input I2 is turned on, 99,998 is written to the current value of counter C23.
I1 ON
Counter C23 OFF
LC=(D)
ON
C23 99999 Q0 Input I2 OFF
Valid Devices
Device Function I Q M R T C D Constant Repeat
Repeat Result Logical AND or OR operation — — — — — — — — —
S1 (Source 1) Data to compare X X X X X X X X 1-99
S2 (Source 2) Data to compare X X X X X X X X 1-99
D1 (Destination 1) Comparison output — X — — — — — 1-99
For valid device address ranges, see "Device Addresses" on page 2-1.
When only S1 and/or S2 is repeated, the logical operation type can be selected from AND or OR.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is displayed.
When F (float) data is selected, only data register and constant can be designated as S1 and S2.
When F (float) data is selected and S1 or S2 does not comply with the normal floating-point format, a user program execution error will result,
turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program
Execution Errors" on page 3-10.
When an output or internal relay is assigned as the destination, only 1 point is used regardless of the selected
data type. When repeat is assigned for the destination, outputs or internal relays as many as the repeat cycles
are used.
When more than one CMP = or ICMP>= instruction is used, M8150, M8151, or M8152 indicates the result of the instruction that
was executed last.
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
S1 S2 D1
CMP>=(W) S1 – S2 – D1 – REP
D10 127 D20 50 Q0 turned on
I0 D10 D20 Q0
S1 S2 D1
CMP>=(I) S1 – S2 – D1 – REP
D30 12 D40 –3 Q1 turned on
I1 D30 D40 Q1
CMP>=(D) S1 – S2 – D1 – REP
I2 D50 D60 Q2
S1 S2 D1
CMP>=(L) S1 – S2 – D1 – REP
I3 D70 D80 Q3
S1 S2 D1
CMP>=(F) S1 – S2 – D1 – REP
I4 D90 D95 Q4
S1 S2 D1
D12 20 15
• Data Type: Double Word (Repeat Logical Operation AND)
ON
CMP>=(W) S1 – S2 – D1 – REP Input I0 OFF
I0 D10 C1 Q0
Comparison D10 ≥ C1
Result D10 < C1
Comparison ON
Output Q0 OFF
This program turns the output off when the input is off.
ON
CMP>=(W) S1 – S2 – D1 – REP Input I0 OFF
I0 D10 C1 M0
Comparison D10 ≥ C1
Result D10 < C1
M0 Q0 ON
Output Q0 OFF
Valid Devices
For the valid device address range, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, S2, or S3, the timer/counter current value (TC or CC) is displayed.
When F (float) data is selected, only data register and constant can be designated as S1, S2, and S3.
When F (float) data is selected and S1, S2, or S3 does not comply with the normal floating-point format, a user program execution error will result,
turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart.
When the data of S1 is smaller than that of S3 (S1 < S3), a user program execution error will result, turning on special internal relay M8004 and ERR
LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) X 16 points (word or integer data) or 32 points (double-word or long data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, 1 point (word
L (long) X or integer data) or 2 points (double-word, long, or float data) are used.
F (float) X
The destination uses only one output or internal relay regardless of the selected data type.
When more than one ICMP>= or CMP= instruction is used, M8150, M8151, or M8152 indicates the result of the instruction that
was executed last.
Example: ICMP>=
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. When the condition is not met, Q1 is turned off.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Data to compare X X X X X X X X —
S2 (Source 2) Data to compare X X X X X X X X —
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used, the timer/counter current value (TC or CC) is displayed.
When F (float) data is selected, only data register and constant can be designated.
When F (float) data is selected and S1 or S2 does not comply with the normal floating-point format, a user program execution error will result,
turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. The output to the following instructions is turned off. For user
program execution errors, see "User Program Execution Errors" on page 3-10.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned, 16 points
I (integer) X (word or integer data) or 32 points (double-word or long data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned, 1 point (word or integer
L (long) X data) or 2 points (double-word, long, or float data) are used.
F (float) X
Examples: LC
ADD (Addition)
Data type W or I: S1 + S2 → D1, CY
ADD(*) S1(R) S2(R) D1(R) REP Data type D, L, or F: S1·S1+1 + S2·S2+1 → D1·D1+1, CY
***** ***** ***** ** When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
added together. The result is set to destination device D1 and internal relay
M8003 (carry or borrow).
SUB (Subtraction)
Data type W or I: S1 – S2 → D1, BW
SUB(*) S1(R) S2(R) D1(R) REP Data type D, L, or F: S1·S1+1 – S2·S2+1 → D1·D1+1, BW
***** ***** ***** ** When input is on, 16- or 32-bit data assigned by source device S2 is
subtracted from 16- or 32-bit data assigned by source device S1. The result is
set to destination device D1 and internal relay M8003 (carry or borrow).
MUL (Multiplication)
Data type W or I: S1 × S2 → D1·D1+1
MUL(*) S1(R) S2(R) D1(R) REP Data type D, L, or F: S1·S1+1 × S2·S2+1 → D1·D1+1
***** ***** ***** ** When input is on, 16- or 32-bit data assigned by source device S1 is multiplied
by 16- or 32-bit data assigned by source device S2. The result is set to
destination device D1.
When the result exceeds the valid range for data types D or L, the ERR LED
and special internal relay M8004 (user program execution error) are turned on.
DIV (Division)
Data type W or I: S1 ÷ S2 → D1 (quotient), D1+1 (remainder)
DIV(*) S1(R) S2(R) D1(R) REP Data type D or L: S1·S1+1 ÷ S2·S2+1 → D1·D1+1 (quotient),
D1+2·D1+3 (remainder)
***** ***** ***** **
Data type F: S1·S1+1 ÷ S2·S2+1 →D1·D1+1 (quotient)
When input is on, 16- or 32-bit data assigned by source device S1 is divided
by 16- or 32-bit data assigned by source device S2. The quotient is set to 16-
or 32-bit destination device D1, and the remainder is set to the next 16- or 32-
bit data. Data type F does not generate a remainder.
When S2 is 0 (dividing by 0), the ERR LED and special internal relay M8004
(user program execution error) are turned on.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as
D1, the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
When F (float) data is selected, only data register and constant can be designated as S1 and S2.
When F (float) data is selected and S1 or S2 does not comply with the normal floating-point format, a user program execution error will result,
turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program
Execution Errors" on page 3-10.
Since the binary arithmetic instructions are executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) X 16 points (word or integer data) or 32 points (double-word, long, or float data) are used. When repeat is
D (double word) X assigned for a bit device, the quantity of device bits increases in 16- or 32-point increments.
L (long) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, 1 point (word
F (float) X or integer data) or 2 points (double-word, long, or float data) are used. When repeat is assigned for a word
device, the quantity of device words increases in 1- or 2-point increments.
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
SOTU ADD(W) S1 – S2 – D1 – REP
I0 D2 500 D2
When a carry occurs, output Q0 is assigned as a warning indicator.
S
Acknowledge M8003 Q0 When the acknowledge pushbutton (input I1) is pressed, the warning
Pushbutton indicator is reset.
R
I1 Q0
ADD(D) S1 – S2 – D1 – REP
I0 D10 D20 D30
ADD(L) S1 – S2 – D1 – REP
I0 D10 D20 D30
ADD(F) S1 – S2 – D1 – REP
I0 D10 D20 D30
Example: SUB
• Data Type: Word
The following example demonstrates the use of special internal relay M8003 to process a borrow.
Examples: MUL
• Data Type: Word
4
When input I1 is on, data of D10 is multiplied by data of D20, and the result is set to D30 and D31. D30
(0004h)
37856
D31
(93E0h)
• Data Type: Integer
65531
D30
(FFFBh)
27680
D31
(6C20h)
• Data Type: Double Word
MUL(D) S1 – S2 – D1 – REP
I1 D10 D20 D30
Note: In multiplication of double word data, the lower 32-bit data of the result is set to destination device D1·D1+1.
MUL(L) S1 – S2 – D1 – REP
I1 D10 D20 D30
Note: In multiplication of long data, the lower 32-bit data of the result is set to destination device D1·D1+1.
MUL(F) S1 – S2 – D1 – REP
I1 D10 D20 D30
Note: Since the destination uses two word devices in the multiplication operation, data register D7999 or D55999 cannot be used as destination
device D1. When using a bit device such as internal relay for destination, 32 internal relays are required; so internal relay M7966 through M9999,
M17466 or a larger number cannot be used as destination device D1.
Examples: DIV
• Data Type: Word
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 D7999 or D55999 cannot be used as
destination device D1. When using a bit device, such as internal relay for destination, 32 internal relays are required; so M7966 through M9999,
M17466 or a larger number cannot be used as destination device D1.
Note: Since the destination uses two word devices in the division operation of integer data, data register D7999 or D55999 cannot be used as
destination device D1. When using a bit device, such as internal relay for destination, 32 internal relays are required; so M7966 through M9999,
M17466 or a larger number cannot be used as destination device D1.
DIV(D) S1 – S2 – D1 – REP
I1 D10 D20 D30
DIV(L) S1 – S2 – D1 – REP
I1 D10 D20 D30
DIV(F) S1 – S2 – D1 – REP
I1 D10 D20 D30
Note: Since the destination uses two word devices in the division operation of float data, data register D7999 or D55999 cannot be used as
destination device D1.
When only S1 (source) is assigned to repeat, the final result is set to destination device D1.
When only S1 (source) is assigned to repeat, the final result is set to destination device D1·D1+1.
When only D1 (destination) is assigned to repeat, the same result is set to 3 devices starting with D1.
When only D1 (destination) is assigned to repeat, the same result is set to 3 devices starting with D1·D1+1.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination device D1.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination device D1·D1+1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1·D1+1.
When all devices are assigned to repeat, different results are set to 3 devices starting with D1.
When all devices are assigned to repeat, different results are set to 3 devices starting with D1·D1+1.
Note: Special internal relay M8003 (carry/borrow) is turned on when a carry or borrow occurs in the last repeat operation. When a user program
execution error occurs in any repeat operation, special internal relay M8004 (user program execution error) and the ERR LED are turned on and
maintained while operations for other instructions continues.
When only S1 (source) is assigned to repeat, the final result is set to destination devices D1 and D1+1.
When only S1 (source) is assigned to repeat, the final result is set to destination devices D1·D1+1 and D1+2·D1+3.
When only S1 (source) is assigned to repeat, the final result is set to destination devices D1·D1+1.
When only D1 (destination) is assigned to repeat, the same result is set to 6 devices starting with D1.
When only D1 (destination) is assigned to repeat, the same result is set to 6 devices starting with D1·D1+1.
When only D1 (destination) is assigned to repeat, the same result is set to 3 devices starting with D1·D1+1.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination devices D1 and D1+1.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination devices D1·D1+1 and D1+2·D1+3.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination devices D1·D1+1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 6 devices starting with D1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 6 devices starting with D1·D1+1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1·D1+1.
When all devices are assigned to repeat, different results are set to 6 devices starting with D1.
When all devices are assigned to repeat, different results are set to 6 devices starting with D1·D1+1.
When all devices are assigned to repeat, different results are set to 3 devices starting with D1·D1+1.
S1 (Repeat = 3) S2 (Repeat = 3) D 1 ( R ep ea t = 3)
SOTU DIV(F) S1 R S2 R D1 R REP
D10 D20 D30 3 D10·D11 ÷ D20·D21 D30·D31
I1
D12·D13 ÷ D22·D23 D32·D33
D14·D15 ÷ D24·D25 D34·D35
Quotient
Note: When a user program execution error occurs in any repeat operation, special internal relay M8004 (user program execution error) and the
ERR LED are turned on and maintained while operations for other instructions continues.
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(*) S/D
***** 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.
DEC (Decrement)
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
DEC(*) S/D
***** When input is on, one is subtracted from the 16- or 32-bit data assigned by device S/D and the result is
stored to the same device.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the INC and DEC instructions are executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a word device such as D (data register) is assigned as the source/destination, 1 point (word or integer
I (integer) X data) or 2 points (double-word or long data) are used.
D (double word) X
L (long) X
F (float) —
Example: INC
Example: DEC
ROOT (Root)
Data type W: S1 → D1
ROOT(*) S1 D1
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.
Data type D: S1·S1+1 → D1·D1+1
When input is on, the square root of the device assigned by S1·S1+1 is
extracted and is stored to the destination assigned by D1·D1+1.
The square root is calculated to two decimals, omitting the figures below
the second place of decimals, and multiplied by 100.
Data type F: S1·S1+1 → D1·D1+1
When input is on, the square root of the device assigned by S1·S1+1 is
extracted and is stored to the destination assigned by D1·D1+1.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Binary data — — — — — — X X —
D1 (Destination 1) Destination to store results — — — — — — X — —
For valid device address ranges, see "Device Addresses" on page 2-1.
When F (float) data is selected and source device S1 contains a negative value, a user program execution error will result, turning on special internal
relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the ROOT instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a word device such as D (data register) is assigned as the source or destination, 1 point (word data) or 2
I (integer) — points (double-word or float data) are used.
D (double word) X
L (long) —
F (float) X
Examples: ROOT
ROOT(W) S1 D1
D10 55 D20 741 55 = 7.4161
I0 D10 D20
SUM (Sum)
Calculates the total of assigned data, depending on the calculation option.
SUM(*) S1 S2 D1
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. S2 specifies the
quantity of data blocks.
XOR:
When input is on, N blocks of 16-bit data starting at the device assigned by S1 are
XORed and the result is stored to the device assigned by D1. S2 specifies the quantity of
data blocks.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed.
When F (float) data is selected, only a data register can be designated as S1.
For source S2, 1 word is always used without regard to the data type.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart.
When S2 is 0 or exceeds the correct value range for the selected device, a user program execution error will result, turning on special internal relay
M8004 and ERR LED on the FC6A Series MicroSmart. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Calculation ADD XOR When ADD is selected, all data types can be used.
W (word) X X When XOR is selected, only W (word) data can be used.
I (integer) X —
When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or
D (double word) X —
destination, 1 point (word or integer data) or 2 points (double-word, long, or float data) are used.
L (long) X —
F (float) X —
Not Zero
Overflow Overflow
M8003 1 0 1 0 1 0 1
Examples: SUM
• Data Type: Word
SOTU SUM(W) S1 S2 D1 D0
1
D100·D101
10
I0 ADD D0 4 D100 (0001h) (0000000Ah)
2
D1
(0002h)
3
D2
(0003h)
4
D3
(0004h)
SOTU SUM(W) S1 S2 D1 D0
261
D100
1276
I0 XOR D0 4 D100 (0105h) (04FCh)
758
D1
(02F6h)
775
D2
(0307h)
1032
D3
(0408h)
XOR Operation
D0 (0105h) 0000 0001 0000 0101
D1 (02F6h) 0000 0010 1111 0110
D2 (0307h) 0000 0011 0000 0111
XOR D3 (0408h) 0000 0100 0000 1000
D100 (04FCh) 0000 0100 1111 1100
SOTU SUM(I) S1 S2 D1 D0
–500
D100·D101
–4566
I0 ADD D0 4 D100 (FE0Ch) (FFFFEE2Ah)
25
D1
(0019h)
–4095
D2
(F001h)
4
D3
(0004h)
200000
D2·D3
(00030D40h)
300000
D4·D5
(000493E0h)
400000
D6·D7
(00061A80h)
123456
D2·D3
(0001E240h)
–9876543
D4·D5
(FF694BC1h)
1
D6·D7
(00000001h)
D2·D3 1.56
D4·D5 0.9876
D6·D7 3.5
RNDM (Random)
This instruction is available on upgraded CPU modules with system program version 210
or higher.
• When the data in S1 or S2 is outside the range of 0 to 32,767, the result is a user program execution error.
• When the data specified by S1 is the same value as the data specified by S2 or a larger value, the result is a user program execution error.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
W (word) X When a word device such as D (data register) is designated as the source or destination, 1 point (word) is
I (integer) — used.
D (double word) —
L (long) —
F (float) —
Example: RNDM
S1 · S2 → D1
ANDW(*) S1(R) S2(R) D1(R) REP
***** ***** ***** ** When input is on, 16- or 32-bit data assigned by source devices S1 and S2
are ANDed, bit by bit. The result is set to destination device D1.
S1 + S2 → D1
ORW(*) S1(R) S2(R) D1(R) REP
***** ***** ***** ** When input is on, 16- or 32-bit data assigned by source devices S1 and S2
are ORed, bit by bit. The result is set to destination device D1.
S1 = 1 1 1 0 0 1 S1 S2 D1
0 0 0
S2 = 1 0 0 0 1 1 0 1 1
1 0 1
D1 = 1 1 1 0 1 1
1 1 1
S1 ⊕ S2 → D1
XORW(*) S1(R) S2(R) D1(R) REP
***** ***** ***** ** When input is on, 16- or 32-bit data assigned by source devices S1 and S2
are exclusive ORed, bit by bit. The result is set to destination device D1.
S1 = 1 1 1 0 0 1 S1 S2 D1
0 0 0
S2 = 1 0 0 0 1 1 0 1 1
1 0 1
D1 = 0 1 1 0 1 0
1 1 0
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be assigned as D1. Special internal relays cannot be assigned as D1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as
D1, the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
Since the Boolean computation instructions are executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be
used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) — or destination, 16 points (word data) or 32 points (double-word data) are used. When repeat is assigned for a bit
D (double word) X device, the quantity of device bits increases in 16- or 32-point increments.
L (long) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
F (float) — 1 point (word data) or 2 points (double-word data) are used. When repeat is assigned for a word device, the
quantity of device words increases in 1- or 2-point increments.
Example: XORW
To convert optional output status among a series of 10 output points, use the XORW instruction in combination with 10 internal
relay points.
Q11 Q10 Q7 Q0
This program will invert the status of the shaded outputs on the left from on to
off, and those not shaded from off to on.
10 points
0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1
M17 M10 M7 M0
S
M2 Five internal relays M0, M2, M4, M6, and M10 are set by initialize pulse
special internal relay M8120.
S
M4
S
M6
S
M10 When input I1 is turned on, the XORW instruction is executed to invert
the status of outputs Q0, Q2, Q4, Q6, and Q10.
SOTU XORW(W) S1 – S2 – D1 – REP
I1 M0 Q0 Q0
When only S1 (source) is assigned to repeat, the final result is set to destination device D1.
When only S1 (source) is assigned to repeat, the final result is set to destination device D1·D1+1.
When only D1 (destination) is assigned to repeat, the same result is set to 3 devices starting with D1.
When only D1 (destination) is assigned to repeat, the same result is set to 3 devices starting with D1·D1+1.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination device D1.
When S1 and S2 (source) are assigned to repeat, the final result is set to destination device D1·D1+1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1.
When S1 (source) and D1 (destination) are assigned to repeat, different results are set to 3 devices starting with D1·D1+1.
When all devices are assigned to repeat, different results are set to 3 devices starting with D1.
When all devices are assigned to repeat, different results are set to 3 devices starting with D1·D1+1.
Note: When a user program error occurs in any repeat operation, special internal relay M8004 (user program execution error) and the ERROR LED
are turned on and maintained while operations for other instructions continues. For an advanced instruction that has caused a user program
execution error due to an error in the source devices, results are not set to any destination.
The result is set to source device S1, and the last bit status shifted out is set to
special internal relay M8003 (carry or borrow). Zero or 1 assigned by source
device S2 is set to the LSB.
CY MSB S1 LSB
After shift: 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 0
M8003
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as S1. Special internal relays cannot be designated as S1.
Since the SFTL instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Examples: SFTL
• N_B = 16 bits
SOTU SFTL S1 S2 N_B Bits Each time input I0 is turned on, 16-bit data of data register D10 is
I0 D10 0 16 1 shifted to the left by 1 bit as assigned by device Bits. The last bit
status shifted out is set to special internal relay M8003 (carry or
borrow). Zeros are set to the LSB.
Bits to shift = 1
CY MSB D10 LSB S2
Before shift: D10 = 43690 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
M8003 Shift to the left
• N_B = 32 bits
Bits to shift = 2
Before shift:
CY MSB D11 D10 LSB S2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
M8003 Shift to the left
After shift:
CY MSB D11 D10 LSB
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
M8003
The result is set to source device S1, and the last bit status shifted out is set
to a carry (special internal relay M8003). Zero or 1 assigned by source
device S2 is set to the MSB.
MSB S1 LSB CY
After shift: 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0
M8003
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the SFTR instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Example: SFTR
• Data Type: Word
SOTU SFTR S1 S2 N_B Bits Each time input I0 is turned on, 16-bit data of data register D10
I0 D10 0 16 2 is shifted to the right by 2 bits as assigned by device Bits. The last
bit status shifted out is set to special internal relay M8003 (carry
or borrow). Zeros are set to the MSB.
Bits to shift = 2
MSB D10 LSB CY
Before shift: D10 = 29 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1
Shift to the right M8003
Bits to shift = 1
Before shift:
S2 MSB D11 D10 LSB CY
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Shift to the right M8003
After shift:
MSB D11 D10·D11 D10 LSB CY
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
M8003
After shift: 0 1 2 3 4 5 6 7 0 0
MSD LSD
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed.
Make sure that the source data determined by S1 and S1+1 is between 0 and 9,999 for each data register. If either source data is over 9,999, a user
program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart. When S2 is higher than
7, a user program execution error will also result.
When a user program execution error occurs, the execution of the instruction is canceled. The data in S1 and S1+1 is left unchanged and the next
instruction is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as source S2, 16 points are used.
When a word device such as T (timer), C (counter), or D (data register) is assigned as source S2, 1 point is used.
Example: BCDLS
M8120 is the initialize pulse special internal relay.
MOV(W) S1 – D1 – REP When the CPU starts operation, the MOV (move) instructions set 123 and 4,567 to
M8120 123 D10
data registers D10 and D11, respectively.
MOV(W) S1 – D1 – REP Each time input I0 is turned on, the 32-bit binary data of data registers D10 and D11
4567 D11 assigned by S1 is converted into 8 BCD digits, shifted to the left by 1 digit as assigned
by device S2, and converted back to 32-bit binary data.
SOTU BCDLS S1 S2
I0 D10 1 Zero is set to the lowest digit after each shift.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is displayed.
When a word device such as T (timer), C (counter), or D (data register) is assigned as source S1 or S2, 1 point is used.
Example: WSFT
CY MSB S1 LSB
After rotation: 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 1
M8003
After rotation:
CY MSB S1 LSB
1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 1
M8003
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as S1. Special internal relays cannot be designated as S1.
The quantity of bits to rotate can be 1 through 15 for word data, or 1 through 31 for double-word data.
Since the ROTL instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as Q (output), M (internal relay), or R (shift register) is assigned as the source, 16 points
I (integer) — (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as D (data register) is assigned as the source, 1 point (word data) or 2 points (double-
L (long) — word data) are used.
F (float) —
Example: ROTL
• Data Type: Word
The status of the MSB is set to special internal relay M8003 (carry or borrow).
Bits to rotate = 1
CY MSB D10 LSB
Before rotation: D10 = 40966 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0
M8003
Each time input I1 is turned on, 32-bit data of data registers D10 and D11 is rotated to
SOTU ROTL(D) S1 bits the left by 1 bit as assigned by device bits.
I1 D10 1
The status of the MSB is set to special internal relay M8003 (carry or borrow).
Bits to rotate = 1
MSB S1 LSB CY
After rotation: 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0
M8003
After rotation:
MSB S1 LSB CY
0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0
M8003
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as S1. Special internal relays cannot be designated as S1.
The number of bits that can be rotated is 1 through 15 for word data, or 1 through 31 for double-word data.
Since the ROTR instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as Q (output), M (internal relay), or R (shift register) is assigned as the source, 16 points
I (integer) — (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as D (data register) is assigned as the source, 1 point (word data) or 2 points (double-
L (long) — word data) are used.
F (float) —
Example: ROTR
• Data Type: Word
SOTU ROTR(W) S1 bits Each time input I1 is turned on, 16-bit data of data register D20 is rotated to the right by
I1 D20 2 2 bits as assigned by device bits.
The last bit status rotated out is set to special internal relay M8003 (carry or borrow).
Bits to rotate = 2
MSB D20 LSB CY
Before rotation: D20 = 13 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
M8003
Each time input I1 is turned on, 32-bit data of data registers D20 and D21 is rotated to
SOTU ROTR(D) S1 bits the right by 1 bit as assigned by device bits.
I1 D20 1
The last bit status rotated out is set to special internal relay M8003 (carry or borrow).
Bits to rotate = 1
Valid values for the source device are 0 through 9,999 for word data, and 0 through 99,999,999
for double-word data.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
When the data type is W (word), the valid range of S1 (binary data) is 0 to 9,999.
When the data type is D (double word), the valid range of S1 (binary data) is 0 to 99,999,999.
Make sure that the source designated by S1 is within the valid value range. If the source data exceeds the valid range, a user program execution
error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the HTOB instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — 16 points (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, 1 point (word
L (long) — data) or 2 points (double-word data) are used.
F (float) —
Examples: HTOB
• Data Type: Word
Binary BCD
SOTU HTOB(W) S1 D1
D10 D20 0 0
I1 D10 D20
(0000h) (0000h)
1234 4660
D10 D20
(04D2h) (1234h)
9999 39321
D10 D20
(270Fh) (9999h)
Binary BCD
SOTU HTOB(D) S1 D1
D10 D20 0 0
I2 D10 D20
(0000h) (0000h)
0 0
D11 D21
(0000h) (0000h)
188 4660
D10 D20
(00BCh) (1234h)
24910 22136
D11 D21
(614Eh) (5678h)
1525 39321
D10 D20
(05F5h) (9999h)
57599 39321
D11 D21
(E0FFh) (9999h)
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.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
When the data type is W (word), the valid range of S1 (BCD data) is 0 to 9,999.
When the data type is D (double word), the valid range of S1 (BCD data) is 0 to 99,999,999.
Make sure that each digit of the source designated by S1 is 0 through 9. If the source data exceeds the valid range, a user program execution error
will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the BTOH instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — 16 points (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, 1 point (word
L (long) — data) or 2 points (double-word data) are used.
F (float) —
Examples: BTOH
• Data Type: Word
BCD Binary
SOTU BTOH(W) S1 D1
D10 D20 0 0
I1 D10 D20
(0000h) (0000h)
4660 1234
D10 D20
(1234h) (04D2h)
39321 9999
D10 D20
(9999h) (270Fh)
BCD Binary
SOTU BTOH(D) S1 D1
D10 D20 0 0
I2 D10 D20
(0000h) (0000h)
0 0
D11 D21
(0000h) (0000h)
4660 188
D10 D20
(1234h) (00BCh)
22136 24910
D11 D21
(5678h) (614Eh)
39321 1525
D10 D20
(9999h) (05F5h)
39321 57599
D11 D21
(9999h) (E0FFh)
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is displayed.
Make sure that the quantity of digits designated by S2 is within the valid range. If the S2 data exceeds the valid range, a user program execution
error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the HTOA instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — 16 points (word data) are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) — 1 point (word data) is used.
F (float) —
Examples: HTOA
• Quantity of Digits: 4
Binary ASCII
50
D21
(0032h)
51
D22
(0033h)
52
D23
(0034h)
• Quantity of Digits: 3
Binary ASCII
51
D21
(0033h)
52
D22
(0034h)
• Quantity of Digits: 2
Binary ASCII
52
D21
(0034h)
• Quantity of Digits: 1
Binary ASCII
Valid values for source data to convert are 30h to 39h and 41h to 46h.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
Valid values for source S1 data to convert are 30h to 39h and 41h to 46h. Make sure that the values for each source designated by S1 and the
quantity of digits designated by S2 are within the valid range. If the S1 or S2 data exceeds the valid range, a user program execution error will
result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the ATOH instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) — or destination, 16 points (word data) are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) — 1 point (word data) is used.
F (float) —
Examples: ATOH
• Quantity of Digits: 4
ASCII Binary
50
D11
(0032h)
51
D12
(0033h)
52
D13
(0034h)
• Quantity of Digits: 3
ASCII Binary
50
D11
(0032h)
51
D12
(0033h)
• Quantity of Digits: 2
ASCII Binary
SOTU ATOH(W) S1 S2 D1 49 18
D10 2 D20 D10 D20
I2 (0031h) (0012h)
50
D11
(0032h)
• Quantity of Digits: 1
ASCII Binary
SOTU ATOH(W) S1 S2 D1 49 1
D10 1 D20 D10 D20
I3 (0031h) (0001h)
The number of digits that can be converted is 1 through 5 for word data, and 1
through 10 for double-word data.
Valid Devices
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value (TC or CC) is displayed.
When the data type is W (word), the valid range of S2 (quantity of digits to convert) is 1 to 5.
When the data type is D (double word), the valid range of S2 (quantity of digits to convert) is 1 to 10.
Make sure that the quantity of digits designated by S2 is within the valid range. If the S2 data exceeds the valid range, a user program execution
error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
Make sure that the last destination data determined by D1+S2-1 is within the valid device range. If the derived destination device exceeds the valid
device range, a user program execution error will result, turning on special internal relay M8004 and ERROR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the BTOA instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — 16 points (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) — 1 point (word data) or 2 points (double-word data) are used.
F (float) —
Examples: BTOA(W)
• Quantity of Digits: 5
BCD
Binary ASCII
SOTU BTOA(W) S1 S2 D1
D10 5 D20 12345 49
I0 D10 D20
(3039h) (0031h)
50
D21
(0032h)
51
D22
(0033h)
52
D23
(0034h)
53
D24
(0035h)
• Quantity of Digits: 4
BCD
Binary ASCII
SOTU BTOA(W) S1 S2 D1
D10 4 D20 12345 50
I1 D10 D20
(3039h) (0032h)
51
D21
(0033h)
52
D22
(0034h)
53
D23
(0035h)
• Quantity of Digits: 3
BCD
Binary ASCII
SOTU BTOA(W) S1 S2 D1
D10 3 D20 12345 51
I2 D10 D20
(3039h) (0033h)
52
D21
(0034h)
53
D22
(0035h)
• Quantity of Digits: 2
BCD
Binary ASCII
SOTU BTOA(W) S1 S2 D1
D10 2 D20 12345 52
I3 D10 D20
(3039h) (0034h)
53
D21
(0035h)
• Quantity of Digits: 1
BCD
Binary ASCII
SOTU BTOA(W) S1 S2 D1
D10 1 D20 12345 53
I4 D10 D20
(3039h) (0035h)
Examples: BTOA(D)
• Quantity of Digits: 10
BCD
Binary ASCII
SOTU BTOA(D) S1 S2 D1
D10 10 D20 1234567890 49
I0 D10·D11 D20
(499602D2h) (0031h)
50
D21
(0032h)
51
D22
(0033h)
52
D23
(0034h)
53
D24
(0035h)
54
D25
(0036h)
55
D26
(0037h)
56
D27
(0038h)
57
D28
(0039h)
48
D29
(0030h)
• Quantity of Digits: 6
BCD
Binary ASCII
SOTU BTOA(D) S1 S2 D1
D10 6 D20 1234567890 53
I1 D10·D11 D20
(499602D2h) (0035h)
54
D21
(0036h)
55
D22
(0037h)
56
D23
(0038h)
57
D24
(0039h)
48
D25
(0030h)
• Quantity of Digits: 3
BCD
Binary ASCII
SOTU BTOA(D) S1 S2 D1
D10 3 D20 1234567890 56
I2 D10·D11 D20
(499602D2h) (0038h)
57
D21
(0039h)
48
D22
(0030h)
Valid values for source data to convert are 30h through 39h.
The number of digits that can be converted is through 5 for word data, and 1 through
10 for double-word data.
Valid Devices
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP).
Valid values for source S1 data to convert are 30h through 39h. When the data type is W (word), the valid range of S2 (quantity of digits to convert)
is 1 to 5.
When the data type is D (double word), the valid range of S2 (quantity of digits to convert) is 1 to 10.
Make sure that the values for each source designated by S1 and the quantity of digits designated by S2 are within the valid range. If the S1 or S2
data exceeds the valid range, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series
MicroSmart.
Make sure that the last source data determined by S1+S2-1 is within the valid device range. If the derived source device exceeds the valid device
range, a user program execution error will result, turning on special internal relay M8004 and ERROR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the ATOB instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) — or destination, 16 points (word data) or 32 points (double-word data) are used.
D (double word) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) — 1 point (word data) or 2 points (double-word data) are used.
F (float) —
Examples: ATOB(W)
• Quantity of Digits: 5
BCD
ASCII Binary
SOTU ATOB(W) S1 S2 D1
D10 5 D20 49 12345
I0 D10 D20
(0031h) (3039h)
50
D11
(0032h)
51
D12
(0033h)
52
D13
(0034h)
53
D14
(0035h)
• Quantity of Digits: 4
BCD
ASCII Binary
SOTU ATOB(W) S1 S2 D1
D10 4 D20 49 1234
I1 D10 D20
(0031h) (04D2h)
50
D11
(0032h)
51
D12
(0033h)
52
D13
(0034h)
• Quantity of Digits: 3
BCD
ASCII Binary
SOTU ATOB(W) S1 S2 D1
D10 3 D20 49 123
I2 D10 D20
(0031h) (007Bh)
50
D11
(0032h)
51
D12
(0033h)
• Quantity of Digits: 2
BCD
ASCII Binary
SOTU ATOB(W) S1 S2 D1
D10 2 D20 49 12
I3 D10 D20
(0031h) (0018h)
50
D11
(0032h)
• Quantity of Digits: 1
BCD
ASCII Binary
SOTU ATOB(W) S1 S2 D1
D10 1 D20 49 1
I4 D10 D20
(0031h) (0001h)
Examples: ATOB(D)
• Quantity of Digits: 10
BCD
ASCII Binary
SOTU ATOB(D) S1 S2 D1
D10 10 D20 49 1234567890
I0 D10 D20·D21
(0031h) (499602D2h)
50
D11
(0032h)
51
D12
(0033h)
52
D13
(0034h)
53
D14
(0035h)
54
D15
(0036h)
55
D16
(0037h)
56
D17
(0038h)
57
D18
(0039h)
48
D19
(0030h)
• Quantity of Digits: 6
BCD
ASCII Binary
SOTU ATOB(D) S1 S2 D1
D10 6 D20 49 123456
I1 D10 D20·D21
(0031h) (0001E240h)
50
D11
(0032h)
51
D12
(0033h)
52
D13
(0034h)
53
D14
(0035h)
54
D15
(0036h)
• Quantity of Digits: 3
BCD
ASCII Binary
SOTU ATOB(D) S1 S2 D1
D10 3 D20 49 123
I2 D10 D20·D21
(0031h) (0000007Bh)
50
D11
(0032h)
51
D12
(0033h)
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 S1 D1 the first set (on) point is located. The number of points from S1 to the first set point (offset) is
Bits ***** ***** stored to the destination assigned by device D1.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
Make sure that the search area designated by S1 plus Bits is within the valid value range. If the source data exceeds the valid range, a user program
execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the ENCO instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Examples: ENCO
When input I0 is on, a search begins for a bit that is set on in an array of 64 bits starting at
ENCO S1 D1 internal relay M4 assigned by device S1.
I0 64 M4 D100
Since internal relay M30 is the first point that is on, the offset from the first search point is 20,
and 20 is stored to data register D100 assigned by device D1.
M17 M0
M37 M20 D100 20
M57 M40
M77 M60 ON
M97 M80
M117 M100 Searched area
When input I1 is on, a search begins for a bit that is set on in an array of 64 bits starting at bit
ENCO S1 D1 0 of data register D10 assigned by device S1.
I1 64 D10 D100
Since bit 8 of data register D11 is the first point that is on, the offset from the first search point
is 24, and 24 is stored to data register D100 assigned by device D1.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D10
D11 D100 24
D12
D13 ON
D14
D15 Searched area
DECO (Decode)
When input is on, the values contained in devices assigned by S1 and D1 are added together to
DECO S1 D1 determine the destination, and the bit is then turned on.
***** *****
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
Valid values for the offset designated by source device S1 are 0 through 255. Make sure that the offset designated by S1 and the last bit of
destination data determined by the sum of S1 and D1 are within the valid value range. If the offset or destination data exceeds the valid range, a
user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the DECO instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Examples: DECO
When input I0 is on, the destination bit is determined by adding the value contained in data
DECO S1 D1 register D20 assigned by device S1 to internal relay M104 assigned by destination device D1.
I0 D20 M104
Since the 19th bit from internal relay M104 is internal relay M127, the bit is then turned on.
M117 M100
D20 19 M137 M120
M157 M140
First bit M177 M160
M197 M180
ON M217 M200
When input I1 is on, the destination bit is determined by adding the value contained in data
DECO S1 D1 register D10 assigned by device S1 to data register D30 assigned by destination device D1.
I1 D10 D30
Since the 39th bit from data register D30 bit 0 is data register D32 bit 7, the bit is then turned
on.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D30
D10 39 D31
D32
D33
ON
D34
D35
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) First bit to start search X X X X — — X — —
S2 (Source 2) Quantity of bits searched X X X X X X X X —
D1 (Destination 1) Destination to store quantity of ON bits — X X X X X — —
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7977 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
The valid range of S2 (quantity of bits searched) is 1 to 256. Make sure that the search area designated by S1 plus S2 is within the valid value range.
If the source data exceeds the valid range, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on
the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the BCNT instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Examples: BCNT
When input is on, a search begins for the total number of bits that are on in an array
BCNT S1 S2 D1 of 64 bits starting at internal relay M4 assigned by source device S1.
I0 M4 64 D100
Since 3 bits are on in the searched area, the quantity is stored to data register D100
assigned by destination device D1.
M17 M0
M37 M20 D100 3
M57 M40
M77 M60 ON
M97 M80
M117 M100 Searched area
When input I0 is on, a search begins for the total number of bits that are on in an
BNCT S1 S2 D1 array of 60 bits starting at bit 0 of data register D10 assigned by device S1.
I1 D10 60 D100
Since 2 bits are on among the 60 bits, 2 is stored to data register D100 assigned by
device D1.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D10
D11 D100 2
D12
D13 ON
D14
D15 Searched area
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.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the ALT instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction must be used. For the SOTU
instruction and the SOTD instruction, see "SOTU and SOTD (Single Output Up and Down)" on page 4-26.
Example: ALT
When input I0 is turned on, output Q0 assigned by device D1 is turned on and remains after input
SOTU ALT D1 I0 is turned off.
I0 Q0
When input I0 is turned on again, output Q0 is turned off.
ON
Input I0
OFF
ON
Output Q0
OFF
S1 → D1
CVDT S1(R) D1(R) REP When input is on, the data type of the 16- or 32-bit data assigned by S1 is converted and
*TO* ***** ***** ** stored to the destination assigned by device D1.
Data types can be assigned for the source and destination, separately
Data Type W, I D, L, F
Source S1 S1·S1+1
Destination D1 D1·D1+1
When the same data type is assigned for both source and destination, the CVDT
instruction has the same function as the MOV instruction.
Unless F (float) data is selected for both source and destination, only the integral number
is moved, omitting the fraction.
When the source data exceeds the range of destination data, the destination stores a
value closest to the source data within the destination data.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source
I (integer) X or destination, 16 points (word or integer data) or 32 points (double-word, long, or float data) are used. When
D (double word) X repeat is assigned for a bit device, the quantity of device bits increases in 16- or 32-point increments.
L (long) X When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
F (float) X 1 point (word or integer data) or 2 points (double-word, long, or float data) are used. When repeat is assigned for
a word device, the quantity of device words increases in 1- or 2-point increments.
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.
S1 D1
D0·D1 3.141593 D2 3
When the source data exceeds the range of destination data type, the destination stores a value closest to the source data within the destination
data type.
.
S1 D1
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed.
Destination device D1 uses 2 data registers starting with the device assigned by D1.
Since the DTDV instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
I (integer) — 16 points (word data) are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) — 1 point (word data) is used.
F (float) —
Example: DTDV
Before Execution After Execution
SOTU DTDV(W) S1 D1
D10 D20 12345 48 Upper byte
I1 D10 D20
(3039h) (30h)
57
D21 Lower byte
(39h)
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as D1, the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
Source device S1 uses 2 data registers starting with the device assigned by S1.
Since the DTCB instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the
I (integer) — destination, 16 points (word data) are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,
L (long) — 1 point (word data) is used.
F (float) —
Example: DTCB
Before Execution After Execution
SOTU DTCB(W) S1 D1
D10 D20 48 Upper byte 12345
I1 D10 D20
(0030h) (3039h)
57
D11 Lower byte
(0039h)
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the SWAP instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a D (data register) is assigned as the source or destination, 1 point (word data) or 2 points (double-word
I (integer) — data) are used. When repeat is assigned, the quantity of device words increases in 1- or 2-point increments.
D (double word) X
L (long) —
F (float) —
Examples: SWAP
• Data Type: W (word)
When input I0 is turned on, upper- and lower-byte data of the 16-bit data in data register D10 assigned by source device S1 are exchanged, and the
result is stored to data register D20 assigned by destination device D1.
When input I1 is turned on, upper- and lower-word data of the 32-bit data in data registers D10 and D11 assigned by source device S1 are
exchanged, and the result is stored to data registers D20 and D21 assigned by destination device D1.
Note: The WKTIM instruction is compatible with the FC5A Series MicroSmart WKTIM instruction. For details on the WKTIM instruction, see
Chapter 9 "WKTIM (Week Timer)" in the "FC5A Series MicroSmart Pentra User's Manual Advanced Volume".
Note: The WKTBL instruction is compatible with the FC5A Series MicroSmart WKTBL instruction. For details on the WKTBL instruction, see
Chapter 9 "WKTBL (Week Table)" in the "FC5A Series MicroSmart Pentra User's Manual Advanced Volume".
WEEK S1 S2 S3 D1
Note: For details on the WEEK instruction, see "WEEK (Weekly Timer)" on page 11-3.
Note: For details on the YEAR instruction, see "YEAR (Yearly Timer)" on page 11-16.
When the input is on, the output specified by D1 is turned on when the day of the
***** ***** ***** *****
week and the time specified by the ON settings match the current day of the
week and time.
The output specified by D1 is also turned off when the day of the week and the
time specified by the OFF settings match the current day of the week and time.
If the ON settings are Monday 13:00 and the OFF settings are Wednesday 18:00, output D1 turns on and off as follows.
When the WEEK instruction input is ON on Monday 13:00, output D1 turns ON on Monday 13:00 and it turns OFF on Wednesday
18:00.
(In this diagram the WEEK instruction input is turned on at 0:00 on Monday)
Day of the week Sunday Monday Tuesday Wednesday Thursday Friday Saturday
0:00 13:00 18:00
Time
ON
Input M0000
OFF
ON
Output Q0
OFF
ON settings Day of the week : Monday OFF settings Day of the week : Wednesday
Time : 13:00 Time : 18:00
Notes:
• A maximum of 10 WEEK instructions can be used in a user program.
• Normally the output is only updated when the current time and the time for the ON/OFF settings matches, but when the WEEK instruction input
changes from off to on, the output state at the current time is determined according to the ON/OFF settings and the output is turned on or off.
For details, see "Timing Chart when the Input Turns On during the Configured Interval" on page 11-10.
• When pulse output is enabled, output is turned on for one scan at the ON settings time. For pulse output, see "6. Pulse Output" on page 11-
5 or "6. Pulse Output" on page 11-8.
• When the ON time is set to a value larger than 2,359, the OFF time is set to a value larger than 2,400, or the lower 2 digits of ON/OFF time
is set to a value larger than 59, a user program execution error will occur.
• When the day of the week is not specified, a user program execution error will occur.
• The WEEK 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" on page 3-10.
Valid Devices
Special data registers cannot be designated as S1. Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1.
Special internal relays cannot be designated as D1.
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. The day of the week and the time for
the ON/OFF settings cannot be changed while the FC6A Series MicroSmart is running. For details, see "To configure the day
of the week and the time as fixed settings" on page 11-4.
• Configuring the day 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. The day of the week and the time for the ON/OFF settings can be changed while the FC6A Series MicroSmart is
running. For details, see "To configure the days of the week and the time by specifying data registers" on page 11-7.
To configure 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. The day of the week and the time for
the ON/OFF settings cannot be changed while the FC6A Series MicroSmart is running.
• Devices tab
1.
2. 3. 5.
6. 4.
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.
Comment Shows the comment for the device address. This item can be edited.
6. Pulse Output
This setting configures the operation for D1 (output). This setting is applied to all parameter tabs.
When the day of the week and the time configured in the ON settings matches the current day of the week and the time, the
output is turned on for only one scan.
The output is turned on and off according to the ON settings and the OFF settings.
• Parameter tab
This tab configures the ON/OFF settings for the output. A maximum of 20 parameter tabs can be configured for one WEEK
instruction.
1.
2.
1. ON settings
This section configures the day of the week and the time to turn on the output. The output is turned on at the specified time for
the specified day of the week.
2. OFF settings
This section configures the day of the week and the time to turn off the output. The output is turned off at the specified time for
the specified day of the week.
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. In this situation, the output is on from 8:00 to 10:00.
ON
Output D1
OFF
If ON time is 9:00 and OFF time is 10:00 on the P 1 tab and ON time is 8:00 and OFF time is 9:00 on the P 2 tab, the 9:00 setting is duplicated
on the two tabs and ON time for the P 1 tab is disabled. In this situation, the output is on from 8:00 to 9:00.
Time 7 00 8 00 9 00 10 00 11 00
ON
Output D1
OFF
• Preview
The preview shows the ON/OFF state for the output based on the settings configured on the parameter tabs as a time chart.
The preview can be shown as a week or a day.
Setting Description
Week Select this radio button when showing the preview as a week.
Day Select this radio button when showing the preview as a day.
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. The day of the week and the time for the ON/OFF settings can be changed while the FC6A Series MicroSmart is running.
Note: When the day of the week or time in the ON/OFF settings is modified with the WEEK instruction input turned on, it is not reflected in the
output operation until the current day of the week and time match the day of the week and time in the changed ON/OFF settings.
To immediately reflect this in the output operation, turn the WEEK instruction off and then on again after changing the day of the week or time.
• Devices tab
1.
2. 3. 5.
6. 4.
7.
Note: When this check box is not selected, the day of the week and the time are fixed settings. The day of the week and the time are
configured on the parameter tabs. The day of the week and the time cannot be changed while the FC6A Series MicroSmart is running. For
fixed settings, see "To configure the day of the week and the time as fixed settings" on page 11-4.
Setting 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.
Shows the range of data registers used to store the settings. This item changes when the device address or the
Used Data Registers
number of parameter tabs changes.
Comment Shows the comment for the device address. This item can be edited.
For allocating the data register region, see "Parameter tab" on page 11-8.
6. Pulse Output
This setting configures the operation for D1 (output). This setting is applied to all parameter tabs and is shared in common
with "To configure the day of the week and the time as fixed settings". See "6. Pulse Output" on page 11-5.
8.
9.
• Parameter tab
This tab configures the ON/OFF settings for the output. A maximum of 20 parameter tabs can be configured for 1 WEEK
instruction.
If indirectly specifying the settings for the WEEK instruction with data registers, the settings configured on the parameter tabs are
stored in the data registers when the initialization input is turned on.
This setting is shared in common with "To configure the day of the week and the time as fixed settings". See "Parameter tab" on
page 11-5.
• Preview
The preview shows the ON/OFF state for the output based on the settings configured on the parameter tabs as a time chart.
This function is shared in common with "To configure the day of the week and the time as fixed settings". See "Preview" on page
11-6.
Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday
Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday
Day of the week setting (ON): 0000010
Day of the week setting (OFF): 0100000
The value of the data register is 1000100000 (binary) = 544 (decimal).
[To configure the output to turn on Monday and Thursday and to turn off Tuesday and Saturday]
Monday and Thursday are enabled in the ON settings, Tuesday and Saturday are enabled in the OFF settings
Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday
Day of the week setting (ON): 0010010
Day of the week setting (OFF): 1000100
The value of the data register is 1001001000100 (binary) = 4676 (decimal).
The ON time and the OFF time are stored in the data register as follows.
12:34 23:45
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.
Setting details
ON
Monday 13:00
Settings
OFF
Wednesday 18:00
Settings
Output Q0
[When the input is on before the day of the week and time specified by the ON settings]
On Monday at 0:00 when input M0000 is turned on, the result of the current date compared with the ON and OFF settings is not
within the ON and OFF settings (Monday 13:00 to Wednesday 18:00). Therefore, the output remains off.
Afterward, on Monday at 13:00, output Q0 turns on, and it turns off on Wednesday at 18:00.
Day of the week Sunday Monday Tuesday Wednesday Thursday Friday Saturday
0:00 13:00 18:00
Time
ON
Input M0000
OFF
ON
Output Q0
OFF
ON settings Day of the week : Monday OFF settings Day of the week : Wednesday
Time : 13:00 Time : 18:00
[When the input is turned on or off during the interval between the ON and OFF settings]
On Tuesday at 6:00 when input M0000 is turned on, the result of the current date compared with the ON and OFF settings is
within the ON and OFF settings (Monday 13:00 to Wednesday 18:00). Therefore, the output turns on. Afterward, if input M0000
is turned off before the OFF settings, the output also turns off at the same time.
Day of the week Sunday Monday Tuesday Wednesday Thursday Friday Saturday
13:00 6:00 15:00 18:00
Time
ON
Input M0000
OFF
ON
Output Q0
OFF
ON settings Day of the week : Monday OFF settings Day of the week : Wednesday
Time : 13:00 Time : 18:00
Setting details
ON settings Sunday 0:00
Output Q0
[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.
ON
Input M0000
OFF
1 scan
ON
Output Q0
OFF
[When the input turns on during the day of the week and time specified by the ON settings]
On Sunday at 0:00:30 (between Sunday 0:00:00 and 0:00:59), when input M0000 changes from off to on, output Q1 turns on
for one scan only.
ON
Input M0000
OFF
1 scan
ON
Output Q0
OFF
Examples: WEEK
[To turn on output Q0 Monday to Friday each week from 8:30 to 17:15]
Parameter tab
WEEK S1 S2 S3 D1
1 Q0
M8125
[To turn on output Q0 Tuesday, Wednesday, and Saturday each week from 20:30 to 1:15 the next day]
Parameter tab
WEEK S1 S2 S3 D1
1 Q0
M8125
[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.
On P 3 tab, configure the output to turn on Monday, Wednesday, and Friday from 22:00 to 0:00 the next day.
WEEK S1 S2 S3 D1
3 Q0
M8125
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
SOTU
M1
When the input is on, the output specified by D1 is turned on when the date
specified by the ON settings matches the current date.
The output is turned off when the date specified by the OFF settings matches the
current date.
When the ON settings are December 15, 2012 and the OFF settings are January
20, 2013, output D1 turns on and off as follows.
ON
Output D1
OFF
Notes:
• A maximum of 10 YEAR instructions can be used in a user program.
• Normally the output is only updated when the current date and the date for the ON/OFF settings matches, but when the YEAR instruction
input changes from off to on, the output state at the current date is determined according to the ON/OFF settings and the output is turned on
or off.
For details, see "Timing Chart when the Input Turns On during the Configured Interval" on page 11-25.
• When pulse output is enabled, output is turned on for one scan at the instant (0:00) the date changes to the ON date.
When the YEAR instruction input changes from off to on, the output state at the current date is judged according to the ON/OFF settings, and
the output is turned on for 1 scan only.
For pulse output, see "6. Pulse Output" on page 11-18 or "6. Pulse Output" on page 11-22.
• When the year data is outside the range of 2000 to 2099, the month data is outside the range of 1 to 12, the day data is outside the range of
1 to 31, the week data is outside the range of 1 to 5, and the day of the week data is outside the range of 0 to 6, a user program execution
error will occur.
• When the yearly setting or monthly setting is enabled and a date that does not exist according to the month or year is set for the ON setting
or the OFF setting, the output turns on or off on the first day of the next month.
Valid Devices
Special data registers cannot be designated as S1. Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1.
Special internal relays cannot be designated as D1.
Settings
There are two methods to configure dates for the YEAR instruction. Specify the method on the Devices tab with Data register
settings.
• Devices tab
1.
2. 3. 5.
6. 4.
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.
Comment Shows the comment for the device address. This item can be edited.
6. Pulse Output
This setting configures the operation for D1 (output). This setting is applied to all parameter tabs.
Selected check box
When the current date changes to the date in the ON settings, the output is turned on for only one scan.
Unselected check box
The output is turned on and off according to the ON settings and the OFF settings.
• Parameter tab
This tab configures the settings for the output. A maximum of 20 parameter tabs can be configured for 1 YEAR instruction.
1. 2.
3.
4.
1. Yearly
When Yearly is selected, the Month and Day settings are valid every year.
At this time, you can configure whether or not to make the Month and Day settings valid yearly from a year until another
year with Year.
2. Monthly
The settings for the selected tab are valid each month. At this time, Month is disabled.
3. ON settings
This section configures the date to turn on the output. The output is turned on at 0:00 on the configured date.
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.
Note: When the date is duplicated in the settings on other tabs, the settings on the tab with the larger tab number are valid.
For example, if the ON date is the 8th of every month and the OFF date is the 16th of every month on the P 1 tab and the ON date is the 16th of
every month and the OFF date is the 22nd of every month on the P 2 tab, the 16th of every month setting is duplicated on the two tabs and the ON
settings for the P 2 tab are valid. In this situation, the output is on from the 8th to the 22nd of every month.
Month
Year
ON date OFF date
8th of 16th of
P 1 tab settings every month every month
Output D1
If the ON date is the 16th of every month and the OFF date is the 22nd of every month on the P 1 tab and the ON date is the 8th of every month
and the OFF date is the 16th of every month on the P 2 tab, the 16th of every month setting is duplicated on the two tabs and the ON settings for
the P 1 tab are disabled. In this situation, the output is on from the 8th to the 16th of every month.
Month
Year
ON date OFF date
16th of 22nd of
P 1 tab settings
every month every month
Output D1
• 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 Specifies the year to show in the preview.
Scrollbar You can change the month shown in the preview by moving the scrollbar.
• Devices tab
1.
2. 3. 5.
6. 4.
7.
Setting 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.
Shows the range of data registers used to store the settings. This item changes when the device address or the number
Used Data Registers
of parameter tabs changes.
Comment Shows the comment for the device address. This item can be edited.
For allocating the data register region, see "Data Register Allocation" on page 11-23.
6. Pulse Output
This setting configures the operation for D1 (output). This setting is applied to all parameter tabs.
This setting is shared in common with "To configure the dates as a fixed setting". See "6. Pulse Output" on page 11-18.
8.
9.
• Parameter tab
This tab configures the settings for the output. A maximum of 20 parameter tabs can be configured for 1 YEAR instruction.
If indirectly specifying the settings for the YEAR instruction with data registers, the settings configured on the parameter tabs are
stored in the data registers when the initialization input is turned on.
This setting is shared in common with "To configure the dates as a fixed setting". See "Parameter tab" on page 11-18.
• Preview
The preview shows the ON/OFF state for the output based on the settings configured on the parameter tabs in a calendar.
This function is shared in common with "To configure the dates as a fixed setting". See "Preview" on page 11-20.
Reserved Month setting Reserved Week setting Day of the week setting
January to December
January 1st
Reserved Month setting Reserved Day setting
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
Month setting: 0001 = 1
Day setting: 00001 = 1
The value of the data register is 100000001 (binary) = 257 (decimal).
December 31st
Reserved Month setting Reserved Day setting
0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 1
Month setting: 1100 = 12
Day setting: 11111 = 31
The value of the data register is 110000011111 (binary) = 3103 (decimal).
0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1
Month setting: 0001 = 1 (January)
Week setting: 001 = 1 (1st)
Day of the week setting: 001 = 1 (Monday)
The value of the data register is 100001001 (binary) = 265 (decimal).
0 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0
Month setting: 0110 = 6 (June)
Week setting: 100 = 4 (4th)
Day of the week setting: 100 = 4 (Thursday)
The value of the data register is 11000100100 (binary) = 1572 (decimal).
Final
Reserved Month setting Reserved Week setting Day of the week setting
Bit Bit Bit Bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 1 1 0 0 1 1 0 0 1 0 0
Month setting: 0110 = 6 (June)
Week setting: 110 = 6 (final)
Day of the week setting: 100 = 4 (Thursday)
The value of the data register is 11000110100 (binary) = 1588 (decimal).
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.
Settings
ON settings February 15, 2012
YEAR S1 S2 S3 D1
OFF settings February 17, 2012
1 Q0
Output port Q0 M0000
On February 13, 2012, when the input is turned on, the result of the current date compared with the ON and OFF settings is not
within the ON and OFF settings (February 15 to February 17, 2012). Therefore, the output remains off.
February 2012
Current date 13th 14th 15th 16th 17th
ON
Input M0000
OFF
ON
Output Q0
OFF
[When the input is turned on or off during the interval between the ON and OFF settings]
On February 15, 2012, when the input is turned on, the result of the current date compared with the ON and OFF settings is within
the ON and OFF settings (February 15 to February 17, 2012). Therefore, the output turns on. The output turns off when the input
is turned off.
On February 16, 2012, when the input is turned on, the result of the current date compared with the ON and OFF settings is that
the output is turned on.
February 2012
Current date 13th 14th 15th 16th 17th
ON
Input M0000
OFF
ON
Output Q0
OFF
Settings
P 1 tab ON settings July 2, 2012
YEAR S1 S2 S3 D1
P 2 tab ON settings July 4, 2012
2 Q0
Output port Q0 M0000
[When the input turns on before the day specified by the ON settings]
The result of the input being determined at 0:00 on July 2, 2012 is to turn on the output for one scan.
The result of the input being determined at 0:00 on July 4, 2012 is to turn on the output for one scan.
July 2012
Current date 1st 2nd 3rd 4th 5th
ON
Input M0000
OFF
ON
Output Q0
OFF
P 1 tab P 2 tab
ON settings ON settings
[When the input turns on exactly on the day specified by the ON settings]
When the input turns on at 0:00 on July 2, 2012, the output turns on for one scan.
When the input turns on after 0:00 on July 4, 2012, the output turns on for one scan.
July 2012
Current date 1st 2nd 3rd 4th 5th
ON
Input M0000
OFF
ON
Output Q0
OFF
P 1 tab P 2 tab
ON settings ON settings
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]
Yearly : OFF
9/1 6/25
Monthly : OFF
Parameter tab
YEAR S1 S2 S3 D1
1 Q0
M8125
[To turn on output Q0 from 0:00 on August 12 to 0:00 on August 15 every year]
Yearly : ON
8/12 8/15 8/12 8/15 8/12 8/15 8/12 8/15
Monthly : OFF
Parameter tab
YEAR S1 S2 S3 D1
1 Q0
M8125
[To turn on output Q0 only on the 2nd Monday of each month from 2000 to 2099]
Yearly : ON
2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd
Monthly : ON Monday Monday Monday Monday Monday Monday Monday Monday
+ + + +
1 day 1 day 1 day 1 day
Parameter tab
YEAR S1 S2 S3 D1
1 Q0
M8125
[To turn on output Q0 on the last day of every month between 2013 and 2020]
Parameter tab
YEAR S1 S2 S3 D1
1 Q0
M8125
[To turn on M100 from 0:00 on September 1, 2011, to 0:00 on June 25, 2013]
Yearly : OFF
9/1 6/25
Monthly : OFF
MOV(W) S1 - D1 - REP
2020 D2
MSG (Message)
Displays the specified data on the HMI module LCD.
MSG S1
*****
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.
The MSG instruction functions are as follows.
Device values can be displayed.
• Word device values can be displayed as numeric values according to the specified data type.
For details, see "Insert Word Device" on page 12-4.
• Word device values can be displayed as bar graphs.
For details, see "Insert Bar Graph" on page 12-8.
• Text can be displayed and switched according to the value of a bit device (input/output, internal relay, shift register, timer contact, or counter
contact).
For details, see "Insert Bit Device" on page 12-6.
Arbitrary text can be displayed.
• The specified text can be displayed.
For details, see "MSG (Message) dialog box" on page 12-2.
The text display effects can be configured.
• Text can be scrolled, blinked, or inverted.
For details, see "Insert Text with Effect" on page 12-7.
Date/time data can be displayed.
• The current date/time and the date/time when the input to the MSG instruction is turned on can be displayed on the LCD.
For details, see "7. Special Data" on page 12-3.
The language for displayed text can be selected from 9 languages.
• Text can be displayed in 9 languages using 4 types of character sets.
For details, see "MSG Instruction Common Settings" on page 12-9.
The text display settings can be configured.
• The scroll unit, scroll speed, and blinking speed can be configured.
For details, see "MSG Instruction Common Settings" on page 12-9.
Device values can be modified.
• Device values displayed with the MSG instruction can be modified on the HMI module.
For details, see "Modifying Device Values on the HMI Module" on page 12-17.
Notes:
• A maximum of 50 MSG instructions can be entered in a user program, but only one MSG instruction message can be displayed on the HMI
module LCD. S1 for the MSG instruction stores the MSG instruction priority. When the display conditions for multiple MSG instructions are
satisfied, the messages are displayed according to the priority set for the MSG instruction.
For MSG instruction priority, see "10. Priority" on page 12-3.
• The MSG instruction cannot be used during an interrupt program. If it is used during an interrupt program, a user program execution error
occurs, the execution of the instruction is canceled, and the next instruction is executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
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" on page 12-9.
10. 11.
7. 8. 9.
1.
3.
4.
5.
6.
2. 12.
1. LCD Display
Configures the screen that is displayed on the HMI module LCD by placing text and devices in the selected area with the mouse
cursor. Enter the text with the keyboard at the cursor position. The character input method (insert/overwrite) is changed by
clicking Insert (9).
Note: Text entered on the LCD Display (1) with the keyboard cannot be set to scroll, blink, or invert. To scroll, blink, or invert the text, enter the
text with Text with Effect (5) and configure the display options. For details on inserting text with effects, see "Insert Text with Effect" on page
12-7.
2. Work Area
This area is used when editing the LCD display. This area is for temporarily relocating text and device data.
Text and device data at the cursor position can be moved between the LCD Display and the Work Area with or (12).
When the dialog is closed, the work area data is discarded.
3. Word Device
Inserts a word device at the cursor position. The value of the specified word device is displayed on the HMI module LCD. For
details, see "Insert Word Device" on page 12-4.
4. Bit Device
Inserts a bit device in the area specified by the cursor. 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. For details, see "Insert Bit Device" on page 12-6.
6. Bar Graph
Inserts a bar graph in the area specified by the cursor. The value of the specified device is displayed as a bar graph on the HMI
module LCD. For details, see "Insert Bar Graph" on page 12-8.
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.
8. Special Character
A special character can be entered at the cursor position. Select the character to enter on the special characters list window
popped up when Special Character is pressed. The special characters that can be used are as follows.
9. Insert/Overwrite
Selects insert or overwrite as the character input mode. Click this button to switch the input mode.
10. Priority
The priority of the MSG instruction can be configured between 0 to 49. 0 is the highest priority and 49 is the lowest priority.
• The same priority cannot be set for multiple MSG instructions.
• When inputs to two or more MSG instructions turns on, the message of the MSG instruction with the highest priority is displayed, out of all
the MSG instructions with inputs that are on.
• When the MSG instruction input with the highest priority changes from on to off, the message for the MSG instruction with the next highest
priority is displayed (the priority is checked when the input changes).
Note: When you press the (up) or (down) button on the HMI module, the messages are switched between the MSG instructions that have
inputs that are on. Messages are also switched when the acknowledgement for the MSG instruction is enabled.
Motor 5
STOP AT Example: Message output
10:12 in Priority 30
!! ACTION !!
Motor 2
3000 Example: Message output
hours in Priority 10
!! MAINTENANCE !!
Running
Date and current time
2015/DEC/01/TUE
09:00:12
11. Acknowledgment
When acknowledgment is enabled, the message continues to be displayed even when the MSG instruction input turns off. The
message is closed when the (OK) button on the HMI module is pressed, and then the message for the MSG instruction with
the next highest priority is displayed, out of all the MSG instructions with inputs that are on at that time.
If the input is on for the MSG instruction that had acknowledgment enabled, the message is not closed even when the (up)
button is pressed.
12. / buttons
Text and device data at the cursor position are moved between the LCD Display and the Work Area.
1.
2.
3.
4.
1. Device
Enter the device to display.
Valid Devices
3. Option
Configure the options for the specified device to blink, invert the text, or allow/prohibit value editing. For the blinking speed, see
"MSG Instruction Common Settings" on page 12-9.
4. Occupied Area
Shows the size of the area to be used on the LCD display (rows: 1, columns: 4 to 13). The area is determined by the selected
data type and conversion type.
The IEEE 754 single precision format consists of three fields: a 23-bit fraction, f; an 8-bit biased exponent, e; and 1-bit sign,
s. These fields are stored contiguously in one 32-bit word, as shown in the figure below. Bits 0:22 contain the 23-bit fraction,
f, with bit 0 being the least significant bit of the fraction and bit 22 being the most significant; bits 23:30 contain the 8-bit
biased exponent, e, with bit 23 being the least significant bit of the biased exponent and bit 30 being the most significant;
and the highest-order bit 31 contains the sign bit, s.
s e[30:23] f[22:0]
Example: This table shows the representation on the LCD for the following floating-point values.
1.
2.
3. 6. 7.
4.
5.
1. Device
Enter the device to display.
Valid Devices
I Q M R T C D
X X X X X X —
2. Display Option
Configure the options to blink or invert the text. For the blinking speed, see "MSG Instruction Common Settings" on page 12-9.
3. Occupied Area
Shows the size of the area to be used on the LCD display (rows: 1, columns: 1 to 24). The display size is determined by the
selected range on the LCD display area (or work area). If multiple rows are selected, the area at the top line in the selected
range is used.
4. ON Text
Enter the text to display when the specified device is on. Up to 24 single-byte characters can be entered. A space is also counted
as one character.
5. OFF Text
Enter the text to display when the specified device is off. Up to 24 single-byte characters can be entered. A space is also counted
as one character.
6. Special Character
Enters a special character at the cursor position. Select the character to enter on the special characters list window popped up
when Special Character is pressed. For the special characters, see "8. Special Character" on page 12-3.
7. Insert/Overwrite
Selects whether to insert or overwrite characters when entering new characters.
1.
2.
3.
5. 6. 5. 6.
4. 4.
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" on page 12-9.
2. Occupied Area
Shows the size of the area to be used on the LCD display (rows: 1, columns: 1 to 24). The occupied area is determined by the
selected range on the LCD display area (or work area). If multiple rows are selected, the area at the top line in the selected
range is used.
5. Special Character
Enters a special character at the cursor position. Select the character to enter on the special characters list window popped up
when Special Character is pressed. For the special characters, see "8. Special Character" on page 12-3.
6. Insert/Overwrite
Selects whether to insert or overwrite characters when entering new characters.
1.
2.
3.
4.
5.
6.
7.
1. Device
Enter the device to display as a bar graph.
Valid Devices
2. Data Type
Selects the data type for the specified device.
Data Type
W (word) X
I (integer) X
D (double word) X
L (long) X
F (float) —
For data types, see "Data Types for Advanced Instructions" on page 3-7.
3. Maximum
Enter the maximum value for the bar graph. If the device value is larger than the maximum value, the bar graph is displayed as
the maximum value. The valid range varies based on the data type. For data types, see "Data Types for Advanced Instructions"
on page 3-7.
4. Minimum
Enter the minimum value for the bar graph. If the device value is smaller than the minimum value, the bar graph is displayed as
the minimum value. The valid range varies based on the data type. For data types, see "Data Types for Advanced Instructions"
on page 3-7.
5. Origin
Enter the value to be the origin of the bar graph. If the device value is larger than the origin value, the bar graph is displayed on
the right side of the origin value. If the device value is smaller than the origin value, the bar graph is displayed on the left side
of the origin value. The valid range varies based on the data type. For data types, see "Data Types for Advanced Instructions" on
page 3-7. The origin value must satisfy the condition of Minimum ≤ Origin ≤ Maximum.
Line A monitor
Target count: 30000 Min ≤ Origin ≤ Max
Prod. count: 14500
6. Occupied Area
The occupied area is determined by the selected range on the LCD display area (or work area). If multiple rows are selected, the
area at the top line in the selected range is used (rows: 1, columns: 1 to 24).
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.
Lower limit The bar graph is blinked when the value of the specified device is smaller than the lower limit.
Maximum, minimum, upper limit, and lower limit values must satisfy the following condition.
Line A monitor
Target count: 30000 Min < Lower limit < Upper limit < Max
Prod. count: 14500
1.
2.
3.
4.
1. Character Set
The character set used for the messages can be configured from the following.
Selection Character Set Languages Usable in the MSG Instruction
European ISO-8859-1 (Latin 1) Italian, English, Dutch, Spanish, German, French
Japanese Shift-JIS Japanese
Chinese GB2312 Chinese (simplified)
Cyrillic ANSI 1251 Russian
2. Scroll Unit
The unit to scroll the texts can be configured.
One character Scrolls the text in 1 character units.
One dot Scrolls the text in 1 dot units.
3. Scroll Speed
The speed to scroll the texts can be configured. The setting range is 500 to 1,000 ms.
4. Blink Speed
The speed to blink the texts can be configured. The setting range is 500 to 1,000 ms.
Note: The MSG instruction character set can be configured irrespective of the HMI module system menu language.
[Display the room temperature when M0000 is on and the outdoor temperature when M0000 is off]
The room temperature/outdoor temperature value is stored in D0002. Create a ladder program that stores
the room temperature value when M0000 is on and the outside temperature value when M0000 is off.
2015/12/01 2015/12/01
Bar graph is used to Show the rise and fall in temperature visually.
Displays the current date.
■ Settings
Configure the following items.
1. Bit Device
IDEC room temp is
4. Special Character
2. Text with Effect Now: 2 8°C
5. Bar Graph
3. Word Device
2 0 1 5/1 2/0 1
6. Special Data
■ Operation Procedure
1. Right-click at the location to insert the MSG instruction, and click Advanced Instructions > Display > MSG (Message).
The MSG (Message) dialog box is displayed.
3. 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" as the OFF Text. Under Display Option, disable all of the options.
I D E C r o om t e m p i s
I D E C o utdoor t e m p i s
Note: The text can also be entered directly on the LCD display area. In the sample above, move the cursor to the start of the second line and enter
"Now:" with the keyboard. When you directly enter the text, proceed to "Configuring the word device" on page 12-13, step 8.
The Insert Text with Effect dialog box is displayed.
6. In Text, enter "Now:" with the keyboard. Under Display Option, disable all of the options.
I D E C r o om t e m p i s
Now:
9. Set Device to "D0002", Data Type to "Integer (I)", and Conversion Type to "Decimal".
Under Display Option, disable all of the options.
I D E C r o om t e m p i s
Now: 28
I D E C r o om t e m p i s
Now: 28 䰳
14. Set Device to "D0002", Data Type to "Integer (I)", Max to "50", Min to "-20", and Origin to "0".
Disable the blinking settings.
I D E C r o om t e m p i s
Now: 28°C
I D E C r o om t e m p i s
Now: 28°C
2015/12/01
LCD display
When M0000 is on, the room temperature stored in D0002
IDEC room temp is
is displayed as the numeric value (°C) and bar graph.
Now: 28°C
2015/12/01
2015/12/01
Line A monitor
Plan: CPO Actual:CCO
Diff: DO
Bar Graph CC0
When the user program is running and the input to the MSG instruction is turned on, the following screen will be displayed on the
LCD.
Line A monitor
Plan: 60000 Actual:20000
Diff: 40000
While the above message is displayed, press and hold the (OK) button and the cursor is displayed on the devices that can be
modified.
Line A monitor
Plan: 60000 Actual:20000
Diff: 40000
Move the cursor to the device you wish to edit using the (up) (down) (left) (right) buttons and press the (OK)
button to change the device in the editable state.
Line A monitor
Plan: 6
60000 Actual:20000
Diff: 40000
Press the (right) button to move the cursor to the fourth digit, and then use the (up) button to modify the target value to
"65000".
Line A monitor
Plan: 65000
5 Actual:20000
Diff: 40000
Line A monitor
Plan: 65000 Actual:20000
Diff: 40000
When a text with effect is set to scroll, the text is displayed on the HMI module LCD as follows.
When scrolling a text longer than the specified area on 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"
500 msec
orporation I DEC C
a ti o n MICRO Sma rt
500 msec
ti on MICRO Smar t
500 msec
500 msec
I D E C C o r por
500 msec
I D E C C o r por a
500 msec
I D E C C o r por a t
500 msec
I D E C C o r por a ti
[Character Set: European, Scroll speed: 500 ms, Scroll unit: 1-dot]
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"
1234567812345678123456781234567812345678123456781234567812
1
2
3
4
5
6
7
8
9
10
IDEC Corporation. 11
12
13
14
15
16
1
2
62.5 msec
62.5 msec
62.5 msec
62.5 msec
62.5 msec
62.5 msec
62.5 msec
62.5 msec
62.5 msec
DISP (Display)
Note: Always use transistor output to display data using the DISP instruction.
Valid Devices
For the valid device address range, see "Device Addresses" on page 2-1.
*1 When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is read out.
*2 Internal relays M0 through M7997 and M10000 through M17497 can be designated as Q. Special internal relays cannot be designated as Q.
Conversion
BCD:To connect BCD (decimal) display units
BIN:To connect BIN (hexadecimal) display units
Specify the data to display on the 7-segment display with S1 (the display data). Specify the output for the display data with Q.
Starting from the device specified with Q, the specified data (4 points + number of digits) is sequentially allocated by the display
data and the number of display digits.
For example, if the number of display digits is 4 digits and the display data output is set to Q0, Q0 to Q7 are allocated (Q0 to Q3
are allocated to the data signal to the display, Q4 to Q7 are allocated to the digit selection signal).
Notes:
• A maximum of 8 DISP instructions can be entered in a user program.
• Displaying one digit of data requires 3 scan times after the input to the DISP instruction is turned on. Keep the input to the DISP instruction
for the period of time shown below to process all digits of the display data.
Display Processing Time
3 scan times × Quantity of digits
When the scan time is less than 2 ms, the data cannot be displayed correctly. When the scan time is too short to ensure normal display, set a
value of 3 or more (in ms) to data register D8022 (constant scan time preset value).
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.
DISP S1 Q LAT DAT When input I0 is on, the 4-digit current value of counter C10
BCD4 C10 Q30 L H is displayed on 7-segment digital display units.
8-Transistor Sink
Output Module
(FC6A-T08K1)
Q30
Q31
Q32
Q33
Q34
Q35
Q36
Q37
COM(–)
+V (+)
(–)
24V DC
(+) (+) (+) (+) Power
(–) (–) (–) (–) Supply
LATCH LATCH LATCH LATCH
A A A A
B B B B
C C C C
D D D D
103 102 101 100
When input is on, the setting values for the connected digital
DGRD I Q D1 switch are stored in the device specified by D1.
BCD4 ***** ***** ***** This instruction can be used to change preset values for
timer and counter instructions using digital switches.
First output number
First input number
Quantity of digits:
1 to 5 (decimal)
1 to 4 (hex)
Conversion:
BCD or BIN
Note: Always use transistor output to display data using the DGRD instruction.
Valid Devices
For the valid device address range, see "Device Addresses" on page 2-1.
The DGRD instruction can read 65535 (5 digits) at the maximum. When the read value exceeds 65,535 with the quantity of digits
set to 5, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the CPU module.
Note: When transferring a user program containing more than 16 DGRD instructions to the CPU, a user program syntax error occurs, turning on the
ERR LED. The user program cannot be executed.
Conversion
BCD:To connect BCD (decimal) digital switches
BIN:To connect BIN (hexadecimal) digital switches
Four points from the input specified by I are allocated as the reading inputs.
For example, when I is set to I0, I0 to I3 are allocated.
The number of digits specified by the number of display digits from the output specified by Q are allocated as the digit selection
outputs.
For example, if the number of display digits is three digits, and Q is set to Q0, Q0 to Q2 are allocated.
Notes:
• A maximum of 16 DGRD instructions can be entered in a user program.
• Reading digital switch data requires the following time after the input to the DGRD instruction is turned on. Keep the input to the DGRD
instruction for the period of time shown below to read the digital switch data. For example, when reading data from 5 digital switches to the
destination device, 14 scans are required.
Digital Switch Data Reading Time
2 scan times × (Quantity of digits + 2)
The DGRD instruction requires a scan time longer than the filter time plus 6 ms.
Minimum Required Scan Time
(Scan time) ≥ (Filter time) + 6 ms
• As necessary, adjust the scan time using the constant scan time (D8022) function. The filter time differs according to the input that is used as
the reading input.
When specifying CPU module inputs as the reading inputs: I0 to I27
See the input filter time configured in the WindLDR Function Area Settings. The initial value is 3 ms.
When specifying input module inputs as the reading inputs: From I30
There is no filter time, so calculate the value by replacing the filter time with the input delay time.
• The data that can be read using this instruction is 0 through 65535 (5 digits), or FFFFh. A user program execution error will occur when a
value of 65,536 or greater is specified as a five digit decimal code and the processing will not be executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
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.
DGRD I Q D1 When input I5 is on, the 4-digit value from BCD digital switches is read to
BCD4 I30 Q30 D10 data register D10.
16-point Transistor
8-point DC Input Sink Output
(FC6A-N08B1) (FC6A-T16K3) Digital Switches
C 8
I30 Q30
I31 Q31 0
4
10 2
I32 Q32
I33 Q33 1
I34 Q34
I35 Q35
I36 Q36 C 8
I37 Q37 4
COM COM(–) 101 2
COM +V 1
C 8
2
4
10 2
1
(+)
(–)
C 8
24V DC
4
Power 103 2
Supply 1
LABEL (Label)
This instruction sets the label number.
LABEL
The label number that can be specified is 0 to 255.
***
An END instruction may be used to separate a tagged portion of the program from the main program. In this way, scan
time is minimized by not executing the program branch unless input conditions are satisfied.
Valid Devices
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the LJMP instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Note: Make sure that a LABEL instruction of the label number used for a LJMP instruction is programmed. When designating S1 using other than a
constant, the value for the label is a variable. When using a variable for a label, make sure that all probable LABEL numbers are included in the user
program. If a matching label does not exist, 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" on page 3-10.
END
LABEL
0
END
LABEL
1
END
LABEL
2
Since the END instruction is not executed as long as M0 remains on, output Q1 is not turned on even if input I1 is on.
Note: The END instruction must be used to separate the main program from any subroutines called by the
LCAL instruction.
A maximum of four LCAL instructions can be nested. When more than four LCAL instructions are nested, a
user program execution error will result, turning on special internal relay M8004 and the ERR LED on the
FC6A Series MicroSmart.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the LCAL instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Note: Make sure that a LABEL instruction of the label number used for a LCAL instruction is programmed. When designating S1 using other than a
constant, the value for the label is a variable. When using a variable for a label, make sure that all probable LABEL numbers are included in the user
program. If a matching label does not exist, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on
the FC6A Series MicroSmart.
The LRET must be placed at the end of the subroutine starting with a LABEL instruction. When the LRET is programmed
at other places, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on
the FC6A Series MicroSmart.
Valid Devices
Correct Incorrect
MOV(W) S1 – D1 – REP MOV(W) S1 – D1 – REP
I0 D0 D1 I0 D0 D1
LCAL S1 LCAL S1
0 0
S S
I0 M0 M0
Separate the ladder line for each LCAL instruction. I0 status may be changed by the subroutine upon return.
END
LABEL
0
M8121 is the 1-s clock special internal relay.
When jump occurs to label 0, output Q0 oscillates in 1-s increments.
M8121 Q0
LABEL
1
M8122 is the 100-ms clock special internal relay.
LABEL
2
M8123 is the 10-ms clock special internal relay.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the DJNZ instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
The label number can be 0 through 255. Make sure that a LABEL instruction of the label number used for a DJNZ instruction is programmed. When
designating S2 using a data register, the value for the label is a variable. When using a variable for a label, make sure that all probable LABEL
numbers are included in the user program. If a matching label does not exist, a user program execution error will result, turning on special internal
relay M8004 and the ERR LED on the FC6A Series MicroSmart.
LABEL
255
IMOV(W) S1 – S2 D1 – D2 REP IMOV moves D0 data 1049 to D1049 in the first cycle.
M8120 D0 D99 D1
END
When Q (output) is used as S1, the output data in the RAM is immediately written to the actual output
available on the FC6A Series MicroSmart.
Refresh instructions are useful when a real-time response is required in a user program which has a long
scan time. The refresh instruction is most effective when using the refresh instruction at a ladder step
immediately before using the data.
The IOREF instruction can be used with an interrupt input or timer interrupt to refresh data.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) I/O for refresh X X — — — — — — —
Only inputs and outputs available on the CPU module can be specified for S1 of the IOREF instruction. Input and output numbers for remote I/O
slaves cannot be designated as S1. For valid device address ranges, see "Device Addresses" on page 2-1.
During normal execution of a user program, I/O statuses are refreshed simultaneously when the END instruction is executed at the
end of a scan. When a real-time response is needed to execute an interrupt, the IOREF instruction can be used. When the input to
the IOREF instruction is turned on, the status of the designated input or output is read or written immediately.
When the IOREF instruction is executed for an input, the filter does not take effect and the input status at the moment is read to
a corresponding internal relay.
The actual input status of the same input number is read to the internal input memory when the END instruction is executed as in
the normal scanning, then the filter value has effect as designated in the Function Area Settings. See Chapter 5 "Functions and
Settings" - "Input Filter" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
Example: IOREF
The following example demonstrates a program that transfers the input I0 status to output Q0 using the IOREF instruction. Input
I2 is designated as an interrupt input. For the interrupt input function, see Chapter 5 "Functions and Settings" - "Interrupt Input"
in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
Main Program
END
The current values of six high-speed counters HSC1 through HSC6 are usually updated in every scan. The HSCRF can
be used in any place in the ladder diagram where you want to read the updated high-speed counter current value.
For the high-speed counter function, see Chapter 5 "Functions and Settings" - "High-Speed Counter" in the "FC6A
Series MicroSmart All-in-One Type User’s Manual".
Example: HSCRF
The following example demonstrates a program that updates the current value of high-speed counter HSC1 using the HSCRF
instruction. For the timer interrupt, see Chapter 5 "Functions and Settings" - "Timer Interrupt" in the "FC6A Series MicroSmart All-
in-One Type User’s Manual".
Main Program
The interrupt program is separated from the main program by the END
END instruction.
LABEL While the CPU is running, program execution jumps to label 0 repeatedly
0 at intervals selected in the Function Area Settings.
Before the measured results are reflected in special data registers, it takes a maximum of approximately 250 ms + the
scan time, but by using the FRQRF instruction, control processing using the latest current values of the frequency
measurements can be performed in any location in the user program.
For the frequency measurement function, see Chapter 5 "Frequency Measurement" in the "FC6A Series MicroSmart
All-in-One Type User’s Manual".
Example: FRQRF
Periodically update the current value of the frequency measurement value (D8060, D8061) using the FRQRF instruction in an
interrupt program.
When the frequency measurement value becomes 5,000 or greater, turn on the error signal (Q1).
MOV(W) S1 – D1 – REP Store 0 in D8036 and specify LABEL 0 as the interrupt program to execute
M8120 0 D8036 when the timer interrupt occurs.
Main Program
The interrupt program is separated from the main program by the END
END instruction.
CMP>(D) S1 – S2 – D1 – REP When the frequency measurement value becomes 5,000 or greater, turn on
M8125 D8060 5000 Q1 Q1 as the error signal.
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.
Regardless of the presence of the COMRF instruction, reading received data and writing send data for expanded
communication port is executed in END processing.
Note: This instruction cannot be used in interrupt programs. If this instruction is used in an interrupt program, a user
program execution error will occur.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
Example: COMRF
The following example demonstrates a program to execute COMRF instructions among other instructions.
Before executing the RXD instruction, COMRF refreshes send and receive data of
COMRF
the expansion communication ports.
RXD S1 D1 D2
M0 3 100 M1 D498
BMOV(W) S1 N-W D1
M1 D0 100 D500
TXD S1 D1 D2
4 100 M0 D502
R
M1
COMRF After executing the TXD instruction, COMRF refreshes send and receive data of
the expansion communication ports.
DI (Disable Interrupt)
When input is on, interrupt inputs and timer interrupt assigned by source device S1 are disabled.
DI S1
**
EI (Enable Interrupt)
When input is on, interrupt inputs and timer interrupt assigned by source device S1 are enabled.
EI S1
**
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Interrupt inputs and timer interrupt — — — — — — — X*1 —
Make sure that interrupt inputs and timer interrupt designated as source device S1 are selected in the Function Area Settings. Otherwise, when the
DI or EI instruction is executed, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A
Series MicroSmart.
The DI and EI instructions 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" on page 3-10.
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.
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 All-in-One Type User’s Manual". In this example, inputs I2 and I3 are designated as interrupt inputs
and timer interrupt is used with interrupt intervals of 100 ms.
EI S1 When input I11 is on and I10 is off, EI enables interrupt inputs I2 and I3, then M8071
I11 I10 6 and M8072 turn on.
EI S1 When input I12 is on and I10 is off, EI enables timer interrupt, then M8144 turns on.
I12 I10 16
IOREF S1 IOREF immediately writes the output Q3 internal memory status to actual output Q3.
M8125 Q3
LABEL Timer interrupt occurs every 100 ms, then program execution jumps to label 2.
2
IOREF S1 IOREF immediately writes the output Q4 internal memory status to actual output Q4.
M8125 Q4
X
(X0, Y0)
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Format number — — — — — — — 0 to 7 —
X0 through Xn X value X X X X X X X 0 to 65,535 —
0 to 65,535
Y0 through Yn Y value X X X X X X X —
–32,768 to 32,767
For valid device address ranges, see "Device Addresses" on page 2-1.
When T (timer) or C (counter) is used as X0 through Xn or Y0 through Yn, the timer/counter current value (TC or CC) is displayed.
S1 (Format number)
Select a format number 0 through 7. A maximum of 8 formats for XY conversion can be set.
Xn (X value), Yn (Y value)
Enter values for the X and Y coordinates. Two different data ranges are available depending on the data type.
Y Y
65,535 32,767
Valid Coordinates
X
0 65,535
X –32,768
0 65,535
CVXTY (Convert X to Y)
When input is on, the X value assigned by device S2 is converted into the
CVXTY(*) S1 S2 D1 corresponding Y value according to the linear relationship defined in the XYFS
* ***** ***** instruction. Device S1 selects a format from a maximum of 8 XY conversion formats.
The conversion result is set to the device assigned by D1.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
S1 (Format number)
Select a format number 0 through 7 which have been set using the XYFS instruction. When an XYFS instruction with the corresponding format
number is not programmed, or when XYFS and CVXTY instructions of the same format number have different data type designations, 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" on page 3-10.
S2 (X value)
Enter a value for the X coordinate to convert, within the range specified in the XYFS instruction.
Y Y
65,535 32,767
Valid Coordinates
X
0 65,535
X –32,768
0 65,535
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as S2 or D1, 16
I (integer) X points are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as S2 or D1, 1 point is used.
L (long) —
F (float) —
CVYTX (Convert Y to X)
When input is on, the Y value assigned by device S2 is converted into the
CVYTX(*) S1 S2 D1 corresponding X value according to the linear relationship defined in the XYFS
* ***** ***** instruction. Device S1 selects a format from a maximum of 8 XY conversion formats.
The conversion result is set to the device assigned by D1.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
S1 (Format number)
Select a format number 0 through 7 which have been set using the XYFS instruction. When an XYFS instruction with the corresponding format
number is not programmed, or when XYFS and CVYTX instructions of the same format number have different data type designations, 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" on page 3-10.
S2 (Y value)
Enter a value for the Y coordinate to convert, within the range specified in the XYFS instruction. Two different data ranges are available depending
on the data type.
Y Y
65,535 32,767
Valid Coordinates
X
0 65,535
X –32,768
0 65,535
W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as S2 or D1, 16
I (integer) X points are used.
D (double word) — When a word device such as T (timer), C (counter), or D (data register) is assigned as S2 or D1, 1 point (integer
L (long) — data) is used.
F (float) —
END
The graph shows the linear relationship that is defined by the two
points:
Y
(X1, Y1)
1
Y = −X
2
D11 (2,500) If the value in data register D10 is 2,000, the value assigned to
D20 is 1,000.
X = 2Y
0
(X0, Y0) D10 D21 8,000 X If the value in data register D11 is 2,500, the value assigned to
(2,000) (5,000) D21 is 5,000.
END
D90 (75)
D95 (40)
(X1, Y1)
(100, 0)
0
D30 100 C10 300 X
(60) (250)
The first line segment defines the following relationship for X to Y conversion:
Y = – X + 100
1
Y = – X – 50
2
For X to Y conversion, each value of X has only one corresponding value for Y. If the current value of counter C10 is 250, the value assigned to D90
is 75.
For Y to X conversion, the XYFS instruction assigns two possible values of X for each value of Y. The relationship defined by the first two points has
priority in these cases. The line between points (X0, Y0) and (X1, Y1), that is, the line between (0, 100) and (100, 0), has priority in defining the
relationship for Y to X conversion (X = –Y + 100).
Therefore, if the value in data register D95 is 40, the value assigned to D30 is 60, not 180.
Exactly the same two line segments might also be defined by the XYFS instruction, except that the point (300, 100) could be assigned first, as (X0,
Y0), and the point (100, 0) could be defined next, as (X1, Y1). In this case, this linear relationship would have priority.
In this case, if the value in data register D95 is 40, the value assigned to D30 is 180, not 60.
AVRG (Average)
When input is on, sampling data assigned by device S1 is
AVRG(*) S1 S2 S3 D1 D2 processed according to sampling conditions assigned by devices
***** ***** ***** ***** ***** S2 and S3.
When sampling is complete, average, maximum, and minimum
values are stored to 3 consecutive devices starting with device
assigned by D1, then sampling completion output assigned by
device D2 is turned on.
Data Type W, I D, L, F
Average D1 D1·D1+1
Maximum value D1+1 D1+2·D1+3
Minimum value D1+2 D1+4·D1+5
The AVRG instruction is effective for data processing of analog input values. A maximum of eight AVRG instructions can be programmed in a user
program.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Sampling data X X X X X X X — —
S2 (Source 2) Sampling end input X X X X — — — — —
S3 (Source 3) Sampling cycles (scan times) X X X X X X X 0-65,535 —
D1 (Destination 1) First device address to store results — — — — — — X — —
D2 (Destination 2) Sampling completion output — X — — — — — —
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0 through M7997 and M10000 through M17497 can be designated as D2. Special internal relays cannot be designated as D2.
When T (timer) or C (counter) is used as S1 or S3, the timer/counter current value (TC or CC) is displayed.
When F (float) data is selected, only data registers can be designated as S1 and D1.
While input is on, the AVRG instruction is executed in each scan. When the quantity of sampling cycles (scan times) designated by device S3 is 1
through 65,535, sampling data designated by device S1 is processed in each scan. When the designated sampling cycles have been completed, the
average value of the sampling data is set to the device designated by D1 (data type W or I) or D1·D1+1 (data type D, L, or F). The maximum value
of the sampling data is set to the next device, D1+1 (data type W or I) or D1+2·D1+3 (data type D, L, or F). The minimum value of the sampling
data is set to the next device, D1+2 (data type W or I) or D1+4·D1+5 (data type D, L, or F). The sampling completion output designated by device
D2 is turned on.
When the quantity of sampling cycles designated by device S3 is 0, sampling is started when the input to the AVRG instruction is turned on, and
stopped when the sampling end input designated by device S2 is turned on. Then, the average, maximum, and minimum values are set to 3 devices
starting with device designated by D1.
When the sampling exceeds 65,535 cycles, the average, maximum, and minimum values at this point are set to 3 devices starting with device
designated by D1, and sampling continues.
When the sampling end input is turned on before the sampling cycles designated by device S3 have been completed, sampling is stopped and the
results at this point are set to 3 devices starting with device designated by D1.
The average value is calculated to units, rounding the fractions of one decimal place.
When the sampling end input is not used, designate an internal relay or another valid device as a dummy for source device S2.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. When an error occurs, incorrect S1 data are skipped. Average, maximum,
and minimum values are calculated from correct S1 data, and set to 3 devices starting with the device designated by D1. For details about user
program execution errors, see "User Program Execution Errors" on page 3-10.
Example: AVRG
The following example demonstrates a program that calculates the average values of data register D100 and store the result to
data register D200 every 500 scans.
1st scan 2nd scan 500th scan 1st scan 2nd scan
ON
In-operation Special IR M8125 OFF
ON
Sampling End Input I10 OFF
ON
Sampling Completion Output M100 OFF
151st scan 152nd scan 153rd scan XXXth scan 1st scan
ON
In-operation Special IR M8125 OFF
ON
Sampling End Input I10 OFF
ON
Sampling Completion Output M100 OFF
1 When the input is on, pulses are output with a fixed duty cycle according to the
***** ***** *****
control register settings specified by S1.
When the initialization input specified by S2 is turned on, the initial values
PULS S1 S2 D1 configured in the WindLDR PULS dialog box, on the Settings tab, are stored in
2 the control registers.
***** ***** *****
The pulse control information (output on/output complete/error) is stored in the
internal relays specified by D1 as the operation status.
PULS S1 S2 D1
3 ***** ***** *****
PULS S1 S2 D1
Note: Configure multiple PULS (pulse output), PWM (pulse width modulation), RAMP (trapezoidal control), and ARAMP (RAMP with table)
instructions so that they do not share the same pulse output port.
However, the ZRN (zero return) instruction can be configured with the same pulse output port as the PULS (pulse output), PWM (pulse width
modulation), RAMP (trapezoidal control), and ARAMP (RAMP with table) instructions.
Notes:
• If a pulse output instruction is simultaneous executed with the same pulse output port, a user program execution will occur.
Error code 48 will be stored in D8006 and instructions that were executed after the initial instruction will be canceled.
• The PULS instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur.
Error code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur.
Error code 19 is stored in D8006 and instruction execution is canceled.
• For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Control register — — — — — — — —
S2 (Source 2) Initialization input X — X — — — — — —
D1 (Destination 1) Operation status — — — — — — — —
Special data registers cannot be designated as S1. Internal relays M0000 through M1277 can be designated as D1. Special internal relays cannot
be designated as D1.
Settings
■ Devices tab
2. 3. 4. 5.
1.
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.
The lowest frequency that can be used with FC5A (except FC5A-D12X1E) Compatible Mode is 20 Hz*1.
*1 The lower limit value for the frequency that the FC5A Series MicroSmart can output is 10 Hz, but in compatibility mode this is 20 Hz.
Notes:
• The lowest frequency of pulses that can be output in FC5A (except FC5A-D12X1E) Compatible Mode is 20 Hz. A frequency lower than 20 Hz
cannot be output. If such a value is specified, the pulse frequency designation error will occur.
• The highest frequency of pulses that can be output with PULS3 in FC5A (except FC5A-D12X1E) Compatible Mode is 5 kHz. A frequency higher
than 5 kHz cannot be output. If such a value is specified, the pulse frequency error will occur.
The rest of this section is written under the assumption that FC6A Standard Mode has been selected.
Note: For details on the FC5A (except FC5A-D12X1E) Compatible Mode settings, refer to the PULS instruction in Chapter 15 "Pulse Output
Instructions" in the "FC5A Series MicroSmart Pentra User's Manual Advanced Volume".
2. Select instruction
This item selects which PULS instruction to use ("PULS1", "PULS2", "PULS3", or "PULS4").
The pulse output and the frequency that can be set are determined by the instruction and the CPU module type.
All-in-One Type
Storage Setting
Function Reference
destination All-in-One Type CAN J1939 All-in-One Type
Output pulse PULS1, PULS2:
Starting number+0 frequency 15 to 100,000
PULS1 to PULS4:
(high word)*1 (increments of 1 Hz) "6. Output pulse frequency" on
15 to 100,000
Output pulse PULS3, PULS4: page 18-4
(increments of 1 Hz)
Starting number+1 frequency 15 to 5,000
(low word)*1 (increments of 1 Hz)
Preset value
Starting number+2
(high word)*1
1 to 100,000,000 pulses "8. Preset value" on page 18-4
Preset value
Starting number+3
(low word)*1
Current value
Starting number+4
(high word)*1
1 to 100,000,000 pulses "9. Current value" on page 18-4
Current value
Starting number+5
(low word)*1
Starting number+6 Error status 0 to 4 "10. Error status" on page 18-4
Starting number+7 Reserved
*1 The upper and lower data registers change according to the 32-bit data storage method specified.
For details, see "32-bit Data Storage" on page 3-9.
Storage
Function Setting
Destination
This relay turns on during pulse output.
Starting 0: Pulse output OFF This relay turns off when pulse output stops.
Pulse output ON
number+0 1: Pulse output ON This relay turns off when the specified number of pulses are output
and output ends.
Starting Pulse output 0: Pulse output not complete This relay turns on when pulse output is complete.
number+1 complete 1: Pulse output complete This relay turns off when pulse output starts.
Starting 0: None When pulse counting is enabled, this relay turns on when a pulse is
Overflow
number+2 1: An overflow has occurred output that exceeds the configured preset value.
■ Settings tab
This tab configures the operation of the PULS instruction.
6.
7.
8.
9.
10.
Configurable Range
CPU Module Type Instruction
Setting Value Frequency
PULS1, PULS2 15 to 100,000 15 Hz to 100 kHz (increments of 1 Hz)
All-in-One Type
PULS3, PULS4 15 to 5,000 15 Hz to 5 kHz (increments of 1 Hz)
CAN J1939 All-in-One Type PULS1 to PULS4 15 to 100,000 15 Hz to 100 kHz (increments of 1 Hz)
7. Pulse counting
Enables or disables pulse counting.
If Enable pulse counting is specified, the number of pulses specified by the preset value (8) is output.
If Disable pulse counting is specified, pulses are continuously output while the PULS instruction input is on.
8. Preset value
When the setting for 7. Pulse counting is Enable pulse counting, this setting specifies the number of pulses to output.
9. Current value
Specifies the device (data register) that will store the number of pulses that were output.
The current value is updated when the PULS instruction is executed at each scan.
Error
Status Description
Code
0 Normal —
PULS1, PULS2: The pulse frequency was not set between 15 and 100,000.
Pulse frequency All-in-One Type
2 PULS3, PULS4: The pulse frequency was not set between 1 and 5,000.
designation error
CAN J1939 All-in-One Type PULS1 to PULS4: The pulse frequency was not set between 15 and 100,000.
Preset value
4 If Enable pulse counting is specified, the preset value was not set between 1 and 100,000,000.
designation error
Examples: PULS
PULS1 instruction (pulse counting enabled) timing chart
PULS S1 S2 D1
1 D0200 M0000 M0050
PULS1 instruction
input
n1 n2
f1 f2
Output pulse Q0
When the PULS1 instruction input changes from off to on, M0050 turns on and pulses with the frequency configured by D0200 and
D0201 are output. When the number of pulses configured by D202 and D203 are output, pulse output stops. If the value of D0200
and D0201 changes during pulse output, pulses are output with the frequency based on that value.
When the PULS1 instruction input changes from on to off, M0050 turns off and M0051 turns on at the same time.
The changes from the initialization input are not reflected while the PULS1 instruction input is on. If you wish to initialize the data
registers with the initialization input, turn the initialization input on after turning off the input.
PULS S1 S2 D1
2 D0100 M0000 M0200
PULS2 instruction
input
Output pulse Q0
When the PULS2 instruction input changes from off to on, M0200 turns on and pulses with the frequency configured by D0101 and
D0100 are output. If the value of D0101 and D0100 changes during pulse output, pulses are output with the frequency based on
that value.
When the PULS2 instruction input changes from on to off, M0200 turns off and M0201 turns on at the same time.
The changes from the initialization input are not reflected while the PULS2 instruction input is on. If you wish to initialize the data
registers with the initialization input, turn the initialization input on after turning off the input.
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
MOV(D) S1 - D1 - REP
SOTU Store 500 (500 Hz) in frequency
500 D0000
M0101 (D0000, D0001)
MOV(D) S1 - D1 - REP
60000 D0002 60,000 is stored in the preset value
(D0002, D0003). Ladder (1)
S
M0001 Turn on M0001 to output next pulse
PULS S1 S2 D1
When the PULS1 instruction input (I0) turns on, a 200 Hz frequency
1 D0000 M0000 M0100 pulse is output, and after 5,000 pulses, pulse output complete
I0000 M0101
(M0101) turns on and pulse output stops.
Then ladder (1) is executed, and after the frequency and preset
value are changed, a 500 Hz pulse is output, and after 60,000 pulses,
pulse output complete (M0101) turns on and pulse output stops.
SOTU R Pulse output complete (M0101) turns off (pulse output not complete)
M0001 M0101
Settings
1 When the input is on, pulses are output according to the control register settings
***** ***** *****
specified by S1.
PWM S1 S2 D1
Notes:
• If a pulse output instruction is simultaneous executed with the same pulse output port, a user program execution will occur.
Error code 48 will be stored in D8006 and instructions that were executed after the initial instruction will be canceled.
• The PWM instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur.
Error code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur.
Error code 19 is stored in D8006 and instruction execution is canceled.
• For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Control register — — — — — — — —
S2 (Source 2) Initialization input X — X — — — — — —
D1 (Destination 1) Operation status — — — — — — — —
Special data registers cannot be designated as S1. Internal relays M0000 through M1277 can be designated as D1. Special internal relays cannot
be designated as D1.
Settings
■ Devices tab
2. 3. 4. 5.
1.
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. When changing the PLC type from the FC4A Series MicroSmart, FC4A
Compatible Mode is automatically selected. When changing the PLC type from the FC5A or FC5A-D12, FC5A (except FC5A-
D12X1E) Compatible Mode or FC5A-D12X1E Compatible Mode is automatically selected.
The frequency that can be specified in FC compatibility mode is an approximate value of the FC4A, FC5A, and FC5A-D12 PWM
instruction frequencies.
Note: The pulse frequencies that can be output in FC compatibility mode are as follows.
The rest of this section is written under the assumption that FC6A Standard Mode has been selected.
Notes:
• For details on the FC4A Compatible Mode settings, refer to the PWM instruction in Chapter 2 "Instructions" in the "FC4A Series MicroSmart
Pentra User's Manual".
• For details on the settings in FC5A (except FC5A-D12X1E) Compatible Mode and FC5A-D12X1E Compatible Mode, refer to the PWM
instruction in Chapter 13 "Pulse Instructions" in the FC5A Series MicroSmart Pentra User's Manual Advanced Volume.
2. Select instruction
This item selects which PWM instruction to use ("PWM1", "PWM2", "PWM3", or "PWM4").
The pulse output that can be set is determined by the instruction and the CPU module type.
All-in-One Type
Configurable Range
Instruction Pulse Output
Frequency Duty Cycle
PWM1 Q0
PWM2 Q1
15 Hz to 5 kHz (increments of 1 Hz) 0.1 to 100.0 (increments of 0.1%)
PWM3 Q2
PWM4 Q3
Configurable Range
Instruction Pulse Output
Frequency Duty Cycle
PWM1 Q0
PWM2 Q2
15 Hz to 5 kHz (increments of 1 Hz) 0.1 to 100.0 (increments of 0.1%)
PWM3 Q4
PWM4 Q6
Storage
Function Setting Reference
Destination
Starting number+0 Output pulse frequency 15 to 5,000 (increments of 1 Hz) "6. Output pulse frequency" on page 18-11
Starting number+1 Pulse duty cycle (ON ratio) 1 to 100% "7. Pulse width ratio" on page 18-11
Starting number+2 Preset value (high word)*1
1 to 100,000,000 pulses "9. Preset value" on page 18-11
Starting number+3 Preset value (low word)*1
*1
Starting number+4 Current value (high word)
1 to 100,000,000 pulses "10. Current value" on page 18-11
Starting number+5 Current value (low word)*1
Starting number+6 Error status 0 to 4 "11. Error status" on page 18-11
Starting number+7 Reserved
*1 The upper and lower data registers change according to the 32-bit data storage method specified.
For details, see "32-bit Data Storage" on page 3-9.
■ Settings tab
6.
7.
8.
9.
10.
11.
8. Pulse counting
Enables or disables pulse counting.
If Enable pulse counting is specified, the number of pulses specified by the preset value (9) is output.
If Disable pulse counting is specified, pulses are continuously output while the PULS instruction input is on.
9. Preset value
When the setting for 8. Pulse counting is Enable pulse counting, this setting specifies the number of pulses to output.
Examples: PWM
PWM1 instruction (pulse counting enabled) timing chart
PWM S1 S2 D1
1 D0200 M0000 M0050
PWM1 instruction
input
n1 n2
w1 w2
Output pulse Q0
When the PWM1 instruction input changes from off to on, M0050 turns on and pulses with the width ratio configured by D0201 are
output. When the number of pulses configured by D0202 and D0203 are output, pulse output stops. If the value of D0201 changes
during pulse output, pulses are output with the width ratio based on that value.
When the PWM1 instruction input changes from on to off, M0050 turns off and M0051 turns on at the same time.
The changes from the initialization input are not reflected while the PWM1 instruction input is on. If you wish to initialize the data
registers with the initialization input, turn the initialization input on after turning off the input.
PWM S1 S2 D1
2 D0100 M0000 M0200
PWM2 instruction
input
w1 w2
When the PWM2 instruction input changes from off to on, M0200 turns on and pulses with the width ratio configured by D0101 are
output. If the value of D0101 changes during pulse output, pulses are output with the width ratio based on that value.
When the PWM2 instruction input changes from on to off, M0200 turns off and M0201 turns on at the same time.
The changes from the initialization input are not reflected while the PWM2 instruction input is on. If you wish to initialize the data
registers with the initialization input, turn the initialization input on after turning off the input.
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.
MOV(W) S1 - D1 - REP
Set pulse width ratio (D0001) to 30 (30% ON)
300 D0001
I0000
MOV(W) S1 - D1 - REP
Set pulse width ratio (D0001) to 60 (60% ON)
600 D0001
I0000
PWM S1 S2 D1 When PWM1 instruction input (I0001) turns on, start output
of a pulse with the pulse width ratio of 30% or 60%
1 D0001 M0000 M0100
I0001
Settings
After steady pulse output at the steady pulse frequency, the pulse frequency is
RAMP S1 S2 D1 decreased before the pulse count reaches the preset value specified by S1, and
2 then pulse output stops when the preset value is reached.
***** ***** *****
RAMP S1 S2 D1
RAMP S1 S2 D1
Frequency Frequency
increase ratio decrease ratio
Frequency increase and
10 ms decrease ratios are the same 10 ms
Steady pulse
frequency
Initial pulse
frequency
When the initialization input specified by S2 is turned on, the initial values configured in the WindLDR RAMP (Trapezoidal
Control) dialog box, on the Settings tab, are stored in the control registers.
The pulse control information (output on/output complete/error) is stored in the internal relays specified by D1 as the operation
status.
Notes:
• If a pulse output instruction is simultaneous executed with the same pulse output port, a user program execution will occur.
Error code 48 will be stored in D8006 and instructions that were executed after the initial instruction will be canceled.
• The PULS instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur.
Error code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur.
Error code 19 is stored in D8006 and instruction execution is canceled.
• For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Control register — — — — — — — —
S2 (Source 2) Initialization input X — X — — — — — —
D1 (Destination 1) Operation status — — — — — — — —
Special data registers cannot be designated as S1. Internal relays M0000 through M1277 can be designated as D1. Special internal relays cannot
be designated as D1.
Settings
■ Devices tab
2. 3. 4. 5.
1.
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.
The lowest frequency that can be used with FC5A (except FC5A-D12X1E) Compatible Mode is 20 Hz*1.
*1 The lower limit value for the frequency that the FC5A Series MicroSmart can output is 10 Hz, but in compatibility mode this is 20 Hz.
Notes:
• The lowest frequency of pulses that can be output in FC5A (except FC5A-D12X1E) Compatible Mode is 20 Hz. A frequency lower than 20 Hz
cannot be output. If such a value is specified, the pulse frequency designation error will occur.
• The highest frequency of pulses that can be output with RAMP3 in FC5A (except FC5A-D12X1E) Compatible Mode is 5 kHz. A frequency
higher than 5 kHz cannot be output. If such a value is specified, the pulse frequency error will occur.
The rest of this section is written under the assumption that FC6A Standard Mode has been selected.
Note: For details on the FC5A (except FC5A-D12X1E) Compatible Mode settings, refer to the RAMP3 instruction in Chapter 15 "Pulse Output
Instructions" in the "FC5A Series MicroSmart Pentra User's Manual Advanced Volume".
2. Select instruction
This item selects which RAMP instruction to use ("RAMP1", "RAMP2", "RAMP3" or "RAMP4").
The pulse output port and the reversible control mode and frequency that can be set 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 "9. Reversible
control enable" on page 18-18.
■ Settings tab
6.
7.
8.
9.
10.
11.
12.
13.
14.
Configurable Range
CPU Module Type Instruction
Setting Value Frequency
RAMP1, RAMP2 15 to 100,000 15 Hz to 100 kHz (increments of 1 Hz)
All-in-One Type
RAMP3, RAMP4 15 to 50,000 15 Hz to 5 kHz (increments of 1 Hz)
CAN J1939 All-in-One Type RAMP1 to RAMP4 15 to 100,000 15 Hz to 100 kHz (increments of 1 Hz)
Configurable Range
CPU Module Type Instruction
Setting Value Frequency
RAMP1, RAMP2 15 to 100,000 15 Hz to 100 kHz (increments of 1 Hz)
All-in-One Type
RAMP3, RAMP4 15 to 50,000 15 Hz to 5 kHz (increments of 1 Hz)
CAN J1939 All-in-One Type RAMP1 to RAMP4 15 to 100,000 15 Hz to 100 kHz (increments of 1 Hz)
The ports used on the FC6A Series MicroSmart vary based on the instruction used, the combination of the pulse output mode
and reversible control, and the model used.
Port Used
All-in-One Type CAN J1939 All-in-One Type
Instruction Operating Condition
Pulse Output Reversible Pulse Output Reversible
Port Control Port Port Control Port
Reversible control disabled Q0 — Q0 —
RAMP1 Reversible control (single-pulse output) Q0 Q2*1 Q0 Q1
Reversible control (dual-pulse output) Q0, Q1*2 — Q0, Q1 —
Reversible control disabled Q1 — Q2 —
RAMP2 Reversible control (single-pulse output) Q1 Q3*1 Q2 Q3
Reversible control (dual-pulse output) — — Q2, Q3 —
Reversible control disabled Q2 — Q4 —
RAMP3 Reversible control (single-pulse output) — — Q4 Q5
Reversible control (dual-pulse output) — — Q4, Q5 —
Reversible control disabled Q3 — Q6 —
RAMP4 Reversible control (single-pulse output) — — Q6 Q7
Reversible control (dual-pulse output) — — Q6, Q7 —
*1 When using single-pulse output mode with the All-in-One Type, Q2 or Q3 will be used, so an instruction that uses the same pulse output port
can no longer be used.
*2 When using dual-pulse output mode with the All-in-One Type, Q1 will be used, so an instruction that uses the same pulse output port can no
longer be used.
Specify Absolute
Overview
Position
The RAMP instruction will be executed by specifying Control direction and Preset value.
Disabled
The number of pulses specified by Preset value is output.
The RAMP instruction will be executed by specifying the target absolute position (target position) in Preset value.
The instruction will be executed by calculating the number of pulses to output and the direction from the absolute
Enabled
position managed by the absolute position counter and the target position specified by Preset value.
The Control direction setting is ignored.
Notes:
• If Reversible control disabled is selected for reversible control enable, specify absolute position mode is disabled.
• If the corresponding absolute position counter initialized flag in D8239 (absolute position control status) is 0 (not initialized), a user program
execution error will occur even if the instruction is executed with specify absolute position mode set to Enabled. After starting operation of
the ladder program, execute the ABS instruction that corresponds to the applicable output port one time.
*1 The number of pulses in the frequency change region calculated by the initial pulse frequency, steady pulse frequency, and frequency change
time has exceeded the total number of output pulses. Adjust the settings by decreasing the steady or initial pulse frequency or by shortening
the frequency change time.
*2 Set the initial pulse frequency so that it is lower than the steady pulse frequency.
RAMP S1 S2 D1
1 D0200 M0000 M0050
PAMP instruction
input
Pulse output
complete M0051
RAMP1 instruction (reversible control enabled, single-pulse output mode) timing chart
RAMP S1 S2 D1
1 D0200 M0000 M0050
RAMP instruction
input
Pulse frequency Q0
Reversible control
signal Q2
When the RAMP instruction input is on, pulses are output according to the settings configured by the control registers. The
reversible control signal is output from Q2. When pulse output starts, M0050 turns on. M0052 turns on while the pulse frequency
is increasing or decreasing. Pulses are output so that the frequency reaches the steady pulse frequency from the initial pulse
frequency in the frequency change time. When the frequency change time is specified as 100, the steady pulse frequency is
reached in 100 ms by increasing or decreasing the frequency every 10 ms.
Pulse output stops when the pulses configured by the preset value are output. (The number of pulses is also counted while
changing the frequency.) At this time, M0050 turns off and M0051 turns on.
If the RAMP instruction input turns off during pulse output, pulse output is canceled. If this input turns on again, the operation
starts from the beginning. Even if the contents of the data registers are changed during pulse output, the change is not reflected
in the pulse output operation. The changed content is reflected the next time the RAMP instruction is started.
RAMP1 instruction (reversible control enabled, dual-pulse output mode) timing chart
RAMP S1 S2 D1
1 D0200 M0000 M0050
RAMP instruction
input
Forward pulse Q0
Reverse pulse Q1
When the RAMP instruction input changes from off to on, pulses are output from Q0 or Q1 according to the settings configured by
the control registers.
When pulse output starts, M0050 turns on. M0052 turns on while the pulse frequency is increasing or decreasing.
Pulses are output so that the frequency reaches the steady pulse frequency from the initial pulse frequency in the frequency
change time. When the frequency change time is specified as 100, the steady pulse frequency is reached in 100 ms by increasing
or decreasing the frequency every 10 ms.
Pulse output stops when the pulses configured by the preset value are output. (The number of pulses is also counted while
changing the frequency.) At this time, M0050 turns off and M0051 turns on.
If the RAMP instruction input turns off during pulse output, pulse output is canceled. If this input turns on again, the operation
starts from the beginning. Even if the contents of the data registers are changed during pulse output, the change is not reflected
in the pulse output operation. The changed content is reflected the next time the RAMP instruction is started.
Example:
To output 48,000 pulses with the frequency change function (reversible control disabled) from Q0
M8120 M0000
RAMP S1 S2 D1 When the RAMP instruction input (I0) turns on, pulse output
starts
1 D0000 M0000 M0100
I0000
Setting
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).
When I1 is on, the reversible control signal (Q2) turns on (reverse).
M8120 M0000
RAMP S1 S2 D1 When the RAMP instruction input (I0) turns on, pulse output
starts
1 D0000 M0000 M0100
I0000
MOV(W) S1 - D1 - REP
When I1 is off, store 0 (forward) in control direction (D0003)
0 D0003
I0001
MOV(W) S1 - D1 - REP
When I1 is on, store 1 (reverse) in control direction (D0003)
1 D0003
I0001
Setting
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.
For reverse when I1 is on, pulses (CCW) are output from Q1.
M8120 M0000
RAMP S1 S2 D1
When the RAMP instruction input (I0) turns on, pulse output
1 D0000 M0000 M0100 starts
I0000
MOV(W) S1 - D1 - REP
When I1 is off, store 0 (forward) in control direction
0 D0003 (D0003), and output pulses from Q0
I0001
MOV(W) S1 - D1 - REP
When I1 is on, store 1 (reverse) in control direction
1 D0003 (D0003), and output pulses from Q1
I0001
Setting
n When the input is on, pulses are output according to the frequency
***** ***** ***** *****
change settings stored in the control register specified by S1.
ZRN Mode 0
The zero return is performed by monitoring only the proximity signal specified by S3.
ZRN Mode 1
The zero return is performed by monitoring the proximity signal (decrease frequency trigger) specified by S3 and the origin
signal (stop trigger) specified by S4.
After stopping pulse output with the origin signal, the complete signal specified by D2 can be output.
For ZRN mode 1, the timing to start monitoring the origin signal can be selected from the following two types.
Start monitoring the origin signal with the rise in the proximity signal
(1) The rise in the proximity signal is detected, the frequency starts
[Hz] Frequency Frequency being decreased, and at the same time the origin signal starts
increase time decrease time
being monitored.
Steady pulse frequency (2) The rise in the origin signal is detected and pulse output is stopped.
(3) When pulse output stops, the complete signal turns on at the
Initial pulse frequency
same time.
(3)
Creep pulse frequency (4) The on period for the complete signal is one scan or longer but
[t]
less than two scans.
(1)
S3: Proximity signal ON
OFF
(2)
S4: Origin signal ON
OFF
Start monitoring the origin signal with the fall in the proximity signal
(1) The rise in the proximity signal is detected and the frequency
[Hz] Frequency Frequency
increase time decrease time starts being decreased.
(2) The fall in the proximity signal is detected and the origin signal
Steady pulse frequency
starts being monitored.
(3) The rise in the origin signal is detected and pulse output is
Initial pulse frequency
stopped.
(4)
Creep pulse frequency (4) When pulse output stops, the complete signal turns on at the
[t]
same time.
(1) (2)
S3: Proximity signal ON
OFF
(5) The on period for the complete signal is one scan or longer but
(3) less than two scans.
S4: Origin signal ON
OFF
Notes:
• If a pulse output instruction is simultaneous executed with the same pulse output port, a user program execution will occur. Error code 48 will
be stored in D8006 and instructions that were executed after the initial instruction will be canceled.
• The ZRN instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur.
Error code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur. Error code 19 will be stored in D8006
and instruction execution will be canceled.
• For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Control register — — — — — — — —
S2 (Source 2) Initialization input X — X — — — — — —
S3 (Source 3) Proximity signal X — X — — — — — —
S4 (Source 4) Origin signal X — X — — — — — —
D1 (Destination 1) Operation status — — — — — — — —
D2 (Destination 2) Complete signal — X — — — — — —
Special data registers cannot be designated as S1. Internal relays M0000 through M1277 can be designated as D1. Special internal relays cannot
be designated as D1 and D2.
Settings
■ Devices tab
2. 3. 4. 5. 6. 7. 8.
1.
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.
The lowest frequency that can be used with FC5A (except FC5A-D12X1E) Compatible Mode is 20 Hz.
Note: The lowest frequency of pulses that can be output in FC5A (except FC5A-D12X1E) Compatible Mode is 20 Hz. A frequency lower than 20 Hz
cannot be output. If such a value is specified, the pulse frequency error will occur.
The rest of this section is written under the assumption that FC6A Standard Mode has been selected.
Note: For details on the FC5A (except FC5A-D12X1E) Compatible Mode settings, refer to the ZRN instruction in Chapter 15 "Pulse Output
Instructions" in the "FC5A Series MicroSmart Pentra User's Manual Advanced Volume".
2. Select instruction
This item selects which ZRN instruction to use ("ZRN1", "ZRN2", "ZRN3" or "ZRN4").
The pulse output port and the reversible control mode and frequency that can be set 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 "17. Reversible
control enable" on page 18-33.
Setting
Storage
Function CAN J1939 All-in- Reference
Destination All-in-One Type
One Type
Initial pulse frequency ZRN1, ZRN2: 15 to 100,000
Starting number+0 ZRN1 to ZRN4:
(high word)*1 (increments of 1 Hz) "10. Initial Pulse
15 to 100,000
Initial pulse frequency ZRN3, ZRN4: 15 to 5,000 Frequency" on page 18-32
Starting number+1 (increments of 1 Hz)
(low word)*1 (increments of 1 Hz)
Creep pulse frequency ZRN1, ZRN2: 15 to 100,000
Starting number+2 ZRN1 to ZRN4:
(high word)*1 (increments of 1 Hz) "11. Creep Pulse
15 to 100,000
Creep pulse frequency ZRN3, ZRN4: 15 to 5,000 Frequency" on page 18-32
Starting number+3 (increments of 1 Hz)
(low word)*1 (increments of 1 Hz)
"12. Error status" on page
Starting number+4 Error status 10 to 10,000 ms
18-32
Starting number+5 Reserved
Steady pulse frequency ZRN1, ZRN2: 15 to 100,000
Starting number+6 ZRN1 to ZRN4:
(high word)*1 *2 (increments of 1 Hz) "13. Steady pulse
15 to 100,000
Steady pulse frequency ZRN3, ZRN4: 15 to 5,000 frequency" on page 18-32
Starting number+7 (increments of 1 Hz)
(low word)*1 *2 (increments of 1 Hz)
"14. Acceleration time" on
Starting number+8 Acceleration time*2 10 to 10,000 ms
page 18-32
"15. Deceleration time" on
Starting number+9 Deceleration time*2 10 to 10,000 ms
page 18-33
0: Forward "18. Control direction" on
Starting number+10 Control direction*2 *3
1: Reverse page 18-33
Starting number+11 Reserved
Starting number+12 Reserved
Starting number+13 Reserved
*1 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see "32-bit Data Storage" on
page 3-9.
*2 When ZRN mode 0 is specified for the zero return method, starting number+6 to +10 are invalid.
*3 Valid only when Reversible control (single-pulse output) or Reversible control (dual-pulse output) is selected for reversible control enable.
Notes:
• Do not use the same input or internal relay as the proximity signal for the ZRN1, ZRN2, ZRN3 and ZRN4 instructions. If they operate
simultaneously, pulse output may not stop even if the proximity signal changes from on to off.
• To use the high-speed proximity signal, set the relevant input to Normal Input under Special Input on Function Area Settings. Do not
use the input as interrupt input, catch input, high-speed counter, or frequency measurement.
• When using the high-speed proximity signal, ensure that no bounce occurs in the proximity signal.
Notes:
• Do not use the same input or internal relay as the origin signal for the ZRN1, ZRN2, ZRN3, or ZRN4 instructions.
If they operate simultaneously, pulse output may not stop even if the origin signal changes from on to off.
• To use a high-speed origin signal, set the relevant input to Normal Input under Special Inputs on Function Area Settings. Do not use
the input as interrupt input, catch input, high-speed counter, or frequency measurement.
• When using a high-speed origin signal, ensure that no bounce occurs in the origin signal.
Storage
Function Setting
Destination
This relay turns on during pulse output. This relay turns
0: Pulse output OFF
Starting number+0 Pulse output ON off when ZRN instruction input is turned off or when pulse
1: Pulse output ON
output is complete.
Pulse output 0: Pulse output not complete This relay turns on when pulse output is complete.
Starting number+1
complete 1: Pulse output complete This relay turns off when pulse output starts.
This relay turns on when the pulse output status is
Pulse output 0: Steady pulse output
Starting number+2 changing.
status 1: Changing output pulse frequency
This relay turns off when the pulse output status is steady.
This relay turns on when the zero return operation is
Zero return 0: Zero return not complete
Starting number+3 complete.
complete 1: Zero return complete
This relay turns off when the zero return operation starts.
(1)
ON
Origin signal OFF
ON
Complete signal OFF
■ Settings tab
This tab configures the operation of the ZRN instruction functions.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
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.
ZRN mode 1 The zero return is performed by monitoring the proximity signal and the origin signal.
Timing Description
Proximity signal OFF→ON After the proximity signal changes from off to on, the change from off to on in the origin signal is monitored.
After the proximity signal changes from off to on and then next changes from on to off, the change from off
Proximity signal ON→OFF
to on in the origin signal is monitored.
Reversible control Single-pulse Pulse A is used as pulse output. Pulse B on/off is used as Q0
output reversible control.
Q2
The ports used on the FC6A Series MicroSmart vary based on the instruction used, the combination of the pulse output mode
and reversible control, and the model used.
Port Used
All-in-One Type CAN J1939 All-in-One Type
Command Operating Condition
Pulse Output Reversible Pulse Output Reversible
Port Control Port Port Control Port
Reversible control disabled Q0 — Q0 —
ZRN1 Reversible control Single-pulse output mode Q0 Q2 Q0 Q1
Reversible control Dual-pulse output mode Q0, Q1 — Q0, Q1 —
Reversible control disabled Q1 — Q2 —
ZRN2 Reversible control Single-pulse output mode Q1 Q3 Q2 Q3
Reversible control Dual-pulse output mode — — Q2, Q3 —
Reversible control disabled Q2 — Q4 —
ZRN3 Reversible control Single-pulse output mode — — Q4 Q5
Reversible control Dual-pulse output mode — — Q4, Q5 —
Reversible control disabled Q3 — Q6 —
ZRN4 Reversible control Single-pulse output mode — — Q6 Q7
Reversible control Dual-pulse output mode — — Q6, Q7 —
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
ZRN S1 S2 S3 S4 D1 D2
ZRN instruction
1 D0200 M0000 I0002 M0010
input
Initial speed
Creep speed
Pulse frequency Q0
Proximity signal I2
Pulse output
complete M0011
Pulse output
status M0012
Zero return
complete M0013
• When the ZRN1 instruction changes from off to on, pulses are output at the initial pulse frequency.
• When pulse output starts, M0010 turns on, and M0011 and M0013 turn off.
• When I2 changes from off to on, pulses are output at the creep pulse frequency.
• When pulse output stops, M0010 turns off, and M0011 and M0013 turn on.
• If the ZRN1 instruction input turns off during pulse output, pulse output stops. If the input turns on again, the operation starts from the
beginning.
• Even if the contents of the data registers are changed during pulse output, the change is not reflected in pulse output operation. The
changed content is reflected the next time the ZRN1 instruction is started.
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
ZRN S1 S2 S3 S4 D1 D2
ZRN instruction
1 D0200 M0000 I0002 I0003 M0010 M0100
input
Steady pulse frequency
Proximity signal I2
Origin signal I3
Pulse output
M0011
complete
Pulse output
M0012
status
Zero return
M0013
complete
• When the ZRN1 instruction changes from off to on, pulses are output at the initial pulse frequency, and then pulses are output so that the
frequency reaches the steady pulse frequency from the initial pulse frequency in the frequency change time. When the frequency change
time is specified as 100, the steady pulse frequency is reached in 100 ms by increasing or decreasing the frequency every 10 ms.
• When pulse output starts, M0010 turns on and M0011 turns off.
• When I2 changes from off to on, the pulse speed starts to decrease and reaches the creep pulse frequency.
• When pulse output stops, M0100 turns on. M0100 turns on for one scan or longer but less than two scans.
• When M0100 changes from on to off and the zero return operation has completed, M0013 turns on.
• Then when pulse output stops, M0010 turns off and M0011 turns on.
• If the ZRN1 instruction input turns off during pulse output, pulse output stops. If the input turns on again, the operation starts from the
beginning.
• Even if the contents of the data registers are changed during pulse output, the change is not reflected in pulse output operation. The
changed content is reflected the next time the ZRN1 instruction is started.
Example:
To perform a zero return operation with proximity signal I2, initial pulse frequency 3 kHz, and creep pulse frequency 800 Hz
R
Pulse output complete (M0101) off
M0101
Setting
Frequency
Step 1 Step 2 Step 3 Step 4
Before Before Before After
Steady pulse
frequency
Steady pulse
frequency
Steady pulse
frequency
Time
When the initialization input specified by S2 is turned on, the initial values configured in the WindLDR ARAMP (Ramp Pulse
Output with Table) are stored in the control registers.
When the interrupt input specified by S3 is turned on, the step being executed is aborted and the interrupt step is executed.
The preset value and the steady pulse frequency for the running step are stored in the monitor registers specified by D1.
The control status including the pulse output status (output on/output direction/output complete) is stored in the operation status
specified by D2.
Notes:
• If a pulse output instruction is simultaneous executed with the same pulse output port, a user program execution will occur.
Error code 48 will be stored in D8006 and instructions that were executed after the initial instruction will be canceled.
• The ARAMP instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur.
Error code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur.
Error code 19 is stored in D8006 and instruction execution is canceled.
• For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Control register — — — — — — — —
S2 (Source 2) Initialization input X — X — — — — — —
S3 (Source 3) Interrupt input X — X — — — — — —
D1 (Destination 1) Monitor register — — — — — — — —
D2 (Destination 2) Operation status — — — — — — — —
Special data registers cannot be designated as S1. Internal relays M0000 through M1277 can be designated as D1. Special internal relays cannot
be designated as D1.
Settings
■ Devices tab
1. 2. 3. 4. 5. 6.
7.
1. Select instruction
This item selects which ARAMP instruction to use ("ARAMP1", "ARAMP2", "ARAMP3" or "ARAMP4").
The output port, 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. Reversible
control enable" on page 18-43.
• To use a high-speed interrupt input signal, set the relevant input to Normal Input under Special Inputs on Function Area Settings. Do
not use the input as interrupt input, catch input, high-speed counter, or frequency measurement.
• When using the high-speed interrupt input, ensure that no bounce occurs in the interrupt input.
• When the interrupt input is turned on, the control direction (forward or reverse) is unchanged regardless of the control direction of the
interrupted step.
Setting
Address Function CAN J1939 All-in- Reference
All-in-One Type
One Type
"Next step number" on
Starting number+0 Next step number 0 to 18
page 18-41
"Running step number" on
Starting number+1 Running step number 1 to 18
page 18-41
Steady pulse frequency ARAMP1, ARAMP2:
Starting number+2
monitor (high word)*1 15 to 100,000
ARAMP1 to ARAMP4:
(increments of 1 Hz) "Steady pulse frequency
15 to 100,000
Frequency change time ARAMP3, ARAMP4: monitor" on page 18-41
Starting number+3 (increments of 1 Hz)
monitor (low word)*1 15 to 5,000
(increments of 1 Hz)
Starting number+4 Reserved
Frequency change time 10 to 10,000 (increments of 10 ms) "Frequency change time
Starting number+5
monitor The first digit of the setting is discarded. monitor" on page 18-41
Preset value monitor
Starting number+6
(high word)*1 "Preset value monitor" on
1 to 100,000,000 pulses
Preset value monitor page 18-41
Starting number+7
(low word)*1
Starting number+8 Current value (high word)*1 "Current value" on page
1 to 100,000,000 pulses
Starting number+9 Current value (low word)*1 18-41
"Error status" on page 18-
Starting number+10 Error status 0 to 9
42
*1 The upper and lower data registers change according to the 32-bit data storage method specified.
For details, see "32-bit Data Storage" on page 3-9.
Current value
This register stores the number of pulses that have been output for the step that is currently being executed. The current
value is updated when the ARAMP instruction is executed at each scan.
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.
Address Description
This relay turns on during pulse output.
Pulse output 0: Pulse output OFF This relay turns off when the ARAMP instruction output stops.
Starting number+0
ON 1: Pulse output ON This relay turns off when the specified number of pulses are
output and output ends
This relay turns on when pulse output completes.
Pulse output 0: Pulse output not complete This relay turns on when the step number currently being
Starting number+1
complete 1: Pulse output complete executed is 0.
This relay turns off when the ARAMP instruction output starts.
Pulse output 0: Steady pulse output This relay turns off when the pulse output status is steady.
Starting number+2
status 1: Changing output pulse frequency This relay turns on when the pulse output is changing.
This relay turns on when the pulses output exceed the
configured preset value.
0: None Pulse output continues even if an the overflow occurs during
Starting number+3 Overflow
1: An overflow has occurred steady output or while the pulse frequency is changing.
However, pulse counting (current value data register) is
suspended at the point when the overflow occurred.
This relay turns off when the output direction of the pulses
Pulse output 0: Forward being output is forward.
Starting number+4
direction 1: Reverse This relay turns on when the output direction of the pulses
being output is reverse.
7. Preview
Displays a preview of the configured ARAMP instruction operation. The change in pulse output frequency, forward/reverse
operation, and the execution order of the steps can be checked.
The vertical axis indicates the pulse frequency and the horizontal axis indicates time.
The width of each step is locked, so the actual proportion of the horizontal axis is not accurate.
■ Settings tab
8.
9.
10.
11.
The ports used on the FC6A Series MicroSmart varies based on the instruction used, the combination of the pulse output mode
and reversible control, and the model used.
Port Used
All-in-One Type CAN J1939 All-in-One Type
Instruction Operating Condition
Pulse Output Reversible Pulse Output Reversible
Port Control Port Port Control Port
Reversible control disabled Q0 — Q0 —
ARAMP1 Reversible control (single-pulse output) Q0 Q2*1 Q0 Q1
Reversible control (dual-pulse output) Q0, Q1*2 — Q0, Q1 —
Reversible control disabled Q1 — Q2 —
ARAMP2 Reversible control (single-pulse output) Q1 Q3*1 Q2 Q3
Reversible control (dual-pulse output) — — Q2, Q3 —
Reversible control disabled Q2 — Q4 —
ARAMP3 Reversible control (single-pulse output) — — Q4 Q5
Reversible control (dual-pulse output) — — Q4, Q5 —
Reversible control disabled Q3 — Q6 —
ARAMP4 Reversible control (single-pulse output) — — Q6 Q7
Reversible control (dual-pulse output) — — Q6, Q7 —
*1 When using single-pulse output, Q2 or Q3 will be used, so a Q2 or Q3 pulse output instruction cannot be used.
*2 When using dual-pulse output, Q1 will be used, so a Q1 pulse output instruction cannot be used.
9. Number of steps
This setting specifies the number of steps. The maximum is 18.
12.
13.
14.
15.
16.
17.
Control direction
When reversible control is enabled, store 0 in this data register for forward operation and store 1 in this data register for reverse
operation.
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. In the After column, the steady pulse frequency is maintained, then the frequency
changes, and the instruction transitions to the next step.
Before After
Increase
Decrease
Note: Depending on the combination of steps and the interrupt input timing, forward and reverse may switch at high frequencies. Program the user
program so that forward and reverse can be switched according to the application specifications that will be used.
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 S1 S2 S3 D1 D2
Pulse frequency Q0
Pulse output
M0051
complete
When the ARAMP instruction input changes from off to on, pulses are output according to the settings configured by the data
registers. When pulse output starts, M0050 turns on. M0052 turns on while the pulse frequency is increasing or decreasing. When
the number of pulses configured for each step is output, the next step is executed. When pulse output is complete for the step
where the next step number is set to 0, then the pulses will stop. In this situation, M0050 turns off and M0051 turns on.
If the ARAMP instruction input turns off during pulse output, pulse output ends. If the ARAMP instruction input turns on again, the
operation starts from the beginning. Even if the contents of the data registers are changed during pulse output, the change is not
reflected in the pulse output operation. The changed content is reflected the next time the ARAMP instruction is started.
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 S1 S2 S3 D1 D2
1 D0200 M0000 D0000 M0050
ARAMP instruction
input
Pulse frequency Q0
When the ARAMP instruction input changes from off to on, pulses are output from Q0 according to the settings configured by the
data registers. The reversible control signal is output from Q2 or Q1. When pulse output starts, M0050 turns on. M0052 turns on
while the pulse frequency is increasing or decreasing. When the number of pulses configured for each step is output, the next step
is executed. When pulse output is complete for the step where the next step number is set to 0, then the pulses will stop. In this
situation, M0050 turns off and M0051 turns on.
If the ARAMP instruction input turns off during pulse output, pulse output ends. If this input turns on again, the operation starts
from the beginning. Even if the contents of the data registers are changed during pulse output, the change is not reflected in the
pulse output operation. The changed content is reflected the next time the ARAMP instruction is started.
In this application, switching between forward and reverse must be executed when the pulse frequency is decreased to the
minimum value, so a step is inserted to decrease the frequency before reversing.
All-in-One Type, 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 S1 S2 S3 D1 D2
1 D0200 M0000 D0000 M0050
ARAMP instruction
input
Pulse output
M0051
complete
When the ARAMP instruction input changes from off to on, pulses are output from Q0 according to the settings configured by the
data registers. The reversible control signal is output from Q0 or Q1. When pulse output starts, M0050 turns on. M0052 turns on
while the pulse frequency is increasing or decreasing. The pulses increase and decrease according to the frequency change time
until they reach the steady pulse frequency from the current pulse frequency. When the configured number of pulses are output,
the pulses stop. In this situation, M0050 turns off and M0051 turns on.
If the ARAMP instruction input turns off during pulse output, pulse output ends. If the ARAMP instruction input turns on again, the
operation starts from the beginning. Even if the contents of the data registers are changed during pulse output, the change is not
reflected in the pulse output operation. The changed content is reflected the next time the ARAMP instruction is started.
In this application, switching between forward and reverse must be executed when the pulse frequency is decreased to the
minimum value, so a step is inserted to decrease the frequency before reversing.
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
100 Hz
15 Hz
Frequency change time Frequency change time Frequency change time
2,000 ms 2,000 ms 4,000 ms
ARAMP S1 S2 S3 D1 D2 When the ARAMP instruction input (I0) turns on, pulse
output starts
1 D0000 M0000 D0030 M0050
I0
Basic settings
Step 1 settings
Step 2 settings
Step 3 settings
When outputting pulses as shown in the diagram below with the frequency change function (single-pulse output
reversible control enabled) using the following settings
Pulses are output from Q0 and the reversible control signal is output from Q2.
Preset value 5,000 Preset value 5,000 Preset value 5,000 Preset value 5,000
1 kHz
Q0
15 Hz
Frequency Frequency Frequency Frequency
change time change time change time change time
3,000 ms 3,000 ms 3,000 ms 3,000 ms
ON
Q2
OFF
Forward Reverse
ARAMP S1 S2 S3 D1 D2 When the ARAMP instruction input (I0) turns on, pulse
1 D0000 M0000 D0040 M0050 output starts
I0000
MOV(W) S1 - D1 - REP
5000 D0002 When the MOV instruction input (I1) turns on, the steady
I0001
pulse frequencies for step 2 and step 4 (D0002, D0003 and
MOV(W) S1 - D1 - REP D0018, D0019) are changed to 5 kHz.
5000 D0018
Basic settings
Step 1 settings
Step 2 settings
Step 3 settings
Step 4 settings
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 Step 5
Preset value 100,000 Preset value 100,000 Preset value 1,000,000 Preset value 1,000,000 Preset value 100,000
50 kHz
10 kHz
5 kHz
Frequency
change time
5,000 ms
15 Hz
Frequency change time Frequency change time Frequency change time Frequency change time Frequency change time
5,000 ms 5,000 ms 8,000 ms 8,000 ms 8,000 ms
ARAMP S1 S2 S3 D1 D2 When the ARAMP instruction input (I0) turns on, pulse
output starts
1 D0000 M0000 M0100 D0023 M0060
I0000
Basic settings
Step 1 settings
Step 2 settings
Step 3 settings
Step 4 settings
Step 5 settings
Step 6 settings
ABS S1
1 *****
ABS S1
2 *****
ABS S1
3 *****
ABS S1
4 *****
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.
When updated, 1 is stored in the absolute position counter initialized flag in special data register D8239 (absolute position control
status).
Notes:
• Do not execute the ABS instruction while the RAMP, ARAMP, ZRN, or JOG instructions are being executed. The absolute position counters may
be initialized with an unintended value.
• Program the user program so that the ABS instruction will be executed after user program execution starts and before specifying the absolute
position and executing the RAMP (Trapezoidal Control) instruction.
• When multiple ABS instructions are executed in the same scan, the content of the last executed ABS instruction is reflected in the absolute
value counters.
• The ABS instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur. Error
code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur.
Error code 19 will be stored in D8006 and instruction execution will be canceled.
• For user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Initial value — — — — — — X X —
Settings
■ Devices tab
1. 2.
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.
The initialized status of D8240 to D8247 can be checked with the absolute position counter initialized flags defined in D8239
(absolute position control status).
When the FC6A Series MicroSmart switches from stop to run, 0 (not initialized) is stored in the absolute position counter
initialized flags. Then when the absolute position counters are initialized using the ABS instruction, 1 (initialized) is stored.
*1 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see "32-bit Data Storage" on
page 3-9.
Example:
Return
start
ZRN S1 S2 S3 S4 D1 D2
1 D0000 M0000 I0000 ***** M0100 *****
M0050
Return
complete
ABS S1
1 100
M0101
Return Return Return
start complete start
R
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.
Setting
JOG S1 S2 S3 D1
1 ***** ***** ***** *****
JOG S1 S2 S3 D1
2 ***** ***** ***** *****
JOG S1 S2 S3 D1
3 ***** ***** ***** *****
JOG S1 S2 S3 D1
4 ***** ***** ***** *****
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. When the steady
pulse frequency is reached, steady pulses are output.
When the JOG input specified by S3 is turned off, the pulses slow at a constant rate until the initial pulse frequency is reached, and
when the initial pulse frequency is reached, pulse output stops.
The pulse control information (output on/output complete/error) is stored in the internal relays specified by D1 as the operation
status.
When the initialization input specified by S2 is turned on, the initial values configured in the WindLDR JOG (JOG Control) dialog
box, on the Settings tab, are stored in the control registers.
Notes:
• If a pulse output instruction is simultaneous executed with the same pulse output port, a user program execution will occur.
Error code 48 will be stored in D8006 and instructions that were executed after the initial instruction will be canceled.
• The JOG instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error will occur. Error
code 18 will be stored in D8006 and instruction execution will be canceled.
• If a pulse output instruction is executed with the relay output type, a user program execution will occur.
Error code 19 will be stored in D8006 and instruction execution will be canceled.
• For user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Control register — — — — — — — —
S2 (Source 2) Initialization input X — X — — — — — —
S3 (Source 3) JOG input X — X — — — — — —
D1 (Destination 1) Status code — — — — — — — —
Special data registers cannot be designated as S1. Special internal relays cannot be designated as D1.
Settings
■ Devices tab
1. 2. 3. 4. 5.
1. Select instruction
This item selects which JOG instruction to use ("JOG1", "JOG2", "JOG3", or "JOG4").
The output port 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. Reversible
control enable" on page 18-66.
Setting
Storage
Function CAN J1939 All-in- Reference
Destination All-in-One Type
One Type
JOG1, JOG2:
Steady pulse frequency
Starting number+0 15 to 100,000
(high word)*1 JOG1 to JOG4:
(increments of 1 Hz) "6. Steady pulse frequency" on
15 to 100,000
JOG3, JOG4: page 18-66
Steady pulse frequency (increments of 1 Hz)
Starting number+1 15 to 5,000
(low word)*1
(increments of 1 Hz)
JOG1, JOG2:
Initial pulse frequency
Starting number+2 15 to 100,000
(high word)*1 JOG1 to JOG4:
(increments of 1 Hz) "7. Initial pulse frequency" on
15 to 100,000
JOG3, JOG4: page 18-66
Initial pulse frequency (increments of 1 Hz)
Starting number+3 15 to 5000
(low word)*1
(increments of 1 Hz)
"8. Acceleration time" on page
Starting number+4 Acceleration time 10 to 10,000 (ms)
18-66
"9. Deceleration time" on page
Starting number+5 Deceleration time 10 to 10,000 (ms)
18-66
0: Forward "11. Control direction" on
Starting number+6 Control direction
1: Reverse page 18-67
Starting number+7 Reserved
Starting number+8 Current value (high word)*1 "12. Current value" on page
1 to 100,000,000 pulses*2
Starting number+9 Current value (low word)*1 18-67
"13. Error status" on page 18-
Starting number+10 Error status 0 to 3
67
Starting number+11 Reserved
*1 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see "32-bit Data Storage" on
page 3-9.
*2 When starting pulse output, the current value is reset.
■ Settings tab
6.
7.
8.
9.
10.
11.
12.
13.
8. Acceleration time
Specifies the time to increase the pulse frequency. Set the value in the range of 10 to 10,000 ms in increments of 10 ms. The
digit in the ones place of the set value is discarded. For example, if 144 is entered, the set value is 140 ms.
9. Deceleration time
This setting specifies the time to decrease the pulse frequency. Set the value in the range of 10 to 10,000 ms in increments of
10 ms. The digit in the ones place of the set value is discarded. For example, if 144 is entered, the set value is 140 ms.
The used ports differ by the instruction used, the combination of the pulse output mode and reversible control, and the model
used.
Port Used
All-in-One Type CAN J1939 All-in-One Type
Command Operating Condition
Pulse Output Reversible Pulse Output Reversible
Port Control Port Port Control Port
Reversible control disabled Q0 — Q0 —
JOG1 Reversible control Single-pulse output Q0 Q2*1 Q0 Q1
Reversible control Dual-pulse output Q0, Q1*2 — Q0, Q1 —
Reversible control disabled Q1 — Q2 —
JOG2 Reversible control Single-pulse output Q1 Q3*1 Q2 Q3
Reversible control Dual-pulse output — — Q2, Q3 —
Port Used
All-in-One Type CAN J1939 All-in-One Type
Command Operating Condition
Pulse Output Reversible Pulse Output Reversible
Port Control Port Port Control Port
Reversible control disabled Q2 — Q4 —
JOG3 Reversible control Single-pulse output — — Q4 Q5
Reversible control Dual-pulse output — — Q4, Q5 —
Reversible control disabled Q3 — Q6 —
JOG4 Reversible control Single-pulse output — — Q6 Q7
Reversible control Dual-pulse output — — Q6, Q7 —
*1 When using single-pulse output mode with the All-in-One Type, Q2 or Q3 will be used, so an instruction that uses the same pulse output port
can no longer be used.
*2 When using dual-pulse output mode with the All-in-One Type, Q1 will be used, so an instruction that uses the same pulse output port can no
longer be used.
With the All-in-One Type, JOG1 instruction, S1 is specified as D0200, D1 is specified as internal relay M0050
JOG S1 S2 S3 D1
M0000
1 D0200 M0010 I0004 M0050
• When the JOG1 input is on, the I4 monitor starts. When I4 is turned on, pulses are output according to the settings configured by the control
registers.
• M0050 turns on during pulse output. M0052 turns on while the pulse frequency is increasing, and M0052 turns off while decreasing.
• Pulses are output so that the frequency reaches the steady pulse frequency from the initial pulse frequency in the acceleration time. The
frequency increases or decreases every 10 ms.
• When I4 turns off, the frequency starts to decrease, and then when the frequency reaches the initial pulse frequency, pulse output stops. At
this time, M0050 turns off and M0051 turns on.
• If I4 turns off while the frequency is increasing, the frequency starts to decrease, and then when the frequency reaches the initial pulse
frequency, pulse output stops.
• If I4 turns on while the frequency is decreasing, it once again starts to increase, and pulses are output so the frequency reaches the steady
pulse frequency.
• Even if the contents of the control registers are changed during pulse output, the change is not reflected in the operation of pulse output.
The changed content will be reflected when pulses are next output after pulse output is first stopped and M0050 is turned off.
Example:
When performing a JOG operation by outputting pulses with a frequency change (reversible control disabled) from Q0
Initialization
Initialize input
Turn on initialization input (M0000)
R
M8120 M0000
Control Initialization JOG input Operation
register input status
When the JOG instruction input (M0001) is on and
JOG S1 S2 S3 D1
the JOG input (I0) is turned on, pulse output starts.
1 D0000 M0000 I0000 M0010
M0001
Setting
PID S1 S2 S3 S4 D1
***** ***** ***** ***** *****
Notes:
• The PID instruction and the PIDA instruction can be mixed in a single program, and a maximum of 32 instructions can be used.
• For details on the PID instruction, see Chapter 14 "PID Instruction" in the "FC5A Series MicroSmart Pentra User's Manual Advanced Volume".
PIDA S1 S2 S3 S4
***** ***** ***** *****
Notes:
• The PID instruction and the PIDA instruction can be mixed in a single program, and a maximum of 32 instructions can be used.
• For details on the PIDA instruction, see "PIDA (PID Control)" on page 19-3.
PIDD ** S1 S2 S3 SP PV MV
***** ***** ***** ***** ***** *****
Notes:
• A maximum of 32 PIDD instructions can be used in a user program. PID and PIDA instructions are counted separately.
• For details on the PIDD instruction, see "PIDD (PID with Derivative Decay)" on page 19-26.
PIDA S1 S2 S3 S4
***** ***** ***** *****
Operation
When the input is on, auto tuning and PID control are performed.
• Special technical knowledge about the PID control is required to use the PIDA function of the FC6A Series MicroSmart.
Warning Use of the PIDA function without understanding the PID control may cause the FC6A Series MicroSmart to perform
unexpected operation, resulting in disorder of the control system, damage, or accidents.
• When using the PIDA instruction for feedback control, emergency stop and interlocking circuits must be configured
outside the FC6A Series MicroSmart. If these are configured in the internal circuit and the process variable is not input
correctly, there is a risk of no longer being able to perform proper feedback control, which may damage connected
devices or cause accidents.
For PID control, see "PID Control" on page 19-23.
The PIDA instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution
Caution error occurs, the execution of the instruction is canceled, and the next instruction is executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
Note: The PIDA instruction and the PID instruction can be mixed in a single program, and a maximum of 32 instructions can be used.
Valid Devices
Special data registers cannot be designated as S1 and S4. Special internal relays cannot be designated as S3.
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.
■Devices tab
1. 2. 3. 4.
5.
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
6.
7.
■Input tab
This tab configures the input parameters for the PIDA instruction.
1.
2.
3.
4.
5.
6.
10. 11. 12. 13.
8.
9.
7.
PID control executed PID control executed PID control executed PID control executed PID control executed
Sampling period > Scan time
PIDA instruction executed PIDA instruction executed PIDA instruction executed PIDA instruction executed PIDA instruction executed
0 ms 60 ms 120 ms 180 ms 240 ms
Scan time
(60 ms)
0 ms 80 ms 160 ms 240 ms
Sampling period
(40 ms)
PID control executed PID control executed PID control executed PID control executed
7. Advanced/Basic
Click this button to show or hide the advanced settings.
On the Input tab, Sampling Period (6) can be set as an advanced setting.
OFF
OFF
- Alarm action point Set point + Alarm action point
193.0°C 195.0°C 200.0°C
When process variable ≥ 195.0°C, the alarm output is turned ON.
When process variable ≤ 193.0°C, the alarm output is turned OFF.
Set point: 200.0°C
5.0°C
Alarm value: 5.0°C
Hysteresis: 2.0°C 2.0°C
Turns ON the alarm output when process variable ≤
(set point + alarm value). ON
OFF
OFF
- Alarm action point Set point + Alarm action point
195.0°C 197.0°C 200.0°C
When process variable ≤ 195.0°C, the alarm output is turned ON.
When process variable ≥ 197.0°C, the alarm output is turned OFF.
Turns ON the alarm output when process variable ≥ Set point: 200.0°C
5.0°C 5.0°C
(set point + alarm value). Alarm value: 5.0°C
Turns ON the alarm output when process variable ≤ Hysteresis: 2.0°C 2.0°C 2.0°C
(set point - alarm value).
Turns OFF the alarm output when (set point - alarm ON
value + hysteresis) ≤ process variable ≤ (set point +
alarm value - hysteresis).
When (set point + alarm value - hysteresis) < process
OFF
variable < (set point + alarm value), the alarm output
maintains the state of the previous scan. 195.0°C 197.0°C 200.0°C 203.0°C 205.0°C
Upper/Lower Limit When (set point - alarm value) < process variable < When process variable ≥ 205.0°C, the alarm output is turned ON.
(set point - alarm value + hysteresis), the alarm When process variable ≤ 195.0°C, the alarm output is turned ON.
Alarm
output maintains the state of the previous scan. When 197.0°C ≤ process variable ≤ 203.0°C, the alarm output is turned OFF.
Alarm value Alarm value
Hysteresis Hysteresis
ON
OFF
Alarm action point Set point Alarm action point
Hysteresis Hysteresis
ON
OFF
Alarm action point Set point Alarm action point
Turns ON the alarm output when process variable ≥ Alarm value: 205.0°C
alarm value. Hysteresis: 2.0°C 2.0°C
Turns OFF the alarm output when process variable ≤
(alarm value - hysteresis). ON
When (alarm value - hysteresis) < process variable <
alarm value, the alarm output maintains the state of
the previous scan. OFF
Process High Alarm Hysteresis 203.0°C 205.0°C
ON
When process variable ≥ 205.0°C, the alarm output is turned ON.
When process variable ≤ 203.0°C, the alarm output is turned OFF.
OFF
Alarm action point
Turns ON the alarm output when process variable ≤ Alarm value: 195.0°C
alarm value. Hysteresis: 2.0°C 2.0°C
Turns OFF the alarm output when process variable ≥
(alarm value + hysteresis). ON
When alarm value < process variable < (alarm value
+ hysteresis), the alarm output maintains the state of
the previous scan. OFF
Process Low Alarm Hysteresis 195.0°C 197.0°C
When process variable ≤ 195.0°C, the alarm output is turned ON.
ON When process variable ≥ 197.0°C, the alarm output is turned OFF.
OFF
Alarm action point
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).
When (set point + alarm value - hysteresis) < process ON
variable < (set point + alarm value), the alarm output
maintains the state of the previous scan.
The gray-colored portion is where the standby
OFF
function operates.
Upper Limit Alarm 200.0°C 203.0°C 205.0°C
with Standby Alarm value When process variable ≥ 205.0°C, the alarm output is turned ON.
Hysteresis When process variable ≤ 203.0°C, the alarm output is turned OFF.
ON
OFF
- Alarm action point Set point + Alarm action point
ON
OFF
- Alarm action point Set point + Alarm action point
Turns ON the alarm output when process variable ≥ Set point: 200.0°C
(set point + alarm value). Alarm value: 5.0°C 5.0°C 5.0°C
Turns ON the alarm output when process variable ≤ Hysteresis: 2.0°C 2.0°C 2.0°C
(set point - alarm value).
Turns OFF the alarm output when (set point - alarm ON
value + hysteresis) ≤ process variable ≤ (set point +
alarm value - hysteresis).
When (set point + alarm value - hysteresis) < process
OFF
variable < (set point + alarm value), the alarm output
maintains the state of the previous scan. 195.0°C 197.0°C 200.0°C 203.0°C 205.0°C
When (set point - alarm value) < process variable <
When process variable ≥ 205.0°C, the alarm output is turned ON.
(set point - alarm value + hysteresis), the alarm
Upper/Lower Limit When process variable ≤ 195.0°C, the alarm output is turned ON.
output maintains the state of the previous scan.
Alarm with Standby The gray-colored portion is where the standby When 197.0°C ≤ process variable ≤ 203.0°C, the alarm output is
turned OFF.
function operates.
Hysteresis Hysteresis
ON
Notes:
• Alarm action point
This indicates the point where the alarm output changes from OFF to ON.
• Standby function
This function does not immediately turn ON the alarm output when starting execution of the PIDA instruction, even when the process
variable is in the alarm output ON range.
The standby function is canceled when the process variable enters the alarm output OFF range, and when the process variable enters the
alarm output ON range, the alarm output will turn ON.
If the set point is changed, the standby function will be enabled again.
ON
PID instruction input
OFF
ON
Alarm output
OFF
Cancel standby
■Control tab
This tab configures the control parameters for the PIDA instruction.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
100% 100%
0% 0%
■Output tab
This tab configures the output parameters for the PIDA instruction.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
2. Device Address
Shows the control register (S1+19) configured on the devices tab when Data Register is specified as the output manipulated
variable (1).
3. Data Type
Select the output manipulated variable (1) data type as W (word) or I (integer).
OFF
1s 5s 10 s
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.
13. Advanced/Basic
Click this button and you can show or hide the advanced settings. On the Output tab, Output Manipulated Variable Limit (6),
Output Manipulated Variable Upper Limit/Percentage (7), Output Manipulated Variable Lower Limit (8), Manual Mode Output MV
(9), Output MV Rate-of-Change (10), Proportional Band Offset (11), and Control Period (12) can be set as advanced settings.
Storage
Function Setting Details R/W
Destination
Set a value between 1 and 65,535 (0.1 to 6553.5 seconds).
S1+10 Derivative time R/W
When derivative time is 0, derivative time is disabled.
Set a value between 0 and 100 (0 to 100%)
S1+11 Derivative gain R/W
Derivative gain of 0 operates as 0% and 101 or higher operates as 100%.
Set a value between 0 and 100 (0 to 100%)
S1+12 ARW R/W
ARW of 101 or higher operates as 100%.
Set a value that satisfies process variable minimum value < (set point - AT bias
setting value) and process variable maximum value > (set point + AT bias
S1+13 AT bias R/W
setting value). When a value is set that does not satisfy both conditions listed
above, 133 is stored in the operation status (S1+2).
• When Enable (upper and lower limits)
Set a value between 0 and 100 (0 to 100%)
Operates as 100 for a value other than 0 to 100.
• When Enable (percentage)
Output manipulated variable
S1+14 Set a value between 10001 and 10099 (1 to 99%) R/W
upper limit/percentage
Operates as the "Output manipulated variable upper limit" for a value
other than 10001 to 10099.
Output manipulated variable = manipulated variable calculated by the
PIDA instruction x scaling factor
Set a value between 0 and 100 (0 to 100%)
Output manipulated variable Operates as 0 for a value other than 0 to 100. Set a value that satisfies
S1+15 R/W
lower limit Output manipulated variable lower limit value < Output manipulated variable
upper limit value.
Output manipulated variable Set a value between 0 and 100 (0 to 100%/second)
S1+16 R/W
rate of change If not 0 to 100, output manipulated variable rate of change is disabled.
Set a value between 0 and 10000 (0.00 to 100.00%). Set a value that
satisfies output manipulated variable lower limit value ≤ manual mode output
manipulated variable ≤ output manipulated variable upper limit value.
Manual mode output
S1+17 When the output manipulated variable limit enable (S3+2) is ON, this R/W
manipulated variable
operates as the output manipulated variable lower limit value for a value
other than one between the output manipulated variable lower limit value
and the output manipulated variable upper limit value.
Output manipulated variable is stored as a value between -32,768 and
+32,767 (-327.68 to +327.67%).
Output manipulated variable The output manipulated variable (% value) is unknown while auto tuning is
S1+18 R
(% value) executing.
For manual mode, the manual mode output manipulated variable value is not
stored.
• When Analog Output is specified for the output manipulated variable
The S1+1 output manipulated variable (%) undergoes linear conversion in
the range of the minimum and maximum values of the analog output, and
Output manipulated variable that value is stored.
S1+19 R
(Analog value) • When Data Register is specified for the output manipulated variable
The output manipulated variable (%) stored in S1+1 is linearly converted
with the minimum and maximum output values, and the converted value is
stored in S1+19.
Set a value between -100 and 100 (-100 to 100%)
S1+20 Proportional band offset Proportional band offset of -101 or lower operates as -100% and 101 or R/W
higher operates as 100%.
Set a value between 1 and 500 (0.1 to 50.0 seconds)
S1+21 Control period Control period of 0 operates as 0.1 seconds and 501 or higher operates as R/W
50.0 seconds.
Storage
Function Setting Details R/W
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 R/W
5: Process High Alarm
6: Process Low Alarm
7: Upper Limit Alarm with Standby
8: Lower Limit Alarm with Standby
9: Upper/Lower Limit Alarm with Standby
Operates as 0 (No Alarm Action) for value other than those listed above.
Set the value that will be the trigger condition for the Alarm 3 action.
S1+23 Alarm 3 value R/W
For details, see "Alarm 3 value (S1+23)" on page 19-20.
Set the range from the alarm action point to when the alarm output changes
from ON to OFF.
Set a value that satisfies the following conditions in the range of 1 to 65,535
(0.1 to 6,553.5 (°C/°F), 1 to 65,535 (voltage/current input)).
• When Alarm 3 action is set to Upper/Lower Limit Alarm or Upper/
S1+24 Alarm 3 hysteresis Lower Limit Alarm with Standby R/W
1 ≤ Alarm 3 hysteresis < Alarm 3 value
• When Alarm 3 action is not set to Upper/Lower Limit Alarm or Upper/
Lower Limit Alarm with Standby
1 ≤ Alarm 3 hysteresis ≤ 65,535
When 0, hysteresis operates as 1 (0.1 (°C/°F) or 1 (voltage/current input)).
Set the time until the alarm output is turned ON after the condition to turn
the alarm output ON is satisfied.
S1+25 Alarm 3 delay time Set as 0 (delay time disabled) or in the range of 1 to 10,000 (1 to 10,000 R/W
seconds).
When 10,001 or higher, delay time operates as 10,000 seconds.
Set the Alarm 4 action type.
S1+26 Alarm 4 action R/W
The setting details are the same as Alarm 3 action (S1+22).
Set the value that will be the trigger condition for the Alarm 4 action.
S1+27 Alarm 4 value R/W
The setting details are the same as Alarm 3 value (S1+23).
Set the range from the alarm action point to when the alarm output changes
S1+28 Alarm 4 hysteresis from ON to OFF. R/W
The setting details are the same as Alarm 3 hysteresis (S1+24).
Set the time until the alarm output is turned ON after the condition to turn
S1+29 Alarm 4 delay time the alarm output ON is satisfied. R/W
The setting details are the same as Alarm 3 delay time (S1+25).
Set the Alarm 5 action type.
S1+30 Alarm 5 action R/W
The setting details are the same as Alarm 3 action (S1+22).
Set the value that will be the trigger condition for the Alarm 5 action.
S1+31 Alarm 5 value R/W
The setting details are the same as Alarm 3 value (S1+23).
Set the range from the alarm action point to when the alarm output changes
S1+32 Alarm 5 hysteresis from ON to OFF. R/W
The setting details are the same as Alarm 3 hysteresis (S1+24).
Set the time until the alarm output is turned ON after the condition to turn
S1+33 Alarm 5 delay time the alarm output ON is satisfied. R/W
The setting details are the same as Alarm 3 delay time (S1+25).
Set the Alarm 6 action type.
S1+34 Alarm 6 action R/W
The setting details are the same as Alarm 3 action (S1+22).
Set the value that will be the trigger condition for the Alarm 6 action.
S1+35 Alarm 6 value R/W
The setting details are the same as Alarm 3 value (S1+23).
Set the range from the alarm action point to when the alarm output changes
S1+36 Alarm 6 hysteresis from ON to OFF. R/W
The setting details are the same as Alarm 3 hysteresis (S1+24).
Set the time until the alarm output is turned ON after the condition to turn
S1+37 Alarm 6 delay time the alarm output ON is satisfied. R/W
The setting details are the same as Alarm 3 delay time (S1+25).
S1+38
— Reserved — — —
S1+39
100% 100%
0% 0%
AT execution (S3+6)
When the execute auto tuning is turned on, auto tuning is initiated. Once auto tuning is finished, it is turned off automatically.
The auto tuning is terminated if it is turned off while auto tuning is executed.
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. The output is turned on until the process variable reaches the A point (the proportional band), and
when it exceeds this (it enters the proportional band), the control output starts to be turned on and off at the control cycle, and
then when the set point is exceeded, the control output is turned completely off. Along with the rise in temperature from the A
point to the set point, the control output on time becomes shorter and the off time becomes longer. An offset always occurs with
Proportional control. The P action is suitable for processes with no wasted time such as gas pressure control and level control.
When set to Proportional control, integral time and derivative time are automatically ignored.
Temperature Proportional band Offset
Set point
A point
Time
• When the proportional band is made smaller, the control output turns on or off from near the set point, so the time until the process variable
rises in temperature to the set point decreases and the offset also becomes smaller, but hunting increases.
• When the proportional band is made larger, the control output turns on or off from a temperature considerably lower than the target
temperature, so auto tuning and hunting eliminate, but it takes time until the process variable rises in temperature to the set point and the
offset between the set point and the process variable becomes larger.
■PI control
The I action automatically corrects the offset generated by Proportional control. However, for rapid changes in temperature due to
disturbances, it will take time until the temperature stabilizes. The PI action is suitable for temperature control with a slow rate of change.
When set to PI control, derivative time is automatically 0.
Temperature Proportional band
Set point
Disturbance
Time
• If the integral time is too small, I (integral) control becomes more powerful and the offset can be corrected in a short amount of time, but this
may cause long cycles of hunting.
• If the integral time is too large, I (integral) control becomes weaker and it takes time to correct the offset.
■PD control
Compared to Proportional control, PD control increases the response to rapid temperature changes due to disturbances, stabilizes
control in a short amount of time, and attempts to improve the transient response characteristics. PD control is suitable to
temperature control with a fast rate of change.
When set to PD control, integral time is automatically 0.
Temperature Proportional band
Set point
Disturbance
Time
• When the derivative time is decreased, the D (derivative) control becomes weaker and the response to rapid temperature changes becomes
slower. The action to control rapid temperature increases also becomes weaker, so the rise in temperature time to the set point will become
faster, but overshooting the set point will occur more easily.
• When the derivative time is increased, the D (derivative) control becomes more powerful and the response to rapid temperature changes
becomes faster. The action to control rapid temperature increases also becomes more powerful, so the rise in temperature time to the set
point will become slower, but overshooting the set point will occur less easily.
■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. The parameters for the proportional band, integral time, and
derivative time in PID control can be automatically set with auto tuning.
Temperature
Set point
Disturbance
Time
AT Time
1 2 3
Set point (SP) - AT bias setting value < process variable (PV) < set point (SP) + AT bias setting value
Fluctuations will start when the process variable (PV) reaches the set point (SP).
AT Time
1 2 3
AT Time
1 2 3
PIDD ** S1 S2 S3 SP PV MV
***** ***** ***** ***** ***** *****
Operation
When the input is on, PID control is performed.
Knowledge of PID control is required to use the PIDD instruction. If this instruction is used without an
Warning
understanding of PID control, there is a possibility of control that was not intended by the user. Please use the
PIDD instruction with a full understanding of PID control and the PIDD instruction.
When performing feedback control using the PIDD instruction, emergency stop and interlocking circuits must
be configured outside the FC6A Series MicroSmart according to the user application. If these are configured in
the internal circuit and the process variable is not input correctly, there is a risk of no longer being able to
perform proper feedback control, which may damage connected devices or cause accidents.
The PIDD instruction cannot be used in an interrupt program. If the instruction is used in an interrupt program, a user
Caution
program execution error occurs, the execution of the instruction is canceled, and the next instruction is executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Devices
The control register uses 100 data registers, and the control relay uses 32 internal relays.
*1 D0 to D7900, and D10000 to D55900 can be specified. Special data registers cannot be used.
*2 M0 to M7960, and M10000 to M17460 can be specified. Special internal relays cannot be used.
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. 2. 3.
4.
4. PIDD No.
Assign a unique number from 0 to 31 to identify each PIDD instruction.
When performing the cascade control, specify the master PIDD instruction by its PIDD number.
■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.
1.
2.
3.
4.
5.
6.
7.
8.
Full Scale of
0.0 to 100.0% Set Point (SP) (S1+2, S1+3)
Set Point (SP)
3. Kp Dependent (S3+8)
Select Dependent or Independent. When Dependent is selected, Kp Dependent (S3+8) will be off. When Independent is
selected, Kp Dependent (S3+8) will be on.
When Kp Dependent is selected, the integral and derivative actions grow larger in proportion to Kp (Gain) (S1+6, S1+7). When
Kp Independent is selected, Kp (Gain) (S1+6, S1+7) has no effect on the integral and derivative actions.
Full Scale of
Full Scale of
Process Process Variable (PV) (S1+0, S1+1)
Analog Input
Variable (PV)
Notes:
• When Analog Input is specified, the analog cartridge or analog module must be configured in the Expansion Editor.
For details on how to configure analog inputs, see Chapter 9 "Analog Module" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
• The analog volume on the CPU module cannot be specified as an analog input.
Full Scale of
Data Register
Process Process Variable (PV) (S1+0, S1+1)
(Float Value)
Variable (PV)
5. PV Upper Range Value (URV) (S1+24, S1+25), PV Lower Range Value (LRV) (S1+22, S1+23)
Sets the full scale of Process Variable (PV) (S1+0, S1+1) with the minimum and maximum values.
If the process variable is higher than PV Upper Range Value (S1+24, S1+25), Process Variable (PV) (S1+0, S1+1) will be PV
Upper Range Value. If the process variable is lower than PV Lower Range Value (S1+22, S1+23), Process Variable (PV) (S1+0,
S1+1) will be PV Lower Range Value. Error code 109 will be stored in Error Status (S1+34, S1+35) in those cases.
PV Upper Range Value (S1+24, S1+25) and PV Lower Range Value (S1+22, S1+23) are set as data type F (float) between
-32,768.0 to 65,535.0.
■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.
1.
2.
3.
4.
5.
6.
Modifiable
Allocation Function Setting Details R/W during
Execution
Stores the process variable for PID control.
S1+0, S1+1 Process Variable (PV) R —
Read-only.
Sets the set point for PID control. Set the set point between SP Low
Limit and SP High Limit.
If the set point is higher than SP High Limit, the instruction operates
S1+2, S1+3 Set Point (SP) R/W Yes
with SP High Limit. If the set point is lower than SP Low Limit, the
instruction operates with SP Low Limit. If the set point is out of range,
error code 106 will be stored in Error Status (S1+34, S1+35).
Set the master PIDD instruction output manipulated variable between
0.0 and 100.0%.
For Cascade Control Mode, the value of Remote Set Point (RSP) will be
converted to the full scale of SP Lower Range Value (S1+44, S1+45)
S1+4, S1+5 Remote Set Point (RSP) to SP Upper Range Value (S1+46, S1+47). If the converted set point R/W Yes
is higher than SP High Limit (S1+28, S1+29), the set point will be SP
High Limit. If the converted set point is lower than SP Low Limit
(S1+26, S1+27), the set point will be SP Low Limit. The converted set
point is stored in Set Point (SP) (S1+2, S1+3).
Set proportional gain between 0.00001 and 100.0 (0.00001 and
100.0%).
If the proportional gain value is less than 0.00001, the instruction
S1+6, S1+7 Kp (Gain) R/W Yes
operates with 0.00001%. If the proportional gain value is greater than
100.0, the instruction operates with 100.0%. If the value is out of
range, error code 122 will be stored in Error Status (S1+34, S1+35).
Set integral gain between 0.00001 and 100.0 (0.00001 and
100.0 times/minute).
S1+8, S1+9 Ki (Integral) If the integral gain value is less than 0.00001, the instruction operates R/W Yes
with 0.00001 times/minute. If the integral gain value is greater than
100.0, the instruction operates with 100.0 times/minute.
Set derivative gain between 0.00001 and 100.0 (0.00001 and
100.0 seconds).
S1+10, S1+11 Kd (Derivative) If the derivative gain value is less than 0.00001, the instruction R/W Yes
operates with 0.00001 seconds. If the derivative gain value is greater
than 100.0, the instruction operates with 100.0 seconds.
S1+12, S1+13 — Reserved — — — —
Modifiable
Allocation Function Setting Details R/W 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. If the value of Manual Output R/W Yes
Variable
Manipulated Variable is greater than 100.0, the instruction operates
with 100.0. If the value is out of range, error code 130 will be stored
in Error Status (S1+34, S1+35).
Stores the output manipulated variable of the PIDD instruction.
Output Manipulated Variable
S1+16, S1+17 The value is stored between MV Low Limit (S1+30, S1+31) and MV R —
(MV)
High Limit (S1+32, S1+33).
S1+18 to
— Reserved — — — —
S1+21
Set PV Lower Range Value between -32,768.0 and 65,535.0.
If the PV Lower Range Value is outside the range of -32,768.0 and
65,535.0, or if PV Upper Range Value ≤ PV Lower Range Value, PV
Lower Range Value will be reverted to the original value, and the
execution of PID control will continue. If the PV Lower Range Value is
out of the range, error code 102 will be stored in Error Status (S1+34,
S1+22, S1+23 PV Lower Range Value (LRV) R/W Yes
S1+35).
However, if PV Lower Range Value is out of the range or if PV Upper
Range Value ≤ PV Lower Range Value at the first scan of PIDD
instruction execution, the execution of PID control will stop. The
execution of PID control will start once the value within the range is
set and the error is eliminated.
Set PV Upper Range Value between -32,768.0 and 65,535.0.
If the PV Upper Range Value is outside the range of -32,768.0 and
65,535.0, or if PV Upper Range Value ≤ PV Lower Range Value, PV
Upper Range Value will be reverted to the original value, and the
execution of PID control will continue. If the PV Upper Range Value is
out of the range, error code 102 will be stored in Error Status (S1+34,
S1+24, S1+25 PV Upper Range Value (URV) R/W Yes
S1+35).
However, if PV Upper Range Value is out of the range or if PV Upper
Range Value ≤ PV Lower Range Value at the first scan of PIDD
instruction execution, the execution of PID control will stop. The
execution of PID control will start once the value within the range is
set and the error is eliminated.
Set SP Low Limit between SP Lower Range Value (S1+44, S1+45) and
SP Upper Range Value (S1+46, S1+47).
If the value of SP Low Limit is lower than SP Lower Range Value
(S1+44, S1+45), the instruction operates with SP Lower Range Value.
S1+26, S1+27 SP Low Limit If the value of SP Low Limit is higher than SP Upper Range Value R/W Yes
(S1+46, S1+47), the instruction operates with SP Upper Range Value.
If SP High Limit ≤ SP Low Limit, the instruction operates with SP
Lower Range Value. Error code 106 will be stored in Error Status
(S1+34, S1+35) in those cases.
Set SP High Limit between SP Lower Range Value (S1+44, S1+45)
and SP Upper Range Value (S1+46, S1+47).
If the value of SP High Limit is lower than SP Lower Range Value
(S1+44, S1+45), the instruction operates with SP Lower Range Value.
S1+28, S1+29 SP High Limit If the value of SP High Limit is higher than SP Upper Range Value R/W Yes
(S1+46, S1+47), the instruction operates with SP Upper Range Value.
If SP High Limit ≤ SP Low Limit, the instruction operates with SP
Upper Range Value. Error code 106 will be stored in Error Status
(S1+34, S1+35) in those cases.
Modifiable
Allocation Function Setting Details R/W 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 R/W Yes
instruction operates with MV Low Limit as 0.0 and MV High Limit as
100.0. Error code 103 will be stored in Error Status (S1+34, S1+35) in
those cases.
Set MV High Limit between 0.0 and 100.0 (0.0 and 100.0%).
If the value of MV High Limit is less than 0.0 or greater than 100.0, the
instruction operates with 100.0. If MV High Limit ≤ MV Low Limit, the
S1+32, S1+33 MV High Limit R/W Yes
instruction operates with MV Low Limit as 0.0 and MV High Limit as
100.0. Error code 103 will be stored in Error Status (S1+34, S1+35) in
those cases.
S1+36 to
— Reserved — — — —
S1+43
S1+44, S1+45 SP Lower Range Value Stores the same value as PV Lower Range Value (S1+22, S1+23). R —
S1+46, S1+47 SP Upper Range Value Stores the same value as PV Upper Range Value (S1+24, S1+25). R —
Set the output manipulated variable while PID Inhibit (S3+11) is on
and PID control is inhibited. Set the value as data type F (float)
Output Manipulated Variable between 0.0 and 100.0 (0.0 and 100.0%).
S1+48, S1+49 R/W Yes
while PID Control is Inhibited While PID Inhibit (S3+11) is off, the value of Output Manipulated
Variable (S1+16, S1+17) for the PIDD instruction is copied to "Output
Manipulated Variable while PID Control is Inhibited (S1+48, S1+49)".
Stores the proportion (%) of the difference (offset) between the set point
S1+50, S1+51 Input Deviation (Offset) R —
(SP) and process variable (PV) for the full scale of the process variable.
S1+52 to
— Reserved — — — —
S1+99
Modifiable
Storage
Function Setting Details R/W during
Destination
Execution
0 (OFF): Reverse Control Action
S3+0 Control Action R/W Yes
1 (ON): Direct Control Action
Set to 1 (ON) to switch the PIDD instruction to Manual Mode. S3+1
S3+1 Manual Mode Select R/W Yes
automatically changes to 0 (OFF).
Set to 1 (ON) to switch the PIDD instruction to Auto Mode. S3+2
S3+2 Auto Mode Select R/W Yes
automatically changes to 0 (OFF).
Set to 1 (ON) to switch the PIDD instruction to Cascade Control
S3+3 Cascade Control Mode Select R/W Yes
Mode. S3+3 automatically changes to 0 (OFF).
Changes to 1 (ON) while PIDD instruction is in Manual Mode.
S3+4 Manual Mode Active R —
Changes to 0 (OFF) when the mode is not Manual Mode.
Changes to 1 (ON) while PIDD instruction is in Auto Mode.
S3+5 Auto Mode Active R —
Changes to 0 (OFF) when the mode is not Auto Mode.
Changes to 1 (ON) while PIDD instruction is in Cascade Control
S3+6 Cascade Control Mode Active Mode. R —
Changes to 0 (OFF) when the mode is not Cascade Control Mode.
0 (OFF): PV tracking disabled
S3+7 PV Tracking R/W Yes
1 (ON): PV tracking enabled
0 (OFF): Kp dependent
S3+8 Kp Dependent R/W Yes
1 (ON): Kp independent
0 (OFF): Derivative enabled
S3+9 Derivative R/W Yes
1 (ON): Derivative disabled
0 (OFF): Derivative decay enabled
S3+10 Derivative Decay R/W Yes
1 (ON): Derivative decay disabled
0 (OFF): PID operation
S3+11 PID Inhibit R/W Yes
1 (ON): PID inhibited
Changes to 1 (ON) when PID control is temporarily stopped, such
S3+12 PID Control Inhibit Monitor as when PID control parameters are changed or when PID control R —
is inhibited.
Derivative Action Execution
S3+13 Changes to 1 (ON) while executing the derivative action. R —
Monitor
S3+14 to
— Reserved — — — —
S3+31
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.
Note: The PID monitor operates according to the PIDA/PIDD instruction settings in the ladder program displayed on the WindLDR and not
according to the settings in the PLC. If the device allocations for the PIDA/PIDD instruction in the PLC and the PIDA/PIDD instruction in WindLDR
are different, the PID instruction is not correctly monitored.
2. From the WindLDR menu bar, select Online > Monitor > PID Monitor.
The PID Monitor dialog box is displayed.
3. On the PID Monitor dialog box, click button (show/hide PID monitor table).
The PID monitor table is displayed.
2. 3. 4. 5.
1.
6. 9.
7.
8.
10.
11.
12.
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.
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. Click this button to display a popup menu and click the corresponding item to send
the command.
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.
When a PIDD instruction is selected, the indicators in the following table are displayed.
2. From the WindLDR menu bar, select Online > Monitor > PID Monitor.
The PID Monitor dialog box is displayed.
3. In the PID Monitor dialog box, click button (PID monitor settings).
The PID Monitor Settings dialog box is displayed.
1.
3.
2.
4.
2. Scaling Settings
You can set the scaling for the vertical axis of the trend graph in the PID Monitor dialog box. When the auto scaling check box
is selected, the Maximum Value and the Minimum Value for the vertical axis are automatically adjusted for the values displayed
on the trend graph. When the check box is cleared, the Maximum Value and the Minimum Value are set according to the entered
values.
4. Default
All settings are set to their initial values.
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.
• PID control via ON/OFF output
Operation
• PID control is performed based on the temperature input to the analog cartridge and the manipulated variable is output.
The set point is 200ºC.
• The control mode is PID (PID control) and the control action is reverse control action.
• Alarm 1 output (S3+3) is turned ON when the process variable reaches 250°C, and the heater is stopped or the power is adjusted.
I0
FC6A-PJ2CP
IN0
RTD A B B’
TC + - NC
Q0 Q1 COM0(+) V0(-)
Alarm Lamp
+ –
Thermocouple +
Heater
–
Fuse
SSR
(Solid State Relay)
Ladder program
Process variable
PID control (after conversion) Initialize Pulse Control action Set point
enable input
PIDA S1 S2 S3 S4 1.
D0000 M8120 M0000 D0007
I0000
Analog input
Alarm 1 output status error PIDA error Alarm lamp
R
M0003 M0020 M0021 Q0001 2.
M0005 Q0000
Analog Status to Analog input
PID control the Analog Cartridge status error
enable input
CMP>=(W) S1 - S2 - D1 - REP
D8172 5 M0020
I0000
3.
Alarm 1 output Alarm lamp
S
M0003 Q0001
Analog input
status error
M0020
PID control Operating status PIDA error
enable input
ICMP>=(W) S1 S2 S3 D1
4.
109 D0002 103 M0021
I0000
S 5.
M0021 Q0001
Note:
The analog status for the analog cartridge is as follows.
• Analog input status error
0: Operating normally
1: Converting data
2: Initializing
5, 6: Wiring error
8 to 11: Analog cartridge error
For details, see Chapter 10 "Analog Cartridge" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
1. The Devices tab configures the devices used with the PIDA instruction.
1. 2. 3. 4.
1.
2.
3.
1.
2.
3.
1.
6. Use the Module Configuration Editor to configure the analog input for the analog cartridge.
On the Configuration tab, in the PLCs group, select Expansion Modules.
7. Select FC6A-PJ2CP in the expansion modules and cartridges list and drag and drop it to the module configuration area.
8. Click the FC6A-PJ2CP analog cartridge that was interested in the module configuration area and click Configure.
The Analog Parameters Configuration (Cartridge Slot 1) dialog box is displayed.
1.
10. Click OK to close the Analog Parameters Configuration (Cartridge Slot 1) dialog box.
I0
FC6A-PJ2CP FC6A-PK2AV
IN0
RTD A B B’ OUT0
TC + - NC + - NC
Q1 COM0(+) V0(-)
Alarm Lamp
Thyristor Unit
Analog input wiring differs by the thyristor
unit and operation mode that is used.
+ –
+
Thermocouple L1 1
L2 –
3
Fuse
Ladder program
CMP>=(W) S1 - S2 - D1 - REP
D8176 5 M0021
Process variable
PID control (after conversion) Initialize pulse Control action Set point
Analog input Analog output
enable input status error status error PIDA S1 S2 S3 S4
D0000 M8120 M0000 D0007
I0000 M0020 M0021
Operating status
Operating status
error
2.
ICMP>=(W) S1 S2 S3 D1
109 D0002 103 M0022
Analog Value to
PID control the Analog Cartridge
enable input
MOV(W) S1 - D1 - REP
3.
0 D8174
I0000
Analog output
status error
M0020
Analog input
status error
M0021
Analog output
PID control Operating status status error
enable input
ICMP>=(W) S1 S2 S3 D1
I0000
109 D0002 103 M0021 4.
Analog input Alarm
status error lamp
Q0001 5.
M0020
Analog output
status error
M0021
PID error
M0022
Alarm 1 output
M0003
1. When I0000 is ON and the analog input status error for the analog cartridge is 5, 6, or 8 to 11, M0020 turns ON.
When the analog output status error for the analog cartridge is 8 to 11, M0021 turns ON.
2. The PID instruction operates when I0000 is ON and both M0020 and M0021 are OFF.
The operating status of the PID instruction is judged, and when an error occurs, M0022 turns ON.
3. When M0020 or M0021 is ON, or when I0000 is OFF (when the PID instruction is stopped), 0 is stored in D8186 and 0 V
is output from AQ4.
4. The operating status of the PID instruction is judged, and when an error occurs, M0021 turns ON.
5. When either M0020, M0021, M0022, or M0003 (Alarm 1 output (process high alarm)) is ON, Q0001 (alarm lamp) turns ON.
Note:
1. The Devices tab configures the devices used with the PID instruction.
1. 2. 3. 4.
1.
2.
3.
1.
2.
3.
1.
5. Use the Module Configuration Editor to configure the analog input for the analog cartridge.
On the Configuration tab, in the PLCs group, select Expansion Modules.
6. Select FC6A-PJ2CP in the expansion modules and cartridges list and drag and drop it to the module configuration area.
7. Click the FC6A-PJ2CP analog cartridge that was interested in the module configuration area and click Configure.
The Analog Parameters Configuration (Cartridge Slot 1) dialog box is displayed.
1.
9. Click OK to close the Analog Parameters Configuration (Cartridge Slot 1) dialog box.
10. Select FC6A-PK2AV in the expansion modules and cartridges list and drag and drop it to the module configuration area.
11. Click the FC6A-PK2AV analog cartridge that was interested in the module configuration area and click Configure.
The Analog Parameters Configuration (Cartridge Slot 2) dialog box is displayed.
1.
13. Click OK to close the Analog Parameters Configuration (Cartridge Slot 2) dialog box.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Internal relays M0-7997 and M10000-17497 can be designated as D1. Special internal relays cannot be designated as D1.
Destination device D2 (system work area) uses 2 data registers starting with the device designated as D2. Data registers D0-D7998 and D10000-
D55998 can be designated as D2. The two data registers are used for a system work area. Do not use these data registers for destinations of other
advanced instructions, and do not change values of these data registers using the monitor function on WindLDR. If the data in these data registers
are changed, the dual timer does not operate correctly.
The dual timer instructions 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.
When a user program execution error occurs, the execution of the instruction is canceled and the next instruction is executed. The data in D1
(destination 1) is unchanged. For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
DTIM S1 S2 D1 D2
10 5 M20 D200
DTMH S1 S2 D1 D2
50 25 M30 D300
DTMS S1 S2 D1 D2
250 125 M40 D400
ON
I0 OFF
ON
M10 OFF
2s 1s
ON
M20 OFF
1s 0.5 s
ON
M30 OFF
500 ms 250 ms
ON
M40 OFF
250 ms 125 ms
For the timer accuracy of timer instructions, see "TML, TIM, TMH, and TMS (Timer)" on page 4-7.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Destination device D1 (measured value) uses 3 data registers starting with the device designated as D1. Data registers D0-D7997 and D10000-
D55997 can be designated as D1. Subsequent two data registers starting with destination device D1+1 are used for a system work area. Do not use
these two data registers for destinations of other advanced instructions, and do not change values of these data registers using the monitor function
on WindLDR. If the data in these data registers are changed, the teaching timer does not operate correctly.
The teaching timer 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" on page 3-10.
When a user program execution error occurs, the execution of the instruction is canceled and the next instruction is executed. The data in D1
(destination 1) is unchanged. For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Examples: TTIM
When input I0 is turned on, TTIM resets data register D100 to zero and starts to store the ON duration of
TTIM D1 input I0 to data register D100, measured in units of 100 ms.
I0 D100
When input I0 is turned off, TTIM stops the measurement, and data register D100 maintains the measured
value of the ON duration.
ON
I0 OFF
1,500 ms
D100 Value 0 15
The following example demonstrates a program to measure the ON duration of input I0 and to use the ON duration as a preset
value for 100-ms timer instruction TIM.
When input I1 is turned on, 100-ms timer T0 starts to operate with a preset
TIM T0 value stored in data register D0.
I1 D0
While input I0 is on, TTIM measures the ON duration of input I0 and stores
TTIM D1 the measured value in units of 100 ms to data register D100.
I0 D100
When input I0 is turned off, MOV(W) stores the D100 value to data register
D0 as a preset value for timer T0.
SOTD MOV(W) S1 – D1 – REP
I0 D100 D0
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Degree value to convert into radian — — — — — — X X —
D1 (Destination 1) Destination to store conversion results — — — — — — X — —
For the valid device address range, see "Device Addresses" on page 2-1.
When the conversion result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 and
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on except when the conversion result is 0. When the conversion result is
between –1.175495 × 10–38 and 1.175495 × 10–38, the destination device designated by D1 stores 0.
Not Zero
Overflow Overflow
M8003 1 0 1 0 1 0 1
When the data designated by S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details about the user program execution errors, see "User Program
Execution Errors" on page 3-10.
Since the RAD instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Example: RAD
When input I1 is turned on, the degree value of data registers D10 and D11 assigned by
SOTU RAD(F) S1 D1 source device S1 is converted into a radian value and stored to data registers D20 and
I1 D10 D20 D21 assigned by destination device D1.
S1 D1
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When the conversion result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 and
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on except when the conversion result is 0. When the conversion result is
below –3.402823 × 1038 or over 3.402823 × 1038, causing an overflow, the destination device designated by D1 stores a value of minus or plus
infinity.
Not Zero
Overflow Overflow
M8003 1 0 1 0 1 0 1
When the data designated by S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details about the user program execution errors, see "User Program
Execution Errors" on page 3-10.
Since the DEG instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: DEG
When input I1 is turned on, the radian value of data registers D10 and D11 assigned by
SOTU DEG(F) S1 D1 source device S1 is converted into a degree value and stored to data registers D20 and
I1 D10 D20 D21 assigned by destination device D1.
S1 D1
SIN (Sine)
sin S1·S1+1 → D1·D1+1
SIN(F) S1 D1 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
For valid device address ranges, see "Device Addresses" on page 2-1.
When the data designated by S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details about the user program execution errors, see "User Program
Execution Errors" on page 3-10.
Since the SIN instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since the floating point data type is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: SIN
When input I1 is turned on, the sine of the radian value of data registers D10 and D11
SOTU SIN(F) S1 D1 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
COS (Cosine)
cos S1·S1+1 → D1·D1+1
COS(F) S1 D1 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
For valid device address ranges, see "Device Addresses" on page 2-1.
When the data designated by S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details about the user program execution errors, see "User Program
Execution Errors" on page 3-10.
Since the COS instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: COS
When input I1 is turned on, the cosine of the radian value of data registers D10 and D11
SOTU COS(F) S1 D1 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
TAN (Tangent)
tan S1·S1+1 → D1·D1+1
TAN(F) S1 D1 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
For valid device address ranges, see "Device Addresses" on page 2-1.
When the conversion result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 and
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on except when the conversion result is 0. When the conversion result is
below –3.402823 × 1038 or over 3.402823 × 1038, causing an overflow, the destination device designated by D1 stores a value of minus or plus
infinity.
Not Zero
Overflow Overflow
M8003 1 0 1 0 1 0 1
Since the TAN instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: TAN
When input I1 is turned on, the tangent of the radian value of data registers D10 and
SOTU TAN(F) S1 D1 D11 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
Valid Devices
When the data designated by source device S1 is not within the range between –1.0 and 1.0 or does not comply with the normal floating-point
format, a user program execution error will result, turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details
about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the ASIN instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: ASIN
When input I1 is turned on, the arc sine of the value of data registers D10 and D11
SOTU ASIN(F) S1 D1 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
Valid Devices
When the data designated by source device S1 is not within the range between –1.0 and 1.0 or does not comply with the normal floating-point
format, a user program execution error will result, turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details
about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the ACOS instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: ACOS
When input I1 is turned on, the arc cosine of the value of data registers D10 and D11
SOTU ACOS(F) S1 D1 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
S1 D1
D10·D11 –0.7071068 D20·D21 2.356194
D10·D11 –0.7071068 D20·D21 2.356194
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When the data designated by source device S1 does not comply with the normal floating-point format, a user program execution error will result,
turning on special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. For details about the user program execution errors, see "User
Program Execution Errors" on page 3-10.
Since the ATAN instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: ATAN
When input I1 is turned on, the arc tangent of the value of data registers D10 and D11
SOTU ATAN(F) S1 D1 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Binary data to convert into natural logarithm — — — — — — X X —
D1 (Destination 1) Destination to store conversion results — — — — — — X — —
For valid device address ranges, see "Device Addresses" on page 2-1.
When the operation result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 and
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on except when the result is 0. For details, see "Carry and Borrow in
Floating-Point Data Processing" on page 3-8.
When the value of S1 (source 1) is 0, a user program execution error occurs.
When the value of S1 (source 1) is less than 0, a user program execution error occurs.
When the data designated by source device S1 does not comply with the normal floating-point format, a user program execution error occurs, and
the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction is executed.
When a user program execution error occurs, special internal relay M8004 and ERR LED on the FC6A Series MicroSmart are turned on. For details
about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the LOGE instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: LOGE
When input I1 is on, the natural logarithm of the binary data of data registers D10 and
SOTU LOGE(F) S1 D1 D11 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When the operation result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 and
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on except when the result is 0. For details, see "Carry and Borrow in
Floating-Point Data Processing" on page 3-8.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: LOG10
When input I1 is on, the common logarithm of the binary data of data registers D10 and
SOTU LOG10(F) S1 D1 D11 assigned by source device S1 is stored to data registers D20 and D21 assigned by
I1 D10 D20 destination device D1.
S1 D1
EXP (Exponent)
eS1·S1+1 → D1·D1+1
EXP(F) S1 D1
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.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When the operation result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 and
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on except when the result is 0. For details, see "Carry and Borrow in
Floating-Point Data Processing" on page 3-8.
When the operation result is between –1.175495 × 10–38 and 1.175495 × 10–38, the destination device designated by D1 stores 0. When the
operation result is less than –3.402823 × 1038 or larger than 3.402823 × 1038, causing an overflow, the destination device designated by D1 stores a
value of minus or plus infinity.
When the data designated by source device S1 does not comply with the normal floating-point format, a user program execution error occurs, and
the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction is executed.
When a user program execution error occurs, special internal relay M8004 and ERR LED on the FC6A Series MicroSmart are turned on. For details
about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the EXP instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: EXP
When input I1 is on, e is raised to the data of data registers D10 and D11 assigned by
SOTU EXP(F) S1 D1 source device S1 and the operation result is stored to data registers D20 and D21
I1 D10 D20 assigned by destination device D1.
e2 = 2.71828182 → 7.389056
S1 D1
POW (Power)
S1·S1+1S2·S2+1 → D1·D1+1
POW(F) S1 S2 D1
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.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When the operation result is not within the range between –3.402823 × 1038 and –1.175495 × 10–38 or between 1.175495 × 10–38 to
3.402823 × 1038, special internal relay M8003 (carry or borrow) is turned on, except when the result is 0. For details, see "Carry and Borrow in
Floating-Point Data Processing" on page 3-8.
When the operation result is between –1.175495 × 10–38 and 1.175495 × 10–38, the destination device designated by D1 stores 0. When the
operation result is less than –3.402823 × 1038 or greater than 3.402823 × 1038, causing an overflow, the destination device designated by D1 stores
a value of minus or plus infinity.
When one of the following conditions occurs, a user program execution error occurs.
• The data designated by source device S1 is less than 0 and the data designated by source device S2 is not an integer.
• The data designated by source device S1 is 0 and the data designated by source device S2 is less than or equal to 0.
When the data designated by source device S1 or S2 does not comply with the normal floating-point format, a user program execution error occurs,
and the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction is executed.
When a user program execution error occurs, special internal relay M8004 and ERR LED on the FC6A Series MicroSmart are turned on. For details
about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the POW instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) — Since floating point data is used, the source and destination devices use two consecutive data registers.
I (integer) —
D (double word) —
L (long) —
F (float) X
Example: POW
When input I1 is on, the data of data registers D10 and D11 assigned by
SOTU POW(F) S1 S2 D1 source device S1 is raised to the power D20·D20+1 assigned by source device
I1 D10 D20 D30 S2 and the operation result is stored to data registers D30 and D31 assigned
by destination device D1.
41.25 → 5.656854
S1 S2 D1
Valid Devices
Since the FIFOF instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When an M (internal relay) is assigned as the D2, three internal relays starting with the device assigned by D2
I (integer) — are used.
D (double word) — When a D (data register) is assigned as the D1, S1×S2+2 data registers starting with the device assigned by D1
L (long) — are used.
F (float) —
D1+(S1×(S2–1)+2)
... Record S2–1 The last record to store the data.
D1+(S1×S2+1)
When input is on, the data stored in data registers starting with the device assigned by S1 is stored to the
FIEX(W) S1
corresponding FIFO data file.
* *****
Valid Devices
Device Function I Q M R T C D Constant Repeat
N (File Number) File number — — — — — — — 0-9 —
S1 (Source 1) First data register to store data to FIFO data file — — — — — — X — —
For valid device address ranges, see "Device Addresses" on page 2-1.
Make sure that FIEX instructions are executed after the corresponding FIFOF instruction has initialized the FIFO data file. If FIEX instructions are
executed without executing the corresponding FIFOF instruction, a user program execution error will result, turning on special internal relay M8004
and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled and the next instruction is executed. For details about the
user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the FIEX instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
When input is on, the data is retrieved from the corresponding FIFO data file and stored to the data
FOEX(W) D1
registers starting with the device assigned by D1.
* *****
Valid Devices
Device Function I Q M R T C D Constant Repeat
N (File Number) File number — — — — — — — 0-9 —
D1 (Destination 1) First data register number to store data — — — — — — X — —
For valid device address ranges, see "Device Addresses" on page 2-1.
Make sure that FOEX instructions are executed after the corresponding FIFOF instruction has initialized the FIFO data file. If FOEX instructions are
executed without executing the corresponding FIFOF instruction, a user program execution error will result, turning on special internal relay M8004
and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled and the next instruction is executed. For details about the
user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the FOEX instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a D (data register) is assigned as the destination, as many data registers as the value stored in device S1
I (integer) — of the corresponding FIFOF instruction are used.
D (double word) —
L (long) —
F (float) —
File number: 2
Quantity of data registers per record: 3
Quantity of records: 4
FIFO Data file: D100 through D113 (3×4+2 data registers)
FIFO status outputs: M100 through M102
Ladder Diagram
M8120 is the initialize pulse special internal relay.
MOV(W) S1 – D1 R REP When the CPU starts, MOV sets 0 to FI and FO pointers, and FIFOF initializes
M8120 0 D100 2
FIFO data file 2.
FIFOF(W) S1 S2 D1 D2
2 3 4 D100 M100
When input I0 is turned on, the data in D10 through D12 are stored to the
SOTU FIEX(W) S1 FIFO data file 2.
I0 2 D10
SOTU FIEX(W) S1 When input I1 is turned on, the data in D20 through D22 are stored to the
I1 2 D20 FIFO data file 2.
SOTU FOEX(W) D1 When input I2 is turned on, the first data is retrieved from the FIFO data file 2
I2 2 D50 and stored to D50 through D52.
The offset of the data register where a match first occurred is stored in data
register assigned by device D1. The number of matches is stored in the next
data register. When the search results in no match, 65,535 is stored in device
D1 and 0 is stored in device D+1.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Source S1 data specifies the value to be sought and the valid range depends on the data type.
The search range cannot straddle data registers and non-retentive data registers. Make sure that the sum of data register numbers designated by
S1 and S2 does not result in a different data register range.
For source S3 and destination D1, 1 word is always used without regard to the data type.
Destination D1 occupies two consecutive data registers starting with the device designated by D1. Data registers D0-D7997 and D10000-D55997
can be designated as destination D1.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MicroSmart. When a user program execution error occurs, the execution of the
instruction is canceled and the next instruction is executed.
When data in S2 to S2+(S3) does not comply with floating-point format, the data is skipped to continue the search and the results are stored in D1
and D1+1.
If used, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart.
When S3 is zero or the sum of S2 and S3 is not within the valid data register range, a user program execution error will result, turning on special
internal relay M8004 and ERR LED on the FC6A Series MicroSmart. When a user program execution error occurs, the execution of the instruction is
canceled and the next instruction is executed.
For details about the user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the NDSRC instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
W (word) X When a word device such as D (data register) is assigned as the source, 1 point (word or integer data) or 2
I (integer) X points (double-word, long, or float data) are used.
D (double word) X
L (long) X
F (float) X
Examples: NDSRC
The following examples demonstrate the NDSRC instruction that searches the data of three different data types.
• Data Type: Word
NDSRC(W) S1 S2 S3 D1
I0 D10 D100 5 D200
D104 652 4
D105 1234
NDSRC(D) S1 S2 S3 D1
I0 D10 D100 5 D200
D110·D111 1234457
NDSRC(F) S1 S2 S3 D1
I0 D10 D100 5 D200
D102·D103 0.224 2
Result D200 6 Offset of first match
D104·D105 0.124 4
D201 1 Quantity of matches
D106·D107 0.4521 6 (match)
D108·D109 3.245 8
D110·D111 12244
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When Mode 0 is selected, source devices S1 and S2 and destination device D1 occupy 3 consecutive data registers starting with the designated
device. Data registers D0-D7997 and D10000-D55997 can be designated as these devices.
When Mode 1 is selected, source device S1 and destination device D1 occupy 7 consecutive data registers starting with the designated device. Data
registers D0-D7993 and D10000-D55993 can be designated as these devices. Source device S2 occupies 3 consecutive data registers starting with
the designated device. Data registers D0-D7997 and D10000-D55997 can be designated as source device S2.
Since the TADD instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
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.
Hour data can be 0 through 23. Minute and second data can be 0 through 59.
When the execution result exceeds 23:59:59, the result is subtracted by 24 hours and stored to the data register designated by destination device
D1, turning on special internal relay M8003 (carry).
When any of the hour, minute, or second data exceeds the valid range, a user program execution error will result, turning on special internal relay
M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled and the next instruction is executed. For details about the
user program execution errors, see "User Program Execution Errors" on page 3-10.
Mode 1
When mode 1 is selected, time data (hour, minute, and second) stored in 3 data registers starting with source device S2 are added to the date/time
data (year, month, day, day of week, hour, minute, and second) stored in 7 data registers starting with source device S1. The results are stored to 7
data registers starting with destination device D1.
Source 1 Destination 1
Year Year
S1 D1
(0-99) (0-99)
Month Month
S1+1 D1+1
(1-12) (1-12)
Day Day
S1+2 D1+2
(1-31) (1-31)
D of W
S1+3 (Note) D1+3
Source 2 (0-6)
Note: Device S1+3 in source 1 is not used for execution and need not be designated.
Examples: TADD
The following examples demonstrate the TADD instruction that will add time data in two different modes.
• Mode 0
SOTU TADD S1 S2 D1
I0 0 D0 D10 D20
30 10 40
D1
(Minute) + D11
(Minute)
D21
(Minute)
40 5 45
D2 D12 D22
(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).
50 20 11
D1
(Minute) + D11
(Minute)
D21
(Minute)
40 30 10
D2 D12 D22
(Second) (Second) (Second)
• Mode 1
SOTU TADD S1 S2 D1
I0 1 D8008 D100 D200
Source 1 Destination 1
7 7
D8008 D200
(Year) (Year)
8 8
D8009 D201
(Month) (Month)
23 23
D8010 D202
(Day) (Day)
4 4
D8011 (Note) D203
(D of W) Source 2 (D of W)
10 10 20
D8012 D100 D204
(Hour) (Hour) (Hour)
20 15 35
D8013
(Minute) + D101
(Minute)
D205
(Minute)
30 25 55
D8014 D102 D206
(Second) (Second) (Second)
Note: D8011 in source 1 is not used for execution and does not need to be designated. The day of week is calculated automatically from the
resultant year, month, and day, and stored to D203 of destination 1.
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
7 7
D8008 D200
(Year) (Year)
8 8
D8009 D201
(Month) (Month)
23 25
D8010 D202
(Day) (Day)
4 6
D8011 (Note) D203
(D of W) Source 2 (D of W)
20 30 3
D8012 D100 D204
(Hour) (Hour) (Hour)
30 35 5
D8013
(Minute) + D101
(Minute)
D205
(Minute)
40 15 55
D8014 D102 D206
(Second) (Second) (Second)
Note: D8011 in source 1 is not used for execution and does not need to be designated. The day of week is calculated automatically from the
resultant year, month, and day, and stored to D203 of destination 1.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
When Mode 0 is selected, source devices S1 and S2 and destination device D1 occupy 3 consecutive data registers starting with the designated
device. Data D0-D7997 and D10000-D55997 can be designated as these devices.
When Mode 1 is selected, source device S1 and destination device D1 occupy 7 consecutive data registers starting with the designated device. Data
registers D0-D7993 and D10000-D55993 can be designated as these devices. Source device S2 occupies 3 consecutive data registers starting with
the designated device. Data registers D0-D7997 and D10000-D55997 can be designated as source device S2.
Since the TSUB instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
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.
Hour data can be 0 through 23. Minute and second data can be 0 through 59.
When the execution result is less than 00:00:00, 24 hour is added to the result and stored to the data register designated by destination device D1,
turning on special internal relay M8003 (borrow).
When any of the hour, minute, or second data exceeds the valid range, a user program execution error will result, turning on special internal relay
M8004 and the ERR LED on the FC6A Series MicroSmart.
When a user program execution error occurs, the execution of the instruction is canceled and the next instruction is executed. For details about the
user program execution errors, see "User Program Execution Errors" on page 3-10.
Mode 1
When mode 1 is selected, time data (hour, minute, and second) stored in 3 data registers starting with source device S2 is subtracted from the date/
time data (year, month, day, day of week, hour, minute, and second) stored in 7 data registers starting with source device S1. The results are stored
to 7 data registers starting with destination device D1.
Source 1 Destination 1
Year Year
S1 D1
(0-99) (0-99)
Month Month
S1+1 D1+1
(1-12) (1-12)
Day Day
S1+2 D1+2
(1-31) (1-31)
D of W
S1+3 (Note) D1+3
Source 2 (0-6)
Note: Device S1+3 in source 1 is not used for execution and need not be designated.
Examples: TSUB
The following examples demonstrate the TSUB instruction to that will subtract time data in two different modes.
• Mode 0
SOTU TSUB S1 S2 D1
I0 0 D0 D10 D20
30 10 20
D1
(Minute) – D11
(Minute)
D21
(Minute)
40 5 35
D2 D12 D22
(Second) (Second) (Second)
When the result is less than 00:00:00, 24 is added to the result, turning on special internal relay M8003 (borrow).
10 30 39
D1
(Minute) – D11
(Minute)
D21
(Minute)
5 30 35
D2 D12 D22
(Second) (Second) (Second)
• Mode 1
SOTU TSUB S1 S2 D1
I0 1 D8008 D100 D200
Source 1 Destination 1
7 7
D8008 D200
(Year) (Year)
8 8
D8009 D201
(Month) (Month)
23 23
D8010 D202
(Day) (Day)
4 4
D8011 (Note) D203
(D of W) Source 2 (D of W)
10 5 5
D8012 D100 D204
(Hour) (Hour) (Hour)
20 15 5
D8013
(Minute) – D101
(Minute)
D205
(Minute)
30 25 5
D8014 D102 D206
(Second) (Second) (Second)
Note: D8011 in source 1 is not used for execution and does not need to be designated. The day of week is calculated automatically from the
resultant year, month, and day, and stored to D203 of destination 1.
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
7 7
D8008 D200
(Year) (Year)
8 8
D8009 D201
(Month) (Month)
23 22
D8010 D202
(Day) (Day)
4 (Note) 3
D8011 D203
(D of W) Source 2 (D of W)
20 30 13
D8012 D100 D204
(Hour) (Hour) (Hour)
30 40 49
D8013
(Minute) – D101
(Minute)
D205
(Minute)
40 50 50
D8014 D102 D206
(Second) (Second) (Second)
Note: D8011 in source 1 is not used for execution and does not need to be designated. The day of week is calculated automatically from the
resultant year, month, and day, and stored to D203 of destination 1.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Time data in hours, minutes, seconds — — — — — — X — —
D1 (Destination 1) Destination to store results — — — — — — X — —
For valid device address ranges, see "Device Addresses" on page 2-1.
Source device S1 occupies 3 consecutive data registers starting with the designated device. Data registers D0-D7997 and D10000-D55997 can be
designated as source device S1.
Destination device D1 occupies 2 consecutive data registers to store double-word data, starting with the designated device. Data registers D0-
D7998 and D10000-D55998 can be designated as destination device D1.
Hour data can be 0 through 65,535. Minute and second data can be 0 through 59.
When any of the hour, minute, or second data exceeds the valid range, a user program execution error will result, turning on special internal relay
M8004 and the ERR LED on the FC6A Series MicroSmart. When a user program execution error occurs, the execution of the instruction is canceled
and the next instruction is executed.
When the execution of the instruction is canceled, the data in D1 and D1+1 is left unchanged. For details about the user program execution errors,
see "User Program Execution Errors" on page 3-10.
Since the HTOS instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Examples: HTOS
The following examples demonstrate the HTOS instruction that will convert time data in hours, minutes, and seconds into seconds
and store the results to two consecutive data registers.
HTOS S1 D1
I0 D0 D100
Source 1
2
D0
(Hour) Destination 1
10 7840
D1 D100·D101
(Minute) (Second)
40
D2
(Second)
Source 1
40
D0
(Hour) Destination 1
30 145820
D1 D100·D101
(Minute) (Second)
20
D2
(Second)
STOH (S to HMS)
Seconds → Hours, minutes, seconds
STOH S1 D1
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
For valid device address ranges, see "Device Addresses" on page 2-1.
Source device S1 occupies 2 consecutive data registers to store double-word data, starting with the designated device. Data registers D0-D7998 and
D10000-D55998 can be designated as source device S1.
Destination device D1 occupies 3 consecutive data registers starting with the designated device. Data registers D0-D7997 and D10000-D55997 can
be designated as destination device D1.
When the conversion result exceeds 65,535 hours 59 minutes 59 seconds, special internal relay M8003 (carry) is turned on. For example, when the
conversion result is 65,537 hours 0 minute 0 second, destination 1 stores 1 hour 0 minute 0 second, turning on special internal relay M8003 (carry).
Since the STOH instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Examples: STOH
The following examples demonstrate the STOH instruction that will convert time data in seconds into hours, minutes, and seconds
and store the results to three consecutive data registers.
STOH S1 D1
I0 D5 D100
Destination 1
3
D100
Source 1 (Hour)
12345 25
D5·D6 D101
(Second) (Minute)
45
D102
(Second)
Destination 1
3429
D100
Source 1 (Hour)
12345678 21
D5·D6 D101
(Second) (Minute)
18
D102
(Second)
The data registers specified by D3 and D3+1 are used as the system work
area.
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Source device S1, when designated by a data register, and destination device D1 occupy 3 consecutive data registers starting with the designated
device to store hour, minute, and second data. Data registers D0-D7997 and D10000-D55997 can be designated as these devices.
When source device S1 is designated by a constant, the preset value can be 0 through 65,535 in hours, then minutes and seconds are set to 0.
Special internal relays cannot be designated as destination device D2.
Destination device D3 requires two data registers reserved for system work area.
Hour data can be 0 through 65,535. Minute and second data can be 0 through 59.
When the measured input ON duration value in destination device D1 reaches the preset value designated by source device S1, the comparison
output designated by destination device D2 turns on. As long as the input remains on, the measured input ON duration value continues to increase.
When the measured input ON duration value exceeds 65,535 hours 59 minutes 59 seconds, the value returns to 0 hours 0 minutes 0 seconds to
repeat another measuring cycle, with the comparison output remaining on.
When any of the hour, minute, or second data of source device S1 exceeds the valid range, a user program execution error will result, turning on
special internal relay M8004 and the ERR LED on the FC6A Series MicroSmart, but the input ON duration is measured.
When any of the hour, minute, or second data of source device S1 is changed to an invalid value after the comparison output has turned on, the
comparison output is turned off. Then a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the
FC6A Series MicroSmart, but the input ON duration measurement is continued. For user program execution errors, see "User Program Execution
Errors" on page 3-10.
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 ↔ D100·D101·D102 → Q2
HOUR S1 D1 D2 D3
D0 D100 Q2 D1900 While input I0 is on, the ON duration is measured. The measured time
I0
value (hour, minute, and second) is stored to data registers
Source 1 Destination 1 D100·D101·D102 assigned by destination device D1 and compared with the
preset value stored in data registers D0·D1·D2 assigned by source device
50 3
D0 D100 S1.
(Hour) (Hour)
When the measured value reaches the preset value, output Q2 assigned by
35 25
D1 D101 destination device D2 is turned on.
(Minute) (Minute)
Data registers D1900 and D1901 assigned by destination device D3 are
55 45
D2 D102 reserved for system work area.
(Second) (Second)
50 ↔ D100·D101·D102 → Q2
HOUR S1 D1 D2 D3
50 D100 Q2 D1900 While input I0 is on, the ON duration is measured. The measured time
I0
value (hour, minute, and second) is stored to data registers
Source 1 Destination 1 D100·D101·D102 assigned by destination device D1 and compared with 50
hours assigned by source device S1.
50 3
Constant D100
(Hour) (Hour) When the measured value reaches 50 hours, output Q2 assigned by
destination device D2 is turned on.
25
D101
(Minute) Data registers D1900 and D1901 assigned by destination device D3 are
reserved for system work area.
45
D102
(Second)
When the input is on, the date and time and the values of the specified devices
***** ***** *****
are output to the CSV file in the folder assigned by S1. When the execution of the
instruction finishes, the device assigned by D1 is turned on and the execution
status is stored to the device assigned by D2.
When the folder assigned by S1 does not exist on the SD memory card, that
folder is created. The folder path is "FCDATA01\DATALOG\User specified folder."
For details on the folder structure, see Chapter 11 "SD Memory Card" in the
"FC6A Series MicroSmart All-in-One Type User’s Manual".
The CSV file name is "DATE.csv." The date when the DLOG instruction is turned
on is used as DATE.
Example: If the date is December 30, 2015, the file name is "20151230.csv".
When a CSV file with the same date does not exist in the folder designated by S1, the CSV file is created and the header and the
log data is output.
Output example
When a CSV file with the same date already exists in the folder designated by S1, only the log data is appended to the CSV file.
Output example
Time D0010
2015/12/30 08:30:23 12345
2015/12/30 17:30:23 1212 Appended log data
When the execution of DLOG instruction finishes, the device designated by D1 is turned on and the status code is stored to the
device designated by D2 according to the execution result. For status codes, see "3. D2 (destination 2): Execution Status" on page
25-3.
Notes:
• The time required to create a new CSV file (create a file and output header) is 510 µs.
• When the FC6A Series MicroSmart starts running and DLOG instruction is executed, the header is appended to the CSV file even if the same
DLOG instruction was executed previously within the same day.
Output example
• For details on the SD memory card specification, see Chapter 11 "SD Memory Card" in the "FC6A Series MicroSmart All-in-One Type User’s
Manual".
Notes:
• The number of DLOG instructions that can be programmed in a user program is 48. However, make sure that the folder name specified by the
DLOG instruction is not duplicated by any folder names specified by the other DLOG instructions. When the folders are duplicated, log data
with a mixed format is output to the same CSV file.
• The DLOG 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" on page 3-10.
• While the input to DLOG instruction is on, log data is repeatedly output to the CSV file. When you want to output the log data only one time,
add a SOTU (single output up instruction) or SOTD (single output down instruction) to the input condition. For SOTU or SOTD, see "SOTU
and SOTD (Single Output Up and Down)" on page 4-26.
• The process of writing data to the SD memory card for the DLOG instruction takes several scans. Once a DLOG instruction is executed, the
process continues until the log data transfer is complete, regardless of any change in the instruction input. While the log data is being written
to the SD memory card, instructions are not being executed, even when the inputs to DLOG instructions are turned on. To execute the DLOG
instruction again, confirm that the previous data transfer process has finished, and then execute the instruction.
Valid Devices
Settings
2. 3. 1.
5. 6. 7. 8.
4.
9.
10.
Notes:
• A period cannot be used at the start or the end of the folder name.
• Single-byte spaces at the start or the end of the folder name are omitted.
4. Settings
The following is a list of the device and display types that can be set as the data to be output to the CSV files.
5. Tag Name
Enter tag names or device addresses to specify the devices whose values are output 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.
8. Repeat
The data in as many consecutive devices as the specified repeat, starting from the specified device address, are output to the
SD memory card.
For example, when the display type of D10 is DEC(W) and the repeat is set to 5, the data is output to SD memory card as
follows.
Time,D0010,D0020,D0030,D0050,D0060
2015/12/30 15:40:00,12345,1,5,12,111
2015/12/30 15:41:00,1212,3,7,35,222
2015/12/30 15:42:00,345,4,99,79,333
When the DLOG 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 header and the log data 1 are output as shown in above output format example. If the DLOG instruction
is executed again on the same date, the log data 2 is appended to the CSV file. Similarly, if the DLOG instruction is executed again
on the same date, log data 3 is appended to the CSV file.
When the date changes and the DLOG instruction is executed, a new CSV file with a new file name is created and the header and
the log data is output.
• File format
The decimal symbol and separating character in CSV files can be specified in the function area settings. For details, see Chapter 11
"SD Memory Card" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
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
• The status code saved in D100 is checked and Q0 is turned on if an error occurs.
• Configuration Procedure
TIM T0 DLOG S1 D1 D2
(1) (2)
(3)
(4) (5)
(6)
• Operation Description
10 seconds after M0 is turned on, the DLOG instruction is executed one time. When the DLOG instruction is executed, the data
of D0 through D5 and D10 are output to the CSV file on the SD memory card as decimal values along with the current date and
time.
The saved location of CSV files is FCDATA01\DATALOG\RESULT. The oldest data is saved at the top of the log data, and the latest
data is saved at the bottom of the log data.
When the execution of the DLOG instruction is complete, the completion output M100 is turned on and the CMP instruction is
executed once. The CMP instruction compares the status code stored in the execution status D100 with 0 and turns Q0 on or off.
Q0 is turned on when an error occurs in the DLOG instruction.
While M0 is on, the log data is appended to the CSV file every 10 seconds.
Output results
Time D0000 D0001 D0002 D0003 D0004 D0005 D0010
2012/02/06 10:20:30 12345 0 0 56789 0 0 -3.402823E+38
2012/02/06 10:20:40 12345 0 0 56789 0 0 -3.402823E+38
2012/02/06 10:20:50 12345 0 0 56789 0 0 -3.402823E+38
When the input is turned on, the date and time and the values of the previous
***** ***** *****
scans for the specified device are output to the CSV file in the folder assigned by
S1. When the execution of the instruction finishes, the device assigned by D1 is
turned on and the execution status is stored to the device assigned by D2.
When the folder assigned by S1 does not exist on the SD memory card, that
folder is created. The folder path is "FCDATA01\TRACE\User specified folder." For
details on the folder structure, see Chapter 11 "SD Memory Card" in the "FC6A
Series MicroSmart All-in-One Type User’s Manual".
The CSV file name is "DATE.csv." The date when the TRACE instruction is turned
on is used as DATE.
Example: If the date is December 30, 2015, the file name is "20151230.csv".
When a CSV file with the same date does not exist in the folder designated by S1, the CSV file is created and the trace data is
output. The oldest data is output at the top of the trace data, and the latest data is output at the bottom of the trace data.
Output example
When a CSV file for the same date already exists in the folder designated by S1, the header and trace data are appended to the
CSV file.
Output example
When the execution of the TRACE instruction finishes, the device designated by D1 is turned on and the status code is stored to
the device designated by D2 according to the execution result. For status codes, see "3. D2 (destination 2): Execution Status" on
page 25-9.
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.
• When the input to the TRACE instruction is turned on, the accumulated data is output to the CSV file.
• The time required to create a new CSV file (create a file and output header) is 870 µs.
• Trace data is accumulated even when the MCS (master control set) instruction is on.
Notes:
• The maximum number of TRACE instructions that can be programmed in a user program is three. Make sure that the folder name specified
by the TRACE instruction is not duplicated by any of the folder names specified by the other TRACE instructions. When the folders are
duplicated, trace data with a mixed format is output to the same CSV file.
• The number of scans of which the trace data can be saved to the CSV file when the TRACE instruction is executed one time depends on the
number of devices specified to trace and the display type for each device. For details, see "9. Trace data size" on page 25-10.
• The TRACE 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" on page 3-10.
• Trace data is not accumulated when the TRACE instruction is skipped by the JMP (jump) instruction. For the JMP (jump) instruction, see "JMP
(Jump) and JEND (Jump End)" on page 4-29.
• While the input to the TRACE instruction is on, the trace data is repeatedly output to the CSV file. When you want to output the trace data
only one time, add a SOTU (single output up instruction) or SOTD (single output down instruction) to the input conditions. For SOTU (single
output up instruction) or SOTD (single output down instruction), see "Basic Instructions" - "SOTU and SOTD (Single Output Up and Down)"
on page 4-26.
• The data writing process to the SD memory card for the TRACE instruction takes several scans. Once a TRACE instruction is executed, the
process continues until the trace data transfer is complete, regardless of any change in the instruction input. While the trace data is being
written to the SD memory card, the instruction is not executed even when the input to the TRACE instructions are turned on. To execute the
TRACE instruction again, confirm that the previous data writing process has finished, and then execute the instruction.
Valid Devices
Settings
2. 3. 1.
5. 6. 7. 8.
4.
9.
10.
11.
4. Settings
The following is a list of the device and display types that can be set as the data to be output to the CSV files.
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.
8. Repeat
The data in as many consecutive devices as the specified repeat, starting from the specified device address, are output to the
SD memory card.
For example, when the display type of D10 is DEC(W) and the repeat is set to 8, the data is output to SD memory card as
follows.
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. When the date changes and the TRACE
instruction is executed, a new CSV file is created with a new file name.
• File format
The decimal symbol and separating character in CSV files can be specified in the function area settings. For details, see Chapter 11
"SD Memory Card" in the "FC6A Series MicroSmart All-in-One Type User’s Manual".
Examples: TRACE
When M0 is turned on, the accumulated data of D0 through D5 (data type W (word)) and D10 (data type F (floating point)) are
saved as decimal values in a CSV file on the "RESULT" folder on the SD memory card.
Output sample
• The execution status saved in D100 is checked and Q0 is turned on if an error occurs.
• Configuration Procedure
TRACE S1 D1 D2
SOTU
M0 RESULT M100 D100
CMP<>(W) S1 - S2 - D1 - REP
SOTU
M100 D100 0 Q0
(1) (2)
(3)
(4) (5)
(6)
• 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.
The saved location of CSV files is FCDATA01\TRACE\RESULT. The oldest data is saved at the top of the trace data, and the latest
data is saved at the bottom of the trace data.
When the execution of the TRACE instruction completes, the completion output M100 is turned on and the CMP instruction is
executed once. The CMP instruction compares the status code stored in the execution status D100 with 0 and turns Q0 on or off.
Q0 is turned on when an error occurs in the TRACE instruction.
Output results
SCRPT (Script)
Executes the specified script.
Symbol
SCRPT S1 D1
***** *****
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. To use the SCRPT instruction, you must create
a script to execute in Script Manager dialog box beforehand.
For an overview of the script function, see "Script Function Overview" on page 26-3.
For editing scripts, see "Script Programming and Management" on page 26-5.
Valid Devices
Settings
S1 (source 1): Script ID
Specify the script ID. A constant or data register can be specified.
Execution results
The execution results (D1, D1+1) store the execution status and the execution time.
Execution status
Numeric Value Status Error Cause
0 Normal termination —
1 Arithmetic error Division by zero, floating point format error
2 Script ID error The specified script does not exist
3 Device access error Invalid device specified, device boundary exceeded
If any error occurs other than the script ID error, script processing is canceled and the execution of the SCRPT instruction is
terminated. If the script ID error occurs, D1 and D1+1 are updated and execution of the SCRPT instruction terminates.
Execution time
The execution time from when the execution of the specified script is started until it is completed is stored in 100 µs
increments. For example, when it takes 1.45 ms to execute the specified script, 15 is stored as the execution time. When it
takes 6,553.5 ms or longer to execute the specified script, 65535 is stored as the execution time. The SCRPT instruction
execution time is affected by interrupt processing or other processing that occurs during the execution.
If any error occurs other than the script ID error, the script execution time from when the script execution is started until the
error occurs is stored as the execution time. If the script ID error occurs, zero is stored as the execution time.
Script selection
To specify a registered script ID for S1 in WindLDR, click Refer button on the SCRPT (Script) dialog box to open Script Manager
dialog box. Choose the script ID to execute and click on Select button on Script Manager dialog box. The selected ID will be
entered to S1.
Data Types
The following five data types can be processed in a script. For details about data types in ladder, see "Data Types for Advanced
Instructions" on page 3-7.
Quantity of Data
Data Type Symbol Bits Range of Decimal Values
Registers Used
Word (Unsigned 16 bits) W 16 bits 1 0 to 65,535
Integer (Signed 16 bits) I 16 bits 1 –32,768 to 32,767
Double Word (Unsigned 32 bits) D 32 bits 2 0 to 4,294,967,295
Long (Signed 32 bits) L 32 bits 2 –2,147,483,648 to 2,147,483,647
Float (Floating point) F 32 bits 2 –3.402823×1038 to 3.402823×1038
Note: Some functions cannot be used if the data type is different. Check the function in the notation list.
See "Programming Scripts" on page 26-12.
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. For device ranges, see "Device Addresses" on page 2-1.
Calculations in which both bit and word devices are used are not allowed.
Bit devices are always processed as bits, and values of those devices are 0 (OFF) or 1 (ON).
2. Click Add.
8. Click Close.
9. Click OK.
The script is saved and the Script Manager dialog box is closed.
Notes:
• If you click No, the script is not saved and the Script Manager dialog box is closed.
• Script Manager can also be opened from the SCRPT (Script) dialog box.
Click Refer to open Script Manager.
Script Manager
In the Script Manager dialog box, you can add scripts created in the Script Editor dialog box or delete registered scripts.
1.
3.
4.
5.
2.
6. 7.
1. List of scripts
Shows the list of registered scripts.
2. Script
Shows the contents of the script selected in the List of scripts.
3. Add
Click this button to display the Script Editor dialog box in order to create and add a script.
For details, see "Script Editor" on page 26-8.
4. Edit
Click this button to open the Script Editor dialog box in order to edit the script selected in the List of scripts.
For details, see "Script Editor" on page 26-8.
5. Delete
Click this button to delete the script selected in the List of scripts.
6. Select
This can only be used when Script Manager has been opened from the SCRPT instruction dialog box.
Select a script in the list of scripts and click this button to enter the selected script ID in S1 on the dialog box.
7. Close
Click this button to close Script Manager.
Note: If you click Close when the list of scripts was modified, a save confirmation message is displayed. Click Yes on the confirmation message to
save the changes. Click No to discard the changes and close Script Manager.
Script Editor
Script Editor is where you create new scripts and edit the scripts selected in Script Manager.
1.
2. 3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
(Description)
14.
15. 16.
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. Script Name
Enter the script name. The script name can be entered up to 40 characters.
3. Data Type
Select the data type to process in the script. For details about the data types, see "Script Data Type" on page 26-3.
4. Script
Enter the script.
The restrictions for one script are a maximum of 240 characters per line and a maximum of 1,024 lines per script.
5. Error Check
Click this button to check errors in the current script.
6. Import
Click this button to display the Open dialog box so you can import a script program.
If you select a script that was saved (exported) as a text file (*.txt) and click Open, the selected script is inserted at the current
cursor position in the current script.
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.
8. Options
Click this button to display the Options dialog box.
In the Options dialog box, you can configure the font for the text used in the Script text box, the colors, the tab indents, and
other settings. For details, see "Script Formatting Options Dialog Box" on page 26-11.
9. Find
Click this button to display the Find dialog box.
You can search the entered text in the script.
Note: If you first select an area in the Script and then click Find, you can search only in the selected area.
10. Replace
Click this button to display the Replace dialog box.
Enter the text to search in the script in Find What and enter the text to replace it with in Replace With.
Notes:
• If you first select an area in the Script and then click Replace, you can search and replace text only in the selected area.
12. Cursor
Shows the current cursor position in the Script text box as the line number and the column number.
15. OK
Click this button to perform the error check on the current script, and then return to Script Manager after the script is saved.
Note: If there are any errors in the current script the save confirmation message is displayed. Scripts that contain errors can be saved.
16. Cancel
Click this button to return to Script Manager without saving the current script.
■Font
Enter or select the font name for text displayed in Script.
■Size
Enter or select the size (pixels) of text displayed in Script.
■Sample
Shows a sample of text that will be displayed in the Script text box with the character font and the character size specified by
Font and Size.
■Colors
Shows the colors for Comment, Keyword, and Device.
Click the colored buttons to display the Theme Colors dialog box.
Characters that are not comments, keywords, or devices are all shown in black.
Programming Scripts
Format List
This section describes the notation for control statements, operators, functions, 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" on page 26-19.
Control Statements
Conditional expressions are written here as , , .
Executable lines are written as , , and so on.
■Conditional branch
Format Description
if ( )
Execution line is executed if the conditional expression is satisfied.
{ ; }
if ( )
{ ; } Execution line 1 is executed if the conditional expression is satisfied.
else Execution line 2 is executed if it is not satisfied.
if
{ ; }
else
else if if ( )
{ ; } Execution line 1 is executed if the conditional expression 1 is satisfied.
else if ( ) Conditional expression 2 is evaluated if conditional expression 1 is not satisfied,
and execution line 2 is executed if conditional expression 2 is satisfied.
{ ; }
else Execution line 3 is executed if conditional expression 2 is not satisfied too.
{ ; }
switch ( )
{
case constant 1:
;
break; Execution line 1 is executed if the value of conditional expression matches constant 1.
switch
case constant 2: Execution line 2 is executed if the value of conditional expression matches constant 2.
case
; Execution line 3 is executed if the value of conditional expression does not match
default
break; constant 1 nor constant 2.
default:
:
break;
}
■Repeat
Format Description
while ( ) Execution line is repeatedly executed while the conditional expression is satisfied.
{ The execution will go into an infinite loop when the conditional expression is always
while
; satisfied, so do not use fixed values or devices that do not change as the conditional
} expression.
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
break ; satisfied.
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.
;
}
;
switch ( )
{
case constant 1:
; When the conditional expression matches the constant 1, execution line 1 is executed
break;
break and the switch execution is terminated by break. Evaluation for constant 2 is not
case constant 2:
executed, and the execution moves to execution line 3.
;
break;
}
;
return return; Script will exit and the next instruction in the user program is executed.
Operator
Device, constant, and temporary device are described as , here, and expressions are described as , , .
■Relational operator
== == Compares if is equal to .
■Logical operator
■Arithmetic operator
+ + Adds and .
- - Subtracts from .
* * Multiplies and .
/ / Divides by .
■Bit operator
Function
Device, constant, and temporary device are described as , , , ... here.
■Bit function
■Word function
Arithmetic operation
Offset
Other
This section describes definitions for constant, device, temporary device, and comment.
■Constant
Constant can be defined as decimal or hexadecimal number.
-1234 Define the negative number with a "-" (minus) symbol at the beginning.
■Device Address
Device Address is defined with the device symbol and address within "[" and "]".
Definition of the device
[Device symbol and address] (Space between the device symbol and address is not required.)
Sample definition
[D0100]
■Temporary Device
Temporary device is a device that can be used only inside the script. It can store a value and can be used as a variable.
It is defined with a device symbol "@" followed by address (1 – 32).
Sample definition
@2 Temporary device number 2
Note: All the values for temporary devices are set to "0" when the execution of the script is started.
■Comment
A note defined in the script is called a comment. The line with "//" defined at the beginning of a line will become a comment.
"//" is defined with a single-byte. Double-byte characters can be written after "//".
Definition of comment
// Arbitrary note
Sample definition
// Store the initial value to calculation data [D0100] for process A ← This line is not executed.
[D0100] = 1234;
:
:
Notes:
• Describing comments to explain the contents of the script is useful especially when another person works on the scripts or when some time
has passed after editing the scripts.
• Comments are ignored (not executed) when the script is executed, so they can be defined freely without interfering the execution time.
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
if ([D0100])
{
[D0102] = [D0103] + [D0104] + [D0105];
}
Operation Description
If the value of D0100 is not 0, the value of D0103, D0104, and D0105 are added and the result is stored in D0102.
Example 1.3 Conditional branch
Script
if (0 != [D0100])
{
if (0 != [D0102])
{
[D0103] = 0x1234;
}
}
Operation Description
If the value of D0100 is not 0 and the value of D0102 is not 0 either, 0x1234 is stored in D0103.
If the value of D0100 is not 0 and the value of D0102 is 0, then nothing is executed.
If the value of D0100 is 0, then nothing is executed regardless of the value of D0102.
Example 1.4 Conditional branch
Script
Operation Description
If either the value of D0100 or the value of D0102 is not 0, then 100 is stored in D0103.
If the values of both D0100 and D0102 are 0, 100 is added to D0105 and the result is stored in D0104.
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.
If the value of D0100 is not 0 nor 1, then 0x9999 is stored in D0102.
Example 1.6 Conditional branch
Script
if ([D0100])
{
if ([D0102])
{
if ([D0103])
{
[D0104] = 100;
}
else
{
[D0104] = 200;
}
}
}
Operation Description
If the value of D0100, D0102, and D0103 are all not 0, then 100 is stored in D0104.
If the values of D0100 and the value of D0102 are not 0 and the value of D0103 is 0, then 200 is stored in D0104.
If either the value of D0100 or D0102 is 0, then nothing is executed regardless of the value of D0103.
Example 1.7 Iteration
Script
[D0100] = 10;
[D0102] = 10;
Operation Description
If the value of D0100 is larger than 0, then 1 is repeatedly added to the value of D0102 and 1 is repeatedly subtracted from the
value of D0100.
In the script example above, when the while statement repeats ten times, the value of D0100 becomes 0 and the while statement
ends.
After this script is executed, the value of D0100 is 0 and the value of D0102 is 20.
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.
In the example script above, the values of D0102 and D0103 are equal when the while statement repeats twice, and after M0000
changes to 1, execution breaks out of the while statement loop. After execution, the value of D0100 is 0, the value of D0102 is 5,
the value of D0103 is 5, and M0000 is 1.
Example 1.9 Indirect write and indirect read using iteration (while statement)
Script
Operation Description
This script stores the values of D0010 through D0019 in D0100 through D0109.
It operates as follows.
First, the offset value D0000 is initialized and set to 0.
First iteration (loop) : The value of D0000 is 0, so the condition "[D0000] < 10" is true and the statements inside while are executed.
• The value of D0010, 0 words from D0010, is stored in D0100, 0 words from D0100.
• 1 is added to the value of offset value D0000, so that it becomes 1.
Second iteration (loop) : The value of D0000 is 1, so the condition "[D0000] < 10" is true and the statements inside while are executed.
• The value of D0011, 1 word from D0010, is stored in D0101, 1 word from D0100.
• 1 is added to the value of offset value D0000, so that it becomes 2.
:
(Repeats in the same manner for the third to ninth iterations)
:
Tenth iteration (loop) : The value of D0000 is 9, so the condition "[D0000] < 10" is true and the statements inside while are executed.
• The value of D0019, 9 words from D0010, is stored in D0109, 9 words from D0100.
• 1 is added to the value of offset value D0000, so that it becomes 10.
The value of D0000 is 10, so the condition "[D0000] < 10" is false and execution breaks out of the while loop.
After execution, the values of D0100 through D0109 are the same with the values of D0010 through D0019.
Script
@1 = 0; // while counter
@2 = [D0100]; // gets original data
@3 = 1; // decimal base
@4 = 0; // calculation results
Operation Description
This example converts a decimal value to octal using a while statement.
By repeating the process to divide the original decimal data by 8 and converting each digit to octal in a while statement, the
conversion is implemented up to four digits.
The original decimal value is stored in D0100. After the script is executed, the converted octal value is stored in D0200.
Script
switch ([D0100])
{
case 10:
[D0200] = 0x1234;
break;
case 999:
[D0200] = 0x5678;
SET([D0000.01]);
break;
}
Operation Description
If the value of D0100 is 10, then 0x1234 is stored in D0200.
If the value of D0100 is 999, then 0x5678 is stored in D0200 and D0000.01 is set to 1.
If the value of D0100 is not 10 nor 999, then nothing is executed.
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.
If the value of D0100 is not 0 nor 1, then 0x9999 is stored in D0102.
Script
if (0x1234 == [D0100])
{
[D0102] = 0x5678;
return;
}
[D0103] = 0;
Operation Description
If the value of D0100 is not 0x1234, then 0 is stored in D0103.
If the value of D0100 is 0x1234, then 0x5678 is stored in D0102 and the script is terminated.
The return statement does not break out of a loop like the break statement, it terminates the script execution.
Script
[D0100] = 0;
[D0102] = 3;
[D0103] = 5;
while ([D0100] == 0)
{
[D0102] = [D0102] + 1;
if ([D0102] == [D0103)
{
SET([D0000.01]);
break;
}
}
Operation Description
While the value of D0100 is 0, the while statement is repeated until D0102 and D0103 match.
Inside the while statement, if the values of D0102 and D0103 are equal, the while statement will end and execution breaks out of
the while statement.
In the example above, the values of D0102 and D0103 match when the while statement is repeated twice, and after D0000.01
changes to 1, the while statement ends. After execution, the value of D0100 is 0, the value of D0102 is 5, the value of D0103 is 5,
and the value of D0000.01 is 1.
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])
{
[D0103] = 0x100;
}
Operation Description
If the value of D0100 is not equal to the value of D0102, then 0x100 is stored in D0103.
Example 2.3 Less than
Script
Operation Description
If the value of D0100 is less than the value of D0102, then 0x100 is stored in D0103.
Example 2.4 Less than or equal to
Script
Operation Description
If the value of D0100 is less than or equal to the value of D0102, then 0x100 is stored in D0103.
Example 2.5 Greater than
Script
Operation Description
If the value of D0100 is greater than the value of D0102, then 0x100 is stored in D0103.
Example 2.6 Greater than or equal to
Script
Operation Description
If the value of D0100 is greater than or equal to the value of D0102, then 0x100 is stored in D0103.
3. Logical Operators
Example 3.1 Logical AND
Script
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.
If either ([D0100] == [D0200]) or ([D0300] == [D0400] + [D0500]) is false, the processing in the brackets “{ }” is not executed.
Example 3.2 Logical OR
Script
Operation Description
If the value of D0100 is not 0 or the value of D0102 is not 0, then 100 is stored in D0300.
If either one of them is true, the processing in the brackets “ ” is executed.
Example 3.3 Logical inversion
Script
if (!([D0100] == 0x1234))
{
[D0300] = 100;
}
Operation Description
If the value of D0100 is not equal to 0x1234, then 100 is stored in D0300.
Example 3.4 Logical inversion
Script
if (!(0 !=[D0100]))
{
[D0300] = 100 ;
}
Operation Description
If the value of D0100 is 0, then 100 is stored in D0300.
This is the same as the code "if (0==[D0100]))".
4. Arithmetic Operators
Example 4.1 Addition
Script
Operation Description
The values of D0100 and D0200 are added together and the result is stored in D0300.
Script
Operation Description
The value of D0200 is subtracted from the value of D0100 and the result is stored in D0300.
Script
Operation Description
The values of D0100 and D0200 are multiplied together and the result is stored in D0300.
Script
Operation Description
The value of D0100 is divided by the value of D0200 and the result is stored in D0300.
Script
Operation Description
The value of D0100 is divided by the value of D0200 and the remainder is stored in D0300.
5. Bitwise Operators
Example 5.1 Logical AND
Script
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.
The operation is the same as the following ladder diagram.
D0000.01 D0001.01 D0002.01
Script
if ([D0000.01] | [D0001.01])
{
SET([D0002.01]);
}
else
{
RST([D0002.01]);
}
Operation Description
If the bitwise logical OR 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 OR operation on the value of D0000.01 and the value of D0001.01 is 0, D0002.01 is changed to 0.
The operation is the same as the following ladder diagram.
D0000.01 D0002.01
D0001.01
Script
Operation Description
The logical XOR operation on the value of D0100 and each bit in 0xFF is stored in D0200.
For example, if the value of D0100 is 15 (0x0F), then 240 (0xF0) is stored in D0200.
Example 5.4 Inversion
Script
[D0200] = ~[D0100];
Operation Description
The bits in the value of D0100 are inverted and stored in D0200.
For example, if the value of D0100 is 0, then 65,535 is stored in D0200.
Script
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.
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 0, then D0003.01 is changed to 0.
The operation is the same as the following ladder diagram.
D0002.01
Script
Operation Description
The value of D0100 is shifted to the left by the value of D0200 and the result is stored in D0300.
For example, if the value of D0100 is 1 and the value of D0200 is 3, 1 is shifted 3 bits to the left, and the result of 8 is stored in
D0300.
Script
Operation Description
The value of D0100 is shifted to the right by the value of D0200 and the result is stored in D0300.
For example, if the value of D0100 is 8 and the value of D0200 is 3, 8 is shifted 3 bits to the right, and the result of 1 is stored in
D0300.
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
Script
REV([D0000.01]);
Operation Description
Inverts 1 and 0 in D0000.01. The result is the same as [D0000.01] = ~[D0000.01].
7. Word Functions
Arithmetic operations
Example 7.1 Maximum value
Script
Operation Description
Out of the values stored in D0100, D0110, D0120, D0130, and D0140, the maximum value is stored in D0200.
Up to 15 arguments can be used.
Script
Operation Description
Out of the values stored in D0100, D0110, D0120, D0130, and D0140, the minimum value is stored in D0200.
Up to 15 arguments can be used.
Script
[D0010] = EXP([D0020]);
Operation Description
Calculates the exponential function of the value of D0020 and the result is stored in D0010.
Only the data type F (float) can be used.
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.
Script
[D0010] = LOG10([D0020]);
Operation Description
Calculates the logarithm of the value of D0020 with 10 as the base and the result is stored in D0010.
Only the data type F (float) can be used.
Script
[D0010] = POW([D0020],[D0030]);
Operation Description
Calculates the power of the values.
For example, if the value of D0020 is 10 and the value of D0030 is 5, the function calculates 10 to the power of 5 and stores the
result in D0010.
Only the data type F (float) can be used.
Script
[D0010] = ROOT([D0020]);
Operation Description
Calculates the square root of the value of [D0020] and the result is stored in [D0010].
Only the data type F (float) can be used.
Script
[D0010] = SIN([D0020]);
Operation Description
Calculates the sine of the radian value of D0020 and stores the result in D0010.
Only the data type F (float) can be used.
Script
[D0010] = COS([D0020]);
Operation Description
Calculates the cosine of the radian value of D0020 and stores the result in D0010.
Only the data type F (float) can be used.
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.
Script
[D0010] = ASIN([D0020]);
Operation Description
Calculates the arcsine of the value of D0020 and stores the result as radians in D0010.
Only the data type F (float) can be used.
[D0010] = ACOS([D0020]);
Operation Description
Calculates the arccosine of the value of D0020 and stores the result as radians in D0010.
Only the data type F (float) can be used.
Script
[D0010] = ATAN([D0020]);
Operation Description
Calculates the arctangent of the value of D0020 and stores the result as radians in D0010.
Only the data type F (float) can be used.
Script
[D0010] = RAD([D0020]);
Operation Description
Converts the value of D0020 from degrees (°) to radians and stores the result in D0010.
Only the data type F (float) can be used.
Example 7.15 Convert radians to angle
Script
[D0010] = DEG([D0020]);
Operation Description
Converts the value of D0020 from radians to degrees (°) and stores the result in D0010.
Only the data type F (float) can be used.
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]);
Operation Description
Converts the binary value in D0100 to a BCD value and stores it in D0200.
For example, if the binary value 16 (10 as a BCD value) is stored in D0100, 16 (BCD value) is stored in D0200.
Example 7.18 Convert float to binary
Script
[D0200] = FLOAT2BIN([D0100]);
Operation Description
Converts the float value in D0100 to a binary value and stores it in D0200.
For example, if the data type F (float) 1234.0 (0x449A4000 as a binary value) is stored in D0100, 1234 (binary value) is stored in
D0200. If the data type F (float) 1234.56 (0x449A51EC as a binary value) is stored in D0100, the value after the decimal point is
truncated and 1234 (binary value) is stored in D0200.
Example 7.19 Convert binary to float
Script
[D0200] = BIN2FLOAT([D0100]);
Operation Description
Converts the binary value in D0100 to a float value and stores it in D0200.
For example, if the binary value 1234 is stored in D0100, the float value 1234.0 (0x449A4000 as a binary value) is stored in D0200.
Example 7.20 Convert decimal to string
Script
DEC2ASCII([D0100], [D0200]);
Operation Description
Converts the decimal numeric value in D0200 to a string and stores it in order with D0100 as the starting address.
Notes:
• This function can be used with data types W (word), I (integer), D (double word), and L (long).
• The NULL terminating character (0x00) is added to the end of the string.
Stored Value
Device
Device Stored Value Upper Byte Lower Byte
D0200 1234 D0100 '1' = 0x31 '2' = 0x32
D0101 '3' = 0x33 '4' = 0x34
D0102 0x00 0x00
Terminating character
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 0x00
Terminating character
Stored Value
Device
Device Stored Value Upper Byte Lower Byte
D0200 D0100 '1' = 0x31 '2' = 0x32
1234567890
D0201 D0101 '3' = 0x33 '4' = 0x34
D0102 '5' = 0x35 '6' = 0x36
D0103 '7' = 0x37 '8' = 0x38
D0104 '9' = 0x39 '0' = 0x30
D0105 0x00 0x00
Terminating character
Stored Value
Device
Device Stored Value Upper Byte Lower Byte
D0200 D0100 '-' = 0x2D '1' = 0x31
-1234567890
D0201 D0101 '2' = 0x32 '3' = 0x33
D0102 '4' = 0x34 '5' = 0x35
D0103 '6' = 0x36 '7' = 0x37
D0104 '8' = 0x38 '9' = 0x39
D0105 '0' = 0x30 0x00
Terminating character
Script
[D0100] = ASCII2DEC([D0200]);
Operation Description
Converts the stored string starting at D0200 to a decimal and stores the result in D0100.
The number of digits that can be converted is the maximum number of digits for each data type with added sign.
If the string to convert contains a NULL or characters that cannot be converted to numeric values, the string is converted up to
that character.
Notes:
• This function can be used with data types W (word), I (integer), D (double word), and L (long).
• The NULL terminating character (0x00) is added to the end of the string.
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
Terminating character
Setting the string "1234567" (when the data type is D (double word))
Stored Value
Device
Upper Byte Lower Byte Device Stored Value
D0200 '1' = 0x31 '2' = 0x32 D0100 12345
D0201 '3' = 0x33 '4' = 0x34
D0202 '5' = 0x35 '6' = 0x36
D0203 '7' = 0x37 0x00
Terminating character
Stored Value
Device
Upper Byte Lower Byte Device Stored Value
D0200 '-' = 0x2D '1' = 0x31 D0100 -12345
D0201 '2' = 0x32 '3' = 0x33
D0202 '4' = 0x34 '5' = 0x35
D0203 0x00 0x00
Terminating character
Stored Value
Device
Upper Byte Lower Byte Device Stored Value
D0200 '1' = 0x31 '2' = 0x32 D0100 1234567890
D0201 '3' = 0x33 '4' = 0x34
D0202 '5' = 0x35 '6' = 0x36
D0203 '7' = 0x37 '8' = 0x38
D0204 '9' = 0x39 '0' = 0x30
D0205 0x00 0x00
Terminating character
Script
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. If even a single one is not equal, 0 is stored.
Compare each
D0100 D0200
D0101 D0201
D0102 D0202
D0107 D0207
D0108 D0208
D0109 D0209
Note: Even if the data type is set to D (double word), L (long), or F (float), the comparison is performed from the starting device in word units.
Script
Operation Description
Compares the third bit of D0100 through the third bit of D0109 with the state of the bits from the first bit of D0200 through the
first bit of D0209.
If the value for each is entirely equal, 1 is stored in D0000. If even a single one is not equal, 0 is stored.
Compare each
Note: Even if the data type is set to D (double word), L (long), or F (float), the comparison is performed from the starting device in bit units.
Script
Operation Description
Copies the value of 10 word devices from D0200 (up to D0209) to 10 word devices from D0100 (up to D0109).
Copy each
D0100 D0200
D0101 D0201
D0102 D0202
D0107 D0207
D0108 D0208
D0109 D0209
Note: Even if the data type is set to D (double word), L (long), or F (float), the data is copied from the starting device in word units.
Script
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
Note: Even if the data type is set to D (double word), L (long), or F (float), the bits are copied from the starting device in bit units.
Script
BITS2BITS(I004, M0000);
Operation Description
A value of 1 word length from I004 (I004 to I023) is copied to the bit states of a 1 word region from M0000 (M0000 to M0017).
Copy each
M0000 I004
M0001 I005
M0017 I023
Script
BITS2WORD(I004, D0000);
Operation Description
A value of 1 word length from I004 (to I023) is copied to the value of device D0000.
This is the same as BITS2BITS (I004, D0000.0);.
Script
WORD2BITS(D0100, M0000);
Operation Description
The value of device D0100 is copied to the bit states of a value of 1 word length from M0000 (M0000 to M0017).
This is the same as BITS2BITS (D1000.0, M0000);.
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
Operation Description
Stores in order from D0100 character count 3 (3 characters worth) from start position 2 (starting from 0, so the 3rd character) of
the string "ABCDEFG" that starts from D0200.
Note: The start position can be specified in the range from 0 to 127, the character count can be specified in the range from 1 to 128.
Script
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.)
STRCAT([D0100], [D0200]);
Operation Description
Appends the string starting from D0200 to the string starting from D0100.
Note: The NULL terminating character (0x00) is the end of the string. (The terminating character is not included in the string length.)
Script
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.
When searching for "WXYZ" and the string was not found
Search string String to be searched Search result
Device Stored Value Device Stored Value Position Device Stored Value
Upper Byte 'W' = 0x57 Upper Byte 'A' = 0x41 0
D0200 D0100 D0000 -1
Lower Byte 'X' = 0x58 Lower Byte 'B' = 0x42 1
Upper Byte 'Y' = 0x59 Upper Byte 'C' = 0x43 2
D0201 D0101
Lower Byte 'Z' = 0x5A Lower Byte 'D' = 0x44 3
Upper Byte 0x00 Terminating character Upper Byte 'E' = 0x45 4
D0202 D0102
Lower Byte 0x00 Lower Byte 'F' = 0x46 5
Upper Byte 'G' = 0x47 6
D0103
Lower Byte 'H' = 0x48 7
Upper Byte 'I' = 0x49 8
D0104
Lower Byte 'J' = 0x4A 9
Upper Byte 'K' = 0x47 10
D0105
Lower Byte 'L' = 0x4C 11
Upper Byte 'M' = 0x4D 12
D0106
Lower Byte 'N' = 0x4E 13
Upper Byte 'O' = 0x4F 14
D0107
Lower Byte 0x00 Terminating character
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.
Script
OFFSET([D0010],[D0020]) = 1234;
Operation Description
When the value of D0020 is 3, the constant 1234 is stored in D0013, the device 3 words from D0010.
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.
[D0100] = 10;
while (0 != [D0100])
{
[D0200] = [D0200] + 1;
}
In the conditional expression of the while definition, it states to exit the loop when the value of D0100 turns 0. However, the value
stored in D0100 is not changed after string 10 in the first line of the script, so the execution goes into an infinite loop.
When using the while definition, define it so the execution will not go into an infinite loop.
If the execution becomes an infinite loop, the scan time will exceed the watchdog timer setting and a watchdog timer error will
occur.
The value of D0100 becomes 0 when the while definition is repeated 10 times in the following example, and the execution will get
out of the while definition.
[D0100] = 10;
while (0 != [D0100])
{
[D0200] = [D0200] + 1;
[D0100] = [D0100] - 1;
}
Priority Operator
High ()
! ~ - (Negative number)
* / %
+ - (Subtraction)
<< >>
&
^
|
< <= > >=
== !=
&&
||
Low =
Symbol
SCALE(*) S1 S2 S3 D1 D2
***** ***** ***** ***** *****
Operation
When the input is on, the value of the data register specified by S1 is scaled according to the settings in the data register specified
by S2, then the calculated result is stored in the output value (D1+0, D1+1).
As shown in the diagram below, scaling is calculated by substituting the input value into a linear function that has been derived
from four points that are set by the output maximum value, output minimum value, input maximum value, input minimum value,
which are configured by S2.
Output value
(D1+0, D1+1)
Notes:
• The SCALE instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error occurs, the
execution of the instruction is canceled, and the next instruction is executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
• If the value of S1 or S2 is out of range, the result is a user program execution error. Error code 28 is stored in D8006, and the output value
(D1+0, D1+1) and the output value (dead band) (D1+2, D1+3) are not updated.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
• In the following cases, a user program execution error will occur. Error code 46 is stored in D8006, and the output value (D1+0, D1+1) and
the output value (dead band) (D1+2, D1+3) are not updated. For user program execution errors, see "User Program Execution Errors" on
page 3-10.
• When the input minimum value (S2+1) is the input maximum value (S2+0) or higher (input minimum value (S2+1) ≥ input maximum
value (S2+0))
• When the output minimum value (S2+4, S2+5) is the output maximum value (S2+2, S2+3) or higher (output minimum value (S2+4,
S2+5) ≥ output maximum value (S2+2, S2+3))
• When the output maximum value, the output minimum value, or the dead band (S2+6, S2+7) is INF (infinity) or NAN (not a number)
Output value
Output value (dead band)
Dead band
When the SCALE instruction is executed, it stores the value scaled in the first scan in output value (D1+0, D1+1) and updates the
output value (dead band) (D1+2, D1+3).
The operation at this time differs according to whether or not the dead band is enabled.
When the dead band is enabled
The output value (D1+0, D1+1) and the output value (dead band) (D1+2, D1+3) are compared, and the value is stored
depending on which of the absolute value of that difference (D1+4, D1+5) and the size of the dead band (S2+6, S2+7) are larger.
• If the absolute value of the difference (D1+4, D1+5) between the output value (D1+0, D1+1) and the output value (dead band)
(D1+2, D1+3) is less than the dead band (S2+6, S2+7)
The output value (D1+0, D1+1) is not stored in the output value (dead band) (D1+2, D1+3).
• If the absolute value of the difference (D1+4, D1+5) between the output value (D1+0, D1+1) and the output value (dead band)
(D1+2, D1+3) is greater than or equal to the dead band (S2+6, S2+7)
The output value (D1+0, D1+1) is stored in the output value (dead band) (D1+2, D1+3) and output value (dead band) change
notification (D2+0) turns on for one scan.
If the dead band is disabled (dead band (S2+6, S2+7)=0)
The output value (D1+0, D1+1) is stored in the output value (dead band) (D1+2, D1+3) with each scan.
-100
(2)
100
Output value (dead band)
(2) (2)
(D1+2, D1+3)
Initial value 0
(1) (1) (1) (1)
-100
(1) Since the absolute value of the difference (D1+4, D1+5) between the output value and the output value (dead band) is
less than the dead band, the output value (D1+0, D1+1) is not stored in the output value (dead band) (D1+2, D1+3).
(2) Since the absolute value of the difference (D1+4, D1+5) between the output value and the output value (dead band) is greater
than or equal to the dead band, the output value (D1+0, D1+1) is stored in the output value (dead band) (D1+2, D1+3).
(3) Output value (dead band) change notification (D2+0) turns on for one scan when (2) occurs.
1st scan 2nd scan 3rd scan 4th scan 5th scan 6th scan 7th scan
-100
100
50
Output value (dead band) 10
(D1+2, D1+3)
-50
-100
Valid Devices
Special data registers cannot be designated as S2 and D1. Special internal relays cannot be designated as D2.
Data Types
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.
■ Devices tab
(6)
(7)
(8)
■ Settings tab
(1)
(2)
*1 If the conditions for the settings cannot be satisfied, a user program execution error will occur and the output value and output value (dead
band) will not be updated.
*2 The data range is 0 and 1.175494E-38 to 3.402823E+38.
Operation Example
SCALE(*) S1 S2 S3 D1 D2
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.
Devices tab
Settings Description
S1 (input value) D0000
S2 (control register) D0050
S3 (initialization input) M8120
D1 (output register) D0150
D2 (output relay) M0050
Settings tab
Settings Description
Data type Word (W)
Input maximum value 4,095
Input minimum value 0
Output maximum value 65,535
Output minimum value 0
Deadband 10
Symbol
FLWA S1 S2 S3 D1 D2
***** ***** ***** ***** *****
Operation
The flow rate is sampled at a fixed cycle and the accumulated flow volume is calculated. That result is stored in the device
specified by D2 (logged data).
The FLWA instruction has a totalizer function that samples and accumulates the flow rate and a log output function that
temporarily saves the accumulated volume at the desired time.
Note: When using an analog output type flow meter, the FLWA instruction can be used to monitor the flow volume by converting the analog value
output from the flow meter to the flow rate with the SCALE instruction.
For details on the SCALE instruction, see "SCALE (Convert Analog Input)" on page 27-1.
When using a pulse output type flow meter, the FLWP instruction can be used to monitor the flow volume. For details on the FLWP instruction, see
"FLWP (Pulse Flow Totalizer)" on page 27-18.
Notes:
• The FLWA instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error occurs, the
execution of the instruction is canceled, and the next instruction is executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
• The FLWA instruction cannot be simultaneously used with the LABEL, LJMP, LCAL, LRET, JMP, JEND, MCS, and MCR instructions.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
Sampling
period
Flow rate
(S1+0, S1+1)
Note: For details on the totalizer function such as the operation immediately after the input is turned on and the operation when the enable totalizer
input (S2) is once again turned on, see "Totalizer Function" on page 27-11.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
ON
Log execution input (S3)
OFF
Sampling
period
Flow rate
(S1+0, S1+1)
Note: For details on the log output function such as the operation immediately after the input is turned on, the operation when the enable totalizer
input (S2) is once again turned on, and the logged data updating when the log execution input (S3) is turned on, see "Log Output Function" on page
27-13.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) Flow rate — — — — — — X — —
S2 (Source 2) Enable totalizer input X — X — — — — — —
S3 (Source 3) Log execution input X — X — — — — — —
D1 (Destination 1) Status — — — — — — — —
D2 (Destination 2) Logged data — — — — — — — —
Function Descriptions
■ Totalizer Function
Starting Totalization
This section describes the operation from turning on the input to starting totalization.
ON
Input
OFF
(1)
ON
Enable totalizer input (S2)
OFF
(2) (3) (4)
Flow rate
(S1+0, S1+1)
Sampling
period
Accumulated flow volume work area
(D1+4, D1+5)
(1) If the input is turned on, the operation status (D1+0), the amount of logged data (D2+0), the accumulated flow volume
work area, the accumulated time work area, and the logged data (D2+2 to D2+2+(6×maximum amount of logged data))
are initialized to "0".
(2) If the enable totalizer input (S2) is turned on, sampling starts. The accumulated time work area (D1+6, D1+7) count starts
at the same time.
(3) The amount to add calculated from the flow rate (S1+0, S1+1) when sampled and the elapsed time is added to the
accumulated flow volume work area (D1+4, D1+5).
(4) Afterward the operation in (3) is repeated.
ON
Input
OFF
(1)
ON
Enable totalizer input (S2)
OFF
(2) (3) (4)
A
Flow rate
(S1+0, S1+1)
Sampling
period
(1) While the totalization is being executed, if the enable totalizer input is turned off, sampling is paused and updating the
accumulated flow volume work area (D1+4, D1+5) and the accumulated time work area (D1+6, D1+7) is stopped. The
accumulated flow volume work area and the accumulated time work area values are retained.
During the period from the previous sampling to (1), the flow rate is not added to the accumulated flow volume work area,
even if it is larger than "0".
(2) If the enable totalizer input once again changes from off to on, totalization restarts.
The processing is the same as (2) in "Starting Totalization" on page 27-11.
(3) The accumulated flow volume and the accumulated time for the sampling period are calculated.
The processing is the same as (3) in "Starting Totalization" on page 27-11.
(4) Afterward the operation in (3) is repeated.
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.
ON
Input
OFF
(1)
ON
Enable totalizer input (S2)
OFF
A (2)
Flow rate
(S1+0, S1+1)
Sampling
period
Accumulated flow volume work area
(D1+4, D1+5)
(1) When the input is off, updating the accumulated flow volume work area and the accumulated time work area is stopped.
The accumulated flow volume work area and the accumulated time work area values are retained.
During the period from the previous sampling to (1) (=A), the flow rate is not added to the accumulated flow volume work
area, even if it is larger than "0".
(2) When the input is off, the accumulated flow volume work area and the accumulated time work area values are retained,
even if the enable totalizer input is turned off.
ON
Input
OFF
ON (2)
Enable totalizer input (S2)
OFF
(1) (3)
Flow rate
(S1+0, S1+1)
Sampling
period
Accumulated flow volume work area
(D1+4, D1+5)
(1) When the enable totalizer input is off, totalization (updating the accumulated flow volume work area and the accumulated
time work area) is stopped.
The accumulated flow volume work area and the accumulated time work area values are retained.
(2) Even if the input is turned off, no processing is performed as totalization was stopped in (1).
The accumulated flow volume work area and the accumulated time work area values are retained.
(3) When the input is off, no processing is performed even if the enable totalizer input is turned on.
The accumulated flow volume work area and the accumulated time work area values are retained.
Flow rate
(S1+0, S1+1)
(1) When the enable totalizer input (S2) is on, if the log execution input (S3) is turned on, the log is updated and the
accumulated flow volume work area and the accumulated time work area values are initialized to "0".
(2) The amount to add calculated from the flow rate (S1+0, S1+1) and the elapsed time is added to the accumulated flow
volume work area.
When the enable totalizer input is on, the sampling period is retained even during the log update processing.
(3) When the enable totalizer input is off, sampling is paused and updating the accumulated flow volume work area and the
accumulated time work area is stopped.
The accumulated flow volume work area and the accumulated time work area values are retained.
(4) Even when the enable totalizer input is off, if the input is on, the log is output in the same manner as (1).
When the input is off
When the input is off, no processing is performed even if the log execution input (S3) is turned on.
Log Updating
The logged data can be recorded from log 1 to log 35. Log 1 is the newest logged data.
Each time the log is updated, 1 is added to the amount of logged data (1) and the old logged data is pushed back by one item (2).
When the maximum amount of logged data is reached, the oldest log is deleted (3).
The date/time information (4) and accumulated flow volume (5) is stored in log 1.
The accumulated time (6) unit is converted from "ms" to "s" and stored in log 1.
Log 34
Log 35
The maximum amount of logged data to use is specified on the Settings tab in the FLWA (Analog Flow Totalizer) dialog box.
Note: For details on the date/time information, the accumulated flow volume, and the accumulated time recorded in the log, see "(5) D2
(Destination 2): Logged Data" on page 27-15.
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.
Comment Shows the comment for the device address. This item can be edited.
Note: If the flow rate value is outside the valid range, a user program execution error occurs, M8004 turns on, error code 28 is stored in D8006, and
execution of the instruction is canceled. 10 is also stored in the status (D1) at the same time.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
(2) S2 (Source 2): Enable Totalizer Input
Specify the device to enable totalization processing of the flow rate.
When the enable totalizer input is off, totalization is paused. When on, totalization is executed.
For details on the enable totalizer input, see "Function Descriptions" on page 27-11.
(3) S3 (Source 3): Log Execution Input
Specify the device to execute and stop the logging process that updates the log and initializes the accumulated flow volume
work area and the accumulated time work area to "0".
When the log execution input changes from off to on, the logging process is executed.
For details on the log execution input, see "Log Output Function" on page 27-13.
(4) D1 (Destination 1): Status
Specify the device to store the status including the error during FLWA instruction execution. 10 continuous words are used
starting from the set device.
Storage
Function Description
Destination
Stores the status including the error during FLWA instruction execution.
D1+0 Operation status 0 : Normal
10 : Flow rate out of range during sampling
D1+1
System work area
…
D1+9
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.
Storage
Function Description Data Range
Destination
D2+0 Amount of logged data Stores the amount of logged data that has been recorded. W (word): 0 to 35
D2+1 Reserved — —
When the log execution input (S3) changes from off to on (during log
D2+2 updating), these devices store the content of special data registers D (double word):
Log time
D2+3 D8008 to D8014 (current calendar/time values) converted to the 0 to 4,294,967,295*2
number of seconds*1 from January 1st, 1970.
When the log execution input (S3) changes from off to on (during log
updating), these devices store the accumulated flow volume. F (float):
D2+4 Log 1 Accumulated
For the processing when an accumulated flow volume overflow or 0, 1.175494E-38 to
D2+5 flow volume
underflow has occurred, see "Carry and Borrow in Floating-Point Data 3.402823E+38*2
Processing" on page 3-8.
When the log execution input (S3) changes from off to on (during log
D2+6 Accumulated D (double word):
updating), these devices store the accumulated time.
D2+7 time 0 to 4,294,967,295*2
The unit is "s".
…
…
D2+206
Log time
D2+207
D2+208 Accumulated
Log 35 Same as log 1. Same as log 1.
D2+209 flow volume
D2+210 Accumulated
D2+211 time
*1 The time expressed as the number of seconds from 00:00:00 on January 1st, 1970.
(For example, if the date/time is 00:00:00 on January 1st, 2015, the value is 1,420,070,400 seconds.)
*2 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see Chapter 3 "Instructions
Reference" - "32-bit Data Storage" on page 3-9.
■ Settings tab
(1)
(2)
(3)
Operation Example
Configuration Example
Devices tag
Settings tag
Example program
SCALE(W) S1 S2 S3 D1 D2 • If input M0000 turns on, the result of analog input value D8058 being
1 D8058 D0000 M0020 D0010 M0030 converted to the flow rate is stored in D0010 with each scan.
M0000
• Sampling of the flow rate D0010 and totalization starts by turning on
FLWA S1 S2 S3 D1 D2 input M0000 and enable totalizer input M0050.
M0000
1 D0010 M0050 M0100 D0150 D0200 • The operation status is stored in D1 (status).
• By turning on M0100 for one scan every day at 00:00 with the WEEK
WEEK S1 S2 S3 D1 instruction, S3 (log execution input) turns on and the current log
1 M0100 information is stored in D2 (logged data).
M0000
Symbol
FLWP(*) S1 S2 S3 D1 D2
***** ***** ***** ***** *****
Operation
The FLWP instruction calculates the flow rate and the accumulated flow volume by acquiring the pulse signal output from a pulse
output type flow meter using a counter and monitoring the value of that counter. That result is stored in the devices specified by
D1 (status) and D2 (logged data).
The FLWP instruction has a flow rate calculation function that calculates the flow rate from pulses, a totalizer function that
accumulates the flow volume, and a log output function to temporarily save the accumulated volume at the desired time.
Note: When using an analog output type flow meter, the FLWA instruction can be used to monitor the flow volume. For details on the FLWA
instruction, see "FLWA (Analog Flow Totalizer)" on page 27-9.
Notes:
• The maximum frequency of pulses that the FLWP instruction supports is 10 kHz.
• Output the log in a cycle within 119 hours.
• The FLWP instruction cannot be used in an interrupt program. If used in an interrupt program, a user program execution error occurs, the
execution of the instruction is canceled, and the next instruction is executed.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
• The FLWP instruction must be executed with each scan as set or it cannot correctly measure the time. Therefore, it cannot be simultaneously
used with the LABEL, LJMP, LCAL, LRET, JMP, JEND, MCS, and MCR instructions.
Flow Rate Calculation Function Overview
When the input is on, if the enable totalizer input (S2) is turned on, the amount that the flow counter (S1+0, S1+1)
increased is added to the flow volume work area with each scan. The flow rate (D1+0, D1+1) is updated every second with
the result that is calculated from the flow volume work area.
If the enable totalizer input is turned off, the flow rate is initialized to "0" and updating the flow rate is stopped.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
Flow counter
(S1+0, S1+1)
Flow rate
update cycle
Flow volume work area
1s
(D1+8, D1+9)
Flow rate
(D1+0, D1+1)
Note: For details on the flow calculation function such as the operation immediately after the input is turned on and the operation when the enable
totalizer input is once again turned on, see "Flow Rate Function" on page 27-20.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
Flow counter
S1+0, S1+1
Note: For details on the totalizer function such as the operation immediately after the input is turned on and the operation when the enable totalizer
input is once again turned on, see "Totalizer Function" on page 27-22.
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. The accumulated flow volume work area and the accumulated
time work area values are retained.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
ON
Log execution input (S3)
OFF
Flow counter
(S1)
Note: For details on the log output function such as the operation immediately after the input is turned on, the operation when the enable totalizer
input (S2) is once again turned on, and the logged data updating when the log execution input (S3) is turned on, see "Log Output Function" on page
27-23.
Valid Devices
Function Descriptions
■ Flow Rate Function
ON
Input
OFF
(1)
ON
Enable totalizer input (S2)
OFF
(2) (3) (4)
Flow counter
S1+0, S1+1
Flow rate
update cycle
Flow volume work area
1s
D1+8, D1+9
Flow rate
D1+0, D1+1
(1) If the input is turned on, the flow volume work area and the flow rate (D1+0, D1+1) are initialized to "0".
(2) If the enable totalizer input (S2) is turned on, sampling of the flow counter (S1+0, S1+1) starts, and the amount that the
flow counter increased is added to the flow volume work area with each scan.
(3) When the enable totalizer input is on, the flow volume is calculated from the flow volume work area each second and stored
in the flow rate.
The flow rate calculation is executed at a cycle of 1 second regardless of whether the log execution input (S3) is turned on
or off.
(4) (2) and (3) are then repeated.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
(1) (2) (3) (4)
Flow counter
(S1+0, S1+1)
Flow rate
update cycle
Flow volume work area
1s
(D1+8, D1+9)
Flow rate
(D1+0, D1+1)
(1) If the enable totalizer input (S2) is turned off, the flow rate is initialized to "0".
(2) If the enable totalizer input (S2) is turned on, sampling of the flow counter (S1+0, S1+1) starts, and the amount that the
flow counter (S1) increased is added to the flow volume work area with each scan. The processing is the same as (2) in
"Starting the Flow Rate Calculation" on page 27-20.
(3) 1 second after the enable totalizer input is turned on, the flow rate is calculated from the flow volume work area and stored
in the flow rate (D1+0, D1+1).
Regardless of whether or not the log execution input (S3) is on or off, the flow rate is calculated in a 1 second cycle (the
processing is the same as (3) in "Starting the Flow Rate Calculation" on page 27-20).
(4) (2) and (3) are then repeated.
ON
Input
OFF
(1) (2) (3) (4)
ON
Enable totalizer input (S2)
OFF
Flow rate
update cycle
Flow counter 1s
(S1+0, S1+1)
Flow rate
(D1+0, D1+1)
(1) If the input is turned off when the enable totalizer input (S2) is on, the flow volume work area and flow rate are initialized to
"0" and the instruction ends.
(2) If the input is turned on when the enable totalizer input is on, the flow rate calculation starts.
(3) If the enable totalizer input is turned off, the flow rate is initialized to "0" and the flow rate calculation is paused (the
processing is the same as (1) in "Pausing the Flow Rate Calculation" on page 27-21).
(4) If the input is turned off, the flow volume work area and the flow rate (D1+0, D1+1) are initialized to "0" and the instruction
ends.
■ Totalizer Function
Starting and Pausing Totalization
This section describes the operation from turning on the input to starting and pausing totalization.
ON
Input
OFF
ON
(1) (2) (3) (4)
Enable totalizer input (S2)
OFF
Flow counter
(S1+0, S1+1)
(1) If the input is turned on, the operation status (D1+2), the amount of logged data (D2), the accumulated flow volume work
area, the accumulated time work area, and the logged data (D2+2 to D2+2+(6×maximum amount of logged data)) are
initialized to "0".
(2) If the enable totalizer input (S2) is turned on while the input is on, sampling of the flow counter starts, and the amount that
the flow counter increased is added to the accumulated flow volume work area with each scan. The accumulated time work
area also starts being measured at the same time.
(3) If the enable totalizer input is turned off, updating the accumulated flow volume work area and the accumulated time work
area is paused.
(4) If the enable totalizer input is once again changed from off to on, the operation is the same as in (2) without initializing the
accumulated flow volume work area and the accumulated time work area.
Ending Totalization
The section describes the operation to end totalization.
ON
Input
OFF
(1) (2) (4)
ON
Enable totalizer input (S2)
OFF
(3)
Flow counter
(S1+0, S1+1)
(1) If the input is turned off when the enable totalizer input (S2) is on, updating the accumulated flow volume work area and the
accumulated time work area is stopped. The accumulated flow volume work area and the accumulated time work area
values are retained.
(2) If the input is turned on, the accumulated flow volume work area and the accumulated time work area are initialized to "0".
If the enable totalizer input is on at this time, updating the accumulated flow volume work area and the accumulated time
work area starts.
(3) If the enable totalizer input is turned off, updating the accumulated flow volume work area and the accumulated time work
area is paused.
The processing is the same as (3) in "Starting and Pausing Totalization" on page 27-22.
(4) If the input is turned off, the totalization processing stops. The accumulated flow volume work area and the accumulated
time work area values are retained.
ON
Input
OFF
ON
Enable totalizer input (S2)
OFF
(1) (2) (3)
ON
Log execution input (S3)
OFF
Flow counter
(S1+0, S1+1)
(1) When the enable totalizer input (S2) is on, if the log execution input (S3) is turned on, the log is updated and the
accumulated flow volume work area and the accumulated time work area values are initialized to "0".
(2) If the enable totalizer input is turned off, sampling is paused and updating the accumulated flow volume work area and the
accumulated time work area is stopped. The accumulated flow volume work area and the accumulated time work area
values are retained.
(3) Even when the enable totalizer input is off, if the input is on, the log output processing is performed in the same manner
as (1).
Log Updating
The logged data can be recorded from log 1 to log 35. Log 1 is the newest logged data.
Each time the log is updated, 1 is added to the amount of logged data (1) and the old logged data is pushed back by one item (2).
When the maximum amount of logged data is reached, the oldest log is deleted (3).
The date/time information (4) and accumulated flow volume (5) is stored in log 1.
The accumulated time (6) unit is converted from "ms" to "s" and stored in log 1.
Log 34
Log 35
The maximum amount of logged data to use is specified on the Settings tab in the FLWP (Pulse Flow Totalizer) dialog box.
Note: For details on the date/time information, the accumulated flow volume, and the accumulated time recorded in the log, see "(5) D2
(Destination 2): Logged Data" on page 27-25.
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.
Comment Shows the comment for the device address. This item can be edited.
The setting range differs according to "(2) Counter Type" on page 27-26.
If Data Type is "Word (W)", the range is 0 to 65,535.
If Data Type is "Double (D)", the range is 0 to 4,294,967,295*1.
*1 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see Chapter 3
"Instructions Reference" - "32-bit Data Storage" on page 3-9.
Storage
Function Description
Destination
D1+0 Stores the flow rate calculated every second. The flow rate unit F (float):
Flow rate
D1+1 conforms to the K factor and flow rate unit settings. 1.175494E-38 to 3.402823E+38*1
D1+2 Operation status Stores the status including the error during FLWP instruction execution.
D1+3
System work area
…
D1+15
*1 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see Chapter 3 "Instructions
Reference" - "32-bit Data Storage" on page 3-9.
Storage
Function Description Range
Destination
Amount of logged
D2+0 Stores the amount of logged data that has been recorded. W (word): 0 to 35
data
D2+1 Reserved — —
When the log execution input (S3) changes from off to on
D2+2 (during log updating), these devices store the content of special D (double word):
Log time
D2+3 data registers D8008 to D8014 (current calendar/time values) 0 to 4,294,967,295*2
converted to the number of seconds*1 from January 1st, 1970.
When the log execution input (S3) changes from off to on
(during log updating), these devices store the accumulated flow
F (float):
D2+4 Log Accumulated volume.
0, 1.175494E-38 to
D2+5 1 flow volume For the processing when an accumulated flow volume overflow
3.402823E+38*2
or underflow has occurred, see "Carry and Borrow in Floating-
Point Data Processing" on page 3-8.
When the log execution input (S3) changes from off to on
D2+6 Accumulated (during log updating), these devices store the accumulated D (double word):
D2+7 time time. 0 to 4,294,967,295*2
The unit is "s".
…
D2+206
Log time
D2+207
D2+208 Log Accumulated
Same as log 1. Same as log 1.
D2+209 35 flow volume
D2+210 Accumulated
D2+211 time
*1 The time expressed as the number of seconds from 00:00:00 on January 1st, 1970.
(For example, if the date/time is 00:00:00 on January 1st, 2015, the value is 1,420,070,400 seconds.)
*2 The upper and lower data registers change according to the 32-bit data storage method specified. For details, see Chapter 3 "Instructions
Reference" - "32-bit Data Storage" on page 3-9.
■ Settings tab
(1)
(2)
(3)
(4)
(5)
Free Run: An addition-only free run operation is performed without initializing the flow counter. The free run
operation resets the count to 0 and continues counting when the count exceeds the upper limit of the
data type (65,535 (W), 4,294,967,295 (D)).
Difference: The number of pulse count for each scan is stored in the flow counter.
For example, use this option when you will count pulses with two different types of counters, calculate
that difference in the ladder, and directly store that to the flow counter.
Operation Example
Configuration Example
Devices tag
Settings tag
Example program
• Totalization starts by turning on input M0000 and S2 (enable totalization
FLWP S1 S2 S3 D1 D2 input).
1 D8120 M0050 M0100 D0150 D0150
M0000 • The flow volume is calculated based on the accumulated value and the
operation status is stored in D1 (status).
WEEK S1 S2 S3 D1
1 M0100 • By turning on M0100 for one scan every day at 00:00 with the WEEK
M0000 instruction, S3 (logging trigger input) turns on and the current log
information is stored in D2 (logged data).
Symbol
UMACRO S1 A1 An
***** ***** *****
Operation
When the input is on, the user-defined macro that corresponds to the specified user-defined macro number will be executed.
When the input is off, the user-defined macro that corresponds to the specified user-defined macro number will not be executed.
You can set the argument devices that will be used in the user-defined macro that is executed by the UMACRO instruction.
Argument devices are devices that the user-defined macro will actually use when the UMACRO instruction is executed. For
example, when I0001 is set for A1, A0001 will operate as I0001 in the user-defined macro.
Valid Devices
Device Function I Q M R T C D Constant Repeat
S1 (Source 1) User-defined Macro Number — — — — — — — X*1 —
*2 Argument Device 1 to n
A1 ... An X X X X X X X X —
(n is 1 ≤ n ≤ 100)
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 number 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.
Main program
UMACRO S1 A1
0 I0001
I0000
MOV(W) S1 - D1 - REP
D0000 D0001
A0001
Note: You can save time and effort in writing similar ladder programs and creating new ladder programs by turning a ladder program into a user-
defined macro.
Note: The UMACRO, JMP, JEND, MCR, MCS, LCAL, LJMP, LRET, LABEL, DJNZ, and END instructions cannot be used in a user-defined macro.
Settings
(1)
(2)
(1) (2)
(3)
(4)
(5)
(6)
(1) No.
Sets the number for the user-defined macro.
(2) Name
Enter the user-defined macro name.
(1) (2)
(3)
(4)
Note: You can prevent the settings in the User-defined Macro dialog box from being changed by selecting the Enable
Protection check box and setting a password.
4. Create a ladder program in the Editor for the created user-defined macro in the same manner as the main program and
subroutines. Use the argument devices (A1 to A100) configured in the User-defined Macro dialog box as required.
The created user-defined macro can be executed with the UMACRO instruction.
Note: The UMACRO, JMP, JEND, MCR, MCS, LCAL, LJMP, LRET, LABEL, DJNZ, and END instructions cannot be used in a user-
defined macro.
Note: The arguments configured in the User-defined Macro dialog box can be used in the user-defined macro as devices. For
example, if the device type of A1 is set to data register in the User-defined Macro dialog box, A1 can be used in the same
manner as a data register.
■User-defined macro
UMACRO S1 UMACRO S1
1 1 User-defined macro
I0000 I0000
(user-defined macro number S1: 1)
User-defined macro
(user-defined macro number S1: 1)
Insert
UMACRO S1 UMACRO S1
1 1
I0001 I0001
User-defined macro
(user-defined macro number S1: 1)
■Subroutine
Main program
LCAL S1
1
I0000
LCAL S1
1
I0001
Call
END
LABEL
Subroutine
(Label number S1: 1)
LRET
Instruction Bytes
The byte quantities for basic and advanced instructions are listed below.
User Program
Execution Error Code Error Details
(D8006)
1 Source/destination device exceeds range.
2 MUL result exceeds data type range.
3 DIV result exceeds data type range, or division by 0.
4 BCDLS has S1 or S1+1 exceeding 9999.
5 S1 is 10,000 or higher in the HTOB(W) instruction, or S1 is 100,000,000 or higher in the HTOB(D) instruction.
6 BTOH has any digit of S1 exceeding 9.
7 HTOA/ATOH/BTOA/ATOB has quantity of digits to convert out of range.
8 ATOH/ATOB has non-ASCII data for S1 through S1+4.
In the WEEK instruction, the ON time data exceeds range (hour data is 24 or higher, minute data is 60 or higher),
9
or the OFF time data exceeds range (hour data is 25 or higher, minute data is 60 or higher).
In the YEAR instruction, the month and day data exceeds range (month data is 13 or higher, day data is 32 or
10
higher).
CVXTY/CVYTX is executed without matching XYFS.
12
XYFS and CVXTY/CVYTX have the same S1, but have different data types.
13 CVXTY/CVYTX has S2 exceeding the value specified in XYFS.
14 Label in LJMP, LCAL, or DJNZ is not found.
16 PID instruction execution error.
Attempt was made to execute an instruction that cannot be used in an interrupt program:
SOTU, SOTD, TML, TIM, TMH, TMS, CNT, CDP, CUD, SFR, SFRN, WEEK, YEAR, MSG, TXD, RXD, DI, EI, XYFS,
18
CVXTY, CVYTX, AVRG, PULS, PWM, RAMP, ZRN, ARAMP, DTML, DTIM, DTMH, DTMS, TTIM, FIFOF, NDSRL, HOUR,
ETXD, ERXD, DLOG, and TRACE (see "Instructions Reference" on page 3-1).
19 Attempt was made to execute an instruction that is not available for the PLC.
20 JOG, ABS, HZRN, PULS, PWM, RAMP, ZRN, or ARAMP has an invalid value in control registers.
21 DECO has S1 exceeding 255.
22 BCNT has S2 exceeding 256.
23 ICMP>= has S1 < S3.
25 BCDLS has S2 exceeding 7.
26 DI or EI is executed when interrupt input or timer interrupt is not programmed in the Function Area Settings.
27 Work area is broken when using DTML, DTIM, DTMH, DTMS, or TTIM.
28 S1 for trigonometric function instruction is invalid.
29 Result of F (float) data type instruction exceeds the data type range.
30 The number of bits configured in the SFTL/SFTR instruction or SFR FB exceeds the valid range.
In the FIFOF instruction, the FIEX instruction or the FOEX instruction was executed before the FIFO data file was
31
registered.
TADD, TSUB, HOUR, or HTOS has invalid data for source device S1 or HOUR FB has invalid data for the Preset
32
value.
34 NDSRC has invalid data for source device S3.
35 In the SUM instruction, the execution result exceeds the valid range for the selected data type, or S2 data is 0.
36 DLOG/TRACE is executed but the capacity of CSV file exceeds 5 MB.
41 SD memory card is write protected.
The result of execution using the SCRPT instruction is a value that indicates anything other than normal
42
completion.
43 The minimum value is greater than the maximum value in RCMP FB.
44 The shift registers specified by the start shift register and the number of bits in SFR FB does not exist.
In RPULS FB, the minimum value of ON time is greater than the maximum value of ON time, or the maximum
45
value of ON time is greater than the cycle time.
X XCHG 5-15
XORW 8-1
XY format set 16-1
XYFS 16-1