Constant; Decimal Constant (K); Hexadecimal Constant (H); Real Constant (E) - Mitsubishi Electric FX5 User Manual

Melsec iq-f series
Hide thumbs Also See for FX5:
Table of Contents

Advertisement

26.10

Constant

This section explains constants.

Decimal constant (K)

Device that specifies decimal data for the program. Specified by K. (Example: K1234)
The specification range is determined by type of argument data of instruction using a decimal constant.
Argument data type of instruction
Data size
16 bits
32 bits

Hexadecimal constant (H)

Device that specifies hexadecimal data for the program. Specified by H. (Example: H1234)
When specifying BCD data, specify each digit of hexadecimal number in 0 to 9. The specification range is determined by type
of argument data of instruction using a hexadecimal constant. If data size is 16 bits, H0 to HFFFF; if 32 bits, H0 to
HFFFFFFFF.

Real constant (E)

Device that specifies real numbers for the program. Specified by E. (Example: E1.234)
Setting range of real numbers
The setting range of real numbers is explained below.
128
-126
-2
≤Device≤-2
, 0, 2
(E-3.40282347+38 to E-1.17549435-38, 0, E1.17549435-38 to E3.40282347+38)
Operation during calculation
■Operation at overflow and underflow
Operation is as follows if overflow or underflow occurs during calculation.
• Overflow: Error occurs.
• Underflow: Becomes "0" without error occurring.
■Operation when special value
If calculation is performed when input data is a special value, an error occurs. If "-0" occurs during calculation, it is treated as
"+0"; the calculation result does not become "-0".
*1 Special values are -0, denormalized numbers, non-numbers, ±∞.
Programming expressions
Real numbers can be specified by the following expressions.
• Normal expression: Specify a numeric value as it is. (Example: E10.2345 in the case of 10.2345)
• Scientific notation: Specify a numeric value in the format "numeric value" ×10n. (Example: E1.234+3 in the case of 1234.
"+3" represents "10

Character string constant

Device that specifies character string. Shift JIS code character strings can be used. Character strings end with NULL
character (00H). Specify by "character string".
26 DEVICES
318
26.10 Constant
Data type name
Word (signed)
Word (unsigned)/Bit string (16-bit)
Double word (signed)
Double word (unsigned)/Bit string (32-bit)
-126
128
≤Device≤2
*1
is input
3
".)
Specification range of decimal constants
K-32768 to K32767
K0 to K65535
K-2147483648 to K2147483647
K0 to K4294967295

Advertisement

Table of Contents
loading

Table of Contents