Data Representation Methods; Constants - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS

3.3 Data Representation Methods

3.3.1 Constants

3 - 8
Constants, labels and devices can be used as data in ST programs.
Item
Constant
Numeric value or character string data written directly to
a program. It does not change during program execution.
Label
Data whose type and name are defined by the user.
Device
Device used by the QCPU (Q mode)/LCPU. It is
identified by the device name and device number.
Each constant is represented as described below in ST programs.
Data Type
Numeric Notation
Binary
BOOL
Octal
Hexadecimal
Binary
Octal
Decimal
INT
DINT
Hexadecimal
REAL
STRING
For the range that can be specified for each constant, refer to Section 3.2.1 Data types.
The following ranges apply to the areas that are not described in Section 3.2.1 Data types.
Description
Representation Method
TRUE • FALSE 1•0
The used binary number is preceded by "2#".
The used octal number is preceded by "8#".
The used hexadecimal number is preceded
by "16#".
The used binary number is preceded by "2#".
The used octal number is preceded by "8#".
The used decimal number is preceded by
"10#".
(The numeric value may be preceded by "K".)
The used hexadecimal number is preceded
by "16#".
(The numeric value may be preceded by "H".)
The used real number is directly input.
(The numeric value may be preceded by "E".)
A character string is enclosed by ' ' (or " ").
Representation
Example
123, "ABC"
Switch_A
X0, Y0, D100, J1\X0
Example
M0 := TRUE;
M0 := 2#0;
M0 := 2#1;
M0 := 8#0;
M0 := 8#1;
M0 := 16#0;
M0 := 16#1;
D0 := 2#110;
D0 := 8#377;
D0 := 123;
D0 := K123;
D0 := 16#FF;
D0 := HFF;
ABC := 2.34;
Rtest := E2.34;
Stest := 'ABC';
Stest := "ABC";
3 - 8

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents