
120 Publication LOGIX-AP008B-EN-P - June 2008
Chapter 4 Conversion of Typical Program Structures
Other Topics Related to
Programming
Scope of Variables
This is an area where Logix differs considerably from STEP 7.
Rules for STEP 7
• Temporary variables are invisible outside the block in which they are
declared.
• Global static variables are visible throughout the program.
• Static variables that are declared as instance data to a function block have a
special status in the FB, but they can be accessed from other parts of the
program.
Rules for Logix
Execution in Logix is divided into Tasks. Each Task may have several
Programs and each Program may have several Routines. Each Program may
have its own tag section.
• Controller scope tags are visible throughout all Routines in all Programs.
• Program scope tags are visible only in the Routines in the Program in
which they are defined. This means that if a routine in one Program is to
share data with a routine in another Program, it must use Controller scope
data.
• Add-On Instruction Local Tags are only visible to that Add-On
Instruction's logic.
OBs, Tasks, and Scheduling
Organization Blocks, Tasks and Scheduling are described in Chapter 2.
Commentaires sur ces manuels