EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 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...
Basic instructions
8.6 Move operations
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
281
8.6.8
Read / Write memory instructions
8.6.8.1
PEEK and POKE (SCL only)
SCL provides PEEK and POKE instructions that allow you to read from or write to data
blocks, I/O, or memory. You provide parameters for specific byte offsets or bit offsets for the
operation.
Note
To use the PEEK and POKE instructions with data blocks, you mu
st use standard (not
optimized) data blocks. Also note that the PEEK and POKE instructions merely transfer data.
They have no knowledge of data types at the addresses.
PEEK(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_);
Reads the b
yte referenced by byteOffset of
the referenced data block, I/O or memory
area.
Example referencing data block:
%MB100 := PEEK(area:=16#84,
dbNumber:=1, byteOffset:=#i);
Example referencing IB3 input:
%MB100 := PEEK(area:=16#81,
dbNumber:=0, byteOffset:=#i); // when
#i = 3
PEEK_WORD(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_);
Reads the word referenced by byteOffset of
the referenced data block, I/O or memory
area.
Example:
%MW200 := PEEK_WORD(area:=16#84,
dbNumber:=1, byteOffset:=#i);
PEEK_DWORD(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_);
Reads the double word referenced by
byteOffset of the referenced data block, I/O or
memory area.
Example:
%MD300 := PEEK_DWORD(area:=16#84,
dbNumber:=1, byteOffset:=#i);
PEEK_BOOL(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_,
bitOffset:=_in_);
Reads a Boolean referenced by the bitOffset
and byteOffset of the referenced data block,
I/O or memory area
Example:
%MB100.0 := PEEK_BOOL(area:=16#84,
dbNu
mber:=1, byteOffset:=#ii,
bitOffset:=#j);

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals