Specification Of Digits For Bit Devices (Kn ***) - Mitsubishi Electric MELSEC-Q Structured Programming Manual

Hide thumbs Also See for MELSEC-Q:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
[Device & Common]
3.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 which handle numeric values such as T, C, D and R are called word devices.
Even bit devices can handle numeric values when they are combined. In this case, the number of digits "Kn"
and the head device number should be combined.
The number of digits is expressed in units of 4 bits. "K1" to "K4" are used for 16-bit data, and "K1" to "K8" are
used for 32-bit data.
For example, "K2M0" indicates 2-digit data handled by M0 to M7.
0
1
0
Sign bit (0 = Positive, 1 = Negative)
Do not change.
M15
M14 M13
Sign bit (0 = Positive, 1 = Negative)
0
0
0
When 16-bit data is transferred to K1M0 to K3M0, data is not transferred to high-order bits because the data
length is insufficient.
32-bit data is transferred in the same way.
When the number of digits specified for bit devices is "K1" to "K3" in a 16-bit (or "K1" to "K7" in a 32-bit)
operation, insufficient high order bits are always regarded as "0". It means that such data is always positive.
M0
KZX004
A bit device number can be specified arbitrarily usually, but it is recommended to set the least significant digit
to "0" for X and 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 words with digit specification, they are specified as shown below when they are handled as a
series.
• K1X000,
• K2Y010,
• K3M0,
• K4S16,
Use the above devices in units of digit so that devices are not skipped.
When "K4Y000" is used in a 32-bit operation, high-order 16 bits are regarded as "0".
It is necessary to use "K8Y000" when 32-bit data is required.
1
0
1
0
1
M12 M11 M10
M9
M8
0
0
0
0
0
BIN
EN
ENO
s
d
D0
K1X004,
K1X010,
K2Y020,
K2Y030••••••
K3M12,
K3M24,
K4S32,
K4S48••••••
3 How to Specify Devices and Constants in Instructions
3.4 Specification of Digits for Bit Devices (Kn ***)
0
1
0
1
D 0
Transferred
K2M0 0
0
1
0
1
M7
M6
M5
M4
M3
Transferred
D 1
0
1
0
1
2-digit BCD data handled by X004 to X013 is converted into
binary data, and then transferred to D0.
K1X014••••••
K3M36••••••
0
1
0
1
Low order
0
1
0
1
M2
M1
M0
Low order
0
1
0
1
1
2
3
4
5
6
7
131

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-lMelsec-fFx3sFx3gFx3gcFx3u ... Show all

Table of Contents