Table Instructions; Add To Table - Siemens SIMATIC S7-200 System Manual

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Table Instructions

Add To Table

The Add To Table instruction adds word values (DATA) to a
table (TBL). The first value of the table is the maximum table
length (TL). The second value is the entry count (EC), which
specifies the number of entries in the table. New data are
added to the table after the last entry. Each time new data
are added to the table, the entry count is incremented.
A table can have up to 100 data entries.
Error conditions that set ENO = 0
H SM1.4 (table overflow)
H 0006 (indirect address)
H 0091 (operand out of range)
SM bits affected:
H SM1.4 is set to 1 if you try to overfill the table
Table 6-68
Valid Operands for the Table Instructions
Inputs/Outputs
DATA
TBL
Example: Add to Table Instruction
Data Types
Operands
INT
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AIW, *VD, *LD, *AC, Constant
WORD
IW, QW, VW, MW, SMW, SW, T, C, LW, *VD, *LD, *AC
Before execution of ATT
VW100
1234
VW200
0006
TL (max. no. of entries)
VW202
0002
EC (entry count)
VW204
5431
d0 (data 0)
VW206
8942
d1 (data 1)
VW208
xxxx
VW210
xxxx
VW212
xxxx
VW214
xxxx
S7-200 Instruction Set
Network 1
//Load maximum table length
LD
SM0.1
MOVW
+6, VW200
Network 2
LD
I0.0
ATT
VW100, VW200
After execution of ATT
VW200
0006
VW202
0003
VW204
5431
VW206
8942
VW208
1234
VW210
xxxx
VW212
xxxx
VW214
xxxx
Chapter 6
TL (max. no. of entries)
EC (entry count)
d0 (data 0)
d1 (data 1)
d2 (data 2)
189

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents