Programming Manual
Programming Manual
FR-C500
P R O G R A M M IN G M A N U A L
FR-C500
TRANSISTORIZED INVERTER
OVERVIEW Chapter 1
DESCRIPTION OF
DEVICES
Chapter 3
Chapter 4
PROGRAMMING MANUAL
PLC FUNCTION
1. OVERVIEW 1
CONTENTS
1.1 Outline of Operation Processings ...........................................2
1.2 RUN and STOP Operation Processings ..................................4
1.3 Program Makeup .......................................................................4
3. DESCRIPTION OF DEVICES 17
3.1 Device List ...............................................................................18
3.2 Inputs, Outputs X, Y ................................................................19
3.2.1 Inputs X ....................................................................................................... 20
3.2.2 Outputs Y .................................................................................................... 21
3.3 Internal Relays M .....................................................................22
3.4 Timers T ...................................................................................23
3.4.1 100ms, 10ms and 100ms retentive timers .................................................. 23
3.4.2 Timer processing method and accuracy ..................................................... 24
3.5 Counters C ...............................................................................26
3.5.1 Count processing in refresh system ............................................................ 27
3.5.2 Maximum counting speed of counter .......................................................... 28
3.6 Data Registers D......................................................................29
3.7 Special Relays, Special Registers .........................................30
I
4. PLC FUNCTION 33
4.1 Function List ........................................................................... 34
4.2 How to RUN/STOP the Built-in PLC Function from Outside (Re-
mote RUN/STOP)..................................................................... 35
4.3 Watchdog Timer (Operation clog up monitor timer)............ 37
4.4 Self-diagnostic Function ........................................................ 38
4.4.1 Error-time operation mode .......................................................................... 39
4.5 Keyword Registration ............................................................. 40
4.6 Setting of Output (Y) Status at Switching from STOP Status to
RUN Status .............................................................................. 41
5. STRUCTURES OF INSTRUCTIONS 43
5.1 Instruction Format .................................................................. 44
5.2 Bit Device Processing Method............................................... 46
5.2.1 1-bit processing........................................................................................... 46
5.2.2 Digit designation processing ....................................................................... 46
5.3 Handling of Numerical Value ................................................. 48
5.4 Operation Error ....................................................................... 49
6. PLC INSTRUCTIONS 51
6.1 PLC Instructions ..................................................................... 52
6.1.1 How to use the instruction list ..................................................................... 52
6.1.2 PLC instruction list ...................................................................................... 54
6.2 Description of the Instructions .............................................. 57
6.3 Contact Instructions ............................................................... 58
6.3.1 Operation start, series connection, parallel connection ... LD, LDI, AND, ANI,
OR, ORI ...................................................................................................... 58
6.4 Connection Instructions......................................................... 61
6.4.1 Ladder block series connection, parallel connection ... ANB, ORB ............ 61
6.4.2 Operation result, push, read, pop ... MPS, MRD, MPP............................... 64
6.5 Output Instructions................................................................. 67
6.5.1 Bit device, timer, counter ... OUT................................................................ 67
6.5.2 Device set, reset ... SET, RST .................................................................... 70
6.5.3 Leading edge, trailing edge differential outputs ... PLS, PLF...................... 73
6.6 Shift Instructions..................................................................... 75
II
6.6.1 Bit device shift ... SFT, SFTP ...................................................................... 75
6.7 Master Control Instructions ...................................................77
6.7.1 Master control set, reset ... MC, MCR ......................................................... 77
6.8 End Instruction ........................................................................81
CONTENTS
6.8.1 Sequence program end ... END .................................................................. 81
6.9 Other Instructions ...................................................................82
6.9.1 No operation ... NOP ................................................................................... 82
6.10 Comparison Operation Instructions ......................................84
6.10.1 16-bit data comparison ... =, <>, >, <=, <, >=.............................................. 86
6.11 Data Transfer Instructions......................................................88
6.11.1 16-bit data transfer ... MOV, MOVP ............................................................ 88
6.12 16-bit Logical Product ... WAND, WANDP .............................90
6.13 16-bit Logical Add ... WOR, WORP ........................................93
III
1. OVERVIEW
This manual describes the functions and devices necessary for programming.
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
1
Outline of Operation Processings
2
Outline of Operation Processings
Power on
Initial processing
I/O initialization
Data memory initialization
Self-diagnostic checks
1
END processing
OVERVIEW
Self-diagnostic checks
Updating of timer and counter present values
and on/off of their contacts
3
RUN and STOP Operation Processings
4
2. SEQUENCE PROGRAM
LANGUAGES AND
OPERATIONS
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
5
Programming Languages
REMARKS
*1. When using GX Developer for programming, perform programming in the "ladder mode".
*2. When using GX Developer for programming, perform programming in the "list mode".
tep number
Ladder
blocks
6
Programming Languages
Operation 3) 4)
5)
from top
to bottom 6)
7
Programming Languages
1) 2) 7) 8) 9)
Step number 10)
1) 3) 4)
2) 5)
3)
Operation
sequence
6)
4)
5)
6) 11)
7)
8)
9)
10)
11)
8
Operation Processing Method of PLC Function
Step 0
Step 1
Step 2
END
Timer/counter present 2
value updating
Self-diagnostic
checks, etc.
9
I/O Processing Method
PLC
CPU
(Central Processing Unit)
4)
At output refresh Control output
Y22 Output (Y)
data memory terminal
Y20 5) 2)
• Input refresh
Before execution of step 0, input data are batch-read from the input module (1))
and stored into the input (X) data memory.
• Output refresh
Before execution of step 0, the data of the output (Y) data memory (2)) are batch-
output to the output module.
• When input contact instruction is executed
Input data are read from the input (X) data memory (3)) and the sequence
program is executed.
• When output contact instruction is executed
Output data are read from the output (Y) data memory (4)) and the sequence
program is executed.
• When output OUT instruction is executed
The operation result (5) of the sequence program is stored into the output (Y) data
memory.
Fig 2.5 I/O Data Flows in Refresh System
10
I/O Processing Method
Scan time
END 0 END 0
Sequence program
END processing
Timer/counter count processing
Self-diagnostic checks
12
Num erical Values Usable in Sequence Program
13
Num erical Values Usable in Sequence Program
=
=
=
=
=
=
=
ecimal value -32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Value is negative if most significant bit is 1.
14
Num erical Values Usable in Sequence Program
15
MEMO
16
3. DESCRIPTION OF
DEVICES
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
17
Device List
18
Inputs, Outputs X, Y
Signal lamp
Select switch
Inputs (X) Outputs (Y)
Sequence
operation
Contactor
Digital switch
DESCRIPTION OF DEVICES
19
Inputs, Outputs X, Y
3.2.1 Inputs X
(1) Inputs are designed to give commands and data from external devices, such as
pushbuttons, select switches, limit switches and digital switches, to the inverter
(built-in PLC function).
(2) On the assumption that the PLC function contains a virtual relay Xn for one input
point, the normally open (N/O) or normally closed (N/C) contact of that Xn is used
in the program.
Virtual relay
PB1 X0
Sequence
X0
function
LS2 X1
X1
No restrictions
on the number
of used contacts.
20
Inputs, Outputs X, Y
3.2.2 Outputs Y
(1) Outputs are designed to output the control results of a program to outside the
inverter (signal lamps, digital indicators, magnetic switches (contactors),
solenoids, etc.).
(2) An output can be exported to outside the inverter as equivalent to one N/O
contact.
(3) There are no restrictions on the number of N/O and N/C contacts of output Yn
used in the program, if they are used within the program capacity range.
M11
DESCRIPTION OF DEVICES
21
Internal Relays M
There are no restrictions on the number of contacts (N/O and N/C contacts) used in
the program.
Use outputs (Y) when outputting the operation results of the sequence program to
outside the inverter.
22
Timers T
3.4 Timers T
The timers of the PLC function are count up timers.
The count up timer starts timing the present value when its coil turns on, and the
contact of that timer turns on when the present value reaches the setting (time-out).
Timing chart
ON ON
5 OFF OFF OFF
ON ON
2 coil OFF OFF OFF
Setting
DESCRIPTION OF DEVICES
imer present
alue 5s
ON
2 contact OFF OFF
23
Timers T
Timing chart
ON ON
X5 OFF OFF OFF
ON ON
T5 coil OFF OFF OFF
Setting
Timer present
value 15s 5s
ON
T5 contact OFF OFF
DESCRIPTION OF DEVICES
10ms timer
timing 1 2 1 2 3 1 2 1 2 1 2 3
2 3 2 2 3
Timing set
at END
0 3 3 3 2 5 597 2 599 599 3 602
T3 present
value *1
1 scan
0
*2 6000ms
1 scan
0
3
600 appears when monitored
on peripheral device.
25
Counters C
3.5 Counters C
The counters of the built-in PLC function are up counters.
An up counter stops counting and its contact turns on when the count value reaches
the setting.
(1) Count processing
1) The coil of the counter is turned on/off at execution of the OUT C instruction,
and its present value is updated and its contact turns on after execution of the
END instruction.
2) The counter counts on detection of the leading edge (OFF to ON) of the coil. It
does not count if the coil remains on.
(2) Counter resetting
1) The count value is not cleared even if the coil turns off. Use the RST C
instruction to clear the count value and turn off the contact.
2) When the counter is reset by the RST instruction, the present value and
contact of the counter are cleared at execution of the RST instruction.
Ladder example
Input condition
C0 counts on leading edge (OFF to ON)
of input X5.
26
Counters C
Counting method
ON
OFF
5
ON
OFF
5
ON
Image)
OFF
3 coil
3 present 0 1 2
alue ON
DESCRIPTION OF DEVICES
OFF
3 contact
27
Counters C
n 1
Maximum counting speed Cmax [times/s] n: Duty (%)
100 ts ts: Scan time [s]
REMARKS
The duty n is a percent (%) ratio of ON/OFF period to (ON + OFF period) of the count input
signal.
T1
When T1 T2 n 100[%]
T1 T2
T2
When T1 T2 n 100[%]
T1 T2
T1 T2
ON
Count input signal OFF
28
Data Registers D
b15 to b0
D
16 bits
Data register No.
DESCRIPTION OF DEVICES
29
Special Relays, Special Registers
30
Special Relays, Special Registers
1 scan
Initial ON
processing M9038
OFF
M9038
flag
(1 scan ON) Switching from STOP to RUN
(2) Using M9038, you can create a sequence program to be
executed only once without using the PLS instruction at
switching from STOP to RUN.
M9038
Initial processing program
DESCRIPTION OF DEVICES
M9036
flag
Sequence 0 END/0
RUN flag M9039 program
ON
M9039
OFF
3
RUN
31
MEMO
32
4. PLC FUNCTION
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
33
Function List
CAUTION
The following functions are unavailable.
Constant scan, latch (backup for power failure), PAUSE, status latch, sampling trace,
step run, clock, interrupt processing, comment, microcomputer mode, print title
registration, annunciator display mode, ERROR LED priority setting
34
How to RUN/STOP the Built-in PLC Function
from Outside (Remote RUN/STOP)
SQ terminal
ON
OFF
emote RUN contact
External input terminal)
4
STOP
Built-in sequence
function: RUN
RUN/STOP status
STOP status
Fig 4.1 Timing Chart for RUN/STOP Using Remote RUN Contact
POINT
Setting of remote RUN contact built-in PLC function parameter
X0 to X1F can be set as the remote RUN contacts.
(Refer to the GX Developer manual for details.)
35
How to RUN/STOP the Built-in PLC Function
from Outside (Remote RUN/STOP)
36
Watchdog Timer (Operation clog up monitor timer)
WDT resetting
(Internal processing)
REMARKS
The watchdog timer setting can be changed by built-in PLC function parameter setting of GX
Developer. (Refer to the GX Developer manual for details.)
37
Self-diagnostic Function
2) If an operation continuation error is detected, only the faulty program part is not
executed and the program at the next step is executed.
(3) Error definition checking
When M9008 (self-diagnostic error) turns on at detection of an error, the error
code is stored into D9008 (self-diagnostic error). Especially in the continuation
mode, use it in the program to prevent a mechanical system malfunction.
For the errors detected by the self-diagnostic, refer to the error code list on page
98.
38
Self-diagnostic Function
PLC FUNCTION
39
Keyword Registration
40
Setting of Output (Y) Status at Switching
from STOP Status to RUN Status
When the RUN status is switched to the STOP status, the outputs (Y) in the RUN
status are stored into the built-in PLC function.
Using the built-in PLC function parameter, you can set whether the outputs (Y) will be
output again or will be output after execution of operation when the STOP status is
switched to the RUN status.
YES
PLC FUNCTION
4
Sequence program operation is executed.
Fig 4.4 Processing Performed when STOP Status Is Switched to RUN Status
41
MEMO
42
5. STRUCTURES OF
INSTRUCTIONS
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
43
Instruction Format
(2) The instruction format can be roughly classified as follows according to the
instruction part and device combinations.
1) Instruction part .....This instruction does not change the device status and
mainly controls the program.
Example END
44
Instruction Format
Source 2............................. S2
Destination ......................... D
Destination 1 ...................... D1
45
Bit Device Processing Method
Designation range
of K1
(4 points)
Designation range of K2
(8 points)
Designation range of K3
(12 points)
Designation range of K4
(16 points)
Fig 5.1 Digit Designation Setting Range for 16-bit Instruction
(a) When there is digit designation on the source (S) side, the numerical values
that can be handled as the source data are as indicated in Table 5.1.
Table 5.1 List of Designated Digits and Numerical
Values That Can Be Handled
Number of Designated Digits 16-bit Instruction
K1 (4 points) 0 to 15
K2 (8 points) 0 to 255
K3 (12 points) 0 to 4095
K4 (16 points) -32768 to 32767
46
Bit Device Processing Method
Turn to 0s.
(b) When there is digit designation on the destination (D) side, the number of
points specified by digit designation is the target on the destination side.
Ladder Example Processing
When source (S) data
is numerical value
STRUCTURES OF INSTRUCTIONS
47
Handling of Numerical Value
2) Hexadecimal number
48
Operation Error
1) D9011 stores the step number of the instruction where an operation error occurred STRUCTURES OF INSTRUCTIONS
when M9011 turned from OFF to ON. Therefore, D9011 data does not change if
M9011 remains on.
2) To reset M9011 and D9011, program as shown below.
Reset command
Resets (turns off) M9011.
Reset command Resets D9011.
(Clears D9011 to 0.)
49
MEMO
50
6. PLC
INSTRUCTIONS
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
51
PLC Instructions
↑ ↑ ↑ ↑ ↑ ↑
1) 2) 3) 4) 5) 6)
MOV S D WAND S1 S2 D
52
PLC Instructions
(S) (D)
Indicates 16 bits.
6)....... Indicates the number of program steps required for each instruction.
The number of steps that changes depending on conditions is two.
PLC INSTRUCTIONS
53
PLC Instructions
Number of Steps
Reference page
Executi
Instruction on
Classification Symbol Processing Conditi
Symbol
on
54
PLC Instructions
Number of Steps
Reference page
Executi
Instruction on
Classification Symbol Processing Conditi
Symbol
on
AND<= <=
Continuity when (S1) ≤ (S2) 5
S1 S2
Non-continuity when (S1) > (S2) 7
5
OR<= <= S1 S2
7
5
LD< < S1 S2
7
Continuity when (S1) < (S2) 5
AND< < S1 S2
Non-continuity when (S1) ≥ (S2) 7
5 6
OR< < S1 S2
7
55
PLC Instructions
Number of Steps
Reference page
Executi
Instruction on
Classification Symbol Processing Conditi
Symbol
on
5
LD>= >= S1 S2
7
16-bit data AND>= Continuity when (S1) ≥ (S2) 5
>= S1 S2 84
comparison Non-continuity when (S1) < (S2) 7
5
OR>= >= S1 S2
7
MOV MOV S D 5
Transfer (S) → (D) 88
MOVP MOVP S D 5
WAND WAND S D 5
(D) ∧ (S) → (D)
WANDP WANDP S D 5
Logical
90
product
WAND WAND S1 S2 D 7
(S1) ∧ (S2) → (D)
WANDP WANDP S1 S2 D 7
WOR WOR S D 5
(D) ∨ (S) → (D)
WORP WORP S D 5
Logical
93
sum
WOR WOR S1 S2 D 7
(S1) ∨ (S2) → (D)
WORP WORP S1 S2 D 7
56
Description of the Instructions
SET input
Device number
SET to be set (turned
5) RST input
D on)
Device number
RST
to be reset
6) Functions
SET
(1) Turns on the specified device when the SET input turns on.
(2) The device turned on is held on if the SET input turns off. It can be turned off by
the RST instruction.
SET input
RST input
(3) When the SET input is off, the device status does not change.
7) Execution Conditions
The SET and RST instructions are executed every scan.
8) Program Examples
SET , RST
1) Program that sets (turns on) Y8 when X8 turns on and resets (turns off) Y8 when X9
turns on.
Coding
PLC INSTRUCTIONS
Description
1) Indicates the section number, instruction outlines and instruction symbols.
2) The devices usable with the instructions are marked.
3) The digit designation that can be set is indicated for the instruction that requires digit
designation when a bit device is used.
4) The instruction for which the error flag turns on at operation error occurrence is
marked. 6
5) Shows the format in the ladder mode.
6) Explains the instruction.
7) Indicates the execution conditions of the instructions.
8) Shows program examples in the ladder mode and list mode.
57
Contact Instructions
X1 Device number
LD
X1
LDI
X2
AND
X2
ANI
OR
X3
ORI
X3
58
Contact Instructions
Functions
LD, LDI
(1) LD is an N/O contact operation start instruction, and LDI is an N/C contact
operation start instruction. Each of them imports the ON/OFF data of the
specified device and uses it as an operation result.
AND, ANI
(1) AND is an N/O contact series connection instruction, and ANI is an N/C contact
series connection instruction. Each of them imports the ON/OFF data of the
specified device, ANDs it with the previous operation result, and uses the
resultant value as an operation result.
(2) There are no restrictions on the use of AND and ANI, but there are the following
conditions in the ladder mode.
1) Write .........When contacts are connected in series by AND or ANI, a ladder of
up to 21 contacts can be created.
2) Read .........When contacts are connected in series by AND or ANI, a ladder of
up to 24 contacts can be displayed. If the ladder has more than 24
contacts, up to 24 contacts are displayed.
OR, ORI
(1) OR is an N/O contact parallel connection instruction, and ORI is an N/C contact
parallel connection instruction. Each of them imports the ON/OFF data of the
specified device, ORs it with the previous operation result, and uses the resultant
value as an operation result.
(2) There are no restrictions on the use of OR and ORI, but there are the following
conditions in the ladder mode.
1) Write .........A ladder of up to 23 contacts connected consecutively by OR or
ORI can be created.
2) Read .........A ladder of up to 23 contacts connected consecutively by OR or
ORI can be displayed. If the ladder has more than 23 contacts, it
cannot be displayed properly.
Execution Conditions
Executed every scan independently of the device ON/OFF and preceding operation
PLC INSTRUCTIONS
result.
59
Contact Instructions
Program Examples
LD , LDI , AND , ANI , OR , ORI
・ Coding
・ Coding
ORB
ANB
・ Coding
60
Connection Instructions
Block A Block B
Block A
Block B
61
Connection Instructions
Functions
ANB
(1) ANDs blocks A and B and uses the resultant value as an operation result.
(2) The symbol of ANB is not a contact symbol but a connection symbol.
(3) ANB can be written up to seven instructions (eight blocks) consecutively.
If ANB is written consecutively more than the above, the PLC cannot perform
normal operation.
ORB
(1) ORs blocks A and B and uses the resultant value as an operation result.
(2) ORB connects in parallel the ladder blocks of two or more contacts. Use OR or
ORI to connect in parallel the ladder blocks of only one contact.
Coding
(3) The symbol of ORB is not a contact symbol but a connection symbol.
(4) ORB can be written up to seven instructions (eight blocks) consecutively.
If ORB is written consecutively more than the above, the PLC cannot perform
normal operation.
62
Connection Instructions
Program Examples
ANB
Though there are the following two different program coding methods for connecting
ladder blocks in series consecutively, use the coding example 1.
ORB
Though there are the following two different program coding methods for connecting
ladder blocks in parallel consecutively, use the coding example 1.
63
Connection Instructions
6.4.2 Operation result, push, read, pop ... MPS, MRD, MPP
Usable Devices Digit
Error Flag
Bit devices Word (16-bit) devices Constants Level Desig
X Y M T C D K H N nation (M9010,M9011)
Functions
MPS
(1) Stores the operation result (ON/OFF) immediately before itself.
(2) The MPS instruction can be used consecutively up to 12 times.
In the ladder mode, however, it can be used up to 11 times.
When the MPP instruction is used midway, the number of used MPS instructions
is decremented by 1.
MRD
(1) Reads the operation result stored by the MPS instruction, and continues
operation from the next step with that operation result.
MPP
(1) Reads the operation result stored by the MPS instruction, and continues
operation from the next step with that operation result.
(2) Clears the operation result stored by the MPS instruction.
64
Connection Instructions
POINT
(1) Ladders differ as shown below between when MPS, MRD and MPP are used and when they
are not used.
Ladder using MPS, MRD and MPP Ladder not using MPS, MRD and MPP
(2) Use the same number of MPS and MPP instructions. If they differ in the number of used
instructions, operation will be performed as described below.
1) If the MPS instructions are used more than MPP instructions, the ladder is changed and
the built-in PLC function performs operation according to the new ladder.
Before change
Coding
After change
Coding
PLC INSTRUCTIONS
2) If the MPP instructions are used more than MPS instructions, that ladder block results in
a ladder creation error, and the built-in PLC function cannot perform normal operation. 6
65
Connection Instructions
Program Example
MPS , MRD , MPP
1) Program using MPS, MRD and MPP
・ Coding
1) 1)
2)
2)
3) 4)
3)
5)
4)
6)
7) 5)
8) 6)
9)
7)
10)
8)
9)
10)
66
Output Instructions
OUT Y15
(Y, M) Device number
K50 Setting Any of 1 to 32767 is
valid
T0
Device number (T0 to 7)
OUT
D10 Setting Any of data register
(T) contents 1 to 32767
T0 is valid
Device number (T0 to 7)
Functions
OUT (Y, M)
(1) Outputs the operation result up to OUT instruction to the specified device.
PLC INSTRUCTIONS
OUT Instruction
Operation Result Contacts
Coil
N/O contact N/C contact
OFF OFF Not energize Energize
ON ON Energize Not energize
REMARKS 6
Three steps are used for the OUT instruction only when the following device is used.
• Special relay (M)
67
Output Instructions
OUT(T)
(1) When the operation result up to the OUT instruction is ON, the coil of the timer
turns on and the timer times up to the setting, and when the timer times out
(timing value ≥ setting), the contact operates as indicated below.
N/O contact Energize
N/C contact Not energize
(2) When the operation result up to the OUT instruction turns from ON to OFF, the
timer operates as indicated below.
Present Before Time-out After Time-out
Timer
Timer Type Value of N/O N/C N/O N/C
Coil
Timer contact contact contact contact
100ms timer Not Not
OFF 0 Energize Energize
10ms timer energize energize
100ms Not Not
OFF Maintained Energize Energize
retentive timer energize energize
(3) After a time-out, the contact state of the retentive timer remains unchanged until
the RST instruction is executed.
(4) A negative number (-32768 to -1) cannot be specified for the setting.
(5) If the setting is 0, it is timed as infinity. Hence, the timer does not time out.
(6) Refer to page 24 for the timing method of the timer.
OUT(C)
(1) When the operation result up to the OUT instruction turns from OFF to ON, the
present value (count value) is incremented by 1, and when the counter stops
counting (present value = setting), the contact operates as indicated below.
N/O contact Energize
N/C contact Not energize
(2) The counter does not count if the operation result remains ON. (Count inputs
need not be converted into pulses.)
(3) After the counter has stopped counting, the count value and contact state remain
unchanged until the RST instruction is executed.
(4) A negative number (-32768 to -1) cannot be specified for the setting. If the setting
is 0, processing is the same as when the setting is 1.
(5) Refer to page 26 for the counting method of the counter.
Execution Conditions
Executed every scan independently of the operation result up to the OUT instruction.
68
Output Instructions
Program Examples
OUT
1) Program that outputs to the output module.
Coding
2) Program that turns on Y10 and Y14 10s after X0 has turned on.
Coding
3) Program that turns on Y0 when X0 turns on 10 times and turns off Y0 when X1 turns
on.
Coding
69
Output Instructions
SET input
Device number
SET to be set (turned
RST input on)
D
Device number
RST
to be reset
Functions
SET
(1) Turns on the specified device when the SET input turns on.
(2) The device turned on is held on if the SET input turns off. It can be turned off by
the RST instruction.
SET input
RST input
(3) When the SET input is off, the device status does not change.
RST
(1) When the RST input turns on, the specified device operates as described below.
Device Status
Y, M The coil and contact are turned off.
T, C The present value is reset to 0 and the coil and contact are turned off.
D Cleared to 0.
(2) When the RST input is off, the device status does not change.
70
Output Instructions
(3) The function of RST (D) is the same as that of the following ladder.
Execution Conditions
The SET and RST instructions are executed every scan.
REMARKS
Three steps are used when the following device is used.
SET instruction ... Special relay (M)
RST instruction ... Special relay (M), all word devices
Program Examples
SET , RST
1) Program that sets (turns on) Y8 when X8 turns on and resets (turns off) Y8 when X9
turns on.
Coding
X8 (SET input)
X9 (RST input)
PLC INSTRUCTIONS
71
Output Instructions
Coding
・ Coding
72
Output Instructions
D " "
PLS command
Set data
Device number whose data
D will be converted into pulses
PLF command
Functions
PLS
(1) Turns the specified device on when the PLS command turns from OFF to ON,
and turns it off except when the PLS command turns from OFF to ON.
When there is one PLS instruction for the device specified at D during one scan,
the specified device turns on for one scan.
Do not execute the PLS instruction for the same device more than once during
one scan.
1 scan 1 scan
PLC INSTRUCTIONS
(2) If the status is switched to STOP and switched to RUN again after execution of
the PLS instruction, the PLS instruction is not executed.
73
Output Instructions
PLF
(1) Turns the specified device on one scan when the PLF command turns from ON to
OFF, and turns it off except when the PLF command turns from ON to OFF.
When there is one PLF instruction for the device specified at D during one scan,
the specified device turns on for one scan.
Do not execute the PLF instruction for the same device more than once during
one scan.
1 scan 1 scan
(2) If the status is switched to STOP and switched to RUN again after execution of
the PLF instruction, the PLF instruction is not executed.
Program Examples
PLS
Program that executes the PLS instruction when X9 turns on.
・ Coding
1 scan
PLF
Program that executes the PLF instruction when X9 turns off.
・ Coding
1 scan
74
Shift Instructions
D " "
SFT commands
Set data
Device number to which
D data will be shifted
Functions
(1) Shifts the ON/OFF status of the device preceding the one specified at D to the
specified device, and turns off the preceding device.
(2) Use the SET instruction to turn on the first device from which data will be shifted.
(3) When using the SFT or SFTP instructions consecutively, program in order of
larger to smaller device numbers.
Shift range
Shift input
1) X02 ON
2) After first shift input
3) After second shift input
PLC INSTRUCTIONS
4) X02 ON
5)
5) After third shift input
6)
6) After fourth shift input
7)
7) After fifth shift input
75
Shift Instructions
Program Example
SFT
1) Program that shifts the Y7 - B data when X8 turns on.
Coding
76
Master Control Instructions
Nesting (N0 to 7)
Functions
(1) The master control instructions are designed to create an efficient ladder
switching sequence program by switching on/off the common bus of the ladder.
The ladder that uses master control is as shown below.
Y7 Executed
only when
X0 is on
YF
PLC INSTRUCTIONS
Y10
77
Master Control Instructions
MC
(1) When the MC ON/OFF command is on at the start of master control, the
operation results between MC and MCR are as performed by the instructions
(ladder).
(2) If the MC instruction is off, the scan between the MC and MCR instructions is
executed, and therefore, the scan time does not become short.
When the MC instruction is off, the operation results between MC and MCR are
as described below.
The count value is reset to 0 and both the coil and contact
100ms, 10ms timer
turn off.
The coil turns off but both the count value and contact
100ms retentive timer, counter
maintain the current states.
Devices in OUT instruction All turn off.
SET, RST,
SFT or device in instruction Maintains the current state.
basic
(3) By changing the device at D , the MC instruction can use the same nesting (N)
number any number of times.
(4) When the MC instruction is on, the coil of the device specified at D turns on.
Since using the same device in the OUT instruction, etc. will result in double coils,
the device specified at D should not be used in any other instruction.
78
Master Control Instructions
MCR
(1) This instruction is designed to reset the master control and indicates the end of the
master control range.
(2) Do not provide a contact instruction in front of the MCR instruction.
The master control instructions can be nested. Their master control ranges are
differentiated by the nesting (N). The nesting can be used from N0 to N7.
Using the nesting structure, you can create a ladder that restricts the program
execution conditions in order.
The ladder using the nesting structure is as shown below.
ñ H̃ ƒ
‰
Display‚ in
[ ladder
h ‚Å ‚Ì \• Ž
ƒ ¦mode Actual operation ladder
A
Executed
when A
turns on.
B
Executed
when A
and B
turn on.
C
Executed
when A, B
and C
turn on.
Executed
when A
and B
turn on.
Executed
when A
turns on.
Irrelevant
to A, B
and C.
PLC INSTRUCTIONS
79
Master Control Instructions
Nesting numbers of MCR are Since buses cross each other, normal
opposite. master control ladder cannot be created.
(2) When the MCR instructions are gathered in one place in the nesting structure, all
master controls can be terminated by one lowest nesting (N) number.
80
End Instruction
END
Functions
(1) Indicates the end of a program. Execution terminates scanning at this step and
returns to step 0.
Sequence program
(2) The END instruction cannot be used halfway through the sequence program.
CAUTION
If the END instruction does not exist in the program, an operation error occurs and the
PLC function does not operate.
PLC INSTRUCTIONS
81
Other Instructions
Functions
NOP
(1) No-operation instruction that has no influence on the preceding operation.
(2) Use NOP to:
1) Provide space for debugging of a sequence program.
2) Delete an instruction without changing the number of steps. (Change the
instruction for NOP)
3) Delete an instruction temporarily.
82
Other Instructions
Program Examples
NOP
1) Contact short-circuit (AND, ANI)
Before change Coding
Replaced by NOP.
After change
Coding
Replaced by NOP.
After change
83
Comparison Operation Instructions
The basic instructions can handle numerical data represented in 16 bits, and are
classified as follows.
Basic Instruction Type Description Reference Page
Comparison operation
Comparison such as =, >, < 84
instruction
Data transfer instruction Transfer of specified data 88
For the number of steps, refer to the instruction manual of the FREQROL-C500.
(2) Use the comparison operation instructions in the same manner as the contact
instructions of the PLC instructions as indicated below.
• LD, LDI ......... LD=
• AND, ANI ..... AND=
• OR, ORI ....... OR=
84
Comparison Operation Instructions
(4) The conditions that the comparison operation instructions turn on are as follows.
98 99 100 101 102
Dn K100 ON OFF ON
Dn K100 OFF ON
Dn K100 ON OFF
Dn K100 ON OFF
Dn K100 OFF ON
CAUTION
The comparison instruction regards the specified data as BIN values. Hence, if the value
whose most significant bit (b15) is 1 (8 to F) is specified for comparison of hexadecimal
data, it is regarded as a negative BIN value.
Example
Comparison of 4-digit HEX values
Regarded Regarded
as -32767 as 1384
in BIN. in BIN.
Therefore, the result is -32767 < 1384 and Y10 does not turn on.
PLC INSTRUCTIONS
85
Comparison Operation Instructions
6.10.1 16-bit data comparison ... =, <>, >, <=, <, >=
Usable Devices Error
Bit devices Word (16-bit) devices Constants Level Digit Flag
Designation (M9010,
X Y M T C D K H N
M9011)
Instruction symbol in
=, <>, >, <=, <, >=
Functions
(1) Handled as an N/O contact and performs 16-bit comparison operation.
(2) The comparison operation results are as indicated below.
Instruction Comparison Instruction Comparison
symbol in Condition Operation symbol in Condition Operation
Result Result
= S1 = S2 = S1 ≠ S2
<> S1 ≠ S2 <> S1 = S2
> S1 > S2 > S1 ≤ S2
Energize Not energize
<= S1 ≤ S2 <= S1 > S2
< S1 < S2 < S1 ≥ S2
>= S1 ≥ S2 >= S1 < S2
Execution Conditions
The execution conditions of LD , AND and OR are as indicated below.
Instruction Execution Condition
LD Executed every scan.
AND Executed only when the preceding contact instruction is on.
OR Executed every scan.
REMARKS
Seven steps are used when:
• The digit designation of a bit device is not K4.
• The beginning of a bit device is not a multiple of 8.
86
Comparison Operation Instructions
Program Examples
=
1) Program that compares the X0-F data and D3 data.
Coding
<>
2) Program that compares the BCD value 100 and D3 data.
Coding
>
3) Program that compares the BIN value 100 and D3 data.
Coding
<=
4) Program that compares the D0 and D3 data.
Coding
PLC INSTRUCTIONS
87
Data Transfer Instructions
Transfer commands
Transfer source data or
MOV S head number of device
that stores that data
Head number of transfer
D destination device
MOVP
Functions
MOV
Transfers the 16-bit data of the device specified at S to the device specified at D .
16 bits
Before
transfer
Transfer
After
transfer
Execution Conditions
The execution conditions of the transfer instructions are as shown below.
Transfer
command
MOVP
Executed only once. Executed only once.
88
Data Transfer Instructions
Program Examples
MOV
1) Program that stores the input X0-B data into D8.
Coding
Coding
PLC INSTRUCTIONS
89
16-bit Logical Product ... WAND, WANDP
Operation
commands
WAND S
S1 Data to be ANDed or
head numbers of
WANDP S2 devices that store data
D
Operation
commands Head number of device
WAND
D1 that will store result of
logical product.
For instructions marked , only
WANDP
WAND can be executed.
Functions
WAND
(1) ANDs the 16-bit data of the device specified at D and the 16-bit data of the
device specified at S on a bit-by-bit basis, and stores the result into the device
specified at D .
16 bits
Before
execution
After
execution
90
16-bit Logical Product ... WAND, WANDP
(2) ANDs the 16-bit data of the device specified at S1 and the 16-bit data of the
device specified at S2 on a bit-by-bit basis, and stores the result into the device
specified at D1 .
16 bits
Before
execution
After
execution
(3) More than the digit designation of a bit device is regarded as 0 for operation.
Execution Conditions
The execution conditions of the logical product instructions are as shown below.
Operation
command
WANDP
Executed only once. Executed only once.
Program Examples
WAND
1) Program that masks the tenth digit (second place from the least significant digit)
with 0 among the four BCD digits of D10 when XA turns on.
PLC INSTRUCTIONS
(D10)=1234 →1204
Coding
91
16-bit Logical Product ... WAND, WANDP
2) Program that ANDs the X10-1B and D33 data and outputs the result to Y0-B when
XA turns on.
ANDs X10-1B data and D33 data
and stores result to D33.
Coding
X1B X1A X19 X18 X17 X16 X15 X14 X13 X12 X11 X10
X1B to 10
Regarded as 0s.
D33
Turn to 0s.
3) Program that ANDs the X10-1B and D33 data and outputs the result to Y0-B when
XA turns on.
Coding
X1B X1A X19 X18 X17 X16 X15 X14 X13 X12 X11 X10
1B to 10
Regarded as 0s.
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
33
YB YA Y9 Y8 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
B to Y0
Remain unchanged.
92
16-bit Logical Add ... WOR, WORP
Usable Devices
Error
Word (16-bit)
Bit devices Constants Level Digit Flag
devices
Designation
(M9010,
X Y M T C D K H N
M9011)
WOR S1 " " " " " " " " K1 to K4 "
Operation
commands
WOR S
S1 Data to be ORed or
head numbers of
WORP S2 devices that store data
Operation D
commands Head number of device
WOR
D1 that will store result of
logical add.
For instructions marked ,only
WORP WOR can be executed.
Functions
WOR
(1) ORs the 16-bit data of the device specified at D and the 16-bit data of the
PLC INSTRUCTIONS
device specified at S on a bit-by-bit basis, and stores the result into the device
specified at D .
16 bits
Before
execution
6
After
execution
93
16-bit Logical Add ... WOR, WORP
(2) ORs the 16-bit data of the device specified at S1 and the 16-bit data of the
device specified at S2 on a bit-by-bit basis, and stores the result into the device
specified at D1 .
16 bits
Before
execution
After
execution
(3) More than the digit designation of a bit device is regarded as 0 for operation.
Execution Conditions
The execution conditions of the logical add instructions are as shown below.
Operation
command
WORP
Executed only once. Executed only once.
Program Examples
WOR
1) Program that ORs the D10 and D20 data and stores the result into D10 when XA
turns on.
・ Coding
94
16-bit Logical Add ... WOR, WORP
2) Program that ORs the X10-1B and D33 data and outputs the result to Y0-F when
XA turns on.
Coding
3) Program that ORs the D10 and D20 data and stores the result into D33 when XA
turns on.
Coding
4) Program that ORs the X10-1B and D33 data and outputs the result to Y0-B when
XA turns on.
Coding
PLC INSTRUCTIONS
95
MEMO
96
7. ERROR CODE
LIST
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
97
How to Read the Error Code
When the built-in PLC function is in the RUN status or if an alarm occurs during RUN,
the self-diagnostic function displays the error and stores the error code and error step
into the special registers. This chapter describes the error definitions and corrective
actions.
98
MEMO
REVISIONS
*The manual number is given on the bottom left of the back cover
Print Date *Manual Number Revision
Aug., 2002 IB(NA)-0600116E-A First edition