4 Data Exchange between User Program and AS−i Slaves
4.2.2
Accessing Binary Data of B Slaves
The following sample program illustrates access to the binary data of B slaves.
Table 4-2
STL
//Read in binary input data of the B slaves:
CALL SFC 59
REQ
:=TRUE
IOID
:=B#16#54
LADDR
:=W#16#100
RECNUM :=B#16#96
RET_VAL :=MW10
BUSY
:=M9.0
RECORD :=P#DB20.DBX16.0 Byte 16
//Examples: Binary access to B slaves:
A
DBX 17.4
S
DBX 49.6
A
DBX 17.0
R
DBX 49.6
//Output binary output data of the B slaves:
CALL SFC 58
REQ
:=TRUE
IOID
:=B#16#54
LADDR
:=W#16#100
RECNUM :=B#16#96
RECORD :=P#DB20.DBX48.0 Byte 16
RET_VAL :=MW12
BUSY
:=M9.1
46
Explanation
//RD_REC
//Permanent trigger
//Fixed value
//CP address (here 256 dec.)
//DSNR=150 (binary data B slaves)
//Dest. area binary data
//Slave 2B, terminal 1
//Slave 2B, terminal 3
//Slave 3B, terminal 1
//Slave 3B, terminal 3
//WR_REC
//Permanent trigger
//Fixed value
//CP address (here 256 dec.)
//DSNR=150 (binary data B slaves)
//Source area binary data
CP 343−2 / CP 343−2 P AS−Interface Master
Release 08/2008
C79000−G8976−C149−04