S5-115U Manual
12.5.5 Sample Program for Transmitting Data
In the restart routine, the parameters for the communications link are passed to system data
words 46 and 48 to 55 via a programmable function block (FB220).
The parameters for the communications link are as follows:
•
Parameter set in DB202, beginning with DW 0
•
Send mailbox in DB203, beginning with DW 0
•
Receive mailbox in DB204, beginning with DW 0
•
The CBS is flag byte FY 100
•
The CBR is flag byte FY 101
•
The mode setting is: Mode 2 (with BCC)
The data to be transferred is in data words DW 1 to DW 5 of DB203. The frame length specifi-
cation must therefore be 10 bytes.
The example describes the program for a remote node, i.e. for a "partner in the link". It can also
be used for a remote CPU 944 when that CPU's priority (DB202, DW 3) is changed to "low".
OB21/OB22 STL
:
:JU
FB 220
NAME :PA-3964
TPAR :
KS DB
NPAR :
KY 202,0
TSMB :
KS DB
NSMB :
KY 203,0
TRMB :
KS DB
NRMB :
KY 204,0
TCBS :
KS FY
NCBS :
KY 100,0
TCBR :
KS FY
NCBR :
KY 101,0
MODE :
KF +2
:
:AN
F
101.7
:S
F
101.7
:BE
EWA 4NEB 811 6130-02b
Communications Capabilities
Description
INITIALIZE SYSTEM DATA AREA
FOR COMMUNICATIONS LINK
PARAMETER LIST FOR COMMUNICATIONS LINK
IS LOCATED IN DB202 BEGINNING DW0
THE SEND MAILBOX IS LOCATED IN
DB203 BEGINNING DW0
THE RECEIVE MAILBOX IS LOCATED IN
DB204 BEGINNING DW0
THE COORDINATION BYTE FOR
SEND IS FLAG BYTE FY100
THE COORDINATION BYTE FOR
RECEIVE IS FLAG BYTE FY101
MODE NUMBER: 2 (WITH BCC)
RECEIVE ENABLE
12-53