Mitsubishi Electric MELSEC Q Series Programming Manual page 51

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

Advertisement

Expression of arrays
To identify individual labels of an array, append an index enclosed by '[ ]' after the label name. Values that can be specified for
indexes are within the range from -32768 to 32767.
For an array with two or more dimensions, delimit indexes in '[ ]' by ','.
Example)
boolary1 [0]
boolary2 [0.3]
Label name
index
For the ST and structured ladder/FBD languages, labels (word (signed) or double word (signed) data type) can be used for
indexes as shown below.
Note that Z0 or Z1 cannot be used in the programs if labels are used for indexes.
[Structured ladder/FBD]
[ST]
FOR Index1:=0
TO 4
BY 1 DO
INC(TRUE,Var_D0[Index1]);
END_FOR;
■Precautions
The following explains precautions for the index of an array.
• When a label or a device is specified for an array index, the operation is performed with a combination of multiple sequence
instructions. Therefore, if an interruption occurs during the operation of the array label, an unintended operation result may
be produced. When using interrupt programs, use interrupt disable/enable instructions (DI/EI instructions) as necessary.
• If the index which is outside of the defined range is specified for an array index
• An operation error occurs.
• A current value of other label is referred or written.
*1 For example, a value other than the value within 0 to 2 is used for the index of an array which is declared with the bit array (0..2).
*1
, any of the following operations occur.
4 PROGRAM CONFIGURATION
4.4 Method for Specifying Data
4
49

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec f seriesMelsec l series

Table of Contents