Siemens NAN 67 Series Wartungshandbuch Seite 33

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 318
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 32
3-9
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
To enter an array as a data type, enter the name in the “Symbol” column and
the keyword ARRAY in the cell for the data type together with the array size,
for example array [1..20, 3..24] for a two-dimensional array. Press the
TAB
key (if necessary, more than once) to insert a row in which you can enter the
data type of the array.
If you want to select an array, click the address cell in the relevant row.
Initial values for each array element can be entered singly or with a repetition
factor (see Figure 3-4):
S Individual entry: You assign each element its own initial value. The
values are separated by commas.
S Repetition factor: The same initial value can be assigned to several
elements. The value itself is shown in parentheses and is preceded by the
repetition factor which defines the number of elements.
Figure 3-4 shows an example of a variable declaration table:
TRAFFIC\...\FB50 - <Offline>
Address Decl. Symbol Data Type Initial Value Comment
structur1
var1
var2
STRUCT
BOOL
INT
FALSE
0
in
in
in
in
in
0.0
+0.0
+2.0
+4.0
=6.0
var3 WORD
array1 ARRAY[1..20,1..40]in6.0
BOOL
TRUE
in*2.0
W#16#0
END_STRUCT
Figure 3-4 Structures and Arrays in a Variable Declaration Table
Note
If you make changes to the variable declaration of blocks whose calls you
have already programmed, time stamp conflicts may occur. You should
therefore first program all blocks to be called, and then program the blocks
that call them. In the case of function blocks, instance DBs should also be
re-created.
When making changes to a UDT which was entered as a data type in a
variable declaration, check the variable declaration of the block and then
save it again.
Entering Arrays
Example
Creating Logic Blocks
Seitenansicht 32
1 2 ... 28 29 30 31 32 33 34 35 36 37 38 ... 317 318

Kommentare zu diesen Handbüchern

Keine Kommentare