Siemens SIMATIC S7 System Manual page 376

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Program instructions
7.16 Table
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
376
Create table with 20 entries start-
ing with memory location 4.
On the first scan, define the
maximum length of the table.
Reset table with input I0.0.
On the rising edge of I0.0, fill
memory locations from VW2
with "+0".
Write value to table with input I0.1.
On the rising edge of I0.1, copy
value of memory location
VW100 to table.
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.
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.
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.
System Manual, V2.3, 07/2017, A5E03822230-AF
STL
Network 1
LD SM0.1
MOVW +20, VW0
Network 2
LD I0.0
EU
FILL +0, VW2, 21
Network 3
LD I0.1
EU
ATT VW100, VW0
Network 4
LD I0.2
EU
LIFO VW0, VW102
Network 5
LD I0.3
EU
FIFO VW0, VW104
Network 6
LD I0.4
EU
MOVW +0, VW106
FND= VW2, +10, VW106
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents