
4.1 User Program Types and Execution Timing
4.1.5 Registers
4-52
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.
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
Format
This section describes the formats of array registers.
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.
Contents
Use
Usable Registers
Array name
All registers with any data type (excluding # and C registers)
Array elements
•
All registers with integer and double-length integer data
types (excluding # and C registers)
•
Constants
•
Index registers
DW00000 = 2;
DB000020 = MB00000000[DW00000];
DB000020 = MB00000002;
Equivalent
DW00000 = 30;
DL00002 = ML0000002[DW00000];
DL00002 = ML0000062;
Equivalent
MOV[A1]ML00000[MW00100];
ML0000200 = 0;
DW00000 = 0;
WHILE DW00000 < 50;
ML0000200 = ML0 ML0000100[DW00000];
DW00000 = D 1;
WEND;
END;
Содержание MP3000 Series
Страница 153: ...4 1 User Program Types and Execution Timing 4 1 2 Motion Programs 4 20 Ladder Program Example...
Страница 212: ...5 4 Tuning 5 70 5 4 1 Using SigmaWin When Using a Servo 5 70 5 4 2 Using DriveWizard Plus When Using an Inverter 5 70...
Страница 274: ...5 3 Monitoring Machine Operation 5 3 3 Realtime Tracing 5 64...