Constants; Character String Constants; Numeric Constants - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

2 THE BASICS OF AD51H-BASIC

2.7 Constants

2.7.1 Character string constants

2.7.2 Numeric constants

2 - 10
Constants are fixed values used when a BASIC program is executed. There are two
types of constants: character constants and numeric constants.
Character string constants are any character strings that can be contained in a
character set up to a maximum of 255 characters enclosed by quotation marks (").
Example
"HELLO"
"$25,000.00"
A character string that has a character length of 0 is
referred to as an empty character string.
In this manual, empty character strings are denoted by " ".
Numeric constants are positive or negative numbers. Numeric constants cannot
contain any commas. There are the following 5 types of numeric constants.
(1) Integer constants
All integers between –32768 to +32767, with or without a % symbol. Decimal
points cannot be added.
Example
100
+123
-32768
32767%
(2) Fixed decimal point constants
Positive or negative real numbers (numbers that include decimal points),
including all integers that are not included in (1) above.
Example
100.0
-123.21
(3) Floating-point constants
Positive or negative numbers expressed in exponential format.
Floating-point constants are comprised of an integer or fixed decimal point
number (base number), followed by the letter E, and then an integer (exponent).
Floating-point constants can express values between 10
Example
235.988E-7
2359E6
(Double-precision floating-point constants use D instead of E.)
• • • • •
0.0000235988
• • • • •
2359000000
MELSEC-Q
-38
+38
to 10
.
2 - 10

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents