Method for controlling an automation system with visualization of program objects of a control program of an automation system, wherein a controller of the automation system comprises a control program, wherein a program state of the control program is stored in a first memory area of the controller, wherein the program state comprises a plurality of program objects of the control program, wherein the program objects are arranged relative to one another in a predetermined arrangement structure of the program state, wherein a memory position and a memory size are assigned to each program object by way of the arrangement structure, wherein a memory position of a program object defines a number of memory locations separating a program object stored in a memory area of a first memory location of the program state, wherein a memory size of a program object defines a number of memory locations occupied by a memory object in a memory area, wherein the program state comprises at least one pointer element, wherein a pointer object is referenced by the pointer element, wherein the pointer object is a program object of the control program, wherein a stack of the control program is set up in a second memory area of the controller, and wherein program objects are storable in the stack during a runtime of the control program, comprising: executing the control program in an executing step; ascertaining a pointer address of the pointer element in a pointer address ascertaining step, wherein the pointer address corresponds to a memory address referenced by the pointer element; checking whether the pointer address of the pointer element is arranged in the first memory area of the program state or in the second memory area of the stack, in a checking step, characterized by, if the pointer address of the pointer element is arranged in the first memory area of the program state determining a first address offset of the pointer address of the pointer element in a first address offset determining step, wherein the first address offset defines a number of memory locations separating the pointer address of the pointer element from a first memory address of the program state in the first memory area; identifying a program object separated from the first memory location of the program state by the first address offset in accordance with the arrangement structure of the program state as a first program object, the memory address of which in the first memory area corresponds to the pointer address of the pointer element, in a first program object identifying step; identifying the first program object with the pointer object referenced by the pointer element in a pointer object identifying step; determining a fully qualified designation of the identified pointer object in a full designation determining step, wherein the fully qualified designation of the identified pointer object comprises a name of the identified first program object; and displaying the fully qualified designation of the pointer object referenced by the pointer element on a display element connected to the controller in a displaying step. executing the control program in an executing step; ascertaining a pointer address of the pointer element in a pointer address ascertaining step, wherein the pointer address corresponds to a memory address referenced by the pointer element; checking whether the pointer address of the pointer element is arranged in the first memory area of the program state or in the second memory area of the stack, in a checking step, characterized by, if the pointer address of the pointer element is arranged in the first memory area of the program state determining a first address offset of the pointer address of the pointer element in a first address offset determining step, wherein the first address offset defines a number of memory locations separating the pointer address of the pointer element from a first memory address of the program state in the first memory area; identifying a program object separated from the first memory location of the program state by the first address offset in accordance with the arrangement structure of the program state as a first program object, the memory address of which in the first memory area corresponds to the pointer address of the pointer element, in a first program object identifying step; identifying the first program object with the pointer object referenced by the pointer element in a pointer object identifying step; determining a fully qualified designation of the identified pointer object in a full designation determining step, wherein the fully qualified designation of the identified pointer object comprises a name of the identified first program object; and displaying the fully qualified designation of the pointer object referenced by the pointer element on a display element connected to the controller in a displaying step.