How To Specify Devices And Constants In Instructions; Numeric Values Handled In Plcs (Octal, Decimal, Hexadecimal And Real Numbers); Types Of Numeric Values - 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.

How to Specify Devices and Constants in Instructions

This chapter explains how to specify sources and destinations in instructions, which is the basis for handling
PLC instructions.
• Specifying constants (decimal, hexadecimal and real numbers)
• Specifying digits of bit devices
• Specifying bit positions in data registers
• Directly specifying BFM (buffer memory) in special function blocks/units
• Indexing by adding index registers
3.1
Numeric Values Handled in PLCs (Octal, Decimal, Hexadecimal and
Real Numbers)
FX PLCs handle five types of numeric values according to the application and purpose.
This section explains the roles and functions of these numeric values.
3.1.1

Types of numeric values

1. Decimal number (DEC)
• Set value (constant "K") of timers and counters
• Device numbers of auxiliary relays (M), timers (T), counters (C), state relays (S), etc.
• Numeric values used as operands and instruction operations in instructions (constant "K")
2. Hexadecimal number (HEX)
• Numeric values used as operands and instruction operations in instructions (constant "H")
3. Binary number (BIN)
For a timer, counter or data register, a numeric value is specified
in the decimal or hexadecimal notation as described above. But
all of these numeric values are handled in the binary notation
inside PLCs.
When these devices are monitored in peripheral equipment,
they are automatically converted into the decimal notation as
shown in the right figure (, and can be converted into the
hexadecimal notation).
• Handling of negative value
A negative value is expressed in two's complement inside
PLCs.
For details, refer to the explanation of NEG instruction in the
following manual.
→ FX Structured Programming Manual [Basic & Applied
4. Octal number (OCT)
In FX PLCs, device numbers of input relays and output relays are assigned in octal.
Because "8" and "9" do not exist in the octal notation, device numbers are carried in the way "0 to 7, 10 to 17
... 70 to 77, 100 to 107".
5. Binary-coded decimal (BCD)
The BCD notation expresses each numeric value from 0 to 9 constructing each digit of a decimal number as a
4-bit binary number.
Because each digit can be handled easily, this notation is adopted for controlling digital switches of BCD
output type and seven-segment display units.
6. Real number (floating point data)
PLCs have the floating point operation function to perform high-accuracy operation.
In floating point operations, binary floating point values (real numbers) are used, and decimal floating point
values (real numbers) (scientific notation) are also used for monitoring binary floating point values.
FX
/FX
/FX
0S
0
0N
124
/FX
/FX
/FX
/FX
/FX
1S
1N
1NC
U
3 How to Specify Devices and Constants in Instructions

3.1 Numeric Values Handled in PLCs (Octal, Decimal, Hexadecimal and Real Numbers)

Instruction]
PLCs do not support floating point operations.
2C
Example of decimal number input
(Decimal)
0:Positive value 1:Negative value
0
0
0
0
0
0
1
1
0
0
Automatic
conversion
1+4+16+256+512
=789
(Decimal)
Monitoring in programming tool
Input from
keyboard
K 7 8 9
(Binary)
0
1
0
1
0
1
K 7 8 9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-lMelsec-fFx3sFx3gFx3gcFx3u ... Show all

Table of Contents