Manual VIPA System 200V
Chapter 3 Project engineering
HB97E - CP - Rev. 11/30
3-5
For the communication between CPU and CP 240 shown in the text below,
the following handling blocks are used:
FC 0 SEND
Data output CPU to CP 240
FC 1 RECEIVE
Receive data from CP 240
FC 9 SYNCHRON_RESET Synchronization between CPU and CP 240
The handling blocks are available as library and may be integrated into the
Siemens SIMATIC Manager like shown above.
A more detailed description of the handling blocks is to be found on the
following pages.
Your PLC program should be build-up with the following structure:
OB1:
CALL FC 9
//Call Synchron
ADR :=0
//1st DW in SEND/EMPF_DB
TIMER_NR :=T2
//Delay time Synchron
ANL :=M3.0
//Start-up running
NULL :=M3.1
//Interim flag
RESET :=M3.2
//Execute module reset
STEUERB_S :=MB2
//Control bits Send_FC
STEUERB_R :=MB1
//Control bits Receive_FC
U M 3.0
//as long as no start-up no
//SEND/RECEIVE
processing
BEB
CALL FC 1
//Receive data
ADR :=0
//1st DW in SEND/RECEIVE_DB
_DB :=DB11
//Receive_DB telegram
ABD :=W#16#14
//1st DW receive buffer (DW20)
ANZ :=MW10
//Amount of received data
EMFR :=M1.0
//Reception ready
PAFE :=MB12
//Error byte
GEEM :=MW100
//Internal data
ANZ_INT :=MW102
//Internal data
empf_laeuft :=M1.1
//Internal data
letzter_block:=M1.2
//Internal data
fehl_empf :=M1.3
//Internal data
U M 1.0
//Reception ready
R M 1.0
//delete reception ready
CALL FC 0
//Send data
ADR :=0
//1st DW in SEND/RECEIVE_DB
_DB :=DB10
//Send_DB telegram
ABD :=W#16#14
//1st DW send buffer (DW20)
ANZ :=MW14
//Amount of data to send
FRG :=M2.0
//Set send ready
PAFE :=MB16
//Error byte
GESE :=MW104
//Internal data
ANZ_INT :=MW106
//Internal data
ende_kom :=M2.1
//Internal data
letzter_block:=M2.2
//Internal data
senden_laeuft:=M2.3
//Internal data
fehler_kom :=M2.4
//Internal data
OB100:
UN M 3.0
S M 3.0
//Start-up CPU running
PLC program
Summary of Contents for CP 240 RS232
Page 1: ...Manual VIPA System 200V CP Order No VIPA HB97E_CP Rev 11 30...
Page 2: ...L...
Page 14: ...Chapter 1 Basics Manual VIPA System 200V 1 6 HB97E CP Rev 11 30...
Page 126: ...Chapter 5 CP 240 EnOcean Manual VIPA System 200V 5 32 HB97E CP Rev 11 30...
Page 144: ...Chapter 6 CP 240 M Bus Manual VIPA System 200V 6 18 HB97E CP Rev 11 30...
Page 148: ...Index Manual VIPA System 200V A 4 HB97E CP Rev 11 30 M Stich...