AT DeclarationΒΆ

In the variables declaration, the AT code assigns a project variable to a specific input address, output address or memory address of the controller that is configured in the device tree. You can also define the assignment of variables to an address in the I/O Mapping dialog box of the device in the controller configuration.

Syntax:

<identifier> AT <address>:<data type>;

This declaration allows you to give an informative name to the address. You can make any necessary changes for the input or output signals at just one location, for example in the declaration.

If you assign a variable to an address, please note the following:

  • You cannot write to variables that are placed at inputs because this will cause compile errors.
  • You can perform AT declarations only for local and global variables, not for input/output variables of POUs.
  • AT declarations cannot be used in persistent variable lists.
  • If you use AT declarations for structure or function block components, then all instances use the same memory. This is just like using static variables in classic programming languages, such as C.
  • The memory layout of structures also depends on the target system.

See also