Possible result of other programming environments - Manual - PLCopen XML - A command line tool to import PLCopen XML files as ST code. - PLCopen XML,tool

PLCopen XML CLI Tool (plcopen-xml)

Portfolio
SIMATIC AX
Product
PLCopen XML
Software version
1.0.8
Edition
05/2024
Language
English (original)
Package Name
@ax/plcopen-xml
// Source code example and possible behavior of other programming environments
VAR
  number_1 : INT := 123;
  number_2 : INT := 456;
  ref_1 : REFERENCE TO INT;
  ref_2 : REFERENCE TO INT;
END_VAR

ref_1 := ADR(number_1);
ref_2 := ADR(number_2);

ref_2 := ref_1; // ref_2^ = number_2 = number_1 = 123

The reference ref_2 still points to number_2, but the value of number_1 is copied to number_2.
With SIMATIC AX, using dereferenced references (e.g. ref_2^ := ref_1^;) gives the same result.