Expressing Methods Of Constants; Precautions On Programming; Precautions On Assigning A Name - Mitsubishi Melsec-Q Series Structured Programming Manual

Application functions, qcpu
Hide thumbs Also See for Melsec-Q Series:
Table of Contents

Advertisement

3.6

Expressing Methods of Constants

The following table shows the expressing method for setting a constant to a label.
Constant
type
Bool
Binary
Octal
notation
Decimal
Hexadecimal
Real
number
Character
string
3.7

Precautions on Programming

Reserved words cannot be used for a name that is used in a program (label name, function block
instance name, structured data type name, etc.).
3.7.1

Precautions on assigning a name

This section explains the conditions for assigning a name and shows the list of reserved words.
Conditions
(1) Specify a name by a character string of up to 32 characters.
(2) Do not use a reserved word.
For reserved words, refer to Table 3.7-1 Reserved words.
(3) Use alphanumeric and underscore (_).
(4) Do not use an underscore at the end of a name.
Do not use two or more underscores in succession.
(5) Do not use a space.
(6) Do not use a number at the initial character.
(7) A constant cannot be used.
(An identifier that begins with 'H' or 'h' and an expression where a hexadecimal (0 to F)
immediately follows 'H' or 'h' (maximum 9 digits including 'H' or 'h' (excluding 0 that
immediately follows 'H' or 'h')) are also treated as a constant. (Example: 'hab0'))
3.6 Expressing Methods of Constants
3-10
3.7.1 Precautions on assigning a name
Table 3.6-1 Constant expressing method
Input FALSE or TRUE, or input 0 or 1.
Append '2#' in front of a binary number.
Append '8#' in front of an octal number.
Directly input a decimal number, or append 'K' in front of a decimal number.
Append '16#' or 'H' in front of a hexadecimal number.
When a lowercase letter 'h' is appended, it is converted to uppercase automatically.
Directly input a real number or append 'E' in front of a real number.
Enclose a character string with single quotations (') or double quotations (").
Expressing method
Example
TRUE, FALSE
2#0010, 2#01101010
8#0, 8#337
123, K123
16#FF, HFF
2.34, E2.34
'ABC', "ABC"

Advertisement

Table of Contents
loading

This manual is also suitable for:

Q-kp-ok-e13jw08

Table of Contents