Jy 997 D 26101 B
Jy 997 D 26101 B
Jy 997 D 26101 B
Discovering
Control
An Intermediate Guide to Learning PLCs
Safety Precautions
(Be sure to read this before the training.)
Before designing a system, be sure to read this manual and pay close
attention to safety.
During the training, pay attention to the following points to ensure
correct handling.
WARNING
To prevent electric shock, do not touch the terminals while they are
powered ON.
Before removing safety covers, either turn the power supply OFF or
confirm safety.
CAUTION
Proceed with the training under the guidance of a teacher.
Chapter 1 1
INTRODUCTION
1-1
1.1 External I/O Assignment and Wiring
+
24VDC
-
External
power
supply
8 8
Analog output
voltmeter
+ +
Input switches
8 4 2 1 8 4 2 1
To external
24VDC power
Switches for supply
X0 to X2
1 2 4 8 1 24 8
24V S /S 0V X 0 X1 X 2 X 3 X 4 X 5 X 6 X 7 X10 to X13 X14 to X17 24+ 24 - V+ V I-
OUT
RUN/STOP Switch
RUN
RS-422 connecter for connecting
a personal computer (Programming tool) ch1 ch 2
STOP (IN 1) (IN 2)
C O M 1 Y 0 Y 1 Y 2 Y 3 C O M 2 Y4 Y 5 Y 6 Y 7 C O M 3 Y10 to Y13 C O M 4 Y14 to Y17 V+ V I- V+ V I-
1 24 8 1 24 8
-
To external Output
5 5
24VDC lamp
power
supply + 0 10 0 10
8 42 1 8 42 1
To external - -
ch1 ch2
24VDC
power + + Input voltage control
Converter/ supply (0 to 10V)
Conversion The first digit The second digit
cable 7-segment display
Personal computer/
Programming tool
G OT
1-2
Warming Up!
Chapter 2
2
GUIDING COURSE: DO YOU REMEMBER?
Actual Usages…
PLCs are broadly used as core components for FA (Factory Automation) and as electronic
application products essential for saving labor costs and improving automation.
PLCs can be used for many types of applications such as systematical applications
which supply control all over a factory or as standalone applications to control an
independent machine.
In this chapter…
The functions, construction, features and so on of PLCs, mainly in regard to small
standalone PLCs, are described in a summarized manner.
2-1
2.1 PLC - Small, reliable, flexible brain.
2.2.1 A n automation solution for the machining,
assembly, transfer, inspection, packaging and
so on of a workpiece
Device to instruct Power supply
when and how Devices to detect the
the system should status of the system
be activated Sensor section
Digital Circuit
Operation section -
switch breaker
-
-
Proximity
switch
+ Input
Pushbutton +
switch +
PLC Limit
Selector switch
switch
Digital
indicator
Output Electromagnetic
clutch
Pilot lamp indicator section Solenoid
Contactor valve Motor
Devices to indicate
the status of the Control section Actuator section
system
Devices to judge the Devices to drive
status of the system the system
and to provide instructions
The PLC is activated by command inputs such as inputs from pushbutton switches, selector switches
and digital switches located at the operating panel, and by sensor inputs, such as inputs from limit
switches, proximity switches and photoelectric switches, which detect the status of the system, in order
to control drive loads such as solenoid valves, motors and electromagnetic clutches, and indication
loads such as pilot lamps and digital indicators.
The behaviors of output signals corresponding to the input signals are determined by the
contents of programs provided to the PLC.
Light loads such as small solenoid valves and pilot lamps can be directly driven by a PLC, but loads
such as 3-phase motors and large solenoid valves must be driven through contactors and intermediate
relays.
As well as PLCs, contactors, intermediate relays and circuit breakers for the power supply are installed
in the control box.
2-2
2.2 Mechanism of PLC
2.2.2 The PLC is a microcomputer for industrial purposes.
Memory
section
Memory
Relay contact Lamp
Input interface
Output interface
Toggle switch
Solenoid valve
(Solenoid valve)
Pushbutton switch
Power
Processor supply
section
Power Microcomputer
supply Output
interface
A PLC incorporates an electrical circuit mainly comprised of a microcomputer and memory.
Input/output interfaces exist between input/output devices and the electronic circuit to connect them.
The programming panel is used to write a program to the memory in the PLC.
Reference
Is the term "sequencer"
2-3
2.2.3 The PLC can be, in effect, considered as an
aggregate of relays and timers.
Activate input relays Activate the internal sequential Activate output Activate external
with external signals circuit with input relay contacts relays loads
X004 Timer
PB2 X001 M100
X005 X005 T0 Y002 MC
Auxiliary relay
Contacts for
Input relay external output
Input Wiring Input Circuitry Internal Signals Output Circuitry Output Wring
●● When the coil of the input relay X001 is energized, the N.O. contact of X001 is closed and the
coil of the output relay Y000 is energized.
●● When the coil of the output relay Y000 is energized, the contact of Y000 is closed, then the
pilot lamp PL is illuminated.
●● When the pushbutton switch PB1 is released, the coil of the input relay X001 is de-energized
and the N.O. contact of X001 is opened.
But the output relay Y000 is still energized since the N.O. contact is closed. (Self-maintaining action)
●● When the input relay is energized by closing the limit switch LS1, the N.C. contact of X003 is
opened, then the coil of the output relay Y000 is de-energized (Reset).
As a result, the pilot lamp; PL distinguishes and the self-maintaining action of the output relay
Y000 is cleared.
2-4
2.2.4 Types of relay and timers
As shown below, a PLC incorporates multiple relays, timers and counters with countless N.O. and N.C.
contacts.
A sequential circuit is formed by connecting the contacts and coils.
Also, one advantage of using a PLC is that a lot of storage cases called "data registers" are included.
2
Input
Input terminal
Input relay: X
An input relay is an inlet port on the PLC where an external signal provided
from an input switch is received and indicated by the element symbol X.
The PLC incorporates an appropriate number of input relays.
30 TIME
20 40
10 50
Counter:C
Auxiliary relay:M 0
SECONDS
60 The PLC Output relay:Y
STAR DELTA TIMER incorporates An output relay is
The PLC multiple counters. an outlet port on
incorporates They are indicated the PLC to drive
multiple auxiliary Timer:T
by the element an external load
relays indicated The PLC symbol C. and it is indicated
by the element incorporates by the element
symbol M. multiple timers symbol Y. The
indicated by the PLC incorporates
element symbol T. multiple output
relays.
Data register: D
12 38
56 45
The data register is used as the storage box for storing the
7
Output
2-5
2.3 Wiring and instructions
FX PLC
COM1
Program
memory
K100
T0
Programming
2-6
2.4 Commands and programs
2.4.1 Mechanism of programs
The internal sequence for the sequence controlling is created as the sequence program with the format
of circuit diagram (ladder diagram) and instruction list.
Repeat operation
1 OR Y000
K30 2 ANI X003
X006
3 OUT Y000
4 T1 4 LD Y000
5 ANI X006
6 OUT T1 K30
9 END
9 END
●● Each "instruction" is comprised of "instruction code + device number". However, there are some
instructions without devices. Also in some cases, instruction codes are just referred to as instructions.
●● The max steps that can be programmed depend on the "program memory capacity" of the PLC that is used.
For example, there is a program memory with the capacity of "2000" steps in the FX1S PLC, "8000" steps in
FX1N and FX 2N, and "64000" steps in the FX3U.
●● The PLC repeatedly performs instructions from step 0 to the END instruction. This operation is referred to as
cyclic operation, and the time required to perform one cycle is referred to as the operation cycle (scan
time).
The Operation cycle will change according to the contents of the programs and the actual operating orders,
ranging from several msec to several tens of msec.
●● A PLC program created by the format of circuit diagram (ladder diagram) is also stored in the program
memory of the PLC with the format of instruction list (program list).
The conversion between instruction list (program list) and circuit diagram (ladder diagram) can be done by
using the programming software on a personal computer.
2-7
2.4.2 The processing order of the program
The program processes sequentially from the first step to the end of the program memory in block units
with the order from left to right, up to down. (in order of 1), 2), ……17) )
1) 2)
3)
4) 5)
7)
6)
8) 9)
10)
11)
12)
13)
14)
15) 16)
17)
2-8
2.5 The configuration of an FX PLC
2.5.1 Brief introduction of the main unit
An FX PLC is a standalone unit that can be easily used as a PC, so it has a series of advantages such
as high speed, high performance and good expandability.
FX3U Series
Performance/ function
2
FX2N Series
2-9
2.5.2 The basic configuration of the system
The configuration of an FX PLC will be described by taking an example using the FX3U Series.
Special adapter Main unit Extension block Input/output extension unit Extension block
Adapter expanding The I/O extension equipment that The extension equipment
the functions such as can be expanded in 8-point or controlling communication,
communication and 16-point units analog, network and
analog positioning
Multiple main units and extension
units within the specified number
can be connected
The PLC of FX series with "CPU, Input/output, power The I/O extension equipment with power
supply, and memory" all in one unit supply built-in can supply power for the
connected extension equipment.
It also can supply power for the connected extension
equipment.
The types and the number of the equipments that can be connected depend on the series and the
model name of the main unit.
2-10
2.5.3 T
he types and advantages of the program memory
The following table lists the types of built-in program memories for FX PLCs.
Built-in memory
Series Advantage
Type Memory capacity Backup method
It is easy to write to/read from the 2
memory, and battery backup is not
required.
2000 steps
Read from
OK
O
Write to
FX1S
K
EEPROM Backup 2
memory unnecessary 1
8000 steps
Read from
Write to
FX 2N /FX 2NC
RAM
memory Battery backup
There are optional memories (EEPROM/
FLASH) which do not require battery
backup. However, it is necessary to use
the battery if the latch memory and clock
function are used.
64000 steps
FX3U/FX3UC
2-11
Reference
FX PLC's Memory Structure (FX3U,FX3UC Examples)
FX3U/FX3UC PLCs are supplied with RAM memory.
By mounting an optional memory device, the memory type can be changed.
Parameter
Sequence program
Not attached
Comment
File register (D)
2. When using an attached optional memory (without using the built-in memory)
Parameter
Sequence program
Not used
Comment
Attachment of an optional memory is automatically File register (D)
recognized (when the power is ON), and the built-in
program memory is disconnected.
(The priority is given to the optional memory.) Extension file register (ER)
2-12
2.5.4 FX PLC I/O number assignment
Each main unit has I/O numbers assigned by an octal number system such as X000 to X007, X010
to X017, Y000 to Y007, Y010 to Y017 and so forth. (Devices other than I/O relays are numbered by a
decimal number system.)
Expansion modules and expansion blocks have I/O numbers subsequent to those of the main unit.
2
X0 X2 X4
Y0 Y2 Y4
Y1 Y3 Y5 Y6 Y7 Y0 Y1 Y3 Y5 Y7
FX3U-32MR/ES Input: 16 points X1 X3 X5 X6 X7 X0 X1 X3 X5 X7
Main unit Output:16 points
Smaller X and Y have
number serial I/O
numbers and
are assigned
automatically
16-point 16-point in order of the
X2 X4 X6
Y2 Y4 Y6
Larger connection of
number units.
●● I/O numbers of expansion modules are assigned with subsequent numbers to those of the main
unit with the I/O more adjacent to the main unit having lower numbers.
It is not necessary to set the parameters by using programming tools such as GX Developer.
●● There are some I/O points that have a null value according to the number of I/O on the main unit
and expansion modules.
[Example]
In the case of the FX1N -24M basic module, 14/10 points (X000 to X015/Y000 to Y011) of the 16/16-
point I/O are required, and the relay numbers X016 to X017 and Y012 to Y017 are not used.
In the case of the FX 2N -8ER (mixed with I/O = 4/4), 4/4 points of the 8/8 -point I/O are required, and
the remaining 8 relay numbers are not used.
(The numbers of null value are also counted as occupied points.)
2-13
2-14
Let's use a personal computer to create the programs!
Chapter 3
THE OPERATION OF GX Developer 3
3-1
3.1 Basic knowledge for operating GX Developer
3.1.1 The layout of the GX Developer screen
3) Tool bar
5) Edit screen
6) Status bar
1) Title bar
The name of the opened project and the window operation icons are displayed.
Changing the size of GX Developer and closing it Maximizing and restoring GX Developer
3-2
2) Menu bar
3) Tool bar
A description of
the function is
displayed when
the mouse cursor
stops over each
button.
*: The contents of the tool bar can be moved, added, and removed. Therefore, the displayed items
and layout depend on saved environments.
Frequently used functions are displayed with icon buttons. Compared to selecting from the menu,
desired functions can be directly executed.
Circuit creating window, parameter setting screen and so on are displayed by tree structure.
3-3
5) Edit screen
5) Edit screen
The circuit creating screen, monitor screen and so on are multiply displayed with windows.
6) Status bar
The status of the operation and keyboard settings are displayed.
Current input mode is displayed Scroll Lock status
The instruction of the CPU The location of the Caps Lock Num Lock
mouse cursor position type CPU connected status status
3-4
3.1.2 About the "Project"
Project
This is equivalent to a folder in Windows®.
3
Program Sequence program
Device Memory Contents of the current device value, or the input device value
3-5
3.2 Starting GX Developer and creating a new project
3.2.2 Starting GX Developer
2) GX Developer is started.
3-6
3.2.3 Creating a new project
1) Click
2) Click
3-7
6) Click OK .
6) Click
Point
ll About the parameter setting
For FX PLCs, it is not necessary to set the parameters when the comments stored in the PLC
are not set or file registers are not used.
For details on the parameters, see the Appendix.
3-8
3.3 Creating a circuit
3.3.1 Creating a circuit by using the function keys
Point
ll The relationship between the function keys and the symbols of the circuit are displayed on the
buttons of the tool bar.
F5 F6 F7 F9 Ctrl
+
F8 F9
ll When creating a circuit, make sure to set the mode to "Write Mode".
Select from the tool bar. Select from the menu ([Edit] → [Write mode]).
3-9
1) Press the F5 key.
Input "X2".
Cancel it by ESC or
[Cancel].
X2
3) The circuit is displayed 3) The circuit input is displayed.
4) Press the F6 key.
Input "X0".
5) Confirm by pressing the Enter key or [OK].
4) Input “X0” 5) Input the Enter key
X0
6) The circuit is displayed 6) The circuit input is displayed.
7) Press the F7 key.
Input "Y0".
8) Confirm by pressing the Enter key or [OK].
7) Input “Y0” 8) Input the Enter key
3-10
Y0
12) The circuit input is displayed.
12) The circuit is displayed
13) Move the cursor to the beginning of the next
13) Move the cursor line.
14) Press the F5 key.
Input "X3".
15) Confirm by pressing the Enter key or [OK].
14) Input “X3” 15) Input the Enter key
3
X3
16) The circuit input is displayed.
16) The circuit is displayed 17) Press the F7 key.
Input "Y1".
18) Confirm by pressing the Enter key or [OK].
3-11
3.3.2 Creating a circuit by using the tool buttons
[The circuit to be created]
Point
ll When creating a circuit, make sure to set the mode to "Write Mode".
Select from the tool bar. Select from the menu ([Edit] → [Write mode])
3-12
1) Click the tool button .
Input "X2".
Cancel it by ESC 3
or [Cancel].
X2
3) The circuit is displayed 3) The circuit input is displayed.
4) Press the tool button .
Input "X0".
4) Input “X0” 5) Click 5) Confirm by pressing the Enter key or [OK].
X0
6) The circuit is displayed 6) The circuit input is displayed.
7) Click the tool button .
Input "Y0".
8) Confirm by pressing the Enter key or [OK].
7) Input “Y0” 8) Click
3-13
Y0
X3
16) The circuit input is displayed.
17) Click the tool button .
Input "Y1".
16) The circuit is displayed 18) Confirm by pressing the Enter key or [OK].
19) T
he circuit input is displayed.
!!The circuit is created!!
19) The circuit is displayed
F4 (Convert) 20) C
ircuit-Conversion Operation [Important].
Do the "Conversion" operation to confirm
or compile the circuit diagram that has not
20) The grey display disappears been confirmed (grey display part).
3-14
3.4 Writing programs to the PLC
Write the created sequence program to the FX PLC.
PLC
built-in port
(RS-422)
RS-232C
F2-232CAB-1
FX-422CAB0
GX Developer
FX-232AWC-H
(RS-232C/RS-422 converter)
PLC
built-in port
USB
(RS-422)
GX Developer
FX-USB-AW
(USB/RS-422 converter)
llCheck the COM port number that the driver of the FX-USB-AW assigns to
the personal computer. For the check procedures, see the manual of the FX-
USB-AW.
3-15
3) Transparent function of GOT1000 (Personal computer side: USB)
PLC
built-in port
(RS-422)
GOT1000
RS-422
USB
GX Developer
USB
GT09-C30USB-5P
3-16
3.4.2 "Transfer Setup" in GX Developer
6) Click
3-17
3.4.3 Writing a program to the PLC
1) Set the "RUN/STOP" switch of the PLC to
"STOP".
1) Set to "STOP"
2) Click
5) Click
3-18
3.4.4 Operation monitor of a program
1) Set to "RUN"
2) Click
1) Set [Switch X002 is "ON"] with the status [Switch X000 is "OFF"], and then check [Output Y000 is
"ON"].
2) Check [Output Y000 is "ON"] while [Switch X002 is "OFF"].
3) Set [Switch X000 is "ON"] and then check [Output Y000 is "OFF"].
4) Check [Output Y001 is "ON/OFF"] in accordance with [Switch X003 is "ON/OFF"].
3-19
Reference
(1) The display of the monitor status dialog
1) Scan time
The maximum scan time of the sequence
program is displayed.
2) PLC status
1) 2) 3) 4)
The status of the PLC is displayed.
3) The execution status of the monitor.
This icon is flashing during monitor mode.
4) Memory type display
The memory type of the PLC is displayed.
(2) The interpretation of the status display for the ladder monitor
1) Contact Instruction
Input contact
X0: OFF X0: ON
Type
X000 X000
NO contact
Circuit open Circuit close
X000 X000
NC contact
Circuit close Circuit open
2) Out Instruction
Driving status Non-execution/
Execution/Drive
Type Non-drive
Y000 Y000
OUT instruction
SET M0 SET M0
SET instruction, etc
The ON/OFF status of the device to be reset is displayed during monitor mode using the RST
instruction.
Device status When device to be When device to be
Type reset is OFF reset is ON
RST M0 RST M0
RST instruction
3-20
3.5 Editing a circuit
3.5.1 Correcting a circuit
Point
ll Make sure to set the mode to "Write Mode" when amending the circuit.
Select from the tool bar. Select from the menu ([Edit]→[Write mode]).
Switches between
"Ovrwrte" and "Insert"
by pressing the Insert key.
3-21
1) Changing the OUT coils and contacts
[The circuit to be corrected]
X002 X000
Y000
Y000
Change to
X003 Y002
Y001
F4 (Convert)
5) Confirm the changes by pressing the F4
(Convert) key.
3-22
2) Adding lines
[The circuit where lines are to be added]
X002 X000
Y000 Add the vertical/
horizontal lines and
create the OUT coil
Y000
Y003
X003 3
Y001
Locate the cursor on the upper right of the 2) Locate the cursor on the upper right of the
beginning of the vertical chart to be added desired vertical line to be added, and then
drag it until it reaches the desired position, and
then drop it.
2) Drag
5) Input "Y3".
6) Confirm by pressing the Enter key or [OK].
3-23
7) The added circuit is finished and the circuit
7) The added circuit block is displayed in grey.
is completed
F4 (Convert)
3-24
3) Deleting lines
X002 X000
Y000
Delete this
circuit
Y000
Y003
X003
3
Y001
Locate the cursor on the upper right 2) Locate the cursor on the upper right of the
of vertical line to be deleted desired vertical line to be deleted, and then
drag it until it reaches the desired position, and
then drop it.
2) Drag
3-25
5) The deleted circuit block is displayed in grey.
F4 (Convert)
3-26
3.5.2 Inserting and deleting lines
1) Adding lines
[The circuit where a line is to be inserted]
X001 Add this line
Y002
X002 X000
Y000
Y000
X003 3
Y001
3) A line is inserted.
3-27
2) Deleting lines
X001
Y002
X002 X000
Y000
Y000
3-28
3.5.3 Cutting and copying (pasting) a circuit
1) Cut
[The circuit to be edited]
Y002
X004
3
Y004
2) Drag the cursor until it reaches the 2) Drag it until it reaches the desired position,
desired position, and then drop it and then drop it.
3) Select from the tool bar or select [Edit] →
3) Execute cut [Cut] ( Ctrl + X ) from the menu, and execute
the cut.
3-29
X002 X000 Copy this
Y000 line
Y000
X004
Y004
X002 X000 Paste to
Y000 this line
Y000
3-30
3.6 Saving a created circuit
3.6.1 Save and Save as
Point
If there are circuits that have not been converted in the program, press Convert (F4).
1) Click
3-31
3.6.2 Saving a project as a new one
Point
If there are circuits that have not been converted in the program, press Convert (F4).
1) Click
3-32
3.6.3 Reading a project
Reference
If another project is open when reading/opening a new file, the current project is closed.
If there are circuits not converted in the project or the project is not saved, a warning message is
displayed.
1) Click
3-33
3.7 Necessary operation for debugging a program
For connecting to the PLC and writing a program to the PLC, see "3.4 Writing programs to the PLC".
3-34
Reference
(1) the display of the monitor status dialog
1) Scan time
The maximum scan time of the sequence
program is displayed.
2) PLC status 3
1) 2) 3) 4)
The status of the PLC is displayed.
3) The execution status of the monitor
This icon is flashing during monitor mode.
4) Memory type display
The memory type of the PLC is displayed.
2) Out Instruction
Driving status Non-execution/
Execution/Drive
Type Non-drive
Y000 Y000
OUT instruction
SET M0 SET M0
SET instruction,
etc.
The ON/OFF status of the device to be reset is displayed during monitor mode using the RST
instruction.
Device status When device to be When device to be
Type reset is OFF reset is ON
RST M0 RST M0
RST instruction
3-35
3.7.2 Device registration monitor
1) Registering optional devices
Register optional devices in the monitor window and monitor only the necessary parts.
1) Set to monitor mode. (See Section 3.7.1.)
3) Click
3-36
2) Registering the devices displayed in monitor mode
Specify the area of the ladder diagram in the ladder monitor window and register all of the devices in
the area.
6) Click the end point while pressing 6) Click the end point while pressing the [Shift]
[Shift] key to select the area.
key to select the area.
7) Click
7) Drag the selected area to the "Entry data
monitor window".
9) Click
3-37
3.7.3 Device batch monitor
Specify a device and monitor a continuous range of devices that follow it.
3-38
3.7.4 Device test
1) Forced ON/OFF
Using the device test screen, forcedly turn ON/OFF the bit devices of the PLC (M,Y,T,C and so on). (The
forced ON/OFF function for X is not available.)
When the PLC is running, the forced ON/OFF function can turn on or off specific devices.
Reference
Forced ON/OFF (Ladder monitor window)
A specified device can be forcedly turned on/off by double-clicking any bit device (contact, coil) in
the [Ladder monitor window] while pressing the [Shift] key.
3-39
2) Changing the current value of a word device
Change the current specified value of the PLC’s word device (T, C, D and so on).
5) Click [Set].
3) Input the device
3-40
3.7.5 Writing a program to the PLC during RUN
Write the corrected part of the circuit to the PLC when the PLC is running.
Less time is needed for writing during RUN since the entire program is not transferred.
3
2) Add a contact.
The circuit block is displayed in grey.
2) Add a contact
Write during RUN Shift+F4 3) Press [Shift] and [F4] together, or select
[Convert] → [Convert (online change)] from the
menu.
4) Click
5) Click
Caution
It is impossible to write the program to the PLC if the program in the PLC is different from the one in
GX Developer. Verify in advance, or transfer the program first by using [Write to PLC].
3-41
3.8 Inputting comments
3.8.1 Types of comments
The following 3 types of comments can be input.
The number of
Type Purpose characters Remark
(full-width)
It is necessary to set the "Comments
A comment describing the role capacity" from the parameter setting
1) Device comment 16
and function of each device when writing to the PLC. The "Comment
range setting" must also be set.
[Comment Examples]
START Circuit 2) Statement
<The Start Btn turns on lamp > Y000
X000 T7
0 (Y000 ) A/S 1 4
Start Conveyor Lamp A/S
Stop Green
Time
Y000 3) Note
Lamp
Green
Point
How to display comments
ll Select [View] → [Comment] from the menu and then the comments are displayed.
3-42
3.8.2 Operation for creating device comments
1) How to input device comments using a list
1) Click
2) Input the device number 2) Input the start number of the devices which
are to be commented in "Device name", and
click [Display].
3) Input comments
3-43
Point
Setting for writing the device comments to the PLC
It is necessary to set "Parameter setting" and "Comment range setting" in order to write the device
comments to the PLC.
1) Parameter setting
ll Double click [Parameter] → [PLC parameter] in the project list.
ll Set the type and the range of the devices to be written to the PLC in the Setup comment range
dialog.
Comment
range setting
Reference
How to input comments when creating a circuit
Select [Tool] → [Options] from the menu, Check
"Continues during command write" of the
[Comment input] box in the [Program common]
tab.
After configuring the setting above, the operation
of circuit input continues and the "Enter symbol"
window described in step 2) is displayed when
Continues during command write the circuit is being created.
3-44
3.8.3 Operation for creating statements
3-45
3.9 Operation for creating instruction list
In GX Developer, a program can also be created by list logic.
3-46
ll How to input basic instructions and applied instructions
A "space" is input between the instruction language, device number and operand.
LDI X0 Enter
Connection and OUT instructions
AND Y0 Enter
OUT M0 Enter
LD M0 Enter
Reference
Key operation for inputting/editing
• "Ovrwrte "and" Insert" modes can be switched between by pressing the Insert key.
• An instruction can be deleted by using the Delete key.
[Insert line] and [Delete line] operations can be done by right clicking the mouse
3-47
3.9.3 Checking the content of the list input
Confirm that there are no errors in the program created by list input in the circuit display.
3-48
Easy to master instructions!
Chapter 4
SUMMARY OF PLC BASIC INSTRUCTIONS
4
So far…
It has been described that the PLC is an aggregate of relays, timers and counters, and
that it is sequentially controlled with imaginary internal wiring which is created through
key operations on a programming panel.
It has also been described that according to the way contacts and coils are connected,
and what types of coils are being used, rules, or instructions, are required for this
imaginary wiring.
In the instructions…
Instructions can be divided into those functioning with element numbers and those
functioning independently. Therefore, you should know the meanings of the device
numbers as well.
In this chapter…
Basic instructions for the PLC are described. Note that there are also many application
instructions which are used to simplify complicated sequential circuit designs.
If you would like to perform the programming training, please learn the basic personal
computer operations referenced in Chapter 3 beforehand.
Now, let’s understand the contents of instructions.
4-1
4.1 Devices and device numbers
Activate input relays Activate the internal sequential Activate output Activate external
with external signals circuit with input relay contacts relays loads
Power
COM
supply
PB1 X000 Y000
X001 X003 Y000
X001 X001 Y000 Y000 PL
PLC
M0 T0 C0
4-2
2) Device number ranges for the FX3U main devices
Device name Content
I/O relay
Input relay X000 to X367 248 points The number of the input/output terminals
Output relay Y000 to Y367 248 points are assigned in octal format.
Auxiliary relay
General type M0 to M499 500 points
Latched (battery backed) type M500 to M1023 524 points
These are the internal relays of the PLC.
Latched (battery backed) type M1024 to M7679 6656 points
Special type M8000 to M8511 512 points
Timer (on-delay timer) 4
100 ms T0 to T191 192 points 0.1 to 3,276.7
seconds
100 ms 0.1 to 3,276.7
[for subroutine or interrupt T192 to T199 8 points seconds
routine] The timers are
10 ms T200 to T245 46 points 0.01 to 327.67
seconds
used for clocking.
The clocking range
0.001 to 32.767 depends on the
Retentive type for 1 ms T246 to T249 4 points seconds timer.
Retentive type for 100 ms T250 to T255 6 points 0.1 to 3,276.7
seconds
1 ms T256 to T511 256 points 0.001
seconds
to 32.767
Counter
General type up-counter (16 C0 to C99 100 points
bits) Counters are used
0 to 32,767 counts
Latched (battery backed) C100 to C199 100 points for counting. 32-bit
type up-counter (16 bits) counters can be
General type bi-directional counter (32 bits) C200 to C219 20 points – 2,147,483,648 to + switched between
2,147,483,647 up/down.
Latched (battery backed) type bi-directional counter (32 bits) C220 to C234 15 points counts
High speed counter
1-phase 1-counting input Bi-directional (32 bits) C235 to C245 Up to 8 points can be used in These counters are
C235 to C255 used for counting
1-phase 2-counting input Bi-directional (32 bits) C246 to C250 [Latched (battery backed) fast signals from
type]-2,147,483,648 to the PLC’s input
2-phase 2-counting input Bi-directional (32 bits) C251 to C255 2,147,483,647 counts terminals.
Data register (32 bits when used in pair form)
General type (16 bits) D0 to D199 200 points
Latched (battery backed) D200 to D511 312 points
type (16 bits)
Latched (battery backed) D512 to D7999 7488 points Registers for storing number data
type (16 bits) <file register> <D1000 to D7999> <7000 points>
Special type (16 bits) D8000 to D8511 512 points
Index type (16 bits) V0 to V7, Z0 to Z7 16 points
Pointer
For jump and branch call P0 to P4095 4096 points Pointers for CJ instruction and CALL instruction
Input interrupt I0�� to I5�� 6 points
Input delay interrupt Pointers for input interrupt and timer
interrupt
Timer interrupt I6�� to I8�� 3 points
Counter interrupt I010 to I060 6 points Pointers for HSCS instruction
Nesting
For master control N0 to N7 8 points Nesting pointers for MC instruction
Constant
16 bits – 32,768 to + 32,767
Decimal (K)
32 bits – 2,147,483,648 to + 2,147,483,647
4-3
4.2 Types of basic instructions
The following table lists the available basic instructions for
FX3U PLC programming.
Mnemonic Name Symbol Function Applicable Devices*1
Contact Instruction
Applicable devices Initial logical operation X,Y,M,S,
LD Load contact type NO
(normally open) D�.b,T,C
4-4
Mnemonic Name Symbol Function Applicable Devices*1
Connection Instruction
INV Invert the current result
INV Inverse of the internal PLC –
operations
Conversion of
MEP*2 MEP operation result –
to leading edge pulse
Conversion of
MEF*2 MEF operation result to –
trailing edge pulse
Out Instruction 4
Applicable devices Final logical operation
OUT OUT Y,M,S,D�.b,T,C
type coil drive
Falling/trailing edge
PLF Pulse Falling PLF Applicable devices Y,M
pulse
Master Control Instruction
Denotes the start of a
MC Master Control MC N Applicable devices Y,M
master control block
4-5
4.3 Let’s master basic instructions
4.3.1 Contact instruction and out instruction
Action
OF F ON OF F ON ll If the input condition X000 is "ON", Y000 is "ON".
Input X000 ON ON
llIf X000 is "OFF", Y000 is also "OFF".
Output Y 000 ON ON
Action
OF F ON OF F ON ll If the input condition X000 is "OFF", Y001 is "ON".
Input X000 ON ON
4-6
3) [Program of a serial circuit (1)]
Ladder display List display (reference)
X002 X003
Step Instruction
0 Y 002 0 LD X002
NO contact NO contact
(LD) (AND)
Output (OUT ) 1 AND X003
2 OUT Y002
Action
OF F ON OF F ON OF F llIf the input condition X002 and X003 are both
Input X002 ON ON
ON ON
"ON", Y002 is "ON".
OF F
Input X003 ON ON
llIf X002 or X003 is "OFF", Y002 is also "OFF".
Output Y 002 ON
Action
OF F ON OF F ON OF F ll If the input condition X002 is "ON" and X003 is
Input X002 ON ON
ON
"OFF", Y003 is "ON".
OF F OF F
Input X003 ON
ll If X002 is "OFF" or X003 is "ON", Y003 is "OFF".
Output Y 003 ON ON
4-7
4) [ Program of a parallel circuit (1) ]
Ladder display List display (reference)
Step Instruction
X004
0 Y 004 0 LD X004
NO contact (LD) Output (OUT ) 1 OR X005
X005
2 OUT Y004
NO contact(OR )
Action
OF F ON OF F ON llIf the input condition X004 or X005 is "ON",
Input X004 ON ON
ON ON
Y004 is "ON".
OF F OF F
Input X005 ON ON
llIf X004 and X005 are both "OFF", Y004 is
Output Y 004 ON ON ON "OFF".
NC contact (LDI)
Action
OF F ON OF F llIf the input condition X004 is "ON" or X005 is
Input X004 ON
OF F ON OF F ON "OFF", Y005 is "ON".
Input X005 ON ON
llIf X004 is "OFF" and X005 is "ON", Y005 is
Output Y 005 "OFF".
ON ON ON
4-8
Important point
Avoid redundant outputs (double coils)
llNote that it is prohibited to specify multiple OUT instructions to a single coil.
X002 X004
Y003
ON ON
ON!
X003 X004 4
Y003
The output result is "OFF"
OFF ON
which is not desired.
Ignored
C E
C E D
Y000
D
A B
M100
Or C E
M101
M100
Y000
M101
4-9
4.3.2 Difference between OUT instruction and SET/RST
X000
Step Instruction
0 Y 001 0 LD X000
1 OUT Y001
Action
OF F ON OF F ON OF F llIf the input condition is "ON", the OUT
Input X000 ON ON
instruction will turn on the specified device.
Output Y 001 ON ON
llIf the input condition is OFF, the specified
device will also be turned off.
Action
OF F ON OF F ON OF F llIf the input condition is "ON", the SET
Input X001 ON ON
instruction will turn on the specified device
ON
Input X002 OF F ON OF F and keep it "ON" even after the input condition
turns "OFF".
Output Y 002 ON ON
llIn order to turn off the set device, use the RST
instruction.
4-10
4.3.3 OUT T � instruction: Clocking of timers
Timers count with clock pulses of 1 ms, 10 ms, 100 ms and so on. When they reach their set valve, the
output contact turns on. (On-delay timer)
The set value may be a constant (K) or indirectly specified by a value in a data register (D).
Timer (T) numbers for the FX3U PLC (Numbers are assigned in decimal format)
100 ms type 10 ms type Retentive type for 1 ms *1 Retentive type for 100 ms *1 1 ms type
0.1 to 3276.7 seconds 0.01 to 327.67 seconds 0.001 to 32.767 seconds 0.1 to 3276.7 seconds 0.001 to 32.767 seconds
T0 to T199 T246 to T249
T250 to T255
200 points 4 points
T200 to T245 6 points T256 to T511
Interrupt execution
46 points Latched (battery 256 points
For routine program Latched (battery
backed) *1
T192 to T199 backed) *1 4
*1. The timer for the retentive type is latched by the battery when the power is off.
1) General timer
Ladder display List display (reference)
Timer s et value
K 30 Step Instruction
X000
0 T0 0 LD X000
C locking input T imer coil 1 OUT T0 K30
T0
4 LD T0
4 Y 000 5 OUT Y000
T imer NO contact
6 LDI T0
T0
6 Y 001
7 OUT Y001
T imer NC contact
Action
OF F ON OF F llIf the input condition is "ON", the timer T0
Input X000 ON
begins clocking, and the T0 contact turns "on"
TO C oil 3 s econds ON after the specified period
(T0: 100 ms base × 30 = 3 seconds).
TO NO contact Y 000 ON
Reference
The values of timers and counters can also be set with a data register (D). (Indirect specification of the value)
4-11
2) Retentive timer
T246 to T249 (4 points) are timers based on 1 ms, and T250 to T255 (6 points) are timers based on 100 ms.
Action
X001 llThe timer operates only when the clock input
X001 is "ON". The clock is interrupted when
Current
Interrupt the input turns "OFF".
timer value
*1 *2 llThe output contact of the timer operates when
5 seconds 7 seconds
*1, *2 Total 12 seconds the total "ON" time of the input X001 reaches
the predetermined value.
X002 Reset input
Reference
Types of counters
Set value of the timer: The constant K is an integer from 1 to 32,767. If the constant is K120, it
is 12 seconds for timers based on 100 ms, and 0.12 seconds for
timers based on 1 ms.
Latched (battery-latched) function: Even if the power is turned off during clocking, the current value of the timer
will be saved and the timer will operate according to the total driving
time before and after the power is off.
4-12
4.3.4 OUT C � instruction: Counting of counters
The types of counters include 16-bit counters, 32-bit counters, and high speed counters. In this section,
the 16-bit up-counter is described.
Counter numbers for the FX3U PLC (Numbers are assigned in decimal format)
16-bit up-counter 32-bit up/down counter
0 to 32767 – 2,147,483,648 to + 2,147,483,647
Latched Latched
General type General type
(battery-backed) (battery-backed)
4
C0 to C99 C100 to C199 C200 to C219 C220 to C234
100 points*1 100 points*2 20 points*1 15 points*2
*1. Non-latched area. It can be changed to a latched (battery-backed) area by setting the parameters.
*2. Latched (battery-backed) area. It can be changed to a non-latched (non-battery-backed) area by setting the
parameters.
4-13
Ladder display List display (reference)
Step Instruction
0 LD X002
X002
0 RST C0 1 RST C0
Reset input Counter
K10 3 LD X003
X003 set
3 C0 value 4 OUT C0 K10
Counting input
Counter coil 7 LD C0
C0
7 Y001 8 OUT Y001
Counter contact
Action
X002
Reset input llThe current value of counter increments
every time the count input relay changes from
OFF to ON, and when the value reaches the
X003 counting input
predetermined value, the output contact is
10
8
9 closed.
Current counter 7
6
value 4
5 ll After reaching the predetermined value, the current
3
1
2 value and the output contact keep their status.
0
llAt the moment the reset input relay X002
Y001 (C 0 output contact) is closed, the current value of the counter
becomes 0 and the output contact is opened.
ll16-bit up counters are assigned from C0 to
C199, and the timers C100 to C199 are backed
up with the battery to maintain their current
value when the power fails.
The battery-backed counters continue to count
up from their stored value when the power is
restored.
Reference
If a high speed counter is used, inputs will not be missed and high speed signals can be counted.
For details on high speed counters, see Chapter 10.
4-14
4.3.5 PLS/PLF instruction
X000
Step Instruction
0 P LS M0 0 LD X000
1 PLS M0
M0 X002 3 LD M0
3 Y 000
4 OR Y000
Y 000 5 ANI X002
6 OUT Y000 4
Action
OFF ON OFF ON OFF llIf the input condition X000 is "ON" and remains
Input X000 ON ON
“ON” during one
on, the specified device will be turned on for
“ON” during one
scan only scan only
M0 ON ON one scan (one operation cycle) only.
Input X002
(NC contact) OFF ON OFF ON
ON ON
Output Y000 ON ON
X001
Step Instruction
0 P LF M1 0 LD X001
1 PLF M1
M1 X003 3 LD M1
3 Y 001
4 OR Y001
Y 001 5 ANI X003
6 OUT Y001
Action
OFF ON OFF ON OFF llIf the input condition X001 is turned on and
Input X001 ON ON
“ON” during
then off, the specified device will be turned
“ON” during one
scan only one scan
M1 ON ON only
on during one scan only.
Input X003 OFF ON OFF ON
ON ON
Output Y001 ON ON
4-15
Reference
If the rising edge pulse contact and the falling edge pulse contact are used, the
operation of the previously described PLS/PLF instruction can be written more simply.
They can be used according to the content and function of the following programs.
Y 000
Y 001
4-16
4.3.6 MC/MCR instruction
[MC instruction] Master Control (Denotes the start of a master control block)
[MCR instruction] Master Control Reset (Denotes the end of a master control block)
Circuit display List display (reference)
X007
Step Instruction
MC N0 M50 0 LD X007
N0 M50 If the MC instruction is input from GX Developer, the N0 1 MC N0 M50
M50 contact is displayed automatically in the read mode.
X000 4 LD X000
Y000
5 OUT Y000
X001
Y001 6 LD X001 4
7 OUT Y001
MCR N0
8 MCR N0
X004
Y004 10 LD X004
11 OUT Y004
Action
llWhile the input condition X007 is "ON", the
ON ON
X007 circuit indicated by 1) becomes valid, [Y000
MC N0 M50
N0 M50 ON
is "ON" if X000 is "ON"], and [Y001 is "ON" if
X000 X001 is "ON"].
Y000
1)
X001
Y001 llWhen X007 is "OFF", Y000/Y001 does not
MCR N0 operate.
X004
Y004 llSince Y004 is not subject to MC/MCR, it turns
on and off independently according to the
operation of X004.
Point
Status of MC block devices when MC does not operate
●● Held with the current status: Devices driven by retentive timer values, counter values
and SET/RST.
●● OFF: Devices driven by non-retentive timers and devices driven by OUT instructions.
4-17
Reference
Nesting with MC/MCR
X000 X000
MC N0 M100 MC N0 M100
N0 M100 N0 M100
N0 N0
X001
MC N1 M200
MCR N0
N1 M200
X001 N1
MC N0 M200
N0 M200
N0 MCR N1
MCR N0
MCR N0
4-18
4.3.7 Non-programmable circuits and solutions
1) Bridge Circuit
A B C E B
F F
A
E
A E D
C D
C
4
A circuit in which current flows in both directions must be rewritten as shown above. (The left and right
circuits are electrically identical.)
2) Location of Coil
A B D A
C E
E B D
C
llIt is recommended that coils internally used between contacts be programmed prior to the output.
4-19
4.3.8 Additional information for list programming (reference)
This section describes the basic instructions necessary when a list program is executed with FX-20P,
etc.
Use the OR (or ORI) instruction commands to connect contacts to the previous LD (or LDI) contacts.
However, if OR (or ORI) is used subsequent to an ANB instruction, the contact is connected not to the
previous LD (or LDI) contact, but to the one before that.
Step Instruction
X000 X001 0 LD X000
0 Y 000 1 AND X001
2 LD X002
OR B 3 AND X003
X002 X003
4 ORB
LD ins truction is us ed 5 OUT Y000
S erial circuit block at the branch point
6 LD X004
X004 ANB X006
6 Y 001 7 OR X005
8 LD X006
9 OR X007
X005 X007 10 ANB
P arallel circuit block
11 OR X000
OR ins truction followed
by ANB ins truction 12 OUT Y001
X000
4-20
2) [MPS instruction] Memory push (Instruction to store the
intermediate operation result)
[MRD instruction] Memory read (Instruction to read the
intermediate operation result)
[MPP instruction] Memory pop (Instruction to read and
reset the intermediate operation result)
4
Step Instruction
13 LD X004
MPS 14 MPS
X004 X005
13 Y002 15 AND X005
16 OUT Y002
X006 17 MRD
Y003
MRD 18 AND X006
19 OUT Y003
Y004
20 MRD
MRD
21 OUT Y004
X007
Y005 22 MPP
MPP 23 AND X007
24 OUT Y005
25 END
Description
llThese instructions are convenient to program a circuit including multiple branches as shown in the
figure above. The MPS instruction stores the intermediate operation result, then drives the output
relay Y002. The MRD instruction reads the stored memory, and then drives the output relay Y003.
llAlthough the MRD instruction is designed to be used repeatedly in a single program without
numerical limitation, its number must be limited to a certain range for the diagram to be properly
printed by the printer or displayed on the graphic programming panel. (The number of parallel
outputs in a single circuit is limited to 24 lines or less.)
llFor the last output line, instead of using an MRD instruction, an MPP instruction is used. This allows
the memory stored in the previous step to be read and reset.
4-21
3) [NOP instruction] No operation (Instruction to perform
no operation)
When the whole program is deleted, all instructions become NOPs.
When an NOP instruction exists between general instructions, the PLC neglects the NOP instruction to
operate.
Since each NOP instruction requires one additional program step, they should be deleted as much as
possible.
Input operation
S tep 0 LD X000
1
2
OUT Y 000
E ND
NOP
NOP
NOP
Input operation
4-22
4.4 Circuit examples with basic instructions
Action
Y005 will turn OFF 19 seconds after X006
X006 turns OFF.
A timer, which turns the input contact on
or off with a certain time delay if the input
contact is OFF, is referred to as off delay
Y 005
timer.
19 s econds
2) Flickering (Flashing)
Ladder display List display (reference)
Step Instruction
0 LD X007
X007 T3 K20
0 T2 1 ANI T3
K10
2 OUT T2 K20
T2
5 T3 5 LD T2
6 OUT T3 K10
Y006
9 OUT Y006
Action
X007
1 seconds
2 seconds 2 seconds
Y006 repeats
the ON/OFF operation.
T2 Y 006
T3
1 scan time
4-23
3) Alternate Circuit with pulse output circuit (Alternate action)
Ladder display List display (reference)
Step Instruction
0 LD X003
X003 1 PLS M103
0 P LS M103
3 LD M103
4 ANI Y002
M103 Y 002 5 LDI M103
3 Y 002
Alternate 6 AND Y002
M103 Y 002 output
7 ORB
8 OUT Y002
Action
X003 llOnce X003 is ON, Y002 is ON. If X003
is ON again, Y002 is, in turn, OFF.
P uls e
M103
(Alternate action)
Y 002
4-24
Let's program!
Chapter 5
INTRODUCTION EXAMPLES AND PROGRAM OPERATION
Let's practice…
5
Through monitoring the program examples outlined in this chapter, the user can master
sequence programming.
In this chapter, you can practice programming with the universal simulation unit, the
FX3U-32MT-SIM. Use a personal computer as the programming tool.
For the operation of the personal computer software (GX Developer), see Chapter 3.
5-1
5.1 Introduction example 1 [Traffic light control]
Y2 (Green) Y0 (Red)
Y1 (Yellow)
Assignment of I/O
Input Output
Control specification
If the PLC is running, the lamps of the traffic light are operated in the following order. The operations are
repeated after one action cycle.
5-2
Example of sequence circuit with comments
* Control start flag
Repeat
pulse
* Loop control
llIf Y000 (Red signal) turns
Red Loop pulse
10-second timer OFF, the program is repeated
from the control of the green
signal.
5-3
Operation check
Use GX Developer to monitor the circuit.
Ԙ ON for 10 seconds
ԙ ON for 5 seconds
Ԛ ON for 10 seconds
5-4
5.2 Introduction example 2 [Conveyer control]
Sta Buzzer
rt
(Y003)
Sto
p
(X000)
Motor forward
(Y000) (X001) 5
Assignment of I/O
Input output
Y003 Buzzer
Control specification
1) If [Start button (X000)] is pressed, [Buzzer (Y003)] sounds for 5 seconds.
2) After that, [Motor forward (Y000)] is activated, and the conveyor begins operating. [RUN lamp (Y001)]
is on when the motor is rotating in the forward direction.
3) If [Transit sensor (X002)] detects 5 workpieces, [Complete lamp (Y002)] is turned on and the conveyer
stops in 10 seconds.
4) Stop the control by [Stop button (X001)]. Turn on [Start button (X000)] to restart.
5-5
Example of sequence circuit with comments
Control start flag
Start Control start flag llIf X000 turns ON, M10 will
button
turn ON for one scan cycle.
Start circuit
Control Stop Completion Start by self-retaining llIf M10 turns ON for one scan
start
flag
button pulse
cycle, M0 is self-retained.
Start by
self-retaining
Initialization at stop/restart
Stop Transit
button number
count
Buzzer control
Start by 5-second
llBuzzer (Y003) sounds for 5
self-retaining timer
seconds.
Conveyor driving time Completion ll The pulse to stop the operation will
after the completion pulse
of the count be ON after the conveyer stops.
5-6
Operation check
Use GX Developer to monitor the circuit.
2) 5 seconds later Y001 (RUN lamp) is turned on, and Y000 (Motor forward) will be
ON.
3) X002 (Transit sensor) Y002 (Completion lamp) is turned on after the fifth ON signal is
is turned on for detected.
5 times.
4) 10 seconds later Y001 (RUN lamp) and Y000 (Motor forward) will be OFF, and the
conveyer stops.
5-7
MEMO
5-8
Let's program with applied instructions!
Chapter 6
THE BASICS OF APPLIED INSTRUCTIONS
6-1
6.1 Applied instructions
Not all applied instructions are complicated. For example, some instructions can provide great benefit
for simple control mechanisms such as the alternating circuit below.
▪ Alternating Circuit
X000
X000
PLS M0
M0 Y000
Y000
Y000
M0 Y000
▪ Alternating Circuit
X000
FNC 66 Y000 This circuit is equivalent to the above
ALT P relay ladder.
▪ Although relay ladder circuits can represent many controls, application instructions have the ability to
greatly simplify the relay ladder circuits.
Reference
6-2
llAlong with the applied instructions for simple ON/OFF control as just described, applied instructions
can be used for simple numeric data operation.
Operations for simple addition and comparison are described below.
Arithmetic operation
Summing two products
Addition example
Numeric Numeric
Calculation value 1) value 2) Result
starts FNC20 K10 K20 D0
ADD
20kg
10kg
30kg
20kg
10kg
6
Comparison
Which is heavier?
Comparison example
Comparison Comparison
Comparison starts source 1) target 2) Result
FNC10 K10 K20 Y000
CMP
20kg
10kg
1) is heavier Y000:ON
20kg 1) = 2) Y001:ON
10kg
2) is heavier Y002:ON
Reference
Types of applied instructions
Applied instructions are beneficial for:
1) Dealing with numeric data regarding comparison, and arithmetic operations.
2) Controlling program flow, executing jumps, subroutines, loops, interrupts and so on.
3) Executing data communications with various handy machines using FROM/TO
instructions and other dedicated instructions.
4) Target-oriented instructions such as those to cut down the number of I/Os, those
to execute high-speed processing, and instructions similar to the ALT instruction
described before.
To use applied instructions, it is necessary to know what "numeric data" means for a PLC
and where "numeric data" is stored in a PLC.
This will be described in the latter half of this chapter.
6-3
Point
llEach applied instruction in the PLC includes a function number and mnemonic to
describe the instruction.
Following the mnemonic symbol, operands are used to define the devices and numeric
values for processing.
Mnemonic
1) Press Enter key or click OK key.
Space
6-4
6.2 Numeric values used in a PLC
6.2.1 Decimal numbers
The FX PLC uses decimal numbers to label timers, counters, and other devices.
[Typical examples]
When constants (K) are used for timers, counters, or numeric values in applied instructions, a decimal
number is used with "K," such as "K20" to represent the constant.
6
6.2.2 Octal numbers
Octal numbers are base 8 numbers, which use eight unique digits from 0 through 7 as follows: 0 to 7,
10 to 17, 20 to 27…
The FX PLC uses octal numbers as device numbers for input relays (X) and output relays (Y).
Input relay (X) X000 to X007 X010 to X017 X020 to X027 X070 to X077 X100 to X107
Output relay (Y) Y000 to Y007 Y010 to Y017 Y020 to Y027 Y070 to Y077 Y100 to Y107
For information on how to assign I/O numbers according to the structure of the system,
see "2.5.4 FX PLC I/O number assignment".
6-5
6.2.3 Binary numbers
The numbers most people are familiar with are decimal numbers, which use a base 10 representation.
Computers and PLCs, however, use binary numbers, which utilize a base 2 system. For example, it is
convenient to use the binary number 0 or 1 to correspond to the ON/OFF status of memory locations and
relays. Let's spend some time to learn the difference between binary and decimal numbers.
Internal processing of
main use Constant K
PLC
8-bit BIN
7 6 5 4 3 2 1 0 Bit
1 0 0 1 1 1 0 1 2 Binary
27 26 25 24 23 22 21 20
Convert to a decimal + + +
128 16 8 4 1
number
The value of
binary number "10011101" is "157" in decimal format.
6-6
6.2.4 Hexadecimal numbers
There are 4 bits for each digit of a hexadecimal number, and each digit of a hexadecimal number is
represented by 0 to 9, A (10), B (11), C (12), D (13), E (14), F (15).
Hexadecimal numbers are base 16 numbers, and the 16th value is F.
0 00 0000 0000
1 01 0000 0001
2 02 0000 0010
3 03 0000 0011
4 04 0000 0100
5 05 0000 0101
6 06 0000 0110
7 07 0000 0111
8 08 0000 1000
9 09 0000 1001
10 0A 0000 1010
11 0B 0000 1011
12 0C 0000 1100
13 0D 0000 1101
14 0E 0000 1110 6
15 0F 0000 1111
16 10 0001 0000
Internal processing of
main use Constant K Constant H and so on
PLC
llIn some cases, the FX PLC uses hexadecimal numbers for the operation setting (buffer memory
setting) when special extension equipment is used.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Bit
0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 HEX code
6-7
6.2.5 Binary-coded decimal numbers (BCD code)
The decimal values 0 to 9 of each digit can be represented in binary numbers of 4 bits by BCD code.
BCD code is used for the output signal of a digital switch, the control signal of a 7-segment display unit,
or for the signals of various measuring instruments.
Decimal BCD
0 0000 0000
1 0000 0001
2 0000 0010
3 0000 0011
4 0000 0100
5 0000 0101
6 0000 0110
7 0000 0111
8 0000 1000
9 0000 1001
10 0001 0000
11 0001 0001
12 0001 0010
llBCD code uses binary numbers of 4 bits to represent one digit 0 to 9 of a decimal number.
[Example of 4 digits of the BCD code that the digital switch outputs]
Decimal number of
3 1 6 5 the digital switch
8 4 2) 1) 8 4 2 1) 8 4) 2) 1 8 4) 2 1)
0 0 1 1 0 0 0 1 0 1 1 0 0 1 0 1 BCD code used in PLC
"Weight" of
8 4 2) 1) 8 4 2 1) 8 4) 2) 1 8 4) 2 1) the binary number of 4 bits
2) 1) 1 4) 2) 4) 1)
6-8
Reference
Main use
Decimal (DEC) Octal (OCT) Hexadecimal (HEX) Binary (BIN) BCD
The device numbers
The internal processing BCD digital switch, 7-
Constant K of the input relays and Constant H and so on
of PLC segment display unit
output relays
6-9
6.3 Storing numeric data
6.3.1 Operating word devices
A word device is a register used to store 16-bit and 32-bit numerical data. Word device types (in FX3U,
FX3UC PLCs) include the following:
Data registers llIn all of the data registers below, 16 bits are
used for one point. 32-bit data can be stored
▪ For general use
by combining two data registers.
D0 to D199 (200 points)
▪ Latched (battery backed) type
D200 to D7999 (7,800 points) ▪ Special type
(File register) D8000 to D8511 (512 points)
D1000 to D7999 (7,000 points) ▪ Index type
▪ Extension register V0 to V7
(16 points)
R0 to R32767 (32,768 points) Z0 to Z7
16-bit data
High-order Low-order 1) A 16-bit data register can represent numeric
D 0 (16-bit data)
values from -32768 to 32767.
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Example 1) When all 16-bit data are "0", the
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
Sign
numeric value is 0.
0 : Positive number 2) When only the most significant bit is
1 : Neve number
"0", and the others are "1", it is +32,767.
3) When all the 16-bit data are "1", it is -1.
32-bit data
32-bit data is represented by a group of data registers with adjacent numbers. (The high-order bits are
larger numbers and the low-order bits are small numbers. In index registers, V represents the high-order
side while Z represents the low-order side.)
Therefore, one register can represent positive and negative numbers from -2,147,483,648 to
+2,147,483,647
High Low
D 1 (16-bit of high-order) D 0 (16-bit of low-order)
-order -order
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
536,870,912
268,435,456
134,217,728
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
32,768
65,536
8
4
2
1
1,073,741,824
For 32-bit data, the device number on the low-order side can be either even or odd.
However, in order to avoid confusion, normally the even numbers are used for the low-order side.
6-10
The values of timers and counters are stored in current value registers. They can substitute for data
registers when they are not used as timers and counters.
The current value register for timers llAll timer registers are a 16-bit. When used as
▪ For 100 ms
a timer, the most significant bit is fixed to "0",
and only integers 0 to 32767 can be stored. (A
T0 to T199 (200 points)
negative number will lead to an error and the
▪ For 10 ms
timer will not work.)
T200 to T245 (46 points)
▪ For 1 ms retentive llAlso, as a timer, units are set at 100 ms, 10
(Latched (battery-backed))
ms, or 1 ms depending on the device number.
T246 to T249 (4 points)
▪ For 100 ms retentive For example, when T0 is 100, it is equivalent to
(Latched (battery-backed)) 10 seconds.
T250 to T255 (6 points) 6
▪ For 1 ms
T256 to T511 (256 points)
The current value register for up-counters llAll up-counting counter registers are a 16-bit.
The current value register for up- and down-counters llAll bi-directional counter registers are 32-bit.
For 100 ms
The most significant bit declares whether the
value is positive (1) or negative (0).
C200 to C219 (20 points)
For latched (battery-backed) ll1 register can represent the positive and
C220 to C234 (15 points) negative numbers from -2,147,483,648 to
For high speed counters +2,147,483,647
(latched (battery-backed))
C235 to C255 (21 points) llWhen timer registers or up-counting counter
registers are needed for storing 32-bit data,
join the two devices with adjacent numbers, as
described on the previous page.
llAll timers and counters used in applied instructions are all current value registers and cannot be
used for coils and output contacts. The sequence instructions (LD, AND, OUT) and so on can be
used for the contacts and coils.
6-11
6.3.2 Operating bit devices as word devices (The
method to specify the digits)
Bit devices are only used for the ON/OFF operation of input relays X, output relays Y, auxiliary relays M,
state relays S and so no. However, bit devices can handle up to 32-bit values by combining 4 points into
one digit and using up to 8 digits together.
[Example of K4X000]
4th digit 3rd digit 2nd digit 1st digit
High-
X017 X016 X015 X014 X013 X012 X011 X010 X007 X006 X005 X004 X003 X002 X001 X000 Low
order order
Specified device
Specification of
the first device
1) 2) 2) 1) 4)
K4 X000
Input X017 X016 X015 X014 X013 X012 X011 X010 X007 X006 X005 X004 X003 X002 X001 X000
relay
K1X000 K1
K2X000 K2
K3X000 K3
K4X000 K4
Max K8
PLC
Device numbers can be specified arbitrarily. (Example: K4M13). However, generally, the least significant
digit is recommended to be set to 0 such as K1X000, K2Y010, K3M20 and K8S103. (Multiples of 8 are
ideal for M and S, but in order to avoid confusion, 0 is recommended to be used.)
6-12
Reference
7-Segment driver
To display numbers on a 7-segment display, a PLC outputs BCD of two digits from Y017 to Y010.
If the inputs 1, 2, 4, 8 of the 7-segment driver are driven by a PLC, 0 to 9 will be indicated according
to the total value of the numbers input.
PLC
8 4 2 1) 8 4 2) 1)
6
DP
For controlling the
decimal point (Also
can be used for the
other output
GND Vcc GND Vcc contacts of the PLC)
6-13
MEMO
6-14
Data transfer is the basis for applied instructions!
Chapter 7
TRANSFER INSTRUCTIONS FOR NUMERICAL VALUES
7-1
7.1 Data transfer instruction (MOV)
The data transfer instruction is the instruction to transfer bit data or numerical data from a transfer
source to a transfer destination. It is a typical applied instruction that must be used for temporary data
retention and storage.
The transfer instructions include instructions for simple data transfer and instructions (such as BCD and
BIN) for converting data during transfer.
Operation outline
Transfer
llFlow of data
Transfer If the transfer instruction input is ON, the data in the transfer
instruction
FNC 12
MOV D0 D1 source is written to the transfer destination.
Transfer Transfer In this situation, the data in the transfer source does not
source destination
change. When the transfer instruction input is OFF, data is
not transferred, and the transfer destination data does not
llThe data is transferred in BIN. change.
MOV K1234 D1
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
K1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
●● The PLC treats K1234 as a
BIN value and transfers it to
D1 (16 bits) D1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
7-2
Instruction operation
Let's check the operation of the MOV instruction.
T0 K50
0 T0 ●● The current value of timer T0 repeatedly
changes from 0 to 50.
T0 K30000
C0
●● The current value of counter C0 increases
every 5 seconds.
X007
11 RST C0
X000
14 FNC12 T0 D0
MOV 1)
X001
FNC12 C0 D1
20 2)
MOV
X002
FNC12 D2 3)
23 T0
MOV P
X003
FNC12 C0 D3
29 4)
MOV P
X004
35 FNC12
K153 D4 5)
MOV P
X005
41 FNC12
MOV P
H4A9D D5 6) 7
1) Turn "ON" X000 ●● The current value of timer T0 is always transferred to the data
register D0 when X000 is ON.
If X000 is turned off, the data register D0 keeps the current value
of the timer at the time when X000 is turned off.
2) Turn "ON" X001 ●● The current value of counter C0 is always transferred to D1 when
X001 is ON.
If X001 is turned off, the data register D1 keeps the current value
of the counter at the time when X001 is turned off.
3) Turn "ON" X002 ●● The current value of timer T0 at the time when X002 is turned on
is transferred to data register D2.
4) Turn "ON" X003 ●● The current value of the counter at the time when X003 is turned
on is transferred to data register D3
5) Turn "ON" X004 ●● "153 (Decimal)" is directly transferred to D4. (Initial data setting)
●● The decimal "19101" is transferred to D5. (Initial data setting)
6) Turn "ON" X005 Select [Online]—[Monitor]—[Change current monitor value
(Hexadecimal)]. "H4A9D" is displayed.
To return it to decimal, select [Change current monitor value
(decimal)] from the same menu .
7-3
Point
Continuous execution vs. Pulse execution
[Continuous execution instruction] [Pulse execution instruction]
Drive input Drive input
FNC 12 D0 D1 FNC 12 D0 D1
MOV MOV P
llFor the continuous execution type llP is added to the end of the pulse
instruction, when the drive input is ON, execution type instruction.
the instruction is executed and the
llFor the pulse execution type, the
transfer is performed for each scan.
instruction is executed only once when
Input condition ON the input drive changes from OFF to ON.
llThus, the continuous execution instruction is used when data is constantly changing,
while the pulse execution instruction is used for transfers that are needed only when the
instruction is input turns on (When setting the initial value or the value at the specified
time.)
llIf the drive input is OFF, the MOV instruction is not executed and the transfer destination
data does not change.
llThe pulse execution operation can also be programmed as follows:
X000
PLS M0
M0 FNC12
D0 D1
MOV
X000 FNC12
D0 D1
MOV P Or
X000 FNC12
D0 D1
MOV
7-4
7.2 Conversion transfer instruction (BCD/BIN)
The operations of values in a PLC are all performed in BIN format. Thus, when inputting the digital switch
values of a BCD to a PLC, use the BCD-to-BIN conversion transfer instruction . Also, to output to a
7-segment display unit using BCD, it is necessary to use the BIN-to-BCD conversion transfer
instruction.
Operation outline
X001
FNC 19
BIN instruction..........When the drive input is ON,
0 K2X010 D0
Drive input
BIN the BCD value of the transfer
Transfer Transfer source is converted to BIN
source(BCD) destination (BIN)
and transferred.
FNC 18
D0 K2Y010
BCD BCD instruction........When the drive input is ON,
Transfer Transfer the BIN value of the transfer
source (BIN) destination (BCD)
source is converted to BCD
and transferred.
Instruction operation
Input the above program.
2nd digit 1st digit
Operation check
- -
7 8
+ + 1) BCD codes are input to devices X010 to X013
(the first digit) and X014 to X017 (the second
7 8
digit) according to the changes of the digital
7
1) BCD input
X013 8
X012 4
X011 2
X010 1
32
16
64
BCD instruction
Output (Y) 0 1 1 1 1 0 0 0
(Reference) Input of digital SW BCD value
8 Y013
3) BCD output
80 Y017
20 Y015
10 Y014
4 Y012
1 Y010
40 Y016
2 Y011
0 0000
1 0001
2 0010
70 8 3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
7-5
Comparing the operation
Let's compare the BIN/BCD instruction to the MOV instruction and check the operation.
Digital switch
- -
8 8
+ +
X000
0 FNC19 K2X010 D0 1)
X017 to X014 X013 to X010 BIN
X000
6 FNC12 K2X010 D0
MOV 2)
MOV instruction BIN instruction
PLC
1) Turn "ON" X000 The value of the digital switch (BCD input) is converted to a decimal
value by "BIN instruction" and transferred to D0.
2) Turn "OFF" X000 The input is the same as 1) above, and the value is not converted to
a decimal value because the instruction used is the MOV instruction,
which directly transfers the value to D0.
7-6
Reference
Operation error and error step number
ll When the value of the transfer source is not BCD, the BIN instruction will lead to an "operation
error" and cannot be executed.
ll The code and the step number of errors are stored to the following special auxiliary relay or
special data register.
Moreover, the check can be performed by selecting [Diagnostics]-[PLC diagnostics] from the
menu of GX Developer.
If an operation error occurs, M8067 will turn on, and the error code of the
M8067 operation error will be stored to D8067. The error step number will be stored
to D8069.
D8067 If a new error occurs at another step, the error code of this instruction and
D8069 the step number will be updated sequentially.
The errors are cleared instantly when the status of PLC changes from STOP
to RUN.
If an operation error occurs, M8068 will be turn on, and the error step number
M8068 will be stored to D8068. The value will not be updated even if a new error 7
D8068 occurs and it will remain until the device is reset or the power is turned off.
7-7
7.3 Indirectly specifying the transfer source
and transfer destination
Devices in applied instructions can be specified directly (as described so far) or indirectly for data
transfer operations.
The index registers V and Z can be used to specify devices indirectly.
7-8
Instruction operation
llMonitor the current values of the data registers (D0 to D9) that are specified by the index register Z.
- Digital switch for specifying
5 the data register number
Input X013 to X010
+
PLC
FNC 12
2) The current value in the data register whose
K10 D0 10
MOV number is indexed by index register Z0 is
FNC 12 displayed in the 7-segment display unit (Y017
MOV K11 D1 11
to Y010).
FNC 12 K12 D2 12 *In the transfer source D0Z0, the data
MOV
register number changes between D0 and D9
FNC 12 K13 D3 13 according to the value of Z0.
MOV
FNC 12 K16 D6 16
MOV
FNC 12 K17 D7 17
MOV
FNC 12 K18 D8 18
MOV
FNC 12 K19 D9 19
MOV
7-9
7.4 Other transfer instructions
7.4.1 Block Move (BMOV)
n pieces of data starting from the device specified in the transfer source are transferred in a batch to n
devices starting from the one specified in the transfer destination.
FNC 12
Transfer K25 to D1
K25 D1
MOV
Transfer K50 to D2
FNC 12
MOV K50 D2
Transfer Transfer llIf the transfer number is larger than the device
source destination
range, the data within the range will be transferred.
D0 10 → D5 10
llIn the case of bit devices for digit specification, set
D1 25 → D6 25 Transfer the same number of digits between the transfer
number
source and destination.
D2 50 → D7 50 BMOV K2X000 K2Y000 K5
The number of digits is the same!
7-10
7.4.2 Fill move (FMOV)
The value of the device specified in the transfer source is transferred to n consecutive devices starting
from the transfer destination device.
The n pieces of transferred data are the same.
M8000
FNC 19
The data set by DSW1 is converted to BIN and then
K1X010 D10
BIN transferred to D10.
Drive input The value of D10 is transferred to 4 points from D20 to
X000
FNC 16 D10 D20 K4 D23.
FMOV
Transfer Transfer Transfer
source destination number
Transfer Transfer llIf the transfer number is larger than the device range,
source destination
the data within the range will be transferred.
D10 3 D20 3
D21 3
Transfer
number
D22 3
D23 3
Reference
Bit length for numeric values
ll The applied instructions for numeric operations can be divided into 16-bit type and 32-bit type
depending on the length of the numeric data.
ll 32-bit instructions are represented with an
Represented in 16-bit
Drive input added "D".
FNC12 D0 D1 Transfer from
MOV D0 to D1 ll For 32-bit instructions, the transfer source
and transfer destination device numbers
Represented in 32-bit
Drive input Transfer from
can be either even or odd. In every case,
FNC12 D10 D12 however, 32-bits of data (ie - two data
D11, D10 to
D MOV
D13, D12 registers) are transferred.
32-bit counter (Example of C200) ll 1 point for a 32-bit counter occupies 32
Drive input Transfer from
FNC12 bits. An operation error will occur if 16-bit
C200 D10 C200 to D11,
D MOV
D10 instructions are used.
7-11
MEMO
7-12
Comparison of numeric data!
Chapter 8
THE COMPARISON INSTRUCTION FOR NUMERIC DATA
8-1
8.1 Data comparison instructions CMP, ZCP
The comparison instructions are used when comparing the current values stored in the data registers,
the timers and the counters, or the values representing the combined relays of X, Y, M, or S, along with
constants K.
There are 1-point comparison and 2-point zone comparison methods for comparing data. Both methods
produce three results to determine whether a value is "less than," "greater than," or "equal to" the
comparison source(s).
M22
Y002 K 10 < C15 M22 ON
X001
C15
X002
RST C15 ll The zone comparison instruction is an instruction
that performs the same operation as the 1-point
Zone comparison
comparison except that the comparison source is
Drive input
FNC 11 K100 K200 D10 M100
a 2-point zone.
ZCP
Comparison Comparison Comparison Output ll Set the value of the comparison source 1 to a
source 1 source 2 destination result value smaller than that of comparison source 2.
M100 Comparison Comparison Output
Y003 source1 K100 > destination D10 M100 ON
result
M101
Comparison Output
Y004 K100 D10 K200 M101 ON
source 2 result
M102 Comparison
Y005 D10 > source 2 K200 Output M102 ON
result
Reference
Operation of output result
In the following cases, the output result for data comparison instructions will not change:
1. When the drive input is ON, but the description of the instruction is mistaken.
Example • When the number of applicable compare device is indexed so that it exceeds the device range.
(The operation error flag M8067 turns on in this case.)
•W
hen the value of the comparison source 1 is larger than the value of comparison source
2 for zone comparison.
2. The drive input is turned on once, and then turned off after the comparison instruction is
executed and the compare output does not change.
(The operation error flag M8067 is not turned on in this case.)
Example
X000
When the output result directly starts from the bus line as
CMP K100 D0 M10 shown in the left diagram and the drive input X0 is turned
M10 off, the output M11 remains ON without regard to changges
OFF in D0.
M11 It is recommended to serially connect the result input to the
ON D0 = 100
M12 drive input as described in the above diagram, or to turn
OFF off the output destination devices using the RST instruction
after the drive input is turned off.
8-2
Instruction operation
Use the count value of the counter to check the operations of the CMP instruction and the ZCP
instruction.
Operation check
X000 K26
0 C0 1) 1) The current value of the counter C0
M8000
increases by "1" when the input of X000
FNC18
4
BCD
C0 K2Y010 2) is "ON".
ON during RUN
2) The current value of the counter C0 is
C0
10 RST C0 3) indicated in the 7-segment display unit.
3) When the current value of the counter
Drive input reaches 26, reset the counter and return
X007
13
FNC10
CMP K10 C0 M20 it to the initial status.
4) Value comparison
M20 K10>C0
Y000 Current value
4) of counter 11 or more 10 0 to 9
M21 K10=C0
Y001 Y002: ON Y001: ON Y000: ON
(M22: ON) (M21: ON) (M20: ON)
M22 K10<C0
Y002 5) Zone comparison
Current value
of counter 21 or more 10 to 20 0 to 9
Drive input
X007 Y007: ON Y006: ON Y005: ON
30 FNC11
ZCP K10 K20 C0 M30 (M32: ON) (M31: ON) (M30: ON)
M30 K10>C0
Y005
5)
8
M31 K10 C0 K20
Y006
M32 K20<C0
Y007
8-3
8.2 Contact comparison instructions (LD , AND , OR )
Contact comparison instructions can use a comparison result as the contact information in a circuit.
Operation outline
llThe contact compare instructions are divided into 3 types depending on their placement within a
program: LD contacts (connected from the bus line), AND contacts (connected to others serially),
and OR contacts (connected to others in parallel).
ll"=, >, <, <>, <=, >=" can be input after in a circuit diagram created with GX Developer.
8-4
OR llY004 is turned on when X001 is turned on or
the current value of the counter C10 is 200.
X001
Y004
8-5
Instruction operation
Compare the input value from a digital switch to a value set in advance and then turn on an output.
Operation check
Digital switch
-
8
+
M8000
FNC19
0 K1X010 D0 1)
X013 to X010 BIN
ON during RUN
PLC
6 > K2 D0 Y000 2)
K2 >
K5 <= 12 K5 D0 Y001 3)
<=
K7 =
D0
18 = K7 D0 Y002 4)
K9 <>
24 <> K9 D0 Y003 5)
8-6
Arithmetic manipulation of numerical values!
Chapter 9
ARITHMETIC OPERATION
9-1
9.1 Arithmetic operation instructions (ADD, SUB, MUL, DIV)
PLC arithmetic instructions are used to perform operations of addition, subtraction, multiplication and
division.
Operation outline
X000
0 FNC 19 K2X010 D0 The BCD values X010 to X017 are converted
BIN
Drive input to BIN, and then transferred to D0.
X001
FNC 20 D0 + K10 = D1
6 D0 K10 D1
ADD ←The following changes occur according to
1) 2) 3) 4) the instructions.
X002
FNC 21
14
SUB D0 K20 D2 D0 - K20 = D2
1) 2) 3) 4)
X003
22 FNC 22 D0 × K1000 = D5, D4
D0 K1000 D4
MUL
1) 2) 3) 4)
X004
FNC 23
30
DIV
D0 K2 D6 D0 ÷ K2 = D6…(D7) Remainder
1) 2) 3) 4)
1) Instructions
FNC20 ADD : BIN ADDITION
FNC21 SUB : BIN SUBTRACTION
FNC22 MUL : BIN MULTIPLICATION
FNC23 DIV : BIN DIVISION
2) Specify the augend, minuend, multiplicand or dividend.
3) Specify the addend, subtrahend, multiplier or divisor.
4) Specify the storage destination for the operation result.
For the 16-bit instruction ADD, SUB, MUL, DIV
Addition (D0) + (K10) = (D1) Sum
Subtraction (D0) - (K20) = (D2) Difference
Multiplication (D0) × (K1000) = (D5, D4) Product (The result is 32 bits.)
Division (D0) ÷ (K2) =(D6) Quotient…(D7) Remainder
For the 32-bit instruction D ADD, D SUB, D MUL, D DIV
Addition (D1, D0) + (K10) = (D2, D1) Sum
Subtraction (D1, D0) - (K20) = (D3, D2) Difference
Multiplication (D1, D0) × (K5) = (D7, D6, D5, D4) Product (The result is 64 bits.)
Division (D1, D0) ÷ (K2) = (D7, D6) Quotient…(D9, D8) Remainder
* The operation result is 32-bit for multiplication (64 bits for the D instruction), and for division, a register
is occupied by the remainder. Thus, it is necessary to avoid storage destination conflicts for operation
results of multiplication and division instructions.
* For the 32-bit multiplication instruction ( D MUL), the operation result becomes 64 bits.
In this situation, note that there are no applied instructions or peripheral equipment for the 64-bit data.
For example, when division is also used, it is recommended to perform the division first in order to
make the data for the multiplication as small as possible.
* If the FNC49FLT instruction is used, floating point operation for values below decimal-point is also
available.
9-2
The operation result of the multiplication instruction (product) is represented as 32-bit data with the 16-
bit operation, while 64-bit data is required for the result of the 32-bit operation.
For example, if the product is K240, the 16-bit operation is shown below.
In this situation, only the upper 16 bits can be used since the upper 16 bits are 0.
16,384
8,192
4,096
32,768
2,048
1,024
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65,536
512
256
128
64
32
16
8
4
2
1
Symbol 0: Positive number 1: Negative number
Higher-order D 0 (16 bits) Lower-order
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 =240
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
On the right, the lower 16 bits of the 32- Symbol
0: Positive number
bit data are shown. 1: Negative number
When the operation result is within 16 bits (32 bits), the data of the lower words can be used as the
operation data for the next time.
Moreover, it is convenient to use the bit status check instruction (FNC44 BON) to check the positive and 9
negative numbers.
Drive input
FNC 44 When the 31st bit (highest bit) of the 32-bit data D1
D0 M0 K31
D BON and D0 is ON, M0 is turned on.
Bit status Check Check
check data output bit status
M0
Y000 Negative number
M0
Y001 Positive number
D1 D0
0 0 0 0 0 ……… 0 0 0 0 0
b31 b30
……… b1 b0 Bit numbers
9-3
MEMO
9-4
Aspects of interrupt control!
Chapter 10
HIGH SPEED PROCESSING FUNCTIONS AND COMMANDS
10
10-1
10.1 Concept of high speed processing
The micro PLC repeats a sequence of "input processing" → "program processing" → "output processing"
called a "batch refresh".
This series of processing actions (one scan cycle) only needs approximately 10 ms, enough to normally
control a sequence. But 10 ms is not enough to execute processing immediately after an input is turned
on or to import an input signal shorter than one scan cycle of the PLC.
This section describes the processing methods that are not subject to the influence of the scan cycle of
the program.
Read out
X000 Write in
Y000 ll Process of program
The PLC reads the ON/OFF statuses of required
Repetitive processing
Read out Image devices from the input image memory or other
memories
for each device's memory, in accordance with the contents
Y000
device of instructions stored in the program memory.
M100
Y, M,
Hence the image memory of each device can
S, T, sequentially change its content in accordance
C, D, with the progress of the program.
V, Z,
Output
ll Output operation
Output latch memory
When all instructions have been executed, the
PLC transfers the ON/OFF statuses of outputs
Y to the output latch memory, which are the
Output terminal physical outputs.
Y000 Y001
10-2
Categories of high speed processing in FX Series PLCs
10-3
10.2 Using input interrupts
For interrupt inputs, six points from X000 to X005 can be used.
Interrupt programs are started with interrupt pointers, which are used as labels and placed after the
FEND instruction in programs. They are ended with IRET instructions.
A single input number cannot be used for multiple interrupt pointers (overlap of numbers is not
allowed).
Operation outline
For example, when X000 is turned on, the
program moves to the label of the pointer llIf X000 or X001 is turned on when the
l001 and executes the sequence instructions program is executed between the EI and the
that follow the label. The program returns to DE instructions, the interrupt routine 1) or 2)
the suspended instruction when the IRET is executed. The program returns to the main
instruction is executed. program by the IRET instruction.
llWhile the special auxiliary relay M805 (
FNC 04
EI represents 1 to 5) is ON, the interrupt routine
X010 of I ** is not executed.
M8050 In the figure to the left, the interrupt routine for
Interrupt range
I001 is not executed by the rising edge of X000
when X010 is ON.
END
ll If multiple interrupt routines are triggered sequentially, the routine that is triggered earlier is executed. If two
interrupt programs are triggered at exactly the same time, the one with lower pointer number is executed first.
ll When an interrupt program is executed between the DI and the EI instructions (the interrupt-disabled
segment), the interrupt program is saved, and then executed after the EI instruction (excluding cases where the
special auxiliary relay M805 is ON). The longer the interrupt-disabled segment, the longer it takes to accept
the interrupt instruction.
10-4
Instruction operation
Confirm the actions of the external interrupt signal of X002.
Proximity sensor
Operation check
Reset
1) • Y000 is turned on when X002 is turned on,
and the data is output immediately by the
X007 X002 PLC
REF instruction.
External interrupt
X002 is used for high speed input. The input
D0 signal needs to stay on for only 5 µs to be
Current value
recognized.
• In this example program, the PLC does not
BCD instruction recognize a signal from X002 while Y000 is
Refresh ON (5 seconds).
output
Y017 to Y014 Y013 to Y010 Y000
• The number of times X002 is turned on is
counted by the INC instruction (increment a
value by 1), and stored in the data register
8 8 D0.
Stays on for 5 seconds 2) • The current value of D0 is reset when X007
7-segment
display unit
after X002 is turned on is turned on.
• The timer T0 times out and is reset after
Y000 stays on for 5 seconds.
M8000
FNC18 D0 K2Y010 Displays interrupt times
BCD
ON during RUN
X007
10
Resets count time
1 RST D0
2) Main program
Y000 K50
4 T0
Y000 is ON
for 5 seconds
Reference
T0
8 RST Y000
The INC instruction is an instruction that
adds "1" to the specified device.
FNC06 Ends main program
10
FEND If the INC instruction of the continuous
I201 execution type is used, 1 is added every
Y000 operation cycle. To avoid this, generally, the
Sets Y000 at rising
11 SET Y000
"INCP" instruction of the pulse execution
1) Interrupt program
edge of X002
type is used.
FNC24 Counts X002’s
INC
D0
input times On the left program, 1 is added by an
instruction only in response to an interrupt
Refreshes Y000 input. Therefore the program runs properly
FNC50 Y000 K8
REF (immediately)
with the "INC" instruction of the continuous
execution type.
FNC03 Ends interrupt
22
IRET program
10-5
POINT
10-6
10.3 Using a timer interrupt program
Pointer
1) Only 6, 7, and 8 can be assigned for timer interrupt programs. The number must not
1) 2) be overlapped.
2) A number between 10 to 99 ms is specified as the cycle for the interrupt program.
The interrupt program starts when the time specified by the pointer has arrived.
Other conditions for timer interrupt programs are the same as those for the input interrupt programs.
The time specified in the pointer I is used as the timer value, so there is no need to program another
timer circuit.
The following instructions use several operation cycles to execute a series of actions: FNC76(RAMP),
FNC71(HKY), FNC74(SEGL), FNC77(PR)
Using these instructions may take a long time to complete all of the actions, or may not even complete
all of the actions successfully due to time fluctuation. Use a timer interrupt program for such cases.
Main program
I610
Interrupt program T imer interrupt program
is executed every
10 ms 10
10-7
10.4 Using high speed counters
10.4.1 Types of high speed counters
A high speed counter counts how many times an input device turns on or off in interrupt processing. It
does not depend on the operation cycle.
As shown in the table on the right page, the input of the high speed counter is specified by the device
number of the high speed counter. The input can be X000 to X007.
The high speed counter can be classified into three types by their counting system.
A phase A phase
1-edge +1 +1 -1 -1 This counter counts up or down
count B phase B phase automatically according to the input status
2-phases Forward rotation Reverse rotation in A- and B-phases.
2-counting The counting direction of the counter is
4-edge +1 +1 +1 +1 +1 -1 -1 -1 -1 -1
input specified with M8251 to M8255.
count A phase A phase
ON: Down-counting
(only OFF: Up-counting
B phase B phase
FX3U,
+1 +1 +1 +1 -1 -1 -1 -1
FX3UC) Forward rotation Reverse rotation
Reference
Definition of a 2-phase type encoder
A phase llA 2-phase type encoder is installed on the rotary shaft of
some machinery, which generates a signal that indicates
B phase the rotation direction (forward or reverse) of the machinery.
time To make a counter count up or down automatically
Count up during forward rotation
according to the rotation direction of the machinery, the
counter must be a 2-phase counter.
A phase
llThe 2-phase encoder generates outputs for A-phase and
B phase B-phase, which are 90 degrees apart from each other. As
time
a result, the high speed counter automatically counts up or
Count down during reverse rotation down as shown on the left.
10-8
10.4.2 High speed counters and input terminal numbers
Device numbers for high speed counters correspond to those of inputs X000 to X007 as shown in
the table below. X000 to X007 cannot be overlapped and used for other purposes within the same
program.
For example, C235 is a 1-phase counter with one input. This counter uses X000 as its input, and does
not have an interrupt reset input or interrupt start input.
C235 cannot be used with C241, C244, C246, C247, C249, C251, C252, or C254.
Another example is C255. C255 is a 2-phase counter with two inputs. This counter uses X003 as its
A-phase input and X004 as its B-phase input. It also uses X005 as its interrupt reset input and X007 as
its interrupt start input.
llA high speed counter input, interrupt input, and FNC56SPD instruction input cannot be overlapped.
llFor an input used with a high speed counter, the setting of the input filter is automatically changed
to accomodate high speed signals.
Reference 10
A high speed counter can be used as a "hardware counter" or "software counter". Response frequencies
available for each type are as follows:
Type
Hardware counter Software counter *1
Signal
1-phase 1-counting input Max. 100 kHz Max. 40 kHz
1-phase 2-counting input Max. 100 kHz Max. 40 kHz
2-phase 2-counting input Max. 50 kHz Max. 40 kHz
*1: This assumes that the high speed counter dedicated comparison instructions, described later,
are used. The response frequency varies by the type and number of instructions to be used.
Also, the total value of available frequencies is defined.
10-9
10.4.3 High speed counter actions
A high speed counter is a latched (battery-backed) up/down counter. One point can use 32-bit data.
To specify high speed counters for applied instructions such as transfer instructions or for the
arithmetic operation instructions, 32-bit instructions are used with D added.
POINT
Do not enter the same device number for the counter drive input as that for
the counting input (X000 to X007).
Input number assigned The contact which is always ON
by C235 when counting
X000 M8000, etc.
C235 C235
ON during RUN
X002 Up Down Up
X000
Counting 5
input 4 4
3 3
2 2
C235 1 1
0 0 0
Current -1
value -2
-3 -3
-4 -4
When output is already ON -5 -5
-6 -6
-7 -7
-8
Y003
C235 counts up or down every time the counting input X000 is
turned on after the C235 coil is turned on.
llThe output contact is closed when the current value of the counter increases from -6 to -5. When
decreases from -5 to -6, the output contact is opened.
llThe current value changes regardless of the output contact ON/OFF status. If the counter counts
up from 2,147,483,647, the value is changed to -2,147,483,648, and if the counter counts down from
-2,147,483,648, the resulting value is 2,147,483,647.
(This counting operation is called a ring counter.)
llWhen the reset input X006 is turned on, the current value of the counter changes to 0, and the
output contact is reset.
llThe current value of the counter, the output contact and the reset status is latched (battery-backed).
10-10
10.4.4 1-phase high speed counters
1-phase 1-input C235 to C245 (6 points or less) 1-phase 2-input C246 to C250 (2 points or less)
The above counters are latched (battery-backed) binary counters that use 32 bits. The output contact
of the counters reacts to changes in the current value, similar to that of the previously described 32-bit
counters for counting internal signals.
However, by using the high speed counting inputs, interrupt instructions are executed to count
independently from the sequence operation. (The PLC provides applied instructions that are used to
execute interrupt processes for output or comparison.)
Also, by selecting a counter number in a specific way, counting can be started or reset with specified
interrupt inputs.
X001 X002
M8235 Down/Up RST C246
X002
X003
RST C 235 R eset
C246 D2
X003
C 235 K 1234
Set value (D3, D2)
llWhile X003 is ON, C235 counts up or llWhile X003 is ON, C246 counts up every
down every time the input X000 turns on. time the input X000 turns on, and counts
down every time the input X001 turns on.
llC235 is reset when X002 turns on.
X004
M8245 Down/Up X000
RST C250
X005
RST C 245 R eset X001
C250 K1234
X006
C 245 D0
llC245 counts up or down while X006 is llC250 counts up or down while X001 is 10
ON. It starts counting immediately after the ON. It starts counting immediately after
input X007 turns on.
the input X007 turns on. The counting
llThe counting input is X002. The setting input is X003 for counting up, while X004
value is (D1, D0) in this example.
is used for counting down.
llC245 can be reset with X005 as shown in
the above sequence circuit. However, this llC250 can be reset with X000 as shown in
is essentially not needed since X003 is the above sequence circuit. However, this
used to reset C245.
is essentially not needed since X005 is
used to reset C250.
ll C counts down or up depending on llThe counting direction (up or down) of C
whether M8 is ON or OFF. can be recognized by monitoring the ON/OFF
status of M8 .
Additional note
Note that a malfunction occurs in counters due to switch chattering when high speed counters are
activated with simulation switches.
10-11
10.4.5 2-phase high speed counters
llThe above counter is a latched (battery-backed) binary counter that uses 32 bits. The output
contact of the counter reacts to changes in the current value, similar to that of the previously
described 32-bit counters for counting internal signals.
llHowever, by using the high speed counting inputs, interrupt instructions are executed to count
independently from the sequence operation. (The PLC provides applied instructions that are used
to execute interrupt processes for output or comparison.)
llAlso, by selecting a counter number in a specific way, counting can be started or reset with
specified interrupt inputs.
llWhile an A-phase input is ON, this counter counts up when the B-phase input is changed from OFF
to ON, and counts down when the B-phase input is changed from ON to OFF.
Additionally, the counting direction (up or down) of C can be recognized by monitoring the
ON/OFF status of M8 .
X002 llWhile X006 is ON, C251 counts up or down every time the input
RST C251 X000 (A-phase) or X001 (B-phase) turns on.
X006
llThis counter is reset when X002 is turned on.
C251 K1234
C251 llY002 is turned on when the current value exceeds the setting
Y002 value, and is turned off when the current value changes to a
M8251 value below the setting value.
Y003
llY003 is turned on (count-down) or off (count-up) according to the
counting direction.
llWhile X006 is ON, C255 counts up or down every time X003
X002 (A-phase) or X004 (B-phase) turns on. It starts counting
RST C255 immediately after the input X007 is turns on.
X006
C255 D0
llThis counter is reset with X002 in the left sequence circuit. It is
also reset when X005 is turned on.
C255
Y004 llY004 is turned on when the current value exceeds the setting
M8255 value (D1, D0) and turned off when the current value changes to
Y005 a value below the setting value.
llY005 is turned on (count-down) or off (count-up) according to the
counting direction.
Additional note
When a counting pulse is not provided, none of the high speed counter output contacts will turn ON,
even if the PLC executes an instruction where "current value > set value."
10-12
10.4.6 Applied instructions and their actions for high speed counters
The previous section described basic ways on how to use the high speed counters. When the current
value reaches the setting value for a counter, the following applied instructions are used to output
signals immediately.
Similar to the high speed counters, the applied instructions are executed independently from the
sequence operation. Thus, outputs can be used without any operation delays.
Operation outline
[High Speed Counter Set/Reset instructions]
Drive input
llThis instruction is a High Speed Counter
FNC 55 K10 K20 C241 Y000 Zone Compare instruction.
D HSZ
Comparison Comparison High speed Output llThree output points are controlled according
value 1 value 2 counter No. destination
to the current value of the high speed
K10 > C241 Current → Y000
value counter.
K10 ≤ C241 Current ≤ K20 → Y001
value
C241 Current > K20 → Y002
value
10
llDo not execute more than 32 of the FNC53 to 55 instructions simultaneously with FX3U or FX3UC
PLCs (six instructions or less in other series).
(More than 32 of the FNC53 to 55 instructions can be programmed if they are not simultaneously
executed.)
10-13
Instruction operation
Using the training machine, create a sequence program with a high speed counter to count input
signals from a 2-phase rotary encoder (high speed output device) and to operate the following outputs
accordingly.
2-phase rotary
encoder
(360 pulse/rotaion)
Operation check
B-phase
Reset input [Count value is 0 to 2000]
A-phase
Counter C251 2000
X007 X001 X000 current value 1000
high speed count input 0 1000 2000 times
Output Y000 ON
PLC
10-14
Let's use a special function block!
Chapter 11
SPECIAL FUNCTION UNIT/BLOCK INSTRUCTIONS
11
11-1
11.1 Special Function Unit/Block Instructions FROM/TO
Positioning control examples • Constant quantify feed control • Constant multiple stage-feed control
• Rotary angle control • Variable speed control
• 2-axis periodic control, etc.
11-2
Intercommunication with special function unit/block buffer memory is executed with FROM/TO
instructions via sequence programs from the PLC.
The FROM instruction reads the current value and status information of the special function unit/block,
while the T0 instruction writes in the various setting values for the special function unit/block actions.
An extension cable
is used to connect
Input processing the PLC and the Input processing
special function
unit/block.
Sequence operation
Interrupt processing
Reference
Main special function unit/block categories 11
The following special function units/blocks are available.
• Analog input module FX 2N -2AD, 4AD, 8AD, FX3U -4AD
• Analog output module FX 2N -2DA, 4DA, FX3U -4DA
• Analog input/output module FX0N -3A, FX 2N -5A
• Analog input module for Pt100 inputs FX 2N -4AD-PT
• Analog input module for thermocouples FX 2N -4AD-TC
• Temperature control block FX 2N -2LC
• High speed counter module FX 2N -1HC
• SSCNET compatible positioning block FX3U -20SSC-H
• Pulse train output (for 1 axis) positioning module FX 2N -1PG, 10PG
• Pulse train output (for 1 axis) positioning module FX 2N -10GM
Operable without PLC
• Pulse train output (for 2 axes) positioning module FX 2N -20GM
• CC-Link interface block FX 2N -32CCL
• CC-Link master block FX 2N -16CCL-M
Including equipments for FX3U and FX3UC PLCs.
A main unit FX 2N or FX3U PLC may connect up to 8 special function units/blocks.
11-3
FROM/TO instruction operation is shown as follows.
FX 2N-32ER
llEach special function unit/block is connected with an extension cable (supplied with the unit/
block) on the right side of the PLC, extension unit, or extension block.
I/O numbers are distributed to the added units/blocks, and the special function units/blocks are
assigned unit numbers automatically.
ll Unit numbers are distributed as No.0 to No.7 from the closest one to the PLC base unit and outwards.
llEach special function unit/block occupies 8 I/O points (deducted from either of the inputs or
outputs). However, I/O numbers are not assigned to them.
The maximum I/O points of a PLC with special function units/blocks is shown in the following formula:
Maximum I/O points = 256- occupied points number (8 points) × Number of special function units/
blocks
llWhen a special function block is used, 5 V power is supplied from the main unit or extension unit.
Therefore, the total current consumption must be below a specified value.
11-4
For transfer source and destination
ll TO/FROM instructions involve communication with buffer memory numbers in the special function blocks.
Buffer memory addresses are 16 bit addresses whose contents and range vary depending on the special
function unit/block.
ll The FROM instruction to the receiving station and the TO instruction to the transfer source are instructions that
both accept PLC word device inputs (such as K2M10 and K4X000 including the digit specification of bit devices).
ll In some buffer memories, 32 bit data is used. In these cases, it is necessary to use 32-bit instructions from
the PLC.
D100 BFM#5
D100 BFM#5
D101 #6
D101 #6
D102 #7
D102 #7
D103 #8
D103 #8
D104 #9
In the case of a 16-bit instruction with n=5 In the case of a 32-bit instruction with n=2
The number of transferred points for FROM/TO instructions is specified with n. 16-bit instructions
with n=2 are identical to 32-bit instructions with n=1.
Reference
Function of special auxiliary relay M8028
ll When M8028 is OFF ll When M8028 is ON
All interrupts are disabled during the If an interrupt occurs during the execution
execution of FROM/TO instructions. The of a FROM/TO instruction, the FROM/TO
input interrupts and timer interrupts cannot execution stops and the interrupt program 11
be executed. begins to run.
The interrupts that occur during this However, FROM/TO instructions cannot be
period are executed immediately after the used during the interrupt program.
execution of the FROM/TO instruction.
FROM/TO instructions may still be used
during interrupt programs.
11-5
11.2 FX2N-5A application examples
Instruction operation
llThe FX 2N -5A analog input/output block has 4 analog input points
and 1 analog output point.
Let’s confirm the application method of this special block using the
FROM/TO instruction.
llIn the following exercise for the FX 2N -5A, the required configuration
and buffer memory settings are as follows.
11-6
M8002 In the case of input mode, set ″HFF00″
FNC79 K0 K0 HFF00 K1 (ch1/ch2 voltage modes are all set to
Initial pulse TO
be : ±10 V → ±32000)
(Only ON once after RUN) Unit BFM# Transfer source Transfer points
No. Transfer destination
Operation check
Use GX Developer to monitor D100,D101 and D100.
1) Rotate the knob of ch1/ch2 and confirm on the GOT screen that the value of [0 to 32000] is input.
2) Operate the GOT screen, designate the instruction value of the output within ±32000 and confirm
whether the voltage is output.
Voltage 10 V
[V]
5V
-32000 -16000 0 Digital value
16000 32000
5V
10 V
3) Application example
When X000 is set to ON, the ch1 volume input value (0 to 32000) can be used as the analog output
instruction (0 to 10 V output).
11
11-7
Reference
Buffer memory setting and contents
1) [BFM#0: Input mode setting]
Set ch1 and ch2 to be used in "Voltage input mode (±10 V → ±32000)". (Set value: HFF00)
• Setting method: Each digit of the 4-digit hexadecimal number is defined in the figure below.
( setting example )
H =0: voltage input mode (±10 V → ±32000)
ch1 =1: current input mode (4 mA-20 mA → 0-32000)
ch2 =F: does not use channel.
ch3
ch4
11-8
Efficient Execution of Ladder Programs
Chapter 12
LET'S LEARN THE PROGRAM FLOW
In this chapter...
In order to create programs for efficient execution, the major control instructions that
have a direct affect on the program flow for changing the sequence of program execution
will be explained in detail.
These control instructions include I/O refresh, jump instructions, subroutines, loop
instructions, and other important instructions.
This chapter will also examine the operation methods of the PLC.
12
12-1
12.1 I/O refresh instructions (REF)
The I/O processing mode for micro PLCs is known as a batch refresh mode. The information at all of
the input terminals (input ON or OFF) is stored into an input image memory prior to the operation of step
0.
After the END instruction (or the FEND instruction) is executed, the information is output from the output
image memory to the latch memory, and then simultaneously transferred from the latch memory to the
output terminals (See page 10-2.)
To acquire the latest input information during the sequence operation, or to output the result of the
operation as quickly as possible, the I/O refresh instruction can be used.
Operation outline
llThe entire sequence is divided into sections
Processing of all input information
(executed automatically) A and B. After sequence A is completed,
the sequence program proceeds with
0
output processing. Before the execution of
…
[B]
In a program where I/O processing is executed more than one time in a single operation cycle, the
operation result may differ between sequences A and B if the input has changed between ON and
OFF during the operation cycle. As in the above figure, if no interlock is provided on outputs Y000
and Y001, the outputs may be activated simultaneously.
12-2
12.2 Input filter adjustment instructions (REFF)
llGenerally, to avoid chattering and noise at the input contacts, the inputs of the PLC are equipped
with a 10 ms C-R filter. However, if the PLC uses non-contact inputs to avoid noise, the use of the
above-mentioned filter will just impede the execution of high-speed import.
llThe FX PLC adopts a digital filter for inputs X000 to X017 (X000 to X007 in 16-point type basic
units), and allows for the instructions to change values of the input filters between 0 to 60 ms.
However, since the inputs also have the smallest C-R filter, the minimum value varies between 5 µs
to 200 µs, depending on the model or the input terminal number.
llIn addition, the value of the input filter is changed to the minimum value in the processing of these
instructions if: an interrupt pointer is used, X000 to X007 are used with high speed counters, or the
FNC56 SPD instruction is used.
Operation outline
llFor general input processing, X000 to X017 use a
Processing of all input information
10 ms filter.
X000
0
10 ms filter
X001
1 ms filter
X001
20 ms filter processing".
X001
12-3
12.3 Jump instructions (CJ)
Operation outline
When the drive input is turned on, a jump I’m not going to do laundry...
Label
P0 Y002
Y003
Reference
Pointer numbers
ll The pointer numbers for each PLC model are as follows:
▪ FX1S : P0 to P62
▪ FX3U, FX3UC : P0 to P62
▪ FX1N, FX 2N, FX1NC, FX 2NC : P0 to P62
P64 to P4095
P64 to P127
▪ If “P63” is specified, the program jumps to END.
ll Lable numbers are also used by the CALL instruction described later. The numbers cannot be
overlapped.
12-4
Instruction operation
Let's confirm the execution of the jump instruction.
X000 When ON
0 FNC00 P0 1)
CJ When OFF
X002
4 Y000 2)
Label
P0 X003
6 Y001 3) Jump to Execute all
P0 of 3) the steps
Operation check
Use GX Developer to monitor the circuit.
2) Y000 turns on or off when X002 is turned 2) Y000 does turn on or off when X002 is turned
on or off. on or off.
(The program at 2) is skipped by the jump
3) Y001 turns on or off when X003 is turned on or instruction.)
off.
3) Y001 turns on or off when X003 is turned on
or off.
(During a jump to the label P0)
12
12-5
Operation of elements while a jump instruction is being executed
ON
…
M10 OFF
is deactivated.
X003
P30 RST T246 llIf the reset instruction for a retentive timer (T246 to
T255) is programmed after or before a jump instruction
is programmed, the reset instruction (e.g. to reset a
contact or clear a current value) can be executed even if
the coil of the retentive timer is skipped.
12-6
Functional principles of counters
X005 FNC00 llA general counter suspends counting when skipped
P40
CJ
by a jump instruction.
General counter
X006
C0 K10 llWhen a high speed counter (C235 to C255) starts
High-speed counter
counting, however, it will resume counting even when
M8000
C235 K100 its coil is skipped by a jump instruction. The output
contact will remain closed.
…
llAn applied instruction will not be operated or executed when skipped by a jump instruction.
However, the high-speed processing instructions from FNC52 to FNC58 and other applied instructions
will be executed intermittently
FNC52 : MTR FNC56 : SPD
FNC53 : HSCS FNC57 : PLSY
FNC54 : HSCR FNC58 : PWM
FNC55 : HSZ
12
12-7
Reference
Jump methods
[Jump to the same pointer]
ll The pointer number in the operands to the left
X020 FNC00
CJ P0 have the same number.
ll When X020 is ON, the program will jump to
…
label P0 from here. When X020 is OFF but
X021
FNC00
CJ P0 X021 is ON, the program will jump to label
P0 from CJ of X021.
…
cycle.
Label X000
Y000
P0
[Jump upward]
Label X023 ll Although it is possible to program the jump
Y021
P2 label at a step number lower than that of
its CJ command, if X024 is turned on for
…
Label
…
P3
12-8
12.4 Call subroutine instructions (CALL, SRET)
The CALL Subroutine instruction is an instruction to execute a subroutine program whithin the main
program.
A subroutine program can be a program that contains actions to be executed several times or a program
that executes only the necessary parts of an action.
Operation outline
llWhen the CALL instruction
is executed, the program will
…
Main program
FNC06
FEND ends
used including labels for CJ
instructions.
Label
P0 llGenerally, the I/O refresh
instruction is used before and 12
after a subroutine program.
Additionally, for timers in
FNC02
SRET
subroutine programs (as with
1) When X000 is "OFF", "Program A" will be executed. interrupt routine programs) it is
2) When X000 is "ON", "Program A" will be executed after the necessary to use the routine
subroutine program of "label P0" is executed.
3) When X001 is "OFF", "Program B" will be executed. timers T192 to T199, and 1 ms
4) When X001 is "ON", "Program B" will be executed after the
subroutine program of "label P0" is executed.
timers T246 to T249.
12-9
Instruction operation
Excute a subroutine program with a CALL instruction, and confirm the actions of the subroutine
program.
X002
0 FNC01 P0 1)
CALL
X003
4 Y000
6 FNC06
FEND
Label
P0
X004
7 Y001
FNC02
SRET
Operation check
Use GX Developer to monitor the circuit.
12-10
[CALL instruction nesting (multi-nesting) ]
If a CALL instruction is programmed within a subroutine , it is known as multi-nesting. This type of CALL
instruction can be programmed 4 times at most. i.e., fivefold nesting is allowed as a whole.
…
4) 2) If the CALL P2 instruction is executed in
FNC06
the subroutine program labeled as P1, the
FEND program will jump to label P2.
3) The second subroutine with label P2 is
Label executed. When the operation moves to
P1
the SRET instruction [B], the program will
Subroutine 1
FNC01 return to the next step of CALL P2.
P2
CALL 4) Similarly, when the operation moves to
SRET instruction [A], program will return
…
FNC02
SRET [B]
END
Reference
ll Actions of timers and counters in subroutine and interrupt routine programs…
If general timers are used in a subroutine or interrupt routine program, clocking is activated only
in the main program.
This is the same for counters. Generally, counters should not be used in subroutine or interrupt
routine programs. The actions of the timer and counter in a subroutine are the same as those
for the jump instruction. Refer to the previous pages.
ll Available pointer numbers differ as follows: 12
▪ FX1S : P0 to P62
▪ FX1N, FX 2N, FX1NC, FX 2NC : P0 to P62 ▪ FX3U, FX3UC : P0 to P62
P64 to P127 P64 to P4095
The program will jump to "END" if [p63] is
specified.
ll Label numbers are also used by the CJ instruction described previously. The numbers cannot
be overlapped.
ll In the P-SRET instruction, it is not allowed to use MC-MCR, STL-RET, I-IRET and another
P-SRET instructions for programming.
In addition, the P-SRET instruction cannot be used in MC-MCR, FOR-NEXT, STL-RET and
I-IRET instructions.
12-11
12.5 Loop instruction (FOR-NEXT)
The loop instruction is an instruction that executes program segments from a FOR instruction to a NEXT
instruction for n times and then executes the program content after the NEXT instruction.
When n is set to 1 to 32767 times, specifying "n = -32768 to 0" is equal to specifying "n = 1".
Operation outline
FNC08
llThe "sequence program 1) " is executed for
K5
FOR
K5 the specified number of times between the
Sequence program 1) FOR-NEXT instructions.
5 times
repetitive
FNC09 execution llAfter the repetitive execution for the
NEXT
specified number of times, the program
Sequence program 2) proceeds with the execution of "sequence
program 2) ", which is placed after the
NEXT instruction.
Reference
ll About nesting (multi-nesting)
When FOR-NEXT instructions are used between FOR-NEXT instructions for nesting programs,
fivefold nesting is allowed at most.
FOR FOR
FOR FOR
1
fold
FOR NEXT
3
1 2 3 fold
fold fold fold
NEXT FOR
2
fold
NEXT NEXT
NEXT NEXT
If the numbers for the FOR and NEXT are not identical, an error may occur.
12-12
Instruction operation
Use FOR-NEXT instructions and confirm the actions of the program.
X000
0 FNC01 P0 1)
CALL P
3)
14 FNC08 K4
FOR
Execute repetitively for 4 times
M8000
17 FNC20 D2 K1 D2
ADD D2+1 D2
ON during RUN
(counting the number of times of
FOR-NEXT execution)
26 FNC09
NEXT
FNC
SRET
Operation check
Use GX Developer to monitor the circuit.
12-13
MEMO
12-14
You can be a professional!
Chapter 13
SUMMARY OF THE POINTS
There are differences in the operating principles between PLCs and relay boards.
However, there are many users who do not recognize these differences. To fully master
PLC programming, it is essential to understand the differences.
In this chapter…
The operating principles of PLCs will be summarized, along with auxiliary relays,
timers, and the role of the battery.
After reviewing all topics and confirming your knowledge of the points that have been
covered, you will take the first step toward becoming a professional sequence circuit
designer.
13
13-1
13.1 Input/output process for the PLC
image
memory
If an input changes its status during
the execution of a program, the input
image memory does not change its
contents at that time. Instead, the
X change will be read in the next input
process cycle.
ll Process of program
The PLC reads the ON/OFF
statuses of required elements from
2) Read out Process of program
the input image memory or other
X000
element's memory, in accordance
Y000 with the contents of the instructions
3) Write in
stored in the program memory.
4) Read out
Image Hence, the image memory of each
Y000
M100 memories for element can sequentially change
5) Write in each device
its content in accordance with the
progress of the program.
Y, M, S
T, C
(The time required to perform one complete
Repetitive operation
ll Output operation
cycle is referred to as the scan time)
Output Y002
latch represent the physical outputs.
memory
13-2
13.2 Response delay for Input/Output
There are not only electrical delays from input filters (approx. 10ms) and mechanical response delays
from output relays (approx. 10ms), but there is also a response delay due to the affect of the scan
time.
For example, assume that input X000 changes from OFF to ON just after the input process is finished,
as shown in the sequence circuit below. (Note: the input switch changes to ON approximately 10 ms
before the process is monitored.)
X000=OFF ON
Y000
Y002 Y002 image memory OFF OFF ON
X000
Y000 Y000 image memory OFF ON ON
Y000
Y001 Y001 image memory OFF ON ON
OFF ON ON
Y000 output
OFF ON ON
Output operation Y001 output
OFF OFF ON
Y002 output
As shown above, Y000 and Y001 may have up to a 2-cycle response delay. (The output contact will
be ON approximately 10 ms later.)
Y002 is energized 1 cycle later, since the contact Y000 which drives Y002 is programmed before
X000.
13
Reference
Countermeasures against I/O response delay
There is an application instruction (Refresh FNC50 REF) which can perform input or output
processing during the program execution. For transistor type output terminals, the response
relay for the output is 0.2 ms or less. Additionally, for inputs X000 to X007, there are applications
instructions (Refresh and filter adjust FNC51 REFF) that can be used to reduce the response delay
by filtering the inputs within the program.
13-3
13.3 Dual output operation
Output operation
Y003 = OFF Y004 = ON
As previously described, if dual output (double out) is performed, the latter content overrides the former.
Reference
Direct I/O Mode
There are PLCs which perform I/O processes at the same instant that the instructions are
executed (direct I/O mode).
In this case, the output responses for inputs become faster, but the action for dual output is
different.
In addition, for the following circuit, Y035 and Y036 may change to ON at the same time.
X003 1) Assume that X003 = ON when executing this circuit. Thus, Y035
Y035
is energized.
X003 2)
Y035 If X003 is not changed until executing this line of code, Y035
may become de-energized. Hence, Y035 can be ON or OFF,
which may cause problems for the dual output during the scan
time.
13-4
13.4 No limitation on the number of contacts
Since the PLC can use the contents of image memories for each element as many times as needed,
there is no limitation to the numbers of N.O. and N.C. contacts.
However, there is a limitation on the program capacity for series and parallel contacts. Other
limitations include the display area of the graphic programming panel and the number of printed
characters that can be included on a single line.
llAt the maximum, 11 contacts and 1 coil (in the case for timers or counters, 10 contacts and 1 coil)
can be included in a single line on the GPP.
The number of lines running in parallel from a single relay must be 24 or less.
llIt is recommended that each line include no more than 10 contacts and 1 coil and that lines be
limited to 5 or less, in order to easily display them on the GPP.
If this programming method is followed, 1 circuit block with comments can be displayed on a single
display area.
Reference
Narrow pulses are not detectible
OFF ON ON OFF
13
Output Input Time flow Cycle time
operation operation
In principle, the widths of input pulses (ON and OFF inputs) for a PLC must be longer than the cycle
time of the PLC.
When the response delay of the input filter, 10 ms, is taken into account, the time durations for ON
and OFF inputs must be 20 ms at the shortest, if the cycle time is 10 ms.
Hence, input pulses with frequencies of more than 25 Hz (= 1000 / (20 + 20)) cannot be read normally.
However if a special function or application instruction is used, these signals can be detected.
13-5
13.5 The role of the battery
The PLC incorporates a non-rechangeable lithium battery which provides backup utility for auxiliary
relays, states of devices in the ladder instructions, timers, and counters as well as the backup of
program memory during power failure.
Moreover, some PLCs without a built-in battery are latched by EEPROM memory.
X000=ON(Left limit)
→ M500(Right drive command)=ON Relays from M500 are backed
→ Power failure up with the battery, and often
Reciprocating motion table
Motor with brake → Positioning table stops halfway referred to as latched (battery
→ Restart(M500=ON) backed) relays.
X001
→ X001=ON(Right limit)
X000
M500 Right drive → M500=OFF, M501=ON
M500 command
→ Left drive
X001 X000
M501 Left drive
M501 command
13-6
13.6 Timers and their accuracy
Each timer in a PLC begins timing when its drive contact is closed, and its output contact is activated
after the timer reaches its set value.
Timekeeping
Contact is not activated at this point
X002 T0
T0 X002 = OFF ON Contact's
K12 Clocking start action
1.2
seconds
elapsed
T0 Y002
Y002 ON
Hence, the approximate accuracy of a timer contact can be expressed with the following formula:
T
+T0
-α α : 0.01 for 10ms timer, 0.1 for 100 ms timer (seconds)
T : Set time of timer (seconds)
T0 : Scan time (seconds)
In the worst case, if the timer drive contact is programmed prior to the timer coil, the accuracy becomes 2T0. If
the set value of the timer is 0, the output contact will be activated at the next execution of the coil instruction.
Reference
Details on timer operation
ll For 10 ms and 100 ms timers, the time is measured at each execution of the coil instruction,
and when it reaches a set value, the output contact is energized. However, in the case where
a 10 ms timer is used in a program with a scan time of 30 ms, the following procedures are
carried out.
10ms
Clock ll There is a timer correction register, 13
which stores the previous scan time,
Scan time in the PLC.
END END
13-7
MEMO
13-8
For further understanding!
Appendix
In this appendix...
The applied instructions, special auxiliary relays and special data registers that have
been described in this textbook are arranged in lists.
In addition, the contents of the parameter settings are included. Set them when
necessary.
A-1
Appendix 1.1 Application instruction list
The application instructions for the Micro PLCs are listed in the following tables.
Handy Instruction
08 FOR Start a FOR/NEXT Loop 63 INCD Incremental Drum Sequencer
09 NEXT End a FOR/NEXT Loop 64 TTMR Teaching Timer
10 CMP Compare 65 STMR Special Timer
11 ZCP Zone Compare 66 ALT Alternate State
12 MOV Move 67 RAMP Ramp Variable Value
Move and Compare
35 SFTL Bit Shift Left 103 ZPOP Batch POP of Index Register
36 WSFR Word Shift Right 110 ECMP Floating Point Compare
37 WSFL Word Shift Left 111 EZCP Floating Point Zone Compare
Shift Write
38 SFWR 112 EMOV Floating Point Move
[FIFO/FILO Control]
Shift Read Floating Point to Character
39 SFRD 116 ESTR
[FIFO Control] String Conversion
Character String to Floating
40 ZRST Zone Reset 117 EVAL
Point Conversion
41 DECO Decode Floating Point to Scientific
42 ENCO Encode 118 EBCD
Notation Conversion
Data Operation
Floating Point
51 REFF Refresh and Filter Adjust 126 LOG10 Floating Point Common Logarithm
52 MTR Input Matrix 127 ESQR Floating Point Square Root
53 HSCS High Speed Counter Set 128 ENEG Floating Point Negation
54 HSCR High Speed Counter Reset 129 INT Floating Point to Integer Conversion
A-2
Applicable PLC Applicable PLC
Classification
141 WTOB WORD to BYTE 214 SFL Bit Shift Left with Carry
142 BTOW BYTE to WORD 224 LD= Load Compare (S1) = (S2)
143 UNI 4-bit Linking of Word Data 225 LD> Load Compare (S1) > (S2)
144 DIS 4-bit Grouping of Word Data 226 LD< Load Compare (S1) < (S2)
147 SWAP Byte Swap 228 LD<> Load Compare (S1) ≠ (S2)
149 SORT2 Sort Tabulated Data 2 229 LD<= Load Compare (S1) (S2)
150 DSZR DOG Search Zero Return 230 LD>= Load Compare (S1) (S2)
232 AND= AND Compare (S1) = (S2)
Positioning Control
Data Comparison
161 TZCP RTC Data Zone Compare 242 OR< OR Compare (S1) < (S2)
162 TADD RTC Data Addition 244 OR<> OR Compare (S1) ≠ (S2)
163 TSUB RTC Data Subtraction 245 OR<= OR Compare (S1) (S2)
164 HTOS Hour to Second Conversion 246 OR>= OR Compare (S1) (S2)
165 STOH Second to Hour Conversion 256 LIMIT Limit Control
Inverter Communication Data Table Operation
166 TRD Read RTC data 257 BAND Dead Band Control
167 TWR Set RTC data 258 ZONE Zone Control
169 HOUR Hour Meter 259 SCL Scaling (Coordinate by Point Data)
170 GRY Decimal to Gray Code Conversion 260 DABIN Decimal ASCII to BIN Conversion
171 GBIN Gray Code to Decimal Conversion 261 BINDA BIN to Decimal ASCII Conversion
176 RD3A Read form Dedicated Analog Block 269 SCL2 Scaling 2 (Coordinate by X/Y Data)
177 WR3A Write to Dedicated Analog Block 270 IVCK Inverter Status Check
External ROM Function 271 IVDR Inverter Drive
180 EXTR
(FX2N/FX2NC) 272 IVRD Inverter Parameter Read
182 COMRD Read Device Comment Data 273 IVWR Inverter Parameter Write
184 RND Random Number Generation 274 IVBWR Inverter Parameter Block Write
Others
186 DUTY Timing Pulse Generation 278 RBFM Divided BFM Read
*3
188 CRC Cyclic Redundancy Check 279 WBFM Divided BFM Write
189 HCMOV High Speed Counter Move High Speed Counter
280 HSCT
Extension File Register Control *4
A-3
Appendix 1.2 Main special device list
Special devices are used to operate the built-in PLC functions that are factory prepared and ready to
use. There are special auxiliary relays and special data registers.
The following tables list the main special devices for FX PLCs.
ll PC status
Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC
RUN monitor NO D 8000 Watchdog timer 200 ms 200 ms 200 ms 200 ms 200 ms 200 ms 200 ms
[M]8000
contact PLC type and
[D]8001 22 26 24 24 26 24 24
RUN monitor NC system version
[M]8001
contact PLC type and
[D]8101 16 16
Initial pulse NO system version
[M]8002
contact
Initial pulse NC [D]8002 Memory capacity In the case of 16 K steps or more, D8002 becomes "K8"
[M]8003
contact while "16" and "64" are input to D8102.
[M]8004 Error occurrence [D]8003*2 Memory type
[D]8004 Error number M
[M]8005 Battery voltage low
[D]8005 Battery voltage
[M]8006 Battery error latch Low battery voltage
[D]8006
detection level
Momentary power
[M]8007*1 Momentary power
failure [D]8007
failure count
Power failure
[M]8008 *1
Power failure
detected D 8008*2
detection
[M]8009 24V DC down [D]8009 24V DC failed device
*1: Changes of the power failure detection (D8008) *2: Contents of the memory type
ll Clock
Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC
[M]8010 [D]8010 Present scan time
[M]8011 10 ms clock pulse
[D]8011 Minimum scan time The indicated value includes the waiting time of the constant
[M]8012 100 ms clock pulse
[D]8012 Maximum scan time scan driven by M8039 as well.
[M]8013 1 sec clock pulse
[M]8014 1 min clock pulse D 8013 Second data
Clock stop and D 8014 Minute data
M 8015
preset
Time read display is D 8015 Hour data
M 8016
stopped D 8016 Day data
±30 seconds
M 8017 D 8017 Month data
correction
[M]8018 Installation detection (Always ON) D 8018 Year data
Real time clock Day-of-the-week
M 8019 D 8019
(RTC) error data
The time data of D8013 to D8019 is latched (battery-backed). In addition, D8018 (year data) can be switched
to a four-digit year mode from 1980 to 2079.
ll Flag
Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC
[M]8020 Zero Input filter
D 8020
adjustment
[M]8021 Borrow
M 8022 Carry [D]8021
[M]8023 [D]8022
BMOV direction
M 8024
specification [D]8023
M 8025 HSC mode
M 8026 RAMP mode [D]8024
M 8027 PR mode [D]8025
100 ms/10 ms timer
M 8028 [D]8026
changeover
Interrupt permission
M 8028 during FROM/TO [D]8027
instruction execution Value of Z0 (Z)
Instruction execution [D]8028
[M]8029 register*3
complete
A-4
ll PC mode
Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC
M 8030*4 Battery LED OFF Value of Z0 (Z)
[D]8030
Non-latch memory register
M 8031*4 Value of analog
all clear [D]8031
Latch memory all volume
M 8032*4
clear [D]8032 NA
M 8033 Memory hold STOP [D]8033 NA
M 8034*4 All outputs disable NA
[D]8034
M 8035*5 Forced RUN mode
[D]8035 NA
M 8036*5 Forced RUN signal
[D]8036 NA
M 8037*5 Forced STOP signal
[M]8038 Parameter setting [D]8037 NA
M 8039 Constant scan mode [D]8038 NA
*4: Processed when END instruction is executed. *5: Cleared when switching from RUN to STOP
ll Error detected
Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC Number Name FX1S FX1N FX 2N FX3U FX1NC FX2NC FX3UC
I/O configuration The first device
[M]8060 [D]8060 number of
error
unconnected I/Os
[M]8061 PLC hardware error Error code for PLC
[D]8061
hardware error
PLC/PP Error code for PLC/
[M]8062
communication error [D]8062 PP communication
Serial error
[M]8063 communication error Error code for serial
1 [ch1]*6 [D]8063 communication error
1 [ch1]
[M]8064 Parameter error
Error code for
[D]8064
parameter error
[M]8065 Syntax error Error code for syntax
[D]8065
error
[M]8066 Ladder error Error code for ladder
[D]8066
error
[M]8067 Operation error*6 Error code for
[D]8067
operation error
Operation error step
M 8068 Operation error latch D 8068
number latched
Error step number of *9 *9
M 8069 I/O bus check*7 [D]8069
M8065 to M8067
Y number where
*10 *10
[M]8109 Output refresh error [D]8109 output refresh error
occurs
*6: Cleared when PLC switches from RUN to STOP. Note that M8068 and D8068 are not cleared.
*7: If M8069 is activated, the I/O bus check is executed. When an error occurs, the error code 6103 or
6104 is written to D8061, and M8061 is turned on. However, if 6104 is written to D8061, M8009 is also
turned on and the I/O numbers of the units whose 24 VDC supply is OFF are written to D8009.
*8: When the units and blocks with the programmed I/O numbers are not mounted, M8060 operates and
the first element numbers are written to D8060.
*9: Stored in D8312, D8313 if there are 32 K steps or more.
*10: Stored in D8314, D8315 if there are 32 K steps or more.
A-5
Appendix 1.3 Supplement of special devices
This section explains how to use the provided special devices to activate the built-in PLC functions for
additional program control.
M8000 ON ON
M8001 ON
NC
1 scan time
M8002 ON ON
Initial pulse (NO contact)
M8003 ON ON
Initial pulse (NC contact)
M8000 ON ON
M8001 ON
NC
1 scan time
M8002 ON ON
Initial pulse (NO contact)
M8003 ON ON
Initial pulse (NC contact)
A-6
2. Watchdog timer [D8000]
The watchdog timer monitors the operation (scan) time of the PLC. When the operation is not
completed within the specified time, ERROR (ERR) LED light turns on and all outputs are turned
OFF. When the power is initially turned ON, "200 ms" is transferred from the system to D8000
as the default value. For executing a program beyond 200 ms, the contents of D8000 must be
changed by the user program.
ll Example program
M8002
0 FNC 12 K300 D8000 Setting value of watchdog timer is set to "300 ms."
MOV
Initial pulse
FNC 07 The watchdog timer
WDT When WDT (FNC 07) instruction is not programmed, the
value stored in D8000 is not valid until END processing.
A-7
3. Battery voltage low detection [M8005 and M8006]
This special device detects low voltage in the lithium battery for memory backup.
When the PLC detects low battery voltage, BATT (BAT) LED light turns on. The following program
demonstrates its use.
ll Example program
M8005
0 Y001 "Battery voltage low"
Battery
voltage low M8006 latches the battery voltage low.
A-8
6. Internal clock [M8011 to M8014]
The PLC has the following four types of internal clocks which are always oscillating while the PLC
power is ON.
10ms
100Hz
Caution:
M8011 Even while the PLC is in the STOP mode, these clocks are always
(10ms) 100ms 10Hz oscillating.Therefore, the rising edge of the RUN monitor (M8000)
does not synchronize with the clock start timing.
M8012
(100ms) 1s 1Hz
M8013
(1 sec) 1min
M8014
(60 sec)
A-9
8. Input filter adjustment [D8020]
The inputs X000 to X017*1 have a digital filter circuit with a setting range of 0 to 60 ms. The digital filter
setting value is set between 0 to 60 ms (in 1 ms steps) in special data register D8020. After PLC powers
ON, D8020 is automatically set to K10 (10 ms).
Input
terminal Filter
X000 0ms 0
1ms 1
Determined by the contents of D8020 (initial value: 10)
10 Input refresh
10ms
X017 *1
Image
60ms 60 memory
*1 When setting the input filter to "5 µs" or when receiving pulses whose response frequency is 50 k
to 100 kHz using high speed counters, perform the following:
- Input wiring length should be 5 m (16' 4") or less.
- Connect a bleeder resistor (1.5 kΩ, 1/2 W) to an input terminal. The load current of the open
collector transistor output in the device on the other end should be 20 mA or more including the
input current of the PLC.
*2 X000 to X007 in the FX3U-16M
●● The input filter constant can be changed as many times as needed in the user program.
●● This input filter adjustment described here is not required when using high speed counter, input
interrupt, or pulse catch (M8170 to M8175) functions.
A-10
9. Battery [BATT (BAT)] LED OFF command [M8030]
ll Batteryless operation
When M8030 is set to ON, the battery LED does not turn ON even if the voltage in the battery
for memory backup becomes low.
When the indication of "battery voltage low error" is not required or when the battery is removed,
set M8030 to ON.
When the batteryless operation is required, however, do not use M8030 but refer to "2. Parameter
setting in peripheral equipment" below.
ll Parameter setting in peripheral equipment
Specify "batteryless operation" mode in the parameter settings.
1) When the batteryless operation option is specified
When "batteryless mode" is specified, the control to turn OFF the BATT (BAT) LED and
initialization of the latch area for the devices shown below are automatically executed by
the PLC system.
- Auxiliary relay (M) - Counter (C) - State relay (S)
- Data register (D) - Timer (T) - Extension data register (R)
2) Applicable programming tool
Some programming tool versions do not support "batteryless mode." In such versions, input
a sequence program to enable the batteryless operation as explained below.
ll Conditions for batteryless operation
1) An FLROM (optional memory cassette) for program memory is installed so that programs
are not erased.
2) The latch (battery backed) devices such as auxiliary relays and data registers are not used
for control.
3) The sampling trace function is not used.
4) The real time clock function is not used.
ll Example program for batteryless mode
When a parameter setting for "batteryless mode" is not available, create the sequence program
shown below.
●● Example program for clearing the memory backup area
{when the latch (battery backed) ranges in the parameter settings are set to their initial
values.}
M8000 M8000
M8030 BATT(BAT) LED turns OFF. or M8030 BATT(BAT) LED
RUN monitor RUN monitor turns OFF.
M8002 FNC 40 M500*1 M7679 M8002
Auxiliary relay M8032 The latch areas
ZRST are cleared.
Initial pulse Initial pulse
FNC 40 S500* 1 S4095
ZRST State relay
A-11
10. Clear command [M8031 and M8032]
For all devices (image memory) in the PLC, the latch (battery backed) areas and non-latch areas
can be cleared.
M8031 (non-latch memory all clear), M8032 (latch memory all clear)
Device number Cleared devices
• Contact image of output relay (Y), general type auxiliary relay (M), and
general type state relay (S)
M8031 • Contact and coil of timer (T)
(non-latch memory • Contact, counting coil, and reset coil of general type counter (C)
all clear) • Present value of general type data register (D)
• Present value register of timer (T)
• Present value register of general type counter (C)
• Contact image of latch (battery backed) type auxiliary relay (M) and latch
(battery backed) type state relay (S)
• Contact and coil of retentive type timer (T)
M8032 • Contact, counting coil, and reset coil of latch (battery backed) type counter
(latch memory all and high speed counter
clear) • Present value of latch (battery backed) type data register (D)
• Present value register of retentive type timer (T) and 1-ms timer (T)
• Present value register of latch (battery backed) type counter and high
speed counter
ll Example program
Command
input
M8033 Outputs are retained even during STOP mode.
For example, when a heater is driven by the PLC, the PLC can be stopped while the heater and
other
equipment are kept driven, and then the PLC can be started again after program changes.
ll Example program
Command
input
M8034 All outputs are disabled (image RUN status).
A-12
13. Individual operation for RUN/STOP input [M8035 to M8037]
When using external push button switches to control the PLC's RUN/STOP mode, operate the
switches using the following procedure.
The PLC enters RUN mode by one-shot input of the RUN switch, while one-shot input of the
STOP switch drives the STOP mode.
ll Example program
The figure on the left shows an example
RUN STOP of FX3U PLC (sink input).
ll Setting method
1) Turn the built-in RUN/STOP switch to STOP.
2) Specify the RUN input switch, input (X) (X000 is specified in the above circuit diagram
example.)
Make the external RUN/STOP input valid by specifying an input between X000 and X017*1
for the RUN input signal.
*1. X000 to X007 in the FX3U-16M
a) Display the parameter setting in the programming tool
In GX Developer case, double-click [Parameter] - [PC parameter] in the project tree to display the
dialog box.
Click "PLC system (1)" tab, and set "RUN terminal input."
b) Specify the input (X) number to switch from STOP mode to RUN mode.
3) Specify the STOP switch input (X)
Specify an arbitrary input terminal (actual I/O on the PLC) in the sequence program.
Refer to the above program.
4) Transfer the program and parameters to the PLC.
5) For the parameter settings to become valid, the PLC power must be turned from OFF to ON.
ll Cautions
1) When both RUN and STOP switches are pressed at the same time, priority is given to the
STOP switch.
2) When the built-in RUN/STOP switch is turned to RUN, the PLC can be set to RUN mode.
However, when the STOP switch assigned to an arbitrary input is activated, the PLC will
enter STOP mode. (Even if the built-in switch is turned to RUN, priority is given to the
STOP command.) A
A-13
ll RUN/STOP command via the programming tool
1) Using the programming software for personal computer
There is a remote RUN/STOP function in the programming software.
By using the programming software, the PLC can be set to the RUN or STOP mode by
giving a command from the personal computer.
2) Using any other programming tool
When M8035 (forced RUN mode) and M8036 (forced RUN signal) are set to ON in the
forced ON/OFF procedure, the PLC begins RUN mode.
When M8037 (forced STOP signal) is set to ON, the PLC changes to STOP mode.
3) Even when the built-in RUN/STOP switch is on the RUN side of the PLC.
The remote STOP command via the programming tool or M8037 (forced STOP signal) are
valid.
14. Constant scan mode [M8039 and D8039](Averaging the scan time)
When the special auxiliary relay M8039 is set to ON and a setting value for the constant scan time
(in 1-ms units) is stored in special data register D8039, the scan time in the PLC does not become
shorter than the value stored in D8039.
The PLC pauses for the remaining time when the operation ends earlier, and then returns to step 0.
ll Example program
M8000
M8039 Constant scan mode
RUN
monitor FNC 12 K 20 D8039 The constant scan time is set to 20 ms.
MOVP
ll Cautions
1) When using an instruction executed in synchronization with a scan
a) W hen using an instruction executed in synchronization with a scan such as RAMP
(FNC 67), HKY (FNC 71), SEGL (FNC 74), ARWS (FNC 75) and PR (FNC 77), it is
recommended to use the constant scan mode or to use the instruction in a timer
interrupt program.
b) When using HKY (FNC 71) instruction
It is necessary to use a scan time of 20 ms or more due to the response delays of the
key input filter.
2) Scan time display (D8010 to D8012)
The scan time specified in the constant scan time is included in the scan time display
stored in D8010 to D8012.
A-14
Appendix 1.4 Types and setting of parameters
Specifying parameter settings means setting the environment where the PLC operates.
Almost all FX3U/FX3UC PLCs can be used with factory default values. When it is necessary to add
optional memory, set the comment capacity, set the communication condition for serial ports, etc.,
change the parameter settings by a programming tool such as personal computer.
ll Parameter list
The following items may be set in the parameter settings.
Classification Item Description
This parameter specifies the maximum value for the number of steps to which a
sequence program can be input.
Memory 1) The upper limit is determined by the capacity of the built-in memory or optional
capacity memory.
2) The program memory, file register, comment area, and other special setting
capacities are contained in this memory capacity.
This parameter incorporates comments into the program memory.
1) Because comments remain in the PLC, the contents can be easily understood at
Comment the time of maintenance.
area 2) Up to 50 comments can be input when one block is specified, but the program
memory capacity is reduced because the comment area requires 500 steps in the
memory capacity.
Memory This parameter incorporates data registers into the program memory.
capacity 1) A sequence program and control data such as machining set values can be handled
File register 2) together, which is convenient.
Up to 500 file registers can be created when one block is specified, but the program
memory capacity is reduced because file registers require 500 steps in the memory
capacity.
1) This parameter sets whether or not the special block/unit initial value setting
function is used.
When this function is used, the program memory capacity is reduced because this
Other special function requires 4000 steps (8 blocks) in the memory capacity.
setting 2) This parameter sets whether or not the positioning setting (constants and setting
capacity table) in TBL (FNC152) instruction is used. When this setting is used, the program
memory capacity is reduced because this setting requires 9000 steps (18 blocks) in
the memory capacity.
Latch range This parameter enables to change the latched (battery backed) device range and the
Device setting setting non-latch device range inside the PLC.
I/O This setting is not written to the PLC.
assignment When the I/O range is set according to the system configuration, however, inputs and
I/O assignment setting outputs are checked by the program check in GX Developer.
setting
Special unit This parameter sets the initial values of the buffer memory (BFM) for each special
block/ unit number.
setting It is necessary to set the memory capacity.
This parameter sets the PLC operation mode without a battery.
Batteryless When the baterryless mode is set, detection of battery voltage low level error is
mode stopped automatically, and consequently, contents of latched (battery backed) devices
becomes inconsistent and are initialized automatically.
PLC system Modem This parameter automatically sends a specified AT command as an initialization
setting (1) initialization command to a modem connected to the serial port.
[PLC mode]
RUN terminal This parameter sets whether one input terminal in the PLC is used for RUN input.
input setting
RUN terminal This parameter specifies the input number of the RUN input described above within
input number the range from X000 to X017.
This parameter corresponds to the following settings by specifying each contents on
PLC system Serial port the PC screen:
setting (2) operation Setting of communication format (D8120, D8400 and D8420)
[Serial setting Setting of station number (D8121 and D8421)
communication] Setting of timeout check (D8129, D8409 and D8429)
This parameter sets interrupt inputs for the maximum speed, bias speed, creep speed,
Constant zero return speed, acceleration time, deceleration time, and DVIT instruction.
Positioning setting It is necessary to set the memory capacity.
setting
Detailed This parameter sets the operation table. A
setting It is necessary to set the memory capacity.
This parameter sets protection to prevent erroneous writing and plagiarism of a
sequence program. The entry code can be specified in 8 hexadecimal characters
Entry code among A to F and 0 to 9.
Others In FX3U and FX3UC PLCs Ver.2.20 or later, the second entry code (in 8 characters)
can be added to allow specification of the entry code in 16 characters.
Program title This parameter enables to set a character string to be used as the program title.
A-15
Appendix 2 PLC GlOSSARY
each step.
A
ADDRESS C
Location in memory where data is stored in the PLC.
CLEAR
Addresses in program memory are called step numbers.
(1) Refers to initializing display of a programming panel.
(2) Refers to clearing the current value of a counter and
ALLOWABLE MOMENTARY POWER FAILURE
timer to zero.
PERIOD
Refers to the maximum time that the PLC can continue
CODING
normal operation during a power failure.
Refers to rewriting sequence circuits in a set instruction
This time is 10ms for FX series PLCs.
language to make an instruction list.
Instructions on this list are stored in PLC's program
ANALOG memory.
Refers to a signal that varies over continuous range and
that cannot be represented clearly in numerical values
COMMENT
(digital values).
This refers to details users can add to elements and circuit
Pressure, temperature, voltage, current, time, etc. are
blocks in ladder diagram.
examples of ANALOG.
ANALOG TIMER
Refers to a timer that calibrates time with volume. FX-8AV
volume input adapter is available to use.
On the other hand, there are timers that are incorporated
inside PLCs that are set with key operation of the COMMON
programming panel. Refers to common terminals.
These timers sometimes are called soft timers. All inputs to a PLC are passed through common terminals,
and outputs are passed through 4-point terminal or
AND independent.
Refers to serial connection of N.O. contacts in PLC
programs.
AND INVERSE
Refers to serial connection of N.C. contacts in PLC
programs.
B
BATCH I/O PROCESSING SYSTEM
Refers to a system where all input signals to a PLC are CONTACT OUTPUT
stored in the image memory. This data is then processed, This refers to an output terminal in the PLC. This is also
and the results are output. known as Relay output.
The other type of I/O system called direct I/O system where When applying large current or performing frequently-
I/Os are performed every time an instruction is executed. conducted operation, service life of the contacts is
shortened.
BATTERY BACKUP
At power failure, data in program memory, counters, and COUNTER
some sub relays in a PLC are retained via battery back up. Refers to a device that counts how many pulse inputs are
supplied to its input and closes a contact when the
BIT accumulated count reaches the set value.
The smallest unit of data stored. 1 bit can be 0 (OFF) or 1
(ON). For example, 3-bit data can be 8 different information: CPU (CENTRAL PROCESSING UNIT)
000, 001, 010, 011, 100, 101, 110, 111. CPUs are the brains of PLCs, therefore they are the
important component in a PLC.
BYTE As hardware, a CPU is an ultra micro scale integrated
A unit of data stored that is equivalent to 8 bits. circuit (UMSI) which includes a microcomputer and
Instructions provided by the FX series PLCs use 2 bytes for memory.
A-16
CURRENT VALUE END
Refers to the current value of changing number in a timer or Refers to an instruction that is written at the end of a
counter. program indicating that there are no more instructions in a
For example, in a timer with 10 seconds set as a set value, program.
a current value increments from 0 in steps of 1 to 10 Note: the END instructions take extra time for I/O
seconds. The output contact of this timer is closed when a processing before completing execution of the program.
current value reaches 10 seconds.
EPROM
CYCLIC OPERATION METHOD (ERASABLE AND PROGRAMMABLE
Refers to the operation system where a program executes READ ONLY MEMORY)
all of its steps and repeats steps from 0 step after the last A type of memory exclusively used for reading. Stored data
step has been executed. in an EPROM is not lost at power failure.
If an operation cycles short, it appears that control A ROM writer or ultraviolet eraser (eraser) is used to write
operations are batch-made as seen with relay panels. to an EPROM.
D ERASER
Refers to devices that delete programs stored in an EPROM
DEBUG
(ultraviolet eraser).
Refers to correcting errors in a program.
ERROR CODE
DEVICE
Refers to classification numbers that identify the cause of
Refers to elements used in a program, such as relays,
an error that occurred in PLC programs.
timers, and counters in a PLC.
Also see ELEMENT NUMBER
EXTENSION MODULE,
EXTENSION BLOCK
DIGITAL
Expansion modules and blocks are used in combination
Refers to amount that can be clearly represented by
with a base unit. Relays within these produces only input
numerical values, such as ON (1), OFF (0), and other
and output relays.
numerical values (i,e, 1, 2, 3, 4 ...).
Expansion modules are also equipped with an internal
powersupply circuit.
DIRECT SYSTEM
Refers to one of PLC's operation systems, which carries out
EXTERNAL POWER SUPPLY
I/Os immediately after an instruction is executed.
Refers to a power supply that feeds a PLC or a load. Also
refers to a power supply located outside a PLC to feed
DOCUMENTATION
sensors.
Refers to paper documents. Examples of PLC-related paper
PLCs are fed by an external power supply and create a
records are circuit diagrams, instruction lists, and so on.
power supply of 5VDC, 12VDC, or 24VDC.
These direct current power supplies are called internal
DOWNLOAD power supply.
Refers to writing and transferring programs from an
A6GPP/PHP or HPP (off line mode) to a PLC. The reverse
F
of this process is known as upload.
FA (FACTORY AUTOMATION)
E Refers to automating various operation of electric devices
conducted in a factory.
EEPROM OA stands for Office Automation.
(ELECTRICALLY ERASABLE AND PROGRAMMABLE HA stands for Home Automation.
READ ONLY MEMORY)
A type of memory exclusively used for reading. Stored data
in an EEPROM is not lost at power failure.
FMS (FLEXIBLE MANUFACTURING SYSTEM)
A
Refers to a system that automates production procedures
(Writing program to an EEPROM from a programming
on high-mix/low-volume production.
panel is possible but takes longer than writing to RAMs).
FORCED ON/OFF
ELEMENT NUMBER
Refers to forcing on or off each device by using keys on a
Refers to numbers assigned to elements (devices) in a PLC,
programming panel along with sequence operation.
such as relays, timers, and counters.
A Forced ON/OFF instruction is enabled for one operation
A-17
cycle. IMAGE MEMORY
This characteristic is well suited for the followings. Refers to memory that stores ON/OFF status of PLC I/Os,
(1) Output relays or sub relays that are closed or opened sub relays, timers, counters, etc.
according to the self-maintaining action or set instructions. At power failure, image memory is partially retained via the
(2) Timer and counter battery.
Note that this instruction works for output relays not having
a self-maintaining circuit or set instructions as long as a INDUCTIVE LOAD
PLC is at stop. Refers to a load that generates surge voltage if applied
This is usable in test mode operation. current is shut off. Coils (winding wire) are inductive loads.
Other types of loads are resistance loads (generates no
G surge voltage), capacitive loads (generates inrush current),
and so on.
GPP (GRAPHIC PROGRAMMING PANEL)
A device that allows users to write sequence programs, INITIAL
create lists, and perform monitoring on a CRT display. Refers to an initial state.
It also enables programs to be transferred to floppy disks For example, all output Ys are initially off at power-on of a
and EPROMs. PLC.
Another example of an initial set operation is when a
H PLC starts running, it generates initial pulses to initialize
counters.
H/W (HARDWARE)
A general term for equipment that physically exist.
INPUT DEVICE
In PLC fields, hardware means PLCs. Hardware cannot run
Refers to operational devices or detectors such as
without software.
pushbutton switches, limit switches, selector switches,
proximity switches, photoelectric switches. Input devices
HARD COPY
are connected to an input
Refers to sequence programs or sequence circuit diagrams
Refers to operational devices or detectors such as
printed on paper. Printers are available for preparing hard
pushbutton switches, limit switches, selector switches,
copies.
proximity switches, photoelectric switches. Input devices
are connected to an input terminal of a PLC.
HIGH-SPEED COUNTERS
Refers to counters with a special input terminal. With
INPUT IMPEDANCE
special terminals, these counters can obtain pulses of
Refers to the equivalent resistance value of a PLC's input
10KHz or less. Counting proceeds in reaction to sequence
circuit.
operation and interrupt pulses. Generally, standard
Value of the input current is obtained by dividing an input
counters incorporated in a PLC only count pulses of 20 to
voltage with this value.
30Hz.
INPUT VOLTAGE
HPP (HANDY PROGRAMMING PANEL)
Refers to the voltage applied to the PLC's input circuits.
Refers to a simple device with which users can write/read
The F series PLC support 24VDC or 100/200VAC.A PLC
programs to/from a PLC and monitor a PLC.
supporting 24VDC has the power supply inside the PLC.
Therefore another 24VDC power supply does not need to
I be installed in the system.
I/F (INTERFACE)
A boundary across which two independent devices INRUSH CURRENT
exchange signals. When using DC loads such as contactors (electromagnetic
For example, an FX-232AW interface module comes in contactors) or solenoid valves, lamps, and capacitive
between a personal computer and a FX series PLC. loads (condensers), current much larger than rated current
(approx. 6 to 10 times larger) is generated right after voltage
is applied to them.
I/O (INPUT AND OUTPUT)
This large current is called inrush current, and blocking the
Refers to inputting and outputting data.
inrush current by relays significantly shortens their product
life.
IC-RAM
Refers to a RAM that is provides a type of integrated circuit.
Also see RAM.
A-18
INSTRUCTION LATCHED (BATTERY BACKED) RELAY
Refers to a building block within the program. Some sub relays have a backup battery. Such relays are
After a PLC starts running, the CPU reads and executes called Latched (Battery Backed) relays.
these instructions in a cyclic manner.
LEAKAGE CURRENT
INSTRUCTION EXECUTION TIME See OPEN CIRCUIT LEAKAGE CURRENT
Time needed for completing one instruction of a program.
Also see OPERATION TIME LED (LIGHT EMITTING DIODE)
Usually called LED.
INSULATION TRANSFORMER LEDs are compact lamps made of semiconductors. They
Refers to a transformer whose primary coil and secondary can operate with small-current and feature a long service
coil are wound separately and are therefore disconnected life.
electrically.
These type of transformers feature noise reduction. LIMIT SWITCH
Refers to a switch that detects machinery reaching its
INTERFACE movement limit. This switch is useful for scheduling
Refers to intermediate circuits or modules that function machinery to stop at a planed location.
between two devices. Interface rules include insulating
circuits to exchange signals, converting voltage level or LITHIUM BATTERY
signal formats, etc. Non-changeable battery that is used as backup power
supply for PLC's memory during a power failure.
INTERLOCK The service lives of lithium batteries are about five years.
Refers to an action that prevents undesired operations Exchange accordingly.
happening simultaneously.
M
MAIN UNIT
Refers to a PLC body including CPUs and I/Os. It also
incorporates timers, counters, sub relays, etc.
MASTER CONTROL
For example, it is dangerous that a forward contactor and Refers to an instruction that is issued for connecting series
reverse contactor operate together. To use them, an of sequence circuits to a main line via common contacts.
interlock must be placed outside of the PLC as well as The instruction that is used to cancel master control is the
inside it. master control reset instruction.
If an interlock is placed only inside a PLC, they may be
energized momentarily due to the on-delay and off-delay of
MEMORY
PLC's output relays.
Refers to elements where programs are stored.
Also see RAM.
INTERNAL RELAY Also see EPROM.
Dedicated relays provided in a PLC. Internal relays can be Also see EEPROM.
written in a program but cannot be used for external
outputs. Sub relays and temporary relays are another name
MEMORY CASSETTE
of internal relays.
A cassette that houses memory. This makes it easier to
handle, insert and remove memory.
L
LADDER DIAGRAM MICROCOMPUTER
Refers to a circuit diagram showing a program with relay Refers to a compact type CPU composed of ultra micro
scale integrated circuits (UMSI). A micro processor and
symbols.
memory are incorporated in a single UMSI.
A
It is named as such because it looks like a ladder.
MNEMONIC
LATCH
One of programming languages used in a sequence
Refers to a memory where a signal is stored until the next
program.
signal comes in.
MNEMONIC is written in the form of easy-to-remember
The ON/OFF status of the PLC's output contacts is stored
codes such as LD, AND and OR.
in the output latch memory.
A-19
MONITOR
Refers to watching how devices inside a PLC are behave.
O
With an A6GPP/PHP, ON/OFF status of contacts and coils OCTAL
can be judged by circuit status. Refers to a numerical system that does not contain the
numbers 8 and 9, such as 0 to 7, 10 to 17, 20 to 27, and so
MTBF (MEAN TIME BETWEEN FAILURES) on. The FX series PLCs provide I/O numbers in octal.
Refers to average failure interval. More concretely, Unlike I/O numbers, step numbers and constants for
averaged time in which a device can operate without having timers/counters are basically represented in decimal,
any failures. however treated inside a PLC, they are represented in
For example, when 150 PLCs with MTBF of 15 years are binary. Digital switches of "binary coded to decimal" are
used, this means 10 PLCs out of those 150 may go out of used as input devices of a PLC."
order within a year.
PLCs feature much longer MTBF than relay panels. OFF DELAY TIMER
Refers to a timer that opens a contact after a set period of
MTTR (MEAN TIME TO REPAIR) time. (Delay timer energized by voltage drop)
Refers to average time needed for repair. This value is
obtained by dividing repair time by times of repairs. OFFLINE PROGRAMMING
PLC' s repair time can be reduced by replacing modules Refers to programming a peripheral device independently
directly. without connection to a PLC using M26A6GPP and PHP,
etc.
N
ON-DELAY TIMER
N.O. (Normally Open) Contacts
Refers to a timer that closes a contact after a set period of
Refers to contacts that are Open Normally and closed when
time. Delay timer energized by voltage suction.
a coil is excited.
NOISE RESISTANCE
Refers to the upper limit of noise with which an electric
device can operate properly. In FX series PLCs, minimum load for SSR outputs are
Usually, noise resistance is represented by pulse width of preset.
noise and maximum voltage of pulse. For micro current load smaller than this minimum value, a
bypass circuit breaker such as a lamp, resistor or surge
absorber
NOISE SIMULATOR
must be installed in parallel with the load.
Refers to a noise generator that can change voltages and
noise width to test noise resistance of electric devices.
OPEN COLLECTOR
Refers to a collector on a transistor is directly connected to
PLC's input terminal without going through other circuits.
NO-VOLTAGE CONTACT
Refers to an input contact that is provided in a PLC and is
not connected with external power supply circuits.
PLCs incorporating their own input power supply use this
contact.
A-20
OPERATING CURRENT are called PLC (Programmable Logic Controller) or SC
Refers to the limit input current for energizing or de- (Sequence controller).
energizing PLC' s internal input circuit.
Operating voltage is obtained by multiplying a value of PERIPHERAL DEVICE
operating current with input impedance. Refers equipment that is used for writing and storing
programs in a PLC, monitoring a PLC, or creating
OPERATION CYCLE documents.
Refers to the time obtained by multiplying an average
operation speed with the number of program steps, and PHOTO-COUPLER
multiplying that result with a given coefficient. Refers to semiconductor elements that insulate an input
Operation cycle is also called cycle time or scan time. circuits an output circuits, and transfer signals using light.
The more interrupt processes, the larger coefficient. Photo couplers reduce noise operation, therefore they are
used in PLC input circuits.
OPERATION SPEED On the other hand, circuits electrically and physically
Refers to the time taken for executing one instruction. Basic connected to other circuits are called non-insulation circuits.
sequence instructions, such as LD, AND, OR and OUT,
take 0.74 s or less. Application instructions take longer
time ranging from several dozen to several hundred us
depending on their contents. One operation cycle is
obtained by multiplying a total of whole operation time taken
for all program steps and time taken for I/O processing with PHOTOELECTRIC SWITCH
a given magnification. Refers to non-contact switches that are closed or opened
in reaction to a light path between a projector and
OR photoreceiver is blocked or not.
Refers to a parallel connection of N.O. contacts in PLC. For an input to a PLC, the NPN transistor of the open
collector type is usually used. This type uses current
OR INVERSE consumption of 50mA/24VDC. A power supply must be
Refers to parallel connection of N.C. contacts in PLC selected based on these values.
programs.
PHP (PLASMA HANDY GRAPHIC
OUT PROGRAMMING PANEL)
In PLC fields, OUT refers to a drive instruction issued in Unlike GPPs, PHPs employ plasma display instead of CRT.
coils. This makes PHPs lighter than GPPs.
Combined with the meaning "coil", winding wire of relays,
OUT in PLC files refers to this meaning in comparison with POLAR CHARACTERISTICS OF INPUT SIGNAL
electromagnetic relays. (1) Negative common input
Refers to an input common terminal is located on the
OUTPUT EQUIPMENT negative side of voltage. (Commonly used in Japan)
Output equipment of a PLC includes pilot lamps,
contactors (electromagnetic contactors), solenoid valves,
electromagnetic clutch brakes, and more. All of them are
connected to output terminals of a PLC.
They are sometimes called a PLC load.
OUTPUT FORMAT
Output formats supported by PLCs fall into three
categories;
(2) Positive common input
Relay output using contacts, no-contact output for AC load
Refers to that an input common terminal is located on the
(SSR), no-contact output for DC load (transistor).
positive side of voltage. (Commonly used in Europe) A
P POLAR CHARACTERISTICS OF OUTPUT SIGNAL
PC (PROGRAMMABLE CONTROLLER) (1) NPN output
Digital electric devices that have a programmable memory Refers to that NPN transistor outputs are connected to the
and perform sequence control. negative side of load. (Commonly used in Japan)
MELSEC‚ PLCs that do not process numerical values
A-21
R
RAM (RANDOM ACCESS MEMORY)
Memory that is writable and readable at anytime. PLCs
incorporate RAMs. RAMs have a backup battery.
READ
Refers to displaying the contents of a program stored in
(2) PNP output
memory on a programming panel.
Refers to that PNP transistor outputs are connected to the
It also means transferring the program from a PLC to
positive side of load. (Commonly used in Europe)
A6GPP/PHPs and HPPs (off line mode).
PROGRAM CAPACITY
RELAY
How many steps an instruction takes depends on the
Refers to an element with an electromagnetic coil and an
contents of the instruction. While some instructions take
open/close contact. A relay transfers signals from another
only one step, others take 10 to 20 steps.
device to the coil, where this coil opens or closes the
Program capacity indicates how many steps in total a
contact accordingly. With this contact operation a relay
program can have. For example, the FX2 PLC provides
energizes another load.
program capacity of 8K step (0 to 7,999 steps). Additionally,
With relays, larger contact current can be applied compared
one comment (up to 15 alphanumeric characters) takes 10
to coil drive current (amplification function).
steps out of program memory and uses a program memory
It is also possible to have two separate power supplies,
with 4,000 steps in 500 steps units.
one for the coil and the other for the output contact circuit
One file register takes one step and uses program memory
(insulation function). Output contacts can be two or more.
with 2,000 steps in 500 steps units.
Relays are also referred as electromagnetic relay.
PROGRAM
REPEAT OPERATION METHOD
An organized list of instructions. Programming is to write
See CYCLIC OPERATION METHOD
these instructions to the memory of a PLC (program
memory or a user memory).
RESET
Refers to performing an initialization.
PROGRAMMING LANGUAGE
RST instructions are issued to counters, retentive timers,
A programming language that uses symbols from a relay
sub relays, output relays, and so on.
sequence diagrams, i, e, LD, AND and OR, is called relay
symbol language. Whereas, a programming language
RESPONSE TIME
that uses the STL or RET instructions according to SFC
(1) When a different signal is input to an external input
(Sequential Function Chart,) is called step ladder language.
terminal, PLC's logic needs some time to recognize the
Micro PLCs can use both languages according to what
signal change.
operation is required.
This delay time is called input response time.
(2) When output data is generated inside a PLC, the data
PROXIMITY SWITCH
does not go out of the PLC until an output terminal is
Refers to non-contact switches that are closed when
opened or closed. This delay time is called output response
an object approaches. Most of these switches support
time.
transistor output.
For the relay output type, this corresponds with the
For an input to a PLC, an open type collector NPN
mechanical operation delay time of the relay.
transistor is usually used.
Usually, proximity switches use current consumption of
10mA/24VDC. A power supply must be selected based on
this value.
PULSE
Refers to a signal with a narrow width.
The function of a pulse instruction is provided by PLCs to
enable the outputs for one scan time if the input conditions
(3) In addition to input response time and output response
are met.
time, there is another response delay due to a scan cycle of
a PLC.
A-22
RETENTIVE TIMER SHIFT
Refers to a timer that retains its current value even when Refers to an instruction that is issued to shift the ON/
the time-counting coil is de-energized or a power failure OFF status of a coil from one auxiliary relay to another
occurs. After it is reenergized, the timer starts counting the sequentially. (In the FX series PLCs, this instruction is
remaining time and outputs the results. include in application instructions.) Auxiliary relays arranged
To clear a current value or open an output contact, use the in sequence for such use are called shift registers.
RST instruction.
SIMULATION
ROM WRITER Refers to testing how a PLC behaves by not using actual
Refers to a device used for writing programs to EPROMs. devices but through using simulated input switches installed
HPPs and A6GPP/PHPs are examples of ROM Writers. on the PLC.
SELF-MAINTAINING CIRCUIT
Refers to a circuit that can keep coils open or closed.
1 to 3 steps are needed for each contact or coil. One
program can contain from 0 to 1,999 steps (or 0 to 7,999
steps).
STOP
Refers to stopping the PLC. A
In the FX series PLCs, turning the RUN input terminal off
SENSOR POWER SUPPLY stops a PLC. Basically, users can program while a PLC
When a PLC uses proximity and photoelectric switches for is at stop since all outputs are turned off during stop. An
inputs, sensors of these switches can be fed with 24VDC exception is when carrying out forced ON/OFF commands.
from the PLC.
However in the case of a large load, a separate power STORED PROGRAM
supply must be installed outside the PLC. If a PLC has memory. This is where the program is stored.
A-23
SUM CHECK
A PLC performs a SUM operation, which adds the contents
U
in the program memory in binary digits and stores the UPLOAD
results in the register of the PLC. This SUM operation is Refers to reading and transferring programs from a PLC to
performed when: peripheral devices such as A6GPP, PHP, HPP (off line
(1) Program panel mode is changed. (Read, write, insert, mode), etc.
delete, or other key operation is performed.) Also see Download.
(2) All clear, write, insert, or delete is performed to a
program.
USER'S MEMORY
(3) A constant is changed during monitoring.
Refers to program memory storing user-created programs
Whether a PLC status corresponds to the results of the
that are needed for a PLC operation.
above operation is checked when;
(1) Power-on
(2) A sum check is performed on the programming panel.
W
(3) A PLC enters RUN state. WATCHDOG TIMER
This check is called SUM check. A timer that detects PLC operation errors. This timer
This check is to know if the contents of the program are monitors the scan time of a program, and issues an alert if
changed or not. If any changes are found, the PROG E LED a scan failed to complete within the set time.
on PLC' s surface flashes, and then the PLC stops. FX series PLC's watchdog timer illuminates CPU E
provided on the PLC's surface. When this occurs, all
SURGE ABSORBER outputs from the PLC are automatically turned off.
Refers to elements that are designed to absorb surge.
A condenser and resistor are used in a SSR for outputs, WRITE
which may cause open circuit leakage current. Surge Refers to an action of saving programs to memory.
absorbers are also called surge killers. To do this, write programs to a PLC from a programming
panel or write and transfer programs using a A6GPP/PHP.
SURGE
Refers to abnormal noises. There also is a term
called surge voltage, which means high voltage that is
instantaneously generated when current in a coil is shut off.
This surge voltage may severely damage semiconductors
or shorten service lives of contacts.
It also may case malfunction of a PLC due to noise.
T
TIMER
Refers to a relay whose contact is opened or closed a
certain time after its coil is energized.
Also see OFF DELAY TIMER
Also see ON DELAY TIMER
The FX series PLCs incorporate delay timers in 0.1 seconds
or 0.01 seconds units.
TRANSISTOR OUTPUT
Refers to a no-contact output for DC loads. A transistor is
used by a PLC for output instead of relay contacts.
TRIAC OUTPUT
Refers to no-contact output for AC loads. A triac is used by
a PLC for output instead of relay contacts.
Note that using a triac with micro load may cause open
circuit leakage current to occur. Triac output is also called
SSR output.
A-24
Revised History
Date Revision Description
1/2006 A First Edition
6/2015 B A Part of the cover design is changed.
Registration
• Windows, are registered trademarks of Microsoft Corporation in the United States and other countries.
• All other company names and product names used in this document are trademarks or registered trademarks of their respective
companies.
This document does not guarantee the implementation of industrial copyright and other rights, nor authorizes rights of
implementation.
Also, MITSUBISHI ELECTRIC CORPORATION cannot assume any responsibility whatsoever for problems in terms of industrial
copyright that may arise by use of the content described in this document.