EasyManua.ls Logo

Siemens Simatic S7 Series

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
Loading...
Program instructions
7.16 Table
S7-200 SMART
334 System Manual, 09/2015, A5E03822230-AC
To search the table, the index (VW106) must set to 0 before doing the find. If a match is
found, the index will have the table entry number, but if no match is found, the index will
match the current entry count for the table (VW2).
LAD
STL
Create table with 20 entries start-
ing with memory location 4.
On the first scan, define the
maximum length of the table.
Network 1
LD SM0.1
MOVW +20, VW0
Reset table with input I0.0.
On the rising edge of I0.0, fill
memory locations from VW2
with "+0".
Network 2
LD I0.0
EU
FILL +0, VW2, 21
Write value to table with input I0.1.
On the rising edge of I0.1, copy
value of memory location
VW100 to table.
Network 3
LD I0.1
EU
ATT VW100, VW0
Read last table value with input
I0.2.
Move the last table value to
location VW102. This reduces
the number of entries. On the
rising edge of I0.2, move last
table value to VW102.
Network 4
LD I0.2
EU
LIFO VW0, VW102
Read first table value with input
I0.3.
Move the first table value to
location VW104. This reduces
the number of entries. On the
rising edge of I0.3, move first
table value to VW104.
Network 5
LD I0.3
EU
FIFO VW0, VW104
Search table for the first location
that has a value of 10.
On the rising edge of I0.4, reset
index pointer.
Find a table entry that equals
10.
Network 6
LD I0.4
EU
MOVW +0, VW106
FND= VW2, +10, VW106

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals