Mitsubishi MELSEC System Q Manual page 76

Hide thumbs Also See for MELSEC System Q:
Table of Contents

Advertisement

The IEC 61131-3 Standard
Class
The class keyword assigns the variable a property that defines how it is to be used in the pro-
ject. Some examples:
VAR: Local variable for use within the POU
VAR_EXTERNAL: An external global variable is declared in the Global Variable List and
can be read and written by all POUs.
VAR_CONSTANT: Local variable with constant value for use within the POU.
Identifier
Each variable is given a symbolic address. This individual name (identifier) can be chosen
freely but must always begin with a letter or a single underline character. Spaces and mathe-
matical operator characters (e.g. +, - ,*) are not permitted.
Examples for identifiers:
S02.3
Drive_2_ready
_Open_Valve
Motor_M1_ON
The use of symbolic declarations complies with IEC 61131.3.
Absolute addresses
When global variables are declared they should also be assigned absolute addresses. If you
do not assign the absolute addresses manually, they are assigned automatically. An absolute
address specifies the memory location of the variable in the CPU or an input or output.
Absolute addresses can be assigned using either the IEC syntax (IEC-Adr.) or the MELSEC
syntax (MIT-Addr.). Some examples for absolute addresses:
Input X0F = X0F (MELSEC syntax) = %IX15 (IEC syntax)
Output Y03 = Y03 (MELSEC syntax) = %QX3 (IEC syntax)
Elementary Data Types
The data type defines the characteristics of a variable like value range or number of bits.
Data type
BOOL
INT
DINT
WORD
DWORD
REAL
TIME
STRING
4 – 12
Value range
Boolean
0 (FALSE), 1 (TRUE)
Integer
-32768 to +32767
Double Integer
-2,147,483,648 to 2,147,483,647
Bit string 16
0 to 65535
Bit string 32
0 to 4.294.967.295
Floating point value
3.4E +/-38 (7 digits)
Time value
-T#24d0h31m23s64800ms to T#24d20h31m23s64700ms
Character string
Character strings are limited to16 characters
An Introduction to Programming
MITSUBISHI ELECTRIC
Size
1 Bit
16 Bits
32 Bits
16 Bits
32 Bits

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents