Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (16.5 MB, 964 trang )
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
5.3
5.3 Character Strings
Character Strings
Character strings are classified into character string constants which directly specify character strings in operands in
applied instructions and character string data.
5.3.1
Character string constant ("ABC")
A device "character string" directly specifies a character string in a sequence program.
Put half-width characters inside quotation marks (example: "ABCD1234") in specification.
JIS8 code is available.
Up to 32 characters can be specified as a character string.
5.3.2
Character string data
With regard to character string data, a specified device to the NULL code (00H) is handled as one character string in
1-byte units.
When expressing (recognizing) character string data by bit devices with digit specification, however, 16 bits are
required for data including the NULL code (00H) specifying the end of the character string data because the instruction
length is 16 bits. (Refer to Example 2 in the step 2 below.)
In the following cases, an operation error occurs in the applied instruction (error code: K6706):
• When "00H" is not specified in the corresponding device range after the source device number specified in an
applied instruction
• When there are insufficient devices for storing character string data (including "00H" or "0000H" indicating the end
of the character string data) in the destination devices specified in an applied instruction
1)
Character string data stored in word devices
• Example of data which can be
recognized as character string data
b15
D100
D101
D102
b8 b7
• Example of data which cannot be
recognized as character string data
b0
b15
1st character
3rd character
5th character
D100
D101
00H
21st character
D7999 "n"th character
D102
"00H" indicating the end of
the character string can be
detected.
2)
2nd character
4th character
6th character
b0
1st character
3rd character
5th character
…
…
D110
b8 b7
2nd character
4th character
6th character
"(n-1)"th character
"00H" indicating the end of character string
cannot be detected from the specified
device to the end device number.
Character string data stored in bit devices with digit specification
• Example of data which can be
• Examples of data which cannot be
recognized as character string data
recognized as character string data
16 bits
16 bits
M115 to M100 2nd character
M131 to M116 4th character
M147 to M132
00H
13th character
…
M211 to M196
M115 to M100
M131 to M116
M147 to M132
2nd character
4th character
6th character
1st character
3rd character
5th character
…
6th character
1st character
3rd character
5th character
"00H" indicating the
end of the character
string can be
detected.
M7679 to
M7664
M7623 to M7608
M7639 to M7624
M7655 to M7640
M7671 to M7656
M7679 to M7672
"n"th character "(n-1)"th character
"00H" indicating the end of character string
cannot be detected from the specified
device to the end device number.
16 bits
2nd character
4th character
6th character
8th character
1st character
3rd character
5th character
7th character
00H
Because the data "00H" indicating the end
of the character string does not reach 16
bits, the end of the character string cannot
be recognized.
158
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
1
Specification of Digits for Bit Devices (Kn[ ]***)
Introduction
5.4
5.4 Specification of Digits for Bit Devices (Kn[ ]***)
Handling of bit devices
0
1
0
1
0
1
0
1
0
1
0
Transferred
Do not change
1
0
1
0
K2M0
M15 M14 M13 M12 M11 M10
M9
M8
0
0
0
0
0
1
0
1
0
1
M7
M6
M5
M4
M3
M2
M1
M0
D1
1
0
1
0
Transferred
Sign bit (0 = Positive, 1: Negative)
0
1
0
0
0
1
0
4
Devices
in Detail
0
0
3
1
Low order
D0
Instruction
List
Sign bit (0 = Positive, 1: Negative)
Low order
1
FNC 19
BIN
K2X004
D0
Two-digit BCD data expressed by X004 to X013 is converted into binary
data, and then transferred to D0.
5
Specified the
Device &
Constant
When 16-bit data is transferred to K1M0 to K3M0, the highest-order bits are not transferred due to insufficient data
length.
32-bit data is transferred in the same way.
When the number of digits specified for bit devices is K1 to K3 (or K1 to K7) in a 16-bit (or 32-bit) operation, the
insufficient high-order bits are always regarded as "0". It means that such data is always positive.
M0
2
Overview
Devices which handle only the ON/OFF information such as X, Y, M and S are called bit devices.
On the other hand, devices handling numeric values such as T, C, D and R are called word devices.
Even bit devices can handle a numeric value when they are combined. In this case, the number of digits Kn and the
head device number are combined.
The number of digits is expressed in 4 bit units (digits); K1 to K4 are used for 16-bit data, and K1 to K8 are used for 32bit data.
For example, "K2M0" indicates two-digit data expressed by M0 to M7.
6
Specification of consecutive words
• K1X000,
K1X004,
K1X010,
• K2Y010,
K2Y020,
K2Y030 .....
K3M12,
M3M24,
• K4S16,
K4S32,
8
K4S48 .....
K3M36 .....
FNC00-FNC09
Program Flow
• K3M0,
K1X014 .....
7
Basic
Instruction
A series of data registers starting from D1 means "D1, D2, D3, D4 ....."
In the case of word devices with digit specification, when such word devices are handled as a series, they are
specified as shown below:
Before
Programming
A bit device number can be specified arbitrarily, but it is recommended to set the least significant digit to "0" for X or Y.
(In other words, it is recommended to specify "X000, X010, X020 ... Y000, Y010, Y020 ...")
For M and S, multiples of "8" are ideal, but it is recommended to specify "M0, M10, M20 ..." to prevent confusion.
Use the above devices in digit units so that devices are not skipped.
When "K4Y000" is used in a 32-bit operation, the high-order 16 bits register as "0".
It is necessary to use "K8Y000" when 32-bit data is required.
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
159
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
5.5
5.5 Bit Specification of a Word Device (D[ ].b)
Bit Specification of a Word Device (D[ ].b)
By specifying a bit of a word device, the specified bit can be used as bit data.
When specifying a bit of a word device, use a word device number and bit number (hexadecimal).
(Example: D0.0 ... Indicates the bit 0 of data register (D).)
Indexing is not available for both device numbers and bit numbers.
Target word device
Bit number
: Data register or special data register
: 0 to F (hexadecimal)
D0.F
D0.3
D0 F E D C B A 9 8 7 6 5 4 3 2 1 0
16 bits
5.6
Direct Specification of Buffer Memory (U[ ]\G[ ])
A buffer memory (BFM) of a special function units/blocks can be specified directly.
BFM is 16-bit or 32-bit word data, and is mainly used for operands in applied instructions.
For specifying a BFM, specify the unit number (U) of a special function units/blocks and the BFM number (\G)
consecutively.
(Example: U0\G0 ... Indicates the BFM #0 in the special function units/blocks whose unit number is 0.)
Indexing is available for BFM numbers.
The specification range is as follows:
Unit number (U).................... 0 to 7
BFM number (\G) ................ 0 to 32766
Example of MOV
instruction
Transfer Transfer
source destination
FNC 12
MOV
K10
U0\G10
Unit number
Example of indexing
BFM number
FNC 12
MOV
Transfer Transfer
source destination
K20
U0\G10Z0
Unit number
160
BFM #10
BFM #(10 + Z0)
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
1
Indexing
Introduction
5.7
5.7 Indexing
The functions and structures of index registers are explained in detail in "4.11 Index Register [V and Z]".
Refer to Section 4.11 in advance.
5.7.1
2
Indexing in basic instructions
Overview
In the case of bit devices
Y000
M0Z(0)
Y001
Cautions
2)
It is not permitted to use 16-bit counters as 32-bit counters by
executing indexing.
3)
When an octal device number of X or Y is indexed with an index
register, the contents of the index register are converted into octal, and then added to the device number.
For example, when the value of an index register added to the input X000 is changed in the order "K0 → K8 →
K16", the device number converted into octal is added to the input X000 and the input number is changed in the
order "X(000+0) = X000 → X(000+8) = X10 → X(000+16) = X20".
In the case of word devices and constants
When a 32-bit counter is used in OUT instruction, the set value
cannot be indexed with an index register.
X001
T0
9
FNC10-FNC19
Move & Compare
D0V2
V2 = 0 : The set value of T0 is the
present value of D0.
V2 = 10 : The set value of T0 is the
present value of D10.
8
FNC00-FNC09
Program Flow
1)
7
Basic
Instruction
The set value of word devices used in OUT instruction of T and C(0~199) can be indexed with index registers.
The indexing operation is explained in an example in which the set value
X030
D0 of T0 used in the index register V2 indexes OUT instruction (as shown
FNC 12
K0
V2
in the right figure).
MOVP
Transfer K0 or K10 to the index register V2 in advance.
K0 → V2
When X001 is set to ON, "D(0+0) = D0" if V2 is "0", and T0 operates with
X030
the set value D0.
FNC 12
K10
V2
When X001 is set to ON, "D(0+10) = D10" if V2 is "10", and T0 operates
MOVP
with the set value D10.
K10 → V2
6
Before
Programming
32-bit counters and special auxiliary relays cannot be indexed with
index registers.
5
Specified the
Device &
Constant
Z(0)=5 : X005=ON → Y000=ON
M5=ON → Y001=ON
Z(0)=10 : X012*2=ON → Y000=ON
M10=ON → Y001=ON
*2 Refer to the caution 3).
1)
Caution
4
Devices
in Detail
• In OUT instruction for a timer or counter, the timer number (or counter
number) and the device specified for the set value can be indexed.
3
Instruction
List
Bit devices [X, Y, M (except special auxiliary relays), T, and C (C0 to C199)] used in LD, LDI, AND, ANI, OR, ORI,
OUT, SET, RST, PLS, and PLF instructions can be indexed with index registers.
The figure shown on the right explains an indexing operation with the
X030
index register Z(0) for X000 and M0 in the LD instruction.
FNC 12
K5
Z(0)
Transfer K5 or K10 to the index register Z(0) in advance.
MOVP
If Z(0) is "5", "X(0+5) = X005". When X005 turns ON, Y000 turns ON and
K5 → Z(0)
"M(0+5) = M5". When M5 turns ON, Y001 turns ON.
X030
FNC 12
If Z(0) is "10", "X(0+10) = X012*1". When X012*1 turns ON, Y000 turns ON
K10
Z(0)
MOVP
and "M(0+10) = M10". When M10 turns ON, Y001 turns ON.
K10 → Z(0)
*1. Refer to the caution 3) below.
X000Z(0)
• The index registers Z0 to Z7 and V0 to V7 can be used for indexing.
10
FNC20-FNC29
Arith. & Logic
Operation
161
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
5.7.2
5.7 Indexing
Indexing in applied instructions
Expression of applied instructions allowing indexing
In the explanation of applied instructions, " " is added to the source S or destination D symbol to indicate
operands allowing indexing as shown in the figure below so that such operands can be discriminated from operands
not allowing indexing.
Indicates that indexing is allowed.
S
FNC 12
MOV
K100
D
D 10
In the case of bit devices
The indexing operation is explained in an example in which the
comparison result M0 in CMP (FNC 10) instruction is indexed with the
index register V1 (as shown in the figure on the right).
Transfer K0 or K10 to the index register V1 in advance.
When X001 is set to ON, "M(0+0) = M0" and the comparison result is
output to M0 to M2 if V1 is "0".
On the other hand, "M(0+10) = M10" and the comparison result is output
to M10 to M12 if V1 is "10".
• The index registers Z0 to Z7 and V0 to V7 can be used for indexing.
In the case of word devices
1. indexing operands in 16-bit instructions
The indexing operation is explained in an example in which the transfer
destination D0 in MOV instruction is indexed with the index register V3 (as
shown in the figure on the right).
Transfer K0 or K10 to the index register V3 in advance.
When X001 is set to ON, "D(0+0) = D0" if V3 is "0", and K500 is
transferred to D0.
When X001 is set to ON, "D(0+10) = D10" if V3 is "10", and K500 is
transferred to D10.
X000
FNC 12
MOVP
K0
V1
K0 → V1
X000
FNC 12
MOVP
K10
V1
K10 → V1
X001
FNC 10
CMP
V1=0
D0>D1 → M0=ON
D0=D1 → M1=ON
D0
X000
D0
D1
M0V1
V1=10
M10=ON
M11=ON
M12=ON
FNC 12
MOVP
K0
V3
K0 → V3
X000
FNC 12
MOVP
K10
V3
K10 → V3
X001
FNC 12
K500
D0V3
MOV
V3=0 : K500 → D0 (D0+0)
V3=10 : K500 → D10 (D0+10)
2. indexing operands in 32-bit instructions
In a 32-bit instruction, it is also necessary to specify a 32-bit index register
in the instruction.
When an index register Z (Z0 to Z7) is specified in a 32-bit instruction, the
specified Z and its counterpart V (V0 to V7) work together as 32-bit
registers.
The indexing operation is explained in an example in which the transfer
destinations [D1, D0] in DMOV instruction are indexed with the index
registers [V4, Z4] (as shown in the figure on the right).
Transfer K0 or K10 to the index registers [V4, Z4] in advance.
When X003 is set to ON, "[D(1+0), D(0+0)] = [D1, D0]" if [V4, Z4] is "0",
and K69000 is transferred to [D1, D0].
When X003 is set to ON, "[D(1+10), D(0+10)] = [D11, D10]" if [V4, Z4] is
"10", and K69000 is transferred to [D11, D10].
162
X002
FNC 12
DMOVP
K0
Z4
K0 → V4,Z4
X002
FNC 12
DMOVP
K10
Z4
K10 → V4,Z4
X003
FNC 12 K69000 D0Z4
DMOVP
V4,Z4=0 : K69000 → D1 ,D0 (D0+0)
V4,Z4=10 : K69000 → D11,D10 (D0+10)
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
5.7 Indexing
1
1)
When even if a numeric value written to index registers does not exceed the 16-bit numeric value range (0 to
32767), make sure to overwrite both V and Z using a 32-bit instruction. If only Z is overwritten and another
numeric value remains in V, the numeric value will be extremely large. Thus an operation error occurs.
2)
It is not permitted to use 16-bit counters as 32-bit counters by executing indexing.
When 32-bit counters are required, add Z0 to Z7 to counters C200 and later.
2
3)
It is not permitted to index V and Z themselves.
4)
Direct specification of buffer memory in special function units/blocks
In the direct specification of buffer memory "U \G ", the buffer memory number can be indexed with index
registers.
The unit number cannot be indexed with index registers.
("U0\G0Z0" is valid, but "U0Z0\G0" is invalid.)
Overview
Introduction
Cautions
5)
Indexing in bit digit specification
It is not permitted to index "n" in "Kn" used for digit specification.
("K4M0Z0" is valid, but "K0Z0M0" is invalid.)
6)
Indexing of I/O relays (octal device numbers)
When octal device numbers of X, Y, KnX, and KnY are indexed with
index register, the contents of an index register are converted into
octal, and then added to the device number.
In the example shown in the figure on the right, Y007 to Y000 are
output by MOV instruction, and inputs are switched by indexing X007
to X000, X017 to X010, and X027 to X020.
When rewriting the index value as "K0", "K8", "K16", the device
number converted into octal is added "X000 + 0 = X000", "X000 + 8 =
X10", "X000 + 16 = X20", and the input terminal working as the
source is changed accordingly.
Instruction
List
X030
X032
K0
V3
K0→V3
FNC 12
MOVP
K8
V3
K8→V3
FNC 12
MOVP
K 16
V3
X033
RUN monitor
Z0
5
(X003 to X000)BCD→(Z0)BIN
T 0Z0
Digital switch input
for setting timer
number X003 to X000
7
PLC
K4Y000
Basic
Instruction
FNC 18
BCD
(T0Z0)BIN→(Y017 to Y000)BCD
"T0Z0 = T0 to T9" according to "Z0 = 0 to 9"
8
FNC00-FNC09
Program Flow
Seven-segment display unit
output for displaying
timer current value
Y017 to Y000
In the case of constants
X004
FNC 12
MOVP
K0
V6
K0 → V6
X004
FNC 12
MOVP
K20
V6
K20 → V6
X005
163
10
FNC20-FNC29
Arith. & Logic
Operation
FNC 12
K6V6
D10
MOVP
V6=0 : K6 (K6+0) → D10
V6=20 : K26(K6+20) → D10
9
FNC10-FNC19
Move & Compare
The indexing operation is explained in an example in which the transfer
destination in MOV instruction is indexed with the index register V6 (as
shown in the figure on the right).
Transfer K0 or K20 to the index register V6 in advance.
When X005 is set to ON, "K(6+0) = K6" if V6 is "0", and K6 is transferred
to D10.
When X005 is set to ON, "K(6+20) = K26" if V6 is "20", and K26 is
transferred to D10.
6
Before
Programming
A sequence to display the present value of the timers T0 to T9 can be programmed index registers.
K1X000
5
Specified the
Device &
Constant
K16 → V 3
Display example of timer present value
FNC 19
BIN
4
Devices
in Detail
X031
FNC 12
MOVP
FNC 12 K2X0V3 K2Y0
MOV
V3=0 : X7 to X0 → Y7 to Y0
V3=8 : X17 to X10 → Y7 to Y0
V3=16 : X27 to X20 → Y7 to Y0
M8000
3
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5 How to Specify Devices and Constants to Instructions
Programming Manual - Basic & Applied Instruction Edition
5.7.3
5.7 Indexing
Indexing example for instruction with limited number of use.
By modifying the target device numbers using index registers V and Z, the target device numbers can be changed
using the program. In this way, an instruction with a limited number of uses per program can be used with multiple
devices.
Example using the TKY instruction (FNC 70)
Two groups of key entries (numeric keypad from 0 to 9)
store the input data to D0 and D2. Although the TKY
instruction (FNC 70) can only be programmed once,
modifying the head device number of the input data,
storage destination and pressed key information, the
information can be input from the two groups of keys
(numeric keypad from 0 to 9). Furthermore, even if V is
changed while this instruction is being executed, this
change is invalid.
The change is invalid until the instruction is no longer
being driven.
X010
(K0) → (V0)
K0
V1
(K0) → (V1)
K0
V2
(K0) → (V2)
FNC 12
MOVP
K16
V0
(K16) → (V0)
FNC 12
MOVP
K2
V1
(K2) → (V1)
FNC 12
MOVP
164
V0
FNC 12
MOVP
X013
K0
FNC 12
MOVP
X012
FNC 12
MOVP
K20
V2
(K20) → (V2)
FNC 70 X000V0 D0V1
TKY
TKY
Input Data Data
Storage
Instruction
Head
Device Destinati
Number
on
M0V2
Head Device
Number of
Pressed Key
Information
5 How to Specify Devices and Constants to Instructions
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
5.7 Indexing
Programming Manual - Basic & Applied Instruction Edition
1
Introduction
MEMO
2
Overview
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
165
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
6 What to Understand before Programming
Programming Manual - Basic & Applied Instruction Edition
6.1 How to Read Explanation of Instructions
6.
What to Understand before Programming
This chapter explains the I/O processing, relationship among instructions and programming method which should be
understood before creating sequence programs.
6.1
How to Read Explanation of Instructions
In this manual, applied instructions are explained in the following form.
For the expression methods and basic rules for applied instructions, read in advance "6.5 General rules for applied
instructions" described later.
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
10 Arithmetic and Logical Operation ( , , , ) – FNC 20 to FNC 29
Programming Manual - Basic & Applied Instruction Edition
1
FNC 20 – ADD / Addition
Introduction
10.1
10.1 FNC 20 – ADD / Addition
Outline
1. Instruction format
D
FNC 20
ADD
Mnemonic
16-bit Instruction
P
7 steps
Operation Condition
32-bit Instruction Mnemonic
ADDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DADD
DADDP
2. Set data
Operand type
Description
3
Instruction
List
Continuous
Operation
Pulse (Single)
Operation
ADD
2
Overview
This instruction executes addition by two values to obtain the result (A + B = C).
For the floating point addition instruction EADD (FNC120), refer to Section 18.8.
Data type
Data for addition or word device number storing data
16- or 32-bit binary
S2
Data for addition or word device number storing data
16- or 32-bit binary
D
Word device number storing the addition result
16- or 32-bit binary
4
Devices
in Detail
S1
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
X Y M T C S D .b KnX KnY KnM KnS T
C D
Others
Special
Unit
System User
R
U \G
S1
1
1
1
Z Modify K
H
Real
CharacPointer
Number ter String
E
" "
P
2
5
2
D
V
Constant
2
S2
Index
Specified the
Device &
Constant
Operand
Type
6
Before
Programming
1: This function is supported only in FX3G/FX3GC/FX3U/FX3UC PLCs.
2: This function is supported only in FX3U/FX3UC PLCs.
Explanation of function and operation
7
1. 16-bit operation (ADD and ADDP)
Command
input
are added to S1
FNC 20
ADD
S1
in binary format, and the addition result is transferred to
S2
D
S1
+ S2
D
.
Basic
Instruction
The contents of S2
D
• When a constant (K) is specified in S1
or S2
, it is automatically converted into binary format.
2. 32-bit operation (DADD and DADDP)
The contents of [ S2
transferred to [ D1
FNC 20
DADD
S1
S2
] are added to [ S1
+1,
S1
] in binary format, and the addition result is
9
].
S2
D
[ S1 +1, S1
] + [ S2
+1, S2
]
D
1, D
]
• The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is added algebraically.
5500 + ( 8540) = 3040
+1, S1
] or [ S2
+1, S2
], it is automatically converted into binary
10
FNC20-FNC29
Arith. & Logic
Operation
• When a constant (K) is specified in [ S1
format.
FNC10-FNC19
Move & Compare
Command
input
+1,
+1, D1
8
FNC00-FNC09
Program Flow
• The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is added algebraically.
5 + ( 8) = 3
265
The above is different from the actual page, as it is provided for explanation only.
166
Indicates applicable
PLC versions.
Applicable
series
Expression of applicable versions
– → Ver. 2.20: before Ver. 2.20
– Ver. 2.20 →: Ver. 2.20 or later
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
6 What to Understand before Programming
Programming Manual - Basic & Applied Instruction Edition
6.1 How to Read Explanation of Instructions
1
1. Instruction format
1)
The applied instruction number (FNC No.) and instruction mnemonic are indicated. The table below shows the
meaning of simplified expression.
Description
Applicable
instruction
(example)
No.
FNC 12
Instruction name
P
MOV
Dotted lines on the upper left and lower left sides indicate an independent instruction
WDT (FNC 07)
not associated with the 16-bit or 32-bit type.
D
No.
FNC 12
Instruction name
P
MOV
Continuous lines on the upper left side indicates that 16-bit type is available. "D" on the
MOV (FNC 12)
lower left side indicates that the 32-bit type is available.
D
No.
FNC 12
Instruction name
P
MOV
Dotted lines on the lower left side indicate that the 32-bit type does not exist.
CJ (FNC 00)
Continuous lines on the upper left side indicate that only the 16-bit type is available.
2
Overview
Mark
Introduction
Outline
3
Continuous lines on the upper right side indicate that the continuous operation type is
CMP (FNC 10)
available. "P" on the lower right side indicates that the pulse operation type is available.
No.
FNC 12
Instruction name P
D MOV
Dotted lines on the lower right side indicate that the pulse operation type does not exist.
Continuous line on the upper right side indicate that only the continuous operation type MTR (FNC 52)
is available.
FNC
Instruction
DMOV name P
"
6
"on the upper right side indicates that the contents of the destination change in
every operation cycle when the continuous operation type is used.
INC (FNC 24)
When operation should be executed only during the driving of an instruction, use the
pulse operation type indicated by "P" on the lower right side.
2. Set data
1)
Contents
The contents of operands in each instruction are described below.
2)
Indexing of the source and destination
In operands to which " " is added such as S
and S1 , indexing is available.
Operands not allowing indexing are expressed as S and S1 .
:
:
:
:
:
:
:
:
:
:
:
:
:
8
Bit device
16-bit binary code
32-bit binary code
64-bit binary code
16-bit or 32-bit binary code
32-bit or 64-bit binary code
4-digit (16-bit) BCD code
8-digit (32-bit) BCD code
4-digit (16-bit) or 8-digit (32-bit) BCD code
Character code such as ASCII code and shift JIS code
ASCII code
Binary floating point
Scientific notation
9
FNC10-FNC19
Move & Compare
-
Data types
Bit
16-bit BIN
32-bit BIN
64-bit BIN
16/32-bit BIN
32/64-bit BIN
4-digit BCD
8-digit BCD
4/8-digit BCD
Character string
Character string (only ASCII)
Real number (binary)
Real number (decimal)
FNC00-FNC09
Program Flow
3)
7
Basic
Instruction
The contents of devices that can be specified as operands in instructions and available data types are described
below:
Before
Programming
No.
12
5
Specified the
Device &
Constant
No.
FNC 12
Instruction name P
D MOV
Devices
in Detail
Dotted lines on the upper left side indicate that the 16-bit type does not exist. "D" on the
HSCS (FNC 53)
lower left side indicates that only the 32-bit type is available.
Instruction
List
No.
FNC 12
Instruction name
D MOV
P
4
10
FNC20-FNC29
Arith. & Logic
Operation
167
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
6 What to Understand before Programming
Programming Manual - Basic & Applied Instruction Edition
6.1 How to Read Explanation of Instructions
Applicable devices
Devices which can be specified in operands of instructions are shown.
When a device supports an instruction, " " is added to the device.
1)
Bit devices
•X : Input relay (X)
•Y : Output relay (Y)
•M : Auxiliary relay (M)
•S : State relay (S)
etc.
2) Word devices
•K : Decimal integer
•H : Hexadecimal integer
•KnX: Input relay (X) with digit specification*1
•KnY: Output relay (Y) with digit specification*1
•KnM: Auxiliary relay (M) with digit specification*1
•KnS: State relay (S) with digit specification*1
•T : Timer (T) current value
•C : Counter (C) current value
•D : Data register (file register)
•V, Z: Index register
•Modify: Availability of indexing using index register
etc.
*1.
Kn without specification indicates K1 to K4 for 16 bits, and K1 to K8 for 32 bits.
Explanation of function and operation
The function of each instruction is explained.
Cautions
Cautions on using each instruction are described.
Errors
Major errors that are possible to occur in each instruction are described.
For details on errors, refer to "Chapter 38. Error Check Method and Error Code List".
Program examples
Concrete program examples using each instruction are described.
168