Constant - Mitsubishi Electric MELSEC iQ-F Series Programming Manual

Hide thumbs Also See for MELSEC iQ-F Series:
Table of Contents

Advertisement

4.6

Constant

Types of constants
The following table shows the expressions for setting a constant to a label.
Applicable data type
Bit
• Word [Unsigned]/Bit String [16-bit]
• Double Word [Unsigned]/Bit String [32-
bit]
• Word [Signed]
• Double Word [Signed]
FLOAT [Single Precision]
String(32)
Time
*1 In the binary notation, the octal notation, the decimal notation, the hexadecimal notation, and the real number notation, values can be
delimited by an underscore (_) to make programs easy to read. (In the program processing, underscores are ignored.)
When "$" is used in character string type data
"$" is used as an escape sequence. Two hexadecimal numbers after "$" are recognized as an ASCII code, and characters
corresponding to the ASCII code are inserted in the character string. If no ASCII code for the two hexadecimal numbers after
"$" exists, a conversion error occurs. However, when any of the following characters is described after "$", no error occurs.
Expression
$$
$'
$''
$L or $l
$N or $n
$P or $p
$R or $r
$T or $t
4 LABELS
40
4.6 Constant
Type
Expression
Boolean data
Input "TRUE" or "FALSE".
Binary
Append "2#" in front of a binary number.
Octal
Append "8#" in front of an octal number.
Decimal
Directly input a decimal number, or append "K" in front of a
decimal number.
Hexadecimal
Append "16#" or "H" in front of a hexadecimal number.
*1
Binary
Append "2#" in front of a binary number.
*1
Octal
Append "8#" in front of an octal number.
*1
Decimal
Directly input a decimal number or append "K" in front of a
decimal number.
*1
Hexadecimal
Append "16#" in front of a hexadecimal number.
Or append "H" in front of a value.
*1
Real number
Directly input a real number, or append "E" in front of a real
number.
Real number
Append "E" in front of an exponent expression or a real number.
(exponent
Append "+" in front of exponent part.
expression)
Character string
Enclose a character string with single quotations (').
Time
Append "T#" in front.
Symbol that is used in character string, or printer code
$
'
''
Line feed
Newline
Page (form feed)
Return
Tab
Example
TRUE, FALSE
2#0, 2#1
8#0, 8#1
0, 1, K0, K1
16#0, 16#1, H0, H1
2#0010, 2#01101010,
2#1111_1111
8#0, 8#337, 8#1_1
123, K123, K-123,
12_3
16#FF, HFF, 16#1_1
2.34, E2.34, E-2.34,
3.14_15
1.0E6, E1.001+5
'ABC'
T#1h,
T#1d2h3m4s5ms

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec iq-f fx5

Table of Contents