Beckhoff Automation GmbH & Co. KG TX1200 — 6.1 Global Variables

Resources Global variables Global variables can be declared as "normal" variables, constants or remanent variables that are known throughout the project. Creating a global variable list To create a new global variable list, select the entry ' Global variables ' in the Object Organizer at the Resources or a global variable list already created there. If you then select the command ' Project' 'Object' 'Insert ', the Global Variable List dialog opens. By the way, this dialog opens to display an already made configuration of the global variable list marked in the Object Organizer also with the command' Project' 'Object' 'Properties '.

Editing the lists for remanent global variables If it is supported by the runtime system, it is possible to work with remanent variables. There are two types of remanent global variables Persistent and retain variables are retained in the event of a controlled shutdown of the runtime system or an 'online' 'reset cold' or a download. Persistent variables are not automatically retain variables! Remanent variables additionally get the keyword RETAIN or PERSISTENT... Syntax: VAR_GLOBAL RETAIN (* Variablendeklarationen *) END_VAR VAR_GLOBAL PERSISTENT (* Variablendeklarationen *) END_VAR Global constants Global constants are additionally assigned the keyword CONSTANT . Syntax:

VAR_GLOBAL CONSTANT (* Variablendeklarationen *) END_VAR Variable configuration In function blocks, addresses for inputs and outputs can be specified for variables defined between the keywords VAR and END_VAR which are not completely defined. Addresses that are not completely defined are marked with an asterisk. Sample: FUNCTION_BLOCK locio VAR loci AT %I*: BOOL := TRUE; loco AT %Q*: BOOL; END_VAR Two local I/O variables are defined here, a local-In (%I*) and a local-Out (%Q*). If you want to configure local I/Os, the object Variable_Configuration is available by default for variable configuration in the Object Organizer in the Resources tab.

The object can be renamed and additional objects can be created for the variable configuration. The variable configuration editor works like the declaration editor. Variables for local I/O configuration must be placed between the keywords VAR_CONFIG and END_VAR. The name of such a variable consists of a complete instance path, where the individual function block and instance names are separated by dots. The TX1200 162 Version: 1.3