Communication via Function Blocks
6.4 Programming the Function Blocks
Point-to-point connection CP 440 Installation and Parameter Assignment
Manual, 09/2007, A5E00057742-03
105
Example 2
The symbol name of the data block used, DB 20, is "CP_DB"; the symbol name for the send
DB number is "SEND_DBNO" and is located in data block DB 20 in the data word DBW 0.
The start address of the send frame is "SEND_DWNO" and is located in the data block
DB 20 in DBW 2. The frame length is "SEND_LEN" and is located in the data block DB 20 in
DBW 4.
The variable used for the module address is the memory word "BGADR" (MW21), for the
DONE parameter the flag "SEND_DONE" (M26.0), for the ERROR parameter the memory
bit "SEND_ERROR" (M26.1), and for the STATUS parameter the memory word
"SEND_STATUS" (MW27).
The STL listings for the example are shown on the following page.
Example of an Absolutely Addressed Actual Operand
Calling FB 10 with absolutely addressed actual operands:
STL
Network 1:
CALL
FB 10, DB10
REQ
:= M 0.6
//Activates SEND
R
:= M 5.0
//Activates RESET
LADDR
:= MW21
//Basic address in MW21
DB_NO
:= DB20.DBW0
//DB no. in DBW0 of DB20
DBB_NO
:= DB20.DBW2
//From DBB no., located in DBW2 of DB20
LEN
:= DB20.DBW4
//Length located in DBW4 of DB20
DONE
:= M 26.0
//Terminated without error
ERROR
:= M 26.1
//Terminated with error
STATUS
:= MW 27
//Status word
长沙工控帮教育科技有限公司
www.gkbpx.com