Structures - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

• The data storage location becomes dynamic by specifying a device for the array index. This enables arrays
to be used in a program that executes loop processing. The following is a program example that
consecutively stores "1234" in the "uLabel4" array.
FOR #0 = K0 TO K9 STEP K1
NEXT
• When the device number of a device assigned to a label exceeds 32767, specify a 32 bit integer device to
the index.
(Example)
Assigning "D32000" to the start device of label array "uLabel4", and also accessing D32768 onwards by
specifying "#0" to the index of the array.
uLabel4[#0L]
Precautions
■When an event task is used
When a device is specified for the array index, the operation is performed with a combination of multiple instructions. For this
reason, if an interrupt occurs during operation of the label defined as an array, data inconsistency may occur producing an
unintended operation result.
To prevent data inconsistency, perform one of the following.
• Do not change the device being used as the index in a normal task during the event task.
• Use the DI/EI instructions that disables/enables event tasks before and after using the label defined in the array.
■Array elements
When accessing the element defined in an array, access it within the range of the number of elements.
If a constant out of the range defined for the array index is specified, an error will occur when converting the Motion SFC
program.
If the array index is specified with data other than a constant, an error will not occur when converting the Motion SFC program.
The processing will be performed by accessing another device.

Structures

A structure is a data type containing one or more labels and can be used in all programs.
Members (labels) included in a structure can be defined even when their data types are different.
Creating structures
To create a structure, first define the structure, and then define members in the structure.
Structure
Member (Label1)
Member (Label2)
Member (Label3)
Member (Label4)
4 OPERATION CONTROL PROGRAMS
128
4.4 Labels
uLabel4[#0] = K1234

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents