Siemens SIMATIC S7 System Manual page 150

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

99BProgramming concepts
6.5 Programming language
Symbolic addressing
"PLC_Tag_1"
"Data_block_1".Tag_1
"Data_block_1".MyArray[#i]
Indexed addressing with PEEK and POKE instructions
SCL also provides PEEK and POKE instructions to allow you to read from or write to data
areas with variables that provide specific byte offsets or bit offsets for the operation.
PEEK(area:=_in_,
PEEK_WORD(area:=_in_,
PEEK_DWORD(area:=_in_,
PEEK_BOOL(area:=_in_,
POKE(area:=_in_,
150
dbNumber:=_in_,
byteOffset:=_in_);
dbNumber:=_in_,
byteOffset:=_in_);
dbNumber:=_in_,
byteOffset:=_in_);
dbNumber:=_in_,
byteOffset:=_in_,
bitOffset:=_in_);
dbNumber:=_in_,
byteOffset:=_in_,
value:=_in_);
Tag in PLC tag table
Tag in a data block
Array element in a data block array
Reads the byte referenced by byteOffset of
the referenced data block, I/O or memory
area.
Example: MB100 := PEEK(area:=16#84,
dbNumber:=1, byteOffset:=#i);
Reads the word referenced by byteOffset of
the referenced data block, I/O or memory
area.
Example: MW200 := PEEK(area:=16#84,
dbNumber:=1, byteOffset:=#i);
Reads the double word referenced by
byteOffset of the referenced data block, I/O or
memory area.
Example: MW200 := PEEK(area:=16#84,
dbNumber:=1, byteOffset:=#i);
Reads a Boolean referenced by the bitOffset
and byteOffset of the referenced data block,
I/O or memory area
Example: MB100.0 := PEEK(area:=16#84,
dbNumber:=1, byteOffset:=#ii, bitOffset:=#j);
Writes the value to the referenced byteOffset
of the referenced data block, I/O or memory
area
Example: POKE(area:=16#84, dbNumber:=2,
byteOffset:=3, value:="Tag_1");
System Manual, 11/2011, A5E02486680-05
S7-1200 Programmable controller

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents