EasyManuals Logo

Siemens Simatic S7 Series System Manual

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #107 background imageLoading...
Page #107 background image
Programming concepts
5.6 Variable table
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
107
To make an assignment in a variable table, follow the procedure below.
1. Ensure that the correct POU is displayed in the Program Editor window by clicking, if
necessary, on the tab of the desired POU. (Since every POU has its own variable table,
you need to make sure that you are making assignments to the correct POU.)
2. Display the variable table if it is not already visible by selecting "Variable Table" from the
Component drop-down list in the Windows area of the view menu.
3. Choose a row that has the right variable type for the kind of variable that you want to
define, and type a name for the variable in the Symbol field. If you are making an
assignment in OB1 or an interrupt routine, the variable table contains only TEMP
variables. If you are making an assignment in a subroutine, the variable table contains IN,
IN_OUT, OUT, and TEMP variables. Do not preface the name with a pound symbol in the
variable table. Pound symbols are only used to precede local variables in the program
code.
Note
Local variable names are permitted to contain a maximum of 23 alphanumeric characters
and underscores. They are also permitted to contain extended characters (ASCII 128 to
ASCII 255). The first character is restricted to alp
ha and extended characters only. It is
illegal to use keywords as symbolic names, or to use names that begin with a number or
contain characters that are not alphanumeric or in the extended character set.
Local variable names are downloaded and stored in C
PU memory. The use of longer
variable names may reduce the memory available to store your program.
4. Click the mouse pointer in the Data Type field and use the list box to select an
appropriate data type for the local variable.
Note
When you assign local variables as parameters for subroutines, you must ensure that the
data type that you assign to the local variable does not conflict with the operand being
used in the subroutine call.
5. Optionally provide a comment describing your local variable.
After you supply a value for the Symbol and Data Type fields, the Program Editor
automatically assigns an L memory address to the local variable.
Entering additional variables
The variable table displays a fixed number of rows for local variables. To add more rows to
the table, select a row in the table of the variable type that you want to add and click the
Insert button
in the variable table window. A new row is automatically generated above
the row you selected, and is for the same variable type that you selected.
You can also add rows by right-clicking an existing row and selecting
Insert > Row
or
Insert
> Row Below
from the context menu.

Table of Contents

Other manuals for Siemens Simatic S7 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens Simatic S7 Series and is the answer not in the manual?

Siemens Simatic S7 Series Specifications

General IconGeneral
CPUVaries by model (e.g., S7-300, S7-400, S7-1200, S7-1500)
Communication InterfacesPROFIBUS, PROFINET, Ethernet, MPI
ProgrammingTIA Portal, STEP 7
Programming LanguagesLAD, FBD, STL, SCL, GRAPH
I/O ModulesDigital, Analog, Specialty modules available
Operating Temperature0°C to 60°C (standard models)
MountingDIN rail mounting
Operating Voltage24V DC or 120/230V AC (varies by model)
Protection ClassIP20 (standard models)
MemoryVaries depending on the S7 model. Includes work memory (RAM) for program execution, load memory (EEPROM or Flash) for program storage, and system memory for operating system functions. Memory sizes range from kilobytes to megabytes.

Related product manuals