Вы находитесь на странице: 1из 21

Handling Blocks in S5

SIMATIC S5 Programmable Logic Control System demands such as operating monitoring or bus links are supported by specific modules. The exchange of data between CPU and CP is carried out by handling blocks. Handling blocks are basically Function Blocks (FB) which can be parameterized by the user.

CPU & CP LINK


CPU STEP5 Prog Handling Blocks Communication Processor CP Data

Configuration
The CPU accesses I/O modules via SIMATIC S5 BUS, similarly data exchange is via handling blocks. Information transfer via DUAL PORT RAM of CP. CP (Interface called SSNR) would access the Dual Port Ram.

Configuration example
CP1 Interface 0 Dual Port RAM CP2 Interface 1 Dual Port RAM

SIMATIC S5 BUS

CPU

I/Os I/Os

Function Blocks
FB 120 FB 121 FB 122 FB 123 FB 124 FB 125 FB 126 FB 127 SEND RECEIVE FETCH CONTROL RESET SYNCHRON SEND A REC - A

Initializing an Interface
Each Interface must be initialised by means of SYNCHRON. This includes amongst other activities, the erasing / pre-programming of the Dual port RAM. Block can be called during warm / cold restart (OB20, OB21, OB 22)

Parameters
Parameter SSNR A-NR ANZW BLGR QTYP/ZTYP DBNR QANF/ZANF QLAE/ZLAE PAFE Type D D I D D D D D Q Data KY KY W KY KS KY KF KF BY Meaning Interface Number Job Number Condition Codeword Field Size Type of data source / Destination Data Block Number Relative Start Address Length of data Parameter assignment error

SSNR Interface No.


Permissible Number 0,0 0,255 (direct parameter assignment) 1.0 255,255 (Indirect parameter assign) High Byte = 0 : direct parameter Low Byte =SSNR. High Byte >< 0 : Indirect parameter ; Low Byte = Pointer

A-NR Job Number


Permissible Area 0,0 (ALL) 0,1 0,223 (Direct) The Job Number addressed on the interface. Under the same number a program parameter set is located on the interface, through which the function of CP will be defined.

ANZW Condition Code


Permissible Area : FW0 252 or DW 0 254 Address of the condition codeword, in which either the processing of the job specified under A-NR will be displayed to User (DIRECT) or Job Number (All) In case of DW parameter a DB call must precede.

BLGR Field Size


Permissible Area : 0,0 0,255 The maximum Number of bytes which can be transferred by one SEND or REC block is called field size. If data is more than field size then as many blocks must be called to complete the transfer. The field size will be decided by SYNCHRON

PAFE Error Indication


Indicated possible problems
7 6 5 4 3 2 1 0

Error Number 0 = No error 1..F = Error (HEX)

=0, always deleted by handling block when PAFE byte is written 1= error, 0 = no error

QTYP/ZTYP, DBNR, QANF / ZANF, QLAE/ZLAE


QTYP Source Type DBNR Data Block Number QANF Source Start ALAE Source Length QANF = DW3 QLAE = 5 DW DB 17 3 5 DW0 DW1 DW2 DW3 DW4 DW5 DW6 DW7 DW8 DW9

SEND FB 120
SEND SSNR A-NR ANZW QTYP DBNR QANF QLAE PAFE

SEND-A FB 126
SEND-A SSNR A-NR ANZW PAFE

RECEIVE FB 121
RECEIVE SSNR A-NR ANZW ZTYP DBNR ZANF ZLAE PAFE

REC-A FB127
REC-A SSNR A-NR ANZW PAFE

FETCH FB 122
FETCH SSNR A-NR ANZW ZTYP DBNR ZANF ZLAE PAFE

CONTROL FB123
CONTROL SSNR A-NR ANZW PAFE

RESET FB124
RESET SSNR A-NR PAFE

SYNCHRON FB125
SYNCHRON SSNR BLGR PAFE

Вам также может понравиться