Chapter 8 Logic Instructions
8-325
Address Instruction
FC
ADR is used to get the address of a variable.
DVP15MC11T-06
Parameters
Meaning
Description Valid range
In Input vlaue
Input
The variable of which the address is to be
ouput
of the variable that the
input parameter is
Out
Operation
result
Output Output variable address of IN
of the variable that the
output parameter is
Boolean
Bit string Integer
Real
number
Time, date
String
Pointer
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
Pointer To xx
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
●
Note:
1. The symbol ● indicates that the parameter is allowed to connect to the variable of the data type.
2. The data type xx of ‘Pointer To xx’ must be the same as that of IN.
Function Explanation
The ADR instruction is used to get the address of a variable. Get the variable address and then find
the value stored in the variable address by using the symbol ^.
Programming Example
The ADR instruction is used to get the address of input variable ADR_In and place it in the output
variable ADR1. The address of ADR_In is %MW0. After the ADR instruction is executed, ADR1 points
to %MW0. After ADD is executed, ADR1 points to %MW1. ADR1^ means to get the value from the
address of ADR1. (ADR1 value is %MW1 and ADR1^ means to get the value in %MW1.) The value
in %MW1 is moved to the OUT1 variable through executing MOVE instruction.