This address operator is not specified by the standard IEC 61131-3.
ADR returns the address of its argument in a DWORD. This address can be assigned to a pointer within the project.
NOTE: EcoStruxure Machine Expert allows you to use the ADR operator with function names, program names, function block names, and method names.
Refer to the chapter Pointers and consider that function pointers can be passed to external libraries. Nevertheless, there is no possibility to call a function pointer within EcoStruxure Machine Expert. In order to enable a system call (runtime system), set the respective object property (in the menu View > Properties... > Build) for the function object.
dwVar:=ADR(bVAR);
LD bVar
ADR
ST dwVar
Considerations for Online Changes
Executing the command Online Change can move variables to another place in the memory. There is an indication during online change if copying is necessary.
The shift of variables may have the effect that POINTER variables point to invalid memory. So, ensure that a pointer is not kept between cycles, but is reassigned in each cycle.
|
UNINTENDED EQUIPMENT OPERATION |
Assign the value of any POINTER TO type variable(s) prior to the first use of it within a POU, and at every subsequent cycle. |
Failure to follow these instructions can result in death, serious injury, or equipment damage. |
NOTE: POINTER TO variables of functions and methods should not be returned to the caller of this function or passed to global variables.