159
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
Programming Manual - Basic & Applied Instruction Edition
5 How to Specify Devices and Constants to Instructions
5.4 Specification of Digits for Bit Devices (Kn[ ]***)
1
Introduction
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
5.4 Specification of Digits for Bit Devices (Kn[ ]***)
Handling of bit devices
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 32-
bit data.
For example, "K2M0" indicates two-digit data expressed by M0 to M7.
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.
Two-digit BCD data expressed by X004 to X013 is converted into binary
data, and then transferred to D0.
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.
Specification of consecutive words
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:
• K1X000, K1X004, K1X010, K1X014 .....
• K2Y010, K2Y020, K2Y030 .....
• K3M0, K3M12, M3M24, K3M36 .....
• K4S16, K4S32, K4S48 .....
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.
Sign bit (0 = Positive, 1: Negative)
Transferred
Low order
M15 M8 M7 M0
Do not change
D 0
D 1
K2M0
Transferred
Sign bit (0 = Positive, 1: Negative)
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1
M6 M5M12 M11 M10 M9 M4 M3 M2 M1
M14 M13
Low order
M0
FNC 19
BIN
K2X004 D0