YASKAWA SGD7C-***AMAA*** Product Manual page 346

Ac servo drive
Table of Contents

Advertisement

Array Registers ([ ])
Array registers are used to modify register addresses.
They are used to handle register addresses as variables.
As with indices, an offset can be added to the register address.
 Attaching an Array Register to a Bit Register
Using an array register is the same as adding the value of the array register to the register
address.
For example, if DW00000 = 2, MB00000000[DW00000] is the same as MB00000002.
DW00000 = 2;
DB000020 = MB00000000[DW00000];
 Attaching an Array Register to a Register Other Than a Bit Register
Using an array register is the same as adding the word size of the data type of the array register
times the value of the array register to the register address.
For example, if DW00000 = 30, ML0000002[DW00000] is the same as ML0000062.
DL00002 = ML00000 (30×2 + 2) = ML0000062
DW00000 = 30;
DL00002 = ML0000002[DW00000];
 Format
This section describes the formats of array registers.
MOV[A1]ML00000[MW00100];
Description
Use
Array name
Array elements
 Programming Example
In the following example, an array register is used to calculate the total amount of 50 registers
from ML0000100 to ML0000198. That amount is then stored in ML0000200.
ML0000200 = 0;
DW00000 = 0;
WHILE DW00000 < 50;
ML0000200 = ML0000200 + ML0000100[DW00000];
DW00000 = DW00000 + 1;
WEND;
END;
7.1 User Program Types and Execution Timing
Equivalent
DB000020 = MB00000002;
Equivalent
DL00002 = ML0000062;
Usable Registers
All registers with any data type (excluding # and C registers)
• All registers with integer and double-length integer data types
(excluding # and C registers)
• Constants
• Index registers
7.1.5 Registers
7
7-37

Advertisement

Table of Contents
loading

Table of Contents