6-12 Writing the User Program ECODRIVE03-FL*-04VRS
DOK-ECODR3-FL*-04VRS**-FK01-EN-P
Indexed Variables
In order to address variables with indexes in program loops, two variable
fields of the same type have been defined. Eight indexed variables are
available. The function within the variable field is assigned and enables a
calculation of a variable address using the formula:
[][][]
508*50950 VVxVNumberVariablecalculated +=
[][][]
518*51951 VVxVNumberVariablecalculated +=
L: [ ] Contents
L: [V50x] = Contents of V500 – V507
L: [V51x] = Contents of V510 – V517
Fig. 6-4: Formula for Calcualating Indexed Variables
The contents of variables V509 and V508 (or V519 and V518) are
multiplied and added to the contents of Variable 50x (or V51x). The
resulting value is the variable number that is then processed in the called
function.
Variables Definition
500 # of Basis Variable 1
501 # of Basis Variable 2
502 # of Basis Variable 3
503 # of Basis Variable 4
504 # of Basis Variable 5
505 # of Basis Variable 6
506 # of Basis Variable 7
507 # of Basis Variable 8
508 Offset Factor 1
509 Variable Index 1
Fig. 6-5: Variable Block 1
Variables Definition
510 # of Basis Variable 1
511 # of Basis Variable 2
512 # of Basis Variable 3
513 # of Basis Variable 4
514 # of Basis Variable 5
515 # of Basis Variable 6
516 # of Basis Variable 7
517 # of Basis Variable 8
518 Offset Factor 2
519 Variable Index 2
Fig. 6-6: Variable Block 2